@agent-plan/server 0.2.19-next.7 → 0.2.19-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +84 -17
- package/package.json +2 -2
- package/web-ui-dist/assets/index-Bp9VqCa6.css +1 -0
- package/web-ui-dist/assets/index-CWwCyVYf.js +211 -0
- package/web-ui-dist/index.html +2 -2
- package/web-ui-dist/assets/index-BQmx1zqk.js +0 -211
- package/web-ui-dist/assets/index-Jy8Yy6I4.css +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
var jS=Object.defineProperty;var DS=(t,a,r)=>a in t?jS(t,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[a]=r;var mn=(t,a,r)=>DS(t,typeof a!="symbol"?a+"":a,r);function CS(t,a){for(var r=0;r<a.length;r++){const i=a[r];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in t)){const o=Object.getOwnPropertyDescriptor(i,u);o&&Object.defineProperty(t,u,o.get?o:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function r(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(u){if(u.ep)return;u.ep=!0;const o=r(u);fetch(u.href,o)}})();function AS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xf={exports:{}},eu={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Fv;function OS(){if(Fv)return eu;Fv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(i,u,o){var f=null;if(o!==void 0&&(f=""+o),u.key!==void 0&&(f=""+u.key),"key"in u){o={};for(var m in u)m!=="key"&&(o[m]=u[m])}else o=u;return u=o.ref,{$$typeof:t,type:i,key:f,ref:u!==void 0?u:null,props:o}}return eu.Fragment=a,eu.jsx=r,eu.jsxs=r,eu}var Iv;function MS(){return Iv||(Iv=1,Xf.exports=OS()),Xf.exports}var d=MS(),Pf={exports:{}},We={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Gv;function kS(){if(Gv)return We;Gv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),E=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=E&&D[E]||D["@@iterator"],typeof D=="function"?D:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,T={};function L(D,q,ne){this.props=D,this.context=q,this.refs=T,this.updater=ne||N}L.prototype.isReactComponent={},L.prototype.setState=function(D,q){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,q,"setState")},L.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function X(){}X.prototype=L.prototype;function Y(D,q,ne){this.props=D,this.context=q,this.refs=T,this.updater=ne||N}var Q=Y.prototype=new X;Q.constructor=Y,O(Q,L.prototype),Q.isPureReactComponent=!0;var K=Array.isArray;function W(){}var U={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function oe(D,q,ne){var ce=ne.ref;return{$$typeof:t,type:D,key:q,ref:ce!==void 0?ce:null,props:ne}}function me(D,q){return oe(D.type,q,D.props)}function ye(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Re(D){var q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return q[ne]})}var ee=/\/+/g;function be(D,q){return typeof D=="object"&&D!==null&&D.key!=null?Re(""+D.key):q.toString(36)}function Ee(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(W,W):(D.status="pending",D.then(function(q){D.status==="pending"&&(D.status="fulfilled",D.value=q)},function(q){D.status==="pending"&&(D.status="rejected",D.reason=q)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function z(D,q,ne,ce,Te){var Ne=typeof D;(Ne==="undefined"||Ne==="boolean")&&(D=null);var Ue=!1;if(D===null)Ue=!0;else switch(Ne){case"bigint":case"string":case"number":Ue=!0;break;case"object":switch(D.$$typeof){case t:case a:Ue=!0;break;case x:return Ue=D._init,z(Ue(D._payload),q,ne,ce,Te)}}if(Ue)return Te=Te(D),Ue=ce===""?"."+be(D,0):ce,K(Te)?(ne="",Ue!=null&&(ne=Ue.replace(ee,"$&/")+"/"),z(Te,q,ne,"",function(tt){return tt})):Te!=null&&(ye(Te)&&(Te=me(Te,ne+(Te.key==null||D&&D.key===Te.key?"":(""+Te.key).replace(ee,"$&/")+"/")+Ue)),q.push(Te)),1;Ue=0;var it=ce===""?".":ce+":";if(K(D))for(var Ge=0;Ge<D.length;Ge++)ce=D[Ge],Ne=it+be(ce,Ge),Ue+=z(ce,q,ne,Ne,Te);else if(Ge=S(D),typeof Ge=="function")for(D=Ge.call(D),Ge=0;!(ce=D.next()).done;)ce=ce.value,Ne=it+be(ce,Ge++),Ue+=z(ce,q,ne,Ne,Te);else if(Ne==="object"){if(typeof D.then=="function")return z(Ee(D),q,ne,ce,Te);throw q=String(D),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ue}function B(D,q,ne){if(D==null)return D;var ce=[],Te=0;return z(D,ce,"","",function(Ne){return q.call(ne,Ne,Te++)}),ce}function ie(D){if(D._status===-1){var q=D._result;q=q(),q.then(function(ne){(D._status===0||D._status===-1)&&(D._status=1,D._result=ne)},function(ne){(D._status===0||D._status===-1)&&(D._status=2,D._result=ne)}),D._status===-1&&(D._status=0,D._result=q)}if(D._status===1)return D._result.default;throw D._result}var de=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},pe={map:B,forEach:function(D,q,ne){B(D,function(){q.apply(this,arguments)},ne)},count:function(D){var q=0;return B(D,function(){q++}),q},toArray:function(D){return B(D,function(q){return q})||[]},only:function(D){if(!ye(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return We.Activity=b,We.Children=pe,We.Component=L,We.Fragment=r,We.Profiler=u,We.PureComponent=Y,We.StrictMode=i,We.Suspense=p,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,We.__COMPILER_RUNTIME={__proto__:null,c:function(D){return U.H.useMemoCache(D)}},We.cache=function(D){return function(){return D.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(D,q,ne){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ce=O({},D.props),Te=D.key;if(q!=null)for(Ne in q.key!==void 0&&(Te=""+q.key),q)!j.call(q,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&q.ref===void 0||(ce[Ne]=q[Ne]);var Ne=arguments.length-2;if(Ne===1)ce.children=ne;else if(1<Ne){for(var Ue=Array(Ne),it=0;it<Ne;it++)Ue[it]=arguments[it+2];ce.children=Ue}return oe(D.type,Te,ce)},We.createContext=function(D){return D={$$typeof:f,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:o,_context:D},D},We.createElement=function(D,q,ne){var ce,Te={},Ne=null;if(q!=null)for(ce in q.key!==void 0&&(Ne=""+q.key),q)j.call(q,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(Te[ce]=q[ce]);var Ue=arguments.length-2;if(Ue===1)Te.children=ne;else if(1<Ue){for(var it=Array(Ue),Ge=0;Ge<Ue;Ge++)it[Ge]=arguments[Ge+2];Te.children=it}if(D&&D.defaultProps)for(ce in Ue=D.defaultProps,Ue)Te[ce]===void 0&&(Te[ce]=Ue[ce]);return oe(D,Ne,Te)},We.createRef=function(){return{current:null}},We.forwardRef=function(D){return{$$typeof:m,render:D}},We.isValidElement=ye,We.lazy=function(D){return{$$typeof:x,_payload:{_status:-1,_result:D},_init:ie}},We.memo=function(D,q){return{$$typeof:g,type:D,compare:q===void 0?null:q}},We.startTransition=function(D){var q=U.T,ne={};U.T=ne;try{var ce=D(),Te=U.S;Te!==null&&Te(ne,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(W,de)}catch(Ne){de(Ne)}finally{q!==null&&ne.types!==null&&(q.types=ne.types),U.T=q}},We.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},We.use=function(D){return U.H.use(D)},We.useActionState=function(D,q,ne){return U.H.useActionState(D,q,ne)},We.useCallback=function(D,q){return U.H.useCallback(D,q)},We.useContext=function(D){return U.H.useContext(D)},We.useDebugValue=function(){},We.useDeferredValue=function(D,q){return U.H.useDeferredValue(D,q)},We.useEffect=function(D,q){return U.H.useEffect(D,q)},We.useEffectEvent=function(D){return U.H.useEffectEvent(D)},We.useId=function(){return U.H.useId()},We.useImperativeHandle=function(D,q,ne){return U.H.useImperativeHandle(D,q,ne)},We.useInsertionEffect=function(D,q){return U.H.useInsertionEffect(D,q)},We.useLayoutEffect=function(D,q){return U.H.useLayoutEffect(D,q)},We.useMemo=function(D,q){return U.H.useMemo(D,q)},We.useOptimistic=function(D,q){return U.H.useOptimistic(D,q)},We.useReducer=function(D,q,ne){return U.H.useReducer(D,q,ne)},We.useRef=function(D){return U.H.useRef(D)},We.useState=function(D){return U.H.useState(D)},We.useSyncExternalStore=function(D,q,ne){return U.H.useSyncExternalStore(D,q,ne)},We.useTransition=function(){return U.H.useTransition()},We.version="19.2.7",We}var Xv;function zh(){return Xv||(Xv=1,Pf.exports=kS()),Pf.exports}var v=zh();const rn=AS(v),_S=CS({__proto__:null,default:rn},[v]);var Qf={exports:{}},tu={},Kf={exports:{}},Zf={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Pv;function LS(){return Pv||(Pv=1,(function(t){function a(z,B){var ie=z.length;z.push(B);e:for(;0<ie;){var de=ie-1>>>1,pe=z[de];if(0<u(pe,B))z[de]=B,z[ie]=pe,ie=de;else break e}}function r(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var B=z[0],ie=z.pop();if(ie!==B){z[0]=ie;e:for(var de=0,pe=z.length,D=pe>>>1;de<D;){var q=2*(de+1)-1,ne=z[q],ce=q+1,Te=z[ce];if(0>u(ne,ie))ce<pe&&0>u(Te,ne)?(z[de]=Te,z[ce]=ie,de=ce):(z[de]=ne,z[q]=ie,de=q);else if(ce<pe&&0>u(Te,ie))z[de]=Te,z[ce]=ie,de=ce;else break e}}return B}function u(z,B){var ie=z.sortIndex-B.sortIndex;return ie!==0?ie:z.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var p=[],g=[],x=1,b=null,E=3,S=!1,N=!1,O=!1,T=!1,L=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function Q(z){for(var B=r(g);B!==null;){if(B.callback===null)i(g);else if(B.startTime<=z)i(g),B.sortIndex=B.expirationTime,a(p,B);else break;B=r(g)}}function K(z){if(O=!1,Q(z),!N)if(r(p)!==null)N=!0,W||(W=!0,Re());else{var B=r(g);B!==null&&Ee(K,B.startTime-z)}}var W=!1,U=-1,j=5,oe=-1;function me(){return T?!0:!(t.unstable_now()-oe<j)}function ye(){if(T=!1,W){var z=t.unstable_now();oe=z;var B=!0;try{e:{N=!1,O&&(O=!1,X(U),U=-1),S=!0;var ie=E;try{t:{for(Q(z),b=r(p);b!==null&&!(b.expirationTime>z&&me());){var de=b.callback;if(typeof de=="function"){b.callback=null,E=b.priorityLevel;var pe=de(b.expirationTime<=z);if(z=t.unstable_now(),typeof pe=="function"){b.callback=pe,Q(z),B=!0;break t}b===r(p)&&i(p),Q(z)}else i(p);b=r(p)}if(b!==null)B=!0;else{var D=r(g);D!==null&&Ee(K,D.startTime-z),B=!1}}break e}finally{b=null,E=ie,S=!1}B=void 0}}finally{B?Re():W=!1}}}var Re;if(typeof Y=="function")Re=function(){Y(ye)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,be=ee.port2;ee.port1.onmessage=ye,Re=function(){be.postMessage(null)}}else Re=function(){L(ye,0)};function Ee(z,B){U=L(function(){z(t.unstable_now())},B)}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(z){z.callback=null},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return E},t.unstable_next=function(z){switch(E){case 1:case 2:case 3:var B=3;break;default:B=E}var ie=E;E=B;try{return z()}finally{E=ie}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(z,B){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ie=E;E=z;try{return B()}finally{E=ie}},t.unstable_scheduleCallback=function(z,B,ie){var de=t.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?de+ie:de):ie=de,z){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=ie+pe,z={id:x++,callback:B,priorityLevel:z,startTime:ie,expirationTime:pe,sortIndex:-1},ie>de?(z.sortIndex=ie,a(g,z),r(p)===null&&z===r(g)&&(O?(X(U),U=-1):O=!0,Ee(K,ie-de))):(z.sortIndex=pe,a(p,z),N||S||(N=!0,W||(W=!0,Re()))),z},t.unstable_shouldYield=me,t.unstable_wrapCallback=function(z){var B=E;return function(){var ie=E;E=B;try{return z.apply(this,arguments)}finally{E=ie}}}})(Zf)),Zf}var Qv;function zS(){return Qv||(Qv=1,Kf.exports=LS()),Kf.exports}var Jf={exports:{}},sa={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Kv;function US(){if(Kv)return sa;Kv=1;var t=zh();function a(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(p,g,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:p,containerInfo:g,implementation:x}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return sa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,sa.createPortal=function(p,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return o(p,g,null,x)},sa.flushSync=function(p){var g=f.T,x=i.p;try{if(f.T=null,i.p=2,p)return p()}finally{f.T=g,i.p=x,i.d.f()}},sa.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(p,g))},sa.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},sa.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var x=g.as,b=m(x,g.crossOrigin),E=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:E,fetchPriority:S}):x==="script"&&i.d.X(p,{crossOrigin:b,integrity:E,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},sa.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=m(g.as,g.crossOrigin);i.d.M(p,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(p)},sa.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,b=m(x,g.crossOrigin);i.d.L(p,x,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},sa.preloadModule=function(p,g){if(typeof p=="string")if(g){var x=m(g.as,g.crossOrigin);i.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(p)},sa.requestFormReset=function(p){i.d.r(p)},sa.unstable_batchedUpdates=function(p,g){return p(g)},sa.useFormState=function(p,g,x){return f.H.useFormState(p,g,x)},sa.useFormStatus=function(){return f.H.useHostTransitionStatus()},sa.version="19.2.7",sa}var Zv;function mx(){if(Zv)return Jf.exports;Zv=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(a){console.error(a)}}return t(),Jf.exports=US(),Jf.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Jv;function HS(){if(Jv)return tu;Jv=1;var t=zS(),a=zh(),r=mx();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(i(188))}function g(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(i(188));return n!==e?null:e}for(var l=e,s=n;;){var c=l.return;if(c===null)break;var h=c.alternate;if(h===null){if(s=c.return,s!==null){l=s;continue}break}if(c.child===h.child){for(h=c.child;h;){if(h===l)return p(c),e;if(h===s)return p(c),n;h=h.sibling}throw Error(i(188))}if(l.return!==s.return)l=c,s=h;else{for(var y=!1,w=c.child;w;){if(w===l){y=!0,l=c,s=h;break}if(w===s){y=!0,s=c,l=h;break}w=w.sibling}if(!y){for(w=h.child;w;){if(w===l){y=!0,l=h,s=c;break}if(w===s){y=!0,s=h,l=c;break}w=w.sibling}if(!y)throw Error(i(189))}}if(l.alternate!==s)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,E=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function Re(e){return e===null||typeof e!="object"?null:(e=ye&&e[ye]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case L:return"Profiler";case T:return"StrictMode";case K:return"Suspense";case W:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case Y:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case Q:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return n=e.displayName||null,n!==null?n:be(e.type)||"Memo";case j:n=e._payload,e=e._init;try{return be(e(n))}catch{}}return null}var Ee=Array.isArray,z=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},de=[],pe=-1;function D(e){return{current:e}}function q(e){0>pe||(e.current=de[pe],de[pe]=null,pe--)}function ne(e,n){pe++,de[pe]=e.current,e.current=n}var ce=D(null),Te=D(null),Ne=D(null),Ue=D(null);function it(e,n){switch(ne(Ne,n),ne(Te,e),ne(ce,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hv(n),e=mv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ce),ne(ce,e)}function Ge(){q(ce),q(Te),q(Ne)}function tt(e){e.memoizedState!==null&&ne(Ue,e);var n=ce.current,l=mv(n,e.type);n!==l&&(ne(Te,e),ne(ce,l))}function pn(e){Te.current===e&&(q(ce),q(Te)),Ue.current===e&&(q(Ue),Ki._currentValue=ie)}var Rt,ut;function se(e){if(Rt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Rt=n&&n[1]||"",ut=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Rt+e+ut}var Ye=!1;function Ie(e,n){if(!e||Ye)return"";Ye=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(P){var G=P}Reflect.construct(e,[],le)}else{try{le.call()}catch(P){G=P}e.call(le.prototype)}}else{try{throw Error()}catch(P){G=P}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(P){if(P&&G&&typeof P.stack=="string")return[P.stack,G.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),y=h[0],w=h[1];if(y&&w){var A=y.split(`
|
|
44
|
+
`),F=w.split(`
|
|
45
|
+
`);for(c=s=0;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;for(;c<F.length&&!F[c].includes("DetermineComponentFrameRoot");)c++;if(s===A.length||c===F.length)for(s=A.length-1,c=F.length-1;1<=s&&0<=c&&A[s]!==F[c];)c--;for(;1<=s&&0<=c;s--,c--)if(A[s]!==F[c]){if(s!==1||c!==1)do if(s--,c--,0>c||A[s]!==F[c]){var J=`
|
|
46
|
+
`+A[s].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=s&&0<=c);break}}}finally{Ye=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?se(l):""}function It(e,n){switch(e.tag){case 26:case 27:case 5:return se(e.type);case 16:return se("Lazy");case 13:return e.child!==n&&n!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return se("Activity");default:return""}}function Dn(e){try{var n="",l=null;do n+=It(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
|
|
47
|
+
Error generating stack: `+s.message+`
|
|
48
|
+
`+s.stack}}var dn=Object.prototype.hasOwnProperty,Lt=t.unstable_scheduleCallback,Jt=t.unstable_cancelCallback,Yn=t.unstable_shouldYield,Vn=t.unstable_requestPaint,fe=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,nt=t.unstable_NormalPriority,mt=t.unstable_LowPriority,Gt=t.unstable_IdlePriority,an=t.log,Hn=t.unstable_setDisableYieldValue,sn=null,re=null;function St(e){if(typeof an=="function"&&Hn(e),re&&typeof re.setStrictMode=="function")try{re.setStrictMode(sn,e)}catch{}}var Mt=Math.clz32?Math.clz32:Tl,Jn=Math.log,Wn=Math.LN2;function Tl(e){return e>>>=0,e===0?32:31-(Jn(e)/Wn|0)|0}var Be=256,Xt=262144,qt=4194304;function vt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function zt(e,n,l){var s=e.pendingLanes;if(s===0)return 0;var c=0,h=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=s&134217727;return w!==0?(s=w&~h,s!==0?c=vt(s):(y&=w,y!==0?c=vt(y):l||(l=w&~e,l!==0&&(c=vt(l))))):(w=s&~h,w!==0?c=vt(w):y!==0?c=vt(y):l||(l=s&~e,l!==0&&(c=vt(l)))),c===0?0:n!==0&&n!==c&&(n&h)===0&&(h=c&-c,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:c}function Tt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Wt(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pt(){var e=qt;return qt<<=1,(qt&62914560)===0&&(qt=4194304),e}function Ut(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function dt(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,n,l,s,c,h){var y=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var w=e.entanglements,A=e.expirationTimes,F=e.hiddenUpdates;for(l=y&~l;0<l;){var J=31-Mt(l),le=1<<J;w[J]=0,A[J]=-1;var G=F[J];if(G!==null)for(F[J]=null,J=0;J<G.length;J++){var P=G[J];P!==null&&(P.lane&=-536870913)}l&=~le}s!==0&&bn(e,s,0),h!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=h&~(y&~n))}function bn(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Mt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function Cn(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-Mt(l),c=1<<s;c&n|e[s]&n&&(e[s]|=n),l&=~c}}function C(e,n){var l=n&-n;return l=(l&42)!==0?1:k(l),(l&(e.suspendedLanes|n))!==0?0:l}function k(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Z(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:Uv(e.type))}function ae(e,n){var l=B.p;try{return B.p=e,n()}finally{B.p=l}}var je=Math.random().toString(36).slice(2),ge="__reactFiber$"+je,De="__reactProps$"+je,we="__reactContainer$"+je,Oe="__reactEvents$"+je,_e="__reactListeners$"+je,Xe="__reactHandles$"+je,Ce="__reactResources$"+je,Ke="__reactMarker$"+je;function $e(e){delete e[ge],delete e[De],delete e[Oe],delete e[_e],delete e[Xe]}function Ht(e){var n=e[ge];if(n)return n;for(var l=e.parentNode;l;){if(n=l[we]||l[ge]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=Sv(e);e!==null;){if(l=e[ge])return l;e=Sv(e)}return n}e=l,l=e.parentNode}return null}function Je(e){if(e=e[ge]||e[we]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ot(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function rt(e){var n=e[Ce];return n||(n=e[Ce]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ct(e){e[Ke]=!0}var Qt=new Set,Fn={};function Sn(e,n){An(e,n),An(e+"Capture",n)}function An(e,n){for(Fn[e]=n,e=0;e<n.length;e++)Qt.add(n[e])}var On=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),In={},fa={};function tr(e){return dn.call(fa,e)?!0:dn.call(In,e)?!1:On.test(e)?fa[e]=!0:(In[e]=!0,!1)}function ea(e,n,l){if(tr(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+l)}}function ul(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+l)}}function Pe(e,n,l,s){if(s===null)e.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,""+s)}}function wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kt(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ta(e,n,l){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(y){l=""+y,h.call(this,y)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Mn(e){if(!e._valueTracker){var n=Kt(e)?"checked":"value";e._valueTracker=ta(e,n,""+e[n])}}function jl(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Kt(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}function Et(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var wa=/[\n"\\]/g;function Gn(e){return e.replace(wa,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Lr(e,n,l,s,c,h,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),n!=null?y==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+wt(n)):e.value!==""+wt(n)&&(e.value=""+wt(n)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),n!=null?jt(e,y,wt(n)):l!=null?jt(e,y,wt(l)):s!=null&&e.removeAttribute("value"),c==null&&h!=null&&(e.defaultChecked=!!h),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+wt(w):e.removeAttribute("name")}function fi(e,n,l,s,c,h,y,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Mn(e);return}l=l!=null?""+wt(l):"",n=n!=null?""+wt(n):l,w||n===e.value||(e.value=n),e.defaultValue=n}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=w?e.checked:!!s,e.defaultChecked=!!s,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Mn(e)}function jt(e,n,l){n==="number"&&Et(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ol(e,n,l,s){if(e=e.options,n){n={};for(var c=0;c<l.length;c++)n["$"+l[c]]=!0;for(l=0;l<e.length;l++)c=n.hasOwnProperty("$"+e[l].value),e[l].selected!==c&&(e[l].selected=c),c&&s&&(e[l].defaultSelected=!0)}else{for(l=""+wt(l),n=null,c=0;c<e.length;c++){if(e[c].value===l){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function qu(e,n,l){if(n!=null&&(n=""+wt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+wt(l):""}function Ja(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(i(92));if(Ee(s)){if(1<s.length)throw Error(i(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=wt(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),Mn(e)}function nr(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var Xc=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function cs(e,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,l):typeof l!="number"||l===0||Xc.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function ha(e,n,l){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,l!=null){for(var s in l)!l.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in n)s=n[c],n.hasOwnProperty(c)&&l[c]!==s&&cs(e,c,s)}else for(var h in n)n.hasOwnProperty(h)&&cs(e,h,n[h])}function zr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ds=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ma=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function en(e){return ma.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Ea=null;function Dl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cl=null,Cl=null;function hi(e){var n=Je(e);if(n&&(e=n.stateNode)){var l=e[De]||null;e:switch(e=n.stateNode,n.type){case"input":if(Lr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Gn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var c=s[De]||null;if(!c)throw Error(i(90));Lr(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===e.form&&jl(s)}break e;case"textarea":qu(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ol(e,!!l.multiple,n,!1)}}}var dl=!1;function mi(e,n,l){if(dl)return e(n,l);dl=!0;try{var s=e(n);return s}finally{if(dl=!1,(cl!==null||Cl!==null)&&(Co(),cl&&(n=cl,e=Cl,Cl=cl=null,hi(n),e)))for(n=0;n<e.length;n++)hi(e[n])}}function La(e,n){var l=e.stateNode;if(l===null)return null;var s=l[De]||null;if(s===null)return null;l=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(i(231,n,typeof l));return l}var Wa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pi=!1;if(Wa)try{var Al={};Object.defineProperty(Al,"passive",{get:function(){pi=!0}}),window.addEventListener("test",Al,Al),window.removeEventListener("test",Al,Al)}catch{pi=!1}var za=null,gi=null,fs=null;function Yu(){if(fs)return fs;var e,n=gi,l=n.length,s,c="value"in za?za.value:za.textContent,h=c.length;for(e=0;e<l&&n[e]===c[e];e++);var y=l-e;for(s=1;s<=y&&n[l-s]===c[h-s];s++);return fs=c.slice(e,1<s?1-s:void 0)}function hs(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ol(){return!0}function Vu(){return!1}function aa(e){function n(l,s,c,h,y){this._reactName=l,this._targetInst=c,this.type=s,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(l=e[w],this[w]=l?l(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ol:Vu,this.isPropagationStopped=Vu,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ol)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ol)},persist:function(){},isPersistent:Ol}),n}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=aa(Ml),Ur=b({},Ml,{view:0,detail:0}),Pc=aa(Ur),ar,Hr,Br,_l=b({},Ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ra,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!==Br&&(Br&&e.type==="mousemove"?(ar=e.screenX-Br.screenX,Hr=e.screenY-Br.screenY):Hr=ar=0,Br=e),ar)},movementY:function(e){return"movementY"in e?e.movementY:Hr}}),Fu=aa(_l),R=b({},_l,{dataTransfer:0}),I=aa(R),Se=b({},Ur,{relatedTarget:0}),ve=aa(Se),Fe=b({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),ue=aa(Fe),he=b({},Ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xe=aa(he),Qe=b({},Ml,{data:0}),at=aa(Qe),ze={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={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"},kt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function la(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=kt[e])?!!n[e]:!1}function ra(){return la}var pa=b({},Ur,{key:function(e){if(e.key){var n=ze[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=hs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ra,charCode:function(e){return e.type==="keypress"?hs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),En=aa(pa),un=b({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_t=aa(un),$r=b({},Ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ra}),fl=aa($r),Qc=b({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),Iu=aa(Qc),Gu=b({},_l,{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}),Kc=aa(Gu),Zc=b({},Ml,{newState:0,oldState:0}),Pb=aa(Zc),Qb=[9,13,27,32],Jc=Wa&&"CompositionEvent"in window,vi=null;Wa&&"documentMode"in document&&(vi=document.documentMode);var Kb=Wa&&"TextEvent"in window&&!vi,xm=Wa&&(!Jc||vi&&8<vi&&11>=vi),bm=" ",Sm=!1;function wm(e,n){switch(e){case"keyup":return Qb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Em(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ms=!1;function Zb(e,n){switch(e){case"compositionend":return Em(n);case"keypress":return n.which!==32?null:(Sm=!0,bm);case"textInput":return e=n.data,e===bm&&Sm?null:e;default:return null}}function Jb(e,n){if(ms)return e==="compositionend"||!Jc&&wm(e,n)?(e=Yu(),fs=gi=za=null,ms=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return xm&&n.locale!=="ko"?null:n.data;default:return null}}var Wb={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 Nm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Wb[e.type]:n==="textarea"}function Rm(e,n,l,s){cl?Cl?Cl.push(s):Cl=[s]:cl=s,n=zo(n,"onChange"),0<n.length&&(l=new kl("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var yi=null,xi=null;function e0(e){iv(e,0)}function Xu(e){var n=ot(e);if(jl(n))return e}function Tm(e,n){if(e==="change")return n}var jm=!1;if(Wa){var Wc;if(Wa){var ed="oninput"in document;if(!ed){var Dm=document.createElement("div");Dm.setAttribute("oninput","return;"),ed=typeof Dm.oninput=="function"}Wc=ed}else Wc=!1;jm=Wc&&(!document.documentMode||9<document.documentMode)}function Cm(){yi&&(yi.detachEvent("onpropertychange",Am),xi=yi=null)}function Am(e){if(e.propertyName==="value"&&Xu(xi)){var n=[];Rm(n,xi,e,Dl(e)),mi(e0,n)}}function t0(e,n,l){e==="focusin"?(Cm(),yi=n,xi=l,yi.attachEvent("onpropertychange",Am)):e==="focusout"&&Cm()}function n0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xu(xi)}function a0(e,n){if(e==="click")return Xu(n)}function l0(e,n){if(e==="input"||e==="change")return Xu(n)}function r0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Na=typeof Object.is=="function"?Object.is:r0;function bi(e,n){if(Na(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var c=l[s];if(!dn.call(n,c)||!Na(e[c],n[c]))return!1}return!0}function Om(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mm(e,n){var l=Om(e);e=0;for(var s;l;){if(l.nodeType===3){if(s=e+l.textContent.length,e<=n&&s>=n)return{node:l,offset:n-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Om(l)}}function km(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?km(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function _m(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Et(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Et(e.document)}return n}function td(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var s0=Wa&&"documentMode"in document&&11>=document.documentMode,ps=null,nd=null,Si=null,ad=!1;function Lm(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ad||ps==null||ps!==Et(s)||(s=ps,"selectionStart"in s&&td(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Si&&bi(Si,s)||(Si=s,s=zo(nd,"onSelect"),0<s.length&&(n=new kl("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=ps)))}function qr(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var gs={animationend:qr("Animation","AnimationEnd"),animationiteration:qr("Animation","AnimationIteration"),animationstart:qr("Animation","AnimationStart"),transitionrun:qr("Transition","TransitionRun"),transitionstart:qr("Transition","TransitionStart"),transitioncancel:qr("Transition","TransitionCancel"),transitionend:qr("Transition","TransitionEnd")},ld={},zm={};Wa&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete gs.animationend.animation,delete gs.animationiteration.animation,delete gs.animationstart.animation),"TransitionEvent"in window||delete gs.transitionend.transition);function Yr(e){if(ld[e])return ld[e];if(!gs[e])return e;var n=gs[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in zm)return ld[e]=n[l];return e}var Um=Yr("animationend"),Hm=Yr("animationiteration"),Bm=Yr("animationstart"),i0=Yr("transitionrun"),u0=Yr("transitionstart"),o0=Yr("transitioncancel"),$m=Yr("transitionend"),qm=new Map,rd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");rd.push("scrollEnd");function el(e,n){qm.set(e,n),Sn(n,[e])}var Pu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ua=[],vs=0,sd=0;function Qu(){for(var e=vs,n=sd=vs=0;n<e;){var l=Ua[n];Ua[n++]=null;var s=Ua[n];Ua[n++]=null;var c=Ua[n];Ua[n++]=null;var h=Ua[n];if(Ua[n++]=null,s!==null&&c!==null){var y=s.pending;y===null?c.next=c:(c.next=y.next,y.next=c),s.pending=c}h!==0&&Ym(l,c,h)}}function Ku(e,n,l,s){Ua[vs++]=e,Ua[vs++]=n,Ua[vs++]=l,Ua[vs++]=s,sd|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function id(e,n,l,s){return Ku(e,n,l,s),Zu(e)}function Vr(e,n){return Ku(e,null,null,n),Zu(e)}function Ym(e,n,l){e.lanes|=l;var s=e.alternate;s!==null&&(s.lanes|=l);for(var c=!1,h=e.return;h!==null;)h.childLanes|=l,s=h.alternate,s!==null&&(s.childLanes|=l),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(c=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,c&&n!==null&&(c=31-Mt(l),e=h.hiddenUpdates,s=e[c],s===null?e[c]=[n]:s.push(n),n.lane=l|536870912),h):null}function Zu(e){if(50<Vi)throw Vi=0,vf=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var ys={};function c0(e,n,l,s){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ra(e,n,l,s){return new c0(e,n,l,s)}function ud(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ll(e,n){var l=e.alternate;return l===null?(l=Ra(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Vm(e,n){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Ju(e,n,l,s,c,h){var y=0;if(s=e,typeof e=="function")ud(e)&&(y=1);else if(typeof e=="string")y=pS(e,l,ce.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=Ra(31,l,n,c),e.elementType=oe,e.lanes=h,e;case O:return Fr(l.children,c,h,n);case T:y=8,c|=24;break;case L:return e=Ra(12,l,n,c|2),e.elementType=L,e.lanes=h,e;case K:return e=Ra(13,l,n,c),e.elementType=K,e.lanes=h,e;case W:return e=Ra(19,l,n,c),e.elementType=W,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:y=10;break e;case X:y=9;break e;case Q:y=11;break e;case U:y=14;break e;case j:y=16,s=null;break e}y=29,l=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Ra(y,l,n,c),n.elementType=e,n.type=s,n.lanes=h,n}function Fr(e,n,l,s){return e=Ra(7,e,s,n),e.lanes=l,e}function od(e,n,l){return e=Ra(6,e,null,n),e.lanes=l,e}function Fm(e){var n=Ra(18,null,null,0);return n.stateNode=e,n}function cd(e,n,l){return n=Ra(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Im=new WeakMap;function Ha(e,n){if(typeof e=="object"&&e!==null){var l=Im.get(e);return l!==void 0?l:(n={value:e,source:n,stack:Dn(n)},Im.set(e,n),n)}return{value:e,source:n,stack:Dn(n)}}var xs=[],bs=0,Wu=null,wi=0,Ba=[],$a=0,lr=null,hl=1,ml="";function zl(e,n){xs[bs++]=wi,xs[bs++]=Wu,Wu=e,wi=n}function Gm(e,n,l){Ba[$a++]=hl,Ba[$a++]=ml,Ba[$a++]=lr,lr=e;var s=hl;e=ml;var c=32-Mt(s)-1;s&=~(1<<c),l+=1;var h=32-Mt(n)+c;if(30<h){var y=c-c%5;h=(s&(1<<y)-1).toString(32),s>>=y,c-=y,hl=1<<32-Mt(n)+c|l<<c|s,ml=h+e}else hl=1<<h|l<<c|s,ml=e}function dd(e){e.return!==null&&(zl(e,1),Gm(e,1,0))}function fd(e){for(;e===Wu;)Wu=xs[--bs],xs[bs]=null,wi=xs[--bs],xs[bs]=null;for(;e===lr;)lr=Ba[--$a],Ba[$a]=null,ml=Ba[--$a],Ba[$a]=null,hl=Ba[--$a],Ba[$a]=null}function Xm(e,n){Ba[$a++]=hl,Ba[$a++]=ml,Ba[$a++]=lr,hl=n.id,ml=n.overflow,lr=e}var Xn=null,tn=null,yt=!1,rr=null,qa=!1,hd=Error(i(519));function sr(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ei(Ha(n,e)),hd}function Pm(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[ge]=e,n[De]=s,l){case"dialog":ht("cancel",n),ht("close",n);break;case"iframe":case"object":case"embed":ht("load",n);break;case"video":case"audio":for(l=0;l<Ii.length;l++)ht(Ii[l],n);break;case"source":ht("error",n);break;case"img":case"image":case"link":ht("error",n),ht("load",n);break;case"details":ht("toggle",n);break;case"input":ht("invalid",n),fi(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ht("invalid",n);break;case"textarea":ht("invalid",n),Ja(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||dv(n.textContent,l)?(s.popover!=null&&(ht("beforetoggle",n),ht("toggle",n)),s.onScroll!=null&&ht("scroll",n),s.onScrollEnd!=null&&ht("scrollend",n),s.onClick!=null&&(n.onclick=na),n=!0):n=!1,n||sr(e,!0)}function Qm(e){for(Xn=e.return;Xn;)switch(Xn.tag){case 5:case 31:case 13:qa=!1;return;case 27:case 3:qa=!0;return;default:Xn=Xn.return}}function Ss(e){if(e!==Xn)return!1;if(!yt)return Qm(e),yt=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Mf(e.type,e.memoizedProps)),l=!l),l&&tn&&sr(e),Qm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));tn=bv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));tn=bv(e)}else n===27?(n=tn,br(e.type)?(e=Uf,Uf=null,tn=e):tn=n):tn=Xn?Va(e.stateNode.nextSibling):null;return!0}function Ir(){tn=Xn=null,yt=!1}function md(){var e=rr;return e!==null&&(xa===null?xa=e:xa.push.apply(xa,e),rr=null),e}function Ei(e){rr===null?rr=[e]:rr.push(e)}var pd=D(null),Gr=null,Ul=null;function ir(e,n,l){ne(pd,n._currentValue),n._currentValue=l}function Hl(e){e._currentValue=pd.current,q(pd)}function gd(e,n,l){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===l)break;e=e.return}}function vd(e,n,l,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var h=c.dependencies;if(h!==null){var y=c.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=c;for(var A=0;A<n.length;A++)if(w.context===n[A]){h.lanes|=l,w=h.alternate,w!==null&&(w.lanes|=l),gd(h.return,l,e),s||(y=null);break e}h=w.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(i(341));y.lanes|=l,h=y.alternate,h!==null&&(h.lanes|=l),gd(y,l,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function ws(e,n,l,s){e=null;for(var c=n,h=!1;c!==null;){if(!h){if((c.flags&524288)!==0)h=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var w=c.type;Na(c.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(c===Ue.current){if(y=c.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Ki):e=[Ki])}c=c.return}e!==null&&vd(n,e,l,s),n.flags|=262144}function eo(e){for(e=e.firstContext;e!==null;){if(!Na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xr(e){Gr=e,Ul=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pn(e){return Km(Gr,e)}function to(e,n){return Gr===null&&Xr(e),Km(e,n)}function Km(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Ul===null){if(e===null)throw Error(i(308));Ul=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ul=Ul.next=n;return l}var d0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},f0=t.unstable_scheduleCallback,h0=t.unstable_NormalPriority,Nn={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yd(){return{controller:new d0,data:new Map,refCount:0}}function Ni(e){e.refCount--,e.refCount===0&&f0(h0,function(){e.controller.abort()})}var Ri=null,xd=0,Es=0,Ns=null;function m0(e,n){if(Ri===null){var l=Ri=[];xd=0,Es=Ef(),Ns={status:"pending",value:void 0,then:function(s){l.push(s)}}}return xd++,n.then(Zm,Zm),n}function Zm(){if(--xd===0&&Ri!==null){Ns!==null&&(Ns.status="fulfilled");var e=Ri;Ri=null,Es=0,Ns=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function p0(e,n){var l=[],s={status:"pending",value:null,reason:null,then:function(c){l.push(c)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var c=0;c<l.length;c++)(0,l[c])(n)},function(c){for(s.status="rejected",s.reason=c,c=0;c<l.length;c++)(0,l[c])(void 0)}),s}var Jm=z.S;z.S=function(e,n){Lg=fe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&m0(e,n),Jm!==null&&Jm(e,n)};var Pr=D(null);function bd(){var e=Pr.current;return e!==null?e:Zt.pooledCache}function no(e,n){n===null?ne(Pr,Pr.current):ne(Pr,n.pool)}function Wm(){var e=bd();return e===null?null:{parent:Nn._currentValue,pool:e}}var Rs=Error(i(460)),Sd=Error(i(474)),ao=Error(i(542)),lo={then:function(){}};function ep(e){return e=e.status,e==="fulfilled"||e==="rejected"}function tp(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(na,na),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ap(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=Zt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var c=n;c.status="fulfilled",c.value=s}},function(s){if(n.status==="pending"){var c=n;c.status="rejected",c.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ap(e),e}throw Kr=n,Rs}}function Qr(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Kr=l,Rs):l}}var Kr=null;function np(){if(Kr===null)throw Error(i(459));var e=Kr;return Kr=null,e}function ap(e){if(e===Rs||e===ao)throw Error(i(483))}var Ts=null,Ti=0;function ro(e){var n=Ti;return Ti+=1,Ts===null&&(Ts=[]),tp(Ts,e,n)}function ji(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function so(e,n){throw n.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function lp(e){function n(H,_){if(e){var V=H.deletions;V===null?(H.deletions=[_],H.flags|=16):V.push(_)}}function l(H,_){if(!e)return null;for(;_!==null;)n(H,_),_=_.sibling;return null}function s(H){for(var _=new Map;H!==null;)H.key!==null?_.set(H.key,H):_.set(H.index,H),H=H.sibling;return _}function c(H,_){return H=Ll(H,_),H.index=0,H.sibling=null,H}function h(H,_,V){return H.index=V,e?(V=H.alternate,V!==null?(V=V.index,V<_?(H.flags|=67108866,_):V):(H.flags|=67108866,_)):(H.flags|=1048576,_)}function y(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function w(H,_,V,te){return _===null||_.tag!==6?(_=od(V,H.mode,te),_.return=H,_):(_=c(_,V),_.return=H,_)}function A(H,_,V,te){var He=V.type;return He===O?J(H,_,V.props.children,te,V.key):_!==null&&(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===j&&Qr(He)===_.type)?(_=c(_,V.props),ji(_,V),_.return=H,_):(_=Ju(V.type,V.key,V.props,null,H.mode,te),ji(_,V),_.return=H,_)}function F(H,_,V,te){return _===null||_.tag!==4||_.stateNode.containerInfo!==V.containerInfo||_.stateNode.implementation!==V.implementation?(_=cd(V,H.mode,te),_.return=H,_):(_=c(_,V.children||[]),_.return=H,_)}function J(H,_,V,te,He){return _===null||_.tag!==7?(_=Fr(V,H.mode,te,He),_.return=H,_):(_=c(_,V),_.return=H,_)}function le(H,_,V){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=od(""+_,H.mode,V),_.return=H,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case S:return V=Ju(_.type,_.key,_.props,null,H.mode,V),ji(V,_),V.return=H,V;case N:return _=cd(_,H.mode,V),_.return=H,_;case j:return _=Qr(_),le(H,_,V)}if(Ee(_)||Re(_))return _=Fr(_,H.mode,V,null),_.return=H,_;if(typeof _.then=="function")return le(H,ro(_),V);if(_.$$typeof===Y)return le(H,to(H,_),V);so(H,_)}return null}function G(H,_,V,te){var He=_!==null?_.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return He!==null?null:w(H,_,""+V,te);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===He?A(H,_,V,te):null;case N:return V.key===He?F(H,_,V,te):null;case j:return V=Qr(V),G(H,_,V,te)}if(Ee(V)||Re(V))return He!==null?null:J(H,_,V,te,null);if(typeof V.then=="function")return G(H,_,ro(V),te);if(V.$$typeof===Y)return G(H,_,to(H,V),te);so(H,V)}return null}function P(H,_,V,te,He){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return H=H.get(V)||null,w(_,H,""+te,He);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case S:return H=H.get(te.key===null?V:te.key)||null,A(_,H,te,He);case N:return H=H.get(te.key===null?V:te.key)||null,F(_,H,te,He);case j:return te=Qr(te),P(H,_,V,te,He)}if(Ee(te)||Re(te))return H=H.get(V)||null,J(_,H,te,He,null);if(typeof te.then=="function")return P(H,_,V,ro(te),He);if(te.$$typeof===Y)return P(H,_,V,to(_,te),He);so(_,te)}return null}function Ae(H,_,V,te){for(var He=null,Dt=null,Me=_,st=_=0,gt=null;Me!==null&&st<V.length;st++){Me.index>st?(gt=Me,Me=null):gt=Me.sibling;var Ct=G(H,Me,V[st],te);if(Ct===null){Me===null&&(Me=gt);break}e&&Me&&Ct.alternate===null&&n(H,Me),_=h(Ct,_,st),Dt===null?He=Ct:Dt.sibling=Ct,Dt=Ct,Me=gt}if(st===V.length)return l(H,Me),yt&&zl(H,st),He;if(Me===null){for(;st<V.length;st++)Me=le(H,V[st],te),Me!==null&&(_=h(Me,_,st),Dt===null?He=Me:Dt.sibling=Me,Dt=Me);return yt&&zl(H,st),He}for(Me=s(Me);st<V.length;st++)gt=P(Me,H,st,V[st],te),gt!==null&&(e&>.alternate!==null&&Me.delete(gt.key===null?st:gt.key),_=h(gt,_,st),Dt===null?He=gt:Dt.sibling=gt,Dt=gt);return e&&Me.forEach(function(Rr){return n(H,Rr)}),yt&&zl(H,st),He}function qe(H,_,V,te){if(V==null)throw Error(i(151));for(var He=null,Dt=null,Me=_,st=_=0,gt=null,Ct=V.next();Me!==null&&!Ct.done;st++,Ct=V.next()){Me.index>st?(gt=Me,Me=null):gt=Me.sibling;var Rr=G(H,Me,Ct.value,te);if(Rr===null){Me===null&&(Me=gt);break}e&&Me&&Rr.alternate===null&&n(H,Me),_=h(Rr,_,st),Dt===null?He=Rr:Dt.sibling=Rr,Dt=Rr,Me=gt}if(Ct.done)return l(H,Me),yt&&zl(H,st),He;if(Me===null){for(;!Ct.done;st++,Ct=V.next())Ct=le(H,Ct.value,te),Ct!==null&&(_=h(Ct,_,st),Dt===null?He=Ct:Dt.sibling=Ct,Dt=Ct);return yt&&zl(H,st),He}for(Me=s(Me);!Ct.done;st++,Ct=V.next())Ct=P(Me,H,st,Ct.value,te),Ct!==null&&(e&&Ct.alternate!==null&&Me.delete(Ct.key===null?st:Ct.key),_=h(Ct,_,st),Dt===null?He=Ct:Dt.sibling=Ct,Dt=Ct);return e&&Me.forEach(function(TS){return n(H,TS)}),yt&&zl(H,st),He}function Ft(H,_,V,te){if(typeof V=="object"&&V!==null&&V.type===O&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case S:e:{for(var He=V.key;_!==null;){if(_.key===He){if(He=V.type,He===O){if(_.tag===7){l(H,_.sibling),te=c(_,V.props.children),te.return=H,H=te;break e}}else if(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===j&&Qr(He)===_.type){l(H,_.sibling),te=c(_,V.props),ji(te,V),te.return=H,H=te;break e}l(H,_);break}else n(H,_);_=_.sibling}V.type===O?(te=Fr(V.props.children,H.mode,te,V.key),te.return=H,H=te):(te=Ju(V.type,V.key,V.props,null,H.mode,te),ji(te,V),te.return=H,H=te)}return y(H);case N:e:{for(He=V.key;_!==null;){if(_.key===He)if(_.tag===4&&_.stateNode.containerInfo===V.containerInfo&&_.stateNode.implementation===V.implementation){l(H,_.sibling),te=c(_,V.children||[]),te.return=H,H=te;break e}else{l(H,_);break}else n(H,_);_=_.sibling}te=cd(V,H.mode,te),te.return=H,H=te}return y(H);case j:return V=Qr(V),Ft(H,_,V,te)}if(Ee(V))return Ae(H,_,V,te);if(Re(V)){if(He=Re(V),typeof He!="function")throw Error(i(150));return V=He.call(V),qe(H,_,V,te)}if(typeof V.then=="function")return Ft(H,_,ro(V),te);if(V.$$typeof===Y)return Ft(H,_,to(H,V),te);so(H,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,_!==null&&_.tag===6?(l(H,_.sibling),te=c(_,V),te.return=H,H=te):(l(H,_),te=od(V,H.mode,te),te.return=H,H=te),y(H)):l(H,_)}return function(H,_,V,te){try{Ti=0;var He=Ft(H,_,V,te);return Ts=null,He}catch(Me){if(Me===Rs||Me===ao)throw Me;var Dt=Ra(29,Me,null,H.mode);return Dt.lanes=te,Dt.return=H,Dt}finally{}}}var Zr=lp(!0),rp=lp(!1),ur=!1;function wd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ed(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function or(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cr(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(At&2)!==0){var c=s.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),s.pending=n,n=Zu(e),Ym(e,null,l),n}return Ku(e,s,n,l),Zu(e)}function Di(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,Cn(e,l)}}function Nd(e,n){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var c=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var y={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?c=h=y:h=h.next=y,l=l.next}while(l!==null);h===null?c=h=n:h=h.next=n}else c=h=n;l={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var Rd=!1;function Ci(){if(Rd){var e=Ns;if(e!==null)throw e}}function Ai(e,n,l,s){Rd=!1;var c=e.updateQueue;ur=!1;var h=c.firstBaseUpdate,y=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var A=w,F=A.next;A.next=null,y===null?h=F:y.next=F,y=A;var J=e.alternate;J!==null&&(J=J.updateQueue,w=J.lastBaseUpdate,w!==y&&(w===null?J.firstBaseUpdate=F:w.next=F,J.lastBaseUpdate=A))}if(h!==null){var le=c.baseState;y=0,J=F=A=null,w=h;do{var G=w.lane&-536870913,P=G!==w.lane;if(P?(pt&G)===G:(s&G)===G){G!==0&&G===Es&&(Rd=!0),J!==null&&(J=J.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Ae=e,qe=w;G=n;var Ft=l;switch(qe.tag){case 1:if(Ae=qe.payload,typeof Ae=="function"){le=Ae.call(Ft,le,G);break e}le=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=qe.payload,G=typeof Ae=="function"?Ae.call(Ft,le,G):Ae,G==null)break e;le=b({},le,G);break e;case 2:ur=!0}}G=w.callback,G!==null&&(e.flags|=64,P&&(e.flags|=8192),P=c.callbacks,P===null?c.callbacks=[G]:P.push(G))}else P={lane:G,tag:w.tag,payload:w.payload,callback:w.callback,next:null},J===null?(F=J=P,A=le):J=J.next=P,y|=G;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;P=w,w=P.next,P.next=null,c.lastBaseUpdate=P,c.shared.pending=null}}while(!0);J===null&&(A=le),c.baseState=A,c.firstBaseUpdate=F,c.lastBaseUpdate=J,h===null&&(c.shared.lanes=0),pr|=y,e.lanes=y,e.memoizedState=le}}function sp(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function ip(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)sp(l[e],n)}var js=D(null),io=D(0);function up(e,n){e=Xl,ne(io,e),ne(js,n),Xl=e|n.baseLanes}function Td(){ne(io,Xl),ne(js,js.current)}function jd(){Xl=io.current,q(js),q(io)}var Ta=D(null),Ya=null;function dr(e){var n=e.alternate;ne(gn,gn.current&1),ne(Ta,e),Ya===null&&(n===null||js.current!==null||n.memoizedState!==null)&&(Ya=e)}function Dd(e){ne(gn,gn.current),ne(Ta,e),Ya===null&&(Ya=e)}function op(e){e.tag===22?(ne(gn,gn.current),ne(Ta,e),Ya===null&&(Ya=e)):fr()}function fr(){ne(gn,gn.current),ne(Ta,Ta.current)}function ja(e){q(Ta),Ya===e&&(Ya=null),q(gn)}var gn=D(0);function uo(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Lf(l)||zf(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Bl=0,lt=null,Yt=null,Rn=null,oo=!1,Ds=!1,Jr=!1,co=0,Oi=0,Cs=null,g0=0;function fn(){throw Error(i(321))}function Cd(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!Na(e[l],n[l]))return!1;return!0}function Ad(e,n,l,s,c,h){return Bl=h,lt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=e===null||e.memoizedState===null?Gp:Id,Jr=!1,h=l(s,c),Jr=!1,Ds&&(h=dp(n,l,s,c)),cp(e),h}function cp(e){z.H=_i;var n=Yt!==null&&Yt.next!==null;if(Bl=0,Rn=Yt=lt=null,oo=!1,Oi=0,Cs=null,n)throw Error(i(300));e===null||Tn||(e=e.dependencies,e!==null&&eo(e)&&(Tn=!0))}function dp(e,n,l,s){lt=e;var c=0;do{if(Ds&&(Cs=null),Oi=0,Ds=!1,25<=c)throw Error(i(301));if(c+=1,Rn=Yt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}z.H=Xp,h=n(l,s)}while(Ds);return h}function v0(){var e=z.H,n=e.useState()[0];return n=typeof n.then=="function"?Mi(n):n,e=e.useState()[0],(Yt!==null?Yt.memoizedState:null)!==e&&(lt.flags|=1024),n}function Od(){var e=co!==0;return co=0,e}function Md(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function kd(e){if(oo){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}oo=!1}Bl=0,Rn=Yt=lt=null,Ds=!1,Oi=co=0,Cs=null}function oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rn===null?lt.memoizedState=Rn=e:Rn=Rn.next=e,Rn}function vn(){if(Yt===null){var e=lt.alternate;e=e!==null?e.memoizedState:null}else e=Yt.next;var n=Rn===null?lt.memoizedState:Rn.next;if(n!==null)Rn=n,Yt=e;else{if(e===null)throw lt.alternate===null?Error(i(467)):Error(i(310));Yt=e,e={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},Rn===null?lt.memoizedState=Rn=e:Rn=Rn.next=e}return Rn}function fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mi(e){var n=Oi;return Oi+=1,Cs===null&&(Cs=[]),e=tp(Cs,e,n),n=lt,(Rn===null?n.memoizedState:Rn.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Gp:Id),e}function ho(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Mi(e);if(e.$$typeof===Y)return Pn(e)}throw Error(i(438,String(e)))}function _d(e){var n=null,l=lt.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=lt.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(c){return c.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=fo(),lt.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),s=0;s<e;s++)l[s]=me;return n.index++,l}function $l(e,n){return typeof n=="function"?n(e):n}function mo(e){var n=vn();return Ld(n,Yt,e)}function Ld(e,n,l){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=l;var c=e.baseQueue,h=s.pending;if(h!==null){if(c!==null){var y=c.next;c.next=h.next,h.next=y}n.baseQueue=c=h,s.pending=null}if(h=e.baseState,c===null)e.memoizedState=h;else{n=c.next;var w=y=null,A=null,F=n,J=!1;do{var le=F.lane&-536870913;if(le!==F.lane?(pt&le)===le:(Bl&le)===le){var G=F.revertLane;if(G===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),le===Es&&(J=!0);else if((Bl&G)===G){F=F.next,G===Es&&(J=!0);continue}else le={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},A===null?(w=A=le,y=h):A=A.next=le,lt.lanes|=G,pr|=G;le=F.action,Jr&&l(h,le),h=F.hasEagerState?F.eagerState:l(h,le)}else G={lane:le,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},A===null?(w=A=G,y=h):A=A.next=G,lt.lanes|=le,pr|=le;F=F.next}while(F!==null&&F!==n);if(A===null?y=h:A.next=w,!Na(h,e.memoizedState)&&(Tn=!0,J&&(l=Ns,l!==null)))throw l;e.memoizedState=h,e.baseState=y,e.baseQueue=A,s.lastRenderedState=h}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function zd(e){var n=vn(),l=n.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=e;var s=l.dispatch,c=l.pending,h=n.memoizedState;if(c!==null){l.pending=null;var y=c=c.next;do h=e(h,y.action),y=y.next;while(y!==c);Na(h,n.memoizedState)||(Tn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,s]}function fp(e,n,l){var s=lt,c=vn(),h=yt;if(h){if(l===void 0)throw Error(i(407));l=l()}else l=n();var y=!Na((Yt||c).memoizedState,l);if(y&&(c.memoizedState=l,Tn=!0),c=c.queue,Bd(pp.bind(null,s,c,e),[e]),c.getSnapshot!==n||y||Rn!==null&&Rn.memoizedState.tag&1){if(s.flags|=2048,As(9,{destroy:void 0},mp.bind(null,s,c,l,n),null),Zt===null)throw Error(i(349));h||(Bl&127)!==0||hp(s,n,l)}return l}function hp(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=lt.updateQueue,n===null?(n=fo(),lt.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function mp(e,n,l,s){n.value=l,n.getSnapshot=s,gp(n)&&vp(e)}function pp(e,n,l){return l(function(){gp(n)&&vp(e)})}function gp(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!Na(e,l)}catch{return!0}}function vp(e){var n=Vr(e,2);n!==null&&ba(n,e,2)}function Ud(e){var n=oa();if(typeof e=="function"){var l=e;if(e=l(),Jr){St(!0);try{l()}finally{St(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:e},n}function yp(e,n,l,s){return e.baseState=l,Ld(e,Yt,typeof s=="function"?s:$l)}function y0(e,n,l,s,c){if(vo(e))throw Error(i(485));if(e=n.action,e!==null){var h={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){h.listeners.push(y)}};z.T!==null?l(!0):h.isTransition=!1,s(h),l=n.pending,l===null?(h.next=n.pending=h,xp(n,h)):(h.next=l.next,n.pending=l.next=h)}}function xp(e,n){var l=n.action,s=n.payload,c=e.state;if(n.isTransition){var h=z.T,y={};z.T=y;try{var w=l(c,s),A=z.S;A!==null&&A(y,w),bp(e,n,w)}catch(F){Hd(e,n,F)}finally{h!==null&&y.types!==null&&(h.types=y.types),z.T=h}}else try{h=l(c,s),bp(e,n,h)}catch(F){Hd(e,n,F)}}function bp(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){Sp(e,n,s)},function(s){return Hd(e,n,s)}):Sp(e,n,l)}function Sp(e,n,l){n.status="fulfilled",n.value=l,wp(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,xp(e,l)))}function Hd(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,wp(n),n=n.next;while(n!==s)}e.action=null}function wp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Ep(e,n){return n}function Np(e,n){if(yt){var l=Zt.formState;if(l!==null){e:{var s=lt;if(yt){if(tn){t:{for(var c=tn,h=qa;c.nodeType!==8;){if(!h){c=null;break t}if(c=Va(c.nextSibling),c===null){c=null;break t}}h=c.data,c=h==="F!"||h==="F"?c:null}if(c){tn=Va(c.nextSibling),s=c.data==="F!";break e}}sr(s)}s=!1}s&&(n=l[0])}}return l=oa(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ep,lastRenderedState:n},l.queue=s,l=Vp.bind(null,lt,s),s.dispatch=l,s=Ud(!1),h=Fd.bind(null,lt,!1,s.queue),s=oa(),c={state:n,dispatch:null,action:e,pending:null},s.queue=c,l=y0.bind(null,lt,c,h,l),c.dispatch=l,s.memoizedState=e,[n,l,!1]}function Rp(e){var n=vn();return Tp(n,Yt,e)}function Tp(e,n,l){if(n=Ld(e,n,Ep)[0],e=mo($l)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Mi(n)}catch(y){throw y===Rs?ao:y}else s=n;n=vn();var c=n.queue,h=c.dispatch;return l!==n.memoizedState&&(lt.flags|=2048,As(9,{destroy:void 0},x0.bind(null,c,l),null)),[s,h,e]}function x0(e,n){e.action=n}function jp(e){var n=vn(),l=Yt;if(l!==null)return Tp(n,l,e);vn(),n=n.memoizedState,l=vn();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function As(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=lt.updateQueue,n===null&&(n=fo(),lt.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(s=l.next,l.next=e,e.next=s,n.lastEffect=e),e}function Dp(){return vn().memoizedState}function po(e,n,l,s){var c=oa();lt.flags|=e,c.memoizedState=As(1|n,{destroy:void 0},l,s===void 0?null:s)}function go(e,n,l,s){var c=vn();s=s===void 0?null:s;var h=c.memoizedState.inst;Yt!==null&&s!==null&&Cd(s,Yt.memoizedState.deps)?c.memoizedState=As(n,h,l,s):(lt.flags|=e,c.memoizedState=As(1|n,h,l,s))}function Cp(e,n){po(8390656,8,e,n)}function Bd(e,n){go(2048,8,e,n)}function b0(e){lt.flags|=4;var n=lt.updateQueue;if(n===null)n=fo(),lt.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Ap(e){var n=vn().memoizedState;return b0({ref:n,nextImpl:e}),function(){if((At&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Op(e,n){return go(4,2,e,n)}function Mp(e,n){return go(4,4,e,n)}function kp(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function _p(e,n,l){l=l!=null?l.concat([e]):null,go(4,4,kp.bind(null,n,e),l)}function $d(){}function Lp(e,n){var l=vn();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&Cd(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function zp(e,n){var l=vn();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Cd(n,s[1]))return s[0];if(s=e(),Jr){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[s,n],s}function qd(e,n,l){return l===void 0||(Bl&1073741824)!==0&&(pt&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Ug(),lt.lanes|=e,pr|=e,l)}function Up(e,n,l,s){return Na(l,n)?l:js.current!==null?(e=qd(e,l,s),Na(e,n)||(Tn=!0),e):(Bl&42)===0||(Bl&1073741824)!==0&&(pt&261930)===0?(Tn=!0,e.memoizedState=l):(e=Ug(),lt.lanes|=e,pr|=e,n)}function Hp(e,n,l,s,c){var h=B.p;B.p=h!==0&&8>h?h:8;var y=z.T,w={};z.T=w,Fd(e,!1,n,l);try{var A=c(),F=z.S;if(F!==null&&F(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var J=p0(A,s);ki(e,n,J,Aa(e))}else ki(e,n,s,Aa(e))}catch(le){ki(e,n,{then:function(){},status:"rejected",reason:le},Aa())}finally{B.p=h,y!==null&&w.types!==null&&(y.types=w.types),z.T=y}}function S0(){}function Yd(e,n,l,s){if(e.tag!==5)throw Error(i(476));var c=Bp(e).queue;Hp(e,c,n,ie,l===null?S0:function(){return $p(e),l(s)})}function Bp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:ie},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function $p(e){var n=Bp(e);n.next===null&&(n=e.alternate.memoizedState),ki(e,n.next.queue,{},Aa())}function Vd(){return Pn(Ki)}function qp(){return vn().memoizedState}function Yp(){return vn().memoizedState}function w0(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Aa();e=or(l);var s=cr(n,e,l);s!==null&&(ba(s,n,l),Di(s,n,l)),n={cache:yd()},e.payload=n;return}n=n.return}}function E0(e,n,l){var s=Aa();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vo(e)?Fp(n,l):(l=id(e,n,l,s),l!==null&&(ba(l,e,s),Ip(l,n,s)))}function Vp(e,n,l){var s=Aa();ki(e,n,l,s)}function ki(e,n,l,s){var c={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(vo(e))Fp(n,c);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var y=n.lastRenderedState,w=h(y,l);if(c.hasEagerState=!0,c.eagerState=w,Na(w,y))return Ku(e,n,c,0),Zt===null&&Qu(),!1}catch{}finally{}if(l=id(e,n,c,s),l!==null)return ba(l,e,s),Ip(l,n,s),!0}return!1}function Fd(e,n,l,s){if(s={lane:2,revertLane:Ef(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},vo(e)){if(n)throw Error(i(479))}else n=id(e,l,s,2),n!==null&&ba(n,e,2)}function vo(e){var n=e.alternate;return e===lt||n!==null&&n===lt}function Fp(e,n){Ds=oo=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Ip(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,Cn(e,l)}}var _i={readContext:Pn,use:ho,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};_i.useEffectEvent=fn;var Gp={readContext:Pn,use:ho,useCallback:function(e,n){return oa().memoizedState=[e,n===void 0?null:n],e},useContext:Pn,useEffect:Cp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,po(4194308,4,kp.bind(null,n,e),l)},useLayoutEffect:function(e,n){return po(4194308,4,e,n)},useInsertionEffect:function(e,n){po(4,2,e,n)},useMemo:function(e,n){var l=oa();n=n===void 0?null:n;var s=e();if(Jr){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=oa();if(l!==void 0){var c=l(n);if(Jr){St(!0);try{l(n)}finally{St(!1)}}}else c=n;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=E0.bind(null,lt,e),[s.memoizedState,e]},useRef:function(e){var n=oa();return e={current:e},n.memoizedState=e},useState:function(e){e=Ud(e);var n=e.queue,l=Vp.bind(null,lt,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:$d,useDeferredValue:function(e,n){var l=oa();return qd(l,e,n)},useTransition:function(){var e=Ud(!1);return e=Hp.bind(null,lt,e.queue,!0,!1),oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=lt,c=oa();if(yt){if(l===void 0)throw Error(i(407));l=l()}else{if(l=n(),Zt===null)throw Error(i(349));(pt&127)!==0||hp(s,n,l)}c.memoizedState=l;var h={value:l,getSnapshot:n};return c.queue=h,Cp(pp.bind(null,s,h,e),[e]),s.flags|=2048,As(9,{destroy:void 0},mp.bind(null,s,h,l,n),null),l},useId:function(){var e=oa(),n=Zt.identifierPrefix;if(yt){var l=ml,s=hl;l=(s&~(1<<32-Mt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=co++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=g0++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Vd,useFormState:Np,useActionState:Np,useOptimistic:function(e){var n=oa();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Fd.bind(null,lt,!0,l),l.dispatch=n,[e,n]},useMemoCache:_d,useCacheRefresh:function(){return oa().memoizedState=w0.bind(null,lt)},useEffectEvent:function(e){var n=oa(),l={impl:e};return n.memoizedState=l,function(){if((At&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},Id={readContext:Pn,use:ho,useCallback:Lp,useContext:Pn,useEffect:Bd,useImperativeHandle:_p,useInsertionEffect:Op,useLayoutEffect:Mp,useMemo:zp,useReducer:mo,useRef:Dp,useState:function(){return mo($l)},useDebugValue:$d,useDeferredValue:function(e,n){var l=vn();return Up(l,Yt.memoizedState,e,n)},useTransition:function(){var e=mo($l)[0],n=vn().memoizedState;return[typeof e=="boolean"?e:Mi(e),n]},useSyncExternalStore:fp,useId:qp,useHostTransitionStatus:Vd,useFormState:Rp,useActionState:Rp,useOptimistic:function(e,n){var l=vn();return yp(l,Yt,e,n)},useMemoCache:_d,useCacheRefresh:Yp};Id.useEffectEvent=Ap;var Xp={readContext:Pn,use:ho,useCallback:Lp,useContext:Pn,useEffect:Bd,useImperativeHandle:_p,useInsertionEffect:Op,useLayoutEffect:Mp,useMemo:zp,useReducer:zd,useRef:Dp,useState:function(){return zd($l)},useDebugValue:$d,useDeferredValue:function(e,n){var l=vn();return Yt===null?qd(l,e,n):Up(l,Yt.memoizedState,e,n)},useTransition:function(){var e=zd($l)[0],n=vn().memoizedState;return[typeof e=="boolean"?e:Mi(e),n]},useSyncExternalStore:fp,useId:qp,useHostTransitionStatus:Vd,useFormState:jp,useActionState:jp,useOptimistic:function(e,n){var l=vn();return Yt!==null?yp(l,Yt,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:_d,useCacheRefresh:Yp};Xp.useEffectEvent=Ap;function Gd(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:b({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Xd={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=Aa(),c=or(s);c.payload=n,l!=null&&(c.callback=l),n=cr(e,c,s),n!==null&&(ba(n,e,s),Di(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=Aa(),c=or(s);c.tag=1,c.payload=n,l!=null&&(c.callback=l),n=cr(e,c,s),n!==null&&(ba(n,e,s),Di(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Aa(),s=or(l);s.tag=2,n!=null&&(s.callback=n),n=cr(e,s,l),n!==null&&(ba(n,e,l),Di(n,e,l))}};function Pp(e,n,l,s,c,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,y):n.prototype&&n.prototype.isPureReactComponent?!bi(l,s)||!bi(c,h):!0}function Qp(e,n,l,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==e&&Xd.enqueueReplaceState(n,n.state,null)}function Wr(e,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}if(e=e.defaultProps){l===n&&(l=b({},l));for(var c in e)l[c]===void 0&&(l[c]=e[c])}return l}function Kp(e){Pu(e)}function Zp(e){console.error(e)}function Jp(e){Pu(e)}function yo(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Wp(e,n,l){try{var s=e.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Pd(e,n,l){return l=or(l),l.tag=3,l.payload={element:null},l.callback=function(){yo(e,n)},l}function eg(e){return e=or(e),e.tag=3,e}function tg(e,n,l,s){var c=l.type.getDerivedStateFromError;if(typeof c=="function"){var h=s.value;e.payload=function(){return c(h)},e.callback=function(){Wp(n,l,s)}}var y=l.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Wp(n,l,s),typeof c!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})})}function N0(e,n,l,s,c){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&ws(n,l,c,!0),l=Ta.current,l!==null){switch(l.tag){case 31:case 13:return Ya===null?Ao():l.alternate===null&&hn===0&&(hn=3),l.flags&=-257,l.flags|=65536,l.lanes=c,s===lo?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),bf(e,s,c)),!1;case 22:return l.flags|=65536,s===lo?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),bf(e,s,c)),!1}throw Error(i(435,l.tag))}return bf(e,s,c),Ao(),!1}if(yt)return n=Ta.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,s!==hd&&(e=Error(i(422),{cause:s}),Ei(Ha(e,l)))):(s!==hd&&(n=Error(i(423),{cause:s}),Ei(Ha(n,l))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Ha(s,l),c=Pd(e.stateNode,s,c),Nd(e,c),hn!==4&&(hn=2)),!1;var h=Error(i(520),{cause:s});if(h=Ha(h,l),Yi===null?Yi=[h]:Yi.push(h),hn!==4&&(hn=2),n===null)return!0;s=Ha(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=c&-c,l.lanes|=e,e=Pd(l.stateNode,s,e),Nd(l,e),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(gr===null||!gr.has(h))))return l.flags|=65536,c&=-c,l.lanes|=c,c=eg(c),tg(c,e,l,s),Nd(l,c),!1}l=l.return}while(l!==null);return!1}var Qd=Error(i(461)),Tn=!1;function Qn(e,n,l,s){n.child=e===null?rp(n,null,l,s):Zr(n,e.child,l,s)}function ng(e,n,l,s,c){l=l.render;var h=n.ref;if("ref"in s){var y={};for(var w in s)w!=="ref"&&(y[w]=s[w])}else y=s;return Xr(n),s=Ad(e,n,l,y,h,c),w=Od(),e!==null&&!Tn?(Md(e,n,c),ql(e,n,c)):(yt&&w&&dd(n),n.flags|=1,Qn(e,n,s,c),n.child)}function ag(e,n,l,s,c){if(e===null){var h=l.type;return typeof h=="function"&&!ud(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,lg(e,n,h,s,c)):(e=Ju(l.type,null,s,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!af(e,c)){var y=h.memoizedProps;if(l=l.compare,l=l!==null?l:bi,l(y,s)&&e.ref===n.ref)return ql(e,n,c)}return n.flags|=1,e=Ll(h,s),e.ref=n.ref,e.return=n,n.child=e}function lg(e,n,l,s,c){if(e!==null){var h=e.memoizedProps;if(bi(h,s)&&e.ref===n.ref)if(Tn=!1,n.pendingProps=s=h,af(e,c))(e.flags&131072)!==0&&(Tn=!0);else return n.lanes=e.lanes,ql(e,n,c)}return Kd(e,n,l,s,c)}function rg(e,n,l,s){var c=s.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,e!==null){for(s=n.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~h}else s=0,n.child=null;return sg(e,n,h,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&no(n,h!==null?h.cachePool:null),h!==null?up(n,h):Td(),op(n);else return s=n.lanes=536870912,sg(e,n,h!==null?h.baseLanes|l:l,l,s)}else h!==null?(no(n,h.cachePool),up(n,h),fr(),n.memoizedState=null):(e!==null&&no(n,null),Td(),fr());return Qn(e,n,c,l),n.child}function Li(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function sg(e,n,l,s,c){var h=bd();return h=h===null?null:{parent:Nn._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},e!==null&&no(n,null),Td(),op(n),e!==null&&ws(e,n,s,!0),n.childLanes=c,null}function xo(e,n){return n=So({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function ig(e,n,l){return Zr(n,e.child,null,l),e=xo(n,n.pendingProps),e.flags|=2,ja(n),n.memoizedState=null,e}function R0(e,n,l){var s=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(yt){if(s.mode==="hidden")return e=xo(n,s),n.lanes=536870912,Li(null,e);if(Dd(n),(e=tn)?(e=xv(e,qa),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:lr!==null?{id:hl,overflow:ml}:null,retryLane:536870912,hydrationErrors:null},l=Fm(e),l.return=n,n.child=l,Xn=n,tn=null)):e=null,e===null)throw sr(n);return n.lanes=536870912,null}return xo(n,s)}var h=e.memoizedState;if(h!==null){var y=h.dehydrated;if(Dd(n),c)if(n.flags&256)n.flags&=-257,n=ig(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(Tn||ws(e,n,l,!1),c=(l&e.childLanes)!==0,Tn||c){if(s=Zt,s!==null&&(y=C(s,l),y!==0&&y!==h.retryLane))throw h.retryLane=y,Vr(e,y),ba(s,e,y),Qd;Ao(),n=ig(e,n,l)}else e=h.treeContext,tn=Va(y.nextSibling),Xn=n,yt=!0,rr=null,qa=!1,e!==null&&Xm(n,e),n=xo(n,s),n.flags|=4096;return n}return e=Ll(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function bo(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function Kd(e,n,l,s,c){return Xr(n),l=Ad(e,n,l,s,void 0,c),s=Od(),e!==null&&!Tn?(Md(e,n,c),ql(e,n,c)):(yt&&s&&dd(n),n.flags|=1,Qn(e,n,l,c),n.child)}function ug(e,n,l,s,c,h){return Xr(n),n.updateQueue=null,l=dp(n,s,l,c),cp(e),s=Od(),e!==null&&!Tn?(Md(e,n,h),ql(e,n,h)):(yt&&s&&dd(n),n.flags|=1,Qn(e,n,l,h),n.child)}function og(e,n,l,s,c){if(Xr(n),n.stateNode===null){var h=ys,y=l.contextType;typeof y=="object"&&y!==null&&(h=Pn(y)),h=new l(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Xd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},wd(n),y=l.contextType,h.context=typeof y=="object"&&y!==null?Pn(y):ys,h.state=n.memoizedState,y=l.getDerivedStateFromProps,typeof y=="function"&&(Gd(n,l,y,s),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(y=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&Xd.enqueueReplaceState(h,h.state,null),Ai(n,s,h,c),Ci(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var w=n.memoizedProps,A=Wr(l,w);h.props=A;var F=h.context,J=l.contextType;y=ys,typeof J=="object"&&J!==null&&(y=Pn(J));var le=l.getDerivedStateFromProps;J=typeof le=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=n.pendingProps!==w,J||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||F!==y)&&Qp(n,h,s,y),ur=!1;var G=n.memoizedState;h.state=G,Ai(n,s,h,c),Ci(),F=n.memoizedState,w||G!==F||ur?(typeof le=="function"&&(Gd(n,l,le,s),F=n.memoizedState),(A=ur||Pp(n,l,A,s,G,F,y))?(J||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=F),h.props=s,h.state=F,h.context=y,s=A):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,Ed(e,n),y=n.memoizedProps,J=Wr(l,y),h.props=J,le=n.pendingProps,G=h.context,F=l.contextType,A=ys,typeof F=="object"&&F!==null&&(A=Pn(F)),w=l.getDerivedStateFromProps,(F=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==le||G!==A)&&Qp(n,h,s,A),ur=!1,G=n.memoizedState,h.state=G,Ai(n,s,h,c),Ci();var P=n.memoizedState;y!==le||G!==P||ur||e!==null&&e.dependencies!==null&&eo(e.dependencies)?(typeof w=="function"&&(Gd(n,l,w,s),P=n.memoizedState),(J=ur||Pp(n,l,J,s,G,P,A)||e!==null&&e.dependencies!==null&&eo(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,P,A),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,P,A)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=P),h.props=s,h.state=P,h.context=A,s=J):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,bo(e,n),s=(n.flags&128)!==0,h||s?(h=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&s?(n.child=Zr(n,e.child,null,c),n.child=Zr(n,null,l,c)):Qn(e,n,l,c),n.memoizedState=h.state,e=n.child):e=ql(e,n,c),e}function cg(e,n,l,s){return Ir(),n.flags|=256,Qn(e,n,l,s),n.child}var Zd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jd(e){return{baseLanes:e,cachePool:Wm()}}function Wd(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Ca),e}function dg(e,n,l){var s=n.pendingProps,c=!1,h=(n.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(gn.current&2)!==0),y&&(c=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,e===null){if(yt){if(c?dr(n):fr(),(e=tn)?(e=xv(e,qa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:lr!==null?{id:hl,overflow:ml}:null,retryLane:536870912,hydrationErrors:null},l=Fm(e),l.return=n,n.child=l,Xn=n,tn=null)):e=null,e===null)throw sr(n);return zf(e)?n.lanes=32:n.lanes=536870912,null}var w=s.children;return s=s.fallback,c?(fr(),c=n.mode,w=So({mode:"hidden",children:w},c),s=Fr(s,c,l,null),w.return=n,s.return=n,w.sibling=s,n.child=w,s=n.child,s.memoizedState=Jd(l),s.childLanes=Wd(e,y,l),n.memoizedState=Zd,Li(null,s)):(dr(n),ef(n,w))}var A=e.memoizedState;if(A!==null&&(w=A.dehydrated,w!==null)){if(h)n.flags&256?(dr(n),n.flags&=-257,n=tf(e,n,l)):n.memoizedState!==null?(fr(),n.child=e.child,n.flags|=128,n=null):(fr(),w=s.fallback,c=n.mode,s=So({mode:"visible",children:s.children},c),w=Fr(w,c,l,null),w.flags|=2,s.return=n,w.return=n,s.sibling=w,n.child=s,Zr(n,e.child,null,l),s=n.child,s.memoizedState=Jd(l),s.childLanes=Wd(e,y,l),n.memoizedState=Zd,n=Li(null,s));else if(dr(n),zf(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var F=y.dgst;y=F,s=Error(i(419)),s.stack="",s.digest=y,Ei({value:s,source:null,stack:null}),n=tf(e,n,l)}else if(Tn||ws(e,n,l,!1),y=(l&e.childLanes)!==0,Tn||y){if(y=Zt,y!==null&&(s=C(y,l),s!==0&&s!==A.retryLane))throw A.retryLane=s,Vr(e,s),ba(y,e,s),Qd;Lf(w)||Ao(),n=tf(e,n,l)}else Lf(w)?(n.flags|=192,n.child=e.child,n=null):(e=A.treeContext,tn=Va(w.nextSibling),Xn=n,yt=!0,rr=null,qa=!1,e!==null&&Xm(n,e),n=ef(n,s.children),n.flags|=4096);return n}return c?(fr(),w=s.fallback,c=n.mode,A=e.child,F=A.sibling,s=Ll(A,{mode:"hidden",children:s.children}),s.subtreeFlags=A.subtreeFlags&65011712,F!==null?w=Ll(F,w):(w=Fr(w,c,l,null),w.flags|=2),w.return=n,s.return=n,s.sibling=w,n.child=s,Li(null,s),s=n.child,w=e.child.memoizedState,w===null?w=Jd(l):(c=w.cachePool,c!==null?(A=Nn._currentValue,c=c.parent!==A?{parent:A,pool:A}:c):c=Wm(),w={baseLanes:w.baseLanes|l,cachePool:c}),s.memoizedState=w,s.childLanes=Wd(e,y,l),n.memoizedState=Zd,Li(e.child,s)):(dr(n),l=e.child,e=l.sibling,l=Ll(l,{mode:"visible",children:s.children}),l.return=n,l.sibling=null,e!==null&&(y=n.deletions,y===null?(n.deletions=[e],n.flags|=16):y.push(e)),n.child=l,n.memoizedState=null,l)}function ef(e,n){return n=So({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function So(e,n){return e=Ra(22,e,null,n),e.lanes=0,e}function tf(e,n,l){return Zr(n,e.child,null,l),e=ef(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function fg(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),gd(e.return,n,l)}function nf(e,n,l,s,c,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:c,treeForkCount:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=l,y.tailMode=c,y.treeForkCount=h)}function hg(e,n,l){var s=n.pendingProps,c=s.revealOrder,h=s.tail;s=s.children;var y=gn.current,w=(y&2)!==0;if(w?(y=y&1|2,n.flags|=128):y&=1,ne(gn,y),Qn(e,n,s,l),s=yt?wi:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fg(e,l,n);else if(e.tag===19)fg(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(l=n.child,c=null;l!==null;)e=l.alternate,e!==null&&uo(e)===null&&(c=l),l=l.sibling;l=c,l===null?(c=n.child,n.child=null):(c=l.sibling,l.sibling=null),nf(n,!1,c,l,h,s);break;case"backwards":case"unstable_legacy-backwards":for(l=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&uo(e)===null){n.child=c;break}e=c.sibling,c.sibling=l,l=c,c=e}nf(n,!0,l,null,h,s);break;case"together":nf(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function ql(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),pr|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(ws(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,l=Ll(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Ll(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function af(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&eo(e)))}function T0(e,n,l){switch(n.tag){case 3:it(n,n.stateNode.containerInfo),ir(n,Nn,e.memoizedState.cache),Ir();break;case 27:case 5:tt(n);break;case 4:it(n,n.stateNode.containerInfo);break;case 10:ir(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Dd(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(dr(n),n.flags|=128,null):(l&n.child.childLanes)!==0?dg(e,n,l):(dr(n),e=ql(e,n,l),e!==null?e.sibling:null);dr(n);break;case 19:var c=(e.flags&128)!==0;if(s=(l&n.childLanes)!==0,s||(ws(e,n,l,!1),s=(l&n.childLanes)!==0),c){if(s)return hg(e,n,l);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ne(gn,gn.current),s)break;return null;case 22:return n.lanes=0,rg(e,n,l,n.pendingProps);case 24:ir(n,Nn,e.memoizedState.cache)}return ql(e,n,l)}function mg(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)Tn=!0;else{if(!af(e,l)&&(n.flags&128)===0)return Tn=!1,T0(e,n,l);Tn=(e.flags&131072)!==0}else Tn=!1,yt&&(n.flags&1048576)!==0&&Gm(n,wi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Qr(n.elementType),n.type=e,typeof e=="function")ud(e)?(s=Wr(e,s),n.tag=1,n=og(null,n,e,s,l)):(n.tag=0,n=Kd(null,n,e,s,l));else{if(e!=null){var c=e.$$typeof;if(c===Q){n.tag=11,n=ng(null,n,e,s,l);break e}else if(c===U){n.tag=14,n=ag(null,n,e,s,l);break e}}throw n=be(e)||e,Error(i(306,n,""))}}return n;case 0:return Kd(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,c=Wr(s,n.pendingProps),og(e,n,s,c,l);case 3:e:{if(it(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var h=n.memoizedState;c=h.element,Ed(e,n),Ai(n,s,null,l);var y=n.memoizedState;if(s=y.cache,ir(n,Nn,s),s!==h.cache&&vd(n,[Nn],l,!0),Ci(),s=y.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=cg(e,n,s,l);break e}else if(s!==c){c=Ha(Error(i(424)),n),Ei(c),n=cg(e,n,s,l);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(tn=Va(e.firstChild),Xn=n,yt=!0,rr=null,qa=!0,l=rp(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Ir(),s===c){n=ql(e,n,l);break e}Qn(e,n,s,l)}n=n.child}return n;case 26:return bo(e,n),e===null?(l=Rv(n.type,null,n.pendingProps,null))?n.memoizedState=l:yt||(l=n.type,e=n.pendingProps,s=Uo(Ne.current).createElement(l),s[ge]=n,s[De]=e,Kn(s,l,e),ct(s),n.stateNode=s):n.memoizedState=Rv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return tt(n),e===null&&yt&&(s=n.stateNode=wv(n.type,n.pendingProps,Ne.current),Xn=n,qa=!0,c=tn,br(n.type)?(Uf=c,tn=Va(s.firstChild)):tn=c),Qn(e,n,n.pendingProps.children,l),bo(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&yt&&((c=s=tn)&&(s=nS(s,n.type,n.pendingProps,qa),s!==null?(n.stateNode=s,Xn=n,tn=Va(s.firstChild),qa=!1,c=!0):c=!1),c||sr(n)),tt(n),c=n.type,h=n.pendingProps,y=e!==null?e.memoizedProps:null,s=h.children,Mf(c,h)?s=null:y!==null&&Mf(c,y)&&(n.flags|=32),n.memoizedState!==null&&(c=Ad(e,n,v0,null,null,l),Ki._currentValue=c),bo(e,n),Qn(e,n,s,l),n.child;case 6:return e===null&&yt&&((e=l=tn)&&(l=aS(l,n.pendingProps,qa),l!==null?(n.stateNode=l,Xn=n,tn=null,e=!0):e=!1),e||sr(n)),null;case 13:return dg(e,n,l);case 4:return it(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Zr(n,null,s,l):Qn(e,n,s,l),n.child;case 11:return ng(e,n,n.type,n.pendingProps,l);case 7:return Qn(e,n,n.pendingProps,l),n.child;case 8:return Qn(e,n,n.pendingProps.children,l),n.child;case 12:return Qn(e,n,n.pendingProps.children,l),n.child;case 10:return s=n.pendingProps,ir(n,n.type,s.value),Qn(e,n,s.children,l),n.child;case 9:return c=n.type._context,s=n.pendingProps.children,Xr(n),c=Pn(c),s=s(c),n.flags|=1,Qn(e,n,s,l),n.child;case 14:return ag(e,n,n.type,n.pendingProps,l);case 15:return lg(e,n,n.type,n.pendingProps,l);case 19:return hg(e,n,l);case 31:return R0(e,n,l);case 22:return rg(e,n,l,n.pendingProps);case 24:return Xr(n),s=Pn(Nn),e===null?(c=bd(),c===null&&(c=Zt,h=yd(),c.pooledCache=h,h.refCount++,h!==null&&(c.pooledCacheLanes|=l),c=h),n.memoizedState={parent:s,cache:c},wd(n),ir(n,Nn,c)):((e.lanes&l)!==0&&(Ed(e,n),Ai(n,null,null,l),Ci()),c=e.memoizedState,h=n.memoizedState,c.parent!==s?(c={parent:s,cache:s},n.memoizedState=c,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=c),ir(n,Nn,s)):(s=h.cache,ir(n,Nn,s),s!==c.cache&&vd(n,[Nn],l,!0))),Qn(e,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Yl(e){e.flags|=4}function lf(e,n,l,s,c){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(qg())e.flags|=8192;else throw Kr=lo,Sd}else e.flags&=-16777217}function pg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Av(n))if(qg())e.flags|=8192;else throw Kr=lo,Sd}function wo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Pt():536870912,e.lanes|=n,_s|=n)}function zi(e,n){if(!yt)switch(e.tailMode){case"hidden":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function nn(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,s=0;if(n)for(var c=e.child;c!==null;)l|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)l|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=l,n}function j0(e,n,l){var s=n.pendingProps;switch(fd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(n),null;case 1:return nn(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Hl(Nn),Ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ss(n)?Yl(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,md())),nn(n),null;case 26:var c=n.type,h=n.memoizedState;return e===null?(Yl(n),h!==null?(nn(n),pg(n,h)):(nn(n),lf(n,c,null,s,l))):h?h!==e.memoizedState?(Yl(n),nn(n),pg(n,h)):(nn(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Yl(n),nn(n),lf(n,c,e,s,l)),null;case 27:if(pn(n),l=Ne.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Yl(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return nn(n),null}e=ce.current,Ss(n)?Pm(n):(e=wv(c,s,l),n.stateNode=e,Yl(n))}return nn(n),null;case 5:if(pn(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Yl(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return nn(n),null}if(h=ce.current,Ss(n))Pm(n);else{var y=Uo(Ne.current);switch(h){case 1:h=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:h=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":h=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":h=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":h=y.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?y.createElement("select",{is:s.is}):y.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?y.createElement(c,{is:s.is}):y.createElement(c)}}h[ge]=n,h[De]=s;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)h.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=h;e:switch(Kn(h,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Yl(n)}}return nn(n),lf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Yl(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=Ne.current,Ss(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,c=Xn,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[ge]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||dv(e.nodeValue,l)),e||sr(n,!0)}else e=Uo(e).createTextNode(s),e[ge]=n,n.stateNode=e}return nn(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Ss(n),l!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[ge]=n}else Ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;nn(n),e=!1}else l=md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(ja(n),n):(ja(n),null);if((n.flags&128)!==0)throw Error(i(558))}return nn(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ss(n),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[ge]=n}else Ir(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;nn(n),c=!1}else c=md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(ja(n),n):(ja(n),null)}return ja(n),(n.flags&128)!==0?(n.lanes=l,n):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=n.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),wo(n,n.updateQueue),nn(n),null);case 4:return Ge(),e===null&&jf(n.stateNode.containerInfo),nn(n),null;case 10:return Hl(n.type),nn(n),null;case 19:if(q(gn),s=n.memoizedState,s===null)return nn(n),null;if(c=(n.flags&128)!==0,h=s.rendering,h===null)if(c)zi(s,!1);else{if(hn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=uo(e),h!==null){for(n.flags|=128,zi(s,!1),e=h.updateQueue,n.updateQueue=e,wo(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Vm(l,e),l=l.sibling;return ne(gn,gn.current&1|2),yt&&zl(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&fe()>jo&&(n.flags|=128,c=!0,zi(s,!1),n.lanes=4194304)}else{if(!c)if(e=uo(h),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,wo(n,e),zi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!yt)return nn(n),null}else 2*fe()-s.renderingStartTime>jo&&l!==536870912&&(n.flags|=128,c=!0,zi(s,!1),n.lanes=4194304);s.isBackwards?(h.sibling=n.child,n.child=h):(e=s.last,e!==null?e.sibling=h:n.child=h,s.last=h)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=fe(),e.sibling=null,l=gn.current,ne(gn,c?l&1|2:l&1),yt&&zl(n,s.treeForkCount),e):(nn(n),null);case 22:case 23:return ja(n),jd(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(nn(n),n.subtreeFlags&6&&(n.flags|=8192)):nn(n),l=n.updateQueue,l!==null&&wo(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),e!==null&&q(Pr),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Hl(Nn),nn(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function D0(e,n){switch(fd(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Hl(Nn),Ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return pn(n),null;case 31:if(n.memoizedState!==null){if(ja(n),n.alternate===null)throw Error(i(340));Ir()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(ja(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Ir()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return q(gn),null;case 4:return Ge(),null;case 10:return Hl(n.type),null;case 22:case 23:return ja(n),jd(),e!==null&&q(Pr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Hl(Nn),null;case 25:return null;default:return null}}function gg(e,n){switch(fd(n),n.tag){case 3:Hl(Nn),Ge();break;case 26:case 27:case 5:pn(n);break;case 4:Ge();break;case 31:n.memoizedState!==null&&ja(n);break;case 13:ja(n);break;case 19:q(gn);break;case 10:Hl(n.type);break;case 22:case 23:ja(n),jd(),e!==null&&q(Pr);break;case 24:Hl(Nn)}}function Ui(e,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){s=void 0;var h=l.create,y=l.inst;s=h(),y.destroy=s}l=l.next}while(l!==c)}}catch(w){$t(n,n.return,w)}}function hr(e,n,l){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&e)===e){var y=s.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,c=n;var A=l,F=w;try{F()}catch(J){$t(c,A,J)}}}s=s.next}while(s!==h)}}catch(J){$t(n,n.return,J)}}function vg(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{ip(n,l)}catch(s){$t(e,e.return,s)}}}function yg(e,n,l){l.props=Wr(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){$t(e,n,s)}}function Hi(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof l=="function"?e.refCleanup=l(s):l.current=s}}catch(c){$t(e,n,c)}}function pl(e,n){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(c){$t(e,n,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){$t(e,n,c)}else l.current=null}function xg(e){var n=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(c){$t(e,e.return,c)}}function rf(e,n,l){try{var s=e.stateNode;K0(s,e.type,l,n),s[De]=n}catch(c){$t(e,e.return,c)}}function bg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&br(e.type)||e.tag===4}function sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&br(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function uf(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(e),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=na));else if(s!==4&&(s===27&&br(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for(uf(e,n,l),e=e.sibling;e!==null;)uf(e,n,l),e=e.sibling}function Eo(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(s!==4&&(s===27&&br(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Eo(e,n,l),e=e.sibling;e!==null;)Eo(e,n,l),e=e.sibling}function Sg(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Kn(n,s,l),n[ge]=e,n[De]=l}catch(h){$t(e,e.return,h)}}var Vl=!1,jn=!1,of=!1,wg=typeof WeakSet=="function"?WeakSet:Set,Bn=null;function C0(e,n){if(e=e.containerInfo,Af=Fo,e=_m(e),td(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var c=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var y=0,w=-1,A=-1,F=0,J=0,le=e,G=null;t:for(;;){for(var P;le!==l||c!==0&&le.nodeType!==3||(w=y+c),le!==h||s!==0&&le.nodeType!==3||(A=y+s),le.nodeType===3&&(y+=le.nodeValue.length),(P=le.firstChild)!==null;)G=le,le=P;for(;;){if(le===e)break t;if(G===l&&++F===c&&(w=y),G===h&&++J===s&&(A=y),(P=le.nextSibling)!==null)break;le=G,G=le.parentNode}le=P}l=w===-1||A===-1?null:{start:w,end:A}}else l=null}l=l||{start:0,end:0}}else l=null;for(Of={focusedElem:e,selectionRange:l},Fo=!1,Bn=n;Bn!==null;)if(n=Bn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Bn=e;else for(;Bn!==null;){switch(n=Bn,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)c=e[l],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,l=n,c=h.memoizedProps,h=h.memoizedState,s=l.stateNode;try{var Ae=Wr(l.type,c);e=s.getSnapshotBeforeUpdate(Ae,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(qe){$t(l,l.return,qe)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)_f(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_f(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=n.sibling,e!==null){e.return=n.return,Bn=e;break}Bn=n.return}}function Eg(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:Il(e,l),s&4&&Ui(5,l);break;case 1:if(Il(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(y){$t(l,l.return,y)}else{var c=Wr(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(y){$t(l,l.return,y)}}s&64&&vg(l),s&512&&Hi(l,l.return);break;case 3:if(Il(e,l),s&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{ip(e,n)}catch(y){$t(l,l.return,y)}}break;case 27:n===null&&s&4&&Sg(l);case 26:case 5:Il(e,l),n===null&&s&4&&xg(l),s&512&&Hi(l,l.return);break;case 12:Il(e,l);break;case 31:Il(e,l),s&4&&Tg(e,l);break;case 13:Il(e,l),s&4&&jg(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=H0.bind(null,l),lS(e,l))));break;case 22:if(s=l.memoizedState!==null||Vl,!s){n=n!==null&&n.memoizedState!==null||jn,c=Vl;var h=jn;Vl=s,(jn=n)&&!h?Gl(e,l,(l.subtreeFlags&8772)!==0):Il(e,l),Vl=c,jn=h}break;case 30:break;default:Il(e,l)}}function Ng(e){var n=e.alternate;n!==null&&(e.alternate=null,Ng(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&$e(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ln=null,ga=!1;function Fl(e,n,l){for(l=l.child;l!==null;)Rg(e,n,l),l=l.sibling}function Rg(e,n,l){if(re&&typeof re.onCommitFiberUnmount=="function")try{re.onCommitFiberUnmount(sn,l)}catch{}switch(l.tag){case 26:jn||pl(l,n),Fl(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:jn||pl(l,n);var s=ln,c=ga;br(l.type)&&(ln=l.stateNode,ga=!1),Fl(e,n,l),Xi(l.stateNode),ln=s,ga=c;break;case 5:jn||pl(l,n);case 6:if(s=ln,c=ga,ln=null,Fl(e,n,l),ln=s,ga=c,ln!==null)if(ga)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(l.stateNode)}catch(h){$t(l,n,h)}else try{ln.removeChild(l.stateNode)}catch(h){$t(l,n,h)}break;case 18:ln!==null&&(ga?(e=ln,vv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ys(e)):vv(ln,l.stateNode));break;case 4:s=ln,c=ga,ln=l.stateNode.containerInfo,ga=!0,Fl(e,n,l),ln=s,ga=c;break;case 0:case 11:case 14:case 15:hr(2,l,n),jn||hr(4,l,n),Fl(e,n,l);break;case 1:jn||(pl(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&yg(l,n,s)),Fl(e,n,l);break;case 21:Fl(e,n,l);break;case 22:jn=(s=jn)||l.memoizedState!==null,Fl(e,n,l),jn=s;break;default:Fl(e,n,l)}}function Tg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ys(e)}catch(l){$t(n,n.return,l)}}}function jg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ys(e)}catch(l){$t(n,n.return,l)}}function A0(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new wg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new wg),n;default:throw Error(i(435,e.tag))}}function No(e,n){var l=A0(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var c=B0.bind(null,e,s);s.then(c,c)}})}function va(e,n){var l=n.deletions;if(l!==null)for(var s=0;s<l.length;s++){var c=l[s],h=e,y=n,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(br(w.type)){ln=w.stateNode,ga=!1;break e}break;case 5:ln=w.stateNode,ga=!1;break e;case 3:case 4:ln=w.stateNode.containerInfo,ga=!0;break e}w=w.return}if(ln===null)throw Error(i(160));Rg(h,y,c),ln=null,ga=!1,h=c.alternate,h!==null&&(h.return=null),c.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Dg(n,e),n=n.sibling}var tl=null;function Dg(e,n){var l=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:va(n,e),ya(e),s&4&&(hr(3,e,e.return),Ui(3,e),hr(5,e,e.return));break;case 1:va(n,e),ya(e),s&512&&(jn||l===null||pl(l,l.return)),s&64&&Vl&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?s:l.concat(s))));break;case 26:var c=tl;if(va(n,e),ya(e),s&512&&(jn||l===null||pl(l,l.return)),s&4){var h=l!==null?l.memoizedState:null;if(s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null){e:{s=e.type,l=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":h=c.getElementsByTagName("title")[0],(!h||h[Ke]||h[ge]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=c.createElement(s),c.head.insertBefore(h,c.querySelector("head > title"))),Kn(h,s,l),h[ge]=e,ct(h),s=h;break e;case"link":var y=Dv("link","href",c).get(s+(l.href||""));if(y){for(var w=0;w<y.length;w++)if(h=y[w],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){y.splice(w,1);break t}}h=c.createElement(s),Kn(h,s,l),c.head.appendChild(h);break;case"meta":if(y=Dv("meta","content",c).get(s+(l.content||""))){for(w=0;w<y.length;w++)if(h=y[w],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){y.splice(w,1);break t}}h=c.createElement(s),Kn(h,s,l),c.head.appendChild(h);break;default:throw Error(i(468,s))}h[ge]=e,ct(h),s=h}e.stateNode=s}else Cv(c,e.type,e.stateNode);else e.stateNode=jv(c,s,e.memoizedProps);else h!==s?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,s===null?Cv(c,e.type,e.stateNode):jv(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&rf(e,e.memoizedProps,l.memoizedProps)}break;case 27:va(n,e),ya(e),s&512&&(jn||l===null||pl(l,l.return)),l!==null&&s&4&&rf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(va(n,e),ya(e),s&512&&(jn||l===null||pl(l,l.return)),e.flags&32){c=e.stateNode;try{nr(c,"")}catch(Ae){$t(e,e.return,Ae)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,rf(e,c,l!==null?l.memoizedProps:c)),s&1024&&(of=!0);break;case 6:if(va(n,e),ya(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,l=e.stateNode;try{l.nodeValue=s}catch(Ae){$t(e,e.return,Ae)}}break;case 3:if($o=null,c=tl,tl=Ho(n.containerInfo),va(n,e),tl=c,ya(e),s&4&&l!==null&&l.memoizedState.isDehydrated)try{Ys(n.containerInfo)}catch(Ae){$t(e,e.return,Ae)}of&&(of=!1,Cg(e));break;case 4:s=tl,tl=Ho(e.stateNode.containerInfo),va(n,e),ya(e),tl=s;break;case 12:va(n,e),ya(e);break;case 31:va(n,e),ya(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,No(e,s)));break;case 13:va(n,e),ya(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(To=fe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,No(e,s)));break;case 22:c=e.memoizedState!==null;var A=l!==null&&l.memoizedState!==null,F=Vl,J=jn;if(Vl=F||c,jn=J||A,va(n,e),jn=J,Vl=F,ya(e),s&8192)e:for(n=e.stateNode,n._visibility=c?n._visibility&-2:n._visibility|1,c&&(l===null||A||Vl||jn||es(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){A=l=n;try{if(h=A.stateNode,c)y=h.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=A.stateNode;var le=A.memoizedProps.style,G=le!=null&&le.hasOwnProperty("display")?le.display:null;w.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(Ae){$t(A,A.return,Ae)}}}else if(n.tag===6){if(l===null){A=n;try{A.stateNode.nodeValue=c?"":A.memoizedProps}catch(Ae){$t(A,A.return,Ae)}}}else if(n.tag===18){if(l===null){A=n;try{var P=A.stateNode;c?yv(P,!0):yv(A.stateNode,!1)}catch(Ae){$t(A,A.return,Ae)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(l=s.retryQueue,l!==null&&(s.retryQueue=null,No(e,l))));break;case 19:va(n,e),ya(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,No(e,s)));break;case 30:break;case 21:break;default:va(n,e),ya(e)}}function ya(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(bg(s)){l=s;break}s=s.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var c=l.stateNode,h=sf(e);Eo(e,h,c);break;case 5:var y=l.stateNode;l.flags&32&&(nr(y,""),l.flags&=-33);var w=sf(e);Eo(e,w,y);break;case 3:case 4:var A=l.stateNode.containerInfo,F=sf(e);uf(e,F,A);break;default:throw Error(i(161))}}catch(J){$t(e,e.return,J)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Cg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Cg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Il(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Eg(e,n.alternate,n),n=n.sibling}function es(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:hr(4,n,n.return),es(n);break;case 1:pl(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&yg(n,n.return,l),es(n);break;case 27:Xi(n.stateNode);case 26:case 5:pl(n,n.return),es(n);break;case 22:n.memoizedState===null&&es(n);break;case 30:es(n);break;default:es(n)}e=e.sibling}}function Gl(e,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,c=e,h=n,y=h.flags;switch(h.tag){case 0:case 11:case 15:Gl(c,h,l),Ui(4,h);break;case 1:if(Gl(c,h,l),s=h,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(F){$t(s,s.return,F)}if(s=h,c=s.updateQueue,c!==null){var w=s.stateNode;try{var A=c.shared.hiddenCallbacks;if(A!==null)for(c.shared.hiddenCallbacks=null,c=0;c<A.length;c++)sp(A[c],w)}catch(F){$t(s,s.return,F)}}l&&y&64&&vg(h),Hi(h,h.return);break;case 27:Sg(h);case 26:case 5:Gl(c,h,l),l&&s===null&&y&4&&xg(h),Hi(h,h.return);break;case 12:Gl(c,h,l);break;case 31:Gl(c,h,l),l&&y&4&&Tg(c,h);break;case 13:Gl(c,h,l),l&&y&4&&jg(c,h);break;case 22:h.memoizedState===null&&Gl(c,h,l),Hi(h,h.return);break;case 30:break;default:Gl(c,h,l)}n=n.sibling}}function cf(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ni(l))}function df(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ni(e))}function nl(e,n,l,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ag(e,n,l,s),n=n.sibling}function Ag(e,n,l,s){var c=n.flags;switch(n.tag){case 0:case 11:case 15:nl(e,n,l,s),c&2048&&Ui(9,n);break;case 1:nl(e,n,l,s);break;case 3:nl(e,n,l,s),c&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ni(e)));break;case 12:if(c&2048){nl(e,n,l,s),e=n.stateNode;try{var h=n.memoizedProps,y=h.id,w=h.onPostCommit;typeof w=="function"&&w(y,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){$t(n,n.return,A)}}else nl(e,n,l,s);break;case 31:nl(e,n,l,s);break;case 13:nl(e,n,l,s);break;case 23:break;case 22:h=n.stateNode,y=n.alternate,n.memoizedState!==null?h._visibility&2?nl(e,n,l,s):Bi(e,n):h._visibility&2?nl(e,n,l,s):(h._visibility|=2,Os(e,n,l,s,(n.subtreeFlags&10256)!==0||!1)),c&2048&&cf(y,n);break;case 24:nl(e,n,l,s),c&2048&&df(n.alternate,n);break;default:nl(e,n,l,s)}}function Os(e,n,l,s,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,y=n,w=l,A=s,F=y.flags;switch(y.tag){case 0:case 11:case 15:Os(h,y,w,A,c),Ui(8,y);break;case 23:break;case 22:var J=y.stateNode;y.memoizedState!==null?J._visibility&2?Os(h,y,w,A,c):Bi(h,y):(J._visibility|=2,Os(h,y,w,A,c)),c&&F&2048&&cf(y.alternate,y);break;case 24:Os(h,y,w,A,c),c&&F&2048&&df(y.alternate,y);break;default:Os(h,y,w,A,c)}n=n.sibling}}function Bi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,s=n,c=s.flags;switch(s.tag){case 22:Bi(l,s),c&2048&&cf(s.alternate,s);break;case 24:Bi(l,s),c&2048&&df(s.alternate,s);break;default:Bi(l,s)}n=n.sibling}}var $i=8192;function Ms(e,n,l){if(e.subtreeFlags&$i)for(e=e.child;e!==null;)Og(e,n,l),e=e.sibling}function Og(e,n,l){switch(e.tag){case 26:Ms(e,n,l),e.flags&$i&&e.memoizedState!==null&&gS(l,tl,e.memoizedState,e.memoizedProps);break;case 5:Ms(e,n,l);break;case 3:case 4:var s=tl;tl=Ho(e.stateNode.containerInfo),Ms(e,n,l),tl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=$i,$i=16777216,Ms(e,n,l),$i=s):Ms(e,n,l));break;default:Ms(e,n,l)}}function Mg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function qi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Bn=s,_g(s,e)}Mg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kg(e),e=e.sibling}function kg(e){switch(e.tag){case 0:case 11:case 15:qi(e),e.flags&2048&&hr(9,e,e.return);break;case 3:qi(e);break;case 12:qi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ro(e)):qi(e);break;default:qi(e)}}function Ro(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Bn=s,_g(s,e)}Mg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:hr(8,n,n.return),Ro(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Ro(n));break;default:Ro(n)}e=e.sibling}}function _g(e,n){for(;Bn!==null;){var l=Bn;switch(l.tag){case 0:case 11:case 15:hr(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ni(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,Bn=s;else e:for(l=e;Bn!==null;){s=Bn;var c=s.sibling,h=s.return;if(Ng(s),s===l){Bn=null;break e}if(c!==null){c.return=h,Bn=c;break e}Bn=h}}}var O0={getCacheForType:function(e){var n=Pn(Nn),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return Pn(Nn).controller.signal}},M0=typeof WeakMap=="function"?WeakMap:Map,At=0,Zt=null,ft=null,pt=0,Bt=0,Da=null,mr=!1,ks=!1,ff=!1,Xl=0,hn=0,pr=0,ts=0,hf=0,Ca=0,_s=0,Yi=null,xa=null,mf=!1,To=0,Lg=0,jo=1/0,Do=null,gr=null,kn=0,vr=null,Ls=null,Pl=0,pf=0,gf=null,zg=null,Vi=0,vf=null;function Aa(){return(At&2)!==0&&pt!==0?pt&-pt:z.T!==null?Ef():Z()}function Ug(){if(Ca===0)if((pt&536870912)===0||yt){var e=Xt;Xt<<=1,(Xt&3932160)===0&&(Xt=262144),Ca=e}else Ca=536870912;return e=Ta.current,e!==null&&(e.flags|=32),Ca}function ba(e,n,l){(e===Zt&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)&&(zs(e,0),yr(e,pt,Ca,!1)),dt(e,l),((At&2)===0||e!==Zt)&&(e===Zt&&((At&2)===0&&(ts|=l),hn===4&&yr(e,pt,Ca,!1)),gl(e))}function Hg(e,n,l){if((At&6)!==0)throw Error(i(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Tt(e,n),c=s?L0(e,n):xf(e,n,!0),h=s;do{if(c===0){ks&&!s&&yr(e,n,0,!1);break}else{if(l=e.current.alternate,h&&!k0(l)){c=xf(e,n,!1),h=!1;continue}if(c===2){if(h=n,e.errorRecoveryDisabledLanes&h)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var w=e;c=Yi;var A=w.current.memoizedState.isDehydrated;if(A&&(zs(w,y).flags|=256),y=xf(w,y,!1),y!==2){if(ff&&!A){w.errorRecoveryDisabledLanes|=h,ts|=h,c=4;break e}h=xa,xa=c,h!==null&&(xa===null?xa=h:xa.push.apply(xa,h))}c=y}if(h=!1,c!==2)continue}}if(c===1){zs(e,0),yr(e,n,0,!0);break}e:{switch(s=e,h=c,h){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:yr(s,n,Ca,!mr);break e;case 2:xa=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(c=To+300-fe(),10<c)){if(yr(s,n,Ca,!mr),zt(s,0,!0)!==0)break e;Pl=n,s.timeoutHandle=pv(Bg.bind(null,s,l,xa,Do,mf,n,Ca,ts,_s,mr,h,"Throttled",-0,0),c);break e}Bg(s,l,xa,Do,mf,n,Ca,ts,_s,mr,h,null,-0,0)}}break}while(!0);gl(e)}function Bg(e,n,l,s,c,h,y,w,A,F,J,le,G,P){if(e.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},Og(n,h,le);var Ae=(h&62914560)===h?To-fe():(h&4194048)===h?Lg-fe():0;if(Ae=vS(le,Ae),Ae!==null){Pl=h,e.cancelPendingCommit=Ae(Xg.bind(null,e,n,h,l,s,c,y,w,A,J,le,null,G,P)),yr(e,h,y,!F);return}}Xg(e,n,h,l,s,c,y,w,A)}function k0(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var s=0;s<l.length;s++){var c=l[s],h=c.getSnapshot;c=c.value;try{if(!Na(h(),c))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function yr(e,n,l,s){n&=~hf,n&=~ts,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var c=n;0<c;){var h=31-Mt(c),y=1<<h;s[h]=-1,c&=~y}l!==0&&bn(e,l,n)}function Co(){return(At&6)===0?(Fi(0),!1):!0}function yf(){if(ft!==null){if(Bt===0)var e=ft.return;else e=ft,Ul=Gr=null,kd(e),Ts=null,Ti=0,e=ft;for(;e!==null;)gg(e.alternate,e),e=e.return;ft=null}}function zs(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,W0(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Pl=0,yf(),Zt=e,ft=l=Ll(e.current,null),pt=n,Bt=0,Da=null,mr=!1,ks=Tt(e,n),ff=!1,_s=Ca=hf=ts=pr=hn=0,xa=Yi=null,mf=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var c=31-Mt(s),h=1<<c;n|=e[c],s&=~h}return Xl=n,Qu(),l}function $g(e,n){lt=null,z.H=_i,n===Rs||n===ao?(n=np(),Bt=3):n===Sd?(n=np(),Bt=4):Bt=n===Qd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Da=n,ft===null&&(hn=1,yo(e,Ha(n,e.current)))}function qg(){var e=Ta.current;return e===null?!0:(pt&4194048)===pt?Ya===null:(pt&62914560)===pt||(pt&536870912)!==0?e===Ya:!1}function Yg(){var e=z.H;return z.H=_i,e===null?_i:e}function Vg(){var e=z.A;return z.A=O0,e}function Ao(){hn=4,mr||(pt&4194048)!==pt&&Ta.current!==null||(ks=!0),(pr&134217727)===0&&(ts&134217727)===0||Zt===null||yr(Zt,pt,Ca,!1)}function xf(e,n,l){var s=At;At|=2;var c=Yg(),h=Vg();(Zt!==e||pt!==n)&&(Do=null,zs(e,n)),n=!1;var y=hn;e:do try{if(Bt!==0&&ft!==null){var w=ft,A=Da;switch(Bt){case 8:yf(),y=6;break e;case 3:case 2:case 9:case 6:Ta.current===null&&(n=!0);var F=Bt;if(Bt=0,Da=null,Us(e,w,A,F),l&&ks){y=0;break e}break;default:F=Bt,Bt=0,Da=null,Us(e,w,A,F)}}_0(),y=hn;break}catch(J){$g(e,J)}while(!0);return n&&e.shellSuspendCounter++,Ul=Gr=null,At=s,z.H=c,z.A=h,ft===null&&(Zt=null,pt=0,Qu()),y}function _0(){for(;ft!==null;)Fg(ft)}function L0(e,n){var l=At;At|=2;var s=Yg(),c=Vg();Zt!==e||pt!==n?(Do=null,jo=fe()+500,zs(e,n)):ks=Tt(e,n);e:do try{if(Bt!==0&&ft!==null){n=ft;var h=Da;t:switch(Bt){case 1:Bt=0,Da=null,Us(e,n,h,1);break;case 2:case 9:if(ep(h)){Bt=0,Da=null,Ig(n);break}n=function(){Bt!==2&&Bt!==9||Zt!==e||(Bt=7),gl(e)},h.then(n,n);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:ep(h)?(Bt=0,Da=null,Ig(n)):(Bt=0,Da=null,Us(e,n,h,7));break;case 5:var y=null;switch(ft.tag){case 26:y=ft.memoizedState;case 5:case 27:var w=ft;if(y?Av(y):w.stateNode.complete){Bt=0,Da=null;var A=w.sibling;if(A!==null)ft=A;else{var F=w.return;F!==null?(ft=F,Oo(F)):ft=null}break t}}Bt=0,Da=null,Us(e,n,h,5);break;case 6:Bt=0,Da=null,Us(e,n,h,6);break;case 8:yf(),hn=6;break e;default:throw Error(i(462))}}z0();break}catch(J){$g(e,J)}while(!0);return Ul=Gr=null,z.H=s,z.A=c,At=l,ft!==null?0:(Zt=null,pt=0,Qu(),hn)}function z0(){for(;ft!==null&&!Yn();)Fg(ft)}function Fg(e){var n=mg(e.alternate,e,Xl);e.memoizedProps=e.pendingProps,n===null?Oo(e):ft=n}function Ig(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=ug(l,n,n.pendingProps,n.type,void 0,pt);break;case 11:n=ug(l,n,n.pendingProps,n.type.render,n.ref,pt);break;case 5:kd(n);default:gg(l,n),n=ft=Vm(n,Xl),n=mg(l,n,Xl)}e.memoizedProps=e.pendingProps,n===null?Oo(e):ft=n}function Us(e,n,l,s){Ul=Gr=null,kd(n),Ts=null,Ti=0;var c=n.return;try{if(N0(e,c,n,l,pt)){hn=1,yo(e,Ha(l,e.current)),ft=null;return}}catch(h){if(c!==null)throw ft=c,h;hn=1,yo(e,Ha(l,e.current)),ft=null;return}n.flags&32768?(yt||s===1?e=!0:ks||(pt&536870912)!==0?e=!1:(mr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ta.current,s!==null&&s.tag===13&&(s.flags|=16384))),Gg(n,e)):Oo(n)}function Oo(e){var n=e;do{if((n.flags&32768)!==0){Gg(n,mr);return}e=n.return;var l=j0(n.alternate,n,Xl);if(l!==null){ft=l;return}if(n=n.sibling,n!==null){ft=n;return}ft=n=e}while(n!==null);hn===0&&(hn=5)}function Gg(e,n){do{var l=D0(e.alternate,e);if(l!==null){l.flags&=32767,ft=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){ft=e;return}ft=e=l}while(e!==null);hn=6,ft=null}function Xg(e,n,l,s,c,h,y,w,A){e.cancelPendingCommit=null;do Mo();while(kn!==0);if((At&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(h=n.lanes|n.childLanes,h|=sd,Ze(e,l,h,y,w,A),e===Zt&&(ft=Zt=null,pt=0),Ls=n,vr=e,Pl=l,pf=h,gf=c,zg=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$0(nt,function(){return Jg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=z.T,z.T=null,c=B.p,B.p=2,y=At,At|=4;try{C0(e,n,l)}finally{At=y,B.p=c,z.T=s}}kn=1,Pg(),Qg(),Kg()}}function Pg(){if(kn===1){kn=0;var e=vr,n=Ls,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=z.T,z.T=null;var s=B.p;B.p=2;var c=At;At|=4;try{Dg(n,e);var h=Of,y=_m(e.containerInfo),w=h.focusedElem,A=h.selectionRange;if(y!==w&&w&&w.ownerDocument&&km(w.ownerDocument.documentElement,w)){if(A!==null&&td(w)){var F=A.start,J=A.end;if(J===void 0&&(J=F),"selectionStart"in w)w.selectionStart=F,w.selectionEnd=Math.min(J,w.value.length);else{var le=w.ownerDocument||document,G=le&&le.defaultView||window;if(G.getSelection){var P=G.getSelection(),Ae=w.textContent.length,qe=Math.min(A.start,Ae),Ft=A.end===void 0?qe:Math.min(A.end,Ae);!P.extend&&qe>Ft&&(y=Ft,Ft=qe,qe=y);var H=Mm(w,qe),_=Mm(w,Ft);if(H&&_&&(P.rangeCount!==1||P.anchorNode!==H.node||P.anchorOffset!==H.offset||P.focusNode!==_.node||P.focusOffset!==_.offset)){var V=le.createRange();V.setStart(H.node,H.offset),P.removeAllRanges(),qe>Ft?(P.addRange(V),P.extend(_.node,_.offset)):(V.setEnd(_.node,_.offset),P.addRange(V))}}}}for(le=[],P=w;P=P.parentNode;)P.nodeType===1&&le.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<le.length;w++){var te=le[w];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Fo=!!Af,Of=Af=null}finally{At=c,B.p=s,z.T=l}}e.current=n,kn=2}}function Qg(){if(kn===2){kn=0;var e=vr,n=Ls,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=z.T,z.T=null;var s=B.p;B.p=2;var c=At;At|=4;try{Eg(e,n.alternate,n)}finally{At=c,B.p=s,z.T=l}}kn=3}}function Kg(){if(kn===4||kn===3){kn=0,Vn();var e=vr,n=Ls,l=Pl,s=zg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?kn=5:(kn=0,Ls=vr=null,Zg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(gr=null),$(l),n=n.stateNode,re&&typeof re.onCommitFiberRoot=="function")try{re.onCommitFiberRoot(sn,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=z.T,c=B.p,B.p=2,z.T=null;try{for(var h=e.onRecoverableError,y=0;y<s.length;y++){var w=s[y];h(w.value,{componentStack:w.stack})}}finally{z.T=n,B.p=c}}(Pl&3)!==0&&Mo(),gl(e),c=e.pendingLanes,(l&261930)!==0&&(c&42)!==0?e===vf?Vi++:(Vi=0,vf=e):Vi=0,Fi(0)}}function Zg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Ni(n)))}function Mo(){return Pg(),Qg(),Kg(),Jg()}function Jg(){if(kn!==5)return!1;var e=vr,n=pf;pf=0;var l=$(Pl),s=z.T,c=B.p;try{B.p=32>l?32:l,z.T=null,l=gf,gf=null;var h=vr,y=Pl;if(kn=0,Ls=vr=null,Pl=0,(At&6)!==0)throw Error(i(331));var w=At;if(At|=4,kg(h.current),Ag(h,h.current,y,l),At=w,Fi(0,!1),re&&typeof re.onPostCommitFiberRoot=="function")try{re.onPostCommitFiberRoot(sn,h)}catch{}return!0}finally{B.p=c,z.T=s,Zg(e,n)}}function Wg(e,n,l){n=Ha(l,n),n=Pd(e.stateNode,n,2),e=cr(e,n,2),e!==null&&(dt(e,2),gl(e))}function $t(e,n,l){if(e.tag===3)Wg(e,e,l);else for(;n!==null;){if(n.tag===3){Wg(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(gr===null||!gr.has(s))){e=Ha(l,e),l=eg(2),s=cr(n,l,2),s!==null&&(tg(l,s,n,e),dt(s,2),gl(s));break}}n=n.return}}function bf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new M0;var c=new Set;s.set(n,c)}else c=s.get(n),c===void 0&&(c=new Set,s.set(n,c));c.has(l)||(ff=!0,c.add(l),e=U0.bind(null,e,n,l),n.then(e,e))}function U0(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Zt===e&&(pt&l)===l&&(hn===4||hn===3&&(pt&62914560)===pt&&300>fe()-To?(At&2)===0&&zs(e,0):hf|=l,_s===pt&&(_s=0)),gl(e)}function ev(e,n){n===0&&(n=Pt()),e=Vr(e,n),e!==null&&(dt(e,n),gl(e))}function H0(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),ev(e,l)}function B0(e,n){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),ev(e,l)}function $0(e,n){return Lt(e,n)}var ko=null,Hs=null,Sf=!1,_o=!1,wf=!1,xr=0;function gl(e){e!==Hs&&e.next===null&&(Hs===null?ko=Hs=e:Hs=Hs.next=e),_o=!0,Sf||(Sf=!0,Y0())}function Fi(e,n){if(!wf&&_o){wf=!0;do for(var l=!1,s=ko;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var h=0;else{var y=s.suspendedLanes,w=s.pingedLanes;h=(1<<31-Mt(42|e)+1)-1,h&=c&~(y&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,lv(s,h))}else h=pt,h=zt(s,s===Zt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Tt(s,h)||(l=!0,lv(s,h));s=s.next}while(l);wf=!1}}function q0(){tv()}function tv(){_o=Sf=!1;var e=0;xr!==0&&J0()&&(e=xr);for(var n=fe(),l=null,s=ko;s!==null;){var c=s.next,h=nv(s,n);h===0?(s.next=null,l===null?ko=c:l.next=c,c===null&&(Hs=l)):(l=s,(e!==0||(h&3)!==0)&&(_o=!0)),s=c}kn!==0&&kn!==5||Fi(e),xr!==0&&(xr=0)}function nv(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var y=31-Mt(h),w=1<<y,A=c[y];A===-1?((w&l)===0||(w&s)!==0)&&(c[y]=Wt(w,n)):A<=n&&(e.expiredLanes|=w),h&=~w}if(n=Zt,l=pt,l=zt(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Jt(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Tt(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&Jt(s),$(l)){case 2:case 8:l=Ve;break;case 32:l=nt;break;case 268435456:l=Gt;break;default:l=nt}return s=av.bind(null,e),l=Lt(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&Jt(s),e.callbackPriority=2,e.callbackNode=null,2}function av(e,n){if(kn!==0&&kn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Mo()&&e.callbackNode!==l)return null;var s=pt;return s=zt(e,e===Zt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Hg(e,s,n),nv(e,fe()),e.callbackNode!=null&&e.callbackNode===l?av.bind(null,e):null)}function lv(e,n){if(Mo())return null;Hg(e,n,!0)}function Y0(){eS(function(){(At&6)!==0?Lt(ke,q0):tv()})}function Ef(){if(xr===0){var e=Es;e===0&&(e=Be,Be<<=1,(Be&261888)===0&&(Be=256)),xr=e}return xr}function rv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:en(""+e)}function sv(e,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,e.id&&l.setAttribute("form",e.id),n.parentNode.insertBefore(l,n),e=new FormData(e),l.parentNode.removeChild(l),e}function V0(e,n,l,s,c){if(n==="submit"&&l&&l.stateNode===c){var h=rv((c[De]||null).action),y=s.submitter;y&&(n=(n=y[De]||null)?rv(n.formAction):y.getAttribute("formAction"),n!==null&&(h=n,y=null));var w=new kl("action","action",null,s,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xr!==0){var A=y?sv(c,y):new FormData(c);Yd(l,{pending:!0,data:A,method:c.method,action:h},null,A)}}else typeof h=="function"&&(w.preventDefault(),A=y?sv(c,y):new FormData(c),Yd(l,{pending:!0,data:A,method:c.method,action:h},h,A))},currentTarget:c}]})}}for(var Nf=0;Nf<rd.length;Nf++){var Rf=rd[Nf],F0=Rf.toLowerCase(),I0=Rf[0].toUpperCase()+Rf.slice(1);el(F0,"on"+I0)}el(Um,"onAnimationEnd"),el(Hm,"onAnimationIteration"),el(Bm,"onAnimationStart"),el("dblclick","onDoubleClick"),el("focusin","onFocus"),el("focusout","onBlur"),el(i0,"onTransitionRun"),el(u0,"onTransitionStart"),el(o0,"onTransitionCancel"),el($m,"onTransitionEnd"),An("onMouseEnter",["mouseout","mouseover"]),An("onMouseLeave",["mouseout","mouseover"]),An("onPointerEnter",["pointerout","pointerover"]),An("onPointerLeave",["pointerout","pointerover"]),Sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),G0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function iv(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var s=e[l],c=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var y=s.length-1;0<=y;y--){var w=s[y],A=w.instance,F=w.currentTarget;if(w=w.listener,A!==h&&c.isPropagationStopped())break e;h=w,c.currentTarget=F;try{h(c)}catch(J){Pu(J)}c.currentTarget=null,h=A}else for(y=0;y<s.length;y++){if(w=s[y],A=w.instance,F=w.currentTarget,w=w.listener,A!==h&&c.isPropagationStopped())break e;h=w,c.currentTarget=F;try{h(c)}catch(J){Pu(J)}c.currentTarget=null,h=A}}}}function ht(e,n){var l=n[Oe];l===void 0&&(l=n[Oe]=new Set);var s=e+"__bubble";l.has(s)||(uv(n,e,2,!1),l.add(s))}function Tf(e,n,l){var s=0;n&&(s|=4),uv(l,e,s,n)}var Lo="_reactListening"+Math.random().toString(36).slice(2);function jf(e){if(!e[Lo]){e[Lo]=!0,Qt.forEach(function(l){l!=="selectionchange"&&(G0.has(l)||Tf(l,!1,e),Tf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Lo]||(n[Lo]=!0,Tf("selectionchange",!1,n))}}function uv(e,n,l,s){switch(Uv(n)){case 2:var c=bS;break;case 8:c=SS;break;default:c=Yf}l=c.bind(null,n,l,e),c=void 0,!pi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(n,l,{capture:!0,passive:c}):e.addEventListener(n,l,!0):c!==void 0?e.addEventListener(n,l,{passive:c}):e.addEventListener(n,l,!1)}function Df(e,n,l,s,c){var h=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var y=s.tag;if(y===3||y===4){var w=s.stateNode.containerInfo;if(w===c)break;if(y===4)for(y=s.return;y!==null;){var A=y.tag;if((A===3||A===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;w!==null;){if(y=Ht(w),y===null)return;if(A=y.tag,A===5||A===6||A===26||A===27){s=h=y;continue e}w=w.parentNode}}s=s.return}mi(function(){var F=h,J=Dl(l),le=[];e:{var G=qm.get(e);if(G!==void 0){var P=kl,Ae=e;switch(e){case"keypress":if(hs(l)===0)break e;case"keydown":case"keyup":P=En;break;case"focusin":Ae="focus",P=ve;break;case"focusout":Ae="blur",P=ve;break;case"beforeblur":case"afterblur":P=ve;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":P=Fu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=I;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=fl;break;case Um:case Hm:case Bm:P=ue;break;case $m:P=Iu;break;case"scroll":case"scrollend":P=Pc;break;case"wheel":P=Kc;break;case"copy":case"cut":case"paste":P=xe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=_t;break;case"toggle":case"beforetoggle":P=Pb}var qe=(n&4)!==0,Ft=!qe&&(e==="scroll"||e==="scrollend"),H=qe?G!==null?G+"Capture":null:G;qe=[];for(var _=F,V;_!==null;){var te=_;if(V=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||V===null||H===null||(te=La(_,H),te!=null&&qe.push(Gi(_,te,V))),Ft)break;_=_.return}0<qe.length&&(G=new P(G,Ae,null,l,J),le.push({event:G,listeners:qe}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",G&&l!==Ea&&(Ae=l.relatedTarget||l.fromElement)&&(Ht(Ae)||Ae[we]))break e;if((P||G)&&(G=J.window===J?J:(G=J.ownerDocument)?G.defaultView||G.parentWindow:window,P?(Ae=l.relatedTarget||l.toElement,P=F,Ae=Ae?Ht(Ae):null,Ae!==null&&(Ft=o(Ae),qe=Ae.tag,Ae!==Ft||qe!==5&&qe!==27&&qe!==6)&&(Ae=null)):(P=null,Ae=F),P!==Ae)){if(qe=Fu,te="onMouseLeave",H="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(qe=_t,te="onPointerLeave",H="onPointerEnter",_="pointer"),Ft=P==null?G:ot(P),V=Ae==null?G:ot(Ae),G=new qe(te,_+"leave",P,l,J),G.target=Ft,G.relatedTarget=V,te=null,Ht(J)===F&&(qe=new qe(H,_+"enter",Ae,l,J),qe.target=V,qe.relatedTarget=Ft,te=qe),Ft=te,P&&Ae)t:{for(qe=X0,H=P,_=Ae,V=0,te=H;te;te=qe(te))V++;te=0;for(var He=_;He;He=qe(He))te++;for(;0<V-te;)H=qe(H),V--;for(;0<te-V;)_=qe(_),te--;for(;V--;){if(H===_||_!==null&&H===_.alternate){qe=H;break t}H=qe(H),_=qe(_)}qe=null}else qe=null;P!==null&&ov(le,G,P,qe,!1),Ae!==null&&Ft!==null&&ov(le,Ft,Ae,qe,!0)}}e:{if(G=F?ot(F):window,P=G.nodeName&&G.nodeName.toLowerCase(),P==="select"||P==="input"&&G.type==="file")var Dt=Tm;else if(Nm(G))if(jm)Dt=l0;else{Dt=n0;var Me=t0}else P=G.nodeName,!P||P.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&zr(F.elementType)&&(Dt=Tm):Dt=a0;if(Dt&&(Dt=Dt(e,F))){Rm(le,Dt,l,J);break e}Me&&Me(e,G,F),e==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&jt(G,"number",G.value)}switch(Me=F?ot(F):window,e){case"focusin":(Nm(Me)||Me.contentEditable==="true")&&(ps=Me,nd=F,Si=null);break;case"focusout":Si=nd=ps=null;break;case"mousedown":ad=!0;break;case"contextmenu":case"mouseup":case"dragend":ad=!1,Lm(le,l,J);break;case"selectionchange":if(s0)break;case"keydown":case"keyup":Lm(le,l,J)}var st;if(Jc)e:{switch(e){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else ms?wm(e,l)&&(gt="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(gt="onCompositionStart");gt&&(xm&&l.locale!=="ko"&&(ms||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&ms&&(st=Yu()):(za=J,gi="value"in za?za.value:za.textContent,ms=!0)),Me=zo(F,gt),0<Me.length&&(gt=new at(gt,e,null,l,J),le.push({event:gt,listeners:Me}),st?gt.data=st:(st=Em(l),st!==null&&(gt.data=st)))),(st=Kb?Zb(e,l):Jb(e,l))&&(gt=zo(F,"onBeforeInput"),0<gt.length&&(Me=new at("onBeforeInput","beforeinput",null,l,J),le.push({event:Me,listeners:gt}),Me.data=st)),V0(le,e,F,l,J)}iv(le,n)})}function Gi(e,n,l){return{instance:e,listener:n,currentTarget:l}}function zo(e,n){for(var l=n+"Capture",s=[];e!==null;){var c=e,h=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||h===null||(c=La(e,l),c!=null&&s.unshift(Gi(e,c,h)),c=La(e,n),c!=null&&s.push(Gi(e,c,h))),e.tag===3)return s;e=e.return}return[]}function X0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ov(e,n,l,s,c){for(var h=n._reactName,y=[];l!==null&&l!==s;){var w=l,A=w.alternate,F=w.stateNode;if(w=w.tag,A!==null&&A===s)break;w!==5&&w!==26&&w!==27||F===null||(A=F,c?(F=La(l,h),F!=null&&y.unshift(Gi(l,F,A))):c||(F=La(l,h),F!=null&&y.push(Gi(l,F,A)))),l=l.return}y.length!==0&&e.push({event:n,listeners:y})}var P0=/\r\n?/g,Q0=/\u0000|\uFFFD/g;function cv(e){return(typeof e=="string"?e:""+e).replace(P0,`
|
|
49
|
+
`).replace(Q0,"")}function dv(e,n){return n=cv(n),cv(e)===n}function Vt(e,n,l,s,c,h){switch(l){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||nr(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&nr(e,""+s);break;case"className":ul(e,"class",s);break;case"tabIndex":ul(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ul(e,l,s);break;case"style":ha(e,s,h);break;case"data":if(n!=="object"){ul(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=en(""+s),e.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(l==="formAction"?(n!=="input"&&Vt(e,n,"name",c.name,c,null),Vt(e,n,"formEncType",c.formEncType,c,null),Vt(e,n,"formMethod",c.formMethod,c,null),Vt(e,n,"formTarget",c.formTarget,c,null)):(Vt(e,n,"encType",c.encType,c,null),Vt(e,n,"method",c.method,c,null),Vt(e,n,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=en(""+s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=na);break;case"onScroll":s!=null&&ht("scroll",e);break;case"onScrollEnd":s!=null&&ht("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(l=s.__html,l!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=l}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}l=en(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""+s):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":s===!0?e.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(l,s):e.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(l):e.setAttribute(l,s);break;case"popover":ht("beforetoggle",e),ht("toggle",e),ea(e,"popover",s);break;case"xlinkActuate":Pe(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Pe(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Pe(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Pe(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Pe(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Pe(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Pe(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Pe(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Pe(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":ea(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ds.get(l)||l,ea(e,l,s))}}function Cf(e,n,l,s,c,h){switch(l){case"style":ha(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(l=s.__html,l!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=l}}break;case"children":typeof s=="string"?nr(e,s):(typeof s=="number"||typeof s=="bigint")&&nr(e,""+s);break;case"onScroll":s!=null&&ht("scroll",e);break;case"onScrollEnd":s!=null&&ht("scrollend",e);break;case"onClick":s!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fn.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(c=l.endsWith("Capture"),n=l.slice(2,c?l.length-7:void 0),h=e[De]||null,h=h!=null?h[l]:null,typeof h=="function"&&e.removeEventListener(n,h,c),typeof s=="function")){typeof h!="function"&&h!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(n,s,c);break e}l in e?e[l]=s:s===!0?e.setAttribute(l,""):ea(e,l,s)}}}function Kn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",e),ht("load",e);var s=!1,c=!1,h;for(h in l)if(l.hasOwnProperty(h)){var y=l[h];if(y!=null)switch(h){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Vt(e,n,h,y,l,null)}}c&&Vt(e,n,"srcSet",l.srcSet,l,null),s&&Vt(e,n,"src",l.src,l,null);return;case"input":ht("invalid",e);var w=h=y=c=null,A=null,F=null;for(s in l)if(l.hasOwnProperty(s)){var J=l[s];if(J!=null)switch(s){case"name":c=J;break;case"type":y=J;break;case"checked":A=J;break;case"defaultChecked":F=J;break;case"value":h=J;break;case"defaultValue":w=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,n));break;default:Vt(e,n,s,J,l,null)}}fi(e,h,w,A,F,y,c,!1);return;case"select":ht("invalid",e),s=y=h=null;for(c in l)if(l.hasOwnProperty(c)&&(w=l[c],w!=null))switch(c){case"value":h=w;break;case"defaultValue":y=w;break;case"multiple":s=w;default:Vt(e,n,c,w,l,null)}n=h,l=y,e.multiple=!!s,n!=null?ol(e,!!s,n,!1):l!=null&&ol(e,!!s,l,!0);return;case"textarea":ht("invalid",e),h=c=s=null;for(y in l)if(l.hasOwnProperty(y)&&(w=l[y],w!=null))switch(y){case"value":s=w;break;case"defaultValue":c=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:Vt(e,n,y,w,l,null)}Ja(e,s,c,h);return;case"option":for(A in l)if(l.hasOwnProperty(A)&&(s=l[A],s!=null))switch(A){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Vt(e,n,A,s,l,null)}return;case"dialog":ht("beforetoggle",e),ht("toggle",e),ht("cancel",e),ht("close",e);break;case"iframe":case"object":ht("load",e);break;case"video":case"audio":for(s=0;s<Ii.length;s++)ht(Ii[s],e);break;case"image":ht("error",e),ht("load",e);break;case"details":ht("toggle",e);break;case"embed":case"source":case"link":ht("error",e),ht("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(s=l[F],s!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Vt(e,n,F,s,l,null)}return;default:if(zr(n)){for(J in l)l.hasOwnProperty(J)&&(s=l[J],s!==void 0&&Cf(e,n,J,s,l,void 0));return}}for(w in l)l.hasOwnProperty(w)&&(s=l[w],s!=null&&Vt(e,n,w,s,l,null))}function K0(e,n,l,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,h=null,y=null,w=null,A=null,F=null,J=null;for(P in l){var le=l[P];if(l.hasOwnProperty(P)&&le!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":A=le;default:s.hasOwnProperty(P)||Vt(e,n,P,null,s,le)}}for(var G in s){var P=s[G];if(le=l[G],s.hasOwnProperty(G)&&(P!=null||le!=null))switch(G){case"type":h=P;break;case"name":c=P;break;case"checked":F=P;break;case"defaultChecked":J=P;break;case"value":y=P;break;case"defaultValue":w=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,n));break;default:P!==le&&Vt(e,n,G,P,s,le)}}Lr(e,y,w,A,F,J,h,c);return;case"select":P=y=w=G=null;for(h in l)if(A=l[h],l.hasOwnProperty(h)&&A!=null)switch(h){case"value":break;case"multiple":P=A;default:s.hasOwnProperty(h)||Vt(e,n,h,null,s,A)}for(c in s)if(h=s[c],A=l[c],s.hasOwnProperty(c)&&(h!=null||A!=null))switch(c){case"value":G=h;break;case"defaultValue":w=h;break;case"multiple":y=h;default:h!==A&&Vt(e,n,c,h,s,A)}n=w,l=y,s=P,G!=null?ol(e,!!l,G,!1):!!s!=!!l&&(n!=null?ol(e,!!l,n,!0):ol(e,!!l,l?[]:"",!1));return;case"textarea":P=G=null;for(w in l)if(c=l[w],l.hasOwnProperty(w)&&c!=null&&!s.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Vt(e,n,w,null,s,c)}for(y in s)if(c=s[y],h=l[y],s.hasOwnProperty(y)&&(c!=null||h!=null))switch(y){case"value":G=c;break;case"defaultValue":P=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==h&&Vt(e,n,y,c,s,h)}qu(e,G,P);return;case"option":for(var Ae in l)if(G=l[Ae],l.hasOwnProperty(Ae)&&G!=null&&!s.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:Vt(e,n,Ae,null,s,G)}for(A in s)if(G=s[A],P=l[A],s.hasOwnProperty(A)&&G!==P&&(G!=null||P!=null))switch(A){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Vt(e,n,A,G,s,P)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var qe in l)G=l[qe],l.hasOwnProperty(qe)&&G!=null&&!s.hasOwnProperty(qe)&&Vt(e,n,qe,null,s,G);for(F in s)if(G=s[F],P=l[F],s.hasOwnProperty(F)&&G!==P&&(G!=null||P!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Vt(e,n,F,G,s,P)}return;default:if(zr(n)){for(var Ft in l)G=l[Ft],l.hasOwnProperty(Ft)&&G!==void 0&&!s.hasOwnProperty(Ft)&&Cf(e,n,Ft,void 0,s,G);for(J in s)G=s[J],P=l[J],!s.hasOwnProperty(J)||G===P||G===void 0&&P===void 0||Cf(e,n,J,G,s,P);return}}for(var H in l)G=l[H],l.hasOwnProperty(H)&&G!=null&&!s.hasOwnProperty(H)&&Vt(e,n,H,null,s,G);for(le in s)G=s[le],P=l[le],!s.hasOwnProperty(le)||G===P||G==null&&P==null||Vt(e,n,le,G,s,P)}function fv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var c=l[s],h=c.transferSize,y=c.initiatorType,w=c.duration;if(h&&w&&fv(y)){for(y=0,w=c.responseEnd,s+=1;s<l.length;s++){var A=l[s],F=A.startTime;if(F>w)break;var J=A.transferSize,le=A.initiatorType;J&&fv(le)&&(A=A.responseEnd,y+=J*(A<w?1:(w-F)/(A-F)))}if(--s,n+=8*(h+y)/(c.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Af=null,Of=null;function Uo(e){return e.nodeType===9?e:e.ownerDocument}function hv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Mf(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var kf=null;function J0(){var e=window.event;return e&&e.type==="popstate"?e===kf?!1:(kf=e,!0):(kf=null,!1)}var pv=typeof setTimeout=="function"?setTimeout:void 0,W0=typeof clearTimeout=="function"?clearTimeout:void 0,gv=typeof Promise=="function"?Promise:void 0,eS=typeof queueMicrotask=="function"?queueMicrotask:typeof gv<"u"?function(e){return gv.resolve(null).then(e).catch(tS)}:pv;function tS(e){setTimeout(function(){throw e})}function br(e){return e==="head"}function vv(e,n){var l=n,s=0;do{var c=l.nextSibling;if(e.removeChild(l),c&&c.nodeType===8)if(l=c.data,l==="/$"||l==="/&"){if(s===0){e.removeChild(c),Ys(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")Xi(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Xi(l);for(var h=l.firstChild;h;){var y=h.nextSibling,w=h.nodeName;h[Ke]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=y}}else l==="body"&&Xi(e.ownerDocument.body);l=c}while(l);Ys(n)}function yv(e,n){var l=e;e=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=s}while(l)}function _f(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":_f(l),$e(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function nS(e,n,l,s){for(;e.nodeType===1;){var c=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ke])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Va(e.nextSibling),e===null)break}return null}function aS(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Va(e.nextSibling),e===null))return null;return e}function xv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Va(e.nextSibling),e===null))return null;return e}function Lf(e){return e.data==="$?"||e.data==="$~"}function zf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lS(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Va(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Uf=null;function bv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return Va(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function Sv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function wv(e,n,l){switch(n=Uo(l),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Xi(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);$e(e)}var Fa=new Map,Ev=new Set;function Ho(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ql=B.d;B.d={f:rS,r:sS,D:iS,C:uS,L:oS,m:cS,X:fS,S:dS,M:hS};function rS(){var e=Ql.f(),n=Co();return e||n}function sS(e){var n=Je(e);n!==null&&n.tag===5&&n.type==="form"?$p(n):Ql.r(e)}var Bs=typeof document>"u"?null:document;function Nv(e,n,l){var s=Bs;if(s&&typeof n=="string"&&n){var c=Gn(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),Ev.has(c)||(Ev.add(c),e={rel:e,crossOrigin:l,href:n},s.querySelector(c)===null&&(n=s.createElement("link"),Kn(n,"link",e),ct(n),s.head.appendChild(n)))}}function iS(e){Ql.D(e),Nv("dns-prefetch",e,null)}function uS(e,n){Ql.C(e,n),Nv("preconnect",e,n)}function oS(e,n,l){Ql.L(e,n,l);var s=Bs;if(s&&e&&n){var c='link[rel="preload"][as="'+Gn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+Gn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+Gn(l.imageSizes)+'"]')):c+='[href="'+Gn(e)+'"]';var h=c;switch(n){case"style":h=$s(e);break;case"script":h=qs(e)}Fa.has(h)||(e=b({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),Fa.set(h,e),s.querySelector(c)!==null||n==="style"&&s.querySelector(Pi(h))||n==="script"&&s.querySelector(Qi(h))||(n=s.createElement("link"),Kn(n,"link",e),ct(n),s.head.appendChild(n)))}}function cS(e,n){Ql.m(e,n);var l=Bs;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+Gn(s)+'"][href="'+Gn(e)+'"]',h=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=qs(e)}if(!Fa.has(h)&&(e=b({rel:"modulepreload",href:e},n),Fa.set(h,e),l.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qi(h)))return}s=l.createElement("link"),Kn(s,"link",e),ct(s),l.head.appendChild(s)}}}function dS(e,n,l){Ql.S(e,n,l);var s=Bs;if(s&&e){var c=rt(s).hoistableStyles,h=$s(e);n=n||"default";var y=c.get(h);if(!y){var w={loading:0,preload:null};if(y=s.querySelector(Pi(h)))w.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},l),(l=Fa.get(h))&&Hf(e,l);var A=y=s.createElement("link");ct(A),Kn(A,"link",e),A._p=new Promise(function(F,J){A.onload=F,A.onerror=J}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Bo(y,n,s)}y={type:"stylesheet",instance:y,count:1,state:w},c.set(h,y)}}}function fS(e,n){Ql.X(e,n);var l=Bs;if(l&&e){var s=rt(l).hoistableScripts,c=qs(e),h=s.get(c);h||(h=l.querySelector(Qi(c)),h||(e=b({src:e,async:!0},n),(n=Fa.get(c))&&Bf(e,n),h=l.createElement("script"),ct(h),Kn(h,"link",e),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(c,h))}}function hS(e,n){Ql.M(e,n);var l=Bs;if(l&&e){var s=rt(l).hoistableScripts,c=qs(e),h=s.get(c);h||(h=l.querySelector(Qi(c)),h||(e=b({src:e,async:!0,type:"module"},n),(n=Fa.get(c))&&Bf(e,n),h=l.createElement("script"),ct(h),Kn(h,"link",e),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(c,h))}}function Rv(e,n,l,s){var c=(c=Ne.current)?Ho(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=$s(l.href),l=rt(c).hoistableStyles,s=l.get(n),s||(s={type:"style",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=$s(l.href);var h=rt(c).hoistableStyles,y=h.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,y),(h=c.querySelector(Pi(e)))&&!h._p&&(y.instance=h,y.state.loading=5),Fa.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Fa.set(e,l),h||mS(c,e,l,y.state))),n&&s===null)throw Error(i(528,""));return y}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=qs(l),l=rt(c).hoistableScripts,s=l.get(n),s||(s={type:"script",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function $s(e){return'href="'+Gn(e)+'"'}function Pi(e){return'link[rel="stylesheet"]['+e+"]"}function Tv(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function mS(e,n,l,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),Kn(n,"link",l),ct(n),e.head.appendChild(n))}function qs(e){return'[src="'+Gn(e)+'"]'}function Qi(e){return"script[async]"+e}function jv(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Gn(l.href)+'"]');if(s)return n.instance=s,ct(s),s;var c=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ct(s),Kn(s,"style",c),Bo(s,l.precedence,e),n.instance=s;case"stylesheet":c=$s(l.href);var h=e.querySelector(Pi(c));if(h)return n.state.loading|=4,n.instance=h,ct(h),h;s=Tv(l),(c=Fa.get(c))&&Hf(s,c),h=(e.ownerDocument||e).createElement("link"),ct(h);var y=h;return y._p=new Promise(function(w,A){y.onload=w,y.onerror=A}),Kn(h,"link",s),n.state.loading|=4,Bo(h,l.precedence,e),n.instance=h;case"script":return h=qs(l.src),(c=e.querySelector(Qi(h)))?(n.instance=c,ct(c),c):(s=l,(c=Fa.get(h))&&(s=b({},l),Bf(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),ct(c),Kn(c,"link",s),e.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Bo(s,l.precedence,e));return n.instance}function Bo(e,n,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,h=c,y=0;y<s.length;y++){var w=s[y];if(w.dataset.precedence===n)h=w;else if(h!==c)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function Hf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Bf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var $o=null;function Dv(e,n,l){if($o===null){var s=new Map,c=$o=new Map;c.set(l,s)}else c=$o,s=c.get(l),s||(s=new Map,c.set(l,s));if(s.has(e))return s;for(s.set(e,null),l=l.getElementsByTagName(e),c=0;c<l.length;c++){var h=l[c];if(!(h[Ke]||h[ge]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var y=h.getAttribute(n)||"";y=e+y;var w=s.get(y);w?w.push(h):s.set(y,[h])}}return s}function Cv(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function pS(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Av(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gS(e,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=$s(s.href),h=n.querySelector(Pi(c));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=qo.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=h,ct(h);return}h=n.ownerDocument||n,s=Tv(s),(c=Fa.get(c))&&Hf(s,c),h=h.createElement("link"),ct(h);var y=h;y._p=new Promise(function(w,A){y.onload=w,y.onerror=A}),Kn(h,"link",s),l.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=qo.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var $f=0;function vS(e,n){return e.stylesheets&&e.count===0&&Vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&Vo(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&$f===0&&($f=62500*Z0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vo(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>$f?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function qo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yo=null;function Vo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yo=new Map,n.forEach(yS,e),Yo=null,qo.call(e))}function yS(e,n){if(!(n.state.loading&4)){var l=Yo.get(e);if(l)var s=l.get(null);else{l=new Map,Yo.set(e,l);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<c.length;h++){var y=c[h];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(l.set(y.dataset.precedence,y),s=y)}s&&l.set(null,s)}c=n.instance,y=c.getAttribute("data-precedence"),h=l.get(y)||s,h===s&&l.set(null,c),l.set(y,c),this.count++,s=qo.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),h?h.parentNode.insertBefore(c,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),n.state.loading|=4}}var Ki={$$typeof:Y,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function xS(e,n,l,s,c,h,y,w,A){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.hiddenUpdates=Ut(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=h,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Ov(e,n,l,s,c,h,y,w,A,F,J,le){return e=new xS(e,n,l,y,A,F,J,le,w),n=1,h===!0&&(n|=24),h=Ra(3,null,null,n),e.current=h,h.stateNode=e,n=yd(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:l,cache:n},wd(h),e}function Mv(e){return e?(e=ys,e):ys}function kv(e,n,l,s,c,h){c=Mv(c),s.context===null?s.context=c:s.pendingContext=c,s=or(n),s.payload={element:l},h=h===void 0?null:h,h!==null&&(s.callback=h),l=cr(e,s,n),l!==null&&(ba(l,e,n),Di(l,e,n))}function _v(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function qf(e,n){_v(e,n),(e=e.alternate)&&_v(e,n)}function Lv(e){if(e.tag===13||e.tag===31){var n=Vr(e,67108864);n!==null&&ba(n,e,67108864),qf(e,67108864)}}function zv(e){if(e.tag===13||e.tag===31){var n=Aa();n=k(n);var l=Vr(e,n);l!==null&&ba(l,e,n),qf(e,n)}}var Fo=!0;function bS(e,n,l,s){var c=z.T;z.T=null;var h=B.p;try{B.p=2,Yf(e,n,l,s)}finally{B.p=h,z.T=c}}function SS(e,n,l,s){var c=z.T;z.T=null;var h=B.p;try{B.p=8,Yf(e,n,l,s)}finally{B.p=h,z.T=c}}function Yf(e,n,l,s){if(Fo){var c=Vf(s);if(c===null)Df(e,n,s,Io,l),Hv(e,s);else if(ES(c,e,n,l,s))s.stopPropagation();else if(Hv(e,s),n&4&&-1<wS.indexOf(e)){for(;c!==null;){var h=Je(c);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=vt(h.pendingLanes);if(y!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var A=1<<31-Mt(y);w.entanglements[1]|=A,y&=~A}gl(h),(At&6)===0&&(jo=fe()+500,Fi(0))}}break;case 31:case 13:w=Vr(h,2),w!==null&&ba(w,h,2),Co(),qf(h,2)}if(h=Vf(s),h===null&&Df(e,n,s,Io,l),h===c)break;c=h}c!==null&&s.stopPropagation()}else Df(e,n,s,null,l)}}function Vf(e){return e=Dl(e),Ff(e)}var Io=null;function Ff(e){if(Io=null,e=Ht(e),e!==null){var n=o(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=f(n),e!==null)return e;e=null}else if(l===31){if(e=m(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Io=e,null}function Uv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Le()){case ke:return 2;case Ve:return 8;case nt:case mt:return 32;case Gt:return 268435456;default:return 32}default:return 32}}var If=!1,Sr=null,wr=null,Er=null,Zi=new Map,Ji=new Map,Nr=[],wS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hv(e,n){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":wr=null;break;case"mouseover":case"mouseout":Er=null;break;case"pointerover":case"pointerout":Zi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ji.delete(n.pointerId)}}function Wi(e,n,l,s,c,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:h,targetContainers:[c]},n!==null&&(n=Je(n),n!==null&&Lv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function ES(e,n,l,s,c){switch(n){case"focusin":return Sr=Wi(Sr,e,n,l,s,c),!0;case"dragenter":return wr=Wi(wr,e,n,l,s,c),!0;case"mouseover":return Er=Wi(Er,e,n,l,s,c),!0;case"pointerover":var h=c.pointerId;return Zi.set(h,Wi(Zi.get(h)||null,e,n,l,s,c)),!0;case"gotpointercapture":return h=c.pointerId,Ji.set(h,Wi(Ji.get(h)||null,e,n,l,s,c)),!0}return!1}function Bv(e){var n=Ht(e.target);if(n!==null){var l=o(n);if(l!==null){if(n=l.tag,n===13){if(n=f(l),n!==null){e.blockedOn=n,ae(e.priority,function(){zv(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,ae(e.priority,function(){zv(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Go(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=Vf(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);Ea=s,l.target.dispatchEvent(s),Ea=null}else return n=Je(l),n!==null&&Lv(n),e.blockedOn=l,!1;n.shift()}return!0}function $v(e,n,l){Go(e)&&l.delete(n)}function NS(){If=!1,Sr!==null&&Go(Sr)&&(Sr=null),wr!==null&&Go(wr)&&(wr=null),Er!==null&&Go(Er)&&(Er=null),Zi.forEach($v),Ji.forEach($v)}function Xo(e,n){e.blockedOn===n&&(e.blockedOn=null,If||(If=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,NS)))}var Po=null;function qv(e){Po!==e&&(Po=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Po===e&&(Po=null);for(var n=0;n<e.length;n+=3){var l=e[n],s=e[n+1],c=e[n+2];if(typeof s!="function"){if(Ff(s||l)===null)continue;break}var h=Je(l);h!==null&&(e.splice(n,3),n-=3,Yd(h,{pending:!0,data:c,method:l.method,action:s},s,c))}}))}function Ys(e){function n(A){return Xo(A,e)}Sr!==null&&Xo(Sr,e),wr!==null&&Xo(wr,e),Er!==null&&Xo(Er,e),Zi.forEach(n),Ji.forEach(n);for(var l=0;l<Nr.length;l++){var s=Nr[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Nr.length&&(l=Nr[0],l.blockedOn===null);)Bv(l),l.blockedOn===null&&Nr.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var c=l[s],h=l[s+1],y=c[De]||null;if(typeof h=="function")y||qv(l);else if(y){var w=null;if(h&&h.hasAttribute("formAction")){if(c=h,y=h[De]||null)w=y.formAction;else if(Ff(c)!==null)continue}else w=y.action;typeof w=="function"?l[s+1]=w:(l.splice(s,3),s-=3),qv(l)}}}function Yv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(y){return c=y})},focusReset:"manual",scroll:"manual"})}function n(){c!==null&&(c(),c=null),s||setTimeout(l,20)}function l(){if(!s&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function Gf(e){this._internalRoot=e}Qo.prototype.render=Gf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var l=n.current,s=Aa();kv(l,s,e,n,null,null)},Qo.prototype.unmount=Gf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;kv(e.current,2,null,e,null,null),Co(),n[we]=null}};function Qo(e){this._internalRoot=e}Qo.prototype.unstable_scheduleHydration=function(e){if(e){var n=Z();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Nr.length&&n!==0&&n<Nr[l].priority;l++);Nr.splice(l,0,e),l===0&&Bv(e)}};var Vv=a.version;if(Vv!=="19.2.7")throw Error(i(527,Vv,"19.2.7"));B.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(n),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var RS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ko.isDisabled&&Ko.supportsFiber)try{sn=Ko.inject(RS),re=Ko}catch{}}return tu.createRoot=function(e,n){if(!u(e))throw Error(i(299));var l=!1,s="",c=Kp,h=Zp,y=Jp;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=Ov(e,1,!1,null,null,l,s,null,c,h,y,Yv),e[we]=n.current,jf(e),new Gf(n)},tu.hydrateRoot=function(e,n,l){if(!u(e))throw Error(i(299));var s=!1,c="",h=Kp,y=Zp,w=Jp,A=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError),l.formState!==void 0&&(A=l.formState)),n=Ov(e,1,!0,n,l??null,s,c,A,h,y,w,Yv),n.context=Mv(null),l=n.current,s=Aa(),s=k(s),c=or(s),c.callback=null,cr(l,c,s),l=s,n.current.lanes=l,dt(n,l),gl(n),e[we]=n.current,jf(e),new Qo(n)},tu.version="19.2.7",tu}var Wv;function BS(){if(Wv)return Qf.exports;Wv=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(a){console.error(a)}}return t(),Qf.exports=HS(),Qf.exports}var $S=BS();/**
|
|
50
|
+
* react-router v7.18.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var px=t=>{throw TypeError(t)},gx=(t,a,r)=>a.has(t)||px("Cannot "+r),Ia=(t,a,r)=>(gx(t,a,"read from private field"),r?r.call(t):a.get(t)),cu=(t,a,r)=>a.has(t)?px("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,r),vl=(t,a,r,i)=>(gx(t,a,"write to private field"),a.set(t,r),r),jc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Uh=/^[\\/]{2}/;function vx(t,a){return a+t.replace(/\\/g,"/")}var ey="popstate";function ty(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function qS(t={}){function a(i,u){var g;let o=(g=u.state)==null?void 0:g.masked,{pathname:f,search:m,hash:p}=o||i.location;return xu("",{pathname:f,search:m,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default",o?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function r(i,u){return typeof u=="string"?u:El(u)}return VS(a,r,null,t)}function et(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function xn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function YS(){return Math.random().toString(36).substring(2,10)}function ny(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function xu(t,a,r=null,i,u){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Nl(a):a,state:r,key:a&&a.key||i||YS(),mask:u}}function El({pathname:t="/",search:a="",hash:r=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Nl(t){let a={};if(t){let r=t.indexOf("#");r>=0&&(a.hash=t.substring(r),t=t.substring(0,r));let i=t.indexOf("?");i>=0&&(a.search=t.substring(i),t=t.substring(0,i)),t&&(a.pathname=t)}return a}function VS(t,a,r,i={}){let{window:u=document.defaultView,v5Compat:o=!1}=i,f=u.history,m="POP",p=null,g=x();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function x(){return(f.state||{idx:null}).idx}function b(){m="POP";let T=x(),L=T==null?null:T-g;g=T,p&&p({action:m,location:O.location,delta:L})}function E(T,L){m="PUSH";let X=ty(T)?T:xu(O.location,T,L);g=x()+1;let Y=ny(X,g),Q=O.createHref(X.mask||X);try{f.pushState(Y,"",Q)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;u.location.assign(Q)}o&&p&&p({action:m,location:O.location,delta:1})}function S(T,L){m="REPLACE";let X=ty(T)?T:xu(O.location,T,L);g=x();let Y=ny(X,g),Q=O.createHref(X.mask||X);f.replaceState(Y,"",Q),o&&p&&p({action:m,location:O.location,delta:0})}function N(T){return yx(u,T)}let O={get action(){return m},get location(){return t(u,f)},listen(T){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(ey,b),p=T,()=>{u.removeEventListener(ey,b),p=null}},createHref(T){return a(u,T)},createURL:N,encodeLocation(T){let L=N(T);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:E,replace:S,go(T){return f.go(T)}};return O}function yx(t,a,r=!1){let i="http://localhost";t&&(i=t.location.origin!=="null"?t.location.origin:t.location.href),et(i,"No window.location.(origin|href) available to create URL");let u=typeof a=="string"?a:El(a);return u=u.replace(/ $/,"%20"),!r&&Uh.test(u)&&(u=i+u),new URL(u,i)}var du,ay=class{constructor(t){if(cu(this,du,new Map),t)for(let[a,r]of t)this.set(a,r)}get(t){if(Ia(this,du).has(t))return Ia(this,du).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Ia(this,du).set(t,a)}};du=new WeakMap;var FS=new Set(["lazy","caseSensitive","path","id","index","children"]);function IS(t){return FS.has(t)}var GS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function XS(t){return GS.has(t)}function PS(t){return t.index===!0}function bu(t,a,r=[],i={},u=!1){return t.map((o,f)=>{let m=[...r,String(f)],p=typeof o.id=="string"?o.id:m.join("-");if(et(o.index!==!0||!o.children,"Cannot specify children on an index route"),et(u||!i[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),PS(o)){let g={...o,id:p};return i[p]=ly(g,a(g)),g}else{let g={...o,id:p,children:void 0};return i[p]=ly(g,a(g)),o.children&&(g.children=bu(o.children,a,m,i,u)),g}})}function ly(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function xx(t,a,r="/"){return al(t,a,r,!1)}function al(t,a,r,i,u){let o=typeof a=="string"?Nl(a):a,f=Ka(o.pathname||"/",r);if(f==null)return null;let m=u??oc(t),p=null,g=s1(f);for(let x=0;p==null&&x<m.length;++x)p=r1(m[x],g,i);return p}function QS(t,a){let{route:r,pathname:i,params:u}=t;return{id:r.id,pathname:i,params:u,data:a[r.id],loaderData:a[r.id],handle:r.handle}}function oc(t){let a=bx(t);return KS(a),a}function bx(t,a=[],r=[],i="",u=!1){let o=(f,m,p=u,g)=>{let x={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&p)return;et(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let b=Qa([i,x.relativePath]),E=r.concat(x);f.children&&f.children.length>0&&(et(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),bx(f.children,a,E,b,p)),!(f.path==null&&!f.index)&&a.push({path:b,score:a1(b,f.index),routesMeta:E.map((S,N)=>{let[O,T]=Ex(S.relativePath,S.caseSensitive,N===E.length-1);return{...S,matcher:O,compiledParams:T}})})};return t.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))o(f,m);else for(let g of Sx(f.path))o(f,m,!0,g)}),a}function Sx(t){let a=t.split("/");if(a.length===0)return[];let[r,...i]=a,u=r.endsWith("?"),o=r.replace(/\?$/,"");if(i.length===0)return u?[o,""]:[o];let f=Sx(i.join("/")),m=[];return m.push(...f.map(p=>p===""?o:[o,p].join("/"))),u&&m.push(...f),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function KS(t){t.sort((a,r)=>a.score!==r.score?r.score-a.score:l1(a.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var ZS=/^:[\w-]+$/,JS=3,WS=2,e1=1,t1=10,n1=-2,ry=t=>t==="*";function a1(t,a){let r=t.split("/"),i=r.length;return r.some(ry)&&(i+=n1),a&&(i+=WS),r.filter(u=>!ry(u)).reduce((u,o)=>u+(ZS.test(o)?JS:o===""?e1:t1),i)}function l1(t,a){return t.length===a.length&&t.slice(0,-1).every((i,u)=>i===a[u])?t[t.length-1]-a[a.length-1]:0}function r1(t,a,r=!1){let{routesMeta:i}=t,u={},o="/",f=[];for(let m=0;m<i.length;++m){let p=i[m],g=m===i.length-1,x=o==="/"?a:a.slice(o.length)||"/",b={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},E=p.matcher&&p.compiledParams?wx(b,x,p.matcher,p.compiledParams):vc(b,x),S=p.route;if(!E&&g&&r&&!i[i.length-1].route.index&&(E=vc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!E)return null;Object.assign(u,E.params),f.push({params:u,pathname:Qa([o,E.pathname]),pathnameBase:o1(Qa([o,E.pathnameBase])),route:S}),E.pathnameBase!=="/"&&(o=Qa([o,E.pathnameBase]))}return f}function vc(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,i]=Ex(t.path,t.caseSensitive,t.end);return wx(t,a,r,i)}function wx(t,a,r,i){let u=a.match(r);if(!u)return null;let o=u[0],f=o.replace(/(.)\/+$/,"$1"),m=u.slice(1);return{params:i.reduce((g,{paramName:x,isOptional:b},E)=>{if(x==="*"){let N=m[E]||"";f=o.slice(0,o.length-N.length).replace(/(.)\/+$/,"$1")}const S=m[E];return b&&!S?g[x]=void 0:g[x]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:f,pattern:t}}function Ex(t,a=!1,r=!0){xn(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 i=[],u="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,g,x)=>{if(i.push({paramName:m,isOptional:p!=null}),p){let b=x.charAt(g+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),u+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?u+="\\/*$":t!==""&&t!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),i]}function s1(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return xn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function Ka(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,i=t.charAt(r);return i&&i!=="/"?null:t.slice(r)||"/"}function i1({basename:t,pathname:a}){return a==="/"?t:Qa([t,a])}var Hh=t=>jc.test(t);function u1(t,a="/"){let{pathname:r,search:i="",hash:u=""}=typeof t=="string"?Nl(t):t,o;return r?(r=$h(r),r.startsWith("/")?o=sy(r.substring(1),"/"):o=sy(r,a)):o=a,{pathname:o,search:c1(i),hash:d1(u)}}function sy(t,a){let r=yc(a).split("/");return t.split("/").forEach(u=>{u===".."?r.length>1&&r.pop():u!=="."&&r.push(u)}),r.length>1?r.join("/"):"/"}function Wf(t,a,r,i){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Nx(t){return t.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function Bh(t){let a=Nx(t);return a.map((r,i)=>i===a.length-1?r.pathname:r.pathnameBase)}function Dc(t,a,r,i=!1){let u;typeof t=="string"?u=Nl(t):(u={...t},et(!u.pathname||!u.pathname.includes("?"),Wf("?","pathname","search",u)),et(!u.pathname||!u.pathname.includes("#"),Wf("#","pathname","hash",u)),et(!u.search||!u.search.includes("#"),Wf("#","search","hash",u)));let o=t===""||u.pathname==="",f=o?"/":u.pathname,m;if(f==null)m=r;else{let b=a.length-1;if(!i&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),b-=1;u.pathname=E.join("/")}m=b>=0?a[b]:"/"}let p=u1(u,m),g=f&&f!=="/"&&f.endsWith("/"),x=(o||f===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var $h=t=>t.replace(/[\\/]{2,}/g,"/"),Qa=t=>$h(t.join("/")),yc=t=>t.replace(/\/+$/,""),o1=t=>yc(t).replace(/^\/*/,"/"),c1=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,d1=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Rl=(t,a=302)=>{let r=a;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let i=new Headers(r.headers);return i.set("Location",t),new Response(null,{...r,headers:i})},f1=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ru=class{constructor(t,a,r,i=!1){this.status=t,this.statusText=a||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ws(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Tu(t){let a=t.map(r=>r.route.path).filter(Boolean);return Qa(a)||"/"}var Rx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tx(t,a){let r=t;if(typeof r!="string"||!jc.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,u=!1;if(Rx)try{let o=new URL(window.location.href),f=Uh.test(r)?new URL(vx(r,o.protocol)):new URL(r),m=Ka(f.pathname,a);f.origin===o.origin&&m!=null?r=m+f.search+f.hash:u=!0}catch{xn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:r}}var Ar=Symbol("Uninstrumented");function h1(t,a){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(u=>u({id:a.id,index:a.index,path:a.path,instrument(o){let f=Object.keys(r);for(let m of f)o[m]&&r[m].push(o[m])}}));let i={};if(typeof a.lazy=="function"&&r.lazy.length>0){let u=Qs(r.lazy,a.lazy,()=>{});u&&(i.lazy=u)}if(typeof a.lazy=="object"){let u=a.lazy;["middleware","loader","action"].forEach(o=>{let f=u[o],m=r[`lazy.${o}`];if(typeof f=="function"&&m.length>0){let p=Qs(m,f,()=>{});p&&(i.lazy=Object.assign(i.lazy||{},{[o]:p}))}})}return["loader","action"].forEach(u=>{let o=a[u];if(typeof o=="function"&&r[u].length>0){let f=o[Ar]??o,m=Qs(r[u],f,(...p)=>iy(p[0]));m&&(u==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[Ar]=f,i[u]=m)}}),a.middleware&&a.middleware.length>0&&r.middleware.length>0&&(i.middleware=a.middleware.map(u=>{let o=u[Ar]??u,f=Qs(r.middleware,o,(...m)=>iy(m[0]));return f?(f[Ar]=o,f):u})),i}function m1(t,a){let r={navigate:[],fetch:[]};if(a.forEach(i=>i({instrument(u){let o=Object.keys(u);for(let f of o)u[f]&&r[f].push(u[f])}})),r.navigate.length>0){let i=t.navigate[Ar]??t.navigate,u=Qs(r.navigate,i,(...o)=>{let[f,m]=o;return{to:typeof f=="number"||typeof f=="string"?f:f?El(f):".",...uy(t,m??{})}});u&&(u[Ar]=i,t.navigate=u)}if(r.fetch.length>0){let i=t.fetch[Ar]??t.fetch,u=Qs(r.fetch,i,(...o)=>{let[f,,m,p]=o;return{href:m??".",fetcherKey:f,...uy(t,p??{})}});u&&(u[Ar]=i,t.fetch=u)}return t}function Qs(t,a,r){return t.length===0?null:async(...i)=>{let u=await jx(t,r(...i),()=>a(...i),t.length-1);if(u.type==="error")throw u.value;return u.value}}async function jx(t,a,r,i){let u=t[i],o;if(u){let f,m=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=jx(t,a,r,i-1),o=await f,et(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await u(m,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await m(),await f}else try{o={type:"success",value:await r()}}catch(f){o={type:"error",value:f}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function iy(t){let{request:a,context:r,params:i,pattern:u}=t;return{request:p1(a),params:{...i},pattern:u,context:g1(r)}}function uy(t,a){return{currentUrl:El(t.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function p1(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function g1(t){if(y1(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var v1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function y1(t){if(t===null||typeof t!="object")return!1;const a=Object.getPrototypeOf(t);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===v1}var Dx=["POST","PUT","PATCH","DELETE"],x1=new Set(Dx),b1=["GET",...Dx],S1=new Set(b1),Cx=new Set([301,302,303,307,308]),w1=new Set([307,308]),eh={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ax={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},E1=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Ox="remix-router-transitions",Mx=Symbol("ResetLoaderData"),ns,Gs,jr,Xs,N1=class{constructor(t){cu(this,ns),cu(this,Gs),cu(this,jr),cu(this,Xs),vl(this,ns,t),vl(this,Gs,oc(t))}get stableRoutes(){return Ia(this,ns)}get activeRoutes(){return Ia(this,jr)??Ia(this,ns)}get branches(){return Ia(this,Xs)??Ia(this,Gs)}get hasHMRRoutes(){return Ia(this,jr)!=null}setRoutes(t){vl(this,ns,t),vl(this,Gs,oc(t))}setHmrRoutes(t){vl(this,jr,t),vl(this,Xs,oc(t))}commitHmrRoutes(){Ia(this,jr)&&(vl(this,ns,Ia(this,jr)),vl(this,Gs,Ia(this,Xs)),vl(this,jr,void 0),vl(this,Xs,void 0))}};ns=new WeakMap;Gs=new WeakMap;jr=new WeakMap;Xs=new WeakMap;function R1(t){const a=t.window?t.window:typeof window<"u"?window:void 0,r=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";et(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],u=t.mapRouteProperties||E1,o=u;if(t.instrumentations){let C=t.instrumentations;o=k=>({...u(k),...h1(C.map($=>$.route).filter(Boolean),k)})}let f={},m=new N1(bu(t.routes,o,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||A1,x={...t.future},b=null,E=new Set,S=null,N=null,O=null,T=null,L=t.hydrationData!=null,X=al(m.activeRoutes,t.history.location,p,!1,m.branches),Y=!1,Q=null,K,W;if(X==null&&!t.patchRoutesOnNavigation){let C=Ga(404,{pathname:t.history.location.pathname}),{matches:k,route:$}=Zo(m.activeRoutes);K=!0,W=!K,X=k,Q={[$.id]:C}}else if(X&&!t.hydrationData&&Ut(X,m.activeRoutes,t.history.location.pathname).active&&(X=null),X)if(X.some(C=>C.route.lazy))K=!1,W=!K;else if(!X.some(C=>qh(C.route)))K=!0,W=!K;else{let C=t.hydrationData?t.hydrationData.loaderData:null,k=t.hydrationData?t.hydrationData.errors:null,$=X;if(k){let Z=X.findIndex(ae=>k[ae.route.id]!==void 0);$=$.slice(0,Z+1)}W=!1,K=!0,$.forEach(Z=>{let ae=kx(Z.route,C,k);W=W||ae.renderFallback,K=K&&!ae.shouldLoad})}else{K=!1,W=!K,X=[];let C=Ut(null,m.activeRoutes,t.history.location.pathname);C.active&&C.matches&&(Y=!0,X=C.matches)}let U,j={historyAction:t.history.action,location:t.history.location,matches:X,initialized:K,renderFallback:W,navigation:eh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||Q,fetchers:new Map,blockers:new Map},oe="POP",me=null,ye=!1,Re,ee=!1,be=new Map,Ee=null,z=!1,B=!1,ie=new Set,de=new Map,pe=0,D=-1,q=new Map,ne=new Set,ce=new Map,Te=new Map,Ne=new Set,Ue=new Map,it,Ge=null;function tt(){if(b=t.history.listen(({action:C,location:k,delta:$})=>{if(it){it(),it=void 0;return}xn(Ue.size===0||$!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Z=qt({currentLocation:j.location,nextLocation:k,historyAction:C});if(Z&&$!=null){let ae=new Promise(je=>{it=je});t.history.go($*-1),Xt(Z,{state:"blocked",location:k,proceed(){Xt(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:k}),ae.then(()=>t.history.go($))},reset(){let je=new Map(j.blockers);je.set(Z,nu),ut({blockers:je})}}),me==null||me.resolve(),me=null;return}return It(C,k)}),r){Q1(a,be);let C=()=>K1(a,be);a.addEventListener("pagehide",C),Ee=()=>a.removeEventListener("pagehide",C)}return j.initialized||It("POP",j.location,{initialHydration:!0}),U}function pn(){b&&b(),Ee&&Ee(),E.clear(),Re&&Re.abort(),j.fetchers.forEach((C,k)=>sn(j.fetchers,k)),j.blockers.forEach((C,k)=>Be(k))}function Rt(C){if(E.add(C),S){let{newErrors:k}=S;S=null,C(j,{deletedFetchers:[],newErrors:k,viewTransitionOpts:void 0,flushSync:!1})}return()=>E.delete(C)}function ut(C,k={}){C.matches&&(C.matches=C.matches.map(ae=>{let je=f[ae.route.id],ge=ae.route;return ge.element!==je.element||ge.errorElement!==je.errorElement||ge.hydrateFallbackElement!==je.hydrateFallbackElement?{...ae,route:je}:ae})),j={...j,...C};let $=[],Z=[];j.fetchers.forEach((ae,je)=>{ae.state==="idle"&&(Ne.has(je)?$.push(je):Z.push(je))}),Ne.forEach(ae=>{!j.fetchers.has(ae)&&!de.has(ae)&&$.push(ae)}),E.size===0&&(S={newErrors:C.errors??null}),[...E].forEach(ae=>ae(j,{deletedFetchers:$,newErrors:C.errors??null,viewTransitionOpts:k.viewTransitionOpts,flushSync:k.flushSync===!0})),$.forEach(ae=>sn(j.fetchers,ae)),Z.forEach(ae=>j.fetchers.delete(ae))}function se(C,k,{flushSync:$}={}){var _e,Xe;let Z=j.actionData!=null&&j.navigation.formMethod!=null&&ua(j.navigation.formMethod)&&j.navigation.state==="loading"&&((_e=C.state)==null?void 0:_e._isRedirect)!==!0,ae;k.actionData?Object.keys(k.actionData).length>0?ae=k.actionData:ae=null:Z?ae=j.actionData:ae=null;let je=k.loaderData?yy(j.loaderData,k.loaderData,k.matches||[],k.errors):j.loaderData,ge=j.blockers;ge.size>0&&(ge=new Map(ge),ge.forEach((Ce,Ke)=>ge.set(Ke,nu)));let De=z?!1:Pt(C,k.matches||j.matches),we=ye===!0||j.navigation.formMethod!=null&&ua(j.navigation.formMethod)&&((Xe=C.state)==null?void 0:Xe._isRedirect)!==!0;m.commitHmrRoutes(),z||oe==="POP"||(oe==="PUSH"?t.history.push(C,C.state):oe==="REPLACE"&&t.history.replace(C,C.state));let Oe;if(oe==="POP"){let Ce=be.get(j.location.pathname);Ce&&Ce.has(C.pathname)?Oe={currentLocation:j.location,nextLocation:C}:be.has(C.pathname)&&(Oe={currentLocation:C,nextLocation:j.location})}else if(ee){let Ce=be.get(j.location.pathname);Ce?Ce.add(C.pathname):(Ce=new Set([C.pathname]),be.set(j.location.pathname,Ce)),Oe={currentLocation:j.location,nextLocation:C}}ut({...k,actionData:ae,loaderData:je,historyAction:oe,location:C,initialized:!0,renderFallback:!1,navigation:eh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:we,blockers:ge},{viewTransitionOpts:Oe,flushSync:$===!0}),oe="POP",ye=!1,ee=!1,z=!1,B=!1,me==null||me.resolve(),me=null,Ge==null||Ge.resolve(),Ge=null}async function Ye(C,k){if(me==null||me.resolve(),me=null,typeof C=="number"){me||(me=wy());let $e=me.promise;return t.history.go(C),$e}let $=Rh(j.location,j.matches,p,C,k==null?void 0:k.fromRouteId,k==null?void 0:k.relative),{path:Z,submission:ae,error:je}=oy(!1,$,k),ge;k!=null&&k.mask&&(ge={pathname:"",search:"",hash:"",...typeof k.mask=="string"?Nl(k.mask):{...j.location.mask,...k.mask}});let De=j.location,we=xu(De,Z,k&&k.state,void 0,ge);we={...we,...t.history.encodeLocation(we)};let Oe=k&&k.replace!=null?k.replace:void 0,_e="PUSH";Oe===!0?_e="REPLACE":Oe===!1||ae!=null&&ua(ae.formMethod)&&ae.formAction===j.location.pathname+j.location.search&&(_e="REPLACE");let Xe=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,Ce=(k&&k.flushSync)===!0,Ke=qt({currentLocation:De,nextLocation:we,historyAction:_e});if(Ke){Xt(Ke,{state:"blocked",location:we,proceed(){Xt(Ke,{state:"proceeding",proceed:void 0,reset:void 0,location:we}),Ye(C,k)},reset(){let $e=new Map(j.blockers);$e.set(Ke,nu),ut({blockers:$e})}});return}await It(_e,we,{submission:ae,pendingError:je,preventScrollReset:Xe,replace:k&&k.replace,enableViewTransition:k&&k.viewTransition,flushSync:Ce,callSiteDefaultShouldRevalidate:k&&k.defaultShouldRevalidate})}function Ie(){Ge||(Ge=wy()),nt(),ut({revalidation:"loading"});let C=Ge.promise;return j.navigation.state==="submitting"?C:j.navigation.state==="idle"?(It(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),C):(It(oe||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:ee===!0}),C)}async function It(C,k,$){Re&&Re.abort(),Re=null,oe=C,z=($&&$.startUninterruptedRevalidation)===!0,Wt(j.location,j.matches),ye=($&&$.preventScrollReset)===!0,ee=($&&$.enableViewTransition)===!0;let Z=m.activeRoutes,ae=$!=null&&$.initialHydration&&j.matches&&j.matches.length>0&&!Y?j.matches:al(Z,k,p,!1,m.branches),je=($&&$.flushSync)===!0;if(ae&&j.initialized&&!B&&B1(j.location,k)&&!($&&$.submission&&ua($.submission.formMethod))){se(k,{matches:ae},{flushSync:je});return}let ge=Ut(ae,Z,k.pathname);if(ge.active&&ge.matches&&(ae=ge.matches),!ae){let{error:Je,notFoundMatches:ot,route:rt}=vt(k.pathname);se(k,{matches:ot,loaderData:{},errors:{[rt.id]:Je}},{flushSync:je});return}let De=$&&$.overrideNavigation?{...$.overrideNavigation,matches:ae,historyAction:C}:void 0;Re=new AbortController;let we=Ps(t.history,k,Re.signal,$&&$.submission),Oe=t.getContext?await t.getContext():new ay,_e;if($&&$.pendingError)_e=[Cr(ae).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&ua($.submission.formMethod)){let Je=await Dn(we,k,$.submission,ae,C,Oe,ge.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:je});if(Je.shortCircuited)return;if(Je.pendingActionResult){let[ot,rt]=Je.pendingActionResult;if(Oa(rt)&&Ws(rt.error)&&rt.error.status===404){Re=null,se(k,{matches:Je.matches,loaderData:{},errors:{[ot]:rt.error}});return}}ae=Je.matches||ae,_e=Je.pendingActionResult,De=th(k,ae,C,$.submission),je=!1,ge.active=!1,we=Ps(t.history,we.url,we.signal)}let{shortCircuited:Xe,matches:Ce,loaderData:Ke,errors:$e,workingFetchers:Ht}=await dn(we,k,ae,C,Oe,ge.active,De,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,je,_e,$&&$.callSiteDefaultShouldRevalidate);Xe||(Re=null,se(k,{matches:Ce||ae,...xy(_e),loaderData:Ke,errors:$e,...Ht?{fetchers:Ht}:{}}))}async function Dn(C,k,$,Z,ae,je,ge,De,we={}){nt();let Oe=X1(k,Z,ae,$);if(ut({navigation:Oe},{flushSync:we.flushSync===!0}),ge){let Ce=await dt(Z,k.pathname,C.signal);if(Ce.type==="aborted")return{shortCircuited:!0};if(Ce.type==="error"){if(Ce.partialMatches.length===0){let{matches:$e,route:Ht}=Zo(m.activeRoutes);return{matches:$e,pendingActionResult:[Ht.id,{type:"error",error:Ce.error}]}}let Ke=Cr(Ce.partialMatches).route.id;return{matches:Ce.partialMatches,pendingActionResult:[Ke,{type:"error",error:Ce.error}]}}else if(Ce.matches)Z=Ce.matches;else{let{notFoundMatches:Ke,error:$e,route:Ht}=vt(k.pathname);return{matches:Ke,pendingActionResult:[Ht.id,{type:"error",error:$e}]}}}let _e,Xe=cc(Z,k);if(!Xe.route.action&&!Xe.route.lazy)_e={type:"error",error:Ga(405,{method:C.method,pathname:k.pathname,routeId:Xe.route.id})};else{let Ce=Zs(o,f,C,k,Z,Xe,De?[]:i,je),Ke=await ke(C,k,Ce,je,null);if(_e=Ke[Xe.route.id],!_e){for(let $e of Z)if(Ke[$e.route.id]){_e=Ke[$e.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(ls(_e)){let Ce;return we&&we.replace!=null?Ce=we.replace:Ce=py(_e.response.headers.get("Location"),new URL(C.url),p,t.history)===j.location.pathname+j.location.search,await Le(C,_e,!0,{submission:$,replace:Ce}),{shortCircuited:!0}}if(Oa(_e)){let Ce=Cr(Z,Xe.route.id);return(we&&we.replace)!==!0&&(oe="PUSH"),{matches:Z,pendingActionResult:[Ce.route.id,_e,Xe.route.id]}}return{matches:Z,pendingActionResult:[Xe.route.id,_e]}}async function dn(C,k,$,Z,ae,je,ge,De,we,Oe,_e,Xe,Ce,Ke){let $e=ge||th(k,$,Z,De),Ht=De||we||Sy($e),Je=!z&&!_e;if(je){if(Je){let wt=Lt(Ce);ut({navigation:$e,...wt!==void 0?{actionData:wt}:{}},{flushSync:Xe})}let Pe=await dt($,k.pathname,C.signal);if(Pe.type==="aborted")return{shortCircuited:!0};if(Pe.type==="error"){if(Pe.partialMatches.length===0){let{matches:Kt,route:ta}=Zo(m.activeRoutes);return{matches:Kt,loaderData:{},errors:{[ta.id]:Pe.error}}}let wt=Cr(Pe.partialMatches).route.id;return{matches:Pe.partialMatches,loaderData:{},errors:{[wt]:Pe.error}}}else if(Pe.matches)$=Pe.matches;else{let{error:wt,notFoundMatches:Kt,route:ta}=vt(k.pathname);return{matches:Kt,loaderData:{},errors:{[ta.id]:wt}}}}let ot=m.activeRoutes,{dsMatches:rt,revalidatingFetchers:ct}=cy(C,ae,o,f,t.history,j,$,Ht,k,_e?[]:i,_e===!0,B,ie,Ne,ce,ne,ot,p,t.patchRoutesOnNavigation!=null,m.branches,Ce,Ke);if(D=++pe,!t.dataStrategy&&!rt.some(Pe=>Pe.shouldLoad)&&!rt.some(Pe=>Pe.route.middleware&&Pe.route.middleware.length>0)&&ct.length===0){let Pe=new Map(j.fetchers),wt=Jn(Pe);return se(k,{matches:$,loaderData:{},errors:Ce&&Oa(Ce[1])?{[Ce[0]]:Ce[1].error}:null,...xy(Ce),...wt?{fetchers:Pe}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(Je){let Pe={};if(!je){Pe.navigation=$e;let wt=Lt(Ce);wt!==void 0&&(Pe.actionData=wt)}ct.length>0&&(Pe.fetchers=Jt(ct)),ut(Pe,{flushSync:Xe})}ct.forEach(Pe=>{St(Pe.key),Pe.controller&&de.set(Pe.key,Pe.controller)});let Qt=()=>ct.forEach(Pe=>St(Pe.key));Re&&Re.signal.addEventListener("abort",Qt);let{loaderResults:Fn,fetcherResults:Sn}=await Ve(rt,ct,C,k,ae);if(C.signal.aborted)return{shortCircuited:!0};Re&&Re.signal.removeEventListener("abort",Qt),ct.forEach(Pe=>de.delete(Pe.key));let An=Jo(Fn);if(An)return await Le(C,An.result,!0,{replace:Oe}),{shortCircuited:!0};if(An=Jo(Sn),An)return ne.add(An.key),await Le(C,An.result,!0,{replace:Oe}),{shortCircuited:!0};let On=new Map(j.fetchers),{loaderData:In,errors:fa}=vy(j,$,Fn,Ce,ct,Sn,On);_e&&j.errors&&(fa={...j.errors,...fa});let tr=Jn(On),ea=Wn(D,On),ul=tr||ea||ct.length>0;return{matches:$,loaderData:In,errors:fa,...ul?{workingFetchers:On}:{}}}function Lt(C){if(C&&!Oa(C[1]))return{[C[0]]:C[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function Jt(C){let k=new Map(j.fetchers);return C.forEach($=>{let Z=k.get($.key),ae=au(void 0,Z?Z.data:void 0);k.set($.key,ae)}),k}async function Yn(C,k,$,Z){St(C);let ae=(Z&&Z.flushSync)===!0,je=m.activeRoutes,ge=Rh(j.location,j.matches,p,$,k,Z==null?void 0:Z.relative),De=al(je,ge,p,!1,m.branches),we=Ut(De,je,ge);if(we.active&&we.matches&&(De=we.matches),!De){Gt(C,k,Ga(404,{pathname:ge}),{flushSync:ae});return}let{path:Oe,submission:_e,error:Xe}=oy(!0,ge,Z);if(Xe){Gt(C,k,Xe,{flushSync:ae});return}let Ce=t.getContext?await t.getContext():new ay,Ke=(Z&&Z.preventScrollReset)===!0;if(_e&&ua(_e.formMethod)){await Vn(C,k,Oe,De,Ce,we.active,ae,Ke,_e,Z&&Z.defaultShouldRevalidate);return}ce.set(C,{routeId:k,path:Oe}),await fe(C,k,Oe,De,Ce,we.active,ae,Ke,_e)}async function Vn(C,k,$,Z,ae,je,ge,De,we,Oe){nt(),ce.delete(C);let _e=j.fetchers.get(C);mt(C,P1(we,_e),{flushSync:ge});let Xe=new AbortController,Ce=Ps(t.history,$,Xe.signal,we);if(je){let Et=await dt(Z,new URL(Ce.url).pathname,Ce.signal,C);if(Et.type==="aborted")return;if(Et.type==="error"){Gt(C,k,Et.error,{flushSync:ge});return}else if(Et.matches)Z=Et.matches;else{Gt(C,k,Ga(404,{pathname:$}),{flushSync:ge});return}}let Ke=cc(Z,$);if(!Ke.route.action&&!Ke.route.lazy){let Et=Ga(405,{method:we.formMethod,pathname:$,routeId:k});Gt(C,k,Et,{flushSync:ge});return}de.set(C,Xe);let $e=pe,Ht=Zs(o,f,Ce,$,Z,Ke,i,ae),Je=await ke(Ce,$,Ht,ae,C),ot=Je[Ke.route.id];if(!ot){for(let Et of Ht)if(Je[Et.route.id]){ot=Je[Et.route.id];break}}if(Ce.signal.aborted){de.get(C)===Xe&&de.delete(C);return}if(Ne.has(C)){if(ls(ot)||Oa(ot)){mt(C,bl(void 0));return}}else{if(ls(ot))if(de.delete(C),D>$e){mt(C,bl(void 0));return}else return ne.add(C),mt(C,au(we)),Le(Ce,ot,!1,{fetcherSubmission:we,preventScrollReset:De});if(Oa(ot)){Gt(C,k,ot.error);return}}let rt=j.navigation.location||j.location,ct=Ps(t.history,rt,Xe.signal),Qt=m.activeRoutes,Fn=j.navigation.state!=="idle"?al(Qt,j.navigation.location,p,!1,m.branches):j.matches;et(Fn,"Didn't find any matches after fetcher action");let Sn=++pe;q.set(C,Sn);let{dsMatches:An,revalidatingFetchers:On}=cy(ct,ae,o,f,t.history,j,Fn,we,rt,i,!1,B,ie,Ne,ce,ne,Qt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ke.route.id,ot],Oe),In=au(we,ot.data),fa=new Map(j.fetchers);fa.set(C,In),On.filter(Et=>Et.key!==C).forEach(Et=>{let wa=Et.key,Gn=fa.get(wa),Lr=au(void 0,Gn?Gn.data:void 0);fa.set(wa,Lr),St(wa),Et.controller&&de.set(wa,Et.controller)}),ut({fetchers:fa});let tr=()=>On.forEach(Et=>St(Et.key));Xe.signal.addEventListener("abort",tr);let{loaderResults:ea,fetcherResults:ul}=await Ve(An,On,ct,rt,ae);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",tr),q.delete(C),de.delete(C),On.forEach(Et=>de.delete(Et.key));let Pe=j.fetchers.has(C),wt=Et=>{if(!Pe)return Et;let wa=new Map(Et.fetchers);return wa.set(C,bl(ot.data)),{...Et,fetchers:wa}},Kt=Jo(ea);if(Kt)return j=wt(j),Le(ct,Kt.result,!1,{preventScrollReset:De});if(Kt=Jo(ul),Kt)return ne.add(Kt.key),j=wt(j),Le(ct,Kt.result,!1,{preventScrollReset:De});let ta=new Map(j.fetchers);Pe&&ta.set(C,bl(ot.data));let{loaderData:Mn,errors:jl}=vy(j,Fn,ea,void 0,On,ul,ta);Wn(Sn,ta),j.navigation.state==="loading"&&Sn>D?(et(oe,"Expected pending action"),Re&&Re.abort(),se(j.navigation.location,{matches:Fn,loaderData:Mn,errors:jl,fetchers:ta})):(ut({errors:jl,loaderData:yy(j.loaderData,Mn,Fn,jl),fetchers:ta}),B=!1)}async function fe(C,k,$,Z,ae,je,ge,De,we){let Oe=j.fetchers.get(C);mt(C,au(we,Oe?Oe.data:void 0),{flushSync:ge});let _e=new AbortController,Xe=Ps(t.history,$,_e.signal);if(je){let ot=await dt(Z,new URL(Xe.url).pathname,Xe.signal,C);if(ot.type==="aborted")return;if(ot.type==="error"){Gt(C,k,ot.error,{flushSync:ge});return}else if(ot.matches)Z=ot.matches;else{Gt(C,k,Ga(404,{pathname:$}),{flushSync:ge});return}}let Ce=cc(Z,$);de.set(C,_e);let Ke=pe,$e=Zs(o,f,Xe,$,Z,Ce,i,ae),Ht=await ke(Xe,$,$e,ae,C),Je=Ht[Ce.route.id];if(!Je){for(let ot of Z)if(Ht[ot.route.id]){Je=Ht[ot.route.id];break}}if(de.get(C)===_e&&de.delete(C),!Xe.signal.aborted){if(Ne.has(C)){mt(C,bl(void 0));return}if(ls(Je))if(D>Ke){mt(C,bl(void 0));return}else{ne.add(C),await Le(Xe,Je,!1,{preventScrollReset:De});return}if(Oa(Je)){Gt(C,k,Je.error);return}mt(C,bl(Je.data))}}async function Le(C,k,$,{submission:Z,fetcherSubmission:ae,preventScrollReset:je,replace:ge}={}){$||(me==null||me.resolve(),me=null),k.response.headers.has("X-Remix-Revalidate")&&(B=!0);let De=k.response.headers.get("Location");et(De,"Expected a Location header on the redirect Response"),De=py(De,new URL(C.url),p,t.history);let we=xu(j.location,De,{_isRedirect:!0});if(r){let $e=!1;if(k.response.headers.has("X-Remix-Reload-Document"))$e=!0;else if(Hh(De)){const Ht=yx(a,De,!0);$e=Ht.origin!==a.location.origin||Ka(Ht.pathname,p)==null}if($e){ge?a.location.replace(De):a.location.assign(De);return}}Re=null;let Oe=ge===!0||k.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:_e,formAction:Xe,formEncType:Ce}=j.navigation;!Z&&!ae&&_e&&Xe&&Ce&&(Z=Sy(j.navigation));let Ke=Z||ae;if(w1.has(k.response.status)&&Ke&&ua(Ke.formMethod))await It(Oe,we,{submission:{...Ke,formAction:De},preventScrollReset:je||ye,enableViewTransition:$?ee:void 0});else{let $e=th(we,[],Oe,Z);await It(Oe,we,{overrideNavigation:$e,fetcherSubmission:ae,preventScrollReset:je||ye,enableViewTransition:$?ee:void 0})}}async function ke(C,k,$,Z,ae){var De;let je,ge={};try{je=await M1(g,C,k,$,ae,Z,!1)}catch(we){return $.filter(Oe=>Oe.shouldLoad).forEach(Oe=>{ge[Oe.route.id]={type:"error",error:we}}),ge}if(C.signal.aborted)return ge;if(!ua(C.method))for(let we of $){if(((De=je[we.route.id])==null?void 0:De.type)==="error")break;!je.hasOwnProperty(we.route.id)&&!j.loaderData.hasOwnProperty(we.route.id)&&(!j.errors||!j.errors.hasOwnProperty(we.route.id))&&we.shouldCallHandler()&&(je[we.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${we.route.id}`)})}for(let[we,Oe]of Object.entries(je))if(V1(Oe)){let _e=Oe.result;ge[we]={type:"redirect",response:z1(_e,C,we,$,p)}}else ge[we]=await L1(Oe);return ge}async function Ve(C,k,$,Z,ae){let je=ke($,Z,C,ae,null),ge=Promise.all(k.map(async Oe=>{if(Oe.matches&&Oe.match&&Oe.request&&Oe.controller){let Xe=(await ke(Oe.request,Oe.path,Oe.matches,ae,Oe.key))[Oe.match.route.id];return{[Oe.key]:Xe}}else return Promise.resolve({[Oe.key]:{type:"error",error:Ga(404,{pathname:Oe.path})}})})),De=await je,we=(await ge).reduce((Oe,_e)=>Object.assign(Oe,_e),{});return{loaderResults:De,fetcherResults:we}}function nt(){B=!0,ce.forEach((C,k)=>{de.has(k)&&ie.add(k),St(k)})}function mt(C,k,$={}){let Z=new Map(j.fetchers);Z.set(C,k),ut({fetchers:Z},{flushSync:($&&$.flushSync)===!0})}function Gt(C,k,$,Z={}){let ae=Cr(j.matches,k),je=new Map(j.fetchers);sn(je,C),ut({errors:{[ae.route.id]:$},fetchers:je},{flushSync:(Z&&Z.flushSync)===!0})}function an(C){return Te.set(C,(Te.get(C)||0)+1),Ne.has(C)&&Ne.delete(C),j.fetchers.get(C)||Ax}function Hn(C,k){St(C,k==null?void 0:k.reason),mt(C,bl(null))}function sn(C,k){let $=j.fetchers.get(k);de.has(k)&&!($&&$.state==="loading"&&q.has(k))&&St(k),ce.delete(k),q.delete(k),ne.delete(k),Ne.delete(k),ie.delete(k),C.delete(k)}function re(C){let k=(Te.get(C)||0)-1;k<=0?(Te.delete(C),Ne.add(C)):Te.set(C,k),ut({fetchers:new Map(j.fetchers)})}function St(C,k){let $=de.get(C);$&&($.abort(k),de.delete(C))}function Mt(C,k){for(let $ of C){let Z=k.get($);et(Z,`Expected fetcher: ${$}`);let ae=bl(Z.data);k.set($,ae)}}function Jn(C){let k=[],$=!1;for(let Z of ne){let ae=C.get(Z);et(ae,`Expected fetcher: ${Z}`),ae.state==="loading"&&(ne.delete(Z),k.push(Z),$=!0)}return Mt(k,C),$}function Wn(C,k){let $=[];for(let[Z,ae]of q)if(ae<C){let je=k.get(Z);et(je,`Expected fetcher: ${Z}`),je.state==="loading"&&(St(Z),q.delete(Z),$.push(Z))}return Mt($,k),$.length>0}function Tl(C,k){let $=j.blockers.get(C)||nu;return Ue.get(C)!==k&&Ue.set(C,k),$}function Be(C){j.blockers.delete(C),Ue.delete(C)}function Xt(C,k){let $=j.blockers.get(C)||nu;et($.state==="unblocked"&&k.state==="blocked"||$.state==="blocked"&&k.state==="blocked"||$.state==="blocked"&&k.state==="proceeding"||$.state==="blocked"&&k.state==="unblocked"||$.state==="proceeding"&&k.state==="unblocked",`Invalid blocker state transition: ${$.state} -> ${k.state}`);let Z=new Map(j.blockers);Z.set(C,k),ut({blockers:Z})}function qt({currentLocation:C,nextLocation:k,historyAction:$}){if(Ue.size===0)return;Ue.size>1&&xn(!1,"A router only supports one blocker at a time");let Z=Array.from(Ue.entries()),[ae,je]=Z[Z.length-1],ge=j.blockers.get(ae);if(!(ge&&ge.state==="proceeding")&&je({currentLocation:C,nextLocation:k,historyAction:$}))return ae}function vt(C){let k=Ga(404,{pathname:C}),$=m.activeRoutes,{matches:Z,route:ae}=Zo($);return{notFoundMatches:Z,route:ae,error:k}}function zt(C,k,$){if(N=C,T=k,O=$||null,!L&&j.navigation===eh){L=!0;let Z=Pt(j.location,j.matches);Z!=null&&ut({restoreScrollPosition:Z})}return()=>{N=null,T=null,O=null}}function Tt(C,k){return O&&O(C,k.map(Z=>QS(Z,j.loaderData)))||C.key}function Wt(C,k){if(N&&T){let $=Tt(C,k);N[$]=T()}}function Pt(C,k){if(N){let $=Tt(C,k),Z=N[$];if(typeof Z=="number")return Z}return null}function Ut(C,k,$){if(t.patchRoutesOnNavigation){let Z=m.branches;if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:al(k,$,p,!0,Z)}}else return{active:!0,matches:al(k,$,p,!0,Z)||[]}}return{active:!1,matches:null}}async function dt(C,k,$,Z){if(!t.patchRoutesOnNavigation)return{type:"success",matches:C};let ae=C;for(;;){let je=f;try{await t.patchRoutesOnNavigation({signal:$,path:k,matches:ae,fetcherKey:Z,patch:(Oe,_e)=>{$.aborted||dy(Oe,_e,m,je,o,!1)}})}catch(Oe){return{type:"error",error:Oe,partialMatches:ae}}if($.aborted)return{type:"aborted"};let ge=m.branches,De=al(m.activeRoutes,k,p,!1,ge),we=null;if(De){if(Object.keys(De[0].params).length===0)return{type:"success",matches:De};if(we=al(m.activeRoutes,k,p,!0,ge),!(we&&ae.length<we.length&&Ze(ae,we.slice(0,ae.length))))return{type:"success",matches:De}}if(we||(we=al(m.activeRoutes,k,p,!0,ge)),!we||Ze(ae,we))return{type:"success",matches:null};ae=we}}function Ze(C,k){return C.length===k.length&&C.every(($,Z)=>$.route.id===k[Z].route.id)}function bn(C){f={},m.setHmrRoutes(bu(C,o,void 0,f))}function Cn(C,k,$=!1){dy(C,k,m,f,o,$),m.hasHMRRoutes||ut({})}return U={get basename(){return p},get future(){return x},get state(){return j},get routes(){return m.stableRoutes},get branches(){return m.branches},get manifest(){return f},get window(){return a},initialize:tt,subscribe:Rt,enableScrollRestoration:zt,navigate:Ye,fetch:Yn,revalidate:Ie,createHref:C=>t.history.createHref(C),encodeLocation:C=>t.history.encodeLocation(C),getFetcher:an,resetFetcher:Hn,deleteFetcher:re,dispose:pn,getBlocker:Tl,deleteBlocker:Be,patchRoutes:Cn,_internalFetchControllers:de,_internalSetRoutes:bn,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){ut(C)}},t.instrumentations&&(U=m1(U,t.instrumentations.map(C=>C.router).filter(Boolean))),U}function T1(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Rh(t,a,r,i,u,o){let f,m;if(u){f=[];for(let g of a)if(f.push(g),g.route.id===u){m=g;break}}else f=a,m=a[a.length-1];let p=Dc(i||".",Bh(f),Ka(t.pathname,r)||t.pathname,o==="path");if(i==null&&(p.search=t.search,p.hash=t.hash),(i==null||i===""||i===".")&&m){let g=Vh(p.search);if(m.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&g){let x=new URLSearchParams(p.search),b=x.getAll("index");x.delete("index"),b.filter(S=>S).forEach(S=>x.append("index",S));let E=x.toString();p.search=E?`?${E}`:""}}return r!=="/"&&(p.pathname=i1({basename:r,pathname:p.pathname})),El(p)}function oy(t,a,r){if(!r||!T1(r))return{path:a};if(r.formMethod&&!G1(r.formMethod))return{path:a,error:Ga(405,{method:r.formMethod})};let i=()=>({path:a,error:Ga(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),f=$x(a);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ua(o))return i();let b=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((E,[S,N])=>`${E}${S}=${N}
|
|
59
|
+
`,""):String(r.body);return{path:a,submission:{formMethod:o,formAction:f,formEncType:r.formEncType,formData:void 0,json:void 0,text:b}}}else if(r.formEncType==="application/json"){if(!ua(o))return i();try{let b=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:a,submission:{formMethod:o,formAction:f,formEncType:r.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}et(typeof FormData=="function","FormData is not available in this environment");let m,p;if(r.formData)m=Dh(r.formData),p=r.formData;else if(r.body instanceof FormData)m=Dh(r.body),p=r.body;else if(r.body instanceof URLSearchParams)m=r.body,p=gy(m);else if(r.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(r.body),p=gy(m)}catch{return i()}let g={formMethod:o,formAction:f,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(ua(g.formMethod))return{path:a,submission:g};let x=Nl(a);return t&&x.search&&Vh(x.search)&&m.append("index",""),x.search=`?${m}`,{path:El(x),submission:g}}function cy(t,a,r,i,u,o,f,m,p,g,x,b,E,S,N,O,T,L,X,Y,Q,K){var z;let W=Q?Oa(Q[1])?Q[1].error:Q[1].data:void 0,U=u.createURL(o.location),j=u.createURL(p),oe;if(x&&o.errors){let B=Object.keys(o.errors)[0];oe=f.findIndex(ie=>ie.route.id===B)}else if(Q&&Oa(Q[1])){let B=Q[0];oe=f.findIndex(ie=>ie.route.id===B)-1}let me=Q?Q[1].statusCode:void 0,ye=me&&me>=400,Re={currentUrl:U,currentParams:((z=o.matches[0])==null?void 0:z.params)||{},nextUrl:j,nextParams:f[0].params,...m,actionResult:W,actionStatus:me},ee=Tu(f),be=f.map((B,ie)=>{let{route:de}=B,pe=null;if(oe!=null&&ie>oe)pe=!1;else if(de.lazy)pe=!0;else if(!qh(de))pe=!1;else if(x){let{shouldLoad:ce}=kx(de,o.loaderData,o.errors);pe=ce}else j1(o.loaderData,o.matches[ie],B)&&(pe=!0);if(pe!==null)return Th(r,i,t,p,ee,B,g,a,pe);let D=!1;typeof K=="boolean"?D=K:ye?D=!1:(b||U.pathname+U.search===j.pathname+j.search||U.search!==j.search||D1(o.matches[ie],B))&&(D=!0);let q={...Re,defaultShouldRevalidate:D},ne=hu(B,q);return Th(r,i,t,p,ee,B,g,a,ne,q,K)}),Ee=[];return N.forEach((B,ie)=>{if(x||!f.some(Ne=>Ne.route.id===B.routeId)||S.has(ie))return;let de=o.fetchers.get(ie),pe=de&&de.state!=="idle"&&de.data===void 0,D=al(T,B.path,L??"/",!1,Y);if(!D){if(X&&pe)return;Ee.push({key:ie,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(O.has(ie))return;let q=cc(D,B.path),ne=new AbortController,ce=Ps(u,B.path,ne.signal),Te=null;if(E.has(ie))E.delete(ie),Te=Zs(r,i,ce,B.path,D,q,g,a);else if(pe)b&&(Te=Zs(r,i,ce,B.path,D,q,g,a));else{let Ne;typeof K=="boolean"?Ne=K:ye?Ne=!1:Ne=b;let Ue={...Re,defaultShouldRevalidate:Ne};hu(q,Ue)&&(Te=Zs(r,i,ce,B.path,D,q,g,a,Ue))}Te&&Ee.push({key:ie,routeId:B.routeId,path:B.path,matches:Te,match:q,request:ce,controller:ne})}),{dsMatches:be,revalidatingFetchers:Ee}}function qh(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function kx(t,a,r){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!qh(t))return{shouldLoad:!1,renderFallback:!1};let i=a!=null&&t.id in a,u=r!=null&&r[t.id]!==void 0;if(!i&&u)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let o=!i&&!u;return{shouldLoad:o,renderFallback:o}}function j1(t,a,r){let i=!a||r.route.id!==a.route.id,u=!t.hasOwnProperty(r.route.id);return i||u}function D1(t,a){let r=t.route.path;return t.pathname!==a.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==a.params["*"]}function hu(t,a){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(a);if(typeof r=="boolean")return r}return a.defaultShouldRevalidate}function dy(t,a,r,i,u,o){let f;if(t){let g=i[t];et(g,`No route found to patch children into: routeId = ${t}`),g.children||(g.children=[]),f=g.children}else f=r.activeRoutes;let m=[],p=[];if(a.forEach(g=>{let x=f.find(b=>_x(g,b));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=bu(m,u,[t||"_","patch",String((f==null?void 0:f.length)||"0")],i);f.push(...g)}if(o&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:x,newRoute:b}=p[g],E=x,[S]=bu([b],u,[],{},!0);Object.assign(E,{element:S.element?S.element:E.element,errorElement:S.errorElement?S.errorElement:E.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:E.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function _x(t,a){var r;return"id"in t&&"id"in a&&t.id===a.id?!0:t.index===a.index&&t.path===a.path&&t.caseSensitive===a.caseSensitive?(!t.children||t.children.length===0)&&(!a.children||a.children.length===0)?!0:((r=t.children)==null?void 0:r.every((i,u)=>{var o;return(o=a.children)==null?void 0:o.some(f=>_x(i,f))}))??!1:!1}var fy=new WeakMap,Lx=({key:t,route:a,manifest:r,mapRouteProperties:i})=>{let u=r[a.id];if(et(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let o=u.lazy[t];if(!o)return;let f=fy.get(u);f||(f={},fy.set(u,f));let m=f[t];if(m)return m;let p=(async()=>{let g=IS(t),b=u[t]!==void 0&&t!=="hasErrorBoundary";if(g)xn(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),f[t]=Promise.resolve();else if(b)xn(!1,`Route "${u.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let E=await o();E!=null&&(Object.assign(u,{[t]:E}),Object.assign(u,i(u)))}typeof u.lazy=="object"&&(u.lazy[t]=void 0,Object.values(u.lazy).every(E=>E===void 0)&&(u.lazy=void 0))})();return f[t]=p,p},hy=new WeakMap;function C1(t,a,r,i,u){let o=r[t.id];if(et(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=hy.get(o);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let b=(async()=>{et(typeof t.lazy=="function","No lazy route function found");let E=await t.lazy(),S={};for(let N in E){let O=E[N];if(O===void 0)continue;let T=XS(N),X=o[N]!==void 0&&N!=="hasErrorBoundary";T?xn(!T,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):X?xn(!X,`Route "${o.id}" has a static property "${N}" defined but its lazy function is also returning a value for this property. The lazy route property "${N}" will be ignored.`):S[N]=O}Object.assign(o,S),Object.assign(o,{...i(o),lazy:void 0})})();return hy.set(o,b),b.catch(()=>{}),{lazyRoutePromise:b,lazyHandlerPromise:b}}let f=Object.keys(t.lazy),m=[],p;for(let x of f){if(u&&u.includes(x))continue;let b=Lx({key:x,route:t,manifest:r,mapRouteProperties:i});b&&(m.push(b),x===a&&(p=b))}let g=m.length>0?Promise.all(m).then(()=>{}):void 0;return g==null||g.catch(()=>{}),p==null||p.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:p}}async function my(t){let a=t.matches.filter(u=>u.shouldLoad),r={};return(await Promise.all(a.map(u=>u.resolve()))).forEach((u,o)=>{r[a[o].route.id]=u}),r}async function A1(t){return t.matches.some(a=>a.route.middleware)?zx(t,()=>my(t)):my(t)}function zx(t,a){return O1(t,a,i=>{if(I1(i))throw i;return i},q1,r);function r(i,u,o){if(o)return Promise.resolve(Object.assign(o.value,{[u]:{type:"error",result:i}}));{let{matches:f}=t,m=Math.min(Math.max(f.findIndex(g=>g.route.id===u),0),Math.max(f.findIndex(g=>g.shouldCallHandler()),0)),p=Cr(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:i}})}}}async function O1(t,a,r,i,u){let{matches:o,...f}=t,m=o.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await Ux(f,m,a,r,i,u)}async function Ux(t,a,r,i,u,o,f=0){let{request:m}=t;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let p=a[f];if(!p)return await r();let[g,x]=p,b,E=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await Ux(t,a,r,i,u,o,f+1)},b.value}catch(S){return b={value:await o(S,g,b)},b.value}};try{let S=await x(t,E),N=S!=null?i(S):void 0;return u(N)?N:b?N??b.value:(b={value:await E()},b.value)}catch(S){return await o(S,g,b)}}function Hx(t,a,r,i,u){let o=Lx({key:"middleware",route:i.route,manifest:a,mapRouteProperties:t}),f=C1(i.route,ua(r.method)?"action":"loader",a,t,u);return{middleware:o,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Th(t,a,r,i,u,o,f,m,p,g=null,x){let b=!1,E=Hx(t,a,r,o,f);return{...o,_lazyPromises:E,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return b=!0,g?typeof x=="boolean"?hu(o,{...g,defaultShouldRevalidate:x}):typeof S=="boolean"?hu(o,{...g,defaultShouldRevalidate:S}):hu(o,g):p},resolve(S){let{lazy:N,loader:O,middleware:T}=o.route,L=b||p||S&&!ua(r.method)&&(N||O),X=T&&T.length>0&&!O&&!N;return L&&(ua(r.method)||!X)?k1({request:r,path:i,pattern:u,match:o,lazyHandlerPromise:E==null?void 0:E.handler,lazyRoutePromise:E==null?void 0:E.route,handlerOverride:S,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Zs(t,a,r,i,u,o,f,m,p=null){return u.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Hx(t,a,r,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Th(t,a,r,i,Tu(u),g,f,m,!0,p))}async function M1(t,a,r,i,u,o,f){i.some(x=>{var b;return(b=x._lazyPromises)==null?void 0:b.middleware})&&await Promise.all(i.map(x=>{var b;return(b=x._lazyPromises)==null?void 0:b.middleware}));let m={request:a,url:Bx(a,r),pattern:Tu(i),params:i[0].params,context:o,matches:i},g=await t({...m,fetcherKey:u,runClientMiddleware:x=>{let b=m;return zx(b,()=>x({...b,fetcherKey:u,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(x=>{var b,E;return[(b=x._lazyPromises)==null?void 0:b.handler,(E=x._lazyPromises)==null?void 0:E.route]}))}catch{}return g}async function k1({request:t,path:a,pattern:r,match:i,lazyHandlerPromise:u,lazyRoutePromise:o,handlerOverride:f,scopedContext:m}){let p,g,x=ua(t.method),b=x?"action":"loader",E=S=>{let N,O=new Promise((X,Y)=>N=Y);g=()=>N(),t.signal.addEventListener("abort",g);let T=X=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${i.route.id}]`)):S({request:t,url:Bx(t,a),pattern:r,params:i.params,context:m},...X!==void 0?[X]:[]),L=(async()=>{try{return{type:"data",result:await(f?f(Y=>T(Y)):T())}}catch(X){return{type:"error",result:X}}})();return Promise.race([L,O])};try{let S=x?i.route.action:i.route.loader;if(u||o)if(S){let N,[O]=await Promise.all([E(S).catch(T=>{N=T}),u,o]);if(N!==void 0)throw N;p=O}else{await u;let N=x?i.route.action:i.route.loader;if(N)[p]=await Promise.all([E(N),o]);else if(b==="action"){let O=new URL(t.url),T=O.pathname+O.search;throw Ga(405,{method:t.method,pathname:T,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(S)p=await E(S);else{let N=new URL(t.url),O=N.pathname+N.search;throw Ga(404,{pathname:O})}}catch(S){return{type:"error",result:S}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function _1(t){let a=t.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?t.body==null?null:t.json():t.text()}async function L1(t){var i,u,o,f,m;let{result:a,type:r}=t;if(Yh(a)){let p;try{p=await _1(a)}catch(g){return{type:"error",error:g}}return r==="error"?{type:"error",error:new Ru(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return r==="error"?by(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:(i=a.init)==null?void 0:i.status,headers:(u=a.init)!=null&&u.headers?new Headers(a.init.headers):void 0}:{type:"error",error:$1(a),statusCode:Ws(a)?a.status:void 0,headers:(o=a.init)!=null&&o.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Ws(a)?a.status:void 0}:by(a)?{type:"data",data:a.data,statusCode:(f=a.init)==null?void 0:f.status,headers:(m=a.init)!=null&&m.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function z1(t,a,r,i,u){let o=t.headers.get("Location");if(et(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Hh(o)){let f=i.slice(0,i.findIndex(m=>m.route.id===r)+1);o=Rh(new URL(a.url),f,u,o),t.headers.set("Location",o)}return t}var U1=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function jh(t){try{return U1.includes(new URL(t).protocol)}catch{return!1}}function py(t,a,r,i){if(Hh(t)){let u=t,o=Uh.test(u)?new URL(vx(u,a.protocol)):new URL(u);if(jh(o.toString()))throw new Error("Invalid redirect location");let f=Ka(o.pathname,r)!=null;if(o.origin===a.origin&&f)return $h(o.pathname)+o.search+o.hash}try{let u=i.createURL(t);if(jh(u.toString()))throw new Error("Invalid redirect location")}catch{}return t}function Ps(t,a,r,i){let u=t.createURL($x(a)).toString(),o={signal:r};if(i&&ua(i.formMethod)){let{formMethod:f,formEncType:m}=i;o.method=f.toUpperCase(),m==="application/json"?(o.headers=new Headers({"Content-Type":m}),o.body=JSON.stringify(i.json)):m==="text/plain"?o.body=i.text:m==="application/x-www-form-urlencoded"&&i.formData?o.body=Dh(i.formData):o.body=i.formData}return new Request(u,o)}function Bx(t,a){let r=new URL(t.url),i=typeof a=="string"?Nl(a):a;if(r.pathname=i.pathname||"/",i.search){let u=new URLSearchParams(i.search),o=u.getAll("index");u.delete("index");for(let f of o.filter(Boolean))u.append("index",f);r.search=u.size?`?${u.toString()}`:""}else r.search="";return r.hash=i.hash||"",r}function Dh(t){let a=new URLSearchParams;for(let[r,i]of t.entries())a.append(r,typeof i=="string"?i:i.name);return a}function gy(t){let a=new FormData;for(let[r,i]of t.entries())a.append(r,i);return a}function H1(t,a,r,i=!1,u=!1){let o={},f=null,m,p=!1,g={},x=r&&Oa(r[1])?r[1].error:void 0;return t.forEach(b=>{if(!(b.route.id in a))return;let E=b.route.id,S=a[E];if(et(!ls(S),"Cannot handle redirect results in processLoaderData"),Oa(S)){let N=S.error;if(x!==void 0&&(N=x,x=void 0),f=f||{},u)f[E]=N;else{let O=Cr(t,E);f[O.route.id]==null&&(f[O.route.id]=N)}i||(o[E]=Mx),p||(p=!0,m=Ws(S.error)?S.error.status:500),S.headers&&(g[E]=S.headers)}else o[E]=S.data,S.statusCode&&S.statusCode!==200&&!p&&(m=S.statusCode),S.headers&&(g[E]=S.headers)}),x!==void 0&&r&&(f={[r[0]]:x},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:f,statusCode:m||200,loaderHeaders:g}}function vy(t,a,r,i,u,o,f){let{loaderData:m,errors:p}=H1(a,r,i);return u.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:b,controller:E}=g;if(E&&E.signal.aborted)return;let S=o[x];if(et(S,"Did not find corresponding fetcher result"),Oa(S)){let N=Cr(t.matches,b==null?void 0:b.route.id);p&&p[N.route.id]||(p={...p,[N.route.id]:S.error}),f.delete(x)}else if(ls(S))et(!1,"Unhandled fetcher revalidation redirect");else{let N=bl(S.data);f.set(x,N)}}),{loaderData:m,errors:p}}function yy(t,a,r,i){let u=Object.entries(a).filter(([,o])=>o!==Mx).reduce((o,[f,m])=>(o[f]=m,o),{});for(let o of r){let f=o.route.id;if(!a.hasOwnProperty(f)&&t.hasOwnProperty(f)&&o.route.loader&&(u[f]=t[f]),i&&i.hasOwnProperty(f))break}return u}function xy(t){return t?Oa(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Cr(t,a){return(a?t.slice(0,t.findIndex(i=>i.route.id===a)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function Zo(t){let a=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Ga(t,{pathname:a,routeId:r,method:i,type:u,message:o}={}){let f="Unknown Server Error",m="Unknown @remix-run/router error";return t===400?(f="Bad Request",i&&a&&r?m=`You made a ${i} request to "${a}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:u==="invalid-body"&&(m="Unable to encode submission body")):t===403?(f="Forbidden",m=`Route "${r}" does not match URL "${a}"`):t===404?(f="Not Found",m=`No route matches URL "${a}"`):t===405&&(f="Method Not Allowed",i&&a&&r?m=`You made a ${i.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:i&&(m=`Invalid request method "${i.toUpperCase()}"`)),new Ru(t||500,f,new Error(m),!0)}function Jo(t){let a=Object.entries(t);for(let r=a.length-1;r>=0;r--){let[i,u]=a[r];if(ls(u))return{key:i,result:u}}}function $x(t){let a=typeof t=="string"?Nl(t):t;return El({...a,hash:""})}function B1(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function $1(t){var a,r;return new Ru(((a=t.init)==null?void 0:a.status)??500,((r=t.init)==null?void 0:r.statusText)??"Internal Server Error",t.data)}function q1(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,r])=>typeof a=="string"&&Y1(r))}function Y1(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function V1(t){return Yh(t.result)&&Cx.has(t.result.status)}function Oa(t){return t.type==="error"}function ls(t){return(t&&t.type)==="redirect"}function by(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Yh(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function F1(t){return Cx.has(t)}function I1(t){return Yh(t)&&F1(t.status)&&t.headers.has("Location")}function G1(t){return S1.has(t.toUpperCase())}function ua(t){return x1.has(t.toUpperCase())}function Vh(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function cc(t,a){let r=typeof a=="string"?Nl(a).search:a.search;if(t[t.length-1].route.index&&Vh(r||""))return t[t.length-1];let i=Nx(t);return i[i.length-1]}function Sy(t){let{formMethod:a,formAction:r,formEncType:i,text:u,formData:o,json:f}=t;if(!(!a||!r||!i)){if(u!=null)return{formMethod:a,formAction:r,formEncType:i,formData:void 0,json:void 0,text:u};if(o!=null)return{formMethod:a,formAction:r,formEncType:i,formData:o,json:void 0,text:void 0};if(f!==void 0)return{formMethod:a,formAction:r,formEncType:i,formData:void 0,json:f,text:void 0}}}function th(t,a,r,i){return i?{state:"loading",location:t,matches:a,historyAction:r,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:t,matches:a,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function X1(t,a,r,i){return{state:"submitting",location:t,matches:a,historyAction:r,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function au(t,a){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function P1(t,a){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a?a.data:void 0}}function bl(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Q1(t,a){try{let r=t.sessionStorage.getItem(Ox);if(r){let i=JSON.parse(r);for(let[u,o]of Object.entries(i||{}))o&&Array.isArray(o)&&a.set(u,new Set(o||[]))}}catch{}}function K1(t,a){if(a.size>0){let r={};for(let[i,u]of a)r[i]=[...u];try{t.sessionStorage.setItem(Ox,JSON.stringify(r))}catch(i){xn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function wy(){let t,a,r=new Promise((i,u)=>{t=async o=>{i(o);try{await r}catch{}},a=async o=>{u(o);try{await r}catch{}}});return{promise:r,resolve:t,reject:a}}var us=v.createContext(null);us.displayName="DataRouter";var li=v.createContext(null);li.displayName="DataRouterState";var qx=v.createContext(!1);function Yx(){return v.useContext(qx)}var Fh=v.createContext({isTransitioning:!1});Fh.displayName="ViewTransition";var Ih=v.createContext(new Map);Ih.displayName="Fetchers";var Z1=v.createContext(null);Z1.displayName="Await";var Za=v.createContext(null);Za.displayName="Navigation";var Cc=v.createContext(null);Cc.displayName="Location";var sl=v.createContext({outlet:null,matches:[],isDataRoute:!1});sl.displayName="Route";var Gh=v.createContext(null);Gh.displayName="RouteError";var Vx="REACT_ROUTER_ERROR",J1="REDIRECT",W1="ROUTE_ERROR_RESPONSE";function ew(t){if(t.startsWith(`${Vx}:${J1}:{`))try{let a=JSON.parse(t.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function tw(t){if(t.startsWith(`${Vx}:${W1}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Ru(a.status,a.statusText,a.data)}catch{}}function nw(t,{relative:a}={}){et(ju(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=v.useContext(Za),{hash:u,pathname:o,search:f}=Du(t,{relative:a}),m=o;return r!=="/"&&(m=o==="/"?r:Qa([r,o])),i.createHref({pathname:m,search:f,hash:u})}function ju(){return v.useContext(Cc)!=null}function il(){return et(ju(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Cc).location}var Fx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ix(t){v.useContext(Za).static||v.useLayoutEffect(t)}function er(){let{isDataRoute:t}=v.useContext(sl);return t?pw():aw()}function aw(){et(ju(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(us),{basename:a,navigator:r}=v.useContext(Za),{matches:i}=v.useContext(sl),{pathname:u}=il(),o=JSON.stringify(Bh(i)),f=v.useRef(!1);return Ix(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(xn(f.current,Fx),!f.current)return;if(typeof p=="number"){r.go(p);return}let x=Dc(p,JSON.parse(o),u,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Qa([a,x.pathname])),(g.replace?r.replace:r.push)(x,g.state,g)},[a,r,o,u,t])}var lw=v.createContext(null);function rw(t){let a=v.useContext(sl).outlet;return v.useMemo(()=>a&&v.createElement(lw.Provider,{value:t},a),[a,t])}function Du(t,{relative:a}={}){let{matches:r}=v.useContext(sl),{pathname:i}=il(),u=JSON.stringify(Bh(r));return v.useMemo(()=>Dc(t,JSON.parse(u),i,a==="path"),[t,u,i,a])}function sw(t,a,r){et(ju(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(Za),{matches:u}=v.useContext(sl),o=u[u.length-1],f=o?o.params:{},m=o?o.pathname:"/",p=o?o.pathnameBase:"/",g=o&&o.route;{let T=g&&g.path||"";Qx(m,!g||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let x=il(),b;b=x;let E=b.pathname||"/",S=E;if(p!=="/"){let T=p.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(T.length).join("/")}let N=r&&r.state.matches.length?r.state.matches.map(T=>Object.assign(T,{route:r.manifest[T.route.id]||T.route})):xx(t,{pathname:S});return xn(g||N!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),xn(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),dw(N&&N.map(T=>Object.assign({},T,{params:Object.assign({},f,T.params),pathname:Qa([p,i.encodeLocation?i.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?p:Qa([p,i.encodeLocation?i.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),u,r)}function iw(){let t=Px(),a=Ws(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},a),r?v.createElement("pre",{style:u},r):null,f)}var uw=v.createElement(iw,null),Gx=class extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const r=tw(t.digest);r&&(t=r)}let a=t!==void 0?v.createElement(sl.Provider,{value:this.props.routeContext},v.createElement(Gh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(ow,{error:t},a):a}};Gx.contextType=qx;var nh=new WeakMap;function ow({children:t,error:a}){let{basename:r}=v.useContext(Za);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let i=ew(a.digest);if(i){let u=nh.get(a);if(u)throw u;let o=Tx(i.location,r),f=o.absoluteURL||o.to;if(jh(f))throw new Error("Invalid redirect location");if(Rx&&!nh.get(a))if(o.isExternal||i.reloadDocument)window.location.href=f;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw nh.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function cw({routeContext:t,match:a,children:r}){let i=v.useContext(us);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(sl.Provider,{value:t},r)}function dw(t,a=[],r){let i=r==null?void 0:r.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(a.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let u=t,o=i==null?void 0:i.errors;if(o!=null){let x=u.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);et(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let f=!1,m=-1;if(r&&i){f=i.renderFallback;for(let x=0;x<u.length;x++){let b=u[x];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=x),b.route.id){let{loaderData:E,errors:S}=i,N=b.route.loader&&!E.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||N){r.isStatic&&(f=!0),m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}}let p=r==null?void 0:r.onError,g=i&&p?(x,b)=>{var E,S;p(x,{location:i.location,params:((S=(E=i.matches)==null?void 0:E[0])==null?void 0:S.params)??{},pattern:Tu(i.matches),errorInfo:b})}:void 0;return u.reduceRight((x,b,E)=>{let S,N=!1,O=null,T=null;i&&(S=o&&b.route.id?o[b.route.id]:void 0,O=b.route.errorElement||uw,f&&(m<0&&E===0?(Qx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,T=null):m===E&&(N=!0,T=b.route.hydrateFallbackElement||null)));let L=a.concat(u.slice(0,E+1)),X=()=>{let Y;return S?Y=O:N?Y=T:b.route.Component?Y=v.createElement(b.route.Component,null):b.route.element?Y=b.route.element:Y=x,v.createElement(cw,{match:b,routeContext:{outlet:x,matches:L,isDataRoute:i!=null},children:Y})};return i&&(b.route.ErrorBoundary||b.route.errorElement||E===0)?v.createElement(Gx,{location:i.location,revalidation:i.revalidation,component:O,error:S,children:X(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:g}):X()},null)}function Xh(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xx(t){let a=v.useContext(us);return et(a,Xh(t)),a}function Cu(t){let a=v.useContext(li);return et(a,Xh(t)),a}function fw(t){let a=v.useContext(sl);return et(a,Xh(t)),a}function Ac(t){let a=fw(t),r=a.matches[a.matches.length-1];return et(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function hw(){return Ac("useRouteId")}function Mr(){let t=Cu("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:r,...i}=t.navigation;return i},[t.navigation])}function mw(){let t=Xx("useRevalidator"),a=Cu("useRevalidator"),r=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:r,state:a.revalidation}),[r,a.revalidation])}function os(){let t=Cu("useLoaderData"),a=Ac("useLoaderData");return t.loaderData[a]}function Au(t){return Cu("useRouteLoaderData").loaderData[t]}function Px(){var i;let t=v.useContext(Gh),a=Cu("useRouteError"),r=Ac("useRouteError");return t!==void 0?t:(i=a.errors)==null?void 0:i[r]}function pw(){let{router:t}=Xx("useNavigate"),a=Ac("useNavigate"),r=v.useRef(!1);return Ix(()=>{r.current=!0}),v.useCallback(async(u,o={})=>{xn(r.current,Fx),r.current&&(typeof u=="number"?await t.navigate(u):await t.navigate(u,{fromRouteId:a,...o}))},[t,a])}var Ey={};function Qx(t,a,r){!a&&!Ey[t]&&(Ey[t]=!0,xn(!1,r))}var Ny={};function Ry(t,a){!t&&!Ny[a]&&(Ny[a]=!0,console.warn(a))}var gw="useOptimistic",Ty=_S[gw],vw=()=>{};function yw(t){return Ty?Ty(t):[t,vw]}function xw(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&xn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:v.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&xn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:v.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&xn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:v.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),a}var bw=["HydrateFallback","hydrateFallbackElement"],Sw=class{constructor(){this.status="pending",this.promise=new Promise((t,a)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",a(r))}})}};function ww({router:t,flushSync:a,onError:r,useTransitions:i}){i=Yx()||i;let[o,f]=v.useState(t.state),[m,p]=yw(o),[g,x]=v.useState(),[b,E]=v.useState({isTransitioning:!1}),[S,N]=v.useState(),[O,T]=v.useState(),[L,X]=v.useState(),Y=v.useRef(new Map),Q=v.useCallback((j,{deletedFetchers:oe,newErrors:me,flushSync:ye,viewTransitionOpts:Re})=>{me&&r&&Object.values(me).forEach(be=>{var Ee;return r(be,{location:j.location,params:((Ee=j.matches[0])==null?void 0:Ee.params)??{},pattern:Tu(j.matches)})}),j.fetchers.forEach((be,Ee)=>{be.data!==void 0&&Y.current.set(Ee,be.data)}),oe.forEach(be=>Y.current.delete(be)),Ry(ye===!1||a!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let ee=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(Ry(Re==null||ee,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!Re||!ee){a&&ye?a(()=>f(j)):i===!1?f(j):v.startTransition(()=>{i===!0&&p(be=>jy(be,j)),f(j)});return}if(a&&ye){a(()=>{O&&(S==null||S.resolve(),O.skipTransition()),E({isTransitioning:!0,flushSync:!0,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation})});let be=t.window.document.startViewTransition(()=>{a(()=>f(j))});be.finished.finally(()=>{a(()=>{N(void 0),T(void 0),x(void 0),E({isTransitioning:!1})})}),a(()=>T(be));return}O?(S==null||S.resolve(),O.skipTransition(),X({state:j,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation})):(x(j),E({isTransitioning:!0,flushSync:!1,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation}))},[t.window,a,O,S,i,p,r]);v.useLayoutEffect(()=>t.subscribe(Q),[t,Q]),v.useEffect(()=>{b.isTransitioning&&!b.flushSync&&N(new Sw)},[b]),v.useEffect(()=>{if(S&&g&&t.window){let j=g,oe=S.promise,me=t.window.document.startViewTransition(async()=>{i===!1?f(j):v.startTransition(()=>{i===!0&&p(ye=>jy(ye,j)),f(j)}),await oe});me.finished.finally(()=>{N(void 0),T(void 0),x(void 0),E({isTransitioning:!1})}),T(me)}},[g,S,t.window,i,p]),v.useEffect(()=>{S&&g&&m.location.key===g.location.key&&S.resolve()},[S,O,m.location,g]),v.useEffect(()=>{!b.isTransitioning&&L&&(x(L.state),E({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),X(void 0))},[b.isTransitioning,L]);let K=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:j=>t.navigate(j),push:(j,oe,me)=>t.navigate(j,{state:oe,preventScrollReset:me==null?void 0:me.preventScrollReset}),replace:(j,oe,me)=>t.navigate(j,{replace:!0,state:oe,preventScrollReset:me==null?void 0:me.preventScrollReset})}),[t]),W=t.basename||"/",U=v.useMemo(()=>({router:t,navigator:K,static:!1,basename:W,onError:r}),[t,K,W,r]);return v.createElement(v.Fragment,null,v.createElement(us.Provider,{value:U},v.createElement(li.Provider,{value:m},v.createElement(Ih.Provider,{value:Y.current},v.createElement(Fh.Provider,{value:b},v.createElement(Rw,{basename:W,location:m.location,navigationType:m.historyAction,navigator:K,useTransitions:i},v.createElement(Ew,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:r})))))),null)}function jy(t,a){return{...t,navigation:a.navigation.state!=="idle"?a.navigation:t.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:t.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:t.actionData,fetchers:a.fetchers}}var Ew=v.memo(Nw);function Nw({routes:t,manifest:a,future:r,state:i,isStatic:u,onError:o}){return sw(t,void 0,{manifest:a,state:i,isStatic:u,onError:o})}function Ou(t){return rw(t.context)}function Rw({basename:t="/",children:a=null,location:r,navigationType:i="POP",navigator:u,static:o=!1,useTransitions:f}){et(!ju(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:m,navigator:u,static:o,useTransitions:f,future:{}}),[m,u,o,f]);typeof r=="string"&&(r=Nl(r));let{pathname:g="/",search:x="",hash:b="",state:E=null,key:S="default",mask:N}=r,O=v.useMemo(()=>{let T=Ka(g,m);return T==null?null:{location:{pathname:T,search:x,hash:b,state:E,key:S,mask:N},navigationType:i}},[m,g,x,b,E,S,i,N]);return xn(O!=null,`<Router basename="${m}"> is not able to match the URL "${g}${x}${b}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:v.createElement(Za.Provider,{value:p},v.createElement(Cc.Provider,{children:a,value:O}))}var dc="get",fc="application/x-www-form-urlencoded";function Oc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Tw(t){return Oc(t)&&t.tagName.toLowerCase()==="button"}function jw(t){return Oc(t)&&t.tagName.toLowerCase()==="form"}function Dw(t){return Oc(t)&&t.tagName.toLowerCase()==="input"}function Cw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Aw(t,a){return t.button===0&&(!a||a==="_self")&&!Cw(t)}function Ch(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,r)=>{let i=t[r];return a.concat(Array.isArray(i)?i.map(u=>[r,u]):[[r,i]])},[]))}function Ow(t,a){let r=Ch(t);return a&&a.forEach((i,u)=>{r.has(u)||a.getAll(u).forEach(o=>{r.append(u,o)})}),r}var Wo=null;function Mw(){if(Wo===null)try{new FormData(document.createElement("form"),0),Wo=!1}catch{Wo=!0}return Wo}var kw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ah(t){return t!=null&&!kw.has(t)?(xn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${fc}"`),null):t}function _w(t,a){let r,i,u,o,f;if(jw(t)){let m=t.getAttribute("action");i=m?Ka(m,a):null,r=t.getAttribute("method")||dc,u=ah(t.getAttribute("enctype"))||fc,o=new FormData(t)}else if(Tw(t)||Dw(t)&&(t.type==="submit"||t.type==="image")){let m=t.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||m.getAttribute("action");if(i=p?Ka(p,a):null,r=t.getAttribute("formmethod")||m.getAttribute("method")||dc,u=ah(t.getAttribute("formenctype"))||ah(m.getAttribute("enctype"))||fc,o=new FormData(m,t),!Mw()){let{name:g,type:x,value:b}=t;if(x==="image"){let E=g?`${g}.`:"";o.append(`${E}x`,"0"),o.append(`${E}y`,"0")}else g&&o.append(g,b)}}else{if(Oc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=dc,i=null,u=fc,f=t}return o&&u==="text/plain"&&(f=o,o=void 0),{action:i,method:r.toLowerCase(),encType:u,formData:o,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ph(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Kx(t,a,r,i){let u=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:a&&Ka(u.pathname,a)==="/"?u.pathname=`${yc(a)}/_root.${i}`:u.pathname=`${yc(u.pathname)}.${i}`,u}async function Lw(t,a){if(t.id in a)return a[t.id];try{let r=await import(t.module);return a[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function zw(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Uw(t,a,r){let i=await Promise.all(t.map(async u=>{let o=a.routes[u.route.id];if(o){let f=await Lw(o,r);return f.links?f.links():[]}return[]}));return qw(i.flat(1).filter(zw).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Dy(t,a,r,i,u,o){let f=(p,g)=>r[g]?p.route.id!==r[g].route.id:!0,m=(p,g)=>{var x;return r[g].pathname!==p.pathname||((x=r[g].route.path)==null?void 0:x.endsWith("*"))&&r[g].params["*"]!==p.params["*"]};return o==="assets"?a.filter((p,g)=>f(p,g)||m(p,g)):o==="data"?a.filter((p,g)=>{var b;let x=i.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(f(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function Hw(t,a,{includeHydrateFallback:r}={}){return Bw(t.map(i=>{let u=a.routes[i.route.id];if(!u)return[];let o=[u.module];return u.clientActionModule&&(o=o.concat(u.clientActionModule)),u.clientLoaderModule&&(o=o.concat(u.clientLoaderModule)),r&&u.hydrateFallbackModule&&(o=o.concat(u.hydrateFallbackModule)),u.imports&&(o=o.concat(u.imports)),o}).flat(1))}function Bw(t){return[...new Set(t)]}function $w(t){let a={},r=Object.keys(t).sort();for(let i of r)a[i]=t[i];return a}function qw(t,a){let r=new Set;return new Set(a),t.reduce((i,u)=>{let o=JSON.stringify($w(u));return r.has(o)||(r.add(o),i.push({key:o,link:u})),i},[])}function Qh(){let t=v.useContext(us);return Ph(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Yw(){let t=v.useContext(li);return Ph(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Kh=v.createContext(void 0);Kh.displayName="FrameworkContext";function Mc(){let t=v.useContext(Kh);return Ph(t,"You must render this element inside a <HydratedRouter> element"),t}function Vw(t,a){let r=v.useContext(Kh),[i,u]=v.useState(!1),[o,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:b}=a,E=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let O=L=>{L.forEach(X=>{f(X.isIntersecting)})},T=new IntersectionObserver(O,{threshold:.5});return E.current&&T.observe(E.current),()=>{T.disconnect()}}},[t]),v.useEffect(()=>{if(i){let O=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(O)}}},[i]);let S=()=>{u(!0)},N=()=>{u(!1),f(!1)};return r?t!=="intent"?[o,E,{}]:[o,E,{onFocus:lu(m,S),onBlur:lu(p,N),onMouseEnter:lu(g,S),onMouseLeave:lu(x,N),onTouchStart:lu(b,S)}]:[!1,E,{}]}function lu(t,a){return r=>{t&&t(r),r.defaultPrevented||a(r)}}function Fw({page:t,...a}){let r=Yx(),{nonce:i}=Mc(),{router:u}=Qh(),o=v.useMemo(()=>xx(u.routes,t,u.basename),[u.routes,t,u.basename]);return o?(a.nonce==null&&i&&(a={...a,nonce:i}),r?v.createElement(Gw,{page:t,matches:o,...a}):v.createElement(Xw,{page:t,matches:o,...a})):null}function Iw(t){let{manifest:a,routeModules:r}=Mc(),[i,u]=v.useState([]);return v.useEffect(()=>{let o=!1;return Uw(t,a,r).then(f=>{o||u(f)}),()=>{o=!0}},[t,a,r]),i}function Gw({page:t,matches:a,...r}){let i=il(),{future:u}=Mc(),{basename:o}=Qh(),f=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let m=Kx(t,o,u.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?p=!0:g.push(x.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[o,u.v8_trailingSlashAwareDataRequests,t,i,a]);return v.createElement(v.Fragment,null,f.map(m=>v.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})))}function Xw({page:t,matches:a,...r}){let i=il(),{future:u,manifest:o,routeModules:f}=Mc(),{basename:m}=Qh(),{loaderData:p,matches:g}=Yw(),x=v.useMemo(()=>Dy(t,a,g,o,i,"data"),[t,a,g,o,i]),b=v.useMemo(()=>Dy(t,a,g,o,i,"assets"),[t,a,g,o,i]),E=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let O=new Set,T=!1;if(a.forEach(X=>{var Q;let Y=o.routes[X.route.id];!Y||!Y.hasLoader||(!x.some(K=>K.route.id===X.route.id)&&X.route.id in p&&((Q=f[X.route.id])!=null&&Q.shouldRevalidate)||Y.hasClientLoader?T=!0:O.add(X.route.id))}),O.size===0)return[];let L=Kx(t,m,u.v8_trailingSlashAwareDataRequests,"data");return T&&O.size>0&&L.searchParams.set("_routes",a.filter(X=>O.has(X.route.id)).map(X=>X.route.id).join(",")),[L.pathname+L.search]},[m,u.v8_trailingSlashAwareDataRequests,p,i,o,x,a,t,f]),S=v.useMemo(()=>Hw(b,o),[b,o]),N=Iw(b);return v.createElement(v.Fragment,null,E.map(O=>v.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...r})),S.map(O=>v.createElement("link",{key:O,rel:"modulepreload",href:O,...r})),N.map(({key:O,link:T})=>v.createElement("link",{key:O,nonce:r.nonce,...T,crossOrigin:T.crossOrigin??r.crossOrigin})))}function Pw(...t){return a=>{t.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var Qw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qw&&(window.__reactRouterVersion="7.18.0")}catch{}function Kw(t,a){return R1({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:qS({window:a==null?void 0:a.window}),hydrationData:Zw(),routes:t,mapRouteProperties:xw,hydrationRouteProperties:bw,dataStrategy:a==null?void 0:a.dataStrategy,patchRoutesOnNavigation:a==null?void 0:a.patchRoutesOnNavigation,window:a==null?void 0:a.window,instrumentations:a==null?void 0:a.instrumentations}).initialize()}function Zw(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:Jw(t.errors)}),t}function Jw(t){if(!t)return null;let a=Object.entries(t),r={};for(let[i,u]of a)if(u&&u.__type==="RouteErrorResponse")r[i]=new Ru(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(typeof u.__subType=="string"&&f1.includes(u.__subType)){let o=window[u.__subType];if(typeof o=="function")try{let f=new o(u.message);f.stack="",r[i]=f}catch{}}if(r[i]==null){let o=new Error(u.message);o.stack="",r[i]=o}}else r[i]=u;return r}var bt=v.forwardRef(function({onClick:a,discover:r="render",prefetch:i="none",relative:u,reloadDocument:o,replace:f,mask:m,state:p,target:g,to:x,preventScrollReset:b,viewTransition:E,defaultShouldRevalidate:S,...N},O){let{basename:T,navigator:L,useTransitions:X}=v.useContext(Za),Y=typeof x=="string"&&jc.test(x),Q=Tx(x,T);x=Q.to;let K=nw(x,{relative:u}),W=il(),U=null;if(m){let Ee=Dc(m,[],W.mask?W.mask.pathname:"/",!0);T!=="/"&&(Ee.pathname=Ee.pathname==="/"?T:Qa([T,Ee.pathname])),U=L.createHref(Ee)}let[j,oe,me]=Vw(i,N),ye=eE(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:b,relative:u,viewTransition:E,defaultShouldRevalidate:S,useTransitions:X});function Re(Ee){a&&a(Ee),Ee.defaultPrevented||ye(Ee)}let ee=!(Q.isExternal||o),be=v.createElement("a",{...N,...me,href:(ee?U:void 0)||Q.absoluteURL||K,onClick:ee?Re:a,ref:Pw(O,oe),target:g,"data-discover":!Y&&r==="render"?"true":void 0});return j&&!Y?v.createElement(v.Fragment,null,be,v.createElement(Fw,{page:K})):be});bt.displayName="Link";var Zx=v.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:i="",end:u=!1,style:o,to:f,viewTransition:m,children:p,...g},x){let b=Du(f,{relative:g.relative}),E=il(),S=v.useContext(li),{navigator:N,basename:O}=v.useContext(Za),T=S!=null&&lE(b)&&m===!0,L=N.encodeLocation?N.encodeLocation(b).pathname:b.pathname,X=E.pathname,Y=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(X=X.toLowerCase(),Y=Y?Y.toLowerCase():null,L=L.toLowerCase()),Y&&O&&(Y=Ka(Y,O)||Y);const Q=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let K=X===L||!u&&X.startsWith(L)&&X.charAt(Q)==="/",W=Y!=null&&(Y===L||!u&&Y.startsWith(L)&&Y.charAt(L.length)==="/"),U={isActive:K,isPending:W,isTransitioning:T},j=K?a:void 0,oe;typeof i=="function"?oe=i(U):oe=[i,K?"active":null,W?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let me=typeof o=="function"?o(U):o;return v.createElement(bt,{...g,"aria-current":j,className:oe,ref:x,style:me,to:f,viewTransition:m},typeof p=="function"?p(U):p)});Zx.displayName="NavLink";var _a=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:r,reloadDocument:i,replace:u,state:o,method:f=dc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:E,...S},N)=>{let{useTransitions:O}=v.useContext(Za),T=Jh(),L=aE(m,{relative:g}),X=f.toLowerCase()==="get"?"get":"post",Y=typeof m=="string"&&jc.test(m),Q=K=>{if(p&&p(K),K.defaultPrevented)return;K.preventDefault();let W=K.nativeEvent.submitter,U=(W==null?void 0:W.getAttribute("formmethod"))||f,j=()=>T(W||K.currentTarget,{fetcherKey:a,method:U,navigate:r,replace:u,state:o,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:E});O&&r!==!1?v.startTransition(()=>j()):j()};return v.createElement("form",{ref:N,method:X,action:L,onSubmit:i?p:Q,...S,"data-discover":!Y&&t==="render"?"true":void 0})});_a.displayName="Form";function Jx(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zh(t){let a=v.useContext(us);return et(a,Jx(t)),a}function Ww(t){let a=v.useContext(li);return et(a,Jx(t)),a}function eE(t,{target:a,replace:r,mask:i,state:u,preventScrollReset:o,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=er(),b=il(),E=Du(t,{relative:f});return v.useCallback(S=>{if(Aw(S,a)){S.preventDefault();let N=r!==void 0?r:El(b)===El(E),O=()=>x(t,{replace:N,mask:i,state:u,preventScrollReset:o,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>O()):O()}},[b,x,E,r,i,u,a,t,o,f,m,p,g])}function kc(t){xn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=v.useRef(Ch(t)),r=v.useRef(!1),i=il(),u=v.useMemo(()=>Ow(i.search,r.current?null:a.current),[i.search]),o=er(),f=v.useCallback((m,p)=>{const g=Ch(typeof m=="function"?m(new URLSearchParams(u)):m);r.current=!0,o("?"+g,p)},[o,u]);return[u,f]}var tE=0,nE=()=>`__${String(++tE)}__`;function Jh(){let{router:t}=Zh("useSubmit"),{basename:a}=v.useContext(Za),r=hw(),i=t.fetch,u=t.navigate;return v.useCallback(async(o,f={})=>{let{action:m,method:p,encType:g,formData:x,body:b}=_w(o,a);if(f.navigate===!1){let E=f.fetcherKey||nE();await i(E,r,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:b,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await u(f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:b,formMethod:f.method||p,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:r,flushSync:f.flushSync,viewTransition:f.viewTransition})},[i,u,a,r])}function aE(t,{relative:a}={}){let{basename:r}=v.useContext(Za),i=v.useContext(sl);et(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),o={...Du(t||".",{relative:a})},f=il();if(t==null){o.search=f.search;let m=new URLSearchParams(o.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let x=m.toString();o.search=x?`?${x}`:""}}return(!t||t===".")&&u.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Qa([r,o.pathname])),El(o)}function ss({key:t}={}){var K;let{router:a}=Zh("useFetcher"),r=Ww("useFetcher"),i=v.useContext(Ih),u=v.useContext(sl),o=(K=u.matches[u.matches.length-1])==null?void 0:K.route.id;et(i,"useFetcher must be used inside a FetchersContext"),et(u,"useFetcher must be used inside a RouteContext"),et(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let f=v.useId(),[m,p]=v.useState(t||f);t&&t!==m&&p(t);let{deleteFetcher:g,getFetcher:x,resetFetcher:b,fetch:E}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let S=v.useCallback(async(W,U)=>{et(o,"No routeId available for fetcher.load()"),await E(m,o,W,U)},[m,o,E]),N=Jh(),O=v.useCallback(async(W,U)=>{await N(W,{...U,navigate:!1,fetcherKey:m})},[m,N]),T=v.useCallback(W=>b(m,W),[b,m]),L=v.useMemo(()=>{let W=v.forwardRef((U,j)=>v.createElement(_a,{...U,navigate:!1,fetcherKey:m,ref:j}));return W.displayName="fetcher.Form",W},[m]),X=r.fetchers.get(m)||Ax,Y=i.get(m);return v.useMemo(()=>({Form:L,submit:O,load:S,reset:T,...X,data:Y}),[L,O,S,T,X,Y])}function lE(t,{relative:a}={}){let r=v.useContext(Fh);et(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Zh("useViewTransitionState"),u=Du(t,{relative:a});if(!r.isTransitioning)return!1;let o=Ka(r.currentLocation.pathname,i)||r.currentLocation.pathname,f=Ka(r.nextLocation.pathname,i)||r.nextLocation.pathname;return vc(u.pathname,f)!=null||vc(u.pathname,o)!=null}var Jl=mx();function rE(t){return v.createElement(ww,{flushSync:Jl.flushSync,...t})}/**
|
|
62
|
+
* @license lucide-react v1.21.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Wx=(...t)=>t.filter((a,r,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===r).join(" ").trim();/**
|
|
67
|
+
* @license lucide-react v1.21.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const sE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
72
|
+
* @license lucide-react v1.21.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const iE=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,r,i)=>i?i.toUpperCase():r.toLowerCase());/**
|
|
77
|
+
* @license lucide-react v1.21.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Cy=t=>{const a=iE(t);return a.charAt(0).toUpperCase()+a.slice(1)};/**
|
|
82
|
+
* @license lucide-react v1.21.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/var lh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
87
|
+
* @license lucide-react v1.21.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const uE=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},oE=v.createContext({}),cE=()=>v.useContext(oE),dE=v.forwardRef(({color:t,size:a,strokeWidth:r,absoluteStrokeWidth:i,className:u="",children:o,iconNode:f,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:b=!1,color:E="currentColor",className:S=""}=cE()??{},N=i??b?Number(r??x)*24/Number(a??g):r??x;return v.createElement("svg",{ref:p,...lh,width:a??g??lh.width,height:a??g??lh.height,stroke:t??E,strokeWidth:N,className:Wx("lucide",S,u),...!o&&!uE(m)&&{"aria-hidden":"true"},...m},[...f.map(([O,T])=>v.createElement(O,T)),...Array.isArray(o)?o:[o]])});/**
|
|
92
|
+
* @license lucide-react v1.21.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const Un=(t,a)=>{const r=v.forwardRef(({className:i,...u},o)=>v.createElement(dE,{ref:o,iconNode:a,className:Wx(`lucide-${sE(Cy(t))}`,`lucide-${t}`,i),...u}));return r.displayName=Cy(t),r};/**
|
|
97
|
+
* @license lucide-react v1.21.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const fE=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_c=Un("arrow-left",fE);/**
|
|
102
|
+
* @license lucide-react v1.21.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const hE=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],mE=Un("chart-column",hE);/**
|
|
107
|
+
* @license lucide-react v1.21.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const pE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eb=Un("check",pE);/**
|
|
112
|
+
* @license lucide-react v1.21.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const gE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],is=Un("chevron-down",gE);/**
|
|
117
|
+
* @license lucide-react v1.21.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const vE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tb=Un("chevron-right",vE);/**
|
|
122
|
+
* @license lucide-react v1.21.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const yE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xE=Un("circle-check",yE);/**
|
|
127
|
+
* @license lucide-react v1.21.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const bE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],nb=Un("copy",bE);/**
|
|
132
|
+
* @license lucide-react v1.21.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const SE=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],wE=Un("download",SE);/**
|
|
137
|
+
* @license lucide-react v1.21.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const EE=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],NE=Un("git-branch",EE);/**
|
|
142
|
+
* @license lucide-react v1.21.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const RE=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],TE=Un("grip-vertical",RE);/**
|
|
147
|
+
* @license lucide-react v1.21.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const jE=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],DE=Un("house",jE);/**
|
|
152
|
+
* @license lucide-react v1.21.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const CE=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],xc=Un("layers",CE);/**
|
|
157
|
+
* @license lucide-react v1.21.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const AE=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],ab=Un("list-todo",AE);/**
|
|
162
|
+
* @license lucide-react v1.21.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const OE=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ME=Un("locate-fixed",OE);/**
|
|
167
|
+
* @license lucide-react v1.21.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const kE=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],_E=Un("moon",kE);/**
|
|
172
|
+
* @license lucide-react v1.21.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const LE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ei=Un("pencil",LE);/**
|
|
177
|
+
* @license lucide-react v1.21.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const zE=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],UE=Un("sun",zE);/**
|
|
182
|
+
* @license lucide-react v1.21.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const HE=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ti=Un("trash-2",HE);/**
|
|
187
|
+
* @license lucide-react v1.21.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const BE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$E=Un("x",BE),qE="/api",YE=120,VE=40;function Lc(t){return{...t,number:t.number??0,decisions:t.decisions??[],acceptedDecisions:t.acceptedDecisions??[],checklist:t.checklist??[],subtasks:t.subtasks??[],startedAt:t.startedAt??"",completedAt:t.completedAt??""}}function zc(t){return{...t,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",notes:t.notes??"",goals:t.goals??[],nonGoals:t.nonGoals??[],dependencies:t.dependencies??[],risks:t.risks??[],openQuestions:t.openQuestions??[],decisions:t.decisions??[],acceptedDecisions:t.acceptedDecisions??[],completionCriteria:t.completionCriteria??[],taskIds:t.taskIds??[],tasks:(t.tasks??[]).map(Lc),handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??""}}function Uc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[]}}function lb(t){var a,r,i;return{...t,scope:t.scope??[],outOfScope:t.outOfScope??[],decisions:t.decisions??[],globalRules:t.globalRules??[],technologies:t.technologies??[],tools:t.tools??[],acceptedDecisions:t.acceptedDecisions??[],planRoot:t.planRoot??"",projectRoot:t.projectRoot??"",workflowRules:{beforePhaseStart:((a=t.workflowRules)==null?void 0:a.beforePhaseStart)??[],beforeTaskStart:((r=t.workflowRules)==null?void 0:r.beforeTaskStart)??[],afterPhaseComplete:((i=t.workflowRules)==null?void 0:i.afterPhaseComplete)??[]}}}async function Ay(t,a){try{return await fetch(`${qE}${t}`,{headers:{"Content-Type":"application/json"},...a})}catch{throw new Response("Planner web server unavailable. Pi or planner-web may have stopped. Restart the planner web UI or Pi, then reload this page.",{status:503,statusText:"Planner web server unavailable"})}}async function cn(t,a){let r=await Ay(t,a),i=0;for(;r.status===503&&i<VE;)await new Promise(u=>setTimeout(u,YE)),i+=1,r=await Ay(t,a);if(!r.ok){const u=await r.text().catch(()=>r.statusText);throw new Response(u||r.statusText,{status:r.status,statusText:r.statusText})}return r.json()}async function rb(){return lb(await cn("/project"))}async function FE(t){return lb(await cn("/project",{method:"PUT",body:JSON.stringify(t)}))}async function IE(){return cn("/ui-config")}async function sb(){return(await cn("/features")).map(Uc)}async function Mu(t){return Uc(await cn(`/features/${t}`))}async function GE(t){return Uc(await cn("/features",{method:"POST",body:JSON.stringify(t)}))}async function ib(t){return Uc(await cn(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function XE(t){return cn(`/features/${t}`,{method:"DELETE"})}async function Wh(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await cn(`/phases${a}`)).map(zc)}async function Hc(t){return zc(await cn(`/phases/${t}`))}async function PE(t){return zc(await cn("/phases",{method:"POST",body:JSON.stringify(t)}))}async function ub(t){return zc(await cn(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function QE(t){return cn(`/phases/${t}`,{method:"DELETE"})}async function KE(t,a){return Lc(await cn(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function Bc(t){return Lc(await cn(`/tasks/${t}`))}async function em(t){return Lc(await cn(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function ZE(t){return cn(`/tasks/${t}`,{method:"DELETE"})}async function ob(){return cn("/tasks/active")}async function cb(){return(await cn("/handoffs")).handoffs??[]}async function JE(t){return cn(`/phases/${t}/handoff`,{method:"DELETE"})}async function WE(t=!1){return cn(`/export?full=${t?"true":"false"}`)}async function eN(){return cn("/repair",{method:"POST"})}async function rh(t,a,r,i){return cn("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:a,beforeId:r,afterId:i})})}function tN(){const[t,a]=v.useState(()=>{if(typeof window>"u")return"dark";const r=window.localStorage.getItem("plan-ui-theme");return r||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return v.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),window.localStorage.setItem("plan-ui-theme",t)},[t]),{theme:t,toggleTheme:()=>a(r=>r==="dark"?"light":"dark")}}function nN({liveStatus:t}){const a=t==="live"?{label:"Live",className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",dotClassName:"bg-emerald-500"}:t==="reconnecting"?{label:"Reconnecting…",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-400",dotClassName:"bg-amber-500 animate-pulse"}:t==="disconnected"?{label:"Disconnected",className:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-400",dotClassName:"bg-rose-500"}:{label:"Connecting…",className:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-400",dotClassName:"bg-sky-500 animate-pulse"};return d.jsxs("span",{className:`inline-flex min-h-11 items-center gap-2 rounded-[14px] border px-3 py-2 text-sm font-semibold ${a.className}`,children:[d.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${a.dotClassName}`}),d.jsx("span",{className:"hidden sm:inline",children:a.label})]})}function aN({projectName:t,projectRoot:a,planRoot:r,liveStatus:i}){const{theme:u,toggleTheme:o}=tN(),[f,m]=v.useState(!1),[p,g]=v.useState(!1),[x,b]=v.useState(null),E=[{to:"/",label:"Dashboard",icon:DE},{to:"/features",label:"Features",icon:xc}];async function S(N){b(N?"full":"summary");try{const T=await WE(N),L=new Blob([T.markdown],{type:"text/markdown;charset=utf-8"}),X=URL.createObjectURL(L),Y=document.createElement("a");Y.href=X,Y.download=N?"EXPORT-full.md":T.filePath||"EXPORT.md",document.body.appendChild(Y),Y.click(),Y.remove(),URL.revokeObjectURL(X),g(!1)}catch(T){window.alert(`Export failed: ${T instanceof Error?T.message:String(T)}`)}finally{b(null)}}return d.jsx("div",{className:"border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:d.jsxs("div",{className:"page-container flex flex-col gap-3 py-2.5 md:flex-row md:items-center md:justify-between sm:gap-4 sm:py-3",children:[d.jsxs(bt,{to:"/",className:"flex min-w-0 items-center gap-3",children:[d.jsx("div",{className:"surface-card flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] text-[var(--accent)]",children:d.jsx(xc,{className:"h-4 w-4"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"truncate text-sm font-black tracking-tight",children:t??"Agent Plan"}),r?d.jsx("span",{className:"shrink-0 rounded-full border border-[var(--border)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[10px] font-semibold text-[var(--text-subtle)]",children:".planner/"}):null]}),a?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"truncate text-[11px] text-[var(--text-subtle)]",title:a,children:a}),d.jsx("button",{type:"button",onClick:async N=>{N.preventDefault(),N.stopPropagation(),a&&(await navigator.clipboard.writeText(a).catch(()=>{}),m(!0),window.setTimeout(()=>m(!1),1200))},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] transition hover:text-[var(--text)]",title:f?"Copied":"Copy project path","aria-label":f?"Copied":"Copy project path",children:f?d.jsx(eb,{className:"h-3.5 w-3.5"}):d.jsx(nb,{className:"h-3.5 w-3.5"})})]}):null]})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 sm:gap-3",children:[d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:d.jsx(nN,{liveStatus:i})}),d.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:E.map(N=>d.jsxs(Zx,{to:N.to,end:N.to==="/",className:({isActive:O})=>`inline-flex min-h-11 items-center gap-2 rounded-[14px] border px-3 py-2 text-sm font-semibold transition sm:px-4 ${O?"border-transparent bg-[var(--accent-soft)] text-[var(--accent)]":"border-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`,children:[d.jsx(N.icon,{className:"h-4 w-4"}),d.jsx("span",{className:"hidden sm:inline",children:N.label})]},N.to))}),d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":p,onClick:()=>g(N=>!N),className:"inline-flex min-h-11 items-center gap-2 rounded-[14px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-3 py-2 text-sm font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:px-4",children:[d.jsx(wE,{className:"h-4 w-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Export"}),d.jsx(is,{className:`h-4 w-4 transition-transform ${p?"rotate-180":""}`})]}),p?d.jsxs("div",{role:"menu",className:"absolute right-0 z-50 mt-2 min-w-44 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[d.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void S(!1),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Summary",x==="summary"?d.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),d.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void S(!0),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Full",x==="full"?d.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]}),d.jsx("button",{type:"button",onClick:o,className:"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)]",children:u==="dark"?d.jsx(UE,{className:"h-4 w-4"}):d.jsx(_E,{className:"h-4 w-4"})})]})]})})}function Oy(t,a,r){t.split(`
|
|
192
|
+
`).forEach((u,o)=>{o>0&&a.push(d.jsx("br",{},`${r}-br-${o}`)),u&&a.push(u)})}function ru(t,a){const r=[],i=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let u=0,o=null,f=0;for(;(o=i.exec(t))!==null;)o.index>u&&Oy(t.slice(u,o.index),r,`${a}-${f}`),o[2]&&o[3]?r.push(d.jsx("a",{href:o[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:o[2]},`${a}-link-${f}`)):o[4]?r.push(d.jsx("strong",{className:"font-semibold text-[var(--text)]",children:o[4]},`${a}-strong-${f}`)):o[5]?r.push(d.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:o[5]},`${a}-code-${f}`)):o[6]&&r.push(d.jsx("em",{className:"italic",children:o[6]},`${a}-em-${f}`)),u=i.lastIndex,f+=1;return u<t.length&&Oy(t.slice(u),r,`${a}-tail`),r}function lN(t,a){var u;const r=t.split(`
|
|
193
|
+
`);if(t.startsWith("```")){const o=t.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return d.jsx("pre",{className:"overflow-x-auto rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] p-3 text-sm font-mono text-[var(--text)]",children:d.jsx("code",{children:o})},`code-${a}`)}const i=t.match(/^(#{1,6})\s+(.+)$/);if(i&&i[2]){const o=((u=i[1])==null?void 0:u.length)??1,f=i[2],m=o<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return d.jsx("p",{className:m,children:ru(f,`h-${a}`)},`h-${a}`)}return r.every(o=>/^\s*>\s?/.test(o))?d.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:r.map((o,f)=>d.jsx("div",{children:ru(o.replace(/^\s*>\s?/,""),`bq-${a}-${f}`)},`bq-${a}-${f}`))},`bq-${a}`):/^\s*([-*_])\1{2,}\s*$/.test(t.trim())?d.jsx("hr",{className:"border-[var(--border)]"},`hr-${a}`):r.every(o=>/^\s*[-*]\s+/.test(o))?d.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:r.map((o,f)=>d.jsx("li",{className:"list-disc",children:ru(o.replace(/^\s*[-*]\s+/,""),`ul-${a}-${f}`)},`ul-${a}-${f}`))},`ul-${a}`):r.every(o=>/^\s*\d+\.\s+/.test(o))?d.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:r.map((o,f)=>d.jsx("li",{children:ru(o.replace(/^\s*\d+\.\s+/,""),`ol-${a}-${f}`)},`ol-${a}-${f}`))},`ol-${a}`):d.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:ru(t,`p-${a}`)},`p-${a}`)}function Ln({text:t,className:a=""}){if(!(t!=null&&t.trim()))return null;const r=t.trim().split(/\n\s*\n/).filter(Boolean);return d.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${a}`,children:r.map((i,u)=>lN(i,u))})}const My={feature:{soft:"rgba(139, 92, 246, 0.16)",strong:"var(--color-entity-feature)"},phase:{soft:"rgba(6, 182, 212, 0.16)",strong:"var(--color-entity-phase)"},task:{soft:"rgba(16, 185, 129, 0.16)",strong:"var(--color-entity-task)"}};function wl(t){return String(t&&t>0?t:0).padStart(3,"0")}function ri({featureNum:t,phaseNum:a,taskNum:r}){const i=[];return t!==void 0&&i.push(`F${wl(t)}`),a!==void 0&&i.push(`P${wl(a)}`),r!==void 0&&i.push(`T${wl(r)}`),i.join("/")}async function rN(t){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(t),!0}catch{}try{const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.top="-1000px",a.style.opacity="0",document.body.appendChild(a),a.focus(),a.select();const r=document.execCommand("copy");return a.remove(),r}catch{return!1}}function kr({type:t,number:a}){const r=My[t]||My.task,i=(r==null?void 0:r.soft)||"transparent",u=(r==null?void 0:r.strong)||"inherit";return d.jsxs("span",{className:"shrink-0 inline-flex items-center justify-center font-mono text-[11px] font-bold leading-none px-2 py-1 rounded-md transition-colors",style:{backgroundColor:i,color:u},children:[t?t.charAt(0).toUpperCase():"?",wl(a)]})}function ni({type:t,phaseNum:a,featureNum:r}){return t==="feature"?null:t==="phase"?r===void 0?null:d.jsx("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:d.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",wl(r)]})}):t==="task"?a===void 0?null:d.jsxs("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:[d.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",wl(a)]}),r!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),d.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",wl(r)]})]})]}):null}function Wl({featureNum:t,phaseNum:a,taskNum:r}){return d.jsxs("span",{className:"entity-path-badge",children:[t!==void 0?d.jsxs("span",{className:"entity-path-seg entity-path-seg--feature",children:["F",wl(t)]}):null,a!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),d.jsxs("span",{className:"entity-path-seg entity-path-seg--phase",children:["P",wl(a)]})]}):null,r!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),d.jsxs("span",{className:"entity-path-seg entity-path-seg--task",children:["T",wl(r)]})]}):null]})}function _r({id:t,children:a}){const[r,i]=v.useState(!1);return d.jsxs("button",{type:"button",onClick:async u=>{u.preventDefault(),u.stopPropagation(),await rN(t)&&(i(!0),window.setTimeout(()=>i(!1),1200))},title:r?"Copied":`Copy ${t}`,"aria-label":r?"Copied":`Copy ${t}`,className:"copyable-id group inline-flex items-center gap-1.5",children:[a,d.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:r?d.jsx(eb,{className:"h-3 w-3 text-emerald-500"}):d.jsx(nb,{className:"h-3 w-3"})})]})}function si({shortId:t}){return d.jsx(_r,{id:t,children:d.jsx("span",{className:"short-id-badge",children:t})})}function tm({phaseId:t,updatedAt:a}){const r=`Phase handoff pending${a?` · updated ${new Date(a).toLocaleString()}`:""}`;return d.jsxs("a",{href:`/handoff#${t}`,className:"handoff-badge flex items-center gap-1 ml-2 shrink-0",title:r,"aria-label":r,children:[d.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),d.jsx("path",{d:"M9 2v3h3"}),d.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),d.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}function sN({activeTasks:t}){const a=er(),r=v.useMemo(()=>{const i=new Set;return t.filter(u=>{const o=`${u.id}-${u.title}-${u.phaseId}`;return i.has(o)?!1:(i.add(o),!0)})},[t]);return r.length===0?null:d.jsx("div",{className:"border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:d.jsx("div",{className:"page-container py-2.5",children:d.jsxs("div",{className:"grid gap-2",children:[d.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["In-progress tasks (",r.length,")"]}),d.jsx("div",{className:"grid grid-cols-1 max-h-[35vh] gap-1.5 overflow-y-auto pr-1",children:r.map(i=>{const u=i.featureId?`/features/${i.featureId}/phases/${i.phaseId}/tasks/${i.id}`:"/features";return d.jsxs("div",{className:"flex min-w-0 items-center gap-2 rounded-[10px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--accent-soft)] hover:text-[var(--accent)]",children:[d.jsxs(bt,{to:u,className:"flex min-w-0 flex-1 items-center gap-2",children:[i.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]","aria-label":"In progress"}):null,d.jsx(kr,{type:"task",number:i.number}),d.jsx(ni,{type:"task",phaseNum:i.phaseNumber,featureNum:i.featureNumber}),d.jsx("span",{className:"min-w-0 truncate font-medium",children:i.title})]}),d.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),a(`/?locate=T${i.number}`)},"aria-label":`Locate T${i.number} in work tree`,title:"Locate in work tree",className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-[8px] text-[var(--text-subtle)] transition-colors hover:bg-[var(--accent)] hover:text-[var(--text)]",children:d.jsx(ME,{className:"h-4 w-4"})})]},i.id)})})]})})})}function iN({project:t,activeTasks:a,serverInfo:r}){const i=Mr(),[u,o]=v.useState("connecting");return v.useEffect(()=>{const f=m=>{var g;const p=(g=m.detail)==null?void 0:g.status;p&&o(p)};return window.addEventListener("agent-plan:ws-status",f),()=>window.removeEventListener("agent-plan:ws-status",f)},[]),d.jsxs("div",{className:"page-shell",children:[d.jsxs("header",{className:"sticky top-0 z-30",children:[d.jsx(aN,{projectName:t==null?void 0:t.name,projectRoot:t==null?void 0:t.projectRoot,planRoot:t==null?void 0:t.planRoot,liveStatus:u}),d.jsx(sN,{activeTasks:a})]}),d.jsxs("div",{className:"page-container py-8",children:[d.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),d.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:d.jsx(bt,{to:"/",className:"hover:text-[var(--accent)]",children:(t==null?void 0:t.name)??"Agent Plan"})}),t!=null&&t.projectRoot?d.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:t.projectRoot,children:t.projectRoot}):null,r?d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[d.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-semibold uppercase tracking-[0.12em] ${r.mode==="lan"?"bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] text-[var(--accent)]":"bg-[var(--surface-elevated)] text-[var(--text-muted)]"}`,children:[d.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full bg-current"}),r.mode==="lan"?"LAN visible":"Local only"]}),d.jsx("a",{href:r.localUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:r.localUrl}),r.lanUrl?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),d.jsx("a",{href:r.lanUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:r.lanUrl})]}):null]}):null,t!=null&&t.description?d.jsx(Ln,{text:t.description,className:"mt-2 max-w-3xl"}):null]}),i.state!=="idle"?d.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),d.jsx(Ou,{})]})]})}const fu={create:{key:"n",meta:!0,ctrl:!0},edit:{key:"e",meta:!0,ctrl:!0},delete:{key:"d",meta:!0,ctrl:!0},submit:{key:"Enter",primary:!0}},db=v.createContext(fu);function fb(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function uN(t){return typeof t!="string"}function oN(t){return{create:(t==null?void 0:t.create)??fu.create,edit:(t==null?void 0:t.edit)??fu.edit,delete:(t==null?void 0:t.delete)??fu.delete,submit:(t==null?void 0:t.submit)??fu.submit}}function cN(t){const a=[],r=fb();t.primary&&a.push(r?"⌘":"Ctrl"),t.meta&&a.push(r?"⌘":"Meta"),t.ctrl&&a.push(r?"⌃":"Ctrl"),t.shift&&a.push(r?"⇧":"Shift"),t.alt&&a.push(r?"⌥":"Alt");const i=t.key==="Backspace"?r?"⌫":"Backspace":t.key==="Enter"?r?"↩":"Enter":t.key.length===1?t.key.toUpperCase():t.key;return a.push(i),r?a.join(""):a.join("+")}function dN(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function fN(t,a){const r=a.key.length===1?a.key.toLowerCase():a.key,i=t.key.length===1?t.key.toLowerCase():t.key,u=fb(),o=a.meta??(a.primary?u:!1),f=a.ctrl??(a.primary?!u:!1);return i===r&&!!o===t.metaKey&&!!f===t.ctrlKey&&!!a.shift===t.shiftKey&&!!a.alt===t.altKey}function hN({shortcuts:t,children:a}){return v.createElement(db.Provider,{value:oN(t)},a)}function hb(t){const a=v.useContext(db);if(t)return uN(t)?t:a[t]}function Zn(t,a,r){const i=hb(t);v.useEffect(()=>{if(!i||(r==null?void 0:r.enabled)===!1)return;const u=o=>{!(r!=null&&r.allowInEditable)&&dN(o.target)||fN(o,i)&&(o.preventDefault(),a())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[a,r==null?void 0:r.allowInEditable,r==null?void 0:r.enabled,i])}const mN=1500,pN=80,gN=12e3,vN=5e3;function yN(){const{revalidate:t}=mw(),a=v.useRef(null),r=v.useRef(null),i=v.useRef(null),u=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{let f=!0;const m=Q=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:Q}}))},p=()=>{r.current!==null&&(window.clearTimeout(r.current),r.current=null)},g=()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null)},x=()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},b=()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},E=()=>{g(),i.current=window.setTimeout(()=>{t()},pN)},S=()=>{!f||r.current!==null||(m("reconnecting"),r.current=window.setTimeout(()=>{r.current=null,T()},mN))},N=()=>{b(),x();const Q=a.current;if(a.current=null,Q&&(Q.readyState===WebSocket.OPEN||Q.readyState===WebSocket.CONNECTING))try{Q.close()}catch{}},O=()=>{b(),x(),u.current=window.setInterval(()=>{const Q=a.current;if(!(!Q||Q.readyState!==WebSocket.OPEN)){try{Q.send(JSON.stringify({type:"ping"}))}catch{N(),S();return}x(),o.current=window.setTimeout(()=>{N(),S()},vN)}},gN)},T=()=>{if(!f)return;const Q=a.current;if(Q&&(Q.readyState===WebSocket.OPEN||Q.readyState===WebSocket.CONNECTING))return;m(r.current!==null?"reconnecting":"connecting"),p();const K=window.location.protocol==="https:"?"wss":"ws",W=new WebSocket(`${K}://${window.location.host}/ws`);a.current=W,W.onopen=()=>{p(),m("live"),O()},W.onmessage=U=>{x();try{const j=JSON.parse(U.data);if(!j.type||j.type==="pong"||j.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:j})),j.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":E();break;default:break}}catch{}},W.onclose=()=>{b(),x(),a.current===W&&(a.current=null),f&&S()},W.onerror=()=>{try{W.close()}catch{}}},L=()=>{const Q=a.current;(!Q||Q.readyState===WebSocket.CLOSED||Q.readyState===WebSocket.CLOSING)&&T()},X=()=>{document.visibilityState==="visible"&&L()},Y=()=>{L()};return m("connecting"),T(),window.addEventListener("online",Y),document.addEventListener("visibilitychange",X),()=>{f=!1,m("disconnected"),window.removeEventListener("online",Y),document.removeEventListener("visibilitychange",X),p(),g(),b(),x(),N()}},[t]),null}async function xN(){const[t,a,r]=await Promise.all([rb(),IE(),ob()]);return{project:t,uiConfig:a,activeTasks:r}}function bN(){const{project:t,uiConfig:a,activeTasks:r}=os();return v.useEffect(()=>{var i;document.title=(i=t==null?void 0:t.name)!=null&&i.trim()?`${t.name} · Agent Plan`:"Agent Plan"},[t==null?void 0:t.name]),d.jsxs(hN,{shortcuts:a.shortcuts,children:[d.jsx(yN,{}),d.jsx(iN,{project:t,activeTasks:r,serverInfo:a.server})]})}function SN(){const t=Px(),a=Ws(t),r=a&&t.status===503,i=a?r?"Planner web UI disconnected":`Request failed (${t.status})`:"Planner web UI unavailable",u=a?t.data||t.statusText:t instanceof Error?t.message:"The planner web UI could not reach its local server.";return v.useEffect(()=>{document.title="Agent Plan"},[]),d.jsx("div",{className:"page-shell min-h-screen",children:d.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:d.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[d.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),d.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:i}),d.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(u)}),d.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:r?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),d.jsx("p",{children:"What to do:"}),d.jsxs("ul",{className:"grid gap-1 pl-5",children:[d.jsxs("li",{className:"list-disc",children:["restart Pi or run ",d.jsx("code",{children:"planner-web start"})]}),d.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),d.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),d.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),d.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:d.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex min-h-11 items-center rounded-[14px] bg-[var(--accent)] px-4 py-2 text-sm font-semibold text-white transition hover:opacity-90",children:"Reload page"})})]})})})}async function wN(){const[t,a,r]=await Promise.all([sb(),Wh(),ob()]);return{features:t,phases:a,activeTasks:r}}function EN({shortcut:t}){const a=hb(t);return a?d.jsx("span",{className:"rounded-md border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[11px] font-bold tracking-wide text-[var(--text-muted)]",children:cN(a)}):null}const NN={primary:"border-transparent bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)]",secondary:"border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",ghost:"border-transparent bg-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",danger:"border-transparent bg-[var(--danger-soft)] text-[var(--color-status-blocked)] hover:bg-[color-mix(in_srgb,var(--danger-soft)_88%,black_12%)]"};function xt({variant:t="secondary",className:a="",children:r,shortcut:i,...u}){return d.jsxs("button",{className:`inline-flex min-h-11 items-center justify-center gap-2 rounded-[14px] border px-4 py-2 text-sm font-semibold transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)] disabled:cursor-not-allowed disabled:opacity-60 ${NN[t]} ${a}`,...u,children:[d.jsx("span",{children:r}),i?d.jsx(EN,{shortcut:i}):null]})}function zn({className:t="",children:a,...r}){return d.jsx("div",{className:`surface-card p-6 ${t}`,...r,children:a})}function RN({decisions:t}){return t.length===0?null:d.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[d.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",t.length,")"]}),d.jsx("div",{className:"mt-4 grid gap-3",children:t.map(a=>d.jsxs("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[d.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?d.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",d.jsx(Ln,{text:a.decision})]}):null,a.rationale?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",d.jsx(Ln,{text:a.rationale})]}):null,a.implementationNotes?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",d.jsx(Ln,{text:a.implementationNotes})]}):null]},a.id))})]})}function TN({project:t}){var x,b,E;const a=t.scope??[],r=t.outOfScope??[],i=t.technologies??[],u=t.tools??[],o=t.globalRules??[],f=t.decisions??[],m=t.acceptedDecisions??[],p={beforePhaseStart:((x=t.workflowRules)==null?void 0:x.beforePhaseStart)??[],beforeTaskStart:((b=t.workflowRules)==null?void 0:b.beforeTaskStart)??[],afterPhaseComplete:((E=t.workflowRules)==null?void 0:E.afterPhaseComplete)??[]};return a.length>0||r.length>0||i.length>0||u.length>0||o.length>0||f.length>0||m.length>0||p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?d.jsx(zn,{className:"grid gap-4",children:d.jsxs("details",{className:"group",children:[d.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"AI Consolidated Context"}),d.jsxs("div",{className:"mt-4 grid gap-4",children:[a.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"In scope"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:a.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,r.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Out of scope"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:r.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,i.length>0||u.length>0?d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Technologies"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:i.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,u.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Tools"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:u.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null]}):null,o.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Global rules"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:o.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?d.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[d.jsx("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:"Workflow rules"}),d.jsxs("div",{className:"mt-4 grid gap-4 text-sm text-[var(--text-muted)]",children:[p.beforePhaseStart.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before phase start"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforePhaseStart.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.beforeTaskStart.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before task start"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforeTaskStart.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.afterPhaseComplete.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"After phase complete"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.afterPhaseComplete.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null]})]}):null,f.length>0?d.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[d.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Legacy decisions (",f.length,")"]}),d.jsx("ul",{className:"mt-4 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:f.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,d.jsx(RN,{decisions:m})]})]})}):null}function Sa({status:t}){return d.jsx("span",{className:`status-chip status-${t}`,children:t})}function jN(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function DN({features:t,phases:a}){const r=v.useMemo(()=>{const i=new Map(t.map(u=>[u.id,u.name]));return a.flatMap(u=>u.tasks.filter(o=>o.status==="done").map(o=>({task:o,phase:u,feature:t.find(f=>f.id===u.featureId),featureName:u.featureId?i.get(u.featureId)??u.featureId:"Unlinked feature",completedAt:o.completedAt||o.updatedAt}))).sort((u,o)=>o.completedAt.localeCompare(u.completedAt)).slice(0,3)},[t,a]);return d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),d.jsx("div",{className:"grid gap-3",children:r.length>0?r.map(({task:i,phase:u,feature:o,featureName:f,completedAt:m})=>d.jsxs(bt,{to:u.featureId?`/features/${u.featureId}/phases/${u.id}/tasks/${i.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(kr,{type:"task",number:i.number}),d.jsx(ni,{type:"task",phaseNum:u.number,featureNum:o==null?void 0:o.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:i.status})})]}),d.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:i.title}),d.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[d.jsx(ni,{type:"phase",featureNum:o==null?void 0:o.number}),d.jsxs("span",{className:"min-w-0 truncate",children:[f," · ",u.title]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",jN(m)]})]},i.id)):d.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const ky=180*1e3;function CN(t){const a=Date.now()-new Date(t).getTime();if(a<0)return"just now";const r=Math.floor(a/1e3);if(r<60)return`${r}s ago`;const i=Math.floor(r/60);return i<60?`${i}m ago`:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function AN({features:t,phases:a}){const[,r]=v.useState(0),i=Date.now(),u=v.useMemo(()=>{const o=new Map(t.map(f=>[f.id,f.name]));return a.flatMap(f=>f.tasks.map(m=>({task:m,phase:f,feature:t.find(p=>p.id===f.featureId),featureName:f.featureId?o.get(f.featureId)??f.featureId:"Unlinked feature",createdAt:m.createdAt}))).filter(f=>{const m=new Date(f.createdAt).getTime();return Number.isFinite(m)&&i-m<ky&&i-m>=0}).sort((f,m)=>m.createdAt.localeCompare(f.createdAt)).slice(0,20)},[t,a,i]);return v.useEffect(()=>{if(u.length===0)return;const o=u.reduce((m,p)=>{const g=new Date(p.createdAt).getTime()+ky-Date.now();return Math.min(m,g)},1/0);if(!Number.isFinite(o)||o<=0)return;const f=window.setTimeout(()=>r(m=>m+1),o+50);return()=>window.clearTimeout(f)},[u]),u.length===0?null:d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"New Added Tasks"}),d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Tasks created in the last 3 minutes."})]}),d.jsx("div",{className:"grid gap-3",children:u.map(({task:o,phase:f,feature:m,featureName:p,createdAt:g})=>d.jsxs(bt,{to:f.featureId?`/features/${f.featureId}/phases/${f.id}/tasks/${o.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 border-[color:color-mix(in_srgb,var(--color-status-done)_0%,transparent)] px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(kr,{type:"task",number:o.number}),d.jsx(ni,{type:"task",phaseNum:f.number,featureNum:m==null?void 0:m.number}),d.jsx("span",{className:"inline-flex items-center rounded-full bg-[color:color-mix(in_srgb,var(--accent)_18%,transparent)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-[var(--accent)]",children:"New"}),d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:o.status})})]}),d.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:o.title}),d.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[d.jsx(ni,{type:"phase",featureNum:m==null?void 0:m.number}),d.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",f.title]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",CN(g)]})]},o.id))})]})}const ON=4200;function MN(t){return t.reduce((a,r)=>a+r.tasks.length,0)}function kN(t){return t.reduce((a,r)=>a+r.tasks.filter(i=>i.status==="done").length,0)}function _N(t){return String(t&&t>0?t:0).padStart(3,"0")}function LN(t,a){const r=new Map;for(const i of a){if(!i.featureId)continue;const u=r.get(i.featureId)??[];u.push(i),r.set(i.featureId,u)}return t.map(i=>{const u=r.get(i.id)??[],o=u.reduce((g,x)=>g+x.tasks.length,0),f=u.reduce((g,x)=>g+x.tasks.filter(b=>b.status==="done").length,0),m=u.map(g=>{const x=[...g.tasks].sort((E,S)=>(E.priority??0)-(S.priority??0)||E.number-S.number||E.createdAt.localeCompare(S.createdAt)||E.title.localeCompare(S.title)),b=x.some(E=>E.status==="in-progress");return{phase:g,totalTasks:g.tasks.length,doneTasks:g.tasks.filter(E=>E.status==="done").length,allTasks:x,hasActiveTask:b}}),p=m.some(({phase:g,allTasks:x})=>g.status==="in-progress"||g.status==="discovery"||x.some(b=>b.status==="in-progress"));return{feature:i,totalTasks:o,doneTasks:f,allPhases:m.sort((g,x)=>(g.phase.priority??0)-(x.phase.priority??0)||g.phase.number-x.phase.number),hasActiveTask:m.some(g=>g.hasActiveTask),isActive:p}}).sort((i,u)=>(i.feature.priority??0)-(u.feature.priority??0)||i.feature.number-u.feature.number||i.feature.name.localeCompare(u.feature.name))}function ec({title:t,value:a,valueSuffix:r,subtitle:i,icon:u,valueClassName:o,iconClassName:f}){return d.jsxs(zn,{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:t}),d.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[d.jsx("p",{className:`text-3xl font-black tracking-tight ${o??"text-[var(--text)]"}`,children:a}),r?d.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:r}):null]}),d.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:i})]}),d.jsx("div",{className:`surface-card flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] bg-[var(--accent-soft)] ${f??"text-[var(--accent)]"}`,children:u})]})}function _y(t){return t>=80?"text-emerald-600 dark:text-emerald-400":t>=30?"text-amber-600 dark:text-amber-400":"text-rose-600 dark:text-rose-400"}function zN({features:t,phases:a}){const r=t.filter(x=>x.status==="done").length,i=Math.max(t.length-r,0),u=a.filter(x=>x.status==="done").length,o=Math.max(a.length-u,0),f=MN(a),m=kN(a),p=Math.max(f-m,0),g=f>0?Math.round(m/f*100):0;return d.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[d.jsx(ec,{title:"Features",value:String(t.length),valueSuffix:"total",subtitle:d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[r," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[i," left"]})]}),icon:d.jsx(xc,{className:"h-4 w-4"})}),d.jsx(ec,{title:"Phases",value:String(a.length),valueSuffix:"total",subtitle:d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[u," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[o," left"]})]}),icon:d.jsx(mE,{className:"h-4 w-4"})}),d.jsx(ec,{title:"Tasks",value:String(f),valueSuffix:"total",subtitle:d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[m," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[p," left"]})]}),icon:d.jsx(ab,{className:"h-4 w-4"})}),d.jsx(ec,{title:"Completion",value:`${g}%`,subtitle:"Task completion rate",valueClassName:_y(g),iconClassName:_y(g),icon:d.jsx(xE,{className:"h-4 w-4"})})]})}function UN(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return v.useMemo(()=>i=>{a.forEach(u=>u(i))},a)}const $c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ii(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function nm(t){return"nodeType"in t}function da(t){var a,r;return t?ii(t)?t:nm(t)&&(a=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?a:window:window}function am(t){const{Document:a}=da(t);return t instanceof a}function ku(t){return ii(t)?!1:t instanceof da(t).HTMLElement}function mb(t){return t instanceof da(t).SVGElement}function ui(t){return t?ii(t)?t.document:nm(t)?am(t)?t:ku(t)||mb(t)?t.ownerDocument:document:document:document}const ll=$c?v.useLayoutEffect:v.useEffect;function qc(t){const a=v.useRef(t);return ll(()=>{a.current=t}),v.useCallback(function(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return a.current==null?void 0:a.current(...i)},[])}function HN(){const t=v.useRef(null),a=v.useCallback((i,u)=>{t.current=setInterval(i,u)},[]),r=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[a,r]}function Su(t,a){a===void 0&&(a=[t]);const r=v.useRef(t);return ll(()=>{r.current!==t&&(r.current=t)},a),r}function _u(t,a){const r=v.useRef();return v.useMemo(()=>{const i=t(r.current);return r.current=i,i},[...a])}function bc(t){const a=qc(t),r=v.useRef(null),i=v.useCallback(u=>{u!==r.current&&(a==null||a(u,r.current)),r.current=u},[]);return[r,i]}function Sc(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let sh={};function Lu(t,a){return v.useMemo(()=>{if(a)return a;const r=sh[t]==null?0:sh[t]+1;return sh[t]=r,t+"-"+r},[t,a])}function pb(t){return function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return i.reduce((o,f)=>{const m=Object.entries(f);for(const[p,g]of m){const x=o[p];x!=null&&(o[p]=x+t*g)}return o},{...a})}}const Js=pb(1),wc=pb(-1);function BN(t){return"clientX"in t&&"clientY"in t}function Yc(t){if(!t)return!1;const{KeyboardEvent:a}=da(t.target);return a&&t instanceof a}function $N(t){if(!t)return!1;const{TouchEvent:a}=da(t.target);return a&&t instanceof a}function Ec(t){if($N(t)){if(t.touches&&t.touches.length){const{clientX:a,clientY:r}=t.touches[0];return{x:a,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:a,clientY:r}=t.changedTouches[0];return{x:a,y:r}}}return BN(t)?{x:t.clientX,y:t.clientY}:null}const Or=Object.freeze({Translate:{toString(t){if(!t)return;const{x:a,y:r}=t;return"translate3d("+(a?Math.round(a):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:a,scaleY:r}=t;return"scaleX("+a+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[Or.Translate.toString(t),Or.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:a,duration:r,easing:i}=t;return a+" "+r+"ms "+i}}}),Ly="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qN(t){return t.matches(Ly)?t:t.querySelector(Ly)}const YN={display:"none"};function VN(t){let{id:a,value:r}=t;return rn.createElement("div",{id:a,style:YN},r)}function FN(t){let{id:a,announcement:r,ariaLiveType:i="assertive"}=t;const u={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return rn.createElement("div",{id:a,style:u,role:"status","aria-live":i,"aria-atomic":!0},r)}function IN(){const[t,a]=v.useState("");return{announce:v.useCallback(i=>{i!=null&&a(i)},[]),announcement:t}}const gb=v.createContext(null);function GN(t){const a=v.useContext(gb);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(t)},[t,a])}function XN(){const[t]=v.useState(()=>new Set),a=v.useCallback(i=>(t.add(i),()=>t.delete(i)),[t]);return[v.useCallback(i=>{let{type:u,event:o}=i;t.forEach(f=>{var m;return(m=f[u])==null?void 0:m.call(f,o)})},[t]),a]}const PN={draggable:`
|
|
194
|
+
To pick up a draggable item, press the space bar.
|
|
195
|
+
While dragging, use the arrow keys to move the item.
|
|
196
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
197
|
+
`},QN={onDragStart(t){let{active:a}=t;return"Picked up draggable item "+a.id+"."},onDragOver(t){let{active:a,over:r}=t;return r?"Draggable item "+a.id+" was moved over droppable area "+r.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(t){let{active:a,over:r}=t;return r?"Draggable item "+a.id+" was dropped over droppable area "+r.id:"Draggable item "+a.id+" was dropped."},onDragCancel(t){let{active:a}=t;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function KN(t){let{announcements:a=QN,container:r,hiddenTextDescribedById:i,screenReaderInstructions:u=PN}=t;const{announce:o,announcement:f}=IN(),m=Lu("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),GN(v.useMemo(()=>({onDragStart(b){let{active:E}=b;o(a.onDragStart({active:E}))},onDragMove(b){let{active:E,over:S}=b;a.onDragMove&&o(a.onDragMove({active:E,over:S}))},onDragOver(b){let{active:E,over:S}=b;o(a.onDragOver({active:E,over:S}))},onDragEnd(b){let{active:E,over:S}=b;o(a.onDragEnd({active:E,over:S}))},onDragCancel(b){let{active:E,over:S}=b;o(a.onDragCancel({active:E,over:S}))}}),[o,a])),!p)return null;const x=rn.createElement(rn.Fragment,null,rn.createElement(VN,{id:i,value:u.draggable}),rn.createElement(FN,{id:m,announcement:f}));return r?Jl.createPortal(x,r):x}var _n;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(_n||(_n={}));function Nc(){}function ZN(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function JN(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return v.useMemo(()=>[...a].filter(i=>i!=null),[...a])}const rl=Object.freeze({x:0,y:0});function WN(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function eR(t,a){const r=Ec(t);if(!r)return"0 0";const i={x:(r.x-a.left)/a.width*100,y:(r.y-a.top)/a.height*100};return i.x+"% "+i.y+"%"}function tR(t,a){let{data:{value:r}}=t,{data:{value:i}}=a;return r-i}function nR(t,a){let{data:{value:r}}=t,{data:{value:i}}=a;return i-r}function aR(t,a){if(!t||t.length===0)return null;const[r]=t;return r[a]}function zy(t,a,r){return a===void 0&&(a=t.left),r===void 0&&(r=t.top),{x:a+t.width*.5,y:r+t.height*.5}}const lR=t=>{let{collisionRect:a,droppableRects:r,droppableContainers:i}=t;const u=zy(a,a.left,a.top),o=[];for(const f of i){const{id:m}=f,p=r.get(m);if(p){const g=WN(zy(p),u);o.push({id:m,data:{droppableContainer:f,value:g}})}}return o.sort(tR)};function rR(t,a){const r=Math.max(a.top,t.top),i=Math.max(a.left,t.left),u=Math.min(a.left+a.width,t.left+t.width),o=Math.min(a.top+a.height,t.top+t.height),f=u-i,m=o-r;if(i<u&&r<o){const p=a.width*a.height,g=t.width*t.height,x=f*m,b=x/(p+g-x);return Number(b.toFixed(4))}return 0}const sR=t=>{let{collisionRect:a,droppableRects:r,droppableContainers:i}=t;const u=[];for(const o of i){const{id:f}=o,m=r.get(f);if(m){const p=rR(m,a);p>0&&u.push({id:f,data:{droppableContainer:o,value:p}})}}return u.sort(nR)};function iR(t,a,r){return{...t,scaleX:a&&r?a.width/r.width:1,scaleY:a&&r?a.height/r.height:1}}function vb(t,a){return t&&a?{x:t.left-a.left,y:t.top-a.top}:rl}function uR(t){return function(r){for(var i=arguments.length,u=new Array(i>1?i-1:0),o=1;o<i;o++)u[o-1]=arguments[o];return u.reduce((f,m)=>({...f,top:f.top+t*m.y,bottom:f.bottom+t*m.y,left:f.left+t*m.x,right:f.right+t*m.x}),{...r})}}const oR=uR(1);function yb(t){if(t.startsWith("matrix3d(")){const a=t.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(t.startsWith("matrix(")){const a=t.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function cR(t,a,r){const i=yb(a);if(!i)return t;const{scaleX:u,scaleY:o,x:f,y:m}=i,p=t.left-f-(1-u)*parseFloat(r),g=t.top-m-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),x=u?t.width/u:t.width,b=o?t.height/o:t.height;return{width:x,height:b,top:g,right:p+x,bottom:g+b,left:p}}const dR={ignoreTransform:!1};function oi(t,a){a===void 0&&(a=dR);let r=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=da(t).getComputedStyle(t);g&&(r=cR(r,g,x))}const{top:i,left:u,width:o,height:f,bottom:m,right:p}=r;return{top:i,left:u,width:o,height:f,bottom:m,right:p}}function Uy(t){return oi(t,{ignoreTransform:!0})}function fR(t){const a=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:a,bottom:r,width:a,height:r}}function hR(t,a){return a===void 0&&(a=da(t).getComputedStyle(t)),a.position==="fixed"}function mR(t,a){a===void 0&&(a=da(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const o=a[u];return typeof o=="string"?r.test(o):!1})}function lm(t,a){const r=[];function i(u){if(a!=null&&r.length>=a||!u)return r;if(am(u)&&u.scrollingElement!=null&&!r.includes(u.scrollingElement))return r.push(u.scrollingElement),r;if(!ku(u)||mb(u)||r.includes(u))return r;const o=da(t).getComputedStyle(u);return u!==t&&mR(u,o)&&r.push(u),hR(u,o)?r:i(u.parentNode)}return t?i(t):r}function xb(t){const[a]=lm(t,1);return a??null}function ih(t){return!$c||!t?null:ii(t)?t:nm(t)?am(t)||t===ui(t).scrollingElement?window:ku(t)?t:null:null}function bb(t){return ii(t)?t.scrollX:t.scrollLeft}function Sb(t){return ii(t)?t.scrollY:t.scrollTop}function Ah(t){return{x:bb(t),y:Sb(t)}}var $n;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})($n||($n={}));function wb(t){return!$c||!t?!1:t===document.scrollingElement}function Eb(t){const a={x:0,y:0},r=wb(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},u=t.scrollTop<=a.y,o=t.scrollLeft<=a.x,f=t.scrollTop>=i.y,m=t.scrollLeft>=i.x;return{isTop:u,isLeft:o,isBottom:f,isRight:m,maxScroll:i,minScroll:a}}const pR={x:.2,y:.2};function gR(t,a,r,i,u){let{top:o,left:f,right:m,bottom:p}=r;i===void 0&&(i=10),u===void 0&&(u=pR);const{isTop:g,isBottom:x,isLeft:b,isRight:E}=Eb(t),S={x:0,y:0},N={x:0,y:0},O={height:a.height*u.y,width:a.width*u.x};return!g&&o<=a.top+O.height?(S.y=$n.Backward,N.y=i*Math.abs((a.top+O.height-o)/O.height)):!x&&p>=a.bottom-O.height&&(S.y=$n.Forward,N.y=i*Math.abs((a.bottom-O.height-p)/O.height)),!E&&m>=a.right-O.width?(S.x=$n.Forward,N.x=i*Math.abs((a.right-O.width-m)/O.width)):!b&&f<=a.left+O.width&&(S.x=$n.Backward,N.x=i*Math.abs((a.left+O.width-f)/O.width)),{direction:S,speed:N}}function vR(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:f}=window;return{top:0,left:0,right:o,bottom:f,width:o,height:f}}const{top:a,left:r,right:i,bottom:u}=t.getBoundingClientRect();return{top:a,left:r,right:i,bottom:u,width:t.clientWidth,height:t.clientHeight}}function Nb(t){return t.reduce((a,r)=>Js(a,Ah(r)),rl)}function yR(t){return t.reduce((a,r)=>a+bb(r),0)}function xR(t){return t.reduce((a,r)=>a+Sb(r),0)}function Rb(t,a){if(a===void 0&&(a=oi),!t)return;const{top:r,left:i,bottom:u,right:o}=a(t);xb(t)&&(u<=0||o<=0||r>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const bR=[["x",["left","right"],yR],["y",["top","bottom"],xR]];class rm{constructor(a,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=lm(r),u=Nb(i);this.rect={...a},this.width=a.width,this.height=a.height;for(const[o,f,m]of bR)for(const p of f)Object.defineProperty(this,p,{get:()=>{const g=m(i),x=u[o]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mu{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...r)})},this.target=a}add(a,r,i){var u;(u=this.target)==null||u.addEventListener(a,r,i),this.listeners.push([a,r,i])}}function SR(t){const{EventTarget:a}=da(t);return t instanceof a?t:ui(t)}function uh(t,a){const r=Math.abs(t.x),i=Math.abs(t.y);return typeof a=="number"?Math.sqrt(r**2+i**2)>a:"x"in a&&"y"in a?r>a.x&&i>a.y:"x"in a?r>a.x:"y"in a?i>a.y:!1}var Xa;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Xa||(Xa={}));function Hy(t){t.preventDefault()}function wR(t){t.stopPropagation()}var Ot;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Ot||(Ot={}));const Tb={start:[Ot.Space,Ot.Enter],cancel:[Ot.Esc],end:[Ot.Space,Ot.Enter,Ot.Tab]},ER=(t,a)=>{let{currentCoordinates:r}=a;switch(t.code){case Ot.Right:return{...r,x:r.x+25};case Ot.Left:return{...r,x:r.x-25};case Ot.Down:return{...r,y:r.y+25};case Ot.Up:return{...r,y:r.y-25}}};class jb{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:r}}=a;this.props=a,this.listeners=new mu(ui(r)),this.windowListeners=new mu(da(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:r}=this.props,i=a.node.current;i&&Rb(i),r(rl)}handleKeyDown(a){if(Yc(a)){const{active:r,context:i,options:u}=this.props,{keyboardCodes:o=Tb,coordinateGetter:f=ER,scrollBehavior:m="smooth"}=u,{code:p}=a;if(o.end.includes(p)){this.handleEnd(a);return}if(o.cancel.includes(p)){this.handleCancel(a);return}const{collisionRect:g}=i.current,x=g?{x:g.left,y:g.top}:rl;this.referenceCoordinates||(this.referenceCoordinates=x);const b=f(a,{active:r,context:i.current,currentCoordinates:x});if(b){const E=wc(b,x),S={x:0,y:0},{scrollableAncestors:N}=i.current;for(const O of N){const T=a.code,{isTop:L,isRight:X,isLeft:Y,isBottom:Q,maxScroll:K,minScroll:W}=Eb(O),U=vR(O),j={x:Math.min(T===Ot.Right?U.right-U.width/2:U.right,Math.max(T===Ot.Right?U.left:U.left+U.width/2,b.x)),y:Math.min(T===Ot.Down?U.bottom-U.height/2:U.bottom,Math.max(T===Ot.Down?U.top:U.top+U.height/2,b.y))},oe=T===Ot.Right&&!X||T===Ot.Left&&!Y,me=T===Ot.Down&&!Q||T===Ot.Up&&!L;if(oe&&j.x!==b.x){const ye=O.scrollLeft+E.x,Re=T===Ot.Right&&ye<=K.x||T===Ot.Left&&ye>=W.x;if(Re&&!E.y){O.scrollTo({left:ye,behavior:m});return}Re?S.x=O.scrollLeft-ye:S.x=T===Ot.Right?O.scrollLeft-K.x:O.scrollLeft-W.x,S.x&&O.scrollBy({left:-S.x,behavior:m});break}else if(me&&j.y!==b.y){const ye=O.scrollTop+E.y,Re=T===Ot.Down&&ye<=K.y||T===Ot.Up&&ye>=W.y;if(Re&&!E.x){O.scrollTo({top:ye,behavior:m});return}Re?S.y=O.scrollTop-ye:S.y=T===Ot.Down?O.scrollTop-K.y:O.scrollTop-W.y,S.y&&O.scrollBy({top:-S.y,behavior:m});break}}this.handleMove(a,Js(wc(b,this.referenceCoordinates),S))}}}handleMove(a,r){const{onMove:i}=this.props;a.preventDefault(),i(r)}handleEnd(a){const{onEnd:r}=this.props;a.preventDefault(),this.detach(),r()}handleCancel(a){const{onCancel:r}=this.props;a.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}jb.activators=[{eventName:"onKeyDown",handler:(t,a,r)=>{let{keyboardCodes:i=Tb,onActivation:u}=a,{active:o}=r;const{code:f}=t.nativeEvent;if(i.start.includes(f)){const m=o.activatorNode.current;return m&&t.target!==m?!1:(t.preventDefault(),u==null||u({event:t.nativeEvent}),!0)}return!1}}];function By(t){return!!(t&&"distance"in t)}function $y(t){return!!(t&&"delay"in t)}class sm{constructor(a,r,i){var u;i===void 0&&(i=SR(a.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=a,this.events=r;const{event:o}=a,{target:f}=o;this.props=a,this.events=r,this.document=ui(f),this.documentListeners=new mu(this.document),this.listeners=new mu(i),this.windowListeners=new mu(da(f)),this.initialCoordinates=(u=Ec(o))!=null?u:rl,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:r,bypassActivationConstraint:i}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.DragStart,Hy),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),this.windowListeners.add(Xa.ContextMenu,Hy),this.documentListeners.add(Xa.Keydown,this.handleKeydown),r){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($y(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(By(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,r){const{active:i,onPending:u}=this.props;u(i,a,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:a}=this,{onStart:r}=this.props;a&&(this.activated=!0,this.documentListeners.add(Xa.Click,wR,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xa.SelectionChange,this.removeTextSelection),r(a))}handleMove(a){var r;const{activated:i,initialCoordinates:u,props:o}=this,{onMove:f,options:{activationConstraint:m}}=o;if(!u)return;const p=(r=Ec(a))!=null?r:rl,g=wc(u,p);if(!i&&m){if(By(m)){if(m.tolerance!=null&&uh(g,m.tolerance))return this.handleCancel();if(uh(g,m.distance))return this.handleStart()}if($y(m)&&uh(g,m.tolerance))return this.handleCancel();this.handlePending(m,g);return}a.cancelable&&a.preventDefault(),f(p)}handleEnd(){const{onAbort:a,onEnd:r}=this.props;this.detach(),this.activated||a(this.props.active),r()}handleCancel(){const{onAbort:a,onCancel:r}=this.props;this.detach(),this.activated||a(this.props.active),r()}handleKeydown(a){a.code===Ot.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const NR={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class im extends sm{constructor(a){const{event:r}=a,i=ui(r.target);super(a,NR,i)}}im.activators=[{eventName:"onPointerDown",handler:(t,a)=>{let{nativeEvent:r}=t,{onActivation:i}=a;return!r.isPrimary||r.button!==0?!1:(i==null||i({event:r}),!0)}}];const RR={move:{name:"mousemove"},end:{name:"mouseup"}};var Oh;(function(t){t[t.RightClick=2]="RightClick"})(Oh||(Oh={}));class TR extends sm{constructor(a){super(a,RR,ui(a.event.target))}}TR.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:r}=t,{onActivation:i}=a;return r.button===Oh.RightClick?!1:(i==null||i({event:r}),!0)}}];const oh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class jR extends sm{constructor(a){super(a,oh)}static setup(){return window.addEventListener(oh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(oh.move.name,a)};function a(){}}}jR.activators=[{eventName:"onTouchStart",handler:(t,a)=>{let{nativeEvent:r}=t,{onActivation:i}=a;const{touches:u}=r;return u.length>1?!1:(i==null||i({event:r}),!0)}}];var pu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(pu||(pu={}));var Rc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Rc||(Rc={}));function DR(t){let{acceleration:a,activator:r=pu.Pointer,canScroll:i,draggingRect:u,enabled:o,interval:f=5,order:m=Rc.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:b,threshold:E}=t;const S=AR({delta:b,disabled:!o}),[N,O]=HN(),T=v.useRef({x:0,y:0}),L=v.useRef({x:0,y:0}),X=v.useMemo(()=>{switch(r){case pu.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case pu.DraggableRect:return u}},[r,u,p]),Y=v.useRef(null),Q=v.useCallback(()=>{const W=Y.current;if(!W)return;const U=T.current.x*L.current.x,j=T.current.y*L.current.y;W.scrollBy(U,j)},[]),K=v.useMemo(()=>m===Rc.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!o||!g.length||!X){O();return}for(const W of K){if((i==null?void 0:i(W))===!1)continue;const U=g.indexOf(W),j=x[U];if(!j)continue;const{direction:oe,speed:me}=gR(W,j,X,a,E);for(const ye of["x","y"])S[ye][oe[ye]]||(me[ye]=0,oe[ye]=0);if(me.x>0||me.y>0){O(),Y.current=W,N(Q,f),T.current=me,L.current=oe;return}}T.current={x:0,y:0},L.current={x:0,y:0},O()},[a,Q,i,O,o,f,JSON.stringify(X),JSON.stringify(S),N,g,K,x,JSON.stringify(E)])}const CR={x:{[$n.Backward]:!1,[$n.Forward]:!1},y:{[$n.Backward]:!1,[$n.Forward]:!1}};function AR(t){let{delta:a,disabled:r}=t;const i=Sc(a);return _u(u=>{if(r||!i||!u)return CR;const o={x:Math.sign(a.x-i.x),y:Math.sign(a.y-i.y)};return{x:{[$n.Backward]:u.x[$n.Backward]||o.x===-1,[$n.Forward]:u.x[$n.Forward]||o.x===1},y:{[$n.Backward]:u.y[$n.Backward]||o.y===-1,[$n.Forward]:u.y[$n.Forward]||o.y===1}}},[r,a,i])}function OR(t,a){const r=a!=null?t.get(a):void 0,i=r?r.node.current:null;return _u(u=>{var o;return a==null?null:(o=i??u)!=null?o:null},[i,a])}function MR(t,a){return v.useMemo(()=>t.reduce((r,i)=>{const{sensor:u}=i,o=u.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,i)}));return[...r,...o]},[]),[t,a])}var wu;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(wu||(wu={}));var Mh;(function(t){t.Optimized="optimized"})(Mh||(Mh={}));const qy=new Map;function kR(t,a){let{dragging:r,dependencies:i,config:u}=a;const[o,f]=v.useState(null),{frequency:m,measure:p,strategy:g}=u,x=v.useRef(t),b=T(),E=Su(b),S=v.useCallback(function(L){L===void 0&&(L=[]),!E.current&&f(X=>X===null?L:X.concat(L.filter(Y=>!X.includes(Y))))},[E]),N=v.useRef(null),O=_u(L=>{if(b&&!r)return qy;if(!L||L===qy||x.current!==t||o!=null){const X=new Map;for(let Y of t){if(!Y)continue;if(o&&o.length>0&&!o.includes(Y.id)&&Y.rect.current){X.set(Y.id,Y.rect.current);continue}const Q=Y.node.current,K=Q?new rm(p(Q),Q):null;Y.rect.current=K,K&&X.set(Y.id,K)}return X}return L},[t,o,r,b,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{b||S()},[r,b]),v.useEffect(()=>{o&&o.length>0&&f(null)},[JSON.stringify(o)]),v.useEffect(()=>{b||typeof m!="number"||N.current!==null||(N.current=setTimeout(()=>{S(),N.current=null},m))},[m,b,S,...i]),{droppableRects:O,measureDroppableContainers:S,measuringScheduled:o!=null};function T(){switch(g){case wu.Always:return!1;case wu.BeforeDragging:return r;default:return!r}}}function um(t,a){return _u(r=>t?r||(typeof a=="function"?a(t):t):null,[a,t])}function _R(t,a){return um(t,a)}function LR(t){let{callback:a,disabled:r}=t;const i=qc(a),u=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,r]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function Vc(t){let{callback:a,disabled:r}=t;const i=qc(a),u=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[r]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function zR(t){return new rm(oi(t),t)}function Yy(t,a,r){a===void 0&&(a=zR);const[i,u]=v.useState(null);function o(){u(p=>{if(!t)return null;if(t.isConnected===!1){var g;return(g=p??r)!=null?g:null}const x=a(t);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const f=LR({callback(p){if(t)for(const g of p){const{type:x,target:b}=g;if(x==="childList"&&b instanceof HTMLElement&&b.contains(t)){o();break}}}}),m=Vc({callback:o});return ll(()=>{o(),t?(m==null||m.observe(t),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(m==null||m.disconnect(),f==null||f.disconnect())},[t]),i}function UR(t){const a=um(t);return vb(t,a)}const Vy=[];function HR(t){const a=v.useRef(t),r=_u(i=>t?i&&i!==Vy&&t&&a.current&&t.parentNode===a.current.parentNode?i:lm(t):Vy,[t]);return v.useEffect(()=>{a.current=t},[t]),r}function BR(t){const[a,r]=v.useState(null),i=v.useRef(t),u=v.useCallback(o=>{const f=ih(o.target);f&&r(m=>m?(m.set(f,Ah(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const o=i.current;if(t!==o){f(o);const m=t.map(p=>{const g=ih(p);return g?(g.addEventListener("scroll",u,{passive:!0}),[g,Ah(g)]):null}).filter(p=>p!=null);r(m.length?new Map(m):null),i.current=t}return()=>{f(t),f(o)};function f(m){m.forEach(p=>{const g=ih(p);g==null||g.removeEventListener("scroll",u)})}},[u,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((o,f)=>Js(o,f),rl):Nb(t):rl,[t,a])}function Fy(t,a){a===void 0&&(a=[]);const r=v.useRef(null);return v.useEffect(()=>{r.current=null},a),v.useEffect(()=>{const i=t!==rl;i&&!r.current&&(r.current=t),!i&&r.current&&(r.current=null)},[t]),r.current?wc(t,r.current):rl}function $R(t){v.useEffect(()=>{if(!$c)return;const a=t.map(r=>{let{sensor:i}=r;return i.setup==null?void 0:i.setup()});return()=>{for(const r of a)r==null||r()}},t.map(a=>{let{sensor:r}=a;return r}))}function qR(t,a){return v.useMemo(()=>t.reduce((r,i)=>{let{eventName:u,handler:o}=i;return r[u]=f=>{o(f,a)},r},{}),[t,a])}function Db(t){return v.useMemo(()=>t?fR(t):null,[t])}const Iy=[];function YR(t,a){a===void 0&&(a=oi);const[r]=t,i=Db(r?da(r):null),[u,o]=v.useState(Iy);function f(){o(()=>t.length?t.map(p=>wb(p)?i:new rm(a(p),p)):Iy)}const m=Vc({callback:f});return ll(()=>{m==null||m.disconnect(),f(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),u}function Cb(t){if(!t)return null;if(t.children.length>1)return t;const a=t.children[0];return ku(a)?a:t}function VR(t){let{measure:a}=t;const[r,i]=v.useState(null),u=v.useCallback(g=>{for(const{target:x}of g)if(ku(x)){i(b=>{const E=a(x);return b?{...b,width:E.width,height:E.height}:E});break}},[a]),o=Vc({callback:u}),f=v.useCallback(g=>{const x=Cb(g);o==null||o.disconnect(),x&&(o==null||o.observe(x)),i(x?a(x):null)},[a,o]),[m,p]=bc(f);return v.useMemo(()=>({nodeRef:m,rect:r,setRef:p}),[r,m,p])}const FR=[{sensor:im,options:{}},{sensor:jb,options:{}}],IR={current:{}},hc={draggable:{measure:Uy},droppable:{measure:Uy,strategy:wu.WhileDragging,frequency:Mh.Optimized},dragOverlay:{measure:oi}};class gu extends Map{get(a){var r;return a!=null&&(r=super.get(a))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:r}=a;return!r})}getNodeFor(a){var r,i;return(r=(i=this.get(a))==null?void 0:i.node.current)!=null?r:void 0}}const GR={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Nc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hc,measureDroppableContainers:Nc,windowRect:null,measuringScheduled:!1},Ab={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Nc,draggableNodes:new Map,over:null,measureDroppableContainers:Nc},zu=v.createContext(Ab),Ob=v.createContext(GR);function XR(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gu}}}function PR(t,a){switch(a.type){case _n.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case _n.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:a.coordinates.x-t.draggable.initialCoordinates.x,y:a.coordinates.y-t.draggable.initialCoordinates.y}}};case _n.DragEnd:case _n.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _n.RegisterDroppable:{const{element:r}=a,{id:i}=r,u=new gu(t.droppable.containers);return u.set(i,r),{...t,droppable:{...t.droppable,containers:u}}}case _n.SetDroppableDisabled:{const{id:r,key:i,disabled:u}=a,o=t.droppable.containers.get(r);if(!o||i!==o.key)return t;const f=new gu(t.droppable.containers);return f.set(r,{...o,disabled:u}),{...t,droppable:{...t.droppable,containers:f}}}case _n.UnregisterDroppable:{const{id:r,key:i}=a,u=t.droppable.containers.get(r);if(!u||i!==u.key)return t;const o=new gu(t.droppable.containers);return o.delete(r),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function QR(t){let{disabled:a}=t;const{active:r,activatorEvent:i,draggableNodes:u}=v.useContext(zu),o=Sc(i),f=Sc(r==null?void 0:r.id);return v.useEffect(()=>{if(!a&&!i&&o&&f!=null){if(!Yc(o)||document.activeElement===o.target)return;const m=u.get(f);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[p.current,g.current]){if(!x)continue;const b=qN(x);if(b){b.focus();break}}})}},[i,a,u,f,o]),null}function Mb(t,a){let{transform:r,...i}=a;return t!=null&&t.length?t.reduce((u,o)=>o({transform:u,...i}),r):r}function KR(t){return v.useMemo(()=>({draggable:{...hc.draggable,...t==null?void 0:t.draggable},droppable:{...hc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...hc.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function ZR(t){let{activeNode:a,measure:r,initialRect:i,config:u=!0}=t;const o=v.useRef(!1),{x:f,y:m}=typeof u=="boolean"?{x:u,y:u}:u;ll(()=>{if(!f&&!m||!a){o.current=!1;return}if(o.current||!i)return;const g=a==null?void 0:a.node.current;if(!g||g.isConnected===!1)return;const x=r(g),b=vb(x,i);if(f||(b.x=0),m||(b.y=0),o.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const E=xb(g);E&&E.scrollBy({top:b.y,left:b.x})}},[a,f,m,i,r])}const Fc=v.createContext({...rl,scaleX:1,scaleY:1});var Dr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Dr||(Dr={}));const JR=v.memo(function(a){var r,i,u,o;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=FR,collisionDetection:b=sR,measuring:E,modifiers:S,...N}=a;const O=v.useReducer(PR,void 0,XR),[T,L]=O,[X,Y]=XN(),[Q,K]=v.useState(Dr.Uninitialized),W=Q===Dr.Initialized,{draggable:{active:U,nodes:j,translate:oe},droppable:{containers:me}}=T,ye=U!=null?j.get(U):null,Re=v.useRef({initial:null,translated:null}),ee=v.useMemo(()=>{var qt;return U!=null?{id:U,data:(qt=ye==null?void 0:ye.data)!=null?qt:IR,rect:Re}:null},[U,ye]),be=v.useRef(null),[Ee,z]=v.useState(null),[B,ie]=v.useState(null),de=Su(N,Object.values(N)),pe=Lu("DndDescribedBy",f),D=v.useMemo(()=>me.getEnabled(),[me]),q=KR(E),{droppableRects:ne,measureDroppableContainers:ce,measuringScheduled:Te}=kR(D,{dragging:W,dependencies:[oe.x,oe.y],config:q.droppable}),Ne=OR(j,U),Ue=v.useMemo(()=>B?Ec(B):null,[B]),it=Xt(),Ge=_R(Ne,q.draggable.measure);ZR({activeNode:U!=null?j.get(U):null,config:it.layoutShiftCompensation,initialRect:Ge,measure:q.draggable.measure});const tt=Yy(Ne,q.draggable.measure,Ge),pn=Yy(Ne?Ne.parentElement:null),Rt=v.useRef({activatorEvent:null,active:null,activeNode:Ne,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:me,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ut=me.getNodeFor((r=Rt.current.over)==null?void 0:r.id),se=VR({measure:q.dragOverlay.measure}),Ye=(i=se.nodeRef.current)!=null?i:Ne,Ie=W?(u=se.rect)!=null?u:tt:null,It=!!(se.nodeRef.current&&se.rect),Dn=UR(It?null:tt),dn=Db(Ye?da(Ye):null),Lt=HR(W?ut??Ne:null),Jt=YR(Lt),Yn=Mb(S,{transform:{x:oe.x-Dn.x,y:oe.y-Dn.y,scaleX:1,scaleY:1},activatorEvent:B,active:ee,activeNodeRect:tt,containerNodeRect:pn,draggingNodeRect:Ie,over:Rt.current.over,overlayNodeRect:se.rect,scrollableAncestors:Lt,scrollableAncestorRects:Jt,windowRect:dn}),Vn=Ue?Js(Ue,oe):null,fe=BR(Lt),Le=Fy(fe),ke=Fy(fe,[tt]),Ve=Js(Yn,Le),nt=Ie?oR(Ie,Yn):null,mt=ee&&nt?b({active:ee,collisionRect:nt,droppableRects:ne,droppableContainers:D,pointerCoordinates:Vn}):null,Gt=aR(mt,"id"),[an,Hn]=v.useState(null),sn=It?Yn:Js(Yn,ke),re=iR(sn,(o=an==null?void 0:an.rect)!=null?o:null,tt),St=v.useRef(null),Mt=v.useCallback((qt,vt)=>{let{sensor:zt,options:Tt}=vt;if(be.current==null)return;const Wt=j.get(be.current);if(!Wt)return;const Pt=qt.nativeEvent,Ut=new zt({active:be.current,activeNode:Wt,event:Pt,options:Tt,context:Rt,onAbort(Ze){if(!j.get(Ze))return;const{onDragAbort:Cn}=de.current,C={id:Ze};Cn==null||Cn(C),X({type:"onDragAbort",event:C})},onPending(Ze,bn,Cn,C){if(!j.get(Ze))return;const{onDragPending:$}=de.current,Z={id:Ze,constraint:bn,initialCoordinates:Cn,offset:C};$==null||$(Z),X({type:"onDragPending",event:Z})},onStart(Ze){const bn=be.current;if(bn==null)return;const Cn=j.get(bn);if(!Cn)return;const{onDragStart:C}=de.current,k={activatorEvent:Pt,active:{id:bn,data:Cn.data,rect:Re}};Jl.unstable_batchedUpdates(()=>{C==null||C(k),K(Dr.Initializing),L({type:_n.DragStart,initialCoordinates:Ze,active:bn}),X({type:"onDragStart",event:k}),z(St.current),ie(Pt)})},onMove(Ze){L({type:_n.DragMove,coordinates:Ze})},onEnd:dt(_n.DragEnd),onCancel:dt(_n.DragCancel)});St.current=Ut;function dt(Ze){return async function(){const{active:Cn,collisions:C,over:k,scrollAdjustedTranslate:$}=Rt.current;let Z=null;if(Cn&&$){const{cancelDrop:ae}=de.current;Z={activatorEvent:Pt,active:Cn,collisions:C,delta:$,over:k},Ze===_n.DragEnd&&typeof ae=="function"&&await Promise.resolve(ae(Z))&&(Ze=_n.DragCancel)}be.current=null,Jl.unstable_batchedUpdates(()=>{L({type:Ze}),K(Dr.Uninitialized),Hn(null),z(null),ie(null),St.current=null;const ae=Ze===_n.DragEnd?"onDragEnd":"onDragCancel";if(Z){const je=de.current[ae];je==null||je(Z),X({type:ae,event:Z})}})}}},[j]),Jn=v.useCallback((qt,vt)=>(zt,Tt)=>{const Wt=zt.nativeEvent,Pt=j.get(Tt);if(be.current!==null||!Pt||Wt.dndKit||Wt.defaultPrevented)return;const Ut={active:Pt};qt(zt,vt.options,Ut)===!0&&(Wt.dndKit={capturedBy:vt.sensor},be.current=Tt,Mt(zt,vt))},[j,Mt]),Wn=MR(x,Jn);$R(x),ll(()=>{tt&&Q===Dr.Initializing&&K(Dr.Initialized)},[tt,Q]),v.useEffect(()=>{const{onDragMove:qt}=de.current,{active:vt,activatorEvent:zt,collisions:Tt,over:Wt}=Rt.current;if(!vt||!zt)return;const Pt={active:vt,activatorEvent:zt,collisions:Tt,delta:{x:Ve.x,y:Ve.y},over:Wt};Jl.unstable_batchedUpdates(()=>{qt==null||qt(Pt),X({type:"onDragMove",event:Pt})})},[Ve.x,Ve.y]),v.useEffect(()=>{const{active:qt,activatorEvent:vt,collisions:zt,droppableContainers:Tt,scrollAdjustedTranslate:Wt}=Rt.current;if(!qt||be.current==null||!vt||!Wt)return;const{onDragOver:Pt}=de.current,Ut=Tt.get(Gt),dt=Ut&&Ut.rect.current?{id:Ut.id,rect:Ut.rect.current,data:Ut.data,disabled:Ut.disabled}:null,Ze={active:qt,activatorEvent:vt,collisions:zt,delta:{x:Wt.x,y:Wt.y},over:dt};Jl.unstable_batchedUpdates(()=>{Hn(dt),Pt==null||Pt(Ze),X({type:"onDragOver",event:Ze})})},[Gt]),ll(()=>{Rt.current={activatorEvent:B,active:ee,activeNode:Ne,collisionRect:nt,collisions:mt,droppableRects:ne,draggableNodes:j,draggingNode:Ye,draggingNodeRect:Ie,droppableContainers:me,over:an,scrollableAncestors:Lt,scrollAdjustedTranslate:Ve},Re.current={initial:Ie,translated:nt}},[ee,Ne,mt,nt,j,Ye,Ie,ne,me,an,Lt,Ve]),DR({...it,delta:oe,draggingRect:nt,pointerCoordinates:Vn,scrollableAncestors:Lt,scrollableAncestorRects:Jt});const Tl=v.useMemo(()=>({active:ee,activeNode:Ne,activeNodeRect:tt,activatorEvent:B,collisions:mt,containerNodeRect:pn,dragOverlay:se,draggableNodes:j,droppableContainers:me,droppableRects:ne,over:an,measureDroppableContainers:ce,scrollableAncestors:Lt,scrollableAncestorRects:Jt,measuringConfiguration:q,measuringScheduled:Te,windowRect:dn}),[ee,Ne,tt,B,mt,pn,se,j,me,ne,an,ce,Lt,Jt,q,Te,dn]),Be=v.useMemo(()=>({activatorEvent:B,activators:Wn,active:ee,activeNodeRect:tt,ariaDescribedById:{draggable:pe},dispatch:L,draggableNodes:j,over:an,measureDroppableContainers:ce}),[B,Wn,ee,tt,L,pe,j,an,ce]);return rn.createElement(gb.Provider,{value:Y},rn.createElement(zu.Provider,{value:Be},rn.createElement(Ob.Provider,{value:Tl},rn.createElement(Fc.Provider,{value:re},g)),rn.createElement(QR,{disabled:(m==null?void 0:m.restoreFocus)===!1})),rn.createElement(KN,{...m,hiddenTextDescribedById:pe}));function Xt(){const qt=(Ee==null?void 0:Ee.autoScrollEnabled)===!1,vt=typeof p=="object"?p.enabled===!1:p===!1,zt=W&&!qt&&!vt;return typeof p=="object"?{...p,enabled:zt}:{enabled:zt}}}),WR=v.createContext(null),Gy="button",e2="Draggable";function t2(t){let{id:a,data:r,disabled:i=!1,attributes:u}=t;const o=Lu(e2),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:b,over:E}=v.useContext(zu),{role:S=Gy,roleDescription:N="draggable",tabIndex:O=0}=u??{},T=(p==null?void 0:p.id)===a,L=v.useContext(T?Fc:WR),[X,Y]=bc(),[Q,K]=bc(),W=qR(f,a),U=Su(r);ll(()=>(b.set(a,{id:a,key:o,node:X,activatorNode:Q,data:U}),()=>{const oe=b.get(a);oe&&oe.key===o&&b.delete(a)}),[b,a]);const j=v.useMemo(()=>({role:S,tabIndex:O,"aria-disabled":i,"aria-pressed":T&&S===Gy?!0:void 0,"aria-roledescription":N,"aria-describedby":x.draggable}),[i,S,O,T,N,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:j,isDragging:T,listeners:i?void 0:W,node:X,over:E,setNodeRef:Y,setActivatorNodeRef:K,transform:L}}function kb(){return v.useContext(Ob)}const n2="Droppable",a2={timeout:25};function l2(t){let{data:a,disabled:r=!1,id:i,resizeObserverConfig:u}=t;const o=Lu(n2),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(zu),x=v.useRef({disabled:r}),b=v.useRef(!1),E=v.useRef(null),S=v.useRef(null),{disabled:N,updateMeasurementsFor:O,timeout:T}={...a2,...u},L=Su(O??i),X=v.useCallback(()=>{if(!b.current){b.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),S.current=null},T)},[T]),Y=Vc({callback:X,disabled:N||!f}),Q=v.useCallback((j,oe)=>{Y&&(oe&&(Y.unobserve(oe),b.current=!1),j&&Y.observe(j))},[Y]),[K,W]=bc(Q),U=Su(a);return v.useEffect(()=>{!Y||!K.current||(Y.disconnect(),b.current=!1,Y.observe(K.current))},[K,Y]),v.useEffect(()=>(m({type:_n.RegisterDroppable,element:{id:i,key:o,disabled:r,node:K,rect:E,data:U}}),()=>m({type:_n.UnregisterDroppable,key:o,id:i})),[i]),v.useEffect(()=>{r!==x.current.disabled&&(m({type:_n.SetDroppableDisabled,id:i,key:o,disabled:r}),x.current.disabled=r)},[i,o,r,m]),{active:f,rect:E,isOver:(p==null?void 0:p.id)===i,node:K,over:p,setNodeRef:W}}function r2(t){let{animation:a,children:r}=t;const[i,u]=v.useState(null),[o,f]=v.useState(null),m=Sc(r);return!r&&!i&&m&&u(m),ll(()=>{if(!o)return;const p=i==null?void 0:i.key,g=i==null?void 0:i.props.id;if(p==null||g==null){u(null);return}Promise.resolve(a(g,o)).then(()=>{u(null)})},[a,i,o]),rn.createElement(rn.Fragment,null,r,i?v.cloneElement(i,{ref:f}):null)}const s2={x:0,y:0,scaleX:1,scaleY:1};function i2(t){let{children:a}=t;return rn.createElement(zu.Provider,{value:Ab},rn.createElement(Fc.Provider,{value:s2},a))}const u2={position:"fixed",touchAction:"none"},o2=t=>Yc(t)?"transform 250ms ease":void 0,c2=v.forwardRef((t,a)=>{let{as:r,activatorEvent:i,adjustScale:u,children:o,className:f,rect:m,style:p,transform:g,transition:x=o2}=t;if(!m)return null;const b=u?g:{...g,scaleX:1,scaleY:1},E={...u2,width:m.width,height:m.height,top:m.top,left:m.left,transform:Or.Transform.toString(b),transformOrigin:u&&i?eR(i,m):void 0,transition:typeof x=="function"?x(i):x,...p};return rn.createElement(r,{className:f,style:E,ref:a},o)}),d2=t=>a=>{let{active:r,dragOverlay:i}=a;const u={},{styles:o,className:f}=t;if(o!=null&&o.active)for(const[m,p]of Object.entries(o.active))p!==void 0&&(u[m]=r.node.style.getPropertyValue(m),r.node.style.setProperty(m,p));if(o!=null&&o.dragOverlay)for(const[m,p]of Object.entries(o.dragOverlay))p!==void 0&&i.node.style.setProperty(m,p);return f!=null&&f.active&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[p,g]of Object.entries(u))r.node.style.setProperty(p,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},f2=t=>{let{transform:{initial:a,final:r}}=t;return[{transform:Or.Transform.toString(a)},{transform:Or.Transform.toString(r)}]},h2={duration:250,easing:"ease",keyframes:f2,sideEffects:d2({styles:{active:{opacity:"0"}}})};function m2(t){let{config:a,draggableNodes:r,droppableContainers:i,measuringConfiguration:u}=t;return qc((o,f)=>{if(a===null)return;const m=r.get(o);if(!m)return;const p=m.node.current;if(!p)return;const g=Cb(f);if(!g)return;const{transform:x}=da(f).getComputedStyle(f),b=yb(x);if(!b)return;const E=typeof a=="function"?a:p2(a);return Rb(p,u.draggable.measure),E({active:{id:o,data:m.data,node:p,rect:u.draggable.measure(p)},draggableNodes:r,dragOverlay:{node:f,rect:u.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:u,transform:b})})}function p2(t){const{duration:a,easing:r,sideEffects:i,keyframes:u}={...h2,...t};return o=>{let{active:f,dragOverlay:m,transform:p,...g}=o;if(!a)return;const x={x:m.rect.left-f.rect.left,y:m.rect.top-f.rect.top},b={scaleX:p.scaleX!==1?f.rect.width*p.scaleX/m.rect.width:1,scaleY:p.scaleY!==1?f.rect.height*p.scaleY/m.rect.height:1},E={x:p.x-x.x,y:p.y-x.y,...b},S=u({...g,active:f,dragOverlay:m,transform:{initial:p,final:E}}),[N]=S,O=S[S.length-1];if(JSON.stringify(N)===JSON.stringify(O))return;const T=i==null?void 0:i({active:f,dragOverlay:m,...g}),L=m.node.animate(S,{duration:a,easing:r,fill:"forwards"});return new Promise(X=>{L.onfinish=()=>{T==null||T(),X()}})}}let Xy=0;function g2(t){return v.useMemo(()=>{if(t!=null)return Xy++,Xy},[t])}const v2=rn.memo(t=>{let{adjustScale:a=!1,children:r,dropAnimation:i,style:u,transition:o,modifiers:f,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:b,activeNodeRect:E,containerNodeRect:S,draggableNodes:N,droppableContainers:O,dragOverlay:T,over:L,measuringConfiguration:X,scrollableAncestors:Y,scrollableAncestorRects:Q,windowRect:K}=kb(),W=v.useContext(Fc),U=g2(b==null?void 0:b.id),j=Mb(f,{activatorEvent:x,active:b,activeNodeRect:E,containerNodeRect:S,draggingNodeRect:T.rect,over:L,overlayNodeRect:T.rect,scrollableAncestors:Y,scrollableAncestorRects:Q,transform:W,windowRect:K}),oe=um(E),me=m2({config:i,draggableNodes:N,droppableContainers:O,measuringConfiguration:X}),ye=oe?T.setRef:void 0;return rn.createElement(i2,null,rn.createElement(r2,{animation:me},b&&U?rn.createElement(c2,{key:U,id:b.id,ref:ye,as:m,activatorEvent:x,adjustScale:a,className:p,transition:o,rect:oe,style:{zIndex:g,...u},transform:j},r):null))});function vu(t,a,r){const i=t.slice();return i.splice(r<0?i.length+r:r,0,i.splice(a,1)[0]),i}function y2(t,a){return t.reduce((r,i,u)=>{const o=a.get(i);return o&&(r[u]=o),r},Array(t.length))}function tc(t){return t!==null&&t>=0}function x2(t,a){if(t===a)return!0;if(t.length!==a.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==a[r])return!1;return!0}function b2(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const _b=t=>{let{rects:a,activeIndex:r,overIndex:i,index:u}=t;const o=vu(a,i,r),f=a[u],m=o[u];return!m||!f?null:{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}},nc={scaleX:1,scaleY:1},om=t=>{var a;let{activeIndex:r,activeNodeRect:i,index:u,rects:o,overIndex:f}=t;const m=(a=o[r])!=null?a:i;if(!m)return null;if(u===r){const g=o[f];return g?{x:0,y:r<f?g.top+g.height-(m.top+m.height):g.top-m.top,...nc}:null}const p=S2(o,u,r);return u>r&&u<=f?{x:0,y:-m.height-p,...nc}:u<r&&u>=f?{x:0,y:m.height+p,...nc}:{x:0,y:0,...nc}};function S2(t,a,r){const i=t[a],u=t[a-1],o=t[a+1];return i?r<a?u?i.top-(u.top+u.height):o?o.top-(i.top+i.height):0:o?o.top-(i.top+i.height):u?i.top-(u.top+u.height):0:0}const Lb="Sortable",zb=rn.createContext({activeIndex:-1,containerId:Lb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_b,disabled:{draggable:!1,droppable:!1}});function cm(t){let{children:a,id:r,items:i,strategy:u=_b,disabled:o=!1}=t;const{active:f,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=kb(),b=Lu(Lb,r),E=m.rect!==null,S=v.useMemo(()=>i.map(W=>typeof W=="object"&&"id"in W?W.id:W),[i]),N=f!=null,O=f?S.indexOf(f.id):-1,T=g?S.indexOf(g.id):-1,L=v.useRef(S),X=!x2(S,L.current),Y=T!==-1&&O===-1||X,Q=b2(o);ll(()=>{X&&N&&x(S)},[X,S,N,x]),v.useEffect(()=>{L.current=S},[S]);const K=v.useMemo(()=>({activeIndex:O,containerId:b,disabled:Q,disableTransforms:Y,items:S,overIndex:T,useDragOverlay:E,sortedRects:y2(S,p),strategy:u}),[O,b,Q.draggable,Q.droppable,Y,S,T,p,E,u]);return rn.createElement(zb.Provider,{value:K},a)}const w2=t=>{let{id:a,items:r,activeIndex:i,overIndex:u}=t;return vu(r,i,u).indexOf(a)},E2=t=>{let{containerId:a,isSorting:r,wasDragging:i,index:u,items:o,newIndex:f,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!i||m!==o&&u===f?!1:r?!0:f!==u&&a===p},N2={duration:200,easing:"ease"},Ub="transform",R2=Or.Transition.toString({property:Ub,duration:0,easing:"linear"}),T2={roleDescription:"sortable"};function j2(t){let{disabled:a,index:r,node:i,rect:u}=t;const[o,f]=v.useState(null),m=v.useRef(r);return ll(()=>{if(!a&&r!==m.current&&i.current){const p=u.current;if(p){const g=oi(i.current,{ignoreTransform:!0}),x={x:p.left-g.left,y:p.top-g.top,scaleX:p.width/g.width,scaleY:p.height/g.height};(x.x||x.y)&&f(x)}}r!==m.current&&(m.current=r)},[a,r,i,u]),v.useEffect(()=>{o&&f(null)},[o]),o}function D2(t){let{animateLayoutChanges:a=E2,attributes:r,disabled:i,data:u,getNewIndex:o=w2,id:f,strategy:m,resizeObserverConfig:p,transition:g=N2}=t;const{items:x,containerId:b,activeIndex:E,disabled:S,disableTransforms:N,sortedRects:O,overIndex:T,useDragOverlay:L,strategy:X}=v.useContext(zb),Y=C2(i,S),Q=x.indexOf(f),K=v.useMemo(()=>({sortable:{containerId:b,index:Q,items:x},...u}),[b,u,Q,x]),W=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:U,node:j,isOver:oe,setNodeRef:me}=l2({id:f,data:K,disabled:Y.droppable,resizeObserverConfig:{updateMeasurementsFor:W,...p}}),{active:ye,activatorEvent:Re,activeNodeRect:ee,attributes:be,setNodeRef:Ee,listeners:z,isDragging:B,over:ie,setActivatorNodeRef:de,transform:pe}=t2({id:f,data:K,attributes:{...T2,...r},disabled:Y.draggable}),D=UN(me,Ee),q=!!ye,ne=q&&!N&&tc(E)&&tc(T),ce=!L&&B,Te=ce&&ne?pe:null,Ue=ne?Te??(m??X)({rects:O,activeNodeRect:ee,activeIndex:E,overIndex:T,index:Q}):null,it=tc(E)&&tc(T)?o({id:f,items:x,activeIndex:E,overIndex:T}):Q,Ge=ye==null?void 0:ye.id,tt=v.useRef({activeId:Ge,items:x,newIndex:it,containerId:b}),pn=x!==tt.current.items,Rt=a({active:ye,containerId:b,isDragging:B,isSorting:q,id:f,index:Q,items:x,newIndex:tt.current.newIndex,previousItems:tt.current.items,previousContainerId:tt.current.containerId,transition:g,wasDragging:tt.current.activeId!=null}),ut=j2({disabled:!Rt,index:Q,node:j,rect:U});return v.useEffect(()=>{q&&tt.current.newIndex!==it&&(tt.current.newIndex=it),b!==tt.current.containerId&&(tt.current.containerId=b),x!==tt.current.items&&(tt.current.items=x)},[q,it,b,x]),v.useEffect(()=>{if(Ge===tt.current.activeId)return;if(Ge!=null&&tt.current.activeId==null){tt.current.activeId=Ge;return}const Ye=setTimeout(()=>{tt.current.activeId=Ge},50);return()=>clearTimeout(Ye)},[Ge]),{active:ye,activeIndex:E,attributes:be,data:K,rect:U,index:Q,newIndex:it,items:x,isOver:oe,isSorting:q,isDragging:B,listeners:z,node:j,overIndex:T,over:ie,setNodeRef:D,setActivatorNodeRef:de,setDroppableNodeRef:me,setDraggableNodeRef:Ee,transform:ut??Ue,transition:se()};function se(){if(ut||pn&&tt.current.newIndex===Q)return R2;if(!(ce&&!Yc(Re)||!g)&&(q||Rt))return Or.Transition.toString({...g,property:Ub})}}function C2(t,a){var r,i;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:a.draggable,droppable:(i=t==null?void 0:t.droppable)!=null?i:a.droppable}}Ot.Down,Ot.Right,Ot.Up,Ot.Left;const Ic=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Gc=[{value:"draft",label:"Draft"},{value:"discovery",label:"Discovery"},{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Uu=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],su=Ic.map(t=>t.value),iu=Gc.map(t=>t.value),uu=Uu.map(t=>t.value);function ch(t,a,r){if(t.includes(a)){const i=t.filter(u=>u!==a);return i.length===0?[...r]:i}return[...t,a]}function dh(t,a){return a.includes(t)}function yl(t,a){return`agent-plan:dashboard:${t}:${a}`}function fh(t,a,r){if(typeof window>"u")return a;try{const i=window.localStorage.getItem(t);if(!i)return a;const u=JSON.parse(i);if(!Array.isArray(u))return a;const o=`${t}-schema`,f=r.slice().sort().join(",");if(window.localStorage.getItem(o)!==f)return window.localStorage.setItem(o,f),a;const p=u.filter(g=>typeof g=="string"&&r.includes(g));return p.length>0?p:a}catch{return a}}function hh(t,a,r){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,r.slice().sort().join(",")))}function mh(t,a){if(typeof window>"u")return a;const r=window.localStorage.getItem(t);return r===null?a:r==="true"}const Py={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Qy=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function Hb(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function A2(t){return new Set(Hb(t).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function Ky(t){const a=t.toUpperCase();return a==="AND"||a==="OR"}function ph(t,a){const r=t??new Set;for(const i of A2(a))r.add(i);return r}function O2(t,a){const r=t??new Set;for(const i of Hb(a).map(u=>u.toUpperCase()))r.add(i);return r}function M2(t){const a=t.trim();if(!a)return{...Py};const r={...Py},i=[],u=[];let o=0;for(;o<a.length;){const m=a[o];if(m==='"'){const p=a.indexOf('"',o+1);if(p===-1){u.push(a.slice(o+1));break}u.push(a.slice(o+1,p)),o=p+1}else if(m===" ")o+=1;else{let p=o;for(;p<a.length&&a[p]!==" ";)p+=1;u.push(a.slice(o,p)),o=p}}let f=0;for(;f<u.length;){const m=u[f];if(Ky(m)){f+=1;continue}const p=m.match(Qy);if(p){const g=(p[1]??"").toLowerCase();let x=p[2]??"";if(x.trim()===""&&f+1<u.length){let b=f+1;for(;b<u.length&&Ky(u[b]);)b+=1;b<u.length&&!u[b].match(Qy)&&(x=u[b],f=b)}if(g==="feature"){const b=ph(r.featureNumbers,x);b.size&&(r.featureNumbers=b)}else if(g==="phase"){const b=ph(r.phaseNumbers,x);b.size&&(r.phaseNumbers=b)}else if(g==="task"){const b=ph(r.taskNumbers,x);b.size&&(r.taskNumbers=b)}else if(g==="id"){const b=O2(r.shortIds,x);b.size&&(r.shortIds=b)}else g==="status"?x.trim()&&(r.status=x.toLowerCase()):g==="feature-status"?x.trim()&&(r.featureStatus=x.toLowerCase()):g==="phase-status"?x.trim()&&(r.phaseStatus=x.toLowerCase()):g==="title"&&x.trim()&&(r.text=x.toLowerCase())}else i.push(m.toLowerCase());f+=1}return i.length>0&&!r.text&&(r.text=i.join(" ")),r}function k2(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function Bb(t){const a=r=>String(r).padStart(3,"0");return[t.task.title,t.task.shortName??"",t.task.shortId??"",String(t.task.number),`T${a(t.task.number)}`,t.task.description??"",t.task.notes??"",t.phase.title,t.phase.slug??"",t.phase.shortId??"",String(t.phase.number),`P${a(t.phase.number)}`,t.phase.description??"",t.phase.summary??"",t.phase.notes??"",t.feature.name,t.feature.shortId??"",String(t.feature.number),`F${a(t.feature.number)}`,t.feature.description??""].join(" ").toLowerCase()}function _2(t,a,r){if(t.featureNumbers&&!t.featureNumbers.has(a.feature.number)||t.phaseNumbers&&!t.phaseNumbers.has(a.phase.number)||t.taskNumbers&&!t.taskNumbers.has(a.task.number)||t.shortIds&&!(t.shortIds.has(a.task.shortId??"")||t.shortIds.has(a.phase.shortId??"")||t.shortIds.has(a.feature.shortId??""))||t.status&&a.task.status!==t.status||t.featureStatus&&a.feature.status!==t.featureStatus||t.phaseStatus&&a.phase.status!==t.phaseStatus)return!1;if(t.text){const i=t.text;if(!(r??Bb(a)).includes(i))return!1}return!0}function L2({features:t,phases:a,projectStorageScope:r}){const i=yl(r,"show-all-features"),u=yl(r,"tree-open-mode"),o=yl(r,"expanded-features"),f=yl(r,"expanded-phases"),m=yl(r,"feature-status-filters"),p=yl(r,"phase-status-filters"),g=yl(r,"task-status-filters"),x=yl(r,"hide-done"),b=yl(r,"hide-planned"),E=yl(r,"only-active-branches"),[S,N]=v.useState(""),O=v.useMemo(()=>LN(t,a),[t,a]),T=v.useMemo(()=>M2(S),[S]),L=k2(T),X=v.useMemo(()=>{if(!L||!T.text)return null;const fe=new Map;for(const Le of O)for(const ke of Le.allPhases)for(const Ve of ke.allTasks)fe.set(Ve.id,Bb({feature:Le.feature,phase:ke.phase,task:Ve}));return fe},[L,T.text,O]),{matchedTaskIds:Y,matchedFeatureIds:Q,matchedPhaseIds:K}=v.useMemo(()=>{const fe=new Set,Le=new Set,ke=new Set;if(!L)return{matchedTaskIds:fe,matchedFeatureIds:Le,matchedPhaseIds:ke};for(const Ve of O)for(const nt of Ve.allPhases)for(const mt of nt.allTasks)_2(T,{feature:Ve.feature,phase:nt.phase,task:mt},X==null?void 0:X.get(mt.id))&&(fe.add(mt.id),Le.add(Ve.feature.id),ke.add(nt.phase.id));return{matchedTaskIds:fe,matchedFeatureIds:Le,matchedPhaseIds:ke}},[L,T,O,X]),[W,U]=v.useState(()=>{if(typeof window>"u")return!0;const fe=window.localStorage.getItem(i);return fe===null?!0:fe==="true"}),[j,oe]=v.useState(()=>{if(typeof window>"u")return"all";const fe=window.localStorage.getItem(u);return fe==="smart"||fe==="none"||fe==="all"?fe:"all"}),[me,ye]=v.useState(()=>{if(typeof window>"u")return[];try{const fe=window.localStorage.getItem(o);return fe?JSON.parse(fe):[]}catch{return[]}}),[Re,ee]=v.useState(()=>{if(typeof window>"u")return[];try{const fe=window.localStorage.getItem(f);return fe?JSON.parse(fe):[]}catch{return[]}}),[be,Ee]=v.useState(()=>fh(m,su,su)),[z,B]=v.useState(()=>fh(p,iu,iu)),[ie,de]=v.useState(()=>fh(g,uu,uu)),[pe,D]=v.useState(()=>mh(x,!1)),[q,ne]=v.useState(()=>mh(b,!1)),[ce,Te]=v.useState(()=>mh(E,!1)),[Ne,Ue]=v.useState([]),[it,Ge]=v.useState([]),[tt,pn]=v.useState([]),Rt=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(i,String(W))},[W,i]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,j)},[j,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(o,JSON.stringify(me))},[me,o]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(Re))},[Re,f]),v.useEffect(()=>{typeof window>"u"||hh(m,be,su)},[be,m]),v.useEffect(()=>{typeof window>"u"||hh(p,z,iu)},[z,p]),v.useEffect(()=>{typeof window>"u"||hh(g,ie,uu)},[ie,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(pe))},[pe,x]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(b,String(q))},[q,b]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(E,String(ce))},[ce,E]),v.useEffect(()=>()=>{Object.values(Rt.current).forEach(fe=>window.clearTimeout(fe)),Rt.current={}},[]);const ut=v.useMemo(()=>{let fe=[...be];return pe&&(fe=fe.filter(Le=>Le!=="done")),q&&(fe=fe.filter(Le=>Le!=="planned")),fe},[be,pe,q]),se=v.useMemo(()=>{let fe=[...z];return pe&&(fe=fe.filter(Le=>Le!=="done")),q&&(fe=fe.filter(Le=>Le!=="planned"&&Le!=="draft")),fe},[z,pe,q]),Ye=v.useMemo(()=>{let fe=[...ie];return pe&&(fe=fe.filter(Le=>Le!=="done")),q&&(fe=fe.filter(Le=>Le!=="planned")),fe},[ie,pe,q]),Ie=v.useMemo(()=>{if(L)return O.map(ke=>({...ke,allPhases:ke.allPhases.map(Ve=>({...Ve,allTasks:Ve.allTasks.filter(nt=>Y.has(nt.id))})).filter(Ve=>Ve.allTasks.length>0)})).filter(ke=>ke.allPhases.length>0);const fe=!W||ce;return(W?O:O.filter(ke=>ke.isActive)).filter(({feature:ke})=>dh(ke.status,ut)).map(ke=>({...ke,allPhases:ke.allPhases.filter(({phase:Ve,hasActiveTask:nt})=>dh(Ve.status,se)?fe?Ve.status==="in-progress"||Ve.status==="discovery"||nt:!0:!1).map(Ve=>({...Ve,allTasks:Ve.allTasks.filter(nt=>!!dh(nt.status,Ye))})).filter(Ve=>Ve.allTasks.length>0||W||!fe)})).filter(({hasActiveTask:ke,allPhases:Ve})=>fe?ke||Ve.some(nt=>nt.hasActiveTask):Ve.length>0||W)},[L,Y,O,ut,se,Ye,ce,W]);v.useEffect(()=>{if(j==="none"){ye([]),ee([]);return}if(j==="all"){ye(Ie.filter(({feature:ke})=>ke.status!=="done").map(({feature:ke})=>ke.id)),ee(Ie.flatMap(({allPhases:ke})=>ke.map(({phase:Ve})=>Ve.id)));return}const fe=new Set(Ie.map(({feature:ke})=>ke.id)),Le=new Set(Ie.flatMap(({allPhases:ke})=>ke.map(({phase:Ve})=>Ve.id)));ye(ke=>ke.filter(Ve=>fe.has(Ve))),ee(ke=>ke.filter(Ve=>Le.has(Ve)))},[Ie,j]),v.useEffect(()=>{L&&(oe("smart"),ye(Array.from(Q)),ee(Array.from(K)))},[L,Q,K]);const It=fe=>{oe("smart"),ye(Le=>Le.includes(fe)?Le.filter(ke=>ke!==fe):[...Le,fe])},Dn=fe=>{oe("smart"),ee(Le=>Le.includes(fe)?Le.filter(ke=>ke!==fe):[...Le,fe])},dn=()=>{oe("smart"),ye(Ie.map(({feature:fe})=>fe.id)),ee(Ie.flatMap(({allPhases:fe})=>fe.map(({phase:Le})=>Le.id)))};return v.useEffect(()=>{const fe=(ke,Ve)=>{const nt=Ve.filter(mt=>!!mt);for(const mt of nt){const Gt=`${ke}:${mt}`,an=ke==="feature"?Ue:ke==="phase"?Ge:pn;an(Hn=>Hn.includes(mt)?Hn:[...Hn,mt]),Rt.current[Gt]!==void 0&&window.clearTimeout(Rt.current[Gt]),Rt.current[Gt]=window.setTimeout(()=>{an(Hn=>Hn.filter(sn=>sn!==mt)),delete Rt.current[Gt]},ON)}},Le=ke=>{var mt,Gt,an,Hn,sn,re;const nt=ke.detail;if(nt!=null&&nt.type){if(nt.type==="features-updated"){const St=((mt=nt.data)==null?void 0:mt.featureId)??((Gt=nt.data)==null?void 0:Gt.id);fe("feature",[St]),St&&(oe("smart"),ye(Mt=>Mt.includes(St)?Mt:[...Mt,St]));return}if(nt.type==="phases-updated"){const St=(an=nt.data)==null?void 0:an.featureId,Mt=((Hn=nt.data)==null?void 0:Hn.phaseId)??((sn=nt.data)==null?void 0:sn.id);fe("phase",[Mt]),fe("feature",[St]),fe("task",[(re=nt.data)==null?void 0:re.taskId]),oe("smart"),St&&ye(Jn=>Jn.includes(St)?Jn:[...Jn,St]),Mt&&ee(Jn=>Jn.includes(Mt)?Jn:[...Jn,Mt])}}};return window.addEventListener("agent-plan:ws-event",Le),()=>{window.removeEventListener("agent-plan:ws-event",Le)}},[]),{workTree:O,displayedWorkTree:Ie,treeOpenMode:j,setTreeOpenMode:oe,expandAll:dn,expandedFeatureIds:me,expandedPhaseIds:Re,setExpandedFeatureIds:ye,setExpandedPhaseIds:ee,toggleExpandedFeature:It,toggleExpandedPhase:Dn,recentFeatureIds:Ne,recentPhaseIds:it,recentTaskIds:tt,setRecentTaskIds:pn,showAllFeatures:W,setShowAllFeatures:U,featureStatusFilters:be,phaseStatusFilters:z,taskStatusFilters:ie,hideDone:pe,setHideDone:D,hidePlanned:q,setHidePlanned:ne,onlyActiveBranches:ce,setOnlyActiveBranches:Te,resetFilters:()=>{U(!0),D(!1),ne(!1),Ee(su),B(iu),de(uu),Te(!1),oe("all")},toggleFeatureStatusFilter:fe=>Ee(Le=>ch(Le,fe,su)),togglePhaseStatusFilter:fe=>B(Le=>ch(Le,fe,iu)),toggleTaskStatusFilter:fe=>de(Le=>ch(Le,fe,uu)),searchQuery:S,setSearchQuery:N,searchActive:L,matchedTaskIds:Y,matchedFeatureIds:Q,matchedPhaseIds:K}}const $b=v.createContext(null);function dm({id:t,children:a}){const r=D2({id:t}),i={transform:Or.Transform.toString(r.transform),transition:r.transition};return d.jsx($b.Provider,{value:r,children:d.jsx("div",{ref:r.setNodeRef,style:i,className:r.isDragging?"ap-sortable--dragging":"",children:a})})}function fm(){const t=v.useContext($b);return t?d.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...t.listeners,...t.attributes,children:d.jsx(TE,{className:"h-4 w-4"})}):null}const hm="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function z2(){return d.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"})}function ai({status:t,doneTasks:a,totalTasks:r,recentlyChanged:i,className:u}){const o=a!=null&&r!=null;return d.jsxs("div",{className:u,children:[i?d.jsx(z2,{}):null,o?d.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",r||0,")"]}):null,d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:t})})]})}function U2({entry:t,expanded:a,recentlyChanged:r,onToggle:i,isPhaseExpanded:u,onTogglePhase:o,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:m,highlightedTaskIds:p}){const{feature:g,totalTasks:x,doneTasks:b,allPhases:E,hasActiveTask:S}=t;return d.jsxs("div",{className:`surface-card min-w-0 px-3 py-3 transition-colors sm:px-4 ${S?"ap-in-progress":""} ${g.status==="done"?"!opacity-70 !bg-[color:color-mix(in_srgb,var(--color-status-done)_10%,transparent)] !border-[color:color-mix(in_srgb,var(--color-status-done)_35%,transparent)]":""} ${r?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[d.jsxs("div",{className:`flex min-w-0 flex-col gap-1.5 rounded-[12px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${r?"bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]":""}`,children:[d.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[d.jsx("button",{type:"button",onClick:i,className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":a?`Collapse feature ${g.name}`:`Expand feature ${g.name}`,"aria-expanded":a,children:d.jsx(tb,{className:`h-4 w-4 transition ${a?"rotate-90":"rotate-0"}`})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(fm,{}),d.jsx(_r,{id:ri({featureNum:g.number}),children:d.jsx(Wl,{featureNum:g.number})}),g.shortId?d.jsx(si,{shortId:g.shortId}):null,S?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ai,{status:g.status,doneTasks:b,totalTasks:x,recentlyChanged:r,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(bt,{to:`/features/${g.id}`,className:`entity-link--feature ${hm} underline-offset-4 hover:underline`,children:g.name})]})]}),d.jsx(ai,{status:g.status,doneTasks:b,totalTasks:x,recentlyChanged:r,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&E.length>0?d.jsx("div",{className:"mt-2 ml-1.5 grid grid-cols-1 gap-2 border-l border-[var(--border)] pl-3 sm:ml-4 sm:pl-4",children:d.jsx(cm,{items:E.map(N=>N.phase.id),strategy:om,children:E.map(N=>d.jsx(dm,{id:N.phase.id,children:d.jsx(H2,{feature:g,phaseEntry:N,expanded:u(N.phase.id),recentlyChanged:f(N.phase.id),onToggle:()=>o(N.phase.id),isTaskRecentlyChanged:m,highlightedTaskIds:p})},N.phase.id))})}):null]})}function H2({feature:t,phaseEntry:a,expanded:r,recentlyChanged:i,onToggle:u,isTaskRecentlyChanged:o,highlightedTaskIds:f}){const{phase:m,totalTasks:p,doneTasks:g,allTasks:x,hasActiveTask:b}=a;return d.jsxs("div",{className:`work-tree-row grid min-w-0 grid-cols-1 gap-2 rounded-[12px] p-3 transition-colors ${b?"ap-in-progress":""} ${m.status==="done"?"opacity-70 bg-[color:color-mix(in_srgb,var(--color-status-done)_6%,transparent)]":""} ${i?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[d.jsxs("div",{className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${i?"bg-[color:color-mix(in_srgb,var(--accent)_8%,transparent)]":""}`,children:[d.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[d.jsx("button",{type:"button",onClick:u,className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":r?`Collapse phase ${m.title}`:`Expand phase ${m.title}`,"aria-expanded":r,children:d.jsx(tb,{className:`h-4 w-4 transition ${r?"rotate-90":"rotate-0"}`})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(fm,{}),d.jsx(_r,{id:ri({featureNum:t==null?void 0:t.number,phaseNum:m.number}),children:d.jsx(Wl,{featureNum:t==null?void 0:t.number,phaseNum:m.number})}),m.shortId?d.jsx(si,{shortId:m.shortId}):null,m.handoff?d.jsx(tm,{phaseId:m.id,updatedAt:m.handoffUpdatedAt}):null,b?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ai,{status:m.status,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(bt,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${hm} underline-offset-4 hover:underline`,children:m.title})]})]}),d.jsx(ai,{status:m.status,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),r?x.length>0?d.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l border-[var(--border)] pl-3 sm:ml-4 sm:pl-4",children:d.jsx(cm,{items:x.map(E=>E.id),strategy:om,children:x.map(E=>d.jsx(dm,{id:E.id,children:d.jsx(B2,{feature:t,phase:m,task:E,recentlyChanged:o(E.id),highlighted:f==null?void 0:f.has(E.id)})},E.id))})}):d.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function B2({feature:t,phase:a,task:r,recentlyChanged:i,highlighted:u}){return d.jsxs("div",{id:`task-row-${r.number}`,className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${r.status==="in-progress"?"ap-in-progress":""} ${r.status==="done"?"opacity-60 bg-[color:color-mix(in_srgb,var(--color-status-done)_6%,transparent)] text-[var(--text-muted)]":""} ${i?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""} ${u?"ap-search-hit":""}`,children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(fm,{}),d.jsx(_r,{id:ri({featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:r.number}),children:d.jsx(Wl,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:r.number})}),r.shortId?d.jsx(si,{shortId:r.shortId}):null,r.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ai,{status:r.status,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(bt,{to:`/features/${t.id}/phases/${a.id}/tasks/${r.id}`,className:`entity-link--task ${hm} underline-offset-4 hover:underline`,children:r.title})]}),d.jsx(ai,{status:r.status,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]})}var M=(function(t){return t.FIELD_NAME="FIELD_NAME",t.COLON="COLON",t.VALUE="VALUE",t.QUOTED_VALUE="QUOTED_VALUE",t.AND="AND",t.OR="OR",t.NOT="NOT",t.COMPARISON_OP="COMPARISON_OP",t.LPAREN="LPAREN",t.RPAREN="RPAREN",t.SAVED_SEARCH="SAVED_SEARCH",t.HISTORY_REF="HISTORY_REF",t.PREFIX_OP="PREFIX_OP",t.WILDCARD="WILDCARD",t.REGEX="REGEX",t.RANGE="RANGE",t.TILDE="TILDE",t.BOOST="BOOST",t.WHITESPACE="WHITESPACE",t.UNKNOWN="UNKNOWN",t})({}),ia=(function(t){return t[t.EXPECT_TERM=0]="EXPECT_TERM",t[t.EXPECT_VALUE=1]="EXPECT_VALUE",t})(ia||{}),Ks=class{constructor(t,a){mn(this,"input");mn(this,"pos");mn(this,"state");mn(this,"tokens");mn(this,"options");this.input=t,this.pos=0,this.state=ia.EXPECT_TERM,this.tokens=[],this.options=a||{}}tokenize(){for(this.tokens=[],this.pos=0,this.state=ia.EXPECT_TERM;this.pos<this.input.length;)this.state===ia.EXPECT_VALUE?this.readValue():this.readTerm();return this.tokens}peek(){return this.input[this.pos]}peekAt(t){return this.input[this.pos+t]}advance(){return this.input[this.pos++]}isWhitespace(t){return t===" "||t===" "||t===`
|
|
198
|
+
`||t==="\r"}isAlpha(t){return/[a-zA-Z_]/.test(t)}isAlphaNumeric(t){return/[a-zA-Z0-9_.\-]/.test(t)}readWhitespace(){const t=this.pos;for(;this.pos<this.input.length&&this.isWhitespace(this.peek());)this.advance();this.tokens.push({type:M.WHITESPACE,value:this.input.slice(t,this.pos),start:t,end:this.pos})}readQuotedString(){const t=this.pos,a=this.advance();for(;this.pos<this.input.length;){const r=this.advance();if(r==="\\"&&this.pos<this.input.length)this.advance();else if(r===a)break}this.tokens.push({type:M.QUOTED_VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=ia.EXPECT_TERM}readTerm(){const t=this.peek();if(this.isWhitespace(t)){this.readWhitespace();return}if(t==='"'){this.readQuotedString();return}if(t==="("){this.tokens.push({type:M.LPAREN,value:"(",start:this.pos,end:this.pos+1}),this.advance();return}if(t===")"){this.tokens.push({type:M.RPAREN,value:")",start:this.pos,end:this.pos+1}),this.advance();return}if(t==="~"||t==="^"){const r=this.pos,i=t==="~"?M.TILDE:M.BOOST;for(this.advance();this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:i,value:this.input.slice(r,this.pos),start:r,end:this.pos});return}if(t==="["||t==="{"){this.readRangeValue();return}if(t==="#"&&this.options.savedSearches){this.readSavedSearch();return}if(t==="!"&&this.options.historySearch){this.readHistoryRef();return}if(t==="-"||t==="+"){const r=this.peekAt(1);if(r&&(this.isAlpha(r)||r==='"'||r==="("||r==="#"||r==="!"||r==="["||r==="{")||!r||r===")"||r===" "||r===" "||r===`
|
|
199
|
+
`||r==="\r"){this.tokens.push({type:M.PREFIX_OP,value:t,start:this.pos,end:this.pos+1}),this.advance();return}}if(t==="&"&&this.peekAt(1)==="&"){this.tokens.push({type:M.AND,value:"&&",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if(t==="|"&&this.peekAt(1)==="|"){this.tokens.push({type:M.OR,value:"||",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if((t===">"||t==="<")&&this.state===ia.EXPECT_TERM){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:M.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos}),this.state=ia.EXPECT_VALUE;return}if(t==="/"){this.readRegex();return}const a=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!=="("&&this.peek()!==")"&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^"&&!(this.peek()==="&"&&this.peekAt(1)==="&")&&!(this.peek()==="|"&&this.peekAt(1)==="|");){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(this.peek()===":"){this.pos>a&&this.tokens.push({type:M.FIELD_NAME,value:this.input.slice(a,this.pos),start:a,end:this.pos}),this.tokens.push({type:M.COLON,value:":",start:this.pos,end:this.pos+1}),this.advance(),this.state=ia.EXPECT_VALUE;return}this.advance()}if(this.pos>a){const r=this.input.slice(a,this.pos),i=r.toUpperCase();i==="AND"?this.tokens.push({type:M.AND,value:r,start:a,end:this.pos}):i==="OR"?this.tokens.push({type:M.OR,value:r,start:a,end:this.pos}):i==="NOT"?this.tokens.push({type:M.NOT,value:r,start:a,end:this.pos}):r.includes("*")||r.includes("?")?this.tokens.push({type:M.WILDCARD,value:r,start:a,end:this.pos}):this.tokens.push({type:M.VALUE,value:r,start:a,end:this.pos}),this.tryReadModifier()}}readValue(){const t=this.peek();if(this.isWhitespace(t)){this.readWhitespace(),this.state=ia.EXPECT_TERM;return}if(t==='"'){this.readQuotedString(),this.state=ia.EXPECT_TERM;return}if(t==="("||t===")"){this.state=ia.EXPECT_TERM,this.readTerm();return}if(t===">"||t==="<"){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:M.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos});return}if(t==="["||t==="{"){this.readRangeValue();return}if(t==="/"){this.readRegex(),this.state=ia.EXPECT_TERM;return}const a=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!==")"&&this.peek()!=="("&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^";){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}this.advance()}if(this.pos>a){const r=this.input.slice(a,this.pos);r.includes("*")||r.includes("?")?this.tokens.push({type:M.WILDCARD,value:r,start:a,end:this.pos}):this.tokens.push({type:M.VALUE,value:r,start:a,end:this.pos}),this.tryReadModifier()}this.state=ia.EXPECT_TERM}readRangeValue(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.peek()!=="]"&&this.peek()!=="}";)this.advance();this.pos<this.input.length&&(this.peek()==="]"||this.peek()==="}")&&this.advance(),this.tokens.push({type:M.RANGE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.state=ia.EXPECT_TERM}tryReadModifier(){for(;this.pos<this.input.length&&(this.peek()==="~"||this.peek()==="^");){const t=this.pos,a=this.advance()==="~"?M.TILDE:M.BOOST;for(;this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:a,value:this.input.slice(t,this.pos),start:t,end:this.pos})}}readRegex(){const t=this.pos;for(this.advance();this.pos<this.input.length;){const a=this.peek();if(a==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(a==="/"){this.advance(),this.tokens.push({type:M.REGEX,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=ia.EXPECT_TERM;return}this.advance()}this.tokens.push({type:M.VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.state=ia.EXPECT_TERM}readSavedSearch(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:M.SAVED_SEARCH,value:this.input.slice(t,this.pos),start:t,end:this.pos})}readHistoryRef(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:M.HISTORY_REF,value:this.input.slice(t,this.pos),start:t,end:this.pos})}},rs=class{constructor(t){mn(this,"tokens");mn(this,"pos");mn(this,"nonWsTokens");mn(this,"errors",[]);this.tokens=t,this.nonWsTokens=t.filter(a=>a.type!==M.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(t){if(t.type!==M.QUOTED_VALUE)return!1;const a=t.value;if(a.length<2)return!0;const r=a[0];return a[a.length-1]!==r}stripQuotes(t){const a=t.value;return this.isUnclosedQuote(t)?a.slice(1):a.slice(1,-1)}checkUnclosedQuote(t){this.isUnclosedQuote(t)&&this.errors.push({type:"Error",value:t.value[0],message:"Missing closing quote",start:t.start,end:t.start+1})}parse(){if(this.nonWsTokens.length===0)return null;let t=this.parseOr();for(;this.peek();){const a=this.peek();if(a.type===M.RPAREN)this.advance(),this.errors.push({type:"Error",value:a.value,message:"Unexpected closing parenthesis",start:a.start,end:a.end});else{const r=this.parseOr();t={type:"BooleanExpr",operator:"AND",left:t,right:r,implicit:!0,start:t.start,end:r.end}}}return t}peek(){return this.nonWsTokens[this.pos]}advance(){return this.nonWsTokens[this.pos++]}match(t){var a;if(((a=this.peek())==null?void 0:a.type)===t)return this.advance()}parseOr(){var a;let t=this.parseAnd();for(;((a=this.peek())==null?void 0:a.type)===M.OR;){const r=this.advance(),i=this.parseAnd();if(i.type==="Error"&&i.value===""){this.errors.push({type:"Error",value:r.value,message:"Missing search term after OR",start:r.start,end:r.end});break}t={type:"BooleanExpr",operator:"OR",left:t,right:i,sourceOperator:r.value,start:t.start,end:i.end}}return t}parseAnd(){let t=this.parseNot();for(;;){const a=this.peek();if(!a)break;if(a.type===M.AND){const r=this.advance(),i=this.parseNot();if(i.type==="Error"&&i.value===""){this.errors.push({type:"Error",value:r.value,message:"Missing search term after AND",start:r.start,end:r.end});break}t={type:"BooleanExpr",operator:"AND",left:t,right:i,sourceOperator:r.value,start:t.start,end:i.end}}else{if(a.type===M.OR||a.type===M.RPAREN)break;{const r=this.parseNot();t={type:"BooleanExpr",operator:"AND",left:t,right:r,implicit:!0,start:t.start,end:r.end}}}}return t}parseNot(){var t;if(((t=this.peek())==null?void 0:t.type)===M.NOT){const a=this.advance(),r=this.parsePrimary();return r.type==="Error"&&r.value===""?(this.errors.push({type:"Error",value:a.value,message:"Missing search term after NOT",start:a.start,end:a.end}),r):{type:"Not",expression:r,sourceOperator:a.value,start:a.start,end:r.end}}return this.parsePrimary()}applyGroupBoost(t){var a;if(((a=this.peek())==null?void 0:a.type)===M.BOOST){const r=this.advance(),i=r.value.slice(1),u=parseFloat(i);t.boost=isNaN(u)?1:u,t.end=r.end}return t}applyModifiers(t){var a,r;if(t.type!=="BareTerm"&&t.type!=="FieldValue")return t;if(((a=this.peek())==null?void 0:a.type)===M.TILDE){const i=this.advance(),u=i.value.slice(1),o=parseInt(u,10);t.quoted?t.proximity=isNaN(o)?0:o:t.fuzzy=isNaN(o)?0:o,t.end=i.end}if(((r=this.peek())==null?void 0:r.type)===M.BOOST){const i=this.advance(),u=i.value.slice(1),o=parseFloat(u);t.boost=isNaN(o)?1:o,t.end=i.end}return t}parseRangeBound(t,a){const r=t.length-t.trimStart().length,i=t.trim();return i.startsWith('"')&&i.endsWith('"')&&i.length>=2?{value:i.slice(1,-1),quoted:!0,valueStart:a+r,valueEnd:a+r+i.length}:i.startsWith('"')?{value:i.slice(1),quoted:!0,valueStart:a+r,valueEnd:a+r+i.length}:{value:i,quoted:!1,valueStart:a+r,valueEnd:a+r+i.length}}parseRange(t){const a=t.value,r=a[0],i=r==="[",u=a[a.length-1],o=u==="]"||u==="}",f=u==="]";o||this.errors.push({type:"Error",value:r,message:"Unclosed range expression",start:t.start,end:t.start+1});const m=o?a.slice(1,-1):a.slice(1),p=m.match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/),g=t.start+1;if(!p){this.errors.push({type:"Error",value:a,message:"Range expression missing TO keyword",start:t.start,end:t.end});const S=this.parseRangeBound(m,g);return{type:"Range",lower:S.value,upper:"",lowerInclusive:i,upperInclusive:o?f:!0,lowerQuoted:S.quoted,upperQuoted:!1,lowerStart:S.valueStart,lowerEnd:S.valueEnd,upperStart:t.end,upperEnd:t.end,start:t.start,end:t.end}}const x=this.parseRangeBound(p[1],g),b=g+p[1].length+(m.length-p[1].length-p[2].length),E=this.parseRangeBound(p[2],b);return{type:"Range",lower:x.value,upper:E.value,lowerInclusive:i,upperInclusive:o?f:!0,lowerQuoted:x.quoted,upperQuoted:E.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:E.valueStart,upperEnd:E.valueEnd,start:t.start,end:t.end}}parsePrimary(){var r,i,u;const t=this.peek();if(!t)return{type:"Error",value:"",message:"Unexpected end of input",start:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0,end:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0};if(t.type===M.AND){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected AND",start:o.start,end:o.end}),this.parsePrimary()}if(t.type===M.OR){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected OR",start:o.start,end:o.end}),this.parsePrimary()}if(t.type===M.PREFIX_OP){const o=this.advance(),f=this.parsePrimary();return o.value==="-"?{type:"Not",expression:f,sourceOperator:o.value,start:o.start,end:f.end}:{...f,start:o.start}}if(t.type===M.LPAREN){const o=this.advance();if(!this.peek()||this.peek().type===M.RPAREN){const g=this.match(M.RPAREN);g||this.errors.push({type:"Error",value:o.value,message:"Unclosed parenthesis",start:o.start,end:o.end});const x={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:o.end,end:o.end},start:o.start,end:g?g.end:o.end};return this.applyGroupBoost(x)}const f=this.parseOr(),m=this.match(M.RPAREN);m||this.errors.push({type:"Error",value:o.value,message:"Missing closing parenthesis",start:o.start,end:o.end});const p={type:"Group",expression:f,start:o.start,end:m?m.end:f.end};return this.applyGroupBoost(p)}if(t.type===M.SAVED_SEARCH){const o=this.advance();return{type:"SavedSearch",name:o.value.slice(1),start:o.start,end:o.end}}if(t.type===M.HISTORY_REF){const o=this.advance();return{type:"HistoryRef",ref:o.value.slice(1),start:o.start,end:o.end}}if(t.type===M.FIELD_NAME){const o=this.advance(),f=this.match(M.COLON);if(f){let m=":";const p=this.match(M.COMPARISON_OP);if(p&&(m=p.value),((r=this.peek())==null?void 0:r.type)===M.LPAREN){const x=this.advance();if(!this.peek()||this.peek().type===M.RPAREN){const N=this.match(M.RPAREN);N||this.errors.push({type:"Error",value:x.value,message:"Unclosed parenthesis",start:x.start,end:x.end});const O={type:"FieldGroup",field:o.value,expression:{type:"BareTerm",value:"",quoted:!1,start:x.end,end:x.end},start:o.start,end:N?N.end:x.end};return this.applyGroupBoost(O)}const b=this.parseOr(),E=this.match(M.RPAREN);E||this.errors.push({type:"Error",value:x.value,message:"Missing closing parenthesis",start:x.start,end:x.end});const S={type:"FieldGroup",field:o.value,expression:b,start:o.start,end:E?E.end:b.end};return this.applyGroupBoost(S)}if(((i=this.peek())==null?void 0:i.type)===M.RANGE){const x=this.advance(),b=this.parseRange(x);return b.field=o.value,b.start=o.start,b}if(((u=this.peek())==null?void 0:u.type)===M.REGEX){const x=this.advance();return{type:"Regex",pattern:x.value.slice(1,-1),start:o.start,end:x.end}}const g=this.peek();if(g&&(g.type===M.VALUE||g.type===M.QUOTED_VALUE||g.type===M.WILDCARD)){const x=this.advance(),b=x.type===M.QUOTED_VALUE;b&&this.checkUnclosedQuote(x);const E=b?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:o.value,operator:m,value:E,quoted:b,start:o.start,end:x.end})}return{type:"FieldValue",field:o.value,operator:m,value:"",quoted:!1,start:o.start,end:p?p.end:f.end}}return{type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end}}if(t.type===M.COMPARISON_OP){const o=this.advance(),f=this.peek();if(f&&(f.type===M.VALUE||f.type===M.QUOTED_VALUE)){const m=this.advance();return{type:"BareTerm",value:o.value+m.value,quoted:!1,start:o.start,end:m.end}}return{type:"Error",value:o.value,message:"Comparison operator without value",start:o.start,end:o.end}}if(t.type===M.QUOTED_VALUE){const o=this.advance();return this.checkUnclosedQuote(o),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(o),quoted:!0,start:o.start,end:o.end})}if(t.type===M.WILDCARD){const o=this.advance();return this.applyModifiers({type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end})}if(t.type===M.RANGE){const o=this.advance();return this.parseRange(o)}if(t.type===M.REGEX){const o=this.advance();return{type:"Regex",pattern:o.value.slice(1,-1),start:o.start,end:o.end}}if(t.type===M.VALUE){const o=this.advance();return this.applyModifiers({type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end})}if(t.type===M.RPAREN){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected closing parenthesis",start:o.start,end:o.end}),{type:"Error",value:o.value,message:"Unexpected closing parenthesis",start:o.start,end:o.end}}const a=this.advance();return{type:"Error",value:a.value,message:`Unexpected token: ${a.value}`,start:a.start,end:a.end}}static getCursorContext(t,a){let r,i;for(const o of t)if(o.type!==M.WHITESPACE){if(a>=o.start&&a<=o.end){r=o;break}o.end<=a&&(i=o)}const u=o=>{let f=0;for(let m=o;m>=0;m--){const p=t[m];if(p.type!==M.WHITESPACE){if(p.type===M.RPAREN){f++;continue}if(p.type===M.LPAREN){if(f>0){f--;continue}for(let g=m-1;g>=0;g--)if(t[g].type!==M.WHITESPACE){if(t[g].type===M.COLON){for(let x=g-1;x>=0;x--)if(t[x].type!==M.WHITESPACE){if(t[x].type===M.FIELD_NAME)return t[x].value;break}}break}}}}return""};if((r==null?void 0:r.type)===M.COLON){let o="";const f=t.indexOf(r);for(let m=f-1;m>=0;m--){if(t[m].type===M.FIELD_NAME){o=t[m].value;break}if(t[m].type!==M.WHITESPACE)break}if(!o&&a===r.start)return{type:"FIELD_NAME",partial:"",token:r};if(a===r.end){for(let m=f+1;m<t.length;m++)if(t[m].type!==M.WHITESPACE){if(t[m].type===M.VALUE||t[m].type===M.QUOTED_VALUE||t[m].type===M.WILDCARD||t[m].type===M.RANGE)return{type:"FIELD_VALUE",partial:t[m].type===M.QUOTED_VALUE?t[m].value.slice(1,t[m].value.endsWith('"')||t[m].value.endsWith("'")?-1:void 0):t[m].value,fieldName:o,token:t[m]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}}if((r==null?void 0:r.type)===M.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===M.HISTORY_REF)return{type:"HISTORY_REF",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===M.RANGE){const o=t.indexOf(r);let f="";for(let m=o-1;m>=0;m--){if(t[m].type===M.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===M.WHITESPACE||t[m].type===M.COLON))break}return{type:"RANGE",partial:"",fieldName:f,token:r}}if((i==null?void 0:i.type)===M.COLON||(i==null?void 0:i.type)===M.COMPARISON_OP){const o=t.indexOf(i);let f="";for(let m=o-1;m>=0;m--){if(t[m].type===M.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===M.WHITESPACE||t[m].type===M.COLON||t[m].type===M.COMPARISON_OP))break}return r&&(r.type===M.VALUE||r.type===M.QUOTED_VALUE||r.type===M.WILDCARD)?{type:"FIELD_VALUE",partial:r.type===M.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:f,token:r}:{type:"FIELD_VALUE",partial:"",fieldName:f,token:i}}if((r==null?void 0:r.type)===M.VALUE||(r==null?void 0:r.type)===M.QUOTED_VALUE||(r==null?void 0:r.type)===M.WILDCARD){const o=t.indexOf(r);for(let f=o-1;f>=0;f--)if(t[f].type!==M.WHITESPACE){if(t[f].type===M.COLON||t[f].type===M.COMPARISON_OP){let m="";for(let p=f-1;p>=0;p--){if(t[p].type===M.FIELD_NAME){m=t[p].value;break}if(!(t[p].type===M.WHITESPACE||t[p].type===M.COLON||t[p].type===M.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:r.type===M.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:m,token:r}}break}}if((r==null?void 0:r.type)===M.QUOTED_VALUE)return{type:"FIELD_NAME",partial:r.value,token:r};if((r==null?void 0:r.type)===M.FIELD_NAME||(r==null?void 0:r.type)===M.VALUE){const o=u(t.indexOf(r));return o?{type:"FIELD_VALUE",partial:r.value,fieldName:o,token:r}:{type:"FIELD_NAME",partial:r.value,token:r}}if((i==null?void 0:i.type)===M.PREFIX_OP){const o=u(t.indexOf(i));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(i&&(i.type===M.AND||i.type===M.OR||i.type===M.NOT)){const o=u(t.indexOf(i));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(t.length===0||t.every(o=>o.type===M.WHITESPACE))return{type:"EMPTY",partial:""};if((r==null?void 0:r.type)===M.LPAREN||(i==null?void 0:i.type)===M.LPAREN){const o=(r==null?void 0:r.type)===M.LPAREN?r:i,f=u(t.indexOf(o));return f?{type:"FIELD_VALUE",partial:"",fieldName:f,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if((r==null?void 0:r.type)===M.TILDE||(r==null?void 0:r.type)===M.BOOST)return{type:"OPERATOR",partial:""};if(i&&(i.type===M.VALUE||i.type===M.QUOTED_VALUE||i.type===M.RPAREN||i.type===M.RANGE||i.type===M.TILDE||i.type===M.BOOST)){const o=u(t.indexOf(i));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function kh(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const r=kh(t.left,a);if(r)return r;const i=kh(t.right,a);return i||null}return t}function $2(t,a,r){if(!t)return null;const i=kh(t,r);if(!i)return null;let u=i.start,o=i.end;const f=a.slice(o).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(f)return o+=f[0].length,{start:u,end:o};const m=a.slice(0,u).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return m&&m.index!==void 0&&m.index>0&&(u-=m[0].length),{start:u,end:o}}var q2={fieldName:"#0550ae",fieldValue:"#1a7f37",operator:"#cf222e",booleanOp:"#8250df",quoted:"#0a3069",paren:"#656d76",savedSearch:"#bf8700",historyRef:"#6639ba",wildcard:"#953800",error:"#cf222e",background:"#ffffff",text:"#1f2328",placeholder:"#656d76",cursor:"#1f2328",dropdownSelected:"#0969da",dropdownHover:"#f6f8fa",regexDelimiter:"#cf222e",regexCharClass:"#0550ae",regexGroup:"#656d76",regexEscape:"#953800",regexQuantifier:"#8250df",regexAnchor:"#cf222e",regexAlternation:"#8250df",regexText:"#0a3069",matchedParenBg:"#fff3cd",warning:"#d4a72c",valueTypes:{}},Y2={fontFamily:"'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace",fontSize:"14px",lineHeight:"1.5",inputMinHeight:"40px",inputPadding:"8px 12px",inputBorderWidth:"2px",inputBorderColor:"#d0d7de",inputBorderRadius:"8px",inputFocusBorderColor:"#0969da",inputFocusShadow:"0 0 0 3px rgba(9, 105, 218, 0.3)",dropdownBorderColor:"#d0d7de",dropdownBorderRadius:"8px",dropdownShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",dropdownMaxHeight:"300px",dropdownMinWidth:"200px",dropdownMaxWidth:"400px",dropdownZIndex:99999,dropdownItemPadding:"6px 12px",dropdownItemFontSize:"13px",dropdownItemContentGap:"8px",typeBadgeBg:"#eef1f5",typeBadgeSelectedBg:"rgba(255,255,255,0.2)",typeBadgeColor:"#656d76",typeBadgeSelectedColor:"#ffffff"},V2=["AND","OR","NOT"];function Zy(t){return t.replace(/\r\n/g,`
|
|
200
|
+
`).replace(/\r/g,`
|
|
201
|
+
`).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036\u00AB\u00BB]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/[\u00A0\u202F\u2007]/g," ").replace(/[\uFF01-\uFF5E]/g,a=>String.fromCharCode(a.charCodeAt(0)-65248))}var Jy={"(":")","[":"]",'"':'"',"'":"'"};function F2(t,a,r,i,u){const o=t.slice(0,a),f=t.slice(a,r),m=t.slice(r);return{newValue:o+i+f+u+m,newCursorPos:r+2,newSelStart:a+1,newSelEnd:r+1}}function I2(t){if(!t.textContent)return"";const a=[];function r(i){var u;if(i.nodeType===Node.TEXT_NODE)a.push(i.textContent||"");else if(i.nodeName==="BR")(u=i.hasAttribute)!=null&&u.call(i,"data-sentinel")||a.push(`
|
|
202
|
+
`);else for(let o=0;o<i.childNodes.length;o++)r(i.childNodes[o])}return r(t),a.join("")}function Wy(t,a,r){let i=-1,u=-1;for(let o=0;o<t.length;o++){const f=t[o];a>=f.start&&a<=f.end&&(i=o),u===-1&&r>=f.start&&r<=f.end&&(u=o)}return[i,u]}function G2(t,a,r){if(t){let i=t.end;if(t.type===M.FIELD_NAME&&r){const u=r.indexOf(t);if(u>=0){for(let o=u+1;o<r.length;o++)if(r[o].type!==M.WHITESPACE){r[o].type===M.COLON&&(i=r[o].end);break}}}return{start:t.start,end:i}}return{start:a,end:a}}var gh=class qb{constructor(a,r=[],i=[],u=10,o={}){mn(this,"fields");mn(this,"fieldMap");mn(this,"savedSearches");mn(this,"searchHistory");mn(this,"maxSuggestions");mn(this,"options");mn(this,"defaultFieldName");mn(this,"defaultFieldShowFieldSuggs",!1);this.fields=a,this.fieldMap=new Map(a.map(f=>[f.name,f]));for(const f of a)if(f.aliases)for(const m of f.aliases)this.fieldMap.set(m,f);this.savedSearches=r,this.searchHistory=i,this.maxSuggestions=u,this.options={showSavedSearchHint:o.showSavedSearchHint??!1,showHistoryHint:o.showHistoryHint??!1}}resolveField(a){return this.fieldMap.get(a)}updateSavedSearches(a){this.savedSearches=a}updateSearchHistory(a){this.searchHistory=a}setDefaultField(a){this.defaultFieldName=a==null?void 0:a.name,this.defaultFieldShowFieldSuggs=(a==null?void 0:a.showFieldSuggestions)??!1}getSuggestions(a,r){let i=rs.getCursorContext(a,r);const u=G2(i.token,r,a);if(this.defaultFieldName&&(i.type==="FIELD_NAME"||i.type==="EMPTY")){i={...i,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const o=this.resolveField(this.defaultFieldName);if((o==null?void 0:o.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:i};const f=this.getValueSuggestions(o,i.partial,u.start,u.end);if(this.defaultFieldShowFieldSuggs){const m=this.getFieldSuggestions(i.partial,u.start,u.end);return{suggestions:[...f,...m],showDatePicker:!1,context:i}}return{suggestions:f,showDatePicker:!1,context:i}}switch(i.type){case"FIELD_NAME":case"EMPTY":{const o=this.getFieldSuggestions(i.partial,u.start,u.end),f=!i.partial&&o.length>0?this.getSpecialHints(u.start,u.end):[];return{suggestions:this.sortByPriority([...o,...f]),showDatePicker:!1,context:i}}case"FIELD_VALUE":{const o=i.fieldName?this.resolveField(i.fieldName):void 0;return(o==null?void 0:o.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:i}:{suggestions:this.getValueSuggestions(o,i.partial,u.start,u.end),showDatePicker:!1,context:i}}case"OPERATOR":{const o=this.getOperatorSuggestions(i.partial,u.start,u.end),f=this.getFieldSuggestions("",u.start,u.end),m=this.getSpecialHints(u.start,u.end);return{suggestions:this.sortByPriority([...o,...f,...m]),showDatePicker:!1,context:i}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(i.partial,u.start,u.end),showDatePicker:!1,context:i};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(i.partial,u.start,u.end),showDatePicker:!1,context:i};case"RANGE":{const o=i.fieldName?this.resolveField(i.fieldName):void 0;return(o==null?void 0:o.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:i}:{suggestions:[],showDatePicker:!1,context:i}}default:return{suggestions:[],showDatePicker:!1,context:i}}}getFieldSuggestions(a,r,i){const u=a.toLowerCase();return this.fields.filter(o=>!o.hide).map(o=>{const f=o.name.toLowerCase(),m=(o.label||"").toLowerCase(),p=(o.aliases||[]).map(x=>x.toLowerCase());let g=0;return f.startsWith(u)?g=4:m.startsWith(u)||p.some(x=>x.startsWith(u))?g=3:f.includes(u)?g=2:(m.includes(u)||p.some(x=>x.includes(u)))&&(g=1),{field:o,score:g}}).filter(o=>o.score>0).sort((o,f)=>f.score-o.score).slice(0,this.maxSuggestions).map(o=>({text:o.field.name+":",label:o.field.label||o.field.name,description:o.field.description,type:o.field.type,replaceStart:r,replaceEnd:i,matchPartial:a,priority:10}))}getValueSuggestions(a,r,i,u){if(!a)return[];if(a.type==="boolean")return["true","false"].filter(o=>o.startsWith(r.toLowerCase())).map(o=>({text:o,label:o,type:"boolean",replaceStart:i,replaceEnd:u,matchPartial:r}));if(a.placeholder!==!1){const o=a.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[a.type];if(o)return[{text:"",label:o,type:"hint",replaceStart:i,replaceEnd:u}]}return[]}getOperatorSuggestions(a,r,i){const u=a.toLowerCase();return V2.filter(o=>o.toLowerCase().startsWith(u)).map(o=>({text:o+" ",label:o,description:o==="AND"?"Both conditions must match":o==="OR"?"Either condition must match":"Negate the following condition",type:"operator",replaceStart:r,replaceEnd:i,matchPartial:a,priority:30}))}sortByPriority(a){return a.sort((r,i)=>(i.priority??0)-(r.priority??0))}getSpecialHints(a,r){const i=[],u=this.savedSearches.length>0||this.options.hasSavedSearchProvider,o=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&u&&i.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:a,replaceEnd:r,priority:20}),this.options.showHistoryHint&&o&&i.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:a,replaceEnd:r,priority:20}),i}getSavedSearchSuggestions(a,r,i){return this.savedSearches.slice(0,this.maxSuggestions).map(u=>({text:u.query,label:u.label||u.query,description:u.description,type:"savedSearch",replaceStart:r,replaceEnd:i,matchPartial:a,sourceData:u}))}getHistorySuggestions(a,r,i){return this.searchHistory.slice(0,this.maxSuggestions).map(u=>({text:qb.wrapHistoryQuery(u.query),label:u.label||u.query,description:u.description,type:"history",replaceStart:r,replaceEnd:i,matchPartial:a,sourceData:u}))}static wrapHistoryQuery(a){try{const r=new rs(new Ks(a).tokenize()).parse();if(r&&r.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function ac(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var X2=[/^\d{4}-\d{2}-\d{2}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^now$/i,/^now[+-]\d+[dhms]$/i];function P2(t){for(const a of X2)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function vh(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function Q2(t){if(/^now$/i.test(t))return new Date;const a=t.match(/^now([+-])(\d+)([dhms])$/i);if(a){const u=new Date,o=a[1]==="+"?1:-1,f=parseInt(a[2],10);switch(a[3].toLowerCase()){case"d":u.setDate(u.getDate()+o*f);break;case"h":u.setHours(u.getHours()+o*f);break;case"m":u.setMinutes(u.getMinutes()+o*f);break;case"s":u.setSeconds(u.getSeconds()+o*f);break}return u}const r=t.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/);if(r)return new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10));const i=new Date(t);return isNaN(i.getTime())?null:i}function ex(t,a){return new Date(t,a+1,0).getDate()}function K2(t,a){return new Date(t,a,1).getDay()}function ou(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function tx(t,a,r){if(!a||!r)return!1;const i=t.getTime(),u=a.getTime(),o=r.getTime();return i>=Math.min(u,o)&&i<=Math.max(u,o)}var Z2=["January","February","March","April","May","June","July","August","September","October","November","December"];function J2(t){return Z2[t]}function lc(t,a){if(t==="")return null;const r=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(r){const i=yh(r[1].trim(),a);if(i)return`Range start: ${i}`;const u=yh(r[2].trim(),a);return u?`Range end: ${u}`:null}return yh(t,a)}function yh(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||P2(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function rc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var sc={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function ic(t){if(t.length<=1)return t;const a=[...t].sort((i,u)=>{const o=sc[i.type??"SYNTAX_ERROR"],f=sc[u.type??"SYNTAX_ERROR"];return o!==f?o-f:i.start-u.start}),r=[];for(const i of a)r.some(u=>sc[u.type??"SYNTAX_ERROR"]<sc[i.type??"SYNTAX_ERROR"]&&u.start<=i.start&&u.end>=i.end)||r.push(i);return r}var nx=class{constructor(t){mn(this,"fields");this.fields=new Map(t.map(a=>[a.name,a]));for(const a of t)if(a.aliases)for(const r of a.aliases)this.fields.set(r,a)}validate(t,a,r,i){if(!t)return[];const u=[],o=i?this.fields.get(i):void 0;return this.walkNode(t,u,a,r,o),this.checkAmbiguousPrecedence(t,u),u}walkNode(t,a,r,i,u){switch(t.type){case"BareTerm":if(t.fuzzy!==void 0&&t.fuzzy>2&&a.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${t.fuzzy})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),t.proximity!==void 0&&t.proximity<0&&a.push({message:`Proximity value must be non-negative (got ${t.proximity})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),u&&t.value!==""){let o=null;switch(u.type){case"number":o=ac(t.value);break;case"date":o=lc(t.value,i);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(o=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(o=`"${t.value}" is not a valid IP address`);break}o&&a.push({message:o,start:t.start,end:t.end,field:u.name,type:"INVALID_VALUE"})}if(r&&t.value!==""){const o=rc(r({value:t.value,position:"bare_term",quoted:t.quoted,fieldName:u==null?void 0:u.name,fieldConfig:u}));o&&a.push({message:o.message,start:t.start,end:t.end,severity:o.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(t,a),t.field&&t.field!=="*"){const o=this.fields.get(t.field);o?this.validateRangeBounds(o,t,a,r,i):a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"})}break;case"FieldValue":{if(t.field==="*")return;if(t.value===""){const m=t.operator===":"?":":t.operator;a.push({message:`Missing value after "${t.field}${m}"`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});return}const o=this.fields.get(t.field);if(!o){a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"});return}t.fuzzy!==void 0&&t.fuzzy>2&&a.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${t.fuzzy})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"}),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});let f=null;switch(o.type){case"number":f=ac(t.value);break;case"date":f=lc(t.value,i);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(f=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(f=`"${t.value}" is not a valid IP address`);break}if(t.operator!==":"&&o.type!=="number"&&o.type!=="date"&&(f=`Comparison operator "${t.operator}" is not valid for ${o.type} fields`),!f&&r){const m=rc(r({value:t.value,position:"field_value",fieldName:o.name,fieldConfig:o,quoted:t.quoted,operator:t.operator!==":"?t.operator:void 0}));if(m){const p=t.end-t.value.length;a.push({message:m.message,start:p,end:t.end,field:t.field,severity:m.severity,type:"CUSTOM"})}}if(f){const m=t.end-t.value.length,p=t.operator!==":"&&o.type!=="number"&&o.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";a.push({message:f,start:m,end:t.end,field:t.field,type:p})}break}case"FieldGroup":if(t.field==="*")this.walkNode(t.expression,a,r,i,u);else{const o=this.fields.get(t.field);o?this.walkFieldGroup(t.expression,o,a,r,i):a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"})}t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break;case"BooleanExpr":this.walkNode(t.left,a,r,i,u),this.walkNode(t.right,a,r,i,u);break;case"Group":this.walkNode(t.expression,a,r,i,u),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break;case"Not":this.walkNode(t.expression,a,r,i,u);break;case"Error":a.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,a,r,i,u){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(a,t.value,t.quoted,":",t.start,t.end,r,i,u);break;case"FieldValue":this.walkNode(t,r,i,u);break;case"Range":this.validateRangeBounds(a,t,r,i,u);break;case"BooleanExpr":this.walkFieldGroup(t.left,a,r,i,u),this.walkFieldGroup(t.right,a,r,i,u);break;case"Group":this.walkFieldGroup(t.expression,a,r,i,u);break;case"Not":this.walkFieldGroup(t.expression,a,r,i,u);break;default:this.walkNode(t,r,i,u);break}}validateFieldValue(t,a,r,i,u,o,f,m,p){let g=null;switch(t.type){case"number":g=ac(a);break;case"date":g=lc(a,p);break;case"boolean":a!=="true"&&a!=="false"&&(g=`Expected "true" or "false", got "${a}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(a)&&!a.includes("*")&&(g=`"${a}" is not a valid IP address`);break}if(i!==":"&&t.type!=="number"&&t.type!=="date"&&(g=`Comparison operator "${i}" is not valid for ${t.type} fields`),!g&&m){const x=rc(m({value:a,position:"field_group_term",fieldName:t.name,fieldConfig:t,quoted:r,operator:i!==":"?i:void 0}));x&&f.push({message:x.message,start:u,end:o,field:t.name,severity:x.severity,type:"CUSTOM"})}if(g){const x=i!==":"&&t.type!=="number"&&t.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";f.push({message:g,start:u,end:o,field:t.name,type:x})}}validateEmptyRangeBounds(t,a){t.lower!=="*"&&t.lower.trim()===""&&a.push({message:"Missing lower bound in range",start:t.start,end:t.start+1,field:t.field,type:"SYNTAX_ERROR"}),t.upper!=="*"&&t.upper.trim()===""&&a.push({message:"Missing upper bound in range",start:t.end-1,end:t.end,field:t.field,type:"SYNTAX_ERROR"})}validateRangeBounds(t,a,r,i,u){const o=[];a.lower!=="*"&&a.lower.trim()!==""&&o.push({value:a.lower,label:"Range start",start:a.lowerStart,end:a.lowerEnd,position:"range_start",inclusive:a.lowerInclusive}),a.upper!=="*"&&a.upper.trim()!==""&&o.push({value:a.upper,label:"Range end",start:a.upperStart,end:a.upperEnd,position:"range_end",inclusive:a.upperInclusive});for(const f of o){let m=null;switch(t.type){case"number":m=ac(f.value),m&&(m=`${f.label}: ${m}`);break;case"date":m=lc(f.value,u),m&&(m=`${f.label}: ${m}`);break;case"boolean":m="Range queries are not supported for boolean fields";break}if(!m&&i){const p=rc(i({value:f.value,position:f.position,fieldName:t.name,fieldConfig:t,quoted:!1,inclusive:f.inclusive}));p&&r.push({message:p.message,start:f.start,end:f.end,field:t.name,severity:p.severity,type:"CUSTOM"})}if(m){const p=t.type==="boolean"?"SYNTAX_ERROR":"INVALID_VALUE";r.push({message:m,start:f.start,end:f.end,field:t.name,type:p})}}}checkAmbiguousPrecedence(t,a){const r=new Set;this.findAndFlagAmbiguity(t,a,r)}findAndFlagAmbiguity(t,a,r){if(t.type==="BooleanExpr"&&!r.has(t)){const i=new Set,u=[];this.collectBoolOps(t,i,u),i.size>1&&(a.push({message:"Ambiguous precedence: mix of AND and OR without parentheses. Add parentheses to clarify.",start:t.start,end:t.end,severity:"warning",type:"AMBIGUOUS_PRECEDENCE"}),u.forEach(o=>r.add(o))),this.collectLeaves(t).forEach(o=>this.findAndFlagAmbiguity(o,a,r))}else t.type==="Group"||t.type==="FieldGroup"?this.findAndFlagAmbiguity(t.expression,a,r):t.type==="Not"?this.findAndFlagAmbiguity(t.expression,a,r):t.type==="BooleanExpr"&&this.collectLeaves(t).forEach(i=>this.findAndFlagAmbiguity(i,a,r))}collectBoolOps(t,a,r){t.type==="BooleanExpr"&&(a.add(t.operator),r.push(t),this.collectBoolOps(t.left,a,r),this.collectBoolOps(t.right,a,r))}collectLeaves(t){return t.type!=="BooleanExpr"?[t]:[...this.collectLeaves(t.left),...this.collectLeaves(t.right)]}};function Ma(...t){return t.filter(Boolean).join(" ")}function Hu(t){return{...q2,...t}}function Bu(t){return{...Y2,...t}}function W2(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function eT(t,a){return{flex:1,minHeight:a.inputMinHeight,padding:a.inputPadding,borderWidth:a.inputBorderWidth,borderStyle:"solid",borderColor:a.inputBorderColor,borderRadius:a.inputBorderRadius,outline:"none",fontSize:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,backgroundColor:t.background,color:t.text,caretColor:t.cursor,whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",overflow:"auto",cursor:"text"}}function tT(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function nT(t,a){const r=a.inputPadding.split(/\s+/),i=r[0]||"8px";return{position:"absolute",top:i,left:r.length>=4?r[3]:r.length>=2?r[1]:i,right:r.length>=4||r.length>=2?r[1]:i,color:t.placeholder,pointerEvents:"none",fontSize:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,userSelect:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}function Yb(t,a){return{position:"absolute",zIndex:a.dropdownZIndex,backgroundColor:t.background,border:`1px solid ${a.dropdownBorderColor}`,borderRadius:a.dropdownBorderRadius,boxShadow:a.dropdownShadow,maxHeight:a.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:a.dropdownMinWidth,maxWidth:a.dropdownMaxWidth,padding:"4px 0"}}function ax(t,a,r){return{padding:r.dropdownItemPadding,cursor:"pointer",fontSize:r.dropdownItemFontSize,fontFamily:r.fontFamily,backgroundColor:t?a.dropdownSelected:"transparent",color:t?"#ffffff":a.text,display:"flex",alignItems:"center",gap:r.dropdownItemContentGap,lineHeight:"1.4"}}function Vs(t){return{flex:1,fontWeight:500}}function xh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function aT(t,a){return{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:t?a.typeBadgeSelectedBg:a.typeBadgeBg,color:t?a.typeBadgeSelectedColor:a.typeBadgeColor,flexShrink:0}}function lT(t,a){return{container:{padding:"12px",backgroundColor:t.background,minWidth:"280px",fontFamily:a.fontFamily},header:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},navButton:{backgroundColor:"transparent",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:t.text,borderRadius:"4px"},monthLabel:{fontWeight:600,fontSize:a.fontSize,color:t.text},weekDays:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},weekDay:{textAlign:"center",fontSize:"11px",color:t.placeholder,padding:"4px",fontWeight:600},days:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},day:{textAlign:"center",padding:"6px",cursor:"pointer",fontSize:a.dropdownItemFontSize,borderRadius:"4px",color:t.text,border:"none",backgroundColor:"transparent"},dayHover:{backgroundColor:t.dropdownHover},daySelected:{backgroundColor:t.dropdownSelected,color:"#ffffff"},dayInRange:{backgroundColor:"rgba(9, 105, 218, 0.1)"},dayOtherMonth:{opacity:.45},dayToday:{fontWeight:700,textDecoration:"underline"},rangeToggle:{display:"flex",gap:"4px",marginBottom:"8px",padding:"2px",backgroundColor:a.typeBadgeBg,borderRadius:"6px"},rangeToggleButton:{flex:1,padding:"4px 8px",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:500,backgroundColor:"transparent",color:t.text},rangeToggleButtonActive:{backgroundColor:t.background,boxShadow:"0 1px 2px rgba(0,0,0,0.1)"},quickOptions:{borderTop:`1px solid ${a.dropdownBorderColor}`,marginTop:"8px",paddingTop:"8px"},quickOption:{display:"block",width:"100%",textAlign:"left",padding:"4px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"12px",color:t.dropdownSelected,borderRadius:"4px"}}}var rT={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function sT(t){const a=[];let r=0,i="";function u(){i&&(a.push({type:"text",text:i}),i="")}t.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),r=1);const o=t.lastIndexOf("/"),f=o>0?o:t.length;for(;r<f;){const m=t[r];if(m==="\\"&&r+1<f){u(),a.push({type:"escape",text:t.slice(r,r+2)}),r+=2;continue}if(m==="["){u();let p=r+1;for(p<f&&t[p]==="^"&&p++,p<f&&t[p]==="]"&&p++;p<f&&t[p]!=="]";)t[p]==="\\"&&p+1<f&&p++,p++;p<f&&p++,a.push({type:"charClass",text:t.slice(r,p)}),r=p;continue}if(m==="("){u();let p="(";if(r+1<f&&t[r+1]==="?"){let g=r+2;for(;g<f&&g<r+4&&/[:<>=!]/.test(t[g]);)g++;p=t.slice(r,g)}a.push({type:"groupOpen",text:p}),r+=p.length;continue}if(m===")"){u(),a.push({type:"groupClose",text:")"}),r++;continue}if(m==="+"||m==="*"||m==="?"){u();let p=m;r+1<f&&t[r+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),r+=p.length;continue}if(m==="{"){u();let p=r+1;for(;p<f&&t[p]!=="}";)p++;p<f&&p++,a.push({type:"quantifier",text:t.slice(r,p)}),r=p;continue}if(m==="^"||m==="$"){u(),a.push({type:"anchor",text:m}),r++;continue}if(m==="|"){u(),a.push({type:"alternation",text:"|"}),r++;continue}i+=m,r++}return u(),o>0&&o<t.length&&a.push({type:"delimiter",text:"/"}),a}function iT(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function uT(t,a,r){const i=sT(t.value).map(u=>{const o=a[rT[u.type]]||a.regexText,f=u.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${u.type}" style="color:${o};font-weight:${f}">${iT(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--regex${r?" "+r:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${i}</span>`}var oT={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function cT(t){const a=[];let r=0;r<t.length&&(t[r]==="["||t[r]==="{")&&(a.push({type:"bracket",text:t[r]}),r++);const i=t.length-1,u=i>=0&&(t[i]==="]"||t[i]==="}"),o=u?i:t.length;for(;r<o;){const f=t[r];if(f===" "||f===" "){let p=r;for(;p<o&&(t[p]===" "||t[p]===" ");)p++;a.push({type:"whitespace",text:t.slice(r,p)}),r=p;continue}if((f==="T"||f==="t")&&r+1<o&&(t[r+1]==="O"||t[r+1]==="o")){const p=r===0||t[r-1]===" "||t[r-1]===" "||t[r-1]==="["||t[r-1]==="{",g=r+2>=o||t[r+2]===" "||t[r+2]===" ";if(p&&g){a.push({type:"toKeyword",text:t.slice(r,r+2)}),r+=2;continue}}if(f==='"'){let p=r+1;for(;p<o&&t[p]!=='"';)t[p]==="\\"&&p+1<o&&p++,p++;p<o&&p++,a.push({type:"quotedValue",text:t.slice(r,p)}),r=p;continue}if(f==="*"){a.push({type:"wildcard",text:"*"}),r++;continue}let m=r;for(;m<o&&t[m]!==" "&&t[m]!==" "&&t[m]!=='"';)m++;if(m>r){const p=t.slice(r,m);a.push({type:"bareValue",text:p}),r=m}else a.push({type:"bareValue",text:f}),r++}return u&&a.push({type:"bracket",text:t[i]}),a}function lx(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function dT(t,a,r){const i=cT(t.value).map(u=>{if(u.type==="whitespace")return lx(u.text);const o=a[oT[u.type]]||a.fieldValue,f=u.type==="toKeyword"||u.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${u.type}" style="color:${o};font-weight:${f}">${lx(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--range${r?" "+r:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${i}</span>`}function Vb(t,a){if(a<0)return null;const r=t.filter(o=>o.type===M.LPAREN||o.type===M.RPAREN);if(r.length===0)return null;const i=r.find(o=>o.end===a);if(i){const o=rx(r,i);if(o)return o}const u=r.find(o=>o.start===a);if(u){const o=rx(r,u);if(o)return o}return null}function rx(t,a){if(a.type===M.LPAREN){const r=t.indexOf(a);let i=0;for(let u=r;u<t.length;u++)if(t[u].type===M.LPAREN?i++:t[u].type===M.RPAREN&&i--,i===0)return{openStart:a.start,closeStart:t[u].start}}else{const r=t.indexOf(a);let i=0;for(let u=r;u>=0;u--)if(t[u].type===M.RPAREN?i++:t[u].type===M.LPAREN&&i--,i===0)return{openStart:t[u].start,closeStart:a.start}}return null}var fT={[M.FIELD_NAME]:"field-name",[M.COLON]:"colon",[M.VALUE]:"value",[M.QUOTED_VALUE]:"quoted-value",[M.AND]:"and",[M.OR]:"or",[M.NOT]:"not",[M.COMPARISON_OP]:"comparison-op",[M.LPAREN]:"lparen",[M.RPAREN]:"rparen",[M.SAVED_SEARCH]:"saved-search",[M.HISTORY_REF]:"history-ref",[M.PREFIX_OP]:"prefix-op",[M.WILDCARD]:"wildcard",[M.REGEX]:"regex",[M.RANGE]:"range",[M.TILDE]:"tilde",[M.BOOST]:"boost",[M.WHITESPACE]:"whitespace",[M.UNKNOWN]:"unknown"},hT={[M.FIELD_NAME]:"fieldName",[M.COLON]:"operator",[M.VALUE]:"fieldValue",[M.QUOTED_VALUE]:"quoted",[M.AND]:"booleanOp",[M.OR]:"booleanOp",[M.NOT]:"booleanOp",[M.COMPARISON_OP]:"operator",[M.LPAREN]:"paren",[M.RPAREN]:"paren",[M.SAVED_SEARCH]:"savedSearch",[M.HISTORY_REF]:"historyRef",[M.PREFIX_OP]:"operator",[M.WILDCARD]:"wildcard",[M.REGEX]:"quoted",[M.RANGE]:"fieldValue",[M.TILDE]:"operator",[M.BOOST]:"operator",[M.WHITESPACE]:"text",[M.UNKNOWN]:"error"};function Fs(t,a,r){const i=Hu(a);if(t.length===0)return"";const u=(r==null?void 0:r.cursorOffset)!==void 0?Vb(t,r.cursorOffset):null,o=a==null?void 0:a.valueTypes,f=r==null?void 0:r.fieldTypeMap;let m;if(o&&f){m=new Array(t.length);let g,x=!1;const b=[];for(let E=0;E<t.length;E++){const S=t[E];S.type===M.FIELD_NAME?(g=S.value,x=!1):S.type===M.COLON&&g?x=!0:S.type===M.WHITESPACE||(S.type===M.LPAREN?(x&&g?b.push(f.get(g.toLowerCase())):b.push(void 0),g=void 0,x=!1):S.type===M.RPAREN?(b.pop(),g=void 0,x=!1):S.type===M.VALUE||S.type===M.QUOTED_VALUE||S.type===M.RANGE||S.type===M.REGEX||S.type===M.WILDCARD?(x&&g?m[E]=f.get(g.toLowerCase()):b.length>0&&(m[E]=b[b.length-1]),g=void 0,x=!1):(S.type===M.AND||S.type===M.OR||(S.type,M.NOT),g=void 0,x=!1))}}let p=t.map((g,x)=>{let b=i[hT[g.type]||"text"]||i.text;if(o&&m){const O=m[x];O&&o[O]&&(b=o[O])}const E=mT(g.value);if(g.type===M.WHITESPACE)return E.replace(/\n/g,"<br>");if(g.type===M.REGEX)return uT(g,i,r==null?void 0:r.tokenClassName);if(g.type===M.RANGE)return dT(g,i,r==null?void 0:r.tokenClassName);let S="normal";(g.type===M.AND||g.type===M.OR||g.type===M.NOT)&&(S="600"),g.type===M.FIELD_NAME&&(S="500");let N="";return u&&(g.type===M.LPAREN||g.type===M.RPAREN)&&(g.start===u.openStart||g.start===u.closeStart)&&(S="700",N=`background-color:${i.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${fT[g.type]}${r!=null&&r.tokenClassName?" "+r.tokenClassName:""}`}" style="color:${b};font-weight:${S};${N}" data-token-start="${g.start}" data-token-end="${g.end}">${E}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function mT(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}if(typeof document<"u"){const t="elastic-input-keyframes";if(!document.getElementById(t)){const a=document.createElement("style");a.id=t,a.textContent="@keyframes elastic-input-spin { to { transform: rotate(360deg); } }",document.head.appendChild(a)}}function sx(t,a,r){if(!a||a.length===0)return t;const i=t.toLowerCase(),u=a.toLowerCase(),o=i.indexOf(u);if(o===-1)return t;const f=t.slice(0,o),m=t.slice(o,o+a.length),p=t.slice(o+a.length),g={fontWeight:700,textDecoration:"underline",textDecorationColor:r?"rgba(255,255,255,0.6)":"#0969da",textUnderlineOffset:"2px"};return v.createElement(v.Fragment,null,f,v.createElement("span",{className:"ei-highlight-match",style:g},m),p)}function pT({suggestions:t,selectedIndex:a,onSelect:r,position:i,colors:u,styles:o,visible:f,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:b,listRefCallback:E,renderType:S,classNames:N}){const O=v.useRef(null),T=v.useRef(null);v.useEffect(()=>{const U=document.createElement("div");return document.body.appendChild(U),O.current=U,()=>{document.body.removeChild(U),O.current=null}},[]);const L=x&&b?x(b):null,X=L!=null;if(v.useEffect(()=>{if(T.current){const U=X?a+1:a,j=T.current.children[U];j&&j.scrollIntoView({block:"nearest"})}},[a,X]),!O.current||!f||t.length===0||!i)return null;const Y=Hu(u),Q=Bu(o),K={...Yb(Y,Q),top:`${i.top}px`,left:`${i.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},W=v.createElement("div",{className:Ma("ei-dropdown",N==null?void 0:N.dropdown),style:K,ref:U=>{T.current=U,E==null||E(U)},onMouseDown:U=>U.preventDefault()},X&&v.createElement("div",{className:Ma("ei-dropdown-header",N==null?void 0:N.dropdownHeader),style:{padding:Q.dropdownItemPadding||"4px 10px",fontSize:"11px",color:Y.placeholder,borderBottom:`1px solid ${Y.dropdownHover}`,userSelect:"none"}},L),t.map((U,j)=>{const oe=j===a,me=ax(oe,Y,Q),ye=(z,B,ie)=>({key:j,className:Ma("ei-dropdown-item",z,oe&&"ei-dropdown-item--selected",N==null?void 0:N.dropdownItem),style:{...me,...B},title:ie,onClick:()=>r(U),onMouseEnter:de=>{de.currentTarget.style.backgroundColor=oe?Y.dropdownSelected:Y.dropdownHover},onMouseLeave:de=>{de.currentTarget.style.backgroundColor=oe?Y.dropdownSelected:"transparent"}}),Re=z=>{if(S===!1||!U.type||U.type==="hint")return null;const B=typeof S=="function"?S(U.type,{text:U.text,label:U.label,description:U.description,type:U.type}):U.type;return B!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...aT(oe,Q),...z}},B):null},ee={flexDirection:"column",alignItems:"flex-start"},be={display:"flex",alignItems:"center",gap:Q.dropdownItemContentGap,width:"100%"};if(U.type==="hint"&&(U.text==="#"||U.text==="!"))return v.createElement("div",{...ye("ei-dropdown-item--hint",{opacity:oe?1:.7}),onMouseEnter:z=>{z.currentTarget.style.backgroundColor=oe?Y.dropdownSelected:Y.dropdownHover,z.currentTarget.style.opacity="1"},onMouseLeave:z=>{z.currentTarget.style.backgroundColor=oe?Y.dropdownSelected:"transparent",z.currentTarget.style.opacity=oe?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:Vs()},U.label),U.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:xh()},U.description));if(U.type==="error")return v.createElement("div",{key:j,className:Ma("ei-dropdown-item","ei-dropdown-item--error",N==null?void 0:N.dropdownItem),style:{...me,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...Vs(),color:Y.error}},U.label||"Error loading suggestions"));if(U.type==="noResults")return v.createElement("div",{key:j,className:Ma("ei-dropdown-item","ei-dropdown-item--no-results",N==null?void 0:N.dropdownItem),style:{...me,cursor:"default",opacity:.7}},U.customContent);if(U.type==="loading")return v.createElement("div",{key:j,className:Ma("ei-dropdown-item","ei-dropdown-item--loading",N==null?void 0:N.dropdownItem),style:{...me,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...Vs(),fontStyle:"italic"}},U.label||"Searching..."),v.createElement("span",{className:"ei-dropdown-spinner",style:{marginLeft:"6px",display:"inline-block",animation:"elastic-input-spin 1s linear infinite",width:"14px",height:"14px",border:"2px solid",borderColor:`${Y.placeholder} transparent ${Y.placeholder} transparent`,borderRadius:"50%"}}));if(U.type==="hint"){const z=ax(!1,Y,Q);return v.createElement("div",{key:j,className:Ma("ei-dropdown-item","ei-dropdown-item--hint",N==null?void 0:N.dropdownItem),style:{...z,cursor:"default",opacity:U.customContent?1:.6}},U.customContent?U.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:Vs()},U.label))}if(U.type==="history"&&p&&U.sourceData){const z=p(U.sourceData,oe);if(z!=null)return v.createElement("div",ye("ei-dropdown-item--history",ee),z)}if(U.type==="savedSearch"&&g&&U.sourceData){const z=g(U.sourceData,oe);if(z!=null)return v.createElement("div",ye("ei-dropdown-item--saved-search"),z)}if((U.type==="history"||U.type==="savedSearch")&&U.description!=null){const z=U.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let B;const ie=U.text.startsWith("(")&&U.text.endsWith(")")?U.text.slice(1,-1):U.text;return U.label!==ie&&(B=U.text),v.createElement("div",ye(z,ee,B),v.createElement("span",{className:"ei-dropdown-item-label",style:{...Vs(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},sx(U.label,U.matchPartial,oe)),v.createElement("span",{style:be},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...xh(),flex:1}},U.description),Re({marginLeft:"auto"})))}const Ee=U.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",ye(Ee),v.createElement("span",{className:"ei-dropdown-item-label",style:Vs()},sx(U.label,U.matchPartial,oe)),U.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:xh()},U.description),Re())}));return Jl.createPortal(W,O.current)}var gT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function bh(t){return Math.floor(t/10)*10}function vT({onSelect:t,colors:a,styles:r,initialMode:i,initialStart:u,initialEnd:o,presets:f,className:m}){const p=i==="range"&&o?o:u??new Date,[g,x]=v.useState(i??"single"),[b,E]=v.useState("days"),[S,N]=v.useState(p.getFullYear()),[O,T]=v.useState(p.getMonth()),[L,X]=v.useState(u??null),[Y,Q]=v.useState(o??null),[K,W]=v.useState(null),U=Hu(a),j=lT(U,Bu(r)),oe=()=>{b==="days"?O===0?(T(11),N(se=>se-1)):T(se=>se-1):N(b==="months"?se=>se-1:se=>se-10)},me=()=>{b==="days"?O===11?(T(0),N(se=>se+1)):T(se=>se+1):N(b==="months"?se=>se+1:se=>se+10)},ye=()=>{N(b==="days"?se=>se-1:b==="months"?se=>se-10:se=>se-100)},Re=()=>{N(b==="days"?se=>se+1:b==="months"?se=>se+10:se=>se+100)},ee=()=>{b==="days"?E("months"):b==="months"&&E("years")},be=se=>{T(se),E("days")},Ee=se=>{N(se),E("months")},z=se=>{if(g==="single"){t(vh(se));return}if(!L||Y)X(se),Q(null),W(null);else{const[Ye,Ie]=L<=se?[L,se]:[se,L];X(Ye),Q(Ie),W(null),t(`[${vh(Ye)} TO ${vh(Ie)}]`)}},B=L&&!Y?K:Y,ie=se=>{x(se),X(null),Q(null),W(null)},de=b==="days"?`${J2(O)} ${S}`:b==="months"?`${S}`:`${bh(S)}–${bh(S)+9}`,pe=b!=="years",D=new Date,q=ex(S,O),ne=K2(S,O),ce=["Su","Mo","Tu","We","Th","Fr","Sa"],Te=[],Ne=(se,Ye,Ie)=>{const It=ou(se,D),Dn=L&&ou(se,L),dn=B&&ou(se,B),Lt=tx(se,L,B),Jt=Dn||dn,Yn={...j.day,...Ie?j.dayOtherMonth:{},...It?j.dayToday:{},...Lt?j.dayInRange:{},...Jt?j.daySelected:{}},Vn=g==="range"&&L&&!Y;return v.createElement("button",{key:Ye,className:"ei-datepicker-day",style:Yn,onClick:()=>z(se),onMouseEnter:fe=>{Vn?W(se):Jt||(fe.currentTarget.style.backgroundColor=U.dropdownHover)},onMouseLeave:fe=>{!Vn&&!Jt&&(fe.currentTarget.style.backgroundColor=Lt?"rgba(9, 105, 218, 0.1)":"transparent")}},se.getDate())};if(ne>0){const se=ex(S,O-1);for(let Ye=ne-1;Ye>=0;Ye--){const Ie=se-Ye,It=new Date(S,O-1,Ie);Te.push(Ne(It,`prev${Ie}`,!0))}}for(let se=1;se<=q;se++){const Ye=new Date(S,O,se);Te.push(Ne(Ye,String(se),!1))}const Ue=Te.length%7;if(Ue>0){const se=7-Ue;for(let Ye=1;Ye<=se;Ye++){const Ie=new Date(S,O+1,Ye);Te.push(Ne(Ie,`next${Ye}`,!0))}}const it={...j.day,padding:"10px 4px",fontSize:"13px"},Ge={...it,...j.dayToday},tt=f??[{label:"Today",value:"[now/d TO now]",type:"range"},{label:"Yesterday",value:"[now-1d/d TO now/d]",type:"range"},{label:"Last 7 days",value:"[now-7d TO now]",type:"range"},{label:"Last 30 days",value:"[now-30d TO now]",type:"range"},{label:"Last 90 days",value:"[now-90d TO now]",type:"range"},{label:"Last 1 year",value:"[now-365d TO now]",type:"range"}],pn={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Rt=se=>{se.currentTarget.style.backgroundColor="#eef1f5"},ut=se=>{se.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:Ma("ei-datepicker",m),style:j.container,onMouseDown:se=>se.preventDefault(),onMouseLeave:()=>W(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:j.rangeToggle},["single","range"].map(se=>v.createElement("button",{key:se,style:{...j.rangeToggleButton,...g===se?j.rangeToggleButtonActive:{}},onClick:()=>ie(se)},se.charAt(0).toUpperCase()+se.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:j.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:j.navButton,onClick:ye,onMouseEnter:Rt,onMouseLeave:ut},"«"),v.createElement("button",{style:j.navButton,onClick:oe,onMouseEnter:Rt,onMouseLeave:ut},"‹")),v.createElement("button",{style:{...j.monthLabel,backgroundColor:"transparent",border:"none",cursor:pe?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:pe?ee:void 0,onMouseEnter:se=>{pe&&(se.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:se=>{se.currentTarget.style.backgroundColor="transparent"}},de),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:j.navButton,onClick:me,onMouseEnter:Rt,onMouseLeave:ut},"›"),v.createElement("button",{style:j.navButton,onClick:Re,onMouseEnter:Rt,onMouseLeave:ut},"»"))),b==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:j.weekDays},ce.map(se=>v.createElement("div",{key:se,style:j.weekDay},se))),v.createElement("div",{className:"ei-datepicker-days",style:j.days},Te)),b==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},gT.map((se,Ye)=>{const Ie=new Date(S,Ye,1),It=tx(Ie,L,B),Dn=L&&ou(new Date(L.getFullYear(),L.getMonth(),1),Ie)||B&&ou(new Date(B.getFullYear(),B.getMonth(),1),Ie),dn=Ye===D.getMonth()&&S===D.getFullYear(),Lt=g==="range"&&L&&!Y;return v.createElement("button",{key:se,style:{...dn?Ge:it,...It?j.dayInRange:{},...Dn?j.daySelected:{}},onClick:()=>be(Ye),onMouseEnter:Jt=>{Lt?W(Ie):Dn||(Jt.currentTarget.style.backgroundColor=U.dropdownHover)},onMouseLeave:Jt=>{!Lt&&!Dn&&(Jt.currentTarget.style.backgroundColor=It?"rgba(9, 105, 218, 0.1)":"transparent")}},se)})),b==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(se,Ye)=>{const Ie=bh(S)-1+Ye,It=Ye===0||Ye===11,Dn=Ie===D.getFullYear(),dn=new Date(Ie,0,1),Lt=L&&B&&Ie>=Math.min(L.getFullYear(),B.getFullYear())&&Ie<=Math.max(L.getFullYear(),B.getFullYear()),Jt=L&&L.getFullYear()===Ie||B&&B.getFullYear()===Ie,Yn=g==="range"&&L&&!Y;return v.createElement("button",{key:Ie,style:{...Dn?Ge:it,...It?j.dayOtherMonth:{},...Lt?j.dayInRange:{},...Jt?j.daySelected:{}},onClick:()=>Ee(Ie),onMouseEnter:Vn=>{Yn?W(dn):Jt||(Vn.currentTarget.style.backgroundColor=U.dropdownHover)},onMouseLeave:Vn=>{!Yn&&!Jt&&(Vn.currentTarget.style.backgroundColor=Lt?"rgba(9, 105, 218, 0.1)":"transparent")}},Ie)})),(()=>{const se=tt.filter(Ye=>!Ye.type||Ye.type===g);return se.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...j.quickOptions,...pn}},se.map(Ye=>v.createElement("button",{key:`${Ye.type??"both"}-${Ye.value}`,style:j.quickOption,onClick:()=>t(Ye.value)},Ye.label)))})())}var yT=30,xT=150;function ix(t,a){let r=0;const i=u=>{if(u.nodeType===Node.TEXT_NODE){const o=(u.textContent||"").length;return r+o>=a?{node:u,offset:a-r}:(r+=o,null)}if(u.nodeName==="BR"){if(r+1>=a){const o=u.parentNode;if(o)return{node:o,offset:Array.from(o.childNodes).indexOf(u)+1}}return r+=1,null}for(let o=0;o<u.childNodes.length;o++){const f=i(u.childNodes[o]);if(f)return f}return null};return i(t)}function bT(t,a,r){const i=ix(t,a),u=ix(t,r);if(!i||!u)return[];const o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(u.node,u.offset);const f=t.getBoundingClientRect(),m=o.getClientRects();if(m.length===0)return[];const p=[];for(let g=0;g<m.length;g++){const x=m[g];x.width<1||p.push({left:x.left-f.left,top:x.top-f.top,width:Math.max(x.width,6),height:x.height})}return p}function ST(t,a,r){if(!a||t.length===0)return[];const i=[];let u=0;for(const o of t){if(u>=yT)break;if(r>=o.start&&r<=o.end)continue;const f=bT(a,o.start,o.end);for(const m of f)i.push({left:m.left,top:m.top,width:m.width,height:m.height,error:o});u++}return i}var ux=28,ox=4;function wT(t){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath d='M0 2 Q2 0 4 2 Q6 4 8 2' stroke='${t.replace("#","%23")}' fill='none' stroke-width='0.8'/%3E%3C/svg%3E")`}function ET({errors:t,editorRef:a,cursorOffset:r,colors:i,styles:u,containerRef:o,classNames:f}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[b,E]=v.useState([]),S=v.useRef([]),N=v.useRef(null),O=v.useRef(null);if(v.useEffect(()=>{if(O.current&&clearTimeout(O.current),t.length===0){E([]),S.current=[],p(null);return}return O.current=setTimeout(()=>{const Y=ST(t,a,r);E(Y),S.current=Y},xT),()=>{O.current&&clearTimeout(O.current)}},[t,a,r]),v.useEffect(()=>{const Y=o;if(!Y||!a)return;const Q=U=>{const j=a.getBoundingClientRect(),oe=U.clientX-j.left,me=U.clientY-j.top;let ye=-1;for(let Re=0;Re<S.current.length;Re++){const ee=S.current[Re];if(oe>=ee.left&&oe<=ee.left+ee.width&&me>=ee.top&&me<=ee.top+ee.height+6){ye=Re;break}}ye>=0?(p(ye),x({x:oe,clientY:U.clientY})):p(null)},K=()=>{p(null)},W=new AbortController;return Y.addEventListener("mousemove",Q,{signal:W.signal}),Y.addEventListener("mouseleave",K,{signal:W.signal}),()=>W.abort()},[o,a]),v.useEffect(()=>{const Y=N.current;if(!Y||m==null)return;const Q=Y.getBoundingClientRect();if(Q.right>window.innerWidth-8){const K=Q.right-window.innerWidth+8;Y.style.transform=`translateX(-${K}px)`}else Y.style.transform=""}),b.length===0)return null;const T=Hu(i),L=Bu(u),X=m!=null?b[m]:null;return v.createElement(v.Fragment,null,b.map((Y,Q)=>{const K=Y.error.severity==="warning",W=wT(K?T.warning:T.error),U=Y.top+Y.height-2;return v.createElement("div",{key:`wave-${Q}`,className:Ma("ei-squiggly",K?"ei-squiggly--warning":"ei-squiggly--error",f==null?void 0:f.squiggly),style:{position:"absolute",left:`${Y.left}px`,top:`${U}px`,width:`${Y.width}px`,height:"4px",zIndex:1,backgroundImage:W,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),X!=null&&(()=>{const Y=X.error.severity==="warning"?T.warning:T.error,Q=a==null?void 0:a.getBoundingClientRect(),K=((Q==null?void 0:Q.left)??0)+g.x,W=((Q==null?void 0:Q.top)??0)+X.top+X.height+2,U=((Q==null?void 0:Q.top)??0)+X.top,j=window.innerHeight-g.clientY<ux+20?U-ux-ox:W+ox;return Jl.createPortal(v.createElement("div",{ref:N,className:Ma("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${j}px`,left:`${K}px`,zIndex:L.dropdownZIndex,backgroundColor:T.background,color:Y,border:`1px solid ${Y}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:L.fontFamily,lineHeight:"1.4",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"90vw"}},X.error.message),document.body)})())}function Eu(t,a,r){let i=0,u=!1;function o(f){var m;if(u)return!0;if(f===a){if(f.nodeType===Node.TEXT_NODE)i+=r;else for(let p=0;p<r&&p<f.childNodes.length;p++)if(o(f.childNodes[p]))return!0;return u=!0,!0}if(f.nodeType===Node.TEXT_NODE)return i+=(f.textContent||"").length,!1;if(f.nodeName==="BR")return(m=f.hasAttribute)!=null&&m.call(f,"data-sentinel")||(i+=1),!1;for(let p=0;p<f.childNodes.length;p++)if(o(f.childNodes[p]))return!0;return!1}return o(t),i}function Tr(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const r=a.getRangeAt(0);return Eu(t,r.startContainer,r.startOffset)}function xl(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const r=a.getRangeAt(0);return{start:Eu(t,r.startContainer,r.startOffset),end:Eu(t,r.endContainer,r.endOffset)}}function Zl(t,a){const r=window.getSelection();if(!r)return;const i=_h(t,a);if(!i)return;const u=document.createRange();u.setStart(i.node,i.offset),u.collapse(!0),r.removeAllRanges(),r.addRange(u)}function Kl(t,a,r){if(a===r){Zl(t,a);return}const i=window.getSelection();if(!i)return;const u=_h(t,a),o=_h(t,r);if(!u||!o)return;const f=document.createRange();f.setStart(u.node,u.offset),f.setEnd(o.node,o.offset),i.removeAllRanges(),i.addRange(f)}function _h(t,a){let r=0;function i(f){var m;if(f.nodeType===Node.TEXT_NODE){const p=(f.textContent||"").length;return r+p>=a?{node:f,offset:a-r}:(r+=p,null)}if(f.nodeName==="BR"){if((m=f.hasAttribute)!=null&&m.call(f,"data-sentinel"))return null;if(r+1>=a){const p=f.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(f)+1}}return r+=1,null}for(let p=0;p<f.childNodes.length;p++){const g=i(f.childNodes[p]);if(g)return g}return null}const u=i(t);if(u)return u;const o=Fb(t);return o?{node:o,offset:(o.textContent||"").length}:{node:t,offset:0}}function Fb(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const r=Fb(t.childNodes[a]);if(r)return r}return null}function NT(t){const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);r.deleteContents();const i=document.createTextNode(t);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),a.removeAllRanges(),a.addRange(r)}function RT(){const t=window.getSelection();if(!t||t.rangeCount===0)return;const a=t.getRangeAt(0);a.deleteContents();const r=document.createElement("br");a.insertNode(r),a.setStartAfter(r),a.collapse(!0),t.removeAllRanges(),t.addRange(a)}function uc(t){var m;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);let i=r.getBoundingClientRect();if(i.width===0&&i.height===0){const p=document.createElement("span");p.textContent="",r.insertNode(p),i=p.getBoundingClientRect(),(m=p.parentNode)==null||m.removeChild(p),a.removeAllRanges(),a.addRange(r)}const u=t.getBoundingClientRect(),o=i.top-u.top+t.scrollTop,f=i.bottom-u.top+t.scrollTop;f>t.scrollTop+t.clientHeight?t.scrollTop=f-t.clientHeight:o<t.scrollTop&&(t.scrollTop=o)}function Sh(){var i,u;const t=window.getSelection();if(!t||t.rangeCount===0)return null;const a=t.getRangeAt(0),r=a.getBoundingClientRect();if(r.width===0&&r.height===0||a.collapsed&&a.startContainer.nodeType===Node.ELEMENT_NODE&&a.startOffset>0&&((i=a.startContainer.childNodes[a.startOffset-1])==null?void 0:i.nodeName)==="BR"){const o=document.createElement("span");o.textContent="",a.insertNode(o);const f=o.getBoundingClientRect();return(u=o.parentNode)==null||u.removeChild(o),t.removeAllRanges(),t.addRange(a),f}return r}function cx(t,a){return Math.min(t,a)}function wh(t,a,r){const i=window.innerHeight,u=window.innerWidth;let o=t.bottom+window.scrollY+4,f=t.left+window.scrollX;return t.bottom+a+4>i&&(o=t.top+window.scrollY-a-4),f+r>u&&(f=u-r-8),f<8&&(f=8),{top:o,left:f}}var TT=new Set([M.VALUE,M.QUOTED_VALUE,M.WILDCARD]);function jT(t,a,r){for(const i of t)if(a>=i.start&&a<=i.end&&TT.has(i.type))return a===i.start&&r===i.end?null:{start:i.start,end:i.end};return null}var DT=new Set([M.VALUE,M.QUOTED_VALUE,M.WILDCARD,M.FIELD_NAME,M.RANGE,M.SAVED_SEARCH,M.HISTORY_REF,M.REGEX]);function CT(t,a,r){const i=[];for(const u of a)if(r>=u.start&&r<=u.end&&DT.has(u.type)){i.push({start:u.start,end:u.end});break}return t&&mc(t,r,i),AT(i)}function mc(t,a,r){if(a<t.start||a>t.end)return!1;let i=!1;switch(t.type){case"BooleanExpr":i=mc(t.left,a,r)||i,i=mc(t.right,a,r)||i;break;case"Group":case"Not":case"FieldGroup":i=mc(t.expression,a,r)||i;break}return r.push({start:t.start,end:t.end}),!0}function AT(t){t.sort((r,i)=>r.end-r.start-(i.end-i.start)||r.start-i.start);const a=[];for(const r of t){const i=a[a.length-1];i&&i.start===r.start&&i.end===r.end||a.push(r)}return a}var OT=60,MT=" ";function kT(t,a){const r=(a==null?void 0:a.maxLineLength)??OT,i=(a==null?void 0:a.indent)??MT,u={whitespace:a==null?void 0:a.whitespaceOperator,and:a==null?void 0:a.andOperator,or:a==null?void 0:a.orOperator,not:a==null?void 0:a.notOperator};let o;return typeof t=="string"?o=new rs(new Ks(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():o=t,o?gc(o,0,r,i,u):""}function _T(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function Ib(t,a){const r=a.not??t.sourceOperator??"NOT";return{op:r,sep:/^[a-zA-Z]/.test(r)?" ":""}}function Sl(t,a){switch(t.type){case"FieldValue":{const r=t.quoted?`"${t.value}"`:t.value,i=t.operator===":"?":":`:${t.operator}`;let u=`${t.field}${i}${r}`;return t.fuzzy!=null&&(u+=`~${t.fuzzy}`),t.proximity!=null&&(u+=`~${t.proximity}`),t.boost!=null&&(u+=`^${t.boost}`),u}case"BareTerm":{let r=t.quoted?`"${t.value}"`:t.value;return t.fuzzy!=null&&(r+=`~${t.fuzzy}`),t.proximity!=null&&(r+=`~${t.proximity}`),t.boost!=null&&(r+=`^${t.boost}`),r}case"Range":{const r=t.lowerInclusive?"[":"{",i=t.upperInclusive?"]":"}",u=`${r}${t.lowerQuoted?`"${t.lower}"`:t.lower} TO ${t.upperQuoted?`"${t.upper}"`:t.upper}${i}`;return t.field?`${t.field}:${u}`:u}case"Regex":return`/${t.pattern}/`;case"SavedSearch":return`#${t.name}`;case"HistoryRef":return`!${t.ref}`;case"Not":{const{op:r,sep:i}=Ib(t,a);return`${r}${i}${Sl(t.expression,a)}`}case"Group":{let r=`(${Sl(t.expression,a)})`;return t.boost!=null&&(r+=`^${t.boost}`),r}case"FieldGroup":{let r=`${t.field}:(${Sl(t.expression,a)})`;return t.boost!=null&&(r+=`^${t.boost}`),r}case"BooleanExpr":{const r=_T(t,a),i=r?` ${r} `:" ";return`${Sl(t.left,a)}${i}${Sl(t.right,a)}`}case"Error":return t.value}}function LT(t){const a=t.operator,r=!!t.implicit,i=[],u=o=>{o.type==="BooleanExpr"&&o.operator===a&&!!o.implicit===r?(u(o.left),u(o.right)):i.push(o)};return u(t),{operator:a,implicit:r,sourceOperator:t.sourceOperator,operands:i}}function pc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?pc(t.left)||pc(t.right):t.type==="Not"?pc(t.expression):!1}var zT={and:"AND",or:"OR",not:"NOT"};function UT(t,a){return!!(Sl(t,zT).length>a||pc(t))}function gc(t,a,r,i,u){const o=i.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=LT(t),x=m?u.whitespace??"":f==="AND"?u.and??p??"AND":u.or??p??"OR",b=x?` ${x} `:" ",E=g.map(S=>Sl(S,u)).join(b);return E.length<=r?E:g.map((S,N)=>{const O=gc(S,a,r,i,u);return N===0?O:x?`${o}${x} ${O}`:`${o}${O}`}).join(`
|
|
203
|
+
`)}case"Group":{if(!UT(t.expression,r)){let m=`(${Sl(t.expression,u)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
|
|
204
|
+
${HT(gc(t.expression,a+1,r,i,u),a+1,i)}
|
|
205
|
+
${o})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"FieldGroup":{let f=`${t.field}:(${Sl(t.expression,u)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=Ib(t,u);return`${f}${m}${gc(t.expression,a,r,i,u)}`}default:return Sl(t,u)}}function HT(t,a,r){const i=r.repeat(a);return t.split(`
|
|
206
|
+
`).map(u=>u.startsWith(i)?u:i+u).join(`
|
|
207
|
+
`)}function BT(t){return t?yu(t):[]}function dx(t){return t.type==="BooleanExpr"}function yu(t){switch(t.type){case"BooleanExpr":return Lh(t);case"Group":{const a=[],r=t.expression;return dx(r)?(a.push({start:t.start,end:t.end}),a.push(...yu(r)),a.push({start:t.start,end:t.end})):a.push({start:t.start,end:t.end}),a}case"FieldGroup":{const a=[];a.push({start:t.start,end:t.end});const r=t.expression;return dx(r)&&a.push(...yu(r)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...yu(t.expression)),a}case"FieldValue":case"BareTerm":case"SavedSearch":case"HistoryRef":case"Regex":case"Range":case"Error":return[{start:t.start,end:t.end}]}}function Lh(t){return t.type==="BooleanExpr"?[...Lh(t.left),...Lh(t.right)]:yu(t)}function $T(t,a,r,i){if(t.length===0)return null;if(a>=0&&a<t.length){const u=i==="forward"?a+1:a-1;return u>=0&&u<t.length?{stop:t[u],index:u}:null}if(i==="forward"){for(let u=0;u<t.length;u++)if(t[u].start>=r)return{stop:t[u],index:u};return{stop:t[t.length-1],index:t.length-1}}else{for(let u=t.length-1;u>=0;u--)if(t[u].end<=r)return{stop:t[u],index:u};return{stop:t[0],index:0}}}var qT=class{constructor(t=100){mn(this,"stack",[]);mn(this,"index",-1);mn(this,"maxSize");this.maxSize=t}push(t){if(this.index>=0&&this.stack[this.index].value===t.value){this.stack[this.index].cursorPos=t.cursorPos;return}this.stack=this.stack.slice(0,this.index+1),this.stack.push(t),this.stack.length>this.maxSize&&this.stack.shift(),this.index=this.stack.length-1}replaceCurrent(t){this.index>=0?this.stack[this.index]=t:this.push(t)}undo(){return this.index<=0?null:(this.index--,this.stack[this.index])}redo(){return this.index>=this.stack.length-1?null:(this.index++,this.stack[this.index])}canUndo(){return this.index>0}canRedo(){return this.index<this.stack.length-1}current(){return this.index>=0?this.stack[this.index]:null}clear(){this.stack=[],this.index=-1}get length(){return this.stack.length}};function YT(t,a){const r=i=>(a==null?void 0:a(i))??Q2(i);if(t.type==="RANGE"&&t.token){const i=t.token.value,u=(i.endsWith("]")||i.endsWith("}")?i.slice(1,-1):i.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(u)return{mode:"range",start:r(u[1].trim()),end:r(u[2].trim())}}if(t.type==="FIELD_VALUE"&&t.partial){const i=r(t.partial);if(i)return{mode:"single",start:i,end:null}}return null}function VT(t,a){var r,i,u,o;return((t==null?void 0:t.mode)??"single")!==((a==null?void 0:a.mode)??"single")||(((r=t==null?void 0:t.start)==null?void 0:r.getTime())??0)!==(((i=a==null?void 0:a.start)==null?void 0:i.getTime())??0)?!0:(((u=t==null?void 0:t.end)==null?void 0:u.getTime())??0)!==(((o=a==null?void 0:a.end)==null?void 0:o.getTime())??0)}function FT({position:t,colors:a,onSelect:r,colorConfig:i,styleConfig:u,datePickerInit:o,fixedWidth:f,datePresets:m,datePickerClassName:p}){const g=v.useRef(null),[x,b]=v.useState(!1);if(v.useEffect(()=>{const N=document.createElement("div");return document.body.appendChild(N),g.current=N,b(!0),()=>{document.body.removeChild(N),g.current=null}},[]),!x||!g.current)return null;const E=Bu(u),S={position:"absolute",zIndex:E.dropdownZIndex,...Yb(a,E),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return Jl.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:S,onMouseDown:N=>N.preventDefault()},v.createElement(vT,{onSelect:r,colors:i,styles:u,initialMode:o==null?void 0:o.mode,initialStart:o==null?void 0:o.start,initialEnd:o==null?void 0:o.end,presets:m,className:p})),g.current)}function IT(t){const{fields:a,onSearch:r,onChange:i,onValidationChange:u,value:o,defaultValue:f,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:b,placeholder:E,className:S,classNames:N,style:O,dropdown:T,features:L,inputRef:X,datePresets:Y,onKeyDown:Q,onFocus:K,onBlur:W,onTab:U,validateValue:j,parseDate:oe,plainModeLength:me,interceptPaste:ye,defaultField:Re,trailingSpaceOnAccept:ee=!0,collapseOnBlur:be=!1}=t,Ee=typeof Re=="string"?{name:Re,showFieldSuggestions:!1}:Re?{showFieldSuggestions:!1,...Re}:void 0,z=Ee==null?void 0:Ee.name,B=(T==null?void 0:T.open)??(T==null?void 0:T.mode)??"always",ie=typeof B=="function",de=ie?null:B,pe=(T==null?void 0:T.alignToInput)??!1,D=T==null?void 0:T.maxSuggestions,q=D||10,ne=T==null?void 0:T.suggestDebounceMs,ce=parseInt((b==null?void 0:b.dropdownMaxHeight)||"300",10)||300,Te=(L==null?void 0:L.savedSearches)??!!m,Ne=(L==null?void 0:L.historySearch)??!!p,Ue=(T==null?void 0:T.showSavedSearchHint)??Te,it=(T==null?void 0:T.showHistoryHint)??Ne,Ge=(T==null?void 0:T.showOperators)!==!1,tt=(ie||de!=="input")&&(T==null?void 0:T.onNavigation)!==!1,pn=(T==null?void 0:T.navigationDelay)??0,Rt=(T==null?void 0:T.loadingDelay)??0,ut=T==null?void 0:T.renderFieldHint,se=T==null?void 0:T.renderHistoryItem,Ye=T==null?void 0:T.renderSavedSearchItem,Ie=T==null?void 0:T.renderHeader,It=T==null?void 0:T.renderNoResults,Dn=T==null?void 0:T.renderType,dn=(T==null?void 0:T.autoSelect)??!1,Lt=(T==null?void 0:T.homeEndKeys)??!1,Jt=(L==null?void 0:L.multiline)!==!1,Yn=(L==null?void 0:L.smartSelectAll)??!1,Vn=(L==null?void 0:L.expandSelection)??!1,fe=(L==null?void 0:L.wildcardWrap)??!1,Le=(L==null?void 0:L.clauseNavigation)??!1,ke=L==null?void 0:L.formatQuery,Ve=!!ke,nt=typeof ke=="object"?ke:void 0,mt=v.useMemo(()=>({savedSearches:Te,historySearch:Ne}),[Te,Ne]),Gt=Array.isArray(a)?a:[],[an,Hn]=v.useState(Gt);v.useEffect(()=>{if(Array.isArray(a)){Hn(a);return}let R=!1;return a().then(I=>{R||Hn(I)}),()=>{R=!0}},[a]);const sn=v.useMemo(()=>{const R=new Map;for(const I of an)if(R.set(I.name.toLowerCase(),I.type),I.aliases)for(const Se of I.aliases)R.set(Se.toLowerCase(),I.type);return R},[an]),re=v.useRef(null),[St,Mt]=v.useState(null),Jn=v.useCallback(R=>{re.current=R,Mt(R)},[]),Wn=v.useRef(null),Tl=v.useRef(null),Be=v.useRef(o||f||""),Xt=v.useRef(null),qt=v.useRef(!1),vt=v.useRef(!1),zt=v.useRef(new qT),Tt=v.useRef(null),Wt=v.useRef(new Set),Pt=v.useRef(null),Ut=v.useRef(null),dt=v.useRef(null),Ze=v.useRef(null),bn=v.useRef(!1),Cn=v.useRef(null),C=v.useRef(null),k=v.useRef(null),$=v.useRef("input"),Z=v.useRef(null),ae=v.useRef(-1),je=v.useRef(()=>{}),ge=v.useRef(new gh(Gt,[],[],D||10,{showSavedSearchHint:Ue,showHistoryHint:it,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));ge.current.setDefaultField(Ee);const De=v.useRef(new nx(Gt)),we=v.useRef(j);we.current=j;const[Oe,_e]=v.useState([]),[Xe,Ce]=v.useState(null),[Ke,$e]=v.useState([]),[Ht,Je]=v.useState(-1),[ot,rt]=v.useState(!1),[ct,Qt]=v.useState(!1),[Fn,Sn]=v.useState(null),[An,On]=v.useState([]),[In,fa]=v.useState(!1),[tr,ea]=v.useState(!Be.current),[ul,Pe]=v.useState(me!=null&&Be.current.length>=me),[wt,Kt]=v.useState(0),[ta,Mn]=v.useState(0),[jl,Et]=v.useState(""),[wa,Gn]=v.useState(null),[Lr,fi]=v.useState(null),jt=v.useRef({tokens:Oe,ast:Xe,suggestions:Ke,selectedSuggestionIndex:Ht,showDropdown:ot,showDatePicker:ct,cursorOffset:wt,selectionEnd:ta,autocompleteContext:jl,validationErrors:An,cursorContext:wa});jt.current={tokens:Oe,ast:Xe,suggestions:Ke,selectedSuggestionIndex:Ht,showDropdown:ot,showDatePicker:ct,cursorOffset:wt,selectionEnd:ta,autocompleteContext:jl,validationErrors:An,cursorContext:wa};const ol=v.useCallback((R,I)=>{if(pe&&Wn.current){const ve=Wn.current.getBoundingClientRect();return{top:ve.bottom+window.scrollY+4,left:ve.left+window.scrollX}}const Se=Sh();return Se?wh(Se,R,I):null},[pe]),qu=v.useCallback(()=>{if(!(!pe||!Wn.current))return Wn.current.getBoundingClientRect().width},[pe]),Ja=v.useCallback((R,I,Se="dropdown")=>{const ve=Se==="datePicker"?R:cx(R,ce);if(pe&&Se!=="datePicker"){rt(!0),Sn(ol(ve,I));return}const Fe=requestAnimationFrame(()=>{Wt.current.delete(Fe),Se==="datePicker"?Qt(!0):rt(!0);const ue=Sh();Sn(ue?wh(ue,ve,I):null)});Wt.current.add(Fe)},[pe,ol,ce]),nr=80,Xc=60,cs=v.useCallback((R,I)=>{if(!re.current)return;const Se=Fs(R,x,{cursorOffset:I,tokenClassName:N==null?void 0:N.token,fieldTypeMap:sn});re.current.innerHTML=Se,document.activeElement===re.current&&Zl(re.current,I)},[x]),ha=v.useCallback((R,I)=>{const Se=me!=null&&R.length>=me;if(Pe(Se),Se){if(_e([]),Ce(null),On([]),ea(R.length===0),$e([]),jt.current.tokens=[],rt(!1),Qt(!1),re.current){const xe=Tr(re.current);re.current.querySelector("span")&&(re.current.textContent=R,Zl(re.current,xe)),Kt(xe),Mn(xe)}i&&i(R,null),u&&u([]);return}const ve=new Ks(R,mt).tokenize(),Fe=new rs(ve),ue=Fe.parse(),he=ic([...Fe.getErrors().map(xe=>({message:xe.message,start:xe.start,end:xe.end,type:"SYNTAX_ERROR"})),...De.current.validate(ue,we.current,oe,z)]);if(re.current){const xe=Tr(re.current);I&&ve.length>nr?(Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(()=>{Ut.current=null,re.current&&cs(ve,Tr(re.current))},Xc)):(Ut.current&&(clearTimeout(Ut.current),Ut.current=null),cs(ve,xe)),_e(ve),Ce(ue),On(he),ea(R.length===0),Kt(xe),Mn(xe),jt.current.tokens=ve,I&&je.current(ve,xe)}else _e(ve),Ce(ue),On(he),ea(R.length===0),jt.current.tokens=ve;i&&i(R,ue),u&&u(he)},[x,i,u,cs,me]),zr=v.useCallback((R,I)=>{if(!ut||I.type!=="FIELD_VALUE"||!I.fieldName)return R;const Se=ge.current.resolveField(I.fieldName);if(!Se)return R;const ve=ut(Se,I.partial);return ve==null?R:R.some(Fe=>Fe.type==="hint")?R.map(Fe=>Fe.type==="hint"?{...Fe,customContent:ve}:Fe):[{text:"",label:"",type:"hint",customContent:ve,replaceStart:I.start??0,replaceEnd:I.end??0},...R]},[ut]),ds=v.useCallback(R=>{if(!It)return!1;const I=It({cursorContext:R,partial:R.partial});return I==null?!1:($e([{text:"",label:"",type:"noResults",customContent:I,replaceStart:0,replaceEnd:0}]),Je(-1),Qt(!1),Ja(32,300),!0)},[It]),ma=v.useCallback((R,I,Se)=>{var xe,Qe,at;const ve=ge.current.getSuggestions(R,I);Ge||(ve.suggestions=ve.suggestions.filter(ze=>ze.type!=="operator"));const Fe=ve.context.type;if(Gn(ve.context),ie){if(B({trigger:$.current,context:ve.context,suggestions:ve.suggestions,isOpen:jt.current.showDropdown||jt.current.showDatePicker,value:Be.current,selectionStart:I,selectionEnd:Se??I})===!1){rt(!1),Qt(!1),$e([]);return}}else{if(de==="never"){rt(!1),Qt(!1),$e([]);return}if(de==="manual"){if(k.current&&k.current!==Fe){k.current=null,rt(!1),Qt(!1),$e([]);return}if(!k.current){rt(!1),Qt(!1),$e([]);return}}if(de==="input"&&$.current!=="input"&&$.current!=="ctrlSpace"){rt(!1),Qt(!1),$e([]);return}if(de==="always"&&R.some(ze=>(ze.type===M.AND||ze.type===M.OR||ze.type===M.NOT||ze.type===M.TILDE||ze.type===M.BOOST)&&I>=ze.start&&I<=ze.end)){rt(!1),Qt(!1),$e([]);return}}const ue=ve.context.fieldName?ge.current.resolveField(ve.context.fieldName):void 0,he=!!(g&&ve.context.type==="FIELD_VALUE"&&ve.context.fieldName&&(ue==null?void 0:ue.type)!=="boolean"&&(ue==null?void 0:ue.suggestions)!==!1)||typeof m=="function"&&ve.context.type==="SAVED_SEARCH"||typeof p=="function"&&ve.context.type==="HISTORY_REF";if(ve.showDatePicker){bn.current=!1,(xe=Pt.current)==null||xe.abort(),Xt.current&&clearTimeout(Xt.current),Ze.current&&(clearTimeout(Ze.current),Ze.current=null);const ze=YT(ve.context,oe),wn=Cn.current;Cn.current=ze,fi(ze);const kt=ve.context.token;kt&&(kt.type==="COLON"||kt.type==="COMPARISON_OP")?C.current={start:kt.end,end:kt.end}:kt?C.current={start:kt.start,end:kt.end}:C.current={start:I,end:I},jt.current.showDatePicker&&VT(wn,ze)&&Qt(!1),$e([]),pe||rt(!1),Et(Fe),Ja(350,300,"datePicker");return}if(he){const ze=ve.context.token,wn=ze?ze.start:I,kt=ze?ze.end:I,la=()=>{Ze.current=null,$e([{text:"",label:"Searching...",type:"loading",replaceStart:wn,replaceEnd:kt}]),pe||rt(!1),Qt(!1),Je(-1),Ja(32,300)};Ze.current&&clearTimeout(Ze.current),Rt>0?Ze.current=setTimeout(la,Rt):la(),Et(Fe)}else{bn.current=!1,(Qe=Pt.current)==null||Qe.abort(),Xt.current&&clearTimeout(Xt.current),Ze.current&&(clearTimeout(Ze.current),Ze.current=null);const ze=zr(ve.suggestions,ve.context);ze.length>0?($e(ze),pe||rt(!1),Qt(!1),Je(ve.context.partial||dn?0:-1),Et(Fe),Ja(ze.length*32,300)):(Et(Fe),ds(ve.context)||(rt(!1),Qt(!1),$e([])))}if(he){const ze=ve.context.partial,wn=ne||200;bn.current=!0,Xt.current&&clearTimeout(Xt.current),(at=Pt.current)==null||at.abort();const kt=new AbortController;Pt.current=kt,Xt.current=setTimeout(async()=>{const la=ve.context.token,ra=la?la.start:I,pa=la?la.end:I;try{let En;if(ve.context.type==="SAVED_SEARCH"&&typeof m=="function"){const un=await m(ze);if(kt.signal.aborted)return;En=un.map(_t=>({text:_t.query,label:_t.label||_t.query,description:_t.description,type:"savedSearch",replaceStart:ra,replaceEnd:pa,matchPartial:ze,sourceData:_t}))}else if(ve.context.type==="HISTORY_REF"&&typeof p=="function"){const un=await p(ze);if(kt.signal.aborted)return;En=un.map(_t=>({text:gh.wrapHistoryQuery(_t.query),label:_t.label||_t.query,description:_t.description,type:"history",replaceStart:ra,replaceEnd:pa,matchPartial:ze,sourceData:_t}))}else{const un=ve.context.fieldName,_t=ge.current.resolveField(un),$r=await g(_t?_t.name:un,ze);if(kt.signal.aborted)return;En=$r.map(fl=>({text:fl.text,label:fl.label||fl.text,description:fl.description,type:fl.type,replaceStart:ra,replaceEnd:pa,matchPartial:ze}))}if(Ze.current&&(clearTimeout(Ze.current),Ze.current=null),En=En.slice(0,q),En.length>0){if(Ee!=null&&Ee.showFieldSuggestions){const un=ge.current.getFieldSuggestions(ze,ra,pa);En=[...En,...un].slice(0,q)}$e(En),Je(ze||dn?0:-1),Ja(En.length*32,300)}else{const un=ge.current.getSuggestions(jt.current.tokens,jt.current.cursorOffset);if(!(ze&&ds(un.context))){const _t=zr(un.suggestions.filter($r=>$r.type==="hint"),un.context);_t.length>0?($e(_t),Je(un.context.partial||dn?0:-1),Ja(_t.length*32,300)):ds(un.context)||(rt(!1),$e([]))}}}catch(En){Ze.current&&(clearTimeout(Ze.current),Ze.current=null),kt.signal.aborted||($e([{text:"",label:En instanceof Error?En.message:"Error loading suggestions",type:"error",replaceStart:ra,replaceEnd:pa}]),Je(-1),Ja(32,300),bn.current=!1)}},wn)}},[g,m,p,ne,zr,ol,Ja,pe,B,ie,de,Ge,q,Rt,dn,ds]);je.current=ma;const en=v.useCallback(()=>{var R;rt(!1),Qt(!1),fi(null),Cn.current=null,C.current=null,$e([]),Je(-1),bn.current=!1,(R=Pt.current)==null||R.abort(),Xt.current&&(clearTimeout(Xt.current),Xt.current=null),dt.current&&(clearTimeout(dt.current),dt.current=null),k.current=null},[]),na=v.useCallback((R,I,Se)=>{if(dt.current&&(clearTimeout(dt.current),dt.current=null),!tt){(jt.current.showDropdown||jt.current.showDatePicker)&&en();return}$.current="navigation",pn>0?dt.current=setTimeout(()=>{dt.current=null,ma(R,I,Se)},pn):ma(R,I,Se)},[tt,pn,ma,en]),Ea=v.useCallback((R,I,Se)=>{Be.current=R,Tt.current&&(clearTimeout(Tt.current),Tt.current=null),zt.current.push({value:R,cursorPos:I});const ve=new Ks(R,mt).tokenize(),Fe=new rs(ve),ue=Fe.parse(),he=ic([...Fe.getErrors().map(xe=>({message:xe.message,start:xe.start,end:xe.end,type:"SYNTAX_ERROR"})),...De.current.validate(ue,we.current,oe,z)]);if(re.current){const xe=Fs(ve,x,{cursorOffset:I,tokenClassName:N==null?void 0:N.token,fieldTypeMap:sn});re.current.innerHTML=xe,Zl(re.current,I)}if(_e(ve),Ce(ue),On(he),ea(R.length===0),Kt(I),Mn(I),rt(!1),Qt(!1),i&&i(R,ue),u&&u(he),Se){const xe=requestAnimationFrame(()=>{Wt.current.delete(xe),Se(ve,ue)});Wt.current.add(xe)}},[x,i,u]),Dl=v.useCallback((R,I="Enter",Se,ve)=>{if(!R)return;const Fe=jt.current,ue=Fe.autocompleteContext,he=ue==="FIELD_VALUE"||ue==="SAVED_SEARCH"||ue==="HISTORY_REF";if(he&&($.current="navigation"),R.type==="hint"&&(R.text==="#"||R.text==="!")){const un=R.text,_t=R.replaceStart,$r=Math.max(R.replaceEnd,Fe.selectionEnd),fl=Be.current.slice(0,_t),Qc=Be.current.slice($r),Iu=fl+un+Qc,Gu=fl.length+un.length;Ea(Iu,Gu,(Kc,Zc)=>{Se?Se(Iu,Zc):ma(Kc,Gu)});return}if(R.type==="hint")return;const xe=Fe.autocompleteContext==="FIELD_VALUE",Qe=Math.min(R.replaceStart,Fe.cursorOffset),at=Math.max(R.replaceEnd,Fe.selectionEnd),ze=Be.current.slice(0,Qe),wn=Be.current.slice(at);let kt="",la=wn;he&&ee&&(wn.length===0?kt=" ":/^[ \t\r\n]+$/.test(wn)&&!wn.startsWith("\\ ")&&(kt=" ",la=""));const ra=ze+R.text+kt+la,pa=ze.length+R.text.length+kt.length,En=I==="Enter"&&xe;Ea(ra,pa,(un,_t)=>{Se?Se(ra,_t):En?r&&r(ra,_t,ve):ma(un,pa)})},[Ea,ma,r,ee]);v.useEffect(()=>{Array.isArray(m)&&ge.current.updateSavedSearches(m),Array.isArray(p)&&ge.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{ge.current=new gh(an,[],[],D||10,{showSavedSearchHint:Ue,showHistoryHint:it,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),ge.current.setDefaultField(Ee),De.current=new nx(an),Array.isArray(m)&&ge.current.updateSavedSearches(m),Array.isArray(p)&&ge.current.updateSearchHistory(p),Be.current&&ha(Be.current,!1)},[an,D,Ue,it]),v.useEffect(()=>{X&&X({getValue:()=>Be.current,setValue:R=>{Be.current=R,ha(R,!1)},focus:()=>{var R;return(R=re.current)==null?void 0:R.focus()},blur:()=>{var R;return(R=re.current)==null?void 0:R.blur()},getAST:()=>jt.current.ast,getValidationErrors:()=>jt.current.validationErrors,setSelection:(R,I)=>{re.current&&(re.current.focus(),Kl(re.current,R,I),Kt(R),Mn(I))}})},[X,ha]),v.useEffect(()=>{const R=Be.current;zt.current.push({value:R,cursorPos:R.length}),R&&ha(R,!1)},[]),v.useEffect(()=>{o!==void 0&&o!==Be.current&&(Be.current=o,ha(o,!1))},[o,ha]),v.useEffect(()=>()=>{var R;Xt.current&&clearTimeout(Xt.current),Ut.current&&clearTimeout(Ut.current),dt.current&&clearTimeout(dt.current),Ze.current&&clearTimeout(Ze.current),Wt.current.forEach(I=>cancelAnimationFrame(I)),Wt.current.clear(),(R=Pt.current)==null||R.abort()},[]),v.useEffect(()=>{if(ie){const R=jt.current;R.cursorContext&&B({trigger:"modeChange",context:R.cursorContext,suggestions:R.suggestions,isOpen:R.showDropdown||R.showDatePicker,value:Be.current,selectionStart:R.cursorOffset,selectionEnd:R.selectionEnd})===!1&&(rt(!1),Qt(!1),$e([]))}else de==="never"&&(rt(!1),Qt(!1),$e([]));k.current=null},[B]);const cl=v.useRef(!1);v.useLayoutEffect(()=>{if(cl.current){cl.current=!1;return}const R=Tl.current;if(!R||!Fn)return;const I=R.getBoundingClientRect(),Se=window.innerWidth;if(I.right>Se-8){const ve=I.right-Se+8;cl.current=!0,Sn(Fe=>Fe&&{...Fe,left:Math.max(8,Fe.left-ve)})}},[Fn,ot,ct,Ke]),v.useEffect(()=>{const R=()=>{const I=jt.current;if(!(!I.showDropdown&&!I.showDatePicker))if(I.showDropdown&&pe&&Wn.current){const Se=Wn.current.getBoundingClientRect();Sn({top:Se.bottom+window.scrollY+4,left:Se.left+window.scrollX})}else{const Se=Sh();Se&&Sn(wh(Se,I.showDatePicker?350:cx(I.suggestions.length*32,ce),300))}};return window.addEventListener("resize",R),window.addEventListener("scroll",R,!0),()=>{window.removeEventListener("resize",R),window.removeEventListener("scroll",R,!0)}},[pe,ce]),v.useEffect(()=>{const R=re.current;if(!R)return;const I=()=>{(jt.current.showDropdown||jt.current.showDatePicker)&&en()};return R.addEventListener("scroll",I),()=>R.removeEventListener("scroll",I)},[en]);const Cl=v.useRef(null),hi=v.useRef(x);v.useEffect(()=>{if(!re.current)return;const R=jt.current.tokens;if(R.length===0||In&&ta!==wt)return;const I=In?wt:-1,Se=x!==hi.current;hi.current=x;const ve=Vb(R,I),Fe=ve?`${ve.openStart},${ve.closeStart}`:null;if(Fe===Cl.current&&!Se)return;Cl.current=Fe;const ue=In?Tr(re.current):-1,he=Fs(R,x,{cursorOffset:I,tokenClassName:N==null?void 0:N.token,fieldTypeMap:sn});re.current.innerHTML=he,In&&ue>=0&&Zl(re.current,ue)},[wt,ta,In,x]);const dl=be&&!In,mi=v.useRef(dl);v.useEffect(()=>{if(!re.current)return;const R=mi.current;if(mi.current=dl,R!==dl)if(dl)re.current.innerHTML=re.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const I=jt.current.tokens;if(I.length>0){const Se=In?Tr(re.current):-1,ve=Fs(I,x,{cursorOffset:Se,tokenClassName:N==null?void 0:N.token,fieldTypeMap:sn});re.current.innerHTML=ve,In&&Se>=0&&Zl(re.current,Se)}}},[dl,x]);const La=v.useCallback(()=>{if(qt.current||!re.current)return;Z.current=null,ae.current=-1,dt.current&&(clearTimeout(dt.current),dt.current=null);let R=I2(re.current);if(R===Be.current)return;let I=Tr(re.current);const Se=Zy(R);Se!==R&&(R=Se,I=Math.min(I,R.length)),Be.current=R;const ve=zt.current,Fe=ve.current();if(Fe&&Math.abs(R.length-Fe.value.length)<=2&&Tt.current?ve.replaceCurrent({value:R,cursorPos:I}):ve.push({value:R,cursorPos:I}),Tt.current&&clearTimeout(Tt.current),Tt.current=setTimeout(()=>{Tt.current=null},300),$.current="input",!ie&&de==="input"){const ue=I>0?R[I-1]:"";if(!ue||ue.trim()===""){ha(R,!1),en(),re.current&&uc(re.current);return}}ha(R,!0),re.current&&uc(re.current)},[ha,ie,de,en]),Wa=v.useCallback(()=>{qt.current=!0},[]),pi=v.useCallback(()=>{qt.current=!1,La()},[La]),Al=v.useCallback(R=>{if(!R)return;Be.current=R.value;const I=new Ks(R.value,mt).tokenize(),Se=new rs(I),ve=Se.parse(),Fe=ic([...Se.getErrors().map(he=>({message:he.message,start:he.start,end:he.end,type:"SYNTAX_ERROR"})),...De.current.validate(ve,we.current,oe,z)]),ue=R.selStart!=null&&R.selStart!==R.cursorPos;if(re.current){const he=Fs(I,x,{cursorOffset:R.cursorPos,tokenClassName:N==null?void 0:N.token,fieldTypeMap:sn});re.current.innerHTML=he,ue?Kl(re.current,R.selStart,R.cursorPos):Zl(re.current,R.cursorPos)}_e(I),Ce(ve),On(Fe),ea(R.value.length===0),Kt(ue?R.selStart:R.cursorPos),Mn(R.cursorPos),en(),i&&i(R.value,ve),u&&u(Fe)},[x,i,u,en]),za=v.useCallback(()=>{const R=Tl.current;if(!R)return 10;const I=R.clientHeight,Se=R.querySelectorAll(".ei-dropdown-item")[0];if(!Se)return 10;const ve=Se.offsetHeight;return ve<=0?10:Math.max(1,Math.floor(I/ve))},[]),gi=v.useCallback(R=>{var ve,Fe;if(Q&&Q(R),R.defaultPrevented)return;const I=jt.current,Se=R.nativeEvent.code;if(Ve&&Se==="KeyF"&&R.altKey&&R.shiftKey&&!R.ctrlKey&&!R.metaKey){R.preventDefault();const ue=kT(Be.current,nt);ue!==Be.current&&Ea(ue,ue.length);return}if(re.current&&re.current.childNodes.length>40){const ue=window.getSelection();if(ue!=null&&!ue.isCollapsed){const he=xl(re.current);if(he.end-he.start>20){const xe=R.key==="Backspace"||R.key==="Delete"||R.key==="x"&&(R.ctrlKey||R.metaKey),Qe=!R.ctrlKey&&!R.metaKey&&!R.altKey&&R.key.length===1;(xe||Qe)&&(re.current.textContent=Be.current,Kl(re.current,he.start,he.end))}}}{let ue=null,he=null;if(Jy[R.key])ue=R.key,he=Jy[R.key];else if(fe&&R.key==="*"&&re.current){const xe=xl(re.current);if(xe.start!==xe.end){const[Qe,at]=Wy(I.tokens,xe.start,xe.end);if(Qe>=0&&Qe===at){const ze=I.tokens[Qe];(ze.type===M.VALUE||ze.type===M.WILDCARD)&&(ue="*",he="*")}}}if(ue&&he&&re.current){const xe=xl(re.current);if(xe.start!==xe.end){R.preventDefault();const{newValue:Qe,newSelStart:at,newSelEnd:ze}=F2(Be.current,xe.start,xe.end,ue,he),wn=zt.current,kt=wn.current();kt&&kt.value===Be.current&&(kt.selStart=xe.start,kt.cursorPos=xe.end),Be.current=Qe,Tt.current&&(clearTimeout(Tt.current),Tt.current=null),wn.push({value:Qe,cursorPos:ze,selStart:at});const la=new Ks(Qe,mt).tokenize(),ra=new rs(la),pa=ra.parse(),En=ic([...ra.getErrors().map(_t=>({message:_t.message,start:_t.start,end:_t.end,type:"SYNTAX_ERROR"})),...De.current.validate(pa,we.current,oe,z)]),un=Fs(la,x,{cursorOffset:ze,tokenClassName:N==null?void 0:N.token,fieldTypeMap:sn});re.current.innerHTML=un,Kl(re.current,at,ze),_e(la),Ce(pa),On(En),ea(!1),Kt(at),Mn(ze),en(),i&&i(Qe,pa),u&&u(En);return}}}if(R.key==="z"&&(R.ctrlKey||R.metaKey)&&!R.shiftKey){R.preventDefault(),Al(zt.current.undo());return}if(R.key==="y"&&(R.ctrlKey||R.metaKey)||R.key==="z"&&(R.ctrlKey||R.metaKey)&&R.shiftKey){R.preventDefault(),Al(zt.current.redo());return}if(R.key==="a"&&(R.ctrlKey||R.metaKey)&&Yn&&re.current){const ue=xl(re.current),he=jT(I.tokens,ue.start,ue.end);if(he){R.preventDefault(),Kl(re.current,he.start,he.end),Kt(he.start),Mn(he.end);return}}if(Vn&&R.altKey&&R.shiftKey&&(Se==="ArrowRight"||Se==="ArrowLeft")&&re.current){const ue=Se==="ArrowRight";let he=Z.current;if(!he){const Qe=xl(re.current),at=CT(I.ast,I.tokens,Qe.start);if(at.length===0)return;he={ranges:at,level:-1},Z.current=he}const xe=ue?Math.min(he.level+1,he.ranges.length-1):Math.max(he.level-1,-1);if(xe===he.level)return;if(he.level=xe,xe<0){const Qe=xl(re.current);Zl(re.current,Qe.start),Z.current=null}else{R.preventDefault();const Qe=he.ranges[xe];Kl(re.current,Qe.start,Qe.end),Kt(Qe.start),Mn(Qe.end)}return}if(Z.current=null,Le&&R.ctrlKey&&R.altKey&&(Se==="ArrowRight"||Se==="ArrowLeft")&&re.current){R.preventDefault();const ue=Se==="ArrowRight"?"forward":"backward",he=BT(I.ast),xe=xl(re.current),Qe=ue==="forward"?xe.end:xe.start,at=$T(he,ae.current,Qe,ue);at&&(ae.current=at.index,Kl(re.current,at.stop.start,at.stop.end),Kt(at.stop.start),Mn(at.stop.end));return}if(ae.current=-1,R.key===" "&&(R.ctrlKey||R.metaKey)){R.preventDefault(),$.current="ctrlSpace",!ie&&de==="manual"&&(k.current=ge.current.getSuggestions(I.tokens,I.cursorOffset).context.type),ma(I.tokens,I.cursorOffset);return}if(R.key==="Enter"&&(R.ctrlKey||R.metaKey)){R.preventDefault(),en(),r&&r(Be.current,I.ast,R);return}if(R.key==="Enter"&&R.shiftKey&&Jt){R.preventDefault(),RT();const ue=re.current?Tr(re.current):Be.current.length+1,he=Be.current,xe=he.slice(0,ue-1)+`
|
|
208
|
+
`+he.slice(ue-1);Be.current=xe,Z.current=null,dt.current&&(clearTimeout(dt.current),dt.current=null),$.current="input",zt.current.push({value:xe,cursorPos:ue}),ha(xe,!0),re.current&&uc(re.current);return}if((R.key==="Backspace"||R.key==="Delete")&&re.current&&!re.current.textContent){const ue=Be.current;if(!ue)return;const{start:he,end:xe}=xl(re.current);let Qe,at;if(he!==xe)Qe=ue.slice(0,he)+ue.slice(xe),at=he;else if(R.key==="Backspace"&&he>0)Qe=ue.slice(0,he-1)+ue.slice(he),at=he-1;else if(R.key==="Delete"&&he<ue.length)Qe=ue.slice(0,he)+ue.slice(he+1),at=he;else return;R.preventDefault(),Be.current=Qe,Z.current=null,dt.current&&(clearTimeout(dt.current),dt.current=null),$.current="input",zt.current.push({value:Qe,cursorPos:at}),Zl(re.current,at),ha(Qe,!0),re.current&&uc(re.current);return}if(vt.current=!1,I.showDropdown&&I.suggestions.length>0)switch(R.key){case"ArrowDown":R.preventDefault(),vt.current=!0,Je(ue=>ue>=I.suggestions.length-1?0:ue+1);return;case"ArrowUp":R.preventDefault(),vt.current=!0,Je(ue=>ue<=0?I.suggestions.length-1:ue-1);return;case"PageDown":{R.preventDefault(),vt.current=!0;const ue=za();Je(he=>Math.min(he+ue,I.suggestions.length-1));return}case"PageUp":{R.preventDefault(),vt.current=!0;const ue=za();Je(he=>Math.max(he-ue,0));return}case"Home":if(Lt&&I.selectedSuggestionIndex>=0){R.preventDefault(),vt.current=!0,Je(0);return}break;case"End":if(Lt&&I.selectedSuggestionIndex>=0){R.preventDefault(),vt.current=!0,Je(I.suggestions.length-1);return}break;case"Enter":if(I.selectedSuggestionIndex>=0){const ue=I.suggestions[I.selectedSuggestionIndex];if(ue.type==="loading"||ue.type==="error"){R.preventDefault(),en(),r&&r(Be.current,I.ast,R);return}if(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!"){R.preventDefault(),en();const he=Be.current,xe=I.cursorOffset;if(xe<=he.length&&he[xe]!==" "){const Qe=he.slice(0,xe),at=he.slice(xe),ze=Qe+" "+at;Ea(ze,xe+1,()=>{r&&r(ze,I.ast,R)})}else r&&r(he,I.ast,R);return}R.preventDefault(),Dl(ue,"Enter",void 0,R);return}R.preventDefault(),en(),r&&r(Be.current,I.ast,R);return;case"Tab":if(U){R.preventDefault();const ue=I.selectedSuggestionIndex>=0?I.suggestions[I.selectedSuggestionIndex]:null,he=ue&&ue.type!=="loading"&&ue.type!=="error"&&!(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!")?ue:null,xe=U({suggestion:he,cursorContext:I.cursorContext||{type:"EMPTY",partial:""},query:Be.current});xe.accept&&he?Dl(he,"Tab",(Qe,at)=>{var ze;xe.submit&&r&&r(Qe,at,R),xe.blur&&((ze=re.current)==null||ze.blur())},R):(en(),xe.submit&&r&&r(Be.current,I.ast,R),xe.blur&&((ve=re.current)==null||ve.blur()));return}if(I.selectedSuggestionIndex>=0){const ue=I.suggestions[I.selectedSuggestionIndex];if(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!"){R.preventDefault(),en();const he=Be.current,xe=I.cursorOffset;if(xe<=he.length&&he[xe]!==" "){const Qe=he.slice(0,xe),at=he.slice(xe),ze=Qe+" "+at,wn=xe+1;Ea(ze,wn,kt=>{ma(kt,wn)})}return}R.preventDefault(),Dl(ue,"Tab",void 0,R);return}break;case"Escape":R.preventDefault(),en();return}if(R.key==="Tab"&&U){R.preventDefault();const ue=U({suggestion:null,cursorContext:I.cursorContext||{type:"EMPTY",partial:""},query:Be.current});ue.submit&&r&&r(Be.current,I.ast,R),ue.blur&&((Fe=re.current)==null||Fe.blur());return}if(I.showDatePicker&&R.key==="Escape"){R.preventDefault(),en();return}if(R.key==="Enter"&&!I.showDropdown&&!I.showDatePicker){R.preventDefault(),r&&r(Be.current,I.ast,R);return}},[r,en,Dl,Ea,Al,Jt,ie,de,ma,Q,U,Yn,Vn,Le,Lt,za,Ve]),fs=v.useCallback(R=>{if(vt.current){vt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(R.key)){if(!re.current)return;const I=xl(re.current);Kt(I.start),Mn(I.end),na(jt.current.tokens,I.start,I.end)}},[na]),Yu=v.useCallback(()=>{fa(!0),K==null||K();const R=requestAnimationFrame(()=>{if(Wt.current.delete(R),re.current){const I=jt.current.tokens,Se=I.length>0?Tr(re.current):0;Kt(Se),Mn(Se),na(I,Se)}});Wt.current.add(R)},[La,na,K]),hs=v.useCallback(()=>{var R;fa(!1),rt(!1),Qt(!1),$e([]),bn.current=!1,(R=Pt.current)==null||R.abort(),Xt.current&&(clearTimeout(Xt.current),Xt.current=null),Ze.current&&(clearTimeout(Ze.current),Ze.current=null),Kt(-1),W==null||W()},[W]),Ol=v.useRef(!1),Vu=v.useCallback(R=>{if(!re.current||R.detail!==2&&R.detail!==3)return;if(R.detail===3){if(!jt.current.ast)return;const xe=document.caretRangeFromPoint(R.clientX,R.clientY);if(!xe)return;const Qe=Eu(re.current,xe.startContainer,xe.startOffset),at=$2(jt.current.ast,Be.current,Qe);if(!at||at.start>=at.end)return;R.preventDefault(),Ol.current=!0,Kl(re.current,at.start,at.end);return}R.preventDefault(),Ol.current=!0;const I=document.caretRangeFromPoint(R.clientX,R.clientY);if(!I)return;const Se=Eu(re.current,I.startContainer,I.startOffset),ve=Be.current,Fe=xe=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(xe);let ue=Se;for(;ue>0&&Fe(ve[ue-1]);)ue--;let he=Se;for(;he<ve.length&&Fe(ve[he]);)he++;ue<he&&Kl(re.current,ue,he)},[]),aa=v.useCallback(R=>{Ol.current&&(R.preventDefault(),Ol.current=!1)},[]),Ml=v.useCallback(()=>{if(!re.current)return;const R=xl(re.current);if(Kt(R.start),Mn(R.end),R.start!==R.end){const[I,Se]=Wy(jt.current.tokens,R.start,R.end);if(I!==Se){en();return}}na(jt.current.tokens,R.start,R.end)},[na,en]),kl=v.useCallback(R=>{Tt.current&&(clearTimeout(Tt.current),Tt.current=null),NT(R),La()},[La]),Ur=v.useCallback(R=>{R.preventDefault();const I=Zy(R.clipboardData.getData("text/plain"));if(ye){const Se=ye(I,R);Se!=null&&typeof(Se==null?void 0:Se.then)=="function"?Se.then(ve=>{ve!=null&&kl(ve)}).catch(()=>{}):Se!=null&&kl(Se)}else kl(I)},[ye,kl]),Pc=v.useCallback(R=>{$.current="navigation";const I=jt.current,Se=C.current,ve=Se?Se.start:I.cursorOffset,Fe=Se?Se.end:I.cursorOffset,ue=Be.current.slice(0,ve),he=Be.current.slice(Fe);let xe="",Qe=he;ee&&R.length>0&&(he.length===0?xe=" ":/^[ \t\r\n]+$/.test(he)&&!he.startsWith("\\ ")&&(xe=" ",Qe=""));const at=ue+R+xe+Qe,ze=ue.length+R.length+xe.length;Ea(at,ze,wn=>{re.current&&re.current.focus(),ma(wn,ze)})},[Ea,ma,ee]),ar=Hu(x),Hr=Bu(b),Br=W2(ar,O),_l={...eT(ar,Hr),...In?tT(Hr):{}};dl&&(_l.whiteSpace="nowrap",_l.overflow="hidden",_l.textOverflow="ellipsis");const Fu=nT(ar,Hr);return v.createElement("div",{ref:Wn,style:Br,className:Ma("ei-container",S,N==null?void 0:N.container)},v.createElement("div",{ref:Jn,contentEditable:!0,suppressContentEditableWarning:!0,className:Ma("ei-editor",N==null?void 0:N.editor),style:_l,onInput:La,onKeyDown:gi,onKeyUp:fs,onMouseDown:Vu,onMouseUp:aa,onFocus:Yu,onBlur:hs,onClick:Ml,onPaste:Ur,onCompositionStart:Wa,onCompositionEnd:pi,spellCheck:!1}),tr&&!In?v.createElement("div",{className:Ma("ei-placeholder",N==null?void 0:N.placeholder),style:Fu},E):null,v.createElement(ET,{errors:An,editorRef:St,cursorOffset:wt,colors:x,styles:b,containerRef:Wn.current,classNames:N?{squiggly:N.squiggly,tooltip:N.tooltip}:void 0}),v.createElement(pT,{suggestions:Ke,selectedIndex:Ht,onSelect:R=>Dl(R,"Tab"),position:Fn,colors:x,styles:b,visible:ot,fixedWidth:qu(),renderHistoryItem:se,renderSavedSearchItem:Ye,renderDropdownHeader:Ie,cursorContext:wa,listRefCallback:R=>{Tl.current=R},renderType:Dn,classNames:N?{dropdown:N.dropdown,dropdownHeader:N.dropdownHeader,dropdownItem:N.dropdownItem}:void 0}),ct&&Fn?v.createElement(FT,{position:Fn,colors:ar,onSelect:Pc,colorConfig:x,styleConfig:b,datePickerInit:Lr,fixedWidth:void 0,datePresets:Y,datePickerClassName:N==null?void 0:N.datePicker}):null)}const GT=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function fx(t){var u;const a=window.getSelection();if(!a||a.rangeCount===0)return((u=t.textContent)==null?void 0:u.length)??0;const r=a.getRangeAt(0),i=r.cloneRange();return i.selectNodeContents(t),i.setEnd(r.endContainer,r.endOffset),i.toString().length}function XT(t){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const r=a.key.toLowerCase(),i=a.currentTarget,u=i.isContentEditable?i:i.querySelector("[contenteditable='true'], [contenteditable]")??i,o=t.current;if(r==="h"&&o){a.preventDefault();const m=o.getValue();let p=fx(u);(p<0||p>m.length)&&(p=m.length),p>0&&(o.setValue(m.slice(0,p-1)+m.slice(p)),o.setSelection(p-1,p-1));return}if(r==="u"&&o){a.preventDefault();const m=o.getValue();let p=fx(u);if((p<0||p>m.length)&&(p=m.length),p===0)return;let g=p;for(;g>0&&/\s/.test(m[g-1]??"");)g--;if(g===p)for(;g>0&&!/\s/.test(m[g-1]??"");)g--;g<p&&(o.setValue(m.slice(0,g)+m.slice(p)),o.setSelection(g,g));return}const f=r==="j"?"ArrowDown":r==="k"?"ArrowUp":null;f&&(a.preventDefault(),u.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function Eh(t){return String(t>0?t:0).padStart(3,"0")}function PT({features:t,phases:a,query:r,onQuery:i}){const u=v.useRef(null),o=XT(u),f=[{name:"feature",label:"Feature",type:"number",description:"Feature number, e.g. 1 (F001)"},{name:"phase",label:"Phase",type:"number",description:"Phase number, e.g. 2 (P002)"},{name:"task",label:"Task",type:"number",description:"Task number, e.g. 10 (T010). Comma-list supported."},{name:"id",label:"Short ID",type:"string",description:"Global 5-char short id, e.g. UUXD1"},{name:"status",label:"Status",type:"string",description:"Task status"},{name:"feature-status",label:"Feature status",type:"string",description:"Status of the feature"},{name:"phase-status",label:"Phase status",type:"string",description:"Status of the phase"},{name:"title",label:"Title",type:"string",description:"Substring match on title"}],m=v.useMemo(()=>{const g=[...new Set(t.map(N=>N.number))].sort((N,O)=>N-O),x=[...new Set(a.map(N=>N.number))].sort((N,O)=>N-O),b=[...new Set(a.flatMap(N=>N.tasks.map(O=>O.number)))].sort((N,O)=>N-O),E=[...new Set([...t.map(N=>N.shortId),...a.flatMap(N=>[N.shortId,...N.tasks.map(O=>O.shortId)])].filter(Boolean))],S=[...new Set(a.flatMap(N=>N.tasks.map(O=>O.title)))];return{featureNums:g,phaseNums:x,taskNums:b,shortIds:E,titles:S}},[t,a]);async function p(g,x){const b=x.toLowerCase();return g==="feature"?m.featureNums.filter(E=>String(E).startsWith(x)).slice(0,20).map(E=>({text:String(E),label:`F${Eh(E)}`})):g==="phase"?m.phaseNums.filter(E=>String(E).startsWith(x)).slice(0,20).map(E=>({text:String(E),label:`P${Eh(E)}`})):g==="task"?m.taskNums.filter(E=>String(E).startsWith(x)).slice(0,20).map(E=>({text:String(E),label:`T${Eh(E)}`})):g==="id"?m.shortIds.filter(E=>E.toLowerCase().startsWith(b)).slice(0,20).map(E=>({text:E,label:E})):g==="status"||g==="feature-status"||g==="phase-status"?GT.filter(E=>E.startsWith(b)).map(E=>({text:E,label:E})):g==="title"?m.titles.filter(E=>E.toLowerCase().includes(b)).slice(0,20).map(E=>({text:E,label:E.length>44?E.slice(0,44)+"…":E})):[]}return d.jsx("div",{className:"search-bar",children:d.jsx(IT,{fields:f,value:r,onChange:g=>i(g),onSearch:g=>i(g),fetchSuggestions:p,onKeyDown:o,inputRef:g=>{u.current=g},placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function QT(t,a){if(Object.keys(a).length===0)return t;const r=o=>{const f=a[o];return f?new Map(f.map((m,p)=>[m,p])):null},i=r("__features__");return(i?[...t].sort((o,f)=>(i.get(o.feature.id)??1/0)-(i.get(f.feature.id)??1/0)):t).map(o=>{const f=r(`phase-scope:${o.feature.id}`),m=f?[...o.allPhases].sort((p,g)=>(f.get(p.phase.id)??1/0)-(f.get(g.phase.id)??1/0)):o.allPhases;return{...o,allPhases:m.map(p=>{const g=r(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((b,E)=>(g.get(b.id)??1/0)-(g.get(E.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function KT({features:t,phases:a,activeTasks:r,projectStorageScope:i}){const u=L2({features:t,phases:a,projectStorageScope:i}),[o,f]=v.useState({});v.useEffect(()=>{f({})},[u.displayedWorkTree]);const m=v.useMemo(()=>QT(u.displayedWorkTree,o),[u.displayedWorkTree,o]),[p,g]=v.useState(!1),[x,b]=v.useState(null),[E,S]=v.useState(null),N=ee=>S(String(ee.active.id)),[O,T]=v.useState(0);v.useEffect(()=>{const ee=document.querySelector("header");if(!ee)return;const be=()=>T(ee.offsetHeight);be();const Ee=new ResizeObserver(be);return Ee.observe(ee),window.addEventListener("resize",be),()=>{Ee.disconnect(),window.removeEventListener("resize",be)}},[]),v.useEffect(()=>{const ee=window.setTimeout(()=>{const be=document.querySelector(".ap-search-sticky"),Ee=document.querySelector("header");if(!be||!Ee)return;const z=be.getBoundingClientRect();if(z.top<0){const B=z.top+window.scrollY-Ee.offsetHeight;window.scrollTo({top:Math.max(0,B),behavior:"smooth"})}},60);return()=>window.clearTimeout(ee)},[u.searchQuery,u.hideDone,u.hidePlanned,u.onlyActiveBranches]);const L=JN(ZN(im,{activationConstraint:{distance:5}})),X=async ee=>{const{active:be,over:Ee}=ee;if(S(null),!Ee||be.id===Ee.id)return;const z=String(be.id),B=String(Ee.id),ie=m.map(de=>de.feature.id);if(ie.includes(z)&&ie.includes(B)){const de=vu(ie,ie.indexOf(z),ie.indexOf(B)),pe=de.indexOf(z),D=pe>0?de[pe-1]??null:null,q=pe<de.length-1?de[pe+1]??null:null;f(ne=>({...ne,__features__:de})),await rh("feature",z,D,q).catch(()=>{});return}for(const de of m){const pe=de.allPhases.map(D=>D.phase.id);if(pe.includes(z)&&pe.includes(B)){const D=vu(pe,pe.indexOf(z),pe.indexOf(B)),q=D.indexOf(z),ne=q>0?D[q-1]??null:null,ce=q<D.length-1?D[q+1]??null:null;f(Te=>({...Te,[`phase-scope:${de.feature.id}`]:D})),await rh("phase",z,ne,ce).catch(()=>{});return}}for(const de of m)for(const pe of de.allPhases){const D=pe.allTasks.map(q=>q.id);if(D.includes(z)&&D.includes(B)){const q=vu(D,D.indexOf(z),D.indexOf(B)),ne=q.indexOf(z),ce=ne>0?q[ne-1]??null:null,Te=ne<q.length-1?q[ne+1]??null:null;f(Ne=>({...Ne,[`task-scope:${pe.phase.id}`]:q})),await rh("task",z,ce,Te).catch(()=>{});return}}},Y=ee=>u.expandedPhaseIds.includes(ee),Q=ee=>u.recentPhaseIds.includes(ee),K=ee=>u.recentTaskIds.includes(ee),[W,U]=kc(),[j,oe]=v.useState(null),me=W.get("locate"),ye=me?parseInt(me.replace(/^T/i,""),10):null;v.useEffect(()=>{if(ye==null||Number.isNaN(ye))return;const ee=a.flatMap(B=>B.tasks.map(ie=>({t:ie,p:B}))).find(({t:B})=>B.number===ye);if(!ee){U(B=>(B.delete("locate"),B),{replace:!0});return}const{t:be,p:Ee}=ee;if(u.onlyActiveBranches&&u.setOnlyActiveBranches(!1),u.hideDone&&u.setHideDone(!1),u.searchQuery&&u.setSearchQuery(""),u.setTreeOpenMode("all"),Ee.featureId){const B=Ee.featureId;u.expandedFeatureIds.includes(B)||u.setExpandedFeatureIds(ie=>ie.includes(B)?ie:[...ie,B])}u.expandedPhaseIds.includes(Ee.id)||u.setExpandedPhaseIds(B=>B.includes(Ee.id)?B:[...B,Ee.id]);const z=document.getElementById(`task-row-${ye}`);if(z){z.scrollIntoView({block:"center",behavior:"smooth"}),oe(be.id);const B=window.setTimeout(()=>oe(null),2500);return U(ie=>(ie.delete("locate"),ie),{replace:!0}),()=>window.clearTimeout(B)}},[ye,a,u.expandedFeatureIds,u.expandedPhaseIds,u.onlyActiveBranches,u.hideDone,u.searchQuery,u.treeOpenMode]);const Re=()=>{if(!E)return null;for(const ee of m){if(ee.feature.id===E)return d.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Wl,{featureNum:ee.feature.number}),d.jsx(Sa,{status:ee.feature.status})]}),d.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ee.feature.name})]});for(const be of ee.allPhases){if(be.phase.id===E)return d.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Wl,{featureNum:ee.feature.number,phaseNum:be.phase.number}),d.jsx(Sa,{status:be.phase.status})]}),d.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:be.phase.title})]});for(const Ee of be.allTasks)if(Ee.id===E)return d.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Wl,{featureNum:ee.feature.number,phaseNum:be.phase.number,taskNum:Ee.number}),d.jsx(Sa,{status:Ee.status})]}),d.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:Ee.title})]})}}return null};return d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(xt,{type:"button",variant:"secondary",onClick:()=>u.expandAll(),children:"Expand all"}),d.jsx(xt,{type:"button",variant:"secondary",onClick:()=>u.setTreeOpenMode("none"),children:"Collapse all"})]})]}),d.jsxs("div",{className:"ap-search-sticky z-20",style:{top:O},children:[d.jsx(PT,{features:t,phases:a,query:u.searchQuery,onQuery:u.setSearchQuery}),u.searchActive?d.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:[u.matchedTaskIds.size," match",u.matchedTaskIds.size===1?"":"es"," — clear the box to reset."]}):null,d.jsx("div",{className:"grid grid-cols-1 gap-2 rounded-[14px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 sm:rounded-[18px] sm:px-4 sm:py-3",children:d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:gap-2",children:[d.jsx("button",{type:"button",onClick:()=>u.setHideDone(ee=>!ee),className:`status-chip transition ${u.hideDone?"status-done":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Hide done"}),d.jsx("button",{type:"button",onClick:()=>u.setHidePlanned(ee=>!ee),className:`status-chip transition ${u.hidePlanned?"status-planned":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Hide planned"}),d.jsx("button",{type:"button",onClick:()=>u.setOnlyActiveBranches(ee=>!ee),className:`status-chip transition ${u.onlyActiveBranches?"status-in-progress":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Only active"}),d.jsx(xt,{type:"button",variant:"secondary",className:"!min-h-9 !px-3 !py-1 !text-xs sm:!min-h-11 sm:!px-4 sm:!py-2 sm:!text-sm",onClick:u.resetFilters,children:"Reset"}),d.jsx(xt,{type:"button",variant:"secondary",className:"!min-h-9 !px-3 !py-1 !text-xs sm:!min-h-11 sm:!px-4 sm:!py-2 sm:!text-sm",disabled:p,onClick:async()=>{g(!0),b(null);try{const ee=await eN(),be=ee.migrated,Ee=ee.integrity.duplicatePhaseIds.length,z=ee.integrity.danglingPhaseIds.length;b(`Repair done: renamed ${be.renamed}, repaired ${be.repaired} refs, inferred ${be.inferred}. Integrity: ${Ee} duplicate, ${z} dangling.`)}catch(ee){b(`Repair failed: ${ee instanceof Error?ee.message:String(ee)}`)}finally{g(!1)}},children:p?"Repairing…":"Repair"}),x?d.jsx("span",{className:"hidden text-xs text-[var(--text-muted)] sm:inline sm:truncate",children:x}):null]})})]}),d.jsx("div",{className:"grid gap-3",children:m.length>0?d.jsxs(JR,{sensors:L,collisionDetection:lR,onDragStart:N,onDragEnd:X,children:[d.jsx(cm,{items:m.map(ee=>ee.feature.id),strategy:om,children:m.map(ee=>d.jsx(dm,{id:ee.feature.id,children:d.jsx(U2,{entry:ee,expanded:u.expandedFeatureIds.includes(ee.feature.id),recentlyChanged:u.recentFeatureIds.includes(ee.feature.id),onToggle:()=>u.toggleExpandedFeature(ee.feature.id),isPhaseExpanded:Y,onTogglePhase:u.toggleExpandedPhase,isPhaseRecentlyChanged:Q,isTaskRecentlyChanged:K,highlightedTaskIds:(()=>{const be=u.searchActive?u.matchedTaskIds:void 0;if(!j)return be;const Ee=new Set(be??[]);return Ee.add(j),Ee})()})},ee.feature.id))}),d.jsx(v2,{dropAnimation:{duration:150,easing:"ease"},children:Re()})]}):r.length>0?r.map(ee=>{const be=ee.featureId?`/features/${ee.featureId}/phases/${ee.phaseId}/tasks/${ee.id}`:"/features";return d.jsxs(bt,{to:be,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[ee.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,d.jsxs("span",{className:"truncate",children:["T",_N(ee.number)," — ",ee.title]})]}),d.jsx(Sa,{status:ee.status})]}),d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:ee.phaseId})]},ee.id)}):d.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function ZT(){const{features:t,phases:a,activeTasks:r}=os(),{project:i}=Au("root"),u=er();Zn("edit",()=>u("/project/edit"));const f=i.projectRoot||i.planRoot||i.name||"default";return d.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[d.jsx(zn,{className:"grid grid-cols-1 gap-4",children:d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Project Goal"}),i.goal?d.jsx(Ln,{text:i.goal,className:"mt-2 max-w-4xl"}):d.jsx("p",{className:"mt-2 max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),d.jsx(bt,{to:"/project/edit",children:d.jsx(xt,{type:"button",shortcut:"edit",children:"Edit project"})})]})}),d.jsx(TN,{project:i}),d.jsx(zN,{features:t,phases:a}),d.jsx(KT,{features:t,phases:a,activeTasks:r,projectStorageScope:f}),d.jsx(DN,{features:t,phases:a}),d.jsx(AN,{features:t,phases:a})]})}async function JT(){const[t,a]=await Promise.all([sb(),Wh()]);return{features:t,phases:a}}function Nu(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function Tc(t){const a=[];return t.active&&a.push(`${t.active} active`),t.planned&&a.push(`${t.planned} planned`),t.done&&a.push(`${t.done} done`),t.blocked&&a.push(`${t.blocked} blocked`),t.canceled&&a.push(`${t.canceled} canceled`),a.join(" · ")}function WT(t){const a=Nu();for(const r of t){if(r.status==="in-progress"||r.status==="discovery"){a.active+=1;continue}if(r.status==="planned"||r.status==="draft"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function Gb(t){const a=Nu();for(const r of t){if(r.status==="in-progress"){a.active+=1;continue}if(r.status==="planned"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function ej(t){const a=Nu();for(const r of t){if(r.status==="in-progress"){a.active+=1;continue}if(r.status==="planned"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function tj({feature:t,phasesCount:a,tasksCount:r,phaseSummary:i,taskSummary:u,activity:o}){var O;const f=ss(),m=ss(),g=((O=f.formData)==null?void 0:O.get("status"))??t.status,x=f.state!=="idle",b=m.state!=="idle",E=Tc(i),S=Tc(u),N=t.description||(o?`${o.doneTasks}/${r} done · ${o.remainingTasks} left${o.blockedTasks?` · ${o.blockedTasks} blocked`:""}`:"");return d.jsxs("div",{className:"surface-card px-4 py-2",children:[d.jsxs("div",{className:"grid gap-2 xl:grid-cols-[minmax(0,1fr)_minmax(0,132px)_minmax(0,152px)_124px_44px_44px] xl:items-center",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(kr,{type:"feature",number:t.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:g})})]}),d.jsx(bt,{to:`/features/${t.id}`,className:"entity-link--feature min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline lg:w-auto lg:truncate",children:t.name})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[d.jsx(bt,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:d.jsx(xt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(m.Form,{method:"post",action:`/features/${t.id}/delete`,onSubmit:T=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||T.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",disabled:b||x,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[a," phases"]}),E?d.jsx("div",{className:"mt-0.5 break-words",children:E}):null]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r," tasks"]}),S?d.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),d.jsx(f.Form,{method:"post",action:`/features/${t.id}/status`,className:"w-full xl:w-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx("select",{name:"status",value:g,disabled:x||b,"aria-busy":x,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:T=>f.submit(T.currentTarget.form),children:Ic.map(T=>d.jsx("option",{value:T.value,children:T.label},T.value))}),d.jsx(is,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),d.jsx(bt,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:d.jsx(xt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(m.Form,{method:"post",action:`/features/${t.id}/delete`,className:"hidden xl:block",onSubmit:T=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||T.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",disabled:b||x,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]}),N?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:N}):null]})}const nj={feature:{label:"Feature",Icon:xc},phase:{label:"Phase",Icon:NE},task:{label:"Task",Icon:ab}};function aj({kind:t,label:a}){const{Icon:r,label:i}=nj[t];return d.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[d.jsx(r,{className:"h-3.5 w-3.5"}),d.jsx("span",{children:a??i})]})}function Pa({className:t="",...a}){return d.jsx("input",{className:`field-control ${t}`,...a})}function $u({className:t="",...a}){return d.jsx("select",{className:`field-control ${t}`,...a})}function mm({query:t,status:a,statusOptions:r,placeholder:i,clearTo:u,resultsLabel:o}){const f=Jh();return d.jsxs(_a,{method:"get",className:"surface-card grid gap-3 p-3 md:grid-cols-[minmax(0,1fr)_200px_auto_auto] md:items-end sm:p-4",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),d.jsx(Pa,{id:"list-filter-query",name:"q",defaultValue:t,placeholder:i,className:"min-h-11 py-2.5",onChange:m=>f(m.currentTarget.form)})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),d.jsxs("div",{className:"relative",children:[d.jsxs($u,{id:"list-filter-status",name:"status",defaultValue:a,className:"min-h-11 appearance-none py-2.5 pr-8",children:[d.jsx("option",{value:"",children:"All statuses"}),r.map(m=>d.jsx("option",{value:m.value,children:m.label},m.value))]}),d.jsx(is,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}),d.jsx(xt,{type:"submit",variant:"secondary",className:"min-h-11",children:"Apply filters"}),d.jsx(bt,{to:u,className:"inline-flex min-h-11 items-center justify-center rounded-[14px] px-3 text-sm font-semibold text-[var(--text-muted)] transition hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",children:"Clear"}),d.jsx("div",{className:"text-sm text-[var(--text-muted)] md:col-span-4",children:o})]})}function pm(t,a){const r=t.trim().toLowerCase();return r?a.some(i=>i==null?void 0:i.toLowerCase().includes(r)):!0}function lj(t){const a=new Map,r=new Map,i=new Map,u=new Map,o=new Map;for(const f of t)f.featureId&&o.set(f.featureId,[...o.get(f.featureId)??[],f]);for(const[f,m]of o)a.set(f,m.length),r.set(f,m.reduce((p,g)=>p+g.tasks.length,0)),i.set(f,WT(m)),u.set(f,Gb(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,tasksByFeature:r,phaseSummaryByFeature:i,taskSummaryByFeature:u}}function rj(){var E,S;const{features:t,phases:a}=os(),{phasesByFeature:r,tasksByFeature:i,phaseSummaryByFeature:u,taskSummaryByFeature:o}=lj(a),f=er(),[m]=kc(),p=((E=m.get("q"))==null?void 0:E.trim())??"",g=((S=m.get("status"))==null?void 0:S.trim())??"",x=v.useCallback(()=>f("new"),[f]);Zn("create",x);const b=v.useMemo(()=>t.filter(N=>(!g||N.status===g)&&pm(p,[N.name,N.id,N.description])),[t,p,g]);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(zn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{children:[d.jsx(aj,{kind:"feature",label:"Features"}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter by name or status, then inspect child phases and tasks directly from the rows."})]}),d.jsx(bt,{to:"new",children:d.jsx(xt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),d.jsx(mm,{query:p,status:g,statusOptions:Ic,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:b.length===t.length?`${t.length} features`:`${b.length} of ${t.length} features`}),d.jsx("div",{className:"grid gap-3",children:b.length>0?b.map(N=>d.jsx(tj,{feature:N,phasesCount:r.get(N.id)??0,tasksCount:i.get(N.id)??0,phaseSummary:u.get(N.id)??Nu(),taskSummary:o.get(N.id)??Nu()},N.id)):d.jsx(zn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),d.jsx(Ou,{})]})}async function sj({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[r,i]=await Promise.all([Mu(a),Wh(a)]);return{feature:r,phases:i}}function ij({featureId:t,feature:a,phase:r}){var x;const i=ss(),u=ss(),f=((x=i.formData)==null?void 0:x.get("status"))??r.status,m=i.state!=="idle",p=u.state!=="idle",g=Tc(Gb(r.tasks));return d.jsxs("div",{className:"surface-card px-4 py-2",children:[d.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(kr,{type:"phase",number:r.number}),d.jsx(ni,{type:"phase",featureNum:a.number}),r.handoff?d.jsx(tm,{phaseId:r.id,updatedAt:r.handoffUpdatedAt}):null,d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:f})})]}),d.jsx(bt,{to:`/features/${t}/phases/${r.id}`,className:"entity-link--phase min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline lg:w-auto lg:truncate",children:r.title})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[d.jsx(bt,{to:`/features/${t}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,children:d.jsx(xt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${r.id}/delete`,onSubmit:b=>{window.confirm(`Delete phase “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r.tasks.length," tasks"]}),g?d.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),d.jsx(i.Form,{method:"post",action:`/features/${t}/phases/${r.id}/status`,className:"w-full lg:w-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx("select",{name:"status",value:f,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:b=>i.submit(b.currentTarget.form),children:Gc.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))}),d.jsx(is,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),d.jsx(bt,{to:`/features/${t}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,className:"hidden lg:block",children:d.jsx(xt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${r.id}/delete`,className:"hidden lg:block",onSubmit:b=>{window.confirm(`Delete phase “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]}),r.summary?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:r.summary}):null]})}function gm({items:t,className:a=""}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:t.map((r,i)=>{const u=i===t.length-1,o=r.to&&!u?d.jsx(bt,{to:r.to,className:"font-semibold text-[var(--accent)] hover:underline",children:r.label}):d.jsx("span",{className:u?"text-[var(--text)]":"text-[var(--text-muted)]",children:r.label});return d.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[i>0?d.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,d.jsx("span",{className:"min-w-0 break-words",children:o})]},`${r.label}-${i}`)})})}function yn({className:t="",children:a,...r}){return d.jsx("div",{className:`surface-card p-4 ${t}`,...r,children:a})}function vm({decisions:t}){return t.length===0?null:d.jsxs("details",{className:"group mt-4",children:[d.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:d.jsxs("span",{children:["Accepted decisions (",t.length,")"]})}),d.jsx("div",{className:"mt-2 grid gap-3",children:t.map(a=>d.jsxs("div",{className:"surface-card px-4 py-3",children:[d.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?d.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),d.jsx(Ln,{text:a.decision,className:"mt-1"})]}):null,a.rationale?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),d.jsx(Ln,{text:a.rationale,className:"mt-1"})]}):null,a.implementationNotes?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),d.jsx(Ln,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}function uj(t){return t.reduce((a,r)=>a+r.tasks.length,0)}function oj(t){let a=0,r=0,i=0,u=0;for(const o of t)for(const f of o.tasks)f.status==="in-progress"&&(a+=1),f.status==="done"&&(r+=1),f.status==="blocked"&&(i+=1),["done","canceled"].includes(f.status)||(u+=1);return{inProgress:a,done:r,blocked:i,remaining:u}}function cj(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function dj(){var O,T;const{feature:t,phases:a}=os(),r=t.acceptedDecisions??[],i=uj(a),u=oj(a),o=cj(a),[f]=kc(),m=((O=f.get("q"))==null?void 0:O.trim())??"",p=((T=f.get("status"))==null?void 0:T.trim())??"",g=v.useMemo(()=>a.filter(L=>(!p||L.status===p)&&pm(m,[L.title,L.id,L.summary,L.description])),[a,m,p]),x=er(),b=v.useRef(null),E=v.useCallback(()=>x("edit"),[x]),S=v.useCallback(()=>x("phases/new"),[x]),N=v.useCallback(()=>{var L;(L=b.current)==null||L.requestSubmit()},[]);return Zn("edit",E),Zn("create",S),Zn("delete",N),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(bt,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(_c,{className:"h-4 w-4"})," Back to features"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(gm,{items:[{label:"Features",to:"/features"},{label:t.name}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(_r,{id:ri({featureNum:t.number}),children:d.jsx(Wl,{featureNum:t.number})}),t.shortId?d.jsx(si,{shortId:t.shortId}):null,d.jsx(Sa,{status:t.status})]}),d.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:t.name}),t.description?d.jsx(Ln,{text:t.description,className:"plan-description mt-3 max-w-4xl"}):null,d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(bt,{to:"edit",children:d.jsx(xt,{type:"button",shortcut:"edit",children:"Edit feature"})}),d.jsx(_a,{ref:b,method:"post",action:`/features/${t.id}/delete`,className:"inline-flex",onSubmit:L=>{window.confirm(`Delete feature "${t.name}"?`)||L.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(o==null?void 0:o.title)||"No active phase"})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.length})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:i})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Window"}),d.jsxs("p",{className:"mt-2 text-sm font-semibold text-[var(--text)]",children:[t.startDate||"Not set"," → ",t.endDate||"Not set"]})]})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]})]}),t.workDone||t.workRemaining?d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.workDone?d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done:"}),d.jsx(Ln,{text:t.workDone,className:"mt-2"})]}):null,t.workRemaining?d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining:"}),d.jsx(Ln,{text:t.workRemaining,className:"mt-2"})]}):null]}):null,r.length>0?d.jsx(vm,{decisions:r}):null]}),d.jsxs(zn,{className:"grid gap-5",children:[d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[d.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[d.jsx(kr,{type:"phase",number:0}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter this feature's phases by name or status."})]}),d.jsx(bt,{to:"phases/new",children:d.jsx(xt,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),d.jsx(mm,{query:m,status:p,statusOptions:Gc,placeholder:"Search phase title, id, or summary",clearTo:`/features/${t.id}`,resultsLabel:g.length===a.length?`${a.length} phases`:`${g.length} of ${a.length} phases`}),d.jsx("div",{className:"grid gap-3",children:g.length>0?g.map(L=>d.jsx(ij,{featureId:t.id,feature:t,phase:L},L.id)):d.jsx(zn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),d.jsx(Ou,{})]})}async function fj({params:t}){const{featureId:a,phaseId:r}=t;if(!a||!r)throw new Response("featureId and phaseId required",{status:400});const[i,u]=await Promise.all([Mu(a),Hc(r)]);return{feature:i,phase:u}}function hx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function hj({featureId:t,phaseId:a,task:r}){var x;const i=ss(),u=ss(),f=((x=i.formData)==null?void 0:x.get("status"))??r.status,m=i.state!=="idle",p=u.state!=="idle",g=Tc(ej(r.subtasks));return d.jsxs("div",{className:"surface-card px-4 py-2",children:[d.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(kr,{type:"task",number:r.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:f})})]}),d.jsx(bt,{to:`/features/${t}/phases/${a}/tasks/${r.id}`,className:"entity-link--task min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline lg:w-auto lg:truncate",children:r.title})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[d.jsx(bt,{to:`/features/${t}/phases/${a}/tasks/${r.id}/edit`,"aria-label":`Edit task ${r.title}`,children:d.jsx(xt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${r.id}/delete`,onSubmit:b=>{window.confirm(`Delete task “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r.subtasks.length," subtasks · ",r.checklist.length," checklist"]}),g?d.jsx("div",{className:"mt-0.5 break-words",children:g}):d.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),d.jsx(i.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${r.id}/status`,className:"w-full lg:w-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx("select",{name:"status",value:f,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:b=>i.submit(b.currentTarget.form),children:Uu.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))}),d.jsx(is,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),d.jsx(bt,{to:`/features/${t}/phases/${a}/tasks/${r.id}/edit`,"aria-label":`Edit task ${r.title}`,className:"hidden lg:block",children:d.jsx(xt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${r.id}/delete`,className:"hidden lg:block",onSubmit:b=>{window.confirm(`Delete task “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]}),d.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[r.startedAt?d.jsxs("span",{children:["Started ",hx(r.startedAt)]}):null,r.completedAt?d.jsxs("span",{children:["Completed ",hx(r.completedAt)]}):null]}),r.description?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:r.description}):null]})}function mj(t){let a=0,r=0,i=0,u=0;for(const o of t.tasks)o.status==="in-progress"&&(a+=1),o.status==="done"&&(r+=1),o.status==="blocked"&&(i+=1),["done","canceled"].includes(o.status)||(u+=1);return{inProgress:a,done:r,blocked:i,remaining:u}}function pj(){var Y,Q;const{feature:t,phase:a}=os(),r=a.decisions??[],i=a.acceptedDecisions??[],u=mj(a),[o]=kc(),f=((Y=o.get("q"))==null?void 0:Y.trim())??"",m=((Q=o.get("status"))==null?void 0:Q.trim())??"",p=v.useMemo(()=>a.tasks.filter(K=>(!m||K.status===m)&&pm(f,[K.title,K.id,K.description,K.shortName])),[a.tasks,f,m]),g=er(),x=v.useRef(null),[b,E]=v.useState(a.handoff??""),[S,N]=v.useState(!1),O=v.useCallback(()=>g("edit"),[g]),T=v.useCallback(()=>g("tasks/new"),[g]),L=v.useCallback(()=>{var K;(K=x.current)==null||K.requestSubmit()},[]),X=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){N(!0);try{await JE(a.id),E("")}catch{}finally{N(!1)}}},[a.id]);return Zn("edit",O),Zn("create",T),Zn("delete",L),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(bt,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(_c,{className:"h-4 w-4"})," Back to feature"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(gm,{items:[{label:"Features",to:"/features"},{label:t.name,to:`/features/${t.id}`},{label:a.title}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(_r,{id:ri({featureNum:t.number,phaseNum:a.number}),children:d.jsx(Wl,{featureNum:t.number,phaseNum:a.number})}),a.shortId?d.jsx(si,{shortId:a.shortId}):null,b?d.jsx(tm,{phaseId:a.id,updatedAt:a.handoffUpdatedAt}):null,d.jsx(Sa,{status:a.status})]}),d.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:a.title}),a.summary?d.jsx(Ln,{text:a.summary,className:"mt-3 max-w-4xl"}):null,d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(bt,{to:"edit",children:d.jsx(xt,{type:"button",shortcut:"edit",children:"Edit phase"})}),d.jsx(bt,{to:"tasks/new",children:d.jsx(xt,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})}),d.jsx(_a,{ref:x,method:"post",action:`/features/${t.id}/phases/${a.id}/delete`,className:"inline-flex",onSubmit:K=>{window.confirm(`Delete phase "${a.title}"?`)||K.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.tasks.length})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.goals.length})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.dependencies.length})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.completionCriteria.length})]})]}),a.description?d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Description:"}),d.jsx(Ln,{text:a.description,className:"plan-description mt-2"})]}):null,r.length>0?d.jsxs("details",{className:"group mt-4",children:[d.jsx("summary",{className:"flex items-center gap-2 cursor-pointer font-semibold text-[var(--text)] select-none",children:d.jsxs("span",{children:["Decisions (",r.length,")"]})}),d.jsx("div",{className:"mt-2 ml-4 space-y-2 border-l-2 border-[var(--border)] pl-4",children:r.map((K,W)=>d.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:d.jsx(Ln,{text:K})},W))})]}):null,i.length>0?d.jsx(vm,{decisions:i}):null]}),b?d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Handoff"}),d.jsx("button",{type:"button",onClick:X,disabled:S,className:"rounded-lg border border-[var(--border)] px-3 py-2 text-sm text-[var(--text-muted)] hover:bg-[var(--surface-card)] disabled:opacity-60",children:S?"Clearing…":"Clear handoff"})]}),d.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:d.jsx(Ln,{text:b,className:"formatted-text max-w-none"})})]}):null,d.jsxs(zn,{className:"grid gap-5",children:[d.jsxs("div",{children:[d.jsx(kr,{type:"task",number:0}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter this phase's tasks by name or status."})]}),d.jsx(mm,{query:f,status:m,statusOptions:Uu,placeholder:"Search task title, id, or description",clearTo:`/features/${t.id}/phases/${a.id}`,resultsLabel:p.length===a.tasks.length?`${a.tasks.length} tasks`:`${p.length} of ${a.tasks.length} tasks`}),d.jsx("div",{className:"grid gap-3",children:p.length>0?p.map(K=>d.jsx(hj,{featureId:t.id,phaseId:a.id,task:K},K.id)):d.jsx(zn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),d.jsx(Ou,{})]})}async function gj({params:t}){const{featureId:a,phaseId:r,taskId:i}=t;if(!a||!r||!i)throw new Response("featureId, phaseId and taskId required",{status:400});const[u,o,f]=await Promise.all([Mu(a),Hc(r),Bc(i)]);return{feature:u,phase:o,task:f}}function Nh(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function vj({featureId:t,phaseId:a,taskId:r,item:i}){const u=ss(),o=u.formData?u.formData.get("checked")==="true":i.checked,f=u.state!=="idle";return d.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[d.jsx("input",{type:"checkbox",checked:o,onChange:()=>u.submit({checked:i.checked?"false":"true"},{method:"post",action:`/features/${t}/phases/${a}/tasks/${r}/checklist/${i.id}/toggle`}),disabled:f,className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]","aria-label":`Toggle checklist item ${i.title}`}),d.jsx("div",{className:"min-w-0",children:d.jsx("p",{className:`text-sm ${o?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:i.title})})]})}function yj(){var x,b,E;const{feature:t,phase:a,task:r}=os(),i=r.decisions??[],u=r.acceptedDecisions??[],o=r.checklist??[],f=er(),m=v.useRef(null),p=v.useCallback(()=>f("edit"),[f]),g=v.useCallback(()=>{var S;(S=m.current)==null||S.requestSubmit()},[]);return Zn("edit",p),Zn("delete",g),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(bt,{to:`/features/${t.id}/phases/${a.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(_c,{className:"h-4 w-4"})," Back to phase"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(gm,{items:[{label:"Features",to:"/features"},{label:t.name,to:`/features/${t.id}`},{label:a.title,to:`/features/${t.id}/phases/${a.id}`},{label:r.title}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(_r,{id:ri({featureNum:t.number,phaseNum:a.number,taskNum:r.number}),children:d.jsx(Wl,{featureNum:t.number,phaseNum:a.number,taskNum:r.number})}),r.shortId?d.jsx(si,{shortId:r.shortId}):null,d.jsx(Sa,{status:r.status})]}),d.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:r.title}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(bt,{to:"edit",children:d.jsx(xt,{type:"button",shortcut:"edit",children:"Edit task"})}),d.jsx(_a,{ref:m,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${r.id}/delete`,className:"inline-flex",onSubmit:S=>{window.confirm(`Delete task "${r.title}"?`)||S.preventDefault()},children:d.jsx(xt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),d.jsxs(zn,{className:"grid gap-4",children:[r.description?d.jsx(Ln,{text:r.description,className:"plan-description"}):null,r.notes?d.jsxs("details",{className:"group mt-4 border border-[var(--border)] rounded-lg overflow-hidden",children:[d.jsxs("summary",{className:"flex items-center justify-between p-3 cursor-pointer font-semibold text-[var(--text)] bg-[var(--surface-elevated)] hover:bg-[var(--surface-strong)] transition-colors select-none",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("span",{className:"text-sm",children:"Notes"})}),d.jsx(is,{className:"h-4 w-4 transition-transform group-open:rotate-180 text-[var(--text-muted)]"})]}),d.jsx("div",{className:"p-3 border-t border-[var(--border)] bg-[var(--surface)]",children:d.jsx(Ln,{text:r.notes})})]}):d.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:"No notes"}),d.jsxs("details",{className:"group mt-4 border border-[var(--border)] rounded-lg overflow-hidden",open:r.statusLog&&r.statusLog.length>0,children:[d.jsxs("summary",{className:"flex items-center justify-between p-3 cursor-pointer font-semibold text-[var(--text)] bg-[var(--surface-elevated)] hover:bg-[var(--surface-strong)] transition-colors select-none",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"text-sm",children:["Status History (",((x=r.statusLog)==null?void 0:x.length)??0,")"]})}),d.jsx(is,{className:"h-4 w-4 transition-transform group-open:rotate-180 text-[var(--text-muted)]"})]}),d.jsx("div",{className:"p-3 border-t border-[var(--border)] bg-[var(--surface)]",children:r.statusLog&&r.statusLog.length>0?d.jsx("div",{className:"mt-3 ml-2 border-l-2 border-[var(--border)] pl-4 space-y-3",children:[...r.statusLog].reverse().map((S,N)=>d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute -left-[21px] top-1.5 h-2.5 w-2.5 rounded-full border-2 border-[var(--border)] bg-[var(--surface)]"}),d.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[d.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:Nh(S.date)}),d.jsxs("span",{className:`text-xs font-bold px-1.5 py-0.5 rounded-full ${S.toStatus==="done"?"bg-[color:color-mix(in_srgb,var(--color-status-done)_16%,transparent)] text-[var(--color-status-done)]":S.toStatus==="blocked"?"bg-[color:color-mix(in_srgb,var(--color-status-blocked)_16%,transparent)] text-[var(--color-status-blocked)]":S.toStatus==="canceled"?"bg-[color:color-mix(in_srgb,var(--color-status-canceled)_16%,transparent)] text-[var(--color-status-canceled)]":S.toStatus==="in-progress"?"bg-[color:color-mix(in_srgb,var(--color-status-in-progress)_16%,transparent)] text-[var(--color-status-in-progress)]":"bg-[color:color-mix(in_srgb,var(--color-status-planned)_16%,transparent)] text-[var(--color-status-planned)]"}`,children:[S.fromStatus," → ",S.toStatus]})]}),S.title&&S.title!==`${S.fromStatus} → ${S.toStatus}`?d.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--text)]",children:S.title}):null,S.description?d.jsx("p",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:S.description}):null]},S.id))}):d.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."})})]}),i.length>0?d.jsxs("details",{className:"group mt-4",children:[d.jsx("summary",{className:"flex items-center gap-2 cursor-pointer font-semibold text-[var(--text)] select-none",children:d.jsxs("span",{children:["Decisions (",i.length,")"]})}),d.jsx("div",{className:"mt-2 ml-4 space-y-2 border-l-2 border-[var(--border)] pl-4",children:i.map((S,N)=>d.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:d.jsx(Ln,{text:S})},N))})]}):null,u.length>0?d.jsx(vm,{decisions:u}):null,d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:o.length})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((b=r.subtasks)==null?void 0:b.length)??0})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Started"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:r.startedAt?Nh(r.startedAt):"—"})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completed"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:r.completedAt?Nh(r.completedAt):"—"})]}),d.jsxs(yn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phase"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:a.title})]})]}),o.length?d.jsxs("div",{className:"grid gap-3",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-[var(--text)]",children:"Checklist"}),d.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:"Always visible and linked to the real task checklist."})]}),d.jsx("div",{className:"grid gap-2",children:o.map(S=>d.jsx(vj,{featureId:t.id,phaseId:a.id,taskId:r.id,item:S},S.id))})]}):null,(E=r.subtasks)!=null&&E.length?d.jsxs("details",{className:"surface-card px-4 py-4",children:[d.jsx("summary",{className:"cursor-pointer list-none text-sm font-bold text-[var(--text)]",children:"Subtasks"}),d.jsx("div",{className:"mt-3 grid gap-2",children:r.subtasks.map(S=>d.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:S.title}),d.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:S.id})]}),d.jsx(Sa,{status:S.status})]},S.id))})]}):null]}),d.jsx(Ou,{})]})}const xj=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function ci({title:t,description:a,children:r}){const i=er(),u=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{var g;const f=u.current;if(!f)return;const m=document.activeElement;(g=o.current)==null||g.focus();const p=x=>{if(x.key==="Escape"){x.preventDefault(),i(-1);return}if(x.key!=="Tab")return;const b=Array.from(f.querySelectorAll(xj)).filter(O=>O.offsetParent!==null);if(b.length===0){x.preventDefault(),f.focus();return}const E=b[0],S=b[b.length-1],N=document.activeElement;x.shiftKey?(N===E||!f.contains(N))&&(x.preventDefault(),S.focus()):N===S&&(x.preventDefault(),E.focus())};return window.addEventListener("keydown",p),()=>{var x;window.removeEventListener("keydown",p),(x=m==null?void 0:m.focus)==null||x.call(m)}},[i]),d.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[d.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>i(-1),"aria-label":"Close modal",tabIndex:-1}),d.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:d.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"surface-panel flex max-h-[calc(100vh-2rem)] w-full max-w-2xl flex-col overflow-hidden p-6 outline-none md:max-h-[calc(100vh-3rem)] md:p-8",children:[d.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:t}),a?d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:a}):null]}),d.jsx("button",{ref:o,type:"button",onClick:()=>i(-1),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] text-[var(--text-muted)] transition hover:text-[var(--text)]","aria-label":"Close modal",children:d.jsx($E,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:r})]})})]})}function di({className:t="",children:a,...r}){return d.jsx("div",{className:`sticky bottom-0 mt-2 flex justify-end gap-3 border-t border-[var(--border)] bg-[var(--surface)] px-1 pt-4 pb-1 backdrop-blur-xl ${t}`,...r,children:a})}function Nt({label:t,children:a}){return d.jsxs("label",{className:"grid gap-2",children:[d.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:t}),a]})}function qn(t){return d.jsx("textarea",{className:"field-control field-textarea",...t})}function bj(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Zn("submit",i,{allowInEditable:!0}),d.jsx(ci,{title:"Create feature",description:"Top-level container for phases and tasks.",children:d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Feature name",children:d.jsx(Pa,{name:"name",placeholder:"Products page implementation",required:!0})}),d.jsx(Nt,{label:"Description",children:d.jsx(qn,{name:"description",placeholder:"Short context for the feature"})}),d.jsx(di,{children:d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function Sj(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var f;return(f=r.current)==null?void 0:f.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const o=Au("feature-detail").feature;return d.jsx(ci,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Name",children:d.jsx(Pa,{name:"name",defaultValue:o.name,required:!0})}),d.jsx(Nt,{label:"Description",children:d.jsx(qn,{name:"description",defaultValue:o.description})}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsx(Nt,{label:"Start date",children:d.jsx(Pa,{type:"date",name:"startDate",defaultValue:o.startDate})}),d.jsx(Nt,{label:"End date",children:d.jsx(Pa,{type:"date",name:"endDate",defaultValue:o.endDate})})]}),d.jsx(Nt,{label:"Status",children:d.jsx($u,{name:"status",defaultValue:o.status,children:Ic.map(f=>d.jsx("option",{value:f.value,children:f.label},f.value))})}),d.jsx(Nt,{label:"Priority",children:d.jsx(Pa,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),d.jsx(Nt,{label:"Work done",children:d.jsx(qn,{name:"workDone",defaultValue:o.workDone})}),d.jsx(Nt,{label:"Work remaining",children:d.jsx(qn,{name:"workRemaining",defaultValue:o.workRemaining})}),d.jsx(di,{children:d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function wj(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Zn("submit",i,{allowInEditable:!0}),d.jsx(ci,{title:"Create phase",description:"A phase belongs to the current feature.",children:d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Phase title",children:d.jsx(Pa,{name:"title",placeholder:"API creation",required:!0})}),d.jsx(Nt,{label:"Summary",children:d.jsx(qn,{name:"summary",placeholder:"Brief phase summary"})}),d.jsx(Nt,{label:"Description",children:d.jsx(qn,{name:"description",placeholder:"Initial implementation notes"})}),d.jsx(di,{children:d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function Is(t){return t.join(`
|
|
209
|
+
`)}function Ej(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var f;return(f=r.current)==null?void 0:f.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const o=Au("phase-detail").phase;return d.jsx(ci,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Title",children:d.jsx(Pa,{name:"title",defaultValue:o.title,required:!0})}),d.jsx(Nt,{label:"Status",children:d.jsx($u,{name:"status",defaultValue:o.status,children:Gc.map(f=>d.jsx("option",{value:f.value,children:f.label},f.value))})}),d.jsx(Nt,{label:"Priority",children:d.jsx(Pa,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),d.jsx(Nt,{label:"Summary",children:d.jsx(qn,{name:"summary",defaultValue:o.summary})}),d.jsx(Nt,{label:"Description",children:d.jsx(qn,{name:"description",defaultValue:o.description})}),d.jsx(Nt,{label:"Goals (one per line)",children:d.jsx(qn,{name:"goals",defaultValue:Is(o.goals)})}),d.jsx(Nt,{label:"Non-goals (one per line)",children:d.jsx(qn,{name:"nonGoals",defaultValue:Is(o.nonGoals)})}),d.jsx(Nt,{label:"Dependencies (one per line)",children:d.jsx(qn,{name:"dependencies",defaultValue:Is(o.dependencies)})}),d.jsx(Nt,{label:"Risks (one per line)",children:d.jsx(qn,{name:"risks",defaultValue:Is(o.risks)})}),d.jsx(Nt,{label:"Open questions (one per line)",children:d.jsx(qn,{name:"openQuestions",defaultValue:Is(o.openQuestions)})}),d.jsx(Nt,{label:"Completion criteria (one per line)",children:d.jsx(qn,{name:"completionCriteria",defaultValue:Is(o.completionCriteria)})}),d.jsx(di,{children:d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function Nj(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Zn("submit",i,{allowInEditable:!0}),d.jsx(ci,{title:"Create task",description:"A task belongs to the current phase.",children:d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Task title",children:d.jsx(Pa,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),d.jsx(Nt,{label:"Description",children:d.jsx(qn,{name:"description",placeholder:"Initial task context"})}),d.jsx(Nt,{label:"Status",children:d.jsx($u,{name:"status",defaultValue:"planned",children:Uu.map(u=>d.jsx("option",{value:u.value,children:u.label},u.value))})}),d.jsx(di,{children:d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function Rj(t){return t.map(a=>a.title).join(`
|
|
210
|
+
`)}function Tj(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var f;return(f=r.current)==null?void 0:f.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const o=Au("task-detail").task;return d.jsx(ci,{title:"Edit task",description:"Update execution details and checklist items.",children:d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Title",children:d.jsx(Pa,{name:"title",defaultValue:o.title,required:!0})}),d.jsx(Nt,{label:"Status",children:d.jsx($u,{name:"status",defaultValue:o.status,children:Uu.map(f=>d.jsx("option",{value:f.value,children:f.label},f.value))})}),d.jsx(Nt,{label:"Priority",children:d.jsx(Pa,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),d.jsx(Nt,{label:"Description",children:d.jsx(qn,{name:"description",defaultValue:o.description})}),d.jsx(Nt,{label:"Checklist (one per line)",children:d.jsx(qn,{name:"checklist",defaultValue:Rj(o.checklist)})}),d.jsx(di,{children:d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function jj(){const a=Mr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var o;return(o=r.current)==null?void 0:o.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const{project:u}=Au("root");return d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(bt,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(_c,{className:"h-4 w-4"})," Back to dashboard"]}),d.jsxs(zn,{className:"grid gap-5",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project goal"}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Define the main objective of the project. This long-form goal appears in the Project Goal card on the dashboard."})]}),d.jsxs(_a,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Project goal",children:d.jsx(qn,{name:"goal",defaultValue:u.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx(bt,{to:"/",children:d.jsx(xt,{type:"button",variant:"ghost",children:"Cancel"})}),d.jsx(xt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save goal"})]})]})]})]})}function ka(t,a){const r=t.get(a);if(typeof r!="string"||r.trim()==="")throw new Response(`Missing field: ${a}`,{status:400});return r.trim()}function ca(t,a){const r=t.get(a);return typeof r=="string"?r.trim():""}function ym(t,a){const r=t.get(a);if(typeof r!="string")return 0;const i=r.trim();if(i==="")return 0;const u=Number(i);return Number.isFinite(u)?u:0}function as(t,a){return ca(t,a).split(`
|
|
211
|
+
`).map(r=>r.trim()).filter(Boolean)}function on(t,a){const r=t[a];if(!r)throw new Response(`Missing route param: ${a}`,{status:400});return r}async function Dj({request:t}){const a=await t.formData();return await GE({name:ka(a,"name"),description:ca(a,"description")}),Rl("/features")}async function Cj({request:t,params:a}){const r=on(a,"featureId"),i=await Mu(r),u=await t.formData();return await ib({...i,name:ka(u,"name"),description:ca(u,"description"),startDate:ca(u,"startDate"),endDate:ca(u,"endDate"),status:ka(u,"status"),priority:ym(u,"priority"),workDone:ca(u,"workDone"),workRemaining:ca(u,"workRemaining")}),Rl(`/features/${r}`)}async function Aj({params:t}){return await XE(on(t,"featureId")),Rl("/features")}async function Oj({request:t,params:a}){const r=on(a,"featureId"),i=await Mu(r),u=await t.formData();return await ib({...i,status:ka(u,"status")}),null}async function Mj({request:t,params:a}){const r=on(a,"featureId"),i=await t.formData();return await PE({featureId:r,title:ka(i,"title"),summary:ca(i,"summary"),description:ca(i,"description")}),Rl(`/features/${r}`)}async function kj({request:t,params:a}){const r=on(a,"featureId"),i=on(a,"phaseId"),u=await Hc(i),o=await t.formData();return await ub({...u,title:ka(o,"title"),status:ka(o,"status"),priority:ym(o,"priority"),summary:ca(o,"summary"),description:ca(o,"description"),goals:as(o,"goals"),nonGoals:as(o,"nonGoals"),dependencies:as(o,"dependencies"),risks:as(o,"risks"),openQuestions:as(o,"openQuestions"),completionCriteria:as(o,"completionCriteria")}),Rl(`/features/${r}/phases/${i}`)}async function _j({params:t}){const a=on(t,"featureId"),r=on(t,"phaseId");return await QE(r),Rl(`/features/${a}`)}async function Lj({request:t,params:a}){const r=on(a,"phaseId"),i=await Hc(r),u=await t.formData();return await ub({...i,status:ka(u,"status")}),null}async function zj({request:t,params:a}){const r=on(a,"featureId"),i=on(a,"phaseId"),u=await t.formData();return await KE(i,{title:ka(u,"title"),description:ca(u,"description"),status:ca(u,"status")||"planned"}),Rl(`/features/${r}/phases/${i}`)}function Uj(t,a){const r=new Map(t.map(u=>[u.id,u])),i=new Map(t.map(u=>[u.title.trim().toLowerCase(),u]));return a.map((u,o)=>{var p;const f=u.trim().toLowerCase(),m=r.get(((p=t[o])==null?void 0:p.id)??"")??i.get(f);return m?{...m,title:u.trim()}:{id:`check-${o+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,title:u.trim(),checked:!1}})}async function Hj({request:t,params:a}){const r=on(a,"featureId"),i=on(a,"phaseId"),u=on(a,"taskId"),o=await Bc(u),f=await t.formData();return await em({...o,phaseId:i,title:ka(f,"title"),status:ka(f,"status"),priority:ym(f,"priority"),description:ca(f,"description"),checklist:Uj(o.checklist,as(f,"checklist"))}),Rl(`/features/${r}/phases/${i}/tasks/${u}`)}async function Bj({params:t}){const a=on(t,"featureId"),r=on(t,"phaseId"),i=on(t,"taskId");return await ZE(i),Rl(`/features/${a}/phases/${r}`)}async function $j({request:t,params:a}){const r=on(a,"phaseId"),i=on(a,"taskId"),u=await Bc(i),o=await t.formData();return await em({...u,phaseId:r,status:ka(o,"status")}),null}async function qj({request:t}){const a=await rb(),r=await t.formData();return await FE({...a,goal:ca(r,"goal")}),Rl("/")}function Yj(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function Vj(){return{handoffs:await cb()}}function Fj(){const{handoffs:t}=os(),[a,r]=v.useState(t),i=il();return v.useEffect(()=>{const u=o=>{const f=o.detail;((f==null?void 0:f.type)==="handoffUpdated"||(f==null?void 0:f.type)==="handoffCleared")&&cb().then(r).catch(()=>{})};return window.addEventListener("agent-plan:ws-event",u),()=>window.removeEventListener("agent-plan:ws-event",u)},[]),v.useEffect(()=>{if(!i.hash)return;const u=i.hash.slice(1),o=document.getElementById(u);o&&o.scrollIntoView({behavior:"smooth",block:"start"})},[i.hash,a]),a.length===0?d.jsxs(zn,{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),d.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Entity-scoped handoffs written on phases (",d.jsx("code",{children:"phase.handoff"}),")."]})]}),d.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):d.jsxs("div",{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),d.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Entity-scoped handoffs written on phases (",d.jsx("code",{children:"phase.handoff"}),"). ",a.length," pending."]})]}),a.map(u=>d.jsx("section",{id:u.phaseId,className:"scroll-mt-20",children:d.jsxs(zn,{className:"grid gap-3",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(_r,{id:u.compositeRef,children:u.compositeRef}),d.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["Updated ",Yj(u.updatedAt)]})]}),d.jsx(bt,{to:`/features/${u.featureId??""}/phases/${u.phaseId}`,className:"text-xs text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",children:"Open phase →"})]}),d.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:d.jsx(Ln,{text:u.content,className:"formatted-text max-w-none"})})]})},u.phaseId))]})}async function Ij({request:t,params:a}){on(a,"featureId");const r=on(a,"phaseId"),i=on(a,"taskId"),u=on(a,"itemId"),o=await t.formData(),f=ka(o,"checked")==="true",m=await Bc(i);return await em({...m,phaseId:r,checklist:m.checklist.map(p=>p.id===u?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:i,itemId:u,checked:f})}const Gj=Kw([{id:"root",path:"/",loader:xN,element:d.jsx(bN,{}),errorElement:d.jsx(SN,{}),children:[{index:!0,loader:wN,element:d.jsx(ZT,{})},{path:"features",id:"features",loader:JT,element:d.jsx(rj,{}),children:[{path:"new",element:d.jsx(bj,{}),action:Dj}]},{path:"features/:featureId",id:"feature-detail",loader:sj,element:d.jsx(dj,{}),children:[{path:"edit",element:d.jsx(Sj,{}),action:Cj},{path:"phases/new",element:d.jsx(wj,{}),action:Mj}]},{path:"project/edit",element:d.jsx(jj,{}),action:qj},{path:"handoff",loader:Vj,element:d.jsx(Fj,{})},{path:"features/:featureId/delete",action:Aj},{path:"features/:featureId/status",action:Oj},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:fj,element:d.jsx(pj,{}),children:[{path:"edit",element:d.jsx(Ej,{}),action:kj},{path:"tasks/new",element:d.jsx(Nj,{}),action:zj}]},{path:"features/:featureId/phases/:phaseId/delete",action:_j},{path:"features/:featureId/phases/:phaseId/status",action:Lj},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:gj,element:d.jsx(yj,{}),children:[{path:"edit",element:d.jsx(Tj,{}),action:Hj}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:Bj},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:$j},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:Ij}]}]),Xb=document.getElementById("root");if(!Xb)throw new Error("#root not found");$S.createRoot(Xb).render(d.jsx(v.StrictMode,{children:d.jsx(rE,{router:Gj})}));
|