@agent-plan/server 0.2.19-next.18 → 0.2.19-next.19
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.
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
var bS=Object.defineProperty;var SS=(t,a,l)=>a in t?bS(t,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[a]=l;var gn=(t,a,l)=>SS(t,typeof a!="symbol"?a+"":a,l);function wS(t,a){for(var l=0;l<a.length;l++){const i=a[l];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in t)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(t,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function l(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=l(o);fetch(o.href,u)}})();function ES(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sh={exports:{}},so={};/**
|
|
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 py;function NS(){if(py)return so;py=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(i,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:t,type:i,key:f,ref:o!==void 0?o:null,props:u}}return so.Fragment=a,so.jsx=l,so.jsxs=l,so}var gy;function RS(){return gy||(gy=1,sh.exports=NS()),sh.exports}var c=RS(),ih={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 vy;function jS(){if(vy)return et;vy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=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"),y=Symbol.for("react.activity"),E=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=E&&C[E]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,R={};function z(C,V,J){this.props=C,this.context=V,this.refs=R,this.updater=J||S}z.prototype.isReactComponent={},z.prototype.setState=function(C,V){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,V,"setState")},z.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function B(){}B.prototype=z.prototype;function I(C,V,J){this.props=C,this.context=V,this.refs=R,this.updater=J||S}var X=I.prototype=new B;X.constructor=I,D(X,z.prototype),X.isPureReactComponent=!0;var W=Array.isArray;function ee(){}var M={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ce(C,V,J){var de=J.ref;return{$$typeof:t,type:C,key:V,ref:de!==void 0?de:null,props:J}}function he(C,V){return ce(C.type,V,C.props)}function we(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function Ee(C){var V={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(J){return V[J]})}var ne=/\/+/g;function pe(C,V){return typeof C=="object"&&C!==null&&C.key!=null?Ee(""+C.key):V.toString(36)}function Re(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(ee,ee):(C.status="pending",C.then(function(V){C.status==="pending"&&(C.status="fulfilled",C.value=V)},function(V){C.status==="pending"&&(C.status="rejected",C.reason=V)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function U(C,V,J,de,Se){var je=typeof C;(je==="undefined"||je==="boolean")&&(C=null);var ze=!1;if(C===null)ze=!0;else switch(je){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(C.$$typeof){case t:case a:ze=!0;break;case x:return ze=C._init,U(ze(C._payload),V,J,de,Se)}}if(ze)return Se=Se(C),ze=de===""?"."+pe(C,0):de,W(Se)?(J="",ze!=null&&(J=ze.replace(ne,"$&/")+"/"),U(Se,V,J,"",function(nt){return nt})):Se!=null&&(we(Se)&&(Se=he(Se,J+(Se.key==null||C&&C.key===Se.key?"":(""+Se.key).replace(ne,"$&/")+"/")+ze)),V.push(Se)),1;ze=0;var ct=de===""?".":de+":";if(W(C))for(var Fe=0;Fe<C.length;Fe++)de=C[Fe],je=ct+pe(de,Fe),ze+=U(de,V,J,je,Se);else if(Fe=w(C),typeof Fe=="function")for(C=Fe.call(C),Fe=0;!(de=C.next()).done;)de=de.value,je=ct+pe(de,Fe++),ze+=U(de,V,J,je,Se);else if(je==="object"){if(typeof C.then=="function")return U(Re(C),V,J,de,Se);throw V=String(C),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ze}function H(C,V,J){if(C==null)return C;var de=[],Se=0;return U(C,de,"","",function(je){return V.call(J,je,Se++)}),de}function ie(C){if(C._status===-1){var V=C._result;V=V(),V.then(function(J){(C._status===0||C._status===-1)&&(C._status=1,C._result=J)},function(J){(C._status===0||C._status===-1)&&(C._status=2,C._result=J)}),C._status===-1&&(C._status=0,C._result=V)}if(C._status===1)return C._result.default;throw C._result}var ue=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},xe={map:H,forEach:function(C,V,J){H(C,function(){V.apply(this,arguments)},J)},count:function(C){var V=0;return H(C,function(){V++}),V},toArray:function(C){return H(C,function(V){return V})||[]},only:function(C){if(!we(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return et.Activity=y,et.Children=xe,et.Component=z,et.Fragment=l,et.Profiler=o,et.PureComponent=I,et.StrictMode=i,et.Suspense=p,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,et.__COMPILER_RUNTIME={__proto__:null,c:function(C){return M.H.useMemoCache(C)}},et.cache=function(C){return function(){return C.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(C,V,J){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var de=D({},C.props),Se=C.key;if(V!=null)for(je in V.key!==void 0&&(Se=""+V.key),V)!T.call(V,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&V.ref===void 0||(de[je]=V[je]);var je=arguments.length-2;if(je===1)de.children=J;else if(1<je){for(var ze=Array(je),ct=0;ct<je;ct++)ze[ct]=arguments[ct+2];de.children=ze}return ce(C.type,Se,de)},et.createContext=function(C){return C={$$typeof:f,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},et.createElement=function(C,V,J){var de,Se={},je=null;if(V!=null)for(de in V.key!==void 0&&(je=""+V.key),V)T.call(V,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(Se[de]=V[de]);var ze=arguments.length-2;if(ze===1)Se.children=J;else if(1<ze){for(var ct=Array(ze),Fe=0;Fe<ze;Fe++)ct[Fe]=arguments[Fe+2];Se.children=ct}if(C&&C.defaultProps)for(de in ze=C.defaultProps,ze)Se[de]===void 0&&(Se[de]=ze[de]);return ce(C,je,Se)},et.createRef=function(){return{current:null}},et.forwardRef=function(C){return{$$typeof:m,render:C}},et.isValidElement=we,et.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:ie}},et.memo=function(C,V){return{$$typeof:g,type:C,compare:V===void 0?null:V}},et.startTransition=function(C){var V=M.T,J={};M.T=J;try{var de=C(),Se=M.S;Se!==null&&Se(J,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(ee,ue)}catch(je){ue(je)}finally{V!==null&&J.types!==null&&(V.types=J.types),M.T=V}},et.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},et.use=function(C){return M.H.use(C)},et.useActionState=function(C,V,J){return M.H.useActionState(C,V,J)},et.useCallback=function(C,V){return M.H.useCallback(C,V)},et.useContext=function(C){return M.H.useContext(C)},et.useDebugValue=function(){},et.useDeferredValue=function(C,V){return M.H.useDeferredValue(C,V)},et.useEffect=function(C,V){return M.H.useEffect(C,V)},et.useEffectEvent=function(C){return M.H.useEffectEvent(C)},et.useId=function(){return M.H.useId()},et.useImperativeHandle=function(C,V,J){return M.H.useImperativeHandle(C,V,J)},et.useInsertionEffect=function(C,V){return M.H.useInsertionEffect(C,V)},et.useLayoutEffect=function(C,V){return M.H.useLayoutEffect(C,V)},et.useMemo=function(C,V){return M.H.useMemo(C,V)},et.useOptimistic=function(C,V){return M.H.useOptimistic(C,V)},et.useReducer=function(C,V,J){return M.H.useReducer(C,V,J)},et.useRef=function(C){return M.H.useRef(C)},et.useState=function(C){return M.H.useState(C)},et.useSyncExternalStore=function(C,V,J){return M.H.useSyncExternalStore(C,V,J)},et.useTransition=function(){return M.H.useTransition()},et.version="19.2.7",et}var yy;function Zh(){return yy||(yy=1,ih.exports=jS()),ih.exports}var v=Zh();const dn=ES(v),TS=wS({__proto__:null,default:dn},[v]);var oh={exports:{}},io={},uh={exports:{}},ch={};/**
|
|
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 xy;function CS(){return xy||(xy=1,(function(t){function a(U,H){var ie=U.length;U.push(H);e:for(;0<ie;){var ue=ie-1>>>1,xe=U[ue];if(0<o(xe,H))U[ue]=H,U[ie]=xe,ie=ue;else break e}}function l(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var H=U[0],ie=U.pop();if(ie!==H){U[0]=ie;e:for(var ue=0,xe=U.length,C=xe>>>1;ue<C;){var V=2*(ue+1)-1,J=U[V],de=V+1,Se=U[de];if(0>o(J,ie))de<xe&&0>o(Se,J)?(U[ue]=Se,U[de]=ie,ue=de):(U[ue]=J,U[V]=ie,ue=V);else if(de<xe&&0>o(Se,ie))U[ue]=Se,U[de]=ie,ue=de;else break e}}return H}function o(U,H){var ie=U.sortIndex-H.sortIndex;return ie!==0?ie:U.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var p=[],g=[],x=1,y=null,E=3,w=!1,S=!1,D=!1,R=!1,z=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function X(U){for(var H=l(g);H!==null;){if(H.callback===null)i(g);else if(H.startTime<=U)i(g),H.sortIndex=H.expirationTime,a(p,H);else break;H=l(g)}}function W(U){if(D=!1,X(U),!S)if(l(p)!==null)S=!0,ee||(ee=!0,Ee());else{var H=l(g);H!==null&&Re(W,H.startTime-U)}}var ee=!1,M=-1,T=5,ce=-1;function he(){return R?!0:!(t.unstable_now()-ce<T)}function we(){if(R=!1,ee){var U=t.unstable_now();ce=U;var H=!0;try{e:{S=!1,D&&(D=!1,B(M),M=-1),w=!0;var ie=E;try{t:{for(X(U),y=l(p);y!==null&&!(y.expirationTime>U&&he());){var ue=y.callback;if(typeof ue=="function"){y.callback=null,E=y.priorityLevel;var xe=ue(y.expirationTime<=U);if(U=t.unstable_now(),typeof xe=="function"){y.callback=xe,X(U),H=!0;break t}y===l(p)&&i(p),X(U)}else i(p);y=l(p)}if(y!==null)H=!0;else{var C=l(g);C!==null&&Re(W,C.startTime-U),H=!1}}break e}finally{y=null,E=ie,w=!1}H=void 0}}finally{H?Ee():ee=!1}}}var Ee;if(typeof I=="function")Ee=function(){I(we)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,pe=ne.port2;ne.port1.onmessage=we,Ee=function(){pe.postMessage(null)}}else Ee=function(){z(we,0)};function Re(U,H){M=z(function(){U(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(U){U.callback=null},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return E},t.unstable_next=function(U){switch(E){case 1:case 2:case 3:var H=3;break;default:H=E}var ie=E;E=H;try{return U()}finally{E=ie}},t.unstable_requestPaint=function(){R=!0},t.unstable_runWithPriority=function(U,H){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ie=E;E=U;try{return H()}finally{E=ie}},t.unstable_scheduleCallback=function(U,H,ie){var ue=t.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ue+ie:ue):ie=ue,U){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=ie+xe,U={id:x++,callback:H,priorityLevel:U,startTime:ie,expirationTime:xe,sortIndex:-1},ie>ue?(U.sortIndex=ie,a(g,U),l(p)===null&&U===l(g)&&(D?(B(M),M=-1):D=!0,Re(W,ie-ue))):(U.sortIndex=xe,a(p,U),S||w||(S=!0,ee||(ee=!0,Ee()))),U},t.unstable_shouldYield=he,t.unstable_wrapCallback=function(U){var H=E;return function(){var ie=E;E=H;try{return U.apply(this,arguments)}finally{E=ie}}}})(ch)),ch}var by;function DS(){return by||(by=1,uh.exports=CS()),uh.exports}var dh={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 Sy;function AS(){if(Sy)return sa;Sy=1;var t=Zh();function a(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function 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},o=Symbol.for("react.portal");function u(p,g,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,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 u(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,y=m(x,g.crossOrigin),E=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:E,fetchPriority:w}):x==="script"&&i.d.X(p,{crossOrigin:y,integrity:E,fetchPriority:w,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,y=m(x,g.crossOrigin);i.d.L(p,x,{crossOrigin:y,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 wy;function Px(){if(wy)return dh.exports;wy=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(),dh.exports=AS(),dh.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 Ey;function kS(){if(Ey)return io;Ey=1;var t=DS(),a=Zh(),l=Px();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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(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(u(e)!==e)throw Error(i(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(i(188));return n!==e?null:e}for(var r=e,s=n;;){var d=r.return;if(d===null)break;var h=d.alternate;if(h===null){if(s=d.return,s!==null){r=s;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return p(d),e;if(h===s)return p(d),n;h=h.sibling}throw Error(i(188))}if(r.return!==s.return)r=d,s=h;else{for(var b=!1,N=d.child;N;){if(N===r){b=!0,r=d,s=h;break}if(N===s){b=!0,s=d,r=h;break}N=N.sibling}if(!b){for(N=h.child;N;){if(N===r){b=!0,r=h,s=d;break}if(N===s){b=!0,s=h,r=d;break}N=N.sibling}if(!b)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 y=Object.assign,E=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),I=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function Ee(e){return e===null||typeof e!="object"?null:(e=we&&e[we]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Symbol.for("react.client.reference");function pe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case z:return"Profiler";case R:return"StrictMode";case W:return"Suspense";case ee:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case I:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case X:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return n=e.displayName||null,n!==null?n:pe(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return pe(e(n))}catch{}}return null}var Re=Array.isArray,U=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},ue=[],xe=-1;function C(e){return{current:e}}function V(e){0>xe||(e.current=ue[xe],ue[xe]=null,xe--)}function J(e,n){xe++,ue[xe]=e.current,e.current=n}var de=C(null),Se=C(null),je=C(null),ze=C(null);function ct(e,n){switch(J(je,n),J(Se,e),J(de,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Bv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Bv(n),e=Hv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(de),J(de,e)}function Fe(){V(de),V(Se),V(je)}function nt(e){e.memoizedState!==null&&J(ze,e);var n=de.current,r=Hv(n,e.type);n!==r&&(J(Se,e),J(de,r))}function wn(e){Se.current===e&&(V(de),V(Se)),ze.current===e&&(V(ze),no._currentValue=ie)}var Ft,ht;function se(e){if(Ft===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ft=n&&n[1]||"",ht=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ft+e+ht}var qe=!1;function at(e,n){if(!e||qe)return"";qe=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(Q){var G=Q}Reflect.construct(e,[],le)}else{try{le.call()}catch(Q){G=Q}e.call(le.prototype)}}else{try{throw Error()}catch(Q){G=Q}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),b=h[0],N=h[1];if(b&&N){var k=b.split(`
|
|
44
|
-
`),F=N.split(`
|
|
45
|
-
`);for(d=s=0;s<k.length&&!k[s].includes("DetermineComponentFrameRoot");)s++;for(;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;if(s===k.length||d===F.length)for(s=k.length-1,d=F.length-1;1<=s&&0<=d&&k[s]!==F[d];)d--;for(;1<=s&&0<=d;s--,d--)if(k[s]!==F[d]){if(s!==1||d!==1)do if(s--,d--,0>d||k[s]!==F[d]){var Z=`
|
|
46
|
-
`+k[s].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=s&&0<=d);break}}}finally{qe=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?se(r):""}function _t(e,n){switch(e.tag){case 26:case 27:case 5:return se(e.type);case 16:return se("Lazy");case 13:return e.child!==n&&n!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return se("Activity");default:return""}}function yn(e){try{var n="",r=null;do n+=_t(e,r),r=e,e=e.return;while(e);return n}catch(s){return`
|
|
47
|
-
Error generating stack: `+s.message+`
|
|
48
|
-
`+s.stack}}var Lt=Object.prototype.hasOwnProperty,kt=t.unstable_scheduleCallback,Pt=t.unstable_cancelCallback,$n=t.unstable_shouldYield,Fn=t.unstable_requestPaint,an=t.unstable_now,ca=t.unstable_getCurrentPriorityLevel,da=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,Ce=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ke=t.log,fn=t.unstable_setDisableYieldValue,Wt=null,ae=null;function Nt(e){if(typeof Ke=="function"&&fn(e),ae&&typeof ae.setStrictMode=="function")try{ae.setStrictMode(Wt,e)}catch{}}var en=Math.clz32?Math.clz32:qn,nr=Math.log,tn=Math.LN2;function qn(e){return e>>>=0,e===0?32:31-(nr(e)/tn|0)|0}var _e=256,Gt=262144,qt=4194304;function xt(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 d=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~h,s!==0?d=xt(s):(b&=N,b!==0?d=xt(b):r||(r=N&~e,r!==0&&(d=xt(r))))):(N=s&~h,N!==0?d=xt(N):b!==0?d=xt(b):r||(r=s&~e,r!==0&&(d=xt(r)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:d}function Rt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function rn(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 Xt(){var e=qt;return qt<<=1,(qt&62914560)===0&&(qt=4194304),e}function Ut(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function mt(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,n,r,s,d,h){var b=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 N=e.entanglements,k=e.expirationTimes,F=e.hiddenUpdates;for(r=b&~r;0<r;){var Z=31-en(r),le=1<<Z;N[Z]=0,k[Z]=-1;var G=F[Z];if(G!==null)for(F[Z]=null,Z=0;Z<G.length;Z++){var Q=G[Z];Q!==null&&(Q.lane&=-536870913)}r&=~le}s!==0&&En(e,s,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~n))}function En(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-en(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function Mn(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var s=31-en(r),d=1<<s;d&n|e[s]&n&&(e[s]|=n),r&=~d}}function A(e,n){var r=n&-n;return r=(r&42)!==0?1:_(r),(r&(e.suspendedLanes|n))!==0?0:r}function _(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 K(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:oy(e.type))}function re(e,n){var r=H.p;try{return H.p=e,n()}finally{H.p=r}}var Te=Math.random().toString(36).slice(2),me="__reactFiber$"+Te,De="__reactProps$"+Te,Ne="__reactContainer$"+Te,Me="__reactEvents$"+Te,Ue="__reactListeners$"+Te,Pe="__reactHandles$"+Te,Ae="__reactResources$"+Te,Ze="__reactMarker$"+Te;function Ie(e){delete e[me],delete e[De],delete e[Me],delete e[Ue],delete e[Pe]}function Bt(e){var n=e[me];if(n)return n;for(var r=e.parentNode;r;){if(n=r[Ne]||r[me]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Pv(e);e!==null;){if(r=e[me])return r;e=Pv(e)}return n}e=r,r=e.parentNode}return null}function We(e){if(e=e[me]||e[Ne]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function dt(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function it(e){var n=e[Ae];return n||(n=e[Ae]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ft(e){e[Ze]=!0}var Qt=new Set,Pn={};function Nn(e,n){_n(e,n),_n(e+"Capture",n)}function _n(e,n){for(Pn[e]=n,e=0;e<n.length;e++)Qt.add(n[e])}var Ln=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]*$"),Gn={},pa={};function rl(e){return Lt.call(pa,e)?!0:Lt.call(Gn,e)?!1:Ln.test(e)?pa[e]=!0:(Gn[e]=!0,!1)}function ea(e,n,r){if(rl(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 hr(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 Ge(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 Kt(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 d=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(b){r=""+b,h.call(this,b)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(b){r=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function zn(e){if(!e._valueTracker){var n=Kt(e)?"checked":"value";e._valueTracker=ta(e,n,""+e[n])}}function kr(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),s="";return e&&(s=Kt(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 ja=/[\n"\\]/g;function Xn(e){return e.replace(ja,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ql(e,n,r,s,d,h,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+wt(n)):e.value!==""+wt(n)&&(e.value=""+wt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?jt(e,b,wt(n)):r!=null?jt(e,b,wt(r)):s!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+wt(N):e.removeAttribute("name")}function yi(e,n,r,s,d,h,b,N){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)){zn(e);return}r=r!=null?""+wt(r):"",n=n!=null?""+wt(n):r,N||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=N?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),zn(e)}function jt(e,n,r){n==="number"&&Et(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function mr(e,n,r,s){if(e=e.options,n){n={};for(var d=0;d<r.length;d++)n["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=n.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&s&&(e[r].defaultSelected=!0)}else{for(r=""+wt(r),n=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function Qo(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 ar(e,n,r,s){if(n==null){if(s!=null){if(r!=null)throw Error(i(92));if(Re(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),zn(e)}function ll(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var sd=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 vs(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||sd.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function ga(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 d in n)s=n[d],n.hasOwnProperty(d)&&r[d]!==s&&vs(e,d,s)}else for(var h in n)n.hasOwnProperty(h)&&vs(e,h,n[h])}function Il(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 ys=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"]]),va=/^[\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 ln(e){return va.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Ta=null;function Or(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pr=null,Mr=null;function xi(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(ql(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="'+Xn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var s=r[n];if(s!==e&&s.form===e.form){var d=s[De]||null;if(!d)throw Error(i(90));ql(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<r.length;n++)s=r[n],s.form===e.form&&kr(s)}break e;case"textarea":Qo(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&mr(e,!!r.multiple,n,!1)}}}var gr=!1;function bi(e,n,r){if(gr)return e(n,r);gr=!0;try{var s=e(n);return s}finally{if(gr=!1,(pr!==null||Mr!==null)&&(zu(),pr&&(n=pr,e=Mr,Mr=pr=null,xi(n),e)))for(n=0;n<e.length;n++)xi(e[n])}}function Ba(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 rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Si=!1;if(rr)try{var _r={};Object.defineProperty(_r,"passive",{get:function(){Si=!0}}),window.addEventListener("test",_r,_r),window.removeEventListener("test",_r,_r)}catch{Si=!1}var Ha=null,wi=null,xs=null;function Ko(){if(xs)return xs;var e,n=wi,r=n.length,s,d="value"in Ha?Ha.value:Ha.textContent,h=d.length;for(e=0;e<r&&n[e]===d[e];e++);var b=r-e;for(s=1;s<=b&&n[r-s]===d[h-s];s++);return xs=d.slice(e,1<s?1-s:void 0)}function bs(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 Lr(){return!0}function Zo(){return!1}function aa(e){function n(r,s,d,h,b){this._reactName=r,this._targetInst=d,this.type=s,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(r=e[N],this[N]=r?r(h):h[N]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Lr:Zo,this.isPropagationStopped=Zo,this}return y(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=Lr)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Lr)},persist:function(){},isPersistent:Lr}),n}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ur=aa(zr),Vl=y({},zr,{view:0,detail:0}),id=aa(Vl),sl,Yl,Fl,Br=y({},Vl,{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!==Fl&&(Fl&&e.type==="mousemove"?(sl=e.screenX-Fl.screenX,Yl=e.screenY-Fl.screenY):Yl=sl=0,Fl=e),sl)},movementY:function(e){return"movementY"in e?e.movementY:Yl}}),Jo=aa(Br),j=y({},Br,{dataTransfer:0}),P=aa(j),be=y({},Vl,{relatedTarget:0}),ve=aa(be),Ye=y({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),oe=aa(Ye),fe=y({},zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ye=aa(fe),Xe=y({},zr,{data:0}),rt=aa(Xe),He={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Rn={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"},Ot={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ra(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Ot[e])?!!n[e]:!1}function la(){return ra}var ya=y({},Vl,{key:function(e){if(e.key){var n=He[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Rn[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"?bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jn=aa(ya),hn=y({},Br,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mt=aa(hn),Pl=y({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),vr=aa(Pl),od=y({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wo=aa(od),eu=y({},Br,{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}),ud=aa(eu),cd=y({},zr,{newState:0,oldState:0}),q0=aa(cd),I0=[9,13,27,32],dd=rr&&"CompositionEvent"in window,Ei=null;rr&&"documentMode"in document&&(Ei=document.documentMode);var V0=rr&&"TextEvent"in window&&!Ei,Ym=rr&&(!dd||Ei&&8<Ei&&11>=Ei),Fm=" ",Pm=!1;function Gm(e,n){switch(e){case"keyup":return I0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ss=!1;function Y0(e,n){switch(e){case"compositionend":return Xm(n);case"keypress":return n.which!==32?null:(Pm=!0,Fm);case"textInput":return e=n.data,e===Fm&&Pm?null:e;default:return null}}function F0(e,n){if(Ss)return e==="compositionend"||!dd&&Gm(e,n)?(e=Ko(),xs=wi=Ha=null,Ss=!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 Ym&&n.locale!=="ko"?null:n.data;default:return null}}var P0={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 Qm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!P0[e.type]:n==="textarea"}function Km(e,n,r,s){pr?Mr?Mr.push(s):Mr=[s]:pr=s,n=Vu(n,"onChange"),0<n.length&&(r=new Ur("onChange","change",null,r,s),e.push({event:r,listeners:n}))}var Ni=null,Ri=null;function G0(e){Ov(e,0)}function tu(e){var n=dt(e);if(kr(n))return e}function Zm(e,n){if(e==="change")return n}var Jm=!1;if(rr){var fd;if(rr){var hd="oninput"in document;if(!hd){var Wm=document.createElement("div");Wm.setAttribute("oninput","return;"),hd=typeof Wm.oninput=="function"}fd=hd}else fd=!1;Jm=fd&&(!document.documentMode||9<document.documentMode)}function ep(){Ni&&(Ni.detachEvent("onpropertychange",tp),Ri=Ni=null)}function tp(e){if(e.propertyName==="value"&&tu(Ri)){var n=[];Km(n,Ri,e,Or(e)),bi(G0,n)}}function X0(e,n,r){e==="focusin"?(ep(),Ni=n,Ri=r,Ni.attachEvent("onpropertychange",tp)):e==="focusout"&&ep()}function Q0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tu(Ri)}function K0(e,n){if(e==="click")return tu(n)}function Z0(e,n){if(e==="input"||e==="change")return tu(n)}function J0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Ca=typeof Object.is=="function"?Object.is:J0;function ji(e,n){if(Ca(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 d=r[s];if(!Lt.call(n,d)||!Ca(e[d],n[d]))return!1}return!0}function np(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ap(e,n){var r=np(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=np(r)}}function rp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?rp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function lp(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 md(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 W0=rr&&"documentMode"in document&&11>=document.documentMode,ws=null,pd=null,Ti=null,gd=!1;function sp(e,n,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;gd||ws==null||ws!==Et(s)||(s=ws,"selectionStart"in s&&md(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}),Ti&&ji(Ti,s)||(Ti=s,s=Vu(pd,"onSelect"),0<s.length&&(n=new Ur("onSelect","select",null,n,r),e.push({event:n,listeners:s}),n.target=ws)))}function Gl(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Es={animationend:Gl("Animation","AnimationEnd"),animationiteration:Gl("Animation","AnimationIteration"),animationstart:Gl("Animation","AnimationStart"),transitionrun:Gl("Transition","TransitionRun"),transitionstart:Gl("Transition","TransitionStart"),transitioncancel:Gl("Transition","TransitionCancel"),transitionend:Gl("Transition","TransitionEnd")},vd={},ip={};rr&&(ip=document.createElement("div").style,"AnimationEvent"in window||(delete Es.animationend.animation,delete Es.animationiteration.animation,delete Es.animationstart.animation),"TransitionEvent"in window||delete Es.transitionend.transition);function Xl(e){if(vd[e])return vd[e];if(!Es[e])return e;var n=Es[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in ip)return vd[e]=n[r];return e}var op=Xl("animationend"),up=Xl("animationiteration"),cp=Xl("animationstart"),e1=Xl("transitionrun"),t1=Xl("transitionstart"),n1=Xl("transitioncancel"),dp=Xl("transitionend"),fp=new Map,yd="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(" ");yd.push("scrollEnd");function lr(e,n){fp.set(e,n),Nn(n,[e])}var nu=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)},$a=[],Ns=0,xd=0;function au(){for(var e=Ns,n=xd=Ns=0;n<e;){var r=$a[n];$a[n++]=null;var s=$a[n];$a[n++]=null;var d=$a[n];$a[n++]=null;var h=$a[n];if($a[n++]=null,s!==null&&d!==null){var b=s.pending;b===null?d.next=d:(d.next=b.next,b.next=d),s.pending=d}h!==0&&hp(r,d,h)}}function ru(e,n,r,s){$a[Ns++]=e,$a[Ns++]=n,$a[Ns++]=r,$a[Ns++]=s,xd|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function bd(e,n,r,s){return ru(e,n,r,s),lu(e)}function Ql(e,n){return ru(e,null,null,n),lu(e)}function hp(e,n,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var d=!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||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-en(r),e=h.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=r|536870912),h):null}function lu(e){if(50<Qi)throw Qi=0,Af=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Rs={};function a1(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 Da(e,n,r,s){return new a1(e,n,r,s)}function Sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hr(e,n){var r=e.alternate;return r===null?(r=Da(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 mp(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 su(e,n,r,s,d,h){var b=0;if(s=e,typeof e=="function")Sd(e)&&(b=1);else if(typeof e=="string")b=oS(e,r,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=Da(31,r,n,d),e.elementType=ce,e.lanes=h,e;case D:return Kl(r.children,d,h,n);case R:b=8,d|=24;break;case z:return e=Da(12,r,n,d|2),e.elementType=z,e.lanes=h,e;case W:return e=Da(13,r,n,d),e.elementType=W,e.lanes=h,e;case ee:return e=Da(19,r,n,d),e.elementType=ee,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:b=10;break e;case B:b=9;break e;case X:b=11;break e;case M:b=14;break e;case T:b=16,s=null;break e}b=29,r=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=Da(b,r,n,d),n.elementType=e,n.type=s,n.lanes=h,n}function Kl(e,n,r,s){return e=Da(7,e,s,n),e.lanes=r,e}function wd(e,n,r){return e=Da(6,e,null,n),e.lanes=r,e}function pp(e){var n=Da(18,null,null,0);return n.stateNode=e,n}function Ed(e,n,r){return n=Da(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var gp=new WeakMap;function qa(e,n){if(typeof e=="object"&&e!==null){var r=gp.get(e);return r!==void 0?r:(n={value:e,source:n,stack:yn(n)},gp.set(e,n),n)}return{value:e,source:n,stack:yn(n)}}var js=[],Ts=0,iu=null,Ci=0,Ia=[],Va=0,il=null,yr=1,xr="";function $r(e,n){js[Ts++]=Ci,js[Ts++]=iu,iu=e,Ci=n}function vp(e,n,r){Ia[Va++]=yr,Ia[Va++]=xr,Ia[Va++]=il,il=e;var s=yr;e=xr;var d=32-en(s)-1;s&=~(1<<d),r+=1;var h=32-en(n)+d;if(30<h){var b=d-d%5;h=(s&(1<<b)-1).toString(32),s>>=b,d-=b,yr=1<<32-en(n)+d|r<<d|s,xr=h+e}else yr=1<<h|r<<d|s,xr=e}function Nd(e){e.return!==null&&($r(e,1),vp(e,1,0))}function Rd(e){for(;e===iu;)iu=js[--Ts],js[Ts]=null,Ci=js[--Ts],js[Ts]=null;for(;e===il;)il=Ia[--Va],Ia[Va]=null,xr=Ia[--Va],Ia[Va]=null,yr=Ia[--Va],Ia[Va]=null}function yp(e,n){Ia[Va++]=yr,Ia[Va++]=xr,Ia[Va++]=il,yr=n.id,xr=n.overflow,il=e}var Qn=null,sn=null,bt=!1,ol=null,Ya=!1,jd=Error(i(519));function ul(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Di(qa(n,e)),jd}function xp(e){var n=e.stateNode,r=e.type,s=e.memoizedProps;switch(n[me]=e,n[De]=s,r){case"dialog":gt("cancel",n),gt("close",n);break;case"iframe":case"object":case"embed":gt("load",n);break;case"video":case"audio":for(r=0;r<Zi.length;r++)gt(Zi[r],n);break;case"source":gt("error",n);break;case"img":case"image":case"link":gt("error",n),gt("load",n);break;case"details":gt("toggle",n);break;case"input":gt("invalid",n),yi(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":gt("invalid",n);break;case"textarea":gt("invalid",n),ar(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||zv(n.textContent,r)?(s.popover!=null&&(gt("beforetoggle",n),gt("toggle",n)),s.onScroll!=null&>("scroll",n),s.onScrollEnd!=null&>("scrollend",n),s.onClick!=null&&(n.onclick=na),n=!0):n=!1,n||ul(e,!0)}function bp(e){for(Qn=e.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:Ya=!1;return;case 27:case 3:Ya=!0;return;default:Qn=Qn.return}}function Cs(e){if(e!==Qn)return!1;if(!bt)return bp(e),bt=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Ff(e.type,e.memoizedProps)),r=!r),r&&sn&&ul(e),bp(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));sn=Fv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));sn=Fv(e)}else n===27?(n=sn,El(e.type)?(e=Kf,Kf=null,sn=e):sn=n):sn=Qn?Pa(e.stateNode.nextSibling):null;return!0}function Zl(){sn=Qn=null,bt=!1}function Td(){var e=ol;return e!==null&&(wa===null?wa=e:wa.push.apply(wa,e),ol=null),e}function Di(e){ol===null?ol=[e]:ol.push(e)}var Cd=C(null),Jl=null,qr=null;function cl(e,n,r){J(Cd,n._currentValue),n._currentValue=r}function Ir(e){e._currentValue=Cd.current,V(Cd)}function Dd(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 Ad(e,n,r,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var b=d.child;h=h.firstContext;e:for(;h!==null;){var N=h;h=d;for(var k=0;k<n.length;k++)if(N.context===n[k]){h.lanes|=r,N=h.alternate,N!==null&&(N.lanes|=r),Dd(h.return,r,e),s||(b=null);break e}h=N.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(i(341));b.lanes|=r,h=b.alternate,h!==null&&(h.lanes|=r),Dd(b,r,e),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===e){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Ds(e,n,r,s){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var b=d.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var N=d.type;Ca(d.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(d===ze.current){if(b=d.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(no):e=[no])}d=d.return}e!==null&&Ad(n,e,r,s),n.flags|=262144}function ou(e){for(e=e.firstContext;e!==null;){if(!Ca(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){Jl=e,qr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kn(e){return Sp(Jl,e)}function uu(e,n){return Jl===null&&Wl(e),Sp(e,n)}function Sp(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},qr===null){if(e===null)throw Error(i(308));qr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else qr=qr.next=n;return r}var r1=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()})}},l1=t.unstable_scheduleCallback,s1=t.unstable_NormalPriority,Tn={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kd(){return{controller:new r1,data:new Map,refCount:0}}function Ai(e){e.refCount--,e.refCount===0&&l1(s1,function(){e.controller.abort()})}var ki=null,Od=0,As=0,ks=null;function i1(e,n){if(ki===null){var r=ki=[];Od=0,As=zf(),ks={status:"pending",value:void 0,then:function(s){r.push(s)}}}return Od++,n.then(wp,wp),n}function wp(){if(--Od===0&&ki!==null){ks!==null&&(ks.status="fulfilled");var e=ki;ki=null,As=0,ks=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function o1(e,n){var r=[],s={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<r.length;d++)(0,r[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),s}var Ep=U.S;U.S=function(e,n){sv=an(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&i1(e,n),Ep!==null&&Ep(e,n)};var es=C(null);function Md(){var e=es.current;return e!==null?e:Zt.pooledCache}function cu(e,n){n===null?J(es,es.current):J(es,n.pool)}function Np(){var e=Md();return e===null?null:{parent:Tn._currentValue,pool:e}}var Os=Error(i(460)),_d=Error(i(474)),du=Error(i(542)),fu={then:function(){}};function Rp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jp(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,Cp(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=Zt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=s}},function(s){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Cp(e),e}throw ns=n,Os}}function ts(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ns=r,Os):r}}var ns=null;function Tp(){if(ns===null)throw Error(i(459));var e=ns;return ns=null,e}function Cp(e){if(e===Os||e===du)throw Error(i(483))}var Ms=null,Oi=0;function hu(e){var n=Oi;return Oi+=1,Ms===null&&(Ms=[]),jp(Ms,e,n)}function Mi(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function mu(e,n){throw n.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Dp(e){function n($,L){if(e){var Y=$.deletions;Y===null?($.deletions=[L],$.flags|=16):Y.push(L)}}function r($,L){if(!e)return null;for(;L!==null;)n($,L),L=L.sibling;return null}function s($){for(var L=new Map;$!==null;)$.key!==null?L.set($.key,$):L.set($.index,$),$=$.sibling;return L}function d($,L){return $=Hr($,L),$.index=0,$.sibling=null,$}function h($,L,Y){return $.index=Y,e?(Y=$.alternate,Y!==null?(Y=Y.index,Y<L?($.flags|=67108866,L):Y):($.flags|=67108866,L)):($.flags|=1048576,L)}function b($){return e&&$.alternate===null&&($.flags|=67108866),$}function N($,L,Y,te){return L===null||L.tag!==6?(L=wd(Y,$.mode,te),L.return=$,L):(L=d(L,Y),L.return=$,L)}function k($,L,Y,te){var $e=Y.type;return $e===D?Z($,L,Y.props.children,te,Y.key):L!==null&&(L.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===T&&ts($e)===L.type)?(L=d(L,Y.props),Mi(L,Y),L.return=$,L):(L=su(Y.type,Y.key,Y.props,null,$.mode,te),Mi(L,Y),L.return=$,L)}function F($,L,Y,te){return L===null||L.tag!==4||L.stateNode.containerInfo!==Y.containerInfo||L.stateNode.implementation!==Y.implementation?(L=Ed(Y,$.mode,te),L.return=$,L):(L=d(L,Y.children||[]),L.return=$,L)}function Z($,L,Y,te,$e){return L===null||L.tag!==7?(L=Kl(Y,$.mode,te,$e),L.return=$,L):(L=d(L,Y),L.return=$,L)}function le($,L,Y){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=wd(""+L,$.mode,Y),L.return=$,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return Y=su(L.type,L.key,L.props,null,$.mode,Y),Mi(Y,L),Y.return=$,Y;case S:return L=Ed(L,$.mode,Y),L.return=$,L;case T:return L=ts(L),le($,L,Y)}if(Re(L)||Ee(L))return L=Kl(L,$.mode,Y,null),L.return=$,L;if(typeof L.then=="function")return le($,hu(L),Y);if(L.$$typeof===I)return le($,uu($,L),Y);mu($,L)}return null}function G($,L,Y,te){var $e=L!==null?L.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return $e!==null?null:N($,L,""+Y,te);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===$e?k($,L,Y,te):null;case S:return Y.key===$e?F($,L,Y,te):null;case T:return Y=ts(Y),G($,L,Y,te)}if(Re(Y)||Ee(Y))return $e!==null?null:Z($,L,Y,te,null);if(typeof Y.then=="function")return G($,L,hu(Y),te);if(Y.$$typeof===I)return G($,L,uu($,Y),te);mu($,Y)}return null}function Q($,L,Y,te,$e){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return $=$.get(Y)||null,N(L,$,""+te,$e);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case w:return $=$.get(te.key===null?Y:te.key)||null,k(L,$,te,$e);case S:return $=$.get(te.key===null?Y:te.key)||null,F(L,$,te,$e);case T:return te=ts(te),Q($,L,Y,te,$e)}if(Re(te)||Ee(te))return $=$.get(Y)||null,Z(L,$,te,$e,null);if(typeof te.then=="function")return Q($,L,Y,hu(te),$e);if(te.$$typeof===I)return Q($,L,Y,uu(L,te),$e);mu(L,te)}return null}function ke($,L,Y,te){for(var $e=null,Tt=null,Le=L,ot=L=0,yt=null;Le!==null&&ot<Y.length;ot++){Le.index>ot?(yt=Le,Le=null):yt=Le.sibling;var Ct=G($,Le,Y[ot],te);if(Ct===null){Le===null&&(Le=yt);break}e&&Le&&Ct.alternate===null&&n($,Le),L=h(Ct,L,ot),Tt===null?$e=Ct:Tt.sibling=Ct,Tt=Ct,Le=yt}if(ot===Y.length)return r($,Le),bt&&$r($,ot),$e;if(Le===null){for(;ot<Y.length;ot++)Le=le($,Y[ot],te),Le!==null&&(L=h(Le,L,ot),Tt===null?$e=Le:Tt.sibling=Le,Tt=Le);return bt&&$r($,ot),$e}for(Le=s(Le);ot<Y.length;ot++)yt=Q(Le,$,ot,Y[ot],te),yt!==null&&(e&&yt.alternate!==null&&Le.delete(yt.key===null?ot:yt.key),L=h(yt,L,ot),Tt===null?$e=yt:Tt.sibling=yt,Tt=yt);return e&&Le.forEach(function(Cl){return n($,Cl)}),bt&&$r($,ot),$e}function Ve($,L,Y,te){if(Y==null)throw Error(i(151));for(var $e=null,Tt=null,Le=L,ot=L=0,yt=null,Ct=Y.next();Le!==null&&!Ct.done;ot++,Ct=Y.next()){Le.index>ot?(yt=Le,Le=null):yt=Le.sibling;var Cl=G($,Le,Ct.value,te);if(Cl===null){Le===null&&(Le=yt);break}e&&Le&&Cl.alternate===null&&n($,Le),L=h(Cl,L,ot),Tt===null?$e=Cl:Tt.sibling=Cl,Tt=Cl,Le=yt}if(Ct.done)return r($,Le),bt&&$r($,ot),$e;if(Le===null){for(;!Ct.done;ot++,Ct=Y.next())Ct=le($,Ct.value,te),Ct!==null&&(L=h(Ct,L,ot),Tt===null?$e=Ct:Tt.sibling=Ct,Tt=Ct);return bt&&$r($,ot),$e}for(Le=s(Le);!Ct.done;ot++,Ct=Y.next())Ct=Q(Le,$,ot,Ct.value,te),Ct!==null&&(e&&Ct.alternate!==null&&Le.delete(Ct.key===null?ot:Ct.key),L=h(Ct,L,ot),Tt===null?$e=Ct:Tt.sibling=Ct,Tt=Ct);return e&&Le.forEach(function(xS){return n($,xS)}),bt&&$r($,ot),$e}function Yt($,L,Y,te){if(typeof Y=="object"&&Y!==null&&Y.type===D&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var $e=Y.key;L!==null;){if(L.key===$e){if($e=Y.type,$e===D){if(L.tag===7){r($,L.sibling),te=d(L,Y.props.children),te.return=$,$=te;break e}}else if(L.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===T&&ts($e)===L.type){r($,L.sibling),te=d(L,Y.props),Mi(te,Y),te.return=$,$=te;break e}r($,L);break}else n($,L);L=L.sibling}Y.type===D?(te=Kl(Y.props.children,$.mode,te,Y.key),te.return=$,$=te):(te=su(Y.type,Y.key,Y.props,null,$.mode,te),Mi(te,Y),te.return=$,$=te)}return b($);case S:e:{for($e=Y.key;L!==null;){if(L.key===$e)if(L.tag===4&&L.stateNode.containerInfo===Y.containerInfo&&L.stateNode.implementation===Y.implementation){r($,L.sibling),te=d(L,Y.children||[]),te.return=$,$=te;break e}else{r($,L);break}else n($,L);L=L.sibling}te=Ed(Y,$.mode,te),te.return=$,$=te}return b($);case T:return Y=ts(Y),Yt($,L,Y,te)}if(Re(Y))return ke($,L,Y,te);if(Ee(Y)){if($e=Ee(Y),typeof $e!="function")throw Error(i(150));return Y=$e.call(Y),Ve($,L,Y,te)}if(typeof Y.then=="function")return Yt($,L,hu(Y),te);if(Y.$$typeof===I)return Yt($,L,uu($,Y),te);mu($,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,L!==null&&L.tag===6?(r($,L.sibling),te=d(L,Y),te.return=$,$=te):(r($,L),te=wd(Y,$.mode,te),te.return=$,$=te),b($)):r($,L)}return function($,L,Y,te){try{Oi=0;var $e=Yt($,L,Y,te);return Ms=null,$e}catch(Le){if(Le===Os||Le===du)throw Le;var Tt=Da(29,Le,null,$.mode);return Tt.lanes=te,Tt.return=$,Tt}finally{}}}var as=Dp(!0),Ap=Dp(!1),dl=!1;function Ld(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zd(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 fl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hl(e,n,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Dt&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=lu(e),hp(e,null,r),n}return ru(e,s,n,r),lu(e)}function _i(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,Mn(e,r)}}function Ud(e,n){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var d=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var b={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?d=h=b:h=h.next=b,r=r.next}while(r!==null);h===null?d=h=n:h=h.next=n}else d=h=n;r={baseState:s.baseState,firstBaseUpdate:d,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 Bd=!1;function Li(){if(Bd){var e=ks;if(e!==null)throw e}}function zi(e,n,r,s){Bd=!1;var d=e.updateQueue;dl=!1;var h=d.firstBaseUpdate,b=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var k=N,F=k.next;k.next=null,b===null?h=F:b.next=F,b=k;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,N=Z.lastBaseUpdate,N!==b&&(N===null?Z.firstBaseUpdate=F:N.next=F,Z.lastBaseUpdate=k))}if(h!==null){var le=d.baseState;b=0,Z=F=k=null,N=h;do{var G=N.lane&-536870913,Q=G!==N.lane;if(Q?(vt&G)===G:(s&G)===G){G!==0&&G===As&&(Bd=!0),Z!==null&&(Z=Z.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ke=e,Ve=N;G=n;var Yt=r;switch(Ve.tag){case 1:if(ke=Ve.payload,typeof ke=="function"){le=ke.call(Yt,le,G);break e}le=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ve.payload,G=typeof ke=="function"?ke.call(Yt,le,G):ke,G==null)break e;le=y({},le,G);break e;case 2:dl=!0}}G=N.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Z===null?(F=Z=Q,k=le):Z=Z.next=Q,b|=G;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);Z===null&&(k=le),d.baseState=k,d.firstBaseUpdate=F,d.lastBaseUpdate=Z,h===null&&(d.shared.lanes=0),yl|=b,e.lanes=b,e.memoizedState=le}}function kp(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function Op(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)kp(r[e],n)}var _s=C(null),pu=C(0);function Mp(e,n){e=Zr,J(pu,e),J(_s,n),Zr=e|n.baseLanes}function Hd(){J(pu,Zr),J(_s,_s.current)}function $d(){Zr=pu.current,V(_s),V(pu)}var Aa=C(null),Fa=null;function ml(e){var n=e.alternate;J(xn,xn.current&1),J(Aa,e),Fa===null&&(n===null||_s.current!==null||n.memoizedState!==null)&&(Fa=e)}function qd(e){J(xn,xn.current),J(Aa,e),Fa===null&&(Fa=e)}function _p(e){e.tag===22?(J(xn,xn.current),J(Aa,e),Fa===null&&(Fa=e)):pl()}function pl(){J(xn,xn.current),J(Aa,Aa.current)}function ka(e){V(Aa),Fa===e&&(Fa=null),V(xn)}var xn=C(0);function gu(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Xf(r)||Qf(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 Vr=0,lt=null,It=null,Cn=null,vu=!1,Ls=!1,rs=!1,yu=0,Ui=0,zs=null,u1=0;function mn(){throw Error(i(321))}function Id(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Ca(e[r],n[r]))return!1;return!0}function Vd(e,n,r,s,d,h){return Vr=h,lt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=e===null||e.memoizedState===null?vg:rf,rs=!1,h=r(s,d),rs=!1,Ls&&(h=zp(n,r,s,d)),Lp(e),h}function Lp(e){U.H=$i;var n=It!==null&&It.next!==null;if(Vr=0,Cn=It=lt=null,vu=!1,Ui=0,zs=null,n)throw Error(i(300));e===null||Dn||(e=e.dependencies,e!==null&&ou(e)&&(Dn=!0))}function zp(e,n,r,s){lt=e;var d=0;do{if(Ls&&(zs=null),Ui=0,Ls=!1,25<=d)throw Error(i(301));if(d+=1,Cn=It=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}U.H=yg,h=n(r,s)}while(Ls);return h}function c1(){var e=U.H,n=e.useState()[0];return n=typeof n.then=="function"?Bi(n):n,e=e.useState()[0],(It!==null?It.memoizedState:null)!==e&&(lt.flags|=1024),n}function Yd(){var e=yu!==0;return yu=0,e}function Fd(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Pd(e){if(vu){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}vu=!1}Vr=0,Cn=It=lt=null,Ls=!1,Ui=yu=0,zs=null}function fa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?lt.memoizedState=Cn=e:Cn=Cn.next=e,Cn}function bn(){if(It===null){var e=lt.alternate;e=e!==null?e.memoizedState:null}else e=It.next;var n=Cn===null?lt.memoizedState:Cn.next;if(n!==null)Cn=n,It=e;else{if(e===null)throw lt.alternate===null?Error(i(467)):Error(i(310));It=e,e={memoizedState:It.memoizedState,baseState:It.baseState,baseQueue:It.baseQueue,queue:It.queue,next:null},Cn===null?lt.memoizedState=Cn=e:Cn=Cn.next=e}return Cn}function xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bi(e){var n=Ui;return Ui+=1,zs===null&&(zs=[]),e=jp(zs,e,n),n=lt,(Cn===null?n.memoizedState:Cn.next)===null&&(n=n.alternate,U.H=n===null||n.memoizedState===null?vg:rf),e}function bu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Bi(e);if(e.$$typeof===I)return Kn(e)}throw Error(i(438,String(e)))}function Gd(e){var n=null,r=lt.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var s=lt.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=xu(),lt.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]=he;return n.index++,r}function Yr(e,n){return typeof n=="function"?n(e):n}function Su(e){var n=bn();return Xd(n,It,e)}function Xd(e,n,r){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var d=e.baseQueue,h=s.pending;if(h!==null){if(d!==null){var b=d.next;d.next=h.next,h.next=b}n.baseQueue=d=h,s.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var N=b=null,k=null,F=n,Z=!1;do{var le=F.lane&-536870913;if(le!==F.lane?(vt&le)===le:(Vr&le)===le){var G=F.revertLane;if(G===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),le===As&&(Z=!0);else if((Vr&G)===G){F=F.next,G===As&&(Z=!0);continue}else le={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(N=k=le,b=h):k=k.next=le,lt.lanes|=G,yl|=G;le=F.action,rs&&r(h,le),h=F.hasEagerState?F.eagerState:r(h,le)}else G={lane:le,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(N=k=G,b=h):k=k.next=G,lt.lanes|=le,yl|=le;F=F.next}while(F!==null&&F!==n);if(k===null?b=h:k.next=N,!Ca(h,e.memoizedState)&&(Dn=!0,Z&&(r=ks,r!==null)))throw r;e.memoizedState=h,e.baseState=b,e.baseQueue=k,s.lastRenderedState=h}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Qd(e){var n=bn(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var s=r.dispatch,d=r.pending,h=n.memoizedState;if(d!==null){r.pending=null;var b=d=d.next;do h=e(h,b.action),b=b.next;while(b!==d);Ca(h,n.memoizedState)||(Dn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,s]}function Up(e,n,r){var s=lt,d=bn(),h=bt;if(h){if(r===void 0)throw Error(i(407));r=r()}else r=n();var b=!Ca((It||d).memoizedState,r);if(b&&(d.memoizedState=r,Dn=!0),d=d.queue,Jd($p.bind(null,s,d,e),[e]),d.getSnapshot!==n||b||Cn!==null&&Cn.memoizedState.tag&1){if(s.flags|=2048,Us(9,{destroy:void 0},Hp.bind(null,s,d,r,n),null),Zt===null)throw Error(i(349));h||(Vr&127)!==0||Bp(s,n,r)}return r}function Bp(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=lt.updateQueue,n===null?(n=xu(),lt.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function Hp(e,n,r,s){n.value=r,n.getSnapshot=s,qp(n)&&Ip(e)}function $p(e,n,r){return r(function(){qp(n)&&Ip(e)})}function qp(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Ca(e,r)}catch{return!0}}function Ip(e){var n=Ql(e,2);n!==null&&Ea(n,e,2)}function Kd(e){var n=fa();if(typeof e=="function"){var r=e;if(e=r(),rs){Nt(!0);try{r()}finally{Nt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:e},n}function Vp(e,n,r,s){return e.baseState=r,Xd(e,It,typeof s=="function"?s:Yr)}function d1(e,n,r,s,d){if(Nu(e))throw Error(i(485));if(e=n.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){h.listeners.push(b)}};U.T!==null?r(!0):h.isTransition=!1,s(h),r=n.pending,r===null?(h.next=n.pending=h,Yp(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Yp(e,n){var r=n.action,s=n.payload,d=e.state;if(n.isTransition){var h=U.T,b={};U.T=b;try{var N=r(d,s),k=U.S;k!==null&&k(b,N),Fp(e,n,N)}catch(F){Zd(e,n,F)}finally{h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}else try{h=r(d,s),Fp(e,n,h)}catch(F){Zd(e,n,F)}}function Fp(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){Pp(e,n,s)},function(s){return Zd(e,n,s)}):Pp(e,n,r)}function Pp(e,n,r){n.status="fulfilled",n.value=r,Gp(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Yp(e,r)))}function Zd(e,n,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=r,Gp(n),n=n.next;while(n!==s)}e.action=null}function Gp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Xp(e,n){return n}function Qp(e,n){if(bt){var r=Zt.formState;if(r!==null){e:{var s=lt;if(bt){if(sn){t:{for(var d=sn,h=Ya;d.nodeType!==8;){if(!h){d=null;break t}if(d=Pa(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){sn=Pa(d.nextSibling),s=d.data==="F!";break e}}ul(s)}s=!1}s&&(n=r[0])}}return r=fa(),r.memoizedState=r.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xp,lastRenderedState:n},r.queue=s,r=mg.bind(null,lt,s),s.dispatch=r,s=Kd(!1),h=af.bind(null,lt,!1,s.queue),s=fa(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,r=d1.bind(null,lt,d,h,r),d.dispatch=r,s.memoizedState=e,[n,r,!1]}function Kp(e){var n=bn();return Zp(n,It,e)}function Zp(e,n,r){if(n=Xd(e,n,Xp)[0],e=Su(Yr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Bi(n)}catch(b){throw b===Os?du:b}else s=n;n=bn();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(lt.flags|=2048,Us(9,{destroy:void 0},f1.bind(null,d,r),null)),[s,h,e]}function f1(e,n){e.action=n}function Jp(e){var n=bn(),r=It;if(r!==null)return Zp(n,r,e);bn(),n=n.memoizedState,r=bn();var s=r.queue.dispatch;return r.memoizedState=e,[n,s,!1]}function Us(e,n,r,s){return e={tag:e,create:r,deps:s,inst:n,next:null},n=lt.updateQueue,n===null&&(n=xu(),lt.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 Wp(){return bn().memoizedState}function wu(e,n,r,s){var d=fa();lt.flags|=e,d.memoizedState=Us(1|n,{destroy:void 0},r,s===void 0?null:s)}function Eu(e,n,r,s){var d=bn();s=s===void 0?null:s;var h=d.memoizedState.inst;It!==null&&s!==null&&Id(s,It.memoizedState.deps)?d.memoizedState=Us(n,h,r,s):(lt.flags|=e,d.memoizedState=Us(1|n,h,r,s))}function eg(e,n){wu(8390656,8,e,n)}function Jd(e,n){Eu(2048,8,e,n)}function h1(e){lt.flags|=4;var n=lt.updateQueue;if(n===null)n=xu(),lt.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function tg(e){var n=bn().memoizedState;return h1({ref:n,nextImpl:e}),function(){if((Dt&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function ng(e,n){return Eu(4,2,e,n)}function ag(e,n){return Eu(4,4,e,n)}function rg(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 lg(e,n,r){r=r!=null?r.concat([e]):null,Eu(4,4,rg.bind(null,n,e),r)}function Wd(){}function sg(e,n){var r=bn();n=n===void 0?null:n;var s=r.memoizedState;return n!==null&&Id(n,s[1])?s[0]:(r.memoizedState=[e,n],e)}function ig(e,n){var r=bn();n=n===void 0?null:n;var s=r.memoizedState;if(n!==null&&Id(n,s[1]))return s[0];if(s=e(),rs){Nt(!0);try{e()}finally{Nt(!1)}}return r.memoizedState=[s,n],s}function ef(e,n,r){return r===void 0||(Vr&1073741824)!==0&&(vt&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=ov(),lt.lanes|=e,yl|=e,r)}function og(e,n,r,s){return Ca(r,n)?r:_s.current!==null?(e=ef(e,r,s),Ca(e,n)||(Dn=!0),e):(Vr&42)===0||(Vr&1073741824)!==0&&(vt&261930)===0?(Dn=!0,e.memoizedState=r):(e=ov(),lt.lanes|=e,yl|=e,n)}function ug(e,n,r,s,d){var h=H.p;H.p=h!==0&&8>h?h:8;var b=U.T,N={};U.T=N,af(e,!1,n,r);try{var k=d(),F=U.S;if(F!==null&&F(N,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var Z=o1(k,s);Hi(e,n,Z,_a(e))}else Hi(e,n,s,_a(e))}catch(le){Hi(e,n,{then:function(){},status:"rejected",reason:le},_a())}finally{H.p=h,b!==null&&N.types!==null&&(b.types=N.types),U.T=b}}function m1(){}function tf(e,n,r,s){if(e.tag!==5)throw Error(i(476));var d=cg(e).queue;ug(e,d,n,ie,r===null?m1:function(){return dg(e),r(s)})}function cg(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:Yr,lastRenderedState:ie},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function dg(e){var n=cg(e);n.next===null&&(n=e.alternate.memoizedState),Hi(e,n.next.queue,{},_a())}function nf(){return Kn(no)}function fg(){return bn().memoizedState}function hg(){return bn().memoizedState}function p1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=_a();e=fl(r);var s=hl(n,e,r);s!==null&&(Ea(s,n,r),_i(s,n,r)),n={cache:kd()},e.payload=n;return}n=n.return}}function g1(e,n,r){var s=_a();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Nu(e)?pg(n,r):(r=bd(e,n,r,s),r!==null&&(Ea(r,e,s),gg(r,n,s)))}function mg(e,n,r){var s=_a();Hi(e,n,r,s)}function Hi(e,n,r,s){var d={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Nu(e))pg(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var b=n.lastRenderedState,N=h(b,r);if(d.hasEagerState=!0,d.eagerState=N,Ca(N,b))return ru(e,n,d,0),Zt===null&&au(),!1}catch{}finally{}if(r=bd(e,n,d,s),r!==null)return Ea(r,e,s),gg(r,n,s),!0}return!1}function af(e,n,r,s){if(s={lane:2,revertLane:zf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Nu(e)){if(n)throw Error(i(479))}else n=bd(e,r,s,2),n!==null&&Ea(n,e,2)}function Nu(e){var n=e.alternate;return e===lt||n!==null&&n===lt}function pg(e,n){Ls=vu=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function gg(e,n,r){if((r&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,r|=s,n.lanes=r,Mn(e,r)}}var $i={readContext:Kn,use:bu,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useInsertionEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useSyncExternalStore:mn,useId:mn,useHostTransitionStatus:mn,useFormState:mn,useActionState:mn,useOptimistic:mn,useMemoCache:mn,useCacheRefresh:mn};$i.useEffectEvent=mn;var vg={readContext:Kn,use:bu,useCallback:function(e,n){return fa().memoizedState=[e,n===void 0?null:n],e},useContext:Kn,useEffect:eg,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,wu(4194308,4,rg.bind(null,n,e),r)},useLayoutEffect:function(e,n){return wu(4194308,4,e,n)},useInsertionEffect:function(e,n){wu(4,2,e,n)},useMemo:function(e,n){var r=fa();n=n===void 0?null:n;var s=e();if(rs){Nt(!0);try{e()}finally{Nt(!1)}}return r.memoizedState=[s,n],s},useReducer:function(e,n,r){var s=fa();if(r!==void 0){var d=r(n);if(rs){Nt(!0);try{r(n)}finally{Nt(!1)}}}else d=n;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=g1.bind(null,lt,e),[s.memoizedState,e]},useRef:function(e){var n=fa();return e={current:e},n.memoizedState=e},useState:function(e){e=Kd(e);var n=e.queue,r=mg.bind(null,lt,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Wd,useDeferredValue:function(e,n){var r=fa();return ef(r,e,n)},useTransition:function(){var e=Kd(!1);return e=ug.bind(null,lt,e.queue,!0,!1),fa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var s=lt,d=fa();if(bt){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Zt===null)throw Error(i(349));(vt&127)!==0||Bp(s,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,eg($p.bind(null,s,h,e),[e]),s.flags|=2048,Us(9,{destroy:void 0},Hp.bind(null,s,h,r,n),null),r},useId:function(){var e=fa(),n=Zt.identifierPrefix;if(bt){var r=xr,s=yr;r=(s&~(1<<32-en(s)-1)).toString(32)+r,n="_"+n+"R_"+r,r=yu++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=u1++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:nf,useFormState:Qp,useActionState:Qp,useOptimistic:function(e){var n=fa();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=af.bind(null,lt,!0,r),r.dispatch=n,[e,n]},useMemoCache:Gd,useCacheRefresh:function(){return fa().memoizedState=p1.bind(null,lt)},useEffectEvent:function(e){var n=fa(),r={impl:e};return n.memoizedState=r,function(){if((Dt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},rf={readContext:Kn,use:bu,useCallback:sg,useContext:Kn,useEffect:Jd,useImperativeHandle:lg,useInsertionEffect:ng,useLayoutEffect:ag,useMemo:ig,useReducer:Su,useRef:Wp,useState:function(){return Su(Yr)},useDebugValue:Wd,useDeferredValue:function(e,n){var r=bn();return og(r,It.memoizedState,e,n)},useTransition:function(){var e=Su(Yr)[0],n=bn().memoizedState;return[typeof e=="boolean"?e:Bi(e),n]},useSyncExternalStore:Up,useId:fg,useHostTransitionStatus:nf,useFormState:Kp,useActionState:Kp,useOptimistic:function(e,n){var r=bn();return Vp(r,It,e,n)},useMemoCache:Gd,useCacheRefresh:hg};rf.useEffectEvent=tg;var yg={readContext:Kn,use:bu,useCallback:sg,useContext:Kn,useEffect:Jd,useImperativeHandle:lg,useInsertionEffect:ng,useLayoutEffect:ag,useMemo:ig,useReducer:Qd,useRef:Wp,useState:function(){return Qd(Yr)},useDebugValue:Wd,useDeferredValue:function(e,n){var r=bn();return It===null?ef(r,e,n):og(r,It.memoizedState,e,n)},useTransition:function(){var e=Qd(Yr)[0],n=bn().memoizedState;return[typeof e=="boolean"?e:Bi(e),n]},useSyncExternalStore:Up,useId:fg,useHostTransitionStatus:nf,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,n){var r=bn();return It!==null?Vp(r,It,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Gd,useCacheRefresh:hg};yg.useEffectEvent=tg;function lf(e,n,r,s){n=e.memoizedState,r=r(s,n),r=r==null?n:y({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var sf={enqueueSetState:function(e,n,r){e=e._reactInternals;var s=_a(),d=fl(s);d.payload=n,r!=null&&(d.callback=r),n=hl(e,d,s),n!==null&&(Ea(n,e,s),_i(n,e,s))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var s=_a(),d=fl(s);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=hl(e,d,s),n!==null&&(Ea(n,e,s),_i(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=_a(),s=fl(r);s.tag=2,n!=null&&(s.callback=n),n=hl(e,s,r),n!==null&&(Ea(n,e,r),_i(n,e,r))}};function xg(e,n,r,s,d,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,b):n.prototype&&n.prototype.isPureReactComponent?!ji(r,s)||!ji(d,h):!0}function bg(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&&sf.enqueueReplaceState(n,n.state,null)}function ls(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=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Sg(e){nu(e)}function wg(e){console.error(e)}function Eg(e){nu(e)}function Ru(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Ng(e,n,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function of(e,n,r){return r=fl(r),r.tag=3,r.payload={element:null},r.callback=function(){Ru(e,n)},r}function Rg(e){return e=fl(e),e.tag=3,e}function jg(e,n,r,s){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=s.value;e.payload=function(){return d(h)},e.callback=function(){Ng(n,r,s)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Ng(n,r,s),typeof d!="function"&&(xl===null?xl=new Set([this]):xl.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function v1(e,n,r,s,d){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=r.alternate,n!==null&&Ds(n,r,d,!0),r=Aa.current,r!==null){switch(r.tag){case 31:case 13:return Fa===null?Uu():r.alternate===null&&pn===0&&(pn=3),r.flags&=-257,r.flags|=65536,r.lanes=d,s===fu?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([s]):n.add(s),Mf(e,s,d)),!1;case 22:return r.flags|=65536,s===fu?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)),Mf(e,s,d)),!1}throw Error(i(435,r.tag))}return Mf(e,s,d),Uu(),!1}if(bt)return n=Aa.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==jd&&(e=Error(i(422),{cause:s}),Di(qa(e,r)))):(s!==jd&&(n=Error(i(423),{cause:s}),Di(qa(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=qa(s,r),d=of(e.stateNode,s,d),Ud(e,d),pn!==4&&(pn=2)),!1;var h=Error(i(520),{cause:s});if(h=qa(h,r),Xi===null?Xi=[h]:Xi.push(h),pn!==4&&(pn=2),n===null)return!0;s=qa(s,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=of(r.stateNode,s,e),Ud(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"&&(xl===null||!xl.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Rg(d),jg(d,e,r,s),Ud(r,d),!1}r=r.return}while(r!==null);return!1}var uf=Error(i(461)),Dn=!1;function Zn(e,n,r,s){n.child=e===null?Ap(n,null,r,s):as(n,e.child,r,s)}function Tg(e,n,r,s,d){r=r.render;var h=n.ref;if("ref"in s){var b={};for(var N in s)N!=="ref"&&(b[N]=s[N])}else b=s;return Wl(n),s=Vd(e,n,r,b,h,d),N=Yd(),e!==null&&!Dn?(Fd(e,n,d),Fr(e,n,d)):(bt&&N&&Nd(n),n.flags|=1,Zn(e,n,s,d),n.child)}function Cg(e,n,r,s,d){if(e===null){var h=r.type;return typeof h=="function"&&!Sd(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,Dg(e,n,h,s,d)):(e=su(r.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!vf(e,d)){var b=h.memoizedProps;if(r=r.compare,r=r!==null?r:ji,r(b,s)&&e.ref===n.ref)return Fr(e,n,d)}return n.flags|=1,e=Hr(h,s),e.ref=n.ref,e.return=n,n.child=e}function Dg(e,n,r,s,d){if(e!==null){var h=e.memoizedProps;if(ji(h,s)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=s=h,vf(e,d))(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,Fr(e,n,d)}return cf(e,n,r,s,d)}function Ag(e,n,r,s){var d=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,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~h}else s=0,n.child=null;return kg(e,n,h,r,s)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&cu(n,h!==null?h.cachePool:null),h!==null?Mp(n,h):Hd(),_p(n);else return s=n.lanes=536870912,kg(e,n,h!==null?h.baseLanes|r:r,r,s)}else h!==null?(cu(n,h.cachePool),Mp(n,h),pl(),n.memoizedState=null):(e!==null&&cu(n,null),Hd(),pl());return Zn(e,n,d,r),n.child}function qi(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function kg(e,n,r,s,d){var h=Md();return h=h===null?null:{parent:Tn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&cu(n,null),Hd(),_p(n),e!==null&&Ds(e,n,s,!0),n.childLanes=d,null}function ju(e,n){return n=Cu({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Og(e,n,r){return as(n,e.child,null,r),e=ju(n,n.pendingProps),e.flags|=2,ka(n),n.memoizedState=null,e}function y1(e,n,r){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(bt){if(s.mode==="hidden")return e=ju(n,s),n.lanes=536870912,qi(null,e);if(qd(n),(e=sn)?(e=Yv(e,Ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:il!==null?{id:yr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},r=pp(e),r.return=n,n.child=r,Qn=n,sn=null)):e=null,e===null)throw ul(n);return n.lanes=536870912,null}return ju(n,s)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(qd(n),d)if(n.flags&256)n.flags&=-257,n=Og(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||Ds(e,n,r,!1),d=(r&e.childLanes)!==0,Dn||d){if(s=Zt,s!==null&&(b=A(s,r),b!==0&&b!==h.retryLane))throw h.retryLane=b,Ql(e,b),Ea(s,e,b),uf;Uu(),n=Og(e,n,r)}else e=h.treeContext,sn=Pa(b.nextSibling),Qn=n,bt=!0,ol=null,Ya=!1,e!==null&&yp(n,e),n=ju(n,s),n.flags|=4096;return n}return e=Hr(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Tu(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 cf(e,n,r,s,d){return Wl(n),r=Vd(e,n,r,s,void 0,d),s=Yd(),e!==null&&!Dn?(Fd(e,n,d),Fr(e,n,d)):(bt&&s&&Nd(n),n.flags|=1,Zn(e,n,r,d),n.child)}function Mg(e,n,r,s,d,h){return Wl(n),n.updateQueue=null,r=zp(n,s,r,d),Lp(e),s=Yd(),e!==null&&!Dn?(Fd(e,n,h),Fr(e,n,h)):(bt&&s&&Nd(n),n.flags|=1,Zn(e,n,r,h),n.child)}function _g(e,n,r,s,d){if(Wl(n),n.stateNode===null){var h=Rs,b=r.contextType;typeof b=="object"&&b!==null&&(h=Kn(b)),h=new r(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=sf,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},Ld(n),b=r.contextType,h.context=typeof b=="object"&&b!==null?Kn(b):Rs,h.state=n.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(lf(n,r,b,s),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&sf.enqueueReplaceState(h,h.state,null),zi(n,s,h,d),Li(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var N=n.memoizedProps,k=ls(r,N);h.props=k;var F=h.context,Z=r.contextType;b=Rs,typeof Z=="object"&&Z!==null&&(b=Kn(Z));var le=r.getDerivedStateFromProps;Z=typeof le=="function"||typeof h.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,Z||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(N||F!==b)&&bg(n,h,s,b),dl=!1;var G=n.memoizedState;h.state=G,zi(n,s,h,d),Li(),F=n.memoizedState,N||G!==F||dl?(typeof le=="function"&&(lf(n,r,le,s),F=n.memoizedState),(k=dl||xg(n,r,k,s,G,F,b))?(Z||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=b,s=k):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,zd(e,n),b=n.memoizedProps,Z=ls(r,b),h.props=Z,le=n.pendingProps,G=h.context,F=r.contextType,k=Rs,typeof F=="object"&&F!==null&&(k=Kn(F)),N=r.getDerivedStateFromProps,(F=typeof N=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==le||G!==k)&&bg(n,h,s,k),dl=!1,G=n.memoizedState,h.state=G,zi(n,s,h,d),Li();var Q=n.memoizedState;b!==le||G!==Q||dl||e!==null&&e.dependencies!==null&&ou(e.dependencies)?(typeof N=="function"&&(lf(n,r,N,s),Q=n.memoizedState),(Z=dl||xg(n,r,Z,s,G,Q,k)||e!==null&&e.dependencies!==null&&ou(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,Q,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,Q,k)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=Q),h.props=s,h.state=Q,h.context=k,s=Z):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,Tu(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=as(n,e.child,null,d),n.child=as(n,null,r,d)):Zn(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Fr(e,n,d),e}function Lg(e,n,r,s){return Zl(),n.flags|=256,Zn(e,n,r,s),n.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ff(e){return{baseLanes:e,cachePool:Np()}}function hf(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Ma),e}function zg(e,n,r){var s=n.pendingProps,d=!1,h=(n.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(xn.current&2)!==0),b&&(d=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(bt){if(d?ml(n):pl(),(e=sn)?(e=Yv(e,Ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:il!==null?{id:yr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},r=pp(e),r.return=n,n.child=r,Qn=n,sn=null)):e=null,e===null)throw ul(n);return Qf(e)?n.lanes=32:n.lanes=536870912,null}var N=s.children;return s=s.fallback,d?(pl(),d=n.mode,N=Cu({mode:"hidden",children:N},d),s=Kl(s,d,r,null),N.return=n,s.return=n,N.sibling=s,n.child=N,s=n.child,s.memoizedState=ff(r),s.childLanes=hf(e,b,r),n.memoizedState=df,qi(null,s)):(ml(n),mf(n,N))}var k=e.memoizedState;if(k!==null&&(N=k.dehydrated,N!==null)){if(h)n.flags&256?(ml(n),n.flags&=-257,n=pf(e,n,r)):n.memoizedState!==null?(pl(),n.child=e.child,n.flags|=128,n=null):(pl(),N=s.fallback,d=n.mode,s=Cu({mode:"visible",children:s.children},d),N=Kl(N,d,r,null),N.flags|=2,s.return=n,N.return=n,s.sibling=N,n.child=s,as(n,e.child,null,r),s=n.child,s.memoizedState=ff(r),s.childLanes=hf(e,b,r),n.memoizedState=df,n=qi(null,s));else if(ml(n),Qf(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var F=b.dgst;b=F,s=Error(i(419)),s.stack="",s.digest=b,Di({value:s,source:null,stack:null}),n=pf(e,n,r)}else if(Dn||Ds(e,n,r,!1),b=(r&e.childLanes)!==0,Dn||b){if(b=Zt,b!==null&&(s=A(b,r),s!==0&&s!==k.retryLane))throw k.retryLane=s,Ql(e,s),Ea(b,e,s),uf;Xf(N)||Uu(),n=pf(e,n,r)}else Xf(N)?(n.flags|=192,n.child=e.child,n=null):(e=k.treeContext,sn=Pa(N.nextSibling),Qn=n,bt=!0,ol=null,Ya=!1,e!==null&&yp(n,e),n=mf(n,s.children),n.flags|=4096);return n}return d?(pl(),N=s.fallback,d=n.mode,k=e.child,F=k.sibling,s=Hr(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&65011712,F!==null?N=Hr(F,N):(N=Kl(N,d,r,null),N.flags|=2),N.return=n,s.return=n,s.sibling=N,n.child=s,qi(null,s),s=n.child,N=e.child.memoizedState,N===null?N=ff(r):(d=N.cachePool,d!==null?(k=Tn._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=Np(),N={baseLanes:N.baseLanes|r,cachePool:d}),s.memoizedState=N,s.childLanes=hf(e,b,r),n.memoizedState=df,qi(e.child,s)):(ml(n),r=e.child,e=r.sibling,r=Hr(r,{mode:"visible",children:s.children}),r.return=n,r.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=r,n.memoizedState=null,r)}function mf(e,n){return n=Cu({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Cu(e,n){return e=Da(22,e,null,n),e.lanes=0,e}function pf(e,n,r){return as(n,e.child,null,r),e=mf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ug(e,n,r){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Dd(e.return,n,r)}function gf(e,n,r,s,d,h){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:d,treeForkCount:h}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=r,b.tailMode=d,b.treeForkCount=h)}function Bg(e,n,r){var s=n.pendingProps,d=s.revealOrder,h=s.tail;s=s.children;var b=xn.current,N=(b&2)!==0;if(N?(b=b&1|2,n.flags|=128):b&=1,J(xn,b),Zn(e,n,s,r),s=bt?Ci:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ug(e,r,n);else if(e.tag===19)Ug(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(d){case"forwards":for(r=n.child,d=null;r!==null;)e=r.alternate,e!==null&&gu(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),gf(n,!1,d,r,h,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&gu(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}gf(n,!0,r,null,h,s);break;case"together":gf(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Fr(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),yl|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Ds(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=Hr(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=Hr(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function vf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&ou(e)))}function x1(e,n,r){switch(n.tag){case 3:ct(n,n.stateNode.containerInfo),cl(n,Tn,e.memoizedState.cache),Zl();break;case 27:case 5:nt(n);break;case 4:ct(n,n.stateNode.containerInfo);break;case 10:cl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,qd(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(ml(n),n.flags|=128,null):(r&n.child.childLanes)!==0?zg(e,n,r):(ml(n),e=Fr(e,n,r),e!==null?e.sibling:null);ml(n);break;case 19:var d=(e.flags&128)!==0;if(s=(r&n.childLanes)!==0,s||(Ds(e,n,r,!1),s=(r&n.childLanes)!==0),d){if(s)return Bg(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),J(xn,xn.current),s)break;return null;case 22:return n.lanes=0,Ag(e,n,r,n.pendingProps);case 24:cl(n,Tn,e.memoizedState.cache)}return Fr(e,n,r)}function Hg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)Dn=!0;else{if(!vf(e,r)&&(n.flags&128)===0)return Dn=!1,x1(e,n,r);Dn=(e.flags&131072)!==0}else Dn=!1,bt&&(n.flags&1048576)!==0&&vp(n,Ci,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=ts(n.elementType),n.type=e,typeof e=="function")Sd(e)?(s=ls(e,s),n.tag=1,n=_g(null,n,e,s,r)):(n.tag=0,n=cf(null,n,e,s,r));else{if(e!=null){var d=e.$$typeof;if(d===X){n.tag=11,n=Tg(null,n,e,s,r);break e}else if(d===M){n.tag=14,n=Cg(null,n,e,s,r);break e}}throw n=pe(e)||e,Error(i(306,n,""))}}return n;case 0:return cf(e,n,n.type,n.pendingProps,r);case 1:return s=n.type,d=ls(s,n.pendingProps),_g(e,n,s,d,r);case 3:e:{if(ct(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var h=n.memoizedState;d=h.element,zd(e,n),zi(n,s,null,r);var b=n.memoizedState;if(s=b.cache,cl(n,Tn,s),s!==h.cache&&Ad(n,[Tn],r,!0),Li(),s=b.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Lg(e,n,s,r);break e}else if(s!==d){d=qa(Error(i(424)),n),Di(d),n=Lg(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(sn=Pa(e.firstChild),Qn=n,bt=!0,ol=null,Ya=!0,r=Ap(n,null,s,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Zl(),s===d){n=Fr(e,n,r);break e}Zn(e,n,s,r)}n=n.child}return n;case 26:return Tu(e,n),e===null?(r=Kv(n.type,null,n.pendingProps,null))?n.memoizedState=r:bt||(r=n.type,e=n.pendingProps,s=Yu(je.current).createElement(r),s[me]=n,s[De]=e,Jn(s,r,e),ft(s),n.stateNode=s):n.memoizedState=Kv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return nt(n),e===null&&bt&&(s=n.stateNode=Gv(n.type,n.pendingProps,je.current),Qn=n,Ya=!0,d=sn,El(n.type)?(Kf=d,sn=Pa(s.firstChild)):sn=d),Zn(e,n,n.pendingProps.children,r),Tu(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&bt&&((d=s=sn)&&(s=Q1(s,n.type,n.pendingProps,Ya),s!==null?(n.stateNode=s,Qn=n,sn=Pa(s.firstChild),Ya=!1,d=!0):d=!1),d||ul(n)),nt(n),d=n.type,h=n.pendingProps,b=e!==null?e.memoizedProps:null,s=h.children,Ff(d,h)?s=null:b!==null&&Ff(d,b)&&(n.flags|=32),n.memoizedState!==null&&(d=Vd(e,n,c1,null,null,r),no._currentValue=d),Tu(e,n),Zn(e,n,s,r),n.child;case 6:return e===null&&bt&&((e=r=sn)&&(r=K1(r,n.pendingProps,Ya),r!==null?(n.stateNode=r,Qn=n,sn=null,e=!0):e=!1),e||ul(n)),null;case 13:return zg(e,n,r);case 4:return ct(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=as(n,null,s,r):Zn(e,n,s,r),n.child;case 11:return Tg(e,n,n.type,n.pendingProps,r);case 7:return Zn(e,n,n.pendingProps,r),n.child;case 8:return Zn(e,n,n.pendingProps.children,r),n.child;case 12:return Zn(e,n,n.pendingProps.children,r),n.child;case 10:return s=n.pendingProps,cl(n,n.type,s.value),Zn(e,n,s.children,r),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,Wl(n),d=Kn(d),s=s(d),n.flags|=1,Zn(e,n,s,r),n.child;case 14:return Cg(e,n,n.type,n.pendingProps,r);case 15:return Dg(e,n,n.type,n.pendingProps,r);case 19:return Bg(e,n,r);case 31:return y1(e,n,r);case 22:return Ag(e,n,r,n.pendingProps);case 24:return Wl(n),s=Kn(Tn),e===null?(d=Md(),d===null&&(d=Zt,h=kd(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:s,cache:d},Ld(n),cl(n,Tn,d)):((e.lanes&r)!==0&&(zd(e,n),zi(n,null,null,r),Li()),d=e.memoizedState,h=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),cl(n,Tn,s)):(s=h.cache,cl(n,Tn,s),s!==d.cache&&Ad(n,[Tn],r,!0))),Zn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Pr(e){e.flags|=4}function yf(e,n,r,s,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(fv())e.flags|=8192;else throw ns=fu,_d}else e.flags&=-16777217}function $g(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ty(n))if(fv())e.flags|=8192;else throw ns=fu,_d}function Du(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Xt():536870912,e.lanes|=n,qs|=n)}function Ii(e,n){if(!bt)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 on(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(n)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=r,n}function b1(e,n,r){var s=n.pendingProps;switch(Rd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(n),null;case 1:return on(n),null;case 3:return r=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Ir(Tn),Fe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Cs(n)?Pr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Td())),on(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Pr(n),h!==null?(on(n),$g(n,h)):(on(n),yf(n,d,null,s,r))):h?h!==e.memoizedState?(Pr(n),on(n),$g(n,h)):(on(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Pr(n),on(n),yf(n,d,e,s,r)),null;case 27:if(wn(n),r=je.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Pr(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return on(n),null}e=de.current,Cs(n)?xp(n):(e=Gv(d,s,r),n.stateNode=e,Pr(n))}return on(n),null;case 5:if(wn(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Pr(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return on(n),null}if(h=de.current,Cs(n))xp(n);else{var b=Yu(je.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?b.createElement(d,{is:s.is}):b.createElement(d)}}h[me]=n,h[De]=s;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=h;e:switch(Jn(h,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Pr(n)}}return on(n),yf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Pr(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=je.current,Cs(n)){if(e=n.stateNode,r=n.memoizedProps,s=null,d=Qn,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[me]=n,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||zv(e.nodeValue,r)),e||ul(n,!0)}else e=Yu(e).createTextNode(s),e[me]=n,n.stateNode=e}return on(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(s=Cs(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[me]=n}else Zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;on(n),e=!1}else r=Td(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(ka(n),n):(ka(n),null);if((n.flags&128)!==0)throw Error(i(558))}return on(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Cs(n),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[me]=n}else Zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;on(n),d=!1}else d=Td(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(ka(n),n):(ka(n),null)}return ka(n),(n.flags&128)!==0?(n.lanes=r,n):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Du(n,n.updateQueue),on(n),null);case 4:return Fe(),e===null&&$f(n.stateNode.containerInfo),on(n),null;case 10:return Ir(n.type),on(n),null;case 19:if(V(xn),s=n.memoizedState,s===null)return on(n),null;if(d=(n.flags&128)!==0,h=s.rendering,h===null)if(d)Ii(s,!1);else{if(pn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=gu(e),h!==null){for(n.flags|=128,Ii(s,!1),e=h.updateQueue,n.updateQueue=e,Du(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)mp(r,e),r=r.sibling;return J(xn,xn.current&1|2),bt&&$r(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&an()>_u&&(n.flags|=128,d=!0,Ii(s,!1),n.lanes=4194304)}else{if(!d)if(e=gu(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Du(n,e),Ii(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!bt)return on(n),null}else 2*an()-s.renderingStartTime>_u&&r!==536870912&&(n.flags|=128,d=!0,Ii(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=an(),e.sibling=null,r=xn.current,J(xn,d?r&1|2:r&1),bt&&$r(n,s.treeForkCount),e):(on(n),null);case 22:case 23:return ka(n),$d(),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&&(on(n),n.subtreeFlags&6&&(n.flags|=8192)):on(n),r=n.updateQueue,r!==null&&Du(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&&V(es),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Ir(Tn),on(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function S1(e,n){switch(Rd(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ir(Tn),Fe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return wn(n),null;case 31:if(n.memoizedState!==null){if(ka(n),n.alternate===null)throw Error(i(340));Zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(ka(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(xn),null;case 4:return Fe(),null;case 10:return Ir(n.type),null;case 22:case 23:return ka(n),$d(),e!==null&&V(es),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Ir(Tn),null;case 25:return null;default:return null}}function qg(e,n){switch(Rd(n),n.tag){case 3:Ir(Tn),Fe();break;case 26:case 27:case 5:wn(n);break;case 4:Fe();break;case 31:n.memoizedState!==null&&ka(n);break;case 13:ka(n);break;case 19:V(xn);break;case 10:Ir(n.type);break;case 22:case 23:ka(n),$d(),e!==null&&V(es);break;case 24:Ir(Tn)}}function Vi(e,n){try{var r=n.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var d=s.next;r=d;do{if((r.tag&e)===e){s=void 0;var h=r.create,b=r.inst;s=h(),b.destroy=s}r=r.next}while(r!==d)}}catch(N){$t(n,n.return,N)}}function gl(e,n,r){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var h=d.next;s=h;do{if((s.tag&e)===e){var b=s.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,d=n;var k=r,F=N;try{F()}catch(Z){$t(d,k,Z)}}}s=s.next}while(s!==h)}}catch(Z){$t(n,n.return,Z)}}function Ig(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{Op(n,r)}catch(s){$t(e,e.return,s)}}}function Vg(e,n,r){r.props=ls(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){$t(e,n,s)}}function Yi(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(d){$t(e,n,d)}}function br(e,n){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(d){$t(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){$t(e,n,d)}else r.current=null}function Yg(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(d){$t(e,e.return,d)}}function xf(e,n,r){try{var s=e.stateNode;V1(s,e.type,r,n),s[De]=n}catch(d){$t(e,e.return,d)}}function Fg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&El(e.type)||e.tag===4}function bf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fg(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&&El(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 Sf(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&&El(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(Sf(e,n,r),e=e.sibling;e!==null;)Sf(e,n,r),e=e.sibling}function Au(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&&El(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Au(e,n,r),e=e.sibling;e!==null;)Au(e,n,r),e=e.sibling}function Pg(e){var n=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);Jn(n,s,r),n[me]=e,n[De]=r}catch(h){$t(e,e.return,h)}}var Gr=!1,An=!1,wf=!1,Gg=typeof WeakSet=="function"?WeakSet:Set,In=null;function w1(e,n){if(e=e.containerInfo,Vf=Zu,e=lp(e),md(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 d=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var b=0,N=-1,k=-1,F=0,Z=0,le=e,G=null;t:for(;;){for(var Q;le!==r||d!==0&&le.nodeType!==3||(N=b+d),le!==h||s!==0&&le.nodeType!==3||(k=b+s),le.nodeType===3&&(b+=le.nodeValue.length),(Q=le.firstChild)!==null;)G=le,le=Q;for(;;){if(le===e)break t;if(G===r&&++F===d&&(N=b),G===h&&++Z===s&&(k=b),(Q=le.nextSibling)!==null)break;le=G,G=le.parentNode}le=Q}r=N===-1||k===-1?null:{start:N,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yf={focusedElem:e,selectionRange:r},Zu=!1,In=n;In!==null;)if(n=In,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,In=e;else for(;In!==null;){switch(n=In,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++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,d=h.memoizedProps,h=h.memoizedState,s=r.stateNode;try{var ke=ls(r.type,d);e=s.getSnapshotBeforeUpdate(ke,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)Gf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gf(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,In=e;break}In=n.return}}function Xg(e,n,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:Qr(e,r),s&4&&Vi(5,r);break;case 1:if(Qr(e,r),s&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(b){$t(r,r.return,b)}else{var d=ls(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){$t(r,r.return,b)}}s&64&&Ig(r),s&512&&Yi(r,r.return);break;case 3:if(Qr(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{Op(e,n)}catch(b){$t(r,r.return,b)}}break;case 27:n===null&&s&4&&Pg(r);case 26:case 5:Qr(e,r),n===null&&s&4&&Yg(r),s&512&&Yi(r,r.return);break;case 12:Qr(e,r);break;case 31:Qr(e,r),s&4&&Zg(e,r);break;case 13:Qr(e,r),s&4&&Jg(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=k1.bind(null,r),Z1(e,r))));break;case 22:if(s=r.memoizedState!==null||Gr,!s){n=n!==null&&n.memoizedState!==null||An,d=Gr;var h=An;Gr=s,(An=n)&&!h?Kr(e,r,(r.subtreeFlags&8772)!==0):Qr(e,r),Gr=d,An=h}break;case 30:break;default:Qr(e,r)}}function Qg(e){var n=e.alternate;n!==null&&(e.alternate=null,Qg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ie(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 cn=null,xa=!1;function Xr(e,n,r){for(r=r.child;r!==null;)Kg(e,n,r),r=r.sibling}function Kg(e,n,r){if(ae&&typeof ae.onCommitFiberUnmount=="function")try{ae.onCommitFiberUnmount(Wt,r)}catch{}switch(r.tag){case 26:An||br(r,n),Xr(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:An||br(r,n);var s=cn,d=xa;El(r.type)&&(cn=r.stateNode,xa=!1),Xr(e,n,r),Wi(r.stateNode),cn=s,xa=d;break;case 5:An||br(r,n);case 6:if(s=cn,d=xa,cn=null,Xr(e,n,r),cn=s,xa=d,cn!==null)if(xa)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(r.stateNode)}catch(h){$t(r,n,h)}else try{cn.removeChild(r.stateNode)}catch(h){$t(r,n,h)}break;case 18:cn!==null&&(xa?(e=cn,Iv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Qs(e)):Iv(cn,r.stateNode));break;case 4:s=cn,d=xa,cn=r.stateNode.containerInfo,xa=!0,Xr(e,n,r),cn=s,xa=d;break;case 0:case 11:case 14:case 15:gl(2,r,n),An||gl(4,r,n),Xr(e,n,r);break;case 1:An||(br(r,n),s=r.stateNode,typeof s.componentWillUnmount=="function"&&Vg(r,n,s)),Xr(e,n,r);break;case 21:Xr(e,n,r);break;case 22:An=(s=An)||r.memoizedState!==null,Xr(e,n,r),An=s;break;default:Xr(e,n,r)}}function Zg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qs(e)}catch(r){$t(n,n.return,r)}}}function Jg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qs(e)}catch(r){$t(n,n.return,r)}}function E1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Gg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Gg),n;default:throw Error(i(435,e.tag))}}function ku(e,n){var r=E1(e);n.forEach(function(s){if(!r.has(s)){r.add(s);var d=O1.bind(null,e,s);s.then(d,d)}})}function ba(e,n){var r=n.deletions;if(r!==null)for(var s=0;s<r.length;s++){var d=r[s],h=e,b=n,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(El(N.type)){cn=N.stateNode,xa=!1;break e}break;case 5:cn=N.stateNode,xa=!1;break e;case 3:case 4:cn=N.stateNode.containerInfo,xa=!0;break e}N=N.return}if(cn===null)throw Error(i(160));Kg(h,b,d),cn=null,xa=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Wg(n,e),n=n.sibling}var sr=null;function Wg(e,n){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ba(n,e),Sa(e),s&4&&(gl(3,e,e.return),Vi(3,e),gl(5,e,e.return));break;case 1:ba(n,e),Sa(e),s&512&&(An||r===null||br(r,r.return)),s&64&&Gr&&(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 d=sr;if(ba(n,e),Sa(e),s&512&&(An||r===null||br(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,d=d.ownerDocument||d;t:switch(s){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Ze]||h[me]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(s),d.head.insertBefore(h,d.querySelector("head > title"))),Jn(h,s,r),h[me]=e,ft(h),s=h;break e;case"link":var b=Wv("link","href",d).get(s+(r.href||""));if(b){for(var N=0;N<b.length;N++)if(h=b[N],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)){b.splice(N,1);break t}}h=d.createElement(s),Jn(h,s,r),d.head.appendChild(h);break;case"meta":if(b=Wv("meta","content",d).get(s+(r.content||""))){for(N=0;N<b.length;N++)if(h=b[N],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)){b.splice(N,1);break t}}h=d.createElement(s),Jn(h,s,r),d.head.appendChild(h);break;default:throw Error(i(468,s))}h[me]=e,ft(h),s=h}e.stateNode=s}else ey(d,e.type,e.stateNode);else e.stateNode=Jv(d,s,e.memoizedProps);else h!==s?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,s===null?ey(d,e.type,e.stateNode):Jv(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&xf(e,e.memoizedProps,r.memoizedProps)}break;case 27:ba(n,e),Sa(e),s&512&&(An||r===null||br(r,r.return)),r!==null&&s&4&&xf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(ba(n,e),Sa(e),s&512&&(An||r===null||br(r,r.return)),e.flags&32){d=e.stateNode;try{ll(d,"")}catch(ke){$t(e,e.return,ke)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,xf(e,d,r!==null?r.memoizedProps:d)),s&1024&&(wf=!0);break;case 6:if(ba(n,e),Sa(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(ke){$t(e,e.return,ke)}}break;case 3:if(Gu=null,d=sr,sr=Fu(n.containerInfo),ba(n,e),sr=d,Sa(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Qs(n.containerInfo)}catch(ke){$t(e,e.return,ke)}wf&&(wf=!1,ev(e));break;case 4:s=sr,sr=Fu(e.stateNode.containerInfo),ba(n,e),Sa(e),sr=s;break;case 12:ba(n,e),Sa(e);break;case 31:ba(n,e),Sa(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ku(e,s)));break;case 13:ba(n,e),Sa(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Mu=an()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ku(e,s)));break;case 22:d=e.memoizedState!==null;var k=r!==null&&r.memoizedState!==null,F=Gr,Z=An;if(Gr=F||d,An=Z||k,ba(n,e),An=Z,Gr=F,Sa(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||k||Gr||An||ss(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){k=r=n;try{if(h=k.stateNode,d)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=k.stateNode;var le=k.memoizedProps.style,G=le!=null&&le.hasOwnProperty("display")?le.display:null;N.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ke){$t(k,k.return,ke)}}}else if(n.tag===6){if(r===null){k=n;try{k.stateNode.nodeValue=d?"":k.memoizedProps}catch(ke){$t(k,k.return,ke)}}}else if(n.tag===18){if(r===null){k=n;try{var Q=k.stateNode;d?Vv(Q,!0):Vv(k.stateNode,!1)}catch(ke){$t(k,k.return,ke)}}}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,ku(e,r))));break;case 19:ba(n,e),Sa(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ku(e,s)));break;case 30:break;case 21:break;default:ba(n,e),Sa(e)}}function Sa(e){var n=e.flags;if(n&2){try{for(var r,s=e.return;s!==null;){if(Fg(s)){r=s;break}s=s.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var d=r.stateNode,h=bf(e);Au(e,h,d);break;case 5:var b=r.stateNode;r.flags&32&&(ll(b,""),r.flags&=-33);var N=bf(e);Au(e,N,b);break;case 3:case 4:var k=r.stateNode.containerInfo,F=bf(e);Sf(e,F,k);break;default:throw Error(i(161))}}catch(Z){$t(e,e.return,Z)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function ev(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;ev(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Qr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Xg(e,n.alternate,n),n=n.sibling}function ss(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),ss(n);break;case 1:br(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Vg(n,n.return,r),ss(n);break;case 27:Wi(n.stateNode);case 26:case 5:br(n,n.return),ss(n);break;case 22:n.memoizedState===null&&ss(n);break;case 30:ss(n);break;default:ss(n)}e=e.sibling}}function Kr(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,h=n,b=h.flags;switch(h.tag){case 0:case 11:case 15:Kr(d,h,r),Vi(4,h);break;case 1:if(Kr(d,h,r),s=h,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(F){$t(s,s.return,F)}if(s=h,d=s.updateQueue,d!==null){var N=s.stateNode;try{var k=d.shared.hiddenCallbacks;if(k!==null)for(d.shared.hiddenCallbacks=null,d=0;d<k.length;d++)kp(k[d],N)}catch(F){$t(s,s.return,F)}}r&&b&64&&Ig(h),Yi(h,h.return);break;case 27:Pg(h);case 26:case 5:Kr(d,h,r),r&&s===null&&b&4&&Yg(h),Yi(h,h.return);break;case 12:Kr(d,h,r);break;case 31:Kr(d,h,r),r&&b&4&&Zg(d,h);break;case 13:Kr(d,h,r),r&&b&4&&Jg(d,h);break;case 22:h.memoizedState===null&&Kr(d,h,r),Yi(h,h.return);break;case 30:break;default:Kr(d,h,r)}n=n.sibling}}function Ef(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&&Ai(r))}function Nf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ai(e))}function ir(e,n,r,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)tv(e,n,r,s),n=n.sibling}function tv(e,n,r,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:ir(e,n,r,s),d&2048&&Vi(9,n);break;case 1:ir(e,n,r,s);break;case 3:ir(e,n,r,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ai(e)));break;case 12:if(d&2048){ir(e,n,r,s),e=n.stateNode;try{var h=n.memoizedProps,b=h.id,N=h.onPostCommit;typeof N=="function"&&N(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){$t(n,n.return,k)}}else ir(e,n,r,s);break;case 31:ir(e,n,r,s);break;case 13:ir(e,n,r,s);break;case 23:break;case 22:h=n.stateNode,b=n.alternate,n.memoizedState!==null?h._visibility&2?ir(e,n,r,s):Fi(e,n):h._visibility&2?ir(e,n,r,s):(h._visibility|=2,Bs(e,n,r,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Ef(b,n);break;case 24:ir(e,n,r,s),d&2048&&Nf(n.alternate,n);break;default:ir(e,n,r,s)}}function Bs(e,n,r,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,b=n,N=r,k=s,F=b.flags;switch(b.tag){case 0:case 11:case 15:Bs(h,b,N,k,d),Vi(8,b);break;case 23:break;case 22:var Z=b.stateNode;b.memoizedState!==null?Z._visibility&2?Bs(h,b,N,k,d):Fi(h,b):(Z._visibility|=2,Bs(h,b,N,k,d)),d&&F&2048&&Ef(b.alternate,b);break;case 24:Bs(h,b,N,k,d),d&&F&2048&&Nf(b.alternate,b);break;default:Bs(h,b,N,k,d)}n=n.sibling}}function Fi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,s=n,d=s.flags;switch(s.tag){case 22:Fi(r,s),d&2048&&Ef(s.alternate,s);break;case 24:Fi(r,s),d&2048&&Nf(s.alternate,s);break;default:Fi(r,s)}n=n.sibling}}var Pi=8192;function Hs(e,n,r){if(e.subtreeFlags&Pi)for(e=e.child;e!==null;)nv(e,n,r),e=e.sibling}function nv(e,n,r){switch(e.tag){case 26:Hs(e,n,r),e.flags&Pi&&e.memoizedState!==null&&uS(r,sr,e.memoizedState,e.memoizedProps);break;case 5:Hs(e,n,r);break;case 3:case 4:var s=sr;sr=Fu(e.stateNode.containerInfo),Hs(e,n,r),sr=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Pi,Pi=16777216,Hs(e,n,r),Pi=s):Hs(e,n,r));break;default:Hs(e,n,r)}}function av(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 Gi(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];In=s,lv(s,e)}av(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rv(e),e=e.sibling}function rv(e){switch(e.tag){case 0:case 11:case 15:Gi(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Gi(e);break;case 12:Gi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ou(e)):Gi(e);break;default:Gi(e)}}function Ou(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];In=s,lv(s,e)}av(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:gl(8,n,n.return),Ou(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,Ou(n));break;default:Ou(n)}e=e.sibling}}function lv(e,n){for(;In!==null;){var r=In;switch(r.tag){case 0:case 11:case 15:gl(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:Ai(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,In=s;else e:for(r=e;In!==null;){s=In;var d=s.sibling,h=s.return;if(Qg(s),s===r){In=null;break e}if(d!==null){d.return=h,In=d;break e}In=h}}}var N1={getCacheForType:function(e){var n=Kn(Tn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Kn(Tn).controller.signal}},R1=typeof WeakMap=="function"?WeakMap:Map,Dt=0,Zt=null,pt=null,vt=0,Ht=0,Oa=null,vl=!1,$s=!1,Rf=!1,Zr=0,pn=0,yl=0,is=0,jf=0,Ma=0,qs=0,Xi=null,wa=null,Tf=!1,Mu=0,sv=0,_u=1/0,Lu=null,xl=null,Un=0,bl=null,Is=null,Jr=0,Cf=0,Df=null,iv=null,Qi=0,Af=null;function _a(){return(Dt&2)!==0&&vt!==0?vt&-vt:U.T!==null?zf():K()}function ov(){if(Ma===0)if((vt&536870912)===0||bt){var e=Gt;Gt<<=1,(Gt&3932160)===0&&(Gt=262144),Ma=e}else Ma=536870912;return e=Aa.current,e!==null&&(e.flags|=32),Ma}function Ea(e,n,r){(e===Zt&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)&&(Vs(e,0),Sl(e,vt,Ma,!1)),mt(e,r),((Dt&2)===0||e!==Zt)&&(e===Zt&&((Dt&2)===0&&(is|=r),pn===4&&Sl(e,vt,Ma,!1)),Sr(e))}function uv(e,n,r){if((Dt&6)!==0)throw Error(i(327));var s=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Rt(e,n),d=s?C1(e,n):Of(e,n,!0),h=s;do{if(d===0){$s&&!s&&Sl(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!j1(r)){d=Of(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var N=e;d=Xi;var k=N.current.memoizedState.isDehydrated;if(k&&(Vs(N,b).flags|=256),b=Of(N,b,!1),b!==2){if(Rf&&!k){N.errorRecoveryDisabledLanes|=h,is|=h,d=4;break e}h=wa,wa=d,h!==null&&(wa===null?wa=h:wa.push.apply(wa,h))}d=b}if(h=!1,d!==2)continue}}if(d===1){Vs(e,0),Sl(e,n,0,!0);break}e:{switch(s=e,h=d,h){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Sl(s,n,Ma,!vl);break e;case 2:wa=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=Mu+300-an(),10<d)){if(Sl(s,n,Ma,!vl),zt(s,0,!0)!==0)break e;Jr=n,s.timeoutHandle=$v(cv.bind(null,s,r,wa,Lu,Tf,n,Ma,is,qs,vl,h,"Throttled",-0,0),d);break e}cv(s,r,wa,Lu,Tf,n,Ma,is,qs,vl,h,null,-0,0)}}break}while(!0);Sr(e)}function cv(e,n,r,s,d,h,b,N,k,F,Z,le,G,Q){if(e.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},nv(n,h,le);var ke=(h&62914560)===h?Mu-an():(h&4194048)===h?sv-an():0;if(ke=cS(le,ke),ke!==null){Jr=h,e.cancelPendingCommit=ke(yv.bind(null,e,n,h,r,s,d,b,N,k,Z,le,null,G,Q)),Sl(e,h,b,!F);return}}yv(e,n,h,r,s,d,b,N,k)}function j1(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 d=r[s],h=d.getSnapshot;d=d.value;try{if(!Ca(h(),d))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 Sl(e,n,r,s){n&=~jf,n&=~is,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var h=31-en(d),b=1<<h;s[h]=-1,d&=~b}r!==0&&En(e,r,n)}function zu(){return(Dt&6)===0?(Ki(0),!1):!0}function kf(){if(pt!==null){if(Ht===0)var e=pt.return;else e=pt,qr=Jl=null,Pd(e),Ms=null,Oi=0,e=pt;for(;e!==null;)qg(e.alternate,e),e=e.return;pt=null}}function Vs(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,P1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Jr=0,kf(),Zt=e,pt=r=Hr(e.current,null),vt=n,Ht=0,Oa=null,vl=!1,$s=Rt(e,n),Rf=!1,qs=Ma=jf=is=yl=pn=0,wa=Xi=null,Tf=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var d=31-en(s),h=1<<d;n|=e[d],s&=~h}return Zr=n,au(),r}function dv(e,n){lt=null,U.H=$i,n===Os||n===du?(n=Tp(),Ht=3):n===_d?(n=Tp(),Ht=4):Ht=n===uf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Oa=n,pt===null&&(pn=1,Ru(e,qa(n,e.current)))}function fv(){var e=Aa.current;return e===null?!0:(vt&4194048)===vt?Fa===null:(vt&62914560)===vt||(vt&536870912)!==0?e===Fa:!1}function hv(){var e=U.H;return U.H=$i,e===null?$i:e}function mv(){var e=U.A;return U.A=N1,e}function Uu(){pn=4,vl||(vt&4194048)!==vt&&Aa.current!==null||($s=!0),(yl&134217727)===0&&(is&134217727)===0||Zt===null||Sl(Zt,vt,Ma,!1)}function Of(e,n,r){var s=Dt;Dt|=2;var d=hv(),h=mv();(Zt!==e||vt!==n)&&(Lu=null,Vs(e,n)),n=!1;var b=pn;e:do try{if(Ht!==0&&pt!==null){var N=pt,k=Oa;switch(Ht){case 8:kf(),b=6;break e;case 3:case 2:case 9:case 6:Aa.current===null&&(n=!0);var F=Ht;if(Ht=0,Oa=null,Ys(e,N,k,F),r&&$s){b=0;break e}break;default:F=Ht,Ht=0,Oa=null,Ys(e,N,k,F)}}T1(),b=pn;break}catch(Z){dv(e,Z)}while(!0);return n&&e.shellSuspendCounter++,qr=Jl=null,Dt=s,U.H=d,U.A=h,pt===null&&(Zt=null,vt=0,au()),b}function T1(){for(;pt!==null;)pv(pt)}function C1(e,n){var r=Dt;Dt|=2;var s=hv(),d=mv();Zt!==e||vt!==n?(Lu=null,_u=an()+500,Vs(e,n)):$s=Rt(e,n);e:do try{if(Ht!==0&&pt!==null){n=pt;var h=Oa;t:switch(Ht){case 1:Ht=0,Oa=null,Ys(e,n,h,1);break;case 2:case 9:if(Rp(h)){Ht=0,Oa=null,gv(n);break}n=function(){Ht!==2&&Ht!==9||Zt!==e||(Ht=7),Sr(e)},h.then(n,n);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:Rp(h)?(Ht=0,Oa=null,gv(n)):(Ht=0,Oa=null,Ys(e,n,h,7));break;case 5:var b=null;switch(pt.tag){case 26:b=pt.memoizedState;case 5:case 27:var N=pt;if(b?ty(b):N.stateNode.complete){Ht=0,Oa=null;var k=N.sibling;if(k!==null)pt=k;else{var F=N.return;F!==null?(pt=F,Bu(F)):pt=null}break t}}Ht=0,Oa=null,Ys(e,n,h,5);break;case 6:Ht=0,Oa=null,Ys(e,n,h,6);break;case 8:kf(),pn=6;break e;default:throw Error(i(462))}}D1();break}catch(Z){dv(e,Z)}while(!0);return qr=Jl=null,U.H=s,U.A=d,Dt=r,pt!==null?0:(Zt=null,vt=0,au(),pn)}function D1(){for(;pt!==null&&!$n();)pv(pt)}function pv(e){var n=Hg(e.alternate,e,Zr);e.memoizedProps=e.pendingProps,n===null?Bu(e):pt=n}function gv(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=Mg(r,n,n.pendingProps,n.type,void 0,vt);break;case 11:n=Mg(r,n,n.pendingProps,n.type.render,n.ref,vt);break;case 5:Pd(n);default:qg(r,n),n=pt=mp(n,Zr),n=Hg(r,n,Zr)}e.memoizedProps=e.pendingProps,n===null?Bu(e):pt=n}function Ys(e,n,r,s){qr=Jl=null,Pd(n),Ms=null,Oi=0;var d=n.return;try{if(v1(e,d,n,r,vt)){pn=1,Ru(e,qa(r,e.current)),pt=null;return}}catch(h){if(d!==null)throw pt=d,h;pn=1,Ru(e,qa(r,e.current)),pt=null;return}n.flags&32768?(bt||s===1?e=!0:$s||(vt&536870912)!==0?e=!1:(vl=e=!0,(s===2||s===9||s===3||s===6)&&(s=Aa.current,s!==null&&s.tag===13&&(s.flags|=16384))),vv(n,e)):Bu(n)}function Bu(e){var n=e;do{if((n.flags&32768)!==0){vv(n,vl);return}e=n.return;var r=b1(n.alternate,n,Zr);if(r!==null){pt=r;return}if(n=n.sibling,n!==null){pt=n;return}pt=n=e}while(n!==null);pn===0&&(pn=5)}function vv(e,n){do{var r=S1(e.alternate,e);if(r!==null){r.flags&=32767,pt=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){pt=e;return}pt=e=r}while(e!==null);pn=6,pt=null}function yv(e,n,r,s,d,h,b,N,k){e.cancelPendingCommit=null;do Hu();while(Un!==0);if((Dt&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(h=n.lanes|n.childLanes,h|=xd,Je(e,r,h,b,N,k),e===Zt&&(pt=Zt=null,vt=0),Is=n,bl=e,Jr=r,Cf=h,Df=d,iv=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,M1(Oe,function(){return Ev(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,d=H.p,H.p=2,b=Dt,Dt|=4;try{w1(e,n,r)}finally{Dt=b,H.p=d,U.T=s}}Un=1,xv(),bv(),Sv()}}function xv(){if(Un===1){Un=0;var e=bl,n=Is,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=U.T,U.T=null;var s=H.p;H.p=2;var d=Dt;Dt|=4;try{Wg(n,e);var h=Yf,b=lp(e.containerInfo),N=h.focusedElem,k=h.selectionRange;if(b!==N&&N&&N.ownerDocument&&rp(N.ownerDocument.documentElement,N)){if(k!==null&&md(N)){var F=k.start,Z=k.end;if(Z===void 0&&(Z=F),"selectionStart"in N)N.selectionStart=F,N.selectionEnd=Math.min(Z,N.value.length);else{var le=N.ownerDocument||document,G=le&&le.defaultView||window;if(G.getSelection){var Q=G.getSelection(),ke=N.textContent.length,Ve=Math.min(k.start,ke),Yt=k.end===void 0?Ve:Math.min(k.end,ke);!Q.extend&&Ve>Yt&&(b=Yt,Yt=Ve,Ve=b);var $=ap(N,Ve),L=ap(N,Yt);if($&&L&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==L.node||Q.focusOffset!==L.offset)){var Y=le.createRange();Y.setStart($.node,$.offset),Q.removeAllRanges(),Ve>Yt?(Q.addRange(Y),Q.extend(L.node,L.offset)):(Y.setEnd(L.node,L.offset),Q.addRange(Y))}}}}for(le=[],Q=N;Q=Q.parentNode;)Q.nodeType===1&&le.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var te=le[N];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Zu=!!Vf,Yf=Vf=null}finally{Dt=d,H.p=s,U.T=r}}e.current=n,Un=2}}function bv(){if(Un===2){Un=0;var e=bl,n=Is,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=U.T,U.T=null;var s=H.p;H.p=2;var d=Dt;Dt|=4;try{Xg(e,n.alternate,n)}finally{Dt=d,H.p=s,U.T=r}}Un=3}}function Sv(){if(Un===4||Un===3){Un=0,Fn();var e=bl,n=Is,r=Jr,s=iv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Un=5:(Un=0,Is=bl=null,wv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(xl=null),q(r),n=n.stateNode,ae&&typeof ae.onCommitFiberRoot=="function")try{ae.onCommitFiberRoot(Wt,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=U.T,d=H.p,H.p=2,U.T=null;try{for(var h=e.onRecoverableError,b=0;b<s.length;b++){var N=s[b];h(N.value,{componentStack:N.stack})}}finally{U.T=n,H.p=d}}(Jr&3)!==0&&Hu(),Sr(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Af?Qi++:(Qi=0,Af=e):Qi=0,Ki(0)}}function wv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Ai(n)))}function Hu(){return xv(),bv(),Sv(),Ev()}function Ev(){if(Un!==5)return!1;var e=bl,n=Cf;Cf=0;var r=q(Jr),s=U.T,d=H.p;try{H.p=32>r?32:r,U.T=null,r=Df,Df=null;var h=bl,b=Jr;if(Un=0,Is=bl=null,Jr=0,(Dt&6)!==0)throw Error(i(331));var N=Dt;if(Dt|=4,rv(h.current),tv(h,h.current,b,r),Dt=N,Ki(0,!1),ae&&typeof ae.onPostCommitFiberRoot=="function")try{ae.onPostCommitFiberRoot(Wt,h)}catch{}return!0}finally{H.p=d,U.T=s,wv(e,n)}}function Nv(e,n,r){n=qa(r,n),n=of(e.stateNode,n,2),e=hl(e,n,2),e!==null&&(mt(e,2),Sr(e))}function $t(e,n,r){if(e.tag===3)Nv(e,e,r);else for(;n!==null;){if(n.tag===3){Nv(n,e,r);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(xl===null||!xl.has(s))){e=qa(r,e),r=Rg(2),s=hl(n,r,2),s!==null&&(jg(r,s,n,e),mt(s,2),Sr(s));break}}n=n.return}}function Mf(e,n,r){var s=e.pingCache;if(s===null){s=e.pingCache=new R1;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(r)||(Rf=!0,d.add(r),e=A1.bind(null,e,n,r),n.then(e,e))}function A1(e,n,r){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Zt===e&&(vt&r)===r&&(pn===4||pn===3&&(vt&62914560)===vt&&300>an()-Mu?(Dt&2)===0&&Vs(e,0):jf|=r,qs===vt&&(qs=0)),Sr(e)}function Rv(e,n){n===0&&(n=Xt()),e=Ql(e,n),e!==null&&(mt(e,n),Sr(e))}function k1(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),Rv(e,r)}function O1(e,n){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(r=d.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 M1(e,n){return kt(e,n)}var $u=null,Fs=null,_f=!1,qu=!1,Lf=!1,wl=0;function Sr(e){e!==Fs&&e.next===null&&(Fs===null?$u=Fs=e:Fs=Fs.next=e),qu=!0,_f||(_f=!0,L1())}function Ki(e,n){if(!Lf&&qu){Lf=!0;do for(var r=!1,s=$u;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var h=0;else{var b=s.suspendedLanes,N=s.pingedLanes;h=(1<<31-en(42|e)+1)-1,h&=d&~(b&~N),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Dv(s,h))}else h=vt,h=zt(s,s===Zt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Rt(s,h)||(r=!0,Dv(s,h));s=s.next}while(r);Lf=!1}}function _1(){jv()}function jv(){qu=_f=!1;var e=0;wl!==0&&F1()&&(e=wl);for(var n=an(),r=null,s=$u;s!==null;){var d=s.next,h=Tv(s,n);h===0?(s.next=null,r===null?$u=d:r.next=d,d===null&&(Fs=r)):(r=s,(e!==0||(h&3)!==0)&&(qu=!0)),s=d}Un!==0&&Un!==5||Ki(e),wl!==0&&(wl=0)}function Tv(e,n){for(var r=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-en(h),N=1<<b,k=d[b];k===-1?((N&r)===0||(N&s)!==0)&&(d[b]=rn(N,n)):k<=n&&(e.expiredLanes|=N),h&=~N}if(n=Zt,r=vt,r=zt(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===n&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Pt(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Rt(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(s!==null&&Pt(s),q(r)){case 2:case 8:r=ge;break;case 32:r=Oe;break;case 268435456:r=Be;break;default:r=Oe}return s=Cv.bind(null,e),r=kt(r,s),e.callbackPriority=n,e.callbackNode=r,n}return s!==null&&s!==null&&Pt(s),e.callbackPriority=2,e.callbackNode=null,2}function Cv(e,n){if(Un!==0&&Un!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Hu()&&e.callbackNode!==r)return null;var s=vt;return s=zt(e,e===Zt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(uv(e,s,n),Tv(e,an()),e.callbackNode!=null&&e.callbackNode===r?Cv.bind(null,e):null)}function Dv(e,n){if(Hu())return null;uv(e,n,!0)}function L1(){G1(function(){(Dt&6)!==0?kt(da,_1):jv()})}function zf(){if(wl===0){var e=As;e===0&&(e=_e,_e<<=1,(_e&261888)===0&&(_e=256)),wl=e}return wl}function Av(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ln(""+e)}function kv(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 z1(e,n,r,s,d){if(n==="submit"&&r&&r.stateNode===d){var h=Av((d[De]||null).action),b=s.submitter;b&&(n=(n=b[De]||null)?Av(n.formAction):b.getAttribute("formAction"),n!==null&&(h=n,b=null));var N=new Ur("action","action",null,s,d);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(wl!==0){var k=b?kv(d,b):new FormData(d);tf(r,{pending:!0,data:k,method:d.method,action:h},null,k)}}else typeof h=="function"&&(N.preventDefault(),k=b?kv(d,b):new FormData(d),tf(r,{pending:!0,data:k,method:d.method,action:h},h,k))},currentTarget:d}]})}}for(var Uf=0;Uf<yd.length;Uf++){var Bf=yd[Uf],U1=Bf.toLowerCase(),B1=Bf[0].toUpperCase()+Bf.slice(1);lr(U1,"on"+B1)}lr(op,"onAnimationEnd"),lr(up,"onAnimationIteration"),lr(cp,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(e1,"onTransitionRun"),lr(t1,"onTransitionStart"),lr(n1,"onTransitionCancel"),lr(dp,"onTransitionEnd"),_n("onMouseEnter",["mouseout","mouseover"]),_n("onMouseLeave",["mouseout","mouseover"]),_n("onPointerEnter",["pointerout","pointerover"]),_n("onPointerLeave",["pointerout","pointerover"]),Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zi="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(" "),H1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zi));function Ov(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],d=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var b=s.length-1;0<=b;b--){var N=s[b],k=N.instance,F=N.currentTarget;if(N=N.listener,k!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=F;try{h(d)}catch(Z){nu(Z)}d.currentTarget=null,h=k}else for(b=0;b<s.length;b++){if(N=s[b],k=N.instance,F=N.currentTarget,N=N.listener,k!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=F;try{h(d)}catch(Z){nu(Z)}d.currentTarget=null,h=k}}}}function gt(e,n){var r=n[Me];r===void 0&&(r=n[Me]=new Set);var s=e+"__bubble";r.has(s)||(Mv(n,e,2,!1),r.add(s))}function Hf(e,n,r){var s=0;n&&(s|=4),Mv(r,e,s,n)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function $f(e){if(!e[Iu]){e[Iu]=!0,Qt.forEach(function(r){r!=="selectionchange"&&(H1.has(r)||Hf(r,!1,e),Hf(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Iu]||(n[Iu]=!0,Hf("selectionchange",!1,n))}}function Mv(e,n,r,s){switch(oy(n)){case 2:var d=hS;break;case 8:d=mS;break;default:d=th}r=d.bind(null,n,r,e),d=void 0,!Si||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,r,{capture:!0,passive:d}):e.addEventListener(n,r,!0):d!==void 0?e.addEventListener(n,r,{passive:d}):e.addEventListener(n,r,!1)}function qf(e,n,r,s,d){var h=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var N=s.stateNode.containerInfo;if(N===d)break;if(b===4)for(b=s.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;N!==null;){if(b=Bt(N),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){s=h=b;continue e}N=N.parentNode}}s=s.return}bi(function(){var F=h,Z=Or(r),le=[];e:{var G=fp.get(e);if(G!==void 0){var Q=Ur,ke=e;switch(e){case"keypress":if(bs(r)===0)break e;case"keydown":case"keyup":Q=jn;break;case"focusin":ke="focus",Q=ve;break;case"focusout":ke="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=Jo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=P;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=vr;break;case op:case up:case cp:Q=oe;break;case dp:Q=Wo;break;case"scroll":case"scrollend":Q=id;break;case"wheel":Q=ud;break;case"copy":case"cut":case"paste":Q=ye;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Mt;break;case"toggle":case"beforetoggle":Q=q0}var Ve=(n&4)!==0,Yt=!Ve&&(e==="scroll"||e==="scrollend"),$=Ve?G!==null?G+"Capture":null:G;Ve=[];for(var L=F,Y;L!==null;){var te=L;if(Y=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||Y===null||$===null||(te=Ba(L,$),te!=null&&Ve.push(Ji(L,te,Y))),Yt)break;L=L.return}0<Ve.length&&(G=new Q(G,ke,null,r,Z),le.push({event:G,listeners:Ve}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&r!==Ta&&(ke=r.relatedTarget||r.fromElement)&&(Bt(ke)||ke[Ne]))break e;if((Q||G)&&(G=Z.window===Z?Z:(G=Z.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(ke=r.relatedTarget||r.toElement,Q=F,ke=ke?Bt(ke):null,ke!==null&&(Yt=u(ke),Ve=ke.tag,ke!==Yt||Ve!==5&&Ve!==27&&Ve!==6)&&(ke=null)):(Q=null,ke=F),Q!==ke)){if(Ve=Jo,te="onMouseLeave",$="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ve=Mt,te="onPointerLeave",$="onPointerEnter",L="pointer"),Yt=Q==null?G:dt(Q),Y=ke==null?G:dt(ke),G=new Ve(te,L+"leave",Q,r,Z),G.target=Yt,G.relatedTarget=Y,te=null,Bt(Z)===F&&(Ve=new Ve($,L+"enter",ke,r,Z),Ve.target=Y,Ve.relatedTarget=Yt,te=Ve),Yt=te,Q&&ke)t:{for(Ve=$1,$=Q,L=ke,Y=0,te=$;te;te=Ve(te))Y++;te=0;for(var $e=L;$e;$e=Ve($e))te++;for(;0<Y-te;)$=Ve($),Y--;for(;0<te-Y;)L=Ve(L),te--;for(;Y--;){if($===L||L!==null&&$===L.alternate){Ve=$;break t}$=Ve($),L=Ve(L)}Ve=null}else Ve=null;Q!==null&&_v(le,G,Q,Ve,!1),ke!==null&&Yt!==null&&_v(le,Yt,ke,Ve,!0)}}e:{if(G=F?dt(F):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var Tt=Zm;else if(Qm(G))if(Jm)Tt=Z0;else{Tt=Q0;var Le=X0}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&Il(F.elementType)&&(Tt=Zm):Tt=K0;if(Tt&&(Tt=Tt(e,F))){Km(le,Tt,r,Z);break e}Le&&Le(e,G,F),e==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&jt(G,"number",G.value)}switch(Le=F?dt(F):window,e){case"focusin":(Qm(Le)||Le.contentEditable==="true")&&(ws=Le,pd=F,Ti=null);break;case"focusout":Ti=pd=ws=null;break;case"mousedown":gd=!0;break;case"contextmenu":case"mouseup":case"dragend":gd=!1,sp(le,r,Z);break;case"selectionchange":if(W0)break;case"keydown":case"keyup":sp(le,r,Z)}var ot;if(dd)e:{switch(e){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else Ss?Gm(e,r)&&(yt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(yt="onCompositionStart");yt&&(Ym&&r.locale!=="ko"&&(Ss||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&Ss&&(ot=Ko()):(Ha=Z,wi="value"in Ha?Ha.value:Ha.textContent,Ss=!0)),Le=Vu(F,yt),0<Le.length&&(yt=new rt(yt,e,null,r,Z),le.push({event:yt,listeners:Le}),ot?yt.data=ot:(ot=Xm(r),ot!==null&&(yt.data=ot)))),(ot=V0?Y0(e,r):F0(e,r))&&(yt=Vu(F,"onBeforeInput"),0<yt.length&&(Le=new rt("onBeforeInput","beforeinput",null,r,Z),le.push({event:Le,listeners:yt}),Le.data=ot)),z1(le,e,F,r,Z)}Ov(le,n)})}function Ji(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Vu(e,n){for(var r=n+"Capture",s=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Ba(e,r),d!=null&&s.unshift(Ji(e,d,h)),d=Ba(e,n),d!=null&&s.push(Ji(e,d,h))),e.tag===3)return s;e=e.return}return[]}function $1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _v(e,n,r,s,d){for(var h=n._reactName,b=[];r!==null&&r!==s;){var N=r,k=N.alternate,F=N.stateNode;if(N=N.tag,k!==null&&k===s)break;N!==5&&N!==26&&N!==27||F===null||(k=F,d?(F=Ba(r,h),F!=null&&b.unshift(Ji(r,F,k))):d||(F=Ba(r,h),F!=null&&b.push(Ji(r,F,k)))),r=r.return}b.length!==0&&e.push({event:n,listeners:b})}var q1=/\r\n?/g,I1=/\u0000|\uFFFD/g;function Lv(e){return(typeof e=="string"?e:""+e).replace(q1,`
|
|
49
|
-
`).replace(I1,"")}function zv(e,n){return n=Lv(n),Lv(e)===n}function Vt(e,n,r,s,d,h){switch(r){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ll(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ll(e,""+s);break;case"className":hr(e,"class",s);break;case"tabIndex":hr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":hr(e,r,s);break;case"style":ga(e,s,h);break;case"data":if(n!=="object"){hr(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=ln(""+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"&&Vt(e,n,"name",d.name,d,null),Vt(e,n,"formEncType",d.formEncType,d,null),Vt(e,n,"formMethod",d.formMethod,d,null),Vt(e,n,"formTarget",d.formTarget,d,null)):(Vt(e,n,"encType",d.encType,d,null),Vt(e,n,"method",d.method,d,null),Vt(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=ln(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=na);break;case"onScroll":s!=null&>("scroll",e);break;case"onScrollEnd":s!=null&>("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(d.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=ln(""+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":gt("beforetoggle",e),gt("toggle",e),ea(e,"popover",s);break;case"xlinkActuate":Ge(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ge(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ge(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ge(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ge(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ge(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ge(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ge(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ge(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=ys.get(r)||r,ea(e,r,s))}}function If(e,n,r,s,d,h){switch(r){case"style":ga(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(d.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof s=="string"?ll(e,s):(typeof s=="number"||typeof s=="bigint")&&ll(e,""+s);break;case"onScroll":s!=null&>("scroll",e);break;case"onScrollEnd":s!=null&>("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(!Pn.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),n=r.slice(2,d?r.length-7:void 0),h=e[De]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,d),typeof s=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,s,d);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):ea(e,r,s)}}}function Jn(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",e),gt("load",e);var s=!1,d=!1,h;for(h in r)if(r.hasOwnProperty(h)){var b=r[h];if(b!=null)switch(h){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Vt(e,n,h,b,r,null)}}d&&Vt(e,n,"srcSet",r.srcSet,r,null),s&&Vt(e,n,"src",r.src,r,null);return;case"input":gt("invalid",e);var N=h=b=d=null,k=null,F=null;for(s in r)if(r.hasOwnProperty(s)){var Z=r[s];if(Z!=null)switch(s){case"name":d=Z;break;case"type":b=Z;break;case"checked":k=Z;break;case"defaultChecked":F=Z;break;case"value":h=Z;break;case"defaultValue":N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,n));break;default:Vt(e,n,s,Z,r,null)}}yi(e,h,N,k,F,b,d,!1);return;case"select":gt("invalid",e),s=b=h=null;for(d in r)if(r.hasOwnProperty(d)&&(N=r[d],N!=null))switch(d){case"value":h=N;break;case"defaultValue":b=N;break;case"multiple":s=N;default:Vt(e,n,d,N,r,null)}n=h,r=b,e.multiple=!!s,n!=null?mr(e,!!s,n,!1):r!=null&&mr(e,!!s,r,!0);return;case"textarea":gt("invalid",e),h=d=s=null;for(b in r)if(r.hasOwnProperty(b)&&(N=r[b],N!=null))switch(b){case"value":s=N;break;case"defaultValue":d=N;break;case"children":h=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(i(91));break;default:Vt(e,n,b,N,r,null)}ar(e,s,d,h);return;case"option":for(k in r)if(r.hasOwnProperty(k)&&(s=r[k],s!=null))switch(k){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Vt(e,n,k,s,r,null)}return;case"dialog":gt("beforetoggle",e),gt("toggle",e),gt("cancel",e),gt("close",e);break;case"iframe":case"object":gt("load",e);break;case"video":case"audio":for(s=0;s<Zi.length;s++)gt(Zi[s],e);break;case"image":gt("error",e),gt("load",e);break;case"details":gt("toggle",e);break;case"embed":case"source":case"link":gt("error",e),gt("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:Vt(e,n,F,s,r,null)}return;default:if(Il(n)){for(Z in r)r.hasOwnProperty(Z)&&(s=r[Z],s!==void 0&&If(e,n,Z,s,r,void 0));return}}for(N in r)r.hasOwnProperty(N)&&(s=r[N],s!=null&&Vt(e,n,N,s,r,null))}function V1(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 d=null,h=null,b=null,N=null,k=null,F=null,Z=null;for(Q in r){var le=r[Q];if(r.hasOwnProperty(Q)&&le!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":k=le;default:s.hasOwnProperty(Q)||Vt(e,n,Q,null,s,le)}}for(var G in s){var Q=s[G];if(le=r[G],s.hasOwnProperty(G)&&(Q!=null||le!=null))switch(G){case"type":h=Q;break;case"name":d=Q;break;case"checked":F=Q;break;case"defaultChecked":Z=Q;break;case"value":b=Q;break;case"defaultValue":N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,n));break;default:Q!==le&&Vt(e,n,G,Q,s,le)}}ql(e,b,N,k,F,Z,h,d);return;case"select":Q=b=N=G=null;for(h in r)if(k=r[h],r.hasOwnProperty(h)&&k!=null)switch(h){case"value":break;case"multiple":Q=k;default:s.hasOwnProperty(h)||Vt(e,n,h,null,s,k)}for(d in s)if(h=s[d],k=r[d],s.hasOwnProperty(d)&&(h!=null||k!=null))switch(d){case"value":G=h;break;case"defaultValue":N=h;break;case"multiple":b=h;default:h!==k&&Vt(e,n,d,h,s,k)}n=N,r=b,s=Q,G!=null?mr(e,!!r,G,!1):!!s!=!!r&&(n!=null?mr(e,!!r,n,!0):mr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(N in r)if(d=r[N],r.hasOwnProperty(N)&&d!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Vt(e,n,N,null,s,d)}for(b in s)if(d=s[b],h=r[b],s.hasOwnProperty(b)&&(d!=null||h!=null))switch(b){case"value":G=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==h&&Vt(e,n,b,d,s,h)}Qo(e,G,Q);return;case"option":for(var ke in r)if(G=r[ke],r.hasOwnProperty(ke)&&G!=null&&!s.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:Vt(e,n,ke,null,s,G)}for(k in s)if(G=s[k],Q=r[k],s.hasOwnProperty(k)&&G!==Q&&(G!=null||Q!=null))switch(k){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Vt(e,n,k,G,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)G=r[Ve],r.hasOwnProperty(Ve)&&G!=null&&!s.hasOwnProperty(Ve)&&Vt(e,n,Ve,null,s,G);for(F in s)if(G=s[F],Q=r[F],s.hasOwnProperty(F)&&G!==Q&&(G!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Vt(e,n,F,G,s,Q)}return;default:if(Il(n)){for(var Yt in r)G=r[Yt],r.hasOwnProperty(Yt)&&G!==void 0&&!s.hasOwnProperty(Yt)&&If(e,n,Yt,void 0,s,G);for(Z in s)G=s[Z],Q=r[Z],!s.hasOwnProperty(Z)||G===Q||G===void 0&&Q===void 0||If(e,n,Z,G,s,Q);return}}for(var $ in r)G=r[$],r.hasOwnProperty($)&&G!=null&&!s.hasOwnProperty($)&&Vt(e,n,$,null,s,G);for(le in s)G=s[le],Q=r[le],!s.hasOwnProperty(le)||G===Q||G==null&&Q==null||Vt(e,n,le,G,s,Q)}function Uv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Y1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var d=r[s],h=d.transferSize,b=d.initiatorType,N=d.duration;if(h&&N&&Uv(b)){for(b=0,N=d.responseEnd,s+=1;s<r.length;s++){var k=r[s],F=k.startTime;if(F>N)break;var Z=k.transferSize,le=k.initiatorType;Z&&Uv(le)&&(k=k.responseEnd,b+=Z*(k<N?1:(N-F)/(k-F)))}if(--s,n+=8*(h+b)/(d.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 Vf=null,Yf=null;function Yu(e){return e.nodeType===9?e:e.ownerDocument}function Bv(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 Hv(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 Ff(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 Pf=null;function F1(){var e=window.event;return e&&e.type==="popstate"?e===Pf?!1:(Pf=e,!0):(Pf=null,!1)}var $v=typeof setTimeout=="function"?setTimeout:void 0,P1=typeof clearTimeout=="function"?clearTimeout:void 0,qv=typeof Promise=="function"?Promise:void 0,G1=typeof queueMicrotask=="function"?queueMicrotask:typeof qv<"u"?function(e){return qv.resolve(null).then(e).catch(X1)}:$v;function X1(e){setTimeout(function(){throw e})}function El(e){return e==="head"}function Iv(e,n){var r=n,s=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(d),Qs(n);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")Wi(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Wi(r);for(var h=r.firstChild;h;){var b=h.nextSibling,N=h.nodeName;h[Ze]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=b}}else r==="body"&&Wi(e.ownerDocument.body);r=d}while(r);Qs(n)}function Vv(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 Gf(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":Gf(r),Ie(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function Q1(e,n,r,s){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ze])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!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Pa(e.nextSibling),e===null)break}return null}function K1(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Pa(e.nextSibling),e===null))return null;return e}function Yv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Pa(e.nextSibling),e===null))return null;return e}function Xf(e){return e.data==="$?"||e.data==="$~"}function Qf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Z1(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 Pa(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 Kf=null;function Fv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Pa(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Pv(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 Gv(e,n,r){switch(n=Yu(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 Wi(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ie(e)}var Ga=new Map,Xv=new Set;function Fu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wr=H.d;H.d={f:J1,r:W1,D:eS,C:tS,L:nS,m:aS,X:lS,S:rS,M:sS};function J1(){var e=Wr.f(),n=zu();return e||n}function W1(e){var n=We(e);n!==null&&n.tag===5&&n.type==="form"?dg(n):Wr.r(e)}var Ps=typeof document>"u"?null:document;function Qv(e,n,r){var s=Ps;if(s&&typeof n=="string"&&n){var d=Xn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),Xv.has(d)||(Xv.add(d),e={rel:e,crossOrigin:r,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),Jn(n,"link",e),ft(n),s.head.appendChild(n)))}}function eS(e){Wr.D(e),Qv("dns-prefetch",e,null)}function tS(e,n){Wr.C(e,n),Qv("preconnect",e,n)}function nS(e,n,r){Wr.L(e,n,r);var s=Ps;if(s&&e&&n){var d='link[rel="preload"][as="'+Xn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+Xn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+Xn(r.imageSizes)+'"]')):d+='[href="'+Xn(e)+'"]';var h=d;switch(n){case"style":h=Gs(e);break;case"script":h=Xs(e)}Ga.has(h)||(e=y({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Ga.set(h,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(eo(h))||n==="script"&&s.querySelector(to(h))||(n=s.createElement("link"),Jn(n,"link",e),ft(n),s.head.appendChild(n)))}}function aS(e,n){Wr.m(e,n);var r=Ps;if(r&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Xn(s)+'"][href="'+Xn(e)+'"]',h=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Xs(e)}if(!Ga.has(h)&&(e=y({rel:"modulepreload",href:e},n),Ga.set(h,e),r.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(to(h)))return}s=r.createElement("link"),Jn(s,"link",e),ft(s),r.head.appendChild(s)}}}function rS(e,n,r){Wr.S(e,n,r);var s=Ps;if(s&&e){var d=it(s).hoistableStyles,h=Gs(e);n=n||"default";var b=d.get(h);if(!b){var N={loading:0,preload:null};if(b=s.querySelector(eo(h)))N.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Ga.get(h))&&Zf(e,r);var k=b=s.createElement("link");ft(k),Jn(k,"link",e),k._p=new Promise(function(F,Z){k.onload=F,k.onerror=Z}),k.addEventListener("load",function(){N.loading|=1}),k.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Pu(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:N},d.set(h,b)}}}function lS(e,n){Wr.X(e,n);var r=Ps;if(r&&e){var s=it(r).hoistableScripts,d=Xs(e),h=s.get(d);h||(h=r.querySelector(to(d)),h||(e=y({src:e,async:!0},n),(n=Ga.get(d))&&Jf(e,n),h=r.createElement("script"),ft(h),Jn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function sS(e,n){Wr.M(e,n);var r=Ps;if(r&&e){var s=it(r).hoistableScripts,d=Xs(e),h=s.get(d);h||(h=r.querySelector(to(d)),h||(e=y({src:e,async:!0,type:"module"},n),(n=Ga.get(d))&&Jf(e,n),h=r.createElement("script"),ft(h),Jn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function Kv(e,n,r,s){var d=(d=je.current)?Fu(d):null;if(!d)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Gs(r.href),r=it(d).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=Gs(r.href);var h=it(d).hoistableStyles,b=h.get(e);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,b),(h=d.querySelector(eo(e)))&&!h._p&&(b.instance=h,b.state.loading=5),Ga.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},Ga.set(e,r),h||iS(d,e,r,b.state))),n&&s===null)throw Error(i(528,""));return b}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=Xs(r),r=it(d).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 Gs(e){return'href="'+Xn(e)+'"'}function eo(e){return'link[rel="stylesheet"]['+e+"]"}function Zv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function iS(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}),Jn(n,"link",r),ft(n),e.head.appendChild(n))}function Xs(e){return'[src="'+Xn(e)+'"]'}function to(e){return"script[async]"+e}function Jv(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Xn(r.href)+'"]');if(s)return n.instance=s,ft(s),s;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ft(s),Jn(s,"style",d),Pu(s,r.precedence,e),n.instance=s;case"stylesheet":d=Gs(r.href);var h=e.querySelector(eo(d));if(h)return n.state.loading|=4,n.instance=h,ft(h),h;s=Zv(r),(d=Ga.get(d))&&Zf(s,d),h=(e.ownerDocument||e).createElement("link"),ft(h);var b=h;return b._p=new Promise(function(N,k){b.onload=N,b.onerror=k}),Jn(h,"link",s),n.state.loading|=4,Pu(h,r.precedence,e),n.instance=h;case"script":return h=Xs(r.src),(d=e.querySelector(to(h)))?(n.instance=d,ft(d),d):(s=r,(d=Ga.get(h))&&(s=y({},r),Jf(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),ft(d),Jn(d,"link",s),e.head.appendChild(d),n.instance=d);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,Pu(s,r.precedence,e));return n.instance}function Pu(e,n,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,h=d,b=0;b<s.length;b++){var N=s[b];if(N.dataset.precedence===n)h=N;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function Zf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Jf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Gu=null;function Wv(e,n,r){if(Gu===null){var s=new Map,d=Gu=new Map;d.set(r,s)}else d=Gu,s=d.get(r),s||(s=new Map,d.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Ze]||h[me]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(n)||"";b=e+b;var N=s.get(b);N?N.push(h):s.set(b,[h])}}return s}function ey(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function oS(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 ty(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function uS(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 d=Gs(s.href),h=n.querySelector(eo(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Xu.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,ft(h);return}h=n.ownerDocument||n,s=Zv(s),(d=Ga.get(d))&&Zf(s,d),h=h.createElement("link"),ft(h);var b=h;b._p=new Promise(function(N,k){b.onload=N,b.onerror=k}),Jn(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=Xu.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Wf=0;function cS(e,n){return e.stylesheets&&e.count===0&&Ku(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Wf===0&&(Wf=62500*Y1());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Wf?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qu=null;function Ku(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qu=new Map,n.forEach(dS,e),Qu=null,Xu.call(e))}function dS(e,n){if(!(n.state.loading&4)){var r=Qu.get(e);if(r)var s=r.get(null);else{r=new Map,Qu.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var b=d[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(r.set(b.dataset.precedence,b),s=b)}s&&r.set(null,s)}d=n.instance,b=d.getAttribute("data-precedence"),h=r.get(b)||s,h===s&&r.set(null,d),r.set(b,d),this.count++,s=Xu.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var no={$$typeof:I,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function fS(e,n,r,s,d,h,b,N,k){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=d,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function ny(e,n,r,s,d,h,b,N,k,F,Z,le){return e=new fS(e,n,r,b,k,F,Z,le,N),n=1,h===!0&&(n|=24),h=Da(3,null,null,n),e.current=h,h.stateNode=e,n=kd(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:r,cache:n},Ld(h),e}function ay(e){return e?(e=Rs,e):Rs}function ry(e,n,r,s,d,h){d=ay(d),s.context===null?s.context=d:s.pendingContext=d,s=fl(n),s.payload={element:r},h=h===void 0?null:h,h!==null&&(s.callback=h),r=hl(e,s,n),r!==null&&(Ea(r,e,n),_i(r,e,n))}function ly(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function eh(e,n){ly(e,n),(e=e.alternate)&&ly(e,n)}function sy(e){if(e.tag===13||e.tag===31){var n=Ql(e,67108864);n!==null&&Ea(n,e,67108864),eh(e,67108864)}}function iy(e){if(e.tag===13||e.tag===31){var n=_a();n=_(n);var r=Ql(e,n);r!==null&&Ea(r,e,n),eh(e,n)}}var Zu=!0;function hS(e,n,r,s){var d=U.T;U.T=null;var h=H.p;try{H.p=2,th(e,n,r,s)}finally{H.p=h,U.T=d}}function mS(e,n,r,s){var d=U.T;U.T=null;var h=H.p;try{H.p=8,th(e,n,r,s)}finally{H.p=h,U.T=d}}function th(e,n,r,s){if(Zu){var d=nh(s);if(d===null)qf(e,n,s,Ju,r),uy(e,s);else if(gS(d,e,n,r,s))s.stopPropagation();else if(uy(e,s),n&4&&-1<pS.indexOf(e)){for(;d!==null;){var h=We(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var b=xt(h.pendingLanes);if(b!==0){var N=h;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var k=1<<31-en(b);N.entanglements[1]|=k,b&=~k}Sr(h),(Dt&6)===0&&(_u=an()+500,Ki(0))}}break;case 31:case 13:N=Ql(h,2),N!==null&&Ea(N,h,2),zu(),eh(h,2)}if(h=nh(s),h===null&&qf(e,n,s,Ju,r),h===d)break;d=h}d!==null&&s.stopPropagation()}else qf(e,n,s,null,r)}}function nh(e){return e=Or(e),ah(e)}var Ju=null;function ah(e){if(Ju=null,e=Bt(e),e!==null){var n=u(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 Ju=e,null}function oy(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(ca()){case da:return 2;case ge:return 8;case Oe:case Ce:return 32;case Be:return 268435456;default:return 32}default:return 32}}var rh=!1,Nl=null,Rl=null,jl=null,ao=new Map,ro=new Map,Tl=[],pS="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 uy(e,n){switch(e){case"focusin":case"focusout":Nl=null;break;case"dragenter":case"dragleave":Rl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":ao.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(n.pointerId)}}function lo(e,n,r,s,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:s,nativeEvent:h,targetContainers:[d]},n!==null&&(n=We(n),n!==null&&sy(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function gS(e,n,r,s,d){switch(n){case"focusin":return Nl=lo(Nl,e,n,r,s,d),!0;case"dragenter":return Rl=lo(Rl,e,n,r,s,d),!0;case"mouseover":return jl=lo(jl,e,n,r,s,d),!0;case"pointerover":var h=d.pointerId;return ao.set(h,lo(ao.get(h)||null,e,n,r,s,d)),!0;case"gotpointercapture":return h=d.pointerId,ro.set(h,lo(ro.get(h)||null,e,n,r,s,d)),!0}return!1}function cy(e){var n=Bt(e.target);if(n!==null){var r=u(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,re(e.priority,function(){iy(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,re(e.priority,function(){iy(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 Wu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=nh(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Ta=s,r.target.dispatchEvent(s),Ta=null}else return n=We(r),n!==null&&sy(n),e.blockedOn=r,!1;n.shift()}return!0}function dy(e,n,r){Wu(e)&&r.delete(n)}function vS(){rh=!1,Nl!==null&&Wu(Nl)&&(Nl=null),Rl!==null&&Wu(Rl)&&(Rl=null),jl!==null&&Wu(jl)&&(jl=null),ao.forEach(dy),ro.forEach(dy)}function ec(e,n){e.blockedOn===n&&(e.blockedOn=null,rh||(rh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,vS)))}var tc=null;function fy(e){tc!==e&&(tc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){tc===e&&(tc=null);for(var n=0;n<e.length;n+=3){var r=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(ah(s||r)===null)continue;break}var h=We(r);h!==null&&(e.splice(n,3),n-=3,tf(h,{pending:!0,data:d,method:r.method,action:s},s,d))}}))}function Qs(e){function n(k){return ec(k,e)}Nl!==null&&ec(Nl,e),Rl!==null&&ec(Rl,e),jl!==null&&ec(jl,e),ao.forEach(n),ro.forEach(n);for(var r=0;r<Tl.length;r++){var s=Tl[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Tl.length&&(r=Tl[0],r.blockedOn===null);)cy(r),r.blockedOn===null&&Tl.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var d=r[s],h=r[s+1],b=d[De]||null;if(typeof h=="function")b||fy(r);else if(b){var N=null;if(h&&h.hasAttribute("formAction")){if(d=h,b=h[De]||null)N=b.formAction;else if(ah(d)!==null)continue}else N=b.action;typeof N=="function"?r[s+1]=N:(r.splice(s,3),s-=3),fy(r)}}}function hy(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return d=b})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=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,d=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),d!==null&&(d(),d=null)}}}function lh(e){this._internalRoot=e}nc.prototype.render=lh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,s=_a();ry(r,s,e,n,null,null)},nc.prototype.unmount=lh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;ry(e.current,2,null,e,null,null),zu(),n[Ne]=null}};function nc(e){this._internalRoot=e}nc.prototype.unstable_scheduleHydration=function(e){if(e){var n=K();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Tl.length&&n!==0&&n<Tl[r].priority;r++);Tl.splice(r,0,e),r===0&&cy(e)}};var my=a.version;if(my!=="19.2.7")throw Error(i(527,my,"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 yS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ac.isDisabled&&ac.supportsFiber)try{Wt=ac.inject(yS),ae=ac}catch{}}return io.createRoot=function(e,n){if(!o(e))throw Error(i(299));var r=!1,s="",d=Sg,h=wg,b=Eg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=ny(e,1,!1,null,null,r,s,null,d,h,b,hy),e[Ne]=n.current,$f(e),new lh(n)},io.hydrateRoot=function(e,n,r){if(!o(e))throw Error(i(299));var s=!1,d="",h=Sg,b=wg,N=Eg,k=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(N=r.onRecoverableError),r.formState!==void 0&&(k=r.formState)),n=ny(e,1,!0,n,r??null,s,d,k,h,b,N,hy),n.context=ay(null),r=n.current,s=_a(),s=_(s),d=fl(s),d.callback=null,hl(r,d,s),r=s,n.current.lanes=r,mt(n,r),Sr(n),e[Ne]=n.current,$f(e),new nc(n)},io.version="19.2.7",io}var Ny;function OS(){if(Ny)return oh.exports;Ny=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(),oh.exports=kS(),oh.exports}var MS=OS();/**
|
|
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 Gx=t=>{throw TypeError(t)},Xx=(t,a,l)=>a.has(t)||Gx("Cannot "+l),Xa=(t,a,l)=>(Xx(t,a,"read from private field"),l?l.call(t):a.get(t)),yo=(t,a,l)=>a.has(t)?Gx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,l),wr=(t,a,l,i)=>(Xx(t,a,"write to private field"),a.set(t,l),l),zc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Jh=/^[\\/]{2}/;function Qx(t,a){return a+t.replace(/\\/g,"/")}var Ry="popstate";function jy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function _S(t={}){function a(i,o){var g;let u=(g=o.state)==null?void 0:g.masked,{pathname:f,search:m,hash:p}=u||i.location;return Co("",{pathname:f,search:m,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function l(i,o){return typeof o=="string"?o:Tr(o)}return zS(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 LS(){return Math.random().toString(36).substring(2,10)}function Ty(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 Co(t,a,l=null,i,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Cr(a):a,state:l,key:a&&a.key||i||LS(),mask:o}}function Tr({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 Cr(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 zS(t,a,l,i={}){let{window:o=document.defaultView,v5Compat:u=!1}=i,f=o.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 y(){m="POP";let R=x(),z=R==null?null:R-g;g=R,p&&p({action:m,location:D.location,delta:z})}function E(R,z){m="PUSH";let B=jy(R)?R:Co(D.location,R,z);g=x()+1;let I=Ty(B,g),X=D.createHref(B.mask||B);try{f.pushState(I,"",X)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;o.location.assign(X)}u&&p&&p({action:m,location:D.location,delta:1})}function w(R,z){m="REPLACE";let B=jy(R)?R:Co(D.location,R,z);g=x();let I=Ty(B,g),X=D.createHref(B.mask||B);f.replaceState(I,"",X),u&&p&&p({action:m,location:D.location,delta:0})}function S(R){return Kx(o,R)}let D={get action(){return m},get location(){return t(o,f)},listen(R){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Ry,y),p=R,()=>{o.removeEventListener(Ry,y),p=null}},createHref(R){return a(o,R)},createURL:S,encodeLocation(R){let z=S(R);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:E,replace:w,go(R){return f.go(R)}};return D}function Kx(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 o=typeof a=="string"?a:Tr(a);return o=o.replace(/ $/,"%20"),!l&&Jh.test(o)&&(o=i+o),new URL(o,i)}var xo,Cy=class{constructor(t){if(yo(this,xo,new Map),t)for(let[a,l]of t)this.set(a,l)}get(t){if(Xa(this,xo).has(t))return Xa(this,xo).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Xa(this,xo).set(t,a)}};xo=new WeakMap;var US=new Set(["lazy","caseSensitive","path","id","index","children"]);function BS(t){return US.has(t)}var HS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function $S(t){return HS.has(t)}function qS(t){return t.index===!0}function Do(t,a,l=[],i={},o=!1){return t.map((u,f)=>{let m=[...l,String(f)],p=typeof u.id=="string"?u.id:m.join("-");if(tt(u.index!==!0||!u.children,"Cannot specify children on an index route"),tt(o||!i[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),qS(u)){let g={...u,id:p};return i[p]=Dy(g,a(g)),g}else{let g={...u,id:p,children:void 0};return i[p]=Dy(g,a(g)),u.children&&(g.children=Do(u.children,a,m,i,o)),g}})}function Dy(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function Zx(t,a,l="/"){return ur(t,a,l,!1)}function ur(t,a,l,i,o){let u=typeof a=="string"?Cr(a):a,f=Wa(u.pathname||"/",l);if(f==null)return null;let m=o??gc(t),p=null,g=WS(f);for(let x=0;p==null&&x<m.length;++x)p=JS(m[x],g,i);return p}function IS(t,a){let{route:l,pathname:i,params:o}=t;return{id:l.id,pathname:i,params:o,data:a[l.id],loaderData:a[l.id],handle:l.handle}}function gc(t){let a=Jx(t);return VS(a),a}function Jx(t,a=[],l=[],i="",o=!1){let u=(f,m,p=o,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 y=Ja([i,x.relativePath]),E=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 "${y}".`),Jx(f.children,a,E,y,p)),!(f.path==null&&!f.index)&&a.push({path:y,score:KS(y,f.index),routesMeta:E.map((w,S)=>{let[D,R]=tb(w.relativePath,w.caseSensitive,S===E.length-1);return{...w,matcher:D,compiledParams:R}})})};return t.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))u(f,m);else for(let g of Wx(f.path))u(f,m,!0,g)}),a}function Wx(t){let a=t.split("/");if(a.length===0)return[];let[l,...i]=a,o=l.endsWith("?"),u=l.replace(/\?$/,"");if(i.length===0)return o?[u,""]:[u];let f=Wx(i.join("/")),m=[];return m.push(...f.map(p=>p===""?u:[u,p].join("/"))),o&&m.push(...f),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function VS(t){t.sort((a,l)=>a.score!==l.score?l.score-a.score:ZS(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}var YS=/^:[\w-]+$/,FS=3,PS=2,GS=1,XS=10,QS=-2,Ay=t=>t==="*";function KS(t,a){let l=t.split("/"),i=l.length;return l.some(Ay)&&(i+=QS),a&&(i+=PS),l.filter(o=>!Ay(o)).reduce((o,u)=>o+(YS.test(u)?FS:u===""?GS:XS),i)}function ZS(t,a){return t.length===a.length&&t.slice(0,-1).every((i,o)=>i===a[o])?t[t.length-1]-a[a.length-1]:0}function JS(t,a,l=!1){let{routesMeta:i}=t,o={},u="/",f=[];for(let m=0;m<i.length;++m){let p=i[m],g=m===i.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},E=p.matcher&&p.compiledParams?eb(y,x,p.matcher,p.compiledParams):Nc(y,x),w=p.route;if(!E&&g&&l&&!i[i.length-1].route.index&&(E=Nc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!E)return null;Object.assign(o,E.params),f.push({params:o,pathname:Ja([u,E.pathname]),pathnameBase:nw(Ja([u,E.pathnameBase])),route:w}),E.pathnameBase!=="/"&&(u=Ja([u,E.pathnameBase]))}return f}function Nc(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,i]=tb(t.path,t.caseSensitive,t.end);return eb(t,a,l,i)}function eb(t,a,l,i){let o=a.match(l);if(!o)return null;let u=o[0],f=u.replace(/(.)\/+$/,"$1"),m=o.slice(1);return{params:i.reduce((g,{paramName:x,isOptional:y},E)=>{if(x==="*"){let S=m[E]||"";f=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const w=m[E];return y&&!w?g[x]=void 0:g[x]=(w||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:t}}function tb(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=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,g,x)=>{if(i.push({paramName:m,isOptional:p!=null}),p){let y=x.charAt(g+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),i]}function WS(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 Wa(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 ew({basename:t,pathname:a}){return a==="/"?t:Ja([t,a])}var Wh=t=>zc.test(t);function tw(t,a="/"){let{pathname:l,search:i="",hash:o=""}=typeof t=="string"?Cr(t):t,u;return l?(l=tm(l),l.startsWith("/")?u=ky(l.substring(1),"/"):u=ky(l,a)):u=a,{pathname:u,search:aw(i),hash:rw(o)}}function ky(t,a){let l=Rc(a).split("/");return t.split("/").forEach(o=>{o===".."?l.length>1&&l.pop():o!=="."&&l.push(o)}),l.length>1?l.join("/"):"/"}function fh(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 nb(t){return t.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function em(t){let a=nb(t);return a.map((l,i)=>i===a.length-1?l.pathname:l.pathnameBase)}function Uc(t,a,l,i=!1){let o;typeof t=="string"?o=Cr(t):(o={...t},tt(!o.pathname||!o.pathname.includes("?"),fh("?","pathname","search",o)),tt(!o.pathname||!o.pathname.includes("#"),fh("#","pathname","hash",o)),tt(!o.search||!o.search.includes("#"),fh("#","search","hash",o)));let u=t===""||o.pathname==="",f=u?"/":o.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!i&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),y-=1;o.pathname=E.join("/")}m=y>=0?a[y]:"/"}let p=tw(o,m),g=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var tm=t=>t.replace(/[\\/]{2,}/g,"/"),Ja=t=>tm(t.join("/")),Rc=t=>t.replace(/\/+$/,""),nw=t=>Rc(t).replace(/^\/*/,"/"),aw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,rw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Ua=(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})},lw=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_o=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 ii(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Lo(t){let a=t.map(l=>l.route.path).filter(Boolean);return Ja(a)||"/"}var ab=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rb(t,a){let l=t;if(typeof l!="string"||!zc.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let i=l,o=!1;if(ab)try{let u=new URL(window.location.href),f=Jh.test(l)?new URL(Qx(l,u.protocol)):new URL(l),m=Wa(f.pathname,a);f.origin===u.origin&&m!=null?l=m+f.search+f.hash:o=!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:o,to:l}}var _l=Symbol("Uninstrumented");function sw(t,a){let l={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(o=>o({id:a.id,index:a.index,path:a.path,instrument(u){let f=Object.keys(l);for(let m of f)u[m]&&l[m].push(u[m])}}));let i={};if(typeof a.lazy=="function"&&l.lazy.length>0){let o=ai(l.lazy,a.lazy,()=>{});o&&(i.lazy=o)}if(typeof a.lazy=="object"){let o=a.lazy;["middleware","loader","action"].forEach(u=>{let f=o[u],m=l[`lazy.${u}`];if(typeof f=="function"&&m.length>0){let p=ai(m,f,()=>{});p&&(i.lazy=Object.assign(i.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(o=>{let u=a[o];if(typeof u=="function"&&l[o].length>0){let f=u[_l]??u,m=ai(l[o],f,(...p)=>Oy(p[0]));m&&(o==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[_l]=f,i[o]=m)}}),a.middleware&&a.middleware.length>0&&l.middleware.length>0&&(i.middleware=a.middleware.map(o=>{let u=o[_l]??o,f=ai(l.middleware,u,(...m)=>Oy(m[0]));return f?(f[_l]=u,f):o})),i}function iw(t,a){let l={navigate:[],fetch:[]};if(a.forEach(i=>i({instrument(o){let u=Object.keys(o);for(let f of u)o[f]&&l[f].push(o[f])}})),l.navigate.length>0){let i=t.navigate[_l]??t.navigate,o=ai(l.navigate,i,(...u)=>{let[f,m]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?Tr(f):".",...My(t,m??{})}});o&&(o[_l]=i,t.navigate=o)}if(l.fetch.length>0){let i=t.fetch[_l]??t.fetch,o=ai(l.fetch,i,(...u)=>{let[f,,m,p]=u;return{href:m??".",fetcherKey:f,...My(t,p??{})}});o&&(o[_l]=i,t.fetch=o)}return t}function ai(t,a,l){return t.length===0?null:async(...i)=>{let o=await lb(t,l(...i),()=>a(...i),t.length-1);if(o.type==="error")throw o.value;return o.value}}async function lb(t,a,l,i){let o=t[i],u;if(o){let f,m=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=lb(t,a,l,i-1),u=await f,tt(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(m,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await m(),await f}else try{u={type:"success",value:await l()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Oy(t){let{request:a,context:l,params:i,pattern:o}=t;return{request:ow(a),params:{...i},pattern:o,context:uw(l)}}function My(t,a){return{currentUrl:Tr(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 ow(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function uw(t){if(dw(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var cw=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function dw(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")===cw}var sb=["POST","PUT","PATCH","DELETE"],fw=new Set(sb),hw=["GET",...sb],mw=new Set(hw),ib=new Set([301,302,303,307,308]),pw=new Set([307,308]),hh={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},ob={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},oo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},gw=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),ub="remix-router-transitions",cb=Symbol("ResetLoaderData"),os,ei,Al,ti,vw=class{constructor(t){yo(this,os),yo(this,ei),yo(this,Al),yo(this,ti),wr(this,os,t),wr(this,ei,gc(t))}get stableRoutes(){return Xa(this,os)}get activeRoutes(){return Xa(this,Al)??Xa(this,os)}get branches(){return Xa(this,ti)??Xa(this,ei)}get hasHMRRoutes(){return Xa(this,Al)!=null}setRoutes(t){wr(this,os,t),wr(this,ei,gc(t))}setHmrRoutes(t){wr(this,Al,t),wr(this,ti,gc(t))}commitHmrRoutes(){Xa(this,Al)&&(wr(this,os,Xa(this,Al)),wr(this,ei,Xa(this,ti)),wr(this,Al,void 0),wr(this,ti,void 0))}};os=new WeakMap;ei=new WeakMap;Al=new WeakMap;ti=new WeakMap;function yw(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||[],o=t.mapRouteProperties||gw,u=o;if(t.instrumentations){let A=t.instrumentations;u=_=>({...o(_),...sw(A.map(q=>q.route).filter(Boolean),_)})}let f={},m=new vw(Do(t.routes,u,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||Ew,x={...t.future},y=null,E=new Set,w=null,S=null,D=null,R=null,z=t.hydrationData!=null,B=ur(m.activeRoutes,t.history.location,p,!1,m.branches),I=!1,X=null,W,ee;if(B==null&&!t.patchRoutesOnNavigation){let A=Qa(404,{pathname:t.history.location.pathname}),{matches:_,route:q}=rc(m.activeRoutes);W=!0,ee=!W,B=_,X={[q.id]:A}}else if(B&&!t.hydrationData&&Ut(B,m.activeRoutes,t.history.location.pathname).active&&(B=null),B)if(B.some(A=>A.route.lazy))W=!1,ee=!W;else if(!B.some(A=>nm(A.route)))W=!0,ee=!W;else{let A=t.hydrationData?t.hydrationData.loaderData:null,_=t.hydrationData?t.hydrationData.errors:null,q=B;if(_){let K=B.findIndex(re=>_[re.route.id]!==void 0);q=q.slice(0,K+1)}ee=!1,W=!0,q.forEach(K=>{let re=db(K.route,A,_);ee=ee||re.renderFallback,W=W&&!re.shouldLoad})}else{W=!1,ee=!W,B=[];let A=Ut(null,m.activeRoutes,t.history.location.pathname);A.active&&A.matches&&(I=!0,B=A.matches)}let M,T={historyAction:t.history.action,location:t.history.location,matches:B,initialized:W,renderFallback:ee,navigation:hh,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||X,fetchers:new Map,blockers:new Map},ce="POP",he=null,we=!1,Ee,ne=!1,pe=new Map,Re=null,U=!1,H=!1,ie=new Set,ue=new Map,xe=0,C=-1,V=new Map,J=new Set,de=new Map,Se=new Map,je=new Set,ze=new Map,ct,Fe=null;function nt(){if(y=t.history.listen(({action:A,location:_,delta:q})=>{if(ct){ct(),ct=void 0;return}Sn(ze.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 K=qt({currentLocation:T.location,nextLocation:_,historyAction:A});if(K&&q!=null){let re=new Promise(Te=>{ct=Te});t.history.go(q*-1),Gt(K,{state:"blocked",location:_,proceed(){Gt(K,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),re.then(()=>t.history.go(q))},reset(){let Te=new Map(T.blockers);Te.set(K,oo),ht({blockers:Te})}}),he==null||he.resolve(),he=null;return}return _t(A,_)}),l){Iw(a,pe);let A=()=>Vw(a,pe);a.addEventListener("pagehide",A),Re=()=>a.removeEventListener("pagehide",A)}return T.initialized||_t("POP",T.location,{initialHydration:!0}),M}function wn(){y&&y(),Re&&Re(),E.clear(),Ee&&Ee.abort(),T.fetchers.forEach((A,_)=>Wt(T.fetchers,_)),T.blockers.forEach((A,_)=>_e(_))}function Ft(A){if(E.add(A),w){let{newErrors:_}=w;w=null,A(T,{deletedFetchers:[],newErrors:_,viewTransitionOpts:void 0,flushSync:!1})}return()=>E.delete(A)}function ht(A,_={}){A.matches&&(A.matches=A.matches.map(re=>{let Te=f[re.route.id],me=re.route;return me.element!==Te.element||me.errorElement!==Te.errorElement||me.hydrateFallbackElement!==Te.hydrateFallbackElement?{...re,route:Te}:re})),T={...T,...A};let q=[],K=[];T.fetchers.forEach((re,Te)=>{re.state==="idle"&&(je.has(Te)?q.push(Te):K.push(Te))}),je.forEach(re=>{!T.fetchers.has(re)&&!ue.has(re)&&q.push(re)}),E.size===0&&(w={newErrors:A.errors??null}),[...E].forEach(re=>re(T,{deletedFetchers:q,newErrors:A.errors??null,viewTransitionOpts:_.viewTransitionOpts,flushSync:_.flushSync===!0})),q.forEach(re=>Wt(T.fetchers,re)),K.forEach(re=>T.fetchers.delete(re))}function se(A,_,{flushSync:q}={}){var Ue,Pe;let K=T.actionData!=null&&T.navigation.formMethod!=null&&oa(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ue=A.state)==null?void 0:Ue._isRedirect)!==!0,re;_.actionData?Object.keys(_.actionData).length>0?re=_.actionData:re=null:K?re=T.actionData:re=null;let Te=_.loaderData?Vy(T.loaderData,_.loaderData,_.matches||[],_.errors):T.loaderData,me=T.blockers;me.size>0&&(me=new Map(me),me.forEach((Ae,Ze)=>me.set(Ze,oo)));let De=U?!1:Xt(A,_.matches||T.matches),Ne=we===!0||T.navigation.formMethod!=null&&oa(T.navigation.formMethod)&&((Pe=A.state)==null?void 0:Pe._isRedirect)!==!0;m.commitHmrRoutes(),U||ce==="POP"||(ce==="PUSH"?t.history.push(A,A.state):ce==="REPLACE"&&t.history.replace(A,A.state));let Me;if(ce==="POP"){let Ae=pe.get(T.location.pathname);Ae&&Ae.has(A.pathname)?Me={currentLocation:T.location,nextLocation:A}:pe.has(A.pathname)&&(Me={currentLocation:A,nextLocation:T.location})}else if(ne){let Ae=pe.get(T.location.pathname);Ae?Ae.add(A.pathname):(Ae=new Set([A.pathname]),pe.set(T.location.pathname,Ae)),Me={currentLocation:T.location,nextLocation:A}}ht({..._,actionData:re,loaderData:Te,historyAction:ce,location:A,initialized:!0,renderFallback:!1,navigation:hh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:Ne,blockers:me},{viewTransitionOpts:Me,flushSync:q===!0}),ce="POP",we=!1,ne=!1,U=!1,H=!1,he==null||he.resolve(),he=null,Fe==null||Fe.resolve(),Fe=null}async function qe(A,_){if(he==null||he.resolve(),he=null,typeof A=="number"){he||(he=Gy());let Ie=he.promise;return t.history.go(A),Ie}let q=Bh(T.location,T.matches,p,A,_==null?void 0:_.fromRouteId,_==null?void 0:_.relative),{path:K,submission:re,error:Te}=_y(!1,q,_),me;_!=null&&_.mask&&(me={pathname:"",search:"",hash:"",...typeof _.mask=="string"?Cr(_.mask):{...T.location.mask,..._.mask}});let De=T.location,Ne=Co(De,K,_&&_.state,void 0,me);Ne={...Ne,...t.history.encodeLocation(Ne)};let Me=_&&_.replace!=null?_.replace:void 0,Ue="PUSH";Me===!0?Ue="REPLACE":Me===!1||re!=null&&oa(re.formMethod)&&re.formAction===T.location.pathname+T.location.search&&(Ue="REPLACE");let Pe=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,Ae=(_&&_.flushSync)===!0,Ze=qt({currentLocation:De,nextLocation:Ne,historyAction:Ue});if(Ze){Gt(Ze,{state:"blocked",location:Ne,proceed(){Gt(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:Ne}),qe(A,_)},reset(){let Ie=new Map(T.blockers);Ie.set(Ze,oo),ht({blockers:Ie})}});return}await _t(Ue,Ne,{submission:re,pendingError:Te,preventScrollReset:Pe,replace:_&&_.replace,enableViewTransition:_&&_.viewTransition,flushSync:Ae,callSiteDefaultShouldRevalidate:_&&_.defaultShouldRevalidate})}function at(){Fe||(Fe=Gy()),Oe(),ht({revalidation:"loading"});let A=Fe.promise;return T.navigation.state==="submitting"?A:T.navigation.state==="idle"?(_t(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),A):(_t(ce||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ne===!0}),A)}async function _t(A,_,q){Ee&&Ee.abort(),Ee=null,ce=A,U=(q&&q.startUninterruptedRevalidation)===!0,rn(T.location,T.matches),we=(q&&q.preventScrollReset)===!0,ne=(q&&q.enableViewTransition)===!0;let K=m.activeRoutes,re=q!=null&&q.initialHydration&&T.matches&&T.matches.length>0&&!I?T.matches:ur(K,_,p,!1,m.branches),Te=(q&&q.flushSync)===!0;if(re&&T.initialized&&!H&&Ow(T.location,_)&&!(q&&q.submission&&oa(q.submission.formMethod))){se(_,{matches:re},{flushSync:Te});return}let me=Ut(re,K,_.pathname);if(me.active&&me.matches&&(re=me.matches),!re){let{error:We,notFoundMatches:dt,route:it}=xt(_.pathname);se(_,{matches:dt,loaderData:{},errors:{[it.id]:We}},{flushSync:Te});return}let De=q&&q.overrideNavigation?{...q.overrideNavigation,matches:re,historyAction:A}:void 0;Ee=new AbortController;let Ne=ni(t.history,_,Ee.signal,q&&q.submission),Me=t.getContext?await t.getContext():new Cy,Ue;if(q&&q.pendingError)Ue=[Ml(re).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&oa(q.submission.formMethod)){let We=await yn(Ne,_,q.submission,re,A,Me,me.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:Te});if(We.shortCircuited)return;if(We.pendingActionResult){let[dt,it]=We.pendingActionResult;if(La(it)&&ii(it.error)&&it.error.status===404){Ee=null,se(_,{matches:We.matches,loaderData:{},errors:{[dt]:it.error}});return}}re=We.matches||re,Ue=We.pendingActionResult,De=mh(_,re,A,q.submission),Te=!1,me.active=!1,Ne=ni(t.history,Ne.url,Ne.signal)}let{shortCircuited:Pe,matches:Ae,loaderData:Ze,errors:Ie,workingFetchers:Bt}=await Lt(Ne,_,re,A,Me,me.active,De,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Te,Ue,q&&q.callSiteDefaultShouldRevalidate);Pe||(Ee=null,se(_,{matches:Ae||re,...Yy(Ue),loaderData:Ze,errors:Ie,...Bt?{fetchers:Bt}:{}}))}async function yn(A,_,q,K,re,Te,me,De,Ne={}){Oe();let Me=$w(_,K,re,q);if(ht({navigation:Me},{flushSync:Ne.flushSync===!0}),me){let Ae=await mt(K,_.pathname,A.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){if(Ae.partialMatches.length===0){let{matches:Ie,route:Bt}=rc(m.activeRoutes);return{matches:Ie,pendingActionResult:[Bt.id,{type:"error",error:Ae.error}]}}let Ze=Ml(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,pendingActionResult:[Ze,{type:"error",error:Ae.error}]}}else if(Ae.matches)K=Ae.matches;else{let{notFoundMatches:Ze,error:Ie,route:Bt}=xt(_.pathname);return{matches:Ze,pendingActionResult:[Bt.id,{type:"error",error:Ie}]}}}let Ue,Pe=vc(K,_);if(!Pe.route.action&&!Pe.route.lazy)Ue={type:"error",error:Qa(405,{method:A.method,pathname:_.pathname,routeId:Pe.route.id})};else{let Ae=li(u,f,A,_,K,Pe,De?[]:i,Te),Ze=await da(A,_,Ae,Te,null);if(Ue=Ze[Pe.route.id],!Ue){for(let Ie of K)if(Ze[Ie.route.id]){Ue=Ze[Ie.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(us(Ue)){let Ae;return Ne&&Ne.replace!=null?Ae=Ne.replace:Ae=$y(Ue.response.headers.get("Location"),new URL(A.url),p,t.history)===T.location.pathname+T.location.search,await ca(A,Ue,!0,{submission:q,replace:Ae}),{shortCircuited:!0}}if(La(Ue)){let Ae=Ml(K,Pe.route.id);return(Ne&&Ne.replace)!==!0&&(ce="PUSH"),{matches:K,pendingActionResult:[Ae.route.id,Ue,Pe.route.id]}}return{matches:K,pendingActionResult:[Pe.route.id,Ue]}}async function Lt(A,_,q,K,re,Te,me,De,Ne,Me,Ue,Pe,Ae,Ze){let Ie=me||mh(_,q,K,De),Bt=De||Ne||Py(Ie),We=!U&&!Ue;if(Te){if(We){let wt=kt(Ae);ht({navigation:Ie,...wt!==void 0?{actionData:wt}:{}},{flushSync:Pe})}let Ge=await mt(q,_.pathname,A.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){if(Ge.partialMatches.length===0){let{matches:Kt,route:ta}=rc(m.activeRoutes);return{matches:Kt,loaderData:{},errors:{[ta.id]:Ge.error}}}let wt=Ml(Ge.partialMatches).route.id;return{matches:Ge.partialMatches,loaderData:{},errors:{[wt]:Ge.error}}}else if(Ge.matches)q=Ge.matches;else{let{error:wt,notFoundMatches:Kt,route:ta}=xt(_.pathname);return{matches:Kt,loaderData:{},errors:{[ta.id]:wt}}}}let dt=m.activeRoutes,{dsMatches:it,revalidatingFetchers:ft}=Ly(A,re,u,f,t.history,T,q,Bt,_,Ue?[]:i,Ue===!0,H,ie,je,de,J,dt,p,t.patchRoutesOnNavigation!=null,m.branches,Ae,Ze);if(C=++xe,!t.dataStrategy&&!it.some(Ge=>Ge.shouldLoad)&&!it.some(Ge=>Ge.route.middleware&&Ge.route.middleware.length>0)&&ft.length===0){let Ge=new Map(T.fetchers),wt=nr(Ge);return se(_,{matches:q,loaderData:{},errors:Ae&&La(Ae[1])?{[Ae[0]]:Ae[1].error}:null,...Yy(Ae),...wt?{fetchers:Ge}:{}},{flushSync:Pe}),{shortCircuited:!0}}if(We){let Ge={};if(!Te){Ge.navigation=Ie;let wt=kt(Ae);wt!==void 0&&(Ge.actionData=wt)}ft.length>0&&(Ge.fetchers=Pt(ft)),ht(Ge,{flushSync:Pe})}ft.forEach(Ge=>{Nt(Ge.key),Ge.controller&&ue.set(Ge.key,Ge.controller)});let Qt=()=>ft.forEach(Ge=>Nt(Ge.key));Ee&&Ee.signal.addEventListener("abort",Qt);let{loaderResults:Pn,fetcherResults:Nn}=await ge(it,ft,A,_,re);if(A.signal.aborted)return{shortCircuited:!0};Ee&&Ee.signal.removeEventListener("abort",Qt),ft.forEach(Ge=>ue.delete(Ge.key));let _n=lc(Pn);if(_n)return await ca(A,_n.result,!0,{replace:Me}),{shortCircuited:!0};if(_n=lc(Nn),_n)return J.add(_n.key),await ca(A,_n.result,!0,{replace:Me}),{shortCircuited:!0};let Ln=new Map(T.fetchers),{loaderData:Gn,errors:pa}=Iy(T,q,Pn,Ae,ft,Nn,Ln);Ue&&T.errors&&(pa={...T.errors,...pa});let rl=nr(Ln),ea=tn(C,Ln),hr=rl||ea||ft.length>0;return{matches:q,loaderData:Gn,errors:pa,...hr?{workingFetchers:Ln}:{}}}function kt(A){if(A&&!La(A[1]))return{[A[0]]:A[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Pt(A){let _=new Map(T.fetchers);return A.forEach(q=>{let K=_.get(q.key),re=uo(void 0,K?K.data:void 0);_.set(q.key,re)}),_}async function $n(A,_,q,K){Nt(A);let re=(K&&K.flushSync)===!0,Te=m.activeRoutes,me=Bh(T.location,T.matches,p,q,_,K==null?void 0:K.relative),De=ur(Te,me,p,!1,m.branches),Ne=Ut(De,Te,me);if(Ne.active&&Ne.matches&&(De=Ne.matches),!De){Be(A,_,Qa(404,{pathname:me}),{flushSync:re});return}let{path:Me,submission:Ue,error:Pe}=_y(!0,me,K);if(Pe){Be(A,_,Pe,{flushSync:re});return}let Ae=t.getContext?await t.getContext():new Cy,Ze=(K&&K.preventScrollReset)===!0;if(Ue&&oa(Ue.formMethod)){await Fn(A,_,Me,De,Ae,Ne.active,re,Ze,Ue,K&&K.defaultShouldRevalidate);return}de.set(A,{routeId:_,path:Me}),await an(A,_,Me,De,Ae,Ne.active,re,Ze,Ue)}async function Fn(A,_,q,K,re,Te,me,De,Ne,Me){Oe(),de.delete(A);let Ue=T.fetchers.get(A);Ce(A,qw(Ne,Ue),{flushSync:me});let Pe=new AbortController,Ae=ni(t.history,q,Pe.signal,Ne);if(Te){let Et=await mt(K,new URL(Ae.url).pathname,Ae.signal,A);if(Et.type==="aborted")return;if(Et.type==="error"){Be(A,_,Et.error,{flushSync:me});return}else if(Et.matches)K=Et.matches;else{Be(A,_,Qa(404,{pathname:q}),{flushSync:me});return}}let Ze=vc(K,q);if(!Ze.route.action&&!Ze.route.lazy){let Et=Qa(405,{method:Ne.formMethod,pathname:q,routeId:_});Be(A,_,Et,{flushSync:me});return}ue.set(A,Pe);let Ie=xe,Bt=li(u,f,Ae,q,K,Ze,i,re),We=await da(Ae,q,Bt,re,A),dt=We[Ze.route.id];if(!dt){for(let Et of Bt)if(We[Et.route.id]){dt=We[Et.route.id];break}}if(Ae.signal.aborted){ue.get(A)===Pe&&ue.delete(A);return}if(je.has(A)){if(us(dt)||La(dt)){Ce(A,Nr(void 0));return}}else{if(us(dt))if(ue.delete(A),C>Ie){Ce(A,Nr(void 0));return}else return J.add(A),Ce(A,uo(Ne)),ca(Ae,dt,!1,{fetcherSubmission:Ne,preventScrollReset:De});if(La(dt)){Be(A,_,dt.error);return}}let it=T.navigation.location||T.location,ft=ni(t.history,it,Pe.signal),Qt=m.activeRoutes,Pn=T.navigation.state!=="idle"?ur(Qt,T.navigation.location,p,!1,m.branches):T.matches;tt(Pn,"Didn't find any matches after fetcher action");let Nn=++xe;V.set(A,Nn);let{dsMatches:_n,revalidatingFetchers:Ln}=Ly(ft,re,u,f,t.history,T,Pn,Ne,it,i,!1,H,ie,je,de,J,Qt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ze.route.id,dt],Me),Gn=uo(Ne,dt.data),pa=new Map(T.fetchers);pa.set(A,Gn),Ln.filter(Et=>Et.key!==A).forEach(Et=>{let ja=Et.key,Xn=pa.get(ja),ql=uo(void 0,Xn?Xn.data:void 0);pa.set(ja,ql),Nt(ja),Et.controller&&ue.set(ja,Et.controller)}),ht({fetchers:pa});let rl=()=>Ln.forEach(Et=>Nt(Et.key));Pe.signal.addEventListener("abort",rl);let{loaderResults:ea,fetcherResults:hr}=await ge(_n,Ln,ft,it,re);if(Pe.signal.aborted)return;Pe.signal.removeEventListener("abort",rl),V.delete(A),ue.delete(A),Ln.forEach(Et=>ue.delete(Et.key));let Ge=T.fetchers.has(A),wt=Et=>{if(!Ge)return Et;let ja=new Map(Et.fetchers);return ja.set(A,Nr(dt.data)),{...Et,fetchers:ja}},Kt=lc(ea);if(Kt)return T=wt(T),ca(ft,Kt.result,!1,{preventScrollReset:De});if(Kt=lc(hr),Kt)return J.add(Kt.key),T=wt(T),ca(ft,Kt.result,!1,{preventScrollReset:De});let ta=new Map(T.fetchers);Ge&&ta.set(A,Nr(dt.data));let{loaderData:zn,errors:kr}=Iy(T,Pn,ea,void 0,Ln,hr,ta);tn(Nn,ta),T.navigation.state==="loading"&&Nn>C?(tt(ce,"Expected pending action"),Ee&&Ee.abort(),se(T.navigation.location,{matches:Pn,loaderData:zn,errors:kr,fetchers:ta})):(ht({errors:kr,loaderData:Vy(T.loaderData,zn,Pn,kr),fetchers:ta}),H=!1)}async function an(A,_,q,K,re,Te,me,De,Ne){let Me=T.fetchers.get(A);Ce(A,uo(Ne,Me?Me.data:void 0),{flushSync:me});let Ue=new AbortController,Pe=ni(t.history,q,Ue.signal);if(Te){let dt=await mt(K,new URL(Pe.url).pathname,Pe.signal,A);if(dt.type==="aborted")return;if(dt.type==="error"){Be(A,_,dt.error,{flushSync:me});return}else if(dt.matches)K=dt.matches;else{Be(A,_,Qa(404,{pathname:q}),{flushSync:me});return}}let Ae=vc(K,q);ue.set(A,Ue);let Ze=xe,Ie=li(u,f,Pe,q,K,Ae,i,re),Bt=await da(Pe,q,Ie,re,A),We=Bt[Ae.route.id];if(!We){for(let dt of K)if(Bt[dt.route.id]){We=Bt[dt.route.id];break}}if(ue.get(A)===Ue&&ue.delete(A),!Pe.signal.aborted){if(je.has(A)){Ce(A,Nr(void 0));return}if(us(We))if(C>Ze){Ce(A,Nr(void 0));return}else{J.add(A),await ca(Pe,We,!1,{preventScrollReset:De});return}if(La(We)){Be(A,_,We.error);return}Ce(A,Nr(We.data))}}async function ca(A,_,q,{submission:K,fetcherSubmission:re,preventScrollReset:Te,replace:me}={}){q||(he==null||he.resolve(),he=null),_.response.headers.has("X-Remix-Revalidate")&&(H=!0);let De=_.response.headers.get("Location");tt(De,"Expected a Location header on the redirect Response"),De=$y(De,new URL(A.url),p,t.history);let Ne=Co(T.location,De,{_isRedirect:!0});if(l){let Ie=!1;if(_.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(Wh(De)){const Bt=Kx(a,De,!0);Ie=Bt.origin!==a.location.origin||Wa(Bt.pathname,p)==null}if(Ie){me?a.location.replace(De):a.location.assign(De);return}}Ee=null;let Me=me===!0||_.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Pe,formEncType:Ae}=T.navigation;!K&&!re&&Ue&&Pe&&Ae&&(K=Py(T.navigation));let Ze=K||re;if(pw.has(_.response.status)&&Ze&&oa(Ze.formMethod))await _t(Me,Ne,{submission:{...Ze,formAction:De},preventScrollReset:Te||we,enableViewTransition:q?ne:void 0});else{let Ie=mh(Ne,[],Me,K);await _t(Me,Ne,{overrideNavigation:Ie,fetcherSubmission:re,preventScrollReset:Te||we,enableViewTransition:q?ne:void 0})}}async function da(A,_,q,K,re){var De;let Te,me={};try{Te=await Rw(g,A,_,q,re,K,!1)}catch(Ne){return q.filter(Me=>Me.shouldLoad).forEach(Me=>{me[Me.route.id]={type:"error",error:Ne}}),me}if(A.signal.aborted)return me;if(!oa(A.method))for(let Ne of q){if(((De=Te[Ne.route.id])==null?void 0:De.type)==="error")break;!Te.hasOwnProperty(Ne.route.id)&&!T.loaderData.hasOwnProperty(Ne.route.id)&&(!T.errors||!T.errors.hasOwnProperty(Ne.route.id))&&Ne.shouldCallHandler()&&(Te[Ne.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ne.route.id}`)})}for(let[Ne,Me]of Object.entries(Te))if(zw(Me)){let Ue=Me.result;me[Ne]={type:"redirect",response:Dw(Ue,A,Ne,q,p)}}else me[Ne]=await Cw(Me);return me}async function ge(A,_,q,K,re){let Te=da(q,K,A,re,null),me=Promise.all(_.map(async Me=>{if(Me.matches&&Me.match&&Me.request&&Me.controller){let Pe=(await da(Me.request,Me.path,Me.matches,re,Me.key))[Me.match.route.id];return{[Me.key]:Pe}}else return Promise.resolve({[Me.key]:{type:"error",error:Qa(404,{pathname:Me.path})}})})),De=await Te,Ne=(await me).reduce((Me,Ue)=>Object.assign(Me,Ue),{});return{loaderResults:De,fetcherResults:Ne}}function Oe(){H=!0,de.forEach((A,_)=>{ue.has(_)&&ie.add(_),Nt(_)})}function Ce(A,_,q={}){let K=new Map(T.fetchers);K.set(A,_),ht({fetchers:K},{flushSync:(q&&q.flushSync)===!0})}function Be(A,_,q,K={}){let re=Ml(T.matches,_),Te=new Map(T.fetchers);Wt(Te,A),ht({errors:{[re.route.id]:q},fetchers:Te},{flushSync:(K&&K.flushSync)===!0})}function Ke(A){return Se.set(A,(Se.get(A)||0)+1),je.has(A)&&je.delete(A),T.fetchers.get(A)||ob}function fn(A,_){Nt(A,_==null?void 0:_.reason),Ce(A,Nr(null))}function Wt(A,_){let q=T.fetchers.get(_);ue.has(_)&&!(q&&q.state==="loading"&&V.has(_))&&Nt(_),de.delete(_),V.delete(_),J.delete(_),je.delete(_),ie.delete(_),A.delete(_)}function ae(A){let _=(Se.get(A)||0)-1;_<=0?(Se.delete(A),je.add(A)):Se.set(A,_),ht({fetchers:new Map(T.fetchers)})}function Nt(A,_){let q=ue.get(A);q&&(q.abort(_),ue.delete(A))}function en(A,_){for(let q of A){let K=_.get(q);tt(K,`Expected fetcher: ${q}`);let re=Nr(K.data);_.set(q,re)}}function nr(A){let _=[],q=!1;for(let K of J){let re=A.get(K);tt(re,`Expected fetcher: ${K}`),re.state==="loading"&&(J.delete(K),_.push(K),q=!0)}return en(_,A),q}function tn(A,_){let q=[];for(let[K,re]of V)if(re<A){let Te=_.get(K);tt(Te,`Expected fetcher: ${K}`),Te.state==="loading"&&(Nt(K),V.delete(K),q.push(K))}return en(q,_),q.length>0}function qn(A,_){let q=T.blockers.get(A)||oo;return ze.get(A)!==_&&ze.set(A,_),q}function _e(A){T.blockers.delete(A),ze.delete(A)}function Gt(A,_){let q=T.blockers.get(A)||oo;tt(q.state==="unblocked"&&_.state==="blocked"||q.state==="blocked"&&_.state==="blocked"||q.state==="blocked"&&_.state==="proceeding"||q.state==="blocked"&&_.state==="unblocked"||q.state==="proceeding"&&_.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${_.state}`);let K=new Map(T.blockers);K.set(A,_),ht({blockers:K})}function qt({currentLocation:A,nextLocation:_,historyAction:q}){if(ze.size===0)return;ze.size>1&&Sn(!1,"A router only supports one blocker at a time");let K=Array.from(ze.entries()),[re,Te]=K[K.length-1],me=T.blockers.get(re);if(!(me&&me.state==="proceeding")&&Te({currentLocation:A,nextLocation:_,historyAction:q}))return re}function xt(A){let _=Qa(404,{pathname:A}),q=m.activeRoutes,{matches:K,route:re}=rc(q);return{notFoundMatches:K,route:re,error:_}}function zt(A,_,q){if(S=A,R=_,D=q||null,!z&&T.navigation===hh){z=!0;let K=Xt(T.location,T.matches);K!=null&&ht({restoreScrollPosition:K})}return()=>{S=null,R=null,D=null}}function Rt(A,_){return D&&D(A,_.map(K=>IS(K,T.loaderData)))||A.key}function rn(A,_){if(S&&R){let q=Rt(A,_);S[q]=R()}}function Xt(A,_){if(S){let q=Rt(A,_),K=S[q];if(typeof K=="number")return K}return null}function Ut(A,_,q){if(t.patchRoutesOnNavigation){let K=m.branches;if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:ur(_,q,p,!0,K)}}else return{active:!0,matches:ur(_,q,p,!0,K)||[]}}return{active:!1,matches:null}}async function mt(A,_,q,K){if(!t.patchRoutesOnNavigation)return{type:"success",matches:A};let re=A;for(;;){let Te=f;try{await t.patchRoutesOnNavigation({signal:q,path:_,matches:re,fetcherKey:K,patch:(Me,Ue)=>{q.aborted||zy(Me,Ue,m,Te,u,!1)}})}catch(Me){return{type:"error",error:Me,partialMatches:re}}if(q.aborted)return{type:"aborted"};let me=m.branches,De=ur(m.activeRoutes,_,p,!1,me),Ne=null;if(De){if(Object.keys(De[0].params).length===0)return{type:"success",matches:De};if(Ne=ur(m.activeRoutes,_,p,!0,me),!(Ne&&re.length<Ne.length&&Je(re,Ne.slice(0,re.length))))return{type:"success",matches:De}}if(Ne||(Ne=ur(m.activeRoutes,_,p,!0,me)),!Ne||Je(re,Ne))return{type:"success",matches:null};re=Ne}}function Je(A,_){return A.length===_.length&&A.every((q,K)=>q.route.id===_[K].route.id)}function En(A){f={},m.setHmrRoutes(Do(A,u,void 0,f))}function Mn(A,_,q=!1){zy(A,_,m,f,u,q),m.hasHMRRoutes||ht({})}return M={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:Ft,enableScrollRestoration:zt,navigate:qe,fetch:$n,revalidate:at,createHref:A=>t.history.createHref(A),encodeLocation:A=>t.history.encodeLocation(A),getFetcher:Ke,resetFetcher:fn,deleteFetcher:ae,dispose:wn,getBlocker:qn,deleteBlocker:_e,patchRoutes:Mn,_internalFetchControllers:ue,_internalSetRoutes:En,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){ht(A)}},t.instrumentations&&(M=iw(M,t.instrumentations.map(A=>A.router).filter(Boolean))),M}function xw(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Bh(t,a,l,i,o,u){let f,m;if(o){f=[];for(let g of a)if(f.push(g),g.route.id===o){m=g;break}}else f=a,m=a[a.length-1];let p=Uc(i||".",em(f),Wa(t.pathname,l)||t.pathname,u==="path");if(i==null&&(p.search=t.search,p.hash=t.hash),(i==null||i===""||i===".")&&m){let g=rm(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),y=x.getAll("index");x.delete("index"),y.filter(w=>w).forEach(w=>x.append("index",w));let E=x.toString();p.search=E?`?${E}`:""}}return l!=="/"&&(p.pathname=ew({basename:l,pathname:p.pathname})),Tr(p)}function _y(t,a,l){if(!l||!xw(l))return{path:a};if(l.formMethod&&!Hw(l.formMethod))return{path:a,error:Qa(405,{method:l.formMethod})};let i=()=>({path:a,error:Qa(400,{type:"invalid-body"})}),u=(l.formMethod||"get").toUpperCase(),f=yb(a);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!oa(u))return i();let y=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((E,[w,S])=>`${E}${w}=${S}
|
|
59
|
-
`,""):String(l.body);return{path:a,submission:{formMethod:u,formAction:f,formEncType:l.formEncType,formData:void 0,json:void 0,text:y}}}else if(l.formEncType==="application/json"){if(!oa(u))return i();try{let y=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:a,submission:{formMethod:u,formAction:f,formEncType:l.formEncType,formData:void 0,json:y,text:void 0}}}catch{return i()}}}tt(typeof FormData=="function","FormData is not available in this environment");let m,p;if(l.formData)m=qh(l.formData),p=l.formData;else if(l.body instanceof FormData)m=qh(l.body),p=l.body;else if(l.body instanceof URLSearchParams)m=l.body,p=qy(m);else if(l.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(l.body),p=qy(m)}catch{return i()}let g={formMethod:u,formAction:f,formEncType:l&&l.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(oa(g.formMethod))return{path:a,submission:g};let x=Cr(a);return t&&x.search&&rm(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Tr(x),submission:g}}function Ly(t,a,l,i,o,u,f,m,p,g,x,y,E,w,S,D,R,z,B,I,X,W){var U;let ee=X?La(X[1])?X[1].error:X[1].data:void 0,M=o.createURL(u.location),T=o.createURL(p),ce;if(x&&u.errors){let H=Object.keys(u.errors)[0];ce=f.findIndex(ie=>ie.route.id===H)}else if(X&&La(X[1])){let H=X[0];ce=f.findIndex(ie=>ie.route.id===H)-1}let he=X?X[1].statusCode:void 0,we=he&&he>=400,Ee={currentUrl:M,currentParams:((U=u.matches[0])==null?void 0:U.params)||{},nextUrl:T,nextParams:f[0].params,...m,actionResult:ee,actionStatus:he},ne=Lo(f),pe=f.map((H,ie)=>{let{route:ue}=H,xe=null;if(ce!=null&&ie>ce)xe=!1;else if(ue.lazy)xe=!0;else if(!nm(ue))xe=!1;else if(x){let{shouldLoad:de}=db(ue,u.loaderData,u.errors);xe=de}else bw(u.loaderData,u.matches[ie],H)&&(xe=!0);if(xe!==null)return Hh(l,i,t,p,ne,H,g,a,xe);let C=!1;typeof W=="boolean"?C=W:we?C=!1:(y||M.pathname+M.search===T.pathname+T.search||M.search!==T.search||Sw(u.matches[ie],H))&&(C=!0);let V={...Ee,defaultShouldRevalidate:C},J=wo(H,V);return Hh(l,i,t,p,ne,H,g,a,J,V,W)}),Re=[];return S.forEach((H,ie)=>{if(x||!f.some(je=>je.route.id===H.routeId)||w.has(ie))return;let ue=u.fetchers.get(ie),xe=ue&&ue.state!=="idle"&&ue.data===void 0,C=ur(R,H.path,z??"/",!1,I);if(!C){if(B&&xe)return;Re.push({key:ie,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(D.has(ie))return;let V=vc(C,H.path),J=new AbortController,de=ni(o,H.path,J.signal),Se=null;if(E.has(ie))E.delete(ie),Se=li(l,i,de,H.path,C,V,g,a);else if(xe)y&&(Se=li(l,i,de,H.path,C,V,g,a));else{let je;typeof W=="boolean"?je=W:we?je=!1:je=y;let ze={...Ee,defaultShouldRevalidate:je};wo(V,ze)&&(Se=li(l,i,de,H.path,C,V,g,a,ze))}Se&&Re.push({key:ie,routeId:H.routeId,path:H.path,matches:Se,match:V,request:de,controller:J})}),{dsMatches:pe,revalidatingFetchers:Re}}function nm(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function db(t,a,l){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!nm(t))return{shouldLoad:!1,renderFallback:!1};let i=a!=null&&t.id in a,o=l!=null&&l[t.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let u=!i&&!o;return{shouldLoad:u,renderFallback:u}}function bw(t,a,l){let i=!a||l.route.id!==a.route.id,o=!t.hasOwnProperty(l.route.id);return i||o}function Sw(t,a){let l=t.route.path;return t.pathname!==a.pathname||l!=null&&l.endsWith("*")&&t.params["*"]!==a.params["*"]}function wo(t,a){if(t.route.shouldRevalidate){let l=t.route.shouldRevalidate(a);if(typeof l=="boolean")return l}return a.defaultShouldRevalidate}function zy(t,a,l,i,o,u){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(y=>fb(g,y));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=Do(m,o,[t||"_","patch",String((f==null?void 0:f.length)||"0")],i);f.push(...g)}if(u&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:x,newRoute:y}=p[g],E=x,[w]=Do([y],o,[],{},!0);Object.assign(E,{element:w.element?w.element:E.element,errorElement:w.errorElement?w.errorElement:E.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:E.hydrateFallbackElement})}l.hasHMRRoutes||l.setRoutes([...l.activeRoutes])}function fb(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,o)=>{var u;return(u=a.children)==null?void 0:u.some(f=>fb(i,f))}))??!1:!1}var Uy=new WeakMap,hb=({key:t,route:a,manifest:l,mapRouteProperties:i})=>{let o=l[a.id];if(tt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[t];if(!u)return;let f=Uy.get(o);f||(f={},Uy.set(o,f));let m=f[t];if(m)return m;let p=(async()=>{let g=BS(t),y=o[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(y)Sn(!1,`Route "${o.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let E=await u();E!=null&&(Object.assign(o,{[t]:E}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[t]=void 0,Object.values(o.lazy).every(E=>E===void 0)&&(o.lazy=void 0))})();return f[t]=p,p},By=new WeakMap;function ww(t,a,l,i,o){let u=l[t.id];if(tt(u,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=By.get(u);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let y=(async()=>{tt(typeof t.lazy=="function","No lazy route function found");let E=await t.lazy(),w={};for(let S in E){let D=E[S];if(D===void 0)continue;let R=$S(S),B=u[S]!==void 0&&S!=="hasErrorBoundary";R?Sn(!R,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):B?Sn(!B,`Route "${u.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):w[S]=D}Object.assign(u,w),Object.assign(u,{...i(u),lazy:void 0})})();return By.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let f=Object.keys(t.lazy),m=[],p;for(let x of f){if(o&&o.includes(x))continue;let y=hb({key:x,route:t,manifest:l,mapRouteProperties:i});y&&(m.push(y),x===a&&(p=y))}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 Hy(t){let a=t.matches.filter(o=>o.shouldLoad),l={};return(await Promise.all(a.map(o=>o.resolve()))).forEach((o,u)=>{l[a[u].route.id]=o}),l}async function Ew(t){return t.matches.some(a=>a.route.middleware)?mb(t,()=>Hy(t)):Hy(t)}function mb(t,a){return Nw(t,a,i=>{if(Bw(i))throw i;return i},_w,l);function l(i,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:i}}));{let{matches:f}=t,m=Math.min(Math.max(f.findIndex(g=>g.route.id===o),0),Math.max(f.findIndex(g=>g.shouldCallHandler()),0)),p=Ml(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:i}})}}}async function Nw(t,a,l,i,o){let{matches:u,...f}=t,m=u.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await pb(f,m,a,l,i,o)}async function pb(t,a,l,i,o,u,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,y,E=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await pb(t,a,l,i,o,u,f+1)},y.value}catch(w){return y={value:await u(w,g,y)},y.value}};try{let w=await x(t,E),S=w!=null?i(w):void 0;return o(S)?S:y?S??y.value:(y={value:await E()},y.value)}catch(w){return await u(w,g,y)}}function gb(t,a,l,i,o){let u=hb({key:"middleware",route:i.route,manifest:a,mapRouteProperties:t}),f=ww(i.route,oa(l.method)?"action":"loader",a,t,o);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Hh(t,a,l,i,o,u,f,m,p,g=null,x){let y=!1,E=gb(t,a,l,u,f);return{...u,_lazyPromises:E,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(w){return y=!0,g?typeof x=="boolean"?wo(u,{...g,defaultShouldRevalidate:x}):typeof w=="boolean"?wo(u,{...g,defaultShouldRevalidate:w}):wo(u,g):p},resolve(w){let{lazy:S,loader:D,middleware:R}=u.route,z=y||p||w&&!oa(l.method)&&(S||D),B=R&&R.length>0&&!D&&!S;return z&&(oa(l.method)||!B)?jw({request:l,path:i,pattern:o,match:u,lazyHandlerPromise:E==null?void 0:E.handler,lazyRoutePromise:E==null?void 0:E.route,handlerOverride:w,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function li(t,a,l,i,o,u,f,m,p=null){return o.map(g=>g.route.id!==u.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:gb(t,a,l,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Hh(t,a,l,i,Lo(o),g,f,m,!0,p))}async function Rw(t,a,l,i,o,u,f){i.some(x=>{var y;return(y=x._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(i.map(x=>{var y;return(y=x._lazyPromises)==null?void 0:y.middleware}));let m={request:a,url:vb(a,l),pattern:Lo(i),params:i[0].params,context:u,matches:i},g=await t({...m,fetcherKey:o,runClientMiddleware:x=>{let y=m;return mb(y,()=>x({...y,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(x=>{var y,E;return[(y=x._lazyPromises)==null?void 0:y.handler,(E=x._lazyPromises)==null?void 0:E.route]}))}catch{}return g}async function jw({request:t,path:a,pattern:l,match:i,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:f,scopedContext:m}){let p,g,x=oa(t.method),y=x?"action":"loader",E=w=>{let S,D=new Promise((B,I)=>S=I);g=()=>S(),t.signal.addEventListener("abort",g);let R=B=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${i.route.id}]`)):w({request:t,url:vb(t,a),pattern:l,params:i.params,context:m},...B!==void 0?[B]:[]),z=(async()=>{try{return{type:"data",result:await(f?f(I=>R(I)):R())}}catch(B){return{type:"error",result:B}}})();return Promise.race([z,D])};try{let w=x?i.route.action:i.route.loader;if(o||u)if(w){let S,[D]=await Promise.all([E(w).catch(R=>{S=R}),o,u]);if(S!==void 0)throw S;p=D}else{await o;let S=x?i.route.action:i.route.loader;if(S)[p]=await Promise.all([E(S),u]);else if(y==="action"){let D=new URL(t.url),R=D.pathname+D.search;throw Qa(405,{method:t.method,pathname:R,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(w)p=await E(w);else{let S=new URL(t.url),D=S.pathname+S.search;throw Qa(404,{pathname:D})}}catch(w){return{type:"error",result:w}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function Tw(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 Cw(t){var i,o,u,f,m;let{result:a,type:l}=t;if(am(a)){let p;try{p=await Tw(a)}catch(g){return{type:"error",error:g}}return l==="error"?{type:"error",error:new _o(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return l==="error"?Fy(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:(i=a.init)==null?void 0:i.status,headers:(o=a.init)!=null&&o.headers?new Headers(a.init.headers):void 0}:{type:"error",error:Mw(a),statusCode:ii(a)?a.status:void 0,headers:(u=a.init)!=null&&u.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:ii(a)?a.status:void 0}:Fy(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 Dw(t,a,l,i,o){let u=t.headers.get("Location");if(tt(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Wh(u)){let f=i.slice(0,i.findIndex(m=>m.route.id===l)+1);u=Bh(new URL(a.url),f,o,u),t.headers.set("Location",u)}return t}var Aw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function $h(t){try{return Aw.includes(new URL(t).protocol)}catch{return!1}}function $y(t,a,l,i){if(Wh(t)){let o=t,u=Jh.test(o)?new URL(Qx(o,a.protocol)):new URL(o);if($h(u.toString()))throw new Error("Invalid redirect location");let f=Wa(u.pathname,l)!=null;if(u.origin===a.origin&&f)return tm(u.pathname)+u.search+u.hash}try{let o=i.createURL(t);if($h(o.toString()))throw new Error("Invalid redirect location")}catch{}return t}function ni(t,a,l,i){let o=t.createURL(yb(a)).toString(),u={signal:l};if(i&&oa(i.formMethod)){let{formMethod:f,formEncType:m}=i;u.method=f.toUpperCase(),m==="application/json"?(u.headers=new Headers({"Content-Type":m}),u.body=JSON.stringify(i.json)):m==="text/plain"?u.body=i.text:m==="application/x-www-form-urlencoded"&&i.formData?u.body=qh(i.formData):u.body=i.formData}return new Request(o,u)}function vb(t,a){let l=new URL(t.url),i=typeof a=="string"?Cr(a):a;if(l.pathname=i.pathname||"/",i.search){let o=new URLSearchParams(i.search),u=o.getAll("index");o.delete("index");for(let f of u.filter(Boolean))o.append("index",f);l.search=o.size?`?${o.toString()}`:""}else l.search="";return l.hash=i.hash||"",l}function qh(t){let a=new URLSearchParams;for(let[l,i]of t.entries())a.append(l,typeof i=="string"?i:i.name);return a}function qy(t){let a=new FormData;for(let[l,i]of t.entries())a.append(l,i);return a}function kw(t,a,l,i=!1,o=!1){let u={},f=null,m,p=!1,g={},x=l&&La(l[1])?l[1].error:void 0;return t.forEach(y=>{if(!(y.route.id in a))return;let E=y.route.id,w=a[E];if(tt(!us(w),"Cannot handle redirect results in processLoaderData"),La(w)){let S=w.error;if(x!==void 0&&(S=x,x=void 0),f=f||{},o)f[E]=S;else{let D=Ml(t,E);f[D.route.id]==null&&(f[D.route.id]=S)}i||(u[E]=cb),p||(p=!0,m=ii(w.error)?w.error.status:500),w.headers&&(g[E]=w.headers)}else u[E]=w.data,w.statusCode&&w.statusCode!==200&&!p&&(m=w.statusCode),w.headers&&(g[E]=w.headers)}),x!==void 0&&l&&(f={[l[0]]:x},l[2]&&(u[l[2]]=void 0)),{loaderData:u,errors:f,statusCode:m||200,loaderHeaders:g}}function Iy(t,a,l,i,o,u,f){let{loaderData:m,errors:p}=kw(a,l,i);return o.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:y,controller:E}=g;if(E&&E.signal.aborted)return;let w=u[x];if(tt(w,"Did not find corresponding fetcher result"),La(w)){let S=Ml(t.matches,y==null?void 0:y.route.id);p&&p[S.route.id]||(p={...p,[S.route.id]:w.error}),f.delete(x)}else if(us(w))tt(!1,"Unhandled fetcher revalidation redirect");else{let S=Nr(w.data);f.set(x,S)}}),{loaderData:m,errors:p}}function Vy(t,a,l,i){let o=Object.entries(a).filter(([,u])=>u!==cb).reduce((u,[f,m])=>(u[f]=m,u),{});for(let u of l){let f=u.route.id;if(!a.hasOwnProperty(f)&&t.hasOwnProperty(f)&&u.route.loader&&(o[f]=t[f]),i&&i.hasOwnProperty(f))break}return o}function Yy(t){return t?La(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Ml(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 rc(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 Qa(t,{pathname:a,routeId:l,method:i,type:o,message:u}={}){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.`:o==="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 _o(t||500,f,new Error(m),!0)}function lc(t){let a=Object.entries(t);for(let l=a.length-1;l>=0;l--){let[i,o]=a[l];if(us(o))return{key:i,result:o}}}function yb(t){let a=typeof t=="string"?Cr(t):t;return Tr({...a,hash:""})}function Ow(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function Mw(t){var a,l;return new _o(((a=t.init)==null?void 0:a.status)??500,((l=t.init)==null?void 0:l.statusText)??"Internal Server Error",t.data)}function _w(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,l])=>typeof a=="string"&&Lw(l))}function Lw(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function zw(t){return am(t.result)&&ib.has(t.result.status)}function La(t){return t.type==="error"}function us(t){return(t&&t.type)==="redirect"}function Fy(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function am(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Uw(t){return ib.has(t)}function Bw(t){return am(t)&&Uw(t.status)&&t.headers.has("Location")}function Hw(t){return mw.has(t.toUpperCase())}function oa(t){return fw.has(t.toUpperCase())}function rm(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function vc(t,a){let l=typeof a=="string"?Cr(a).search:a.search;if(t[t.length-1].route.index&&rm(l||""))return t[t.length-1];let i=nb(t);return i[i.length-1]}function Py(t){let{formMethod:a,formAction:l,formEncType:i,text:o,formData:u,json:f}=t;if(!(!a||!l||!i)){if(o!=null)return{formMethod:a,formAction:l,formEncType:i,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:a,formAction:l,formEncType:i,formData:u,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 mh(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 $w(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 uo(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 qw(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 Nr(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 Iw(t,a){try{let l=t.sessionStorage.getItem(ub);if(l){let i=JSON.parse(l);for(let[o,u]of Object.entries(i||{}))u&&Array.isArray(u)&&a.set(o,new Set(u||[]))}}catch{}}function Vw(t,a){if(a.size>0){let l={};for(let[i,o]of a)l[i]=[...o];try{t.sessionStorage.setItem(ub,JSON.stringify(l))}catch(i){Sn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function Gy(){let t,a,l=new Promise((i,o)=>{t=async u=>{i(u);try{await l}catch{}},a=async u=>{o(u);try{await l}catch{}}});return{promise:l,resolve:t,reject:a}}var hs=v.createContext(null);hs.displayName="DataRouter";var ci=v.createContext(null);ci.displayName="DataRouterState";var xb=v.createContext(!1);function bb(){return v.useContext(xb)}var lm=v.createContext({isTransitioning:!1});lm.displayName="ViewTransition";var sm=v.createContext(new Map);sm.displayName="Fetchers";var Yw=v.createContext(null);Yw.displayName="Await";var er=v.createContext(null);er.displayName="Navigation";var Bc=v.createContext(null);Bc.displayName="Location";var tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var im=v.createContext(null);im.displayName="RouteError";var Sb="REACT_ROUTER_ERROR",Fw="REDIRECT",Pw="ROUTE_ERROR_RESPONSE";function Gw(t){if(t.startsWith(`${Sb}:${Fw}:{`))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 Xw(t){if(t.startsWith(`${Sb}:${Pw}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new _o(a.status,a.statusText,a.data)}catch{}}function Qw(t,{relative:a}={}){tt(zo(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:i}=v.useContext(er),{hash:o,pathname:u,search:f}=Uo(t,{relative:a}),m=u;return l!=="/"&&(m=u==="/"?l:Ja([l,u])),i.createHref({pathname:m,search:f,hash:o})}function zo(){return v.useContext(Bc)!=null}function fr(){return tt(zo(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Bc).location}var wb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Eb(t){v.useContext(er).static||v.useLayoutEffect(t)}function Dr(){let{isDataRoute:t}=v.useContext(tr);return t?uE():Kw()}function Kw(){tt(zo(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(hs),{basename:a,navigator:l}=v.useContext(er),{matches:i}=v.useContext(tr),{pathname:o}=fr(),u=JSON.stringify(em(i)),f=v.useRef(!1);return Eb(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(Sn(f.current,wb),!f.current)return;if(typeof p=="number"){l.go(p);return}let x=Uc(p,JSON.parse(u),o,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Ja([a,x.pathname])),(g.replace?l.replace:l.push)(x,g.state,g)},[a,l,u,o,t])}var Zw=v.createContext(null);function Jw(t){let a=v.useContext(tr).outlet;return v.useMemo(()=>a&&v.createElement(Zw.Provider,{value:t},a),[a,t])}function Ww(){let{matches:t}=v.useContext(tr),a=t[t.length-1];return(a==null?void 0:a.params)??{}}function Uo(t,{relative:a}={}){let{matches:l}=v.useContext(tr),{pathname:i}=fr(),o=JSON.stringify(em(l));return v.useMemo(()=>Uc(t,JSON.parse(o),i,a==="path"),[t,o,i,a])}function eE(t,a,l){tt(zo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(er),{matches:o}=v.useContext(tr),u=o[o.length-1],f=u?u.params:{},m=u?u.pathname:"/",p=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";Tb(m,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=fr(),y;y=x;let E=y.pathname||"/",w=E;if(p!=="/"){let R=p.replace(/^\//,"").split("/");w="/"+E.replace(/^\//,"").split("/").slice(R.length).join("/")}let S=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):Zx(t,{pathname:w});return Sn(g||S!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Sn(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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.`),lE(S&&S.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ja([p,i.encodeLocation?i.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:Ja([p,i.encodeLocation?i.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,l)}function tE(){let t=jb(),a=ii(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)",o={padding:"0.5rem",backgroundColor:i},u={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:u},"ErrorBoundary")," or"," ",v.createElement("code",{style:u},"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:o},l):null,f)}var nE=v.createElement(tE,null),Nb=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=Xw(t.digest);l&&(t=l)}let a=t!==void 0?v.createElement(tr.Provider,{value:this.props.routeContext},v.createElement(im.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(aE,{error:t},a):a}};Nb.contextType=xb;var ph=new WeakMap;function aE({children:t,error:a}){let{basename:l}=v.useContext(er);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let i=Gw(a.digest);if(i){let o=ph.get(a);if(o)throw o;let u=rb(i.location,l),f=u.absoluteURL||u.to;if($h(f))throw new Error("Invalid redirect location");if(ab&&!ph.get(a))if(u.isExternal||i.reloadDocument)window.location.href=f;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw ph.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function rE({routeContext:t,match:a,children:l}){let i=v.useContext(hs);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(tr.Provider,{value:t},l)}function lE(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 o=t,u=i==null?void 0:i.errors;if(u!=null){let x=o.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);tt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let f=!1,m=-1;if(l&&i){f=i.renderFallback;for(let x=0;x<o.length;x++){let y=o[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=x),y.route.id){let{loaderData:E,errors:w}=i,S=y.route.loader&&!E.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||S){l.isStatic&&(f=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let p=l==null?void 0:l.onError,g=i&&p?(x,y)=>{var E,w;p(x,{location:i.location,params:((w=(E=i.matches)==null?void 0:E[0])==null?void 0:w.params)??{},pattern:Lo(i.matches),errorInfo:y})}:void 0;return o.reduceRight((x,y,E)=>{let w,S=!1,D=null,R=null;i&&(w=u&&y.route.id?u[y.route.id]:void 0,D=y.route.errorElement||nE,f&&(m<0&&E===0?(Tb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,R=null):m===E&&(S=!0,R=y.route.hydrateFallbackElement||null)));let z=a.concat(o.slice(0,E+1)),B=()=>{let I;return w?I=D:S?I=R:y.route.Component?I=v.createElement(y.route.Component,null):y.route.element?I=y.route.element:I=x,v.createElement(rE,{match:y,routeContext:{outlet:x,matches:z,isDataRoute:i!=null},children:I})};return i&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?v.createElement(Nb,{location:i.location,revalidation:i.revalidation,component:D,error:w,children:B(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:g}):B()},null)}function om(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rb(t){let a=v.useContext(hs);return tt(a,om(t)),a}function Bo(t){let a=v.useContext(ci);return tt(a,om(t)),a}function sE(t){let a=v.useContext(tr);return tt(a,om(t)),a}function Hc(t){let a=sE(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 iE(){return Hc("useRouteId")}function Ar(){let t=Bo("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:l,...i}=t.navigation;return i},[t.navigation])}function oE(){let t=Rb("useRevalidator"),a=Bo("useRevalidator"),l=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:l,state:a.revalidation}),[l,a.revalidation])}function zl(){let t=Bo("useLoaderData"),a=Hc("useLoaderData");return t.loaderData[a]}function ms(t){return Bo("useRouteLoaderData").loaderData[t]}function jb(){var i;let t=v.useContext(im),a=Bo("useRouteError"),l=Hc("useRouteError");return t!==void 0?t:(i=a.errors)==null?void 0:i[l]}function uE(){let{router:t}=Rb("useNavigate"),a=Hc("useNavigate"),l=v.useRef(!1);return Eb(()=>{l.current=!0}),v.useCallback(async(o,u={})=>{Sn(l.current,wb),l.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:a,...u}))},[t,a])}var Xy={};function Tb(t,a,l){!a&&!Xy[t]&&(Xy[t]=!0,Sn(!1,l))}var Qy={};function Ky(t,a){!t&&!Qy[a]&&(Qy[a]=!0,console.warn(a))}var cE="useOptimistic",Zy=TS[cE],dE=()=>{};function fE(t){return Zy?Zy(t):[t,dE]}function hE(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 mE=["HydrateFallback","hydrateFallbackElement"],pE=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 gE({router:t,flushSync:a,onError:l,useTransitions:i}){i=bb()||i;let[u,f]=v.useState(t.state),[m,p]=fE(u),[g,x]=v.useState(),[y,E]=v.useState({isTransitioning:!1}),[w,S]=v.useState(),[D,R]=v.useState(),[z,B]=v.useState(),I=v.useRef(new Map),X=v.useCallback((T,{deletedFetchers:ce,newErrors:he,flushSync:we,viewTransitionOpts:Ee})=>{he&&l&&Object.values(he).forEach(pe=>{var Re;return l(pe,{location:T.location,params:((Re=T.matches[0])==null?void 0:Re.params)??{},pattern:Lo(T.matches)})}),T.fetchers.forEach((pe,Re)=>{pe.data!==void 0&&I.current.set(Re,pe.data)}),ce.forEach(pe=>I.current.delete(pe)),Ky(we===!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 ne=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(Ky(Ee==null||ne,"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."),!Ee||!ne){a&&we?a(()=>f(T)):i===!1?f(T):v.startTransition(()=>{i===!0&&p(pe=>Jy(pe,T)),f(T)});return}if(a&&we){a(()=>{D&&(w==null||w.resolve(),D.skipTransition()),E({isTransitioning:!0,flushSync:!0,currentLocation:Ee.currentLocation,nextLocation:Ee.nextLocation})});let pe=t.window.document.startViewTransition(()=>{a(()=>f(T))});pe.finished.finally(()=>{a(()=>{S(void 0),R(void 0),x(void 0),E({isTransitioning:!1})})}),a(()=>R(pe));return}D?(w==null||w.resolve(),D.skipTransition(),B({state:T,currentLocation:Ee.currentLocation,nextLocation:Ee.nextLocation})):(x(T),E({isTransitioning:!0,flushSync:!1,currentLocation:Ee.currentLocation,nextLocation:Ee.nextLocation}))},[t.window,a,D,w,i,p,l]);v.useLayoutEffect(()=>t.subscribe(X),[t,X]),v.useEffect(()=>{y.isTransitioning&&!y.flushSync&&S(new pE)},[y]),v.useEffect(()=>{if(w&&g&&t.window){let T=g,ce=w.promise,he=t.window.document.startViewTransition(async()=>{i===!1?f(T):v.startTransition(()=>{i===!0&&p(we=>Jy(we,T)),f(T)}),await ce});he.finished.finally(()=>{S(void 0),R(void 0),x(void 0),E({isTransitioning:!1})}),R(he)}},[g,w,t.window,i,p]),v.useEffect(()=>{w&&g&&m.location.key===g.location.key&&w.resolve()},[w,D,m.location,g]),v.useEffect(()=>{!y.isTransitioning&&z&&(x(z.state),E({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}),B(void 0))},[y.isTransitioning,z]);let W=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:T=>t.navigate(T),push:(T,ce,he)=>t.navigate(T,{state:ce,preventScrollReset:he==null?void 0:he.preventScrollReset}),replace:(T,ce,he)=>t.navigate(T,{replace:!0,state:ce,preventScrollReset:he==null?void 0:he.preventScrollReset})}),[t]),ee=t.basename||"/",M=v.useMemo(()=>({router:t,navigator:W,static:!1,basename:ee,onError:l}),[t,W,ee,l]);return v.createElement(v.Fragment,null,v.createElement(hs.Provider,{value:M},v.createElement(ci.Provider,{value:m},v.createElement(sm.Provider,{value:I.current},v.createElement(lm.Provider,{value:y},v.createElement(xE,{basename:ee,location:m.location,navigationType:m.historyAction,navigator:W,useTransitions:i},v.createElement(vE,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:l})))))),null)}function Jy(t,a){return{...t,navigation:a.navigation.state!=="idle"?a.navigation:t.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:t.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:t.actionData,fetchers:a.fetchers}}var vE=v.memo(yE);function yE({routes:t,manifest:a,future:l,state:i,isStatic:o,onError:u}){return eE(t,void 0,{manifest:a,state:i,isStatic:o,onError:u})}function di(t){return Jw(t.context)}function xE({basename:t="/",children:a=null,location:l,navigationType:i="POP",navigator:o,static:u=!1,useTransitions:f}){tt(!zo(),"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:o,static:u,useTransitions:f,future:{}}),[m,o,u,f]);typeof l=="string"&&(l=Cr(l));let{pathname:g="/",search:x="",hash:y="",state:E=null,key:w="default",mask:S}=l,D=v.useMemo(()=>{let R=Wa(g,m);return R==null?null:{location:{pathname:R,search:x,hash:y,state:E,key:w,mask:S},navigationType:i}},[m,g,x,y,E,w,i,S]);return Sn(D!=null,`<Router basename="${m}"> is not able to match the URL "${g}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),D==null?null:v.createElement(er.Provider,{value:p},v.createElement(Bc.Provider,{children:a,value:D}))}var yc="get",xc="application/x-www-form-urlencoded";function $c(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function bE(t){return $c(t)&&t.tagName.toLowerCase()==="button"}function SE(t){return $c(t)&&t.tagName.toLowerCase()==="form"}function wE(t){return $c(t)&&t.tagName.toLowerCase()==="input"}function EE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function NE(t,a){return t.button===0&&(!a||a==="_self")&&!EE(t)}function Ih(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(o=>[l,o]):[[l,i]])},[]))}function RE(t,a){let l=Ih(t);return a&&a.forEach((i,o)=>{l.has(o)||a.getAll(o).forEach(u=>{l.append(o,u)})}),l}var sc=null;function jE(){if(sc===null)try{new FormData(document.createElement("form"),0),sc=!1}catch{sc=!0}return sc}var TE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gh(t){return t!=null&&!TE.has(t)?(Sn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xc}"`),null):t}function CE(t,a){let l,i,o,u,f;if(SE(t)){let m=t.getAttribute("action");i=m?Wa(m,a):null,l=t.getAttribute("method")||yc,o=gh(t.getAttribute("enctype"))||xc,u=new FormData(t)}else if(bE(t)||wE(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?Wa(p,a):null,l=t.getAttribute("formmethod")||m.getAttribute("method")||yc,o=gh(t.getAttribute("formenctype"))||gh(m.getAttribute("enctype"))||xc,u=new FormData(m,t),!jE()){let{name:g,type:x,value:y}=t;if(x==="image"){let E=g?`${g}.`:"";u.append(`${E}x`,"0"),u.append(`${E}y`,"0")}else g&&u.append(g,y)}}else{if($c(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=yc,i=null,o=xc,f=t}return u&&o==="text/plain"&&(f=u,u=void 0),{action:i,method:l.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function um(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Cb(t,a,l,i){let o=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return l?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:a&&Wa(o.pathname,a)==="/"?o.pathname=`${Rc(a)}/_root.${i}`:o.pathname=`${Rc(o.pathname)}.${i}`,o}async function DE(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 AE(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 kE(t,a,l){let i=await Promise.all(t.map(async o=>{let u=a.routes[o.route.id];if(u){let f=await DE(u,l);return f.links?f.links():[]}return[]}));return LE(i.flat(1).filter(AE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Wy(t,a,l,i,o,u){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 u==="assets"?a.filter((p,g)=>f(p,g)||m(p,g)):u==="data"?a.filter((p,g)=>{var y;let x=i.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(f(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function OE(t,a,{includeHydrateFallback:l}={}){return ME(t.map(i=>{let o=a.routes[i.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),l&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function ME(t){return[...new Set(t)]}function _E(t){let a={},l=Object.keys(t).sort();for(let i of l)a[i]=t[i];return a}function LE(t,a){let l=new Set;return new Set(a),t.reduce((i,o)=>{let u=JSON.stringify(_E(o));return l.has(u)||(l.add(u),i.push({key:u,link:o})),i},[])}function cm(){let t=v.useContext(hs);return um(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function zE(){let t=v.useContext(ci);return um(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var dm=v.createContext(void 0);dm.displayName="FrameworkContext";function qc(){let t=v.useContext(dm);return um(t,"You must render this element inside a <HydratedRouter> element"),t}function UE(t,a){let l=v.useContext(dm),[i,o]=v.useState(!1),[u,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:y}=a,E=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let D=z=>{z.forEach(B=>{f(B.isIntersecting)})},R=new IntersectionObserver(D,{threshold:.5});return E.current&&R.observe(E.current),()=>{R.disconnect()}}},[t]),v.useEffect(()=>{if(i){let D=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(D)}}},[i]);let w=()=>{o(!0)},S=()=>{o(!1),f(!1)};return l?t!=="intent"?[u,E,{}]:[u,E,{onFocus:co(m,w),onBlur:co(p,S),onMouseEnter:co(g,w),onMouseLeave:co(x,S),onTouchStart:co(y,w)}]:[!1,E,{}]}function co(t,a){return l=>{t&&t(l),l.defaultPrevented||a(l)}}function BE({page:t,...a}){let l=bb(),{nonce:i}=qc(),{router:o}=cm(),u=v.useMemo(()=>Zx(o.routes,t,o.basename),[o.routes,t,o.basename]);return u?(a.nonce==null&&i&&(a={...a,nonce:i}),l?v.createElement($E,{page:t,matches:u,...a}):v.createElement(qE,{page:t,matches:u,...a})):null}function HE(t){let{manifest:a,routeModules:l}=qc(),[i,o]=v.useState([]);return v.useEffect(()=>{let u=!1;return kE(t,a,l).then(f=>{u||o(f)}),()=>{u=!0}},[t,a,l]),i}function $E({page:t,matches:a,...l}){let i=fr(),{future:o}=qc(),{basename:u}=cm(),f=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let m=Cb(t,u,o.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]},[u,o.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 qE({page:t,matches:a,...l}){let i=fr(),{future:o,manifest:u,routeModules:f}=qc(),{basename:m}=cm(),{loaderData:p,matches:g}=zE(),x=v.useMemo(()=>Wy(t,a,g,u,i,"data"),[t,a,g,u,i]),y=v.useMemo(()=>Wy(t,a,g,u,i,"assets"),[t,a,g,u,i]),E=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let D=new Set,R=!1;if(a.forEach(B=>{var X;let I=u.routes[B.route.id];!I||!I.hasLoader||(!x.some(W=>W.route.id===B.route.id)&&B.route.id in p&&((X=f[B.route.id])!=null&&X.shouldRevalidate)||I.hasClientLoader?R=!0:D.add(B.route.id))}),D.size===0)return[];let z=Cb(t,m,o.v8_trailingSlashAwareDataRequests,"data");return R&&D.size>0&&z.searchParams.set("_routes",a.filter(B=>D.has(B.route.id)).map(B=>B.route.id).join(",")),[z.pathname+z.search]},[m,o.v8_trailingSlashAwareDataRequests,p,i,u,x,a,t,f]),w=v.useMemo(()=>OE(y,u),[y,u]),S=HE(y);return v.createElement(v.Fragment,null,E.map(D=>v.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...l})),w.map(D=>v.createElement("link",{key:D,rel:"modulepreload",href:D,...l})),S.map(({key:D,link:R})=>v.createElement("link",{key:D,nonce:l.nonce,...R,crossOrigin:R.crossOrigin??l.crossOrigin})))}function IE(...t){return a=>{t.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var VE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{VE&&(window.__reactRouterVersion="7.18.0")}catch{}function YE(t,a){return yw({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:_S({window:a==null?void 0:a.window}),hydrationData:FE(),routes:t,mapRouteProperties:hE,hydrationRouteProperties:mE,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 FE(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:PE(t.errors)}),t}function PE(t){if(!t)return null;let a=Object.entries(t),l={};for(let[i,o]of a)if(o&&o.__type==="RouteErrorResponse")l[i]=new _o(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&lw.includes(o.__subType)){let u=window[o.__subType];if(typeof u=="function")try{let f=new u(o.message);f.stack="",l[i]=f}catch{}}if(l[i]==null){let u=new Error(o.message);u.stack="",l[i]=u}}else l[i]=o;return l}var Qe=v.forwardRef(function({onClick:a,discover:l="render",prefetch:i="none",relative:o,reloadDocument:u,replace:f,mask:m,state:p,target:g,to:x,preventScrollReset:y,viewTransition:E,defaultShouldRevalidate:w,...S},D){let{basename:R,navigator:z,useTransitions:B}=v.useContext(er),I=typeof x=="string"&&zc.test(x),X=rb(x,R);x=X.to;let W=Qw(x,{relative:o}),ee=fr(),M=null;if(m){let Re=Uc(m,[],ee.mask?ee.mask.pathname:"/",!0);R!=="/"&&(Re.pathname=Re.pathname==="/"?R:Ja([R,Re.pathname])),M=z.createHref(Re)}let[T,ce,he]=UE(i,S),we=XE(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:y,relative:o,viewTransition:E,defaultShouldRevalidate:w,useTransitions:B});function Ee(Re){a&&a(Re),Re.defaultPrevented||we(Re)}let ne=!(X.isExternal||u),pe=v.createElement("a",{...S,...he,href:(ne?M:void 0)||X.absoluteURL||W,onClick:ne?Ee:a,ref:IE(D,ce),target:g,"data-discover":!I&&l==="render"?"true":void 0});return T&&!I?v.createElement(v.Fragment,null,pe,v.createElement(BE,{page:W})):pe});Qe.displayName="Link";var Db=v.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:i="",end:o=!1,style:u,to:f,viewTransition:m,children:p,...g},x){let y=Uo(f,{relative:g.relative}),E=fr(),w=v.useContext(ci),{navigator:S,basename:D}=v.useContext(er),R=w!=null&&JE(y)&&m===!0,z=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,B=E.pathname,I=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(B=B.toLowerCase(),I=I?I.toLowerCase():null,z=z.toLowerCase()),I&&D&&(I=Wa(I,D)||I);const X=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let W=B===z||!o&&B.startsWith(z)&&B.charAt(X)==="/",ee=I!=null&&(I===z||!o&&I.startsWith(z)&&I.charAt(z.length)==="/"),M={isActive:W,isPending:ee,isTransitioning:R},T=W?a:void 0,ce;typeof i=="function"?ce=i(M):ce=[i,W?"active":null,ee?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let he=typeof u=="function"?u(M):u;return v.createElement(Qe,{...g,"aria-current":T,className:ce,ref:x,style:he,to:f,viewTransition:m},typeof p=="function"?p(M):p)});Db.displayName="NavLink";var ua=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:l,reloadDocument:i,replace:o,state:u,method:f=yc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:E,...w},S)=>{let{useTransitions:D}=v.useContext(er),R=hm(),z=ZE(m,{relative:g}),B=f.toLowerCase()==="get"?"get":"post",I=typeof m=="string"&&zc.test(m),X=W=>{if(p&&p(W),W.defaultPrevented)return;W.preventDefault();let ee=W.nativeEvent.submitter,M=(ee==null?void 0:ee.getAttribute("formmethod"))||f,T=()=>R(ee||W.currentTarget,{fetcherKey:a,method:M,navigate:l,replace:o,state:u,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:E});D&&l!==!1?v.startTransition(()=>T()):T()};return v.createElement("form",{ref:S,method:B,action:z,onSubmit:i?p:X,...w,"data-discover":!I&&t==="render"?"true":void 0})});ua.displayName="Form";function Ab(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fm(t){let a=v.useContext(hs);return tt(a,Ab(t)),a}function GE(t){let a=v.useContext(ci);return tt(a,Ab(t)),a}function XE(t,{target:a,replace:l,mask:i,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=Dr(),y=fr(),E=Uo(t,{relative:f});return v.useCallback(w=>{if(NE(w,a)){w.preventDefault();let S=l!==void 0?l:Tr(y)===Tr(E),D=()=>x(t,{replace:S,mask:i,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>D()):D()}},[y,x,E,l,i,o,a,t,u,f,m,p,g])}function Ho(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(Ih(t)),l=v.useRef(!1),i=fr(),o=v.useMemo(()=>RE(i.search,l.current?null:a.current),[i.search]),u=Dr(),f=v.useCallback((m,p)=>{const g=Ih(typeof m=="function"?m(new URLSearchParams(o)):m);l.current=!0,u("?"+g,p)},[u,o]);return[o,f]}var QE=0,KE=()=>`__${String(++QE)}__`;function hm(){let{router:t}=fm("useSubmit"),{basename:a}=v.useContext(er),l=iE(),i=t.fetch,o=t.navigate;return v.useCallback(async(u,f={})=>{let{action:m,method:p,encType:g,formData:x,body:y}=CE(u,a);if(f.navigate===!1){let E=f.fetcherKey||KE();await i(E,l,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await o(f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[i,o,a,l])}function ZE(t,{relative:a}={}){let{basename:l}=v.useContext(er),i=v.useContext(tr);tt(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),u={...Uo(t||".",{relative:a})},f=fr();if(t==null){u.search=f.search;let m=new URLSearchParams(u.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(y=>y).forEach(y=>m.append("index",y));let x=m.toString();u.search=x?`?${x}`:""}}return(!t||t===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Ja([l,u.pathname])),Tr(u)}function ds({key:t}={}){var W;let{router:a}=fm("useFetcher"),l=GE("useFetcher"),i=v.useContext(sm),o=v.useContext(tr),u=(W=o.matches[o.matches.length-1])==null?void 0:W.route.id;tt(i,"useFetcher must be used inside a FetchersContext"),tt(o,"useFetcher must be used inside a RouteContext"),tt(u!=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:y,fetch:E}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let w=v.useCallback(async(ee,M)=>{tt(u,"No routeId available for fetcher.load()"),await E(m,u,ee,M)},[m,u,E]),S=hm(),D=v.useCallback(async(ee,M)=>{await S(ee,{...M,navigate:!1,fetcherKey:m})},[m,S]),R=v.useCallback(ee=>y(m,ee),[y,m]),z=v.useMemo(()=>{let ee=v.forwardRef((M,T)=>v.createElement(ua,{...M,navigate:!1,fetcherKey:m,ref:T}));return ee.displayName="fetcher.Form",ee},[m]),B=l.fetchers.get(m)||ob,I=i.get(m);return v.useMemo(()=>({Form:z,submit:D,load:w,reset:R,...B,data:I}),[z,D,w,R,B,I])}function JE(t,{relative:a}={}){let l=v.useContext(lm);tt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=fm("useViewTransitionState"),o=Uo(t,{relative:a});if(!l.isTransitioning)return!1;let u=Wa(l.currentLocation.pathname,i)||l.currentLocation.pathname,f=Wa(l.nextLocation.pathname,i)||l.nextLocation.pathname;return Nc(o.pathname,f)!=null||Nc(o.pathname,u)!=null}var nl=Px();function WE(t){return v.createElement(gE,{flushSync:nl.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 kb=(...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 eN=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 tN=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 ex=t=>{const a=tN(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 vh={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 nN=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},aN=v.createContext({}),rN=()=>v.useContext(aN),lN=v.forwardRef(({color:t,size:a,strokeWidth:l,absoluteStrokeWidth:i,className:o="",children:u,iconNode:f,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:y=!1,color:E="currentColor",className:w=""}=rN()??{},S=i??y?Number(l??x)*24/Number(a??g):l??x;return v.createElement("svg",{ref:p,...vh,width:a??g??vh.width,height:a??g??vh.height,stroke:t??E,strokeWidth:S,className:kb("lucide",w,o),...!u&&!nN(m)&&{"aria-hidden":"true"},...m},[...f.map(([D,R])=>v.createElement(D,R)),...Array.isArray(u)?u:[u]])});/**
|
|
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 St=(t,a)=>{const l=v.forwardRef(({className:i,...o},u)=>v.createElement(lN,{ref:u,iconNode:a,className:kb(`lucide-${eN(ex(t))}`,`lucide-${t}`,i),...o}));return l.displayName=ex(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 sN=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],iN=St("arrow-down-wide-narrow",sN);/**
|
|
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 oN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ic=St("arrow-left",oN);/**
|
|
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 uN=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],cN=St("arrow-up-narrow-wide",uN);/**
|
|
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 dN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Ob=St("ban",dN);/**
|
|
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 fN=[["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"}]],hN=St("chart-column",fN);/**
|
|
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 mN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mb=St("check",mN);/**
|
|
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 pN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ps=St("chevron-down",pN);/**
|
|
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 gN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_b=St("chevron-right",gN);/**
|
|
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 vN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],yN=St("circle-check-big",vN);/**
|
|
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 xN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mm=St("circle-check",xN);/**
|
|
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 bN=[["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"}]],SN=St("circle-dashed",bN);/**
|
|
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 wN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],EN=St("circle-minus",wN);/**
|
|
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 NN=[["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"}]],Lb=St("circle-pause",NN);/**
|
|
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 RN=[["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"}]],zb=St("circle-play",RN);/**
|
|
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 jN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],TN=St("circle-x",jN);/**
|
|
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 CN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Vc=St("circle",CN);/**
|
|
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 DN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],AN=St("clock",DN);/**
|
|
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 kN=[["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"}]],Ub=St("copy",kN);/**
|
|
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 ON=[["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"}]],MN=St("download",ON);/**
|
|
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 _N=[["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"}]],LN=St("git-branch",_N);/**
|
|
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 zN=[["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"}]],UN=St("grip-vertical",zN);/**
|
|
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 BN=[["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"}]],HN=St("house",BN);/**
|
|
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 $N=[["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"}]],jc=St("layers",$N);/**
|
|
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 qN=[["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"}]],Yc=St("list-todo",qN);/**
|
|
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 IN=[["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"}]],VN=St("locate-fixed",IN);/**
|
|
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 YN=[["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"}]],FN=St("moon",YN);/**
|
|
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 PN=[["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"}]],Bb=St("octagon-alert",PN);/**
|
|
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 GN=[["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"}]],fs=St("pencil",GN);/**
|
|
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 XN=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],QN=St("play",XN);/**
|
|
242
|
-
* @license lucide-react v1.21.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const KN=[["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"}]],Hb=St("scroll-text",KN);/**
|
|
247
|
-
* @license lucide-react v1.21.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const ZN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],JN=St("search",ZN);/**
|
|
252
|
-
* @license lucide-react v1.21.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const WN=[["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"}]],eR=St("sun",WN);/**
|
|
257
|
-
* @license lucide-react v1.21.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const tR=[["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"}]],nR=St("timer-reset",tR);/**
|
|
262
|
-
* @license lucide-react v1.21.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const aR=[["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"}]],oi=St("trash-2",aR);/**
|
|
267
|
-
* @license lucide-react v1.21.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const rR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lR=St("x",rR),sR="/api",iR=120,oR=40;function Fc(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 Pc(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(Fc),linkedRequirements:t.linkedRequirements??[],handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??""}}function Gc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[]}}function $b(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)??[]}}}function pm(t){return{...t,description:t.description??"",macroTasks:t.macroTasks??[],linkedPhaseIds:t.linkedPhaseIds??[]}}async function tx(t,a){try{return await fetch(`${sR}${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 Jt(t,a){let l=await tx(t,a),i=0;for(;l.status===503&&i<oR;)await new Promise(o=>setTimeout(o,iR)),i+=1,l=await tx(t,a);if(!l.ok){const o=await l.text().catch(()=>l.statusText);throw new Response(o||l.statusText,{status:l.status,statusText:l.statusText})}return l.json()}async function qb(){return $b(await Jt("/project"))}async function uR(t){return $b(await Jt("/project",{method:"PUT",body:JSON.stringify(t)}))}async function cR(){return Jt("/ui-config")}async function Ib(){return(await Jt("/features")).map(Gc)}async function $o(t){return Gc(await Jt(`/features/${t}`))}async function dR(t){return Gc(await Jt("/features",{method:"POST",body:JSON.stringify(t)}))}async function Vb(t){return Gc(await Jt(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function fR(t){return Jt(`/features/${t}`,{method:"DELETE"})}async function gm(){return(await Jt("/requirements")).requirements.map(pm)}async function hR(t){const a=new Date().toISOString();return pm(await Jt("/requirements",{method:"POST",body:JSON.stringify({...t,macroTasks:[],createdAt:a,updatedAt:a})}))}async function mR(t){return pm(await Jt(`/requirements/${t.id}`,{method:"PUT",body:JSON.stringify({...t,updatedAt:new Date().toISOString()})}))}async function pR(t){return Jt(`/requirements/${t}`,{method:"DELETE"})}async function Xc(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await Jt(`/phases${a}`)).map(Pc)}async function Qc(t){return Pc(await Jt(`/phases/${t}`))}async function gR(t){return Pc(await Jt("/phases",{method:"POST",body:JSON.stringify(t)}))}async function Yb(t){return Pc(await Jt(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function vR(t){return Jt(`/phases/${t}`,{method:"DELETE"})}async function yR(t,a){return Fc(await Jt(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function Kc(t){return Fc(await Jt(`/tasks/${t}`))}async function vm(t){return Fc(await Jt(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function xR(t){return Jt(`/tasks/${t}`,{method:"DELETE"})}async function Fb(){return Jt("/tasks/active")}async function Vh(){return(await Jt("/handoffs")).handoffs??[]}async function Pb(t){return Jt(`/phases/${t}/handoff`,{method:"DELETE"})}async function bR(t=!1){return Jt(`/export?full=${t?"true":"false"}`)}async function SR(){return Jt("/repair",{method:"POST"})}async function yh(t,a,l,i){return Jt("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:a,beforeId:l,afterId:i})})}function wR(){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 ER({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 c.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:[c.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${a.dotClassName}`}),c.jsx("span",{className:"hidden sm:inline",children:a.label})]})}function NR({projectName:t,projectRoot:a,planRoot:l,liveStatus:i}){const{theme:o,toggleTheme:u}=wR(),[f,m]=v.useState(!1),[p,g]=v.useState(!1),[x,y]=v.useState(null),E=[{to:"/",label:"Dashboard",icon:HN},{to:"/features",label:"Features",icon:jc},{to:"/requirements",label:"Requirements",icon:Yc},{to:"/handoff",label:"Handoff",icon:Hb}];async function w(S){y(S?"full":"summary");try{const R=await bR(S),z=new Blob([R.markdown],{type:"text/markdown;charset=utf-8"}),B=URL.createObjectURL(z),I=document.createElement("a");I.href=B,I.download=S?"EXPORT-full.md":R.filePath||"EXPORT.md",document.body.appendChild(I),I.click(),I.remove(),URL.revokeObjectURL(B),g(!1)}catch(R){window.alert(`Export failed: ${R instanceof Error?R.message:String(R)}`)}finally{y(null)}}return c.jsx("div",{className:"relative z-20 overflow-visible border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:c.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:[c.jsxs(Qe,{to:"/",className:"flex min-w-0 items-center gap-3",children:[c.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:c.jsx(jc,{className:"h-4 w-4"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("div",{className:"truncate text-sm font-black tracking-tight",children:t??"Agent Plan"})}),a?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"truncate text-[11px] text-[var(--text-subtle)]",title:a,children:a}),c.jsx("button",{type:"button",onClick:async S=>{S.preventDefault(),S.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?c.jsx(Mb,{className:"h-3.5 w-3.5"}):c.jsx(Ub,{className:"h-3.5 w-3.5"})})]}):null]})]}),c.jsxs("div",{className:"flex items-center justify-end gap-2 sm:gap-3",children:[c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(ER,{liveStatus:i})}),c.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:E.map(S=>c.jsxs(Db,{to:S.to,end:S.to==="/",className:({isActive:D})=>`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 ${D?"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:[c.jsx(S.icon,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:S.label})]},S.to))}),c.jsxs("div",{className:"relative z-30",children:[c.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":p,onClick:()=>g(S=>!S),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:[c.jsx(MN,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"}),c.jsx(ps,{className:`h-4 w-4 transition-transform ${p?"rotate-180":""}`})]}),p?c.jsxs("div",{role:"menu",onKeyDown:S=>{var B;const D=Array.from(S.currentTarget.querySelectorAll("[role=menuitem]")).filter(I=>!I.hasAttribute("disabled"));if(D.length===0)return;const R=D.indexOf(document.activeElement);let z=R;if(S.key==="ArrowDown")z=R===-1?0:(R+1)%D.length;else if(S.key==="ArrowUp")z=R===-1?D.length-1:(R-1+D.length)%D.length;else if(S.key==="Home")z=0;else if(S.key==="End")z=D.length-1;else return;S.preventDefault(),(B=D[z])==null||B.focus()},className:"absolute right-0 top-full z-[200] mt-2 min-w-44 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[c.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void w(!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"?c.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),c.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void w(!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"?c.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]}),c.jsx("button",{type:"button",onClick:u,"aria-label":o==="dark"?"Switch to light theme":"Switch to dark theme",title:o==="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:o==="dark"?c.jsx(eR,{className:"h-4 w-4"}):c.jsx(FN,{className:"h-4 w-4"})})]})]})})}function nx(t,a,l){t.split(`
|
|
272
|
-
`).forEach((o,u)=>{u>0&&a.push(c.jsx("br",{},`${l}-br-${u}`)),o&&a.push(o)})}function fo(t,a){const l=[],i=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let o=0,u=null,f=0;for(;(u=i.exec(t))!==null;)u.index>o&&nx(t.slice(o,u.index),l,`${a}-${f}`),u[2]&&u[3]?l.push(c.jsx("a",{href:u[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:u[2]},`${a}-link-${f}`)):u[4]?l.push(c.jsx("strong",{className:"font-semibold text-[var(--text)]",children:u[4]},`${a}-strong-${f}`)):u[5]?l.push(c.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:u[5]},`${a}-code-${f}`)):u[6]&&l.push(c.jsx("em",{className:"italic",children:u[6]},`${a}-em-${f}`)),o=i.lastIndex,f+=1;return o<t.length&&nx(t.slice(o),l,`${a}-tail`),l}function RR(t,a){var o;const l=t.split(`
|
|
273
|
-
`);if(t.startsWith("```")){const u=t.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return c.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:c.jsx("code",{children:u})},`code-${a}`)}const i=t.match(/^(#{1,6})\s+(.+)$/);if(i&&i[2]){const u=((o=i[1])==null?void 0:o.length)??1,f=i[2],m=u<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return c.jsx("p",{className:m,children:fo(f,`h-${a}`)},`h-${a}`)}return l.every(u=>/^\s*>\s?/.test(u))?c.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:l.map((u,f)=>c.jsx("div",{children:fo(u.replace(/^\s*>\s?/,""),`bq-${a}-${f}`)},`bq-${a}-${f}`))},`bq-${a}`):/^\s*([-*_])\1{2,}\s*$/.test(t.trim())?c.jsx("hr",{className:"border-[var(--border)]"},`hr-${a}`):l.every(u=>/^\s*[-*]\s+/.test(u))?c.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map((u,f)=>c.jsx("li",{className:"list-disc",children:fo(u.replace(/^\s*[-*]\s+/,""),`ul-${a}-${f}`)},`ul-${a}-${f}`))},`ul-${a}`):l.every(u=>/^\s*\d+\.\s+/.test(u))?c.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:l.map((u,f)=>c.jsx("li",{children:fo(u.replace(/^\s*\d+\.\s+/,""),`ol-${a}-${f}`)},`ol-${a}-${f}`))},`ol-${a}`):c.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:fo(t,`p-${a}`)},`p-${a}`)}function kn({text:t,className:a=""}){if(!(t!=null&&t.trim()))return null;const l=t.trim().split(/\n\s*\n/).filter(Boolean);return c.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${a}`,children:l.map((i,o)=>RR(i,o))})}const ax={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 jr(t){return String(t&&t>0?t:0).padStart(3,"0")}function fi({featureNum:t,phaseNum:a,taskNum:l}){const i=[];return t!==void 0&&i.push(`F${jr(t)}`),a!==void 0&&i.push(`P${jr(a)}`),l!==void 0&&i.push(`T${jr(l)}`),i.join("/")}async function jR(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 hi({type:t,number:a}){const l=ax[t]||ax.task,i=(l==null?void 0:l.soft)||"transparent",o=(l==null?void 0:l.strong)||"inherit";return c.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:o},children:[t?t.charAt(0).toUpperCase():"?",jr(a)]})}function ui({type:t,phaseNum:a,featureNum:l}){return t==="feature"?null:t==="phase"?l===void 0?null:c.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:c.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",jr(l)]})}):t==="task"?a===void 0?null:c.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:[c.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",jr(a)]}),l!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),c.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",jr(l)]})]})]}):null}function al({featureNum:t,phaseNum:a,taskNum:l,featureId:i,phaseId:o,taskId:u}){const f=i?({children:g})=>c.jsx(Qe,{to:`/features/${i}`,className:"entity-path-seg entity-path-seg--feature entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--feature",children:g}),m=o?({children:g})=>c.jsx(Qe,{to:`/features/${i}/phases/${o}`,className:"entity-path-seg entity-path-seg--phase entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--phase",children:g}),p=u?({children:g})=>c.jsx(Qe,{to:`/features/${i}/phases/${o}/tasks/${u}`,className:"entity-path-seg entity-path-seg--task entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--task",children:g});return c.jsxs("span",{className:"entity-path-badge",children:[t!==void 0?c.jsxs(f,{children:["F",jr(t)]}):null,a!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),c.jsxs(m,{children:["P",jr(a)]})]}):null,l!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),c.jsxs(p,{children:["T",jr(l)]})]}):null]})}function Ul({id:t,children:a}){const[l,i]=v.useState(!1);return c.jsxs("button",{type:"button",onClick:async o=>{o.preventDefault(),o.stopPropagation(),await jR(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,c.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:l?c.jsx(Mb,{className:"h-3 w-3 text-emerald-500"}):c.jsx(Ub,{className:"h-3 w-3"})})]})}function mi({shortId:t}){return c.jsx(Ul,{id:t,children:c.jsx("span",{className:"short-id-badge",children:t})})}function ym({phaseId:t,updatedAt:a}){const l=`Phase handoff pending${a?` · updated ${new Date(a).toLocaleString()}`:""}`;return c.jsxs("a",{href:`/handoff#${t}`,className:"handoff-badge flex items-center gap-1 ml-2 shrink-0",title:l,"aria-label":l,children:[c.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:[c.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),c.jsx("path",{d:"M9 2v3h3"}),c.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),c.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}function TR({activeTasks:t}){const a=Dr(),l=v.useMemo(()=>{const i=new Set;return t.filter(o=>{const u=`${o.id}-${o.title}-${o.phaseId}`;return i.has(u)?!1:(i.add(u),!0)})},[t]);return l.length===0?null:c.jsx("div",{className:"relative z-10 border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:c.jsx("div",{className:"page-container py-2.5",children:c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["In-progress tasks (",l.length,")"]}),c.jsx("div",{className:"grid grid-cols-1 max-h-[35vh] gap-1.5 overflow-y-auto pr-1",children:l.map(i=>{const o=i.featureId?`/features/${i.featureId}/phases/${i.phaseId}/tasks/${i.id}`:"/features";return c.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:[c.jsxs(Qe,{to:o,className:"flex min-w-0 flex-1 items-center gap-2",children:[i.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]","aria-label":"In progress"}):null,c.jsx(hi,{type:"task",number:i.number}),c.jsx(ui,{type:"task",phaseNum:i.phaseNumber,featureNum:i.featureNumber}),c.jsx("span",{className:"min-w-0 truncate font-medium",children:i.title})]}),c.jsx("button",{type:"button",onClick:u=>{u.preventDefault(),u.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:c.jsx(VN,{className:"h-4 w-4"})})]},i.id)})})]})})})}function CR({project:t,activeTasks:a,serverInfo:l}){const i=Ar(),[o,u]=v.useState("connecting");return v.useEffect(()=>{const f=m=>{var g;const p=(g=m.detail)==null?void 0:g.status;p&&u(p)};return window.addEventListener("agent-plan:ws-status",f),()=>window.removeEventListener("agent-plan:ws-status",f)},[]),c.jsxs("div",{className:"page-shell",children:[c.jsxs("header",{className:"sticky top-0 z-30 overflow-visible",children:[c.jsx(NR,{projectName:t==null?void 0:t.name,projectRoot:t==null?void 0:t.projectRoot,planRoot:t==null?void 0:t.planRoot,liveStatus:o}),c.jsx(TR,{activeTasks:a})]}),c.jsxs("div",{className:"page-container py-8",children:[c.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),c.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:c.jsx(Qe,{to:"/",className:"hover:text-[var(--accent)]",children:(t==null?void 0:t.name)??"Agent Plan"})}),t!=null&&t.projectRoot?c.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:t.projectRoot,children:t.projectRoot}):null,l?c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[c.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:[c.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"]}),c.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?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),c.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?c.jsx(kn,{text:t.description,className:"mt-2 max-w-3xl"}):null]}),i.state!=="idle"?c.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),c.jsx(di,{})]})]})}const Na=32,Gb=4,DR=Math.PI*1.2;function Xb(){if(typeof document>"u")return"#7b68ee";const t=document.createElement("div");t.style.color="var(--accent, #7b68ee)",document.body.appendChild(t);const a=getComputedStyle(t).color||"#7b68ee";return t.remove(),a}function AR(){const t=document.createElement("canvas");t.width=Na,t.height=Na;const a=t.getContext("2d");if(!a)return"";const l=Xb();return a.beginPath(),a.arc(Na/2,Na/2,Na/2-Gb,0,Math.PI*2),a.fillStyle=l,a.fill(),a.fillStyle="#ffffff",a.font="bold 16px system-ui, sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText("A",Na/2,Na/2+1),t.toDataURL("image/png")}function kR(t,a){const l=t.getContext("2d");if(!l)return"";const i=Xb();l.clearRect(0,0,Na,Na);const o=Na/2,u=Na/2,f=Na/2-Gb;return l.beginPath(),l.arc(o,u,f,0,Math.PI*2),l.fillStyle=i,l.globalAlpha=.85,l.fill(),l.globalAlpha=1,l.beginPath(),l.arc(o,u,f-3,a,a+DR),l.strokeStyle="#ffffff",l.lineWidth=3,l.lineCap="round",l.stroke(),l.fillStyle="#ffffff",l.font="bold 14px system-ui, sans-serif",l.textAlign="center",l.textBaseline="middle",l.fillText("A",o,u+1),t.toDataURL("image/png")}function OR(){let t=document.querySelector("link[rel~='icon']");return t||(t=document.createElement("link"),t.rel="icon",t.type="image/png",document.head.appendChild(t)),t}function MR(t){const a=v.useRef(null),l=v.useRef(null),i=v.useRef(null),o=v.useRef(0);v.useEffect(()=>{if(a.current||(a.current=OR()),i.current||(i.current=AR()),!l.current){const m=document.createElement("canvas");m.width=Na,m.height=Na,l.current=m}const u=a.current;if(!t){u.href=i.current;return}const f=window.setInterval(()=>{document.hidden||(o.current+=Math.PI/10,u.href=kR(l.current,o.current))},100);return()=>{window.clearInterval(f),u.href=i.current}},[t])}const bo={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},Qb=v.createContext(bo);function Kb(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function _R(t){return typeof t!="string"}function LR(t){return{create:(t==null?void 0:t.create)??bo.create,edit:(t==null?void 0:t.edit)??bo.edit,delete:(t==null?void 0:t.delete)??bo.delete,submit:(t==null?void 0:t.submit)??bo.submit}}function zR(t){const a=[],l=Kb();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 UR(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function BR(t,a){const l=a.key.length===1?a.key.toLowerCase():a.key,i=t.key.length===1?t.key.toLowerCase():t.key,o=Kb(),u=a.meta??(a.primary?o:!1),f=a.ctrl??(a.primary?!o:!1);return i===l&&!!u===t.metaKey&&!!f===t.ctrlKey&&!!a.shift===t.shiftKey&&!!a.alt===t.altKey}function HR({shortcuts:t,children:a}){return v.createElement(Qb.Provider,{value:LR(t)},a)}function Zb(t){const a=v.useContext(Qb);if(t)return _R(t)?t:a[t]}function On(t,a,l){const i=Zb(t);v.useEffect(()=>{if(!i||(l==null?void 0:l.enabled)===!1)return;const o=u=>{!(l!=null&&l.allowInEditable)&&UR(u.target)||BR(u,i)&&(u.preventDefault(),a())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a,l==null?void 0:l.allowInEditable,l==null?void 0:l.enabled,i])}const $R=1500,qR=80,IR=12e3,VR=5e3;function YR(){const{revalidate:t}=oE(),a=v.useRef(null),l=v.useRef(null),i=v.useRef(null),o=v.useRef(null),u=v.useRef(null);return v.useEffect(()=>{let f=!0;const m=X=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:X}}))},p=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},g=()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null)},x=()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},y=()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},E=()=>{g(),i.current=window.setTimeout(()=>{t()},qR)},w=()=>{!f||l.current!==null||(m("reconnecting"),l.current=window.setTimeout(()=>{l.current=null,R()},$R))},S=()=>{y(),x();const X=a.current;if(a.current=null,X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))try{X.close()}catch{}},D=()=>{y(),x(),o.current=window.setInterval(()=>{const X=a.current;if(!(!X||X.readyState!==WebSocket.OPEN)){try{X.send(JSON.stringify({type:"ping"}))}catch{S(),w();return}x(),u.current=window.setTimeout(()=>{S(),w()},VR)}},IR)},R=()=>{if(!f)return;const X=a.current;if(X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))return;m(l.current!==null?"reconnecting":"connecting"),p();const W=window.location.protocol==="https:"?"wss":"ws",ee=new WebSocket(`${W}://${window.location.host}/ws`);a.current=ee,ee.onopen=()=>{p(),m("live"),D()},ee.onmessage=M=>{x();try{const T=JSON.parse(M.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":E();break;default:break}}catch{}},ee.onclose=()=>{y(),x(),a.current===ee&&(a.current=null),f&&w()},ee.onerror=()=>{try{ee.close()}catch{}}},z=()=>{const X=a.current;(!X||X.readyState===WebSocket.CLOSED||X.readyState===WebSocket.CLOSING)&&R()},B=()=>{document.visibilityState==="visible"&&z()},I=()=>{z()};return m("connecting"),R(),window.addEventListener("online",I),document.addEventListener("visibilitychange",B),()=>{f=!1,m("disconnected"),window.removeEventListener("online",I),document.removeEventListener("visibilitychange",B),p(),g(),y(),x(),S()}},[t]),null}async function FR(){const[t,a,l]=await Promise.all([qb(),cR(),Fb()]);return{project:t,uiConfig:a,activeTasks:l}}function PR(){const{project:t,uiConfig:a,activeTasks:l}=zl();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]),MR(l.length>0),c.jsxs(HR,{shortcuts:a.shortcuts,children:[c.jsx(YR,{}),c.jsx(CR,{project:t,activeTasks:l,serverInfo:a.server})]})}function GR(){const t=jb(),a=ii(t),l=a&&t.status===503,i=a?l?"Planner web UI disconnected":`Request failed (${t.status})`:"Planner web UI unavailable",o=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"},[]),c.jsx("div",{className:"page-shell min-h-screen",children:c.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:c.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),c.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:i}),c.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(o)}),c.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:l?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),c.jsx("p",{children:"What to do:"}),c.jsxs("ul",{className:"grid gap-1 pl-5",children:[c.jsxs("li",{className:"list-disc",children:["restart Pi or run ",c.jsx("code",{children:"planner-web start"})]}),c.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),c.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),c.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),c.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:c.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 XR(){const[t,a,l]=await Promise.all([Ib(),Xc(),Fb()]);return{features:t,phases:a,activeTasks:l}}function QR({shortcut:t}){const a=Zb(t);return a?c.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:zR(a)}):null}const KR={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 ut({variant:t="secondary",className:a="",children:l,shortcut:i,...o}){return c.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 ${KR[t]} ${a}`,...o,children:[c.jsx("span",{children:l}),i?c.jsx(QR,{shortcut:i}):null]})}function nn({className:t="",children:a,...l}){return c.jsx("div",{className:`surface-card p-6 ${t}`,...l,children:a})}function ZR({decisions:t}){return t.length===0?null:c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",t.length,")"]}),c.jsx("div",{className:"mt-4 grid gap-3",children:t.map(a=>c.jsxs("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?c.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",c.jsx(kn,{text:a.decision})]}):null,a.rationale?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",c.jsx(kn,{text:a.rationale})]}):null,a.implementationNotes?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",c.jsx(kn,{text:a.implementationNotes})]}):null]},a.id))})]})}function JR({project:t}){var x,y,E;const a=t.scope??[],l=t.outOfScope??[],i=t.technologies??[],o=t.tools??[],u=t.globalRules??[],f=t.decisions??[],m=t.acceptedDecisions??[],p={beforePhaseStart:((x=t.workflowRules)==null?void 0:x.beforePhaseStart)??[],beforeTaskStart:((y=t.workflowRules)==null?void 0:y.beforeTaskStart)??[],afterPhaseComplete:((E=t.workflowRules)==null?void 0:E.afterPhaseComplete)??[]};return a.length>0||l.length>0||i.length>0||o.length>0||u.length>0||f.length>0||m.length>0||p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?c.jsx(nn,{className:"grid gap-4",children:c.jsxs("details",{className:"group",children:[c.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"AI Consolidated Context"}),c.jsxs("div",{className:"mt-4 grid gap-4",children:[a.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"In scope"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:a.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,l.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Out of scope"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,i.length>0||o.length>0?c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Technologies"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:i.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,o.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Tools"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:o.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null]}):null,u.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Global rules"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:u.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsx("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:"Workflow rules"}),c.jsxs("div",{className:"mt-4 grid gap-4 text-sm text-[var(--text-muted)]",children:[p.beforePhaseStart.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before phase start"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforePhaseStart.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.beforeTaskStart.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before task start"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforeTaskStart.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.afterPhaseComplete.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"After phase complete"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.afterPhaseComplete.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null]})]}):null,f.length>0?c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Legacy decisions (",f.length,")"]}),c.jsx("ul",{className:"mt-4 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:f.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,c.jsx(ZR,{decisions:m})]})]})}):null}const Yh={planned:{colorVar:"--color-status-planned",icon:"circle",pattern:"",label:"Planned",description:"Not started",borderStyle:"solid",bgOpacity:10,borderOpacity:30},started:{colorVar:"--color-status-started",icon:"play-start",pattern:"dashed",label:"Started",description:"Begun but not active now",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},"in-progress":{colorVar:"--color-status-in-progress",icon:"play",pattern:"pulse",label:"In progress",description:"Active now",borderStyle:"solid",bgOpacity:12,borderOpacity:30},waiting:{colorVar:"--color-status-waiting",icon:"clock",pattern:"dashed",label:"Waiting",description:"Waiting on a dependency",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},blocked:{colorVar:"--color-status-blocked",icon:"stop",pattern:"",label:"Blocked",description:"Impediment",borderStyle:"solid",bgOpacity:12,borderOpacity:30},deferred:{colorVar:"--color-status-deferred",icon:"pause",pattern:"dashed",label:"Deferred",description:"Postponed",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},done:{colorVar:"--color-status-done",icon:"check",pattern:"",label:"Done",description:"Completed",borderStyle:"solid",bgOpacity:14,borderOpacity:30},closed:{colorVar:"--color-status-closed",icon:"check-mixed",pattern:"",label:"Closed",description:"Closed with mixed outcomes",borderStyle:"solid",bgOpacity:14,borderOpacity:30},canceled:{colorVar:"--color-status-canceled",icon:"ban",pattern:"hatch",label:"Canceled",description:"Canceled",borderStyle:"solid",bgOpacity:8,borderOpacity:30},rejected:{colorVar:"--color-status-rejected",icon:"x",pattern:"crosshatch",label:"Rejected",description:"Rejected",borderStyle:"solid",bgOpacity:10,borderOpacity:30}};function Bl(t){return Yh[t]??Yh.planned}function Tc(t,a,l){switch(a){case"bg":return`color-mix(in srgb, var(${t.colorVar}) ${t.bgOpacity}%, transparent)`;case"border":return`color-mix(in srgb, var(${t.colorVar}) ${t.borderOpacity}%, transparent)`}}function WR(t){const a=Bl(t);return{backgroundColor:Tc(a,"bg"),borderStyle:a.borderStyle,borderColor:Tc(a,"border"),borderWidth:"1px"}}function e2(t){const a=Bl(t);return{backgroundColor:Tc(a,"bg"),borderStyle:a.borderStyle,borderColor:Tc(a,"border"),borderWidth:"1px"}}function xm(t){const{pattern:a}=Bl(t);return a?a==="dashed"?`status-pattern-dashed status-pattern-dashed-${t}`:`status-pattern-${a}`:""}function Jb(t){return`status-${t}`}function Wb(t,a=30){return`color-mix(in srgb, var(${Bl(t).colorVar}) ${a}%, transparent)`}function bm(t){return`ap-status-surface ap-status-surface-${t}`}function t2(t){return t in Yh?t:"planned"}function n2(t,a){const i=[Bl(t).label],o=[["done",a.done],["in-progress",a.inProgress],["planned",a.planned],["waiting",a.waiting],["blocked",a.blocked],["deferred",a.deferred],["canceled",a.canceled],["rejected",a.rejected]];for(const[u,f]of o)f>0&&i.push(`${f} ${u}`);return i.join(" · ")}const e0={circle:Vc,"play-start":QN,play:zb,clock:AN,stop:Bb,pause:Lb,check:mm,"check-mixed":yN,ban:Ob,x:TN};function a2({status:t,className:a=""}){const l=Bl(t),i=e0[l.icon]??Vc;return c.jsx(i,{className:`h-4 w-4 shrink-0 ${a}`.trim(),"aria-hidden":"true"})}function Za({status:t}){const a=t2(t),l=Bl(a);return c.jsxs("span",{className:`status-chip ${Jb(a)} ${xm(a)}`,title:l.description,"aria-label":l.description,children:[c.jsx(a2,{status:a,className:"h-3.5 w-3.5"}),c.jsx("span",{children:l.label})]})}function qo({status:t,breakdown:a,size:l="md",children:i}){const o=Bl(t),u=e0[o.icon]??Vc,f=xm(t),m=a?n2(t,a):o.description,p=l==="sm"?"px-2 py-0.5 text-[10px]":"px-2.5 py-1 text-[11px]";return c.jsxs("span",{className:`status-chip ${Jb(t)} ${f} ${p}`,title:m,"aria-label":m,children:[c.jsx(u,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:o.label}),i]})}function Cc({status:t,breakdown:a,doneTasks:l,totalTasks:i,recentlyChanged:o,className:u}){const f=l!=null&&i!=null;return c.jsxs("div",{className:u,children:[o?c.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"}):null,f?c.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",l,"/",i||0,")"]}):null,c.jsx(qo,{status:t,breakdown:a})]})}function r2(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function l2({features:t,phases:a}){const l=v.useMemo(()=>{const i=new Map(t.map(o=>[o.id,o.name]));return a.flatMap(o=>o.tasks.filter(u=>u.status==="done").map(u=>({task:u,phase:o,feature:t.find(f=>f.id===o.featureId),featureName:o.featureId?i.get(o.featureId)??o.featureId:"Unlinked feature",completedAt:u.completedAt||u.updatedAt}))).sort((o,u)=>u.completedAt.localeCompare(o.completedAt)).slice(0,3)},[t,a]);return c.jsxs(nn,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),c.jsx("div",{className:"grid gap-3",children:l.length>0?l.map(({task:i,phase:o,feature:u,featureName:f,completedAt:m})=>c.jsxs(Qe,{to:o.featureId?`/features/${o.featureId}/phases/${o.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:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(hi,{type:"task",number:i.number}),c.jsx(ui,{type:"task",phaseNum:o.number,featureNum:u==null?void 0:u.number}),c.jsx("span",{className:"shrink-0",children:c.jsx(Za,{status:i.status})})]}),c.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:i.title}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[c.jsx(ui,{type:"phase",featureNum:u==null?void 0:u.number}),c.jsxs("span",{className:"min-w-0 truncate",children:[f," · ",o.title]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",r2(m)]})]},i.id)):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const rx=1440*60*1e3;function s2(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 i2({features:t,phases:a}){const[,l]=v.useState(0),i=Date.now(),o=v.useMemo(()=>{const u=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?u.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<rx&&i-m>=0&&f.task.status==="planned"&&!f.task.startedAt}).sort((f,m)=>m.createdAt.localeCompare(f.createdAt)).slice(0,10)},[t,a,i]);return v.useEffect(()=>{if(o.length===0)return;const u=o.reduce((m,p)=>{const g=new Date(p.createdAt).getTime()+rx-Date.now();return Math.min(m,g)},1/0);if(!Number.isFinite(u)||u<=0)return;const f=window.setTimeout(()=>l(m=>m+1),u+50);return()=>window.clearTimeout(f)},[o]),o.length===0?null:c.jsxs(nn,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"New Added Tasks"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Tasks created in the last 24 hours."})]}),c.jsx("div",{className:"grid gap-3",children:o.map(({task:u,phase:f,feature:m,featureName:p,createdAt:g})=>c.jsxs(Qe,{to:f.featureId?`/features/${f.featureId}/phases/${f.id}/tasks/${u.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:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(hi,{type:"task",number:u.number}),c.jsx(ui,{type:"task",phaseNum:f.number,featureNum:m==null?void 0:m.number}),c.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"}),c.jsx("span",{className:"shrink-0",children:c.jsx(Za,{status:u.status})})]}),c.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:u.title}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[c.jsx(ui,{type:"phase",featureNum:m==null?void 0:m.number}),c.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",f.title]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",s2(g)]})]},u.id))})]})}const o2=new Set(["in-progress"]),u2=new Set(["planned","waiting","blocked","deferred"]),c2=new Set(["done","canceled","rejected"]);function t0(t){return t==="discovery"?"in-progress":t==="draft"?"planned":t}function d2(t){const a={planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0};for(const l of t)switch(l){case"planned":a.planned++;break;case"in-progress":a.inProgress++;break;case"waiting":a.waiting++;break;case"blocked":a.blocked++;break;case"deferred":a.deferred++;break;case"done":a.done++;break;case"canceled":a.canceled++;break;case"rejected":a.rejected++;break}return a}function f2(){return{planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function n0(t){const a=t,l=d2(a),i=a.length;if(i===0)return{displayStatus:"planned",breakdown:f2(),hasStarted:!1,totalChildren:0,meaningfulChildren:0};const o=a.filter(g=>g!=="canceled"&&g!=="rejected"),u=o.length,f=o.some(g=>g!=="planned");if(o.some(g=>o2.has(g)))return{displayStatus:"in-progress",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u};if(a.every(g=>c2.has(g)))return a.every(g=>g==="done")?{displayStatus:"done",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:a.every(g=>g==="canceled")?{displayStatus:"canceled",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:a.every(g=>g==="rejected")?{displayStatus:"rejected",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:{displayStatus:"closed",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u};const m=o.filter(g=>u2.has(g));return m.length>0&&m.every(g=>g==="waiting")?{displayStatus:"waiting",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="blocked")?{displayStatus:"blocked",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="deferred")?{displayStatus:"deferred",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="planned")&&!f?{displayStatus:"planned",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}:{displayStatus:"started",breakdown:l,hasStarted:f,totalChildren:i,meaningfulChildren:u}}function Sm(t){const a=t.map(l=>t0(l.status));return n0(a)}function wm(t){const a=t.map(l=>t0(l.status));return n0(a)}function a0(t){return wm(t)}function r0(t){return Sm(t)}const So={key:"priority",direction:"asc"},h2=4200;function m2(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function p2(t){return t.reduce((a,l)=>a+l.tasks.filter(i=>i.status==="done").length,0)}function g2(t){return String(t&&t>0?t:0).padStart(3,"0")}const v2={draft:0,discovery:1,planned:2,waiting:3,blocked:4,deferred:5,"in-progress":6,done:7,canceled:8,rejected:9};function lx(t,a){if(a==="title")return"name"in t?t.name:t.title;if(a==="status")return v2[t.status]??99;if(a==="startedAt"){if("startedAt"in t){const l=t.startedAt;return l?new Date(l).getTime():Number.MAX_SAFE_INTEGER}return Number.MAX_SAFE_INTEGER}if(a==="completedAt"){if("completedAt"in t){const l=t.completedAt;return l?new Date(l).getTime():Number.MAX_SAFE_INTEGER}return Number.MAX_SAFE_INTEGER}if(a==="shortId")return t.shortId??"";if(a==="priority"||a==="number")return t[a]??0;if(a==="createdAt"||a==="updatedAt"){const l=t[a];return l?new Date(l).getTime():0}return 0}function xh(t,a,l,i){const o=lx(t,l),u=lx(a,l);let f;return typeof o=="number"&&typeof u=="number"?f=o-u:f=String(o).localeCompare(String(u)),f===0&&(f=(t.priority??0)-(a.priority??0)||t.number-a.number||t.createdAt.localeCompare(a.createdAt)),i==="desc"?-f:f}function y2(t,a,l=So){const i=new Map;for(const o of a){if(!o.featureId)continue;const u=i.get(o.featureId)??[];u.push(o),i.set(o.featureId,u)}return t.map(o=>{const u=i.get(o.id)??[],f=u.reduce((x,y)=>x+y.tasks.length,0),m=u.reduce((x,y)=>x+y.tasks.filter(E=>E.status==="done").length,0),p=u.map(x=>{const y=[...x.tasks].sort((w,S)=>xh(w,S,l.key,l.direction)),E=y.some(w=>w.status==="in-progress");return{phase:x,totalTasks:x.tasks.length,doneTasks:x.tasks.filter(w=>w.status==="done").length,allTasks:y,hasActiveTask:E,display:Sm(y)}}),g=p.some(({phase:x,allTasks:y})=>x.status==="in-progress"||x.status==="discovery"||y.some(E=>E.status==="in-progress"));return{feature:o,totalTasks:f,doneTasks:m,allPhases:p.sort((x,y)=>xh(x.phase,y.phase,l.key,l.direction)),hasActiveTask:p.some(x=>x.hasActiveTask),isActive:g,display:wm(p.map(x=>x.phase))}}).sort((o,u)=>xh(o.feature,u.feature,l.key,l.direction))}function ic({title:t,value:a,valueSuffix:l,subtitle:i,icon:o,valueClassName:u,iconClassName:f}){return c.jsxs(nn,{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:t}),c.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[c.jsx("p",{className:`text-3xl font-black tracking-tight ${u??"text-[var(--text)]"}`,children:a}),l?c.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:l}):null]}),c.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:i})]}),c.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:o})]})}function sx(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 x2({features:t,phases:a}){const l=new Map;for(const y of a)y.featureId&&l.set(y.featureId,[...l.get(y.featureId)??[],y]);const i=t.filter(y=>{const E=l.get(y.id)??[];return wm(E).displayStatus==="done"}).length,o=Math.max(t.length-i,0),u=a.filter(y=>Sm(y.tasks).displayStatus==="done").length,f=Math.max(a.length-u,0),m=m2(a),p=p2(a),g=Math.max(m-p,0),x=m>0?Math.round(p/m*100):0;return c.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[c.jsx(ic,{title:"Features",value:String(t.length),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[i," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[o," left"]})]}),icon:c.jsx(jc,{className:"h-4 w-4"})}),c.jsx(ic,{title:"Phases",value:String(a.length),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[u," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[f," left"]})]}),icon:c.jsx(hN,{className:"h-4 w-4"})}),c.jsx(ic,{title:"Tasks",value:String(m),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[p," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[g," left"]})]}),icon:c.jsx(Yc,{className:"h-4 w-4"})}),c.jsx(ic,{title:"Completion",value:`${x}%`,subtitle:"Task completion rate",valueClassName:sx(x),iconClassName:sx(x),icon:c.jsx(mm,{className:"h-4 w-4"})})]})}function b2(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return v.useMemo(()=>i=>{a.forEach(o=>o(i))},a)}const Zc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pi(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function Em(t){return"nodeType"in t}function ma(t){var a,l;return t?pi(t)?t:Em(t)&&(a=(l=t.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Nm(t){const{Document:a}=ma(t);return t instanceof a}function Io(t){return pi(t)?!1:t instanceof ma(t).HTMLElement}function l0(t){return t instanceof ma(t).SVGElement}function gi(t){return t?pi(t)?t.document:Em(t)?Nm(t)?t:Io(t)||l0(t)?t.ownerDocument:document:document:document}const cr=Zc?v.useLayoutEffect:v.useEffect;function Jc(t){const a=v.useRef(t);return cr(()=>{a.current=t}),v.useCallback(function(){for(var l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];return a.current==null?void 0:a.current(...i)},[])}function S2(){const t=v.useRef(null),a=v.useCallback((i,o)=>{t.current=setInterval(i,o)},[]),l=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[a,l]}function Ao(t,a){a===void 0&&(a=[t]);const l=v.useRef(t);return cr(()=>{l.current!==t&&(l.current=t)},a),l}function Vo(t,a){const l=v.useRef();return v.useMemo(()=>{const i=t(l.current);return l.current=i,i},[...a])}function Dc(t){const a=Jc(t),l=v.useRef(null),i=v.useCallback(o=>{o!==l.current&&(a==null||a(o,l.current)),l.current=o},[]);return[l,i]}function Ac(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let bh={};function Yo(t,a){return v.useMemo(()=>{if(a)return a;const l=bh[t]==null?0:bh[t]+1;return bh[t]=l,t+"-"+l},[t,a])}function s0(t){return function(a){for(var l=arguments.length,i=new Array(l>1?l-1:0),o=1;o<l;o++)i[o-1]=arguments[o];return i.reduce((u,f)=>{const m=Object.entries(f);for(const[p,g]of m){const x=u[p];x!=null&&(u[p]=x+t*g)}return u},{...a})}}const si=s0(1),kc=s0(-1);function w2(t){return"clientX"in t&&"clientY"in t}function Wc(t){if(!t)return!1;const{KeyboardEvent:a}=ma(t.target);return a&&t instanceof a}function E2(t){if(!t)return!1;const{TouchEvent:a}=ma(t.target);return a&&t instanceof a}function Oc(t){if(E2(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 w2(t)?{x:t.clientX,y:t.clientY}:null}const Ll=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[Ll.Translate.toString(t),Ll.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:a,duration:l,easing:i}=t;return a+" "+l+"ms "+i}}}),ix="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function N2(t){return t.matches(ix)?t:t.querySelector(ix)}const R2={display:"none"};function j2(t){let{id:a,value:l}=t;return dn.createElement("div",{id:a,style:R2},l)}function T2(t){let{id:a,announcement:l,ariaLiveType:i="assertive"}=t;const o={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 dn.createElement("div",{id:a,style:o,role:"status","aria-live":i,"aria-atomic":!0},l)}function C2(){const[t,a]=v.useState("");return{announce:v.useCallback(i=>{i!=null&&a(i)},[]),announcement:t}}const i0=v.createContext(null);function D2(t){const a=v.useContext(i0);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(t)},[t,a])}function A2(){const[t]=v.useState(()=>new Set),a=v.useCallback(i=>(t.add(i),()=>t.delete(i)),[t]);return[v.useCallback(i=>{let{type:o,event:u}=i;t.forEach(f=>{var m;return(m=f[o])==null?void 0:m.call(f,u)})},[t]),a]}const k2={draggable:`
|
|
274
|
-
To pick up a draggable item, press the space bar.
|
|
275
|
-
While dragging, use the arrow keys to move the item.
|
|
276
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
277
|
-
`},O2={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 M2(t){let{announcements:a=O2,container:l,hiddenTextDescribedById:i,screenReaderInstructions:o=k2}=t;const{announce:u,announcement:f}=C2(),m=Yo("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),D2(v.useMemo(()=>({onDragStart(y){let{active:E}=y;u(a.onDragStart({active:E}))},onDragMove(y){let{active:E,over:w}=y;a.onDragMove&&u(a.onDragMove({active:E,over:w}))},onDragOver(y){let{active:E,over:w}=y;u(a.onDragOver({active:E,over:w}))},onDragEnd(y){let{active:E,over:w}=y;u(a.onDragEnd({active:E,over:w}))},onDragCancel(y){let{active:E,over:w}=y;u(a.onDragCancel({active:E,over:w}))}}),[u,a])),!p)return null;const x=dn.createElement(dn.Fragment,null,dn.createElement(j2,{id:i,value:o.draggable}),dn.createElement(T2,{id:m,announcement:f}));return l?nl.createPortal(x,l):x}var Hn;(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"})(Hn||(Hn={}));function Mc(){}function _2(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function L2(){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 dr=Object.freeze({x:0,y:0});function z2(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function U2(t,a){const l=Oc(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 B2(t,a){let{data:{value:l}}=t,{data:{value:i}}=a;return l-i}function H2(t,a){let{data:{value:l}}=t,{data:{value:i}}=a;return i-l}function $2(t,a){if(!t||t.length===0)return null;const[l]=t;return l[a]}function ox(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 q2=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:i}=t;const o=ox(a,a.left,a.top),u=[];for(const f of i){const{id:m}=f,p=l.get(m);if(p){const g=z2(ox(p),o);u.push({id:m,data:{droppableContainer:f,value:g}})}}return u.sort(B2)};function I2(t,a){const l=Math.max(a.top,t.top),i=Math.max(a.left,t.left),o=Math.min(a.left+a.width,t.left+t.width),u=Math.min(a.top+a.height,t.top+t.height),f=o-i,m=u-l;if(i<o&&l<u){const p=a.width*a.height,g=t.width*t.height,x=f*m,y=x/(p+g-x);return Number(y.toFixed(4))}return 0}const V2=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:i}=t;const o=[];for(const u of i){const{id:f}=u,m=l.get(f);if(m){const p=I2(m,a);p>0&&o.push({id:f,data:{droppableContainer:u,value:p}})}}return o.sort(H2)};function Y2(t,a,l){return{...t,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function o0(t,a){return t&&a?{x:t.left-a.left,y:t.top-a.top}:dr}function F2(t){return function(l){for(var i=arguments.length,o=new Array(i>1?i-1:0),u=1;u<i;u++)o[u-1]=arguments[u];return o.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 P2=F2(1);function u0(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 G2(t,a,l){const i=u0(a);if(!i)return t;const{scaleX:o,scaleY:u,x:f,y:m}=i,p=t.left-f-(1-o)*parseFloat(l),g=t.top-m-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=o?t.width/o:t.width,y=u?t.height/u:t.height;return{width:x,height:y,top:g,right:p+x,bottom:g+y,left:p}}const X2={ignoreTransform:!1};function vi(t,a){a===void 0&&(a=X2);let l=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=ma(t).getComputedStyle(t);g&&(l=G2(l,g,x))}const{top:i,left:o,width:u,height:f,bottom:m,right:p}=l;return{top:i,left:o,width:u,height:f,bottom:m,right:p}}function ux(t){return vi(t,{ignoreTransform:!0})}function Q2(t){const a=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function K2(t,a){return a===void 0&&(a=ma(t).getComputedStyle(t)),a.position==="fixed"}function Z2(t,a){a===void 0&&(a=ma(t).getComputedStyle(t));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const u=a[o];return typeof u=="string"?l.test(u):!1})}function Rm(t,a){const l=[];function i(o){if(a!=null&&l.length>=a||!o)return l;if(Nm(o)&&o.scrollingElement!=null&&!l.includes(o.scrollingElement))return l.push(o.scrollingElement),l;if(!Io(o)||l0(o)||l.includes(o))return l;const u=ma(t).getComputedStyle(o);return o!==t&&Z2(o,u)&&l.push(o),K2(o,u)?l:i(o.parentNode)}return t?i(t):l}function c0(t){const[a]=Rm(t,1);return a??null}function Sh(t){return!Zc||!t?null:pi(t)?t:Em(t)?Nm(t)||t===gi(t).scrollingElement?window:Io(t)?t:null:null}function d0(t){return pi(t)?t.scrollX:t.scrollLeft}function f0(t){return pi(t)?t.scrollY:t.scrollTop}function Fh(t){return{x:d0(t),y:f0(t)}}var Vn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Vn||(Vn={}));function h0(t){return!Zc||!t?!1:t===document.scrollingElement}function m0(t){const a={x:0,y:0},l=h0(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-l.width,y:t.scrollHeight-l.height},o=t.scrollTop<=a.y,u=t.scrollLeft<=a.x,f=t.scrollTop>=i.y,m=t.scrollLeft>=i.x;return{isTop:o,isLeft:u,isBottom:f,isRight:m,maxScroll:i,minScroll:a}}const J2={x:.2,y:.2};function W2(t,a,l,i,o){let{top:u,left:f,right:m,bottom:p}=l;i===void 0&&(i=10),o===void 0&&(o=J2);const{isTop:g,isBottom:x,isLeft:y,isRight:E}=m0(t),w={x:0,y:0},S={x:0,y:0},D={height:a.height*o.y,width:a.width*o.x};return!g&&u<=a.top+D.height?(w.y=Vn.Backward,S.y=i*Math.abs((a.top+D.height-u)/D.height)):!x&&p>=a.bottom-D.height&&(w.y=Vn.Forward,S.y=i*Math.abs((a.bottom-D.height-p)/D.height)),!E&&m>=a.right-D.width?(w.x=Vn.Forward,S.x=i*Math.abs((a.right-D.width-m)/D.width)):!y&&f<=a.left+D.width&&(w.x=Vn.Backward,S.x=i*Math.abs((a.left+D.width-f)/D.width)),{direction:w,speed:S}}function ej(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:l,right:i,bottom:o}=t.getBoundingClientRect();return{top:a,left:l,right:i,bottom:o,width:t.clientWidth,height:t.clientHeight}}function p0(t){return t.reduce((a,l)=>si(a,Fh(l)),dr)}function tj(t){return t.reduce((a,l)=>a+d0(l),0)}function nj(t){return t.reduce((a,l)=>a+f0(l),0)}function g0(t,a){if(a===void 0&&(a=vi),!t)return;const{top:l,left:i,bottom:o,right:u}=a(t);c0(t)&&(o<=0||u<=0||l>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const aj=[["x",["left","right"],tj],["y",["top","bottom"],nj]];class jm{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=Rm(l),o=p0(i);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,m]of aj)for(const p of f)Object.defineProperty(this,p,{get:()=>{const g=m(i),x=o[u]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Eo{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 o;(o=this.target)==null||o.addEventListener(a,l,i),this.listeners.push([a,l,i])}}function rj(t){const{EventTarget:a}=ma(t);return t instanceof a?t:gi(t)}function wh(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 Ka;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Ka||(Ka={}));function cx(t){t.preventDefault()}function lj(t){t.stopPropagation()}var At;(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"})(At||(At={}));const v0={start:[At.Space,At.Enter],cancel:[At.Esc],end:[At.Space,At.Enter,At.Tab]},sj=(t,a)=>{let{currentCoordinates:l}=a;switch(t.code){case At.Right:return{...l,x:l.x+25};case At.Left:return{...l,x:l.x-25};case At.Down:return{...l,y:l.y+25};case At.Up:return{...l,y:l.y-25}}};class y0{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 Eo(gi(l)),this.windowListeners=new Eo(ma(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ka.Resize,this.handleCancel),this.windowListeners.add(Ka.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ka.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,i=a.node.current;i&&g0(i),l(dr)}handleKeyDown(a){if(Wc(a)){const{active:l,context:i,options:o}=this.props,{keyboardCodes:u=v0,coordinateGetter:f=sj,scrollBehavior:m="smooth"}=o,{code:p}=a;if(u.end.includes(p)){this.handleEnd(a);return}if(u.cancel.includes(p)){this.handleCancel(a);return}const{collisionRect:g}=i.current,x=g?{x:g.left,y:g.top}:dr;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:i.current,currentCoordinates:x});if(y){const E=kc(y,x),w={x:0,y:0},{scrollableAncestors:S}=i.current;for(const D of S){const R=a.code,{isTop:z,isRight:B,isLeft:I,isBottom:X,maxScroll:W,minScroll:ee}=m0(D),M=ej(D),T={x:Math.min(R===At.Right?M.right-M.width/2:M.right,Math.max(R===At.Right?M.left:M.left+M.width/2,y.x)),y:Math.min(R===At.Down?M.bottom-M.height/2:M.bottom,Math.max(R===At.Down?M.top:M.top+M.height/2,y.y))},ce=R===At.Right&&!B||R===At.Left&&!I,he=R===At.Down&&!X||R===At.Up&&!z;if(ce&&T.x!==y.x){const we=D.scrollLeft+E.x,Ee=R===At.Right&&we<=W.x||R===At.Left&&we>=ee.x;if(Ee&&!E.y){D.scrollTo({left:we,behavior:m});return}Ee?w.x=D.scrollLeft-we:w.x=R===At.Right?D.scrollLeft-W.x:D.scrollLeft-ee.x,w.x&&D.scrollBy({left:-w.x,behavior:m});break}else if(he&&T.y!==y.y){const we=D.scrollTop+E.y,Ee=R===At.Down&&we<=W.y||R===At.Up&&we>=ee.y;if(Ee&&!E.x){D.scrollTo({top:we,behavior:m});return}Ee?w.y=D.scrollTop-we:w.y=R===At.Down?D.scrollTop-W.y:D.scrollTop-ee.y,w.y&&D.scrollBy({top:-w.y,behavior:m});break}}this.handleMove(a,si(kc(y,this.referenceCoordinates),w))}}}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()}}y0.activators=[{eventName:"onKeyDown",handler:(t,a,l)=>{let{keyboardCodes:i=v0,onActivation:o}=a,{active:u}=l;const{code:f}=t.nativeEvent;if(i.start.includes(f)){const m=u.activatorNode.current;return m&&t.target!==m?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function dx(t){return!!(t&&"distance"in t)}function fx(t){return!!(t&&"delay"in t)}class Tm{constructor(a,l,i){var o;i===void 0&&(i=rj(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:u}=a,{target:f}=u;this.props=a,this.events=l,this.document=gi(f),this.documentListeners=new Eo(this.document),this.listeners=new Eo(i),this.windowListeners=new Eo(ma(f)),this.initialCoordinates=(o=Oc(u))!=null?o:dr,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(Ka.Resize,this.handleCancel),this.windowListeners.add(Ka.DragStart,cx),this.windowListeners.add(Ka.VisibilityChange,this.handleCancel),this.windowListeners.add(Ka.ContextMenu,cx),this.documentListeners.add(Ka.Keydown,this.handleKeydown),l){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fx(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(dx(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:o}=this.props;o(i,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(Ka.Click,lj,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ka.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:i,initialCoordinates:o,props:u}=this,{onMove:f,options:{activationConstraint:m}}=u;if(!o)return;const p=(l=Oc(a))!=null?l:dr,g=kc(o,p);if(!i&&m){if(dx(m)){if(m.tolerance!=null&&wh(g,m.tolerance))return this.handleCancel();if(wh(g,m.distance))return this.handleStart()}if(fx(m)&&wh(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===At.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const ij={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Cm extends Tm{constructor(a){const{event:l}=a,i=gi(l.target);super(a,ij,i)}}Cm.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 oj={move:{name:"mousemove"},end:{name:"mouseup"}};var Ph;(function(t){t[t.RightClick=2]="RightClick"})(Ph||(Ph={}));class uj extends Tm{constructor(a){super(a,oj,gi(a.event.target))}}uj.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:i}=a;return l.button===Ph.RightClick?!1:(i==null||i({event:l}),!0)}}];const Eh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class cj extends Tm{constructor(a){super(a,Eh)}static setup(){return window.addEventListener(Eh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Eh.move.name,a)};function a(){}}}cj.activators=[{eventName:"onTouchStart",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:i}=a;const{touches:o}=l;return o.length>1?!1:(i==null||i({event:l}),!0)}}];var No;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(No||(No={}));var _c;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(_c||(_c={}));function dj(t){let{acceleration:a,activator:l=No.Pointer,canScroll:i,draggingRect:o,enabled:u,interval:f=5,order:m=_c.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:y,threshold:E}=t;const w=hj({delta:y,disabled:!u}),[S,D]=S2(),R=v.useRef({x:0,y:0}),z=v.useRef({x:0,y:0}),B=v.useMemo(()=>{switch(l){case No.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case No.DraggableRect:return o}},[l,o,p]),I=v.useRef(null),X=v.useCallback(()=>{const ee=I.current;if(!ee)return;const M=R.current.x*z.current.x,T=R.current.y*z.current.y;ee.scrollBy(M,T)},[]),W=v.useMemo(()=>m===_c.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!u||!g.length||!B){D();return}for(const ee of W){if((i==null?void 0:i(ee))===!1)continue;const M=g.indexOf(ee),T=x[M];if(!T)continue;const{direction:ce,speed:he}=W2(ee,T,B,a,E);for(const we of["x","y"])w[we][ce[we]]||(he[we]=0,ce[we]=0);if(he.x>0||he.y>0){D(),I.current=ee,S(X,f),R.current=he,z.current=ce;return}}R.current={x:0,y:0},z.current={x:0,y:0},D()},[a,X,i,D,u,f,JSON.stringify(B),JSON.stringify(w),S,g,W,x,JSON.stringify(E)])}const fj={x:{[Vn.Backward]:!1,[Vn.Forward]:!1},y:{[Vn.Backward]:!1,[Vn.Forward]:!1}};function hj(t){let{delta:a,disabled:l}=t;const i=Ac(a);return Vo(o=>{if(l||!i||!o)return fj;const u={x:Math.sign(a.x-i.x),y:Math.sign(a.y-i.y)};return{x:{[Vn.Backward]:o.x[Vn.Backward]||u.x===-1,[Vn.Forward]:o.x[Vn.Forward]||u.x===1},y:{[Vn.Backward]:o.y[Vn.Backward]||u.y===-1,[Vn.Forward]:o.y[Vn.Forward]||u.y===1}}},[l,a,i])}function mj(t,a){const l=a!=null?t.get(a):void 0,i=l?l.node.current:null;return Vo(o=>{var u;return a==null?null:(u=i??o)!=null?u:null},[i,a])}function pj(t,a){return v.useMemo(()=>t.reduce((l,i)=>{const{sensor:o}=i,u=o.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,i)}));return[...l,...u]},[]),[t,a])}var ko;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ko||(ko={}));var Gh;(function(t){t.Optimized="optimized"})(Gh||(Gh={}));const hx=new Map;function gj(t,a){let{dragging:l,dependencies:i,config:o}=a;const[u,f]=v.useState(null),{frequency:m,measure:p,strategy:g}=o,x=v.useRef(t),y=R(),E=Ao(y),w=v.useCallback(function(z){z===void 0&&(z=[]),!E.current&&f(B=>B===null?z:B.concat(z.filter(I=>!B.includes(I))))},[E]),S=v.useRef(null),D=Vo(z=>{if(y&&!l)return hx;if(!z||z===hx||x.current!==t||u!=null){const B=new Map;for(let I of t){if(!I)continue;if(u&&u.length>0&&!u.includes(I.id)&&I.rect.current){B.set(I.id,I.rect.current);continue}const X=I.node.current,W=X?new jm(p(X),X):null;I.rect.current=W,W&&B.set(I.id,W)}return B}return z},[t,u,l,y,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{y||w()},[l,y]),v.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),v.useEffect(()=>{y||typeof m!="number"||S.current!==null||(S.current=setTimeout(()=>{w(),S.current=null},m))},[m,y,w,...i]),{droppableRects:D,measureDroppableContainers:w,measuringScheduled:u!=null};function R(){switch(g){case ko.Always:return!1;case ko.BeforeDragging:return l;default:return!l}}}function Dm(t,a){return Vo(l=>t?l||(typeof a=="function"?a(t):t):null,[a,t])}function vj(t,a){return Dm(t,a)}function yj(t){let{callback:a,disabled:l}=t;const i=Jc(a),o=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(i)},[i,l]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ed(t){let{callback:a,disabled:l}=t;const i=Jc(a),o=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(i)},[l]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function xj(t){return new jm(vi(t),t)}function mx(t,a,l){a===void 0&&(a=xj);const[i,o]=v.useState(null);function u(){o(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=yj({callback(p){if(t)for(const g of p){const{type:x,target:y}=g;if(x==="childList"&&y instanceof HTMLElement&&y.contains(t)){u();break}}}}),m=ed({callback:u});return cr(()=>{u(),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 bj(t){const a=Dm(t);return o0(t,a)}const px=[];function Sj(t){const a=v.useRef(t),l=Vo(i=>t?i&&i!==px&&t&&a.current&&t.parentNode===a.current.parentNode?i:Rm(t):px,[t]);return v.useEffect(()=>{a.current=t},[t]),l}function wj(t){const[a,l]=v.useState(null),i=v.useRef(t),o=v.useCallback(u=>{const f=Sh(u.target);f&&l(m=>m?(m.set(f,Fh(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const u=i.current;if(t!==u){f(u);const m=t.map(p=>{const g=Sh(p);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,Fh(g)]):null}).filter(p=>p!=null);l(m.length?new Map(m):null),i.current=t}return()=>{f(t),f(u)};function f(m){m.forEach(p=>{const g=Sh(p);g==null||g.removeEventListener("scroll",o)})}},[o,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((u,f)=>si(u,f),dr):p0(t):dr,[t,a])}function gx(t,a){a===void 0&&(a=[]);const l=v.useRef(null);return v.useEffect(()=>{l.current=null},a),v.useEffect(()=>{const i=t!==dr;i&&!l.current&&(l.current=t),!i&&l.current&&(l.current=null)},[t]),l.current?kc(t,l.current):dr}function Ej(t){v.useEffect(()=>{if(!Zc)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 Nj(t,a){return v.useMemo(()=>t.reduce((l,i)=>{let{eventName:o,handler:u}=i;return l[o]=f=>{u(f,a)},l},{}),[t,a])}function x0(t){return v.useMemo(()=>t?Q2(t):null,[t])}const vx=[];function Rj(t,a){a===void 0&&(a=vi);const[l]=t,i=x0(l?ma(l):null),[o,u]=v.useState(vx);function f(){u(()=>t.length?t.map(p=>h0(p)?i:new jm(a(p),p)):vx)}const m=ed({callback:f});return cr(()=>{m==null||m.disconnect(),f(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),o}function b0(t){if(!t)return null;if(t.children.length>1)return t;const a=t.children[0];return Io(a)?a:t}function jj(t){let{measure:a}=t;const[l,i]=v.useState(null),o=v.useCallback(g=>{for(const{target:x}of g)if(Io(x)){i(y=>{const E=a(x);return y?{...y,width:E.width,height:E.height}:E});break}},[a]),u=ed({callback:o}),f=v.useCallback(g=>{const x=b0(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),i(x?a(x):null)},[a,u]),[m,p]=Dc(f);return v.useMemo(()=>({nodeRef:m,rect:l,setRef:p}),[l,m,p])}const Tj=[{sensor:Cm,options:{}},{sensor:y0,options:{}}],Cj={current:{}},bc={draggable:{measure:ux},droppable:{measure:ux,strategy:ko.WhileDragging,frequency:Gh.Optimized},dragOverlay:{measure:vi}};class Ro 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 Dj={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ro,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Mc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bc,measureDroppableContainers:Mc,windowRect:null,measuringScheduled:!1},S0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Mc,draggableNodes:new Map,over:null,measureDroppableContainers:Mc},Fo=v.createContext(S0),w0=v.createContext(Dj);function Aj(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ro}}}function kj(t,a){switch(a.type){case Hn.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Hn.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 Hn.DragEnd:case Hn.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Hn.RegisterDroppable:{const{element:l}=a,{id:i}=l,o=new Ro(t.droppable.containers);return o.set(i,l),{...t,droppable:{...t.droppable,containers:o}}}case Hn.SetDroppableDisabled:{const{id:l,key:i,disabled:o}=a,u=t.droppable.containers.get(l);if(!u||i!==u.key)return t;const f=new Ro(t.droppable.containers);return f.set(l,{...u,disabled:o}),{...t,droppable:{...t.droppable,containers:f}}}case Hn.UnregisterDroppable:{const{id:l,key:i}=a,o=t.droppable.containers.get(l);if(!o||i!==o.key)return t;const u=new Ro(t.droppable.containers);return u.delete(l),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function Oj(t){let{disabled:a}=t;const{active:l,activatorEvent:i,draggableNodes:o}=v.useContext(Fo),u=Ac(i),f=Ac(l==null?void 0:l.id);return v.useEffect(()=>{if(!a&&!i&&u&&f!=null){if(!Wc(u)||document.activeElement===u.target)return;const m=o.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 y=N2(x);if(y){y.focus();break}}})}},[i,a,o,f,u]),null}function E0(t,a){let{transform:l,...i}=a;return t!=null&&t.length?t.reduce((o,u)=>u({transform:o,...i}),l):l}function Mj(t){return v.useMemo(()=>({draggable:{...bc.draggable,...t==null?void 0:t.draggable},droppable:{...bc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...bc.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 _j(t){let{activeNode:a,measure:l,initialRect:i,config:o=!0}=t;const u=v.useRef(!1),{x:f,y:m}=typeof o=="boolean"?{x:o,y:o}:o;cr(()=>{if(!f&&!m||!a){u.current=!1;return}if(u.current||!i)return;const g=a==null?void 0:a.node.current;if(!g||g.isConnected===!1)return;const x=l(g),y=o0(x,i);if(f||(y.x=0),m||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const E=c0(g);E&&E.scrollBy({top:y.y,left:y.x})}},[a,f,m,i,l])}const td=v.createContext({...dr,scaleX:1,scaleY:1});var kl;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(kl||(kl={}));const Lj=v.memo(function(a){var l,i,o,u;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=Tj,collisionDetection:y=V2,measuring:E,modifiers:w,...S}=a;const D=v.useReducer(kj,void 0,Aj),[R,z]=D,[B,I]=A2(),[X,W]=v.useState(kl.Uninitialized),ee=X===kl.Initialized,{draggable:{active:M,nodes:T,translate:ce},droppable:{containers:he}}=R,we=M!=null?T.get(M):null,Ee=v.useRef({initial:null,translated:null}),ne=v.useMemo(()=>{var qt;return M!=null?{id:M,data:(qt=we==null?void 0:we.data)!=null?qt:Cj,rect:Ee}:null},[M,we]),pe=v.useRef(null),[Re,U]=v.useState(null),[H,ie]=v.useState(null),ue=Ao(S,Object.values(S)),xe=Yo("DndDescribedBy",f),C=v.useMemo(()=>he.getEnabled(),[he]),V=Mj(E),{droppableRects:J,measureDroppableContainers:de,measuringScheduled:Se}=gj(C,{dragging:ee,dependencies:[ce.x,ce.y],config:V.droppable}),je=mj(T,M),ze=v.useMemo(()=>H?Oc(H):null,[H]),ct=Gt(),Fe=vj(je,V.draggable.measure);_j({activeNode:M!=null?T.get(M):null,config:ct.layoutShiftCompensation,initialRect:Fe,measure:V.draggable.measure});const nt=mx(je,V.draggable.measure,Fe),wn=mx(je?je.parentElement:null),Ft=v.useRef({activatorEvent:null,active:null,activeNode:je,collisionRect:null,collisions:null,droppableRects:J,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:he,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ht=he.getNodeFor((l=Ft.current.over)==null?void 0:l.id),se=jj({measure:V.dragOverlay.measure}),qe=(i=se.nodeRef.current)!=null?i:je,at=ee?(o=se.rect)!=null?o:nt:null,_t=!!(se.nodeRef.current&&se.rect),yn=bj(_t?null:nt),Lt=x0(qe?ma(qe):null),kt=Sj(ee?ht??je:null),Pt=Rj(kt),$n=E0(w,{transform:{x:ce.x-yn.x,y:ce.y-yn.y,scaleX:1,scaleY:1},activatorEvent:H,active:ne,activeNodeRect:nt,containerNodeRect:wn,draggingNodeRect:at,over:Ft.current.over,overlayNodeRect:se.rect,scrollableAncestors:kt,scrollableAncestorRects:Pt,windowRect:Lt}),Fn=ze?si(ze,ce):null,an=wj(kt),ca=gx(an),da=gx(an,[nt]),ge=si($n,ca),Oe=at?P2(at,$n):null,Ce=ne&&Oe?y({active:ne,collisionRect:Oe,droppableRects:J,droppableContainers:C,pointerCoordinates:Fn}):null,Be=$2(Ce,"id"),[Ke,fn]=v.useState(null),Wt=_t?$n:si($n,da),ae=Y2(Wt,(u=Ke==null?void 0:Ke.rect)!=null?u:null,nt),Nt=v.useRef(null),en=v.useCallback((qt,xt)=>{let{sensor:zt,options:Rt}=xt;if(pe.current==null)return;const rn=T.get(pe.current);if(!rn)return;const Xt=qt.nativeEvent,Ut=new zt({active:pe.current,activeNode:rn,event:Xt,options:Rt,context:Ft,onAbort(Je){if(!T.get(Je))return;const{onDragAbort:Mn}=ue.current,A={id:Je};Mn==null||Mn(A),B({type:"onDragAbort",event:A})},onPending(Je,En,Mn,A){if(!T.get(Je))return;const{onDragPending:q}=ue.current,K={id:Je,constraint:En,initialCoordinates:Mn,offset:A};q==null||q(K),B({type:"onDragPending",event:K})},onStart(Je){const En=pe.current;if(En==null)return;const Mn=T.get(En);if(!Mn)return;const{onDragStart:A}=ue.current,_={activatorEvent:Xt,active:{id:En,data:Mn.data,rect:Ee}};nl.unstable_batchedUpdates(()=>{A==null||A(_),W(kl.Initializing),z({type:Hn.DragStart,initialCoordinates:Je,active:En}),B({type:"onDragStart",event:_}),U(Nt.current),ie(Xt)})},onMove(Je){z({type:Hn.DragMove,coordinates:Je})},onEnd:mt(Hn.DragEnd),onCancel:mt(Hn.DragCancel)});Nt.current=Ut;function mt(Je){return async function(){const{active:Mn,collisions:A,over:_,scrollAdjustedTranslate:q}=Ft.current;let K=null;if(Mn&&q){const{cancelDrop:re}=ue.current;K={activatorEvent:Xt,active:Mn,collisions:A,delta:q,over:_},Je===Hn.DragEnd&&typeof re=="function"&&await Promise.resolve(re(K))&&(Je=Hn.DragCancel)}pe.current=null,nl.unstable_batchedUpdates(()=>{z({type:Je}),W(kl.Uninitialized),fn(null),U(null),ie(null),Nt.current=null;const re=Je===Hn.DragEnd?"onDragEnd":"onDragCancel";if(K){const Te=ue.current[re];Te==null||Te(K),B({type:re,event:K})}})}}},[T]),nr=v.useCallback((qt,xt)=>(zt,Rt)=>{const rn=zt.nativeEvent,Xt=T.get(Rt);if(pe.current!==null||!Xt||rn.dndKit||rn.defaultPrevented)return;const Ut={active:Xt};qt(zt,xt.options,Ut)===!0&&(rn.dndKit={capturedBy:xt.sensor},pe.current=Rt,en(zt,xt))},[T,en]),tn=pj(x,nr);Ej(x),cr(()=>{nt&&X===kl.Initializing&&W(kl.Initialized)},[nt,X]),v.useEffect(()=>{const{onDragMove:qt}=ue.current,{active:xt,activatorEvent:zt,collisions:Rt,over:rn}=Ft.current;if(!xt||!zt)return;const Xt={active:xt,activatorEvent:zt,collisions:Rt,delta:{x:ge.x,y:ge.y},over:rn};nl.unstable_batchedUpdates(()=>{qt==null||qt(Xt),B({type:"onDragMove",event:Xt})})},[ge.x,ge.y]),v.useEffect(()=>{const{active:qt,activatorEvent:xt,collisions:zt,droppableContainers:Rt,scrollAdjustedTranslate:rn}=Ft.current;if(!qt||pe.current==null||!xt||!rn)return;const{onDragOver:Xt}=ue.current,Ut=Rt.get(Be),mt=Ut&&Ut.rect.current?{id:Ut.id,rect:Ut.rect.current,data:Ut.data,disabled:Ut.disabled}:null,Je={active:qt,activatorEvent:xt,collisions:zt,delta:{x:rn.x,y:rn.y},over:mt};nl.unstable_batchedUpdates(()=>{fn(mt),Xt==null||Xt(Je),B({type:"onDragOver",event:Je})})},[Be]),cr(()=>{Ft.current={activatorEvent:H,active:ne,activeNode:je,collisionRect:Oe,collisions:Ce,droppableRects:J,draggableNodes:T,draggingNode:qe,draggingNodeRect:at,droppableContainers:he,over:Ke,scrollableAncestors:kt,scrollAdjustedTranslate:ge},Ee.current={initial:at,translated:Oe}},[ne,je,Ce,Oe,T,qe,at,J,he,Ke,kt,ge]),dj({...ct,delta:ce,draggingRect:Oe,pointerCoordinates:Fn,scrollableAncestors:kt,scrollableAncestorRects:Pt});const qn=v.useMemo(()=>({active:ne,activeNode:je,activeNodeRect:nt,activatorEvent:H,collisions:Ce,containerNodeRect:wn,dragOverlay:se,draggableNodes:T,droppableContainers:he,droppableRects:J,over:Ke,measureDroppableContainers:de,scrollableAncestors:kt,scrollableAncestorRects:Pt,measuringConfiguration:V,measuringScheduled:Se,windowRect:Lt}),[ne,je,nt,H,Ce,wn,se,T,he,J,Ke,de,kt,Pt,V,Se,Lt]),_e=v.useMemo(()=>({activatorEvent:H,activators:tn,active:ne,activeNodeRect:nt,ariaDescribedById:{draggable:xe},dispatch:z,draggableNodes:T,over:Ke,measureDroppableContainers:de}),[H,tn,ne,nt,z,xe,T,Ke,de]);return dn.createElement(i0.Provider,{value:I},dn.createElement(Fo.Provider,{value:_e},dn.createElement(w0.Provider,{value:qn},dn.createElement(td.Provider,{value:ae},g)),dn.createElement(Oj,{disabled:(m==null?void 0:m.restoreFocus)===!1})),dn.createElement(M2,{...m,hiddenTextDescribedById:xe}));function Gt(){const qt=(Re==null?void 0:Re.autoScrollEnabled)===!1,xt=typeof p=="object"?p.enabled===!1:p===!1,zt=ee&&!qt&&!xt;return typeof p=="object"?{...p,enabled:zt}:{enabled:zt}}}),zj=v.createContext(null),yx="button",Uj="Draggable";function Bj(t){let{id:a,data:l,disabled:i=!1,attributes:o}=t;const u=Yo(Uj),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:y,over:E}=v.useContext(Fo),{role:w=yx,roleDescription:S="draggable",tabIndex:D=0}=o??{},R=(p==null?void 0:p.id)===a,z=v.useContext(R?td:zj),[B,I]=Dc(),[X,W]=Dc(),ee=Nj(f,a),M=Ao(l);cr(()=>(y.set(a,{id:a,key:u,node:B,activatorNode:X,data:M}),()=>{const ce=y.get(a);ce&&ce.key===u&&y.delete(a)}),[y,a]);const T=v.useMemo(()=>({role:w,tabIndex:D,"aria-disabled":i,"aria-pressed":R&&w===yx?!0:void 0,"aria-roledescription":S,"aria-describedby":x.draggable}),[i,w,D,R,S,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:T,isDragging:R,listeners:i?void 0:ee,node:B,over:E,setNodeRef:I,setActivatorNodeRef:W,transform:z}}function N0(){return v.useContext(w0)}const Hj="Droppable",$j={timeout:25};function qj(t){let{data:a,disabled:l=!1,id:i,resizeObserverConfig:o}=t;const u=Yo(Hj),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Fo),x=v.useRef({disabled:l}),y=v.useRef(!1),E=v.useRef(null),w=v.useRef(null),{disabled:S,updateMeasurementsFor:D,timeout:R}={...$j,...o},z=Ao(D??i),B=v.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{g(Array.isArray(z.current)?z.current:[z.current]),w.current=null},R)},[R]),I=ed({callback:B,disabled:S||!f}),X=v.useCallback((T,ce)=>{I&&(ce&&(I.unobserve(ce),y.current=!1),T&&I.observe(T))},[I]),[W,ee]=Dc(X),M=Ao(a);return v.useEffect(()=>{!I||!W.current||(I.disconnect(),y.current=!1,I.observe(W.current))},[W,I]),v.useEffect(()=>(m({type:Hn.RegisterDroppable,element:{id:i,key:u,disabled:l,node:W,rect:E,data:M}}),()=>m({type:Hn.UnregisterDroppable,key:u,id:i})),[i]),v.useEffect(()=>{l!==x.current.disabled&&(m({type:Hn.SetDroppableDisabled,id:i,key:u,disabled:l}),x.current.disabled=l)},[i,u,l,m]),{active:f,rect:E,isOver:(p==null?void 0:p.id)===i,node:W,over:p,setNodeRef:ee}}function Ij(t){let{animation:a,children:l}=t;const[i,o]=v.useState(null),[u,f]=v.useState(null),m=Ac(l);return!l&&!i&&m&&o(m),cr(()=>{if(!u)return;const p=i==null?void 0:i.key,g=i==null?void 0:i.props.id;if(p==null||g==null){o(null);return}Promise.resolve(a(g,u)).then(()=>{o(null)})},[a,i,u]),dn.createElement(dn.Fragment,null,l,i?v.cloneElement(i,{ref:f}):null)}const Vj={x:0,y:0,scaleX:1,scaleY:1};function Yj(t){let{children:a}=t;return dn.createElement(Fo.Provider,{value:S0},dn.createElement(td.Provider,{value:Vj},a))}const Fj={position:"fixed",touchAction:"none"},Pj=t=>Wc(t)?"transform 250ms ease":void 0,Gj=v.forwardRef((t,a)=>{let{as:l,activatorEvent:i,adjustScale:o,children:u,className:f,rect:m,style:p,transform:g,transition:x=Pj}=t;if(!m)return null;const y=o?g:{...g,scaleX:1,scaleY:1},E={...Fj,width:m.width,height:m.height,top:m.top,left:m.left,transform:Ll.Transform.toString(y),transformOrigin:o&&i?U2(i,m):void 0,transition:typeof x=="function"?x(i):x,...p};return dn.createElement(l,{className:f,style:E,ref:a},u)}),Xj=t=>a=>{let{active:l,dragOverlay:i}=a;const o={},{styles:u,className:f}=t;if(u!=null&&u.active)for(const[m,p]of Object.entries(u.active))p!==void 0&&(o[m]=l.node.style.getPropertyValue(m),l.node.style.setProperty(m,p));if(u!=null&&u.dragOverlay)for(const[m,p]of Object.entries(u.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(o))l.node.style.setProperty(p,g);f!=null&&f.active&&l.node.classList.remove(f.active)}},Qj=t=>{let{transform:{initial:a,final:l}}=t;return[{transform:Ll.Transform.toString(a)},{transform:Ll.Transform.toString(l)}]},Kj={duration:250,easing:"ease",keyframes:Qj,sideEffects:Xj({styles:{active:{opacity:"0"}}})};function Zj(t){let{config:a,draggableNodes:l,droppableContainers:i,measuringConfiguration:o}=t;return Jc((u,f)=>{if(a===null)return;const m=l.get(u);if(!m)return;const p=m.node.current;if(!p)return;const g=b0(f);if(!g)return;const{transform:x}=ma(f).getComputedStyle(f),y=u0(x);if(!y)return;const E=typeof a=="function"?a:Jj(a);return g0(p,o.draggable.measure),E({active:{id:u,data:m.data,node:p,rect:o.draggable.measure(p)},draggableNodes:l,dragOverlay:{node:f,rect:o.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:o,transform:y})})}function Jj(t){const{duration:a,easing:l,sideEffects:i,keyframes:o}={...Kj,...t};return u=>{let{active:f,dragOverlay:m,transform:p,...g}=u;if(!a)return;const x={x:m.rect.left-f.rect.left,y:m.rect.top-f.rect.top},y={scaleX:p.scaleX!==1?f.rect.width*p.scaleX/m.rect.width:1,scaleY:p.scaleY!==1?f.rect.height*p.scaleY/m.rect.height:1},E={x:p.x-x.x,y:p.y-x.y,...y},w=o({...g,active:f,dragOverlay:m,transform:{initial:p,final:E}}),[S]=w,D=w[w.length-1];if(JSON.stringify(S)===JSON.stringify(D))return;const R=i==null?void 0:i({active:f,dragOverlay:m,...g}),z=m.node.animate(w,{duration:a,easing:l,fill:"forwards"});return new Promise(B=>{z.onfinish=()=>{R==null||R(),B()}})}}let xx=0;function Wj(t){return v.useMemo(()=>{if(t!=null)return xx++,xx},[t])}const eT=dn.memo(t=>{let{adjustScale:a=!1,children:l,dropAnimation:i,style:o,transition:u,modifiers:f,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:y,activeNodeRect:E,containerNodeRect:w,draggableNodes:S,droppableContainers:D,dragOverlay:R,over:z,measuringConfiguration:B,scrollableAncestors:I,scrollableAncestorRects:X,windowRect:W}=N0(),ee=v.useContext(td),M=Wj(y==null?void 0:y.id),T=E0(f,{activatorEvent:x,active:y,activeNodeRect:E,containerNodeRect:w,draggingNodeRect:R.rect,over:z,overlayNodeRect:R.rect,scrollableAncestors:I,scrollableAncestorRects:X,transform:ee,windowRect:W}),ce=Dm(E),he=Zj({config:i,draggableNodes:S,droppableContainers:D,measuringConfiguration:B}),we=ce?R.setRef:void 0;return dn.createElement(Yj,null,dn.createElement(Ij,{animation:he},y&&M?dn.createElement(Gj,{key:M,id:y.id,ref:we,as:m,activatorEvent:x,adjustScale:a,className:p,transition:u,rect:ce,style:{zIndex:g,...o},transform:T},l):null))});function jo(t,a,l){const i=t.slice();return i.splice(l<0?i.length+l:l,0,i.splice(a,1)[0]),i}function tT(t,a){return t.reduce((l,i,o)=>{const u=a.get(i);return u&&(l[o]=u),l},Array(t.length))}function oc(t){return t!==null&&t>=0}function nT(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 aT(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const R0=t=>{let{rects:a,activeIndex:l,overIndex:i,index:o}=t;const u=jo(a,i,l),f=a[o],m=u[o];return!m||!f?null:{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}},uc={scaleX:1,scaleY:1},Am=t=>{var a;let{activeIndex:l,activeNodeRect:i,index:o,rects:u,overIndex:f}=t;const m=(a=u[l])!=null?a:i;if(!m)return null;if(o===l){const g=u[f];return g?{x:0,y:l<f?g.top+g.height-(m.top+m.height):g.top-m.top,...uc}:null}const p=rT(u,o,l);return o>l&&o<=f?{x:0,y:-m.height-p,...uc}:o<l&&o>=f?{x:0,y:m.height+p,...uc}:{x:0,y:0,...uc}};function rT(t,a,l){const i=t[a],o=t[a-1],u=t[a+1];return i?l<a?o?i.top-(o.top+o.height):u?u.top-(i.top+i.height):0:u?u.top-(i.top+i.height):o?i.top-(o.top+o.height):0:0}const j0="Sortable",T0=dn.createContext({activeIndex:-1,containerId:j0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:R0,disabled:{draggable:!1,droppable:!1}});function km(t){let{children:a,id:l,items:i,strategy:o=R0,disabled:u=!1}=t;const{active:f,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=N0(),y=Yo(j0,l),E=m.rect!==null,w=v.useMemo(()=>i.map(ee=>typeof ee=="object"&&"id"in ee?ee.id:ee),[i]),S=f!=null,D=f?w.indexOf(f.id):-1,R=g?w.indexOf(g.id):-1,z=v.useRef(w),B=!nT(w,z.current),I=R!==-1&&D===-1||B,X=aT(u);cr(()=>{B&&S&&x(w)},[B,w,S,x]),v.useEffect(()=>{z.current=w},[w]);const W=v.useMemo(()=>({activeIndex:D,containerId:y,disabled:X,disableTransforms:I,items:w,overIndex:R,useDragOverlay:E,sortedRects:tT(w,p),strategy:o}),[D,y,X.draggable,X.droppable,I,w,R,p,E,o]);return dn.createElement(T0.Provider,{value:W},a)}const lT=t=>{let{id:a,items:l,activeIndex:i,overIndex:o}=t;return jo(l,i,o).indexOf(a)},sT=t=>{let{containerId:a,isSorting:l,wasDragging:i,index:o,items:u,newIndex:f,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!i||m!==u&&o===f?!1:l?!0:f!==o&&a===p},iT={duration:200,easing:"ease"},C0="transform",oT=Ll.Transition.toString({property:C0,duration:0,easing:"linear"}),uT={roleDescription:"sortable"};function cT(t){let{disabled:a,index:l,node:i,rect:o}=t;const[u,f]=v.useState(null),m=v.useRef(l);return cr(()=>{if(!a&&l!==m.current&&i.current){const p=o.current;if(p){const g=vi(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,o]),v.useEffect(()=>{u&&f(null)},[u]),u}function dT(t){let{animateLayoutChanges:a=sT,attributes:l,disabled:i,data:o,getNewIndex:u=lT,id:f,strategy:m,resizeObserverConfig:p,transition:g=iT}=t;const{items:x,containerId:y,activeIndex:E,disabled:w,disableTransforms:S,sortedRects:D,overIndex:R,useDragOverlay:z,strategy:B}=v.useContext(T0),I=fT(i,w),X=x.indexOf(f),W=v.useMemo(()=>({sortable:{containerId:y,index:X,items:x},...o}),[y,o,X,x]),ee=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:M,node:T,isOver:ce,setNodeRef:he}=qj({id:f,data:W,disabled:I.droppable,resizeObserverConfig:{updateMeasurementsFor:ee,...p}}),{active:we,activatorEvent:Ee,activeNodeRect:ne,attributes:pe,setNodeRef:Re,listeners:U,isDragging:H,over:ie,setActivatorNodeRef:ue,transform:xe}=Bj({id:f,data:W,attributes:{...uT,...l},disabled:I.draggable}),C=b2(he,Re),V=!!we,J=V&&!S&&oc(E)&&oc(R),de=!z&&H,Se=de&&J?xe:null,ze=J?Se??(m??B)({rects:D,activeNodeRect:ne,activeIndex:E,overIndex:R,index:X}):null,ct=oc(E)&&oc(R)?u({id:f,items:x,activeIndex:E,overIndex:R}):X,Fe=we==null?void 0:we.id,nt=v.useRef({activeId:Fe,items:x,newIndex:ct,containerId:y}),wn=x!==nt.current.items,Ft=a({active:we,containerId:y,isDragging:H,isSorting:V,id:f,index:X,items:x,newIndex:nt.current.newIndex,previousItems:nt.current.items,previousContainerId:nt.current.containerId,transition:g,wasDragging:nt.current.activeId!=null}),ht=cT({disabled:!Ft,index:X,node:T,rect:M});return v.useEffect(()=>{V&&nt.current.newIndex!==ct&&(nt.current.newIndex=ct),y!==nt.current.containerId&&(nt.current.containerId=y),x!==nt.current.items&&(nt.current.items=x)},[V,ct,y,x]),v.useEffect(()=>{if(Fe===nt.current.activeId)return;if(Fe!=null&&nt.current.activeId==null){nt.current.activeId=Fe;return}const qe=setTimeout(()=>{nt.current.activeId=Fe},50);return()=>clearTimeout(qe)},[Fe]),{active:we,activeIndex:E,attributes:pe,data:W,rect:M,index:X,newIndex:ct,items:x,isOver:ce,isSorting:V,isDragging:H,listeners:U,node:T,overIndex:R,over:ie,setNodeRef:C,setActivatorNodeRef:ue,setDroppableNodeRef:he,setDraggableNodeRef:Re,transform:ht??ze,transition:se()};function se(){if(ht||wn&&nt.current.newIndex===X)return oT;if(!(de&&!Wc(Ee)||!g)&&(V||Ft))return Ll.Transition.toString({...g,property:C0})}}function fT(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}}At.Down,At.Right,At.Up,At.Left;const nd=[{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"}],ad=[{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"}],Po=[{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"}],Om=[{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"}],ho=nd.map(t=>t.value),mo=ad.map(t=>t.value),po=Po.map(t=>t.value);function Nh(t,a,l){if(t.includes(a)){const i=t.filter(o=>o!==a);return i.length===0?[...l]:i}return[...t,a]}function Ks(t,a){return a.includes(t)}function or(t,a){return`agent-plan:dashboard:${t}:${a}`}function Rh(t,a,l){if(typeof window>"u")return a;try{const i=window.localStorage.getItem(t);if(!i)return a;const o=JSON.parse(i);if(!Array.isArray(o))return a;const u=`${t}-schema`,f=l.slice().sort().join(",");if(window.localStorage.getItem(u)!==f)return window.localStorage.setItem(u,f),a;const p=o.filter(g=>typeof g=="string"&&l.includes(g));return p.length>0?p:a}catch{return a}}function jh(t,a,l){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,l.slice().sort().join(",")))}function Th(t,a){if(typeof window>"u")return a;const l=window.localStorage.getItem(t);return l===null?a:l==="true"}const bx={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Sx=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function D0(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function hT(t){return new Set(D0(t).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function wx(t){const a=t.toUpperCase();return a==="AND"||a==="OR"}function Ch(t,a){const l=t??new Set;for(const i of hT(a))l.add(i);return l}function mT(t,a){const l=t??new Set;for(const i of D0(a).map(o=>o.toUpperCase()))l.add(i);return l}function pT(t){const a=t.trim();if(!a)return{...bx};const l={...bx},i=[],o=[];let u=0;for(;u<a.length;){const m=a[u];if(m==='"'){const p=a.indexOf('"',u+1);if(p===-1){o.push(a.slice(u+1));break}o.push(a.slice(u+1,p)),u=p+1}else if(m===" ")u+=1;else{let p=u;for(;p<a.length&&a[p]!==" ";)p+=1;o.push(a.slice(u,p)),u=p}}let f=0;for(;f<o.length;){const m=o[f];if(wx(m)){f+=1;continue}const p=m.match(Sx);if(p){const g=(p[1]??"").toLowerCase();let x=p[2]??"";if(x.trim()===""&&f+1<o.length){let y=f+1;for(;y<o.length&&wx(o[y]);)y+=1;y<o.length&&!o[y].match(Sx)&&(x=o[y],f=y)}if(g==="feature"){const y=Ch(l.featureNumbers,x);y.size&&(l.featureNumbers=y)}else if(g==="phase"){const y=Ch(l.phaseNumbers,x);y.size&&(l.phaseNumbers=y)}else if(g==="task"){const y=Ch(l.taskNumbers,x);y.size&&(l.taskNumbers=y)}else if(g==="id"){const y=mT(l.shortIds,x);y.size&&(l.shortIds=y)}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 gT(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function A0(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 vT(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??A0(a)).includes(i))return!1}return!0}function yT({features:t,phases:a,projectStorageScope:l}){const i=or(l,"show-all-features"),o=or(l,"tree-open-mode"),u=or(l,"expanded-features"),f=or(l,"expanded-phases"),m=or(l,"feature-status-filters"),p=or(l,"phase-status-filters"),g=or(l,"task-status-filters"),x=or(l,"hide-done"),y=or(l,"hide-planned"),E=or(l,"only-active-branches"),w=or(l,"work-tree-sort"),[S,D]=v.useState(""),[R,z]=v.useState(()=>{if(typeof window>"u")return So;try{const ge=window.localStorage.getItem(w);if(!ge)return So;const Oe=JSON.parse(ge);if(Oe.key&&Oe.direction)return{key:Oe.key,direction:Oe.direction}}catch{}return So}),B=v.useMemo(()=>y2(t,a,R),[t,a,R]),I=v.useMemo(()=>pT(S),[S]),X=gT(I),W=v.useMemo(()=>{if(!X||!I.text)return null;const ge=new Map;for(const Oe of B)for(const Ce of Oe.allPhases)for(const Be of Ce.allTasks)ge.set(Be.id,A0({feature:Oe.feature,phase:Ce.phase,task:Be}));return ge},[X,I.text,B]),{matchedTaskIds:ee,matchedFeatureIds:M,matchedPhaseIds:T}=v.useMemo(()=>{const ge=new Set,Oe=new Set,Ce=new Set;if(!X)return{matchedTaskIds:ge,matchedFeatureIds:Oe,matchedPhaseIds:Ce};for(const Be of B)for(const Ke of Be.allPhases)for(const fn of Ke.allTasks)vT(I,{feature:Be.feature,phase:Ke.phase,task:fn},W==null?void 0:W.get(fn.id))&&(ge.add(fn.id),Oe.add(Be.feature.id),Ce.add(Ke.phase.id));return{matchedTaskIds:ge,matchedFeatureIds:Oe,matchedPhaseIds:Ce}},[X,I,B,W]),[ce,he]=v.useState(()=>{if(typeof window>"u")return!0;const ge=window.localStorage.getItem(i);return ge===null?!0:ge==="true"}),[we,Ee]=v.useState(()=>{if(typeof window>"u")return"all";const ge=window.localStorage.getItem(o);return ge==="smart"||ge==="none"||ge==="all"?ge:"all"}),[ne,pe]=v.useState(()=>{if(typeof window>"u")return[];try{const ge=window.localStorage.getItem(u);return ge?JSON.parse(ge):[]}catch{return[]}}),[Re,U]=v.useState(()=>{if(typeof window>"u")return[];try{const ge=window.localStorage.getItem(f);return ge?JSON.parse(ge):[]}catch{return[]}}),[H,ie]=v.useState(()=>Rh(m,ho,ho)),[ue,xe]=v.useState(()=>Rh(p,mo,mo)),[C,V]=v.useState(()=>Rh(g,po,po)),[J,de]=v.useState(()=>Th(x,!1)),[Se,je]=v.useState(()=>Th(y,!1)),[ze,ct]=v.useState(()=>Th(E,!1)),[Fe,nt]=v.useState([]),[wn,Ft]=v.useState([]),[ht,se]=v.useState([]),qe=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(i,String(ce))},[ce,i]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(o,we)},[we,o]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,JSON.stringify(ne))},[ne,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(Re))},[Re,f]),v.useEffect(()=>{typeof window>"u"||jh(m,H,ho)},[H,m]),v.useEffect(()=>{typeof window>"u"||jh(p,ue,mo)},[ue,p]),v.useEffect(()=>{typeof window>"u"||jh(g,C,po)},[C,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(J))},[J,x]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y,String(Se))},[Se,y]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(E,String(ze))},[ze,E]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(w,JSON.stringify(R))},[R,w]),v.useEffect(()=>()=>{Object.values(qe.current).forEach(ge=>window.clearTimeout(ge)),qe.current={}},[]);const at=v.useMemo(()=>{let ge=[...H];return J&&(ge=ge.filter(Oe=>Oe!=="done")),Se&&(ge=ge.filter(Oe=>Oe!=="planned")),ge},[H,J,Se]),_t=v.useMemo(()=>{let ge=[...ue];return J&&(ge=ge.filter(Oe=>Oe!=="done")),Se&&(ge=ge.filter(Oe=>Oe!=="planned"&&Oe!=="draft")),ge},[ue,J,Se]),yn=v.useMemo(()=>{let ge=[...C];return J&&(ge=ge.filter(Oe=>Oe!=="done")),Se&&(ge=ge.filter(Oe=>Oe!=="planned")),ge},[C,J,Se]),Lt=v.useMemo(()=>{if(X)return B.filter(Ce=>Ks(Ce.feature.status,at)).map(Ce=>({...Ce,allPhases:Ce.allPhases.filter(Be=>Ks(Be.phase.status,_t)).map(Be=>({...Be,allTasks:Be.allTasks.filter(Ke=>ee.has(Ke.id)&&Ks(Ke.status,yn))})).filter(Be=>Be.allTasks.length>0)})).filter(Ce=>Ce.allPhases.length>0);const ge=!ce||ze;return(ce?B:B.filter(Ce=>Ce.isActive)).filter(({feature:Ce})=>Ks(Ce.status,at)).map(Ce=>({...Ce,allPhases:Ce.allPhases.filter(({phase:Be,hasActiveTask:Ke})=>Ks(Be.status,_t)?ge?Be.status==="in-progress"||Be.status==="discovery"||Ke:!0:!1).map(Be=>({...Be,allTasks:Be.allTasks.filter(Ke=>!!Ks(Ke.status,yn))})).filter(Be=>Be.allTasks.length>0||ce||!ge)})).filter(({hasActiveTask:Ce,allPhases:Be})=>ge?Ce||Be.some(Ke=>Ke.hasActiveTask):Be.length>0||ce)},[X,ee,B,at,_t,yn,ze,ce]);v.useEffect(()=>{if(we==="none"){pe([]),U([]);return}if(we==="all"){pe(Lt.filter(({feature:Ce})=>Ce.status!=="done").map(({feature:Ce})=>Ce.id)),U(Lt.flatMap(({allPhases:Ce})=>Ce.map(({phase:Be})=>Be.id)));return}const ge=new Set(Lt.map(({feature:Ce})=>Ce.id)),Oe=new Set(Lt.flatMap(({allPhases:Ce})=>Ce.map(({phase:Be})=>Be.id)));pe(Ce=>Ce.filter(Be=>ge.has(Be))),U(Ce=>Ce.filter(Be=>Oe.has(Be)))},[Lt,we]),v.useEffect(()=>{X&&(Ee("smart"),pe(Array.from(M)),U(Array.from(T)))},[X,M,T]);const kt=ge=>{Ee("smart"),pe(Oe=>Oe.includes(ge)?Oe.filter(Ce=>Ce!==ge):[...Oe,ge])},Pt=ge=>{Ee("smart"),U(Oe=>Oe.includes(ge)?Oe.filter(Ce=>Ce!==ge):[...Oe,ge])},$n=()=>{Ee("smart"),pe(Lt.map(({feature:ge})=>ge.id)),U(Lt.flatMap(({allPhases:ge})=>ge.map(({phase:Oe})=>Oe.id)))};return v.useEffect(()=>{const ge=(Ce,Be)=>{const Ke=Be.filter(fn=>!!fn);for(const fn of Ke){const Wt=`${Ce}:${fn}`,ae=Ce==="feature"?nt:Ce==="phase"?Ft:se;ae(Nt=>Nt.includes(fn)?Nt:[...Nt,fn]),qe.current[Wt]!==void 0&&window.clearTimeout(qe.current[Wt]),qe.current[Wt]=window.setTimeout(()=>{ae(Nt=>Nt.filter(en=>en!==fn)),delete qe.current[Wt]},h2)}},Oe=Ce=>{var fn,Wt,ae,Nt,en,nr;const Ke=Ce.detail;if(Ke!=null&&Ke.type){if(Ke.type==="features-updated"){const tn=((fn=Ke.data)==null?void 0:fn.featureId)??((Wt=Ke.data)==null?void 0:Wt.id);ge("feature",[tn]),tn&&(Ee("smart"),pe(qn=>qn.includes(tn)?qn:[...qn,tn]));return}if(Ke.type==="phases-updated"){const tn=(ae=Ke.data)==null?void 0:ae.featureId,qn=((Nt=Ke.data)==null?void 0:Nt.phaseId)??((en=Ke.data)==null?void 0:en.id);ge("phase",[qn]),ge("feature",[tn]),ge("task",[(nr=Ke.data)==null?void 0:nr.taskId]),Ee("smart"),tn&&pe(_e=>_e.includes(tn)?_e:[..._e,tn]),qn&&U(_e=>_e.includes(qn)?_e:[..._e,qn])}}};return window.addEventListener("agent-plan:ws-event",Oe),()=>{window.removeEventListener("agent-plan:ws-event",Oe)}},[]),{workTree:B,displayedWorkTree:Lt,treeOpenMode:we,setTreeOpenMode:Ee,expandAll:$n,expandedFeatureIds:ne,expandedPhaseIds:Re,setExpandedFeatureIds:pe,setExpandedPhaseIds:U,toggleExpandedFeature:kt,toggleExpandedPhase:Pt,recentFeatureIds:Fe,recentPhaseIds:wn,recentTaskIds:ht,setRecentTaskIds:se,showAllFeatures:ce,setShowAllFeatures:he,featureStatusFilters:H,phaseStatusFilters:ue,taskStatusFilters:C,hideDone:J,setHideDone:de,hidePlanned:Se,setHidePlanned:je,onlyActiveBranches:ze,setOnlyActiveBranches:ct,resetFilters:()=>{D(""),he(!0),de(!1),je(!1),ie(ho),xe(mo),V(po),ct(!1),z(So),Ee("all")},toggleFeatureStatusFilter:ge=>ie(Oe=>Nh(Oe,ge,ho)),togglePhaseStatusFilter:ge=>xe(Oe=>Nh(Oe,ge,mo)),toggleTaskStatusFilter:ge=>V(Oe=>Nh(Oe,ge,po)),searchQuery:S,setSearchQuery:D,searchActive:X,matchedTaskIds:ee,matchedFeatureIds:M,matchedPhaseIds:T,sort:R,setSort:z}}function Mm({status:t,variant:a="header",className:l,children:i,ariaLabel:o}){const u=a==="surface"?WR(t):e2(t),f=xm(t),m=["status-item",a==="surface"?"status-item--surface":"status-item--header",f,l??""].filter(Boolean).join(" ");return c.jsx("div",{className:m,style:u,"aria-label":o,"data-status":t,children:i})}const k0=v.createContext(null);function _m({id:t,children:a}){const l=dT({id:t}),i={transform:Ll.Transform.toString(l.transform),transition:l.transition};return c.jsx(k0.Provider,{value:l,children:c.jsx("div",{ref:l.setNodeRef,style:i,className:l.isDragging?"ap-sortable--dragging":"",children:a})})}function Lm(){const t=v.useContext(k0);return t?c.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...t.listeners,...t.attributes,children:c.jsx(UN,{className:"h-4 w-4"})}):null}const zm="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function xT(){return c.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 Ex({status:t,doneTasks:a,totalTasks:l,recentlyChanged:i,className:o}){const u=a!=null&&l!=null;return c.jsxs("div",{className:o,children:[i?c.jsx(xT,{}):null,u?c.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",l||0,")"]}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(Za,{status:t})})]})}function bT({entry:t,expanded:a,recentlyChanged:l,onToggle:i,isPhaseExpanded:o,onTogglePhase:u,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:m,highlightedTaskIds:p}){const{feature:g,totalTasks:x,doneTasks:y,allPhases:E,hasActiveTask:w}=t;return c.jsxs("div",{className:`surface-card min-w-0 rounded-[10px] px-3 py-3 transition-colors sm:px-4 ${l?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[c.jsxs(Mm,{status:t.display.displayStatus,variant:"header",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 ${l?"bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]":""}`,children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[c.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:c.jsx(_b,{className:`h-4 w-4 transition ${a?"rotate-90":"rotate-0"}`})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Lm,{}),c.jsx(al,{featureNum:g.number,featureId:g.id}),c.jsx(Ul,{id:fi({featureNum:g.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),g.shortId?c.jsx(mi,{shortId:g.shortId}):null,w?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Cc,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:y,totalTasks:x,recentlyChanged:l,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Qe,{to:`/features/${g.id}`,className:`entity-link--feature ${zm} underline-offset-4 hover:underline`,children:g.name})]})]}),c.jsx(Cc,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:y,totalTasks:x,recentlyChanged:l,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&E.length>0?c.jsx("div",{className:"mt-2 ml-1.5 grid grid-cols-1 gap-2 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:Wb(t.display.displayStatus)},children:c.jsx(km,{items:E.map(S=>S.phase.id),strategy:Am,children:E.map(S=>c.jsx(_m,{id:S.phase.id,children:c.jsx(ST,{feature:g,phaseEntry:S,expanded:o(S.phase.id),recentlyChanged:f(S.phase.id),onToggle:()=>u(S.phase.id),isTaskRecentlyChanged:m,highlightedTaskIds:p})},S.phase.id))})}):null]})}function ST({feature:t,phaseEntry:a,expanded:l,recentlyChanged:i,onToggle:o,isTaskRecentlyChanged:u,highlightedTaskIds:f}){const{phase:m,totalTasks:p,doneTasks:g,allTasks:x,hasActiveTask:y}=a;return c.jsxs("div",{className:`work-tree-row grid min-w-0 grid-cols-1 gap-2 rounded-[10px] p-3 transition-colors ${i?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[c.jsxs(Mm,{status:a.display.displayStatus,variant:"header",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:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[c.jsx("button",{type:"button",onClick:o,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:c.jsx(_b,{className:`h-4 w-4 transition ${l?"rotate-90":"rotate-0"}`})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Lm,{}),c.jsx(al,{featureNum:t==null?void 0:t.number,phaseNum:m.number,featureId:t.id,phaseId:m.id}),c.jsx(Ul,{id:fi({featureNum:t==null?void 0:t.number,phaseNum:m.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),m.shortId?c.jsx(mi,{shortId:m.shortId}):null,m.handoff?c.jsx(ym,{phaseId:m.id,updatedAt:m.handoffUpdatedAt}):null,y?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Cc,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Qe,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${zm} underline-offset-4 hover:underline`,children:m.title})]})]}),c.jsx(Cc,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),l?x.length>0?c.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:Wb(a.display.displayStatus)},children:c.jsx(km,{items:x.map(E=>E.id),strategy:Am,children:x.map(E=>c.jsx(_m,{id:E.id,children:c.jsx(wT,{feature:t,phase:m,task:E,recentlyChanged:u(E.id),highlighted:f==null?void 0:f.has(E.id)})},E.id))})}):c.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function wT({feature:t,phase:a,task:l,recentlyChanged:i,highlighted:o}){return c.jsxs(Mm,{status:l.status,variant:"surface",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 ${i?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""} ${o?"ap-search-hit":""}`,children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Lm,{}),c.jsx(al,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id}),c.jsx(Ul,{id:fi({featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),l.shortId?c.jsx(mi,{shortId:l.shortId}):null,l.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Ex,{status:l.status,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Qe,{to:`/features/${t.id}/phases/${a.id}/tasks/${l.id}`,className:`entity-link--task ${zm} underline-offset-4 hover:underline`,children:l.title})]}),c.jsx(Ex,{status:l.status,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]})}var O=(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||{}),ri=class{constructor(t,a){gn(this,"input");gn(this,"pos");gn(this,"state");gn(this,"tokens");gn(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===`
|
|
278
|
-
`||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:O.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:O.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:O.LPAREN,value:"(",start:this.pos,end:this.pos+1}),this.advance();return}if(t===")"){this.tokens.push({type:O.RPAREN,value:")",start:this.pos,end:this.pos+1}),this.advance();return}if(t==="~"||t==="^"){const l=this.pos,i=t==="~"?O.TILDE:O.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===`
|
|
279
|
-
`||l==="\r"){this.tokens.push({type:O.PREFIX_OP,value:t,start:this.pos,end:this.pos+1}),this.advance();return}}if(t==="&"&&this.peekAt(1)==="&"){this.tokens.push({type:O.AND,value:"&&",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if(t==="|"&&this.peekAt(1)==="|"){this.tokens.push({type:O.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:O.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:O.FIELD_NAME,value:this.input.slice(a,this.pos),start:a,end:this.pos}),this.tokens.push({type:O.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:O.AND,value:l,start:a,end:this.pos}):i==="OR"?this.tokens.push({type:O.OR,value:l,start:a,end:this.pos}):i==="NOT"?this.tokens.push({type:O.NOT,value:l,start:a,end:this.pos}):l.includes("*")||l.includes("?")?this.tokens.push({type:O.WILDCARD,value:l,start:a,end:this.pos}):this.tokens.push({type:O.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:O.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:O.WILDCARD,value:l,start:a,end:this.pos}):this.tokens.push({type:O.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:O.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()==="~"?O.TILDE:O.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:O.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:O.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:O.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:O.HISTORY_REF,value:this.input.slice(t,this.pos),start:t,end:this.pos})}},cs=class{constructor(t){gn(this,"tokens");gn(this,"pos");gn(this,"nonWsTokens");gn(this,"errors",[]);this.tokens=t,this.nonWsTokens=t.filter(a=>a.type!==O.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(t){if(t.type!==O.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===O.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)===O.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===O.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===O.OR||a.type===O.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)===O.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)===O.BOOST){const l=this.advance(),i=l.value.slice(1),o=parseFloat(i);t.boost=isNaN(o)?1:o,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)===O.TILDE){const i=this.advance(),o=i.value.slice(1),u=parseInt(o,10);t.quoted?t.proximity=isNaN(u)?0:u:t.fuzzy=isNaN(u)?0:u,t.end=i.end}if(((l=this.peek())==null?void 0:l.type)===O.BOOST){const i=this.advance(),o=i.value.slice(1),u=parseFloat(o);t.boost=isNaN(u)?1:u,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==="[",o=a[a.length-1],u=o==="]"||o==="}",f=o==="]";u||this.errors.push({type:"Error",value:l,message:"Unclosed range expression",start:t.start,end:t.start+1});const m=u?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 w=this.parseRangeBound(m,g);return{type:"Range",lower:w.value,upper:"",lowerInclusive:i,upperInclusive:u?f:!0,lowerQuoted:w.quoted,upperQuoted:!1,lowerStart:w.valueStart,lowerEnd:w.valueEnd,upperStart:t.end,upperEnd:t.end,start:t.start,end:t.end}}const x=this.parseRangeBound(p[1],g),y=g+p[1].length+(m.length-p[1].length-p[2].length),E=this.parseRangeBound(p[2],y);return{type:"Range",lower:x.value,upper:E.value,lowerInclusive:i,upperInclusive:u?f:!0,lowerQuoted:x.quoted,upperQuoted:E.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:E.valueStart,upperEnd:E.valueEnd,start:t.start,end:t.end}}parsePrimary(){var l,i,o;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===O.AND){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected AND",start:u.start,end:u.end}),this.parsePrimary()}if(t.type===O.OR){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected OR",start:u.start,end:u.end}),this.parsePrimary()}if(t.type===O.PREFIX_OP){const u=this.advance(),f=this.parsePrimary();return u.value==="-"?{type:"Not",expression:f,sourceOperator:u.value,start:u.start,end:f.end}:{...f,start:u.start}}if(t.type===O.LPAREN){const u=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const g=this.match(O.RPAREN);g||this.errors.push({type:"Error",value:u.value,message:"Unclosed parenthesis",start:u.start,end:u.end});const x={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:u.end,end:u.end},start:u.start,end:g?g.end:u.end};return this.applyGroupBoost(x)}const f=this.parseOr(),m=this.match(O.RPAREN);m||this.errors.push({type:"Error",value:u.value,message:"Missing closing parenthesis",start:u.start,end:u.end});const p={type:"Group",expression:f,start:u.start,end:m?m.end:f.end};return this.applyGroupBoost(p)}if(t.type===O.SAVED_SEARCH){const u=this.advance();return{type:"SavedSearch",name:u.value.slice(1),start:u.start,end:u.end}}if(t.type===O.HISTORY_REF){const u=this.advance();return{type:"HistoryRef",ref:u.value.slice(1),start:u.start,end:u.end}}if(t.type===O.FIELD_NAME){const u=this.advance(),f=this.match(O.COLON);if(f){let m=":";const p=this.match(O.COMPARISON_OP);if(p&&(m=p.value),((l=this.peek())==null?void 0:l.type)===O.LPAREN){const x=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const S=this.match(O.RPAREN);S||this.errors.push({type:"Error",value:x.value,message:"Unclosed parenthesis",start:x.start,end:x.end});const D={type:"FieldGroup",field:u.value,expression:{type:"BareTerm",value:"",quoted:!1,start:x.end,end:x.end},start:u.start,end:S?S.end:x.end};return this.applyGroupBoost(D)}const y=this.parseOr(),E=this.match(O.RPAREN);E||this.errors.push({type:"Error",value:x.value,message:"Missing closing parenthesis",start:x.start,end:x.end});const w={type:"FieldGroup",field:u.value,expression:y,start:u.start,end:E?E.end:y.end};return this.applyGroupBoost(w)}if(((i=this.peek())==null?void 0:i.type)===O.RANGE){const x=this.advance(),y=this.parseRange(x);return y.field=u.value,y.start=u.start,y}if(((o=this.peek())==null?void 0:o.type)===O.REGEX){const x=this.advance();return{type:"Regex",pattern:x.value.slice(1,-1),start:u.start,end:x.end}}const g=this.peek();if(g&&(g.type===O.VALUE||g.type===O.QUOTED_VALUE||g.type===O.WILDCARD)){const x=this.advance(),y=x.type===O.QUOTED_VALUE;y&&this.checkUnclosedQuote(x);const E=y?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:u.value,operator:m,value:E,quoted:y,start:u.start,end:x.end})}return{type:"FieldValue",field:u.value,operator:m,value:"",quoted:!1,start:u.start,end:p?p.end:f.end}}return{type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end}}if(t.type===O.COMPARISON_OP){const u=this.advance(),f=this.peek();if(f&&(f.type===O.VALUE||f.type===O.QUOTED_VALUE)){const m=this.advance();return{type:"BareTerm",value:u.value+m.value,quoted:!1,start:u.start,end:m.end}}return{type:"Error",value:u.value,message:"Comparison operator without value",start:u.start,end:u.end}}if(t.type===O.QUOTED_VALUE){const u=this.advance();return this.checkUnclosedQuote(u),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(u),quoted:!0,start:u.start,end:u.end})}if(t.type===O.WILDCARD){const u=this.advance();return this.applyModifiers({type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end})}if(t.type===O.RANGE){const u=this.advance();return this.parseRange(u)}if(t.type===O.REGEX){const u=this.advance();return{type:"Regex",pattern:u.value.slice(1,-1),start:u.start,end:u.end}}if(t.type===O.VALUE){const u=this.advance();return this.applyModifiers({type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end})}if(t.type===O.RPAREN){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected closing parenthesis",start:u.start,end:u.end}),{type:"Error",value:u.value,message:"Unexpected closing parenthesis",start:u.start,end:u.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 u of t)if(u.type!==O.WHITESPACE){if(a>=u.start&&a<=u.end){l=u;break}u.end<=a&&(i=u)}const o=u=>{let f=0;for(let m=u;m>=0;m--){const p=t[m];if(p.type!==O.WHITESPACE){if(p.type===O.RPAREN){f++;continue}if(p.type===O.LPAREN){if(f>0){f--;continue}for(let g=m-1;g>=0;g--)if(t[g].type!==O.WHITESPACE){if(t[g].type===O.COLON){for(let x=g-1;x>=0;x--)if(t[x].type!==O.WHITESPACE){if(t[x].type===O.FIELD_NAME)return t[x].value;break}}break}}}}return""};if((l==null?void 0:l.type)===O.COLON){let u="";const f=t.indexOf(l);for(let m=f-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){u=t[m].value;break}if(t[m].type!==O.WHITESPACE)break}if(!u&&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!==O.WHITESPACE){if(t[m].type===O.VALUE||t[m].type===O.QUOTED_VALUE||t[m].type===O.WILDCARD||t[m].type===O.RANGE)return{type:"FIELD_VALUE",partial:t[m].type===O.QUOTED_VALUE?t[m].value.slice(1,t[m].value.endsWith('"')||t[m].value.endsWith("'")?-1:void 0):t[m].value,fieldName:u,token:t[m]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}}if((l==null?void 0:l.type)===O.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===O.HISTORY_REF)return{type:"HISTORY_REF",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===O.RANGE){const u=t.indexOf(l);let f="";for(let m=u-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===O.WHITESPACE||t[m].type===O.COLON))break}return{type:"RANGE",partial:"",fieldName:f,token:l}}if((i==null?void 0:i.type)===O.COLON||(i==null?void 0:i.type)===O.COMPARISON_OP){const u=t.indexOf(i);let f="";for(let m=u-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===O.WHITESPACE||t[m].type===O.COLON||t[m].type===O.COMPARISON_OP))break}return l&&(l.type===O.VALUE||l.type===O.QUOTED_VALUE||l.type===O.WILDCARD)?{type:"FIELD_VALUE",partial:l.type===O.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)===O.VALUE||(l==null?void 0:l.type)===O.QUOTED_VALUE||(l==null?void 0:l.type)===O.WILDCARD){const u=t.indexOf(l);for(let f=u-1;f>=0;f--)if(t[f].type!==O.WHITESPACE){if(t[f].type===O.COLON||t[f].type===O.COMPARISON_OP){let m="";for(let p=f-1;p>=0;p--){if(t[p].type===O.FIELD_NAME){m=t[p].value;break}if(!(t[p].type===O.WHITESPACE||t[p].type===O.COLON||t[p].type===O.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:l.type===O.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)===O.QUOTED_VALUE)return{type:"FIELD_NAME",partial:l.value,token:l};if((l==null?void 0:l.type)===O.FIELD_NAME||(l==null?void 0:l.type)===O.VALUE){const u=o(t.indexOf(l));return u?{type:"FIELD_VALUE",partial:l.value,fieldName:u,token:l}:{type:"FIELD_NAME",partial:l.value,token:l}}if((i==null?void 0:i.type)===O.PREFIX_OP){const u=o(t.indexOf(i));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(i&&(i.type===O.AND||i.type===O.OR||i.type===O.NOT)){const u=o(t.indexOf(i));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(t.length===0||t.every(u=>u.type===O.WHITESPACE))return{type:"EMPTY",partial:""};if((l==null?void 0:l.type)===O.LPAREN||(i==null?void 0:i.type)===O.LPAREN){const u=(l==null?void 0:l.type)===O.LPAREN?l:i,f=o(t.indexOf(u));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)===O.TILDE||(l==null?void 0:l.type)===O.BOOST)return{type:"OPERATOR",partial:""};if(i&&(i.type===O.VALUE||i.type===O.QUOTED_VALUE||i.type===O.RPAREN||i.type===O.RANGE||i.type===O.TILDE||i.type===O.BOOST)){const u=o(t.indexOf(i));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function Xh(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const l=Xh(t.left,a);if(l)return l;const i=Xh(t.right,a);return i||null}return t}function ET(t,a,l){if(!t)return null;const i=Xh(t,l);if(!i)return null;let o=i.start,u=i.end;const f=a.slice(u).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(f)return u+=f[0].length,{start:o,end:u};const m=a.slice(0,o).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return m&&m.index!==void 0&&m.index>0&&(o-=m[0].length),{start:o,end:u}}var NT={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:{}},RT={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"},jT=["AND","OR","NOT"];function Nx(t){return t.replace(/\r\n/g,`
|
|
280
|
-
`).replace(/\r/g,`
|
|
281
|
-
`).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 Rx={"(":")","[":"]",'"':'"',"'":"'"};function TT(t,a,l,i,o){const u=t.slice(0,a),f=t.slice(a,l),m=t.slice(l);return{newValue:u+i+f+o+m,newCursorPos:l+2,newSelStart:a+1,newSelEnd:l+1}}function CT(t){if(!t.textContent)return"";const a=[];function l(i){var o;if(i.nodeType===Node.TEXT_NODE)a.push(i.textContent||"");else if(i.nodeName==="BR")(o=i.hasAttribute)!=null&&o.call(i,"data-sentinel")||a.push(`
|
|
282
|
-
`);else for(let u=0;u<i.childNodes.length;u++)l(i.childNodes[u])}return l(t),a.join("")}function jx(t,a,l){let i=-1,o=-1;for(let u=0;u<t.length;u++){const f=t[u];a>=f.start&&a<=f.end&&(i=u),o===-1&&l>=f.start&&l<=f.end&&(o=u)}return[i,o]}function DT(t,a,l){if(t){let i=t.end;if(t.type===O.FIELD_NAME&&l){const o=l.indexOf(t);if(o>=0){for(let u=o+1;u<l.length;u++)if(l[u].type!==O.WHITESPACE){l[u].type===O.COLON&&(i=l[u].end);break}}}return{start:t.start,end:i}}return{start:a,end:a}}var Dh=class O0{constructor(a,l=[],i=[],o=10,u={}){gn(this,"fields");gn(this,"fieldMap");gn(this,"savedSearches");gn(this,"searchHistory");gn(this,"maxSuggestions");gn(this,"options");gn(this,"defaultFieldName");gn(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=o,this.options={showSavedSearchHint:u.showSavedSearchHint??!1,showHistoryHint:u.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=cs.getCursorContext(a,l);const o=DT(i.token,l,a);if(this.defaultFieldName&&(i.type==="FIELD_NAME"||i.type==="EMPTY")){i={...i,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const u=this.resolveField(this.defaultFieldName);if((u==null?void 0:u.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:i};const f=this.getValueSuggestions(u,i.partial,o.start,o.end);if(this.defaultFieldShowFieldSuggs){const m=this.getFieldSuggestions(i.partial,o.start,o.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 u=this.getFieldSuggestions(i.partial,o.start,o.end),f=!i.partial&&u.length>0?this.getSpecialHints(o.start,o.end):[];return{suggestions:this.sortByPriority([...u,...f]),showDatePicker:!1,context:i}}case"FIELD_VALUE":{const u=i.fieldName?this.resolveField(i.fieldName):void 0;return(u==null?void 0:u.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:i}:{suggestions:this.getValueSuggestions(u,i.partial,o.start,o.end),showDatePicker:!1,context:i}}case"OPERATOR":{const u=this.getOperatorSuggestions(i.partial,o.start,o.end),f=this.getFieldSuggestions("",o.start,o.end),m=this.getSpecialHints(o.start,o.end);return{suggestions:this.sortByPriority([...u,...f,...m]),showDatePicker:!1,context:i}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(i.partial,o.start,o.end),showDatePicker:!1,context:i};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(i.partial,o.start,o.end),showDatePicker:!1,context:i};case"RANGE":{const u=i.fieldName?this.resolveField(i.fieldName):void 0;return(u==null?void 0:u.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:i}:{suggestions:[],showDatePicker:!1,context:i}}default:return{suggestions:[],showDatePicker:!1,context:i}}}getFieldSuggestions(a,l,i){const o=a.toLowerCase();return this.fields.filter(u=>!u.hide).map(u=>{const f=u.name.toLowerCase(),m=(u.label||"").toLowerCase(),p=(u.aliases||[]).map(x=>x.toLowerCase());let g=0;return f.startsWith(o)?g=4:m.startsWith(o)||p.some(x=>x.startsWith(o))?g=3:f.includes(o)?g=2:(m.includes(o)||p.some(x=>x.includes(o)))&&(g=1),{field:u,score:g}}).filter(u=>u.score>0).sort((u,f)=>f.score-u.score).slice(0,this.maxSuggestions).map(u=>({text:u.field.name+":",label:u.field.label||u.field.name,description:u.field.description,type:u.field.type,replaceStart:l,replaceEnd:i,matchPartial:a,priority:10}))}getValueSuggestions(a,l,i,o){if(!a)return[];if(a.type==="boolean")return["true","false"].filter(u=>u.startsWith(l.toLowerCase())).map(u=>({text:u,label:u,type:"boolean",replaceStart:i,replaceEnd:o,matchPartial:l}));if(a.placeholder!==!1){const u=a.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[a.type];if(u)return[{text:"",label:u,type:"hint",replaceStart:i,replaceEnd:o}]}return[]}getOperatorSuggestions(a,l,i){const o=a.toLowerCase();return jT.filter(u=>u.toLowerCase().startsWith(o)).map(u=>({text:u+" ",label:u,description:u==="AND"?"Both conditions must match":u==="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=[],o=this.savedSearches.length>0||this.options.hasSavedSearchProvider,u=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&o&&i.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:a,replaceEnd:l,priority:20}),this.options.showHistoryHint&&u&&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(o=>({text:o.query,label:o.label||o.query,description:o.description,type:"savedSearch",replaceStart:l,replaceEnd:i,matchPartial:a,sourceData:o}))}getHistorySuggestions(a,l,i){return this.searchHistory.slice(0,this.maxSuggestions).map(o=>({text:O0.wrapHistoryQuery(o.query),label:o.label||o.query,description:o.description,type:"history",replaceStart:l,replaceEnd:i,matchPartial:a,sourceData:o}))}static wrapHistoryQuery(a){try{const l=new cs(new ri(a).tokenize()).parse();if(l&&l.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function cc(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var AT=[/^\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 kT(t){for(const a of AT)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function Ah(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function OT(t){if(/^now$/i.test(t))return new Date;const a=t.match(/^now([+-])(\d+)([dhms])$/i);if(a){const o=new Date,u=a[1]==="+"?1:-1,f=parseInt(a[2],10);switch(a[3].toLowerCase()){case"d":o.setDate(o.getDate()+u*f);break;case"h":o.setHours(o.getHours()+u*f);break;case"m":o.setMinutes(o.getMinutes()+u*f);break;case"s":o.setSeconds(o.getSeconds()+u*f);break}return o}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 Tx(t,a){return new Date(t,a+1,0).getDate()}function MT(t,a){return new Date(t,a,1).getDay()}function go(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function Cx(t,a,l){if(!a||!l)return!1;const i=t.getTime(),o=a.getTime(),u=l.getTime();return i>=Math.min(o,u)&&i<=Math.max(o,u)}var _T=["January","February","March","April","May","June","July","August","September","October","November","December"];function LT(t){return _T[t]}function dc(t,a){if(t==="")return null;const l=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(l){const i=kh(l[1].trim(),a);if(i)return`Range start: ${i}`;const o=kh(l[2].trim(),a);return o?`Range end: ${o}`:null}return kh(t,a)}function kh(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||kT(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function fc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var hc={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function mc(t){if(t.length<=1)return t;const a=[...t].sort((i,o)=>{const u=hc[i.type??"SYNTAX_ERROR"],f=hc[o.type??"SYNTAX_ERROR"];return u!==f?u-f:i.start-o.start}),l=[];for(const i of a)l.some(o=>hc[o.type??"SYNTAX_ERROR"]<hc[i.type??"SYNTAX_ERROR"]&&o.start<=i.start&&o.end>=i.end)||l.push(i);return l}var Dx=class{constructor(t){gn(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 o=[],u=i?this.fields.get(i):void 0;return this.walkNode(t,o,a,l,u),this.checkAmbiguousPrecedence(t,o),o}walkNode(t,a,l,i,o){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"}),o&&t.value!==""){let u=null;switch(o.type){case"number":u=cc(t.value);break;case"date":u=dc(t.value,i);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(u=`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("*")&&(u=`"${t.value}" is not a valid IP address`);break}u&&a.push({message:u,start:t.start,end:t.end,field:o.name,type:"INVALID_VALUE"})}if(l&&t.value!==""){const u=fc(l({value:t.value,position:"bare_term",quoted:t.quoted,fieldName:o==null?void 0:o.name,fieldConfig:o}));u&&a.push({message:u.message,start:t.start,end:t.end,severity:u.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(t,a),t.field&&t.field!=="*"){const u=this.fields.get(t.field);u?this.validateRangeBounds(u,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 u=this.fields.get(t.field);if(!u){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(u.type){case"number":f=cc(t.value);break;case"date":f=dc(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!==":"&&u.type!=="number"&&u.type!=="date"&&(f=`Comparison operator "${t.operator}" is not valid for ${u.type} fields`),!f&&l){const m=fc(l({value:t.value,position:"field_value",fieldName:u.name,fieldConfig:u,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!==":"&&u.type!=="number"&&u.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,o);else{const u=this.fields.get(t.field);u?this.walkFieldGroup(t.expression,u,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,o),this.walkNode(t.right,a,l,i,o);break;case"Group":this.walkNode(t.expression,a,l,i,o),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,o);break;case"Error":a.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,a,l,i,o){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(a,t.value,t.quoted,":",t.start,t.end,l,i,o);break;case"FieldValue":this.walkNode(t,l,i,o);break;case"Range":this.validateRangeBounds(a,t,l,i,o);break;case"BooleanExpr":this.walkFieldGroup(t.left,a,l,i,o),this.walkFieldGroup(t.right,a,l,i,o);break;case"Group":this.walkFieldGroup(t.expression,a,l,i,o);break;case"Not":this.walkFieldGroup(t.expression,a,l,i,o);break;default:this.walkNode(t,l,i,o);break}}validateFieldValue(t,a,l,i,o,u,f,m,p){let g=null;switch(t.type){case"number":g=cc(a);break;case"date":g=dc(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=fc(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:o,end:u,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:o,end:u,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,o){const u=[];a.lower!=="*"&&a.lower.trim()!==""&&u.push({value:a.lower,label:"Range start",start:a.lowerStart,end:a.lowerEnd,position:"range_start",inclusive:a.lowerInclusive}),a.upper!=="*"&&a.upper.trim()!==""&&u.push({value:a.upper,label:"Range end",start:a.upperStart,end:a.upperEnd,position:"range_end",inclusive:a.upperInclusive});for(const f of u){let m=null;switch(t.type){case"number":m=cc(f.value),m&&(m=`${f.label}: ${m}`);break;case"date":m=dc(f.value,o),m&&(m=`${f.label}: ${m}`);break;case"boolean":m="Range queries are not supported for boolean fields";break}if(!m&&i){const p=fc(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,o=[];this.collectBoolOps(t,i,o),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"}),o.forEach(u=>l.add(u))),this.collectLeaves(t).forEach(u=>this.findAndFlagAmbiguity(u,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 za(...t){return t.filter(Boolean).join(" ")}function Go(t){return{...NT,...t}}function Xo(t){return{...RT,...t}}function zT(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function UT(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 BT(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function HT(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 M0(t,a){return{position:"absolute",zIndex:a.dropdownZIndex,backgroundColor:t.background,border:`1px solid ${a.dropdownBorderColor}`,borderRadius:a.dropdownBorderRadius,boxShadow:a.dropdownShadow,maxHeight:a.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:a.dropdownMinWidth,maxWidth:a.dropdownMaxWidth,padding:"4px 0"}}function Ax(t,a,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 Zs(t){return{flex:1,fontWeight:500}}function Oh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function $T(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 qT(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 IT={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function VT(t){const a=[];let l=0,i="";function o(){i&&(a.push({type:"text",text:i}),i="")}t.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),l=1);const u=t.lastIndexOf("/"),f=u>0?u:t.length;for(;l<f;){const m=t[l];if(m==="\\"&&l+1<f){o(),a.push({type:"escape",text:t.slice(l,l+2)}),l+=2;continue}if(m==="["){o();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==="("){o();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===")"){o(),a.push({type:"groupClose",text:")"}),l++;continue}if(m==="+"||m==="*"||m==="?"){o();let p=m;l+1<f&&t[l+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),l+=p.length;continue}if(m==="{"){o();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==="$"){o(),a.push({type:"anchor",text:m}),l++;continue}if(m==="|"){o(),a.push({type:"alternation",text:"|"}),l++;continue}i+=m,l++}return o(),u>0&&u<t.length&&a.push({type:"delimiter",text:"/"}),a}function YT(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function FT(t,a,l){const i=VT(t.value).map(o=>{const u=a[IT[o.type]]||a.regexText,f=o.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${o.type}" style="color:${u};font-weight:${f}">${YT(o.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 PT={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function GT(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,o=i>=0&&(t[i]==="]"||t[i]==="}"),u=o?i:t.length;for(;l<u;){const f=t[l];if(f===" "||f===" "){let p=l;for(;p<u&&(t[p]===" "||t[p]===" ");)p++;a.push({type:"whitespace",text:t.slice(l,p)}),l=p;continue}if((f==="T"||f==="t")&&l+1<u&&(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>=u||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<u&&t[p]!=='"';)t[p]==="\\"&&p+1<u&&p++,p++;p<u&&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<u&&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 o&&a.push({type:"bracket",text:t[i]}),a}function kx(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function XT(t,a,l){const i=GT(t.value).map(o=>{if(o.type==="whitespace")return kx(o.text);const u=a[PT[o.type]]||a.fieldValue,f=o.type==="toKeyword"||o.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${o.type}" style="color:${u};font-weight:${f}">${kx(o.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 _0(t,a){if(a<0)return null;const l=t.filter(u=>u.type===O.LPAREN||u.type===O.RPAREN);if(l.length===0)return null;const i=l.find(u=>u.end===a);if(i){const u=Ox(l,i);if(u)return u}const o=l.find(u=>u.start===a);if(o){const u=Ox(l,o);if(u)return u}return null}function Ox(t,a){if(a.type===O.LPAREN){const l=t.indexOf(a);let i=0;for(let o=l;o<t.length;o++)if(t[o].type===O.LPAREN?i++:t[o].type===O.RPAREN&&i--,i===0)return{openStart:a.start,closeStart:t[o].start}}else{const l=t.indexOf(a);let i=0;for(let o=l;o>=0;o--)if(t[o].type===O.RPAREN?i++:t[o].type===O.LPAREN&&i--,i===0)return{openStart:t[o].start,closeStart:a.start}}return null}var QT={[O.FIELD_NAME]:"field-name",[O.COLON]:"colon",[O.VALUE]:"value",[O.QUOTED_VALUE]:"quoted-value",[O.AND]:"and",[O.OR]:"or",[O.NOT]:"not",[O.COMPARISON_OP]:"comparison-op",[O.LPAREN]:"lparen",[O.RPAREN]:"rparen",[O.SAVED_SEARCH]:"saved-search",[O.HISTORY_REF]:"history-ref",[O.PREFIX_OP]:"prefix-op",[O.WILDCARD]:"wildcard",[O.REGEX]:"regex",[O.RANGE]:"range",[O.TILDE]:"tilde",[O.BOOST]:"boost",[O.WHITESPACE]:"whitespace",[O.UNKNOWN]:"unknown"},KT={[O.FIELD_NAME]:"fieldName",[O.COLON]:"operator",[O.VALUE]:"fieldValue",[O.QUOTED_VALUE]:"quoted",[O.AND]:"booleanOp",[O.OR]:"booleanOp",[O.NOT]:"booleanOp",[O.COMPARISON_OP]:"operator",[O.LPAREN]:"paren",[O.RPAREN]:"paren",[O.SAVED_SEARCH]:"savedSearch",[O.HISTORY_REF]:"historyRef",[O.PREFIX_OP]:"operator",[O.WILDCARD]:"wildcard",[O.REGEX]:"quoted",[O.RANGE]:"fieldValue",[O.TILDE]:"operator",[O.BOOST]:"operator",[O.WHITESPACE]:"text",[O.UNKNOWN]:"error"};function Js(t,a,l){const i=Go(a);if(t.length===0)return"";const o=(l==null?void 0:l.cursorOffset)!==void 0?_0(t,l.cursorOffset):null,u=a==null?void 0:a.valueTypes,f=l==null?void 0:l.fieldTypeMap;let m;if(u&&f){m=new Array(t.length);let g,x=!1;const y=[];for(let E=0;E<t.length;E++){const w=t[E];w.type===O.FIELD_NAME?(g=w.value,x=!1):w.type===O.COLON&&g?x=!0:w.type===O.WHITESPACE||(w.type===O.LPAREN?(x&&g?y.push(f.get(g.toLowerCase())):y.push(void 0),g=void 0,x=!1):w.type===O.RPAREN?(y.pop(),g=void 0,x=!1):w.type===O.VALUE||w.type===O.QUOTED_VALUE||w.type===O.RANGE||w.type===O.REGEX||w.type===O.WILDCARD?(x&&g?m[E]=f.get(g.toLowerCase()):y.length>0&&(m[E]=y[y.length-1]),g=void 0,x=!1):(w.type===O.AND||w.type===O.OR||(w.type,O.NOT),g=void 0,x=!1))}}let p=t.map((g,x)=>{let y=i[KT[g.type]||"text"]||i.text;if(u&&m){const D=m[x];D&&u[D]&&(y=u[D])}const E=ZT(g.value);if(g.type===O.WHITESPACE)return E.replace(/\n/g,"<br>");if(g.type===O.REGEX)return FT(g,i,l==null?void 0:l.tokenClassName);if(g.type===O.RANGE)return XT(g,i,l==null?void 0:l.tokenClassName);let w="normal";(g.type===O.AND||g.type===O.OR||g.type===O.NOT)&&(w="600"),g.type===O.FIELD_NAME&&(w="500");let S="";return o&&(g.type===O.LPAREN||g.type===O.RPAREN)&&(g.start===o.openStart||g.start===o.closeStart)&&(w="700",S=`background-color:${i.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${QT[g.type]}${l!=null&&l.tokenClassName?" "+l.tokenClassName:""}`}" style="color:${y};font-weight:${w};${S}" data-token-start="${g.start}" data-token-end="${g.end}">${E}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function ZT(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 Mx(t,a,l){if(!a||a.length===0)return t;const i=t.toLowerCase(),o=a.toLowerCase(),u=i.indexOf(o);if(u===-1)return t;const f=t.slice(0,u),m=t.slice(u,u+a.length),p=t.slice(u+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 JT({suggestions:t,selectedIndex:a,onSelect:l,position:i,colors:o,styles:u,visible:f,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:y,listRefCallback:E,renderType:w,classNames:S}){const D=v.useRef(null),R=v.useRef(null);v.useEffect(()=>{const M=document.createElement("div");return document.body.appendChild(M),D.current=M,()=>{document.body.removeChild(M),D.current=null}},[]);const z=x&&y?x(y):null,B=z!=null;if(v.useEffect(()=>{if(R.current){const M=B?a+1:a,T=R.current.children[M];T&&T.scrollIntoView({block:"nearest"})}},[a,B]),!D.current||!f||t.length===0||!i)return null;const I=Go(o),X=Xo(u),W={...M0(I,X),top:`${i.top}px`,left:`${i.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},ee=v.createElement("div",{className:za("ei-dropdown",S==null?void 0:S.dropdown),style:W,ref:M=>{R.current=M,E==null||E(M)},onMouseDown:M=>M.preventDefault()},B&&v.createElement("div",{className:za("ei-dropdown-header",S==null?void 0:S.dropdownHeader),style:{padding:X.dropdownItemPadding||"4px 10px",fontSize:"11px",color:I.placeholder,borderBottom:`1px solid ${I.dropdownHover}`,userSelect:"none"}},z),t.map((M,T)=>{const ce=T===a,he=Ax(ce,I,X),we=(U,H,ie)=>({key:T,className:za("ei-dropdown-item",U,ce&&"ei-dropdown-item--selected",S==null?void 0:S.dropdownItem),style:{...he,...H},title:ie,onClick:()=>l(M),onMouseEnter:ue=>{ue.currentTarget.style.backgroundColor=ce?I.dropdownSelected:I.dropdownHover},onMouseLeave:ue=>{ue.currentTarget.style.backgroundColor=ce?I.dropdownSelected:"transparent"}}),Ee=U=>{if(w===!1||!M.type||M.type==="hint")return null;const H=typeof w=="function"?w(M.type,{text:M.text,label:M.label,description:M.description,type:M.type}):M.type;return H!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...$T(ce,X),...U}},H):null},ne={flexDirection:"column",alignItems:"flex-start"},pe={display:"flex",alignItems:"center",gap:X.dropdownItemContentGap,width:"100%"};if(M.type==="hint"&&(M.text==="#"||M.text==="!"))return v.createElement("div",{...we("ei-dropdown-item--hint",{opacity:ce?1:.7}),onMouseEnter:U=>{U.currentTarget.style.backgroundColor=ce?I.dropdownSelected:I.dropdownHover,U.currentTarget.style.opacity="1"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor=ce?I.dropdownSelected:"transparent",U.currentTarget.style.opacity=ce?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:Zs()},M.label),M.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:Oh()},M.description));if(M.type==="error")return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--error",S==null?void 0:S.dropdownItem),style:{...he,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...Zs(),color:I.error}},M.label||"Error loading suggestions"));if(M.type==="noResults")return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--no-results",S==null?void 0:S.dropdownItem),style:{...he,cursor:"default",opacity:.7}},M.customContent);if(M.type==="loading")return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--loading",S==null?void 0:S.dropdownItem),style:{...he,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...Zs(),fontStyle:"italic"}},M.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:`${I.placeholder} transparent ${I.placeholder} transparent`,borderRadius:"50%"}}));if(M.type==="hint"){const U=Ax(!1,I,X);return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--hint",S==null?void 0:S.dropdownItem),style:{...U,cursor:"default",opacity:M.customContent?1:.6}},M.customContent?M.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:Zs()},M.label))}if(M.type==="history"&&p&&M.sourceData){const U=p(M.sourceData,ce);if(U!=null)return v.createElement("div",we("ei-dropdown-item--history",ne),U)}if(M.type==="savedSearch"&&g&&M.sourceData){const U=g(M.sourceData,ce);if(U!=null)return v.createElement("div",we("ei-dropdown-item--saved-search"),U)}if((M.type==="history"||M.type==="savedSearch")&&M.description!=null){const U=M.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let H;const ie=M.text.startsWith("(")&&M.text.endsWith(")")?M.text.slice(1,-1):M.text;return M.label!==ie&&(H=M.text),v.createElement("div",we(U,ne,H),v.createElement("span",{className:"ei-dropdown-item-label",style:{...Zs(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},Mx(M.label,M.matchPartial,ce)),v.createElement("span",{style:pe},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...Oh(),flex:1}},M.description),Ee({marginLeft:"auto"})))}const Re=M.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",we(Re),v.createElement("span",{className:"ei-dropdown-item-label",style:Zs()},Mx(M.label,M.matchPartial,ce)),M.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:Oh()},M.description),Ee())}));return nl.createPortal(ee,D.current)}var WT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Mh(t){return Math.floor(t/10)*10}function eC({onSelect:t,colors:a,styles:l,initialMode:i,initialStart:o,initialEnd:u,presets:f,className:m}){const p=i==="range"&&u?u:o??new Date,[g,x]=v.useState(i??"single"),[y,E]=v.useState("days"),[w,S]=v.useState(p.getFullYear()),[D,R]=v.useState(p.getMonth()),[z,B]=v.useState(o??null),[I,X]=v.useState(u??null),[W,ee]=v.useState(null),M=Go(a),T=qT(M,Xo(l)),ce=()=>{y==="days"?D===0?(R(11),S(se=>se-1)):R(se=>se-1):S(y==="months"?se=>se-1:se=>se-10)},he=()=>{y==="days"?D===11?(R(0),S(se=>se+1)):R(se=>se+1):S(y==="months"?se=>se+1:se=>se+10)},we=()=>{S(y==="days"?se=>se-1:y==="months"?se=>se-10:se=>se-100)},Ee=()=>{S(y==="days"?se=>se+1:y==="months"?se=>se+10:se=>se+100)},ne=()=>{y==="days"?E("months"):y==="months"&&E("years")},pe=se=>{R(se),E("days")},Re=se=>{S(se),E("months")},U=se=>{if(g==="single"){t(Ah(se));return}if(!z||I)B(se),X(null),ee(null);else{const[qe,at]=z<=se?[z,se]:[se,z];B(qe),X(at),ee(null),t(`[${Ah(qe)} TO ${Ah(at)}]`)}},H=z&&!I?W:I,ie=se=>{x(se),B(null),X(null),ee(null)},ue=y==="days"?`${LT(D)} ${w}`:y==="months"?`${w}`:`${Mh(w)}–${Mh(w)+9}`,xe=y!=="years",C=new Date,V=Tx(w,D),J=MT(w,D),de=["Su","Mo","Tu","We","Th","Fr","Sa"],Se=[],je=(se,qe,at)=>{const _t=go(se,C),yn=z&&go(se,z),Lt=H&&go(se,H),kt=Cx(se,z,H),Pt=yn||Lt,$n={...T.day,...at?T.dayOtherMonth:{},..._t?T.dayToday:{},...kt?T.dayInRange:{},...Pt?T.daySelected:{}},Fn=g==="range"&&z&&!I;return v.createElement("button",{key:qe,className:"ei-datepicker-day",style:$n,onClick:()=>U(se),onMouseEnter:an=>{Fn?ee(se):Pt||(an.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:an=>{!Fn&&!Pt&&(an.currentTarget.style.backgroundColor=kt?"rgba(9, 105, 218, 0.1)":"transparent")}},se.getDate())};if(J>0){const se=Tx(w,D-1);for(let qe=J-1;qe>=0;qe--){const at=se-qe,_t=new Date(w,D-1,at);Se.push(je(_t,`prev${at}`,!0))}}for(let se=1;se<=V;se++){const qe=new Date(w,D,se);Se.push(je(qe,String(se),!1))}const ze=Se.length%7;if(ze>0){const se=7-ze;for(let qe=1;qe<=se;qe++){const at=new Date(w,D+1,qe);Se.push(je(at,`next${qe}`,!0))}}const ct={...T.day,padding:"10px 4px",fontSize:"13px"},Fe={...ct,...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"}],wn={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Ft=se=>{se.currentTarget.style.backgroundColor="#eef1f5"},ht=se=>{se.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:za("ei-datepicker",m),style:T.container,onMouseDown:se=>se.preventDefault(),onMouseLeave:()=>ee(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:T.rangeToggle},["single","range"].map(se=>v.createElement("button",{key:se,style:{...T.rangeToggleButton,...g===se?T.rangeToggleButtonActive:{}},onClick:()=>ie(se)},se.charAt(0).toUpperCase()+se.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:we,onMouseEnter:Ft,onMouseLeave:ht},"«"),v.createElement("button",{style:T.navButton,onClick:ce,onMouseEnter:Ft,onMouseLeave:ht},"‹")),v.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:xe?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:xe?ne:void 0,onMouseEnter:se=>{xe&&(se.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:se=>{se.currentTarget.style.backgroundColor="transparent"}},ue),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:he,onMouseEnter:Ft,onMouseLeave:ht},"›"),v.createElement("button",{style:T.navButton,onClick:Ee,onMouseEnter:Ft,onMouseLeave:ht},"»"))),y==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:T.weekDays},de.map(se=>v.createElement("div",{key:se,style:T.weekDay},se))),v.createElement("div",{className:"ei-datepicker-days",style:T.days},Se)),y==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},WT.map((se,qe)=>{const at=new Date(w,qe,1),_t=Cx(at,z,H),yn=z&&go(new Date(z.getFullYear(),z.getMonth(),1),at)||H&&go(new Date(H.getFullYear(),H.getMonth(),1),at),Lt=qe===C.getMonth()&&w===C.getFullYear(),kt=g==="range"&&z&&!I;return v.createElement("button",{key:se,style:{...Lt?Fe:ct,..._t?T.dayInRange:{},...yn?T.daySelected:{}},onClick:()=>pe(qe),onMouseEnter:Pt=>{kt?ee(at):yn||(Pt.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:Pt=>{!kt&&!yn&&(Pt.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},se)})),y==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(se,qe)=>{const at=Mh(w)-1+qe,_t=qe===0||qe===11,yn=at===C.getFullYear(),Lt=new Date(at,0,1),kt=z&&H&&at>=Math.min(z.getFullYear(),H.getFullYear())&&at<=Math.max(z.getFullYear(),H.getFullYear()),Pt=z&&z.getFullYear()===at||H&&H.getFullYear()===at,$n=g==="range"&&z&&!I;return v.createElement("button",{key:at,style:{...yn?Fe:ct,..._t?T.dayOtherMonth:{},...kt?T.dayInRange:{},...Pt?T.daySelected:{}},onClick:()=>Re(at),onMouseEnter:Fn=>{$n?ee(Lt):Pt||(Fn.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:Fn=>{!$n&&!Pt&&(Fn.currentTarget.style.backgroundColor=kt?"rgba(9, 105, 218, 0.1)":"transparent")}},at)})),(()=>{const se=nt.filter(qe=>!qe.type||qe.type===g);return se.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...T.quickOptions,...wn}},se.map(qe=>v.createElement("button",{key:`${qe.type??"both"}-${qe.value}`,style:T.quickOption,onClick:()=>t(qe.value)},qe.label)))})())}var tC=30,nC=150;function _x(t,a){let l=0;const i=o=>{if(o.nodeType===Node.TEXT_NODE){const u=(o.textContent||"").length;return l+u>=a?{node:o,offset:a-l}:(l+=u,null)}if(o.nodeName==="BR"){if(l+1>=a){const u=o.parentNode;if(u)return{node:u,offset:Array.from(u.childNodes).indexOf(o)+1}}return l+=1,null}for(let u=0;u<o.childNodes.length;u++){const f=i(o.childNodes[u]);if(f)return f}return null};return i(t)}function aC(t,a,l){const i=_x(t,a),o=_x(t,l);if(!i||!o)return[];const u=document.createRange();u.setStart(i.node,i.offset),u.setEnd(o.node,o.offset);const f=t.getBoundingClientRect(),m=u.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 rC(t,a,l){if(!a||t.length===0)return[];const i=[];let o=0;for(const u of t){if(o>=tC)break;if(l>=u.start&&l<=u.end)continue;const f=aC(a,u.start,u.end);for(const m of f)i.push({left:m.left,top:m.top,width:m.width,height:m.height,error:u});o++}return i}var Lx=28,zx=4;function lC(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 sC({errors:t,editorRef:a,cursorOffset:l,colors:i,styles:o,containerRef:u,classNames:f}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[y,E]=v.useState([]),w=v.useRef([]),S=v.useRef(null),D=v.useRef(null);if(v.useEffect(()=>{if(D.current&&clearTimeout(D.current),t.length===0){E([]),w.current=[],p(null);return}return D.current=setTimeout(()=>{const I=rC(t,a,l);E(I),w.current=I},nC),()=>{D.current&&clearTimeout(D.current)}},[t,a,l]),v.useEffect(()=>{const I=u;if(!I||!a)return;const X=M=>{const T=a.getBoundingClientRect(),ce=M.clientX-T.left,he=M.clientY-T.top;let we=-1;for(let Ee=0;Ee<w.current.length;Ee++){const ne=w.current[Ee];if(ce>=ne.left&&ce<=ne.left+ne.width&&he>=ne.top&&he<=ne.top+ne.height+6){we=Ee;break}}we>=0?(p(we),x({x:ce,clientY:M.clientY})):p(null)},W=()=>{p(null)},ee=new AbortController;return I.addEventListener("mousemove",X,{signal:ee.signal}),I.addEventListener("mouseleave",W,{signal:ee.signal}),()=>ee.abort()},[u,a]),v.useEffect(()=>{const I=S.current;if(!I||m==null)return;const X=I.getBoundingClientRect();if(X.right>window.innerWidth-8){const W=X.right-window.innerWidth+8;I.style.transform=`translateX(-${W}px)`}else I.style.transform=""}),y.length===0)return null;const R=Go(i),z=Xo(o),B=m!=null?y[m]:null;return v.createElement(v.Fragment,null,y.map((I,X)=>{const W=I.error.severity==="warning",ee=lC(W?R.warning:R.error),M=I.top+I.height-2;return v.createElement("div",{key:`wave-${X}`,className:za("ei-squiggly",W?"ei-squiggly--warning":"ei-squiggly--error",f==null?void 0:f.squiggly),style:{position:"absolute",left:`${I.left}px`,top:`${M}px`,width:`${I.width}px`,height:"4px",zIndex:1,backgroundImage:ee,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),B!=null&&(()=>{const I=B.error.severity==="warning"?R.warning:R.error,X=a==null?void 0:a.getBoundingClientRect(),W=((X==null?void 0:X.left)??0)+g.x,ee=((X==null?void 0:X.top)??0)+B.top+B.height+2,M=((X==null?void 0:X.top)??0)+B.top,T=window.innerHeight-g.clientY<Lx+20?M-Lx-zx:ee+zx;return nl.createPortal(v.createElement("div",{ref:S,className:za("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${T}px`,left:`${W}px`,zIndex:z.dropdownZIndex,backgroundColor:R.background,color:I,border:`1px solid ${I}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:z.fontFamily,lineHeight:"1.4",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"90vw"}},B.error.message),document.body)})())}function Oo(t,a,l){let i=0,o=!1;function u(f){var m;if(o)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(u(f.childNodes[p]))return!0;return o=!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(u(f.childNodes[p]))return!0;return!1}return u(t),i}function Dl(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const l=a.getRangeAt(0);return Oo(t,l.startContainer,l.startOffset)}function Er(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const l=a.getRangeAt(0);return{start:Oo(t,l.startContainer,l.startOffset),end:Oo(t,l.endContainer,l.endOffset)}}function tl(t,a){const l=window.getSelection();if(!l)return;const i=Qh(t,a);if(!i)return;const o=document.createRange();o.setStart(i.node,i.offset),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}function el(t,a,l){if(a===l){tl(t,a);return}const i=window.getSelection();if(!i)return;const o=Qh(t,a),u=Qh(t,l);if(!o||!u)return;const f=document.createRange();f.setStart(o.node,o.offset),f.setEnd(u.node,u.offset),i.removeAllRanges(),i.addRange(f)}function Qh(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 o=i(t);if(o)return o;const u=L0(t);return u?{node:u,offset:(u.textContent||"").length}:{node:t,offset:0}}function L0(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const l=L0(t.childNodes[a]);if(l)return l}return null}function iC(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 oC(){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 pc(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 o=t.getBoundingClientRect(),u=i.top-o.top+t.scrollTop,f=i.bottom-o.top+t.scrollTop;f>t.scrollTop+t.clientHeight?t.scrollTop=f-t.clientHeight:u<t.scrollTop&&(t.scrollTop=u)}function _h(){var i,o;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 u=document.createElement("span");u.textContent="",a.insertNode(u);const f=u.getBoundingClientRect();return(o=u.parentNode)==null||o.removeChild(u),t.removeAllRanges(),t.addRange(a),f}return l}function Ux(t,a){return Math.min(t,a)}function Lh(t,a,l){const i=window.innerHeight,o=window.innerWidth;let u=t.bottom+window.scrollY+4,f=t.left+window.scrollX;return t.bottom+a+4>i&&(u=t.top+window.scrollY-a-4),f+l>o&&(f=o-l-8),f<8&&(f=8),{top:u,left:f}}var uC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD]);function cC(t,a,l){for(const i of t)if(a>=i.start&&a<=i.end&&uC.has(i.type))return a===i.start&&l===i.end?null:{start:i.start,end:i.end};return null}var dC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD,O.FIELD_NAME,O.RANGE,O.SAVED_SEARCH,O.HISTORY_REF,O.REGEX]);function fC(t,a,l){const i=[];for(const o of a)if(l>=o.start&&l<=o.end&&dC.has(o.type)){i.push({start:o.start,end:o.end});break}return t&&Sc(t,l,i),hC(i)}function Sc(t,a,l){if(a<t.start||a>t.end)return!1;let i=!1;switch(t.type){case"BooleanExpr":i=Sc(t.left,a,l)||i,i=Sc(t.right,a,l)||i;break;case"Group":case"Not":case"FieldGroup":i=Sc(t.expression,a,l)||i;break}return l.push({start:t.start,end:t.end}),!0}function hC(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 mC=60,pC=" ";function gC(t,a){const l=(a==null?void 0:a.maxLineLength)??mC,i=(a==null?void 0:a.indent)??pC,o={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 u;return typeof t=="string"?u=new cs(new ri(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():u=t,u?Ec(u,0,l,i,o):""}function vC(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function z0(t,a){const l=a.not??t.sourceOperator??"NOT";return{op:l,sep:/^[a-zA-Z]/.test(l)?" ":""}}function Rr(t,a){switch(t.type){case"FieldValue":{const l=t.quoted?`"${t.value}"`:t.value,i=t.operator===":"?":":`:${t.operator}`;let o=`${t.field}${i}${l}`;return t.fuzzy!=null&&(o+=`~${t.fuzzy}`),t.proximity!=null&&(o+=`~${t.proximity}`),t.boost!=null&&(o+=`^${t.boost}`),o}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?"]":"}",o=`${l}${t.lowerQuoted?`"${t.lower}"`:t.lower} TO ${t.upperQuoted?`"${t.upper}"`:t.upper}${i}`;return t.field?`${t.field}:${o}`:o}case"Regex":return`/${t.pattern}/`;case"SavedSearch":return`#${t.name}`;case"HistoryRef":return`!${t.ref}`;case"Not":{const{op:l,sep:i}=z0(t,a);return`${l}${i}${Rr(t.expression,a)}`}case"Group":{let l=`(${Rr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"FieldGroup":{let l=`${t.field}:(${Rr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"BooleanExpr":{const l=vC(t,a),i=l?` ${l} `:" ";return`${Rr(t.left,a)}${i}${Rr(t.right,a)}`}case"Error":return t.value}}function yC(t){const a=t.operator,l=!!t.implicit,i=[],o=u=>{u.type==="BooleanExpr"&&u.operator===a&&!!u.implicit===l?(o(u.left),o(u.right)):i.push(u)};return o(t),{operator:a,implicit:l,sourceOperator:t.sourceOperator,operands:i}}function wc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?wc(t.left)||wc(t.right):t.type==="Not"?wc(t.expression):!1}var xC={and:"AND",or:"OR",not:"NOT"};function bC(t,a){return!!(Rr(t,xC).length>a||wc(t))}function Ec(t,a,l,i,o){const u=i.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=yC(t),x=m?o.whitespace??"":f==="AND"?o.and??p??"AND":o.or??p??"OR",y=x?` ${x} `:" ",E=g.map(w=>Rr(w,o)).join(y);return E.length<=l?E:g.map((w,S)=>{const D=Ec(w,a,l,i,o);return S===0?D:x?`${u}${x} ${D}`:`${u}${D}`}).join(`
|
|
283
|
-
`)}case"Group":{if(!bC(t.expression,l)){let m=`(${Rr(t.expression,o)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
|
|
284
|
-
${SC(Ec(t.expression,a+1,l,i,o),a+1,i)}
|
|
285
|
-
${u})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"FieldGroup":{let f=`${t.field}:(${Rr(t.expression,o)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=z0(t,o);return`${f}${m}${Ec(t.expression,a,l,i,o)}`}default:return Rr(t,o)}}function SC(t,a,l){const i=l.repeat(a);return t.split(`
|
|
286
|
-
`).map(o=>o.startsWith(i)?o:i+o).join(`
|
|
287
|
-
`)}function wC(t){return t?To(t):[]}function Bx(t){return t.type==="BooleanExpr"}function To(t){switch(t.type){case"BooleanExpr":return Kh(t);case"Group":{const a=[],l=t.expression;return Bx(l)?(a.push({start:t.start,end:t.end}),a.push(...To(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 Bx(l)&&a.push(...To(l)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...To(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 Kh(t){return t.type==="BooleanExpr"?[...Kh(t.left),...Kh(t.right)]:To(t)}function EC(t,a,l,i){if(t.length===0)return null;if(a>=0&&a<t.length){const o=i==="forward"?a+1:a-1;return o>=0&&o<t.length?{stop:t[o],index:o}:null}if(i==="forward"){for(let o=0;o<t.length;o++)if(t[o].start>=l)return{stop:t[o],index:o};return{stop:t[t.length-1],index:t.length-1}}else{for(let o=t.length-1;o>=0;o--)if(t[o].end<=l)return{stop:t[o],index:o};return{stop:t[0],index:0}}}var NC=class{constructor(t=100){gn(this,"stack",[]);gn(this,"index",-1);gn(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 RC(t,a){const l=i=>(a==null?void 0:a(i))??OT(i);if(t.type==="RANGE"&&t.token){const i=t.token.value,o=(i.endsWith("]")||i.endsWith("}")?i.slice(1,-1):i.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(o)return{mode:"range",start:l(o[1].trim()),end:l(o[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 jC(t,a){var l,i,o,u;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:(((o=t==null?void 0:t.end)==null?void 0:o.getTime())??0)!==(((u=a==null?void 0:a.end)==null?void 0:u.getTime())??0)}function TC({position:t,colors:a,onSelect:l,colorConfig:i,styleConfig:o,datePickerInit:u,fixedWidth:f,datePresets:m,datePickerClassName:p}){const g=v.useRef(null),[x,y]=v.useState(!1);if(v.useEffect(()=>{const S=document.createElement("div");return document.body.appendChild(S),g.current=S,y(!0),()=>{document.body.removeChild(S),g.current=null}},[]),!x||!g.current)return null;const E=Xo(o),w={position:"absolute",zIndex:E.dropdownZIndex,...M0(a,E),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return nl.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:w,onMouseDown:S=>S.preventDefault()},v.createElement(eC,{onSelect:l,colors:i,styles:o,initialMode:u==null?void 0:u.mode,initialStart:u==null?void 0:u.start,initialEnd:u==null?void 0:u.end,presets:m,className:p})),g.current)}function CC(t){const{fields:a,onSearch:l,onChange:i,onValidationChange:o,value:u,defaultValue:f,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:y,placeholder:E,className:w,classNames:S,style:D,dropdown:R,features:z,inputRef:B,datePresets:I,onKeyDown:X,onFocus:W,onBlur:ee,onTab:M,validateValue:T,parseDate:ce,plainModeLength:he,interceptPaste:we,defaultField:Ee,trailingSpaceOnAccept:ne=!0,collapseOnBlur:pe=!1}=t,Re=typeof Ee=="string"?{name:Ee,showFieldSuggestions:!1}:Ee?{showFieldSuggestions:!1,...Ee}:void 0,U=Re==null?void 0:Re.name,H=(R==null?void 0:R.open)??(R==null?void 0:R.mode)??"always",ie=typeof H=="function",ue=ie?null:H,xe=(R==null?void 0:R.alignToInput)??!1,C=R==null?void 0:R.maxSuggestions,V=C||10,J=R==null?void 0:R.suggestDebounceMs,de=parseInt((y==null?void 0:y.dropdownMaxHeight)||"300",10)||300,Se=(z==null?void 0:z.savedSearches)??!!m,je=(z==null?void 0:z.historySearch)??!!p,ze=(R==null?void 0:R.showSavedSearchHint)??Se,ct=(R==null?void 0:R.showHistoryHint)??je,Fe=(R==null?void 0:R.showOperators)!==!1,nt=(ie||ue!=="input")&&(R==null?void 0:R.onNavigation)!==!1,wn=(R==null?void 0:R.navigationDelay)??0,Ft=(R==null?void 0:R.loadingDelay)??0,ht=R==null?void 0:R.renderFieldHint,se=R==null?void 0:R.renderHistoryItem,qe=R==null?void 0:R.renderSavedSearchItem,at=R==null?void 0:R.renderHeader,_t=R==null?void 0:R.renderNoResults,yn=R==null?void 0:R.renderType,Lt=(R==null?void 0:R.autoSelect)??!1,kt=(R==null?void 0:R.homeEndKeys)??!1,Pt=(z==null?void 0:z.multiline)!==!1,$n=(z==null?void 0:z.smartSelectAll)??!1,Fn=(z==null?void 0:z.expandSelection)??!1,an=(z==null?void 0:z.wildcardWrap)??!1,ca=(z==null?void 0:z.clauseNavigation)??!1,da=z==null?void 0:z.formatQuery,ge=!!da,Oe=typeof da=="object"?da:void 0,Ce=v.useMemo(()=>({savedSearches:Se,historySearch:je}),[Se,je]),Be=Array.isArray(a)?a:[],[Ke,fn]=v.useState(Be);v.useEffect(()=>{if(Array.isArray(a)){fn(a);return}let j=!1;return a().then(P=>{j||fn(P)}),()=>{j=!0}},[a]);const Wt=v.useMemo(()=>{const j=new Map;for(const P of Ke)if(j.set(P.name.toLowerCase(),P.type),P.aliases)for(const be of P.aliases)j.set(be.toLowerCase(),P.type);return j},[Ke]),ae=v.useRef(null),[Nt,en]=v.useState(null),nr=v.useCallback(j=>{ae.current=j,en(j)},[]),tn=v.useRef(null),qn=v.useRef(null),_e=v.useRef(u||f||""),Gt=v.useRef(null),qt=v.useRef(!1),xt=v.useRef(!1),zt=v.useRef(new NC),Rt=v.useRef(null),rn=v.useRef(new Set),Xt=v.useRef(null),Ut=v.useRef(null),mt=v.useRef(null),Je=v.useRef(null),En=v.useRef(!1),Mn=v.useRef(null),A=v.useRef(null),_=v.useRef(null),q=v.useRef("input"),K=v.useRef(null),re=v.useRef(-1),Te=v.useRef(()=>{}),me=v.useRef(new Dh(Be,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ct,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));me.current.setDefaultField(Re);const De=v.useRef(new Dx(Be)),Ne=v.useRef(T);Ne.current=T;const[Me,Ue]=v.useState([]),[Pe,Ae]=v.useState(null),[Ze,Ie]=v.useState([]),[Bt,We]=v.useState(-1),[dt,it]=v.useState(!1),[ft,Qt]=v.useState(!1),[Pn,Nn]=v.useState(null),[_n,Ln]=v.useState([]),[Gn,pa]=v.useState(!1),[rl,ea]=v.useState(!_e.current),[hr,Ge]=v.useState(he!=null&&_e.current.length>=he),[wt,Kt]=v.useState(0),[ta,zn]=v.useState(0),[kr,Et]=v.useState(""),[ja,Xn]=v.useState(null),[ql,yi]=v.useState(null),jt=v.useRef({tokens:Me,ast:Pe,suggestions:Ze,selectedSuggestionIndex:Bt,showDropdown:dt,showDatePicker:ft,cursorOffset:wt,selectionEnd:ta,autocompleteContext:kr,validationErrors:_n,cursorContext:ja});jt.current={tokens:Me,ast:Pe,suggestions:Ze,selectedSuggestionIndex:Bt,showDropdown:dt,showDatePicker:ft,cursorOffset:wt,selectionEnd:ta,autocompleteContext:kr,validationErrors:_n,cursorContext:ja};const mr=v.useCallback((j,P)=>{if(xe&&tn.current){const ve=tn.current.getBoundingClientRect();return{top:ve.bottom+window.scrollY+4,left:ve.left+window.scrollX}}const be=_h();return be?Lh(be,j,P):null},[xe]),Qo=v.useCallback(()=>{if(!(!xe||!tn.current))return tn.current.getBoundingClientRect().width},[xe]),ar=v.useCallback((j,P,be="dropdown")=>{const ve=be==="datePicker"?j:Ux(j,de);if(xe&&be!=="datePicker"){it(!0),Nn(mr(ve,P));return}const Ye=requestAnimationFrame(()=>{rn.current.delete(Ye),be==="datePicker"?Qt(!0):it(!0);const oe=_h();Nn(oe?Lh(oe,ve,P):null)});rn.current.add(Ye)},[xe,mr,de]),ll=80,sd=60,vs=v.useCallback((j,P)=>{if(!ae.current)return;const be=Js(j,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:Wt});ae.current.innerHTML=be,document.activeElement===ae.current&&tl(ae.current,P)},[x]),ga=v.useCallback((j,P)=>{const be=he!=null&&j.length>=he;if(Ge(be),be){if(Ue([]),Ae(null),Ln([]),ea(j.length===0),Ie([]),jt.current.tokens=[],it(!1),Qt(!1),ae.current){const ye=Dl(ae.current);ae.current.querySelector("span")&&(ae.current.textContent=j,tl(ae.current,ye)),Kt(ye),zn(ye)}i&&i(j,null),o&&o([]);return}const ve=new ri(j,Ce).tokenize(),Ye=new cs(ve),oe=Ye.parse(),fe=mc([...Ye.getErrors().map(ye=>({message:ye.message,start:ye.start,end:ye.end,type:"SYNTAX_ERROR"})),...De.current.validate(oe,Ne.current,ce,U)]);if(ae.current){const ye=Dl(ae.current);P&&ve.length>ll?(Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(()=>{Ut.current=null,ae.current&&vs(ve,Dl(ae.current))},sd)):(Ut.current&&(clearTimeout(Ut.current),Ut.current=null),vs(ve,ye)),Ue(ve),Ae(oe),Ln(fe),ea(j.length===0),Kt(ye),zn(ye),jt.current.tokens=ve,P&&Te.current(ve,ye)}else Ue(ve),Ae(oe),Ln(fe),ea(j.length===0),jt.current.tokens=ve;i&&i(j,oe),o&&o(fe)},[x,i,o,vs,he]),Il=v.useCallback((j,P)=>{if(!ht||P.type!=="FIELD_VALUE"||!P.fieldName)return j;const be=me.current.resolveField(P.fieldName);if(!be)return j;const ve=ht(be,P.partial);return ve==null?j:j.some(Ye=>Ye.type==="hint")?j.map(Ye=>Ye.type==="hint"?{...Ye,customContent:ve}:Ye):[{text:"",label:"",type:"hint",customContent:ve,replaceStart:P.start??0,replaceEnd:P.end??0},...j]},[ht]),ys=v.useCallback(j=>{if(!_t)return!1;const P=_t({cursorContext:j,partial:j.partial});return P==null?!1:(Ie([{text:"",label:"",type:"noResults",customContent:P,replaceStart:0,replaceEnd:0}]),We(-1),Qt(!1),ar(32,300),!0)},[_t]),va=v.useCallback((j,P,be)=>{var ye,Xe,rt;const ve=me.current.getSuggestions(j,P);Fe||(ve.suggestions=ve.suggestions.filter(He=>He.type!=="operator"));const Ye=ve.context.type;if(Xn(ve.context),ie){if(H({trigger:q.current,context:ve.context,suggestions:ve.suggestions,isOpen:jt.current.showDropdown||jt.current.showDatePicker,value:_e.current,selectionStart:P,selectionEnd:be??P})===!1){it(!1),Qt(!1),Ie([]);return}}else{if(ue==="never"){it(!1),Qt(!1),Ie([]);return}if(ue==="manual"){if(_.current&&_.current!==Ye){_.current=null,it(!1),Qt(!1),Ie([]);return}if(!_.current){it(!1),Qt(!1),Ie([]);return}}if(ue==="input"&&q.current!=="input"&&q.current!=="ctrlSpace"){it(!1),Qt(!1),Ie([]);return}if(ue==="always"&&j.some(He=>(He.type===O.AND||He.type===O.OR||He.type===O.NOT||He.type===O.TILDE||He.type===O.BOOST)&&P>=He.start&&P<=He.end)){it(!1),Qt(!1),Ie([]);return}}const oe=ve.context.fieldName?me.current.resolveField(ve.context.fieldName):void 0,fe=!!(g&&ve.context.type==="FIELD_VALUE"&&ve.context.fieldName&&(oe==null?void 0:oe.type)!=="boolean"&&(oe==null?void 0:oe.suggestions)!==!1)||typeof m=="function"&&ve.context.type==="SAVED_SEARCH"||typeof p=="function"&&ve.context.type==="HISTORY_REF";if(ve.showDatePicker){En.current=!1,(ye=Xt.current)==null||ye.abort(),Gt.current&&clearTimeout(Gt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const He=RC(ve.context,ce),Rn=Mn.current;Mn.current=He,yi(He);const Ot=ve.context.token;Ot&&(Ot.type==="COLON"||Ot.type==="COMPARISON_OP")?A.current={start:Ot.end,end:Ot.end}:Ot?A.current={start:Ot.start,end:Ot.end}:A.current={start:P,end:P},jt.current.showDatePicker&&jC(Rn,He)&&Qt(!1),Ie([]),xe||it(!1),Et(Ye),ar(350,300,"datePicker");return}if(fe){const He=ve.context.token,Rn=He?He.start:P,Ot=He?He.end:P,ra=()=>{Je.current=null,Ie([{text:"",label:"Searching...",type:"loading",replaceStart:Rn,replaceEnd:Ot}]),xe||it(!1),Qt(!1),We(-1),ar(32,300)};Je.current&&clearTimeout(Je.current),Ft>0?Je.current=setTimeout(ra,Ft):ra(),Et(Ye)}else{En.current=!1,(Xe=Xt.current)==null||Xe.abort(),Gt.current&&clearTimeout(Gt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const He=Il(ve.suggestions,ve.context);He.length>0?(Ie(He),xe||it(!1),Qt(!1),We(ve.context.partial||Lt?0:-1),Et(Ye),ar(He.length*32,300)):(Et(Ye),ys(ve.context)||(it(!1),Qt(!1),Ie([])))}if(fe){const He=ve.context.partial,Rn=J||200;En.current=!0,Gt.current&&clearTimeout(Gt.current),(rt=Xt.current)==null||rt.abort();const Ot=new AbortController;Xt.current=Ot,Gt.current=setTimeout(async()=>{const ra=ve.context.token,la=ra?ra.start:P,ya=ra?ra.end:P;try{let jn;if(ve.context.type==="SAVED_SEARCH"&&typeof m=="function"){const hn=await m(He);if(Ot.signal.aborted)return;jn=hn.map(Mt=>({text:Mt.query,label:Mt.label||Mt.query,description:Mt.description,type:"savedSearch",replaceStart:la,replaceEnd:ya,matchPartial:He,sourceData:Mt}))}else if(ve.context.type==="HISTORY_REF"&&typeof p=="function"){const hn=await p(He);if(Ot.signal.aborted)return;jn=hn.map(Mt=>({text:Dh.wrapHistoryQuery(Mt.query),label:Mt.label||Mt.query,description:Mt.description,type:"history",replaceStart:la,replaceEnd:ya,matchPartial:He,sourceData:Mt}))}else{const hn=ve.context.fieldName,Mt=me.current.resolveField(hn),Pl=await g(Mt?Mt.name:hn,He);if(Ot.signal.aborted)return;jn=Pl.map(vr=>({text:vr.text,label:vr.label||vr.text,description:vr.description,type:vr.type,replaceStart:la,replaceEnd:ya,matchPartial:He}))}if(Je.current&&(clearTimeout(Je.current),Je.current=null),jn=jn.slice(0,V),jn.length>0){if(Re!=null&&Re.showFieldSuggestions){const hn=me.current.getFieldSuggestions(He,la,ya);jn=[...jn,...hn].slice(0,V)}Ie(jn),We(He||Lt?0:-1),ar(jn.length*32,300)}else{const hn=me.current.getSuggestions(jt.current.tokens,jt.current.cursorOffset);if(!(He&&ys(hn.context))){const Mt=Il(hn.suggestions.filter(Pl=>Pl.type==="hint"),hn.context);Mt.length>0?(Ie(Mt),We(hn.context.partial||Lt?0:-1),ar(Mt.length*32,300)):ys(hn.context)||(it(!1),Ie([]))}}}catch(jn){Je.current&&(clearTimeout(Je.current),Je.current=null),Ot.signal.aborted||(Ie([{text:"",label:jn instanceof Error?jn.message:"Error loading suggestions",type:"error",replaceStart:la,replaceEnd:ya}]),We(-1),ar(32,300),En.current=!1)}},Rn)}},[g,m,p,J,Il,mr,ar,xe,H,ie,ue,Fe,V,Ft,Lt,ys]);Te.current=va;const ln=v.useCallback(()=>{var j;it(!1),Qt(!1),yi(null),Mn.current=null,A.current=null,Ie([]),We(-1),En.current=!1,(j=Xt.current)==null||j.abort(),Gt.current&&(clearTimeout(Gt.current),Gt.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null),_.current=null},[]),na=v.useCallback((j,P,be)=>{if(mt.current&&(clearTimeout(mt.current),mt.current=null),!nt){(jt.current.showDropdown||jt.current.showDatePicker)&&ln();return}q.current="navigation",wn>0?mt.current=setTimeout(()=>{mt.current=null,va(j,P,be)},wn):va(j,P,be)},[nt,wn,va,ln]),Ta=v.useCallback((j,P,be)=>{_e.current=j,Rt.current&&(clearTimeout(Rt.current),Rt.current=null),zt.current.push({value:j,cursorPos:P});const ve=new ri(j,Ce).tokenize(),Ye=new cs(ve),oe=Ye.parse(),fe=mc([...Ye.getErrors().map(ye=>({message:ye.message,start:ye.start,end:ye.end,type:"SYNTAX_ERROR"})),...De.current.validate(oe,Ne.current,ce,U)]);if(ae.current){const ye=Js(ve,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:Wt});ae.current.innerHTML=ye,tl(ae.current,P)}if(Ue(ve),Ae(oe),Ln(fe),ea(j.length===0),Kt(P),zn(P),it(!1),Qt(!1),i&&i(j,oe),o&&o(fe),be){const ye=requestAnimationFrame(()=>{rn.current.delete(ye),be(ve,oe)});rn.current.add(ye)}},[x,i,o]),Or=v.useCallback((j,P="Enter",be,ve)=>{if(!j)return;const Ye=jt.current,oe=Ye.autocompleteContext,fe=oe==="FIELD_VALUE"||oe==="SAVED_SEARCH"||oe==="HISTORY_REF";if(fe&&(q.current="navigation"),j.type==="hint"&&(j.text==="#"||j.text==="!")){const hn=j.text,Mt=j.replaceStart,Pl=Math.max(j.replaceEnd,Ye.selectionEnd),vr=_e.current.slice(0,Mt),od=_e.current.slice(Pl),Wo=vr+hn+od,eu=vr.length+hn.length;Ta(Wo,eu,(ud,cd)=>{be?be(Wo,cd):va(ud,eu)});return}if(j.type==="hint")return;const ye=Ye.autocompleteContext==="FIELD_VALUE",Xe=Math.min(j.replaceStart,Ye.cursorOffset),rt=Math.max(j.replaceEnd,Ye.selectionEnd),He=_e.current.slice(0,Xe),Rn=_e.current.slice(rt);let Ot="",ra=Rn;fe&&ne&&(Rn.length===0?Ot=" ":/^[ \t\r\n]+$/.test(Rn)&&!Rn.startsWith("\\ ")&&(Ot=" ",ra=""));const la=He+j.text+Ot+ra,ya=He.length+j.text.length+Ot.length,jn=P==="Enter"&&ye;Ta(la,ya,(hn,Mt)=>{be?be(la,Mt):jn?l&&l(la,Mt,ve):va(hn,ya)})},[Ta,va,l,ne]);v.useEffect(()=>{Array.isArray(m)&&me.current.updateSavedSearches(m),Array.isArray(p)&&me.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{me.current=new Dh(Ke,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ct,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),me.current.setDefaultField(Re),De.current=new Dx(Ke),Array.isArray(m)&&me.current.updateSavedSearches(m),Array.isArray(p)&&me.current.updateSearchHistory(p),_e.current&&ga(_e.current,!1)},[Ke,C,ze,ct]),v.useEffect(()=>{B&&B({getValue:()=>_e.current,setValue:j=>{_e.current=j,ga(j,!1)},focus:()=>{var j;return(j=ae.current)==null?void 0:j.focus()},blur:()=>{var j;return(j=ae.current)==null?void 0:j.blur()},getAST:()=>jt.current.ast,getValidationErrors:()=>jt.current.validationErrors,setSelection:(j,P)=>{ae.current&&(ae.current.focus(),el(ae.current,j,P),Kt(j),zn(P))}})},[B,ga]),v.useEffect(()=>{const j=_e.current;zt.current.push({value:j,cursorPos:j.length}),j&&ga(j,!1)},[]),v.useEffect(()=>{u!==void 0&&u!==_e.current&&(_e.current=u,ga(u,!1))},[u,ga]),v.useEffect(()=>()=>{var j;Gt.current&&clearTimeout(Gt.current),Ut.current&&clearTimeout(Ut.current),mt.current&&clearTimeout(mt.current),Je.current&&clearTimeout(Je.current),rn.current.forEach(P=>cancelAnimationFrame(P)),rn.current.clear(),(j=Xt.current)==null||j.abort()},[]),v.useEffect(()=>{if(ie){const j=jt.current;j.cursorContext&&H({trigger:"modeChange",context:j.cursorContext,suggestions:j.suggestions,isOpen:j.showDropdown||j.showDatePicker,value:_e.current,selectionStart:j.cursorOffset,selectionEnd:j.selectionEnd})===!1&&(it(!1),Qt(!1),Ie([]))}else ue==="never"&&(it(!1),Qt(!1),Ie([]));_.current=null},[H]);const pr=v.useRef(!1);v.useLayoutEffect(()=>{if(pr.current){pr.current=!1;return}const j=qn.current;if(!j||!Pn)return;const P=j.getBoundingClientRect(),be=window.innerWidth;if(P.right>be-8){const ve=P.right-be+8;pr.current=!0,Nn(Ye=>Ye&&{...Ye,left:Math.max(8,Ye.left-ve)})}},[Pn,dt,ft,Ze]),v.useEffect(()=>{const j=()=>{const P=jt.current;if(!(!P.showDropdown&&!P.showDatePicker))if(P.showDropdown&&xe&&tn.current){const be=tn.current.getBoundingClientRect();Nn({top:be.bottom+window.scrollY+4,left:be.left+window.scrollX})}else{const be=_h();be&&Nn(Lh(be,P.showDatePicker?350:Ux(P.suggestions.length*32,de),300))}};return window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}},[xe,de]),v.useEffect(()=>{const j=ae.current;if(!j)return;const P=()=>{(jt.current.showDropdown||jt.current.showDatePicker)&&ln()};return j.addEventListener("scroll",P),()=>j.removeEventListener("scroll",P)},[ln]);const Mr=v.useRef(null),xi=v.useRef(x);v.useEffect(()=>{if(!ae.current)return;const j=jt.current.tokens;if(j.length===0||Gn&&ta!==wt)return;const P=Gn?wt:-1,be=x!==xi.current;xi.current=x;const ve=_0(j,P),Ye=ve?`${ve.openStart},${ve.closeStart}`:null;if(Ye===Mr.current&&!be)return;Mr.current=Ye;const oe=Gn?Dl(ae.current):-1,fe=Js(j,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:Wt});ae.current.innerHTML=fe,Gn&&oe>=0&&tl(ae.current,oe)},[wt,ta,Gn,x]);const gr=pe&&!Gn,bi=v.useRef(gr);v.useEffect(()=>{if(!ae.current)return;const j=bi.current;if(bi.current=gr,j!==gr)if(gr)ae.current.innerHTML=ae.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const P=jt.current.tokens;if(P.length>0){const be=Gn?Dl(ae.current):-1,ve=Js(P,x,{cursorOffset:be,tokenClassName:S==null?void 0:S.token,fieldTypeMap:Wt});ae.current.innerHTML=ve,Gn&&be>=0&&tl(ae.current,be)}}},[gr,x]);const Ba=v.useCallback(()=>{if(qt.current||!ae.current)return;K.current=null,re.current=-1,mt.current&&(clearTimeout(mt.current),mt.current=null);let j=CT(ae.current);if(j===_e.current)return;let P=Dl(ae.current);const be=Nx(j);be!==j&&(j=be,P=Math.min(P,j.length)),_e.current=j;const ve=zt.current,Ye=ve.current();if(Ye&&Math.abs(j.length-Ye.value.length)<=2&&Rt.current?ve.replaceCurrent({value:j,cursorPos:P}):ve.push({value:j,cursorPos:P}),Rt.current&&clearTimeout(Rt.current),Rt.current=setTimeout(()=>{Rt.current=null},300),q.current="input",!ie&&ue==="input"){const oe=P>0?j[P-1]:"";if(!oe||oe.trim()===""){ga(j,!1),ln(),ae.current&&pc(ae.current);return}}ga(j,!0),ae.current&&pc(ae.current)},[ga,ie,ue,ln]),rr=v.useCallback(()=>{qt.current=!0},[]),Si=v.useCallback(()=>{qt.current=!1,Ba()},[Ba]),_r=v.useCallback(j=>{if(!j)return;_e.current=j.value;const P=new ri(j.value,Ce).tokenize(),be=new cs(P),ve=be.parse(),Ye=mc([...be.getErrors().map(fe=>({message:fe.message,start:fe.start,end:fe.end,type:"SYNTAX_ERROR"})),...De.current.validate(ve,Ne.current,ce,U)]),oe=j.selStart!=null&&j.selStart!==j.cursorPos;if(ae.current){const fe=Js(P,x,{cursorOffset:j.cursorPos,tokenClassName:S==null?void 0:S.token,fieldTypeMap:Wt});ae.current.innerHTML=fe,oe?el(ae.current,j.selStart,j.cursorPos):tl(ae.current,j.cursorPos)}Ue(P),Ae(ve),Ln(Ye),ea(j.value.length===0),Kt(oe?j.selStart:j.cursorPos),zn(j.cursorPos),ln(),i&&i(j.value,ve),o&&o(Ye)},[x,i,o,ln]),Ha=v.useCallback(()=>{const j=qn.current;if(!j)return 10;const P=j.clientHeight,be=j.querySelectorAll(".ei-dropdown-item")[0];if(!be)return 10;const ve=be.offsetHeight;return ve<=0?10:Math.max(1,Math.floor(P/ve))},[]),wi=v.useCallback(j=>{var ve,Ye;if(X&&X(j),j.defaultPrevented)return;const P=jt.current,be=j.nativeEvent.code;if(ge&&be==="KeyF"&&j.altKey&&j.shiftKey&&!j.ctrlKey&&!j.metaKey){j.preventDefault();const oe=gC(_e.current,Oe);oe!==_e.current&&Ta(oe,oe.length);return}if(ae.current&&ae.current.childNodes.length>40){const oe=window.getSelection();if(oe!=null&&!oe.isCollapsed){const fe=Er(ae.current);if(fe.end-fe.start>20){const ye=j.key==="Backspace"||j.key==="Delete"||j.key==="x"&&(j.ctrlKey||j.metaKey),Xe=!j.ctrlKey&&!j.metaKey&&!j.altKey&&j.key.length===1;(ye||Xe)&&(ae.current.textContent=_e.current,el(ae.current,fe.start,fe.end))}}}{let oe=null,fe=null;if(Rx[j.key])oe=j.key,fe=Rx[j.key];else if(an&&j.key==="*"&&ae.current){const ye=Er(ae.current);if(ye.start!==ye.end){const[Xe,rt]=jx(P.tokens,ye.start,ye.end);if(Xe>=0&&Xe===rt){const He=P.tokens[Xe];(He.type===O.VALUE||He.type===O.WILDCARD)&&(oe="*",fe="*")}}}if(oe&&fe&&ae.current){const ye=Er(ae.current);if(ye.start!==ye.end){j.preventDefault();const{newValue:Xe,newSelStart:rt,newSelEnd:He}=TT(_e.current,ye.start,ye.end,oe,fe),Rn=zt.current,Ot=Rn.current();Ot&&Ot.value===_e.current&&(Ot.selStart=ye.start,Ot.cursorPos=ye.end),_e.current=Xe,Rt.current&&(clearTimeout(Rt.current),Rt.current=null),Rn.push({value:Xe,cursorPos:He,selStart:rt});const ra=new ri(Xe,Ce).tokenize(),la=new cs(ra),ya=la.parse(),jn=mc([...la.getErrors().map(Mt=>({message:Mt.message,start:Mt.start,end:Mt.end,type:"SYNTAX_ERROR"})),...De.current.validate(ya,Ne.current,ce,U)]),hn=Js(ra,x,{cursorOffset:He,tokenClassName:S==null?void 0:S.token,fieldTypeMap:Wt});ae.current.innerHTML=hn,el(ae.current,rt,He),Ue(ra),Ae(ya),Ln(jn),ea(!1),Kt(rt),zn(He),ln(),i&&i(Xe,ya),o&&o(jn);return}}}if(j.key==="z"&&(j.ctrlKey||j.metaKey)&&!j.shiftKey){j.preventDefault(),_r(zt.current.undo());return}if(j.key==="y"&&(j.ctrlKey||j.metaKey)||j.key==="z"&&(j.ctrlKey||j.metaKey)&&j.shiftKey){j.preventDefault(),_r(zt.current.redo());return}if(j.key==="a"&&(j.ctrlKey||j.metaKey)&&$n&&ae.current){const oe=Er(ae.current),fe=cC(P.tokens,oe.start,oe.end);if(fe){j.preventDefault(),el(ae.current,fe.start,fe.end),Kt(fe.start),zn(fe.end);return}}if(Fn&&j.altKey&&j.shiftKey&&(be==="ArrowRight"||be==="ArrowLeft")&&ae.current){const oe=be==="ArrowRight";let fe=K.current;if(!fe){const Xe=Er(ae.current),rt=fC(P.ast,P.tokens,Xe.start);if(rt.length===0)return;fe={ranges:rt,level:-1},K.current=fe}const ye=oe?Math.min(fe.level+1,fe.ranges.length-1):Math.max(fe.level-1,-1);if(ye===fe.level)return;if(fe.level=ye,ye<0){const Xe=Er(ae.current);tl(ae.current,Xe.start),K.current=null}else{j.preventDefault();const Xe=fe.ranges[ye];el(ae.current,Xe.start,Xe.end),Kt(Xe.start),zn(Xe.end)}return}if(K.current=null,ca&&j.ctrlKey&&j.altKey&&(be==="ArrowRight"||be==="ArrowLeft")&&ae.current){j.preventDefault();const oe=be==="ArrowRight"?"forward":"backward",fe=wC(P.ast),ye=Er(ae.current),Xe=oe==="forward"?ye.end:ye.start,rt=EC(fe,re.current,Xe,oe);rt&&(re.current=rt.index,el(ae.current,rt.stop.start,rt.stop.end),Kt(rt.stop.start),zn(rt.stop.end));return}if(re.current=-1,j.key===" "&&(j.ctrlKey||j.metaKey)){j.preventDefault(),q.current="ctrlSpace",!ie&&ue==="manual"&&(_.current=me.current.getSuggestions(P.tokens,P.cursorOffset).context.type),va(P.tokens,P.cursorOffset);return}if(j.key==="Enter"&&(j.ctrlKey||j.metaKey)){j.preventDefault(),ln(),l&&l(_e.current,P.ast,j);return}if(j.key==="Enter"&&j.shiftKey&&Pt){j.preventDefault(),oC();const oe=ae.current?Dl(ae.current):_e.current.length+1,fe=_e.current,ye=fe.slice(0,oe-1)+`
|
|
288
|
-
`+fe.slice(oe-1);_e.current=ye,K.current=null,mt.current&&(clearTimeout(mt.current),mt.current=null),q.current="input",zt.current.push({value:ye,cursorPos:oe}),ga(ye,!0),ae.current&&pc(ae.current);return}if((j.key==="Backspace"||j.key==="Delete")&&ae.current&&!ae.current.textContent){const oe=_e.current;if(!oe)return;const{start:fe,end:ye}=Er(ae.current);let Xe,rt;if(fe!==ye)Xe=oe.slice(0,fe)+oe.slice(ye),rt=fe;else if(j.key==="Backspace"&&fe>0)Xe=oe.slice(0,fe-1)+oe.slice(fe),rt=fe-1;else if(j.key==="Delete"&&fe<oe.length)Xe=oe.slice(0,fe)+oe.slice(fe+1),rt=fe;else return;j.preventDefault(),_e.current=Xe,K.current=null,mt.current&&(clearTimeout(mt.current),mt.current=null),q.current="input",zt.current.push({value:Xe,cursorPos:rt}),tl(ae.current,rt),ga(Xe,!0),ae.current&&pc(ae.current);return}if(xt.current=!1,P.showDropdown&&P.suggestions.length>0)switch(j.key){case"ArrowDown":j.preventDefault(),xt.current=!0,We(oe=>oe>=P.suggestions.length-1?0:oe+1);return;case"ArrowUp":j.preventDefault(),xt.current=!0,We(oe=>oe<=0?P.suggestions.length-1:oe-1);return;case"PageDown":{j.preventDefault(),xt.current=!0;const oe=Ha();We(fe=>Math.min(fe+oe,P.suggestions.length-1));return}case"PageUp":{j.preventDefault(),xt.current=!0;const oe=Ha();We(fe=>Math.max(fe-oe,0));return}case"Home":if(kt&&P.selectedSuggestionIndex>=0){j.preventDefault(),xt.current=!0,We(0);return}break;case"End":if(kt&&P.selectedSuggestionIndex>=0){j.preventDefault(),xt.current=!0,We(P.suggestions.length-1);return}break;case"Enter":if(P.selectedSuggestionIndex>=0){const oe=P.suggestions[P.selectedSuggestionIndex];if(oe.type==="loading"||oe.type==="error"){j.preventDefault(),ln(),l&&l(_e.current,P.ast,j);return}if(oe.type==="hint"&&oe.text!=="#"&&oe.text!=="!"){j.preventDefault(),ln();const fe=_e.current,ye=P.cursorOffset;if(ye<=fe.length&&fe[ye]!==" "){const Xe=fe.slice(0,ye),rt=fe.slice(ye),He=Xe+" "+rt;Ta(He,ye+1,()=>{l&&l(He,P.ast,j)})}else l&&l(fe,P.ast,j);return}j.preventDefault(),Or(oe,"Enter",void 0,j);return}j.preventDefault(),ln(),l&&l(_e.current,P.ast,j);return;case"Tab":if(M){j.preventDefault();const oe=P.selectedSuggestionIndex>=0?P.suggestions[P.selectedSuggestionIndex]:null,fe=oe&&oe.type!=="loading"&&oe.type!=="error"&&!(oe.type==="hint"&&oe.text!=="#"&&oe.text!=="!")?oe:null,ye=M({suggestion:fe,cursorContext:P.cursorContext||{type:"EMPTY",partial:""},query:_e.current});ye.accept&&fe?Or(fe,"Tab",(Xe,rt)=>{var He;ye.submit&&l&&l(Xe,rt,j),ye.blur&&((He=ae.current)==null||He.blur())},j):(ln(),ye.submit&&l&&l(_e.current,P.ast,j),ye.blur&&((ve=ae.current)==null||ve.blur()));return}if(P.selectedSuggestionIndex>=0){const oe=P.suggestions[P.selectedSuggestionIndex];if(oe.type==="hint"&&oe.text!=="#"&&oe.text!=="!"){j.preventDefault(),ln();const fe=_e.current,ye=P.cursorOffset;if(ye<=fe.length&&fe[ye]!==" "){const Xe=fe.slice(0,ye),rt=fe.slice(ye),He=Xe+" "+rt,Rn=ye+1;Ta(He,Rn,Ot=>{va(Ot,Rn)})}return}j.preventDefault(),Or(oe,"Tab",void 0,j);return}break;case"Escape":j.preventDefault(),ln();return}if(j.key==="Tab"&&M){j.preventDefault();const oe=M({suggestion:null,cursorContext:P.cursorContext||{type:"EMPTY",partial:""},query:_e.current});oe.submit&&l&&l(_e.current,P.ast,j),oe.blur&&((Ye=ae.current)==null||Ye.blur());return}if(P.showDatePicker&&j.key==="Escape"){j.preventDefault(),ln();return}if(j.key==="Enter"&&!P.showDropdown&&!P.showDatePicker){j.preventDefault(),l&&l(_e.current,P.ast,j);return}},[l,ln,Or,Ta,_r,Pt,ie,ue,va,X,M,$n,Fn,ca,kt,Ha,ge]),xs=v.useCallback(j=>{if(xt.current){xt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(j.key)){if(!ae.current)return;const P=Er(ae.current);Kt(P.start),zn(P.end),na(jt.current.tokens,P.start,P.end)}},[na]),Ko=v.useCallback(()=>{pa(!0),W==null||W();const j=requestAnimationFrame(()=>{if(rn.current.delete(j),ae.current){const P=jt.current.tokens,be=P.length>0?Dl(ae.current):0;Kt(be),zn(be),na(P,be)}});rn.current.add(j)},[Ba,na,W]),bs=v.useCallback(()=>{var j;pa(!1),it(!1),Qt(!1),Ie([]),En.current=!1,(j=Xt.current)==null||j.abort(),Gt.current&&(clearTimeout(Gt.current),Gt.current=null),Je.current&&(clearTimeout(Je.current),Je.current=null),Kt(-1),ee==null||ee()},[ee]),Lr=v.useRef(!1),Zo=v.useCallback(j=>{if(!ae.current||j.detail!==2&&j.detail!==3)return;if(j.detail===3){if(!jt.current.ast)return;const ye=document.caretRangeFromPoint(j.clientX,j.clientY);if(!ye)return;const Xe=Oo(ae.current,ye.startContainer,ye.startOffset),rt=ET(jt.current.ast,_e.current,Xe);if(!rt||rt.start>=rt.end)return;j.preventDefault(),Lr.current=!0,el(ae.current,rt.start,rt.end);return}j.preventDefault(),Lr.current=!0;const P=document.caretRangeFromPoint(j.clientX,j.clientY);if(!P)return;const be=Oo(ae.current,P.startContainer,P.startOffset),ve=_e.current,Ye=ye=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(ye);let oe=be;for(;oe>0&&Ye(ve[oe-1]);)oe--;let fe=be;for(;fe<ve.length&&Ye(ve[fe]);)fe++;oe<fe&&el(ae.current,oe,fe)},[]),aa=v.useCallback(j=>{Lr.current&&(j.preventDefault(),Lr.current=!1)},[]),zr=v.useCallback(()=>{if(!ae.current)return;const j=Er(ae.current);if(Kt(j.start),zn(j.end),j.start!==j.end){const[P,be]=jx(jt.current.tokens,j.start,j.end);if(P!==be){ln();return}}na(jt.current.tokens,j.start,j.end)},[na,ln]),Ur=v.useCallback(j=>{Rt.current&&(clearTimeout(Rt.current),Rt.current=null),iC(j),Ba()},[Ba]),Vl=v.useCallback(j=>{j.preventDefault();const P=Nx(j.clipboardData.getData("text/plain"));if(we){const be=we(P,j);be!=null&&typeof(be==null?void 0:be.then)=="function"?be.then(ve=>{ve!=null&&Ur(ve)}).catch(()=>{}):be!=null&&Ur(be)}else Ur(P)},[we,Ur]),id=v.useCallback(j=>{q.current="navigation";const P=jt.current,be=A.current,ve=be?be.start:P.cursorOffset,Ye=be?be.end:P.cursorOffset,oe=_e.current.slice(0,ve),fe=_e.current.slice(Ye);let ye="",Xe=fe;ne&&j.length>0&&(fe.length===0?ye=" ":/^[ \t\r\n]+$/.test(fe)&&!fe.startsWith("\\ ")&&(ye=" ",Xe=""));const rt=oe+j+ye+Xe,He=oe.length+j.length+ye.length;Ta(rt,He,Rn=>{ae.current&&ae.current.focus(),va(Rn,He)})},[Ta,va,ne]),sl=Go(x),Yl=Xo(y),Fl=zT(sl,D),Br={...UT(sl,Yl),...Gn?BT(Yl):{}};gr&&(Br.whiteSpace="nowrap",Br.overflow="hidden",Br.textOverflow="ellipsis");const Jo=HT(sl,Yl);return v.createElement("div",{ref:tn,style:Fl,className:za("ei-container",w,S==null?void 0:S.container)},v.createElement("div",{ref:nr,contentEditable:!0,suppressContentEditableWarning:!0,className:za("ei-editor",S==null?void 0:S.editor),style:Br,onInput:Ba,onKeyDown:wi,onKeyUp:xs,onMouseDown:Zo,onMouseUp:aa,onFocus:Ko,onBlur:bs,onClick:zr,onPaste:Vl,onCompositionStart:rr,onCompositionEnd:Si,spellCheck:!1}),rl&&!Gn?v.createElement("div",{className:za("ei-placeholder",S==null?void 0:S.placeholder),style:Jo},E):null,v.createElement(sC,{errors:_n,editorRef:Nt,cursorOffset:wt,colors:x,styles:y,containerRef:tn.current,classNames:S?{squiggly:S.squiggly,tooltip:S.tooltip}:void 0}),v.createElement(JT,{suggestions:Ze,selectedIndex:Bt,onSelect:j=>Or(j,"Tab"),position:Pn,colors:x,styles:y,visible:dt,fixedWidth:Qo(),renderHistoryItem:se,renderSavedSearchItem:qe,renderDropdownHeader:at,cursorContext:ja,listRefCallback:j=>{qn.current=j},renderType:yn,classNames:S?{dropdown:S.dropdown,dropdownHeader:S.dropdownHeader,dropdownItem:S.dropdownItem}:void 0}),ft&&Pn?v.createElement(TC,{position:Pn,colors:sl,onSelect:id,colorConfig:x,styleConfig:y,datePickerInit:ql,fixedWidth:void 0,datePresets:I,datePickerClassName:S==null?void 0:S.datePicker}):null)}const DC=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function Hx(t){var o;const a=window.getSelection();if(!a||a.rangeCount===0)return((o=t.textContent)==null?void 0:o.length)??0;const l=a.getRangeAt(0),i=l.cloneRange();return i.selectNodeContents(t),i.setEnd(l.endContainer,l.endOffset),i.toString().length}function AC(t){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const l=a.key.toLowerCase(),i=a.currentTarget,o=i.isContentEditable?i:i.querySelector("[contenteditable='true'], [contenteditable]")??i,u=t.current;if(l==="h"&&u){a.preventDefault();const m=u.getValue();let p=Hx(o);(p<0||p>m.length)&&(p=m.length),p>0&&(u.setValue(m.slice(0,p-1)+m.slice(p)),u.setSelection(p-1,p-1));return}if(l==="u"&&u){a.preventDefault();const m=u.getValue();let p=Hx(o);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&&(u.setValue(m.slice(0,g)+m.slice(p)),u.setSelection(g,g));return}const f=l==="j"?"ArrowDown":l==="k"?"ArrowUp":null;f&&(a.preventDefault(),o.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function zh(t){return String(t>0?t:0).padStart(3,"0")}function kC({features:t,phases:a,query:l,onQuery:i}){const o=v.useRef(null),u=AC(o),f=v.useMemo(()=>[{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 y=[...new Set(t.map(R=>R.number))].sort((R,z)=>R-z),E=[...new Set(a.map(R=>R.number))].sort((R,z)=>R-z),w=[...new Set(a.flatMap(R=>R.tasks.map(z=>z.number)))].sort((R,z)=>R-z),S=[...new Set([...t.map(R=>R.shortId),...a.flatMap(R=>[R.shortId,...R.tasks.map(z=>z.shortId)])].filter(Boolean))],D=[...new Set(a.flatMap(R=>R.tasks.map(z=>z.title)))];return{featureNums:y,phaseNums:E,taskNums:w,shortIds:S,titles:D}},[t,a]),p=v.useCallback(async(y,E)=>{const w=E.toLowerCase();return y==="feature"?m.featureNums.filter(S=>String(S).startsWith(E)).slice(0,20).map(S=>({text:String(S),label:`F${zh(S)}`})):y==="phase"?m.phaseNums.filter(S=>String(S).startsWith(E)).slice(0,20).map(S=>({text:String(S),label:`P${zh(S)}`})):y==="task"?m.taskNums.filter(S=>String(S).startsWith(E)).slice(0,20).map(S=>({text:String(S),label:`T${zh(S)}`})):y==="id"?m.shortIds.filter(S=>S.toLowerCase().startsWith(w)).slice(0,20).map(S=>({text:S,label:S})):y==="status"||y==="feature-status"||y==="phase-status"?DC.filter(S=>S.startsWith(w)).map(S=>({text:S,label:S})):y==="title"?m.titles.filter(S=>S.toLowerCase().includes(w)).slice(0,20).map(S=>({text:S,label:S.length>44?S.slice(0,44)+"…":S})):[]},[m]),g=v.useCallback(y=>i(y),[i]),x=v.useCallback(y=>{o.current=y},[]);return c.jsx("div",{className:"search-bar",children:c.jsx(CC,{fields:f,value:l,onChange:g,onSearch:g,fetchSuggestions:p,onKeyDown:u,inputRef:x,placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function OC(t,a){if(Object.keys(a).length===0)return t;const l=u=>{const f=a[u];return f?new Map(f.map((m,p)=>[m,p])):null},i=l("__features__");return(i?[...t].sort((u,f)=>(i.get(u.feature.id)??1/0)-(i.get(f.feature.id)??1/0)):t).map(u=>{const f=l(`phase-scope:${u.feature.id}`),m=f?[...u.allPhases].sort((p,g)=>(f.get(p.phase.id)??1/0)-(f.get(g.phase.id)??1/0)):u.allPhases;return{...u,allPhases:m.map(p=>{const g=l(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((y,E)=>(g.get(y.id)??1/0)-(g.get(E.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}const MC=[{value:"priority",label:"Priority"},{value:"number",label:"Number"},{value:"createdAt",label:"Created date"},{value:"updatedAt",label:"Updated date"},{value:"title",label:"Title"},{value:"shortId",label:"Short ID"},{value:"status",label:"Status"},{value:"startedAt",label:"Started (tasks)"},{value:"completedAt",label:"Completed (tasks)"}];function _C({sort:t,onChange:a}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("label",{htmlFor:"work-tree-sort",className:"hidden text-xs text-[var(--text-muted)] sm:inline",children:"Sort by"}),c.jsxs("div",{className:"inline-flex h-9 items-center gap-1 rounded-lg border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1 shadow-sm",children:[c.jsxs("div",{className:"relative",children:[c.jsx("select",{id:"work-tree-sort",value:t.key,onChange:l=>a({key:l.target.value,direction:t.direction}),className:"h-7 w-full min-w-[7.5rem] cursor-pointer appearance-none border-0 bg-transparent pr-6 pl-1 text-xs font-medium text-[var(--text)] outline-none hover:text-[var(--accent)] sm:w-auto",children:MC.map(l=>c.jsx("option",{value:l.value,children:l.label},l.value))}),c.jsx(ps,{className:"pointer-events-none absolute right-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]","aria-hidden":"true"})]}),c.jsx("button",{type:"button",onClick:()=>a({key:t.key,direction:t.direction==="asc"?"desc":"asc"}),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[var(--text-muted)] transition hover:bg-[var(--surface-strong)] hover:text-[var(--text)]","aria-label":`Sort direction: ${t.direction}`,title:`Sort direction: ${t.direction}`,children:t.direction==="asc"?c.jsx(cN,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.jsx(iN,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})}function LC({features:t,phases:a,activeTasks:l,projectStorageScope:i}){const o=yT({features:t,phases:a,projectStorageScope:i}),[u,f]=v.useState({});v.useEffect(()=>{f({})},[o.displayedWorkTree]);const m=v.useMemo(()=>OC(o.displayedWorkTree,u),[o.displayedWorkTree,u]),[p,g]=v.useState(!1),[x,y]=v.useState(null),[E,w]=v.useState(null),S=ne=>w(String(ne.active.id)),[D,R]=v.useState(0);v.useEffect(()=>{const ne=document.querySelector("header");if(!ne)return;const pe=()=>R(ne.offsetHeight);pe();const Re=new ResizeObserver(pe);return Re.observe(ne),window.addEventListener("resize",pe),()=>{Re.disconnect(),window.removeEventListener("resize",pe)}},[]),v.useEffect(()=>{const ne=window.setTimeout(()=>{const pe=document.querySelector(".ap-search-sticky"),Re=document.querySelector("header");if(!pe||!Re)return;const U=pe.getBoundingClientRect();if(U.top<0){const H=U.top+window.scrollY-Re.offsetHeight;window.scrollTo({top:Math.max(0,H),behavior:"smooth"})}},60);return()=>window.clearTimeout(ne)},[o.searchQuery,o.hideDone,o.hidePlanned,o.onlyActiveBranches]);const z=L2(_2(Cm,{activationConstraint:{distance:5}})),B=async ne=>{const{active:pe,over:Re}=ne;if(w(null),!Re||pe.id===Re.id)return;const U=String(pe.id),H=String(Re.id),ie=m.map(ue=>ue.feature.id);if(ie.includes(U)&&ie.includes(H)){const ue=jo(ie,ie.indexOf(U),ie.indexOf(H)),xe=ue.indexOf(U),C=xe>0?ue[xe-1]??null:null,V=xe<ue.length-1?ue[xe+1]??null:null;f(J=>({...J,__features__:ue})),await yh("feature",U,C,V).catch(()=>{});return}for(const ue of m){const xe=ue.allPhases.map(C=>C.phase.id);if(xe.includes(U)&&xe.includes(H)){const C=jo(xe,xe.indexOf(U),xe.indexOf(H)),V=C.indexOf(U),J=V>0?C[V-1]??null:null,de=V<C.length-1?C[V+1]??null:null;f(Se=>({...Se,[`phase-scope:${ue.feature.id}`]:C})),await yh("phase",U,J,de).catch(()=>{});return}}for(const ue of m)for(const xe of ue.allPhases){const C=xe.allTasks.map(V=>V.id);if(C.includes(U)&&C.includes(H)){const V=jo(C,C.indexOf(U),C.indexOf(H)),J=V.indexOf(U),de=J>0?V[J-1]??null:null,Se=J<V.length-1?V[J+1]??null:null;f(je=>({...je,[`task-scope:${xe.phase.id}`]:V})),await yh("task",U,de,Se).catch(()=>{});return}}},I=ne=>o.expandedPhaseIds.includes(ne),X=ne=>o.recentPhaseIds.includes(ne),W=ne=>o.recentTaskIds.includes(ne),[ee,M]=Ho(),[T,ce]=v.useState(null),he=ee.get("locate"),we=he?parseInt(he.replace(/^T/i,""),10):null;v.useEffect(()=>{if(we==null||Number.isNaN(we))return;const ne=a.flatMap(H=>H.tasks.map(ie=>({t:ie,p:H}))).find(({t:H})=>H.number===we);if(!ne){M(H=>(H.delete("locate"),H),{replace:!0});return}const{t:pe,p:Re}=ne;if(o.onlyActiveBranches&&o.setOnlyActiveBranches(!1),o.hideDone&&o.setHideDone(!1),o.searchQuery&&o.setSearchQuery(""),o.setTreeOpenMode("all"),Re.featureId){const H=Re.featureId;o.expandedFeatureIds.includes(H)||o.setExpandedFeatureIds(ie=>ie.includes(H)?ie:[...ie,H])}o.expandedPhaseIds.includes(Re.id)||o.setExpandedPhaseIds(H=>H.includes(Re.id)?H:[...H,Re.id]);const U=document.getElementById(`task-row-${we}`);if(U){const H=document.querySelector("header"),ie=document.querySelector(".ap-search-sticky"),ue=((H==null?void 0:H.offsetHeight)??0)+((ie==null?void 0:ie.offsetHeight)??0)+12,xe=U.getBoundingClientRect().top+window.scrollY-ue;window.scrollTo({top:Math.max(0,xe),behavior:"smooth"}),ce(pe.id);const C=window.setTimeout(()=>ce(null),2500);return M(V=>(V.delete("locate"),V),{replace:!0}),()=>window.clearTimeout(C)}},[we,a,o.expandedFeatureIds,o.expandedPhaseIds,o.onlyActiveBranches,o.hideDone,o.searchQuery,o.treeOpenMode]);const Ee=()=>{if(!E)return null;for(const ne of m){if(ne.feature.id===E)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(al,{featureNum:ne.feature.number}),c.jsx(Za,{status:ne.feature.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ne.feature.name})]});for(const pe of ne.allPhases){if(pe.phase.id===E)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(al,{featureNum:ne.feature.number,phaseNum:pe.phase.number}),c.jsx(Za,{status:pe.phase.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:pe.phase.title})]});for(const Re of pe.allTasks)if(Re.id===E)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(al,{featureNum:ne.feature.number,phaseNum:pe.phase.number,taskNum:Re.number}),c.jsx(Za,{status:Re.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:Re.title})]})}}return null};return c.jsxs(nn,{className:"grid gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ut,{type:"button",variant:"secondary",className:"w-full sm:w-[12rem] justify-center",onClick:()=>o.expandAll(),children:"Expand all"}),c.jsx(ut,{type:"button",variant:"secondary",className:"w-full sm:w-[12rem] justify-center",onClick:()=>o.setTreeOpenMode("none"),children:"Collapse all"})]})]}),c.jsxs("div",{className:"ap-search-sticky z-20 grid gap-3",style:{top:D},children:[c.jsx(kC,{features:t,phases:a,query:o.searchQuery,onQuery:o.setSearchQuery}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsx(_C,{sort:o.sort,onChange:o.setSort}),o.searchActive?c.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:[o.matchedTaskIds.size," match",o.matchedTaskIds.size===1?"":"es"," — clear the box to reset."]}):null]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 rounded-[14px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 sm:grid-cols-3 sm:rounded-[18px] sm:px-4 sm:py-3 lg:grid-cols-5",children:[c.jsx("button",{type:"button",onClick:()=>o.setHideDone(ne=>!ne),className:`status-chip transition !h-11 !w-full !justify-center !px-4 !py-2 !text-sm ${o.hideDone?"status-done":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Hide done"}),c.jsx("button",{type:"button",onClick:()=>o.setHidePlanned(ne=>!ne),className:`status-chip transition !h-11 !w-full !justify-center !px-4 !py-2 !text-sm ${o.hidePlanned?"status-planned":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Hide planned"}),c.jsx("button",{type:"button",onClick:()=>o.setOnlyActiveBranches(ne=>!ne),className:`status-chip transition !h-11 !w-full !justify-center !px-4 !py-2 !text-sm ${o.onlyActiveBranches?"status-in-progress":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Only active"}),c.jsx(ut,{type:"button",variant:"secondary",className:"!h-11 !w-full !justify-center !px-4 !py-2 !text-sm",onClick:o.resetFilters,children:"Reset"}),c.jsx(ut,{type:"button",variant:"secondary",className:"!h-11 !w-full !justify-center !px-4 !py-2 !text-sm",disabled:p,onClick:async()=>{g(!0),y(null);try{const ne=await SR(),pe=ne.migrated,Re=ne.integrity.duplicatePhaseIds.length,U=ne.integrity.danglingPhaseIds.length;y(`Repair done: renamed ${pe.renamed}, repaired ${pe.repaired} refs, inferred ${pe.inferred}. Integrity: ${Re} duplicate, ${U} dangling.`)}catch(ne){y(`Repair failed: ${ne instanceof Error?ne.message:String(ne)}`)}finally{g(!1)}},children:p?"Repairing…":"Repair"}),x?c.jsx("span",{className:"hidden text-xs text-[var(--text-muted)] sm:inline sm:truncate",children:x}):null]})]}),c.jsx("div",{className:"grid gap-3",children:m.length>0?c.jsxs(Lj,{sensors:z,collisionDetection:q2,onDragStart:S,onDragEnd:B,children:[c.jsx(km,{items:m.map(ne=>ne.feature.id),strategy:Am,children:m.map(ne=>c.jsx(_m,{id:ne.feature.id,children:c.jsx(bT,{entry:ne,expanded:o.expandedFeatureIds.includes(ne.feature.id),recentlyChanged:o.recentFeatureIds.includes(ne.feature.id),onToggle:()=>o.toggleExpandedFeature(ne.feature.id),isPhaseExpanded:I,onTogglePhase:o.toggleExpandedPhase,isPhaseRecentlyChanged:X,isTaskRecentlyChanged:W,highlightedTaskIds:(()=>{const pe=o.searchActive?o.matchedTaskIds:void 0;if(!T)return pe;const Re=new Set(pe??[]);return Re.add(T),Re})()})},ne.feature.id))}),c.jsx(eT,{dropAnimation:{duration:150,easing:"ease"},children:Ee()})]}):l.length>0?l.map(ne=>{const pe=ne.featureId?`/features/${ne.featureId}/phases/${ne.phaseId}/tasks/${ne.id}`:"/features";return c.jsxs(Qe,{to:pe,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[ne.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,c.jsxs("span",{className:"truncate",children:["T",g2(ne.number)," — ",ne.title]})]}),c.jsx(Za,{status:ne.status})]}),c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:ne.phaseId})]},ne.id)}):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function zC(){const{features:t,phases:a,activeTasks:l}=zl(),{project:i}=ms("root"),o=Dr(),u=()=>o("/project/edit");On("edit",u);const f=i.projectRoot||i.planRoot||i.name||"default";return c.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[c.jsx(nn,{className:"grid grid-cols-1 gap-4",children:c.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Project Goal"}),i.goal?c.jsx(kn,{text:i.goal,className:"mt-2 max-w-4xl"}):c.jsx("p",{className:"mt-2 max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),c.jsxs(ut,{type:"button",shortcut:"edit",onClick:u,className:"self-start md:self-center",children:[c.jsx(fs,{className:"h-4 w-4"}),"Edit project"]})]})}),c.jsx(JR,{project:i}),c.jsx(x2,{features:t,phases:a}),c.jsx(LC,{features:t,phases:a,activeTasks:l,projectStorageScope:f}),c.jsx(l2,{features:t,phases:a}),c.jsx(i2,{features:t,phases:a})]})}async function UC(){const[t,a]=await Promise.all([Ib(),Xc()]);return{features:t,phases:a}}function Mo(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function Lc(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 BC(t){const a=Mo();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 U0(t){const a=Mo();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 HC(t){const a=Mo();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 $C({feature:t,phases:a,phasesCount:l,tasksCount:i,phaseSummary:o,taskSummary:u,activity:f}){var z;const m=ds(),p=ds(),x=((z=m.formData)==null?void 0:z.get("status"))??t.status,y=m.state!=="idle",E=p.state!=="idle",w=Lc(o),S=Lc(u),D=a0(a??[]),R=t.description||(f?`${f.doneTasks}/${i} done · ${f.remainingTasks} left${f.blockedTasks?` · ${f.blockedTasks} blocked`:""}`:"");return c.jsxs("div",{className:`surface-card px-4 py-2 ${bm(D.displayStatus)}`,children:[c.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:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hi,{type:"feature",number:t.number}),c.jsx("span",{className:"shrink-0",children:c.jsx(qo,{status:D.displayStatus,breakdown:D.breakdown})})]}),c.jsx(Qe,{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})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[c.jsx(Qe,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:c.jsx(ut,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(p.Form,{method:"post",action:`/features/${t.id}/delete`,onSubmit:B=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||B.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",disabled:E||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(oi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l," phases"]}),w?c.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[i," tasks"]}),S?c.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),c.jsx(m.Form,{method:"post",action:`/features/${t.id}/status`,className:"w-full xl:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:x,disabled:y||E,"aria-busy":y,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:B=>m.submit(B.currentTarget.form),children:nd.map(B=>c.jsx("option",{value:B.value,children:B.label},B.value))}),c.jsx(ps,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Qe,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:c.jsx(ut,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(p.Form,{method:"post",action:`/features/${t.id}/delete`,className:"hidden xl:block",onSubmit:B=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||B.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",disabled:E||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(oi,{className:"h-4 w-4"})})})]}),R?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:R}):null]})}const qC={feature:{label:"Feature",Icon:jc},phase:{label:"Phase",Icon:LN},task:{label:"Task",Icon:Yc},requirement:{label:"Requirement",Icon:Hb}};function B0({kind:t,label:a}){const{Icon:l,label:i}=qC[t];return c.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[c.jsx(l,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:a??i})]})}function Ra({className:t="",...a}){return c.jsx("input",{className:`field-control ${t}`,...a})}function gs({className:t="",...a}){return c.jsx("select",{className:`field-control ${t}`,...a})}function rd({query:t,status:a,statusOptions:l,placeholder:i,clearTo:o,resultsLabel:u}){const f=hm();return c.jsxs(ua,{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:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),c.jsx(Ra,{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)})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),c.jsxs("div",{className:"relative",children:[c.jsxs(gs,{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:[c.jsx("option",{value:"",children:"All statuses"}),l.map(m=>c.jsx("option",{value:m.value,children:m.label},m.value))]}),c.jsx(ps,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}),c.jsx(ut,{type:"submit",variant:"secondary",children:"Apply filters"}),c.jsx(Qe,{to:o,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"}),c.jsx("div",{className:"text-sm text-[var(--text-muted)] md:col-span-4",children:u})]})}function ld(t,a){const l=t.trim().toLowerCase();return l?a.some(i=>i==null?void 0:i.toLowerCase().includes(l)):!0}function IC(t){const a=new Map;for(const f of t)f.featureId&&a.set(f.featureId,[...a.get(f.featureId)??[],f]);const l=new Map,i=new Map,o=new Map,u=new Map;for(const[f,m]of a)l.set(f,m.length),i.set(f,m.reduce((p,g)=>p+g.tasks.length,0)),o.set(f,BC(m)),u.set(f,U0(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,phasesCountByFeature:l,tasksCountByFeature:i,phaseSummaryByFeature:o,taskSummaryByFeature:u}}function VC(){var w,S;const{features:t,phases:a}=zl(),{phasesByFeature:l,phasesCountByFeature:i,tasksCountByFeature:o,phaseSummaryByFeature:u,taskSummaryByFeature:f}=IC(a),m=Dr(),[p]=Ho(),g=((w=p.get("q"))==null?void 0:w.trim())??"",x=((S=p.get("status"))==null?void 0:S.trim())??"",y=v.useCallback(()=>m("new"),[m]);On("create",y);const E=v.useMemo(()=>t.filter(D=>(!x||D.status===x)&&ld(g,[D.name,D.id,D.description])),[t,g,x]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(nn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(B0,{kind:"feature",label:"Features"}),c.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."})]}),c.jsx(Qe,{to:"new",children:c.jsx(ut,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),c.jsx(rd,{query:g,status:x,statusOptions:nd,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:E.length===t.length?`${t.length} features`:`${E.length} of ${t.length} features`}),c.jsx("div",{className:"grid gap-3",children:t.length===0?c.jsxs(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",c.jsx(Qe,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):E.length>0?E.map(D=>c.jsx($C,{feature:D,phases:l.get(D.id),phasesCount:i.get(D.id)??0,tasksCount:o.get(D.id)??0,phaseSummary:u.get(D.id)??Mo(),taskSummary:f.get(D.id)??Mo()},D.id)):c.jsx(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),c.jsx(di,{})]})}async function YC(){const[t,a]=await Promise.all([gm(),Xc()]);return{requirements:t,phases:a}}function vo(...t){return t.filter(Boolean).join(" ")}function FC(){return c.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] shadow-sm transition group-open:rotate-180 group-hover:border-[var(--accent)] group-hover:text-[var(--accent)]",children:c.jsx(ps,{className:"h-5 w-5"})})}function ha({title:t,subtitle:a,leading:l,actions:i,defaultOpen:o=!0,count:u,className:f,summaryClassName:m,contentClassName:p,titleClassName:g,subtitleClassName:x,children:y}){return c.jsxs("details",{className:vo("group mt-4 overflow-hidden rounded-lg border border-[var(--border)]",f),open:o,children:[c.jsxs("summary",{className:vo("flex min-w-0 list-none cursor-pointer items-start justify-between gap-3 bg-[var(--surface-elevated)] p-4 text-left text-[var(--text)] transition-colors select-none hover:bg-[var(--surface-strong)] [&::-webkit-details-marker]:hidden",m),children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l?c.jsx("div",{className:"shrink-0 pt-0.5",children:l}):null,c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:vo("flex flex-wrap items-center gap-2 text-sm font-semibold",g),children:[t,u!==void 0?c.jsxs("span",{className:"text-[var(--text-subtle)]",children:["(",u,")"]}):null]}),a?c.jsx("div",{className:vo("mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",x),children:a}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i,c.jsx(FC,{})]})]}),c.jsx("div",{className:vo("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:y})]})}function $x(t){return`P${String(t.number??0).padStart(3,"0")}`}function PC(){var g,x;const{requirements:t,phases:a}=zl(),l=Dr(),[i]=Ho(),o=((g=i.get("q"))==null?void 0:g.trim())??"",u=((x=i.get("status"))==null?void 0:x.trim())??"",f=v.useCallback(()=>l("new"),[l]);On("create",f);const m=v.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),p=v.useMemo(()=>t.filter(y=>{const E=y.linkedPhaseIds.map(w=>{const S=m.get(w);return S?`${$x(S)} ${S.title} ${S.summary}`:w});return(!u||y.status===u)&&ld(o,[y.title,y.description,y.id,...E])}),[t,m,o,u]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(nn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(B0,{kind:"requirement",label:"Requirements"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Track top-level outcomes independently from features, then link them to the phases that deliver them."})]}),c.jsx(Qe,{to:"new",children:c.jsx(ut,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),c.jsx(rd,{query:o,status:u,statusOptions:Om,placeholder:"Search requirement title, description, id, or linked phase",clearTo:"/requirements",resultsLabel:p.length===t.length?`${t.length} requirements`:`${p.length} of ${t.length} requirements`}),c.jsx("div",{className:"grid gap-3",children:t.length===0?c.jsxs(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",c.jsx(Qe,{to:"/requirements/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first requirement"})]}):p.length>0?p.map(y=>{const E=y.linkedPhaseIds.map(w=>m.get(w)).filter(Boolean);return c.jsx(nn,{className:"overflow-hidden p-0",children:c.jsxs(ha,{defaultOpen:!1,leading:c.jsx(Za,{status:y.status}),title:c.jsx("h2",{className:"min-w-0 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:y.title}),count:E.length,contentClassName:"grid gap-4",subtitle:c.jsxs(c.Fragment,{children:[E.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[E.length," linked phase",E.length===1?"":"s"]}):null,E.length>0&&y.macroTasks.length>0?c.jsx("span",{className:"mx-2 text-[var(--text-subtle)]",children:"•"}):null,y.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[y.macroTasks.length," macro task",y.macroTasks.length===1?"":"s"]}):null]}),summaryClassName:"hover:bg-[var(--surface-elevated)]/65",children:[c.jsxs("div",{className:"flex min-w-0 flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsx("div",{className:"min-w-0",children:y.description?c.jsx("p",{className:"min-w-0 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:y.description}):null}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[c.jsx(Qe,{to:`${y.id}/edit`,children:c.jsx(ut,{type:"button",variant:"secondary",children:"Edit"})}),c.jsx(ua,{method:"post",action:`/requirements/${y.id}/delete`,onSubmit:w=>{window.confirm(`Delete requirement "${y.title}"?`)||w.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",children:"Delete"})})]})]}),E.length>0?c.jsxs("div",{className:"grid gap-2",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Linked phases"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:E.map(w=>{const S=w.featureId?`/features/${w.featureId}/phases/${w.id}`:"/features";return c.jsx(Qe,{to:S,className:"inline-flex max-w-full items-center rounded-full border border-[var(--border)] bg-[var(--surface-elevated)] px-3 py-1.5 text-sm text-[var(--text)] transition hover:border-[var(--accent)] hover:text-[var(--accent)]",children:c.jsxs("span",{className:"[overflow-wrap:anywhere]",children:[$x(w)," — ",w.title]})},w.id)})})]}):c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"No linked phases yet."})]})},y.id)}):c.jsx(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),c.jsx(di,{})]})}async function GC({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[l,i]=await Promise.all([$o(a),Xc(a)]);return{feature:l,phases:i}}function XC({featureId:t,feature:a,phase:l}){var y;const i=ds(),o=ds(),f=((y=i.formData)==null?void 0:y.get("status"))??l.status,m=i.state!=="idle",p=o.state!=="idle",g=Lc(U0(l.tasks)),x=r0(l.tasks);return c.jsxs("div",{className:`surface-card px-4 py-2 ${bm(x.displayStatus)}`,children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hi,{type:"phase",number:l.number}),c.jsx(ui,{type:"phase",featureNum:a.number}),l.handoff?c.jsx(ym,{phaseId:l.id,updatedAt:l.handoffUpdatedAt}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(qo,{status:x.displayStatus,breakdown:x.breakdown})})]}),c.jsx(Qe,{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})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[c.jsx(Qe,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,children:c.jsx(ut,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,onSubmit:E=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||E.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:c.jsx(oi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l.tasks.length," tasks"]}),g?c.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),c.jsx(i.Form,{method:"post",action:`/features/${t}/phases/${l.id}/status`,className:"w-full lg:w-auto",children:c.jsxs("div",{className:"relative",children:[c.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:E=>i.submit(E.currentTarget.form),children:ad.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx(ps,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Qe,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,className:"hidden lg:block",children:c.jsx(ut,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,className:"hidden lg:block",onSubmit:E=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||E.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:c.jsx(oi,{className:"h-4 w-4"})})})]}),l.summary?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.summary}):null]})}function Um({items:t,className:a="",stacked:l=!1}){return l?c.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${a}`,children:t.map((i,o)=>{const u=o===t.length-1,f=i.to&&!u?c.jsx(Qe,{to:i.to,className:"font-semibold text-[var(--accent)] hover:underline break-words min-w-0",children:i.label}):c.jsx("span",{className:`break-words min-w-0 ${u?"text-[var(--text)] font-semibold":"text-[var(--text-muted)]"}`,children:i.label});return c.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[i.kind?c.jsxs("span",{className:"shrink-0 text-[var(--text-subtle)] font-medium",children:[i.kind,":"]}):null,c.jsx("span",{className:"min-w-0",children:f})]},`${i.label}-${o}`)})}):c.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:t.map((i,o)=>{const u=o===t.length-1,f=i.to&&!u?c.jsx(Qe,{to:i.to,className:"font-semibold text-[var(--accent)] hover:underline",children:i.label}):c.jsx("span",{className:u?"text-[var(--text)]":"text-[var(--text-muted)]",children:i.label});return c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[o>0?c.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,c.jsx("span",{className:"min-w-0 break-words",children:f})]},`${i.label}-${o}`)})})}function Bn({className:t="",children:a,...l}){return c.jsx("div",{className:`surface-card p-4 ${t}`,...l,children:a})}function qx(...t){return t.filter(Boolean).join(" ")}function Bm({items:t,className:a}){const l=t.filter(i=>i.visible!==!1);return l.length===0?null:c.jsx("div",{className:qx("grid gap-4 md:grid-cols-2 xl:grid-cols-4",a),children:l.map(i=>c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:i.label}),c.jsx("div",{className:qx("mt-2 text-sm font-semibold break-words text-[var(--text)] [overflow-wrap:anywhere]",i.valueClassName),children:i.value})]},i.label))})}function Hm(t){return t&&t>0?`P${t}`:""}function QC(t,a){return!t&&!a?"":`${t||"Start not set"} → ${a||"End not set"}`}function $m({decisions:t}){return t.length===0?null:c.jsxs("details",{className:"group mt-4",children:[c.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:c.jsxs("span",{children:["Accepted decisions (",t.length,")"]})}),c.jsx("div",{className:"mt-2 grid gap-3",children:t.map(a=>c.jsxs("div",{className:"surface-card px-4 py-3",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?c.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),c.jsx(kn,{text:a.decision,className:"mt-1"})]}):null,a.rationale?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),c.jsx(kn,{text:a.rationale,className:"mt-1"})]}):null,a.implementationNotes?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),c.jsx(kn,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}const KC={draft:SN,discovery:JN,planned:Yc,"in-progress":zb,done:mm,blocked:Bb,waiting:Lb,deferred:nR,canceled:Ob,rejected:EN};function Uh(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Ix(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}const ZC=new Set(["canceled","rejected"]);function qm({statusLog:t,currentStatus:a,backbone:l,createdAt:i,updatedAt:o,startedAt:u,completedAt:f}){const m=[];if(t.length===0){const S=l.indexOf(a);if(S>=0)for(let D=0;D<=S;D++)m.push(l[D]);else m.push(a)}else{const S=t[0];S&&m.push(S.fromStatus);for(const D of t)m[m.length-1]!==D.toStatus&&m.push(D.toStatus)}m[m.length-1]!==a&&m.push(a);const p=new Set(m),g=a==="done"||ZC.has(a),x=S=>{var R,z;if(t.length>0){if(S===((R=t[0])==null?void 0:R.fromStatus))return((z=t[0])==null?void 0:z.date)??"";for(const B of t)if(B.toStatus===S)return B.date;return""}const D=l[0];return S===D?i??"":S==="in-progress"?u??o??"":S==="done"?f??o??"":""},y=[...m];if(!g){const S=l.indexOf(a);if(S>=0&&S+1<l.length){const D=l[S+1];p.has(D)||y.push(D)}}const E=t.length===0?y.filter((S,D)=>D===0||S===a||!!x(S)):y,w=S=>p.has(S)?S===a&&!g?"current":"completed":"pending";return c.jsx("ol",{className:"status-stepper",role:"list","aria-label":"Status progress",children:E.map((S,D)=>{const R=w(S),z=KC[S]??Vc,B=p.has(S),I=x(S),X=I?`${Uh(S)} — ${Ix(I)}`:Uh(S),W=D===0?null:B?"traveled":"pending";return c.jsxs("li",{className:`status-step status-step--${R}`,role:"listitem","aria-current":R==="current"?"step":void 0,style:{"--step-color":`var(--color-status-${S})`},children:[W?c.jsx("span",{className:`status-connector status-connector--${W}`,"aria-hidden":"true"}):null,c.jsx("span",{className:"status-node",title:X,children:c.jsx(z,{className:"status-node-icon"})}),c.jsx("span",{className:"status-step-label",children:Uh(S)}),I?c.jsx("span",{className:"status-step-date",children:Ix(I)}):null]},`${S}-${D}`)})})}function Vx(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function JC(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}function WC(t,a,l,i,o){if(t.length>0)return t.map(m=>({date:m.date,fromStatus:m.fromStatus,toStatus:m.toStatus,inferred:!1}));const u=l.indexOf(a);if(u<0)return[];const f=[];for(let m=1;m<=u;m++){const p=l[m-1],g=l[m],x=g==="in-progress"?i??"":g==="done"?o??"":"";f.push({date:x,fromStatus:p,toStatus:g,inferred:!0})}return f}function Im({statusLog:t,currentStatus:a,backbone:l,startedAt:i,completedAt:o}){const u=WC(t??[],a??"",l??[],i,o);return c.jsx(ha,{title:"Status history",count:u.length,defaultOpen:u.length>0,contentClassName:"grid gap-2.5",children:u.length===0?c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."}):u.map((f,m)=>c.jsxs("div",{className:"text-sm flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-xs font-mono text-[var(--text-subtle)]",children:JC(f.date)}),c.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:Vx(f.fromStatus)}),c.jsx("span",{className:"text-[var(--text-subtle)]",children:"→"}),c.jsx("span",{className:"font-semibold text-[var(--text)]",children:Vx(f.toStatus)})]},m))})}function eD(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function tD(t){let a=0,l=0,i=0,o=0;for(const u of t)for(const f of u.tasks)f.status==="in-progress"&&(a+=1),f.status==="done"&&(l+=1),f.status==="blocked"&&(i+=1),["done","canceled"].includes(f.status)||(o+=1);return{inProgress:a,done:l,blocked:i,remaining:o}}function nD(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function aD(){var R,z;const{feature:t,phases:a}=zl(),l=t.acceptedDecisions??[],i=eD(a),o=tD(a),u=nD(a),f=a0(a),[m]=Ho(),p=((R=m.get("q"))==null?void 0:R.trim())??"",g=((z=m.get("status"))==null?void 0:z.trim())??"",x=v.useMemo(()=>a.filter(B=>(!g||B.status===g)&&ld(p,[B.title,B.id,B.summary,B.description])),[a,p,g]),y=Dr(),E=v.useRef(null),w=v.useCallback(()=>y("edit"),[y]),S=v.useCallback(()=>y("phases/new"),[y]),D=v.useCallback(()=>{var B;(B=E.current)==null||B.requestSubmit()},[]);return On("edit",w),On("create",S),On("delete",D),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Qe,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Ic,{className:"h-4 w-4"})," Back to features"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Um,{stacked:!0,items:[{label:t.name,kind:"Feature"}]}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[c.jsx(al,{featureNum:t.number,featureId:t.id}),c.jsx(Ul,{id:fi({featureNum:t.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),t.shortId?c.jsx(mi,{shortId:t.shortId}):null,c.jsx(qo,{status:f.displayStatus,breakdown:f.breakdown})]}),c.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?c.jsx(ha,{title:"Description",children:c.jsx(kn,{text:t.description,className:"plan-description max-w-4xl"})}):null,c.jsx("div",{className:"mt-4",children:c.jsx(qm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"],createdAt:t.createdAt,updatedAt:t.updatedAt})}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Qe,{to:"edit",children:c.jsx(ut,{type:"button",shortcut:"edit",children:"Edit feature"})}),c.jsx(ua,{ref:E,method:"post",action:`/features/${t.id}/delete`,className:"inline-flex",onSubmit:B=>{window.confirm(`Delete feature "${t.name}"?`)||B.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),c.jsxs(nn,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(u==null?void 0:u.title)||"No active phase"})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.length})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:i})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(u==null?void 0:u.title)||"No active phase"})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.inProgress})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.remaining})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.done})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.blocked})]})]}),c.jsx(Bm,{items:[{label:"Priority",value:Hm(t.priority),visible:t.priority>0},{label:"Timeline",value:QC(t.startDate,t.endDate),visible:!!(t.startDate||t.endDate)}]}),t.workDone||t.workRemaining?c.jsx(ha,{title:"Planning notes",defaultOpen:!1,children:c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.workDone?c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done"}),c.jsx(kn,{text:t.workDone,className:"mt-2"})]}):null,t.workRemaining?c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining"}),c.jsx(kn,{text:t.workRemaining,className:"mt-2"})]}):null]})}):null,l.length>0?c.jsx($m,{decisions:l}):null,c.jsx(Im,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"]})]}),c.jsxs(nn,{className:"grid gap-5",children:[c.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter this feature's phases by name or status."})]}),c.jsx(Qe,{to:"phases/new",children:c.jsx(ut,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),c.jsx(rd,{query:p,status:g,statusOptions:ad,placeholder:"Search phase title, id, or summary",clearTo:`/features/${t.id}`,resultsLabel:x.length===a.length?`${a.length} phases`:`${x.length} of ${a.length} phases`}),c.jsx("div",{className:"grid gap-3",children:a.length===0?c.jsxs(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",c.jsx(Qe,{to:`/features/${t.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):x.length>0?x.map(B=>c.jsx(XC,{featureId:t.id,feature:t,phase:B},B.id)):c.jsx(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),c.jsx(di,{})]})}async function rD({params:t}){const{featureId:a,phaseId:l}=t;if(!a||!l)throw new Response("featureId and phaseId required",{status:400});const[i,o,u]=await Promise.all([$o(a),Qc(l),gm()]),f=u.filter(m=>m.linkedPhaseIds.includes(l));return{feature:i,phase:{...o,linkedRequirements:f}}}function Yx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function lD({featureId:t,phaseId:a,task:l}){var x;const i=ds(),o=ds(),f=((x=i.formData)==null?void 0:x.get("status"))??l.status,m=i.state!=="idle",p=o.state!=="idle",g=Lc(HC(l.subtasks));return c.jsxs("div",{className:`surface-card px-4 py-2 ${bm(f)}`,children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hi,{type:"task",number:l.number}),c.jsx("span",{className:"shrink-0",children:c.jsx(Za,{status:f})})]}),c.jsx(Qe,{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})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[c.jsx(Qe,{to:`/features/${t}/phases/${a}/tasks/${l.id}/edit`,"aria-label":`Edit task ${l.title}`,children:c.jsx(ut,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${l.id}/delete`,onSubmit:y=>{window.confirm(`Delete task “${l.title}”? This cannot be undone.`)||y.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${l.title}`,children:c.jsx(oi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l.subtasks.length," subtasks · ",l.checklist.length," checklist"]}),g?c.jsx("div",{className:"mt-0.5 break-words",children:g}):c.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),c.jsx(i.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${l.id}/status`,className:"w-full lg:w-auto",children:c.jsxs("div",{className:"relative",children:[c.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:y=>i.submit(y.currentTarget.form),children:Po.map(y=>c.jsx("option",{value:y.value,children:y.label},y.value))}),c.jsx(ps,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Qe,{to:`/features/${t}/phases/${a}/tasks/${l.id}/edit`,"aria-label":`Edit task ${l.title}`,className:"hidden lg:block",children:c.jsx(ut,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${l.id}/delete`,className:"hidden lg:block",onSubmit:y=>{window.confirm(`Delete task “${l.title}”? This cannot be undone.`)||y.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${l.title}`,children:c.jsx(oi,{className:"h-4 w-4"})})})]}),c.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[l.startedAt?c.jsxs("span",{children:["Started ",Yx(l.startedAt)]}):null,l.completedAt?c.jsxs("span",{children:["Completed ",Yx(l.completedAt)]}):null]}),l.description?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.description}):null]})}function sD(t){let a=0,l=0,i=0,o=0;for(const u of t.tasks)u.status==="in-progress"&&(a+=1),u.status==="done"&&(l+=1),u.status==="blocked"&&(i+=1),["done","canceled"].includes(u.status)||(o+=1);return{inProgress:a,done:l,blocked:i,remaining:o}}function iD(){var W,ee;const{feature:t,phase:a}=zl(),l=a.decisions??[],i=a.acceptedDecisions??[],o=a.linkedRequirements??[],u=sD(a),f=r0(a.tasks),[m]=Ho(),p=((W=m.get("q"))==null?void 0:W.trim())??"",g=((ee=m.get("status"))==null?void 0:ee.trim())??"",x=v.useMemo(()=>a.tasks.filter(M=>(!g||M.status===g)&&ld(p,[M.title,M.id,M.description,M.shortName])),[a.tasks,p,g]),y=Dr(),E=v.useRef(null),[w,S]=v.useState(a.handoff??""),[D,R]=v.useState(!1),z=v.useCallback(()=>y("edit"),[y]),B=v.useCallback(()=>y("tasks/new"),[y]),I=v.useCallback(()=>{var M;(M=E.current)==null||M.requestSubmit()},[]),X=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){R(!0);try{await Pb(a.id),S("")}catch{}finally{R(!1)}}},[a.id]);return On("edit",z),On("create",B),On("delete",I),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Qe,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Ic,{className:"h-4 w-4"})," Back to feature"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Um,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:a.title,kind:"Phase"}]}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[c.jsx(al,{featureNum:t.number,phaseNum:a.number,featureId:t.id,phaseId:a.id}),c.jsx(Ul,{id:fi({featureNum:t.number,phaseNum:a.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),a.shortId?c.jsx(mi,{shortId:a.shortId}):null,w?c.jsx(ym,{phaseId:a.id,updatedAt:a.handoffUpdatedAt}):null,c.jsx(qo,{status:f.displayStatus,breakdown:f.breakdown})]}),c.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?c.jsx(kn,{text:a.summary,className:"mt-3 max-w-4xl"}):null,c.jsx(qm,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:a.createdAt,updatedAt:a.updatedAt}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Qe,{to:"edit",children:c.jsx(ut,{type:"button",shortcut:"edit",children:"Edit phase"})}),c.jsx(Qe,{to:"tasks/new",children:c.jsx(ut,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})}),c.jsx(ua,{ref:E,method:"post",action:`/features/${t.id}/phases/${a.id}/delete`,className:"inline-flex",onSubmit:M=>{window.confirm(`Delete phase "${a.title}"?`)||M.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),c.jsxs(nn,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.tasks.length})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.goals.length})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.dependencies.length})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.completionCriteria.length})]})]}),c.jsx(Bm,{items:[{label:"Priority",value:Hm(a.priority),visible:a.priority>0},{label:"Linked requirements",value:o.length,visible:o.length>0,valueClassName:"text-2xl font-black"},{label:"Risks",value:a.risks.length,visible:a.risks.length>0,valueClassName:"text-2xl font-black"},{label:"Open questions",value:a.openQuestions.length,visible:a.openQuestions.length>0,valueClassName:"text-2xl font-black"}]}),a.notes?c.jsx(ha,{title:"Notes",defaultOpen:!1,children:c.jsx(kn,{text:a.notes,className:"plan-description"})}):null,c.jsx(ha,{title:"Linked requirements",count:o.length,defaultOpen:!1,children:o.length>0?c.jsx("div",{className:"grid gap-3",children:o.map(M=>c.jsx("div",{className:"min-w-0 rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:c.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Za,{status:M.status}),M.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[M.macroTasks.length," macro task",M.macroTasks.length===1?"":"s"]}):null]}),c.jsx("h3",{className:"mt-2 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:M.title}),M.description?c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:M.description}):null]}),c.jsx(Qe,{to:`/requirements?q=${encodeURIComponent(M.title)}`,className:"text-sm font-semibold text-[var(--accent)] hover:underline sm:shrink-0",children:"Open in requirements →"})]})},M.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No linked requirements yet."})}),a.description?c.jsx(ha,{title:"Description",children:c.jsx(kn,{text:a.description,className:"plan-description"})}):null,l.length>0?c.jsx(ha,{title:"Decisions",count:l.length,defaultOpen:!1,children:c.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:l.map((M,T)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(kn,{text:M})},T))})}):null,i.length>0?c.jsx($m,{decisions:i}):null,c.jsx(Im,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"]})]}),w?c.jsx(nn,{className:"grid gap-4",children:c.jsx(ha,{title:"Handoff",actions:c.jsx("button",{type:"button",onClick:X,disabled:D,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:D?"Clearing…":"Clear handoff"}),children:c.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:c.jsx(kn,{text:w,className:"formatted-text max-w-none"})})})}):null,c.jsxs(nn,{className:"grid gap-5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter this phase's tasks by name or status."})]}),c.jsx(rd,{query:p,status:g,statusOptions:Po,placeholder:"Search task title, id, or description",clearTo:`/features/${t.id}/phases/${a.id}`,resultsLabel:x.length===a.tasks.length?`${a.tasks.length} tasks`:`${x.length} of ${a.tasks.length} tasks`}),c.jsx("div",{className:"grid gap-3",children:a.tasks.length===0?c.jsxs(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",c.jsx(Qe,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):x.length>0?x.map(M=>c.jsx(lD,{featureId:t.id,phaseId:a.id,task:M},M.id)):c.jsx(nn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),c.jsx(di,{})]})}async function oD({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[o,u,f]=await Promise.all([$o(a),Qc(l),Kc(i)]);return{feature:o,phase:u,task:f}}function Fx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function uD({featureId:t,phaseId:a,taskId:l,item:i}){const o=ds(),u=o.formData?o.formData.get("checked")==="true":i.checked,f=o.state!=="idle";return c.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:()=>o.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}`}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"checklist-num",children:i.number})," ",c.jsx("span",{className:`text-sm ${u?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:i.title})]})]})}function cD(){var x,y;const{feature:t,phase:a,task:l}=zl(),i=l.decisions??[],o=l.acceptedDecisions??[],u=l.checklist??[],f=Dr(),m=v.useRef(null),p=v.useCallback(()=>f("edit"),[f]),g=v.useCallback(()=>{var E;(E=m.current)==null||E.requestSubmit()},[]);return On("edit",p),On("delete",g),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Qe,{to:`/features/${t.id}/phases/${a.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Ic,{className:"h-4 w-4"})," Back to phase"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Um,{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"}]}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[c.jsx(al,{featureNum:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id}),c.jsx(Ul,{id:fi({featureNum:t.number,phaseNum:a.number,taskNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),l.shortId?c.jsx(mi,{shortId:l.shortId}):null,c.jsx(Za,{status:l.status})]}),c.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}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Qe,{to:"edit",children:c.jsx(ut,{type:"button",shortcut:"edit",children:"Edit task"})}),c.jsx(ua,{ref:m,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${l.id}/delete`,className:"inline-flex",onSubmit:E=>{window.confirm(`Delete task "${l.title}"?`)||E.preventDefault()},children:c.jsx(ut,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),c.jsx(qm,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],createdAt:l.createdAt,updatedAt:l.updatedAt,startedAt:l.startedAt,completedAt:l.completedAt}),c.jsxs(nn,{className:"grid gap-4",children:[l.description?c.jsx(ha,{title:"Description",children:c.jsx(kn,{text:l.description,className:"plan-description"})}):null,l.notes?c.jsx(ha,{title:"Notes",defaultOpen:!1,children:c.jsx(kn,{text:l.notes})}):null,c.jsx(Im,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],startedAt:l.startedAt,completedAt:l.completedAt}),i.length>0?c.jsx(ha,{title:"Decisions",count:i.length,defaultOpen:!1,children:c.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:i.map((E,w)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(kn,{text:E})},w))})}):null,o.length>0?c.jsx($m,{decisions:o}):null,c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:u.length})]}),c.jsxs(Bn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((x=l.subtasks)==null?void 0:x.length)??0})]})]}),c.jsx(Bm,{items:[{label:"Priority",value:Hm(l.priority),visible:l.priority>0},{label:"Short name",value:l.shortName,visible:!!l.shortName},{label:"Started",value:Fx(l.startedAt),visible:!!l.startedAt},{label:"Completed",value:Fx(l.completedAt),visible:!!l.completedAt},{label:"Phase",value:a.title}]}),c.jsxs("div",{className:"grid gap-3",children:[c.jsx("div",{children:c.jsxs("h3",{className:"text-sm font-bold text-[var(--text)]",children:["Steps (",u.length,")"]})}),u.length?c.jsx("div",{className:"grid gap-2",children:u.map(E=>c.jsx(uD,{featureId:t.id,phaseId:a.id,taskId:l.id,item:E},E.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(y=l.subtasks)!=null&&y.length?c.jsx(ha,{title:"Subtasks",count:l.subtasks.length,defaultOpen:!1,contentClassName:"grid gap-2",children:l.subtasks.map(E=>c.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:E.title}),c.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:E.id})]}),c.jsx(Za,{status:E.status})]},E.id))}):null]}),c.jsx(di,{})]})}const dD=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Hl({title:t,description:a,children:l}){const i=Dr(),o=v.useRef(null),u=v.useRef(null);return v.useEffect(()=>{var g;const f=o.current;if(!f)return;const m=document.activeElement;(g=u.current)==null||g.focus();const p=x=>{if(x.key==="Escape"){x.preventDefault(),i(-1);return}if(x.key!=="Tab")return;const y=Array.from(f.querySelectorAll(dD)).filter(D=>D.offsetParent!==null);if(y.length===0){x.preventDefault(),f.focus();return}const E=y[0],w=y[y.length-1],S=document.activeElement;x.shiftKey?(S===E||!f.contains(S))&&(x.preventDefault(),w.focus()):S===w&&(x.preventDefault(),E.focus())};return window.addEventListener("keydown",p),()=>{var x;window.removeEventListener("keydown",p),(x=m==null?void 0:m.focus)==null||x.call(m)}},[i]),c.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[c.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>i(-1),"aria-label":"Close modal",tabIndex:-1}),c.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:c.jsxs("div",{ref:o,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:[c.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:t}),a?c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:a}):null]}),c.jsx("button",{ref:u,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:c.jsx(lR,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:l})]})})]})}function $l({className:t="",children:a,...l}){return c.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 st({label:t,children:a}){return c.jsxs("label",{className:"grid gap-2",children:[c.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:t}),a]})}function vn(t){return c.jsx("textarea",{className:"field-control field-textarea",...t})}function fD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return On("submit",i,{allowInEditable:!0}),c.jsx(Hl,{title:"Create feature",description:"Top-level container for phases and tasks.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Feature name",children:c.jsx(Ra,{name:"name",placeholder:"Products page implementation",required:!0})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",placeholder:"Short context for the feature"})}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function hD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);On("submit",i,{allowInEditable:!0});const u=ms("feature-detail").feature;return c.jsx(Hl,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Name",children:c.jsx(Ra,{name:"name",defaultValue:u.name,required:!0})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",defaultValue:u.description})}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(st,{label:"Start date",children:c.jsx(Ra,{type:"date",name:"startDate",defaultValue:u.startDate})}),c.jsx(st,{label:"End date",children:c.jsx(Ra,{type:"date",name:"endDate",defaultValue:u.endDate})})]}),c.jsx(st,{label:"Status",children:c.jsx(gs,{name:"status",defaultValue:u.status,children:nd.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(st,{label:"Priority",children:c.jsx(Ra,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(ha,{title:"Planning notes",subtitle:"Optional agent-maintained notes for progress tracking.",defaultOpen:!1,className:"mt-0",children:c.jsxs("div",{className:"grid gap-4",children:[c.jsx(st,{label:"Work done",children:c.jsx(vn,{name:"workDone",defaultValue:u.workDone})}),c.jsx(st,{label:"Work remaining",children:c.jsx(vn,{name:"workRemaining",defaultValue:u.workRemaining})})]})}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function mD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return On("submit",i,{allowInEditable:!0}),c.jsx(Hl,{title:"Create phase",description:"A phase belongs to the current feature.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Phase title",children:c.jsx(Ra,{name:"title",placeholder:"API creation",required:!0})}),c.jsx(st,{label:"Summary",children:c.jsx(vn,{name:"summary",placeholder:"Brief phase summary"})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",placeholder:"Initial implementation notes"})}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function Ws(t){return t.join(`
|
|
289
|
-
`)}function pD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);On("submit",i,{allowInEditable:!0});const u=ms("phase-detail").phase;return c.jsx(Hl,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Title",children:c.jsx(Ra,{name:"title",defaultValue:u.title,required:!0})}),c.jsx(st,{label:"Status",children:c.jsx(gs,{name:"status",defaultValue:u.status,children:ad.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(st,{label:"Priority",children:c.jsx(Ra,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(st,{label:"Summary",children:c.jsx(vn,{name:"summary",defaultValue:u.summary})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",defaultValue:u.description})}),c.jsx(st,{label:"Goals (one per line)",children:c.jsx(vn,{name:"goals",defaultValue:Ws(u.goals)})}),c.jsx(st,{label:"Non-goals (one per line)",children:c.jsx(vn,{name:"nonGoals",defaultValue:Ws(u.nonGoals)})}),c.jsx(st,{label:"Dependencies (one per line)",children:c.jsx(vn,{name:"dependencies",defaultValue:Ws(u.dependencies)})}),c.jsx(st,{label:"Risks (one per line)",children:c.jsx(vn,{name:"risks",defaultValue:Ws(u.risks)})}),c.jsx(st,{label:"Open questions (one per line)",children:c.jsx(vn,{name:"openQuestions",defaultValue:Ws(u.openQuestions)})}),c.jsx(st,{label:"Completion criteria (one per line)",children:c.jsx(vn,{name:"completionCriteria",defaultValue:Ws(u.completionCriteria)})}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function gD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return On("submit",i,{allowInEditable:!0}),c.jsx(Hl,{title:"Create task",description:"A task belongs to the current phase.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Task title",children:c.jsx(Ra,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",placeholder:"Initial task context"})}),c.jsx(st,{label:"Checklist (one per line)",children:c.jsx(vn,{name:"checklist",placeholder:`Step one
|
|
290
|
-
Step two
|
|
291
|
-
Step three`})}),c.jsx(st,{label:"Status",children:c.jsx(gs,{name:"status",defaultValue:"planned",children:Po.map(o=>c.jsx("option",{value:o.value,children:o.label},o.value))})}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function vD(t){return t.map(a=>a.title).join(`
|
|
292
|
-
`)}function yD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);On("submit",i,{allowInEditable:!0});const u=ms("task-detail").task;return c.jsx(Hl,{title:"Edit task",description:"Update execution details and checklist items.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Title",children:c.jsx(Ra,{name:"title",defaultValue:u.title,required:!0})}),c.jsx(st,{label:"Status",children:c.jsx(gs,{name:"status",defaultValue:u.status,children:Po.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(st,{label:"Priority",children:c.jsx(Ra,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",defaultValue:u.description})}),c.jsx(st,{label:"Checklist (one per line)",children:c.jsx(vn,{name:"checklist",defaultValue:vD(u.checklist)})}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function xD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);On("submit",i,{allowInEditable:!0});const{project:o}=ms("root");return c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Qe,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Ic,{className:"h-4 w-4"})," Back to dashboard"]}),c.jsxs(nn,{className:"grid gap-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project overview"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Update the short dashboard summary and the longer project goal without changing the rest of the project metadata."})]}),c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Short description",children:c.jsx(vn,{name:"description",defaultValue:o.description,placeholder:"Summarize the project in a few lines for the dashboard overview"})}),c.jsx(st,{label:"Project goal",children:c.jsx(vn,{name:"goal",defaultValue:o.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx(Qe,{to:"/",children:c.jsx(ut,{type:"button",variant:"ghost",children:"Cancel"})}),c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save project overview"})]})]})]})]})}function bD(t){return`P${String(t.number??0).padStart(3,"0")}`}function H0({phases:t,selectedIds:a=[]}){const l=new Set(a);return c.jsx(st,{label:"Linked phases",children:t.length===0?c.jsx("div",{className:"rounded-[14px] border border-dashed border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"No phases available yet. Create phases first if you want to link this requirement to delivery work."}):c.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-[var(--border)] bg-[var(--surface-elevated)] p-3",children:[c.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Select the phases that directly implement or track this requirement."}),c.jsx("div",{className:"grid gap-2 max-h-[32dvh] overflow-y-auto pr-1",children:t.map(i=>c.jsxs("label",{className:"flex items-start gap-3 rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsx("input",{type:"checkbox",name:"linkedPhaseIds",value:i.id,defaultChecked:l.has(i.id),className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]"}),c.jsxs("span",{className:"min-w-0",children:[c.jsxs("span",{className:"block font-semibold",children:[bD(i)," — ",i.title]}),i.summary?c.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-muted)]",children:i.summary}):null]})]},i.id))})]})})}function SD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);On("submit",i,{allowInEditable:!0});const{phases:o}=ms("requirements");return c.jsx(Hl,{title:"Create requirement",description:"Capture a top-level outcome that phases can implement and track.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Requirement title",children:c.jsx(Ra,{name:"title",placeholder:"Self-hosted Claude Code plugin marketplace distribution",required:!0})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",placeholder:"Describe the user/business outcome this requirement represents"})}),c.jsx(st,{label:"Status",children:c.jsx(gs,{name:"status",defaultValue:"planned",children:Om.map(u=>c.jsx("option",{value:u.value,children:u.label},u.value))})}),c.jsx(H0,{phases:o}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create requirement"})})]})})}function wD(){const a=Ar().state!=="idle",l=v.useRef(null),i=v.useCallback(()=>{var p;return(p=l.current)==null?void 0:p.requestSubmit()},[]);On("submit",i,{allowInEditable:!0});const{requirementId:o}=Ww(),{phases:u,requirements:f}=ms("requirements"),m=f.find(p=>p.id===o);return m?c.jsx(Hl,{title:"Edit requirement",description:"Update status, scope notes, and linked delivery phases.",children:c.jsxs(ua,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(st,{label:"Requirement title",children:c.jsx(Ra,{name:"title",defaultValue:m.title,required:!0})}),c.jsx(st,{label:"Description",children:c.jsx(vn,{name:"description",defaultValue:m.description})}),c.jsx(st,{label:"Status",children:c.jsx(gs,{name:"status",defaultValue:m.status,children:Om.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))})}),c.jsx(H0,{phases:u,selectedIds:m.linkedPhaseIds}),c.jsx("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"Macro tasks are preserved automatically on save. This screen does not edit the nested macro-task list yet."}),c.jsx($l,{children:c.jsx(ut,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save requirement"})})]})}):null}function Wn(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 Yn(t,a){const l=t.get(a);return typeof l=="string"?l.trim():""}function Vm(t,a){const l=t.get(a);if(typeof l!="string")return 0;const i=l.trim();if(i==="")return 0;const o=Number(i);return Number.isFinite(o)?o:0}function Ol(t,a){return Yn(t,a).split(`
|
|
293
|
-
`).map(l=>l.trim()).filter(Boolean)}function un(t,a){const l=t[a];if(!l)throw new Response(`Missing route param: ${a}`,{status:400});return l}async function ED({request:t}){const a=await t.formData();return await dR({name:Wn(a,"name"),description:Yn(a,"description")}),Ua("/features")}async function ND({request:t,params:a}){const l=un(a,"featureId"),i=await $o(l),o=await t.formData();return await Vb({...i,name:Wn(o,"name"),description:Yn(o,"description"),startDate:Yn(o,"startDate"),endDate:Yn(o,"endDate"),status:Wn(o,"status"),priority:Vm(o,"priority"),workDone:Yn(o,"workDone"),workRemaining:Yn(o,"workRemaining")}),Ua(`/features/${l}`)}async function RD({params:t}){return await fR(un(t,"featureId")),Ua("/features")}async function jD({request:t,params:a}){const l=un(a,"featureId"),i=await $o(l),o=await t.formData();return await Vb({...i,status:Wn(o,"status")}),null}async function TD({request:t,params:a}){const l=un(a,"featureId"),i=await t.formData();return await gR({featureId:l,title:Wn(i,"title"),summary:Yn(i,"summary"),description:Yn(i,"description")}),Ua(`/features/${l}`)}async function CD({request:t,params:a}){const l=un(a,"featureId"),i=un(a,"phaseId"),o=await Qc(i),u=await t.formData();return await Yb({...o,title:Wn(u,"title"),status:Wn(u,"status"),priority:Vm(u,"priority"),summary:Yn(u,"summary"),description:Yn(u,"description"),goals:Ol(u,"goals"),nonGoals:Ol(u,"nonGoals"),dependencies:Ol(u,"dependencies"),risks:Ol(u,"risks"),openQuestions:Ol(u,"openQuestions"),completionCriteria:Ol(u,"completionCriteria")}),Ua(`/features/${l}/phases/${i}`)}async function DD({params:t}){const a=un(t,"featureId"),l=un(t,"phaseId");return await vR(l),Ua(`/features/${a}`)}async function AD({request:t,params:a}){const l=un(a,"phaseId"),i=await Qc(l),o=await t.formData();return await Yb({...i,status:Wn(o,"status")}),null}async function kD({request:t,params:a}){const l=un(a,"featureId"),i=un(a,"phaseId"),o=await t.formData(),u=Ol(o,"checklist");return await yR(i,{title:Wn(o,"title"),description:Yn(o,"description"),status:Yn(o,"status")||"planned",...u.length?{checklist:u}:{}}),Ua(`/features/${l}/phases/${i}`)}function OD(t,a){const l=new Map(t.map(o=>[o.id,o])),i=new Map(t.map(o=>[o.title.trim().toLowerCase(),o]));return a.map((o,u)=>{var p;const f=o.trim().toLowerCase(),m=l.get(((p=t[u])==null?void 0:p.id)??"")??i.get(f);return m?{...m,number:u+1,title:o.trim()}:{id:`check-${u+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:u+1,title:o.trim(),checked:!1}})}async function MD({request:t,params:a}){const l=un(a,"featureId"),i=un(a,"phaseId"),o=un(a,"taskId"),u=await Kc(o),f=await t.formData();return await vm({...u,phaseId:i,title:Wn(f,"title"),status:Wn(f,"status"),priority:Vm(f,"priority"),description:Yn(f,"description"),checklist:OD(u.checklist,Ol(f,"checklist"))}),Ua(`/features/${l}/phases/${i}/tasks/${o}`)}async function _D({params:t}){const a=un(t,"featureId"),l=un(t,"phaseId"),i=un(t,"taskId");return await xR(i),Ua(`/features/${a}/phases/${l}`)}async function LD({request:t,params:a}){const l=un(a,"phaseId"),i=un(a,"taskId"),o=await Kc(i),u=await t.formData();return await vm({...o,phaseId:l,status:Wn(u,"status")}),null}async function zD({request:t}){const a=await qb(),l=await t.formData();return await uR({...a,description:Yn(l,"description"),goal:Yn(l,"goal")}),Ua("/")}async function UD({request:t}){const a=await t.formData();return await hR({id:crypto.randomUUID(),title:Wn(a,"title"),description:Yn(a,"description"),status:Wn(a,"status"),linkedPhaseIds:a.getAll("linkedPhaseIds").filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean)}),Ua("/requirements")}async function BD({request:t,params:a}){const l=un(a,"requirementId"),i=(await gm()).find(u=>u.id===l);if(!i)throw new Response(`Requirement not found: ${l}`,{status:404});const o=await t.formData();return await mR({...i,title:Wn(o,"title"),description:Yn(o,"description"),status:Wn(o,"status"),linkedPhaseIds:o.getAll("linkedPhaseIds").filter(u=>typeof u=="string").map(u=>u.trim()).filter(Boolean)}),Ua("/requirements")}async function HD({params:t}){return await pR(un(t,"requirementId")),Ua("/requirements")}function $D(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function qD(){return{handoffs:await Vh()}}function ID(){const{handoffs:t}=zl(),[a,l]=v.useState(t),[i,o]=v.useState(null),[u,f]=v.useState(""),m=fr();async function p(g){if(!(i||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){o(g.phaseId),f("");try{await Pb(g.phaseId),l(y=>y.filter(E=>E.phaseId!==g.phaseId)),Vh().then(l).catch(()=>{})}catch(y){const E=y instanceof Error?y.message:String(y);f(E||`Failed to clear handoff for ${g.compositeRef}.`)}finally{o(null)}}}return v.useEffect(()=>{const g=x=>{const y=x.detail;((y==null?void 0:y.type)==="handoffUpdated"||(y==null?void 0:y.type)==="handoffCleared")&&Vh().then(l).catch(()=>{})};return window.addEventListener("agent-plan:ws-event",g),()=>window.removeEventListener("agent-plan:ws-event",g)},[]),v.useEffect(()=>{if(!m.hash)return;const g=m.hash.slice(1),x=document.getElementById(g);x&&x.scrollIntoView({behavior:"smooth",block:"start"})},[m.hash,a]),a.length===0?c.jsxs(nn,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Entity-scoped handoffs written on phases (",c.jsx("code",{children:"phase.handoff"}),")."]})]}),u?c.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:u}):null,c.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Entity-scoped handoffs written on phases (",c.jsx("code",{children:"phase.handoff"}),"). ",a.length," pending."]})]}),u?c.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:u}):null,a.map(g=>c.jsx("section",{id:g.phaseId,className:"scroll-mt-20",children:c.jsx(nn,{className:"overflow-hidden p-0",children:c.jsx(ha,{defaultOpen:!1,title:c.jsxs(c.Fragment,{children:[c.jsx(Ul,{id:g.compositeRef,children:g.compositeRef}),c.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",$D(g.updatedAt)]})]}),subtitle:g.firstLine||"Empty handoff content.",summaryClassName:"hover:bg-[var(--surface-hover)]/60 focus-visible:bg-[var(--surface-hover)]/60",actions:c.jsxs(c.Fragment,{children:[c.jsx(ut,{type:"button",variant:"danger",className:"min-h-8 px-2.5 py-1 text-xs sm:min-h-9",disabled:i===g.phaseId,onClick:x=>{x.preventDefault(),x.stopPropagation(),p(g)},children:i===g.phaseId?"Clearing…":"Clear"}),c.jsx(Qe,{to:g.featureId?`/features/${g.featureId}/phases/${g.phaseId}`:"/features",className:"text-xs text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",onClick:x=>x.stopPropagation(),children:g.featureId?"Open phase →":"Browse features →"})]}),contentClassName:"px-5 py-5",children:g.firstLine?c.jsx(kn,{text:g.content,className:"formatted-text max-w-none"}):c.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"Empty handoff content."})})})},g.phaseId))]})}async function VD({request:t,params:a}){un(a,"featureId");const l=un(a,"phaseId"),i=un(a,"taskId"),o=un(a,"itemId"),u=await t.formData(),f=Wn(u,"checked")==="true",m=await Kc(i);return await vm({...m,phaseId:l,checklist:m.checklist.map(p=>p.id===o?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:i,itemId:o,checked:f})}const YD=YE([{id:"root",path:"/",loader:FR,element:c.jsx(PR,{}),errorElement:c.jsx(GR,{}),children:[{index:!0,loader:XR,element:c.jsx(zC,{})},{path:"features",id:"features",loader:UC,element:c.jsx(VC,{}),children:[{path:"new",element:c.jsx(fD,{}),action:ED}]},{path:"features/:featureId",id:"feature-detail",loader:GC,element:c.jsx(aD,{}),children:[{path:"edit",element:c.jsx(hD,{}),action:ND},{path:"phases/new",element:c.jsx(mD,{}),action:TD}]},{path:"requirements",id:"requirements",loader:YC,element:c.jsx(PC,{}),children:[{path:"new",element:c.jsx(SD,{}),action:UD},{path:":requirementId/edit",element:c.jsx(wD,{}),action:BD}]},{path:"project/edit",element:c.jsx(xD,{}),action:zD},{path:"handoff",loader:qD,element:c.jsx(ID,{})},{path:"features/:featureId/delete",action:RD},{path:"requirements/:requirementId/delete",action:HD},{path:"features/:featureId/status",action:jD},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:rD,element:c.jsx(iD,{}),children:[{path:"edit",element:c.jsx(pD,{}),action:CD},{path:"tasks/new",element:c.jsx(gD,{}),action:kD}]},{path:"features/:featureId/phases/:phaseId/delete",action:DD},{path:"features/:featureId/phases/:phaseId/status",action:AD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:oD,element:c.jsx(cD,{}),children:[{path:"edit",element:c.jsx(yD,{}),action:MD}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:_D},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:LD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:VD}]}]),$0=document.getElementById("root");if(!$0)throw new Error("#root not found");MS.createRoot($0).render(c.jsx(v.StrictMode,{children:c.jsx(WE,{router:YD})}));
|