@agent-plan/server 0.2.19-next.16 → 0.2.19-next.18
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 +17 -2
- package/package.json +2 -2
- package/web-ui-dist/assets/index-DG2XF_Sy.css +1 -0
- package/web-ui-dist/assets/index-DS7Qrq0d.js +293 -0
- package/web-ui-dist/index.html +3 -2
- package/web-ui-dist/assets/index-CZs-bw22.js +0 -263
- package/web-ui-dist/assets/index-zZFIH6DD.css +0 -1
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
var _1=Object.defineProperty;var L1=(t,a,l)=>a in t?_1(t,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[a]=l;var pn=(t,a,l)=>L1(t,typeof a!="symbol"?a+"":a,l);function z1(t,a){for(var l=0;l<a.length;l++){const i=a[l];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 l(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=l(u);fetch(u.href,o)}})();function U1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qf={exports:{}},tu={};/**
|
|
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 Pv;function H1(){if(Pv)return tu;Pv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(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 tu.Fragment=a,tu.jsx=l,tu.jsxs=l,tu}var Qv;function B1(){return Qv||(Qv=1,Qf.exports=H1()),Qf.exports}var d=B1(),Kf={exports:{}},et={};/**
|
|
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 Kv;function $1(){if(Kv)return et;Kv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=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"),w=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=w&&D[w]||D["@@iterator"],typeof D=="function"?D:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,j={};function L(D,$,ne){this.props=D,this.context=$,this.refs=j,this.updater=ne||N}L.prototype.isReactComponent={},L.prototype.setState=function(D,$){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,$,"setState")},L.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function I(){}I.prototype=L.prototype;function Y(D,$,ne){this.props=D,this.context=$,this.refs=j,this.updater=ne||N}var P=Y.prototype=new I;P.constructor=Y,A(P,L.prototype),P.isPureReactComponent=!0;var K=Array.isArray;function W(){}var U={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function oe(D,$,ne){var de=ne.ref;return{$$typeof:t,type:D,key:$,ref:de!==void 0?de:null,props:ne}}function me(D,$){return oe(D.type,$,D.props)}function ye(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Re(D){var $={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return $[ne]})}var ee=/\/+/g;function be(D,$){return typeof D=="object"&&D!==null&&D.key!=null?Re(""+D.key):$.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($){D.status==="pending"&&(D.status="fulfilled",D.value=$)},function($){D.status==="pending"&&(D.status="rejected",D.reason=$)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function z(D,$,ne,de,je){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),$,ne,de,je)}}if(Ue)return je=je(D),Ue=de===""?"."+be(D,0):de,K(je)?(ne="",Ue!=null&&(ne=Ue.replace(ee,"$&/")+"/"),z(je,$,ne,"",function(nt){return nt})):je!=null&&(ye(je)&&(je=me(je,ne+(je.key==null||D&&D.key===je.key?"":(""+je.key).replace(ee,"$&/")+"/")+Ue)),$.push(je)),1;Ue=0;var it=de===""?".":de+":";if(K(D))for(var Ge=0;Ge<D.length;Ge++)de=D[Ge],Ne=it+be(de,Ge),Ue+=z(de,$,ne,Ne,je);else if(Ge=S(D),typeof Ge=="function")for(D=Ge.call(D),Ge=0;!(de=D.next()).done;)de=de.value,Ne=it+be(de,Ge++),Ue+=z(de,$,ne,Ne,je);else if(Ne==="object"){if(typeof D.then=="function")return z(Ee(D),$,ne,de,je);throw $=String(D),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Ue}function H(D,$,ne){if(D==null)return D;var de=[],je=0;return z(D,de,"","",function(Ne){return $.call(ne,Ne,je++)}),de}function ie(D){if(D._status===-1){var $=D._result;$=$(),$.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=$)}if(D._status===1)return D._result.default;throw D._result}var ce=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},pe={map:H,forEach:function(D,$,ne){H(D,function(){$.apply(this,arguments)},ne)},count:function(D){var $=0;return H(D,function(){$++}),$},toArray:function(D){return H(D,function($){return $})||[]},only:function(D){if(!ye(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return et.Activity=b,et.Children=pe,et.Component=L,et.Fragment=l,et.Profiler=u,et.PureComponent=Y,et.StrictMode=i,et.Suspense=p,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,et.__COMPILER_RUNTIME={__proto__:null,c:function(D){return U.H.useMemoCache(D)}},et.cache=function(D){return function(){return D.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(D,$,ne){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var de=A({},D.props),je=D.key;if($!=null)for(Ne in $.key!==void 0&&(je=""+$.key),$)!T.call($,Ne)||Ne==="key"||Ne==="__self"||Ne==="__source"||Ne==="ref"&&$.ref===void 0||(de[Ne]=$[Ne]);var Ne=arguments.length-2;if(Ne===1)de.children=ne;else if(1<Ne){for(var Ue=Array(Ne),it=0;it<Ne;it++)Ue[it]=arguments[it+2];de.children=Ue}return oe(D.type,je,de)},et.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},et.createElement=function(D,$,ne){var de,je={},Ne=null;if($!=null)for(de in $.key!==void 0&&(Ne=""+$.key),$)T.call($,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(je[de]=$[de]);var Ue=arguments.length-2;if(Ue===1)je.children=ne;else if(1<Ue){for(var it=Array(Ue),Ge=0;Ge<Ue;Ge++)it[Ge]=arguments[Ge+2];je.children=it}if(D&&D.defaultProps)for(de in Ue=D.defaultProps,Ue)je[de]===void 0&&(je[de]=Ue[de]);return oe(D,Ne,je)},et.createRef=function(){return{current:null}},et.forwardRef=function(D){return{$$typeof:m,render:D}},et.isValidElement=ye,et.lazy=function(D){return{$$typeof:x,_payload:{_status:-1,_result:D},_init:ie}},et.memo=function(D,$){return{$$typeof:g,type:D,compare:$===void 0?null:$}},et.startTransition=function(D){var $=U.T,ne={};U.T=ne;try{var de=D(),je=U.S;je!==null&&je(ne,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(W,ce)}catch(Ne){ce(Ne)}finally{$!==null&&ne.types!==null&&($.types=ne.types),U.T=$}},et.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},et.use=function(D){return U.H.use(D)},et.useActionState=function(D,$,ne){return U.H.useActionState(D,$,ne)},et.useCallback=function(D,$){return U.H.useCallback(D,$)},et.useContext=function(D){return U.H.useContext(D)},et.useDebugValue=function(){},et.useDeferredValue=function(D,$){return U.H.useDeferredValue(D,$)},et.useEffect=function(D,$){return U.H.useEffect(D,$)},et.useEffectEvent=function(D){return U.H.useEffectEvent(D)},et.useId=function(){return U.H.useId()},et.useImperativeHandle=function(D,$,ne){return U.H.useImperativeHandle(D,$,ne)},et.useInsertionEffect=function(D,$){return U.H.useInsertionEffect(D,$)},et.useLayoutEffect=function(D,$){return U.H.useLayoutEffect(D,$)},et.useMemo=function(D,$){return U.H.useMemo(D,$)},et.useOptimistic=function(D,$){return U.H.useOptimistic(D,$)},et.useReducer=function(D,$,ne){return U.H.useReducer(D,$,ne)},et.useRef=function(D){return U.H.useRef(D)},et.useState=function(D){return U.H.useState(D)},et.useSyncExternalStore=function(D,$,ne){return U.H.useSyncExternalStore(D,$,ne)},et.useTransition=function(){return U.H.useTransition()},et.version="19.2.7",et}var Zv;function Uh(){return Zv||(Zv=1,Kf.exports=$1()),Kf.exports}var v=Uh();const sn=U1(v),q1=z1({__proto__:null,default:sn},[v]);var Zf={exports:{}},nu={},Jf={exports:{}},Wf={};/**
|
|
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 Jv;function Y1(){return Jv||(Jv=1,(function(t){function a(z,H){var ie=z.length;z.push(H);e:for(;0<ie;){var ce=ie-1>>>1,pe=z[ce];if(0<u(pe,H))z[ce]=H,z[ie]=pe,ie=ce;else break e}}function l(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var H=z[0],ie=z.pop();if(ie!==H){z[0]=ie;e:for(var ce=0,pe=z.length,D=pe>>>1;ce<D;){var $=2*(ce+1)-1,ne=z[$],de=$+1,je=z[de];if(0>u(ne,ie))de<pe&&0>u(je,ne)?(z[ce]=je,z[de]=ie,ce=de):(z[ce]=ne,z[$]=ie,ce=$);else if(de<pe&&0>u(je,ie))z[ce]=je,z[de]=ie,ce=de;else break e}}return H}function u(z,H){var ie=z.sortIndex-H.sortIndex;return ie!==0?ie:z.id-H.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,w=3,S=!1,N=!1,A=!1,j=!1,L=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function P(z){for(var H=l(g);H!==null;){if(H.callback===null)i(g);else if(H.startTime<=z)i(g),H.sortIndex=H.expirationTime,a(p,H);else break;H=l(g)}}function K(z){if(A=!1,P(z),!N)if(l(p)!==null)N=!0,W||(W=!0,Re());else{var H=l(g);H!==null&&Ee(K,H.startTime-z)}}var W=!1,U=-1,T=5,oe=-1;function me(){return j?!0:!(t.unstable_now()-oe<T)}function ye(){if(j=!1,W){var z=t.unstable_now();oe=z;var H=!0;try{e:{N=!1,A&&(A=!1,I(U),U=-1),S=!0;var ie=w;try{t:{for(P(z),b=l(p);b!==null&&!(b.expirationTime>z&&me());){var ce=b.callback;if(typeof ce=="function"){b.callback=null,w=b.priorityLevel;var pe=ce(b.expirationTime<=z);if(z=t.unstable_now(),typeof pe=="function"){b.callback=pe,P(z),H=!0;break t}b===l(p)&&i(p),P(z)}else i(p);b=l(p)}if(b!==null)H=!0;else{var D=l(g);D!==null&&Ee(K,D.startTime-z),H=!1}}break e}finally{b=null,w=ie,S=!1}H=void 0}}finally{H?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,H){U=L(function(){z(t.unstable_now())},H)}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"):T=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(z){switch(w){case 1:case 2:case 3:var H=3;break;default:H=w}var ie=w;w=H;try{return z()}finally{w=ie}},t.unstable_requestPaint=function(){j=!0},t.unstable_runWithPriority=function(z,H){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ie=w;w=z;try{return H()}finally{w=ie}},t.unstable_scheduleCallback=function(z,H,ie){var ce=t.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ce+ie:ce):ie=ce,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:H,priorityLevel:z,startTime:ie,expirationTime:pe,sortIndex:-1},ie>ce?(z.sortIndex=ie,a(g,z),l(p)===null&&z===l(g)&&(A?(I(U),U=-1):A=!0,Ee(K,ie-ce))):(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 H=w;return function(){var ie=w;w=H;try{return z.apply(this,arguments)}finally{w=ie}}}})(Wf)),Wf}var Wv;function V1(){return Wv||(Wv=1,Jf.exports=Y1()),Jf.exports}var eh={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 ey;function F1(){if(ey)return sa;ey=1;var t=Uh();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 l(){}var i={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},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),w=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:w,fetchPriority:S}):x==="script"&&i.d.X(p,{crossOrigin:b,integrity:w,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 ty;function Sx(){if(ty)return eh.exports;ty=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(),eh.exports=F1(),eh.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 ny;function I1(){if(ny)return nu;ny=1;var t=V1(),a=Uh(),l=Sx();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}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,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r: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 r=e,s=n;;){var c=r.return;if(c===null)break;var h=c.alternate;if(h===null){if(s=c.return,s!==null){r=s;continue}break}if(c.child===h.child){for(h=c.child;h;){if(h===r)return p(c),e;if(h===s)return p(c),n;h=h.sibling}throw Error(i(188))}if(r.return!==s.return)r=c,s=h;else{for(var y=!1,E=c.child;E;){if(E===r){y=!0,r=c,s=h;break}if(E===s){y=!0,s=c,r=h;break}E=E.sibling}if(!y){for(E=h.child;E;){if(E===r){y=!0,r=h,s=c;break}if(E===s){y=!0,s=h,r=c;break}E=E.sibling}if(!y)throw Error(i(189))}}if(r.alternate!==s)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?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,w=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),T=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 A:return"Fragment";case L:return"Profiler";case j: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 I:return(e._context.displayName||"Context")+".Consumer";case P: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 T: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,H=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ce=[],pe=-1;function D(e){return{current:e}}function $(e){0>pe||(e.current=ce[pe],ce[pe]=null,pe--)}function ne(e,n){pe++,ce[pe]=e.current,e.current=n}var de=D(null),je=D(null),Ne=D(null),Ue=D(null);function it(e,n){switch(ne(Ne,n),ne(je,e),ne(de,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?vv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=vv(n),e=yv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(de),ne(de,e)}function Ge(){$(de),$(je),$(Ne)}function nt(e){e.memoizedState!==null&&ne(Ue,e);var n=de.current,r=yv(n,e.type);n!==r&&(ne(je,e),ne(de,r))}function vn(e){je.current===e&&($(de),$(je)),Ue.current===e&&($(Ue),Zi._currentValue=ie)}var Rt,ut;function le(e){if(Rt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Rt=n&&n[1]||"",ut=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Rt+e+ut}var Ye=!1;function Ie(e,n){if(!e||Ye)return"";Ye=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var X=Q}Reflect.construct(e,[],re)}else{try{re.call()}catch(Q){X=Q}e.call(re.prototype)}}else{try{throw Error()}catch(Q){X=Q}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&X&&typeof Q.stack=="string")return[Q.stack,X.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],E=h[1];if(y&&E){var O=y.split(`
|
|
44
|
-
`),F=E.split(`
|
|
45
|
-
`);for(c=s=0;s<O.length&&!O[s].includes("DetermineComponentFrameRoot");)s++;for(;c<F.length&&!F[c].includes("DetermineComponentFrameRoot");)c++;if(s===O.length||c===F.length)for(s=O.length-1,c=F.length-1;1<=s&&0<=c&&O[s]!==F[c];)c--;for(;1<=s&&0<=c;s--,c--)if(O[s]!==F[c]){if(s!==1||c!==1)do if(s--,c--,0>c||O[s]!==F[c]){var J=`
|
|
46
|
-
`+O[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=r}return(r=e?e.displayName||e.name:"")?le(r):""}function Gt(e,n){switch(e.tag){case 26:case 27:case 5:return le(e.type);case 16:return le("Lazy");case 13:return e.child!==n&&n!==null?le("Suspense Fallback"):le("Suspense");case 19:return le("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 le("Activity");default:return""}}function An(e){try{var n="",r=null;do n+=Gt(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
|
|
47
|
-
Error generating stack: `+s.message+`
|
|
48
|
-
`+s.stack}}var fn=Object.prototype.hasOwnProperty,Lt=t.unstable_scheduleCallback,Wt=t.unstable_cancelCallback,Yn=t.unstable_shouldYield,Vn=t.unstable_requestPaint,fe=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,pt=t.unstable_LowPriority,Xt=t.unstable_IdlePriority,rn=t.log,Bn=t.unstable_setDisableYieldValue,un=null,se=null;function St(e){if(typeof rn=="function"&&Bn(e),se&&typeof se.setStrictMode=="function")try{se.setStrictMode(un,e)}catch{}}var Mt=Math.clz32?Math.clz32:jr,Jn=Math.log,Wn=Math.LN2;function jr(e){return e>>>=0,e===0?32:31-(Jn(e)/Wn|0)|0}var Be=256,Pt=262144,Yt=4194304;function yt(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,r){var s=e.pendingLanes;if(s===0)return 0;var c=0,h=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var E=s&134217727;return E!==0?(s=E&~h,s!==0?c=yt(s):(y&=E,y!==0?c=yt(y):r||(r=E&~e,r!==0&&(c=yt(r))))):(E=s&~h,E!==0?c=yt(E):y!==0?c=yt(y):r||(r=s&~e,r!==0&&(c=yt(r)))),c===0?0:n!==0&&n!==c&&(n&h)===0&&(h=c&-c,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:c}function jt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function en(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 Qt(){var e=Yt;return Yt<<=1,(Yt&62914560)===0&&(Yt=4194304),e}function Ut(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function ft(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,n,r,s,c,h){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var E=e.entanglements,O=e.expirationTimes,F=e.hiddenUpdates;for(r=y&~r;0<r;){var J=31-Mt(r),re=1<<J;E[J]=0,O[J]=-1;var X=F[J];if(X!==null)for(F[J]=null,J=0;J<X.length;J++){var Q=X[J];Q!==null&&(Q.lane&=-536870913)}r&=~re}s!==0&&wn(e,s,0),h!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=h&~(y&~n))}function wn(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Mt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function On(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-Mt(r),c=1<<s;c&n|e[s]&n&&(e[s]|=n),r&=~c}}function C(e,n){var r=n&-n;return r=(r&42)!==0?1:k(r),(r&(e.suspendedLanes|n))!==0?0:r}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 q(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Z(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:qv(e.type))}function ae(e,n){var r=H.p;try{return H.p=e,n()}finally{H.p=r}}var Te=Math.random().toString(36).slice(2),ge="__reactFiber$"+Te,De="__reactProps$"+Te,we="__reactContainer$"+Te,Oe="__reactEvents$"+Te,_e="__reactListeners$"+Te,Xe="__reactHandles$"+Te,Ce="__reactResources$"+Te,Ke="__reactMarker$"+Te;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 r=e.parentNode;r;){if(n=r[we]||r[ge]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Rv(e);e!==null;){if(r=e[ge])return r;e=Rv(e)}return n}e=r,r=e.parentNode}return null}function We(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 lt(e){var n=e[Ce];return n||(n=e[Ce]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ct(e){e[Ke]=!0}var Kt=new Set,Fn={};function En(e,n){Mn(e,n),Mn(e+"Capture",n)}function Mn(e,n){for(Fn[e]=n,e=0;e<n.length;e++)Kt.add(n[e])}var kn=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 tl(e){return fn.call(fa,e)?!0:fn.call(In,e)?!1:kn.test(e)?fa[e]=!0:(In[e]=!0,!1)}function ea(e,n,r){if(tl(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){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,""+r)}}function ur(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function Pe(e,n,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+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 Zt(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ta(e,n,r){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){r=""+y,h.call(this,y)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(y){r=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function _n(e){if(!e._valueTracker){var n=Zt(e)?"checked":"value";e._valueTracker=ta(e,n,""+e[n])}}function Tr(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=Zt(e)?e.checked?"true":"false":e.value),e=s,e!==r?(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 Ul(e,n,r,s,c,h,y,E){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?Tt(e,y,wt(n)):r!=null?Tt(e,y,wt(r)):s!=null&&e.removeAttribute("value"),c==null&&h!=null&&(e.defaultChecked=!!h),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+wt(E):e.removeAttribute("name")}function hi(e,n,r,s,c,h,y,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){_n(e);return}r=r!=null?""+wt(r):"",n=n!=null?""+wt(n):r,E||n===e.value||(e.value=n),e.defaultValue=n}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=E?e.checked:!!s,e.defaultChecked=!!s,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),_n(e)}function Tt(e,n,r){n==="number"&&Et(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function or(e,n,r,s){if(e=e.options,n){n={};for(var c=0;c<r.length;c++)n["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=n.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&s&&(e[r].defaultSelected=!0)}else{for(r=""+wt(r),n=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function Yu(e,n,r){if(n!=null&&(n=""+wt(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+wt(r):""}function Ja(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(Ee(s)){if(1<s.length)throw Error(i(93));s=s[0]}r=s}r==null&&(r=""),n=r}r=wt(n),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),_n(e)}function nl(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var Qc=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 ds(e,n,r){var s=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,r):typeof r!="number"||r===0||Qc.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function ha(e,n,r){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,r!=null){for(var s in r)!r.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)&&r[c]!==s&&ds(e,c,s)}else for(var h in n)n.hasOwnProperty(h)&&ds(e,h,n[h])}function Hl(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 fs=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 tn(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 Dr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cr=null,Cr=null;function mi(e){var n=We(e);if(n&&(e=n.stateNode)){var r=e[De]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ul(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Gn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var c=s[De]||null;if(!c)throw Error(i(90));Ul(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<r.length;n++)s=r[n],s.form===e.form&&Tr(s)}break e;case"textarea":Yu(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&or(e,!!r.multiple,n,!1)}}}var dr=!1;function pi(e,n,r){if(dr)return e(n,r);dr=!0;try{var s=e(n);return s}finally{if(dr=!1,(cr!==null||Cr!==null)&&(Ao(),cr&&(n=cr,e=Cr,Cr=cr=null,mi(n),e)))for(n=0;n<e.length;n++)mi(e[n])}}function La(e,n){var r=e.stateNode;if(r===null)return null;var s=r[De]||null;if(s===null)return null;r=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(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var Wa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gi=!1;if(Wa)try{var Ar={};Object.defineProperty(Ar,"passive",{get:function(){gi=!0}}),window.addEventListener("test",Ar,Ar),window.removeEventListener("test",Ar,Ar)}catch{gi=!1}var za=null,vi=null,hs=null;function Vu(){if(hs)return hs;var e,n=vi,r=n.length,s,c="value"in za?za.value:za.textContent,h=c.length;for(e=0;e<r&&n[e]===c[e];e++);var y=r-e;for(s=1;s<=y&&n[r-s]===c[h-s];s++);return hs=c.slice(e,1<s?1-s:void 0)}function ms(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 Or(){return!0}function Fu(){return!1}function aa(e){function n(r,s,c,h,y){this._reactName=r,this._targetInst=c,this.type=s,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(r=e[E],this[E]=r?r(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Or:Fu,this.isPropagationStopped=Fu,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Or)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Or)},persist:function(){},isPersistent:Or}),n}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kr=aa(Mr),Bl=b({},Mr,{view:0,detail:0}),Kc=aa(Bl),al,$l,ql,_r=b({},Bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:la,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!==ql&&(ql&&e.type==="mousemove"?(al=e.screenX-ql.screenX,$l=e.screenY-ql.screenY):$l=al=0,ql=e),al)},movementY:function(e){return"movementY"in e?e.movementY:$l}}),Iu=aa(_r),R=b({},_r,{dataTransfer:0}),G=aa(R),Se=b({},Bl,{relatedTarget:0}),ve=aa(Se),Fe=b({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),ue=aa(Fe),he=b({},Mr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xe=aa(he),Qe=b({},Mr,{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"},Nn={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 ra(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=kt[e])?!!n[e]:!1}function la(){return ra}var pa=b({},Bl,{key:function(e){if(e.key){var n=ze[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:la,charCode:function(e){return e.type==="keypress"?ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rn=aa(pa),on=b({},_r,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_t=aa(on),Yl=b({},Bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),fr=aa(Yl),Zc=b({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gu=aa(Zc),Xu=b({},_r,{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}),Jc=aa(Xu),Wc=b({},Mr,{newState:0,oldState:0}),t0=aa(Wc),n0=[9,13,27,32],ed=Wa&&"CompositionEvent"in window,yi=null;Wa&&"documentMode"in document&&(yi=document.documentMode);var a0=Wa&&"TextEvent"in window&&!yi,Em=Wa&&(!ed||yi&&8<yi&&11>=yi),Nm=" ",Rm=!1;function jm(e,n){switch(e){case"keyup":return n0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ps=!1;function r0(e,n){switch(e){case"compositionend":return Tm(n);case"keypress":return n.which!==32?null:(Rm=!0,Nm);case"textInput":return e=n.data,e===Nm&&Rm?null:e;default:return null}}function l0(e,n){if(ps)return e==="compositionend"||!ed&&jm(e,n)?(e=Vu(),hs=vi=za=null,ps=!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 Em&&n.locale!=="ko"?null:n.data;default:return null}}var s0={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 Dm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!s0[e.type]:n==="textarea"}function Cm(e,n,r,s){cr?Cr?Cr.push(s):Cr=[s]:cr=s,n=Uo(n,"onChange"),0<n.length&&(r=new kr("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var xi=null,bi=null;function i0(e){dv(e,0)}function Pu(e){var n=ot(e);if(Tr(n))return e}function Am(e,n){if(e==="change")return n}var Om=!1;if(Wa){var td;if(Wa){var nd="oninput"in document;if(!nd){var Mm=document.createElement("div");Mm.setAttribute("oninput","return;"),nd=typeof Mm.oninput=="function"}td=nd}else td=!1;Om=td&&(!document.documentMode||9<document.documentMode)}function km(){xi&&(xi.detachEvent("onpropertychange",_m),bi=xi=null)}function _m(e){if(e.propertyName==="value"&&Pu(bi)){var n=[];Cm(n,bi,e,Dr(e)),pi(i0,n)}}function u0(e,n,r){e==="focusin"?(km(),xi=n,bi=r,xi.attachEvent("onpropertychange",_m)):e==="focusout"&&km()}function o0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pu(bi)}function c0(e,n){if(e==="click")return Pu(n)}function d0(e,n){if(e==="input"||e==="change")return Pu(n)}function f0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Na=typeof Object.is=="function"?Object.is:f0;function Si(e,n){if(Na(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var c=r[s];if(!fn.call(n,c)||!Na(e[c],n[c]))return!1}return!0}function Lm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zm(e,n){var r=Lm(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=n&&s>=n)return{node:r,offset:n-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Lm(r)}}function Um(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Um(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Hm(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 r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Et(e.document)}return n}function ad(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 h0=Wa&&"documentMode"in document&&11>=document.documentMode,gs=null,rd=null,wi=null,ld=!1;function Bm(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ld||gs==null||gs!==Et(s)||(s=gs,"selectionStart"in s&&ad(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}),wi&&Si(wi,s)||(wi=s,s=Uo(rd,"onSelect"),0<s.length&&(n=new kr("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=gs)))}function Vl(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var vs={animationend:Vl("Animation","AnimationEnd"),animationiteration:Vl("Animation","AnimationIteration"),animationstart:Vl("Animation","AnimationStart"),transitionrun:Vl("Transition","TransitionRun"),transitionstart:Vl("Transition","TransitionStart"),transitioncancel:Vl("Transition","TransitionCancel"),transitionend:Vl("Transition","TransitionEnd")},sd={},$m={};Wa&&($m=document.createElement("div").style,"AnimationEvent"in window||(delete vs.animationend.animation,delete vs.animationiteration.animation,delete vs.animationstart.animation),"TransitionEvent"in window||delete vs.transitionend.transition);function Fl(e){if(sd[e])return sd[e];if(!vs[e])return e;var n=vs[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in $m)return sd[e]=n[r];return e}var qm=Fl("animationend"),Ym=Fl("animationiteration"),Vm=Fl("animationstart"),m0=Fl("transitionrun"),p0=Fl("transitionstart"),g0=Fl("transitioncancel"),Fm=Fl("transitionend"),Im=new Map,id="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(" ");id.push("scrollEnd");function er(e,n){Im.set(e,n),En(n,[e])}var Qu=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=[],ys=0,ud=0;function Ku(){for(var e=ys,n=ud=ys=0;n<e;){var r=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&&Gm(r,c,h)}}function Zu(e,n,r,s){Ua[ys++]=e,Ua[ys++]=n,Ua[ys++]=r,Ua[ys++]=s,ud|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function od(e,n,r,s){return Zu(e,n,r,s),Ju(e)}function Il(e,n){return Zu(e,null,null,n),Ju(e)}function Gm(e,n,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var c=!1,h=e.return;h!==null;)h.childLanes|=r,s=h.alternate,s!==null&&(s.childLanes|=r),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(r),e=h.hiddenUpdates,s=e[c],s===null?e[c]=[n]:s.push(n),n.lane=r|536870912),h):null}function Ju(e){if(50<Fi)throw Fi=0,xf=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var xs={};function v0(e,n,r,s){this.tag=e,this.key=r,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,r,s){return new v0(e,n,r,s)}function cd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lr(e,n){var r=e.alternate;return r===null?(r=Ra(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Xm(e,n){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Wu(e,n,r,s,c,h){var y=0;if(s=e,typeof e=="function")cd(e)&&(y=1);else if(typeof e=="string")y=w1(e,r,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=Ra(31,r,n,c),e.elementType=oe,e.lanes=h,e;case A:return Gl(r.children,c,h,n);case j:y=8,c|=24;break;case L:return e=Ra(12,r,n,c|2),e.elementType=L,e.lanes=h,e;case K:return e=Ra(13,r,n,c),e.elementType=K,e.lanes=h,e;case W:return e=Ra(19,r,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 I:y=9;break e;case P:y=11;break e;case U:y=14;break e;case T:y=16,s=null;break e}y=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Ra(y,r,n,c),n.elementType=e,n.type=s,n.lanes=h,n}function Gl(e,n,r,s){return e=Ra(7,e,s,n),e.lanes=r,e}function dd(e,n,r){return e=Ra(6,e,null,n),e.lanes=r,e}function Pm(e){var n=Ra(18,null,null,0);return n.stateNode=e,n}function fd(e,n,r){return n=Ra(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Qm=new WeakMap;function Ha(e,n){if(typeof e=="object"&&e!==null){var r=Qm.get(e);return r!==void 0?r:(n={value:e,source:n,stack:An(n)},Qm.set(e,n),n)}return{value:e,source:n,stack:An(n)}}var bs=[],Ss=0,eo=null,Ei=0,Ba=[],$a=0,rl=null,hr=1,mr="";function zr(e,n){bs[Ss++]=Ei,bs[Ss++]=eo,eo=e,Ei=n}function Km(e,n,r){Ba[$a++]=hr,Ba[$a++]=mr,Ba[$a++]=rl,rl=e;var s=hr;e=mr;var c=32-Mt(s)-1;s&=~(1<<c),r+=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,hr=1<<32-Mt(n)+c|r<<c|s,mr=h+e}else hr=1<<h|r<<c|s,mr=e}function hd(e){e.return!==null&&(zr(e,1),Km(e,1,0))}function md(e){for(;e===eo;)eo=bs[--Ss],bs[Ss]=null,Ei=bs[--Ss],bs[Ss]=null;for(;e===rl;)rl=Ba[--$a],Ba[$a]=null,mr=Ba[--$a],Ba[$a]=null,hr=Ba[--$a],Ba[$a]=null}function Zm(e,n){Ba[$a++]=hr,Ba[$a++]=mr,Ba[$a++]=rl,hr=n.id,mr=n.overflow,rl=e}var Xn=null,nn=null,xt=!1,ll=null,qa=!1,pd=Error(i(519));function sl(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ni(Ha(n,e)),pd}function Jm(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[ge]=e,n[De]=s,r){case"dialog":mt("cancel",n),mt("close",n);break;case"iframe":case"object":case"embed":mt("load",n);break;case"video":case"audio":for(r=0;r<Gi.length;r++)mt(Gi[r],n);break;case"source":mt("error",n);break;case"img":case"image":case"link":mt("error",n),mt("load",n);break;case"details":mt("toggle",n);break;case"input":mt("invalid",n),hi(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":mt("invalid",n);break;case"textarea":mt("invalid",n),Ja(n,s.value,s.defaultValue,s.children)}r=s.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||s.suppressHydrationWarning===!0||pv(n.textContent,r)?(s.popover!=null&&(mt("beforetoggle",n),mt("toggle",n)),s.onScroll!=null&&mt("scroll",n),s.onScrollEnd!=null&&mt("scrollend",n),s.onClick!=null&&(n.onclick=na),n=!0):n=!1,n||sl(e,!0)}function Wm(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 ws(e){if(e!==Xn)return!1;if(!xt)return Wm(e),xt=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||_f(e.type,e.memoizedProps)),r=!r),r&&nn&&sl(e),Wm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));nn=Nv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));nn=Nv(e)}else n===27?(n=nn,bl(e.type)?(e=Bf,Bf=null,nn=e):nn=n):nn=Xn?Va(e.stateNode.nextSibling):null;return!0}function Xl(){nn=Xn=null,xt=!1}function gd(){var e=ll;return e!==null&&(xa===null?xa=e:xa.push.apply(xa,e),ll=null),e}function Ni(e){ll===null?ll=[e]:ll.push(e)}var vd=D(null),Pl=null,Ur=null;function il(e,n,r){ne(vd,n._currentValue),n._currentValue=r}function Hr(e){e._currentValue=vd.current,$(vd)}function yd(e,n,r){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===r)break;e=e.return}}function xd(e,n,r,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 E=h;h=c;for(var O=0;O<n.length;O++)if(E.context===n[O]){h.lanes|=r,E=h.alternate,E!==null&&(E.lanes|=r),yd(h.return,r,e),s||(y=null);break e}h=E.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(i(341));y.lanes|=r,h=y.alternate,h!==null&&(h.lanes|=r),yd(y,r,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 Es(e,n,r,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 E=c.type;Na(c.pendingProps.value,y.value)||(e!==null?e.push(E):e=[E])}}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(Zi):e=[Zi])}c=c.return}e!==null&&xd(n,e,r,s),n.flags|=262144}function to(e){for(e=e.firstContext;e!==null;){if(!Na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ql(e){Pl=e,Ur=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pn(e){return ep(Pl,e)}function no(e,n){return Pl===null&&Ql(e),ep(e,n)}function ep(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Ur===null){if(e===null)throw Error(i(308));Ur=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ur=Ur.next=n;return r}var y0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},x0=t.unstable_scheduleCallback,b0=t.unstable_NormalPriority,jn={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bd(){return{controller:new y0,data:new Map,refCount:0}}function Ri(e){e.refCount--,e.refCount===0&&x0(b0,function(){e.controller.abort()})}var ji=null,Sd=0,Ns=0,Rs=null;function S0(e,n){if(ji===null){var r=ji=[];Sd=0,Ns=Rf(),Rs={status:"pending",value:void 0,then:function(s){r.push(s)}}}return Sd++,n.then(tp,tp),n}function tp(){if(--Sd===0&&ji!==null){Rs!==null&&(Rs.status="fulfilled");var e=ji;ji=null,Ns=0,Rs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function w0(e,n){var r=[],s={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var c=0;c<r.length;c++)(0,r[c])(n)},function(c){for(s.status="rejected",s.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),s}var np=z.S;z.S=function(e,n){Bg=fe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&S0(e,n),np!==null&&np(e,n)};var Kl=D(null);function wd(){var e=Kl.current;return e!==null?e:Jt.pooledCache}function ao(e,n){n===null?ne(Kl,Kl.current):ne(Kl,n.pool)}function ap(){var e=wd();return e===null?null:{parent:jn._currentValue,pool:e}}var js=Error(i(460)),Ed=Error(i(474)),ro=Error(i(542)),lo={then:function(){}};function rp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lp(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(na,na),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ip(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=Jt,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,ip(e),e}throw Jl=n,js}}function Zl(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Jl=r,js):r}}var Jl=null;function sp(){if(Jl===null)throw Error(i(459));var e=Jl;return Jl=null,e}function ip(e){if(e===js||e===ro)throw Error(i(483))}var Ts=null,Ti=0;function so(e){var n=Ti;return Ti+=1,Ts===null&&(Ts=[]),lp(Ts,e,n)}function Di(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function io(e,n){throw n.$$typeof===w?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function up(e){function n(B,_){if(e){var V=B.deletions;V===null?(B.deletions=[_],B.flags|=16):V.push(_)}}function r(B,_){if(!e)return null;for(;_!==null;)n(B,_),_=_.sibling;return null}function s(B){for(var _=new Map;B!==null;)B.key!==null?_.set(B.key,B):_.set(B.index,B),B=B.sibling;return _}function c(B,_){return B=Lr(B,_),B.index=0,B.sibling=null,B}function h(B,_,V){return B.index=V,e?(V=B.alternate,V!==null?(V=V.index,V<_?(B.flags|=67108866,_):V):(B.flags|=67108866,_)):(B.flags|=1048576,_)}function y(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function E(B,_,V,te){return _===null||_.tag!==6?(_=dd(V,B.mode,te),_.return=B,_):(_=c(_,V),_.return=B,_)}function O(B,_,V,te){var He=V.type;return He===A?J(B,_,V.props.children,te,V.key):_!==null&&(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&Zl(He)===_.type)?(_=c(_,V.props),Di(_,V),_.return=B,_):(_=Wu(V.type,V.key,V.props,null,B.mode,te),Di(_,V),_.return=B,_)}function F(B,_,V,te){return _===null||_.tag!==4||_.stateNode.containerInfo!==V.containerInfo||_.stateNode.implementation!==V.implementation?(_=fd(V,B.mode,te),_.return=B,_):(_=c(_,V.children||[]),_.return=B,_)}function J(B,_,V,te,He){return _===null||_.tag!==7?(_=Gl(V,B.mode,te,He),_.return=B,_):(_=c(_,V),_.return=B,_)}function re(B,_,V){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=dd(""+_,B.mode,V),_.return=B,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case S:return V=Wu(_.type,_.key,_.props,null,B.mode,V),Di(V,_),V.return=B,V;case N:return _=fd(_,B.mode,V),_.return=B,_;case T:return _=Zl(_),re(B,_,V)}if(Ee(_)||Re(_))return _=Gl(_,B.mode,V,null),_.return=B,_;if(typeof _.then=="function")return re(B,so(_),V);if(_.$$typeof===Y)return re(B,no(B,_),V);io(B,_)}return null}function X(B,_,V,te){var He=_!==null?_.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return He!==null?null:E(B,_,""+V,te);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===He?O(B,_,V,te):null;case N:return V.key===He?F(B,_,V,te):null;case T:return V=Zl(V),X(B,_,V,te)}if(Ee(V)||Re(V))return He!==null?null:J(B,_,V,te,null);if(typeof V.then=="function")return X(B,_,so(V),te);if(V.$$typeof===Y)return X(B,_,no(B,V),te);io(B,V)}return null}function Q(B,_,V,te,He){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return B=B.get(V)||null,E(_,B,""+te,He);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case S:return B=B.get(te.key===null?V:te.key)||null,O(_,B,te,He);case N:return B=B.get(te.key===null?V:te.key)||null,F(_,B,te,He);case T:return te=Zl(te),Q(B,_,V,te,He)}if(Ee(te)||Re(te))return B=B.get(V)||null,J(_,B,te,He,null);if(typeof te.then=="function")return Q(B,_,V,so(te),He);if(te.$$typeof===Y)return Q(B,_,V,no(_,te),He);io(_,te)}return null}function Ae(B,_,V,te){for(var He=null,Dt=null,ke=_,st=_=0,vt=null;ke!==null&&st<V.length;st++){ke.index>st?(vt=ke,ke=null):vt=ke.sibling;var Ct=X(B,ke,V[st],te);if(Ct===null){ke===null&&(ke=vt);break}e&&ke&&Ct.alternate===null&&n(B,ke),_=h(Ct,_,st),Dt===null?He=Ct:Dt.sibling=Ct,Dt=Ct,ke=vt}if(st===V.length)return r(B,ke),xt&&zr(B,st),He;if(ke===null){for(;st<V.length;st++)ke=re(B,V[st],te),ke!==null&&(_=h(ke,_,st),Dt===null?He=ke:Dt.sibling=ke,Dt=ke);return xt&&zr(B,st),He}for(ke=s(ke);st<V.length;st++)vt=Q(ke,B,st,V[st],te),vt!==null&&(e&&vt.alternate!==null&&ke.delete(vt.key===null?st:vt.key),_=h(vt,_,st),Dt===null?He=vt:Dt.sibling=vt,Dt=vt);return e&&ke.forEach(function(Rl){return n(B,Rl)}),xt&&zr(B,st),He}function Ve(B,_,V,te){if(V==null)throw Error(i(151));for(var He=null,Dt=null,ke=_,st=_=0,vt=null,Ct=V.next();ke!==null&&!Ct.done;st++,Ct=V.next()){ke.index>st?(vt=ke,ke=null):vt=ke.sibling;var Rl=X(B,ke,Ct.value,te);if(Rl===null){ke===null&&(ke=vt);break}e&&ke&&Rl.alternate===null&&n(B,ke),_=h(Rl,_,st),Dt===null?He=Rl:Dt.sibling=Rl,Dt=Rl,ke=vt}if(Ct.done)return r(B,ke),xt&&zr(B,st),He;if(ke===null){for(;!Ct.done;st++,Ct=V.next())Ct=re(B,Ct.value,te),Ct!==null&&(_=h(Ct,_,st),Dt===null?He=Ct:Dt.sibling=Ct,Dt=Ct);return xt&&zr(B,st),He}for(ke=s(ke);!Ct.done;st++,Ct=V.next())Ct=Q(ke,B,st,Ct.value,te),Ct!==null&&(e&&Ct.alternate!==null&&ke.delete(Ct.key===null?st:Ct.key),_=h(Ct,_,st),Dt===null?He=Ct:Dt.sibling=Ct,Dt=Ct);return e&&ke.forEach(function(k1){return n(B,k1)}),xt&&zr(B,st),He}function It(B,_,V,te){if(typeof V=="object"&&V!==null&&V.type===A&&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===A){if(_.tag===7){r(B,_.sibling),te=c(_,V.props.children),te.return=B,B=te;break e}}else if(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&Zl(He)===_.type){r(B,_.sibling),te=c(_,V.props),Di(te,V),te.return=B,B=te;break e}r(B,_);break}else n(B,_);_=_.sibling}V.type===A?(te=Gl(V.props.children,B.mode,te,V.key),te.return=B,B=te):(te=Wu(V.type,V.key,V.props,null,B.mode,te),Di(te,V),te.return=B,B=te)}return y(B);case N:e:{for(He=V.key;_!==null;){if(_.key===He)if(_.tag===4&&_.stateNode.containerInfo===V.containerInfo&&_.stateNode.implementation===V.implementation){r(B,_.sibling),te=c(_,V.children||[]),te.return=B,B=te;break e}else{r(B,_);break}else n(B,_);_=_.sibling}te=fd(V,B.mode,te),te.return=B,B=te}return y(B);case T:return V=Zl(V),It(B,_,V,te)}if(Ee(V))return Ae(B,_,V,te);if(Re(V)){if(He=Re(V),typeof He!="function")throw Error(i(150));return V=He.call(V),Ve(B,_,V,te)}if(typeof V.then=="function")return It(B,_,so(V),te);if(V.$$typeof===Y)return It(B,_,no(B,V),te);io(B,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,_!==null&&_.tag===6?(r(B,_.sibling),te=c(_,V),te.return=B,B=te):(r(B,_),te=dd(V,B.mode,te),te.return=B,B=te),y(B)):r(B,_)}return function(B,_,V,te){try{Ti=0;var He=It(B,_,V,te);return Ts=null,He}catch(ke){if(ke===js||ke===ro)throw ke;var Dt=Ra(29,ke,null,B.mode);return Dt.lanes=te,Dt.return=B,Dt}finally{}}}var Wl=up(!0),op=up(!1),ul=!1;function Nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rd(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 ol(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cl(e,n,r){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=Ju(e),Gm(e,null,r),n}return Zu(e,s,n,r),Ju(e)}function Ci(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,On(e,r)}}function jd(e,n){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var c=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?c=h=y:h=h.next=y,r=r.next}while(r!==null);h===null?c=h=n:h=h.next=n}else c=h=n;r={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Td=!1;function Ai(){if(Td){var e=Rs;if(e!==null)throw e}}function Oi(e,n,r,s){Td=!1;var c=e.updateQueue;ul=!1;var h=c.firstBaseUpdate,y=c.lastBaseUpdate,E=c.shared.pending;if(E!==null){c.shared.pending=null;var O=E,F=O.next;O.next=null,y===null?h=F:y.next=F,y=O;var J=e.alternate;J!==null&&(J=J.updateQueue,E=J.lastBaseUpdate,E!==y&&(E===null?J.firstBaseUpdate=F:E.next=F,J.lastBaseUpdate=O))}if(h!==null){var re=c.baseState;y=0,J=F=O=null,E=h;do{var X=E.lane&-536870913,Q=X!==E.lane;if(Q?(gt&X)===X:(s&X)===X){X!==0&&X===Ns&&(Td=!0),J!==null&&(J=J.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Ae=e,Ve=E;X=n;var It=r;switch(Ve.tag){case 1:if(Ae=Ve.payload,typeof Ae=="function"){re=Ae.call(It,re,X);break e}re=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ve.payload,X=typeof Ae=="function"?Ae.call(It,re,X):Ae,X==null)break e;re=b({},re,X);break e;case 2:ul=!0}}X=E.callback,X!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[X]:Q.push(X))}else Q={lane:X,tag:E.tag,payload:E.payload,callback:E.callback,next:null},J===null?(F=J=Q,O=re):J=J.next=Q,y|=X;if(E=E.next,E===null){if(E=c.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);J===null&&(O=re),c.baseState=O,c.firstBaseUpdate=F,c.lastBaseUpdate=J,h===null&&(c.shared.lanes=0),pl|=y,e.lanes=y,e.memoizedState=re}}function cp(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function dp(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)cp(r[e],n)}var Ds=D(null),uo=D(0);function fp(e,n){e=Xr,ne(uo,e),ne(Ds,n),Xr=e|n.baseLanes}function Dd(){ne(uo,Xr),ne(Ds,Ds.current)}function Cd(){Xr=uo.current,$(Ds),$(uo)}var ja=D(null),Ya=null;function dl(e){var n=e.alternate;ne(yn,yn.current&1),ne(ja,e),Ya===null&&(n===null||Ds.current!==null||n.memoizedState!==null)&&(Ya=e)}function Ad(e){ne(yn,yn.current),ne(ja,e),Ya===null&&(Ya=e)}function hp(e){e.tag===22?(ne(yn,yn.current),ne(ja,e),Ya===null&&(Ya=e)):fl()}function fl(){ne(yn,yn.current),ne(ja,ja.current)}function Ta(e){$(ja),Ya===e&&(Ya=null),$(yn)}var yn=D(0);function oo(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Uf(r)||Hf(r)))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 Br=0,rt=null,Vt=null,Tn=null,co=!1,Cs=!1,es=!1,fo=0,Mi=0,As=null,E0=0;function hn(){throw Error(i(321))}function Od(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Na(e[r],n[r]))return!1;return!0}function Md(e,n,r,s,c,h){return Br=h,rt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=e===null||e.memoizedState===null?Kp:Xd,es=!1,h=r(s,c),es=!1,Cs&&(h=pp(n,r,s,c)),mp(e),h}function mp(e){z.H=Li;var n=Vt!==null&&Vt.next!==null;if(Br=0,Tn=Vt=rt=null,co=!1,Mi=0,As=null,n)throw Error(i(300));e===null||Dn||(e=e.dependencies,e!==null&&to(e)&&(Dn=!0))}function pp(e,n,r,s){rt=e;var c=0;do{if(Cs&&(As=null),Mi=0,Cs=!1,25<=c)throw Error(i(301));if(c+=1,Tn=Vt=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=Zp,h=n(r,s)}while(Cs);return h}function N0(){var e=z.H,n=e.useState()[0];return n=typeof n.then=="function"?ki(n):n,e=e.useState()[0],(Vt!==null?Vt.memoizedState:null)!==e&&(rt.flags|=1024),n}function kd(){var e=fo!==0;return fo=0,e}function _d(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Ld(e){if(co){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}co=!1}Br=0,Tn=Vt=rt=null,Cs=!1,Mi=fo=0,As=null}function oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?rt.memoizedState=Tn=e:Tn=Tn.next=e,Tn}function xn(){if(Vt===null){var e=rt.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var n=Tn===null?rt.memoizedState:Tn.next;if(n!==null)Tn=n,Vt=e;else{if(e===null)throw rt.alternate===null?Error(i(467)):Error(i(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Tn===null?rt.memoizedState=Tn=e:Tn=Tn.next=e}return Tn}function ho(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ki(e){var n=Mi;return Mi+=1,As===null&&(As=[]),e=lp(As,e,n),n=rt,(Tn===null?n.memoizedState:Tn.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Kp:Xd),e}function mo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ki(e);if(e.$$typeof===Y)return Pn(e)}throw Error(i(438,String(e)))}function zd(e){var n=null,r=rt.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=rt.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}),r===null&&(r=ho(),rt.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),s=0;s<e;s++)r[s]=me;return n.index++,r}function $r(e,n){return typeof n=="function"?n(e):n}function po(e){var n=xn();return Ud(n,Vt,e)}function Ud(e,n,r){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;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 E=y=null,O=null,F=n,J=!1;do{var re=F.lane&-536870913;if(re!==F.lane?(gt&re)===re:(Br&re)===re){var X=F.revertLane;if(X===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===Ns&&(J=!0);else if((Br&X)===X){F=F.next,X===Ns&&(J=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},O===null?(E=O=re,y=h):O=O.next=re,rt.lanes|=X,pl|=X;re=F.action,es&&r(h,re),h=F.hasEagerState?F.eagerState:r(h,re)}else X={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},O===null?(E=O=X,y=h):O=O.next=X,rt.lanes|=re,pl|=re;F=F.next}while(F!==null&&F!==n);if(O===null?y=h:O.next=E,!Na(h,e.memoizedState)&&(Dn=!0,J&&(r=Rs,r!==null)))throw r;e.memoizedState=h,e.baseState=y,e.baseQueue=O,s.lastRenderedState=h}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Hd(e){var n=xn(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var s=r.dispatch,c=r.pending,h=n.memoizedState;if(c!==null){r.pending=null;var y=c=c.next;do h=e(h,y.action),y=y.next;while(y!==c);Na(h,n.memoizedState)||(Dn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function gp(e,n,r){var s=rt,c=xn(),h=xt;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var y=!Na((Vt||c).memoizedState,r);if(y&&(c.memoizedState=r,Dn=!0),c=c.queue,qd(xp.bind(null,s,c,e),[e]),c.getSnapshot!==n||y||Tn!==null&&Tn.memoizedState.tag&1){if(s.flags|=2048,Os(9,{destroy:void 0},yp.bind(null,s,c,r,n),null),Jt===null)throw Error(i(349));h||(Br&127)!==0||vp(s,n,r)}return r}function vp(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=rt.updateQueue,n===null?(n=ho(),rt.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function yp(e,n,r,s){n.value=r,n.getSnapshot=s,bp(n)&&Sp(e)}function xp(e,n,r){return r(function(){bp(n)&&Sp(e)})}function bp(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Na(e,r)}catch{return!0}}function Sp(e){var n=Il(e,2);n!==null&&ba(n,e,2)}function Bd(e){var n=oa();if(typeof e=="function"){var r=e;if(e=r(),es){St(!0);try{r()}finally{St(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:e},n}function wp(e,n,r,s){return e.baseState=r,Ud(e,Vt,typeof s=="function"?s:$r)}function R0(e,n,r,s,c){if(yo(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?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,Ep(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Ep(e,n){var r=n.action,s=n.payload,c=e.state;if(n.isTransition){var h=z.T,y={};z.T=y;try{var E=r(c,s),O=z.S;O!==null&&O(y,E),Np(e,n,E)}catch(F){$d(e,n,F)}finally{h!==null&&y.types!==null&&(h.types=y.types),z.T=h}}else try{h=r(c,s),Np(e,n,h)}catch(F){$d(e,n,F)}}function Np(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){Rp(e,n,s)},function(s){return $d(e,n,s)}):Rp(e,n,r)}function Rp(e,n,r){n.status="fulfilled",n.value=r,jp(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Ep(e,r)))}function $d(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,jp(n),n=n.next;while(n!==s)}e.action=null}function jp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Tp(e,n){return n}function Dp(e,n){if(xt){var r=Jt.formState;if(r!==null){e:{var s=rt;if(xt){if(nn){t:{for(var c=nn,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){nn=Va(c.nextSibling),s=c.data==="F!";break e}}sl(s)}s=!1}s&&(n=r[0])}}return r=oa(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tp,lastRenderedState:n},r.queue=s,r=Xp.bind(null,rt,s),s.dispatch=r,s=Bd(!1),h=Gd.bind(null,rt,!1,s.queue),s=oa(),c={state:n,dispatch:null,action:e,pending:null},s.queue=c,r=R0.bind(null,rt,c,h,r),c.dispatch=r,s.memoizedState=e,[n,r,!1]}function Cp(e){var n=xn();return Ap(n,Vt,e)}function Ap(e,n,r){if(n=Ud(e,n,Tp)[0],e=po($r)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=ki(n)}catch(y){throw y===js?ro:y}else s=n;n=xn();var c=n.queue,h=c.dispatch;return r!==n.memoizedState&&(rt.flags|=2048,Os(9,{destroy:void 0},j0.bind(null,c,r),null)),[s,h,e]}function j0(e,n){e.action=n}function Op(e){var n=xn(),r=Vt;if(r!==null)return Ap(n,r,e);xn(),n=n.memoizedState,r=xn();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Os(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=rt.updateQueue,n===null&&(n=ho(),rt.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,n.lastEffect=e),e}function Mp(){return xn().memoizedState}function go(e,n,r,s){var c=oa();rt.flags|=e,c.memoizedState=Os(1|n,{destroy:void 0},r,s===void 0?null:s)}function vo(e,n,r,s){var c=xn();s=s===void 0?null:s;var h=c.memoizedState.inst;Vt!==null&&s!==null&&Od(s,Vt.memoizedState.deps)?c.memoizedState=Os(n,h,r,s):(rt.flags|=e,c.memoizedState=Os(1|n,h,r,s))}function kp(e,n){go(8390656,8,e,n)}function qd(e,n){vo(2048,8,e,n)}function T0(e){rt.flags|=4;var n=rt.updateQueue;if(n===null)n=ho(),rt.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function _p(e){var n=xn().memoizedState;return T0({ref:n,nextImpl:e}),function(){if((At&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Lp(e,n){return vo(4,2,e,n)}function zp(e,n){return vo(4,4,e,n)}function Up(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Hp(e,n,r){r=r!=null?r.concat([e]):null,vo(4,4,Up.bind(null,n,e),r)}function Yd(){}function Bp(e,n){var r=xn();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&Od(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function $p(e,n){var r=xn();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&Od(n,s[1]))return s[0];if(s=e(),es){St(!0);try{e()}finally{St(!1)}}return r.memoizedState=[s,n],s}function Vd(e,n,r){return r===void 0||(Br&1073741824)!==0&&(gt&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=qg(),rt.lanes|=e,pl|=e,r)}function qp(e,n,r,s){return Na(r,n)?r:Ds.current!==null?(e=Vd(e,r,s),Na(e,n)||(Dn=!0),e):(Br&42)===0||(Br&1073741824)!==0&&(gt&261930)===0?(Dn=!0,e.memoizedState=r):(e=qg(),rt.lanes|=e,pl|=e,n)}function Yp(e,n,r,s,c){var h=H.p;H.p=h!==0&&8>h?h:8;var y=z.T,E={};z.T=E,Gd(e,!1,n,r);try{var O=c(),F=z.S;if(F!==null&&F(E,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var J=w0(O,s);_i(e,n,J,Aa(e))}else _i(e,n,s,Aa(e))}catch(re){_i(e,n,{then:function(){},status:"rejected",reason:re},Aa())}finally{H.p=h,y!==null&&E.types!==null&&(y.types=E.types),z.T=y}}function D0(){}function Fd(e,n,r,s){if(e.tag!==5)throw Error(i(476));var c=Vp(e).queue;Yp(e,c,n,ie,r===null?D0:function(){return Fp(e),r(s)})}function Vp(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:$r,lastRenderedState:ie},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fp(e){var n=Vp(e);n.next===null&&(n=e.alternate.memoizedState),_i(e,n.next.queue,{},Aa())}function Id(){return Pn(Zi)}function Ip(){return xn().memoizedState}function Gp(){return xn().memoizedState}function C0(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=Aa();e=ol(r);var s=cl(n,e,r);s!==null&&(ba(s,n,r),Ci(s,n,r)),n={cache:bd()},e.payload=n;return}n=n.return}}function A0(e,n,r){var s=Aa();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},yo(e)?Pp(n,r):(r=od(e,n,r,s),r!==null&&(ba(r,e,s),Qp(r,n,s)))}function Xp(e,n,r){var s=Aa();_i(e,n,r,s)}function _i(e,n,r,s){var c={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(yo(e))Pp(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,E=h(y,r);if(c.hasEagerState=!0,c.eagerState=E,Na(E,y))return Zu(e,n,c,0),Jt===null&&Ku(),!1}catch{}finally{}if(r=od(e,n,c,s),r!==null)return ba(r,e,s),Qp(r,n,s),!0}return!1}function Gd(e,n,r,s){if(s={lane:2,revertLane:Rf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},yo(e)){if(n)throw Error(i(479))}else n=od(e,r,s,2),n!==null&&ba(n,e,2)}function yo(e){var n=e.alternate;return e===rt||n!==null&&n===rt}function Pp(e,n){Cs=co=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Qp(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,On(e,r)}}var Li={readContext:Pn,use:mo,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn};Li.useEffectEvent=hn;var Kp={readContext:Pn,use:mo,useCallback:function(e,n){return oa().memoizedState=[e,n===void 0?null:n],e},useContext:Pn,useEffect:kp,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,go(4194308,4,Up.bind(null,n,e),r)},useLayoutEffect:function(e,n){return go(4194308,4,e,n)},useInsertionEffect:function(e,n){go(4,2,e,n)},useMemo:function(e,n){var r=oa();n=n===void 0?null:n;var s=e();if(es){St(!0);try{e()}finally{St(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=oa();if(r!==void 0){var c=r(n);if(es){St(!0);try{r(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=A0.bind(null,rt,e),[s.memoizedState,e]},useRef:function(e){var n=oa();return e={current:e},n.memoizedState=e},useState:function(e){e=Bd(e);var n=e.queue,r=Xp.bind(null,rt,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Yd,useDeferredValue:function(e,n){var r=oa();return Vd(r,e,n)},useTransition:function(){var e=Bd(!1);return e=Yp.bind(null,rt,e.queue,!0,!1),oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=rt,c=oa();if(xt){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Jt===null)throw Error(i(349));(gt&127)!==0||vp(s,n,r)}c.memoizedState=r;var h={value:r,getSnapshot:n};return c.queue=h,kp(xp.bind(null,s,h,e),[e]),s.flags|=2048,Os(9,{destroy:void 0},yp.bind(null,s,h,r,n),null),r},useId:function(){var e=oa(),n=Jt.identifierPrefix;if(xt){var r=mr,s=hr;r=(s&~(1<<32-Mt(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=fo++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=E0++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Id,useFormState:Dp,useActionState:Dp,useOptimistic:function(e){var n=oa();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=Gd.bind(null,rt,!0,r),r.dispatch=n,[e,n]},useMemoCache:zd,useCacheRefresh:function(){return oa().memoizedState=C0.bind(null,rt)},useEffectEvent:function(e){var n=oa(),r={impl:e};return n.memoizedState=r,function(){if((At&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},Xd={readContext:Pn,use:mo,useCallback:Bp,useContext:Pn,useEffect:qd,useImperativeHandle:Hp,useInsertionEffect:Lp,useLayoutEffect:zp,useMemo:$p,useReducer:po,useRef:Mp,useState:function(){return po($r)},useDebugValue:Yd,useDeferredValue:function(e,n){var r=xn();return qp(r,Vt.memoizedState,e,n)},useTransition:function(){var e=po($r)[0],n=xn().memoizedState;return[typeof e=="boolean"?e:ki(e),n]},useSyncExternalStore:gp,useId:Ip,useHostTransitionStatus:Id,useFormState:Cp,useActionState:Cp,useOptimistic:function(e,n){var r=xn();return wp(r,Vt,e,n)},useMemoCache:zd,useCacheRefresh:Gp};Xd.useEffectEvent=_p;var Zp={readContext:Pn,use:mo,useCallback:Bp,useContext:Pn,useEffect:qd,useImperativeHandle:Hp,useInsertionEffect:Lp,useLayoutEffect:zp,useMemo:$p,useReducer:Hd,useRef:Mp,useState:function(){return Hd($r)},useDebugValue:Yd,useDeferredValue:function(e,n){var r=xn();return Vt===null?Vd(r,e,n):qp(r,Vt.memoizedState,e,n)},useTransition:function(){var e=Hd($r)[0],n=xn().memoizedState;return[typeof e=="boolean"?e:ki(e),n]},useSyncExternalStore:gp,useId:Ip,useHostTransitionStatus:Id,useFormState:Op,useActionState:Op,useOptimistic:function(e,n){var r=xn();return Vt!==null?wp(r,Vt,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:zd,useCacheRefresh:Gp};Zp.useEffectEvent=_p;function Pd(e,n,r,s){n=e.memoizedState,r=r(s,n),r=r==null?n:b({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Qd={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=Aa(),c=ol(s);c.payload=n,r!=null&&(c.callback=r),n=cl(e,c,s),n!==null&&(ba(n,e,s),Ci(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=Aa(),c=ol(s);c.tag=1,c.payload=n,r!=null&&(c.callback=r),n=cl(e,c,s),n!==null&&(ba(n,e,s),Ci(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=Aa(),s=ol(r);s.tag=2,n!=null&&(s.callback=n),n=cl(e,s,r),n!==null&&(ba(n,e,r),Ci(n,e,r))}};function Jp(e,n,r,s,c,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,y):n.prototype&&n.prototype.isPureReactComponent?!Si(r,s)||!Si(c,h):!0}function Wp(e,n,r,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,s),n.state!==e&&Qd.enqueueReplaceState(n,n.state,null)}function ts(e,n){var r=n;if("ref"in n){r={};for(var s in n)s!=="ref"&&(r[s]=n[s])}if(e=e.defaultProps){r===n&&(r=b({},r));for(var c in e)r[c]===void 0&&(r[c]=e[c])}return r}function eg(e){Qu(e)}function tg(e){console.error(e)}function ng(e){Qu(e)}function xo(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function ag(e,n,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Kd(e,n,r){return r=ol(r),r.tag=3,r.payload={element:null},r.callback=function(){xo(e,n)},r}function rg(e){return e=ol(e),e.tag=3,e}function lg(e,n,r,s){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var h=s.value;e.payload=function(){return c(h)},e.callback=function(){ag(n,r,s)}}var y=r.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){ag(n,r,s),typeof c!="function"&&(gl===null?gl=new Set([this]):gl.add(this));var E=s.stack;this.componentDidCatch(s.value,{componentStack:E!==null?E:""})})}function O0(e,n,r,s,c){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&Es(n,r,c,!0),r=ja.current,r!==null){switch(r.tag){case 31:case 13:return Ya===null?Oo():r.alternate===null&&mn===0&&(mn=3),r.flags&=-257,r.flags|=65536,r.lanes=c,s===lo?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),wf(e,s,c)),!1;case 22:return r.flags|=65536,s===lo?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([s]):r.add(s)),wf(e,s,c)),!1}throw Error(i(435,r.tag))}return wf(e,s,c),Oo(),!1}if(xt)return n=ja.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,s!==pd&&(e=Error(i(422),{cause:s}),Ni(Ha(e,r)))):(s!==pd&&(n=Error(i(423),{cause:s}),Ni(Ha(n,r))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Ha(s,r),c=Kd(e.stateNode,s,c),jd(e,c),mn!==4&&(mn=2)),!1;var h=Error(i(520),{cause:s});if(h=Ha(h,r),Vi===null?Vi=[h]:Vi.push(h),mn!==4&&(mn=2),n===null)return!0;s=Ha(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=c&-c,r.lanes|=e,e=Kd(r.stateNode,s,e),jd(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(gl===null||!gl.has(h))))return r.flags|=65536,c&=-c,r.lanes|=c,c=rg(c),lg(c,e,r,s),jd(r,c),!1}r=r.return}while(r!==null);return!1}var Zd=Error(i(461)),Dn=!1;function Qn(e,n,r,s){n.child=e===null?op(n,null,r,s):Wl(n,e.child,r,s)}function sg(e,n,r,s,c){r=r.render;var h=n.ref;if("ref"in s){var y={};for(var E in s)E!=="ref"&&(y[E]=s[E])}else y=s;return Ql(n),s=Md(e,n,r,y,h,c),E=kd(),e!==null&&!Dn?(_d(e,n,c),qr(e,n,c)):(xt&&E&&hd(n),n.flags|=1,Qn(e,n,s,c),n.child)}function ig(e,n,r,s,c){if(e===null){var h=r.type;return typeof h=="function"&&!cd(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,ug(e,n,h,s,c)):(e=Wu(r.type,null,s,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!lf(e,c)){var y=h.memoizedProps;if(r=r.compare,r=r!==null?r:Si,r(y,s)&&e.ref===n.ref)return qr(e,n,c)}return n.flags|=1,e=Lr(h,s),e.ref=n.ref,e.return=n,n.child=e}function ug(e,n,r,s,c){if(e!==null){var h=e.memoizedProps;if(Si(h,s)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=s=h,lf(e,c))(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,qr(e,n,c)}return Jd(e,n,r,s,c)}function og(e,n,r,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|r:r,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 cg(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ao(n,h!==null?h.cachePool:null),h!==null?fp(n,h):Dd(),hp(n);else return s=n.lanes=536870912,cg(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(ao(n,h.cachePool),fp(n,h),fl(),n.memoizedState=null):(e!==null&&ao(n,null),Dd(),fl());return Qn(e,n,c,r),n.child}function zi(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function cg(e,n,r,s,c){var h=wd();return h=h===null?null:{parent:jn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&ao(n,null),Dd(),hp(n),e!==null&&Es(e,n,s,!0),n.childLanes=c,null}function bo(e,n){return n=wo({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function dg(e,n,r){return Wl(n,e.child,null,r),e=bo(n,n.pendingProps),e.flags|=2,Ta(n),n.memoizedState=null,e}function M0(e,n,r){var s=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(xt){if(s.mode==="hidden")return e=bo(n,s),n.lanes=536870912,zi(null,e);if(Ad(n),(e=nn)?(e=Ev(e,qa),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:rl!==null?{id:hr,overflow:mr}:null,retryLane:536870912,hydrationErrors:null},r=Pm(e),r.return=n,n.child=r,Xn=n,nn=null)):e=null,e===null)throw sl(n);return n.lanes=536870912,null}return bo(n,s)}var h=e.memoizedState;if(h!==null){var y=h.dehydrated;if(Ad(n),c)if(n.flags&256)n.flags&=-257,n=dg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(Dn||Es(e,n,r,!1),c=(r&e.childLanes)!==0,Dn||c){if(s=Jt,s!==null&&(y=C(s,r),y!==0&&y!==h.retryLane))throw h.retryLane=y,Il(e,y),ba(s,e,y),Zd;Oo(),n=dg(e,n,r)}else e=h.treeContext,nn=Va(y.nextSibling),Xn=n,xt=!0,ll=null,qa=!1,e!==null&&Zm(n,e),n=bo(n,s),n.flags|=4096;return n}return e=Lr(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function So(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function Jd(e,n,r,s,c){return Ql(n),r=Md(e,n,r,s,void 0,c),s=kd(),e!==null&&!Dn?(_d(e,n,c),qr(e,n,c)):(xt&&s&&hd(n),n.flags|=1,Qn(e,n,r,c),n.child)}function fg(e,n,r,s,c,h){return Ql(n),n.updateQueue=null,r=pp(n,s,r,c),mp(e),s=kd(),e!==null&&!Dn?(_d(e,n,h),qr(e,n,h)):(xt&&s&&hd(n),n.flags|=1,Qn(e,n,r,h),n.child)}function hg(e,n,r,s,c){if(Ql(n),n.stateNode===null){var h=xs,y=r.contextType;typeof y=="object"&&y!==null&&(h=Pn(y)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Qd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},Nd(n),y=r.contextType,h.context=typeof y=="object"&&y!==null?Pn(y):xs,h.state=n.memoizedState,y=r.getDerivedStateFromProps,typeof y=="function"&&(Pd(n,r,y,s),h.state=n.memoizedState),typeof r.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&&Qd.enqueueReplaceState(h,h.state,null),Oi(n,s,h,c),Ai(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var E=n.memoizedProps,O=ts(r,E);h.props=O;var F=h.context,J=r.contextType;y=xs,typeof J=="object"&&J!==null&&(y=Pn(J));var re=r.getDerivedStateFromProps;J=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,J||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||F!==y)&&Wp(n,h,s,y),ul=!1;var X=n.memoizedState;h.state=X,Oi(n,s,h,c),Ai(),F=n.memoizedState,E||X!==F||ul?(typeof re=="function"&&(Pd(n,r,re,s),F=n.memoizedState),(O=ul||Jp(n,r,O,s,X,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=O):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,Rd(e,n),y=n.memoizedProps,J=ts(r,y),h.props=J,re=n.pendingProps,X=h.context,F=r.contextType,O=xs,typeof F=="object"&&F!==null&&(O=Pn(F)),E=r.getDerivedStateFromProps,(F=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==re||X!==O)&&Wp(n,h,s,O),ul=!1,X=n.memoizedState,h.state=X,Oi(n,s,h,c),Ai();var Q=n.memoizedState;y!==re||X!==Q||ul||e!==null&&e.dependencies!==null&&to(e.dependencies)?(typeof E=="function"&&(Pd(n,r,E,s),Q=n.memoizedState),(J=ul||Jp(n,r,J,s,X,Q,O)||e!==null&&e.dependencies!==null&&to(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,Q,O),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,Q,O)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=Q),h.props=s,h.state=Q,h.context=O,s=J):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&X===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,So(e,n),s=(n.flags&128)!==0,h||s?(h=n.stateNode,r=s&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&s?(n.child=Wl(n,e.child,null,c),n.child=Wl(n,null,r,c)):Qn(e,n,r,c),n.memoizedState=h.state,e=n.child):e=qr(e,n,c),e}function mg(e,n,r,s){return Xl(),n.flags|=256,Qn(e,n,r,s),n.child}var Wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(e){return{baseLanes:e,cachePool:ap()}}function tf(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Ca),e}function pg(e,n,r){var s=n.pendingProps,c=!1,h=(n.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(yn.current&2)!==0),y&&(c=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,e===null){if(xt){if(c?dl(n):fl(),(e=nn)?(e=Ev(e,qa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:rl!==null?{id:hr,overflow:mr}:null,retryLane:536870912,hydrationErrors:null},r=Pm(e),r.return=n,n.child=r,Xn=n,nn=null)):e=null,e===null)throw sl(n);return Hf(e)?n.lanes=32:n.lanes=536870912,null}var E=s.children;return s=s.fallback,c?(fl(),c=n.mode,E=wo({mode:"hidden",children:E},c),s=Gl(s,c,r,null),E.return=n,s.return=n,E.sibling=s,n.child=E,s=n.child,s.memoizedState=ef(r),s.childLanes=tf(e,y,r),n.memoizedState=Wd,zi(null,s)):(dl(n),nf(n,E))}var O=e.memoizedState;if(O!==null&&(E=O.dehydrated,E!==null)){if(h)n.flags&256?(dl(n),n.flags&=-257,n=af(e,n,r)):n.memoizedState!==null?(fl(),n.child=e.child,n.flags|=128,n=null):(fl(),E=s.fallback,c=n.mode,s=wo({mode:"visible",children:s.children},c),E=Gl(E,c,r,null),E.flags|=2,s.return=n,E.return=n,s.sibling=E,n.child=s,Wl(n,e.child,null,r),s=n.child,s.memoizedState=ef(r),s.childLanes=tf(e,y,r),n.memoizedState=Wd,n=zi(null,s));else if(dl(n),Hf(E)){if(y=E.nextSibling&&E.nextSibling.dataset,y)var F=y.dgst;y=F,s=Error(i(419)),s.stack="",s.digest=y,Ni({value:s,source:null,stack:null}),n=af(e,n,r)}else if(Dn||Es(e,n,r,!1),y=(r&e.childLanes)!==0,Dn||y){if(y=Jt,y!==null&&(s=C(y,r),s!==0&&s!==O.retryLane))throw O.retryLane=s,Il(e,s),ba(y,e,s),Zd;Uf(E)||Oo(),n=af(e,n,r)}else Uf(E)?(n.flags|=192,n.child=e.child,n=null):(e=O.treeContext,nn=Va(E.nextSibling),Xn=n,xt=!0,ll=null,qa=!1,e!==null&&Zm(n,e),n=nf(n,s.children),n.flags|=4096);return n}return c?(fl(),E=s.fallback,c=n.mode,O=e.child,F=O.sibling,s=Lr(O,{mode:"hidden",children:s.children}),s.subtreeFlags=O.subtreeFlags&65011712,F!==null?E=Lr(F,E):(E=Gl(E,c,r,null),E.flags|=2),E.return=n,s.return=n,s.sibling=E,n.child=s,zi(null,s),s=n.child,E=e.child.memoizedState,E===null?E=ef(r):(c=E.cachePool,c!==null?(O=jn._currentValue,c=c.parent!==O?{parent:O,pool:O}:c):c=ap(),E={baseLanes:E.baseLanes|r,cachePool:c}),s.memoizedState=E,s.childLanes=tf(e,y,r),n.memoizedState=Wd,zi(e.child,s)):(dl(n),r=e.child,e=r.sibling,r=Lr(r,{mode:"visible",children:s.children}),r.return=n,r.sibling=null,e!==null&&(y=n.deletions,y===null?(n.deletions=[e],n.flags|=16):y.push(e)),n.child=r,n.memoizedState=null,r)}function nf(e,n){return n=wo({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function wo(e,n){return e=Ra(22,e,null,n),e.lanes=0,e}function af(e,n,r){return Wl(n,e.child,null,r),e=nf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function gg(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),yd(e.return,n,r)}function rf(e,n,r,s,c,h){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:c,treeForkCount:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=r,y.tailMode=c,y.treeForkCount=h)}function vg(e,n,r){var s=n.pendingProps,c=s.revealOrder,h=s.tail;s=s.children;var y=yn.current,E=(y&2)!==0;if(E?(y=y&1|2,n.flags|=128):y&=1,ne(yn,y),Qn(e,n,s,r),s=xt?Ei:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gg(e,r,n);else if(e.tag===19)gg(e,r,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(r=n.child,c=null;r!==null;)e=r.alternate,e!==null&&oo(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=n.child,n.child=null):(c=r.sibling,r.sibling=null),rf(n,!1,c,r,h,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&oo(e)===null){n.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}rf(n,!0,r,null,h,s);break;case"together":rf(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function qr(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),pl|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Es(e,n,r,!1),(r&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,r=Lr(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=Lr(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function lf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&to(e)))}function k0(e,n,r){switch(n.tag){case 3:it(n,n.stateNode.containerInfo),il(n,jn,e.memoizedState.cache),Xl();break;case 27:case 5:nt(n);break;case 4:it(n,n.stateNode.containerInfo);break;case 10:il(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ad(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(dl(n),n.flags|=128,null):(r&n.child.childLanes)!==0?pg(e,n,r):(dl(n),e=qr(e,n,r),e!==null?e.sibling:null);dl(n);break;case 19:var c=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(Es(e,n,r,!1),s=(r&n.childLanes)!==0),c){if(s)return vg(e,n,r);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ne(yn,yn.current),s)break;return null;case 22:return n.lanes=0,og(e,n,r,n.pendingProps);case 24:il(n,jn,e.memoizedState.cache)}return qr(e,n,r)}function yg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)Dn=!0;else{if(!lf(e,r)&&(n.flags&128)===0)return Dn=!1,k0(e,n,r);Dn=(e.flags&131072)!==0}else Dn=!1,xt&&(n.flags&1048576)!==0&&Km(n,Ei,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Zl(n.elementType),n.type=e,typeof e=="function")cd(e)?(s=ts(e,s),n.tag=1,n=hg(null,n,e,s,r)):(n.tag=0,n=Jd(null,n,e,s,r));else{if(e!=null){var c=e.$$typeof;if(c===P){n.tag=11,n=sg(null,n,e,s,r);break e}else if(c===U){n.tag=14,n=ig(null,n,e,s,r);break e}}throw n=be(e)||e,Error(i(306,n,""))}}return n;case 0:return Jd(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,c=ts(s,n.pendingProps),hg(e,n,s,c,r);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,Rd(e,n),Oi(n,s,null,r);var y=n.memoizedState;if(s=y.cache,il(n,jn,s),s!==h.cache&&xd(n,[jn],r,!0),Ai(),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=mg(e,n,s,r);break e}else if(s!==c){c=Ha(Error(i(424)),n),Ni(c),n=mg(e,n,s,r);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(nn=Va(e.firstChild),Xn=n,xt=!0,ll=null,qa=!0,r=op(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Xl(),s===c){n=qr(e,n,r);break e}Qn(e,n,s,r)}n=n.child}return n;case 26:return So(e,n),e===null?(r=Cv(n.type,null,n.pendingProps,null))?n.memoizedState=r:xt||(r=n.type,e=n.pendingProps,s=Ho(Ne.current).createElement(r),s[ge]=n,s[De]=e,Kn(s,r,e),ct(s),n.stateNode=s):n.memoizedState=Cv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return nt(n),e===null&&xt&&(s=n.stateNode=jv(n.type,n.pendingProps,Ne.current),Xn=n,qa=!0,c=nn,bl(n.type)?(Bf=c,nn=Va(s.firstChild)):nn=c),Qn(e,n,n.pendingProps.children,r),So(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&xt&&((c=s=nn)&&(s=o1(s,n.type,n.pendingProps,qa),s!==null?(n.stateNode=s,Xn=n,nn=Va(s.firstChild),qa=!1,c=!0):c=!1),c||sl(n)),nt(n),c=n.type,h=n.pendingProps,y=e!==null?e.memoizedProps:null,s=h.children,_f(c,h)?s=null:y!==null&&_f(c,y)&&(n.flags|=32),n.memoizedState!==null&&(c=Md(e,n,N0,null,null,r),Zi._currentValue=c),So(e,n),Qn(e,n,s,r),n.child;case 6:return e===null&&xt&&((e=r=nn)&&(r=c1(r,n.pendingProps,qa),r!==null?(n.stateNode=r,Xn=n,nn=null,e=!0):e=!1),e||sl(n)),null;case 13:return pg(e,n,r);case 4:return it(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Wl(n,null,s,r):Qn(e,n,s,r),n.child;case 11:return sg(e,n,n.type,n.pendingProps,r);case 7:return Qn(e,n,n.pendingProps,r),n.child;case 8:return Qn(e,n,n.pendingProps.children,r),n.child;case 12:return Qn(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,il(n,n.type,s.value),Qn(e,n,s.children,r),n.child;case 9:return c=n.type._context,s=n.pendingProps.children,Ql(n),c=Pn(c),s=s(c),n.flags|=1,Qn(e,n,s,r),n.child;case 14:return ig(e,n,n.type,n.pendingProps,r);case 15:return ug(e,n,n.type,n.pendingProps,r);case 19:return vg(e,n,r);case 31:return M0(e,n,r);case 22:return og(e,n,r,n.pendingProps);case 24:return Ql(n),s=Pn(jn),e===null?(c=wd(),c===null&&(c=Jt,h=bd(),c.pooledCache=h,h.refCount++,h!==null&&(c.pooledCacheLanes|=r),c=h),n.memoizedState={parent:s,cache:c},Nd(n),il(n,jn,c)):((e.lanes&r)!==0&&(Rd(e,n),Oi(n,null,null,r),Ai()),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),il(n,jn,s)):(s=h.cache,il(n,jn,s),s!==c.cache&&xd(n,[jn],r,!0))),Qn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Yr(e){e.flags|=4}function sf(e,n,r,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(Ig())e.flags|=8192;else throw Jl=lo,Ed}else e.flags&=-16777217}function xg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_v(n))if(Ig())e.flags|=8192;else throw Jl=lo,Ed}function Eo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Qt():536870912,e.lanes|=n,Ls|=n)}function Ui(e,n){if(!xt)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function an(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(n)for(var c=e.child;c!==null;)r|=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;)r|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=r,n}function _0(e,n,r){var s=n.pendingProps;switch(md(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(n),null;case 1:return an(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Hr(jn),Ge(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ws(n)?Yr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,gd())),an(n),null;case 26:var c=n.type,h=n.memoizedState;return e===null?(Yr(n),h!==null?(an(n),xg(n,h)):(an(n),sf(n,c,null,s,r))):h?h!==e.memoizedState?(Yr(n),an(n),xg(n,h)):(an(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Yr(n),an(n),sf(n,c,e,s,r)),null;case 27:if(vn(n),r=Ne.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Yr(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return an(n),null}e=de.current,ws(n)?Jm(n):(e=jv(c,s,r),n.stateNode=e,Yr(n))}return an(n),null;case 5:if(vn(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Yr(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return an(n),null}if(h=de.current,ws(n))Jm(n);else{var y=Ho(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&&Yr(n)}}return an(n),sf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Yr(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=Ne.current,ws(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,c=Xn,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[ge]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||pv(e.nodeValue,r)),e||sl(n,!0)}else e=Ho(e).createTextNode(s),e[ge]=n,n.stateNode=e}return an(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=ws(n),r!==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 Xl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;an(n),e=!1}else r=gd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(Ta(n),n):(Ta(n),null);if((n.flags&128)!==0)throw Error(i(558))}return an(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ws(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 Xl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;an(n),c=!1}else c=gd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(Ta(n),n):(Ta(n),null)}return Ta(n),(n.flags&128)!==0?(n.lanes=r,n):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(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)),r!==e&&r&&(n.child.flags|=8192),Eo(n,n.updateQueue),an(n),null);case 4:return Ge(),e===null&&Cf(n.stateNode.containerInfo),an(n),null;case 10:return Hr(n.type),an(n),null;case 19:if($(yn),s=n.memoizedState,s===null)return an(n),null;if(c=(n.flags&128)!==0,h=s.rendering,h===null)if(c)Ui(s,!1);else{if(mn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=oo(e),h!==null){for(n.flags|=128,Ui(s,!1),e=h.updateQueue,n.updateQueue=e,Eo(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Xm(r,e),r=r.sibling;return ne(yn,yn.current&1|2),xt&&zr(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&fe()>Do&&(n.flags|=128,c=!0,Ui(s,!1),n.lanes=4194304)}else{if(!c)if(e=oo(h),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,Eo(n,e),Ui(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!xt)return an(n),null}else 2*fe()-s.renderingStartTime>Do&&r!==536870912&&(n.flags|=128,c=!0,Ui(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,r=yn.current,ne(yn,c?r&1|2:r&1),xt&&zr(n,s.treeForkCount),e):(an(n),null);case 22:case 23:return Ta(n),Cd(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(r&536870912)!==0&&(n.flags&128)===0&&(an(n),n.subtreeFlags&6&&(n.flags|=8192)):an(n),r=n.updateQueue,r!==null&&Eo(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048),e!==null&&$(Kl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Hr(jn),an(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function L0(e,n){switch(md(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Hr(jn),Ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return vn(n),null;case 31:if(n.memoizedState!==null){if(Ta(n),n.alternate===null)throw Error(i(340));Xl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Ta(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Xl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(yn),null;case 4:return Ge(),null;case 10:return Hr(n.type),null;case 22:case 23:return Ta(n),Cd(),e!==null&&$(Kl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Hr(jn),null;case 25:return null;default:return null}}function bg(e,n){switch(md(n),n.tag){case 3:Hr(jn),Ge();break;case 26:case 27:case 5:vn(n);break;case 4:Ge();break;case 31:n.memoizedState!==null&&Ta(n);break;case 13:Ta(n);break;case 19:$(yn);break;case 10:Hr(n.type);break;case 22:case 23:Ta(n),Cd(),e!==null&&$(Kl);break;case 24:Hr(jn)}}function Hi(e,n){try{var r=n.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var c=s.next;r=c;do{if((r.tag&e)===e){s=void 0;var h=r.create,y=r.inst;s=h(),y.destroy=s}r=r.next}while(r!==c)}}catch(E){$t(n,n.return,E)}}function hl(e,n,r){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,E=y.destroy;if(E!==void 0){y.destroy=void 0,c=n;var O=r,F=E;try{F()}catch(J){$t(c,O,J)}}}s=s.next}while(s!==h)}}catch(J){$t(n,n.return,J)}}function Sg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{dp(n,r)}catch(s){$t(e,e.return,s)}}}function wg(e,n,r){r.props=ts(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){$t(e,n,s)}}function Bi(e,n){try{var r=e.ref;if(r!==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 r=="function"?e.refCleanup=r(s):r.current=s}}catch(c){$t(e,n,c)}}function pr(e,n){var r=e.ref,s=e.refCleanup;if(r!==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 r=="function")try{r(null)}catch(c){$t(e,n,c)}else r.current=null}function Eg(e){var n=e.type,r=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&s.focus();break e;case"img":r.src?s.src=r.src:r.srcSet&&(s.srcset=r.srcSet)}}catch(c){$t(e,e.return,c)}}function uf(e,n,r){try{var s=e.stateNode;a1(s,e.type,r,n),s[De]=n}catch(c){$t(e,e.return,c)}}function Ng(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function of(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ng(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&&bl(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 cf(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=na));else if(s!==4&&(s===27&&bl(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(cf(e,n,r),e=e.sibling;e!==null;)cf(e,n,r),e=e.sibling}function No(e,n,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(s!==4&&(s===27&&bl(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(No(e,n,r),e=e.sibling;e!==null;)No(e,n,r),e=e.sibling}function Rg(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Kn(n,s,r),n[ge]=e,n[De]=r}catch(h){$t(e,e.return,h)}}var Vr=!1,Cn=!1,df=!1,jg=typeof WeakSet=="function"?WeakSet:Set,$n=null;function z0(e,n){if(e=e.containerInfo,Mf=Io,e=Hm(e),ad(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var c=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var y=0,E=-1,O=-1,F=0,J=0,re=e,X=null;t:for(;;){for(var Q;re!==r||c!==0&&re.nodeType!==3||(E=y+c),re!==h||s!==0&&re.nodeType!==3||(O=y+s),re.nodeType===3&&(y+=re.nodeValue.length),(Q=re.firstChild)!==null;)X=re,re=Q;for(;;){if(re===e)break t;if(X===r&&++F===c&&(E=y),X===h&&++J===s&&(O=y),(Q=re.nextSibling)!==null)break;re=X,X=re.parentNode}re=Q}r=E===-1||O===-1?null:{start:E,end:O}}else r=null}r=r||{start:0,end:0}}else r=null;for(kf={focusedElem:e,selectionRange:r},Io=!1,$n=n;$n!==null;)if(n=$n,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,$n=e;else for(;$n!==null;){switch(n=$n,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(r=0;r<e.length;r++)c=e[r],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,c=h.memoizedProps,h=h.memoizedState,s=r.stateNode;try{var Ae=ts(r.type,c);e=s.getSnapshotBeforeUpdate(Ae,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ve){$t(r,r.return,Ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)zf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zf(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,$n=e;break}$n=n.return}}function Tg(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:Ir(e,r),s&4&&Hi(5,r);break;case 1:if(Ir(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(y){$t(r,r.return,y)}else{var c=ts(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(y){$t(r,r.return,y)}}s&64&&Sg(r),s&512&&Bi(r,r.return);break;case 3:if(Ir(e,r),s&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{dp(e,n)}catch(y){$t(r,r.return,y)}}break;case 27:n===null&&s&4&&Rg(r);case 26:case 5:Ir(e,r),n===null&&s&4&&Eg(r),s&512&&Bi(r,r.return);break;case 12:Ir(e,r);break;case 31:Ir(e,r),s&4&&Ag(e,r);break;case 13:Ir(e,r),s&4&&Og(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=I0.bind(null,r),d1(e,r))));break;case 22:if(s=r.memoizedState!==null||Vr,!s){n=n!==null&&n.memoizedState!==null||Cn,c=Vr;var h=Cn;Vr=s,(Cn=n)&&!h?Gr(e,r,(r.subtreeFlags&8772)!==0):Ir(e,r),Vr=c,Cn=h}break;case 30:break;default:Ir(e,r)}}function Dg(e){var n=e.alternate;n!==null&&(e.alternate=null,Dg(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 Fr(e,n,r){for(r=r.child;r!==null;)Cg(e,n,r),r=r.sibling}function Cg(e,n,r){if(se&&typeof se.onCommitFiberUnmount=="function")try{se.onCommitFiberUnmount(un,r)}catch{}switch(r.tag){case 26:Cn||pr(r,n),Fr(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Cn||pr(r,n);var s=ln,c=ga;bl(r.type)&&(ln=r.stateNode,ga=!1),Fr(e,n,r),Pi(r.stateNode),ln=s,ga=c;break;case 5:Cn||pr(r,n);case 6:if(s=ln,c=ga,ln=null,Fr(e,n,r),ln=s,ga=c,ln!==null)if(ga)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(r.stateNode)}catch(h){$t(r,n,h)}else try{ln.removeChild(r.stateNode)}catch(h){$t(r,n,h)}break;case 18:ln!==null&&(ga?(e=ln,Sv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Vs(e)):Sv(ln,r.stateNode));break;case 4:s=ln,c=ga,ln=r.stateNode.containerInfo,ga=!0,Fr(e,n,r),ln=s,ga=c;break;case 0:case 11:case 14:case 15:hl(2,r,n),Cn||hl(4,r,n),Fr(e,n,r);break;case 1:Cn||(pr(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&wg(r,n,s)),Fr(e,n,r);break;case 21:Fr(e,n,r);break;case 22:Cn=(s=Cn)||r.memoizedState!==null,Fr(e,n,r),Cn=s;break;default:Fr(e,n,r)}}function Ag(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vs(e)}catch(r){$t(n,n.return,r)}}}function Og(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vs(e)}catch(r){$t(n,n.return,r)}}function U0(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new jg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new jg),n;default:throw Error(i(435,e.tag))}}function Ro(e,n){var r=U0(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var c=G0.bind(null,e,s);s.then(c,c)}})}function va(e,n){var r=n.deletions;if(r!==null)for(var s=0;s<r.length;s++){var c=r[s],h=e,y=n,E=y;e:for(;E!==null;){switch(E.tag){case 27:if(bl(E.type)){ln=E.stateNode,ga=!1;break e}break;case 5:ln=E.stateNode,ga=!1;break e;case 3:case 4:ln=E.stateNode.containerInfo,ga=!0;break e}E=E.return}if(ln===null)throw Error(i(160));Cg(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;)Mg(n,e),n=n.sibling}var tr=null;function Mg(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:va(n,e),ya(e),s&4&&(hl(3,e,e.return),Hi(3,e),hl(5,e,e.return));break;case 1:va(n,e),ya(e),s&512&&(Cn||r===null||pr(r,r.return)),s&64&&Vr&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?s:r.concat(s))));break;case 26:var c=tr;if(va(n,e),ya(e),s&512&&(Cn||r===null||pr(r,r.return)),s&4){var h=r!==null?r.memoizedState:null;if(s=e.memoizedState,r===null)if(s===null)if(e.stateNode===null){e:{s=e.type,r=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,r),h[ge]=e,ct(h),s=h;break e;case"link":var y=Mv("link","href",c).get(s+(r.href||""));if(y){for(var E=0;E<y.length;E++)if(h=y[E],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){y.splice(E,1);break t}}h=c.createElement(s),Kn(h,s,r),c.head.appendChild(h);break;case"meta":if(y=Mv("meta","content",c).get(s+(r.content||""))){for(E=0;E<y.length;E++)if(h=y[E],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){y.splice(E,1);break t}}h=c.createElement(s),Kn(h,s,r),c.head.appendChild(h);break;default:throw Error(i(468,s))}h[ge]=e,ct(h),s=h}e.stateNode=s}else kv(c,e.type,e.stateNode);else e.stateNode=Ov(c,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?kv(c,e.type,e.stateNode):Ov(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&uf(e,e.memoizedProps,r.memoizedProps)}break;case 27:va(n,e),ya(e),s&512&&(Cn||r===null||pr(r,r.return)),r!==null&&s&4&&uf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(va(n,e),ya(e),s&512&&(Cn||r===null||pr(r,r.return)),e.flags&32){c=e.stateNode;try{nl(c,"")}catch(Ae){$t(e,e.return,Ae)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,uf(e,c,r!==null?r.memoizedProps:c)),s&1024&&(df=!0);break;case 6:if(va(n,e),ya(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(Ae){$t(e,e.return,Ae)}}break;case 3:if(qo=null,c=tr,tr=Bo(n.containerInfo),va(n,e),tr=c,ya(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Vs(n.containerInfo)}catch(Ae){$t(e,e.return,Ae)}df&&(df=!1,kg(e));break;case 4:s=tr,tr=Bo(e.stateNode.containerInfo),va(n,e),ya(e),tr=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,Ro(e,s)));break;case 13:va(n,e),ya(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(To=fe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ro(e,s)));break;case 22:c=e.memoizedState!==null;var O=r!==null&&r.memoizedState!==null,F=Vr,J=Cn;if(Vr=F||c,Cn=J||O,va(n,e),Cn=J,Vr=F,ya(e),s&8192)e:for(n=e.stateNode,n._visibility=c?n._visibility&-2:n._visibility|1,c&&(r===null||O||Vr||Cn||ns(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){O=r=n;try{if(h=O.stateNode,c)y=h.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{E=O.stateNode;var re=O.memoizedProps.style,X=re!=null&&re.hasOwnProperty("display")?re.display:null;E.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Ae){$t(O,O.return,Ae)}}}else if(n.tag===6){if(r===null){O=n;try{O.stateNode.nodeValue=c?"":O.memoizedProps}catch(Ae){$t(O,O.return,Ae)}}}else if(n.tag===18){if(r===null){O=n;try{var Q=O.stateNode;c?wv(Q,!0):wv(O.stateNode,!1)}catch(Ae){$t(O,O.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;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(r=s.retryQueue,r!==null&&(s.retryQueue=null,Ro(e,r))));break;case 19:va(n,e),ya(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ro(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 r,s=e.return;s!==null;){if(Ng(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var c=r.stateNode,h=of(e);No(e,h,c);break;case 5:var y=r.stateNode;r.flags&32&&(nl(y,""),r.flags&=-33);var E=of(e);No(e,E,y);break;case 3:case 4:var O=r.stateNode.containerInfo,F=of(e);cf(e,F,O);break;default:throw Error(i(161))}}catch(J){$t(e,e.return,J)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function kg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;kg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Ir(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Tg(e,n.alternate,n),n=n.sibling}function ns(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:hl(4,n,n.return),ns(n);break;case 1:pr(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&wg(n,n.return,r),ns(n);break;case 27:Pi(n.stateNode);case 26:case 5:pr(n,n.return),ns(n);break;case 22:n.memoizedState===null&&ns(n);break;case 30:ns(n);break;default:ns(n)}e=e.sibling}}function Gr(e,n,r){for(r=r&&(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:Gr(c,h,r),Hi(4,h);break;case 1:if(Gr(c,h,r),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 E=s.stateNode;try{var O=c.shared.hiddenCallbacks;if(O!==null)for(c.shared.hiddenCallbacks=null,c=0;c<O.length;c++)cp(O[c],E)}catch(F){$t(s,s.return,F)}}r&&y&64&&Sg(h),Bi(h,h.return);break;case 27:Rg(h);case 26:case 5:Gr(c,h,r),r&&s===null&&y&4&&Eg(h),Bi(h,h.return);break;case 12:Gr(c,h,r);break;case 31:Gr(c,h,r),r&&y&4&&Ag(c,h);break;case 13:Gr(c,h,r),r&&y&4&&Og(c,h);break;case 22:h.memoizedState===null&&Gr(c,h,r),Bi(h,h.return);break;case 30:break;default:Gr(c,h,r)}n=n.sibling}}function ff(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Ri(r))}function hf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ri(e))}function nr(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)_g(e,n,r,s),n=n.sibling}function _g(e,n,r,s){var c=n.flags;switch(n.tag){case 0:case 11:case 15:nr(e,n,r,s),c&2048&&Hi(9,n);break;case 1:nr(e,n,r,s);break;case 3:nr(e,n,r,s),c&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ri(e)));break;case 12:if(c&2048){nr(e,n,r,s),e=n.stateNode;try{var h=n.memoizedProps,y=h.id,E=h.onPostCommit;typeof E=="function"&&E(y,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){$t(n,n.return,O)}}else nr(e,n,r,s);break;case 31:nr(e,n,r,s);break;case 13:nr(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,y=n.alternate,n.memoizedState!==null?h._visibility&2?nr(e,n,r,s):$i(e,n):h._visibility&2?nr(e,n,r,s):(h._visibility|=2,Ms(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),c&2048&&ff(y,n);break;case 24:nr(e,n,r,s),c&2048&&hf(n.alternate,n);break;default:nr(e,n,r,s)}}function Ms(e,n,r,s,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,y=n,E=r,O=s,F=y.flags;switch(y.tag){case 0:case 11:case 15:Ms(h,y,E,O,c),Hi(8,y);break;case 23:break;case 22:var J=y.stateNode;y.memoizedState!==null?J._visibility&2?Ms(h,y,E,O,c):$i(h,y):(J._visibility|=2,Ms(h,y,E,O,c)),c&&F&2048&&ff(y.alternate,y);break;case 24:Ms(h,y,E,O,c),c&&F&2048&&hf(y.alternate,y);break;default:Ms(h,y,E,O,c)}n=n.sibling}}function $i(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,s=n,c=s.flags;switch(s.tag){case 22:$i(r,s),c&2048&&ff(s.alternate,s);break;case 24:$i(r,s),c&2048&&hf(s.alternate,s);break;default:$i(r,s)}n=n.sibling}}var qi=8192;function ks(e,n,r){if(e.subtreeFlags&qi)for(e=e.child;e!==null;)Lg(e,n,r),e=e.sibling}function Lg(e,n,r){switch(e.tag){case 26:ks(e,n,r),e.flags&qi&&e.memoizedState!==null&&E1(r,tr,e.memoizedState,e.memoizedProps);break;case 5:ks(e,n,r);break;case 3:case 4:var s=tr;tr=Bo(e.stateNode.containerInfo),ks(e,n,r),tr=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=qi,qi=16777216,ks(e,n,r),qi=s):ks(e,n,r));break;default:ks(e,n,r)}}function zg(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 Yi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];$n=s,Hg(s,e)}zg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ug(e),e=e.sibling}function Ug(e){switch(e.tag){case 0:case 11:case 15:Yi(e),e.flags&2048&&hl(9,e,e.return);break;case 3:Yi(e);break;case 12:Yi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,jo(e)):Yi(e);break;default:Yi(e)}}function jo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];$n=s,Hg(s,e)}zg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:hl(8,n,n.return),jo(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,jo(n));break;default:jo(n)}e=e.sibling}}function Hg(e,n){for(;$n!==null;){var r=$n;switch(r.tag){case 0:case 11:case 15:hl(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var s=r.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ri(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,$n=s;else e:for(r=e;$n!==null;){s=$n;var c=s.sibling,h=s.return;if(Dg(s),s===r){$n=null;break e}if(c!==null){c.return=h,$n=c;break e}$n=h}}}var H0={getCacheForType:function(e){var n=Pn(jn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Pn(jn).controller.signal}},B0=typeof WeakMap=="function"?WeakMap:Map,At=0,Jt=null,ht=null,gt=0,Bt=0,Da=null,ml=!1,_s=!1,mf=!1,Xr=0,mn=0,pl=0,as=0,pf=0,Ca=0,Ls=0,Vi=null,xa=null,gf=!1,To=0,Bg=0,Do=1/0,Co=null,gl=null,Ln=0,vl=null,zs=null,Pr=0,vf=0,yf=null,$g=null,Fi=0,xf=null;function Aa(){return(At&2)!==0&>!==0?gt&-gt:z.T!==null?Rf():Z()}function qg(){if(Ca===0)if((gt&536870912)===0||xt){var e=Pt;Pt<<=1,(Pt&3932160)===0&&(Pt=262144),Ca=e}else Ca=536870912;return e=ja.current,e!==null&&(e.flags|=32),Ca}function ba(e,n,r){(e===Jt&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)&&(Us(e,0),yl(e,gt,Ca,!1)),ft(e,r),((At&2)===0||e!==Jt)&&(e===Jt&&((At&2)===0&&(as|=r),mn===4&&yl(e,gt,Ca,!1)),gr(e))}function Yg(e,n,r){if((At&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||jt(e,n),c=s?Y0(e,n):Sf(e,n,!0),h=s;do{if(c===0){_s&&!s&&yl(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!$0(r)){c=Sf(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 E=e;c=Vi;var O=E.current.memoizedState.isDehydrated;if(O&&(Us(E,y).flags|=256),y=Sf(E,y,!1),y!==2){if(mf&&!O){E.errorRecoveryDisabledLanes|=h,as|=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){Us(e,0),yl(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:yl(s,n,Ca,!ml);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(yl(s,n,Ca,!ml),zt(s,0,!0)!==0)break e;Pr=n,s.timeoutHandle=xv(Vg.bind(null,s,r,xa,Co,gf,n,Ca,as,Ls,ml,h,"Throttled",-0,0),c);break e}Vg(s,r,xa,Co,gf,n,Ca,as,Ls,ml,h,null,-0,0)}}break}while(!0);gr(e)}function Vg(e,n,r,s,c,h,y,E,O,F,J,re,X,Q){if(e.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},Lg(n,h,re);var Ae=(h&62914560)===h?To-fe():(h&4194048)===h?Bg-fe():0;if(Ae=N1(re,Ae),Ae!==null){Pr=h,e.cancelPendingCommit=Ae(Zg.bind(null,e,n,h,r,s,c,y,E,O,J,re,null,X,Q)),yl(e,h,y,!F);return}}Zg(e,n,h,r,s,c,y,E,O)}function $0(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var s=0;s<r.length;s++){var c=r[s],h=c.getSnapshot;c=c.value;try{if(!Na(h(),c))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;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 yl(e,n,r,s){n&=~pf,n&=~as,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}r!==0&&wn(e,r,n)}function Ao(){return(At&6)===0?(Ii(0),!1):!0}function bf(){if(ht!==null){if(Bt===0)var e=ht.return;else e=ht,Ur=Pl=null,Ld(e),Ts=null,Ti=0,e=ht;for(;e!==null;)bg(e.alternate,e),e=e.return;ht=null}}function Us(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,s1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Pr=0,bf(),Jt=e,ht=r=Lr(e.current,null),gt=n,Bt=0,Da=null,ml=!1,_s=jt(e,n),mf=!1,Ls=Ca=pf=as=pl=mn=0,xa=Vi=null,gf=!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 Xr=n,Ku(),r}function Fg(e,n){rt=null,z.H=Li,n===js||n===ro?(n=sp(),Bt=3):n===Ed?(n=sp(),Bt=4):Bt=n===Zd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Da=n,ht===null&&(mn=1,xo(e,Ha(n,e.current)))}function Ig(){var e=ja.current;return e===null?!0:(gt&4194048)===gt?Ya===null:(gt&62914560)===gt||(gt&536870912)!==0?e===Ya:!1}function Gg(){var e=z.H;return z.H=Li,e===null?Li:e}function Xg(){var e=z.A;return z.A=H0,e}function Oo(){mn=4,ml||(gt&4194048)!==gt&&ja.current!==null||(_s=!0),(pl&134217727)===0&&(as&134217727)===0||Jt===null||yl(Jt,gt,Ca,!1)}function Sf(e,n,r){var s=At;At|=2;var c=Gg(),h=Xg();(Jt!==e||gt!==n)&&(Co=null,Us(e,n)),n=!1;var y=mn;e:do try{if(Bt!==0&&ht!==null){var E=ht,O=Da;switch(Bt){case 8:bf(),y=6;break e;case 3:case 2:case 9:case 6:ja.current===null&&(n=!0);var F=Bt;if(Bt=0,Da=null,Hs(e,E,O,F),r&&_s){y=0;break e}break;default:F=Bt,Bt=0,Da=null,Hs(e,E,O,F)}}q0(),y=mn;break}catch(J){Fg(e,J)}while(!0);return n&&e.shellSuspendCounter++,Ur=Pl=null,At=s,z.H=c,z.A=h,ht===null&&(Jt=null,gt=0,Ku()),y}function q0(){for(;ht!==null;)Pg(ht)}function Y0(e,n){var r=At;At|=2;var s=Gg(),c=Xg();Jt!==e||gt!==n?(Co=null,Do=fe()+500,Us(e,n)):_s=jt(e,n);e:do try{if(Bt!==0&&ht!==null){n=ht;var h=Da;t:switch(Bt){case 1:Bt=0,Da=null,Hs(e,n,h,1);break;case 2:case 9:if(rp(h)){Bt=0,Da=null,Qg(n);break}n=function(){Bt!==2&&Bt!==9||Jt!==e||(Bt=7),gr(e)},h.then(n,n);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:rp(h)?(Bt=0,Da=null,Qg(n)):(Bt=0,Da=null,Hs(e,n,h,7));break;case 5:var y=null;switch(ht.tag){case 26:y=ht.memoizedState;case 5:case 27:var E=ht;if(y?_v(y):E.stateNode.complete){Bt=0,Da=null;var O=E.sibling;if(O!==null)ht=O;else{var F=E.return;F!==null?(ht=F,Mo(F)):ht=null}break t}}Bt=0,Da=null,Hs(e,n,h,5);break;case 6:Bt=0,Da=null,Hs(e,n,h,6);break;case 8:bf(),mn=6;break e;default:throw Error(i(462))}}V0();break}catch(J){Fg(e,J)}while(!0);return Ur=Pl=null,z.H=s,z.A=c,At=r,ht!==null?0:(Jt=null,gt=0,Ku(),mn)}function V0(){for(;ht!==null&&!Yn();)Pg(ht)}function Pg(e){var n=yg(e.alternate,e,Xr);e.memoizedProps=e.pendingProps,n===null?Mo(e):ht=n}function Qg(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=fg(r,n,n.pendingProps,n.type,void 0,gt);break;case 11:n=fg(r,n,n.pendingProps,n.type.render,n.ref,gt);break;case 5:Ld(n);default:bg(r,n),n=ht=Xm(n,Xr),n=yg(r,n,Xr)}e.memoizedProps=e.pendingProps,n===null?Mo(e):ht=n}function Hs(e,n,r,s){Ur=Pl=null,Ld(n),Ts=null,Ti=0;var c=n.return;try{if(O0(e,c,n,r,gt)){mn=1,xo(e,Ha(r,e.current)),ht=null;return}}catch(h){if(c!==null)throw ht=c,h;mn=1,xo(e,Ha(r,e.current)),ht=null;return}n.flags&32768?(xt||s===1?e=!0:_s||(gt&536870912)!==0?e=!1:(ml=e=!0,(s===2||s===9||s===3||s===6)&&(s=ja.current,s!==null&&s.tag===13&&(s.flags|=16384))),Kg(n,e)):Mo(n)}function Mo(e){var n=e;do{if((n.flags&32768)!==0){Kg(n,ml);return}e=n.return;var r=_0(n.alternate,n,Xr);if(r!==null){ht=r;return}if(n=n.sibling,n!==null){ht=n;return}ht=n=e}while(n!==null);mn===0&&(mn=5)}function Kg(e,n){do{var r=L0(e.alternate,e);if(r!==null){r.flags&=32767,ht=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){ht=e;return}ht=e=r}while(e!==null);mn=6,ht=null}function Zg(e,n,r,s,c,h,y,E,O){e.cancelPendingCommit=null;do ko();while(Ln!==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|=ud,Je(e,r,h,y,E,O),e===Jt&&(ht=Jt=null,gt=0),zs=n,vl=e,Pr=r,vf=h,yf=c,$g=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,X0(Ze,function(){return nv(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=z.T,z.T=null,c=H.p,H.p=2,y=At,At|=4;try{z0(e,n,r)}finally{At=y,H.p=c,z.T=s}}Ln=1,Jg(),Wg(),ev()}}function Jg(){if(Ln===1){Ln=0;var e=vl,n=zs,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=z.T,z.T=null;var s=H.p;H.p=2;var c=At;At|=4;try{Mg(n,e);var h=kf,y=Hm(e.containerInfo),E=h.focusedElem,O=h.selectionRange;if(y!==E&&E&&E.ownerDocument&&Um(E.ownerDocument.documentElement,E)){if(O!==null&&ad(E)){var F=O.start,J=O.end;if(J===void 0&&(J=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(J,E.value.length);else{var re=E.ownerDocument||document,X=re&&re.defaultView||window;if(X.getSelection){var Q=X.getSelection(),Ae=E.textContent.length,Ve=Math.min(O.start,Ae),It=O.end===void 0?Ve:Math.min(O.end,Ae);!Q.extend&&Ve>It&&(y=It,It=Ve,Ve=y);var B=zm(E,Ve),_=zm(E,It);if(B&&_&&(Q.rangeCount!==1||Q.anchorNode!==B.node||Q.anchorOffset!==B.offset||Q.focusNode!==_.node||Q.focusOffset!==_.offset)){var V=re.createRange();V.setStart(B.node,B.offset),Q.removeAllRanges(),Ve>It?(Q.addRange(V),Q.extend(_.node,_.offset)):(V.setEnd(_.node,_.offset),Q.addRange(V))}}}}for(re=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<re.length;E++){var te=re[E];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Io=!!Mf,kf=Mf=null}finally{At=c,H.p=s,z.T=r}}e.current=n,Ln=2}}function Wg(){if(Ln===2){Ln=0;var e=vl,n=zs,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=z.T,z.T=null;var s=H.p;H.p=2;var c=At;At|=4;try{Tg(e,n.alternate,n)}finally{At=c,H.p=s,z.T=r}}Ln=3}}function ev(){if(Ln===4||Ln===3){Ln=0,Vn();var e=vl,n=zs,r=Pr,s=$g;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ln=5:(Ln=0,zs=vl=null,tv(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(gl=null),q(r),n=n.stateNode,se&&typeof se.onCommitFiberRoot=="function")try{se.onCommitFiberRoot(un,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=z.T,c=H.p,H.p=2,z.T=null;try{for(var h=e.onRecoverableError,y=0;y<s.length;y++){var E=s[y];h(E.value,{componentStack:E.stack})}}finally{z.T=n,H.p=c}}(Pr&3)!==0&&ko(),gr(e),c=e.pendingLanes,(r&261930)!==0&&(c&42)!==0?e===xf?Fi++:(Fi=0,xf=e):Fi=0,Ii(0)}}function tv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Ri(n)))}function ko(){return Jg(),Wg(),ev(),nv()}function nv(){if(Ln!==5)return!1;var e=vl,n=vf;vf=0;var r=q(Pr),s=z.T,c=H.p;try{H.p=32>r?32:r,z.T=null,r=yf,yf=null;var h=vl,y=Pr;if(Ln=0,zs=vl=null,Pr=0,(At&6)!==0)throw Error(i(331));var E=At;if(At|=4,Ug(h.current),_g(h,h.current,y,r),At=E,Ii(0,!1),se&&typeof se.onPostCommitFiberRoot=="function")try{se.onPostCommitFiberRoot(un,h)}catch{}return!0}finally{H.p=c,z.T=s,tv(e,n)}}function av(e,n,r){n=Ha(r,n),n=Kd(e.stateNode,n,2),e=cl(e,n,2),e!==null&&(ft(e,2),gr(e))}function $t(e,n,r){if(e.tag===3)av(e,e,r);else for(;n!==null;){if(n.tag===3){av(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(gl===null||!gl.has(s))){e=Ha(r,e),r=rg(2),s=cl(n,r,2),s!==null&&(lg(r,s,n,e),ft(s,2),gr(s));break}}n=n.return}}function wf(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new B0;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(r)||(mf=!0,c.add(r),e=F0.bind(null,e,n,r),n.then(e,e))}function F0(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Jt===e&&(gt&r)===r&&(mn===4||mn===3&&(gt&62914560)===gt&&300>fe()-To?(At&2)===0&&Us(e,0):pf|=r,Ls===gt&&(Ls=0)),gr(e)}function rv(e,n){n===0&&(n=Qt()),e=Il(e,n),e!==null&&(ft(e,n),gr(e))}function I0(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),rv(e,r)}function G0(e,n){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(r=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),rv(e,r)}function X0(e,n){return Lt(e,n)}var _o=null,Bs=null,Ef=!1,Lo=!1,Nf=!1,xl=0;function gr(e){e!==Bs&&e.next===null&&(Bs===null?_o=Bs=e:Bs=Bs.next=e),Lo=!0,Ef||(Ef=!0,Q0())}function Ii(e,n){if(!Nf&&Lo){Nf=!0;do for(var r=!1,s=_o;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var h=0;else{var y=s.suspendedLanes,E=s.pingedLanes;h=(1<<31-Mt(42|e)+1)-1,h&=c&~(y&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,uv(s,h))}else h=gt,h=zt(s,s===Jt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||jt(s,h)||(r=!0,uv(s,h));s=s.next}while(r);Nf=!1}}function P0(){lv()}function lv(){Lo=Ef=!1;var e=0;xl!==0&&l1()&&(e=xl);for(var n=fe(),r=null,s=_o;s!==null;){var c=s.next,h=sv(s,n);h===0?(s.next=null,r===null?_o=c:r.next=c,c===null&&(Bs=r)):(r=s,(e!==0||(h&3)!==0)&&(Lo=!0)),s=c}Ln!==0&&Ln!==5||Ii(e),xl!==0&&(xl=0)}function sv(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var y=31-Mt(h),E=1<<y,O=c[y];O===-1?((E&r)===0||(E&s)!==0)&&(c[y]=en(E,n)):O<=n&&(e.expiredLanes|=E),h&=~E}if(n=Jt,r=gt,r=zt(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Wt(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||jt(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&Wt(s),q(r)){case 2:case 8:r=qe;break;case 32:r=Ze;break;case 268435456:r=Xt;break;default:r=Ze}return s=iv.bind(null,e),r=Lt(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&Wt(s),e.callbackPriority=2,e.callbackNode=null,2}function iv(e,n){if(Ln!==0&&Ln!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ko()&&e.callbackNode!==r)return null;var s=gt;return s=zt(e,e===Jt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Yg(e,s,n),sv(e,fe()),e.callbackNode!=null&&e.callbackNode===r?iv.bind(null,e):null)}function uv(e,n){if(ko())return null;Yg(e,n,!0)}function Q0(){i1(function(){(At&6)!==0?Lt(Me,P0):lv()})}function Rf(){if(xl===0){var e=Ns;e===0&&(e=Be,Be<<=1,(Be&261888)===0&&(Be=256)),xl=e}return xl}function ov(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:tn(""+e)}function cv(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function K0(e,n,r,s,c){if(n==="submit"&&r&&r.stateNode===c){var h=ov((c[De]||null).action),y=s.submitter;y&&(n=(n=y[De]||null)?ov(n.formAction):y.getAttribute("formAction"),n!==null&&(h=n,y=null));var E=new kr("action","action",null,s,c);e.push({event:E,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xl!==0){var O=y?cv(c,y):new FormData(c);Fd(r,{pending:!0,data:O,method:c.method,action:h},null,O)}}else typeof h=="function"&&(E.preventDefault(),O=y?cv(c,y):new FormData(c),Fd(r,{pending:!0,data:O,method:c.method,action:h},h,O))},currentTarget:c}]})}}for(var jf=0;jf<id.length;jf++){var Tf=id[jf],Z0=Tf.toLowerCase(),J0=Tf[0].toUpperCase()+Tf.slice(1);er(Z0,"on"+J0)}er(qm,"onAnimationEnd"),er(Ym,"onAnimationIteration"),er(Vm,"onAnimationStart"),er("dblclick","onDoubleClick"),er("focusin","onFocus"),er("focusout","onBlur"),er(m0,"onTransitionRun"),er(p0,"onTransitionStart"),er(g0,"onTransitionCancel"),er(Fm,"onTransitionEnd"),Mn("onMouseEnter",["mouseout","mouseover"]),Mn("onMouseLeave",["mouseout","mouseover"]),Mn("onPointerEnter",["pointerout","pointerover"]),Mn("onPointerLeave",["pointerout","pointerover"]),En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),En("onBeforeInput",["compositionend","keypress","textInput","paste"]),En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gi="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(" "),W0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gi));function dv(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],c=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var y=s.length-1;0<=y;y--){var E=s[y],O=E.instance,F=E.currentTarget;if(E=E.listener,O!==h&&c.isPropagationStopped())break e;h=E,c.currentTarget=F;try{h(c)}catch(J){Qu(J)}c.currentTarget=null,h=O}else for(y=0;y<s.length;y++){if(E=s[y],O=E.instance,F=E.currentTarget,E=E.listener,O!==h&&c.isPropagationStopped())break e;h=E,c.currentTarget=F;try{h(c)}catch(J){Qu(J)}c.currentTarget=null,h=O}}}}function mt(e,n){var r=n[Oe];r===void 0&&(r=n[Oe]=new Set);var s=e+"__bubble";r.has(s)||(fv(n,e,2,!1),r.add(s))}function Df(e,n,r){var s=0;n&&(s|=4),fv(r,e,s,n)}var zo="_reactListening"+Math.random().toString(36).slice(2);function Cf(e){if(!e[zo]){e[zo]=!0,Kt.forEach(function(r){r!=="selectionchange"&&(W0.has(r)||Df(r,!1,e),Df(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[zo]||(n[zo]=!0,Df("selectionchange",!1,n))}}function fv(e,n,r,s){switch(qv(n)){case 2:var c=T1;break;case 8:c=D1;break;default:c=Ff}r=c.bind(null,n,r,e),c=void 0,!gi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(n,r,{capture:!0,passive:c}):e.addEventListener(n,r,!0):c!==void 0?e.addEventListener(n,r,{passive:c}):e.addEventListener(n,r,!1)}function Af(e,n,r,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 E=s.stateNode.containerInfo;if(E===c)break;if(y===4)for(y=s.return;y!==null;){var O=y.tag;if((O===3||O===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;E!==null;){if(y=Ht(E),y===null)return;if(O=y.tag,O===5||O===6||O===26||O===27){s=h=y;continue e}E=E.parentNode}}s=s.return}pi(function(){var F=h,J=Dr(r),re=[];e:{var X=Im.get(e);if(X!==void 0){var Q=kr,Ae=e;switch(e){case"keypress":if(ms(r)===0)break e;case"keydown":case"keyup":Q=Rn;break;case"focusin":Ae="focus",Q=ve;break;case"focusout":Ae="blur",Q=ve;break;case"beforeblur":case"afterblur":Q=ve;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Iu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=G;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=fr;break;case qm:case Ym:case Vm:Q=ue;break;case Fm:Q=Gu;break;case"scroll":case"scrollend":Q=Kc;break;case"wheel":Q=Jc;break;case"copy":case"cut":case"paste":Q=xe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=_t;break;case"toggle":case"beforetoggle":Q=t0}var Ve=(n&4)!==0,It=!Ve&&(e==="scroll"||e==="scrollend"),B=Ve?X!==null?X+"Capture":null:X;Ve=[];for(var _=F,V;_!==null;){var te=_;if(V=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||V===null||B===null||(te=La(_,B),te!=null&&Ve.push(Xi(_,te,V))),It)break;_=_.return}0<Ve.length&&(X=new Q(X,Ae,null,r,J),re.push({event:X,listeners:Ve}))}}if((n&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",X&&r!==Ea&&(Ae=r.relatedTarget||r.fromElement)&&(Ht(Ae)||Ae[we]))break e;if((Q||X)&&(X=J.window===J?J:(X=J.ownerDocument)?X.defaultView||X.parentWindow:window,Q?(Ae=r.relatedTarget||r.toElement,Q=F,Ae=Ae?Ht(Ae):null,Ae!==null&&(It=o(Ae),Ve=Ae.tag,Ae!==It||Ve!==5&&Ve!==27&&Ve!==6)&&(Ae=null)):(Q=null,Ae=F),Q!==Ae)){if(Ve=Iu,te="onMouseLeave",B="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Ve=_t,te="onPointerLeave",B="onPointerEnter",_="pointer"),It=Q==null?X:ot(Q),V=Ae==null?X:ot(Ae),X=new Ve(te,_+"leave",Q,r,J),X.target=It,X.relatedTarget=V,te=null,Ht(J)===F&&(Ve=new Ve(B,_+"enter",Ae,r,J),Ve.target=V,Ve.relatedTarget=It,te=Ve),It=te,Q&&Ae)t:{for(Ve=e1,B=Q,_=Ae,V=0,te=B;te;te=Ve(te))V++;te=0;for(var He=_;He;He=Ve(He))te++;for(;0<V-te;)B=Ve(B),V--;for(;0<te-V;)_=Ve(_),te--;for(;V--;){if(B===_||_!==null&&B===_.alternate){Ve=B;break t}B=Ve(B),_=Ve(_)}Ve=null}else Ve=null;Q!==null&&hv(re,X,Q,Ve,!1),Ae!==null&&It!==null&&hv(re,It,Ae,Ve,!0)}}e:{if(X=F?ot(F):window,Q=X.nodeName&&X.nodeName.toLowerCase(),Q==="select"||Q==="input"&&X.type==="file")var Dt=Am;else if(Dm(X))if(Om)Dt=d0;else{Dt=o0;var ke=u0}else Q=X.nodeName,!Q||Q.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?F&&Hl(F.elementType)&&(Dt=Am):Dt=c0;if(Dt&&(Dt=Dt(e,F))){Cm(re,Dt,r,J);break e}ke&&ke(e,X,F),e==="focusout"&&F&&X.type==="number"&&F.memoizedProps.value!=null&&Tt(X,"number",X.value)}switch(ke=F?ot(F):window,e){case"focusin":(Dm(ke)||ke.contentEditable==="true")&&(gs=ke,rd=F,wi=null);break;case"focusout":wi=rd=gs=null;break;case"mousedown":ld=!0;break;case"contextmenu":case"mouseup":case"dragend":ld=!1,Bm(re,r,J);break;case"selectionchange":if(h0)break;case"keydown":case"keyup":Bm(re,r,J)}var st;if(ed)e:{switch(e){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else ps?jm(e,r)&&(vt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(vt="onCompositionStart");vt&&(Em&&r.locale!=="ko"&&(ps||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&ps&&(st=Vu()):(za=J,vi="value"in za?za.value:za.textContent,ps=!0)),ke=Uo(F,vt),0<ke.length&&(vt=new at(vt,e,null,r,J),re.push({event:vt,listeners:ke}),st?vt.data=st:(st=Tm(r),st!==null&&(vt.data=st)))),(st=a0?r0(e,r):l0(e,r))&&(vt=Uo(F,"onBeforeInput"),0<vt.length&&(ke=new at("onBeforeInput","beforeinput",null,r,J),re.push({event:ke,listeners:vt}),ke.data=st)),K0(re,e,F,r,J)}dv(re,n)})}function Xi(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Uo(e,n){for(var r=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,r),c!=null&&s.unshift(Xi(e,c,h)),c=La(e,n),c!=null&&s.push(Xi(e,c,h))),e.tag===3)return s;e=e.return}return[]}function e1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hv(e,n,r,s,c){for(var h=n._reactName,y=[];r!==null&&r!==s;){var E=r,O=E.alternate,F=E.stateNode;if(E=E.tag,O!==null&&O===s)break;E!==5&&E!==26&&E!==27||F===null||(O=F,c?(F=La(r,h),F!=null&&y.unshift(Xi(r,F,O))):c||(F=La(r,h),F!=null&&y.push(Xi(r,F,O)))),r=r.return}y.length!==0&&e.push({event:n,listeners:y})}var t1=/\r\n?/g,n1=/\u0000|\uFFFD/g;function mv(e){return(typeof e=="string"?e:""+e).replace(t1,`
|
|
49
|
-
`).replace(n1,"")}function pv(e,n){return n=mv(n),mv(e)===n}function Ft(e,n,r,s,c,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||nl(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&nl(e,""+s);break;case"className":ur(e,"class",s);break;case"tabIndex":ur(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ur(e,r,s);break;case"style":ha(e,s,h);break;case"data":if(n!=="object"){ur(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=tn(""+s),e.setAttribute(r,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(r,"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"&&(r==="formAction"?(n!=="input"&&Ft(e,n,"name",c.name,c,null),Ft(e,n,"formEncType",c.formEncType,c,null),Ft(e,n,"formMethod",c.formMethod,c,null),Ft(e,n,"formTarget",c.formTarget,c,null)):(Ft(e,n,"encType",c.encType,c,null),Ft(e,n,"method",c.method,c,null),Ft(e,n,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=tn(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=na);break;case"onScroll":s!=null&&mt("scroll",e);break;case"onScrollEnd":s!=null&&mt("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=r}}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}r=tn(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);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(r,""+s):e.removeAttribute(r);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(r,""):e.removeAttribute(r);break;case"capture":case"download":s===!0?e.setAttribute(r,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,s):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(r,s):e.removeAttribute(r);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(r):e.setAttribute(r,s);break;case"popover":mt("beforetoggle",e),mt("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<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=fs.get(r)||r,ea(e,r,s))}}function Of(e,n,r,s,c,h){switch(r){case"style":ha(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(r=s.__html,r!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof s=="string"?nl(e,s):(typeof s=="number"||typeof s=="bigint")&&nl(e,""+s);break;case"onScroll":s!=null&&mt("scroll",e);break;case"onScrollEnd":s!=null&&mt("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(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),n=r.slice(2,c?r.length-7:void 0),h=e[De]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,c),typeof s=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,s,c);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):ea(e,r,s)}}}function Kn(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",e),mt("load",e);var s=!1,c=!1,h;for(h in r)if(r.hasOwnProperty(h)){var y=r[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:Ft(e,n,h,y,r,null)}}c&&Ft(e,n,"srcSet",r.srcSet,r,null),s&&Ft(e,n,"src",r.src,r,null);return;case"input":mt("invalid",e);var E=h=y=c=null,O=null,F=null;for(s in r)if(r.hasOwnProperty(s)){var J=r[s];if(J!=null)switch(s){case"name":c=J;break;case"type":y=J;break;case"checked":O=J;break;case"defaultChecked":F=J;break;case"value":h=J;break;case"defaultValue":E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,n));break;default:Ft(e,n,s,J,r,null)}}hi(e,h,E,O,F,y,c,!1);return;case"select":mt("invalid",e),s=y=h=null;for(c in r)if(r.hasOwnProperty(c)&&(E=r[c],E!=null))switch(c){case"value":h=E;break;case"defaultValue":y=E;break;case"multiple":s=E;default:Ft(e,n,c,E,r,null)}n=h,r=y,e.multiple=!!s,n!=null?or(e,!!s,n,!1):r!=null&&or(e,!!s,r,!0);return;case"textarea":mt("invalid",e),h=c=s=null;for(y in r)if(r.hasOwnProperty(y)&&(E=r[y],E!=null))switch(y){case"value":s=E;break;case"defaultValue":c=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(i(91));break;default:Ft(e,n,y,E,r,null)}Ja(e,s,c,h);return;case"option":for(O in r)if(r.hasOwnProperty(O)&&(s=r[O],s!=null))switch(O){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ft(e,n,O,s,r,null)}return;case"dialog":mt("beforetoggle",e),mt("toggle",e),mt("cancel",e),mt("close",e);break;case"iframe":case"object":mt("load",e);break;case"video":case"audio":for(s=0;s<Gi.length;s++)mt(Gi[s],e);break;case"image":mt("error",e),mt("load",e);break;case"details":mt("toggle",e);break;case"embed":case"source":case"link":mt("error",e),mt("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 r)if(r.hasOwnProperty(F)&&(s=r[F],s!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ft(e,n,F,s,r,null)}return;default:if(Hl(n)){for(J in r)r.hasOwnProperty(J)&&(s=r[J],s!==void 0&&Of(e,n,J,s,r,void 0));return}}for(E in r)r.hasOwnProperty(E)&&(s=r[E],s!=null&&Ft(e,n,E,s,r,null))}function a1(e,n,r,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,E=null,O=null,F=null,J=null;for(Q in r){var re=r[Q];if(r.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":O=re;default:s.hasOwnProperty(Q)||Ft(e,n,Q,null,s,re)}}for(var X in s){var Q=s[X];if(re=r[X],s.hasOwnProperty(X)&&(Q!=null||re!=null))switch(X){case"type":h=Q;break;case"name":c=Q;break;case"checked":F=Q;break;case"defaultChecked":J=Q;break;case"value":y=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,n));break;default:Q!==re&&Ft(e,n,X,Q,s,re)}}Ul(e,y,E,O,F,J,h,c);return;case"select":Q=y=E=X=null;for(h in r)if(O=r[h],r.hasOwnProperty(h)&&O!=null)switch(h){case"value":break;case"multiple":Q=O;default:s.hasOwnProperty(h)||Ft(e,n,h,null,s,O)}for(c in s)if(h=s[c],O=r[c],s.hasOwnProperty(c)&&(h!=null||O!=null))switch(c){case"value":X=h;break;case"defaultValue":E=h;break;case"multiple":y=h;default:h!==O&&Ft(e,n,c,h,s,O)}n=E,r=y,s=Q,X!=null?or(e,!!r,X,!1):!!s!=!!r&&(n!=null?or(e,!!r,n,!0):or(e,!!r,r?[]:"",!1));return;case"textarea":Q=X=null;for(E in r)if(c=r[E],r.hasOwnProperty(E)&&c!=null&&!s.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ft(e,n,E,null,s,c)}for(y in s)if(c=s[y],h=r[y],s.hasOwnProperty(y)&&(c!=null||h!=null))switch(y){case"value":X=c;break;case"defaultValue":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==h&&Ft(e,n,y,c,s,h)}Yu(e,X,Q);return;case"option":for(var Ae in r)if(X=r[Ae],r.hasOwnProperty(Ae)&&X!=null&&!s.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:Ft(e,n,Ae,null,s,X)}for(O in s)if(X=s[O],Q=r[O],s.hasOwnProperty(O)&&X!==Q&&(X!=null||Q!=null))switch(O){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Ft(e,n,O,X,s,Q)}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 Ve in r)X=r[Ve],r.hasOwnProperty(Ve)&&X!=null&&!s.hasOwnProperty(Ve)&&Ft(e,n,Ve,null,s,X);for(F in s)if(X=s[F],Q=r[F],s.hasOwnProperty(F)&&X!==Q&&(X!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,n));break;default:Ft(e,n,F,X,s,Q)}return;default:if(Hl(n)){for(var It in r)X=r[It],r.hasOwnProperty(It)&&X!==void 0&&!s.hasOwnProperty(It)&&Of(e,n,It,void 0,s,X);for(J in s)X=s[J],Q=r[J],!s.hasOwnProperty(J)||X===Q||X===void 0&&Q===void 0||Of(e,n,J,X,s,Q);return}}for(var B in r)X=r[B],r.hasOwnProperty(B)&&X!=null&&!s.hasOwnProperty(B)&&Ft(e,n,B,null,s,X);for(re in s)X=s[re],Q=r[re],!s.hasOwnProperty(re)||X===Q||X==null&&Q==null||Ft(e,n,re,X,s,Q)}function gv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function r1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var c=r[s],h=c.transferSize,y=c.initiatorType,E=c.duration;if(h&&E&&gv(y)){for(y=0,E=c.responseEnd,s+=1;s<r.length;s++){var O=r[s],F=O.startTime;if(F>E)break;var J=O.transferSize,re=O.initiatorType;J&&gv(re)&&(O=O.responseEnd,y+=J*(O<E?1:(E-F)/(O-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 Mf=null,kf=null;function Ho(e){return e.nodeType===9?e:e.ownerDocument}function vv(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 yv(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 _f(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 Lf=null;function l1(){var e=window.event;return e&&e.type==="popstate"?e===Lf?!1:(Lf=e,!0):(Lf=null,!1)}var xv=typeof setTimeout=="function"?setTimeout:void 0,s1=typeof clearTimeout=="function"?clearTimeout:void 0,bv=typeof Promise=="function"?Promise:void 0,i1=typeof queueMicrotask=="function"?queueMicrotask:typeof bv<"u"?function(e){return bv.resolve(null).then(e).catch(u1)}:xv;function u1(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Sv(e,n){var r=n,s=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(c),Vs(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Pi(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Pi(r);for(var h=r.firstChild;h;){var y=h.nextSibling,E=h.nodeName;h[Ke]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=y}}else r==="body"&&Pi(e.ownerDocument.body);r=c}while(r);Vs(n)}function wv(e,n){var r=e;e=0;do{var s=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=s}while(r)}function zf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":zf(r),$e(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function o1(e,n,r,s){for(;e.nodeType===1;){var c=r;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 c1(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Va(e.nextSibling),e===null))return null;return e}function Ev(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 Uf(e){return e.data==="$?"||e.data==="$~"}function Hf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function d1(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var s=function(){n(),r.removeEventListener("DOMContentLoaded",s)};r.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 Bf=null;function Nv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Va(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Rv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function jv(e,n,r){switch(n=Ho(r),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 Pi(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);$e(e)}var Fa=new Map,Tv=new Set;function Bo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Qr=H.d;H.d={f:f1,r:h1,D:m1,C:p1,L:g1,m:v1,X:x1,S:y1,M:b1};function f1(){var e=Qr.f(),n=Ao();return e||n}function h1(e){var n=We(e);n!==null&&n.tag===5&&n.type==="form"?Fp(n):Qr.r(e)}var $s=typeof document>"u"?null:document;function Dv(e,n,r){var s=$s;if(s&&typeof n=="string"&&n){var c=Gn(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Tv.has(c)||(Tv.add(c),e={rel:e,crossOrigin:r,href:n},s.querySelector(c)===null&&(n=s.createElement("link"),Kn(n,"link",e),ct(n),s.head.appendChild(n)))}}function m1(e){Qr.D(e),Dv("dns-prefetch",e,null)}function p1(e,n){Qr.C(e,n),Dv("preconnect",e,n)}function g1(e,n,r){Qr.L(e,n,r);var s=$s;if(s&&e&&n){var c='link[rel="preload"][as="'+Gn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+Gn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+Gn(r.imageSizes)+'"]')):c+='[href="'+Gn(e)+'"]';var h=c;switch(n){case"style":h=qs(e);break;case"script":h=Ys(e)}Fa.has(h)||(e=b({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Fa.set(h,e),s.querySelector(c)!==null||n==="style"&&s.querySelector(Qi(h))||n==="script"&&s.querySelector(Ki(h))||(n=s.createElement("link"),Kn(n,"link",e),ct(n),s.head.appendChild(n)))}}function v1(e,n){Qr.m(e,n);var r=$s;if(r&&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=Ys(e)}if(!Fa.has(h)&&(e=b({rel:"modulepreload",href:e},n),Fa.set(h,e),r.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ki(h)))return}s=r.createElement("link"),Kn(s,"link",e),ct(s),r.head.appendChild(s)}}}function y1(e,n,r){Qr.S(e,n,r);var s=$s;if(s&&e){var c=lt(s).hoistableStyles,h=qs(e);n=n||"default";var y=c.get(h);if(!y){var E={loading:0,preload:null};if(y=s.querySelector(Qi(h)))E.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Fa.get(h))&&$f(e,r);var O=y=s.createElement("link");ct(O),Kn(O,"link",e),O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),O.addEventListener("load",function(){E.loading|=1}),O.addEventListener("error",function(){E.loading|=2}),E.loading|=4,$o(y,n,s)}y={type:"stylesheet",instance:y,count:1,state:E},c.set(h,y)}}}function x1(e,n){Qr.X(e,n);var r=$s;if(r&&e){var s=lt(r).hoistableScripts,c=Ys(e),h=s.get(c);h||(h=r.querySelector(Ki(c)),h||(e=b({src:e,async:!0},n),(n=Fa.get(c))&&qf(e,n),h=r.createElement("script"),ct(h),Kn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(c,h))}}function b1(e,n){Qr.M(e,n);var r=$s;if(r&&e){var s=lt(r).hoistableScripts,c=Ys(e),h=s.get(c);h||(h=r.querySelector(Ki(c)),h||(e=b({src:e,async:!0,type:"module"},n),(n=Fa.get(c))&&qf(e,n),h=r.createElement("script"),ct(h),Kn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(c,h))}}function Cv(e,n,r,s){var c=(c=Ne.current)?Bo(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=qs(r.href),r=lt(c).hoistableStyles,s=r.get(n),s||(s={type:"style",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=qs(r.href);var h=lt(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(Qi(e)))&&!h._p&&(y.instance=h,y.state.loading=5),Fa.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Fa.set(e,r),h||S1(c,e,r,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=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ys(r),r=lt(c).hoistableScripts,s=r.get(n),s||(s={type:"script",instance:null,count:0,state:null},r.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function qs(e){return'href="'+Gn(e)+'"'}function Qi(e){return'link[rel="stylesheet"]['+e+"]"}function Av(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function S1(e,n,r,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",r),ct(n),e.head.appendChild(n))}function Ys(e){return'[src="'+Gn(e)+'"]'}function Ki(e){return"script[async]"+e}function Ov(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Gn(r.href)+'"]');if(s)return n.instance=s,ct(s),s;var c=b({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ct(s),Kn(s,"style",c),$o(s,r.precedence,e),n.instance=s;case"stylesheet":c=qs(r.href);var h=e.querySelector(Qi(c));if(h)return n.state.loading|=4,n.instance=h,ct(h),h;s=Av(r),(c=Fa.get(c))&&$f(s,c),h=(e.ownerDocument||e).createElement("link"),ct(h);var y=h;return y._p=new Promise(function(E,O){y.onload=E,y.onerror=O}),Kn(h,"link",s),n.state.loading|=4,$o(h,r.precedence,e),n.instance=h;case"script":return h=Ys(r.src),(c=e.querySelector(Ki(h)))?(n.instance=c,ct(c),c):(s=r,(c=Fa.get(h))&&(s=b({},r),qf(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,$o(s,r.precedence,e));return n.instance}function $o(e,n,r){for(var s=r.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 E=s[y];if(E.dataset.precedence===n)h=E;else if(h!==c)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function $f(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function qf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var qo=null;function Mv(e,n,r){if(qo===null){var s=new Map,c=qo=new Map;c.set(r,s)}else c=qo,s=c.get(r),s||(s=new Map,c.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),c=0;c<r.length;c++){var h=r[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 E=s.get(y);E?E.push(h):s.set(y,[h])}}return s}function kv(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function w1(e,n,r){if(r===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 _v(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function E1(e,n,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=qs(s.href),h=n.querySelector(Qi(c));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Yo.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,ct(h);return}h=n.ownerDocument||n,s=Av(s),(c=Fa.get(c))&&$f(s,c),h=h.createElement("link"),ct(h);var y=h;y._p=new Promise(function(E,O){y.onload=E,y.onerror=O}),Kn(h,"link",s),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Yo.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Yf=0;function N1(e,n){return e.stylesheets&&e.count===0&&Fo(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&Fo(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Yf===0&&(Yf=62500*r1());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fo(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Yf?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vo=null;function Fo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vo=new Map,n.forEach(R1,e),Vo=null,Yo.call(e))}function R1(e,n){if(!(n.state.loading&4)){var r=Vo.get(e);if(r)var s=r.get(null);else{r=new Map,Vo.set(e,r);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")&&(r.set(y.dataset.precedence,y),s=y)}s&&r.set(null,s)}c=n.instance,y=c.getAttribute("data-precedence"),h=r.get(y)||s,h===s&&r.set(null,c),r.set(y,c),this.count++,s=Yo.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 Zi={$$typeof:Y,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function j1(e,n,r,s,c,h,y,E,O){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=O,this.incompleteTransitions=new Map}function Lv(e,n,r,s,c,h,y,E,O,F,J,re){return e=new j1(e,n,r,y,O,F,J,re,E),n=1,h===!0&&(n|=24),h=Ra(3,null,null,n),e.current=h,h.stateNode=e,n=bd(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},Nd(h),e}function zv(e){return e?(e=xs,e):xs}function Uv(e,n,r,s,c,h){c=zv(c),s.context===null?s.context=c:s.pendingContext=c,s=ol(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=cl(e,s,n),r!==null&&(ba(r,e,n),Ci(r,e,n))}function Hv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Vf(e,n){Hv(e,n),(e=e.alternate)&&Hv(e,n)}function Bv(e){if(e.tag===13||e.tag===31){var n=Il(e,67108864);n!==null&&ba(n,e,67108864),Vf(e,67108864)}}function $v(e){if(e.tag===13||e.tag===31){var n=Aa();n=k(n);var r=Il(e,n);r!==null&&ba(r,e,n),Vf(e,n)}}var Io=!0;function T1(e,n,r,s){var c=z.T;z.T=null;var h=H.p;try{H.p=2,Ff(e,n,r,s)}finally{H.p=h,z.T=c}}function D1(e,n,r,s){var c=z.T;z.T=null;var h=H.p;try{H.p=8,Ff(e,n,r,s)}finally{H.p=h,z.T=c}}function Ff(e,n,r,s){if(Io){var c=If(s);if(c===null)Af(e,n,s,Go,r),Yv(e,s);else if(A1(c,e,n,r,s))s.stopPropagation();else if(Yv(e,s),n&4&&-1<C1.indexOf(e)){for(;c!==null;){var h=We(c);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=yt(h.pendingLanes);if(y!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;y;){var O=1<<31-Mt(y);E.entanglements[1]|=O,y&=~O}gr(h),(At&6)===0&&(Do=fe()+500,Ii(0))}}break;case 31:case 13:E=Il(h,2),E!==null&&ba(E,h,2),Ao(),Vf(h,2)}if(h=If(s),h===null&&Af(e,n,s,Go,r),h===c)break;c=h}c!==null&&s.stopPropagation()}else Af(e,n,s,null,r)}}function If(e){return e=Dr(e),Gf(e)}var Go=null;function Gf(e){if(Go=null,e=Ht(e),e!==null){var n=o(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=m(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Go=e,null}function qv(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 Me:return 2;case qe:return 8;case Ze:case pt:return 32;case Xt:return 268435456;default:return 32}default:return 32}}var Xf=!1,Sl=null,wl=null,El=null,Ji=new Map,Wi=new Map,Nl=[],C1="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 Yv(e,n){switch(e){case"focusin":case"focusout":Sl=null;break;case"dragenter":case"dragleave":wl=null;break;case"mouseover":case"mouseout":El=null;break;case"pointerover":case"pointerout":Ji.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wi.delete(n.pointerId)}}function eu(e,n,r,s,c,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:s,nativeEvent:h,targetContainers:[c]},n!==null&&(n=We(n),n!==null&&Bv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function A1(e,n,r,s,c){switch(n){case"focusin":return Sl=eu(Sl,e,n,r,s,c),!0;case"dragenter":return wl=eu(wl,e,n,r,s,c),!0;case"mouseover":return El=eu(El,e,n,r,s,c),!0;case"pointerover":var h=c.pointerId;return Ji.set(h,eu(Ji.get(h)||null,e,n,r,s,c)),!0;case"gotpointercapture":return h=c.pointerId,Wi.set(h,eu(Wi.get(h)||null,e,n,r,s,c)),!0}return!1}function Vv(e){var n=Ht(e.target);if(n!==null){var r=o(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,ae(e.priority,function(){$v(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,ae(e.priority,function(){$v(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=If(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Ea=s,r.target.dispatchEvent(s),Ea=null}else return n=We(r),n!==null&&Bv(n),e.blockedOn=r,!1;n.shift()}return!0}function Fv(e,n,r){Xo(e)&&r.delete(n)}function O1(){Xf=!1,Sl!==null&&Xo(Sl)&&(Sl=null),wl!==null&&Xo(wl)&&(wl=null),El!==null&&Xo(El)&&(El=null),Ji.forEach(Fv),Wi.forEach(Fv)}function Po(e,n){e.blockedOn===n&&(e.blockedOn=null,Xf||(Xf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,O1)))}var Qo=null;function Iv(e){Qo!==e&&(Qo=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Qo===e&&(Qo=null);for(var n=0;n<e.length;n+=3){var r=e[n],s=e[n+1],c=e[n+2];if(typeof s!="function"){if(Gf(s||r)===null)continue;break}var h=We(r);h!==null&&(e.splice(n,3),n-=3,Fd(h,{pending:!0,data:c,method:r.method,action:s},s,c))}}))}function Vs(e){function n(O){return Po(O,e)}Sl!==null&&Po(Sl,e),wl!==null&&Po(wl,e),El!==null&&Po(El,e),Ji.forEach(n),Wi.forEach(n);for(var r=0;r<Nl.length;r++){var s=Nl[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Nl.length&&(r=Nl[0],r.blockedOn===null);)Vv(r),r.blockedOn===null&&Nl.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var c=r[s],h=r[s+1],y=c[De]||null;if(typeof h=="function")y||Iv(r);else if(y){var E=null;if(h&&h.hasAttribute("formAction")){if(c=h,y=h[De]||null)E=y.formAction;else if(Gf(c)!==null)continue}else E=y.action;typeof E=="function"?r[s+1]=E:(r.splice(s,3),s-=3),Iv(r)}}}function Gv(){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(r,20)}function r(){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(r,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function Pf(e){this._internalRoot=e}Ko.prototype.render=Pf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=Aa();Uv(r,s,e,n,null,null)},Ko.prototype.unmount=Pf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Uv(e.current,2,null,e,null,null),Ao(),n[we]=null}};function Ko(e){this._internalRoot=e}Ko.prototype.unstable_scheduleHydration=function(e){if(e){var n=Z();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Nl.length&&n!==0&&n<Nl[r].priority;r++);Nl.splice(r,0,e),r===0&&Vv(e)}};var Xv=a.version;if(Xv!=="19.2.7")throw Error(i(527,Xv,"19.2.7"));H.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 M1={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zo.isDisabled&&Zo.supportsFiber)try{un=Zo.inject(M1),se=Zo}catch{}}return nu.createRoot=function(e,n){if(!u(e))throw Error(i(299));var r=!1,s="",c=eg,h=tg,y=ng;return n!=null&&(n.unstable_strictMode===!0&&(r=!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=Lv(e,1,!1,null,null,r,s,null,c,h,y,Gv),e[we]=n.current,Cf(e),new Pf(n)},nu.hydrateRoot=function(e,n,r){if(!u(e))throw Error(i(299));var s=!1,c="",h=eg,y=tg,E=ng,O=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError),r.formState!==void 0&&(O=r.formState)),n=Lv(e,1,!0,n,r??null,s,c,O,h,y,E,Gv),n.context=zv(null),r=n.current,s=Aa(),s=k(s),c=ol(s),c.callback=null,cl(r,c,s),r=s,n.current.lanes=r,ft(n,r),gr(n),e[we]=n.current,Cf(e),new Ko(n)},nu.version="19.2.7",nu}var ay;function G1(){if(ay)return Zf.exports;ay=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(),Zf.exports=I1(),Zf.exports}var X1=G1();/**
|
|
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 wx=t=>{throw TypeError(t)},Ex=(t,a,l)=>a.has(t)||wx("Cannot "+l),Ia=(t,a,l)=>(Ex(t,a,"read from private field"),l?l.call(t):a.get(t)),du=(t,a,l)=>a.has(t)?wx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,l),vr=(t,a,l,i)=>(Ex(t,a,"write to private field"),a.set(t,l),l),Cc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Hh=/^[\\/]{2}/;function Nx(t,a){return a+t.replace(/\\/g,"/")}var ry="popstate";function ly(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function P1(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 bu("",{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 l(i,u){return typeof u=="string"?u:Er(u)}return K1(a,l,null,t)}function tt(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Sn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Q1(){return Math.random().toString(36).substring(2,10)}function sy(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 bu(t,a,l=null,i,u){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Nr(a):a,state:l,key:a&&a.key||i||Q1(),mask:u}}function Er({pathname:t="/",search:a="",hash:l=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(t+=l.charAt(0)==="#"?l:"#"+l),t}function Nr(t){let a={};if(t){let l=t.indexOf("#");l>=0&&(a.hash=t.substring(l),t=t.substring(0,l));let i=t.indexOf("?");i>=0&&(a.search=t.substring(i),t=t.substring(0,i)),t&&(a.pathname=t)}return a}function K1(t,a,l,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 j=x(),L=j==null?null:j-g;g=j,p&&p({action:m,location:A.location,delta:L})}function w(j,L){m="PUSH";let I=ly(j)?j:bu(A.location,j,L);g=x()+1;let Y=sy(I,g),P=A.createHref(I.mask||I);try{f.pushState(Y,"",P)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;u.location.assign(P)}o&&p&&p({action:m,location:A.location,delta:1})}function S(j,L){m="REPLACE";let I=ly(j)?j:bu(A.location,j,L);g=x();let Y=sy(I,g),P=A.createHref(I.mask||I);f.replaceState(Y,"",P),o&&p&&p({action:m,location:A.location,delta:0})}function N(j){return Rx(u,j)}let A={get action(){return m},get location(){return t(u,f)},listen(j){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(ry,b),p=j,()=>{u.removeEventListener(ry,b),p=null}},createHref(j){return a(u,j)},createURL:N,encodeLocation(j){let L=N(j);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:w,replace:S,go(j){return f.go(j)}};return A}function Rx(t,a,l=!1){let i="http://localhost";t&&(i=t.location.origin!=="null"?t.location.origin:t.location.href),tt(i,"No window.location.(origin|href) available to create URL");let u=typeof a=="string"?a:Er(a);return u=u.replace(/ $/,"%20"),!l&&Hh.test(u)&&(u=i+u),new URL(u,i)}var fu,iy=class{constructor(t){if(du(this,fu,new Map),t)for(let[a,l]of t)this.set(a,l)}get(t){if(Ia(this,fu).has(t))return Ia(this,fu).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Ia(this,fu).set(t,a)}};fu=new WeakMap;var Z1=new Set(["lazy","caseSensitive","path","id","index","children"]);function J1(t){return Z1.has(t)}var W1=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function eS(t){return W1.has(t)}function tS(t){return t.index===!0}function Su(t,a,l=[],i={},u=!1){return t.map((o,f)=>{let m=[...l,String(f)],p=typeof o.id=="string"?o.id:m.join("-");if(tt(o.index!==!0||!o.children,"Cannot specify children on an index route"),tt(u||!i[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),tS(o)){let g={...o,id:p};return i[p]=uy(g,a(g)),g}else{let g={...o,id:p,children:void 0};return i[p]=uy(g,a(g)),o.children&&(g.children=Su(o.children,a,m,i,u)),g}})}function uy(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function jx(t,a,l="/"){return ar(t,a,l,!1)}function ar(t,a,l,i,u){let o=typeof a=="string"?Nr(a):a,f=Ka(o.pathname||"/",l);if(f==null)return null;let m=u??cc(t),p=null,g=hS(f);for(let x=0;p==null&&x<m.length;++x)p=fS(m[x],g,i);return p}function nS(t,a){let{route:l,pathname:i,params:u}=t;return{id:l.id,pathname:i,params:u,data:a[l.id],loaderData:a[l.id],handle:l.handle}}function cc(t){let a=Tx(t);return aS(a),a}function Tx(t,a=[],l=[],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;tt(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]),w=l.concat(x);f.children&&f.children.length>0&&(tt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),Tx(f.children,a,w,b,p)),!(f.path==null&&!f.index)&&a.push({path:b,score:cS(b,f.index),routesMeta:w.map((S,N)=>{let[A,j]=Ax(S.relativePath,S.caseSensitive,N===w.length-1);return{...S,matcher:A,compiledParams:j}})})};return t.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))o(f,m);else for(let g of Dx(f.path))o(f,m,!0,g)}),a}function Dx(t){let a=t.split("/");if(a.length===0)return[];let[l,...i]=a,u=l.endsWith("?"),o=l.replace(/\?$/,"");if(i.length===0)return u?[o,""]:[o];let f=Dx(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 aS(t){t.sort((a,l)=>a.score!==l.score?l.score-a.score:dS(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}var rS=/^:[\w-]+$/,lS=3,sS=2,iS=1,uS=10,oS=-2,oy=t=>t==="*";function cS(t,a){let l=t.split("/"),i=l.length;return l.some(oy)&&(i+=oS),a&&(i+=sS),l.filter(u=>!oy(u)).reduce((u,o)=>u+(rS.test(o)?lS:o===""?iS:uS),i)}function dS(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 fS(t,a,l=!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},w=p.matcher&&p.compiledParams?Cx(b,x,p.matcher,p.compiledParams):yc(b,x),S=p.route;if(!w&&g&&l&&!i[i.length-1].route.index&&(w=yc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!w)return null;Object.assign(u,w.params),f.push({params:u,pathname:Qa([o,w.pathname]),pathnameBase:gS(Qa([o,w.pathnameBase])),route:S}),w.pathnameBase!=="/"&&(o=Qa([o,w.pathnameBase]))}return f}function yc(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,i]=Ax(t.path,t.caseSensitive,t.end);return Cx(t,a,l,i)}function Cx(t,a,l,i){let u=a.match(l);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},w)=>{if(x==="*"){let N=m[w]||"";f=o.slice(0,o.length-N.length).replace(/(.)\/+$/,"$1")}const S=m[w];return b&&!S?g[x]=void 0:g[x]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:f,pattern:t}}function Ax(t,a=!1,l=!0){Sn(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==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?u+="\\/*$":t!==""&&t!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),i]}function hS(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Sn(!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 l=a.endsWith("/")?a.length-1:a.length,i=t.charAt(l);return i&&i!=="/"?null:t.slice(l)||"/"}function mS({basename:t,pathname:a}){return a==="/"?t:Qa([t,a])}var Bh=t=>Cc.test(t);function pS(t,a="/"){let{pathname:l,search:i="",hash:u=""}=typeof t=="string"?Nr(t):t,o;return l?(l=qh(l),l.startsWith("/")?o=cy(l.substring(1),"/"):o=cy(l,a)):o=a,{pathname:o,search:vS(i),hash:yS(u)}}function cy(t,a){let l=xc(a).split("/");return t.split("/").forEach(u=>{u===".."?l.length>1&&l.pop():u!=="."&&l.push(u)}),l.length>1?l.join("/"):"/"}function th(t,a,l,i){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ox(t){return t.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function $h(t){let a=Ox(t);return a.map((l,i)=>i===a.length-1?l.pathname:l.pathnameBase)}function Ac(t,a,l,i=!1){let u;typeof t=="string"?u=Nr(t):(u={...t},tt(!u.pathname||!u.pathname.includes("?"),th("?","pathname","search",u)),tt(!u.pathname||!u.pathname.includes("#"),th("#","pathname","hash",u)),tt(!u.search||!u.search.includes("#"),th("#","search","hash",u)));let o=t===""||u.pathname==="",f=o?"/":u.pathname,m;if(f==null)m=l;else{let b=a.length-1;if(!i&&f.startsWith("..")){let w=f.split("/");for(;w[0]==="..";)w.shift(),b-=1;u.pathname=w.join("/")}m=b>=0?a[b]:"/"}let p=pS(u,m),g=f&&f!=="/"&&f.endsWith("/"),x=(o||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var qh=t=>t.replace(/[\\/]{2,}/g,"/"),Qa=t=>qh(t.join("/")),xc=t=>t.replace(/\/+$/,""),gS=t=>xc(t).replace(/^\/*/,"/"),vS=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yS=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Rr=(t,a=302)=>{let l=a;typeof l=="number"?l={status:l}:typeof l.status>"u"&&(l.status=302);let i=new Headers(l.headers);return i.set("Location",t),new Response(null,{...l,headers:i})},xS=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ju=class{constructor(t,a,l,i=!1){this.status=t,this.statusText=a||"",this.internal=i,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function ti(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(l=>l.route.path).filter(Boolean);return Qa(a)||"/"}var Mx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function kx(t,a){let l=t;if(typeof l!="string"||!Cc.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let i=l,u=!1;if(Mx)try{let o=new URL(window.location.href),f=Hh.test(l)?new URL(Nx(l,o.protocol)):new URL(l),m=Ka(f.pathname,a);f.origin===o.origin&&m!=null?l=m+f.search+f.hash:u=!0}catch{Sn(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:l}}var Ol=Symbol("Uninstrumented");function bS(t,a){let l={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(l);for(let m of f)o[m]&&l[m].push(o[m])}}));let i={};if(typeof a.lazy=="function"&&l.lazy.length>0){let u=Zs(l.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=l[`lazy.${o}`];if(typeof f=="function"&&m.length>0){let p=Zs(m,f,()=>{});p&&(i.lazy=Object.assign(i.lazy||{},{[o]:p}))}})}return["loader","action"].forEach(u=>{let o=a[u];if(typeof o=="function"&&l[u].length>0){let f=o[Ol]??o,m=Zs(l[u],f,(...p)=>dy(p[0]));m&&(u==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[Ol]=f,i[u]=m)}}),a.middleware&&a.middleware.length>0&&l.middleware.length>0&&(i.middleware=a.middleware.map(u=>{let o=u[Ol]??u,f=Zs(l.middleware,o,(...m)=>dy(m[0]));return f?(f[Ol]=o,f):u})),i}function SS(t,a){let l={navigate:[],fetch:[]};if(a.forEach(i=>i({instrument(u){let o=Object.keys(u);for(let f of o)u[f]&&l[f].push(u[f])}})),l.navigate.length>0){let i=t.navigate[Ol]??t.navigate,u=Zs(l.navigate,i,(...o)=>{let[f,m]=o;return{to:typeof f=="number"||typeof f=="string"?f:f?Er(f):".",...fy(t,m??{})}});u&&(u[Ol]=i,t.navigate=u)}if(l.fetch.length>0){let i=t.fetch[Ol]??t.fetch,u=Zs(l.fetch,i,(...o)=>{let[f,,m,p]=o;return{href:m??".",fetcherKey:f,...fy(t,p??{})}});u&&(u[Ol]=i,t.fetch=u)}return t}function Zs(t,a,l){return t.length===0?null:async(...i)=>{let u=await _x(t,l(...i),()=>a(...i),t.length-1);if(u.type==="error")throw u.value;return u.value}}async function _x(t,a,l,i){let u=t[i],o;if(u){let f,m=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=_x(t,a,l,i-1),o=await f,tt(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 l()}}catch(f){o={type:"error",value:f}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function dy(t){let{request:a,context:l,params:i,pattern:u}=t;return{request:wS(a),params:{...i},pattern:u,context:ES(l)}}function fy(t,a){return{currentUrl:Er(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 wS(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function ES(t){if(RS(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var NS=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function RS(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")===NS}var Lx=["POST","PUT","PATCH","DELETE"],jS=new Set(Lx),TS=["GET",...Lx],DS=new Set(TS),zx=new Set([301,302,303,307,308]),CS=new Set([307,308]),nh={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},Ux={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},au={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},AS=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Hx="remix-router-transitions",Bx=Symbol("ResetLoaderData"),rs,Ps,Tl,Qs,OS=class{constructor(t){du(this,rs),du(this,Ps),du(this,Tl),du(this,Qs),vr(this,rs,t),vr(this,Ps,cc(t))}get stableRoutes(){return Ia(this,rs)}get activeRoutes(){return Ia(this,Tl)??Ia(this,rs)}get branches(){return Ia(this,Qs)??Ia(this,Ps)}get hasHMRRoutes(){return Ia(this,Tl)!=null}setRoutes(t){vr(this,rs,t),vr(this,Ps,cc(t))}setHmrRoutes(t){vr(this,Tl,t),vr(this,Qs,cc(t))}commitHmrRoutes(){Ia(this,Tl)&&(vr(this,rs,Ia(this,Tl)),vr(this,Ps,Ia(this,Qs)),vr(this,Tl,void 0),vr(this,Qs,void 0))}};rs=new WeakMap;Ps=new WeakMap;Tl=new WeakMap;Qs=new WeakMap;function MS(t){const a=t.window?t.window:typeof window<"u"?window:void 0,l=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";tt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],u=t.mapRouteProperties||AS,o=u;if(t.instrumentations){let C=t.instrumentations;o=k=>({...u(k),...bS(C.map(q=>q.route).filter(Boolean),k)})}let f={},m=new OS(Su(t.routes,o,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||US,x={...t.future},b=null,w=new Set,S=null,N=null,A=null,j=null,L=t.hydrationData!=null,I=ar(m.activeRoutes,t.history.location,p,!1,m.branches),Y=!1,P=null,K,W;if(I==null&&!t.patchRoutesOnNavigation){let C=Ga(404,{pathname:t.history.location.pathname}),{matches:k,route:q}=Jo(m.activeRoutes);K=!0,W=!K,I=k,P={[q.id]:C}}else if(I&&!t.hydrationData&&Ut(I,m.activeRoutes,t.history.location.pathname).active&&(I=null),I)if(I.some(C=>C.route.lazy))K=!1,W=!K;else if(!I.some(C=>Yh(C.route)))K=!0,W=!K;else{let C=t.hydrationData?t.hydrationData.loaderData:null,k=t.hydrationData?t.hydrationData.errors:null,q=I;if(k){let Z=I.findIndex(ae=>k[ae.route.id]!==void 0);q=q.slice(0,Z+1)}W=!1,K=!0,q.forEach(Z=>{let ae=$x(Z.route,C,k);W=W||ae.renderFallback,K=K&&!ae.shouldLoad})}else{K=!1,W=!K,I=[];let C=Ut(null,m.activeRoutes,t.history.location.pathname);C.active&&C.matches&&(Y=!0,I=C.matches)}let U,T={historyAction:t.history.action,location:t.history.location,matches:I,initialized:K,renderFallback:W,navigation:nh,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||P,fetchers:new Map,blockers:new Map},oe="POP",me=null,ye=!1,Re,ee=!1,be=new Map,Ee=null,z=!1,H=!1,ie=new Set,ce=new Map,pe=0,D=-1,$=new Map,ne=new Set,de=new Map,je=new Map,Ne=new Set,Ue=new Map,it,Ge=null;function nt(){if(b=t.history.listen(({action:C,location:k,delta:q})=>{if(it){it(),it=void 0;return}Sn(Ue.size===0||q!=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=Yt({currentLocation:T.location,nextLocation:k,historyAction:C});if(Z&&q!=null){let ae=new Promise(Te=>{it=Te});t.history.go(q*-1),Pt(Z,{state:"blocked",location:k,proceed(){Pt(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:k}),ae.then(()=>t.history.go(q))},reset(){let Te=new Map(T.blockers);Te.set(Z,au),ut({blockers:Te})}}),me==null||me.resolve(),me=null;return}return Gt(C,k)}),l){nw(a,be);let C=()=>aw(a,be);a.addEventListener("pagehide",C),Ee=()=>a.removeEventListener("pagehide",C)}return T.initialized||Gt("POP",T.location,{initialHydration:!0}),U}function vn(){b&&b(),Ee&&Ee(),w.clear(),Re&&Re.abort(),T.fetchers.forEach((C,k)=>un(T.fetchers,k)),T.blockers.forEach((C,k)=>Be(k))}function Rt(C){if(w.add(C),S){let{newErrors:k}=S;S=null,C(T,{deletedFetchers:[],newErrors:k,viewTransitionOpts:void 0,flushSync:!1})}return()=>w.delete(C)}function ut(C,k={}){C.matches&&(C.matches=C.matches.map(ae=>{let Te=f[ae.route.id],ge=ae.route;return ge.element!==Te.element||ge.errorElement!==Te.errorElement||ge.hydrateFallbackElement!==Te.hydrateFallbackElement?{...ae,route:Te}:ae})),T={...T,...C};let q=[],Z=[];T.fetchers.forEach((ae,Te)=>{ae.state==="idle"&&(Ne.has(Te)?q.push(Te):Z.push(Te))}),Ne.forEach(ae=>{!T.fetchers.has(ae)&&!ce.has(ae)&&q.push(ae)}),w.size===0&&(S={newErrors:C.errors??null}),[...w].forEach(ae=>ae(T,{deletedFetchers:q,newErrors:C.errors??null,viewTransitionOpts:k.viewTransitionOpts,flushSync:k.flushSync===!0})),q.forEach(ae=>un(T.fetchers,ae)),Z.forEach(ae=>T.fetchers.delete(ae))}function le(C,k,{flushSync:q}={}){var _e,Xe;let Z=T.actionData!=null&&T.navigation.formMethod!=null&&ua(T.navigation.formMethod)&&T.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=T.actionData:ae=null;let Te=k.loaderData?wy(T.loaderData,k.loaderData,k.matches||[],k.errors):T.loaderData,ge=T.blockers;ge.size>0&&(ge=new Map(ge),ge.forEach((Ce,Ke)=>ge.set(Ke,au)));let De=z?!1:Qt(C,k.matches||T.matches),we=ye===!0||T.navigation.formMethod!=null&&ua(T.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(T.location.pathname);Ce&&Ce.has(C.pathname)?Oe={currentLocation:T.location,nextLocation:C}:be.has(C.pathname)&&(Oe={currentLocation:C,nextLocation:T.location})}else if(ee){let Ce=be.get(T.location.pathname);Ce?Ce.add(C.pathname):(Ce=new Set([C.pathname]),be.set(T.location.pathname,Ce)),Oe={currentLocation:T.location,nextLocation:C}}ut({...k,actionData:ae,loaderData:Te,historyAction:oe,location:C,initialized:!0,renderFallback:!1,navigation:nh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:we,blockers:ge},{viewTransitionOpts:Oe,flushSync:q===!0}),oe="POP",ye=!1,ee=!1,z=!1,H=!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=jy());let $e=me.promise;return t.history.go(C),$e}let q=jh(T.location,T.matches,p,C,k==null?void 0:k.fromRouteId,k==null?void 0:k.relative),{path:Z,submission:ae,error:Te}=hy(!1,q,k),ge;k!=null&&k.mask&&(ge={pathname:"",search:"",hash:"",...typeof k.mask=="string"?Nr(k.mask):{...T.location.mask,...k.mask}});let De=T.location,we=bu(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===T.location.pathname+T.location.search&&(_e="REPLACE");let Xe=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,Ce=(k&&k.flushSync)===!0,Ke=Yt({currentLocation:De,nextLocation:we,historyAction:_e});if(Ke){Pt(Ke,{state:"blocked",location:we,proceed(){Pt(Ke,{state:"proceeding",proceed:void 0,reset:void 0,location:we}),Ye(C,k)},reset(){let $e=new Map(T.blockers);$e.set(Ke,au),ut({blockers:$e})}});return}await Gt(_e,we,{submission:ae,pendingError:Te,preventScrollReset:Xe,replace:k&&k.replace,enableViewTransition:k&&k.viewTransition,flushSync:Ce,callSiteDefaultShouldRevalidate:k&&k.defaultShouldRevalidate})}function Ie(){Ge||(Ge=jy()),Ze(),ut({revalidation:"loading"});let C=Ge.promise;return T.navigation.state==="submitting"?C:T.navigation.state==="idle"?(Gt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),C):(Gt(oe||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ee===!0}),C)}async function Gt(C,k,q){Re&&Re.abort(),Re=null,oe=C,z=(q&&q.startUninterruptedRevalidation)===!0,en(T.location,T.matches),ye=(q&&q.preventScrollReset)===!0,ee=(q&&q.enableViewTransition)===!0;let Z=m.activeRoutes,ae=q!=null&&q.initialHydration&&T.matches&&T.matches.length>0&&!Y?T.matches:ar(Z,k,p,!1,m.branches),Te=(q&&q.flushSync)===!0;if(ae&&T.initialized&&!H&&GS(T.location,k)&&!(q&&q.submission&&ua(q.submission.formMethod))){le(k,{matches:ae},{flushSync:Te});return}let ge=Ut(ae,Z,k.pathname);if(ge.active&&ge.matches&&(ae=ge.matches),!ae){let{error:We,notFoundMatches:ot,route:lt}=yt(k.pathname);le(k,{matches:ot,loaderData:{},errors:{[lt.id]:We}},{flushSync:Te});return}let De=q&&q.overrideNavigation?{...q.overrideNavigation,matches:ae,historyAction:C}:void 0;Re=new AbortController;let we=Ks(t.history,k,Re.signal,q&&q.submission),Oe=t.getContext?await t.getContext():new iy,_e;if(q&&q.pendingError)_e=[Al(ae).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&ua(q.submission.formMethod)){let We=await An(we,k,q.submission,ae,C,Oe,ge.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:Te});if(We.shortCircuited)return;if(We.pendingActionResult){let[ot,lt]=We.pendingActionResult;if(Oa(lt)&&ti(lt.error)&<.error.status===404){Re=null,le(k,{matches:We.matches,loaderData:{},errors:{[ot]:lt.error}});return}}ae=We.matches||ae,_e=We.pendingActionResult,De=ah(k,ae,C,q.submission),Te=!1,ge.active=!1,we=Ks(t.history,we.url,we.signal)}let{shortCircuited:Xe,matches:Ce,loaderData:Ke,errors:$e,workingFetchers:Ht}=await fn(we,k,ae,C,Oe,ge.active,De,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Te,_e,q&&q.callSiteDefaultShouldRevalidate);Xe||(Re=null,le(k,{matches:Ce||ae,...Ey(_e),loaderData:Ke,errors:$e,...Ht?{fetchers:Ht}:{}}))}async function An(C,k,q,Z,ae,Te,ge,De,we={}){Ze();let Oe=ew(k,Z,ae,q);if(ut({navigation:Oe},{flushSync:we.flushSync===!0}),ge){let Ce=await ft(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}=Jo(m.activeRoutes);return{matches:$e,pendingActionResult:[Ht.id,{type:"error",error:Ce.error}]}}let Ke=Al(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}=yt(k.pathname);return{matches:Ke,pendingActionResult:[Ht.id,{type:"error",error:$e}]}}}let _e,Xe=dc(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=Ws(o,f,C,k,Z,Xe,De?[]:i,Te),Ke=await Me(C,k,Ce,Te,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=xy(_e.response.headers.get("Location"),new URL(C.url),p,t.history)===T.location.pathname+T.location.search,await Le(C,_e,!0,{submission:q,replace:Ce}),{shortCircuited:!0}}if(Oa(_e)){let Ce=Al(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 fn(C,k,q,Z,ae,Te,ge,De,we,Oe,_e,Xe,Ce,Ke){let $e=ge||ah(k,q,Z,De),Ht=De||we||Ry($e),We=!z&&!_e;if(Te){if(We){let wt=Lt(Ce);ut({navigation:$e,...wt!==void 0?{actionData:wt}:{}},{flushSync:Xe})}let Pe=await ft(q,k.pathname,C.signal);if(Pe.type==="aborted")return{shortCircuited:!0};if(Pe.type==="error"){if(Pe.partialMatches.length===0){let{matches:Zt,route:ta}=Jo(m.activeRoutes);return{matches:Zt,loaderData:{},errors:{[ta.id]:Pe.error}}}let wt=Al(Pe.partialMatches).route.id;return{matches:Pe.partialMatches,loaderData:{},errors:{[wt]:Pe.error}}}else if(Pe.matches)q=Pe.matches;else{let{error:wt,notFoundMatches:Zt,route:ta}=yt(k.pathname);return{matches:Zt,loaderData:{},errors:{[ta.id]:wt}}}}let ot=m.activeRoutes,{dsMatches:lt,revalidatingFetchers:ct}=my(C,ae,o,f,t.history,T,q,Ht,k,_e?[]:i,_e===!0,H,ie,Ne,de,ne,ot,p,t.patchRoutesOnNavigation!=null,m.branches,Ce,Ke);if(D=++pe,!t.dataStrategy&&!lt.some(Pe=>Pe.shouldLoad)&&!lt.some(Pe=>Pe.route.middleware&&Pe.route.middleware.length>0)&&ct.length===0){let Pe=new Map(T.fetchers),wt=Jn(Pe);return le(k,{matches:q,loaderData:{},errors:Ce&&Oa(Ce[1])?{[Ce[0]]:Ce[1].error}:null,...Ey(Ce),...wt?{fetchers:Pe}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(We){let Pe={};if(!Te){Pe.navigation=$e;let wt=Lt(Ce);wt!==void 0&&(Pe.actionData=wt)}ct.length>0&&(Pe.fetchers=Wt(ct)),ut(Pe,{flushSync:Xe})}ct.forEach(Pe=>{St(Pe.key),Pe.controller&&ce.set(Pe.key,Pe.controller)});let Kt=()=>ct.forEach(Pe=>St(Pe.key));Re&&Re.signal.addEventListener("abort",Kt);let{loaderResults:Fn,fetcherResults:En}=await qe(lt,ct,C,k,ae);if(C.signal.aborted)return{shortCircuited:!0};Re&&Re.signal.removeEventListener("abort",Kt),ct.forEach(Pe=>ce.delete(Pe.key));let Mn=Wo(Fn);if(Mn)return await Le(C,Mn.result,!0,{replace:Oe}),{shortCircuited:!0};if(Mn=Wo(En),Mn)return ne.add(Mn.key),await Le(C,Mn.result,!0,{replace:Oe}),{shortCircuited:!0};let kn=new Map(T.fetchers),{loaderData:In,errors:fa}=Sy(T,q,Fn,Ce,ct,En,kn);_e&&T.errors&&(fa={...T.errors,...fa});let tl=Jn(kn),ea=Wn(D,kn),ur=tl||ea||ct.length>0;return{matches:q,loaderData:In,errors:fa,...ur?{workingFetchers:kn}:{}}}function Lt(C){if(C&&!Oa(C[1]))return{[C[0]]:C[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Wt(C){let k=new Map(T.fetchers);return C.forEach(q=>{let Z=k.get(q.key),ae=ru(void 0,Z?Z.data:void 0);k.set(q.key,ae)}),k}async function Yn(C,k,q,Z){St(C);let ae=(Z&&Z.flushSync)===!0,Te=m.activeRoutes,ge=jh(T.location,T.matches,p,q,k,Z==null?void 0:Z.relative),De=ar(Te,ge,p,!1,m.branches),we=Ut(De,Te,ge);if(we.active&&we.matches&&(De=we.matches),!De){Xt(C,k,Ga(404,{pathname:ge}),{flushSync:ae});return}let{path:Oe,submission:_e,error:Xe}=hy(!0,ge,Z);if(Xe){Xt(C,k,Xe,{flushSync:ae});return}let Ce=t.getContext?await t.getContext():new iy,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}de.set(C,{routeId:k,path:Oe}),await fe(C,k,Oe,De,Ce,we.active,ae,Ke,_e)}async function Vn(C,k,q,Z,ae,Te,ge,De,we,Oe){Ze(),de.delete(C);let _e=T.fetchers.get(C);pt(C,tw(we,_e),{flushSync:ge});let Xe=new AbortController,Ce=Ks(t.history,q,Xe.signal,we);if(Te){let Et=await ft(Z,new URL(Ce.url).pathname,Ce.signal,C);if(Et.type==="aborted")return;if(Et.type==="error"){Xt(C,k,Et.error,{flushSync:ge});return}else if(Et.matches)Z=Et.matches;else{Xt(C,k,Ga(404,{pathname:q}),{flushSync:ge});return}}let Ke=dc(Z,q);if(!Ke.route.action&&!Ke.route.lazy){let Et=Ga(405,{method:we.formMethod,pathname:q,routeId:k});Xt(C,k,Et,{flushSync:ge});return}ce.set(C,Xe);let $e=pe,Ht=Ws(o,f,Ce,q,Z,Ke,i,ae),We=await Me(Ce,q,Ht,ae,C),ot=We[Ke.route.id];if(!ot){for(let Et of Ht)if(We[Et.route.id]){ot=We[Et.route.id];break}}if(Ce.signal.aborted){ce.get(C)===Xe&&ce.delete(C);return}if(Ne.has(C)){if(ls(ot)||Oa(ot)){pt(C,br(void 0));return}}else{if(ls(ot))if(ce.delete(C),D>$e){pt(C,br(void 0));return}else return ne.add(C),pt(C,ru(we)),Le(Ce,ot,!1,{fetcherSubmission:we,preventScrollReset:De});if(Oa(ot)){Xt(C,k,ot.error);return}}let lt=T.navigation.location||T.location,ct=Ks(t.history,lt,Xe.signal),Kt=m.activeRoutes,Fn=T.navigation.state!=="idle"?ar(Kt,T.navigation.location,p,!1,m.branches):T.matches;tt(Fn,"Didn't find any matches after fetcher action");let En=++pe;$.set(C,En);let{dsMatches:Mn,revalidatingFetchers:kn}=my(ct,ae,o,f,t.history,T,Fn,we,lt,i,!1,H,ie,Ne,de,ne,Kt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ke.route.id,ot],Oe),In=ru(we,ot.data),fa=new Map(T.fetchers);fa.set(C,In),kn.filter(Et=>Et.key!==C).forEach(Et=>{let wa=Et.key,Gn=fa.get(wa),Ul=ru(void 0,Gn?Gn.data:void 0);fa.set(wa,Ul),St(wa),Et.controller&&ce.set(wa,Et.controller)}),ut({fetchers:fa});let tl=()=>kn.forEach(Et=>St(Et.key));Xe.signal.addEventListener("abort",tl);let{loaderResults:ea,fetcherResults:ur}=await qe(Mn,kn,ct,lt,ae);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",tl),$.delete(C),ce.delete(C),kn.forEach(Et=>ce.delete(Et.key));let Pe=T.fetchers.has(C),wt=Et=>{if(!Pe)return Et;let wa=new Map(Et.fetchers);return wa.set(C,br(ot.data)),{...Et,fetchers:wa}},Zt=Wo(ea);if(Zt)return T=wt(T),Le(ct,Zt.result,!1,{preventScrollReset:De});if(Zt=Wo(ur),Zt)return ne.add(Zt.key),T=wt(T),Le(ct,Zt.result,!1,{preventScrollReset:De});let ta=new Map(T.fetchers);Pe&&ta.set(C,br(ot.data));let{loaderData:_n,errors:Tr}=Sy(T,Fn,ea,void 0,kn,ur,ta);Wn(En,ta),T.navigation.state==="loading"&&En>D?(tt(oe,"Expected pending action"),Re&&Re.abort(),le(T.navigation.location,{matches:Fn,loaderData:_n,errors:Tr,fetchers:ta})):(ut({errors:Tr,loaderData:wy(T.loaderData,_n,Fn,Tr),fetchers:ta}),H=!1)}async function fe(C,k,q,Z,ae,Te,ge,De,we){let Oe=T.fetchers.get(C);pt(C,ru(we,Oe?Oe.data:void 0),{flushSync:ge});let _e=new AbortController,Xe=Ks(t.history,q,_e.signal);if(Te){let ot=await ft(Z,new URL(Xe.url).pathname,Xe.signal,C);if(ot.type==="aborted")return;if(ot.type==="error"){Xt(C,k,ot.error,{flushSync:ge});return}else if(ot.matches)Z=ot.matches;else{Xt(C,k,Ga(404,{pathname:q}),{flushSync:ge});return}}let Ce=dc(Z,q);ce.set(C,_e);let Ke=pe,$e=Ws(o,f,Xe,q,Z,Ce,i,ae),Ht=await Me(Xe,q,$e,ae,C),We=Ht[Ce.route.id];if(!We){for(let ot of Z)if(Ht[ot.route.id]){We=Ht[ot.route.id];break}}if(ce.get(C)===_e&&ce.delete(C),!Xe.signal.aborted){if(Ne.has(C)){pt(C,br(void 0));return}if(ls(We))if(D>Ke){pt(C,br(void 0));return}else{ne.add(C),await Le(Xe,We,!1,{preventScrollReset:De});return}if(Oa(We)){Xt(C,k,We.error);return}pt(C,br(We.data))}}async function Le(C,k,q,{submission:Z,fetcherSubmission:ae,preventScrollReset:Te,replace:ge}={}){q||(me==null||me.resolve(),me=null),k.response.headers.has("X-Remix-Revalidate")&&(H=!0);let De=k.response.headers.get("Location");tt(De,"Expected a Location header on the redirect Response"),De=xy(De,new URL(C.url),p,t.history);let we=bu(T.location,De,{_isRedirect:!0});if(l){let $e=!1;if(k.response.headers.has("X-Remix-Reload-Document"))$e=!0;else if(Bh(De)){const Ht=Rx(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}=T.navigation;!Z&&!ae&&_e&&Xe&&Ce&&(Z=Ry(T.navigation));let Ke=Z||ae;if(CS.has(k.response.status)&&Ke&&ua(Ke.formMethod))await Gt(Oe,we,{submission:{...Ke,formAction:De},preventScrollReset:Te||ye,enableViewTransition:q?ee:void 0});else{let $e=ah(we,[],Oe,Z);await Gt(Oe,we,{overrideNavigation:$e,fetcherSubmission:ae,preventScrollReset:Te||ye,enableViewTransition:q?ee:void 0})}}async function Me(C,k,q,Z,ae){var De;let Te,ge={};try{Te=await BS(g,C,k,q,ae,Z,!1)}catch(we){return q.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 q){if(((De=Te[we.route.id])==null?void 0:De.type)==="error")break;!Te.hasOwnProperty(we.route.id)&&!T.loaderData.hasOwnProperty(we.route.id)&&(!T.errors||!T.errors.hasOwnProperty(we.route.id))&&we.shouldCallHandler()&&(Te[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(Te))if(KS(Oe)){let _e=Oe.result;ge[we]={type:"redirect",response:VS(_e,C,we,q,p)}}else ge[we]=await YS(Oe);return ge}async function qe(C,k,q,Z,ae){let Te=Me(q,Z,C,ae,null),ge=Promise.all(k.map(async Oe=>{if(Oe.matches&&Oe.match&&Oe.request&&Oe.controller){let Xe=(await Me(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 Te,we=(await ge).reduce((Oe,_e)=>Object.assign(Oe,_e),{});return{loaderResults:De,fetcherResults:we}}function Ze(){H=!0,de.forEach((C,k)=>{ce.has(k)&&ie.add(k),St(k)})}function pt(C,k,q={}){let Z=new Map(T.fetchers);Z.set(C,k),ut({fetchers:Z},{flushSync:(q&&q.flushSync)===!0})}function Xt(C,k,q,Z={}){let ae=Al(T.matches,k),Te=new Map(T.fetchers);un(Te,C),ut({errors:{[ae.route.id]:q},fetchers:Te},{flushSync:(Z&&Z.flushSync)===!0})}function rn(C){return je.set(C,(je.get(C)||0)+1),Ne.has(C)&&Ne.delete(C),T.fetchers.get(C)||Ux}function Bn(C,k){St(C,k==null?void 0:k.reason),pt(C,br(null))}function un(C,k){let q=T.fetchers.get(k);ce.has(k)&&!(q&&q.state==="loading"&&$.has(k))&&St(k),de.delete(k),$.delete(k),ne.delete(k),Ne.delete(k),ie.delete(k),C.delete(k)}function se(C){let k=(je.get(C)||0)-1;k<=0?(je.delete(C),Ne.add(C)):je.set(C,k),ut({fetchers:new Map(T.fetchers)})}function St(C,k){let q=ce.get(C);q&&(q.abort(k),ce.delete(C))}function Mt(C,k){for(let q of C){let Z=k.get(q);tt(Z,`Expected fetcher: ${q}`);let ae=br(Z.data);k.set(q,ae)}}function Jn(C){let k=[],q=!1;for(let Z of ne){let ae=C.get(Z);tt(ae,`Expected fetcher: ${Z}`),ae.state==="loading"&&(ne.delete(Z),k.push(Z),q=!0)}return Mt(k,C),q}function Wn(C,k){let q=[];for(let[Z,ae]of $)if(ae<C){let Te=k.get(Z);tt(Te,`Expected fetcher: ${Z}`),Te.state==="loading"&&(St(Z),$.delete(Z),q.push(Z))}return Mt(q,k),q.length>0}function jr(C,k){let q=T.blockers.get(C)||au;return Ue.get(C)!==k&&Ue.set(C,k),q}function Be(C){T.blockers.delete(C),Ue.delete(C)}function Pt(C,k){let q=T.blockers.get(C)||au;tt(q.state==="unblocked"&&k.state==="blocked"||q.state==="blocked"&&k.state==="blocked"||q.state==="blocked"&&k.state==="proceeding"||q.state==="blocked"&&k.state==="unblocked"||q.state==="proceeding"&&k.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${k.state}`);let Z=new Map(T.blockers);Z.set(C,k),ut({blockers:Z})}function Yt({currentLocation:C,nextLocation:k,historyAction:q}){if(Ue.size===0)return;Ue.size>1&&Sn(!1,"A router only supports one blocker at a time");let Z=Array.from(Ue.entries()),[ae,Te]=Z[Z.length-1],ge=T.blockers.get(ae);if(!(ge&&ge.state==="proceeding")&&Te({currentLocation:C,nextLocation:k,historyAction:q}))return ae}function yt(C){let k=Ga(404,{pathname:C}),q=m.activeRoutes,{matches:Z,route:ae}=Jo(q);return{notFoundMatches:Z,route:ae,error:k}}function zt(C,k,q){if(N=C,j=k,A=q||null,!L&&T.navigation===nh){L=!0;let Z=Qt(T.location,T.matches);Z!=null&&ut({restoreScrollPosition:Z})}return()=>{N=null,j=null,A=null}}function jt(C,k){return A&&A(C,k.map(Z=>nS(Z,T.loaderData)))||C.key}function en(C,k){if(N&&j){let q=jt(C,k);N[q]=j()}}function Qt(C,k){if(N){let q=jt(C,k),Z=N[q];if(typeof Z=="number")return Z}return null}function Ut(C,k,q){if(t.patchRoutesOnNavigation){let Z=m.branches;if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:ar(k,q,p,!0,Z)}}else return{active:!0,matches:ar(k,q,p,!0,Z)||[]}}return{active:!1,matches:null}}async function ft(C,k,q,Z){if(!t.patchRoutesOnNavigation)return{type:"success",matches:C};let ae=C;for(;;){let Te=f;try{await t.patchRoutesOnNavigation({signal:q,path:k,matches:ae,fetcherKey:Z,patch:(Oe,_e)=>{q.aborted||py(Oe,_e,m,Te,o,!1)}})}catch(Oe){return{type:"error",error:Oe,partialMatches:ae}}if(q.aborted)return{type:"aborted"};let ge=m.branches,De=ar(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=ar(m.activeRoutes,k,p,!0,ge),!(we&&ae.length<we.length&&Je(ae,we.slice(0,ae.length))))return{type:"success",matches:De}}if(we||(we=ar(m.activeRoutes,k,p,!0,ge)),!we||Je(ae,we))return{type:"success",matches:null};ae=we}}function Je(C,k){return C.length===k.length&&C.every((q,Z)=>q.route.id===k[Z].route.id)}function wn(C){f={},m.setHmrRoutes(Su(C,o,void 0,f))}function On(C,k,q=!1){py(C,k,m,f,o,q),m.hasHMRRoutes||ut({})}return U={get basename(){return p},get future(){return x},get state(){return T},get routes(){return m.stableRoutes},get branches(){return m.branches},get manifest(){return f},get window(){return a},initialize:nt,subscribe:Rt,enableScrollRestoration:zt,navigate:Ye,fetch:Yn,revalidate:Ie,createHref:C=>t.history.createHref(C),encodeLocation:C=>t.history.encodeLocation(C),getFetcher:rn,resetFetcher:Bn,deleteFetcher:se,dispose:vn,getBlocker:jr,deleteBlocker:Be,patchRoutes:On,_internalFetchControllers:ce,_internalSetRoutes:wn,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){ut(C)}},t.instrumentations&&(U=SS(U,t.instrumentations.map(C=>C.router).filter(Boolean))),U}function kS(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function jh(t,a,l,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=Ac(i||".",$h(f),Ka(t.pathname,l)||t.pathname,o==="path");if(i==null&&(p.search=t.search,p.hash=t.hash),(i==null||i===""||i===".")&&m){let g=Fh(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 w=x.toString();p.search=w?`?${w}`:""}}return l!=="/"&&(p.pathname=mS({basename:l,pathname:p.pathname})),Er(p)}function hy(t,a,l){if(!l||!kS(l))return{path:a};if(l.formMethod&&!WS(l.formMethod))return{path:a,error:Ga(405,{method:l.formMethod})};let i=()=>({path:a,error:Ga(400,{type:"invalid-body"})}),o=(l.formMethod||"get").toUpperCase(),f=Xx(a);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!ua(o))return i();let b=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((w,[S,N])=>`${w}${S}=${N}
|
|
59
|
-
`,""):String(l.body);return{path:a,submission:{formMethod:o,formAction:f,formEncType:l.formEncType,formData:void 0,json:void 0,text:b}}}else if(l.formEncType==="application/json"){if(!ua(o))return i();try{let b=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:a,submission:{formMethod:o,formAction:f,formEncType:l.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}tt(typeof FormData=="function","FormData is not available in this environment");let m,p;if(l.formData)m=Ch(l.formData),p=l.formData;else if(l.body instanceof FormData)m=Ch(l.body),p=l.body;else if(l.body instanceof URLSearchParams)m=l.body,p=by(m);else if(l.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(l.body),p=by(m)}catch{return i()}let g={formMethod:o,formAction:f,formEncType:l&&l.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=Nr(a);return t&&x.search&&Fh(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Er(x),submission:g}}function my(t,a,l,i,u,o,f,m,p,g,x,b,w,S,N,A,j,L,I,Y,P,K){var z;let W=P?Oa(P[1])?P[1].error:P[1].data:void 0,U=u.createURL(o.location),T=u.createURL(p),oe;if(x&&o.errors){let H=Object.keys(o.errors)[0];oe=f.findIndex(ie=>ie.route.id===H)}else if(P&&Oa(P[1])){let H=P[0];oe=f.findIndex(ie=>ie.route.id===H)-1}let me=P?P[1].statusCode:void 0,ye=me&&me>=400,Re={currentUrl:U,currentParams:((z=o.matches[0])==null?void 0:z.params)||{},nextUrl:T,nextParams:f[0].params,...m,actionResult:W,actionStatus:me},ee=Tu(f),be=f.map((H,ie)=>{let{route:ce}=H,pe=null;if(oe!=null&&ie>oe)pe=!1;else if(ce.lazy)pe=!0;else if(!Yh(ce))pe=!1;else if(x){let{shouldLoad:de}=$x(ce,o.loaderData,o.errors);pe=de}else _S(o.loaderData,o.matches[ie],H)&&(pe=!0);if(pe!==null)return Th(l,i,t,p,ee,H,g,a,pe);let D=!1;typeof K=="boolean"?D=K:ye?D=!1:(b||U.pathname+U.search===T.pathname+T.search||U.search!==T.search||LS(o.matches[ie],H))&&(D=!0);let $={...Re,defaultShouldRevalidate:D},ne=mu(H,$);return Th(l,i,t,p,ee,H,g,a,ne,$,K)}),Ee=[];return N.forEach((H,ie)=>{if(x||!f.some(Ne=>Ne.route.id===H.routeId)||S.has(ie))return;let ce=o.fetchers.get(ie),pe=ce&&ce.state!=="idle"&&ce.data===void 0,D=ar(j,H.path,L??"/",!1,Y);if(!D){if(I&&pe)return;Ee.push({key:ie,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(A.has(ie))return;let $=dc(D,H.path),ne=new AbortController,de=Ks(u,H.path,ne.signal),je=null;if(w.has(ie))w.delete(ie),je=Ws(l,i,de,H.path,D,$,g,a);else if(pe)b&&(je=Ws(l,i,de,H.path,D,$,g,a));else{let Ne;typeof K=="boolean"?Ne=K:ye?Ne=!1:Ne=b;let Ue={...Re,defaultShouldRevalidate:Ne};mu($,Ue)&&(je=Ws(l,i,de,H.path,D,$,g,a,Ue))}je&&Ee.push({key:ie,routeId:H.routeId,path:H.path,matches:je,match:$,request:de,controller:ne})}),{dsMatches:be,revalidatingFetchers:Ee}}function Yh(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function $x(t,a,l){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Yh(t))return{shouldLoad:!1,renderFallback:!1};let i=a!=null&&t.id in a,u=l!=null&&l[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 _S(t,a,l){let i=!a||l.route.id!==a.route.id,u=!t.hasOwnProperty(l.route.id);return i||u}function LS(t,a){let l=t.route.path;return t.pathname!==a.pathname||l!=null&&l.endsWith("*")&&t.params["*"]!==a.params["*"]}function mu(t,a){if(t.route.shouldRevalidate){let l=t.route.shouldRevalidate(a);if(typeof l=="boolean")return l}return a.defaultShouldRevalidate}function py(t,a,l,i,u,o){let f;if(t){let g=i[t];tt(g,`No route found to patch children into: routeId = ${t}`),g.children||(g.children=[]),f=g.children}else f=l.activeRoutes;let m=[],p=[];if(a.forEach(g=>{let x=f.find(b=>qx(g,b));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=Su(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],w=x,[S]=Su([b],u,[],{},!0);Object.assign(w,{element:S.element?S.element:w.element,errorElement:S.errorElement?S.errorElement:w.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:w.hydrateFallbackElement})}l.hasHMRRoutes||l.setRoutes([...l.activeRoutes])}function qx(t,a){var l;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:((l=t.children)==null?void 0:l.every((i,u)=>{var o;return(o=a.children)==null?void 0:o.some(f=>qx(i,f))}))??!1:!1}var gy=new WeakMap,Yx=({key:t,route:a,manifest:l,mapRouteProperties:i})=>{let u=l[a.id];if(tt(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let o=u.lazy[t];if(!o)return;let f=gy.get(u);f||(f={},gy.set(u,f));let m=f[t];if(m)return m;let p=(async()=>{let g=J1(t),b=u[t]!==void 0&&t!=="hasErrorBoundary";if(g)Sn(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),f[t]=Promise.resolve();else if(b)Sn(!1,`Route "${u.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let w=await o();w!=null&&(Object.assign(u,{[t]:w}),Object.assign(u,i(u)))}typeof u.lazy=="object"&&(u.lazy[t]=void 0,Object.values(u.lazy).every(w=>w===void 0)&&(u.lazy=void 0))})();return f[t]=p,p},vy=new WeakMap;function zS(t,a,l,i,u){let o=l[t.id];if(tt(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=vy.get(o);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let b=(async()=>{tt(typeof t.lazy=="function","No lazy route function found");let w=await t.lazy(),S={};for(let N in w){let A=w[N];if(A===void 0)continue;let j=eS(N),I=o[N]!==void 0&&N!=="hasErrorBoundary";j?Sn(!j,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?Sn(!I,`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]=A}Object.assign(o,S),Object.assign(o,{...i(o),lazy:void 0})})();return vy.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=Yx({key:x,route:t,manifest:l,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 yy(t){let a=t.matches.filter(u=>u.shouldLoad),l={};return(await Promise.all(a.map(u=>u.resolve()))).forEach((u,o)=>{l[a[o].route.id]=u}),l}async function US(t){return t.matches.some(a=>a.route.middleware)?Vx(t,()=>yy(t)):yy(t)}function Vx(t,a){return HS(t,a,i=>{if(JS(i))throw i;return i},PS,l);function l(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=Al(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:i}})}}}async function HS(t,a,l,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 Fx(f,m,a,l,i,u)}async function Fx(t,a,l,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 l();let[g,x]=p,b,w=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await Fx(t,a,l,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,w),N=S!=null?i(S):void 0;return u(N)?N:b?N??b.value:(b={value:await w()},b.value)}catch(S){return await o(S,g,b)}}function Ix(t,a,l,i,u){let o=Yx({key:"middleware",route:i.route,manifest:a,mapRouteProperties:t}),f=zS(i.route,ua(l.method)?"action":"loader",a,t,u);return{middleware:o,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Th(t,a,l,i,u,o,f,m,p,g=null,x){let b=!1,w=Ix(t,a,l,o,f);return{...o,_lazyPromises:w,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return b=!0,g?typeof x=="boolean"?mu(o,{...g,defaultShouldRevalidate:x}):typeof S=="boolean"?mu(o,{...g,defaultShouldRevalidate:S}):mu(o,g):p},resolve(S){let{lazy:N,loader:A,middleware:j}=o.route,L=b||p||S&&!ua(l.method)&&(N||A),I=j&&j.length>0&&!A&&!N;return L&&(ua(l.method)||!I)?$S({request:l,path:i,pattern:u,match:o,lazyHandlerPromise:w==null?void 0:w.handler,lazyRoutePromise:w==null?void 0:w.route,handlerOverride:S,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Ws(t,a,l,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:Ix(t,a,l,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Th(t,a,l,i,Tu(u),g,f,m,!0,p))}async function BS(t,a,l,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:Gx(a,l),pattern:Tu(i),params:i[0].params,context:o,matches:i},g=await t({...m,fetcherKey:u,runClientMiddleware:x=>{let b=m;return Vx(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,w;return[(b=x._lazyPromises)==null?void 0:b.handler,(w=x._lazyPromises)==null?void 0:w.route]}))}catch{}return g}async function $S({request:t,path:a,pattern:l,match:i,lazyHandlerPromise:u,lazyRoutePromise:o,handlerOverride:f,scopedContext:m}){let p,g,x=ua(t.method),b=x?"action":"loader",w=S=>{let N,A=new Promise((I,Y)=>N=Y);g=()=>N(),t.signal.addEventListener("abort",g);let j=I=>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:Gx(t,a),pattern:l,params:i.params,context:m},...I!==void 0?[I]:[]),L=(async()=>{try{return{type:"data",result:await(f?f(Y=>j(Y)):j())}}catch(I){return{type:"error",result:I}}})();return Promise.race([L,A])};try{let S=x?i.route.action:i.route.loader;if(u||o)if(S){let N,[A]=await Promise.all([w(S).catch(j=>{N=j}),u,o]);if(N!==void 0)throw N;p=A}else{await u;let N=x?i.route.action:i.route.loader;if(N)[p]=await Promise.all([w(N),o]);else if(b==="action"){let A=new URL(t.url),j=A.pathname+A.search;throw Ga(405,{method:t.method,pathname:j,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(S)p=await w(S);else{let N=new URL(t.url),A=N.pathname+N.search;throw Ga(404,{pathname:A})}}catch(S){return{type:"error",result:S}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function qS(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 YS(t){var i,u,o,f,m;let{result:a,type:l}=t;if(Vh(a)){let p;try{p=await qS(a)}catch(g){return{type:"error",error:g}}return l==="error"?{type:"error",error:new ju(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return l==="error"?Ny(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:XS(a),statusCode:ti(a)?a.status:void 0,headers:(o=a.init)!=null&&o.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:ti(a)?a.status:void 0}:Ny(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 VS(t,a,l,i,u){let o=t.headers.get("Location");if(tt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bh(o)){let f=i.slice(0,i.findIndex(m=>m.route.id===l)+1);o=jh(new URL(a.url),f,u,o),t.headers.set("Location",o)}return t}var FS=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Dh(t){try{return FS.includes(new URL(t).protocol)}catch{return!1}}function xy(t,a,l,i){if(Bh(t)){let u=t,o=Hh.test(u)?new URL(Nx(u,a.protocol)):new URL(u);if(Dh(o.toString()))throw new Error("Invalid redirect location");let f=Ka(o.pathname,l)!=null;if(o.origin===a.origin&&f)return qh(o.pathname)+o.search+o.hash}try{let u=i.createURL(t);if(Dh(u.toString()))throw new Error("Invalid redirect location")}catch{}return t}function Ks(t,a,l,i){let u=t.createURL(Xx(a)).toString(),o={signal:l};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=Ch(i.formData):o.body=i.formData}return new Request(u,o)}function Gx(t,a){let l=new URL(t.url),i=typeof a=="string"?Nr(a):a;if(l.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);l.search=u.size?`?${u.toString()}`:""}else l.search="";return l.hash=i.hash||"",l}function Ch(t){let a=new URLSearchParams;for(let[l,i]of t.entries())a.append(l,typeof i=="string"?i:i.name);return a}function by(t){let a=new FormData;for(let[l,i]of t.entries())a.append(l,i);return a}function IS(t,a,l,i=!1,u=!1){let o={},f=null,m,p=!1,g={},x=l&&Oa(l[1])?l[1].error:void 0;return t.forEach(b=>{if(!(b.route.id in a))return;let w=b.route.id,S=a[w];if(tt(!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[w]=N;else{let A=Al(t,w);f[A.route.id]==null&&(f[A.route.id]=N)}i||(o[w]=Bx),p||(p=!0,m=ti(S.error)?S.error.status:500),S.headers&&(g[w]=S.headers)}else o[w]=S.data,S.statusCode&&S.statusCode!==200&&!p&&(m=S.statusCode),S.headers&&(g[w]=S.headers)}),x!==void 0&&l&&(f={[l[0]]:x},l[2]&&(o[l[2]]=void 0)),{loaderData:o,errors:f,statusCode:m||200,loaderHeaders:g}}function Sy(t,a,l,i,u,o,f){let{loaderData:m,errors:p}=IS(a,l,i);return u.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:b,controller:w}=g;if(w&&w.signal.aborted)return;let S=o[x];if(tt(S,"Did not find corresponding fetcher result"),Oa(S)){let N=Al(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))tt(!1,"Unhandled fetcher revalidation redirect");else{let N=br(S.data);f.set(x,N)}}),{loaderData:m,errors:p}}function wy(t,a,l,i){let u=Object.entries(a).filter(([,o])=>o!==Bx).reduce((o,[f,m])=>(o[f]=m,o),{});for(let o of l){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 Ey(t){return t?Oa(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Al(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 Jo(t){let a=t.length===1?t[0]:t.find(l=>l.index||!l.path||l.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Ga(t,{pathname:a,routeId:l,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&&l?m=`You made a ${i} request to "${a}" but did not provide a \`loader\` for route "${l}", so there is no way to handle the request.`:u==="invalid-body"&&(m="Unable to encode submission body")):t===403?(f="Forbidden",m=`Route "${l}" does not match URL "${a}"`):t===404?(f="Not Found",m=`No route matches URL "${a}"`):t===405&&(f="Method Not Allowed",i&&a&&l?m=`You made a ${i.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${l}", so there is no way to handle the request.`:i&&(m=`Invalid request method "${i.toUpperCase()}"`)),new ju(t||500,f,new Error(m),!0)}function Wo(t){let a=Object.entries(t);for(let l=a.length-1;l>=0;l--){let[i,u]=a[l];if(ls(u))return{key:i,result:u}}}function Xx(t){let a=typeof t=="string"?Nr(t):t;return Er({...a,hash:""})}function GS(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function XS(t){var a,l;return new ju(((a=t.init)==null?void 0:a.status)??500,((l=t.init)==null?void 0:l.statusText)??"Internal Server Error",t.data)}function PS(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,l])=>typeof a=="string"&&QS(l))}function QS(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function KS(t){return Vh(t.result)&&zx.has(t.result.status)}function Oa(t){return t.type==="error"}function ls(t){return(t&&t.type)==="redirect"}function Ny(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Vh(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function ZS(t){return zx.has(t)}function JS(t){return Vh(t)&&ZS(t.status)&&t.headers.has("Location")}function WS(t){return DS.has(t.toUpperCase())}function ua(t){return jS.has(t.toUpperCase())}function Fh(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function dc(t,a){let l=typeof a=="string"?Nr(a).search:a.search;if(t[t.length-1].route.index&&Fh(l||""))return t[t.length-1];let i=Ox(t);return i[i.length-1]}function Ry(t){let{formMethod:a,formAction:l,formEncType:i,text:u,formData:o,json:f}=t;if(!(!a||!l||!i)){if(u!=null)return{formMethod:a,formAction:l,formEncType:i,formData:void 0,json:void 0,text:u};if(o!=null)return{formMethod:a,formAction:l,formEncType:i,formData:o,json:void 0,text:void 0};if(f!==void 0)return{formMethod:a,formAction:l,formEncType:i,formData:void 0,json:f,text:void 0}}}function ah(t,a,l,i){return i?{state:"loading",location:t,matches:a,historyAction:l,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:l,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ew(t,a,l,i){return{state:"submitting",location:t,matches:a,historyAction:l,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function ru(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 tw(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 br(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 nw(t,a){try{let l=t.sessionStorage.getItem(Hx);if(l){let i=JSON.parse(l);for(let[u,o]of Object.entries(i||{}))o&&Array.isArray(o)&&a.set(u,new Set(o||[]))}}catch{}}function aw(t,a){if(a.size>0){let l={};for(let[i,u]of a)l[i]=[...u];try{t.sessionStorage.setItem(Hx,JSON.stringify(l))}catch(i){Sn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function jy(){let t,a,l=new Promise((i,u)=>{t=async o=>{i(o);try{await l}catch{}},a=async o=>{u(o);try{await l}catch{}}});return{promise:l,resolve:t,reject:a}}var os=v.createContext(null);os.displayName="DataRouter";var li=v.createContext(null);li.displayName="DataRouterState";var Px=v.createContext(!1);function Qx(){return v.useContext(Px)}var Ih=v.createContext({isTransitioning:!1});Ih.displayName="ViewTransition";var Gh=v.createContext(new Map);Gh.displayName="Fetchers";var rw=v.createContext(null);rw.displayName="Await";var Za=v.createContext(null);Za.displayName="Navigation";var Oc=v.createContext(null);Oc.displayName="Location";var sr=v.createContext({outlet:null,matches:[],isDataRoute:!1});sr.displayName="Route";var Xh=v.createContext(null);Xh.displayName="RouteError";var Kx="REACT_ROUTER_ERROR",lw="REDIRECT",sw="ROUTE_ERROR_RESPONSE";function iw(t){if(t.startsWith(`${Kx}:${lw}:{`))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 uw(t){if(t.startsWith(`${Kx}:${sw}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new ju(a.status,a.statusText,a.data)}catch{}}function ow(t,{relative:a}={}){tt(Du(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:i}=v.useContext(Za),{hash:u,pathname:o,search:f}=Cu(t,{relative:a}),m=o;return l!=="/"&&(m=o==="/"?l:Qa([l,o])),i.createHref({pathname:m,search:f,hash:u})}function Du(){return v.useContext(Oc)!=null}function ir(){return tt(Du(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Oc).location}var Zx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jx(t){v.useContext(Za).static||v.useLayoutEffect(t)}function el(){let{isDataRoute:t}=v.useContext(sr);return t?ww():cw()}function cw(){tt(Du(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(os),{basename:a,navigator:l}=v.useContext(Za),{matches:i}=v.useContext(sr),{pathname:u}=ir(),o=JSON.stringify($h(i)),f=v.useRef(!1);return Jx(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(Sn(f.current,Zx),!f.current)return;if(typeof p=="number"){l.go(p);return}let x=Ac(p,JSON.parse(o),u,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Qa([a,x.pathname])),(g.replace?l.replace:l.push)(x,g.state,g)},[a,l,o,u,t])}var dw=v.createContext(null);function fw(t){let a=v.useContext(sr).outlet;return v.useMemo(()=>a&&v.createElement(dw.Provider,{value:t},a),[a,t])}function Cu(t,{relative:a}={}){let{matches:l}=v.useContext(sr),{pathname:i}=ir(),u=JSON.stringify($h(l));return v.useMemo(()=>Ac(t,JSON.parse(u),i,a==="path"),[t,u,i,a])}function hw(t,a,l){tt(Du(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(Za),{matches:u}=v.useContext(sr),o=u[u.length-1],f=o?o.params:{},m=o?o.pathname:"/",p=o?o.pathnameBase:"/",g=o&&o.route;{let j=g&&g.path||"";nb(m,!g||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let x=ir(),b;b=x;let w=b.pathname||"/",S=w;if(p!=="/"){let j=p.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(j.length).join("/")}let N=l&&l.state.matches.length?l.state.matches.map(j=>Object.assign(j,{route:l.manifest[j.route.id]||j.route})):jx(t,{pathname:S});return Sn(g||N!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Sn(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.`),yw(N&&N.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:Qa([p,i.encodeLocation?i.encodeLocation(j.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:Qa([p,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),u,l)}function mw(){let t=tb(),a=ti(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),l=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),l?v.createElement("pre",{style:u},l):null,f)}var pw=v.createElement(mw,null),Wx=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 l=uw(t.digest);l&&(t=l)}let a=t!==void 0?v.createElement(sr.Provider,{value:this.props.routeContext},v.createElement(Xh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(gw,{error:t},a):a}};Wx.contextType=Px;var rh=new WeakMap;function gw({children:t,error:a}){let{basename:l}=v.useContext(Za);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let i=iw(a.digest);if(i){let u=rh.get(a);if(u)throw u;let o=kx(i.location,l),f=o.absoluteURL||o.to;if(Dh(f))throw new Error("Invalid redirect location");if(Mx&&!rh.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 rh.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function vw({routeContext:t,match:a,children:l}){let i=v.useContext(os);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(sr.Provider,{value:t},l)}function yw(t,a=[],l){let i=l==null?void 0:l.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);tt(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(l&&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:w,errors:S}=i,N=b.route.loader&&!w.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||N){l.isStatic&&(f=!0),m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}}let p=l==null?void 0:l.onError,g=i&&p?(x,b)=>{var w,S;p(x,{location:i.location,params:((S=(w=i.matches)==null?void 0:w[0])==null?void 0:S.params)??{},pattern:Tu(i.matches),errorInfo:b})}:void 0;return u.reduceRight((x,b,w)=>{let S,N=!1,A=null,j=null;i&&(S=o&&b.route.id?o[b.route.id]:void 0,A=b.route.errorElement||pw,f&&(m<0&&w===0?(nb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,j=null):m===w&&(N=!0,j=b.route.hydrateFallbackElement||null)));let L=a.concat(u.slice(0,w+1)),I=()=>{let Y;return S?Y=A:N?Y=j:b.route.Component?Y=v.createElement(b.route.Component,null):b.route.element?Y=b.route.element:Y=x,v.createElement(vw,{match:b,routeContext:{outlet:x,matches:L,isDataRoute:i!=null},children:Y})};return i&&(b.route.ErrorBoundary||b.route.errorElement||w===0)?v.createElement(Wx,{location:i.location,revalidation:i.revalidation,component:A,error:S,children:I(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:g}):I()},null)}function Ph(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eb(t){let a=v.useContext(os);return tt(a,Ph(t)),a}function Au(t){let a=v.useContext(li);return tt(a,Ph(t)),a}function xw(t){let a=v.useContext(sr);return tt(a,Ph(t)),a}function Mc(t){let a=xw(t),l=a.matches[a.matches.length-1];return tt(l.route.id,`${t} can only be used on routes that contain a unique "id"`),l.route.id}function bw(){return Mc("useRouteId")}function kl(){let t=Au("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:l,...i}=t.navigation;return i},[t.navigation])}function Sw(){let t=eb("useRevalidator"),a=Au("useRevalidator"),l=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:l,state:a.revalidation}),[l,a.revalidation])}function cs(){let t=Au("useLoaderData"),a=Mc("useLoaderData");return t.loaderData[a]}function Ou(t){return Au("useRouteLoaderData").loaderData[t]}function tb(){var i;let t=v.useContext(Xh),a=Au("useRouteError"),l=Mc("useRouteError");return t!==void 0?t:(i=a.errors)==null?void 0:i[l]}function ww(){let{router:t}=eb("useNavigate"),a=Mc("useNavigate"),l=v.useRef(!1);return Jx(()=>{l.current=!0}),v.useCallback(async(u,o={})=>{Sn(l.current,Zx),l.current&&(typeof u=="number"?await t.navigate(u):await t.navigate(u,{fromRouteId:a,...o}))},[t,a])}var Ty={};function nb(t,a,l){!a&&!Ty[t]&&(Ty[t]=!0,Sn(!1,l))}var Dy={};function Cy(t,a){!t&&!Dy[a]&&(Dy[a]=!0,console.warn(a))}var Ew="useOptimistic",Ay=q1[Ew],Nw=()=>{};function Rw(t){return Ay?Ay(t):[t,Nw]}function jw(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Sn(!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&&Sn(!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&&Sn(!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 Tw=["HydrateFallback","hydrateFallbackElement"],Dw=class{constructor(){this.status="pending",this.promise=new Promise((t,a)=>{this.resolve=l=>{this.status==="pending"&&(this.status="resolved",t(l))},this.reject=l=>{this.status==="pending"&&(this.status="rejected",a(l))}})}};function Cw({router:t,flushSync:a,onError:l,useTransitions:i}){i=Qx()||i;let[o,f]=v.useState(t.state),[m,p]=Rw(o),[g,x]=v.useState(),[b,w]=v.useState({isTransitioning:!1}),[S,N]=v.useState(),[A,j]=v.useState(),[L,I]=v.useState(),Y=v.useRef(new Map),P=v.useCallback((T,{deletedFetchers:oe,newErrors:me,flushSync:ye,viewTransitionOpts:Re})=>{me&&l&&Object.values(me).forEach(be=>{var Ee;return l(be,{location:T.location,params:((Ee=T.matches[0])==null?void 0:Ee.params)??{},pattern:Tu(T.matches)})}),T.fetchers.forEach((be,Ee)=>{be.data!==void 0&&Y.current.set(Ee,be.data)}),oe.forEach(be=>Y.current.delete(be)),Cy(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(Cy(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(T)):i===!1?f(T):v.startTransition(()=>{i===!0&&p(be=>Oy(be,T)),f(T)});return}if(a&&ye){a(()=>{A&&(S==null||S.resolve(),A.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation})});let be=t.window.document.startViewTransition(()=>{a(()=>f(T))});be.finished.finally(()=>{a(()=>{N(void 0),j(void 0),x(void 0),w({isTransitioning:!1})})}),a(()=>j(be));return}A?(S==null||S.resolve(),A.skipTransition(),I({state:T,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation})):(x(T),w({isTransitioning:!0,flushSync:!1,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation}))},[t.window,a,A,S,i,p,l]);v.useLayoutEffect(()=>t.subscribe(P),[t,P]),v.useEffect(()=>{b.isTransitioning&&!b.flushSync&&N(new Dw)},[b]),v.useEffect(()=>{if(S&&g&&t.window){let T=g,oe=S.promise,me=t.window.document.startViewTransition(async()=>{i===!1?f(T):v.startTransition(()=>{i===!0&&p(ye=>Oy(ye,T)),f(T)}),await oe});me.finished.finally(()=>{N(void 0),j(void 0),x(void 0),w({isTransitioning:!1})}),j(me)}},[g,S,t.window,i,p]),v.useEffect(()=>{S&&g&&m.location.key===g.location.key&&S.resolve()},[S,A,m.location,g]),v.useEffect(()=>{!b.isTransitioning&&L&&(x(L.state),w({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),I(void 0))},[b.isTransitioning,L]);let K=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:T=>t.navigate(T),push:(T,oe,me)=>t.navigate(T,{state:oe,preventScrollReset:me==null?void 0:me.preventScrollReset}),replace:(T,oe,me)=>t.navigate(T,{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:l}),[t,K,W,l]);return v.createElement(v.Fragment,null,v.createElement(os.Provider,{value:U},v.createElement(li.Provider,{value:m},v.createElement(Gh.Provider,{value:Y.current},v.createElement(Ih.Provider,{value:b},v.createElement(Mw,{basename:W,location:m.location,navigationType:m.historyAction,navigator:K,useTransitions:i},v.createElement(Aw,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:l})))))),null)}function Oy(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 Aw=v.memo(Ow);function Ow({routes:t,manifest:a,future:l,state:i,isStatic:u,onError:o}){return hw(t,void 0,{manifest:a,state:i,isStatic:u,onError:o})}function Mu(t){return fw(t.context)}function Mw({basename:t="/",children:a=null,location:l,navigationType:i="POP",navigator:u,static:o=!1,useTransitions:f}){tt(!Du(),"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 l=="string"&&(l=Nr(l));let{pathname:g="/",search:x="",hash:b="",state:w=null,key:S="default",mask:N}=l,A=v.useMemo(()=>{let j=Ka(g,m);return j==null?null:{location:{pathname:j,search:x,hash:b,state:w,key:S,mask:N},navigationType:i}},[m,g,x,b,w,S,i,N]);return Sn(A!=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.`),A==null?null:v.createElement(Za.Provider,{value:p},v.createElement(Oc.Provider,{children:a,value:A}))}var fc="get",hc="application/x-www-form-urlencoded";function kc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function kw(t){return kc(t)&&t.tagName.toLowerCase()==="button"}function _w(t){return kc(t)&&t.tagName.toLowerCase()==="form"}function Lw(t){return kc(t)&&t.tagName.toLowerCase()==="input"}function zw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Uw(t,a){return t.button===0&&(!a||a==="_self")&&!zw(t)}function Ah(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,l)=>{let i=t[l];return a.concat(Array.isArray(i)?i.map(u=>[l,u]):[[l,i]])},[]))}function Hw(t,a){let l=Ah(t);return a&&a.forEach((i,u)=>{l.has(u)||a.getAll(u).forEach(o=>{l.append(u,o)})}),l}var ec=null;function Bw(){if(ec===null)try{new FormData(document.createElement("form"),0),ec=!1}catch{ec=!0}return ec}var $w=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lh(t){return t!=null&&!$w.has(t)?(Sn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hc}"`),null):t}function qw(t,a){let l,i,u,o,f;if(_w(t)){let m=t.getAttribute("action");i=m?Ka(m,a):null,l=t.getAttribute("method")||fc,u=lh(t.getAttribute("enctype"))||hc,o=new FormData(t)}else if(kw(t)||Lw(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,l=t.getAttribute("formmethod")||m.getAttribute("method")||fc,u=lh(t.getAttribute("formenctype"))||lh(m.getAttribute("enctype"))||hc,o=new FormData(m,t),!Bw()){let{name:g,type:x,value:b}=t;if(x==="image"){let w=g?`${g}.`:"";o.append(`${w}x`,"0"),o.append(`${w}y`,"0")}else g&&o.append(g,b)}}else{if(kc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=fc,i=null,u=hc,f=t}return o&&u==="text/plain"&&(f=o,o=void 0),{action:i,method:l.toLowerCase(),encType:u,formData:o,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Qh(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function ab(t,a,l,i){let u=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return l?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=`${xc(a)}/_root.${i}`:u.pathname=`${xc(u.pathname)}.${i}`,u}async function Yw(t,a){if(t.id in a)return a[t.id];try{let l=await import(t.module);return a[t.id]=l,l}catch(l){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vw(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 Fw(t,a,l){let i=await Promise.all(t.map(async u=>{let o=a.routes[u.route.id];if(o){let f=await Yw(o,l);return f.links?f.links():[]}return[]}));return Pw(i.flat(1).filter(Vw).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function My(t,a,l,i,u,o){let f=(p,g)=>l[g]?p.route.id!==l[g].route.id:!0,m=(p,g)=>{var x;return l[g].pathname!==p.pathname||((x=l[g].route.path)==null?void 0:x.endsWith("*"))&&l[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 w=p.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((b=l[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function Iw(t,a,{includeHydrateFallback:l}={}){return Gw(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)),l&&u.hydrateFallbackModule&&(o=o.concat(u.hydrateFallbackModule)),u.imports&&(o=o.concat(u.imports)),o}).flat(1))}function Gw(t){return[...new Set(t)]}function Xw(t){let a={},l=Object.keys(t).sort();for(let i of l)a[i]=t[i];return a}function Pw(t,a){let l=new Set;return new Set(a),t.reduce((i,u)=>{let o=JSON.stringify(Xw(u));return l.has(o)||(l.add(o),i.push({key:o,link:u})),i},[])}function Kh(){let t=v.useContext(os);return Qh(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Qw(){let t=v.useContext(li);return Qh(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Zh=v.createContext(void 0);Zh.displayName="FrameworkContext";function _c(){let t=v.useContext(Zh);return Qh(t,"You must render this element inside a <HydratedRouter> element"),t}function Kw(t,a){let l=v.useContext(Zh),[i,u]=v.useState(!1),[o,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:b}=a,w=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let A=L=>{L.forEach(I=>{f(I.isIntersecting)})},j=new IntersectionObserver(A,{threshold:.5});return w.current&&j.observe(w.current),()=>{j.disconnect()}}},[t]),v.useEffect(()=>{if(i){let A=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(A)}}},[i]);let S=()=>{u(!0)},N=()=>{u(!1),f(!1)};return l?t!=="intent"?[o,w,{}]:[o,w,{onFocus:lu(m,S),onBlur:lu(p,N),onMouseEnter:lu(g,S),onMouseLeave:lu(x,N),onTouchStart:lu(b,S)}]:[!1,w,{}]}function lu(t,a){return l=>{t&&t(l),l.defaultPrevented||a(l)}}function Zw({page:t,...a}){let l=Qx(),{nonce:i}=_c(),{router:u}=Kh(),o=v.useMemo(()=>jx(u.routes,t,u.basename),[u.routes,t,u.basename]);return o?(a.nonce==null&&i&&(a={...a,nonce:i}),l?v.createElement(Ww,{page:t,matches:o,...a}):v.createElement(eE,{page:t,matches:o,...a})):null}function Jw(t){let{manifest:a,routeModules:l}=_c(),[i,u]=v.useState([]);return v.useEffect(()=>{let o=!1;return Fw(t,a,l).then(f=>{o||u(f)}),()=>{o=!0}},[t,a,l]),i}function Ww({page:t,matches:a,...l}){let i=ir(),{future:u}=_c(),{basename:o}=Kh(),f=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let m=ab(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,...l})))}function eE({page:t,matches:a,...l}){let i=ir(),{future:u,manifest:o,routeModules:f}=_c(),{basename:m}=Kh(),{loaderData:p,matches:g}=Qw(),x=v.useMemo(()=>My(t,a,g,o,i,"data"),[t,a,g,o,i]),b=v.useMemo(()=>My(t,a,g,o,i,"assets"),[t,a,g,o,i]),w=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let A=new Set,j=!1;if(a.forEach(I=>{var P;let Y=o.routes[I.route.id];!Y||!Y.hasLoader||(!x.some(K=>K.route.id===I.route.id)&&I.route.id in p&&((P=f[I.route.id])!=null&&P.shouldRevalidate)||Y.hasClientLoader?j=!0:A.add(I.route.id))}),A.size===0)return[];let L=ab(t,m,u.v8_trailingSlashAwareDataRequests,"data");return j&&A.size>0&&L.searchParams.set("_routes",a.filter(I=>A.has(I.route.id)).map(I=>I.route.id).join(",")),[L.pathname+L.search]},[m,u.v8_trailingSlashAwareDataRequests,p,i,o,x,a,t,f]),S=v.useMemo(()=>Iw(b,o),[b,o]),N=Jw(b);return v.createElement(v.Fragment,null,w.map(A=>v.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...l})),S.map(A=>v.createElement("link",{key:A,rel:"modulepreload",href:A,...l})),N.map(({key:A,link:j})=>v.createElement("link",{key:A,nonce:l.nonce,...j,crossOrigin:j.crossOrigin??l.crossOrigin})))}function tE(...t){return a=>{t.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var nE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{nE&&(window.__reactRouterVersion="7.18.0")}catch{}function aE(t,a){return MS({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:P1({window:a==null?void 0:a.window}),hydrationData:rE(),routes:t,mapRouteProperties:jw,hydrationRouteProperties:Tw,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 rE(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:lE(t.errors)}),t}function lE(t){if(!t)return null;let a=Object.entries(t),l={};for(let[i,u]of a)if(u&&u.__type==="RouteErrorResponse")l[i]=new ju(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(typeof u.__subType=="string"&&xS.includes(u.__subType)){let o=window[u.__subType];if(typeof o=="function")try{let f=new o(u.message);f.stack="",l[i]=f}catch{}}if(l[i]==null){let o=new Error(u.message);o.stack="",l[i]=o}}else l[i]=u;return l}var dt=v.forwardRef(function({onClick:a,discover:l="render",prefetch:i="none",relative:u,reloadDocument:o,replace:f,mask:m,state:p,target:g,to:x,preventScrollReset:b,viewTransition:w,defaultShouldRevalidate:S,...N},A){let{basename:j,navigator:L,useTransitions:I}=v.useContext(Za),Y=typeof x=="string"&&Cc.test(x),P=kx(x,j);x=P.to;let K=ow(x,{relative:u}),W=ir(),U=null;if(m){let Ee=Ac(m,[],W.mask?W.mask.pathname:"/",!0);j!=="/"&&(Ee.pathname=Ee.pathname==="/"?j:Qa([j,Ee.pathname])),U=L.createHref(Ee)}let[T,oe,me]=Kw(i,N),ye=iE(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:b,relative:u,viewTransition:w,defaultShouldRevalidate:S,useTransitions:I});function Re(Ee){a&&a(Ee),Ee.defaultPrevented||ye(Ee)}let ee=!(P.isExternal||o),be=v.createElement("a",{...N,...me,href:(ee?U:void 0)||P.absoluteURL||K,onClick:ee?Re:a,ref:tE(A,oe),target:g,"data-discover":!Y&&l==="render"?"true":void 0});return T&&!Y?v.createElement(v.Fragment,null,be,v.createElement(Zw,{page:K})):be});dt.displayName="Link";var rb=v.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:i="",end:u=!1,style:o,to:f,viewTransition:m,children:p,...g},x){let b=Cu(f,{relative:g.relative}),w=ir(),S=v.useContext(li),{navigator:N,basename:A}=v.useContext(Za),j=S!=null&&dE(b)&&m===!0,L=N.encodeLocation?N.encodeLocation(b).pathname:b.pathname,I=w.pathname,Y=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;l||(I=I.toLowerCase(),Y=Y?Y.toLowerCase():null,L=L.toLowerCase()),Y&&A&&(Y=Ka(Y,A)||Y);const P=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let K=I===L||!u&&I.startsWith(L)&&I.charAt(P)==="/",W=Y!=null&&(Y===L||!u&&Y.startsWith(L)&&Y.charAt(L.length)==="/"),U={isActive:K,isPending:W,isTransitioning:j},T=K?a:void 0,oe;typeof i=="function"?oe=i(U):oe=[i,K?"active":null,W?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let me=typeof o=="function"?o(U):o;return v.createElement(dt,{...g,"aria-current":T,className:oe,ref:x,style:me,to:f,viewTransition:m},typeof p=="function"?p(U):p)});rb.displayName="NavLink";var _a=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:l,reloadDocument:i,replace:u,state:o,method:f=fc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:w,...S},N)=>{let{useTransitions:A}=v.useContext(Za),j=Wh(),L=cE(m,{relative:g}),I=f.toLowerCase()==="get"?"get":"post",Y=typeof m=="string"&&Cc.test(m),P=K=>{if(p&&p(K),K.defaultPrevented)return;K.preventDefault();let W=K.nativeEvent.submitter,U=(W==null?void 0:W.getAttribute("formmethod"))||f,T=()=>j(W||K.currentTarget,{fetcherKey:a,method:U,navigate:l,replace:u,state:o,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:w});A&&l!==!1?v.startTransition(()=>T()):T()};return v.createElement("form",{ref:N,method:I,action:L,onSubmit:i?p:P,...S,"data-discover":!Y&&t==="render"?"true":void 0})});_a.displayName="Form";function lb(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jh(t){let a=v.useContext(os);return tt(a,lb(t)),a}function sE(t){let a=v.useContext(li);return tt(a,lb(t)),a}function iE(t,{target:a,replace:l,mask:i,state:u,preventScrollReset:o,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=el(),b=ir(),w=Cu(t,{relative:f});return v.useCallback(S=>{if(Uw(S,a)){S.preventDefault();let N=l!==void 0?l:Er(b)===Er(w),A=()=>x(t,{replace:N,mask:i,state:u,preventScrollReset:o,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>A()):A()}},[b,x,w,l,i,u,a,t,o,f,m,p,g])}function Lc(t){Sn(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(Ah(t)),l=v.useRef(!1),i=ir(),u=v.useMemo(()=>Hw(i.search,l.current?null:a.current),[i.search]),o=el(),f=v.useCallback((m,p)=>{const g=Ah(typeof m=="function"?m(new URLSearchParams(u)):m);l.current=!0,o("?"+g,p)},[o,u]);return[u,f]}var uE=0,oE=()=>`__${String(++uE)}__`;function Wh(){let{router:t}=Jh("useSubmit"),{basename:a}=v.useContext(Za),l=bw(),i=t.fetch,u=t.navigate;return v.useCallback(async(o,f={})=>{let{action:m,method:p,encType:g,formData:x,body:b}=qw(o,a);if(f.navigate===!1){let w=f.fetcherKey||oE();await i(w,l,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:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[i,u,a,l])}function cE(t,{relative:a}={}){let{basename:l}=v.useContext(Za),i=v.useContext(sr);tt(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),o={...Cu(t||".",{relative:a})},f=ir();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"),l!=="/"&&(o.pathname=o.pathname==="/"?l:Qa([l,o.pathname])),Er(o)}function is({key:t}={}){var K;let{router:a}=Jh("useFetcher"),l=sE("useFetcher"),i=v.useContext(Gh),u=v.useContext(sr),o=(K=u.matches[u.matches.length-1])==null?void 0:K.route.id;tt(i,"useFetcher must be used inside a FetchersContext"),tt(u,"useFetcher must be used inside a RouteContext"),tt(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:w}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let S=v.useCallback(async(W,U)=>{tt(o,"No routeId available for fetcher.load()"),await w(m,o,W,U)},[m,o,w]),N=Wh(),A=v.useCallback(async(W,U)=>{await N(W,{...U,navigate:!1,fetcherKey:m})},[m,N]),j=v.useCallback(W=>b(m,W),[b,m]),L=v.useMemo(()=>{let W=v.forwardRef((U,T)=>v.createElement(_a,{...U,navigate:!1,fetcherKey:m,ref:T}));return W.displayName="fetcher.Form",W},[m]),I=l.fetchers.get(m)||Ux,Y=i.get(m);return v.useMemo(()=>({Form:L,submit:A,load:S,reset:j,...I,data:Y}),[L,A,S,j,I,Y])}function dE(t,{relative:a}={}){let l=v.useContext(Ih);tt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Jh("useViewTransitionState"),u=Cu(t,{relative:a});if(!l.isTransitioning)return!1;let o=Ka(l.currentLocation.pathname,i)||l.currentLocation.pathname,f=Ka(l.nextLocation.pathname,i)||l.nextLocation.pathname;return yc(u.pathname,f)!=null||yc(u.pathname,o)!=null}var Jr=Sx();function fE(t){return v.createElement(Cw,{flushSync:Jr.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 sb=(...t)=>t.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).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 hE=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 mE=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.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 ky=t=>{const a=mE(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 sh={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 pE=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},gE=v.createContext({}),vE=()=>v.useContext(gE),yE=v.forwardRef(({color:t,size:a,strokeWidth:l,absoluteStrokeWidth:i,className:u="",children:o,iconNode:f,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:b=!1,color:w="currentColor",className:S=""}=vE()??{},N=i??b?Number(l??x)*24/Number(a??g):l??x;return v.createElement("svg",{ref:p,...sh,width:a??g??sh.width,height:a??g??sh.height,stroke:t??w,strokeWidth:N,className:sb("lucide",S,u),...!o&&!pE(m)&&{"aria-hidden":"true"},...m},[...f.map(([A,j])=>v.createElement(A,j)),...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 qt=(t,a)=>{const l=v.forwardRef(({className:i,...u},o)=>v.createElement(yE,{ref:o,iconNode:a,className:sb(`lucide-${hE(ky(t))}`,`lucide-${t}`,i),...u}));return l.displayName=ky(t),l};/**
|
|
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 xE=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zc=qt("arrow-left",xE);/**
|
|
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 bE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],SE=qt("ban",bE);/**
|
|
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 wE=[["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"}]],EE=qt("chart-column",wE);/**
|
|
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 NE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ib=qt("check",NE);/**
|
|
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 RE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_l=qt("chevron-down",RE);/**
|
|
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 jE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ub=qt("chevron-right",jE);/**
|
|
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 TE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ob=qt("circle-check",TE);/**
|
|
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 DE=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],CE=qt("circle-dashed",DE);/**
|
|
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 AE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],OE=qt("circle-minus",AE);/**
|
|
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 ME=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],kE=qt("circle-pause",ME);/**
|
|
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 _E=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],LE=qt("circle-play",_E);/**
|
|
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 zE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],UE=qt("circle",zE);/**
|
|
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 HE=[["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"}]],cb=qt("copy",HE);/**
|
|
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 BE=[["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"}]],$E=qt("download",BE);/**
|
|
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 qE=[["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"}]],YE=qt("git-branch",qE);/**
|
|
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 VE=[["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"}]],FE=qt("grip-vertical",VE);/**
|
|
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 IE=[["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"}]],GE=qt("house",IE);/**
|
|
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 XE=[["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"}]],bc=qt("layers",XE);/**
|
|
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 PE=[["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"}]],em=qt("list-todo",PE);/**
|
|
192
|
-
* @license lucide-react v1.21.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const QE=[["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"}]],KE=qt("locate-fixed",QE);/**
|
|
197
|
-
* @license lucide-react v1.21.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const ZE=[["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"}]],JE=qt("moon",ZE);/**
|
|
202
|
-
* @license lucide-react v1.21.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const WE=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],eN=qt("octagon-alert",WE);/**
|
|
207
|
-
* @license lucide-react v1.21.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const tN=[["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"}]],us=qt("pencil",tN);/**
|
|
212
|
-
* @license lucide-react v1.21.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const nN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],aN=qt("scroll-text",nN);/**
|
|
217
|
-
* @license lucide-react v1.21.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const rN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],lN=qt("search",rN);/**
|
|
222
|
-
* @license lucide-react v1.21.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const sN=[["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"}]],iN=qt("sun",sN);/**
|
|
227
|
-
* @license lucide-react v1.21.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const uN=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],oN=qt("timer-reset",uN);/**
|
|
232
|
-
* @license lucide-react v1.21.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const cN=[["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"}]],ni=qt("trash-2",cN);/**
|
|
237
|
-
* @license lucide-react v1.21.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const dN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fN=qt("x",dN),hN="/api",mN=120,pN=40;function Uc(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 Hc(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(Uc),handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??""}}function Bc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[]}}function db(t){var a,l,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:((l=t.workflowRules)==null?void 0:l.beforeTaskStart)??[],afterPhaseComplete:((i=t.workflowRules)==null?void 0:i.afterPhaseComplete)??[]}}}async function _y(t,a){try{return await fetch(`${hN}${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 dn(t,a){let l=await _y(t,a),i=0;for(;l.status===503&&i<pN;)await new Promise(u=>setTimeout(u,mN)),i+=1,l=await _y(t,a);if(!l.ok){const u=await l.text().catch(()=>l.statusText);throw new Response(u||l.statusText,{status:l.status,statusText:l.statusText})}return l.json()}async function fb(){return db(await dn("/project"))}async function gN(t){return db(await dn("/project",{method:"PUT",body:JSON.stringify(t)}))}async function vN(){return dn("/ui-config")}async function hb(){return(await dn("/features")).map(Bc)}async function ku(t){return Bc(await dn(`/features/${t}`))}async function yN(t){return Bc(await dn("/features",{method:"POST",body:JSON.stringify(t)}))}async function mb(t){return Bc(await dn(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function xN(t){return dn(`/features/${t}`,{method:"DELETE"})}async function tm(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await dn(`/phases${a}`)).map(Hc)}async function $c(t){return Hc(await dn(`/phases/${t}`))}async function bN(t){return Hc(await dn("/phases",{method:"POST",body:JSON.stringify(t)}))}async function pb(t){return Hc(await dn(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function SN(t){return dn(`/phases/${t}`,{method:"DELETE"})}async function wN(t,a){return Uc(await dn(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function qc(t){return Uc(await dn(`/tasks/${t}`))}async function nm(t){return Uc(await dn(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function EN(t){return dn(`/tasks/${t}`,{method:"DELETE"})}async function gb(){return dn("/tasks/active")}async function vb(){return(await dn("/handoffs")).handoffs??[]}async function NN(t){return dn(`/phases/${t}/handoff`,{method:"DELETE"})}async function RN(t=!1){return dn(`/export?full=${t?"true":"false"}`)}async function jN(){return dn("/repair",{method:"POST"})}async function ih(t,a,l,i){return dn("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:a,beforeId:l,afterId:i})})}function TN(){const[t,a]=v.useState(()=>{if(typeof window>"u")return"dark";const l=window.localStorage.getItem("plan-ui-theme");return l||(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(l=>l==="dark"?"light":"dark")}}function DN({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-9 items-center gap-2 rounded-[12px] border px-2.5 py-1.5 text-sm font-semibold sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 ${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 CN({projectName:t,projectRoot:a,planRoot:l,liveStatus:i}){const{theme:u,toggleTheme:o}=TN(),[f,m]=v.useState(!1),[p,g]=v.useState(!1),[x,b]=v.useState(null),w=[{to:"/",label:"Dashboard",icon:GE},{to:"/features",label:"Features",icon:bc},{to:"/handoff",label:"Handoff",icon:aN}];async function S(N){b(N?"full":"summary");try{const j=await RN(N),L=new Blob([j.markdown],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(L),Y=document.createElement("a");Y.href=I,Y.download=N?"EXPORT-full.md":j.filePath||"EXPORT.md",document.body.appendChild(Y),Y.click(),Y.remove(),URL.revokeObjectURL(I),g(!1)}catch(j){window.alert(`Export failed: ${j instanceof Error?j.message:String(j)}`)}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(dt,{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(bc,{className:"h-4 w-4"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("div",{className:"truncate text-sm font-black tracking-tight",children:t??"Agent Plan"})}),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(ib,{className:"h-3.5 w-3.5"}):d.jsx(cb,{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(DN,{liveStatus:i})}),d.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:w.map(N=>d.jsxs(rb,{to:N.to,end:N.to==="/",className:({isActive:A})=>`inline-flex min-h-9 items-center gap-2 rounded-[12px] border px-2.5 py-1.5 text-sm font-semibold transition sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 sm:px-4 ${A?"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-9 items-center gap-2 rounded-[12px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2.5 py-1.5 text-sm font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 sm:px-4",children:[d.jsx($E,{className:"h-4 w-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Export"}),d.jsx(_l,{className:`h-4 w-4 transition-transform ${p?"rotate-180":""}`})]}),p?d.jsxs("div",{role:"menu",onKeyDown:N=>{var I;const A=Array.from(N.currentTarget.querySelectorAll("[role=menuitem]")).filter(Y=>!Y.hasAttribute("disabled"));if(A.length===0)return;const j=A.indexOf(document.activeElement);let L=j;if(N.key==="ArrowDown")L=j===-1?0:(j+1)%A.length;else if(N.key==="ArrowUp")L=j===-1?A.length-1:(j-1+A.length)%A.length;else if(N.key==="Home")L=0;else if(N.key==="End")L=A.length-1;else return;N.preventDefault(),(I=A[L])==null||I.focus()},className:"absolute right-0 z-[100] 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,"aria-label":u==="dark"?"Switch to light theme":"Switch to dark theme",title:u==="dark"?"Switch to light theme":"Switch to dark theme",className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[12px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)] sm:h-11 sm:w-11 sm:rounded-[14px]",children:u==="dark"?d.jsx(iN,{className:"h-4 w-4"}):d.jsx(JE,{className:"h-4 w-4"})})]})]})})}function Ly(t,a,l){t.split(`
|
|
242
|
-
`).forEach((u,o)=>{o>0&&a.push(d.jsx("br",{},`${l}-br-${o}`)),u&&a.push(u)})}function su(t,a){const l=[],i=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let u=0,o=null,f=0;for(;(o=i.exec(t))!==null;)o.index>u&&Ly(t.slice(u,o.index),l,`${a}-${f}`),o[2]&&o[3]?l.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]?l.push(d.jsx("strong",{className:"font-semibold text-[var(--text)]",children:o[4]},`${a}-strong-${f}`)):o[5]?l.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]&&l.push(d.jsx("em",{className:"italic",children:o[6]},`${a}-em-${f}`)),u=i.lastIndex,f+=1;return u<t.length&&Ly(t.slice(u),l,`${a}-tail`),l}function AN(t,a){var u;const l=t.split(`
|
|
243
|
-
`);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:su(f,`h-${a}`)},`h-${a}`)}return l.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:l.map((o,f)=>d.jsx("div",{children:su(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}`):l.every(o=>/^\s*[-*]\s+/.test(o))?d.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map((o,f)=>d.jsx("li",{className:"list-disc",children:su(o.replace(/^\s*[-*]\s+/,""),`ul-${a}-${f}`)},`ul-${a}-${f}`))},`ul-${a}`):l.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:l.map((o,f)=>d.jsx("li",{children:su(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:su(t,`p-${a}`)},`p-${a}`)}function Hn({text:t,className:a=""}){if(!(t!=null&&t.trim()))return null;const l=t.trim().split(/\n\s*\n/).filter(Boolean);return d.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${a}`,children:l.map((i,u)=>AN(i,u))})}const zy={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 wr(t){return String(t&&t>0?t:0).padStart(3,"0")}function si({featureNum:t,phaseNum:a,taskNum:l}){const i=[];return t!==void 0&&i.push(`F${wr(t)}`),a!==void 0&&i.push(`P${wr(a)}`),l!==void 0&&i.push(`T${wr(l)}`),i.join("/")}async function ON(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 l=document.execCommand("copy");return a.remove(),l}catch{return!1}}function Ll({type:t,number:a}){const l=zy[t]||zy.task,i=(l==null?void 0:l.soft)||"transparent",u=(l==null?void 0:l.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():"?",wr(a)]})}function ai({type:t,phaseNum:a,featureNum:l}){return t==="feature"?null:t==="phase"?l===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",wr(l)]})}):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",wr(a)]}),l!==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",wr(l)]})]})]}):null}function Wr({featureNum:t,phaseNum:a,taskNum:l}){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",wr(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",wr(a)]})]}):null,l!==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",wr(l)]})]}):null]})}function zl({id:t,children:a}){const[l,i]=v.useState(!1);return d.jsxs("button",{type:"button",onClick:async u=>{u.preventDefault(),u.stopPropagation(),await ON(t)&&(i(!0),window.setTimeout(()=>i(!1),1200))},title:l?"Copied":`Copy ${t}`,"aria-label":l?"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:l?d.jsx(ib,{className:"h-3 w-3 text-emerald-500"}):d.jsx(cb,{className:"h-3 w-3"})})]})}function ii({shortId:t}){return d.jsx(zl,{id:t,children:d.jsx("span",{className:"short-id-badge",children:t})})}function am({phaseId:t,updatedAt:a}){const l=`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:l,"aria-label":l,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 MN({activeTasks:t}){const a=el(),l=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 l.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 (",l.length,")"]}),d.jsx("div",{className:"grid grid-cols-1 max-h-[35vh] gap-1.5 overflow-y-auto pr-1",children:l.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(dt,{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(Ll,{type:"task",number:i.number}),d.jsx(ai,{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(KE,{className:"h-4 w-4"})})]},i.id)})})]})})})}function kN({project:t,activeTasks:a,serverInfo:l}){const i=kl(),[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(CN,{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(MN,{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(dt,{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,l?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] ${l.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"}),l.mode==="lan"?"LAN visible":"Local only"]}),d.jsx("a",{href:l.localUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:l.localUrl}),l.lanUrl?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),d.jsx("a",{href:l.lanUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:l.lanUrl})]}):null]}):null,t!=null&&t.description?d.jsx(Hn,{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(Mu,{})]})]})}const hu={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},yb=v.createContext(hu);function xb(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function _N(t){return typeof t!="string"}function LN(t){return{create:(t==null?void 0:t.create)??hu.create,edit:(t==null?void 0:t.edit)??hu.edit,delete:(t==null?void 0:t.delete)??hu.delete,submit:(t==null?void 0:t.submit)??hu.submit}}function zN(t){const a=[],l=xb();t.primary&&a.push(l?"⌘":"Ctrl"),t.meta&&a.push(l?"⌘":"Meta"),t.ctrl&&a.push(l?"⌃":"Ctrl"),t.shift&&a.push(l?"⇧":"Shift"),t.alt&&a.push(l?"⌥":"Alt");const i=t.key==="Backspace"?l?"⌫":"Backspace":t.key==="Enter"?l?"↩":"Enter":t.key.length===1?t.key.toUpperCase():t.key;return a.push(i),l?a.join(""):a.join("+")}function UN(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function HN(t,a){const l=a.key.length===1?a.key.toLowerCase():a.key,i=t.key.length===1?t.key.toLowerCase():t.key,u=xb(),o=a.meta??(a.primary?u:!1),f=a.ctrl??(a.primary?!u:!1);return i===l&&!!o===t.metaKey&&!!f===t.ctrlKey&&!!a.shift===t.shiftKey&&!!a.alt===t.altKey}function BN({shortcuts:t,children:a}){return v.createElement(yb.Provider,{value:LN(t)},a)}function bb(t){const a=v.useContext(yb);if(t)return _N(t)?t:a[t]}function Zn(t,a,l){const i=bb(t);v.useEffect(()=>{if(!i||(l==null?void 0:l.enabled)===!1)return;const u=o=>{!(l!=null&&l.allowInEditable)&&UN(o.target)||HN(o,i)&&(o.preventDefault(),a())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[a,l==null?void 0:l.allowInEditable,l==null?void 0:l.enabled,i])}const $N=1500,qN=80,YN=12e3,VN=5e3;function FN(){const{revalidate:t}=Sw(),a=v.useRef(null),l=v.useRef(null),i=v.useRef(null),u=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{let f=!0;const m=P=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:P}}))},p=()=>{l.current!==null&&(window.clearTimeout(l.current),l.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)},w=()=>{g(),i.current=window.setTimeout(()=>{t()},qN)},S=()=>{!f||l.current!==null||(m("reconnecting"),l.current=window.setTimeout(()=>{l.current=null,j()},$N))},N=()=>{b(),x();const P=a.current;if(a.current=null,P&&(P.readyState===WebSocket.OPEN||P.readyState===WebSocket.CONNECTING))try{P.close()}catch{}},A=()=>{b(),x(),u.current=window.setInterval(()=>{const P=a.current;if(!(!P||P.readyState!==WebSocket.OPEN)){try{P.send(JSON.stringify({type:"ping"}))}catch{N(),S();return}x(),o.current=window.setTimeout(()=>{N(),S()},VN)}},YN)},j=()=>{if(!f)return;const P=a.current;if(P&&(P.readyState===WebSocket.OPEN||P.readyState===WebSocket.CONNECTING))return;m(l.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"),A()},W.onmessage=U=>{x();try{const T=JSON.parse(U.data);if(!T.type||T.type==="pong"||T.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:T})),T.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":w();break;default:break}}catch{}},W.onclose=()=>{b(),x(),a.current===W&&(a.current=null),f&&S()},W.onerror=()=>{try{W.close()}catch{}}},L=()=>{const P=a.current;(!P||P.readyState===WebSocket.CLOSED||P.readyState===WebSocket.CLOSING)&&j()},I=()=>{document.visibilityState==="visible"&&L()},Y=()=>{L()};return m("connecting"),j(),window.addEventListener("online",Y),document.addEventListener("visibilitychange",I),()=>{f=!1,m("disconnected"),window.removeEventListener("online",Y),document.removeEventListener("visibilitychange",I),p(),g(),b(),x(),N()}},[t]),null}async function IN(){const[t,a,l]=await Promise.all([fb(),vN(),gb()]);return{project:t,uiConfig:a,activeTasks:l}}function GN(){const{project:t,uiConfig:a,activeTasks:l}=cs();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(BN,{shortcuts:a.shortcuts,children:[d.jsx(FN,{}),d.jsx(kN,{project:t,activeTasks:l,serverInfo:a.server})]})}function XN(){const t=tb(),a=ti(t),l=a&&t.status===503,i=a?l?"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:l?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-9 items-center whitespace-nowrap rounded-[12px] bg-[var(--accent)] px-3 py-1.5 text-sm font-semibold text-white transition hover:opacity-90 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2",children:"Reload page"})})]})})})}async function PN(){const[t,a,l]=await Promise.all([hb(),tm(),gb()]);return{features:t,phases:a,activeTasks:l}}function QN({shortcut:t}){const a=bb(t);return a?d.jsx("span",{className:"hidden 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)] sm:inline-block",children:zN(a)}):null}const KN={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 bt({variant:t="secondary",className:a="",children:l,shortcut:i,...u}){return d.jsxs("button",{className:`inline-flex min-h-9 items-center justify-center gap-1.5 whitespace-nowrap rounded-[12px] border px-3 py-1.5 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 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2 sm:gap-2 ${KN[t]} ${a}`,...u,children:[d.jsx("span",{children:l}),i?d.jsx(QN,{shortcut:i}):null]})}function gn({className:t="",children:a,...l}){return d.jsx("div",{className:`surface-card p-6 ${t}`,...l,children:a})}function ZN({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(Hn,{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(Hn,{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(Hn,{text:a.implementationNotes})]}):null]},a.id))})]})}function JN({project:t}){var x,b,w;const a=t.scope??[],l=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:((w=t.workflowRules)==null?void 0:w.afterPhaseComplete)??[]};return a.length>0||l.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(gn,{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,l.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:l.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(ZN,{decisions:m})]})]})}):null}function Sa({status:t}){return d.jsx("span",{className:`status-chip status-${t}`,children:t})}function WN(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function eR({features:t,phases:a}){const l=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(gn,{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:l.length>0?l.map(({task:i,phase:u,feature:o,featureName:f,completedAt:m})=>d.jsxs(dt,{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(Ll,{type:"task",number:i.number}),d.jsx(ai,{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(ai,{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 ",WN(m)]})]},i.id)):d.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const Uy=180*1e3;function tR(t){const a=Date.now()-new Date(t).getTime();if(a<0)return"just now";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const i=Math.floor(l/60);return i<60?`${i}m ago`:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function nR({features:t,phases:a}){const[,l]=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<Uy&&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()+Uy-Date.now();return Math.min(m,g)},1/0);if(!Number.isFinite(o)||o<=0)return;const f=window.setTimeout(()=>l(m=>m+1),o+50);return()=>window.clearTimeout(f)},[u]),u.length===0?null:d.jsxs(gn,{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(dt,{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(Ll,{type:"task",number:o.number}),d.jsx(ai,{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(ai,{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 ",tR(g)]})]},o.id))})]})}const aR=4200;function rR(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function lR(t){return t.reduce((a,l)=>a+l.tasks.filter(i=>i.status==="done").length,0)}function sR(t){return String(t&&t>0?t:0).padStart(3,"0")}function iR(t,a){const l=new Map;for(const i of a){if(!i.featureId)continue;const u=l.get(i.featureId)??[];u.push(i),l.set(i.featureId,u)}return t.map(i=>{const u=l.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((w,S)=>(w.priority??0)-(S.priority??0)||w.number-S.number||w.createdAt.localeCompare(S.createdAt)||w.title.localeCompare(S.title)),b=x.some(w=>w.status==="in-progress");return{phase:g,totalTasks:g.tasks.length,doneTasks:g.tasks.filter(w=>w.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 tc({title:t,value:a,valueSuffix:l,subtitle:i,icon:u,valueClassName:o,iconClassName:f}){return d.jsxs(gn,{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}),l?d.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:l}):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 Hy(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 uR({features:t,phases:a}){const l=t.filter(x=>x.status==="done").length,i=Math.max(t.length-l,0),u=a.filter(x=>x.status==="done").length,o=Math.max(a.length-u,0),f=rR(a),m=lR(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(tc,{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:[l," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[i," left"]})]}),icon:d.jsx(bc,{className:"h-4 w-4"})}),d.jsx(tc,{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(EE,{className:"h-4 w-4"})}),d.jsx(tc,{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(em,{className:"h-4 w-4"})}),d.jsx(tc,{title:"Completion",value:`${g}%`,subtitle:"Task completion rate",valueClassName:Hy(g),iconClassName:Hy(g),icon:d.jsx(ob,{className:"h-4 w-4"})})]})}function oR(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return v.useMemo(()=>i=>{a.forEach(u=>u(i))},a)}const Yc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ui(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function rm(t){return"nodeType"in t}function da(t){var a,l;return t?ui(t)?t:rm(t)&&(a=(l=t.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function lm(t){const{Document:a}=da(t);return t instanceof a}function _u(t){return ui(t)?!1:t instanceof da(t).HTMLElement}function Sb(t){return t instanceof da(t).SVGElement}function oi(t){return t?ui(t)?t.document:rm(t)?lm(t)?t:_u(t)||Sb(t)?t.ownerDocument:document:document:document}const rr=Yc?v.useLayoutEffect:v.useEffect;function Vc(t){const a=v.useRef(t);return rr(()=>{a.current=t}),v.useCallback(function(){for(var l=arguments.length,i=new Array(l),u=0;u<l;u++)i[u]=arguments[u];return a.current==null?void 0:a.current(...i)},[])}function cR(){const t=v.useRef(null),a=v.useCallback((i,u)=>{t.current=setInterval(i,u)},[]),l=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[a,l]}function wu(t,a){a===void 0&&(a=[t]);const l=v.useRef(t);return rr(()=>{l.current!==t&&(l.current=t)},a),l}function Lu(t,a){const l=v.useRef();return v.useMemo(()=>{const i=t(l.current);return l.current=i,i},[...a])}function Sc(t){const a=Vc(t),l=v.useRef(null),i=v.useCallback(u=>{u!==l.current&&(a==null||a(u,l.current)),l.current=u},[]);return[l,i]}function wc(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let uh={};function zu(t,a){return v.useMemo(()=>{if(a)return a;const l=uh[t]==null?0:uh[t]+1;return uh[t]=l,t+"-"+l},[t,a])}function wb(t){return function(a){for(var l=arguments.length,i=new Array(l>1?l-1:0),u=1;u<l;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 ei=wb(1),Ec=wb(-1);function dR(t){return"clientX"in t&&"clientY"in t}function Fc(t){if(!t)return!1;const{KeyboardEvent:a}=da(t.target);return a&&t instanceof a}function fR(t){if(!t)return!1;const{TouchEvent:a}=da(t.target);return a&&t instanceof a}function Nc(t){if(fR(t)){if(t.touches&&t.touches.length){const{clientX:a,clientY:l}=t.touches[0];return{x:a,y:l}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:a,clientY:l}=t.changedTouches[0];return{x:a,y:l}}}return dR(t)?{x:t.clientX,y:t.clientY}:null}const Ml=Object.freeze({Translate:{toString(t){if(!t)return;const{x:a,y:l}=t;return"translate3d("+(a?Math.round(a):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:a,scaleY:l}=t;return"scaleX("+a+") scaleY("+l+")"}},Transform:{toString(t){if(t)return[Ml.Translate.toString(t),Ml.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:a,duration:l,easing:i}=t;return a+" "+l+"ms "+i}}}),By="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hR(t){return t.matches(By)?t:t.querySelector(By)}const mR={display:"none"};function pR(t){let{id:a,value:l}=t;return sn.createElement("div",{id:a,style:mR},l)}function gR(t){let{id:a,announcement:l,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 sn.createElement("div",{id:a,style:u,role:"status","aria-live":i,"aria-atomic":!0},l)}function vR(){const[t,a]=v.useState("");return{announce:v.useCallback(i=>{i!=null&&a(i)},[]),announcement:t}}const Eb=v.createContext(null);function yR(t){const a=v.useContext(Eb);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(t)},[t,a])}function xR(){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 bR={draggable:`
|
|
244
|
-
To pick up a draggable item, press the space bar.
|
|
245
|
-
While dragging, use the arrow keys to move the item.
|
|
246
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
247
|
-
`},SR={onDragStart(t){let{active:a}=t;return"Picked up draggable item "+a.id+"."},onDragOver(t){let{active:a,over:l}=t;return l?"Draggable item "+a.id+" was moved over droppable area "+l.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(t){let{active:a,over:l}=t;return l?"Draggable item "+a.id+" was dropped over droppable area "+l.id:"Draggable item "+a.id+" was dropped."},onDragCancel(t){let{active:a}=t;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function wR(t){let{announcements:a=SR,container:l,hiddenTextDescribedById:i,screenReaderInstructions:u=bR}=t;const{announce:o,announcement:f}=vR(),m=zu("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),yR(v.useMemo(()=>({onDragStart(b){let{active:w}=b;o(a.onDragStart({active:w}))},onDragMove(b){let{active:w,over:S}=b;a.onDragMove&&o(a.onDragMove({active:w,over:S}))},onDragOver(b){let{active:w,over:S}=b;o(a.onDragOver({active:w,over:S}))},onDragEnd(b){let{active:w,over:S}=b;o(a.onDragEnd({active:w,over:S}))},onDragCancel(b){let{active:w,over:S}=b;o(a.onDragCancel({active:w,over:S}))}}),[o,a])),!p)return null;const x=sn.createElement(sn.Fragment,null,sn.createElement(pR,{id:i,value:u.draggable}),sn.createElement(gR,{id:m,announcement:f}));return l?Jr.createPortal(x,l):x}var Un;(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"})(Un||(Un={}));function Rc(){}function ER(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function NR(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return v.useMemo(()=>[...a].filter(i=>i!=null),[...a])}const lr=Object.freeze({x:0,y:0});function RR(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function jR(t,a){const l=Nc(t);if(!l)return"0 0";const i={x:(l.x-a.left)/a.width*100,y:(l.y-a.top)/a.height*100};return i.x+"% "+i.y+"%"}function TR(t,a){let{data:{value:l}}=t,{data:{value:i}}=a;return l-i}function DR(t,a){let{data:{value:l}}=t,{data:{value:i}}=a;return i-l}function CR(t,a){if(!t||t.length===0)return null;const[l]=t;return l[a]}function $y(t,a,l){return a===void 0&&(a=t.left),l===void 0&&(l=t.top),{x:a+t.width*.5,y:l+t.height*.5}}const AR=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:i}=t;const u=$y(a,a.left,a.top),o=[];for(const f of i){const{id:m}=f,p=l.get(m);if(p){const g=RR($y(p),u);o.push({id:m,data:{droppableContainer:f,value:g}})}}return o.sort(TR)};function OR(t,a){const l=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-l;if(i<u&&l<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 MR=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:i}=t;const u=[];for(const o of i){const{id:f}=o,m=l.get(f);if(m){const p=OR(m,a);p>0&&u.push({id:f,data:{droppableContainer:o,value:p}})}}return u.sort(DR)};function kR(t,a,l){return{...t,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function Nb(t,a){return t&&a?{x:t.left-a.left,y:t.top-a.top}:lr}function _R(t){return function(l){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}),{...l})}}const LR=_R(1);function Rb(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 zR(t,a,l){const i=Rb(a);if(!i)return t;const{scaleX:u,scaleY:o,x:f,y:m}=i,p=t.left-f-(1-u)*parseFloat(l),g=t.top-m-(1-o)*parseFloat(l.slice(l.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 UR={ignoreTransform:!1};function ci(t,a){a===void 0&&(a=UR);let l=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=da(t).getComputedStyle(t);g&&(l=zR(l,g,x))}const{top:i,left:u,width:o,height:f,bottom:m,right:p}=l;return{top:i,left:u,width:o,height:f,bottom:m,right:p}}function qy(t){return ci(t,{ignoreTransform:!0})}function HR(t){const a=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function BR(t,a){return a===void 0&&(a=da(t).getComputedStyle(t)),a.position==="fixed"}function $R(t,a){a===void 0&&(a=da(t).getComputedStyle(t));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const o=a[u];return typeof o=="string"?l.test(o):!1})}function sm(t,a){const l=[];function i(u){if(a!=null&&l.length>=a||!u)return l;if(lm(u)&&u.scrollingElement!=null&&!l.includes(u.scrollingElement))return l.push(u.scrollingElement),l;if(!_u(u)||Sb(u)||l.includes(u))return l;const o=da(t).getComputedStyle(u);return u!==t&&$R(u,o)&&l.push(u),BR(u,o)?l:i(u.parentNode)}return t?i(t):l}function jb(t){const[a]=sm(t,1);return a??null}function oh(t){return!Yc||!t?null:ui(t)?t:rm(t)?lm(t)||t===oi(t).scrollingElement?window:_u(t)?t:null:null}function Tb(t){return ui(t)?t.scrollX:t.scrollLeft}function Db(t){return ui(t)?t.scrollY:t.scrollTop}function Oh(t){return{x:Tb(t),y:Db(t)}}var qn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(qn||(qn={}));function Cb(t){return!Yc||!t?!1:t===document.scrollingElement}function Ab(t){const a={x:0,y:0},l=Cb(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-l.width,y:t.scrollHeight-l.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 qR={x:.2,y:.2};function YR(t,a,l,i,u){let{top:o,left:f,right:m,bottom:p}=l;i===void 0&&(i=10),u===void 0&&(u=qR);const{isTop:g,isBottom:x,isLeft:b,isRight:w}=Ab(t),S={x:0,y:0},N={x:0,y:0},A={height:a.height*u.y,width:a.width*u.x};return!g&&o<=a.top+A.height?(S.y=qn.Backward,N.y=i*Math.abs((a.top+A.height-o)/A.height)):!x&&p>=a.bottom-A.height&&(S.y=qn.Forward,N.y=i*Math.abs((a.bottom-A.height-p)/A.height)),!w&&m>=a.right-A.width?(S.x=qn.Forward,N.x=i*Math.abs((a.right-A.width-m)/A.width)):!b&&f<=a.left+A.width&&(S.x=qn.Backward,N.x=i*Math.abs((a.left+A.width-f)/A.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:l,right:i,bottom:u}=t.getBoundingClientRect();return{top:a,left:l,right:i,bottom:u,width:t.clientWidth,height:t.clientHeight}}function Ob(t){return t.reduce((a,l)=>ei(a,Oh(l)),lr)}function FR(t){return t.reduce((a,l)=>a+Tb(l),0)}function IR(t){return t.reduce((a,l)=>a+Db(l),0)}function Mb(t,a){if(a===void 0&&(a=ci),!t)return;const{top:l,left:i,bottom:u,right:o}=a(t);jb(t)&&(u<=0||o<=0||l>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const GR=[["x",["left","right"],FR],["y",["top","bottom"],IR]];class im{constructor(a,l){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=sm(l),u=Ob(i);this.rect={...a},this.width=a.width,this.height=a.height;for(const[o,f,m]of GR)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 pu{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...l)})},this.target=a}add(a,l,i){var u;(u=this.target)==null||u.addEventListener(a,l,i),this.listeners.push([a,l,i])}}function XR(t){const{EventTarget:a}=da(t);return t instanceof a?t:oi(t)}function ch(t,a){const l=Math.abs(t.x),i=Math.abs(t.y);return typeof a=="number"?Math.sqrt(l**2+i**2)>a:"x"in a&&"y"in a?l>a.x&&i>a.y:"x"in a?l>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 Yy(t){t.preventDefault()}function PR(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 kb={start:[Ot.Space,Ot.Enter],cancel:[Ot.Esc],end:[Ot.Space,Ot.Enter,Ot.Tab]},QR=(t,a)=>{let{currentCoordinates:l}=a;switch(t.code){case Ot.Right:return{...l,x:l.x+25};case Ot.Left:return{...l,x:l.x-25};case Ot.Down:return{...l,y:l.y+25};case Ot.Up:return{...l,y:l.y-25}}};class _b{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:l}}=a;this.props=a,this.listeners=new pu(oi(l)),this.windowListeners=new pu(da(l)),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:l}=this.props,i=a.node.current;i&&Mb(i),l(lr)}handleKeyDown(a){if(Fc(a)){const{active:l,context:i,options:u}=this.props,{keyboardCodes:o=kb,coordinateGetter:f=QR,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}:lr;this.referenceCoordinates||(this.referenceCoordinates=x);const b=f(a,{active:l,context:i.current,currentCoordinates:x});if(b){const w=Ec(b,x),S={x:0,y:0},{scrollableAncestors:N}=i.current;for(const A of N){const j=a.code,{isTop:L,isRight:I,isLeft:Y,isBottom:P,maxScroll:K,minScroll:W}=Ab(A),U=VR(A),T={x:Math.min(j===Ot.Right?U.right-U.width/2:U.right,Math.max(j===Ot.Right?U.left:U.left+U.width/2,b.x)),y:Math.min(j===Ot.Down?U.bottom-U.height/2:U.bottom,Math.max(j===Ot.Down?U.top:U.top+U.height/2,b.y))},oe=j===Ot.Right&&!I||j===Ot.Left&&!Y,me=j===Ot.Down&&!P||j===Ot.Up&&!L;if(oe&&T.x!==b.x){const ye=A.scrollLeft+w.x,Re=j===Ot.Right&&ye<=K.x||j===Ot.Left&&ye>=W.x;if(Re&&!w.y){A.scrollTo({left:ye,behavior:m});return}Re?S.x=A.scrollLeft-ye:S.x=j===Ot.Right?A.scrollLeft-K.x:A.scrollLeft-W.x,S.x&&A.scrollBy({left:-S.x,behavior:m});break}else if(me&&T.y!==b.y){const ye=A.scrollTop+w.y,Re=j===Ot.Down&&ye<=K.y||j===Ot.Up&&ye>=W.y;if(Re&&!w.x){A.scrollTo({top:ye,behavior:m});return}Re?S.y=A.scrollTop-ye:S.y=j===Ot.Down?A.scrollTop-K.y:A.scrollTop-W.y,S.y&&A.scrollBy({top:-S.y,behavior:m});break}}this.handleMove(a,ei(Ec(b,this.referenceCoordinates),S))}}}handleMove(a,l){const{onMove:i}=this.props;a.preventDefault(),i(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}_b.activators=[{eventName:"onKeyDown",handler:(t,a,l)=>{let{keyboardCodes:i=kb,onActivation:u}=a,{active:o}=l;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 Vy(t){return!!(t&&"distance"in t)}function Fy(t){return!!(t&&"delay"in t)}class um{constructor(a,l,i){var u;i===void 0&&(i=XR(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=l;const{event:o}=a,{target:f}=o;this.props=a,this.events=l,this.document=oi(f),this.documentListeners=new pu(this.document),this.listeners=new pu(i),this.windowListeners=new pu(da(f)),this.initialCoordinates=(u=Nc(o))!=null?u:lr,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:l,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,Yy),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),this.windowListeners.add(Xa.ContextMenu,Yy),this.documentListeners.add(Xa.Keydown,this.handleKeydown),l){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fy(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Vy(l)){this.handlePending(l);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,l){const{active:i,onPending:u}=this.props;u(i,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(Xa.Click,PR,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xa.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:i,initialCoordinates:u,props:o}=this,{onMove:f,options:{activationConstraint:m}}=o;if(!u)return;const p=(l=Nc(a))!=null?l:lr,g=Ec(u,p);if(!i&&m){if(Vy(m)){if(m.tolerance!=null&&ch(g,m.tolerance))return this.handleCancel();if(ch(g,m.distance))return this.handleStart()}if(Fy(m)&&ch(g,m.tolerance))return this.handleCancel();this.handlePending(m,g);return}a.cancelable&&a.preventDefault(),f(p)}handleEnd(){const{onAbort:a,onEnd:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleCancel(){const{onAbort:a,onCancel:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleKeydown(a){a.code===Ot.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const KR={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class om extends um{constructor(a){const{event:l}=a,i=oi(l.target);super(a,KR,i)}}om.activators=[{eventName:"onPointerDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:i}=a;return!l.isPrimary||l.button!==0?!1:(i==null||i({event:l}),!0)}}];const ZR={move:{name:"mousemove"},end:{name:"mouseup"}};var Mh;(function(t){t[t.RightClick=2]="RightClick"})(Mh||(Mh={}));class JR extends um{constructor(a){super(a,ZR,oi(a.event.target))}}JR.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:i}=a;return l.button===Mh.RightClick?!1:(i==null||i({event:l}),!0)}}];const dh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class WR extends um{constructor(a){super(a,dh)}static setup(){return window.addEventListener(dh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(dh.move.name,a)};function a(){}}}WR.activators=[{eventName:"onTouchStart",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:i}=a;const{touches:u}=l;return u.length>1?!1:(i==null||i({event:l}),!0)}}];var gu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(gu||(gu={}));var jc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(jc||(jc={}));function e2(t){let{acceleration:a,activator:l=gu.Pointer,canScroll:i,draggingRect:u,enabled:o,interval:f=5,order:m=jc.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:b,threshold:w}=t;const S=n2({delta:b,disabled:!o}),[N,A]=cR(),j=v.useRef({x:0,y:0}),L=v.useRef({x:0,y:0}),I=v.useMemo(()=>{switch(l){case gu.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case gu.DraggableRect:return u}},[l,u,p]),Y=v.useRef(null),P=v.useCallback(()=>{const W=Y.current;if(!W)return;const U=j.current.x*L.current.x,T=j.current.y*L.current.y;W.scrollBy(U,T)},[]),K=v.useMemo(()=>m===jc.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!o||!g.length||!I){A();return}for(const W of K){if((i==null?void 0:i(W))===!1)continue;const U=g.indexOf(W),T=x[U];if(!T)continue;const{direction:oe,speed:me}=YR(W,T,I,a,w);for(const ye of["x","y"])S[ye][oe[ye]]||(me[ye]=0,oe[ye]=0);if(me.x>0||me.y>0){A(),Y.current=W,N(P,f),j.current=me,L.current=oe;return}}j.current={x:0,y:0},L.current={x:0,y:0},A()},[a,P,i,A,o,f,JSON.stringify(I),JSON.stringify(S),N,g,K,x,JSON.stringify(w)])}const t2={x:{[qn.Backward]:!1,[qn.Forward]:!1},y:{[qn.Backward]:!1,[qn.Forward]:!1}};function n2(t){let{delta:a,disabled:l}=t;const i=wc(a);return Lu(u=>{if(l||!i||!u)return t2;const o={x:Math.sign(a.x-i.x),y:Math.sign(a.y-i.y)};return{x:{[qn.Backward]:u.x[qn.Backward]||o.x===-1,[qn.Forward]:u.x[qn.Forward]||o.x===1},y:{[qn.Backward]:u.y[qn.Backward]||o.y===-1,[qn.Forward]:u.y[qn.Forward]||o.y===1}}},[l,a,i])}function a2(t,a){const l=a!=null?t.get(a):void 0,i=l?l.node.current:null;return Lu(u=>{var o;return a==null?null:(o=i??u)!=null?o:null},[i,a])}function r2(t,a){return v.useMemo(()=>t.reduce((l,i)=>{const{sensor:u}=i,o=u.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,i)}));return[...l,...o]},[]),[t,a])}var Eu;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Eu||(Eu={}));var kh;(function(t){t.Optimized="optimized"})(kh||(kh={}));const Iy=new Map;function l2(t,a){let{dragging:l,dependencies:i,config:u}=a;const[o,f]=v.useState(null),{frequency:m,measure:p,strategy:g}=u,x=v.useRef(t),b=j(),w=wu(b),S=v.useCallback(function(L){L===void 0&&(L=[]),!w.current&&f(I=>I===null?L:I.concat(L.filter(Y=>!I.includes(Y))))},[w]),N=v.useRef(null),A=Lu(L=>{if(b&&!l)return Iy;if(!L||L===Iy||x.current!==t||o!=null){const I=new Map;for(let Y of t){if(!Y)continue;if(o&&o.length>0&&!o.includes(Y.id)&&Y.rect.current){I.set(Y.id,Y.rect.current);continue}const P=Y.node.current,K=P?new im(p(P),P):null;Y.rect.current=K,K&&I.set(Y.id,K)}return I}return L},[t,o,l,b,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{b||S()},[l,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:A,measureDroppableContainers:S,measuringScheduled:o!=null};function j(){switch(g){case Eu.Always:return!1;case Eu.BeforeDragging:return l;default:return!l}}}function cm(t,a){return Lu(l=>t?l||(typeof a=="function"?a(t):t):null,[a,t])}function s2(t,a){return cm(t,a)}function i2(t){let{callback:a,disabled:l}=t;const i=Vc(a),u=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,l]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function Ic(t){let{callback:a,disabled:l}=t;const i=Vc(a),u=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[l]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function u2(t){return new im(ci(t),t)}function Gy(t,a,l){a===void 0&&(a=u2);const[i,u]=v.useState(null);function o(){u(p=>{if(!t)return null;if(t.isConnected===!1){var g;return(g=p??l)!=null?g:null}const x=a(t);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const f=i2({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=Ic({callback:o});return rr(()=>{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 o2(t){const a=cm(t);return Nb(t,a)}const Xy=[];function c2(t){const a=v.useRef(t),l=Lu(i=>t?i&&i!==Xy&&t&&a.current&&t.parentNode===a.current.parentNode?i:sm(t):Xy,[t]);return v.useEffect(()=>{a.current=t},[t]),l}function d2(t){const[a,l]=v.useState(null),i=v.useRef(t),u=v.useCallback(o=>{const f=oh(o.target);f&&l(m=>m?(m.set(f,Oh(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const o=i.current;if(t!==o){f(o);const m=t.map(p=>{const g=oh(p);return g?(g.addEventListener("scroll",u,{passive:!0}),[g,Oh(g)]):null}).filter(p=>p!=null);l(m.length?new Map(m):null),i.current=t}return()=>{f(t),f(o)};function f(m){m.forEach(p=>{const g=oh(p);g==null||g.removeEventListener("scroll",u)})}},[u,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((o,f)=>ei(o,f),lr):Ob(t):lr,[t,a])}function Py(t,a){a===void 0&&(a=[]);const l=v.useRef(null);return v.useEffect(()=>{l.current=null},a),v.useEffect(()=>{const i=t!==lr;i&&!l.current&&(l.current=t),!i&&l.current&&(l.current=null)},[t]),l.current?Ec(t,l.current):lr}function f2(t){v.useEffect(()=>{if(!Yc)return;const a=t.map(l=>{let{sensor:i}=l;return i.setup==null?void 0:i.setup()});return()=>{for(const l of a)l==null||l()}},t.map(a=>{let{sensor:l}=a;return l}))}function h2(t,a){return v.useMemo(()=>t.reduce((l,i)=>{let{eventName:u,handler:o}=i;return l[u]=f=>{o(f,a)},l},{}),[t,a])}function Lb(t){return v.useMemo(()=>t?HR(t):null,[t])}const Qy=[];function m2(t,a){a===void 0&&(a=ci);const[l]=t,i=Lb(l?da(l):null),[u,o]=v.useState(Qy);function f(){o(()=>t.length?t.map(p=>Cb(p)?i:new im(a(p),p)):Qy)}const m=Ic({callback:f});return rr(()=>{m==null||m.disconnect(),f(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),u}function zb(t){if(!t)return null;if(t.children.length>1)return t;const a=t.children[0];return _u(a)?a:t}function p2(t){let{measure:a}=t;const[l,i]=v.useState(null),u=v.useCallback(g=>{for(const{target:x}of g)if(_u(x)){i(b=>{const w=a(x);return b?{...b,width:w.width,height:w.height}:w});break}},[a]),o=Ic({callback:u}),f=v.useCallback(g=>{const x=zb(g);o==null||o.disconnect(),x&&(o==null||o.observe(x)),i(x?a(x):null)},[a,o]),[m,p]=Sc(f);return v.useMemo(()=>({nodeRef:m,rect:l,setRef:p}),[l,m,p])}const g2=[{sensor:om,options:{}},{sensor:_b,options:{}}],v2={current:{}},mc={draggable:{measure:qy},droppable:{measure:qy,strategy:Eu.WhileDragging,frequency:kh.Optimized},dragOverlay:{measure:ci}};class vu extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,i;return(l=(i=this.get(a))==null?void 0:i.node.current)!=null?l:void 0}}const y2={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mc,measureDroppableContainers:Rc,windowRect:null,measuringScheduled:!1},Ub={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rc,draggableNodes:new Map,over:null,measureDroppableContainers:Rc},Uu=v.createContext(Ub),Hb=v.createContext(y2);function x2(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vu}}}function b2(t,a){switch(a.type){case Un.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Un.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 Un.DragEnd:case Un.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Un.RegisterDroppable:{const{element:l}=a,{id:i}=l,u=new vu(t.droppable.containers);return u.set(i,l),{...t,droppable:{...t.droppable,containers:u}}}case Un.SetDroppableDisabled:{const{id:l,key:i,disabled:u}=a,o=t.droppable.containers.get(l);if(!o||i!==o.key)return t;const f=new vu(t.droppable.containers);return f.set(l,{...o,disabled:u}),{...t,droppable:{...t.droppable,containers:f}}}case Un.UnregisterDroppable:{const{id:l,key:i}=a,u=t.droppable.containers.get(l);if(!u||i!==u.key)return t;const o=new vu(t.droppable.containers);return o.delete(l),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function S2(t){let{disabled:a}=t;const{active:l,activatorEvent:i,draggableNodes:u}=v.useContext(Uu),o=wc(i),f=wc(l==null?void 0:l.id);return v.useEffect(()=>{if(!a&&!i&&o&&f!=null){if(!Fc(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=hR(x);if(b){b.focus();break}}})}},[i,a,u,f,o]),null}function Bb(t,a){let{transform:l,...i}=a;return t!=null&&t.length?t.reduce((u,o)=>o({transform:u,...i}),l):l}function w2(t){return v.useMemo(()=>({draggable:{...mc.draggable,...t==null?void 0:t.draggable},droppable:{...mc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...mc.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 E2(t){let{activeNode:a,measure:l,initialRect:i,config:u=!0}=t;const o=v.useRef(!1),{x:f,y:m}=typeof u=="boolean"?{x:u,y:u}:u;rr(()=>{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=l(g),b=Nb(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 w=jb(g);w&&w.scrollBy({top:b.y,left:b.x})}},[a,f,m,i,l])}const Gc=v.createContext({...lr,scaleX:1,scaleY:1});var Dl;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Dl||(Dl={}));const N2=v.memo(function(a){var l,i,u,o;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=g2,collisionDetection:b=MR,measuring:w,modifiers:S,...N}=a;const A=v.useReducer(b2,void 0,x2),[j,L]=A,[I,Y]=xR(),[P,K]=v.useState(Dl.Uninitialized),W=P===Dl.Initialized,{draggable:{active:U,nodes:T,translate:oe},droppable:{containers:me}}=j,ye=U!=null?T.get(U):null,Re=v.useRef({initial:null,translated:null}),ee=v.useMemo(()=>{var Yt;return U!=null?{id:U,data:(Yt=ye==null?void 0:ye.data)!=null?Yt:v2,rect:Re}:null},[U,ye]),be=v.useRef(null),[Ee,z]=v.useState(null),[H,ie]=v.useState(null),ce=wu(N,Object.values(N)),pe=zu("DndDescribedBy",f),D=v.useMemo(()=>me.getEnabled(),[me]),$=w2(w),{droppableRects:ne,measureDroppableContainers:de,measuringScheduled:je}=l2(D,{dragging:W,dependencies:[oe.x,oe.y],config:$.droppable}),Ne=a2(T,U),Ue=v.useMemo(()=>H?Nc(H):null,[H]),it=Pt(),Ge=s2(Ne,$.draggable.measure);E2({activeNode:U!=null?T.get(U):null,config:it.layoutShiftCompensation,initialRect:Ge,measure:$.draggable.measure});const nt=Gy(Ne,$.draggable.measure,Ge),vn=Gy(Ne?Ne.parentElement:null),Rt=v.useRef({activatorEvent:null,active:null,activeNode:Ne,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:me,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ut=me.getNodeFor((l=Rt.current.over)==null?void 0:l.id),le=p2({measure:$.dragOverlay.measure}),Ye=(i=le.nodeRef.current)!=null?i:Ne,Ie=W?(u=le.rect)!=null?u:nt:null,Gt=!!(le.nodeRef.current&&le.rect),An=o2(Gt?null:nt),fn=Lb(Ye?da(Ye):null),Lt=c2(W?ut??Ne:null),Wt=m2(Lt),Yn=Bb(S,{transform:{x:oe.x-An.x,y:oe.y-An.y,scaleX:1,scaleY:1},activatorEvent:H,active:ee,activeNodeRect:nt,containerNodeRect:vn,draggingNodeRect:Ie,over:Rt.current.over,overlayNodeRect:le.rect,scrollableAncestors:Lt,scrollableAncestorRects:Wt,windowRect:fn}),Vn=Ue?ei(Ue,oe):null,fe=d2(Lt),Le=Py(fe),Me=Py(fe,[nt]),qe=ei(Yn,Le),Ze=Ie?LR(Ie,Yn):null,pt=ee&&Ze?b({active:ee,collisionRect:Ze,droppableRects:ne,droppableContainers:D,pointerCoordinates:Vn}):null,Xt=CR(pt,"id"),[rn,Bn]=v.useState(null),un=Gt?Yn:ei(Yn,Me),se=kR(un,(o=rn==null?void 0:rn.rect)!=null?o:null,nt),St=v.useRef(null),Mt=v.useCallback((Yt,yt)=>{let{sensor:zt,options:jt}=yt;if(be.current==null)return;const en=T.get(be.current);if(!en)return;const Qt=Yt.nativeEvent,Ut=new zt({active:be.current,activeNode:en,event:Qt,options:jt,context:Rt,onAbort(Je){if(!T.get(Je))return;const{onDragAbort:On}=ce.current,C={id:Je};On==null||On(C),I({type:"onDragAbort",event:C})},onPending(Je,wn,On,C){if(!T.get(Je))return;const{onDragPending:q}=ce.current,Z={id:Je,constraint:wn,initialCoordinates:On,offset:C};q==null||q(Z),I({type:"onDragPending",event:Z})},onStart(Je){const wn=be.current;if(wn==null)return;const On=T.get(wn);if(!On)return;const{onDragStart:C}=ce.current,k={activatorEvent:Qt,active:{id:wn,data:On.data,rect:Re}};Jr.unstable_batchedUpdates(()=>{C==null||C(k),K(Dl.Initializing),L({type:Un.DragStart,initialCoordinates:Je,active:wn}),I({type:"onDragStart",event:k}),z(St.current),ie(Qt)})},onMove(Je){L({type:Un.DragMove,coordinates:Je})},onEnd:ft(Un.DragEnd),onCancel:ft(Un.DragCancel)});St.current=Ut;function ft(Je){return async function(){const{active:On,collisions:C,over:k,scrollAdjustedTranslate:q}=Rt.current;let Z=null;if(On&&q){const{cancelDrop:ae}=ce.current;Z={activatorEvent:Qt,active:On,collisions:C,delta:q,over:k},Je===Un.DragEnd&&typeof ae=="function"&&await Promise.resolve(ae(Z))&&(Je=Un.DragCancel)}be.current=null,Jr.unstable_batchedUpdates(()=>{L({type:Je}),K(Dl.Uninitialized),Bn(null),z(null),ie(null),St.current=null;const ae=Je===Un.DragEnd?"onDragEnd":"onDragCancel";if(Z){const Te=ce.current[ae];Te==null||Te(Z),I({type:ae,event:Z})}})}}},[T]),Jn=v.useCallback((Yt,yt)=>(zt,jt)=>{const en=zt.nativeEvent,Qt=T.get(jt);if(be.current!==null||!Qt||en.dndKit||en.defaultPrevented)return;const Ut={active:Qt};Yt(zt,yt.options,Ut)===!0&&(en.dndKit={capturedBy:yt.sensor},be.current=jt,Mt(zt,yt))},[T,Mt]),Wn=r2(x,Jn);f2(x),rr(()=>{nt&&P===Dl.Initializing&&K(Dl.Initialized)},[nt,P]),v.useEffect(()=>{const{onDragMove:Yt}=ce.current,{active:yt,activatorEvent:zt,collisions:jt,over:en}=Rt.current;if(!yt||!zt)return;const Qt={active:yt,activatorEvent:zt,collisions:jt,delta:{x:qe.x,y:qe.y},over:en};Jr.unstable_batchedUpdates(()=>{Yt==null||Yt(Qt),I({type:"onDragMove",event:Qt})})},[qe.x,qe.y]),v.useEffect(()=>{const{active:Yt,activatorEvent:yt,collisions:zt,droppableContainers:jt,scrollAdjustedTranslate:en}=Rt.current;if(!Yt||be.current==null||!yt||!en)return;const{onDragOver:Qt}=ce.current,Ut=jt.get(Xt),ft=Ut&&Ut.rect.current?{id:Ut.id,rect:Ut.rect.current,data:Ut.data,disabled:Ut.disabled}:null,Je={active:Yt,activatorEvent:yt,collisions:zt,delta:{x:en.x,y:en.y},over:ft};Jr.unstable_batchedUpdates(()=>{Bn(ft),Qt==null||Qt(Je),I({type:"onDragOver",event:Je})})},[Xt]),rr(()=>{Rt.current={activatorEvent:H,active:ee,activeNode:Ne,collisionRect:Ze,collisions:pt,droppableRects:ne,draggableNodes:T,draggingNode:Ye,draggingNodeRect:Ie,droppableContainers:me,over:rn,scrollableAncestors:Lt,scrollAdjustedTranslate:qe},Re.current={initial:Ie,translated:Ze}},[ee,Ne,pt,Ze,T,Ye,Ie,ne,me,rn,Lt,qe]),e2({...it,delta:oe,draggingRect:Ze,pointerCoordinates:Vn,scrollableAncestors:Lt,scrollableAncestorRects:Wt});const jr=v.useMemo(()=>({active:ee,activeNode:Ne,activeNodeRect:nt,activatorEvent:H,collisions:pt,containerNodeRect:vn,dragOverlay:le,draggableNodes:T,droppableContainers:me,droppableRects:ne,over:rn,measureDroppableContainers:de,scrollableAncestors:Lt,scrollableAncestorRects:Wt,measuringConfiguration:$,measuringScheduled:je,windowRect:fn}),[ee,Ne,nt,H,pt,vn,le,T,me,ne,rn,de,Lt,Wt,$,je,fn]),Be=v.useMemo(()=>({activatorEvent:H,activators:Wn,active:ee,activeNodeRect:nt,ariaDescribedById:{draggable:pe},dispatch:L,draggableNodes:T,over:rn,measureDroppableContainers:de}),[H,Wn,ee,nt,L,pe,T,rn,de]);return sn.createElement(Eb.Provider,{value:Y},sn.createElement(Uu.Provider,{value:Be},sn.createElement(Hb.Provider,{value:jr},sn.createElement(Gc.Provider,{value:se},g)),sn.createElement(S2,{disabled:(m==null?void 0:m.restoreFocus)===!1})),sn.createElement(wR,{...m,hiddenTextDescribedById:pe}));function Pt(){const Yt=(Ee==null?void 0:Ee.autoScrollEnabled)===!1,yt=typeof p=="object"?p.enabled===!1:p===!1,zt=W&&!Yt&&!yt;return typeof p=="object"?{...p,enabled:zt}:{enabled:zt}}}),R2=v.createContext(null),Ky="button",j2="Draggable";function T2(t){let{id:a,data:l,disabled:i=!1,attributes:u}=t;const o=zu(j2),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:b,over:w}=v.useContext(Uu),{role:S=Ky,roleDescription:N="draggable",tabIndex:A=0}=u??{},j=(p==null?void 0:p.id)===a,L=v.useContext(j?Gc:R2),[I,Y]=Sc(),[P,K]=Sc(),W=h2(f,a),U=wu(l);rr(()=>(b.set(a,{id:a,key:o,node:I,activatorNode:P,data:U}),()=>{const oe=b.get(a);oe&&oe.key===o&&b.delete(a)}),[b,a]);const T=v.useMemo(()=>({role:S,tabIndex:A,"aria-disabled":i,"aria-pressed":j&&S===Ky?!0:void 0,"aria-roledescription":N,"aria-describedby":x.draggable}),[i,S,A,j,N,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:T,isDragging:j,listeners:i?void 0:W,node:I,over:w,setNodeRef:Y,setActivatorNodeRef:K,transform:L}}function $b(){return v.useContext(Hb)}const D2="Droppable",C2={timeout:25};function A2(t){let{data:a,disabled:l=!1,id:i,resizeObserverConfig:u}=t;const o=zu(D2),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Uu),x=v.useRef({disabled:l}),b=v.useRef(!1),w=v.useRef(null),S=v.useRef(null),{disabled:N,updateMeasurementsFor:A,timeout:j}={...C2,...u},L=wu(A??i),I=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},j)},[j]),Y=Ic({callback:I,disabled:N||!f}),P=v.useCallback((T,oe)=>{Y&&(oe&&(Y.unobserve(oe),b.current=!1),T&&Y.observe(T))},[Y]),[K,W]=Sc(P),U=wu(a);return v.useEffect(()=>{!Y||!K.current||(Y.disconnect(),b.current=!1,Y.observe(K.current))},[K,Y]),v.useEffect(()=>(m({type:Un.RegisterDroppable,element:{id:i,key:o,disabled:l,node:K,rect:w,data:U}}),()=>m({type:Un.UnregisterDroppable,key:o,id:i})),[i]),v.useEffect(()=>{l!==x.current.disabled&&(m({type:Un.SetDroppableDisabled,id:i,key:o,disabled:l}),x.current.disabled=l)},[i,o,l,m]),{active:f,rect:w,isOver:(p==null?void 0:p.id)===i,node:K,over:p,setNodeRef:W}}function O2(t){let{animation:a,children:l}=t;const[i,u]=v.useState(null),[o,f]=v.useState(null),m=wc(l);return!l&&!i&&m&&u(m),rr(()=>{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]),sn.createElement(sn.Fragment,null,l,i?v.cloneElement(i,{ref:f}):null)}const M2={x:0,y:0,scaleX:1,scaleY:1};function k2(t){let{children:a}=t;return sn.createElement(Uu.Provider,{value:Ub},sn.createElement(Gc.Provider,{value:M2},a))}const _2={position:"fixed",touchAction:"none"},L2=t=>Fc(t)?"transform 250ms ease":void 0,z2=v.forwardRef((t,a)=>{let{as:l,activatorEvent:i,adjustScale:u,children:o,className:f,rect:m,style:p,transform:g,transition:x=L2}=t;if(!m)return null;const b=u?g:{...g,scaleX:1,scaleY:1},w={..._2,width:m.width,height:m.height,top:m.top,left:m.left,transform:Ml.Transform.toString(b),transformOrigin:u&&i?jR(i,m):void 0,transition:typeof x=="function"?x(i):x,...p};return sn.createElement(l,{className:f,style:w,ref:a},o)}),U2=t=>a=>{let{active:l,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]=l.node.style.getPropertyValue(m),l.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&&l.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[p,g]of Object.entries(u))l.node.style.setProperty(p,g);f!=null&&f.active&&l.node.classList.remove(f.active)}},H2=t=>{let{transform:{initial:a,final:l}}=t;return[{transform:Ml.Transform.toString(a)},{transform:Ml.Transform.toString(l)}]},B2={duration:250,easing:"ease",keyframes:H2,sideEffects:U2({styles:{active:{opacity:"0"}}})};function $2(t){let{config:a,draggableNodes:l,droppableContainers:i,measuringConfiguration:u}=t;return Vc((o,f)=>{if(a===null)return;const m=l.get(o);if(!m)return;const p=m.node.current;if(!p)return;const g=zb(f);if(!g)return;const{transform:x}=da(f).getComputedStyle(f),b=Rb(x);if(!b)return;const w=typeof a=="function"?a:q2(a);return Mb(p,u.draggable.measure),w({active:{id:o,data:m.data,node:p,rect:u.draggable.measure(p)},draggableNodes:l,dragOverlay:{node:f,rect:u.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:u,transform:b})})}function q2(t){const{duration:a,easing:l,sideEffects:i,keyframes:u}={...B2,...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},w={x:p.x-x.x,y:p.y-x.y,...b},S=u({...g,active:f,dragOverlay:m,transform:{initial:p,final:w}}),[N]=S,A=S[S.length-1];if(JSON.stringify(N)===JSON.stringify(A))return;const j=i==null?void 0:i({active:f,dragOverlay:m,...g}),L=m.node.animate(S,{duration:a,easing:l,fill:"forwards"});return new Promise(I=>{L.onfinish=()=>{j==null||j(),I()}})}}let Zy=0;function Y2(t){return v.useMemo(()=>{if(t!=null)return Zy++,Zy},[t])}const V2=sn.memo(t=>{let{adjustScale:a=!1,children:l,dropAnimation:i,style:u,transition:o,modifiers:f,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:b,activeNodeRect:w,containerNodeRect:S,draggableNodes:N,droppableContainers:A,dragOverlay:j,over:L,measuringConfiguration:I,scrollableAncestors:Y,scrollableAncestorRects:P,windowRect:K}=$b(),W=v.useContext(Gc),U=Y2(b==null?void 0:b.id),T=Bb(f,{activatorEvent:x,active:b,activeNodeRect:w,containerNodeRect:S,draggingNodeRect:j.rect,over:L,overlayNodeRect:j.rect,scrollableAncestors:Y,scrollableAncestorRects:P,transform:W,windowRect:K}),oe=cm(w),me=$2({config:i,draggableNodes:N,droppableContainers:A,measuringConfiguration:I}),ye=oe?j.setRef:void 0;return sn.createElement(k2,null,sn.createElement(O2,{animation:me},b&&U?sn.createElement(z2,{key:U,id:b.id,ref:ye,as:m,activatorEvent:x,adjustScale:a,className:p,transition:o,rect:oe,style:{zIndex:g,...u},transform:T},l):null))});function yu(t,a,l){const i=t.slice();return i.splice(l<0?i.length+l:l,0,i.splice(a,1)[0]),i}function F2(t,a){return t.reduce((l,i,u)=>{const o=a.get(i);return o&&(l[u]=o),l},Array(t.length))}function nc(t){return t!==null&&t>=0}function I2(t,a){if(t===a)return!0;if(t.length!==a.length)return!1;for(let l=0;l<t.length;l++)if(t[l]!==a[l])return!1;return!0}function G2(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const qb=t=>{let{rects:a,activeIndex:l,overIndex:i,index:u}=t;const o=yu(a,i,l),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}},ac={scaleX:1,scaleY:1},dm=t=>{var a;let{activeIndex:l,activeNodeRect:i,index:u,rects:o,overIndex:f}=t;const m=(a=o[l])!=null?a:i;if(!m)return null;if(u===l){const g=o[f];return g?{x:0,y:l<f?g.top+g.height-(m.top+m.height):g.top-m.top,...ac}:null}const p=X2(o,u,l);return u>l&&u<=f?{x:0,y:-m.height-p,...ac}:u<l&&u>=f?{x:0,y:m.height+p,...ac}:{x:0,y:0,...ac}};function X2(t,a,l){const i=t[a],u=t[a-1],o=t[a+1];return i?l<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 Yb="Sortable",Vb=sn.createContext({activeIndex:-1,containerId:Yb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qb,disabled:{draggable:!1,droppable:!1}});function fm(t){let{children:a,id:l,items:i,strategy:u=qb,disabled:o=!1}=t;const{active:f,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=$b(),b=zu(Yb,l),w=m.rect!==null,S=v.useMemo(()=>i.map(W=>typeof W=="object"&&"id"in W?W.id:W),[i]),N=f!=null,A=f?S.indexOf(f.id):-1,j=g?S.indexOf(g.id):-1,L=v.useRef(S),I=!I2(S,L.current),Y=j!==-1&&A===-1||I,P=G2(o);rr(()=>{I&&N&&x(S)},[I,S,N,x]),v.useEffect(()=>{L.current=S},[S]);const K=v.useMemo(()=>({activeIndex:A,containerId:b,disabled:P,disableTransforms:Y,items:S,overIndex:j,useDragOverlay:w,sortedRects:F2(S,p),strategy:u}),[A,b,P.draggable,P.droppable,Y,S,j,p,w,u]);return sn.createElement(Vb.Provider,{value:K},a)}const P2=t=>{let{id:a,items:l,activeIndex:i,overIndex:u}=t;return yu(l,i,u).indexOf(a)},Q2=t=>{let{containerId:a,isSorting:l,wasDragging:i,index:u,items:o,newIndex:f,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!i||m!==o&&u===f?!1:l?!0:f!==u&&a===p},K2={duration:200,easing:"ease"},Fb="transform",Z2=Ml.Transition.toString({property:Fb,duration:0,easing:"linear"}),J2={roleDescription:"sortable"};function W2(t){let{disabled:a,index:l,node:i,rect:u}=t;const[o,f]=v.useState(null),m=v.useRef(l);return rr(()=>{if(!a&&l!==m.current&&i.current){const p=u.current;if(p){const g=ci(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)}}l!==m.current&&(m.current=l)},[a,l,i,u]),v.useEffect(()=>{o&&f(null)},[o]),o}function ej(t){let{animateLayoutChanges:a=Q2,attributes:l,disabled:i,data:u,getNewIndex:o=P2,id:f,strategy:m,resizeObserverConfig:p,transition:g=K2}=t;const{items:x,containerId:b,activeIndex:w,disabled:S,disableTransforms:N,sortedRects:A,overIndex:j,useDragOverlay:L,strategy:I}=v.useContext(Vb),Y=tj(i,S),P=x.indexOf(f),K=v.useMemo(()=>({sortable:{containerId:b,index:P,items:x},...u}),[b,u,P,x]),W=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:U,node:T,isOver:oe,setNodeRef:me}=A2({id:f,data:K,disabled:Y.droppable,resizeObserverConfig:{updateMeasurementsFor:W,...p}}),{active:ye,activatorEvent:Re,activeNodeRect:ee,attributes:be,setNodeRef:Ee,listeners:z,isDragging:H,over:ie,setActivatorNodeRef:ce,transform:pe}=T2({id:f,data:K,attributes:{...J2,...l},disabled:Y.draggable}),D=oR(me,Ee),$=!!ye,ne=$&&!N&&nc(w)&&nc(j),de=!L&&H,je=de&&ne?pe:null,Ue=ne?je??(m??I)({rects:A,activeNodeRect:ee,activeIndex:w,overIndex:j,index:P}):null,it=nc(w)&&nc(j)?o({id:f,items:x,activeIndex:w,overIndex:j}):P,Ge=ye==null?void 0:ye.id,nt=v.useRef({activeId:Ge,items:x,newIndex:it,containerId:b}),vn=x!==nt.current.items,Rt=a({active:ye,containerId:b,isDragging:H,isSorting:$,id:f,index:P,items:x,newIndex:nt.current.newIndex,previousItems:nt.current.items,previousContainerId:nt.current.containerId,transition:g,wasDragging:nt.current.activeId!=null}),ut=W2({disabled:!Rt,index:P,node:T,rect:U});return v.useEffect(()=>{$&&nt.current.newIndex!==it&&(nt.current.newIndex=it),b!==nt.current.containerId&&(nt.current.containerId=b),x!==nt.current.items&&(nt.current.items=x)},[$,it,b,x]),v.useEffect(()=>{if(Ge===nt.current.activeId)return;if(Ge!=null&&nt.current.activeId==null){nt.current.activeId=Ge;return}const Ye=setTimeout(()=>{nt.current.activeId=Ge},50);return()=>clearTimeout(Ye)},[Ge]),{active:ye,activeIndex:w,attributes:be,data:K,rect:U,index:P,newIndex:it,items:x,isOver:oe,isSorting:$,isDragging:H,listeners:z,node:T,overIndex:j,over:ie,setNodeRef:D,setActivatorNodeRef:ce,setDroppableNodeRef:me,setDraggableNodeRef:Ee,transform:ut??Ue,transition:le()};function le(){if(ut||vn&&nt.current.newIndex===P)return Z2;if(!(de&&!Fc(Re)||!g)&&($||Rt))return Ml.Transition.toString({...g,property:Fb})}}function tj(t,a){var l,i;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(l=t==null?void 0:t.draggable)!=null?l:a.draggable,droppable:(i=t==null?void 0:t.droppable)!=null?i:a.droppable}}Ot.Down,Ot.Right,Ot.Up,Ot.Left;const Xc=[{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"}],Pc=[{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"}],Hu=[{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"}],iu=Xc.map(t=>t.value),uu=Pc.map(t=>t.value),ou=Hu.map(t=>t.value);function fh(t,a,l){if(t.includes(a)){const i=t.filter(u=>u!==a);return i.length===0?[...l]:i}return[...t,a]}function Fs(t,a){return a.includes(t)}function yr(t,a){return`agent-plan:dashboard:${t}:${a}`}function hh(t,a,l){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=l.slice().sort().join(",");if(window.localStorage.getItem(o)!==f)return window.localStorage.setItem(o,f),a;const p=u.filter(g=>typeof g=="string"&&l.includes(g));return p.length>0?p:a}catch{return a}}function mh(t,a,l){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,l.slice().sort().join(",")))}function ph(t,a){if(typeof window>"u")return a;const l=window.localStorage.getItem(t);return l===null?a:l==="true"}const Jy={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Wy=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function Ib(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function nj(t){return new Set(Ib(t).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function ex(t){const a=t.toUpperCase();return a==="AND"||a==="OR"}function gh(t,a){const l=t??new Set;for(const i of nj(a))l.add(i);return l}function aj(t,a){const l=t??new Set;for(const i of Ib(a).map(u=>u.toUpperCase()))l.add(i);return l}function rj(t){const a=t.trim();if(!a)return{...Jy};const l={...Jy},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(ex(m)){f+=1;continue}const p=m.match(Wy);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&&ex(u[b]);)b+=1;b<u.length&&!u[b].match(Wy)&&(x=u[b],f=b)}if(g==="feature"){const b=gh(l.featureNumbers,x);b.size&&(l.featureNumbers=b)}else if(g==="phase"){const b=gh(l.phaseNumbers,x);b.size&&(l.phaseNumbers=b)}else if(g==="task"){const b=gh(l.taskNumbers,x);b.size&&(l.taskNumbers=b)}else if(g==="id"){const b=aj(l.shortIds,x);b.size&&(l.shortIds=b)}else g==="status"?x.trim()&&(l.status=x.toLowerCase()):g==="feature-status"?x.trim()&&(l.featureStatus=x.toLowerCase()):g==="phase-status"?x.trim()&&(l.phaseStatus=x.toLowerCase()):g==="title"&&x.trim()&&(l.text=x.toLowerCase())}else i.push(m.toLowerCase());f+=1}return i.length>0&&!l.text&&(l.text=i.join(" ")),l}function lj(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function Gb(t){const a=l=>String(l).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 sj(t,a,l){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(!(l??Gb(a)).includes(i))return!1}return!0}function ij({features:t,phases:a,projectStorageScope:l}){const i=yr(l,"show-all-features"),u=yr(l,"tree-open-mode"),o=yr(l,"expanded-features"),f=yr(l,"expanded-phases"),m=yr(l,"feature-status-filters"),p=yr(l,"phase-status-filters"),g=yr(l,"task-status-filters"),x=yr(l,"hide-done"),b=yr(l,"hide-planned"),w=yr(l,"only-active-branches"),[S,N]=v.useState(""),A=v.useMemo(()=>iR(t,a),[t,a]),j=v.useMemo(()=>rj(S),[S]),L=lj(j),I=v.useMemo(()=>{if(!L||!j.text)return null;const fe=new Map;for(const Le of A)for(const Me of Le.allPhases)for(const qe of Me.allTasks)fe.set(qe.id,Gb({feature:Le.feature,phase:Me.phase,task:qe}));return fe},[L,j.text,A]),{matchedTaskIds:Y,matchedFeatureIds:P,matchedPhaseIds:K}=v.useMemo(()=>{const fe=new Set,Le=new Set,Me=new Set;if(!L)return{matchedTaskIds:fe,matchedFeatureIds:Le,matchedPhaseIds:Me};for(const qe of A)for(const Ze of qe.allPhases)for(const pt of Ze.allTasks)sj(j,{feature:qe.feature,phase:Ze.phase,task:pt},I==null?void 0:I.get(pt.id))&&(fe.add(pt.id),Le.add(qe.feature.id),Me.add(Ze.phase.id));return{matchedTaskIds:fe,matchedFeatureIds:Le,matchedPhaseIds:Me}},[L,j,A,I]),[W,U]=v.useState(()=>{if(typeof window>"u")return!0;const fe=window.localStorage.getItem(i);return fe===null?!0:fe==="true"}),[T,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(()=>hh(m,iu,iu)),[z,H]=v.useState(()=>hh(p,uu,uu)),[ie,ce]=v.useState(()=>hh(g,ou,ou)),[pe,D]=v.useState(()=>ph(x,!1)),[$,ne]=v.useState(()=>ph(b,!1)),[de,je]=v.useState(()=>ph(w,!1)),[Ne,Ue]=v.useState([]),[it,Ge]=v.useState([]),[nt,vn]=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,T)},[T,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"||mh(m,be,iu)},[be,m]),v.useEffect(()=>{typeof window>"u"||mh(p,z,uu)},[z,p]),v.useEffect(()=>{typeof window>"u"||mh(g,ie,ou)},[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($))},[$,b]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(w,String(de))},[de,w]),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")),$&&(fe=fe.filter(Le=>Le!=="planned")),fe},[be,pe,$]),le=v.useMemo(()=>{let fe=[...z];return pe&&(fe=fe.filter(Le=>Le!=="done")),$&&(fe=fe.filter(Le=>Le!=="planned"&&Le!=="draft")),fe},[z,pe,$]),Ye=v.useMemo(()=>{let fe=[...ie];return pe&&(fe=fe.filter(Le=>Le!=="done")),$&&(fe=fe.filter(Le=>Le!=="planned")),fe},[ie,pe,$]),Ie=v.useMemo(()=>{if(L)return A.filter(Me=>Fs(Me.feature.status,ut)).map(Me=>({...Me,allPhases:Me.allPhases.filter(qe=>Fs(qe.phase.status,le)).map(qe=>({...qe,allTasks:qe.allTasks.filter(Ze=>Y.has(Ze.id)&&Fs(Ze.status,Ye))})).filter(qe=>qe.allTasks.length>0)})).filter(Me=>Me.allPhases.length>0);const fe=!W||de;return(W?A:A.filter(Me=>Me.isActive)).filter(({feature:Me})=>Fs(Me.status,ut)).map(Me=>({...Me,allPhases:Me.allPhases.filter(({phase:qe,hasActiveTask:Ze})=>Fs(qe.status,le)?fe?qe.status==="in-progress"||qe.status==="discovery"||Ze:!0:!1).map(qe=>({...qe,allTasks:qe.allTasks.filter(Ze=>!!Fs(Ze.status,Ye))})).filter(qe=>qe.allTasks.length>0||W||!fe)})).filter(({hasActiveTask:Me,allPhases:qe})=>fe?Me||qe.some(Ze=>Ze.hasActiveTask):qe.length>0||W)},[L,Y,A,ut,le,Ye,de,W]);v.useEffect(()=>{if(T==="none"){ye([]),ee([]);return}if(T==="all"){ye(Ie.filter(({feature:Me})=>Me.status!=="done").map(({feature:Me})=>Me.id)),ee(Ie.flatMap(({allPhases:Me})=>Me.map(({phase:qe})=>qe.id)));return}const fe=new Set(Ie.map(({feature:Me})=>Me.id)),Le=new Set(Ie.flatMap(({allPhases:Me})=>Me.map(({phase:qe})=>qe.id)));ye(Me=>Me.filter(qe=>fe.has(qe))),ee(Me=>Me.filter(qe=>Le.has(qe)))},[Ie,T]),v.useEffect(()=>{L&&(oe("smart"),ye(Array.from(P)),ee(Array.from(K)))},[L,P,K]);const Gt=fe=>{oe("smart"),ye(Le=>Le.includes(fe)?Le.filter(Me=>Me!==fe):[...Le,fe])},An=fe=>{oe("smart"),ee(Le=>Le.includes(fe)?Le.filter(Me=>Me!==fe):[...Le,fe])},fn=()=>{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=(Me,qe)=>{const Ze=qe.filter(pt=>!!pt);for(const pt of Ze){const Xt=`${Me}:${pt}`,rn=Me==="feature"?Ue:Me==="phase"?Ge:vn;rn(Bn=>Bn.includes(pt)?Bn:[...Bn,pt]),Rt.current[Xt]!==void 0&&window.clearTimeout(Rt.current[Xt]),Rt.current[Xt]=window.setTimeout(()=>{rn(Bn=>Bn.filter(un=>un!==pt)),delete Rt.current[Xt]},aR)}},Le=Me=>{var pt,Xt,rn,Bn,un,se;const Ze=Me.detail;if(Ze!=null&&Ze.type){if(Ze.type==="features-updated"){const St=((pt=Ze.data)==null?void 0:pt.featureId)??((Xt=Ze.data)==null?void 0:Xt.id);fe("feature",[St]),St&&(oe("smart"),ye(Mt=>Mt.includes(St)?Mt:[...Mt,St]));return}if(Ze.type==="phases-updated"){const St=(rn=Ze.data)==null?void 0:rn.featureId,Mt=((Bn=Ze.data)==null?void 0:Bn.phaseId)??((un=Ze.data)==null?void 0:un.id);fe("phase",[Mt]),fe("feature",[St]),fe("task",[(se=Ze.data)==null?void 0:se.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:A,displayedWorkTree:Ie,treeOpenMode:T,setTreeOpenMode:oe,expandAll:fn,expandedFeatureIds:me,expandedPhaseIds:Re,setExpandedFeatureIds:ye,setExpandedPhaseIds:ee,toggleExpandedFeature:Gt,toggleExpandedPhase:An,recentFeatureIds:Ne,recentPhaseIds:it,recentTaskIds:nt,setRecentTaskIds:vn,showAllFeatures:W,setShowAllFeatures:U,featureStatusFilters:be,phaseStatusFilters:z,taskStatusFilters:ie,hideDone:pe,setHideDone:D,hidePlanned:$,setHidePlanned:ne,onlyActiveBranches:de,setOnlyActiveBranches:je,resetFilters:()=>{N(""),U(!0),D(!1),ne(!1),Ee(iu),H(uu),ce(ou),je(!1),oe("all")},toggleFeatureStatusFilter:fe=>Ee(Le=>fh(Le,fe,iu)),togglePhaseStatusFilter:fe=>H(Le=>fh(Le,fe,uu)),toggleTaskStatusFilter:fe=>ce(Le=>fh(Le,fe,ou)),searchQuery:S,setSearchQuery:N,searchActive:L,matchedTaskIds:Y,matchedFeatureIds:P,matchedPhaseIds:K}}const Xb=v.createContext(null);function hm({id:t,children:a}){const l=ej({id:t}),i={transform:Ml.Transform.toString(l.transform),transition:l.transition};return d.jsx(Xb.Provider,{value:l,children:d.jsx("div",{ref:l.setNodeRef,style:i,className:l.isDragging?"ap-sortable--dragging":"",children:a})})}function mm(){const t=v.useContext(Xb);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(FE,{className:"h-4 w-4"})}):null}const pm="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function uj(){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 ri({status:t,doneTasks:a,totalTasks:l,recentlyChanged:i,className:u}){const o=a!=null&&l!=null;return d.jsxs("div",{className:u,children:[i?d.jsx(uj,{}):null,o?d.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",l||0,")"]}):null,d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:t})})]})}function oj({entry:t,expanded:a,recentlyChanged:l,onToggle:i,isPhaseExpanded:u,onTogglePhase:o,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:m,highlightedTaskIds:p}){const{feature:g,totalTasks:x,doneTasks:b,allPhases:w,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)]":""} ${l?"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 ${l?"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(ub,{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(mm,{}),d.jsx(zl,{id:si({featureNum:g.number}),children:d.jsx(Wr,{featureNum:g.number})}),g.shortId?d.jsx(ii,{shortId:g.shortId}):null,S?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ri,{status:g.status,doneTasks:b,totalTasks:x,recentlyChanged:l,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(dt,{to:`/features/${g.id}`,className:`entity-link--feature ${pm} underline-offset-4 hover:underline`,children:g.name})]})]}),d.jsx(ri,{status:g.status,doneTasks:b,totalTasks:x,recentlyChanged:l,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&w.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(fm,{items:w.map(N=>N.phase.id),strategy:dm,children:w.map(N=>d.jsx(hm,{id:N.phase.id,children:d.jsx(cj,{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 cj({feature:t,phaseEntry:a,expanded:l,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":l?`Collapse phase ${m.title}`:`Expand phase ${m.title}`,"aria-expanded":l,children:d.jsx(ub,{className:`h-4 w-4 transition ${l?"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(mm,{}),d.jsx(zl,{id:si({featureNum:t==null?void 0:t.number,phaseNum:m.number}),children:d.jsx(Wr,{featureNum:t==null?void 0:t.number,phaseNum:m.number})}),m.shortId?d.jsx(ii,{shortId:m.shortId}):null,m.handoff?d.jsx(am,{phaseId:m.id,updatedAt:m.handoffUpdatedAt}):null,b?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ri,{status:m.status,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(dt,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${pm} underline-offset-4 hover:underline`,children:m.title})]})]}),d.jsx(ri,{status:m.status,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),l?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(fm,{items:x.map(w=>w.id),strategy:dm,children:x.map(w=>d.jsx(hm,{id:w.id,children:d.jsx(dj,{feature:t,phase:m,task:w,recentlyChanged:o(w.id),highlighted:f==null?void 0:f.has(w.id)})},w.id))})}):d.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function dj({feature:t,phase:a,task:l,recentlyChanged:i,highlighted:u}){return d.jsxs("div",{id:`task-row-${l.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 ${l.status==="in-progress"?"ap-in-progress":""} ${l.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(mm,{}),d.jsx(zl,{id:si({featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number}),children:d.jsx(Wr,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number})}),l.shortId?d.jsx(ii,{shortId:l.shortId}):null,l.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ri,{status:l.status,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(dt,{to:`/features/${t.id}/phases/${a.id}/tasks/${l.id}`,className:`entity-link--task ${pm} underline-offset-4 hover:underline`,children:l.title})]}),d.jsx(ri,{status:l.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||{}),Js=class{constructor(t,a){pn(this,"input");pn(this,"pos");pn(this,"state");pn(this,"tokens");pn(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===`
|
|
248
|
-
`||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 l=this.advance();if(l==="\\"&&this.pos<this.input.length)this.advance();else if(l===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 l=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(l,this.pos),start:l,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 l=this.peekAt(1);if(l&&(this.isAlpha(l)||l==='"'||l==="("||l==="#"||l==="!"||l==="["||l==="{")||!l||l===")"||l===" "||l===" "||l===`
|
|
249
|
-
`||l==="\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 l=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:M.COMPARISON_OP,value:this.input.slice(l,this.pos),start:l,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 l=this.input.slice(a,this.pos),i=l.toUpperCase();i==="AND"?this.tokens.push({type:M.AND,value:l,start:a,end:this.pos}):i==="OR"?this.tokens.push({type:M.OR,value:l,start:a,end:this.pos}):i==="NOT"?this.tokens.push({type:M.NOT,value:l,start:a,end:this.pos}):l.includes("*")||l.includes("?")?this.tokens.push({type:M.WILDCARD,value:l,start:a,end:this.pos}):this.tokens.push({type:M.VALUE,value:l,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 l=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:M.COMPARISON_OP,value:this.input.slice(l,this.pos),start:l,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 l=this.input.slice(a,this.pos);l.includes("*")||l.includes("?")?this.tokens.push({type:M.WILDCARD,value:l,start:a,end:this.pos}):this.tokens.push({type:M.VALUE,value:l,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})}},ss=class{constructor(t){pn(this,"tokens");pn(this,"pos");pn(this,"nonWsTokens");pn(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 l=a[0];return a[a.length-1]!==l}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 l=this.parseOr();t={type:"BooleanExpr",operator:"AND",left:t,right:l,implicit:!0,start:t.start,end:l.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 l=this.advance(),i=this.parseAnd();if(i.type==="Error"&&i.value===""){this.errors.push({type:"Error",value:l.value,message:"Missing search term after OR",start:l.start,end:l.end});break}t={type:"BooleanExpr",operator:"OR",left:t,right:i,sourceOperator:l.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 l=this.advance(),i=this.parseNot();if(i.type==="Error"&&i.value===""){this.errors.push({type:"Error",value:l.value,message:"Missing search term after AND",start:l.start,end:l.end});break}t={type:"BooleanExpr",operator:"AND",left:t,right:i,sourceOperator:l.value,start:t.start,end:i.end}}else{if(a.type===M.OR||a.type===M.RPAREN)break;{const l=this.parseNot();t={type:"BooleanExpr",operator:"AND",left:t,right:l,implicit:!0,start:t.start,end:l.end}}}}return t}parseNot(){var t;if(((t=this.peek())==null?void 0:t.type)===M.NOT){const a=this.advance(),l=this.parsePrimary();return l.type==="Error"&&l.value===""?(this.errors.push({type:"Error",value:a.value,message:"Missing search term after NOT",start:a.start,end:a.end}),l):{type:"Not",expression:l,sourceOperator:a.value,start:a.start,end:l.end}}return this.parsePrimary()}applyGroupBoost(t){var a;if(((a=this.peek())==null?void 0:a.type)===M.BOOST){const l=this.advance(),i=l.value.slice(1),u=parseFloat(i);t.boost=isNaN(u)?1:u,t.end=l.end}return t}applyModifiers(t){var a,l;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(((l=this.peek())==null?void 0:l.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 l=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+l,valueEnd:a+l+i.length}:i.startsWith('"')?{value:i.slice(1),quoted:!0,valueStart:a+l,valueEnd:a+l+i.length}:{value:i,quoted:!1,valueStart:a+l,valueEnd:a+l+i.length}}parseRange(t){const a=t.value,l=a[0],i=l==="[",u=a[a.length-1],o=u==="]"||u==="}",f=u==="]";o||this.errors.push({type:"Error",value:l,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),w=this.parseRangeBound(p[2],b);return{type:"Range",lower:x.value,upper:w.value,lowerInclusive:i,upperInclusive:o?f:!0,lowerQuoted:x.quoted,upperQuoted:w.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:w.valueStart,upperEnd:w.valueEnd,start:t.start,end:t.end}}parsePrimary(){var l,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),((l=this.peek())==null?void 0:l.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 A={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(A)}const b=this.parseOr(),w=this.match(M.RPAREN);w||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:w?w.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 w=b?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:o.value,operator:m,value:w,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 l,i;for(const o of t)if(o.type!==M.WHITESPACE){if(a>=o.start&&a<=o.end){l=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((l==null?void 0:l.type)===M.COLON){let o="";const f=t.indexOf(l);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===l.start)return{type:"FIELD_NAME",partial:"",token:l};if(a===l.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((l==null?void 0:l.type)===M.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===M.HISTORY_REF)return{type:"HISTORY_REF",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===M.RANGE){const o=t.indexOf(l);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:l}}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 l&&(l.type===M.VALUE||l.type===M.QUOTED_VALUE||l.type===M.WILDCARD)?{type:"FIELD_VALUE",partial:l.type===M.QUOTED_VALUE?l.value.slice(1,l.value.endsWith('"')||l.value.endsWith("'")?-1:void 0):l.value,fieldName:f,token:l}:{type:"FIELD_VALUE",partial:"",fieldName:f,token:i}}if((l==null?void 0:l.type)===M.VALUE||(l==null?void 0:l.type)===M.QUOTED_VALUE||(l==null?void 0:l.type)===M.WILDCARD){const o=t.indexOf(l);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:l.type===M.QUOTED_VALUE?l.value.slice(1,l.value.endsWith('"')||l.value.endsWith("'")?-1:void 0):l.value,fieldName:m,token:l}}break}}if((l==null?void 0:l.type)===M.QUOTED_VALUE)return{type:"FIELD_NAME",partial:l.value,token:l};if((l==null?void 0:l.type)===M.FIELD_NAME||(l==null?void 0:l.type)===M.VALUE){const o=u(t.indexOf(l));return o?{type:"FIELD_VALUE",partial:l.value,fieldName:o,token:l}:{type:"FIELD_NAME",partial:l.value,token:l}}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((l==null?void 0:l.type)===M.LPAREN||(i==null?void 0:i.type)===M.LPAREN){const o=(l==null?void 0:l.type)===M.LPAREN?l: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((l==null?void 0:l.type)===M.TILDE||(l==null?void 0:l.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 _h(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const l=_h(t.left,a);if(l)return l;const i=_h(t.right,a);return i||null}return t}function fj(t,a,l){if(!t)return null;const i=_h(t,l);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 hj={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:{}},mj={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"},pj=["AND","OR","NOT"];function tx(t){return t.replace(/\r\n/g,`
|
|
250
|
-
`).replace(/\r/g,`
|
|
251
|
-
`).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 nx={"(":")","[":"]",'"':'"',"'":"'"};function gj(t,a,l,i,u){const o=t.slice(0,a),f=t.slice(a,l),m=t.slice(l);return{newValue:o+i+f+u+m,newCursorPos:l+2,newSelStart:a+1,newSelEnd:l+1}}function vj(t){if(!t.textContent)return"";const a=[];function l(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(`
|
|
252
|
-
`);else for(let o=0;o<i.childNodes.length;o++)l(i.childNodes[o])}return l(t),a.join("")}function ax(t,a,l){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&&l>=f.start&&l<=f.end&&(u=o)}return[i,u]}function yj(t,a,l){if(t){let i=t.end;if(t.type===M.FIELD_NAME&&l){const u=l.indexOf(t);if(u>=0){for(let o=u+1;o<l.length;o++)if(l[o].type!==M.WHITESPACE){l[o].type===M.COLON&&(i=l[o].end);break}}}return{start:t.start,end:i}}return{start:a,end:a}}var vh=class Pb{constructor(a,l=[],i=[],u=10,o={}){pn(this,"fields");pn(this,"fieldMap");pn(this,"savedSearches");pn(this,"searchHistory");pn(this,"maxSuggestions");pn(this,"options");pn(this,"defaultFieldName");pn(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=l,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,l){let i=ss.getCursorContext(a,l);const u=yj(i.token,l,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,l,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:l,replaceEnd:i,matchPartial:a,priority:10}))}getValueSuggestions(a,l,i,u){if(!a)return[];if(a.type==="boolean")return["true","false"].filter(o=>o.startsWith(l.toLowerCase())).map(o=>({text:o,label:o,type:"boolean",replaceStart:i,replaceEnd:u,matchPartial:l}));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,l,i){const u=a.toLowerCase();return pj.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:l,replaceEnd:i,matchPartial:a,priority:30}))}sortByPriority(a){return a.sort((l,i)=>(i.priority??0)-(l.priority??0))}getSpecialHints(a,l){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:l,priority:20}),this.options.showHistoryHint&&o&&i.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:a,replaceEnd:l,priority:20}),i}getSavedSearchSuggestions(a,l,i){return this.savedSearches.slice(0,this.maxSuggestions).map(u=>({text:u.query,label:u.label||u.query,description:u.description,type:"savedSearch",replaceStart:l,replaceEnd:i,matchPartial:a,sourceData:u}))}getHistorySuggestions(a,l,i){return this.searchHistory.slice(0,this.maxSuggestions).map(u=>({text:Pb.wrapHistoryQuery(u.query),label:u.label||u.query,description:u.description,type:"history",replaceStart:l,replaceEnd:i,matchPartial:a,sourceData:u}))}static wrapHistoryQuery(a){try{const l=new ss(new Js(a).tokenize()).parse();if(l&&l.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function rc(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var xj=[/^\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 bj(t){for(const a of xj)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function yh(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function Sj(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 l=t.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/);if(l)return new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10));const i=new Date(t);return isNaN(i.getTime())?null:i}function rx(t,a){return new Date(t,a+1,0).getDate()}function wj(t,a){return new Date(t,a,1).getDay()}function cu(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function lx(t,a,l){if(!a||!l)return!1;const i=t.getTime(),u=a.getTime(),o=l.getTime();return i>=Math.min(u,o)&&i<=Math.max(u,o)}var Ej=["January","February","March","April","May","June","July","August","September","October","November","December"];function Nj(t){return Ej[t]}function lc(t,a){if(t==="")return null;const l=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(l){const i=xh(l[1].trim(),a);if(i)return`Range start: ${i}`;const u=xh(l[2].trim(),a);return u?`Range end: ${u}`:null}return xh(t,a)}function xh(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||bj(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function sc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var ic={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function uc(t){if(t.length<=1)return t;const a=[...t].sort((i,u)=>{const o=ic[i.type??"SYNTAX_ERROR"],f=ic[u.type??"SYNTAX_ERROR"];return o!==f?o-f:i.start-u.start}),l=[];for(const i of a)l.some(u=>ic[u.type??"SYNTAX_ERROR"]<ic[i.type??"SYNTAX_ERROR"]&&u.start<=i.start&&u.end>=i.end)||l.push(i);return l}var sx=class{constructor(t){pn(this,"fields");this.fields=new Map(t.map(a=>[a.name,a]));for(const a of t)if(a.aliases)for(const l of a.aliases)this.fields.set(l,a)}validate(t,a,l,i){if(!t)return[];const u=[],o=i?this.fields.get(i):void 0;return this.walkNode(t,u,a,l,o),this.checkAmbiguousPrecedence(t,u),u}walkNode(t,a,l,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=rc(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(l&&t.value!==""){const o=sc(l({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,l,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=rc(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&&l){const m=sc(l({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,l,i,u);else{const o=this.fields.get(t.field);o?this.walkFieldGroup(t.expression,o,a,l,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,l,i,u),this.walkNode(t.right,a,l,i,u);break;case"Group":this.walkNode(t.expression,a,l,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,l,i,u);break;case"Error":a.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,a,l,i,u){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(a,t.value,t.quoted,":",t.start,t.end,l,i,u);break;case"FieldValue":this.walkNode(t,l,i,u);break;case"Range":this.validateRangeBounds(a,t,l,i,u);break;case"BooleanExpr":this.walkFieldGroup(t.left,a,l,i,u),this.walkFieldGroup(t.right,a,l,i,u);break;case"Group":this.walkFieldGroup(t.expression,a,l,i,u);break;case"Not":this.walkFieldGroup(t.expression,a,l,i,u);break;default:this.walkNode(t,l,i,u);break}}validateFieldValue(t,a,l,i,u,o,f,m,p){let g=null;switch(t.type){case"number":g=rc(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=sc(m({value:a,position:"field_group_term",fieldName:t.name,fieldConfig:t,quoted:l,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,l,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=rc(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=sc(i({value:f.value,position:f.position,fieldName:t.name,fieldConfig:t,quoted:!1,inclusive:f.inclusive}));p&&l.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";l.push({message:m,start:f.start,end:f.end,field:t.name,type:p})}}}checkAmbiguousPrecedence(t,a){const l=new Set;this.findAndFlagAmbiguity(t,a,l)}findAndFlagAmbiguity(t,a,l){if(t.type==="BooleanExpr"&&!l.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=>l.add(o))),this.collectLeaves(t).forEach(o=>this.findAndFlagAmbiguity(o,a,l))}else t.type==="Group"||t.type==="FieldGroup"?this.findAndFlagAmbiguity(t.expression,a,l):t.type==="Not"?this.findAndFlagAmbiguity(t.expression,a,l):t.type==="BooleanExpr"&&this.collectLeaves(t).forEach(i=>this.findAndFlagAmbiguity(i,a,l))}collectBoolOps(t,a,l){t.type==="BooleanExpr"&&(a.add(t.operator),l.push(t),this.collectBoolOps(t.left,a,l),this.collectBoolOps(t.right,a,l))}collectLeaves(t){return t.type!=="BooleanExpr"?[t]:[...this.collectLeaves(t.left),...this.collectLeaves(t.right)]}};function Ma(...t){return t.filter(Boolean).join(" ")}function Bu(t){return{...hj,...t}}function $u(t){return{...mj,...t}}function Rj(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function jj(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 Tj(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function Dj(t,a){const l=a.inputPadding.split(/\s+/),i=l[0]||"8px";return{position:"absolute",top:i,left:l.length>=4?l[3]:l.length>=2?l[1]:i,right:l.length>=4||l.length>=2?l[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 Qb(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 ix(t,a,l){return{padding:l.dropdownItemPadding,cursor:"pointer",fontSize:l.dropdownItemFontSize,fontFamily:l.fontFamily,backgroundColor:t?a.dropdownSelected:"transparent",color:t?"#ffffff":a.text,display:"flex",alignItems:"center",gap:l.dropdownItemContentGap,lineHeight:"1.4"}}function Is(t){return{flex:1,fontWeight:500}}function bh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function Cj(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 Aj(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 Oj={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function Mj(t){const a=[];let l=0,i="";function u(){i&&(a.push({type:"text",text:i}),i="")}t.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),l=1);const o=t.lastIndexOf("/"),f=o>0?o:t.length;for(;l<f;){const m=t[l];if(m==="\\"&&l+1<f){u(),a.push({type:"escape",text:t.slice(l,l+2)}),l+=2;continue}if(m==="["){u();let p=l+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(l,p)}),l=p;continue}if(m==="("){u();let p="(";if(l+1<f&&t[l+1]==="?"){let g=l+2;for(;g<f&&g<l+4&&/[:<>=!]/.test(t[g]);)g++;p=t.slice(l,g)}a.push({type:"groupOpen",text:p}),l+=p.length;continue}if(m===")"){u(),a.push({type:"groupClose",text:")"}),l++;continue}if(m==="+"||m==="*"||m==="?"){u();let p=m;l+1<f&&t[l+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),l+=p.length;continue}if(m==="{"){u();let p=l+1;for(;p<f&&t[p]!=="}";)p++;p<f&&p++,a.push({type:"quantifier",text:t.slice(l,p)}),l=p;continue}if(m==="^"||m==="$"){u(),a.push({type:"anchor",text:m}),l++;continue}if(m==="|"){u(),a.push({type:"alternation",text:"|"}),l++;continue}i+=m,l++}return u(),o>0&&o<t.length&&a.push({type:"delimiter",text:"/"}),a}function kj(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function _j(t,a,l){const i=Mj(t.value).map(u=>{const o=a[Oj[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}">${kj(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--regex${l?" "+l:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${i}</span>`}var Lj={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function zj(t){const a=[];let l=0;l<t.length&&(t[l]==="["||t[l]==="{")&&(a.push({type:"bracket",text:t[l]}),l++);const i=t.length-1,u=i>=0&&(t[i]==="]"||t[i]==="}"),o=u?i:t.length;for(;l<o;){const f=t[l];if(f===" "||f===" "){let p=l;for(;p<o&&(t[p]===" "||t[p]===" ");)p++;a.push({type:"whitespace",text:t.slice(l,p)}),l=p;continue}if((f==="T"||f==="t")&&l+1<o&&(t[l+1]==="O"||t[l+1]==="o")){const p=l===0||t[l-1]===" "||t[l-1]===" "||t[l-1]==="["||t[l-1]==="{",g=l+2>=o||t[l+2]===" "||t[l+2]===" ";if(p&&g){a.push({type:"toKeyword",text:t.slice(l,l+2)}),l+=2;continue}}if(f==='"'){let p=l+1;for(;p<o&&t[p]!=='"';)t[p]==="\\"&&p+1<o&&p++,p++;p<o&&p++,a.push({type:"quotedValue",text:t.slice(l,p)}),l=p;continue}if(f==="*"){a.push({type:"wildcard",text:"*"}),l++;continue}let m=l;for(;m<o&&t[m]!==" "&&t[m]!==" "&&t[m]!=='"';)m++;if(m>l){const p=t.slice(l,m);a.push({type:"bareValue",text:p}),l=m}else a.push({type:"bareValue",text:f}),l++}return u&&a.push({type:"bracket",text:t[i]}),a}function ux(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Uj(t,a,l){const i=zj(t.value).map(u=>{if(u.type==="whitespace")return ux(u.text);const o=a[Lj[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}">${ux(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--range${l?" "+l:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${i}</span>`}function Kb(t,a){if(a<0)return null;const l=t.filter(o=>o.type===M.LPAREN||o.type===M.RPAREN);if(l.length===0)return null;const i=l.find(o=>o.end===a);if(i){const o=ox(l,i);if(o)return o}const u=l.find(o=>o.start===a);if(u){const o=ox(l,u);if(o)return o}return null}function ox(t,a){if(a.type===M.LPAREN){const l=t.indexOf(a);let i=0;for(let u=l;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 l=t.indexOf(a);let i=0;for(let u=l;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 Hj={[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"},Bj={[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 Gs(t,a,l){const i=Bu(a);if(t.length===0)return"";const u=(l==null?void 0:l.cursorOffset)!==void 0?Kb(t,l.cursorOffset):null,o=a==null?void 0:a.valueTypes,f=l==null?void 0:l.fieldTypeMap;let m;if(o&&f){m=new Array(t.length);let g,x=!1;const b=[];for(let w=0;w<t.length;w++){const S=t[w];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[w]=f.get(g.toLowerCase()):b.length>0&&(m[w]=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[Bj[g.type]||"text"]||i.text;if(o&&m){const A=m[x];A&&o[A]&&(b=o[A])}const w=$j(g.value);if(g.type===M.WHITESPACE)return w.replace(/\n/g,"<br>");if(g.type===M.REGEX)return _j(g,i,l==null?void 0:l.tokenClassName);if(g.type===M.RANGE)return Uj(g,i,l==null?void 0:l.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--${Hj[g.type]}${l!=null&&l.tokenClassName?" "+l.tokenClassName:""}`}" style="color:${b};font-weight:${S};${N}" data-token-start="${g.start}" data-token-end="${g.end}">${w}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function $j(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 cx(t,a,l){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:l?"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 qj({suggestions:t,selectedIndex:a,onSelect:l,position:i,colors:u,styles:o,visible:f,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:b,listRefCallback:w,renderType:S,classNames:N}){const A=v.useRef(null),j=v.useRef(null);v.useEffect(()=>{const U=document.createElement("div");return document.body.appendChild(U),A.current=U,()=>{document.body.removeChild(U),A.current=null}},[]);const L=x&&b?x(b):null,I=L!=null;if(v.useEffect(()=>{if(j.current){const U=I?a+1:a,T=j.current.children[U];T&&T.scrollIntoView({block:"nearest"})}},[a,I]),!A.current||!f||t.length===0||!i)return null;const Y=Bu(u),P=$u(o),K={...Qb(Y,P),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=>{j.current=U,w==null||w(U)},onMouseDown:U=>U.preventDefault()},I&&v.createElement("div",{className:Ma("ei-dropdown-header",N==null?void 0:N.dropdownHeader),style:{padding:P.dropdownItemPadding||"4px 10px",fontSize:"11px",color:Y.placeholder,borderBottom:`1px solid ${Y.dropdownHover}`,userSelect:"none"}},L),t.map((U,T)=>{const oe=T===a,me=ix(oe,Y,P),ye=(z,H,ie)=>({key:T,className:Ma("ei-dropdown-item",z,oe&&"ei-dropdown-item--selected",N==null?void 0:N.dropdownItem),style:{...me,...H},title:ie,onClick:()=>l(U),onMouseEnter:ce=>{ce.currentTarget.style.backgroundColor=oe?Y.dropdownSelected:Y.dropdownHover},onMouseLeave:ce=>{ce.currentTarget.style.backgroundColor=oe?Y.dropdownSelected:"transparent"}}),Re=z=>{if(S===!1||!U.type||U.type==="hint")return null;const H=typeof S=="function"?S(U.type,{text:U.text,label:U.label,description:U.description,type:U.type}):U.type;return H!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...Cj(oe,P),...z}},H):null},ee={flexDirection:"column",alignItems:"flex-start"},be={display:"flex",alignItems:"center",gap:P.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:Is()},U.label),U.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:bh()},U.description));if(U.type==="error")return v.createElement("div",{key:T,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:{...Is(),color:Y.error}},U.label||"Error loading suggestions"));if(U.type==="noResults")return v.createElement("div",{key:T,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:T,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:{...Is(),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=ix(!1,Y,P);return v.createElement("div",{key:T,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:Is()},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 H;const ie=U.text.startsWith("(")&&U.text.endsWith(")")?U.text.slice(1,-1):U.text;return U.label!==ie&&(H=U.text),v.createElement("div",ye(z,ee,H),v.createElement("span",{className:"ei-dropdown-item-label",style:{...Is(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},cx(U.label,U.matchPartial,oe)),v.createElement("span",{style:be},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...bh(),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:Is()},cx(U.label,U.matchPartial,oe)),U.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:bh()},U.description),Re())}));return Jr.createPortal(W,A.current)}var Yj=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Sh(t){return Math.floor(t/10)*10}function Vj({onSelect:t,colors:a,styles:l,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,w]=v.useState("days"),[S,N]=v.useState(p.getFullYear()),[A,j]=v.useState(p.getMonth()),[L,I]=v.useState(u??null),[Y,P]=v.useState(o??null),[K,W]=v.useState(null),U=Bu(a),T=Aj(U,$u(l)),oe=()=>{b==="days"?A===0?(j(11),N(le=>le-1)):j(le=>le-1):N(b==="months"?le=>le-1:le=>le-10)},me=()=>{b==="days"?A===11?(j(0),N(le=>le+1)):j(le=>le+1):N(b==="months"?le=>le+1:le=>le+10)},ye=()=>{N(b==="days"?le=>le-1:b==="months"?le=>le-10:le=>le-100)},Re=()=>{N(b==="days"?le=>le+1:b==="months"?le=>le+10:le=>le+100)},ee=()=>{b==="days"?w("months"):b==="months"&&w("years")},be=le=>{j(le),w("days")},Ee=le=>{N(le),w("months")},z=le=>{if(g==="single"){t(yh(le));return}if(!L||Y)I(le),P(null),W(null);else{const[Ye,Ie]=L<=le?[L,le]:[le,L];I(Ye),P(Ie),W(null),t(`[${yh(Ye)} TO ${yh(Ie)}]`)}},H=L&&!Y?K:Y,ie=le=>{x(le),I(null),P(null),W(null)},ce=b==="days"?`${Nj(A)} ${S}`:b==="months"?`${S}`:`${Sh(S)}–${Sh(S)+9}`,pe=b!=="years",D=new Date,$=rx(S,A),ne=wj(S,A),de=["Su","Mo","Tu","We","Th","Fr","Sa"],je=[],Ne=(le,Ye,Ie)=>{const Gt=cu(le,D),An=L&&cu(le,L),fn=H&&cu(le,H),Lt=lx(le,L,H),Wt=An||fn,Yn={...T.day,...Ie?T.dayOtherMonth:{},...Gt?T.dayToday:{},...Lt?T.dayInRange:{},...Wt?T.daySelected:{}},Vn=g==="range"&&L&&!Y;return v.createElement("button",{key:Ye,className:"ei-datepicker-day",style:Yn,onClick:()=>z(le),onMouseEnter:fe=>{Vn?W(le):Wt||(fe.currentTarget.style.backgroundColor=U.dropdownHover)},onMouseLeave:fe=>{!Vn&&!Wt&&(fe.currentTarget.style.backgroundColor=Lt?"rgba(9, 105, 218, 0.1)":"transparent")}},le.getDate())};if(ne>0){const le=rx(S,A-1);for(let Ye=ne-1;Ye>=0;Ye--){const Ie=le-Ye,Gt=new Date(S,A-1,Ie);je.push(Ne(Gt,`prev${Ie}`,!0))}}for(let le=1;le<=$;le++){const Ye=new Date(S,A,le);je.push(Ne(Ye,String(le),!1))}const Ue=je.length%7;if(Ue>0){const le=7-Ue;for(let Ye=1;Ye<=le;Ye++){const Ie=new Date(S,A+1,Ye);je.push(Ne(Ie,`next${Ye}`,!0))}}const it={...T.day,padding:"10px 4px",fontSize:"13px"},Ge={...it,...T.dayToday},nt=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"}],vn={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Rt=le=>{le.currentTarget.style.backgroundColor="#eef1f5"},ut=le=>{le.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:Ma("ei-datepicker",m),style:T.container,onMouseDown:le=>le.preventDefault(),onMouseLeave:()=>W(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:T.rangeToggle},["single","range"].map(le=>v.createElement("button",{key:le,style:{...T.rangeToggleButton,...g===le?T.rangeToggleButtonActive:{}},onClick:()=>ie(le)},le.charAt(0).toUpperCase()+le.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:T.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:ye,onMouseEnter:Rt,onMouseLeave:ut},"«"),v.createElement("button",{style:T.navButton,onClick:oe,onMouseEnter:Rt,onMouseLeave:ut},"‹")),v.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:pe?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:pe?ee:void 0,onMouseEnter:le=>{pe&&(le.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:le=>{le.currentTarget.style.backgroundColor="transparent"}},ce),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:me,onMouseEnter:Rt,onMouseLeave:ut},"›"),v.createElement("button",{style:T.navButton,onClick:Re,onMouseEnter:Rt,onMouseLeave:ut},"»"))),b==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:T.weekDays},de.map(le=>v.createElement("div",{key:le,style:T.weekDay},le))),v.createElement("div",{className:"ei-datepicker-days",style:T.days},je)),b==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Yj.map((le,Ye)=>{const Ie=new Date(S,Ye,1),Gt=lx(Ie,L,H),An=L&&cu(new Date(L.getFullYear(),L.getMonth(),1),Ie)||H&&cu(new Date(H.getFullYear(),H.getMonth(),1),Ie),fn=Ye===D.getMonth()&&S===D.getFullYear(),Lt=g==="range"&&L&&!Y;return v.createElement("button",{key:le,style:{...fn?Ge:it,...Gt?T.dayInRange:{},...An?T.daySelected:{}},onClick:()=>be(Ye),onMouseEnter:Wt=>{Lt?W(Ie):An||(Wt.currentTarget.style.backgroundColor=U.dropdownHover)},onMouseLeave:Wt=>{!Lt&&!An&&(Wt.currentTarget.style.backgroundColor=Gt?"rgba(9, 105, 218, 0.1)":"transparent")}},le)})),b==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(le,Ye)=>{const Ie=Sh(S)-1+Ye,Gt=Ye===0||Ye===11,An=Ie===D.getFullYear(),fn=new Date(Ie,0,1),Lt=L&&H&&Ie>=Math.min(L.getFullYear(),H.getFullYear())&&Ie<=Math.max(L.getFullYear(),H.getFullYear()),Wt=L&&L.getFullYear()===Ie||H&&H.getFullYear()===Ie,Yn=g==="range"&&L&&!Y;return v.createElement("button",{key:Ie,style:{...An?Ge:it,...Gt?T.dayOtherMonth:{},...Lt?T.dayInRange:{},...Wt?T.daySelected:{}},onClick:()=>Ee(Ie),onMouseEnter:Vn=>{Yn?W(fn):Wt||(Vn.currentTarget.style.backgroundColor=U.dropdownHover)},onMouseLeave:Vn=>{!Yn&&!Wt&&(Vn.currentTarget.style.backgroundColor=Lt?"rgba(9, 105, 218, 0.1)":"transparent")}},Ie)})),(()=>{const le=nt.filter(Ye=>!Ye.type||Ye.type===g);return le.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...T.quickOptions,...vn}},le.map(Ye=>v.createElement("button",{key:`${Ye.type??"both"}-${Ye.value}`,style:T.quickOption,onClick:()=>t(Ye.value)},Ye.label)))})())}var Fj=30,Ij=150;function dx(t,a){let l=0;const i=u=>{if(u.nodeType===Node.TEXT_NODE){const o=(u.textContent||"").length;return l+o>=a?{node:u,offset:a-l}:(l+=o,null)}if(u.nodeName==="BR"){if(l+1>=a){const o=u.parentNode;if(o)return{node:o,offset:Array.from(o.childNodes).indexOf(u)+1}}return l+=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 Gj(t,a,l){const i=dx(t,a),u=dx(t,l);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 Xj(t,a,l){if(!a||t.length===0)return[];const i=[];let u=0;for(const o of t){if(u>=Fj)break;if(l>=o.start&&l<=o.end)continue;const f=Gj(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 fx=28,hx=4;function Pj(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 Qj({errors:t,editorRef:a,cursorOffset:l,colors:i,styles:u,containerRef:o,classNames:f}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[b,w]=v.useState([]),S=v.useRef([]),N=v.useRef(null),A=v.useRef(null);if(v.useEffect(()=>{if(A.current&&clearTimeout(A.current),t.length===0){w([]),S.current=[],p(null);return}return A.current=setTimeout(()=>{const Y=Xj(t,a,l);w(Y),S.current=Y},Ij),()=>{A.current&&clearTimeout(A.current)}},[t,a,l]),v.useEffect(()=>{const Y=o;if(!Y||!a)return;const P=U=>{const T=a.getBoundingClientRect(),oe=U.clientX-T.left,me=U.clientY-T.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",P,{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 P=Y.getBoundingClientRect();if(P.right>window.innerWidth-8){const K=P.right-window.innerWidth+8;Y.style.transform=`translateX(-${K}px)`}else Y.style.transform=""}),b.length===0)return null;const j=Bu(i),L=$u(u),I=m!=null?b[m]:null;return v.createElement(v.Fragment,null,b.map((Y,P)=>{const K=Y.error.severity==="warning",W=Pj(K?j.warning:j.error),U=Y.top+Y.height-2;return v.createElement("div",{key:`wave-${P}`,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"}})}),I!=null&&(()=>{const Y=I.error.severity==="warning"?j.warning:j.error,P=a==null?void 0:a.getBoundingClientRect(),K=((P==null?void 0:P.left)??0)+g.x,W=((P==null?void 0:P.top)??0)+I.top+I.height+2,U=((P==null?void 0:P.top)??0)+I.top,T=window.innerHeight-g.clientY<fx+20?U-fx-hx:W+hx;return Jr.createPortal(v.createElement("div",{ref:N,className:Ma("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${T}px`,left:`${K}px`,zIndex:L.dropdownZIndex,backgroundColor:j.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"}},I.error.message),document.body)})())}function Nu(t,a,l){let i=0,u=!1;function o(f){var m;if(u)return!0;if(f===a){if(f.nodeType===Node.TEXT_NODE)i+=l;else for(let p=0;p<l&&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 jl(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const l=a.getRangeAt(0);return Nu(t,l.startContainer,l.startOffset)}function xr(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const l=a.getRangeAt(0);return{start:Nu(t,l.startContainer,l.startOffset),end:Nu(t,l.endContainer,l.endOffset)}}function Zr(t,a){const l=window.getSelection();if(!l)return;const i=Lh(t,a);if(!i)return;const u=document.createRange();u.setStart(i.node,i.offset),u.collapse(!0),l.removeAllRanges(),l.addRange(u)}function Kr(t,a,l){if(a===l){Zr(t,a);return}const i=window.getSelection();if(!i)return;const u=Lh(t,a),o=Lh(t,l);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 Lh(t,a){let l=0;function i(f){var m;if(f.nodeType===Node.TEXT_NODE){const p=(f.textContent||"").length;return l+p>=a?{node:f,offset:a-l}:(l+=p,null)}if(f.nodeName==="BR"){if((m=f.hasAttribute)!=null&&m.call(f,"data-sentinel"))return null;if(l+1>=a){const p=f.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(f)+1}}return l+=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=Zb(t);return o?{node:o,offset:(o.textContent||"").length}:{node:t,offset:0}}function Zb(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const l=Zb(t.childNodes[a]);if(l)return l}return null}function Kj(t){const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0);l.deleteContents();const i=document.createTextNode(t);l.insertNode(i),l.setStartAfter(i),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}function Zj(){const t=window.getSelection();if(!t||t.rangeCount===0)return;const a=t.getRangeAt(0);a.deleteContents();const l=document.createElement("br");a.insertNode(l),a.setStartAfter(l),a.collapse(!0),t.removeAllRanges(),t.addRange(a)}function oc(t){var m;const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0);let i=l.getBoundingClientRect();if(i.width===0&&i.height===0){const p=document.createElement("span");p.textContent="",l.insertNode(p),i=p.getBoundingClientRect(),(m=p.parentNode)==null||m.removeChild(p),a.removeAllRanges(),a.addRange(l)}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 wh(){var i,u;const t=window.getSelection();if(!t||t.rangeCount===0)return null;const a=t.getRangeAt(0),l=a.getBoundingClientRect();if(l.width===0&&l.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 l}function mx(t,a){return Math.min(t,a)}function Eh(t,a,l){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+l>u&&(f=u-l-8),f<8&&(f=8),{top:o,left:f}}var Jj=new Set([M.VALUE,M.QUOTED_VALUE,M.WILDCARD]);function Wj(t,a,l){for(const i of t)if(a>=i.start&&a<=i.end&&Jj.has(i.type))return a===i.start&&l===i.end?null:{start:i.start,end:i.end};return null}var eT=new Set([M.VALUE,M.QUOTED_VALUE,M.WILDCARD,M.FIELD_NAME,M.RANGE,M.SAVED_SEARCH,M.HISTORY_REF,M.REGEX]);function tT(t,a,l){const i=[];for(const u of a)if(l>=u.start&&l<=u.end&&eT.has(u.type)){i.push({start:u.start,end:u.end});break}return t&&pc(t,l,i),nT(i)}function pc(t,a,l){if(a<t.start||a>t.end)return!1;let i=!1;switch(t.type){case"BooleanExpr":i=pc(t.left,a,l)||i,i=pc(t.right,a,l)||i;break;case"Group":case"Not":case"FieldGroup":i=pc(t.expression,a,l)||i;break}return l.push({start:t.start,end:t.end}),!0}function nT(t){t.sort((l,i)=>l.end-l.start-(i.end-i.start)||l.start-i.start);const a=[];for(const l of t){const i=a[a.length-1];i&&i.start===l.start&&i.end===l.end||a.push(l)}return a}var aT=60,rT=" ";function lT(t,a){const l=(a==null?void 0:a.maxLineLength)??aT,i=(a==null?void 0:a.indent)??rT,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 ss(new Js(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():o=t,o?vc(o,0,l,i,u):""}function sT(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function Jb(t,a){const l=a.not??t.sourceOperator??"NOT";return{op:l,sep:/^[a-zA-Z]/.test(l)?" ":""}}function Sr(t,a){switch(t.type){case"FieldValue":{const l=t.quoted?`"${t.value}"`:t.value,i=t.operator===":"?":":`:${t.operator}`;let u=`${t.field}${i}${l}`;return t.fuzzy!=null&&(u+=`~${t.fuzzy}`),t.proximity!=null&&(u+=`~${t.proximity}`),t.boost!=null&&(u+=`^${t.boost}`),u}case"BareTerm":{let l=t.quoted?`"${t.value}"`:t.value;return t.fuzzy!=null&&(l+=`~${t.fuzzy}`),t.proximity!=null&&(l+=`~${t.proximity}`),t.boost!=null&&(l+=`^${t.boost}`),l}case"Range":{const l=t.lowerInclusive?"[":"{",i=t.upperInclusive?"]":"}",u=`${l}${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:l,sep:i}=Jb(t,a);return`${l}${i}${Sr(t.expression,a)}`}case"Group":{let l=`(${Sr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"FieldGroup":{let l=`${t.field}:(${Sr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"BooleanExpr":{const l=sT(t,a),i=l?` ${l} `:" ";return`${Sr(t.left,a)}${i}${Sr(t.right,a)}`}case"Error":return t.value}}function iT(t){const a=t.operator,l=!!t.implicit,i=[],u=o=>{o.type==="BooleanExpr"&&o.operator===a&&!!o.implicit===l?(u(o.left),u(o.right)):i.push(o)};return u(t),{operator:a,implicit:l,sourceOperator:t.sourceOperator,operands:i}}function gc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?gc(t.left)||gc(t.right):t.type==="Not"?gc(t.expression):!1}var uT={and:"AND",or:"OR",not:"NOT"};function oT(t,a){return!!(Sr(t,uT).length>a||gc(t))}function vc(t,a,l,i,u){const o=i.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=iT(t),x=m?u.whitespace??"":f==="AND"?u.and??p??"AND":u.or??p??"OR",b=x?` ${x} `:" ",w=g.map(S=>Sr(S,u)).join(b);return w.length<=l?w:g.map((S,N)=>{const A=vc(S,a,l,i,u);return N===0?A:x?`${o}${x} ${A}`:`${o}${A}`}).join(`
|
|
253
|
-
`)}case"Group":{if(!oT(t.expression,l)){let m=`(${Sr(t.expression,u)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
|
|
254
|
-
${cT(vc(t.expression,a+1,l,i,u),a+1,i)}
|
|
255
|
-
${o})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"FieldGroup":{let f=`${t.field}:(${Sr(t.expression,u)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=Jb(t,u);return`${f}${m}${vc(t.expression,a,l,i,u)}`}default:return Sr(t,u)}}function cT(t,a,l){const i=l.repeat(a);return t.split(`
|
|
256
|
-
`).map(u=>u.startsWith(i)?u:i+u).join(`
|
|
257
|
-
`)}function dT(t){return t?xu(t):[]}function px(t){return t.type==="BooleanExpr"}function xu(t){switch(t.type){case"BooleanExpr":return zh(t);case"Group":{const a=[],l=t.expression;return px(l)?(a.push({start:t.start,end:t.end}),a.push(...xu(l)),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 l=t.expression;return px(l)&&a.push(...xu(l)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...xu(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 zh(t){return t.type==="BooleanExpr"?[...zh(t.left),...zh(t.right)]:xu(t)}function fT(t,a,l,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>=l)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<=l)return{stop:t[u],index:u};return{stop:t[0],index:0}}}var hT=class{constructor(t=100){pn(this,"stack",[]);pn(this,"index",-1);pn(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 mT(t,a){const l=i=>(a==null?void 0:a(i))??Sj(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:l(u[1].trim()),end:l(u[2].trim())}}if(t.type==="FIELD_VALUE"&&t.partial){const i=l(t.partial);if(i)return{mode:"single",start:i,end:null}}return null}function pT(t,a){var l,i,u,o;return((t==null?void 0:t.mode)??"single")!==((a==null?void 0:a.mode)??"single")||(((l=t==null?void 0:t.start)==null?void 0:l.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 gT({position:t,colors:a,onSelect:l,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 w=$u(u),S={position:"absolute",zIndex:w.dropdownZIndex,...Qb(a,w),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return Jr.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:S,onMouseDown:N=>N.preventDefault()},v.createElement(Vj,{onSelect:l,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 vT(t){const{fields:a,onSearch:l,onChange:i,onValidationChange:u,value:o,defaultValue:f,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:b,placeholder:w,className:S,classNames:N,style:A,dropdown:j,features:L,inputRef:I,datePresets:Y,onKeyDown:P,onFocus:K,onBlur:W,onTab:U,validateValue:T,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,H=(j==null?void 0:j.open)??(j==null?void 0:j.mode)??"always",ie=typeof H=="function",ce=ie?null:H,pe=(j==null?void 0:j.alignToInput)??!1,D=j==null?void 0:j.maxSuggestions,$=D||10,ne=j==null?void 0:j.suggestDebounceMs,de=parseInt((b==null?void 0:b.dropdownMaxHeight)||"300",10)||300,je=(L==null?void 0:L.savedSearches)??!!m,Ne=(L==null?void 0:L.historySearch)??!!p,Ue=(j==null?void 0:j.showSavedSearchHint)??je,it=(j==null?void 0:j.showHistoryHint)??Ne,Ge=(j==null?void 0:j.showOperators)!==!1,nt=(ie||ce!=="input")&&(j==null?void 0:j.onNavigation)!==!1,vn=(j==null?void 0:j.navigationDelay)??0,Rt=(j==null?void 0:j.loadingDelay)??0,ut=j==null?void 0:j.renderFieldHint,le=j==null?void 0:j.renderHistoryItem,Ye=j==null?void 0:j.renderSavedSearchItem,Ie=j==null?void 0:j.renderHeader,Gt=j==null?void 0:j.renderNoResults,An=j==null?void 0:j.renderType,fn=(j==null?void 0:j.autoSelect)??!1,Lt=(j==null?void 0:j.homeEndKeys)??!1,Wt=(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,Me=L==null?void 0:L.formatQuery,qe=!!Me,Ze=typeof Me=="object"?Me:void 0,pt=v.useMemo(()=>({savedSearches:je,historySearch:Ne}),[je,Ne]),Xt=Array.isArray(a)?a:[],[rn,Bn]=v.useState(Xt);v.useEffect(()=>{if(Array.isArray(a)){Bn(a);return}let R=!1;return a().then(G=>{R||Bn(G)}),()=>{R=!0}},[a]);const un=v.useMemo(()=>{const R=new Map;for(const G of rn)if(R.set(G.name.toLowerCase(),G.type),G.aliases)for(const Se of G.aliases)R.set(Se.toLowerCase(),G.type);return R},[rn]),se=v.useRef(null),[St,Mt]=v.useState(null),Jn=v.useCallback(R=>{se.current=R,Mt(R)},[]),Wn=v.useRef(null),jr=v.useRef(null),Be=v.useRef(o||f||""),Pt=v.useRef(null),Yt=v.useRef(!1),yt=v.useRef(!1),zt=v.useRef(new hT),jt=v.useRef(null),en=v.useRef(new Set),Qt=v.useRef(null),Ut=v.useRef(null),ft=v.useRef(null),Je=v.useRef(null),wn=v.useRef(!1),On=v.useRef(null),C=v.useRef(null),k=v.useRef(null),q=v.useRef("input"),Z=v.useRef(null),ae=v.useRef(-1),Te=v.useRef(()=>{}),ge=v.useRef(new vh(Xt,[],[],D||10,{showSavedSearchHint:Ue,showHistoryHint:it,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));ge.current.setDefaultField(Ee);const De=v.useRef(new sx(Xt)),we=v.useRef(T);we.current=T;const[Oe,_e]=v.useState([]),[Xe,Ce]=v.useState(null),[Ke,$e]=v.useState([]),[Ht,We]=v.useState(-1),[ot,lt]=v.useState(!1),[ct,Kt]=v.useState(!1),[Fn,En]=v.useState(null),[Mn,kn]=v.useState([]),[In,fa]=v.useState(!1),[tl,ea]=v.useState(!Be.current),[ur,Pe]=v.useState(me!=null&&Be.current.length>=me),[wt,Zt]=v.useState(0),[ta,_n]=v.useState(0),[Tr,Et]=v.useState(""),[wa,Gn]=v.useState(null),[Ul,hi]=v.useState(null),Tt=v.useRef({tokens:Oe,ast:Xe,suggestions:Ke,selectedSuggestionIndex:Ht,showDropdown:ot,showDatePicker:ct,cursorOffset:wt,selectionEnd:ta,autocompleteContext:Tr,validationErrors:Mn,cursorContext:wa});Tt.current={tokens:Oe,ast:Xe,suggestions:Ke,selectedSuggestionIndex:Ht,showDropdown:ot,showDatePicker:ct,cursorOffset:wt,selectionEnd:ta,autocompleteContext:Tr,validationErrors:Mn,cursorContext:wa};const or=v.useCallback((R,G)=>{if(pe&&Wn.current){const ve=Wn.current.getBoundingClientRect();return{top:ve.bottom+window.scrollY+4,left:ve.left+window.scrollX}}const Se=wh();return Se?Eh(Se,R,G):null},[pe]),Yu=v.useCallback(()=>{if(!(!pe||!Wn.current))return Wn.current.getBoundingClientRect().width},[pe]),Ja=v.useCallback((R,G,Se="dropdown")=>{const ve=Se==="datePicker"?R:mx(R,de);if(pe&&Se!=="datePicker"){lt(!0),En(or(ve,G));return}const Fe=requestAnimationFrame(()=>{en.current.delete(Fe),Se==="datePicker"?Kt(!0):lt(!0);const ue=wh();En(ue?Eh(ue,ve,G):null)});en.current.add(Fe)},[pe,or,de]),nl=80,Qc=60,ds=v.useCallback((R,G)=>{if(!se.current)return;const Se=Gs(R,x,{cursorOffset:G,tokenClassName:N==null?void 0:N.token,fieldTypeMap:un});se.current.innerHTML=Se,document.activeElement===se.current&&Zr(se.current,G)},[x]),ha=v.useCallback((R,G)=>{const Se=me!=null&&R.length>=me;if(Pe(Se),Se){if(_e([]),Ce(null),kn([]),ea(R.length===0),$e([]),Tt.current.tokens=[],lt(!1),Kt(!1),se.current){const xe=jl(se.current);se.current.querySelector("span")&&(se.current.textContent=R,Zr(se.current,xe)),Zt(xe),_n(xe)}i&&i(R,null),u&&u([]);return}const ve=new Js(R,pt).tokenize(),Fe=new ss(ve),ue=Fe.parse(),he=uc([...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(se.current){const xe=jl(se.current);G&&ve.length>nl?(Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(()=>{Ut.current=null,se.current&&ds(ve,jl(se.current))},Qc)):(Ut.current&&(clearTimeout(Ut.current),Ut.current=null),ds(ve,xe)),_e(ve),Ce(ue),kn(he),ea(R.length===0),Zt(xe),_n(xe),Tt.current.tokens=ve,G&&Te.current(ve,xe)}else _e(ve),Ce(ue),kn(he),ea(R.length===0),Tt.current.tokens=ve;i&&i(R,ue),u&&u(he)},[x,i,u,ds,me]),Hl=v.useCallback((R,G)=>{if(!ut||G.type!=="FIELD_VALUE"||!G.fieldName)return R;const Se=ge.current.resolveField(G.fieldName);if(!Se)return R;const ve=ut(Se,G.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:G.start??0,replaceEnd:G.end??0},...R]},[ut]),fs=v.useCallback(R=>{if(!Gt)return!1;const G=Gt({cursorContext:R,partial:R.partial});return G==null?!1:($e([{text:"",label:"",type:"noResults",customContent:G,replaceStart:0,replaceEnd:0}]),We(-1),Kt(!1),Ja(32,300),!0)},[Gt]),ma=v.useCallback((R,G,Se)=>{var xe,Qe,at;const ve=ge.current.getSuggestions(R,G);Ge||(ve.suggestions=ve.suggestions.filter(ze=>ze.type!=="operator"));const Fe=ve.context.type;if(Gn(ve.context),ie){if(H({trigger:q.current,context:ve.context,suggestions:ve.suggestions,isOpen:Tt.current.showDropdown||Tt.current.showDatePicker,value:Be.current,selectionStart:G,selectionEnd:Se??G})===!1){lt(!1),Kt(!1),$e([]);return}}else{if(ce==="never"){lt(!1),Kt(!1),$e([]);return}if(ce==="manual"){if(k.current&&k.current!==Fe){k.current=null,lt(!1),Kt(!1),$e([]);return}if(!k.current){lt(!1),Kt(!1),$e([]);return}}if(ce==="input"&&q.current!=="input"&&q.current!=="ctrlSpace"){lt(!1),Kt(!1),$e([]);return}if(ce==="always"&&R.some(ze=>(ze.type===M.AND||ze.type===M.OR||ze.type===M.NOT||ze.type===M.TILDE||ze.type===M.BOOST)&&G>=ze.start&&G<=ze.end)){lt(!1),Kt(!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){wn.current=!1,(xe=Qt.current)==null||xe.abort(),Pt.current&&clearTimeout(Pt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const ze=mT(ve.context,oe),Nn=On.current;On.current=ze,hi(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:G,end:G},Tt.current.showDatePicker&&pT(Nn,ze)&&Kt(!1),$e([]),pe||lt(!1),Et(Fe),Ja(350,300,"datePicker");return}if(he){const ze=ve.context.token,Nn=ze?ze.start:G,kt=ze?ze.end:G,ra=()=>{Je.current=null,$e([{text:"",label:"Searching...",type:"loading",replaceStart:Nn,replaceEnd:kt}]),pe||lt(!1),Kt(!1),We(-1),Ja(32,300)};Je.current&&clearTimeout(Je.current),Rt>0?Je.current=setTimeout(ra,Rt):ra(),Et(Fe)}else{wn.current=!1,(Qe=Qt.current)==null||Qe.abort(),Pt.current&&clearTimeout(Pt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const ze=Hl(ve.suggestions,ve.context);ze.length>0?($e(ze),pe||lt(!1),Kt(!1),We(ve.context.partial||fn?0:-1),Et(Fe),Ja(ze.length*32,300)):(Et(Fe),fs(ve.context)||(lt(!1),Kt(!1),$e([])))}if(he){const ze=ve.context.partial,Nn=ne||200;wn.current=!0,Pt.current&&clearTimeout(Pt.current),(at=Qt.current)==null||at.abort();const kt=new AbortController;Qt.current=kt,Pt.current=setTimeout(async()=>{const ra=ve.context.token,la=ra?ra.start:G,pa=ra?ra.end:G;try{let Rn;if(ve.context.type==="SAVED_SEARCH"&&typeof m=="function"){const on=await m(ze);if(kt.signal.aborted)return;Rn=on.map(_t=>({text:_t.query,label:_t.label||_t.query,description:_t.description,type:"savedSearch",replaceStart:la,replaceEnd:pa,matchPartial:ze,sourceData:_t}))}else if(ve.context.type==="HISTORY_REF"&&typeof p=="function"){const on=await p(ze);if(kt.signal.aborted)return;Rn=on.map(_t=>({text:vh.wrapHistoryQuery(_t.query),label:_t.label||_t.query,description:_t.description,type:"history",replaceStart:la,replaceEnd:pa,matchPartial:ze,sourceData:_t}))}else{const on=ve.context.fieldName,_t=ge.current.resolveField(on),Yl=await g(_t?_t.name:on,ze);if(kt.signal.aborted)return;Rn=Yl.map(fr=>({text:fr.text,label:fr.label||fr.text,description:fr.description,type:fr.type,replaceStart:la,replaceEnd:pa,matchPartial:ze}))}if(Je.current&&(clearTimeout(Je.current),Je.current=null),Rn=Rn.slice(0,$),Rn.length>0){if(Ee!=null&&Ee.showFieldSuggestions){const on=ge.current.getFieldSuggestions(ze,la,pa);Rn=[...Rn,...on].slice(0,$)}$e(Rn),We(ze||fn?0:-1),Ja(Rn.length*32,300)}else{const on=ge.current.getSuggestions(Tt.current.tokens,Tt.current.cursorOffset);if(!(ze&&fs(on.context))){const _t=Hl(on.suggestions.filter(Yl=>Yl.type==="hint"),on.context);_t.length>0?($e(_t),We(on.context.partial||fn?0:-1),Ja(_t.length*32,300)):fs(on.context)||(lt(!1),$e([]))}}}catch(Rn){Je.current&&(clearTimeout(Je.current),Je.current=null),kt.signal.aborted||($e([{text:"",label:Rn instanceof Error?Rn.message:"Error loading suggestions",type:"error",replaceStart:la,replaceEnd:pa}]),We(-1),Ja(32,300),wn.current=!1)}},Nn)}},[g,m,p,ne,Hl,or,Ja,pe,H,ie,ce,Ge,$,Rt,fn,fs]);Te.current=ma;const tn=v.useCallback(()=>{var R;lt(!1),Kt(!1),hi(null),On.current=null,C.current=null,$e([]),We(-1),wn.current=!1,(R=Qt.current)==null||R.abort(),Pt.current&&(clearTimeout(Pt.current),Pt.current=null),ft.current&&(clearTimeout(ft.current),ft.current=null),k.current=null},[]),na=v.useCallback((R,G,Se)=>{if(ft.current&&(clearTimeout(ft.current),ft.current=null),!nt){(Tt.current.showDropdown||Tt.current.showDatePicker)&&tn();return}q.current="navigation",vn>0?ft.current=setTimeout(()=>{ft.current=null,ma(R,G,Se)},vn):ma(R,G,Se)},[nt,vn,ma,tn]),Ea=v.useCallback((R,G,Se)=>{Be.current=R,jt.current&&(clearTimeout(jt.current),jt.current=null),zt.current.push({value:R,cursorPos:G});const ve=new Js(R,pt).tokenize(),Fe=new ss(ve),ue=Fe.parse(),he=uc([...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(se.current){const xe=Gs(ve,x,{cursorOffset:G,tokenClassName:N==null?void 0:N.token,fieldTypeMap:un});se.current.innerHTML=xe,Zr(se.current,G)}if(_e(ve),Ce(ue),kn(he),ea(R.length===0),Zt(G),_n(G),lt(!1),Kt(!1),i&&i(R,ue),u&&u(he),Se){const xe=requestAnimationFrame(()=>{en.current.delete(xe),Se(ve,ue)});en.current.add(xe)}},[x,i,u]),Dr=v.useCallback((R,G="Enter",Se,ve)=>{if(!R)return;const Fe=Tt.current,ue=Fe.autocompleteContext,he=ue==="FIELD_VALUE"||ue==="SAVED_SEARCH"||ue==="HISTORY_REF";if(he&&(q.current="navigation"),R.type==="hint"&&(R.text==="#"||R.text==="!")){const on=R.text,_t=R.replaceStart,Yl=Math.max(R.replaceEnd,Fe.selectionEnd),fr=Be.current.slice(0,_t),Zc=Be.current.slice(Yl),Gu=fr+on+Zc,Xu=fr.length+on.length;Ea(Gu,Xu,(Jc,Wc)=>{Se?Se(Gu,Wc):ma(Jc,Xu)});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),Nn=Be.current.slice(at);let kt="",ra=Nn;he&&ee&&(Nn.length===0?kt=" ":/^[ \t\r\n]+$/.test(Nn)&&!Nn.startsWith("\\ ")&&(kt=" ",ra=""));const la=ze+R.text+kt+ra,pa=ze.length+R.text.length+kt.length,Rn=G==="Enter"&&xe;Ea(la,pa,(on,_t)=>{Se?Se(la,_t):Rn?l&&l(la,_t,ve):ma(on,pa)})},[Ea,ma,l,ee]);v.useEffect(()=>{Array.isArray(m)&&ge.current.updateSavedSearches(m),Array.isArray(p)&&ge.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{ge.current=new vh(rn,[],[],D||10,{showSavedSearchHint:Ue,showHistoryHint:it,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),ge.current.setDefaultField(Ee),De.current=new sx(rn),Array.isArray(m)&&ge.current.updateSavedSearches(m),Array.isArray(p)&&ge.current.updateSearchHistory(p),Be.current&&ha(Be.current,!1)},[rn,D,Ue,it]),v.useEffect(()=>{I&&I({getValue:()=>Be.current,setValue:R=>{Be.current=R,ha(R,!1)},focus:()=>{var R;return(R=se.current)==null?void 0:R.focus()},blur:()=>{var R;return(R=se.current)==null?void 0:R.blur()},getAST:()=>Tt.current.ast,getValidationErrors:()=>Tt.current.validationErrors,setSelection:(R,G)=>{se.current&&(se.current.focus(),Kr(se.current,R,G),Zt(R),_n(G))}})},[I,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;Pt.current&&clearTimeout(Pt.current),Ut.current&&clearTimeout(Ut.current),ft.current&&clearTimeout(ft.current),Je.current&&clearTimeout(Je.current),en.current.forEach(G=>cancelAnimationFrame(G)),en.current.clear(),(R=Qt.current)==null||R.abort()},[]),v.useEffect(()=>{if(ie){const R=Tt.current;R.cursorContext&&H({trigger:"modeChange",context:R.cursorContext,suggestions:R.suggestions,isOpen:R.showDropdown||R.showDatePicker,value:Be.current,selectionStart:R.cursorOffset,selectionEnd:R.selectionEnd})===!1&&(lt(!1),Kt(!1),$e([]))}else ce==="never"&&(lt(!1),Kt(!1),$e([]));k.current=null},[H]);const cr=v.useRef(!1);v.useLayoutEffect(()=>{if(cr.current){cr.current=!1;return}const R=jr.current;if(!R||!Fn)return;const G=R.getBoundingClientRect(),Se=window.innerWidth;if(G.right>Se-8){const ve=G.right-Se+8;cr.current=!0,En(Fe=>Fe&&{...Fe,left:Math.max(8,Fe.left-ve)})}},[Fn,ot,ct,Ke]),v.useEffect(()=>{const R=()=>{const G=Tt.current;if(!(!G.showDropdown&&!G.showDatePicker))if(G.showDropdown&&pe&&Wn.current){const Se=Wn.current.getBoundingClientRect();En({top:Se.bottom+window.scrollY+4,left:Se.left+window.scrollX})}else{const Se=wh();Se&&En(Eh(Se,G.showDatePicker?350:mx(G.suggestions.length*32,de),300))}};return window.addEventListener("resize",R),window.addEventListener("scroll",R,!0),()=>{window.removeEventListener("resize",R),window.removeEventListener("scroll",R,!0)}},[pe,de]),v.useEffect(()=>{const R=se.current;if(!R)return;const G=()=>{(Tt.current.showDropdown||Tt.current.showDatePicker)&&tn()};return R.addEventListener("scroll",G),()=>R.removeEventListener("scroll",G)},[tn]);const Cr=v.useRef(null),mi=v.useRef(x);v.useEffect(()=>{if(!se.current)return;const R=Tt.current.tokens;if(R.length===0||In&&ta!==wt)return;const G=In?wt:-1,Se=x!==mi.current;mi.current=x;const ve=Kb(R,G),Fe=ve?`${ve.openStart},${ve.closeStart}`:null;if(Fe===Cr.current&&!Se)return;Cr.current=Fe;const ue=In?jl(se.current):-1,he=Gs(R,x,{cursorOffset:G,tokenClassName:N==null?void 0:N.token,fieldTypeMap:un});se.current.innerHTML=he,In&&ue>=0&&Zr(se.current,ue)},[wt,ta,In,x]);const dr=be&&!In,pi=v.useRef(dr);v.useEffect(()=>{if(!se.current)return;const R=pi.current;if(pi.current=dr,R!==dr)if(dr)se.current.innerHTML=se.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const G=Tt.current.tokens;if(G.length>0){const Se=In?jl(se.current):-1,ve=Gs(G,x,{cursorOffset:Se,tokenClassName:N==null?void 0:N.token,fieldTypeMap:un});se.current.innerHTML=ve,In&&Se>=0&&Zr(se.current,Se)}}},[dr,x]);const La=v.useCallback(()=>{if(Yt.current||!se.current)return;Z.current=null,ae.current=-1,ft.current&&(clearTimeout(ft.current),ft.current=null);let R=vj(se.current);if(R===Be.current)return;let G=jl(se.current);const Se=tx(R);Se!==R&&(R=Se,G=Math.min(G,R.length)),Be.current=R;const ve=zt.current,Fe=ve.current();if(Fe&&Math.abs(R.length-Fe.value.length)<=2&&jt.current?ve.replaceCurrent({value:R,cursorPos:G}):ve.push({value:R,cursorPos:G}),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{jt.current=null},300),q.current="input",!ie&&ce==="input"){const ue=G>0?R[G-1]:"";if(!ue||ue.trim()===""){ha(R,!1),tn(),se.current&&oc(se.current);return}}ha(R,!0),se.current&&oc(se.current)},[ha,ie,ce,tn]),Wa=v.useCallback(()=>{Yt.current=!0},[]),gi=v.useCallback(()=>{Yt.current=!1,La()},[La]),Ar=v.useCallback(R=>{if(!R)return;Be.current=R.value;const G=new Js(R.value,pt).tokenize(),Se=new ss(G),ve=Se.parse(),Fe=uc([...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(se.current){const he=Gs(G,x,{cursorOffset:R.cursorPos,tokenClassName:N==null?void 0:N.token,fieldTypeMap:un});se.current.innerHTML=he,ue?Kr(se.current,R.selStart,R.cursorPos):Zr(se.current,R.cursorPos)}_e(G),Ce(ve),kn(Fe),ea(R.value.length===0),Zt(ue?R.selStart:R.cursorPos),_n(R.cursorPos),tn(),i&&i(R.value,ve),u&&u(Fe)},[x,i,u,tn]),za=v.useCallback(()=>{const R=jr.current;if(!R)return 10;const G=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(G/ve))},[]),vi=v.useCallback(R=>{var ve,Fe;if(P&&P(R),R.defaultPrevented)return;const G=Tt.current,Se=R.nativeEvent.code;if(qe&&Se==="KeyF"&&R.altKey&&R.shiftKey&&!R.ctrlKey&&!R.metaKey){R.preventDefault();const ue=lT(Be.current,Ze);ue!==Be.current&&Ea(ue,ue.length);return}if(se.current&&se.current.childNodes.length>40){const ue=window.getSelection();if(ue!=null&&!ue.isCollapsed){const he=xr(se.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)&&(se.current.textContent=Be.current,Kr(se.current,he.start,he.end))}}}{let ue=null,he=null;if(nx[R.key])ue=R.key,he=nx[R.key];else if(fe&&R.key==="*"&&se.current){const xe=xr(se.current);if(xe.start!==xe.end){const[Qe,at]=ax(G.tokens,xe.start,xe.end);if(Qe>=0&&Qe===at){const ze=G.tokens[Qe];(ze.type===M.VALUE||ze.type===M.WILDCARD)&&(ue="*",he="*")}}}if(ue&&he&&se.current){const xe=xr(se.current);if(xe.start!==xe.end){R.preventDefault();const{newValue:Qe,newSelStart:at,newSelEnd:ze}=gj(Be.current,xe.start,xe.end,ue,he),Nn=zt.current,kt=Nn.current();kt&&kt.value===Be.current&&(kt.selStart=xe.start,kt.cursorPos=xe.end),Be.current=Qe,jt.current&&(clearTimeout(jt.current),jt.current=null),Nn.push({value:Qe,cursorPos:ze,selStart:at});const ra=new Js(Qe,pt).tokenize(),la=new ss(ra),pa=la.parse(),Rn=uc([...la.getErrors().map(_t=>({message:_t.message,start:_t.start,end:_t.end,type:"SYNTAX_ERROR"})),...De.current.validate(pa,we.current,oe,z)]),on=Gs(ra,x,{cursorOffset:ze,tokenClassName:N==null?void 0:N.token,fieldTypeMap:un});se.current.innerHTML=on,Kr(se.current,at,ze),_e(ra),Ce(pa),kn(Rn),ea(!1),Zt(at),_n(ze),tn(),i&&i(Qe,pa),u&&u(Rn);return}}}if(R.key==="z"&&(R.ctrlKey||R.metaKey)&&!R.shiftKey){R.preventDefault(),Ar(zt.current.undo());return}if(R.key==="y"&&(R.ctrlKey||R.metaKey)||R.key==="z"&&(R.ctrlKey||R.metaKey)&&R.shiftKey){R.preventDefault(),Ar(zt.current.redo());return}if(R.key==="a"&&(R.ctrlKey||R.metaKey)&&Yn&&se.current){const ue=xr(se.current),he=Wj(G.tokens,ue.start,ue.end);if(he){R.preventDefault(),Kr(se.current,he.start,he.end),Zt(he.start),_n(he.end);return}}if(Vn&&R.altKey&&R.shiftKey&&(Se==="ArrowRight"||Se==="ArrowLeft")&&se.current){const ue=Se==="ArrowRight";let he=Z.current;if(!he){const Qe=xr(se.current),at=tT(G.ast,G.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=xr(se.current);Zr(se.current,Qe.start),Z.current=null}else{R.preventDefault();const Qe=he.ranges[xe];Kr(se.current,Qe.start,Qe.end),Zt(Qe.start),_n(Qe.end)}return}if(Z.current=null,Le&&R.ctrlKey&&R.altKey&&(Se==="ArrowRight"||Se==="ArrowLeft")&&se.current){R.preventDefault();const ue=Se==="ArrowRight"?"forward":"backward",he=dT(G.ast),xe=xr(se.current),Qe=ue==="forward"?xe.end:xe.start,at=fT(he,ae.current,Qe,ue);at&&(ae.current=at.index,Kr(se.current,at.stop.start,at.stop.end),Zt(at.stop.start),_n(at.stop.end));return}if(ae.current=-1,R.key===" "&&(R.ctrlKey||R.metaKey)){R.preventDefault(),q.current="ctrlSpace",!ie&&ce==="manual"&&(k.current=ge.current.getSuggestions(G.tokens,G.cursorOffset).context.type),ma(G.tokens,G.cursorOffset);return}if(R.key==="Enter"&&(R.ctrlKey||R.metaKey)){R.preventDefault(),tn(),l&&l(Be.current,G.ast,R);return}if(R.key==="Enter"&&R.shiftKey&&Wt){R.preventDefault(),Zj();const ue=se.current?jl(se.current):Be.current.length+1,he=Be.current,xe=he.slice(0,ue-1)+`
|
|
258
|
-
`+he.slice(ue-1);Be.current=xe,Z.current=null,ft.current&&(clearTimeout(ft.current),ft.current=null),q.current="input",zt.current.push({value:xe,cursorPos:ue}),ha(xe,!0),se.current&&oc(se.current);return}if((R.key==="Backspace"||R.key==="Delete")&&se.current&&!se.current.textContent){const ue=Be.current;if(!ue)return;const{start:he,end:xe}=xr(se.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,ft.current&&(clearTimeout(ft.current),ft.current=null),q.current="input",zt.current.push({value:Qe,cursorPos:at}),Zr(se.current,at),ha(Qe,!0),se.current&&oc(se.current);return}if(yt.current=!1,G.showDropdown&&G.suggestions.length>0)switch(R.key){case"ArrowDown":R.preventDefault(),yt.current=!0,We(ue=>ue>=G.suggestions.length-1?0:ue+1);return;case"ArrowUp":R.preventDefault(),yt.current=!0,We(ue=>ue<=0?G.suggestions.length-1:ue-1);return;case"PageDown":{R.preventDefault(),yt.current=!0;const ue=za();We(he=>Math.min(he+ue,G.suggestions.length-1));return}case"PageUp":{R.preventDefault(),yt.current=!0;const ue=za();We(he=>Math.max(he-ue,0));return}case"Home":if(Lt&&G.selectedSuggestionIndex>=0){R.preventDefault(),yt.current=!0,We(0);return}break;case"End":if(Lt&&G.selectedSuggestionIndex>=0){R.preventDefault(),yt.current=!0,We(G.suggestions.length-1);return}break;case"Enter":if(G.selectedSuggestionIndex>=0){const ue=G.suggestions[G.selectedSuggestionIndex];if(ue.type==="loading"||ue.type==="error"){R.preventDefault(),tn(),l&&l(Be.current,G.ast,R);return}if(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!"){R.preventDefault(),tn();const he=Be.current,xe=G.cursorOffset;if(xe<=he.length&&he[xe]!==" "){const Qe=he.slice(0,xe),at=he.slice(xe),ze=Qe+" "+at;Ea(ze,xe+1,()=>{l&&l(ze,G.ast,R)})}else l&&l(he,G.ast,R);return}R.preventDefault(),Dr(ue,"Enter",void 0,R);return}R.preventDefault(),tn(),l&&l(Be.current,G.ast,R);return;case"Tab":if(U){R.preventDefault();const ue=G.selectedSuggestionIndex>=0?G.suggestions[G.selectedSuggestionIndex]:null,he=ue&&ue.type!=="loading"&&ue.type!=="error"&&!(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!")?ue:null,xe=U({suggestion:he,cursorContext:G.cursorContext||{type:"EMPTY",partial:""},query:Be.current});xe.accept&&he?Dr(he,"Tab",(Qe,at)=>{var ze;xe.submit&&l&&l(Qe,at,R),xe.blur&&((ze=se.current)==null||ze.blur())},R):(tn(),xe.submit&&l&&l(Be.current,G.ast,R),xe.blur&&((ve=se.current)==null||ve.blur()));return}if(G.selectedSuggestionIndex>=0){const ue=G.suggestions[G.selectedSuggestionIndex];if(ue.type==="hint"&&ue.text!=="#"&&ue.text!=="!"){R.preventDefault(),tn();const he=Be.current,xe=G.cursorOffset;if(xe<=he.length&&he[xe]!==" "){const Qe=he.slice(0,xe),at=he.slice(xe),ze=Qe+" "+at,Nn=xe+1;Ea(ze,Nn,kt=>{ma(kt,Nn)})}return}R.preventDefault(),Dr(ue,"Tab",void 0,R);return}break;case"Escape":R.preventDefault(),tn();return}if(R.key==="Tab"&&U){R.preventDefault();const ue=U({suggestion:null,cursorContext:G.cursorContext||{type:"EMPTY",partial:""},query:Be.current});ue.submit&&l&&l(Be.current,G.ast,R),ue.blur&&((Fe=se.current)==null||Fe.blur());return}if(G.showDatePicker&&R.key==="Escape"){R.preventDefault(),tn();return}if(R.key==="Enter"&&!G.showDropdown&&!G.showDatePicker){R.preventDefault(),l&&l(Be.current,G.ast,R);return}},[l,tn,Dr,Ea,Ar,Wt,ie,ce,ma,P,U,Yn,Vn,Le,Lt,za,qe]),hs=v.useCallback(R=>{if(yt.current){yt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(R.key)){if(!se.current)return;const G=xr(se.current);Zt(G.start),_n(G.end),na(Tt.current.tokens,G.start,G.end)}},[na]),Vu=v.useCallback(()=>{fa(!0),K==null||K();const R=requestAnimationFrame(()=>{if(en.current.delete(R),se.current){const G=Tt.current.tokens,Se=G.length>0?jl(se.current):0;Zt(Se),_n(Se),na(G,Se)}});en.current.add(R)},[La,na,K]),ms=v.useCallback(()=>{var R;fa(!1),lt(!1),Kt(!1),$e([]),wn.current=!1,(R=Qt.current)==null||R.abort(),Pt.current&&(clearTimeout(Pt.current),Pt.current=null),Je.current&&(clearTimeout(Je.current),Je.current=null),Zt(-1),W==null||W()},[W]),Or=v.useRef(!1),Fu=v.useCallback(R=>{if(!se.current||R.detail!==2&&R.detail!==3)return;if(R.detail===3){if(!Tt.current.ast)return;const xe=document.caretRangeFromPoint(R.clientX,R.clientY);if(!xe)return;const Qe=Nu(se.current,xe.startContainer,xe.startOffset),at=fj(Tt.current.ast,Be.current,Qe);if(!at||at.start>=at.end)return;R.preventDefault(),Or.current=!0,Kr(se.current,at.start,at.end);return}R.preventDefault(),Or.current=!0;const G=document.caretRangeFromPoint(R.clientX,R.clientY);if(!G)return;const Se=Nu(se.current,G.startContainer,G.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&&Kr(se.current,ue,he)},[]),aa=v.useCallback(R=>{Or.current&&(R.preventDefault(),Or.current=!1)},[]),Mr=v.useCallback(()=>{if(!se.current)return;const R=xr(se.current);if(Zt(R.start),_n(R.end),R.start!==R.end){const[G,Se]=ax(Tt.current.tokens,R.start,R.end);if(G!==Se){tn();return}}na(Tt.current.tokens,R.start,R.end)},[na,tn]),kr=v.useCallback(R=>{jt.current&&(clearTimeout(jt.current),jt.current=null),Kj(R),La()},[La]),Bl=v.useCallback(R=>{R.preventDefault();const G=tx(R.clipboardData.getData("text/plain"));if(ye){const Se=ye(G,R);Se!=null&&typeof(Se==null?void 0:Se.then)=="function"?Se.then(ve=>{ve!=null&&kr(ve)}).catch(()=>{}):Se!=null&&kr(Se)}else kr(G)},[ye,kr]),Kc=v.useCallback(R=>{q.current="navigation";const G=Tt.current,Se=C.current,ve=Se?Se.start:G.cursorOffset,Fe=Se?Se.end:G.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,Nn=>{se.current&&se.current.focus(),ma(Nn,ze)})},[Ea,ma,ee]),al=Bu(x),$l=$u(b),ql=Rj(al,A),_r={...jj(al,$l),...In?Tj($l):{}};dr&&(_r.whiteSpace="nowrap",_r.overflow="hidden",_r.textOverflow="ellipsis");const Iu=Dj(al,$l);return v.createElement("div",{ref:Wn,style:ql,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:_r,onInput:La,onKeyDown:vi,onKeyUp:hs,onMouseDown:Fu,onMouseUp:aa,onFocus:Vu,onBlur:ms,onClick:Mr,onPaste:Bl,onCompositionStart:Wa,onCompositionEnd:gi,spellCheck:!1}),tl&&!In?v.createElement("div",{className:Ma("ei-placeholder",N==null?void 0:N.placeholder),style:Iu},w):null,v.createElement(Qj,{errors:Mn,editorRef:St,cursorOffset:wt,colors:x,styles:b,containerRef:Wn.current,classNames:N?{squiggly:N.squiggly,tooltip:N.tooltip}:void 0}),v.createElement(qj,{suggestions:Ke,selectedIndex:Ht,onSelect:R=>Dr(R,"Tab"),position:Fn,colors:x,styles:b,visible:ot,fixedWidth:Yu(),renderHistoryItem:le,renderSavedSearchItem:Ye,renderDropdownHeader:Ie,cursorContext:wa,listRefCallback:R=>{jr.current=R},renderType:An,classNames:N?{dropdown:N.dropdown,dropdownHeader:N.dropdownHeader,dropdownItem:N.dropdownItem}:void 0}),ct&&Fn?v.createElement(gT,{position:Fn,colors:al,onSelect:Kc,colorConfig:x,styleConfig:b,datePickerInit:Ul,fixedWidth:void 0,datePresets:Y,datePickerClassName:N==null?void 0:N.datePicker}):null)}const yT=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function gx(t){var u;const a=window.getSelection();if(!a||a.rangeCount===0)return((u=t.textContent)==null?void 0:u.length)??0;const l=a.getRangeAt(0),i=l.cloneRange();return i.selectNodeContents(t),i.setEnd(l.endContainer,l.endOffset),i.toString().length}function xT(t){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const l=a.key.toLowerCase(),i=a.currentTarget,u=i.isContentEditable?i:i.querySelector("[contenteditable='true'], [contenteditable]")??i,o=t.current;if(l==="h"&&o){a.preventDefault();const m=o.getValue();let p=gx(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(l==="u"&&o){a.preventDefault();const m=o.getValue();let p=gx(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=l==="j"?"ArrowDown":l==="k"?"ArrowUp":null;f&&(a.preventDefault(),u.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function Nh(t){return String(t>0?t:0).padStart(3,"0")}function bT({features:t,phases:a,query:l,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,A)=>N-A),x=[...new Set(a.map(N=>N.number))].sort((N,A)=>N-A),b=[...new Set(a.flatMap(N=>N.tasks.map(A=>A.number)))].sort((N,A)=>N-A),w=[...new Set([...t.map(N=>N.shortId),...a.flatMap(N=>[N.shortId,...N.tasks.map(A=>A.shortId)])].filter(Boolean))],S=[...new Set(a.flatMap(N=>N.tasks.map(A=>A.title)))];return{featureNums:g,phaseNums:x,taskNums:b,shortIds:w,titles:S}},[t,a]);async function p(g,x){const b=x.toLowerCase();return g==="feature"?m.featureNums.filter(w=>String(w).startsWith(x)).slice(0,20).map(w=>({text:String(w),label:`F${Nh(w)}`})):g==="phase"?m.phaseNums.filter(w=>String(w).startsWith(x)).slice(0,20).map(w=>({text:String(w),label:`P${Nh(w)}`})):g==="task"?m.taskNums.filter(w=>String(w).startsWith(x)).slice(0,20).map(w=>({text:String(w),label:`T${Nh(w)}`})):g==="id"?m.shortIds.filter(w=>w.toLowerCase().startsWith(b)).slice(0,20).map(w=>({text:w,label:w})):g==="status"||g==="feature-status"||g==="phase-status"?yT.filter(w=>w.startsWith(b)).map(w=>({text:w,label:w})):g==="title"?m.titles.filter(w=>w.toLowerCase().includes(b)).slice(0,20).map(w=>({text:w,label:w.length>44?w.slice(0,44)+"…":w})):[]}return d.jsx("div",{className:"search-bar",children:d.jsx(vT,{fields:f,value:l,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 ST(t,a){if(Object.keys(a).length===0)return t;const l=o=>{const f=a[o];return f?new Map(f.map((m,p)=>[m,p])):null},i=l("__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=l(`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=l(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((b,w)=>(g.get(b.id)??1/0)-(g.get(w.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function wT({features:t,phases:a,activeTasks:l,projectStorageScope:i}){const u=ij({features:t,phases:a,projectStorageScope:i}),[o,f]=v.useState({});v.useEffect(()=>{f({})},[u.displayedWorkTree]);const m=v.useMemo(()=>ST(u.displayedWorkTree,o),[u.displayedWorkTree,o]),[p,g]=v.useState(!1),[x,b]=v.useState(null),[w,S]=v.useState(null),N=ee=>S(String(ee.active.id)),[A,j]=v.useState(0);v.useEffect(()=>{const ee=document.querySelector("header");if(!ee)return;const be=()=>j(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 H=z.top+window.scrollY-Ee.offsetHeight;window.scrollTo({top:Math.max(0,H),behavior:"smooth"})}},60);return()=>window.clearTimeout(ee)},[u.searchQuery,u.hideDone,u.hidePlanned,u.onlyActiveBranches]);const L=NR(ER(om,{activationConstraint:{distance:5}})),I=async ee=>{const{active:be,over:Ee}=ee;if(S(null),!Ee||be.id===Ee.id)return;const z=String(be.id),H=String(Ee.id),ie=m.map(ce=>ce.feature.id);if(ie.includes(z)&&ie.includes(H)){const ce=yu(ie,ie.indexOf(z),ie.indexOf(H)),pe=ce.indexOf(z),D=pe>0?ce[pe-1]??null:null,$=pe<ce.length-1?ce[pe+1]??null:null;f(ne=>({...ne,__features__:ce})),await ih("feature",z,D,$).catch(()=>{});return}for(const ce of m){const pe=ce.allPhases.map(D=>D.phase.id);if(pe.includes(z)&&pe.includes(H)){const D=yu(pe,pe.indexOf(z),pe.indexOf(H)),$=D.indexOf(z),ne=$>0?D[$-1]??null:null,de=$<D.length-1?D[$+1]??null:null;f(je=>({...je,[`phase-scope:${ce.feature.id}`]:D})),await ih("phase",z,ne,de).catch(()=>{});return}}for(const ce of m)for(const pe of ce.allPhases){const D=pe.allTasks.map($=>$.id);if(D.includes(z)&&D.includes(H)){const $=yu(D,D.indexOf(z),D.indexOf(H)),ne=$.indexOf(z),de=ne>0?$[ne-1]??null:null,je=ne<$.length-1?$[ne+1]??null:null;f(Ne=>({...Ne,[`task-scope:${pe.phase.id}`]:$})),await ih("task",z,de,je).catch(()=>{});return}}},Y=ee=>u.expandedPhaseIds.includes(ee),P=ee=>u.recentPhaseIds.includes(ee),K=ee=>u.recentTaskIds.includes(ee),[W,U]=Lc(),[T,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(H=>H.tasks.map(ie=>({t:ie,p:H}))).find(({t:H})=>H.number===ye);if(!ee){U(H=>(H.delete("locate"),H),{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 H=Ee.featureId;u.expandedFeatureIds.includes(H)||u.setExpandedFeatureIds(ie=>ie.includes(H)?ie:[...ie,H])}u.expandedPhaseIds.includes(Ee.id)||u.setExpandedPhaseIds(H=>H.includes(Ee.id)?H:[...H,Ee.id]);const z=document.getElementById(`task-row-${ye}`);if(z){const H=document.querySelector("header"),ie=document.querySelector(".ap-search-sticky"),ce=((H==null?void 0:H.offsetHeight)??0)+((ie==null?void 0:ie.offsetHeight)??0)+12,pe=z.getBoundingClientRect().top+window.scrollY-ce;window.scrollTo({top:Math.max(0,pe),behavior:"smooth"}),oe(be.id);const D=window.setTimeout(()=>oe(null),2500);return U($=>($.delete("locate"),$),{replace:!0}),()=>window.clearTimeout(D)}},[ye,a,u.expandedFeatureIds,u.expandedPhaseIds,u.onlyActiveBranches,u.hideDone,u.searchQuery,u.treeOpenMode]);const Re=()=>{if(!w)return null;for(const ee of m){if(ee.feature.id===w)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(Wr,{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===w)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(Wr,{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===w)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(Wr,{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(gn,{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(bt,{type:"button",variant:"secondary",onClick:()=>u.expandAll(),children:"Expand all"}),d.jsx(bt,{type:"button",variant:"secondary",onClick:()=>u.setTreeOpenMode("none"),children:"Collapse all"})]})]}),d.jsxs("div",{className:"ap-search-sticky z-20",style:{top:A},children:[d.jsx(bT,{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(bt,{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(bt,{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 jN(),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(N2,{sensors:L,collisionDetection:AR,onDragStart:N,onDragEnd:I,children:[d.jsx(fm,{items:m.map(ee=>ee.feature.id),strategy:dm,children:m.map(ee=>d.jsx(hm,{id:ee.feature.id,children:d.jsx(oj,{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:P,isTaskRecentlyChanged:K,highlightedTaskIds:(()=>{const be=u.searchActive?u.matchedTaskIds:void 0;if(!T)return be;const Ee=new Set(be??[]);return Ee.add(T),Ee})()})},ee.feature.id))}),d.jsx(V2,{dropAnimation:{duration:150,easing:"ease"},children:Re()})]}):l.length>0?l.map(ee=>{const be=ee.featureId?`/features/${ee.featureId}/phases/${ee.phaseId}/tasks/${ee.id}`:"/features";return d.jsxs(dt,{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",sR(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 ET(){const{features:t,phases:a,activeTasks:l}=cs(),{project:i}=Ou("root"),u=el(),o=()=>u("/project/edit");Zn("edit",o);const f=i.projectRoot||i.planRoot||i.name||"default";return d.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[d.jsx(gn,{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(Hn,{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.jsxs(bt,{type:"button",shortcut:"edit",onClick:o,className:"self-start",children:[d.jsx(us,{className:"h-4 w-4"}),"Edit project"]})]})}),d.jsx(JN,{project:i}),d.jsx(uR,{features:t,phases:a}),d.jsx(wT,{features:t,phases:a,activeTasks:l,projectStorageScope:f}),d.jsx(eR,{features:t,phases:a}),d.jsx(nR,{features:t,phases:a})]})}async function NT(){const[t,a]=await Promise.all([hb(),tm()]);return{features:t,phases:a}}function Ru(){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 RT(t){const a=Ru();for(const l of t){if(l.status==="in-progress"||l.status==="discovery"){a.active+=1;continue}if(l.status==="planned"||l.status==="draft"){a.planned+=1;continue}if(l.status==="done"){a.done+=1;continue}if(l.status==="blocked"){a.blocked+=1;continue}l.status==="canceled"&&(a.canceled+=1)}return a}function Wb(t){const a=Ru();for(const l of t){if(l.status==="in-progress"){a.active+=1;continue}if(l.status==="planned"){a.planned+=1;continue}if(l.status==="done"){a.done+=1;continue}if(l.status==="blocked"){a.blocked+=1;continue}l.status==="canceled"&&(a.canceled+=1)}return a}function jT(t){const a=Ru();for(const l of t){if(l.status==="in-progress"){a.active+=1;continue}if(l.status==="planned"){a.planned+=1;continue}if(l.status==="done"){a.done+=1;continue}if(l.status==="blocked"){a.blocked+=1;continue}l.status==="canceled"&&(a.canceled+=1)}return a}function TT({feature:t,phasesCount:a,tasksCount:l,phaseSummary:i,taskSummary:u,activity:o}){var A;const f=is(),m=is(),g=((A=f.formData)==null?void 0:A.get("status"))??t.status,x=f.state!=="idle",b=m.state!=="idle",w=Tc(i),S=Tc(u),N=t.description||(o?`${o.doneTasks}/${l} 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(Ll,{type:"feature",number:t.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:g})})]}),d.jsx(dt,{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(dt,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:d.jsx(bt,{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(us,{className:"h-3.5 w-3.5"})})}),d.jsx(m.Form,{method:"post",action:`/features/${t.id}/delete`,onSubmit:j=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||j.preventDefault()},children:d.jsx(bt,{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(ni,{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"]}),w?d.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l," 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:j=>f.submit(j.currentTarget.form),children:Xc.map(j=>d.jsx("option",{value:j.value,children:j.label},j.value))}),d.jsx(_l,{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(dt,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:d.jsx(bt,{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(us,{className:"h-3.5 w-3.5"})})}),d.jsx(m.Form,{method:"post",action:`/features/${t.id}/delete`,className:"hidden xl:block",onSubmit:j=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||j.preventDefault()},children:d.jsx(bt,{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(ni,{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 DT={feature:{label:"Feature",Icon:bc},phase:{label:"Phase",Icon:YE},task:{label:"Task",Icon:em}};function CT({kind:t,label:a}){const{Icon:l,label:i}=DT[t];return d.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[d.jsx(l,{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 qu({className:t="",...a}){return d.jsx("select",{className:`field-control ${t}`,...a})}function gm({query:t,status:a,statusOptions:l,placeholder:i,clearTo:u,resultsLabel:o}){const f=Wh();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-9 py-2 sm:min-h-11 sm: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(qu,{id:"list-filter-status",name:"status",defaultValue:a,className:"min-h-9 appearance-none py-2 sm:min-h-11 sm:py-2.5 pr-8",children:[d.jsx("option",{value:"",children:"All statuses"}),l.map(m=>d.jsx("option",{value:m.value,children:m.label},m.value))]}),d.jsx(_l,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}),d.jsx(bt,{type:"submit",variant:"secondary",children:"Apply filters"}),d.jsx(dt,{to:u,className:"inline-flex min-h-9 items-center justify-center rounded-[12px] px-3 text-sm font-semibold text-[var(--text-muted)] transition hover:bg-[var(--accent-soft)] hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px]",children:"Clear"}),d.jsx("div",{className:"text-sm text-[var(--text-muted)] md:col-span-4",children:o})]})}function vm(t,a){const l=t.trim().toLowerCase();return l?a.some(i=>i==null?void 0:i.toLowerCase().includes(l)):!0}function AT(t){const a=new Map,l=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),l.set(f,m.reduce((p,g)=>p+g.tasks.length,0)),i.set(f,RT(m)),u.set(f,Wb(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,tasksByFeature:l,phaseSummaryByFeature:i,taskSummaryByFeature:u}}function OT(){var w,S;const{features:t,phases:a}=cs(),{phasesByFeature:l,tasksByFeature:i,phaseSummaryByFeature:u,taskSummaryByFeature:o}=AT(a),f=el(),[m]=Lc(),p=((w=m.get("q"))==null?void 0:w.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)&&vm(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(gn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{children:[d.jsx(CT,{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(dt,{to:"new",children:d.jsx(bt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),d.jsx(gm,{query:p,status:g,statusOptions:Xc,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:t.length===0?d.jsxs(gn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",d.jsx(dt,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):b.length>0?b.map(N=>d.jsx(TT,{feature:N,phasesCount:l.get(N.id)??0,tasksCount:i.get(N.id)??0,phaseSummary:u.get(N.id)??Ru(),taskSummary:o.get(N.id)??Ru()},N.id)):d.jsx(gn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),d.jsx(Mu,{})]})}async function MT({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[l,i]=await Promise.all([ku(a),tm(a)]);return{feature:l,phases:i}}function kT({featureId:t,feature:a,phase:l}){var x;const i=is(),u=is(),f=((x=i.formData)==null?void 0:x.get("status"))??l.status,m=i.state!=="idle",p=u.state!=="idle",g=Tc(Wb(l.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(Ll,{type:"phase",number:l.number}),d.jsx(ai,{type:"phase",featureNum:a.number}),l.handoff?d.jsx(am,{phaseId:l.id,updatedAt:l.handoffUpdatedAt}):null,d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:f})})]}),d.jsx(dt,{to:`/features/${t}/phases/${l.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:l.title})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[d.jsx(dt,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,children:d.jsx(bt,{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(us,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,onSubmit:b=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(bt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:d.jsx(ni,{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:[l.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/${l.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:Pc.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))}),d.jsx(_l,{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(dt,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,className:"hidden lg:block",children:d.jsx(bt,{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(us,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,className:"hidden lg:block",onSubmit:b=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(bt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:d.jsx(ni,{className:"h-4 w-4"})})})]}),l.summary?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.summary}):null]})}function ym({items:t,className:a="",stacked:l=!1}){return l?d.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${a}`,children:t.map((i,u)=>{const o=u===t.length-1,f=i.to&&!o?d.jsx(dt,{to:i.to,className:"font-semibold text-[var(--accent)] hover:underline break-words min-w-0",children:i.label}):d.jsx("span",{className:`break-words min-w-0 ${o?"text-[var(--text)] font-semibold":"text-[var(--text-muted)]"}`,children:i.label});return d.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[i.kind?d.jsxs("span",{className:"shrink-0 text-[var(--text-subtle)] font-medium",children:[i.kind,":"]}):null,d.jsx("span",{className:"min-w-0",children:f})]},`${i.label}-${u}`)})}):d.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:t.map((i,u)=>{const o=u===t.length-1,f=i.to&&!o?d.jsx(dt,{to:i.to,className:"font-semibold text-[var(--accent)] hover:underline",children:i.label}):d.jsx("span",{className:o?"text-[var(--text)]":"text-[var(--text-muted)]",children:i.label});return d.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[u>0?d.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,d.jsx("span",{className:"min-w-0 break-words",children:f})]},`${i.label}-${u}`)})})}function bn({className:t="",children:a,...l}){return d.jsx("div",{className:`surface-card p-4 ${t}`,...l,children:a})}function Dc({title:t,actions:a,defaultOpen:l=!0,count:i,children:u}){return d.jsxs("details",{className:"group mt-4 border border-[var(--border)] rounded-lg overflow-hidden",open:l,children:[d.jsxs("summary",{className:"flex items-center justify-between gap-2 p-3 cursor-pointer font-semibold text-[var(--text)] bg-[var(--surface-elevated)] hover:bg-[var(--surface-strong)] transition-colors select-none",children:[d.jsxs("span",{className:"flex items-center gap-2 text-sm",children:[t,i!==void 0?d.jsxs("span",{className:"text-[var(--text-subtle)]",children:["(",i,")"]}):null]}),d.jsxs("span",{className:"flex items-center gap-2",children:[a,d.jsx(_l,{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:u})]})}function xm({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(Hn,{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(Hn,{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(Hn,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}const _T={draft:CE,discovery:lN,planned:em,"in-progress":LE,done:ob,blocked:eN,waiting:kE,deferred:oN,canceled:SE,rejected:OE};function Rh(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function vx(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}const LT=new Set(["canceled","rejected"]);function bm({statusLog:t,currentStatus:a,backbone:l,createdAt:i,updatedAt:u,startedAt:o,completedAt:f}){const m=[];if(t.length===0){const S=l.indexOf(a);if(S>=0)for(let N=0;N<=S;N++)m.push(l[N]);else m.push(a)}else{const S=t[0];S&&m.push(S.fromStatus);for(const N of t)m[m.length-1]!==N.toStatus&&m.push(N.toStatus)}m[m.length-1]!==a&&m.push(a);const p=new Set(m),g=a==="done"||LT.has(a),x=[...m];if(!g){const S=l.indexOf(a);if(S>=0&&S+1<l.length){const N=l[S+1];p.has(N)||x.push(N)}}const b=S=>p.has(S)?S===a&&!g?"current":"completed":"pending",w=S=>{var A,j;if(t.length>0){if(S===((A=t[0])==null?void 0:A.fromStatus))return((j=t[0])==null?void 0:j.date)??"";for(const L of t)if(L.toStatus===S)return L.date;return""}const N=l[0];return S===N?i??"":S==="in-progress"?o??u??"":S==="done"?f??u??"":""};return d.jsx("ol",{className:"status-stepper",role:"list","aria-label":"Status progress",children:x.map((S,N)=>{const A=b(S),j=_T[S]??UE,L=p.has(S),I=w(S),Y=I?`${Rh(S)} — ${vx(I)}`:Rh(S),P=N===0?null:L?"traveled":"pending";return d.jsxs("li",{className:`status-step status-step--${A}`,role:"listitem","aria-current":A==="current"?"step":void 0,style:{"--step-color":`var(--color-status-${S})`},children:[P?d.jsx("span",{className:`status-connector status-connector--${P}`,"aria-hidden":"true"}):null,d.jsx("span",{className:"status-node",title:Y,children:d.jsx(j,{className:"status-node-icon"})}),d.jsx("span",{className:"status-step-label",children:Rh(S)}),I?d.jsx("span",{className:"status-step-date",children:vx(I)}):null]},`${S}-${N}`)})})}function yx(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function zT(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}function UT(t,a,l,i,u){if(t.length>0)return t.map(m=>({date:m.date,fromStatus:m.fromStatus,toStatus:m.toStatus,inferred:!1}));const o=l.indexOf(a);if(o<0)return[];const f=[];for(let m=1;m<=o;m++){const p=l[m-1],g=l[m],x=g==="in-progress"?i??"":g==="done"?u??"":"";f.push({date:x,fromStatus:p,toStatus:g,inferred:!0})}return f}function Sm({statusLog:t,currentStatus:a,backbone:l,startedAt:i,completedAt:u}){const o=UT(t??[],a??"",l??[],i,u),f=o.length>0;return d.jsxs("details",{className:"group mt-4 border border-[var(--border)] rounded-lg overflow-hidden",open:f,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.jsxs("span",{className:"text-sm",children:["Status history (",o.length,")"]}),d.jsx(_l,{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)] grid gap-2.5",children:o.length===0?d.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."}):o.map((m,p)=>d.jsxs("div",{className:"text-sm flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:"text-xs font-mono text-[var(--text-subtle)]",children:zT(m.date)}),d.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:yx(m.fromStatus)}),d.jsx("span",{className:"text-[var(--text-subtle)]",children:"→"}),d.jsx("span",{className:"font-semibold text-[var(--text)]",children:yx(m.toStatus)})]},p))})]})}function HT(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function BT(t){let a=0,l=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"&&(l+=1),f.status==="blocked"&&(i+=1),["done","canceled"].includes(f.status)||(u+=1);return{inProgress:a,done:l,blocked:i,remaining:u}}function $T(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function qT(){var A,j;const{feature:t,phases:a}=cs(),l=t.acceptedDecisions??[],i=HT(a),u=BT(a),o=$T(a),[f]=Lc(),m=((A=f.get("q"))==null?void 0:A.trim())??"",p=((j=f.get("status"))==null?void 0:j.trim())??"",g=v.useMemo(()=>a.filter(L=>(!p||L.status===p)&&vm(m,[L.title,L.id,L.summary,L.description])),[a,m,p]),x=el(),b=v.useRef(null),w=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",w),Zn("create",S),Zn("delete",N),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(dt,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(zc,{className:"h-4 w-4"})," Back to features"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(ym,{stacked:!0,items:[{label:t.name,kind:"Feature"}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(zl,{id:si({featureNum:t.number}),children:d.jsx(Wr,{featureNum:t.number})}),t.shortId?d.jsx(ii,{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(Dc,{title:"Description",children:d.jsx(Hn,{text:t.description,className:"plan-description max-w-4xl"})}):null,d.jsx("div",{className:"mt-4",children:d.jsx(bm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"],createdAt:t.createdAt,updatedAt:t.updatedAt})}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(dt,{to:"edit",children:d.jsx(bt,{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(bt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),d.jsxs(gn,{className:"grid gap-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(Hn,{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(Hn,{text:t.workRemaining,className:"mt-2"})]}):null]}):null,l.length>0?d.jsx(xm,{decisions:l}):null,d.jsx(Sm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"]})]}),d.jsxs(gn,{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(Ll,{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(dt,{to:"phases/new",children:d.jsx(bt,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),d.jsx(gm,{query:m,status:p,statusOptions:Pc,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:a.length===0?d.jsxs(gn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",d.jsx(dt,{to:`/features/${t.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):g.length>0?g.map(L=>d.jsx(kT,{featureId:t.id,feature:t,phase:L},L.id)):d.jsx(gn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),d.jsx(Mu,{})]})}async function YT({params:t}){const{featureId:a,phaseId:l}=t;if(!a||!l)throw new Response("featureId and phaseId required",{status:400});const[i,u]=await Promise.all([ku(a),$c(l)]);return{feature:i,phase:u}}function xx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function VT({featureId:t,phaseId:a,task:l}){var x;const i=is(),u=is(),f=((x=i.formData)==null?void 0:x.get("status"))??l.status,m=i.state!=="idle",p=u.state!=="idle",g=Tc(jT(l.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(Ll,{type:"task",number:l.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Sa,{status:f})})]}),d.jsx(dt,{to:`/features/${t}/phases/${a}/tasks/${l.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:l.title})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[d.jsx(dt,{to:`/features/${t}/phases/${a}/tasks/${l.id}/edit`,"aria-label":`Edit task ${l.title}`,children:d.jsx(bt,{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(us,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${l.id}/delete`,onSubmit:b=>{window.confirm(`Delete task “${l.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(bt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${l.title}`,children:d.jsx(ni,{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:[l.subtasks.length," subtasks · ",l.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/${l.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:Hu.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))}),d.jsx(_l,{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(dt,{to:`/features/${t}/phases/${a}/tasks/${l.id}/edit`,"aria-label":`Edit task ${l.title}`,className:"hidden lg:block",children:d.jsx(bt,{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(us,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${l.id}/delete`,className:"hidden lg:block",onSubmit:b=>{window.confirm(`Delete task “${l.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(bt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${l.title}`,children:d.jsx(ni,{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:[l.startedAt?d.jsxs("span",{children:["Started ",xx(l.startedAt)]}):null,l.completedAt?d.jsxs("span",{children:["Completed ",xx(l.completedAt)]}):null]}),l.description?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.description}):null]})}function FT(t){let a=0,l=0,i=0,u=0;for(const o of t.tasks)o.status==="in-progress"&&(a+=1),o.status==="done"&&(l+=1),o.status==="blocked"&&(i+=1),["done","canceled"].includes(o.status)||(u+=1);return{inProgress:a,done:l,blocked:i,remaining:u}}function IT(){var Y,P;const{feature:t,phase:a}=cs(),l=a.decisions??[],i=a.acceptedDecisions??[],u=FT(a),[o]=Lc(),f=((Y=o.get("q"))==null?void 0:Y.trim())??"",m=((P=o.get("status"))==null?void 0:P.trim())??"",p=v.useMemo(()=>a.tasks.filter(K=>(!m||K.status===m)&&vm(f,[K.title,K.id,K.description,K.shortName])),[a.tasks,f,m]),g=el(),x=v.useRef(null),[b,w]=v.useState(a.handoff??""),[S,N]=v.useState(!1),A=v.useCallback(()=>g("edit"),[g]),j=v.useCallback(()=>g("tasks/new"),[g]),L=v.useCallback(()=>{var K;(K=x.current)==null||K.requestSubmit()},[]),I=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){N(!0);try{await NN(a.id),w("")}catch{}finally{N(!1)}}},[a.id]);return Zn("edit",A),Zn("create",j),Zn("delete",L),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(dt,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(zc,{className:"h-4 w-4"})," Back to feature"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(ym,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:a.title,kind:"Phase"}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(zl,{id:si({featureNum:t.number,phaseNum:a.number}),children:d.jsx(Wr,{featureNum:t.number,phaseNum:a.number})}),a.shortId?d.jsx(ii,{shortId:a.shortId}):null,b?d.jsx(am,{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(Hn,{text:a.summary,className:"mt-3 max-w-4xl"}):null,d.jsx(bm,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:a.createdAt,updatedAt:a.updatedAt}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(dt,{to:"edit",children:d.jsx(bt,{type:"button",shortcut:"edit",children:"Edit phase"})}),d.jsx(dt,{to:"tasks/new",children:d.jsx(bt,{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(bt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),d.jsxs(gn,{className:"grid gap-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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(bn,{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.jsx(Dc,{title:"Description",children:d.jsx(Hn,{text:a.description,className:"plan-description"})}):null,l.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 (",l.length,")"]})}),d.jsx("div",{className:"mt-2 ml-4 space-y-2 border-l-2 border-[var(--border)] pl-4",children:l.map((K,W)=>d.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:d.jsx(Hn,{text:K})},W))})]}):null,i.length>0?d.jsx(xm,{decisions:i}):null,d.jsx(Sm,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"]})]}),b?d.jsx(gn,{className:"grid gap-4",children:d.jsx(Dc,{title:"Handoff",actions:d.jsx("button",{type:"button",onClick:I,disabled:S,className:"rounded-lg border border-[var(--border)] px-3 py-1.5 text-sm text-[var(--text-muted)] hover:bg-[var(--surface-card)] disabled:opacity-60",children:S?"Clearing…":"Clear handoff"}),children:d.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:d.jsx(Hn,{text:b,className:"formatted-text max-w-none"})})})}):null,d.jsxs(gn,{className:"grid gap-5",children:[d.jsxs("div",{children:[d.jsx(Ll,{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(gm,{query:f,status:m,statusOptions:Hu,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:a.tasks.length===0?d.jsxs(gn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",d.jsx(dt,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):p.length>0?p.map(K=>d.jsx(VT,{featureId:t.id,phaseId:a.id,task:K},K.id)):d.jsx(gn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),d.jsx(Mu,{})]})}async function GT({params:t}){const{featureId:a,phaseId:l,taskId:i}=t;if(!a||!l||!i)throw new Response("featureId, phaseId and taskId required",{status:400});const[u,o,f]=await Promise.all([ku(a),$c(l),qc(i)]);return{feature:u,phase:o,task:f}}function bx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function XT({featureId:t,phaseId:a,taskId:l,item:i}){const u=is(),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/${l}/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.jsxs("div",{className:"min-w-0",children:[d.jsx("span",{className:"checklist-num",children:i.number})," ",d.jsx("span",{className:`text-sm ${o?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:i.title})]})]})}function PT(){var x,b;const{feature:t,phase:a,task:l}=cs(),i=l.decisions??[],u=l.acceptedDecisions??[],o=l.checklist??[],f=el(),m=v.useRef(null),p=v.useCallback(()=>f("edit"),[f]),g=v.useCallback(()=>{var w;(w=m.current)==null||w.requestSubmit()},[]);return Zn("edit",p),Zn("delete",g),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(dt,{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(zc,{className:"h-4 w-4"})," Back to phase"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(ym,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:a.title,to:`/features/${t.id}/phases/${a.id}`,kind:"Phase"},{label:l.title,kind:"Task"}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(zl,{id:si({featureNum:t.number,phaseNum:a.number,taskNum:l.number}),children:d.jsx(Wr,{featureNum:t.number,phaseNum:a.number,taskNum:l.number})}),l.shortId?d.jsx(ii,{shortId:l.shortId}):null,d.jsx(Sa,{status:l.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:l.title}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(dt,{to:"edit",children:d.jsx(bt,{type:"button",shortcut:"edit",children:"Edit task"})}),d.jsx(_a,{ref:m,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${l.id}/delete`,className:"inline-flex",onSubmit:w=>{window.confirm(`Delete task "${l.title}"?`)||w.preventDefault()},children:d.jsx(bt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),d.jsx(bm,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],createdAt:l.createdAt,updatedAt:l.updatedAt,startedAt:l.startedAt,completedAt:l.completedAt}),d.jsxs(gn,{className:"grid gap-4",children:[l.description?d.jsx(Dc,{title:"Description",children:d.jsx(Hn,{text:l.description,className:"plan-description"})}):null,l.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(_l,{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(Hn,{text:l.notes})})]}):d.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:"No notes"}),d.jsx(Sm,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],startedAt:l.startedAt,completedAt:l.completedAt}),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((w,S)=>d.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:d.jsx(Hn,{text:w})},S))})]}):null,u.length>0?d.jsx(xm,{decisions:u}):null,d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[d.jsxs(bn,{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(bn,{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:((x=l.subtasks)==null?void 0:x.length)??0})]}),d.jsxs(bn,{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:l.startedAt?bx(l.startedAt):"—"})]}),d.jsxs(bn,{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:l.completedAt?bx(l.completedAt):"—"})]}),d.jsxs(bn,{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})]})]}),d.jsxs("div",{className:"grid gap-3",children:[d.jsx("div",{children:d.jsxs("h3",{className:"text-sm font-bold text-[var(--text)]",children:["Steps (",o.length,")"]})}),o.length?d.jsx("div",{className:"grid gap-2",children:o.map(w=>d.jsx(XT,{featureId:t.id,phaseId:a.id,taskId:l.id,item:w},w.id))}):d.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(b=l.subtasks)!=null&&b.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:l.subtasks.map(w=>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:w.title}),d.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:w.id})]}),d.jsx(Sa,{status:w.status})]},w.id))})]}):null]}),d.jsx(Mu,{})]})}const QT=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function di({title:t,description:a,children:l}){const i=el(),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(QT)).filter(A=>A.offsetParent!==null);if(b.length===0){x.preventDefault(),f.focus();return}const w=b[0],S=b[b.length-1],N=document.activeElement;x.shiftKey?(N===w||!f.contains(N))&&(x.preventDefault(),S.focus()):N===S&&(x.preventDefault(),w.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(fN,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:l})]})})]})}function fi({className:t="",children:a,...l}){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}`,...l,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 zn(t){return d.jsx("textarea",{className:"field-control field-textarea",...t})}function KT(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);return Zn("submit",i,{allowInEditable:!0}),d.jsx(di,{title:"Create feature",description:"Top-level container for phases and tasks.",children:d.jsxs(_a,{ref:l,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(zn,{name:"description",placeholder:"Short context for the feature"})}),d.jsx(fi,{children:d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function ZT(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const o=Ou("feature-detail").feature;return d.jsx(di,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:d.jsxs(_a,{ref:l,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(zn,{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(qu,{name:"status",defaultValue:o.status,children:Xc.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(zn,{name:"workDone",defaultValue:o.workDone})}),d.jsx(Nt,{label:"Work remaining",children:d.jsx(zn,{name:"workRemaining",defaultValue:o.workRemaining})}),d.jsx(fi,{children:d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function JT(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);return Zn("submit",i,{allowInEditable:!0}),d.jsx(di,{title:"Create phase",description:"A phase belongs to the current feature.",children:d.jsxs(_a,{ref:l,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(zn,{name:"summary",placeholder:"Brief phase summary"})}),d.jsx(Nt,{label:"Description",children:d.jsx(zn,{name:"description",placeholder:"Initial implementation notes"})}),d.jsx(fi,{children:d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function Xs(t){return t.join(`
|
|
259
|
-
`)}function WT(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const o=Ou("phase-detail").phase;return d.jsx(di,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:d.jsxs(_a,{ref:l,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(qu,{name:"status",defaultValue:o.status,children:Pc.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(zn,{name:"summary",defaultValue:o.summary})}),d.jsx(Nt,{label:"Description",children:d.jsx(zn,{name:"description",defaultValue:o.description})}),d.jsx(Nt,{label:"Goals (one per line)",children:d.jsx(zn,{name:"goals",defaultValue:Xs(o.goals)})}),d.jsx(Nt,{label:"Non-goals (one per line)",children:d.jsx(zn,{name:"nonGoals",defaultValue:Xs(o.nonGoals)})}),d.jsx(Nt,{label:"Dependencies (one per line)",children:d.jsx(zn,{name:"dependencies",defaultValue:Xs(o.dependencies)})}),d.jsx(Nt,{label:"Risks (one per line)",children:d.jsx(zn,{name:"risks",defaultValue:Xs(o.risks)})}),d.jsx(Nt,{label:"Open questions (one per line)",children:d.jsx(zn,{name:"openQuestions",defaultValue:Xs(o.openQuestions)})}),d.jsx(Nt,{label:"Completion criteria (one per line)",children:d.jsx(zn,{name:"completionCriteria",defaultValue:Xs(o.completionCriteria)})}),d.jsx(fi,{children:d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function eD(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);return Zn("submit",i,{allowInEditable:!0}),d.jsx(di,{title:"Create task",description:"A task belongs to the current phase.",children:d.jsxs(_a,{ref:l,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(zn,{name:"description",placeholder:"Initial task context"})}),d.jsx(Nt,{label:"Checklist (one per line)",children:d.jsx(zn,{name:"checklist",placeholder:`Step one
|
|
260
|
-
Step two
|
|
261
|
-
Step three`})}),d.jsx(Nt,{label:"Status",children:d.jsx(qu,{name:"status",defaultValue:"planned",children:Hu.map(u=>d.jsx("option",{value:u.value,children:u.label},u.value))})}),d.jsx(fi,{children:d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function tD(t){return t.map(a=>a.title).join(`
|
|
262
|
-
`)}function nD(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const o=Ou("task-detail").task;return d.jsx(di,{title:"Edit task",description:"Update execution details and checklist items.",children:d.jsxs(_a,{ref:l,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(qu,{name:"status",defaultValue:o.status,children:Hu.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(zn,{name:"description",defaultValue:o.description})}),d.jsx(Nt,{label:"Checklist (one per line)",children:d.jsx(zn,{name:"checklist",defaultValue:tD(o.checklist)})}),d.jsx(fi,{children:d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function aD(){const a=kl().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);Zn("submit",i,{allowInEditable:!0});const{project:u}=Ou("root");return d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(dt,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(zc,{className:"h-4 w-4"})," Back to dashboard"]}),d.jsxs(gn,{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:l,method:"post",className:"grid gap-4",children:[d.jsx(Nt,{label:"Project goal",children:d.jsx(zn,{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(dt,{to:"/",children:d.jsx(bt,{type:"button",variant:"ghost",children:"Cancel"})}),d.jsx(bt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save goal"})]})]})]})]})}function ka(t,a){const l=t.get(a);if(typeof l!="string"||l.trim()==="")throw new Response(`Missing field: ${a}`,{status:400});return l.trim()}function ca(t,a){const l=t.get(a);return typeof l=="string"?l.trim():""}function wm(t,a){const l=t.get(a);if(typeof l!="string")return 0;const i=l.trim();if(i==="")return 0;const u=Number(i);return Number.isFinite(u)?u:0}function Cl(t,a){return ca(t,a).split(`
|
|
263
|
-
`).map(l=>l.trim()).filter(Boolean)}function cn(t,a){const l=t[a];if(!l)throw new Response(`Missing route param: ${a}`,{status:400});return l}async function rD({request:t}){const a=await t.formData();return await yN({name:ka(a,"name"),description:ca(a,"description")}),Rr("/features")}async function lD({request:t,params:a}){const l=cn(a,"featureId"),i=await ku(l),u=await t.formData();return await mb({...i,name:ka(u,"name"),description:ca(u,"description"),startDate:ca(u,"startDate"),endDate:ca(u,"endDate"),status:ka(u,"status"),priority:wm(u,"priority"),workDone:ca(u,"workDone"),workRemaining:ca(u,"workRemaining")}),Rr(`/features/${l}`)}async function sD({params:t}){return await xN(cn(t,"featureId")),Rr("/features")}async function iD({request:t,params:a}){const l=cn(a,"featureId"),i=await ku(l),u=await t.formData();return await mb({...i,status:ka(u,"status")}),null}async function uD({request:t,params:a}){const l=cn(a,"featureId"),i=await t.formData();return await bN({featureId:l,title:ka(i,"title"),summary:ca(i,"summary"),description:ca(i,"description")}),Rr(`/features/${l}`)}async function oD({request:t,params:a}){const l=cn(a,"featureId"),i=cn(a,"phaseId"),u=await $c(i),o=await t.formData();return await pb({...u,title:ka(o,"title"),status:ka(o,"status"),priority:wm(o,"priority"),summary:ca(o,"summary"),description:ca(o,"description"),goals:Cl(o,"goals"),nonGoals:Cl(o,"nonGoals"),dependencies:Cl(o,"dependencies"),risks:Cl(o,"risks"),openQuestions:Cl(o,"openQuestions"),completionCriteria:Cl(o,"completionCriteria")}),Rr(`/features/${l}/phases/${i}`)}async function cD({params:t}){const a=cn(t,"featureId"),l=cn(t,"phaseId");return await SN(l),Rr(`/features/${a}`)}async function dD({request:t,params:a}){const l=cn(a,"phaseId"),i=await $c(l),u=await t.formData();return await pb({...i,status:ka(u,"status")}),null}async function fD({request:t,params:a}){const l=cn(a,"featureId"),i=cn(a,"phaseId"),u=await t.formData(),o=Cl(u,"checklist");return await wN(i,{title:ka(u,"title"),description:ca(u,"description"),status:ca(u,"status")||"planned",...o.length?{checklist:o}:{}}),Rr(`/features/${l}/phases/${i}`)}function hD(t,a){const l=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=l.get(((p=t[o])==null?void 0:p.id)??"")??i.get(f);return m?{...m,number:o+1,title:u.trim()}:{id:`check-${o+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:o+1,title:u.trim(),checked:!1}})}async function mD({request:t,params:a}){const l=cn(a,"featureId"),i=cn(a,"phaseId"),u=cn(a,"taskId"),o=await qc(u),f=await t.formData();return await nm({...o,phaseId:i,title:ka(f,"title"),status:ka(f,"status"),priority:wm(f,"priority"),description:ca(f,"description"),checklist:hD(o.checklist,Cl(f,"checklist"))}),Rr(`/features/${l}/phases/${i}/tasks/${u}`)}async function pD({params:t}){const a=cn(t,"featureId"),l=cn(t,"phaseId"),i=cn(t,"taskId");return await EN(i),Rr(`/features/${a}/phases/${l}`)}async function gD({request:t,params:a}){const l=cn(a,"phaseId"),i=cn(a,"taskId"),u=await qc(i),o=await t.formData();return await nm({...u,phaseId:l,status:ka(o,"status")}),null}async function vD({request:t}){const a=await fb(),l=await t.formData();return await gN({...a,goal:ca(l,"goal")}),Rr("/")}function yD(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function xD(){return{handoffs:await vb()}}function bD(){const{handoffs:t}=cs(),[a,l]=v.useState(t),i=ir();return v.useEffect(()=>{const u=o=>{const f=o.detail;((f==null?void 0:f.type)==="handoffUpdated"||(f==null?void 0:f.type)==="handoffCleared")&&vb().then(l).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(gn,{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(gn,{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(zl,{id:u.compositeRef,children:u.compositeRef}),d.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["Updated ",yD(u.updatedAt)]})]}),d.jsx(dt,{to:u.featureId?`/features/${u.featureId}/phases/${u.phaseId}`:"/features",className:"text-xs text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",children:u.featureId?"Open phase →":"Browse features →"})]}),d.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:u.firstLine?d.jsx(Hn,{text:u.content,className:"formatted-text max-w-none"}):d.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"Empty handoff content."})})]})},u.phaseId))]})}async function SD({request:t,params:a}){cn(a,"featureId");const l=cn(a,"phaseId"),i=cn(a,"taskId"),u=cn(a,"itemId"),o=await t.formData(),f=ka(o,"checked")==="true",m=await qc(i);return await nm({...m,phaseId:l,checklist:m.checklist.map(p=>p.id===u?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:i,itemId:u,checked:f})}const wD=aE([{id:"root",path:"/",loader:IN,element:d.jsx(GN,{}),errorElement:d.jsx(XN,{}),children:[{index:!0,loader:PN,element:d.jsx(ET,{})},{path:"features",id:"features",loader:NT,element:d.jsx(OT,{}),children:[{path:"new",element:d.jsx(KT,{}),action:rD}]},{path:"features/:featureId",id:"feature-detail",loader:MT,element:d.jsx(qT,{}),children:[{path:"edit",element:d.jsx(ZT,{}),action:lD},{path:"phases/new",element:d.jsx(JT,{}),action:uD}]},{path:"project/edit",element:d.jsx(aD,{}),action:vD},{path:"handoff",loader:xD,element:d.jsx(bD,{})},{path:"features/:featureId/delete",action:sD},{path:"features/:featureId/status",action:iD},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:YT,element:d.jsx(IT,{}),children:[{path:"edit",element:d.jsx(WT,{}),action:oD},{path:"tasks/new",element:d.jsx(eD,{}),action:fD}]},{path:"features/:featureId/phases/:phaseId/delete",action:cD},{path:"features/:featureId/phases/:phaseId/status",action:dD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:GT,element:d.jsx(PT,{}),children:[{path:"edit",element:d.jsx(nD,{}),action:mD}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:pD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:gD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:SD}]}]),e0=document.getElementById("root");if(!e0)throw new Error("#root not found");X1.createRoot(e0).render(d.jsx(v.StrictMode,{children:d.jsx(fE,{router:wD})}));
|