@agent-plan/pi-adapter 0.2.19-next.0 → 0.2.19-next.2

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.
@@ -0,0 +1,211 @@
1
+ var TS=Object.defineProperty;var jS=(t,a,r)=>a in t?TS(t,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[a]=r;var mn=(t,a,r)=>jS(t,typeof a!="symbol"?a+"":a,r);function DS(t,a){for(var r=0;r<a.length;r++){const i=a[r];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in t)){const o=Object.getOwnPropertyDescriptor(i,u);o&&Object.defineProperty(t,u,o.get?o:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function r(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(u){if(u.ep)return;u.ep=!0;const o=r(u);fetch(u.href,o)}})();function CS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xf={exports:{}},Wi={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Fv;function AS(){if(Fv)return Wi;Fv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(i,u,o){var h=null;if(o!==void 0&&(h=""+o),u.key!==void 0&&(h=""+u.key),"key"in u){o={};for(var m in u)m!=="key"&&(o[m]=u[m])}else o=u;return u=o.ref,{$$typeof:t,type:i,key:h,ref:u!==void 0?u:null,props:o}}return Wi.Fragment=a,Wi.jsx=r,Wi.jsxs=r,Wi}var Gv;function OS(){return Gv||(Gv=1,Xf.exports=AS()),Xf.exports}var d=OS(),If={exports:{}},Je={};/**
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 Xv;function MS(){if(Xv)return Je;Xv=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function S(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function z(O,X,se){this.props=O,this.context=X,this.refs=N,this.updater=se||R}z.prototype.isReactComponent={},z.prototype.setState=function(O,X){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,X,"setState")},z.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function I(){}I.prototype=z.prototype;function q(O,X,se){this.props=O,this.context=X,this.refs=N,this.updater=se||R}var Q=q.prototype=new I;Q.constructor=q,C(Q,z.prototype),Q.isPureReactComponent=!0;var ee=Array.isArray;function te(){}var D={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function re(O,X,se){var ce=se.ref;return{$$typeof:t,type:O,key:X,ref:ce!==void 0?ce:null,props:se}}function ue(O,X){return re(O.type,X,O.props)}function xe(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function pe(O){var X={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(se){return X[se]})}var Te=/\/+/g;function Ae(O,X){return typeof O=="object"&&O!==null&&O.key!=null?pe(""+O.key):X.toString(36)}function Re(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(te,te):(O.status="pending",O.then(function(X){O.status==="pending"&&(O.status="fulfilled",O.value=X)},function(X){O.status==="pending"&&(O.status="rejected",O.reason=X)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function B(O,X,se,ce,we){var Se=typeof O;(Se==="undefined"||Se==="boolean")&&(O=null);var He=!1;if(O===null)He=!0;else switch(Se){case"bigint":case"string":case"number":He=!0;break;case"object":switch(O.$$typeof){case t:case a:He=!0;break;case x:return He=O._init,B(He(O._payload),X,se,ce,we)}}if(He)return we=we(O),He=ce===""?"."+Ae(O,0):ce,ee(we)?(se="",He!=null&&(se=He.replace(Te,"$&/")+"/"),B(we,X,se,"",function(et){return et})):we!=null&&(xe(we)&&(we=ue(we,se+(we.key==null||O&&O.key===we.key?"":(""+we.key).replace(Te,"$&/")+"/")+He)),X.push(we)),1;He=0;var it=ce===""?".":ce+":";if(ee(O))for(var Fe=0;Fe<O.length;Fe++)ce=O[Fe],Se=it+Ae(ce,Fe),He+=B(ce,X,se,Se,we);else if(Fe=S(O),typeof Fe=="function")for(O=Fe.call(O),Fe=0;!(ce=O.next()).done;)ce=ce.value,Se=it+Ae(ce,Fe++),He+=B(ce,X,se,Se,we);else if(Se==="object"){if(typeof O.then=="function")return B(Re(O),X,se,ce,we);throw X=String(O),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return He}function V(O,X,se){if(O==null)return O;var ce=[],we=0;return B(O,ce,"","",function(Se){return X.call(se,Se,we++)}),ce}function de(O){if(O._status===-1){var X=O._result;X=X(),X.then(function(se){(O._status===0||O._status===-1)&&(O._status=1,O._result=se)},function(se){(O._status===0||O._status===-1)&&(O._status=2,O._result=se)}),O._status===-1&&(O._status=0,O._result=X)}if(O._status===1)return O._result.default;throw O._result}var fe=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Ne={map:V,forEach:function(O,X,se){V(O,function(){X.apply(this,arguments)},se)},count:function(O){var X=0;return V(O,function(){X++}),X},toArray:function(O){return V(O,function(X){return X})||[]},only:function(O){if(!xe(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Je.Activity=b,Je.Children=Ne,Je.Component=z,Je.Fragment=r,Je.Profiler=u,Je.PureComponent=q,Je.StrictMode=i,Je.Suspense=p,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Je.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},Je.cache=function(O){return function(){return O.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(O,X,se){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ce=C({},O.props),we=O.key;if(X!=null)for(Se in X.key!==void 0&&(we=""+X.key),X)!j.call(X,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&X.ref===void 0||(ce[Se]=X[Se]);var Se=arguments.length-2;if(Se===1)ce.children=se;else if(1<Se){for(var He=Array(Se),it=0;it<Se;it++)He[it]=arguments[it+2];ce.children=He}return re(O.type,we,ce)},Je.createContext=function(O){return O={$$typeof:h,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},Je.createElement=function(O,X,se){var ce,we={},Se=null;if(X!=null)for(ce in X.key!==void 0&&(Se=""+X.key),X)j.call(X,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(we[ce]=X[ce]);var He=arguments.length-2;if(He===1)we.children=se;else if(1<He){for(var it=Array(He),Fe=0;Fe<He;Fe++)it[Fe]=arguments[Fe+2];we.children=it}if(O&&O.defaultProps)for(ce in He=O.defaultProps,He)we[ce]===void 0&&(we[ce]=He[ce]);return re(O,Se,we)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(O){return{$$typeof:m,render:O}},Je.isValidElement=xe,Je.lazy=function(O){return{$$typeof:x,_payload:{_status:-1,_result:O},_init:de}},Je.memo=function(O,X){return{$$typeof:g,type:O,compare:X===void 0?null:X}},Je.startTransition=function(O){var X=D.T,se={};D.T=se;try{var ce=O(),we=D.S;we!==null&&we(se,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(te,fe)}catch(Se){fe(Se)}finally{X!==null&&se.types!==null&&(X.types=se.types),D.T=X}},Je.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Je.use=function(O){return D.H.use(O)},Je.useActionState=function(O,X,se){return D.H.useActionState(O,X,se)},Je.useCallback=function(O,X){return D.H.useCallback(O,X)},Je.useContext=function(O){return D.H.useContext(O)},Je.useDebugValue=function(){},Je.useDeferredValue=function(O,X){return D.H.useDeferredValue(O,X)},Je.useEffect=function(O,X){return D.H.useEffect(O,X)},Je.useEffectEvent=function(O){return D.H.useEffectEvent(O)},Je.useId=function(){return D.H.useId()},Je.useImperativeHandle=function(O,X,se){return D.H.useImperativeHandle(O,X,se)},Je.useInsertionEffect=function(O,X){return D.H.useInsertionEffect(O,X)},Je.useLayoutEffect=function(O,X){return D.H.useLayoutEffect(O,X)},Je.useMemo=function(O,X){return D.H.useMemo(O,X)},Je.useOptimistic=function(O,X){return D.H.useOptimistic(O,X)},Je.useReducer=function(O,X,se){return D.H.useReducer(O,X,se)},Je.useRef=function(O){return D.H.useRef(O)},Je.useState=function(O){return D.H.useState(O)},Je.useSyncExternalStore=function(O,X,se){return D.H.useSyncExternalStore(O,X,se)},Je.useTransition=function(){return D.H.useTransition()},Je.version="19.2.7",Je}var Iv;function Lh(){return Iv||(Iv=1,If.exports=MS()),If.exports}var v=Lh();const un=CS(v),kS=DS({__proto__:null,default:un},[v]);var Qf={exports:{}},eu={},Pf={exports:{}},Kf={};/**
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 Qv;function _S(){return Qv||(Qv=1,(function(t){function a(B,V){var de=B.length;B.push(V);e:for(;0<de;){var fe=de-1>>>1,Ne=B[fe];if(0<u(Ne,V))B[fe]=V,B[de]=Ne,de=fe;else break e}}function r(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var V=B[0],de=B.pop();if(de!==V){B[0]=de;e:for(var fe=0,Ne=B.length,O=Ne>>>1;fe<O;){var X=2*(fe+1)-1,se=B[X],ce=X+1,we=B[ce];if(0>u(se,de))ce<Ne&&0>u(we,se)?(B[fe]=we,B[ce]=de,fe=ce):(B[fe]=se,B[X]=de,fe=X);else if(ce<Ne&&0>u(we,de))B[fe]=we,B[ce]=de,fe=ce;else break e}}return V}function u(B,V){var de=B.sortIndex-V.sortIndex;return de!==0?de:B.id-V.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var h=Date,m=h.now();t.unstable_now=function(){return h.now()-m}}var p=[],g=[],x=1,b=null,w=3,S=!1,R=!1,C=!1,N=!1,z=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function Q(B){for(var V=r(g);V!==null;){if(V.callback===null)i(g);else if(V.startTime<=B)i(g),V.sortIndex=V.expirationTime,a(p,V);else break;V=r(g)}}function ee(B){if(C=!1,Q(B),!R)if(r(p)!==null)R=!0,te||(te=!0,pe());else{var V=r(g);V!==null&&Re(ee,V.startTime-B)}}var te=!1,D=-1,j=5,re=-1;function ue(){return N?!0:!(t.unstable_now()-re<j)}function xe(){if(N=!1,te){var B=t.unstable_now();re=B;var V=!0;try{e:{R=!1,C&&(C=!1,I(D),D=-1),S=!0;var de=w;try{t:{for(Q(B),b=r(p);b!==null&&!(b.expirationTime>B&&ue());){var fe=b.callback;if(typeof fe=="function"){b.callback=null,w=b.priorityLevel;var Ne=fe(b.expirationTime<=B);if(B=t.unstable_now(),typeof Ne=="function"){b.callback=Ne,Q(B),V=!0;break t}b===r(p)&&i(p),Q(B)}else i(p);b=r(p)}if(b!==null)V=!0;else{var O=r(g);O!==null&&Re(ee,O.startTime-B),V=!1}}break e}finally{b=null,w=de,S=!1}V=void 0}}finally{V?pe():te=!1}}}var pe;if(typeof q=="function")pe=function(){q(xe)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,Ae=Te.port2;Te.port1.onmessage=xe,pe=function(){Ae.postMessage(null)}}else pe=function(){z(xe,0)};function Re(B,V){D=z(function(){B(t.unstable_now())},V)}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(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(B){switch(w){case 1:case 2:case 3:var V=3;break;default:V=w}var de=w;w=V;try{return B()}finally{w=de}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(B,V){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var de=w;w=B;try{return V()}finally{w=de}},t.unstable_scheduleCallback=function(B,V,de){var fe=t.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?fe+de:fe):de=fe,B){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=de+Ne,B={id:x++,callback:V,priorityLevel:B,startTime:de,expirationTime:Ne,sortIndex:-1},de>fe?(B.sortIndex=de,a(g,B),r(p)===null&&B===r(g)&&(C?(I(D),D=-1):C=!0,Re(ee,de-fe))):(B.sortIndex=Ne,a(p,B),R||S||(R=!0,te||(te=!0,pe()))),B},t.unstable_shouldYield=ue,t.unstable_wrapCallback=function(B){var V=w;return function(){var de=w;w=V;try{return B.apply(this,arguments)}finally{w=de}}}})(Kf)),Kf}var Pv;function LS(){return Pv||(Pv=1,Pf.exports=_S()),Pf.exports}var Zf={exports:{}},la={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Kv;function zS(){if(Kv)return la;Kv=1;var t=Lh();function a(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(p,g,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:p,containerInfo:g,implementation:x}}var h=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 la.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,la.createPortal=function(p,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return o(p,g,null,x)},la.flushSync=function(p){var g=h.T,x=i.p;try{if(h.T=null,i.p=2,p)return p()}finally{h.T=g,i.p=x,i.d.f()}},la.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))},la.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},la.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var x=g.as,b=m(x,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:S}):x==="script"&&i.d.X(p,{crossOrigin:b,integrity:w,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},la.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)},la.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,b=m(x,g.crossOrigin);i.d.L(p,x,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},la.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)},la.requestFormReset=function(p){i.d.r(p)},la.unstable_batchedUpdates=function(p,g){return p(g)},la.useFormState=function(p,g,x){return h.H.useFormState(p,g,x)},la.useFormStatus=function(){return h.H.useHostTransitionStatus()},la.version="19.2.7",la}var Zv;function mx(){if(Zv)return Zf.exports;Zv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Zf.exports=zS(),Zf.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Jv;function US(){if(Jv)return eu;Jv=1;var t=LS(),a=Lh(),r=mx();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(i(188))}function g(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(i(188));return n!==e?null:e}for(var l=e,s=n;;){var c=l.return;if(c===null)break;var f=c.alternate;if(f===null){if(s=c.return,s!==null){l=s;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===l)return p(c),e;if(f===s)return p(c),n;f=f.sibling}throw Error(i(188))}if(l.return!==s.return)l=c,s=f;else{for(var y=!1,E=c.child;E;){if(E===l){y=!0,l=c,s=f;break}if(E===s){y=!0,s=c,l=f;break}E=E.sibling}if(!y){for(E=f.child;E;){if(E===l){y=!0,l=f,s=c;break}if(E===s){y=!0,s=f,l=c;break}E=E.sibling}if(!y)throw Error(i(189))}}if(l.alternate!==s)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),q=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function pe(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case z:return"Profiler";case N:return"StrictMode";case ee:return"Suspense";case te:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case q:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case Q:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return n=e.displayName||null,n!==null?n:Ae(e.type)||"Memo";case j:n=e._payload,e=e._init;try{return Ae(e(n))}catch{}}return null}var Re=Array.isArray,B=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],Ne=-1;function O(e){return{current:e}}function X(e){0>Ne||(e.current=fe[Ne],fe[Ne]=null,Ne--)}function se(e,n){Ne++,fe[Ne]=e.current,e.current=n}var ce=O(null),we=O(null),Se=O(null),He=O(null);function it(e,n){switch(se(Se,n),se(we,e),se(ce,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hv(n),e=mv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(ce),se(ce,e)}function Fe(){X(ce),X(we),X(Se)}function et(e){e.memoizedState!==null&&se(He,e);var n=ce.current,l=mv(n,e.type);n!==l&&(se(we,e),se(ce,l))}function en(e){we.current===e&&(X(ce),X(we)),He.current===e&&(X(He),Pi._currentValue=de)}var qt,ut;function le(e){if(qt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);qt=n&&n[1]||"",ut=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+qt+e+ut}var Le=!1;function at(e,n){if(!e||Le)return"";Le=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(P){var G=P}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(P){G=P}e.call(ae.prototype)}}else{try{throw Error()}catch(P){G=P}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(P){if(P&&G&&typeof P.stack=="string")return[P.stack,G.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),y=f[0],E=f[1];if(y&&E){var M=y.split(`
44
+ `),Y=E.split(`
45
+ `);for(c=s=0;s<M.length&&!M[s].includes("DetermineComponentFrameRoot");)s++;for(;c<Y.length&&!Y[c].includes("DetermineComponentFrameRoot");)c++;if(s===M.length||c===Y.length)for(s=M.length-1,c=Y.length-1;1<=s&&0<=c&&M[s]!==Y[c];)c--;for(;1<=s&&0<=c;s--,c--)if(M[s]!==Y[c]){if(s!==1||c!==1)do if(s--,c--,0>c||M[s]!==Y[c]){var Z=`
46
+ `+M[s].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=s&&0<=c);break}}}finally{Le=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?le(l):""}function Xt(e,n){switch(e.tag){case 26:case 27:case 5:return le(e.type);case 16:return le("Lazy");case 13:return e.child!==n&&n!==null?le("Suspense Fallback"):le("Suspense");case 19:return le("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return le("Activity");default:return""}}function Cn(e){try{var n="",l=null;do n+=Xt(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var pn=Object.prototype.hasOwnProperty,_t=t.unstable_scheduleCallback,Wt=t.unstable_cancelCallback,Yn=t.unstable_shouldYield,ye=t.unstable_requestPaint,Oe=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,lt=t.unstable_UserBlockingPriority,At=t.unstable_NormalPriority,Ot=t.unstable_LowPriority,tn=t.unstable_IdlePriority,It=t.log,ca=t.unstable_setDisableYieldValue,gn=null,J=null;function St(e){if(typeof It=="function"&&ca(e),J&&typeof J.setStrictMode=="function")try{J.setStrictMode(gn,e)}catch{}}var Lt=Math.clz32?Math.clz32:Nl,er=Math.log,Zn=Math.LN2;function Nl(e){return e>>>=0,e===0?32:31-(er(e)/Zn|0)|0}var $e=256,Qt=262144,Yt=4194304;function gt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function zt(e,n,l){var s=e.pendingLanes;if(s===0)return 0;var c=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var E=s&134217727;return E!==0?(s=E&~f,s!==0?c=gt(s):(y&=E,y!==0?c=gt(y):l||(l=E&~e,l!==0&&(c=gt(l))))):(E=s&~f,E!==0?c=gt(E):y!==0?c=gt(y):l||(l=s&~e,l!==0&&(c=gt(l)))),c===0?0:n!==0&&n!==c&&(n&f)===0&&(f=c&-c,l=n&-n,f>=l||f===32&&(l&4194048)!==0)?n:c}function Rt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function nn(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pt(){var e=Yt;return Yt<<=1,(Yt&62914560)===0&&(Yt=4194304),e}function Ut(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function dt(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,n,l,s,c,f){var y=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var E=e.entanglements,M=e.expirationTimes,Y=e.hiddenUpdates;for(l=y&~l;0<l;){var Z=31-Lt(l),ae=1<<Z;E[Z]=0,M[Z]=-1;var G=Y[Z];if(G!==null)for(Y[Z]=null,Z=0;Z<G.length;Z++){var P=G[Z];P!==null&&(P.lane&=-536870913)}l&=~ae}s!==0&&Sn(e,s,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~n))}function Sn(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Lt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function An(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-Lt(l),c=1<<s;c&n|e[s]&n&&(e[s]|=n),l&=~c}}function A(e,n){var l=n&-n;return l=(l&42)!==0?1:_(l),(l&(e.suspendedLanes|n))!==0?0:l}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 H(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function K(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Uv(e.type))}function ne(e,n){var l=V.p;try{return V.p=e,n()}finally{V.p=l}}var Ee=Math.random().toString(36).slice(2),he="__reactFiber$"+Ee,je="__reactProps$"+Ee,be="__reactContainer$"+Ee,Me="__reactEvents$"+Ee,_e="__reactListeners$"+Ee,Xe="__reactHandles$"+Ee,De="__reactResources$"+Ee,Pe="__reactMarker$"+Ee;function qe(e){delete e[he],delete e[je],delete e[Me],delete e[_e],delete e[Xe]}function Ht(e){var n=e[he];if(n)return n;for(var l=e.parentNode;l;){if(n=l[be]||l[he]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=Sv(e);e!==null;){if(l=e[he])return l;e=Sv(e)}return n}e=l,l=e.parentNode}return null}function Ze(e){if(e=e[he]||e[be]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ot(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function rt(e){var n=e[De];return n||(n=e[De]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ct(e){e[Pe]=!0}var Kt=new Set,Vn={};function En(e,n){On(e,n),On(e+"Capture",n)}function On(e,n){for(Vn[e]=n,e=0;e<n.length;e++)Kt.add(n[e])}var Mn=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]*$"),Fn={},da={};function tr(e){return pn.call(da,e)?!0:pn.call(Fn,e)?!1:Mn.test(e)?da[e]=!0:(Fn[e]=!0,!1)}function Jn(e,n,l){if(tr(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+l)}}function sl(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+l)}}function Ie(e,n,l,s){if(s===null)e.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zt(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Wn(e,n,l){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,f=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(y){l=""+y,f.call(this,y)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function kn(e){if(!e._valueTracker){var n=Zt(e)?"checked":"value";e._valueTracker=Wn(e,n,""+e[n])}}function Tl(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Zt(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}function bt(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 ba=/[\n"\\]/g;function Gn(e){return e.replace(ba,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function _r(e,n,l,s,c,f,y,E){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),n!=null?y==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+xt(n)):e.value!==""+xt(n)&&(e.value=""+xt(n)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),n!=null?Nt(e,y,xt(n)):l!=null?Nt(e,y,xt(l)):s!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+xt(E):e.removeAttribute("name")}function di(e,n,l,s,c,f,y,E){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||l!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){kn(e);return}l=l!=null?""+xt(l):"",n=n!=null?""+xt(n):l,E||n===e.value||(e.value=n),e.defaultValue=n}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=E?e.checked:!!s,e.defaultChecked=!!s,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),kn(e)}function Nt(e,n,l){n==="number"&&bt(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function il(e,n,l,s){if(e=e.options,n){n={};for(var c=0;c<l.length;c++)n["$"+l[c]]=!0;for(l=0;l<e.length;l++)c=n.hasOwnProperty("$"+e[l].value),e[l].selected!==c&&(e[l].selected=c),c&&s&&(e[l].defaultSelected=!0)}else{for(l=""+xt(l),n=null,c=0;c<e.length;c++){if(e[c].value===l){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function $u(e,n,l){if(n!=null&&(n=""+xt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+xt(l):""}function Za(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(i(92));if(Re(s)){if(1<s.length)throw Error(i(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=xt(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),kn(e)}function nr(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var Xc=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function cs(e,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,l):typeof l!="number"||l===0||Xc.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function fa(e,n,l){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,l!=null){for(var s in l)!l.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var c in n)s=n[c],n.hasOwnProperty(c)&&l[c]!==s&&cs(e,c,s)}else for(var f in n)n.hasOwnProperty(f)&&cs(e,f,n[f])}function Lr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ds=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ha=/^[\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 an(e){return ha.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ea(){}var Sa=null;function jl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ul=null,Dl=null;function fi(e){var n=Ze(e);if(n&&(e=n.stateNode)){var l=e[je]||null;e:switch(e=n.stateNode,n.type){case"input":if(_r(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Gn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var c=s[je]||null;if(!c)throw Error(i(90));_r(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===e.form&&Tl(s)}break e;case"textarea":$u(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&il(e,!!l.multiple,n,!1)}}}var ol=!1;function hi(e,n,l){if(ol)return e(n,l);ol=!0;try{var s=e(n);return s}finally{if(ol=!1,(ul!==null||Dl!==null)&&(Do(),ul&&(n=ul,e=Dl,Dl=ul=null,fi(n),e)))for(n=0;n<e.length;n++)fi(e[n])}}function _a(e,n){var l=e.stateNode;if(l===null)return null;var s=l[je]||null;if(s===null)return null;l=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(i(231,n,typeof l));return l}var Ja=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mi=!1;if(Ja)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){mi=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{mi=!1}var La=null,pi=null,fs=null;function qu(){if(fs)return fs;var e,n=pi,l=n.length,s,c="value"in La?La.value:La.textContent,f=c.length;for(e=0;e<l&&n[e]===c[e];e++);var y=l-e;for(s=1;s<=y&&n[l-s]===c[f-s];s++);return fs=c.slice(e,1<s?1-s:void 0)}function hs(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Al(){return!0}function Yu(){return!1}function ta(e){function n(l,s,c,f,y){this._reactName=l,this._targetInst=c,this.type=s,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(l=e[E],this[E]=l?l(f):f[E]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Al:Yu,this.isPropagationStopped=Yu,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),n}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=ta(Ol),zr=b({},Ol,{view:0,detail:0}),Ic=ta(zr),ar,Ur,Hr,kl=b({},zr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:aa,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!==Hr&&(Hr&&e.type==="mousemove"?(ar=e.screenX-Hr.screenX,Ur=e.screenY-Hr.screenY):Ur=ar=0,Hr=e),ar)},movementY:function(e){return"movementY"in e?e.movementY:Ur}}),Vu=ta(kl),T=b({},kl,{dataTransfer:0}),F=ta(T),ve=b({},zr,{relatedTarget:0}),me=ta(ve),Ve=b({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),ie=ta(Ve),oe=b({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ge=ta(oe),Qe=b({},Ol,{data:0}),tt=ta(Qe),Ue={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Mt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function na(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Mt[e])?!!n[e]:!1}function aa(){return na}var ma=b({},zr,{key:function(e){if(e.key){var n=Ue[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=hs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:aa,charCode:function(e){return e.type==="keypress"?hs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rn=ta(ma),cn=b({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kt=ta(cn),Br=b({},zr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:aa}),cl=ta(Br),Qc=b({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fu=ta(Qc),Gu=b({},kl,{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}),Pc=ta(Gu),Kc=b({},Ol,{newState:0,oldState:0}),Ib=ta(Kc),Qb=[9,13,27,32],Zc=Ja&&"CompositionEvent"in window,gi=null;Ja&&"documentMode"in document&&(gi=document.documentMode);var Pb=Ja&&"TextEvent"in window&&!gi,xm=Ja&&(!Zc||gi&&8<gi&&11>=gi),bm=" ",Sm=!1;function Em(e,n){switch(e){case"keyup":return Qb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ms=!1;function Kb(e,n){switch(e){case"compositionend":return wm(n);case"keypress":return n.which!==32?null:(Sm=!0,bm);case"textInput":return e=n.data,e===bm&&Sm?null:e;default:return null}}function Zb(e,n){if(ms)return e==="compositionend"||!Zc&&Em(e,n)?(e=qu(),fs=pi=La=null,ms=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return xm&&n.locale!=="ko"?null:n.data;default:return null}}var Jb={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 Rm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Jb[e.type]:n==="textarea"}function Nm(e,n,l,s){ul?Dl?Dl.push(s):Dl=[s]:ul=s,n=Lo(n,"onChange"),0<n.length&&(l=new Ml("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var vi=null,yi=null;function Wb(e){iv(e,0)}function Xu(e){var n=ot(e);if(Tl(n))return e}function Tm(e,n){if(e==="change")return n}var jm=!1;if(Ja){var Jc;if(Ja){var Wc="oninput"in document;if(!Wc){var Dm=document.createElement("div");Dm.setAttribute("oninput","return;"),Wc=typeof Dm.oninput=="function"}Jc=Wc}else Jc=!1;jm=Jc&&(!document.documentMode||9<document.documentMode)}function Cm(){vi&&(vi.detachEvent("onpropertychange",Am),yi=vi=null)}function Am(e){if(e.propertyName==="value"&&Xu(yi)){var n=[];Nm(n,yi,e,jl(e)),hi(Wb,n)}}function e0(e,n,l){e==="focusin"?(Cm(),vi=n,yi=l,vi.attachEvent("onpropertychange",Am)):e==="focusout"&&Cm()}function t0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xu(yi)}function n0(e,n){if(e==="click")return Xu(n)}function a0(e,n){if(e==="input"||e==="change")return Xu(n)}function l0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Ea=typeof Object.is=="function"?Object.is:l0;function xi(e,n){if(Ea(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var c=l[s];if(!pn.call(n,c)||!Ea(e[c],n[c]))return!1}return!0}function Om(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mm(e,n){var l=Om(e);e=0;for(var s;l;){if(l.nodeType===3){if(s=e+l.textContent.length,e<=n&&s>=n)return{node:l,offset:n-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Om(l)}}function km(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?km(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function _m(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=bt(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=bt(e.document)}return n}function ed(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 r0=Ja&&"documentMode"in document&&11>=document.documentMode,ps=null,td=null,bi=null,nd=!1;function Lm(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;nd||ps==null||ps!==bt(s)||(s=ps,"selectionStart"in s&&ed(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}),bi&&xi(bi,s)||(bi=s,s=Lo(td,"onSelect"),0<s.length&&(n=new Ml("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=ps)))}function $r(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var gs={animationend:$r("Animation","AnimationEnd"),animationiteration:$r("Animation","AnimationIteration"),animationstart:$r("Animation","AnimationStart"),transitionrun:$r("Transition","TransitionRun"),transitionstart:$r("Transition","TransitionStart"),transitioncancel:$r("Transition","TransitionCancel"),transitionend:$r("Transition","TransitionEnd")},ad={},zm={};Ja&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete gs.animationend.animation,delete gs.animationiteration.animation,delete gs.animationstart.animation),"TransitionEvent"in window||delete gs.transitionend.transition);function qr(e){if(ad[e])return ad[e];if(!gs[e])return e;var n=gs[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in zm)return ad[e]=n[l];return e}var Um=qr("animationend"),Hm=qr("animationiteration"),Bm=qr("animationstart"),s0=qr("transitionrun"),i0=qr("transitionstart"),u0=qr("transitioncancel"),$m=qr("transitionend"),qm=new Map,ld="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(" ");ld.push("scrollEnd");function Wa(e,n){qm.set(e,n),En(n,[e])}var Iu=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)},za=[],vs=0,rd=0;function Qu(){for(var e=vs,n=rd=vs=0;n<e;){var l=za[n];za[n++]=null;var s=za[n];za[n++]=null;var c=za[n];za[n++]=null;var f=za[n];if(za[n++]=null,s!==null&&c!==null){var y=s.pending;y===null?c.next=c:(c.next=y.next,y.next=c),s.pending=c}f!==0&&Ym(l,c,f)}}function Pu(e,n,l,s){za[vs++]=e,za[vs++]=n,za[vs++]=l,za[vs++]=s,rd|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function sd(e,n,l,s){return Pu(e,n,l,s),Ku(e)}function Yr(e,n){return Pu(e,null,null,n),Ku(e)}function Ym(e,n,l){e.lanes|=l;var s=e.alternate;s!==null&&(s.lanes|=l);for(var c=!1,f=e.return;f!==null;)f.childLanes|=l,s=f.alternate,s!==null&&(s.childLanes|=l),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&n!==null&&(c=31-Lt(l),e=f.hiddenUpdates,s=e[c],s===null?e[c]=[n]:s.push(n),n.lane=l|536870912),f):null}function Ku(e){if(50<Yi)throw Yi=0,gf=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var ys={};function o0(e,n,l,s){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wa(e,n,l,s){return new o0(e,n,l,s)}function id(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _l(e,n){var l=e.alternate;return l===null?(l=wa(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Vm(e,n){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Zu(e,n,l,s,c,f){var y=0;if(s=e,typeof e=="function")id(e)&&(y=1);else if(typeof e=="string")y=mS(e,l,ce.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case re:return e=wa(31,l,n,c),e.elementType=re,e.lanes=f,e;case C:return Vr(l.children,c,f,n);case N:y=8,c|=24;break;case z:return e=wa(12,l,n,c|2),e.elementType=z,e.lanes=f,e;case ee:return e=wa(13,l,n,c),e.elementType=ee,e.lanes=f,e;case te:return e=wa(19,l,n,c),e.elementType=te,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:y=10;break e;case I:y=9;break e;case Q:y=11;break e;case D:y=14;break e;case j:y=16,s=null;break e}y=29,l=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=wa(y,l,n,c),n.elementType=e,n.type=s,n.lanes=f,n}function Vr(e,n,l,s){return e=wa(7,e,s,n),e.lanes=l,e}function ud(e,n,l){return e=wa(6,e,null,n),e.lanes=l,e}function Fm(e){var n=wa(18,null,null,0);return n.stateNode=e,n}function od(e,n,l){return n=wa(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Gm=new WeakMap;function Ua(e,n){if(typeof e=="object"&&e!==null){var l=Gm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:Cn(n)},Gm.set(e,n),n)}return{value:e,source:n,stack:Cn(n)}}var xs=[],bs=0,Ju=null,Si=0,Ha=[],Ba=0,lr=null,dl=1,fl="";function Ll(e,n){xs[bs++]=Si,xs[bs++]=Ju,Ju=e,Si=n}function Xm(e,n,l){Ha[Ba++]=dl,Ha[Ba++]=fl,Ha[Ba++]=lr,lr=e;var s=dl;e=fl;var c=32-Lt(s)-1;s&=~(1<<c),l+=1;var f=32-Lt(n)+c;if(30<f){var y=c-c%5;f=(s&(1<<y)-1).toString(32),s>>=y,c-=y,dl=1<<32-Lt(n)+c|l<<c|s,fl=f+e}else dl=1<<f|l<<c|s,fl=e}function cd(e){e.return!==null&&(Ll(e,1),Xm(e,1,0))}function dd(e){for(;e===Ju;)Ju=xs[--bs],xs[bs]=null,Si=xs[--bs],xs[bs]=null;for(;e===lr;)lr=Ha[--Ba],Ha[Ba]=null,fl=Ha[--Ba],Ha[Ba]=null,dl=Ha[--Ba],Ha[Ba]=null}function Im(e,n){Ha[Ba++]=dl,Ha[Ba++]=fl,Ha[Ba++]=lr,dl=n.id,fl=n.overflow,lr=e}var Xn=null,ln=null,vt=!1,rr=null,$a=!1,fd=Error(i(519));function sr(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ei(Ua(n,e)),fd}function Qm(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[he]=e,n[je]=s,l){case"dialog":ht("cancel",n),ht("close",n);break;case"iframe":case"object":case"embed":ht("load",n);break;case"video":case"audio":for(l=0;l<Fi.length;l++)ht(Fi[l],n);break;case"source":ht("error",n);break;case"img":case"image":case"link":ht("error",n),ht("load",n);break;case"details":ht("toggle",n);break;case"input":ht("invalid",n),di(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ht("invalid",n);break;case"textarea":ht("invalid",n),Za(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||dv(n.textContent,l)?(s.popover!=null&&(ht("beforetoggle",n),ht("toggle",n)),s.onScroll!=null&&ht("scroll",n),s.onScrollEnd!=null&&ht("scrollend",n),s.onClick!=null&&(n.onclick=ea),n=!0):n=!1,n||sr(e,!0)}function Pm(e){for(Xn=e.return;Xn;)switch(Xn.tag){case 5:case 31:case 13:$a=!1;return;case 27:case 3:$a=!0;return;default:Xn=Xn.return}}function Ss(e){if(e!==Xn)return!1;if(!vt)return Pm(e),vt=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Of(e.type,e.memoizedProps)),l=!l),l&&ln&&sr(e),Pm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ln=bv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ln=bv(e)}else n===27?(n=ln,br(e.type)?(e=zf,zf=null,ln=e):ln=n):ln=Xn?Ya(e.stateNode.nextSibling):null;return!0}function Fr(){ln=Xn=null,vt=!1}function hd(){var e=rr;return e!==null&&(ya===null?ya=e:ya.push.apply(ya,e),rr=null),e}function Ei(e){rr===null?rr=[e]:rr.push(e)}var md=O(null),Gr=null,zl=null;function ir(e,n,l){se(md,n._currentValue),n._currentValue=l}function Ul(e){e._currentValue=md.current,X(md)}function pd(e,n,l){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===l)break;e=e.return}}function gd(e,n,l,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var y=c.child;f=f.firstContext;e:for(;f!==null;){var E=f;f=c;for(var M=0;M<n.length;M++)if(E.context===n[M]){f.lanes|=l,E=f.alternate,E!==null&&(E.lanes|=l),pd(f.return,l,e),s||(y=null);break e}f=E.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(i(341));y.lanes|=l,f=y.alternate,f!==null&&(f.lanes|=l),pd(y,l,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Es(e,n,l,s){e=null;for(var c=n,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var E=c.type;Ea(c.pendingProps.value,y.value)||(e!==null?e.push(E):e=[E])}}else if(c===He.current){if(y=c.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Pi):e=[Pi])}c=c.return}e!==null&&gd(n,e,l,s),n.flags|=262144}function Wu(e){for(e=e.firstContext;e!==null;){if(!Ea(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xr(e){Gr=e,zl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function In(e){return Km(Gr,e)}function eo(e,n){return Gr===null&&Xr(e),Km(e,n)}function Km(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},zl===null){if(e===null)throw Error(i(308));zl=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else zl=zl.next=n;return l}var c0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},d0=t.unstable_scheduleCallback,f0=t.unstable_NormalPriority,Nn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vd(){return{controller:new c0,data:new Map,refCount:0}}function wi(e){e.refCount--,e.refCount===0&&d0(f0,function(){e.controller.abort()})}var Ri=null,yd=0,ws=0,Rs=null;function h0(e,n){if(Ri===null){var l=Ri=[];yd=0,ws=Ef(),Rs={status:"pending",value:void 0,then:function(s){l.push(s)}}}return yd++,n.then(Zm,Zm),n}function Zm(){if(--yd===0&&Ri!==null){Rs!==null&&(Rs.status="fulfilled");var e=Ri;Ri=null,ws=0,Rs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function m0(e,n){var l=[],s={status:"pending",value:null,reason:null,then:function(c){l.push(c)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var c=0;c<l.length;c++)(0,l[c])(n)},function(c){for(s.status="rejected",s.reason=c,c=0;c<l.length;c++)(0,l[c])(void 0)}),s}var Jm=B.S;B.S=function(e,n){Lg=Oe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&h0(e,n),Jm!==null&&Jm(e,n)};var Ir=O(null);function xd(){var e=Ir.current;return e!==null?e:Jt.pooledCache}function to(e,n){n===null?se(Ir,Ir.current):se(Ir,n.pool)}function Wm(){var e=xd();return e===null?null:{parent:Nn._currentValue,pool:e}}var Ns=Error(i(460)),bd=Error(i(474)),no=Error(i(542)),ao={then:function(){}};function ep(e){return e=e.status,e==="fulfilled"||e==="rejected"}function tp(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(ea,ea),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ap(e),e;default:if(typeof n.status=="string")n.then(ea,ea);else{if(e=Jt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var c=n;c.status="fulfilled",c.value=s}},function(s){if(n.status==="pending"){var c=n;c.status="rejected",c.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ap(e),e}throw Pr=n,Ns}}function Qr(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Pr=l,Ns):l}}var Pr=null;function np(){if(Pr===null)throw Error(i(459));var e=Pr;return Pr=null,e}function ap(e){if(e===Ns||e===no)throw Error(i(483))}var Ts=null,Ni=0;function lo(e){var n=Ni;return Ni+=1,Ts===null&&(Ts=[]),tp(Ts,e,n)}function Ti(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ro(e,n){throw n.$$typeof===w?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function lp(e){function n(U,L){if(e){var $=U.deletions;$===null?(U.deletions=[L],U.flags|=16):$.push(L)}}function l(U,L){if(!e)return null;for(;L!==null;)n(U,L),L=L.sibling;return null}function s(U){for(var L=new Map;U!==null;)U.key!==null?L.set(U.key,U):L.set(U.index,U),U=U.sibling;return L}function c(U,L){return U=_l(U,L),U.index=0,U.sibling=null,U}function f(U,L,$){return U.index=$,e?($=U.alternate,$!==null?($=$.index,$<L?(U.flags|=67108866,L):$):(U.flags|=67108866,L)):(U.flags|=1048576,L)}function y(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function E(U,L,$,W){return L===null||L.tag!==6?(L=ud($,U.mode,W),L.return=U,L):(L=c(L,$),L.return=U,L)}function M(U,L,$,W){var Be=$.type;return Be===C?Z(U,L,$.props.children,W,$.key):L!==null&&(L.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===j&&Qr(Be)===L.type)?(L=c(L,$.props),Ti(L,$),L.return=U,L):(L=Zu($.type,$.key,$.props,null,U.mode,W),Ti(L,$),L.return=U,L)}function Y(U,L,$,W){return L===null||L.tag!==4||L.stateNode.containerInfo!==$.containerInfo||L.stateNode.implementation!==$.implementation?(L=od($,U.mode,W),L.return=U,L):(L=c(L,$.children||[]),L.return=U,L)}function Z(U,L,$,W,Be){return L===null||L.tag!==7?(L=Vr($,U.mode,W,Be),L.return=U,L):(L=c(L,$),L.return=U,L)}function ae(U,L,$){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=ud(""+L,U.mode,$),L.return=U,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case S:return $=Zu(L.type,L.key,L.props,null,U.mode,$),Ti($,L),$.return=U,$;case R:return L=od(L,U.mode,$),L.return=U,L;case j:return L=Qr(L),ae(U,L,$)}if(Re(L)||pe(L))return L=Vr(L,U.mode,$,null),L.return=U,L;if(typeof L.then=="function")return ae(U,lo(L),$);if(L.$$typeof===q)return ae(U,eo(U,L),$);ro(U,L)}return null}function G(U,L,$,W){var Be=L!==null?L.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return Be!==null?null:E(U,L,""+$,W);if(typeof $=="object"&&$!==null){switch($.$$typeof){case S:return $.key===Be?M(U,L,$,W):null;case R:return $.key===Be?Y(U,L,$,W):null;case j:return $=Qr($),G(U,L,$,W)}if(Re($)||pe($))return Be!==null?null:Z(U,L,$,W,null);if(typeof $.then=="function")return G(U,L,lo($),W);if($.$$typeof===q)return G(U,L,eo(U,$),W);ro(U,$)}return null}function P(U,L,$,W,Be){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return U=U.get($)||null,E(L,U,""+W,Be);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return U=U.get(W.key===null?$:W.key)||null,M(L,U,W,Be);case R:return U=U.get(W.key===null?$:W.key)||null,Y(L,U,W,Be);case j:return W=Qr(W),P(U,L,$,W,Be)}if(Re(W)||pe(W))return U=U.get($)||null,Z(L,U,W,Be,null);if(typeof W.then=="function")return P(U,L,$,lo(W),Be);if(W.$$typeof===q)return P(U,L,$,eo(L,W),Be);ro(L,W)}return null}function Ce(U,L,$,W){for(var Be=null,Tt=null,ke=L,st=L=0,pt=null;ke!==null&&st<$.length;st++){ke.index>st?(pt=ke,ke=null):pt=ke.sibling;var jt=G(U,ke,$[st],W);if(jt===null){ke===null&&(ke=pt);break}e&&ke&&jt.alternate===null&&n(U,ke),L=f(jt,L,st),Tt===null?Be=jt:Tt.sibling=jt,Tt=jt,ke=pt}if(st===$.length)return l(U,ke),vt&&Ll(U,st),Be;if(ke===null){for(;st<$.length;st++)ke=ae(U,$[st],W),ke!==null&&(L=f(ke,L,st),Tt===null?Be=ke:Tt.sibling=ke,Tt=ke);return vt&&Ll(U,st),Be}for(ke=s(ke);st<$.length;st++)pt=P(ke,U,st,$[st],W),pt!==null&&(e&&pt.alternate!==null&&ke.delete(pt.key===null?st:pt.key),L=f(pt,L,st),Tt===null?Be=pt:Tt.sibling=pt,Tt=pt);return e&&ke.forEach(function(Nr){return n(U,Nr)}),vt&&Ll(U,st),Be}function Ye(U,L,$,W){if($==null)throw Error(i(151));for(var Be=null,Tt=null,ke=L,st=L=0,pt=null,jt=$.next();ke!==null&&!jt.done;st++,jt=$.next()){ke.index>st?(pt=ke,ke=null):pt=ke.sibling;var Nr=G(U,ke,jt.value,W);if(Nr===null){ke===null&&(ke=pt);break}e&&ke&&Nr.alternate===null&&n(U,ke),L=f(Nr,L,st),Tt===null?Be=Nr:Tt.sibling=Nr,Tt=Nr,ke=pt}if(jt.done)return l(U,ke),vt&&Ll(U,st),Be;if(ke===null){for(;!jt.done;st++,jt=$.next())jt=ae(U,jt.value,W),jt!==null&&(L=f(jt,L,st),Tt===null?Be=jt:Tt.sibling=jt,Tt=jt);return vt&&Ll(U,st),Be}for(ke=s(ke);!jt.done;st++,jt=$.next())jt=P(ke,U,st,jt.value,W),jt!==null&&(e&&jt.alternate!==null&&ke.delete(jt.key===null?st:jt.key),L=f(jt,L,st),Tt===null?Be=jt:Tt.sibling=jt,Tt=jt);return e&&ke.forEach(function(NS){return n(U,NS)}),vt&&Ll(U,st),Be}function Gt(U,L,$,W){if(typeof $=="object"&&$!==null&&$.type===C&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case S:e:{for(var Be=$.key;L!==null;){if(L.key===Be){if(Be=$.type,Be===C){if(L.tag===7){l(U,L.sibling),W=c(L,$.props.children),W.return=U,U=W;break e}}else if(L.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===j&&Qr(Be)===L.type){l(U,L.sibling),W=c(L,$.props),Ti(W,$),W.return=U,U=W;break e}l(U,L);break}else n(U,L);L=L.sibling}$.type===C?(W=Vr($.props.children,U.mode,W,$.key),W.return=U,U=W):(W=Zu($.type,$.key,$.props,null,U.mode,W),Ti(W,$),W.return=U,U=W)}return y(U);case R:e:{for(Be=$.key;L!==null;){if(L.key===Be)if(L.tag===4&&L.stateNode.containerInfo===$.containerInfo&&L.stateNode.implementation===$.implementation){l(U,L.sibling),W=c(L,$.children||[]),W.return=U,U=W;break e}else{l(U,L);break}else n(U,L);L=L.sibling}W=od($,U.mode,W),W.return=U,U=W}return y(U);case j:return $=Qr($),Gt(U,L,$,W)}if(Re($))return Ce(U,L,$,W);if(pe($)){if(Be=pe($),typeof Be!="function")throw Error(i(150));return $=Be.call($),Ye(U,L,$,W)}if(typeof $.then=="function")return Gt(U,L,lo($),W);if($.$$typeof===q)return Gt(U,L,eo(U,$),W);ro(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,L!==null&&L.tag===6?(l(U,L.sibling),W=c(L,$),W.return=U,U=W):(l(U,L),W=ud($,U.mode,W),W.return=U,U=W),y(U)):l(U,L)}return function(U,L,$,W){try{Ni=0;var Be=Gt(U,L,$,W);return Ts=null,Be}catch(ke){if(ke===Ns||ke===no)throw ke;var Tt=wa(29,ke,null,U.mode);return Tt.lanes=W,Tt.return=U,Tt}finally{}}}var Kr=lp(!0),rp=lp(!1),ur=!1;function Sd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ed(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function or(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cr(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Dt&2)!==0){var c=s.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),s.pending=n,n=Ku(e),Ym(e,null,l),n}return Pu(e,s,n,l),Ku(e)}function ji(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,An(e,l)}}function wd(e,n){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var c=null,f=null;if(l=l.firstBaseUpdate,l!==null){do{var y={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};f===null?c=f=y:f=f.next=y,l=l.next}while(l!==null);f===null?c=f=n:f=f.next=n}else c=f=n;l={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var Rd=!1;function Di(){if(Rd){var e=Rs;if(e!==null)throw e}}function Ci(e,n,l,s){Rd=!1;var c=e.updateQueue;ur=!1;var f=c.firstBaseUpdate,y=c.lastBaseUpdate,E=c.shared.pending;if(E!==null){c.shared.pending=null;var M=E,Y=M.next;M.next=null,y===null?f=Y:y.next=Y,y=M;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,E=Z.lastBaseUpdate,E!==y&&(E===null?Z.firstBaseUpdate=Y:E.next=Y,Z.lastBaseUpdate=M))}if(f!==null){var ae=c.baseState;y=0,Z=Y=M=null,E=f;do{var G=E.lane&-536870913,P=G!==E.lane;if(P?(mt&G)===G:(s&G)===G){G!==0&&G===ws&&(Rd=!0),Z!==null&&(Z=Z.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Ce=e,Ye=E;G=n;var Gt=l;switch(Ye.tag){case 1:if(Ce=Ye.payload,typeof Ce=="function"){ae=Ce.call(Gt,ae,G);break e}ae=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ye.payload,G=typeof Ce=="function"?Ce.call(Gt,ae,G):Ce,G==null)break e;ae=b({},ae,G);break e;case 2:ur=!0}}G=E.callback,G!==null&&(e.flags|=64,P&&(e.flags|=8192),P=c.callbacks,P===null?c.callbacks=[G]:P.push(G))}else P={lane:G,tag:E.tag,payload:E.payload,callback:E.callback,next:null},Z===null?(Y=Z=P,M=ae):Z=Z.next=P,y|=G;if(E=E.next,E===null){if(E=c.shared.pending,E===null)break;P=E,E=P.next,P.next=null,c.lastBaseUpdate=P,c.shared.pending=null}}while(!0);Z===null&&(M=ae),c.baseState=M,c.firstBaseUpdate=Y,c.lastBaseUpdate=Z,f===null&&(c.shared.lanes=0),pr|=y,e.lanes=y,e.memoizedState=ae}}function sp(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function ip(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)sp(l[e],n)}var js=O(null),so=O(0);function up(e,n){e=Xl,se(so,e),se(js,n),Xl=e|n.baseLanes}function Nd(){se(so,Xl),se(js,js.current)}function Td(){Xl=so.current,X(js),X(so)}var Ra=O(null),qa=null;function dr(e){var n=e.alternate;se(vn,vn.current&1),se(Ra,e),qa===null&&(n===null||js.current!==null||n.memoizedState!==null)&&(qa=e)}function jd(e){se(vn,vn.current),se(Ra,e),qa===null&&(qa=e)}function op(e){e.tag===22?(se(vn,vn.current),se(Ra,e),qa===null&&(qa=e)):fr()}function fr(){se(vn,vn.current),se(Ra,Ra.current)}function Na(e){X(Ra),qa===e&&(qa=null),X(vn)}var vn=O(0);function io(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||_f(l)||Lf(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Hl=0,nt=null,Vt=null,Tn=null,uo=!1,Ds=!1,Zr=!1,oo=0,Ai=0,Cs=null,p0=0;function fn(){throw Error(i(321))}function Dd(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!Ea(e[l],n[l]))return!1;return!0}function Cd(e,n,l,s,c,f){return Hl=f,nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,B.H=e===null||e.memoizedState===null?Xp:Fd,Zr=!1,f=l(s,c),Zr=!1,Ds&&(f=dp(n,l,s,c)),cp(e),f}function cp(e){B.H=ki;var n=Vt!==null&&Vt.next!==null;if(Hl=0,Tn=Vt=nt=null,uo=!1,Ai=0,Cs=null,n)throw Error(i(300));e===null||jn||(e=e.dependencies,e!==null&&Wu(e)&&(jn=!0))}function dp(e,n,l,s){nt=e;var c=0;do{if(Ds&&(Cs=null),Ai=0,Ds=!1,25<=c)throw Error(i(301));if(c+=1,Tn=Vt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}B.H=Ip,f=n(l,s)}while(Ds);return f}function g0(){var e=B.H,n=e.useState()[0];return n=typeof n.then=="function"?Oi(n):n,e=e.useState()[0],(Vt!==null?Vt.memoizedState:null)!==e&&(nt.flags|=1024),n}function Ad(){var e=oo!==0;return oo=0,e}function Od(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function Md(e){if(uo){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}uo=!1}Hl=0,Tn=Vt=nt=null,Ds=!1,Ai=oo=0,Cs=null}function ia(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?nt.memoizedState=Tn=e:Tn=Tn.next=e,Tn}function yn(){if(Vt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var n=Tn===null?nt.memoizedState:Tn.next;if(n!==null)Tn=n,Vt=e;else{if(e===null)throw nt.alternate===null?Error(i(467)):Error(i(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Tn===null?nt.memoizedState=Tn=e:Tn=Tn.next=e}return Tn}function co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oi(e){var n=Ai;return Ai+=1,Cs===null&&(Cs=[]),e=tp(Cs,e,n),n=nt,(Tn===null?n.memoizedState:Tn.next)===null&&(n=n.alternate,B.H=n===null||n.memoizedState===null?Xp:Fd),e}function fo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Oi(e);if(e.$$typeof===q)return In(e)}throw Error(i(438,String(e)))}function kd(e){var n=null,l=nt.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=nt.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(c){return c.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=co(),nt.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),s=0;s<e;s++)l[s]=ue;return n.index++,l}function Bl(e,n){return typeof n=="function"?n(e):n}function ho(e){var n=yn();return _d(n,Vt,e)}function _d(e,n,l){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=l;var c=e.baseQueue,f=s.pending;if(f!==null){if(c!==null){var y=c.next;c.next=f.next,f.next=y}n.baseQueue=c=f,s.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{n=c.next;var E=y=null,M=null,Y=n,Z=!1;do{var ae=Y.lane&-536870913;if(ae!==Y.lane?(mt&ae)===ae:(Hl&ae)===ae){var G=Y.revertLane;if(G===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ae===ws&&(Z=!0);else if((Hl&G)===G){Y=Y.next,G===ws&&(Z=!0);continue}else ae={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},M===null?(E=M=ae,y=f):M=M.next=ae,nt.lanes|=G,pr|=G;ae=Y.action,Zr&&l(f,ae),f=Y.hasEagerState?Y.eagerState:l(f,ae)}else G={lane:ae,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},M===null?(E=M=G,y=f):M=M.next=G,nt.lanes|=ae,pr|=ae;Y=Y.next}while(Y!==null&&Y!==n);if(M===null?y=f:M.next=E,!Ea(f,e.memoizedState)&&(jn=!0,Z&&(l=Rs,l!==null)))throw l;e.memoizedState=f,e.baseState=y,e.baseQueue=M,s.lastRenderedState=f}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Ld(e){var n=yn(),l=n.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=e;var s=l.dispatch,c=l.pending,f=n.memoizedState;if(c!==null){l.pending=null;var y=c=c.next;do f=e(f,y.action),y=y.next;while(y!==c);Ea(f,n.memoizedState)||(jn=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),l.lastRenderedState=f}return[f,s]}function fp(e,n,l){var s=nt,c=yn(),f=vt;if(f){if(l===void 0)throw Error(i(407));l=l()}else l=n();var y=!Ea((Vt||c).memoizedState,l);if(y&&(c.memoizedState=l,jn=!0),c=c.queue,Hd(pp.bind(null,s,c,e),[e]),c.getSnapshot!==n||y||Tn!==null&&Tn.memoizedState.tag&1){if(s.flags|=2048,As(9,{destroy:void 0},mp.bind(null,s,c,l,n),null),Jt===null)throw Error(i(349));f||(Hl&127)!==0||hp(s,n,l)}return l}function hp(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=nt.updateQueue,n===null?(n=co(),nt.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function mp(e,n,l,s){n.value=l,n.getSnapshot=s,gp(n)&&vp(e)}function pp(e,n,l){return l(function(){gp(n)&&vp(e)})}function gp(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!Ea(e,l)}catch{return!0}}function vp(e){var n=Yr(e,2);n!==null&&xa(n,e,2)}function zd(e){var n=ia();if(typeof e=="function"){var l=e;if(e=l(),Zr){St(!0);try{l()}finally{St(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bl,lastRenderedState:e},n}function yp(e,n,l,s){return e.baseState=l,_d(e,Vt,typeof s=="function"?s:Bl)}function v0(e,n,l,s,c){if(go(e))throw Error(i(485));if(e=n.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};B.T!==null?l(!0):f.isTransition=!1,s(f),l=n.pending,l===null?(f.next=n.pending=f,xp(n,f)):(f.next=l.next,n.pending=l.next=f)}}function xp(e,n){var l=n.action,s=n.payload,c=e.state;if(n.isTransition){var f=B.T,y={};B.T=y;try{var E=l(c,s),M=B.S;M!==null&&M(y,E),bp(e,n,E)}catch(Y){Ud(e,n,Y)}finally{f!==null&&y.types!==null&&(f.types=y.types),B.T=f}}else try{f=l(c,s),bp(e,n,f)}catch(Y){Ud(e,n,Y)}}function bp(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){Sp(e,n,s)},function(s){return Ud(e,n,s)}):Sp(e,n,l)}function Sp(e,n,l){n.status="fulfilled",n.value=l,Ep(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,xp(e,l)))}function Ud(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,Ep(n),n=n.next;while(n!==s)}e.action=null}function Ep(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function wp(e,n){return n}function Rp(e,n){if(vt){var l=Jt.formState;if(l!==null){e:{var s=nt;if(vt){if(ln){t:{for(var c=ln,f=$a;c.nodeType!==8;){if(!f){c=null;break t}if(c=Ya(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){ln=Ya(c.nextSibling),s=c.data==="F!";break e}}sr(s)}s=!1}s&&(n=l[0])}}return l=ia(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wp,lastRenderedState:n},l.queue=s,l=Vp.bind(null,nt,s),s.dispatch=l,s=zd(!1),f=Vd.bind(null,nt,!1,s.queue),s=ia(),c={state:n,dispatch:null,action:e,pending:null},s.queue=c,l=v0.bind(null,nt,c,f,l),c.dispatch=l,s.memoizedState=e,[n,l,!1]}function Np(e){var n=yn();return Tp(n,Vt,e)}function Tp(e,n,l){if(n=_d(e,n,wp)[0],e=ho(Bl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Oi(n)}catch(y){throw y===Ns?no:y}else s=n;n=yn();var c=n.queue,f=c.dispatch;return l!==n.memoizedState&&(nt.flags|=2048,As(9,{destroy:void 0},y0.bind(null,c,l),null)),[s,f,e]}function y0(e,n){e.action=n}function jp(e){var n=yn(),l=Vt;if(l!==null)return Tp(n,l,e);yn(),n=n.memoizedState,l=yn();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function As(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=nt.updateQueue,n===null&&(n=co(),nt.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(s=l.next,l.next=e,e.next=s,n.lastEffect=e),e}function Dp(){return yn().memoizedState}function mo(e,n,l,s){var c=ia();nt.flags|=e,c.memoizedState=As(1|n,{destroy:void 0},l,s===void 0?null:s)}function po(e,n,l,s){var c=yn();s=s===void 0?null:s;var f=c.memoizedState.inst;Vt!==null&&s!==null&&Dd(s,Vt.memoizedState.deps)?c.memoizedState=As(n,f,l,s):(nt.flags|=e,c.memoizedState=As(1|n,f,l,s))}function Cp(e,n){mo(8390656,8,e,n)}function Hd(e,n){po(2048,8,e,n)}function x0(e){nt.flags|=4;var n=nt.updateQueue;if(n===null)n=co(),nt.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Ap(e){var n=yn().memoizedState;return x0({ref:n,nextImpl:e}),function(){if((Dt&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Op(e,n){return po(4,2,e,n)}function Mp(e,n){return po(4,4,e,n)}function kp(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function _p(e,n,l){l=l!=null?l.concat([e]):null,po(4,4,kp.bind(null,n,e),l)}function Bd(){}function Lp(e,n){var l=yn();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&Dd(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function zp(e,n){var l=yn();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Dd(n,s[1]))return s[0];if(s=e(),Zr){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[s,n],s}function $d(e,n,l){return l===void 0||(Hl&1073741824)!==0&&(mt&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Ug(),nt.lanes|=e,pr|=e,l)}function Up(e,n,l,s){return Ea(l,n)?l:js.current!==null?(e=$d(e,l,s),Ea(e,n)||(jn=!0),e):(Hl&42)===0||(Hl&1073741824)!==0&&(mt&261930)===0?(jn=!0,e.memoizedState=l):(e=Ug(),nt.lanes|=e,pr|=e,n)}function Hp(e,n,l,s,c){var f=V.p;V.p=f!==0&&8>f?f:8;var y=B.T,E={};B.T=E,Vd(e,!1,n,l);try{var M=c(),Y=B.S;if(Y!==null&&Y(E,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var Z=m0(M,s);Mi(e,n,Z,Da(e))}else Mi(e,n,s,Da(e))}catch(ae){Mi(e,n,{then:function(){},status:"rejected",reason:ae},Da())}finally{V.p=f,y!==null&&E.types!==null&&(y.types=E.types),B.T=y}}function b0(){}function qd(e,n,l,s){if(e.tag!==5)throw Error(i(476));var c=Bp(e).queue;Hp(e,c,n,de,l===null?b0:function(){return $p(e),l(s)})}function Bp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bl,lastRenderedState:de},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bl,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function $p(e){var n=Bp(e);n.next===null&&(n=e.alternate.memoizedState),Mi(e,n.next.queue,{},Da())}function Yd(){return In(Pi)}function qp(){return yn().memoizedState}function Yp(){return yn().memoizedState}function S0(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Da();e=or(l);var s=cr(n,e,l);s!==null&&(xa(s,n,l),ji(s,n,l)),n={cache:vd()},e.payload=n;return}n=n.return}}function E0(e,n,l){var s=Da();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},go(e)?Fp(n,l):(l=sd(e,n,l,s),l!==null&&(xa(l,e,s),Gp(l,n,s)))}function Vp(e,n,l){var s=Da();Mi(e,n,l,s)}function Mi(e,n,l,s){var c={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(go(e))Fp(n,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,E=f(y,l);if(c.hasEagerState=!0,c.eagerState=E,Ea(E,y))return Pu(e,n,c,0),Jt===null&&Qu(),!1}catch{}finally{}if(l=sd(e,n,c,s),l!==null)return xa(l,e,s),Gp(l,n,s),!0}return!1}function Vd(e,n,l,s){if(s={lane:2,revertLane:Ef(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},go(e)){if(n)throw Error(i(479))}else n=sd(e,l,s,2),n!==null&&xa(n,e,2)}function go(e){var n=e.alternate;return e===nt||n!==null&&n===nt}function Fp(e,n){Ds=uo=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Gp(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,An(e,l)}}var ki={readContext:In,use:fo,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};ki.useEffectEvent=fn;var Xp={readContext:In,use:fo,useCallback:function(e,n){return ia().memoizedState=[e,n===void 0?null:n],e},useContext:In,useEffect:Cp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,mo(4194308,4,kp.bind(null,n,e),l)},useLayoutEffect:function(e,n){return mo(4194308,4,e,n)},useInsertionEffect:function(e,n){mo(4,2,e,n)},useMemo:function(e,n){var l=ia();n=n===void 0?null:n;var s=e();if(Zr){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=ia();if(l!==void 0){var c=l(n);if(Zr){St(!0);try{l(n)}finally{St(!1)}}}else c=n;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=E0.bind(null,nt,e),[s.memoizedState,e]},useRef:function(e){var n=ia();return e={current:e},n.memoizedState=e},useState:function(e){e=zd(e);var n=e.queue,l=Vp.bind(null,nt,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:Bd,useDeferredValue:function(e,n){var l=ia();return $d(l,e,n)},useTransition:function(){var e=zd(!1);return e=Hp.bind(null,nt,e.queue,!0,!1),ia().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=nt,c=ia();if(vt){if(l===void 0)throw Error(i(407));l=l()}else{if(l=n(),Jt===null)throw Error(i(349));(mt&127)!==0||hp(s,n,l)}c.memoizedState=l;var f={value:l,getSnapshot:n};return c.queue=f,Cp(pp.bind(null,s,f,e),[e]),s.flags|=2048,As(9,{destroy:void 0},mp.bind(null,s,f,l,n),null),l},useId:function(){var e=ia(),n=Jt.identifierPrefix;if(vt){var l=fl,s=dl;l=(s&~(1<<32-Lt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=oo++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=p0++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Yd,useFormState:Rp,useActionState:Rp,useOptimistic:function(e){var n=ia();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Vd.bind(null,nt,!0,l),l.dispatch=n,[e,n]},useMemoCache:kd,useCacheRefresh:function(){return ia().memoizedState=S0.bind(null,nt)},useEffectEvent:function(e){var n=ia(),l={impl:e};return n.memoizedState=l,function(){if((Dt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},Fd={readContext:In,use:fo,useCallback:Lp,useContext:In,useEffect:Hd,useImperativeHandle:_p,useInsertionEffect:Op,useLayoutEffect:Mp,useMemo:zp,useReducer:ho,useRef:Dp,useState:function(){return ho(Bl)},useDebugValue:Bd,useDeferredValue:function(e,n){var l=yn();return Up(l,Vt.memoizedState,e,n)},useTransition:function(){var e=ho(Bl)[0],n=yn().memoizedState;return[typeof e=="boolean"?e:Oi(e),n]},useSyncExternalStore:fp,useId:qp,useHostTransitionStatus:Yd,useFormState:Np,useActionState:Np,useOptimistic:function(e,n){var l=yn();return yp(l,Vt,e,n)},useMemoCache:kd,useCacheRefresh:Yp};Fd.useEffectEvent=Ap;var Ip={readContext:In,use:fo,useCallback:Lp,useContext:In,useEffect:Hd,useImperativeHandle:_p,useInsertionEffect:Op,useLayoutEffect:Mp,useMemo:zp,useReducer:Ld,useRef:Dp,useState:function(){return Ld(Bl)},useDebugValue:Bd,useDeferredValue:function(e,n){var l=yn();return Vt===null?$d(l,e,n):Up(l,Vt.memoizedState,e,n)},useTransition:function(){var e=Ld(Bl)[0],n=yn().memoizedState;return[typeof e=="boolean"?e:Oi(e),n]},useSyncExternalStore:fp,useId:qp,useHostTransitionStatus:Yd,useFormState:jp,useActionState:jp,useOptimistic:function(e,n){var l=yn();return Vt!==null?yp(l,Vt,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:kd,useCacheRefresh:Yp};Ip.useEffectEvent=Ap;function Gd(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:b({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Xd={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=Da(),c=or(s);c.payload=n,l!=null&&(c.callback=l),n=cr(e,c,s),n!==null&&(xa(n,e,s),ji(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=Da(),c=or(s);c.tag=1,c.payload=n,l!=null&&(c.callback=l),n=cr(e,c,s),n!==null&&(xa(n,e,s),ji(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Da(),s=or(l);s.tag=2,n!=null&&(s.callback=n),n=cr(e,s,l),n!==null&&(xa(n,e,l),ji(n,e,l))}};function Qp(e,n,l,s,c,f,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,y):n.prototype&&n.prototype.isPureReactComponent?!xi(l,s)||!xi(c,f):!0}function Pp(e,n,l,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==e&&Xd.enqueueReplaceState(n,n.state,null)}function Jr(e,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}if(e=e.defaultProps){l===n&&(l=b({},l));for(var c in e)l[c]===void 0&&(l[c]=e[c])}return l}function Kp(e){Iu(e)}function Zp(e){console.error(e)}function Jp(e){Iu(e)}function vo(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Wp(e,n,l){try{var s=e.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Id(e,n,l){return l=or(l),l.tag=3,l.payload={element:null},l.callback=function(){vo(e,n)},l}function eg(e){return e=or(e),e.tag=3,e}function tg(e,n,l,s){var c=l.type.getDerivedStateFromError;if(typeof c=="function"){var f=s.value;e.payload=function(){return c(f)},e.callback=function(){Wp(n,l,s)}}var y=l.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Wp(n,l,s),typeof c!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var E=s.stack;this.componentDidCatch(s.value,{componentStack:E!==null?E:""})})}function w0(e,n,l,s,c){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&Es(n,l,c,!0),l=Ra.current,l!==null){switch(l.tag){case 31:case 13:return qa===null?Co():l.alternate===null&&hn===0&&(hn=3),l.flags&=-257,l.flags|=65536,l.lanes=c,s===ao?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),xf(e,s,c)),!1;case 22:return l.flags|=65536,s===ao?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),xf(e,s,c)),!1}throw Error(i(435,l.tag))}return xf(e,s,c),Co(),!1}if(vt)return n=Ra.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,s!==fd&&(e=Error(i(422),{cause:s}),Ei(Ua(e,l)))):(s!==fd&&(n=Error(i(423),{cause:s}),Ei(Ua(n,l))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Ua(s,l),c=Id(e.stateNode,s,c),wd(e,c),hn!==4&&(hn=2)),!1;var f=Error(i(520),{cause:s});if(f=Ua(f,l),qi===null?qi=[f]:qi.push(f),hn!==4&&(hn=2),n===null)return!0;s=Ua(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=c&-c,l.lanes|=e,e=Id(l.stateNode,s,e),wd(l,e),!1;case 1:if(n=l.type,f=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(gr===null||!gr.has(f))))return l.flags|=65536,c&=-c,l.lanes|=c,c=eg(c),tg(c,e,l,s),wd(l,c),!1}l=l.return}while(l!==null);return!1}var Qd=Error(i(461)),jn=!1;function Qn(e,n,l,s){n.child=e===null?rp(n,null,l,s):Kr(n,e.child,l,s)}function ng(e,n,l,s,c){l=l.render;var f=n.ref;if("ref"in s){var y={};for(var E in s)E!=="ref"&&(y[E]=s[E])}else y=s;return Xr(n),s=Cd(e,n,l,y,f,c),E=Ad(),e!==null&&!jn?(Od(e,n,c),$l(e,n,c)):(vt&&E&&cd(n),n.flags|=1,Qn(e,n,s,c),n.child)}function ag(e,n,l,s,c){if(e===null){var f=l.type;return typeof f=="function"&&!id(f)&&f.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=f,lg(e,n,f,s,c)):(e=Zu(l.type,null,s,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!nf(e,c)){var y=f.memoizedProps;if(l=l.compare,l=l!==null?l:xi,l(y,s)&&e.ref===n.ref)return $l(e,n,c)}return n.flags|=1,e=_l(f,s),e.ref=n.ref,e.return=n,n.child=e}function lg(e,n,l,s,c){if(e!==null){var f=e.memoizedProps;if(xi(f,s)&&e.ref===n.ref)if(jn=!1,n.pendingProps=s=f,nf(e,c))(e.flags&131072)!==0&&(jn=!0);else return n.lanes=e.lanes,$l(e,n,c)}return Pd(e,n,l,s,c)}function rg(e,n,l,s){var c=s.children,f=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(f=f!==null?f.baseLanes|l:l,e!==null){for(s=n.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~f}else s=0,n.child=null;return sg(e,n,f,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&to(n,f!==null?f.cachePool:null),f!==null?up(n,f):Nd(),op(n);else return s=n.lanes=536870912,sg(e,n,f!==null?f.baseLanes|l:l,l,s)}else f!==null?(to(n,f.cachePool),up(n,f),fr(),n.memoizedState=null):(e!==null&&to(n,null),Nd(),fr());return Qn(e,n,c,l),n.child}function _i(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function sg(e,n,l,s,c){var f=xd();return f=f===null?null:{parent:Nn._currentValue,pool:f},n.memoizedState={baseLanes:l,cachePool:f},e!==null&&to(n,null),Nd(),op(n),e!==null&&Es(e,n,s,!0),n.childLanes=c,null}function yo(e,n){return n=bo({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function ig(e,n,l){return Kr(n,e.child,null,l),e=yo(n,n.pendingProps),e.flags|=2,Na(n),n.memoizedState=null,e}function R0(e,n,l){var s=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(vt){if(s.mode==="hidden")return e=yo(n,s),n.lanes=536870912,_i(null,e);if(jd(n),(e=ln)?(e=xv(e,$a),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:lr!==null?{id:dl,overflow:fl}:null,retryLane:536870912,hydrationErrors:null},l=Fm(e),l.return=n,n.child=l,Xn=n,ln=null)):e=null,e===null)throw sr(n);return n.lanes=536870912,null}return yo(n,s)}var f=e.memoizedState;if(f!==null){var y=f.dehydrated;if(jd(n),c)if(n.flags&256)n.flags&=-257,n=ig(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(jn||Es(e,n,l,!1),c=(l&e.childLanes)!==0,jn||c){if(s=Jt,s!==null&&(y=A(s,l),y!==0&&y!==f.retryLane))throw f.retryLane=y,Yr(e,y),xa(s,e,y),Qd;Co(),n=ig(e,n,l)}else e=f.treeContext,ln=Ya(y.nextSibling),Xn=n,vt=!0,rr=null,$a=!1,e!==null&&Im(n,e),n=yo(n,s),n.flags|=4096;return n}return e=_l(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function xo(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function Pd(e,n,l,s,c){return Xr(n),l=Cd(e,n,l,s,void 0,c),s=Ad(),e!==null&&!jn?(Od(e,n,c),$l(e,n,c)):(vt&&s&&cd(n),n.flags|=1,Qn(e,n,l,c),n.child)}function ug(e,n,l,s,c,f){return Xr(n),n.updateQueue=null,l=dp(n,s,l,c),cp(e),s=Ad(),e!==null&&!jn?(Od(e,n,f),$l(e,n,f)):(vt&&s&&cd(n),n.flags|=1,Qn(e,n,l,f),n.child)}function og(e,n,l,s,c){if(Xr(n),n.stateNode===null){var f=ys,y=l.contextType;typeof y=="object"&&y!==null&&(f=In(y)),f=new l(s,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Xd,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=s,f.state=n.memoizedState,f.refs={},Sd(n),y=l.contextType,f.context=typeof y=="object"&&y!==null?In(y):ys,f.state=n.memoizedState,y=l.getDerivedStateFromProps,typeof y=="function"&&(Gd(n,l,y,s),f.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&Xd.enqueueReplaceState(f,f.state,null),Ci(n,s,f,c),Di(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){f=n.stateNode;var E=n.memoizedProps,M=Jr(l,E);f.props=M;var Y=f.context,Z=l.contextType;y=ys,typeof Z=="object"&&Z!==null&&(y=In(Z));var ae=l.getDerivedStateFromProps;Z=typeof ae=="function"||typeof f.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,Z||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(E||Y!==y)&&Pp(n,f,s,y),ur=!1;var G=n.memoizedState;f.state=G,Ci(n,s,f,c),Di(),Y=n.memoizedState,E||G!==Y||ur?(typeof ae=="function"&&(Gd(n,l,ae,s),Y=n.memoizedState),(M=ur||Qp(n,l,M,s,G,Y,y))?(Z||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=Y),f.props=s,f.state=Y,f.context=y,s=M):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{f=n.stateNode,Ed(e,n),y=n.memoizedProps,Z=Jr(l,y),f.props=Z,ae=n.pendingProps,G=f.context,Y=l.contextType,M=ys,typeof Y=="object"&&Y!==null&&(M=In(Y)),E=l.getDerivedStateFromProps,(Y=typeof E=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==ae||G!==M)&&Pp(n,f,s,M),ur=!1,G=n.memoizedState,f.state=G,Ci(n,s,f,c),Di();var P=n.memoizedState;y!==ae||G!==P||ur||e!==null&&e.dependencies!==null&&Wu(e.dependencies)?(typeof E=="function"&&(Gd(n,l,E,s),P=n.memoizedState),(Z=ur||Qp(n,l,Z,s,G,P,M)||e!==null&&e.dependencies!==null&&Wu(e.dependencies))?(Y||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,P,M),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,P,M)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=P),f.props=s,f.state=P,f.context=M,s=Z):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return f=s,xo(e,n),s=(n.flags&128)!==0,f||s?(f=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&s?(n.child=Kr(n,e.child,null,c),n.child=Kr(n,null,l,c)):Qn(e,n,l,c),n.memoizedState=f.state,e=n.child):e=$l(e,n,c),e}function cg(e,n,l,s){return Fr(),n.flags|=256,Qn(e,n,l,s),n.child}var Kd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zd(e){return{baseLanes:e,cachePool:Wm()}}function Jd(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=ja),e}function dg(e,n,l){var s=n.pendingProps,c=!1,f=(n.flags&128)!==0,y;if((y=f)||(y=e!==null&&e.memoizedState===null?!1:(vn.current&2)!==0),y&&(c=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,e===null){if(vt){if(c?dr(n):fr(),(e=ln)?(e=xv(e,$a),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:lr!==null?{id:dl,overflow:fl}:null,retryLane:536870912,hydrationErrors:null},l=Fm(e),l.return=n,n.child=l,Xn=n,ln=null)):e=null,e===null)throw sr(n);return Lf(e)?n.lanes=32:n.lanes=536870912,null}var E=s.children;return s=s.fallback,c?(fr(),c=n.mode,E=bo({mode:"hidden",children:E},c),s=Vr(s,c,l,null),E.return=n,s.return=n,E.sibling=s,n.child=E,s=n.child,s.memoizedState=Zd(l),s.childLanes=Jd(e,y,l),n.memoizedState=Kd,_i(null,s)):(dr(n),Wd(n,E))}var M=e.memoizedState;if(M!==null&&(E=M.dehydrated,E!==null)){if(f)n.flags&256?(dr(n),n.flags&=-257,n=ef(e,n,l)):n.memoizedState!==null?(fr(),n.child=e.child,n.flags|=128,n=null):(fr(),E=s.fallback,c=n.mode,s=bo({mode:"visible",children:s.children},c),E=Vr(E,c,l,null),E.flags|=2,s.return=n,E.return=n,s.sibling=E,n.child=s,Kr(n,e.child,null,l),s=n.child,s.memoizedState=Zd(l),s.childLanes=Jd(e,y,l),n.memoizedState=Kd,n=_i(null,s));else if(dr(n),Lf(E)){if(y=E.nextSibling&&E.nextSibling.dataset,y)var Y=y.dgst;y=Y,s=Error(i(419)),s.stack="",s.digest=y,Ei({value:s,source:null,stack:null}),n=ef(e,n,l)}else if(jn||Es(e,n,l,!1),y=(l&e.childLanes)!==0,jn||y){if(y=Jt,y!==null&&(s=A(y,l),s!==0&&s!==M.retryLane))throw M.retryLane=s,Yr(e,s),xa(y,e,s),Qd;_f(E)||Co(),n=ef(e,n,l)}else _f(E)?(n.flags|=192,n.child=e.child,n=null):(e=M.treeContext,ln=Ya(E.nextSibling),Xn=n,vt=!0,rr=null,$a=!1,e!==null&&Im(n,e),n=Wd(n,s.children),n.flags|=4096);return n}return c?(fr(),E=s.fallback,c=n.mode,M=e.child,Y=M.sibling,s=_l(M,{mode:"hidden",children:s.children}),s.subtreeFlags=M.subtreeFlags&65011712,Y!==null?E=_l(Y,E):(E=Vr(E,c,l,null),E.flags|=2),E.return=n,s.return=n,s.sibling=E,n.child=s,_i(null,s),s=n.child,E=e.child.memoizedState,E===null?E=Zd(l):(c=E.cachePool,c!==null?(M=Nn._currentValue,c=c.parent!==M?{parent:M,pool:M}:c):c=Wm(),E={baseLanes:E.baseLanes|l,cachePool:c}),s.memoizedState=E,s.childLanes=Jd(e,y,l),n.memoizedState=Kd,_i(e.child,s)):(dr(n),l=e.child,e=l.sibling,l=_l(l,{mode:"visible",children:s.children}),l.return=n,l.sibling=null,e!==null&&(y=n.deletions,y===null?(n.deletions=[e],n.flags|=16):y.push(e)),n.child=l,n.memoizedState=null,l)}function Wd(e,n){return n=bo({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function bo(e,n){return e=wa(22,e,null,n),e.lanes=0,e}function ef(e,n,l){return Kr(n,e.child,null,l),e=Wd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function fg(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),pd(e.return,n,l)}function tf(e,n,l,s,c,f){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:c,treeForkCount:f}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=l,y.tailMode=c,y.treeForkCount=f)}function hg(e,n,l){var s=n.pendingProps,c=s.revealOrder,f=s.tail;s=s.children;var y=vn.current,E=(y&2)!==0;if(E?(y=y&1|2,n.flags|=128):y&=1,se(vn,y),Qn(e,n,s,l),s=vt?Si:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fg(e,l,n);else if(e.tag===19)fg(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(l=n.child,c=null;l!==null;)e=l.alternate,e!==null&&io(e)===null&&(c=l),l=l.sibling;l=c,l===null?(c=n.child,n.child=null):(c=l.sibling,l.sibling=null),tf(n,!1,c,l,f,s);break;case"backwards":case"unstable_legacy-backwards":for(l=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&io(e)===null){n.child=c;break}e=c.sibling,c.sibling=l,l=c,c=e}tf(n,!0,l,null,f,s);break;case"together":tf(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function $l(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),pr|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Es(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,l=_l(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=_l(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function nf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Wu(e)))}function N0(e,n,l){switch(n.tag){case 3:it(n,n.stateNode.containerInfo),ir(n,Nn,e.memoizedState.cache),Fr();break;case 27:case 5:et(n);break;case 4:it(n,n.stateNode.containerInfo);break;case 10:ir(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,jd(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(dr(n),n.flags|=128,null):(l&n.child.childLanes)!==0?dg(e,n,l):(dr(n),e=$l(e,n,l),e!==null?e.sibling:null);dr(n);break;case 19:var c=(e.flags&128)!==0;if(s=(l&n.childLanes)!==0,s||(Es(e,n,l,!1),s=(l&n.childLanes)!==0),c){if(s)return hg(e,n,l);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),se(vn,vn.current),s)break;return null;case 22:return n.lanes=0,rg(e,n,l,n.pendingProps);case 24:ir(n,Nn,e.memoizedState.cache)}return $l(e,n,l)}function mg(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)jn=!0;else{if(!nf(e,l)&&(n.flags&128)===0)return jn=!1,N0(e,n,l);jn=(e.flags&131072)!==0}else jn=!1,vt&&(n.flags&1048576)!==0&&Xm(n,Si,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Qr(n.elementType),n.type=e,typeof e=="function")id(e)?(s=Jr(e,s),n.tag=1,n=og(null,n,e,s,l)):(n.tag=0,n=Pd(null,n,e,s,l));else{if(e!=null){var c=e.$$typeof;if(c===Q){n.tag=11,n=ng(null,n,e,s,l);break e}else if(c===D){n.tag=14,n=ag(null,n,e,s,l);break e}}throw n=Ae(e)||e,Error(i(306,n,""))}}return n;case 0:return Pd(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,c=Jr(s,n.pendingProps),og(e,n,s,c,l);case 3:e:{if(it(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var f=n.memoizedState;c=f.element,Ed(e,n),Ci(n,s,null,l);var y=n.memoizedState;if(s=y.cache,ir(n,Nn,s),s!==f.cache&&gd(n,[Nn],l,!0),Di(),s=y.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=cg(e,n,s,l);break e}else if(s!==c){c=Ua(Error(i(424)),n),Ei(c),n=cg(e,n,s,l);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ln=Ya(e.firstChild),Xn=n,vt=!0,rr=null,$a=!0,l=rp(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Fr(),s===c){n=$l(e,n,l);break e}Qn(e,n,s,l)}n=n.child}return n;case 26:return xo(e,n),e===null?(l=Nv(n.type,null,n.pendingProps,null))?n.memoizedState=l:vt||(l=n.type,e=n.pendingProps,s=zo(Se.current).createElement(l),s[he]=n,s[je]=e,Pn(s,l,e),ct(s),n.stateNode=s):n.memoizedState=Nv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return et(n),e===null&&vt&&(s=n.stateNode=Ev(n.type,n.pendingProps,Se.current),Xn=n,$a=!0,c=ln,br(n.type)?(zf=c,ln=Ya(s.firstChild)):ln=c),Qn(e,n,n.pendingProps.children,l),xo(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&vt&&((c=s=ln)&&(s=tS(s,n.type,n.pendingProps,$a),s!==null?(n.stateNode=s,Xn=n,ln=Ya(s.firstChild),$a=!1,c=!0):c=!1),c||sr(n)),et(n),c=n.type,f=n.pendingProps,y=e!==null?e.memoizedProps:null,s=f.children,Of(c,f)?s=null:y!==null&&Of(c,y)&&(n.flags|=32),n.memoizedState!==null&&(c=Cd(e,n,g0,null,null,l),Pi._currentValue=c),xo(e,n),Qn(e,n,s,l),n.child;case 6:return e===null&&vt&&((e=l=ln)&&(l=nS(l,n.pendingProps,$a),l!==null?(n.stateNode=l,Xn=n,ln=null,e=!0):e=!1),e||sr(n)),null;case 13:return dg(e,n,l);case 4:return it(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Kr(n,null,s,l):Qn(e,n,s,l),n.child;case 11:return ng(e,n,n.type,n.pendingProps,l);case 7:return Qn(e,n,n.pendingProps,l),n.child;case 8:return Qn(e,n,n.pendingProps.children,l),n.child;case 12:return Qn(e,n,n.pendingProps.children,l),n.child;case 10:return s=n.pendingProps,ir(n,n.type,s.value),Qn(e,n,s.children,l),n.child;case 9:return c=n.type._context,s=n.pendingProps.children,Xr(n),c=In(c),s=s(c),n.flags|=1,Qn(e,n,s,l),n.child;case 14:return ag(e,n,n.type,n.pendingProps,l);case 15:return lg(e,n,n.type,n.pendingProps,l);case 19:return hg(e,n,l);case 31:return R0(e,n,l);case 22:return rg(e,n,l,n.pendingProps);case 24:return Xr(n),s=In(Nn),e===null?(c=xd(),c===null&&(c=Jt,f=vd(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=l),c=f),n.memoizedState={parent:s,cache:c},Sd(n),ir(n,Nn,c)):((e.lanes&l)!==0&&(Ed(e,n),Ci(n,null,null,l),Di()),c=e.memoizedState,f=n.memoizedState,c.parent!==s?(c={parent:s,cache:s},n.memoizedState=c,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=c),ir(n,Nn,s)):(s=f.cache,ir(n,Nn,s),s!==c.cache&&gd(n,[Nn],l,!0))),Qn(e,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function ql(e){e.flags|=4}function af(e,n,l,s,c){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(qg())e.flags|=8192;else throw Pr=ao,bd}else e.flags&=-16777217}function pg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Av(n))if(qg())e.flags|=8192;else throw Pr=ao,bd}function So(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Pt():536870912,e.lanes|=n,_s|=n)}function Li(e,n){if(!vt)switch(e.tailMode){case"hidden":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function rn(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,s=0;if(n)for(var c=e.child;c!==null;)l|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)l|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=l,n}function T0(e,n,l){var s=n.pendingProps;switch(dd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(n),null;case 1:return rn(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Ul(Nn),Fe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ss(n)?ql(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,hd())),rn(n),null;case 26:var c=n.type,f=n.memoizedState;return e===null?(ql(n),f!==null?(rn(n),pg(n,f)):(rn(n),af(n,c,null,s,l))):f?f!==e.memoizedState?(ql(n),rn(n),pg(n,f)):(rn(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&ql(n),rn(n),af(n,c,e,s,l)),null;case 27:if(en(n),l=Se.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&ql(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return rn(n),null}e=ce.current,Ss(n)?Qm(n):(e=Ev(c,s,l),n.stateNode=e,ql(n))}return rn(n),null;case 5:if(en(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&ql(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return rn(n),null}if(f=ce.current,Ss(n))Qm(n);else{var y=zo(Se.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?y.createElement("select",{is:s.is}):y.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?y.createElement(c,{is:s.is}):y.createElement(c)}}f[he]=n,f[je]=s;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(Pn(f,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ql(n)}}return rn(n),af(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&ql(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=Se.current,Ss(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,c=Xn,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[he]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||dv(e.nodeValue,l)),e||sr(n,!0)}else e=zo(e).createTextNode(s),e[he]=n,n.stateNode=e}return rn(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Ss(n),l!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[he]=n}else Fr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;rn(n),e=!1}else l=hd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Na(n),n):(Na(n),null);if((n.flags&128)!==0)throw Error(i(558))}return rn(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ss(n),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[he]=n}else Fr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;rn(n),c=!1}else c=hd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(Na(n),n):(Na(n),null)}return Na(n),(n.flags&128)!==0?(n.lanes=l,n):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=n.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==c&&(s.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),So(n,n.updateQueue),rn(n),null);case 4:return Fe(),e===null&&Tf(n.stateNode.containerInfo),rn(n),null;case 10:return Ul(n.type),rn(n),null;case 19:if(X(vn),s=n.memoizedState,s===null)return rn(n),null;if(c=(n.flags&128)!==0,f=s.rendering,f===null)if(c)Li(s,!1);else{if(hn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=io(e),f!==null){for(n.flags|=128,Li(s,!1),e=f.updateQueue,n.updateQueue=e,So(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Vm(l,e),l=l.sibling;return se(vn,vn.current&1|2),vt&&Ll(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Oe()>To&&(n.flags|=128,c=!0,Li(s,!1),n.lanes=4194304)}else{if(!c)if(e=io(f),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,So(n,e),Li(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!vt)return rn(n),null}else 2*Oe()-s.renderingStartTime>To&&l!==536870912&&(n.flags|=128,c=!0,Li(s,!1),n.lanes=4194304);s.isBackwards?(f.sibling=n.child,n.child=f):(e=s.last,e!==null?e.sibling=f:n.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Oe(),e.sibling=null,l=vn.current,se(vn,c?l&1|2:l&1),vt&&Ll(n,s.treeForkCount),e):(rn(n),null);case 22:case 23:return Na(n),Td(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(rn(n),n.subtreeFlags&6&&(n.flags|=8192)):rn(n),l=n.updateQueue,l!==null&&So(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),e!==null&&X(Ir),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Ul(Nn),rn(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function j0(e,n){switch(dd(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ul(Nn),Fe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return en(n),null;case 31:if(n.memoizedState!==null){if(Na(n),n.alternate===null)throw Error(i(340));Fr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Na(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Fr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return X(vn),null;case 4:return Fe(),null;case 10:return Ul(n.type),null;case 22:case 23:return Na(n),Td(),e!==null&&X(Ir),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Ul(Nn),null;case 25:return null;default:return null}}function gg(e,n){switch(dd(n),n.tag){case 3:Ul(Nn),Fe();break;case 26:case 27:case 5:en(n);break;case 4:Fe();break;case 31:n.memoizedState!==null&&Na(n);break;case 13:Na(n);break;case 19:X(vn);break;case 10:Ul(n.type);break;case 22:case 23:Na(n),Td(),e!==null&&X(Ir);break;case 24:Ul(Nn)}}function zi(e,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){s=void 0;var f=l.create,y=l.inst;s=f(),y.destroy=s}l=l.next}while(l!==c)}}catch(E){$t(n,n.return,E)}}function hr(e,n,l){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var f=c.next;s=f;do{if((s.tag&e)===e){var y=s.inst,E=y.destroy;if(E!==void 0){y.destroy=void 0,c=n;var M=l,Y=E;try{Y()}catch(Z){$t(c,M,Z)}}}s=s.next}while(s!==f)}}catch(Z){$t(n,n.return,Z)}}function vg(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{ip(n,l)}catch(s){$t(e,e.return,s)}}}function yg(e,n,l){l.props=Jr(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){$t(e,n,s)}}function Ui(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof l=="function"?e.refCleanup=l(s):l.current=s}}catch(c){$t(e,n,c)}}function hl(e,n){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(c){$t(e,n,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){$t(e,n,c)}else l.current=null}function xg(e){var n=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(c){$t(e,e.return,c)}}function lf(e,n,l){try{var s=e.stateNode;P0(s,e.type,l,n),s[je]=n}catch(c){$t(e,e.return,c)}}function bg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&br(e.type)||e.tag===4}function rf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&br(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sf(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(e),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=ea));else if(s!==4&&(s===27&&br(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for(sf(e,n,l),e=e.sibling;e!==null;)sf(e,n,l),e=e.sibling}function Eo(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(s!==4&&(s===27&&br(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Eo(e,n,l),e=e.sibling;e!==null;)Eo(e,n,l),e=e.sibling}function Sg(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Pn(n,s,l),n[he]=e,n[je]=l}catch(f){$t(e,e.return,f)}}var Yl=!1,Dn=!1,uf=!1,Eg=typeof WeakSet=="function"?WeakSet:Set,Un=null;function D0(e,n){if(e=e.containerInfo,Cf=Vo,e=_m(e),ed(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var c=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var y=0,E=-1,M=-1,Y=0,Z=0,ae=e,G=null;t:for(;;){for(var P;ae!==l||c!==0&&ae.nodeType!==3||(E=y+c),ae!==f||s!==0&&ae.nodeType!==3||(M=y+s),ae.nodeType===3&&(y+=ae.nodeValue.length),(P=ae.firstChild)!==null;)G=ae,ae=P;for(;;){if(ae===e)break t;if(G===l&&++Y===c&&(E=y),G===f&&++Z===s&&(M=y),(P=ae.nextSibling)!==null)break;ae=G,G=ae.parentNode}ae=P}l=E===-1||M===-1?null:{start:E,end:M}}else l=null}l=l||{start:0,end:0}}else l=null;for(Af={focusedElem:e,selectionRange:l},Vo=!1,Un=n;Un!==null;)if(n=Un,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Un=e;else for(;Un!==null;){switch(n=Un,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)c=e[l],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,l=n,c=f.memoizedProps,f=f.memoizedState,s=l.stateNode;try{var Ce=Jr(l.type,c);e=s.getSnapshotBeforeUpdate(Ce,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ye){$t(l,l.return,Ye)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)kf(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":kf(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,Un=e;break}Un=n.return}}function wg(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:Fl(e,l),s&4&&zi(5,l);break;case 1:if(Fl(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(y){$t(l,l.return,y)}else{var c=Jr(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(y){$t(l,l.return,y)}}s&64&&vg(l),s&512&&Ui(l,l.return);break;case 3:if(Fl(e,l),s&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{ip(e,n)}catch(y){$t(l,l.return,y)}}break;case 27:n===null&&s&4&&Sg(l);case 26:case 5:Fl(e,l),n===null&&s&4&&xg(l),s&512&&Ui(l,l.return);break;case 12:Fl(e,l);break;case 31:Fl(e,l),s&4&&Tg(e,l);break;case 13:Fl(e,l),s&4&&jg(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=U0.bind(null,l),aS(e,l))));break;case 22:if(s=l.memoizedState!==null||Yl,!s){n=n!==null&&n.memoizedState!==null||Dn,c=Yl;var f=Dn;Yl=s,(Dn=n)&&!f?Gl(e,l,(l.subtreeFlags&8772)!==0):Fl(e,l),Yl=c,Dn=f}break;case 30:break;default:Fl(e,l)}}function Rg(e){var n=e.alternate;n!==null&&(e.alternate=null,Rg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&qe(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 sn=null,pa=!1;function Vl(e,n,l){for(l=l.child;l!==null;)Ng(e,n,l),l=l.sibling}function Ng(e,n,l){if(J&&typeof J.onCommitFiberUnmount=="function")try{J.onCommitFiberUnmount(gn,l)}catch{}switch(l.tag){case 26:Dn||hl(l,n),Vl(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Dn||hl(l,n);var s=sn,c=pa;br(l.type)&&(sn=l.stateNode,pa=!1),Vl(e,n,l),Xi(l.stateNode),sn=s,pa=c;break;case 5:Dn||hl(l,n);case 6:if(s=sn,c=pa,sn=null,Vl(e,n,l),sn=s,pa=c,sn!==null)if(pa)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(l.stateNode)}catch(f){$t(l,n,f)}else try{sn.removeChild(l.stateNode)}catch(f){$t(l,n,f)}break;case 18:sn!==null&&(pa?(e=sn,vv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ys(e)):vv(sn,l.stateNode));break;case 4:s=sn,c=pa,sn=l.stateNode.containerInfo,pa=!0,Vl(e,n,l),sn=s,pa=c;break;case 0:case 11:case 14:case 15:hr(2,l,n),Dn||hr(4,l,n),Vl(e,n,l);break;case 1:Dn||(hl(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&yg(l,n,s)),Vl(e,n,l);break;case 21:Vl(e,n,l);break;case 22:Dn=(s=Dn)||l.memoizedState!==null,Vl(e,n,l),Dn=s;break;default:Vl(e,n,l)}}function Tg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ys(e)}catch(l){$t(n,n.return,l)}}}function jg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ys(e)}catch(l){$t(n,n.return,l)}}function C0(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Eg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Eg),n;default:throw Error(i(435,e.tag))}}function wo(e,n){var l=C0(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var c=H0.bind(null,e,s);s.then(c,c)}})}function ga(e,n){var l=n.deletions;if(l!==null)for(var s=0;s<l.length;s++){var c=l[s],f=e,y=n,E=y;e:for(;E!==null;){switch(E.tag){case 27:if(br(E.type)){sn=E.stateNode,pa=!1;break e}break;case 5:sn=E.stateNode,pa=!1;break e;case 3:case 4:sn=E.stateNode.containerInfo,pa=!0;break e}E=E.return}if(sn===null)throw Error(i(160));Ng(f,y,c),sn=null,pa=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Dg(n,e),n=n.sibling}var el=null;function Dg(e,n){var l=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ga(n,e),va(e),s&4&&(hr(3,e,e.return),zi(3,e),hr(5,e,e.return));break;case 1:ga(n,e),va(e),s&512&&(Dn||l===null||hl(l,l.return)),s&64&&Yl&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?s:l.concat(s))));break;case 26:var c=el;if(ga(n,e),va(e),s&512&&(Dn||l===null||hl(l,l.return)),s&4){var f=l!==null?l.memoizedState:null;if(s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null){e:{s=e.type,l=e.memoizedProps,c=c.ownerDocument||c;t:switch(s){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Pe]||f[he]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(s),c.head.insertBefore(f,c.querySelector("head > title"))),Pn(f,s,l),f[he]=e,ct(f),s=f;break e;case"link":var y=Dv("link","href",c).get(s+(l.href||""));if(y){for(var E=0;E<y.length;E++)if(f=y[E],f.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&f.getAttribute("rel")===(l.rel==null?null:l.rel)&&f.getAttribute("title")===(l.title==null?null:l.title)&&f.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){y.splice(E,1);break t}}f=c.createElement(s),Pn(f,s,l),c.head.appendChild(f);break;case"meta":if(y=Dv("meta","content",c).get(s+(l.content||""))){for(E=0;E<y.length;E++)if(f=y[E],f.getAttribute("content")===(l.content==null?null:""+l.content)&&f.getAttribute("name")===(l.name==null?null:l.name)&&f.getAttribute("property")===(l.property==null?null:l.property)&&f.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&f.getAttribute("charset")===(l.charSet==null?null:l.charSet)){y.splice(E,1);break t}}f=c.createElement(s),Pn(f,s,l),c.head.appendChild(f);break;default:throw Error(i(468,s))}f[he]=e,ct(f),s=f}e.stateNode=s}else Cv(c,e.type,e.stateNode);else e.stateNode=jv(c,s,e.memoizedProps);else f!==s?(f===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):f.count--,s===null?Cv(c,e.type,e.stateNode):jv(c,s,e.memoizedProps)):s===null&&e.stateNode!==null&&lf(e,e.memoizedProps,l.memoizedProps)}break;case 27:ga(n,e),va(e),s&512&&(Dn||l===null||hl(l,l.return)),l!==null&&s&4&&lf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ga(n,e),va(e),s&512&&(Dn||l===null||hl(l,l.return)),e.flags&32){c=e.stateNode;try{nr(c,"")}catch(Ce){$t(e,e.return,Ce)}}s&4&&e.stateNode!=null&&(c=e.memoizedProps,lf(e,c,l!==null?l.memoizedProps:c)),s&1024&&(uf=!0);break;case 6:if(ga(n,e),va(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,l=e.stateNode;try{l.nodeValue=s}catch(Ce){$t(e,e.return,Ce)}}break;case 3:if(Bo=null,c=el,el=Uo(n.containerInfo),ga(n,e),el=c,va(e),s&4&&l!==null&&l.memoizedState.isDehydrated)try{Ys(n.containerInfo)}catch(Ce){$t(e,e.return,Ce)}uf&&(uf=!1,Cg(e));break;case 4:s=el,el=Uo(e.stateNode.containerInfo),ga(n,e),va(e),el=s;break;case 12:ga(n,e),va(e);break;case 31:ga(n,e),va(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,wo(e,s)));break;case 13:ga(n,e),va(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(No=Oe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,wo(e,s)));break;case 22:c=e.memoizedState!==null;var M=l!==null&&l.memoizedState!==null,Y=Yl,Z=Dn;if(Yl=Y||c,Dn=Z||M,ga(n,e),Dn=Z,Yl=Y,va(e),s&8192)e:for(n=e.stateNode,n._visibility=c?n._visibility&-2:n._visibility|1,c&&(l===null||M||Yl||Dn||Wr(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){M=l=n;try{if(f=M.stateNode,c)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{E=M.stateNode;var ae=M.memoizedProps.style,G=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;E.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(Ce){$t(M,M.return,Ce)}}}else if(n.tag===6){if(l===null){M=n;try{M.stateNode.nodeValue=c?"":M.memoizedProps}catch(Ce){$t(M,M.return,Ce)}}}else if(n.tag===18){if(l===null){M=n;try{var P=M.stateNode;c?yv(P,!0):yv(M.stateNode,!1)}catch(Ce){$t(M,M.return,Ce)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(l=s.retryQueue,l!==null&&(s.retryQueue=null,wo(e,l))));break;case 19:ga(n,e),va(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,wo(e,s)));break;case 30:break;case 21:break;default:ga(n,e),va(e)}}function va(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(bg(s)){l=s;break}s=s.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var c=l.stateNode,f=rf(e);Eo(e,f,c);break;case 5:var y=l.stateNode;l.flags&32&&(nr(y,""),l.flags&=-33);var E=rf(e);Eo(e,E,y);break;case 3:case 4:var M=l.stateNode.containerInfo,Y=rf(e);sf(e,Y,M);break;default:throw Error(i(161))}}catch(Z){$t(e,e.return,Z)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Cg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Cg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Fl(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)wg(e,n.alternate,n),n=n.sibling}function Wr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:hr(4,n,n.return),Wr(n);break;case 1:hl(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&yg(n,n.return,l),Wr(n);break;case 27:Xi(n.stateNode);case 26:case 5:hl(n,n.return),Wr(n);break;case 22:n.memoizedState===null&&Wr(n);break;case 30:Wr(n);break;default:Wr(n)}e=e.sibling}}function Gl(e,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,c=e,f=n,y=f.flags;switch(f.tag){case 0:case 11:case 15:Gl(c,f,l),zi(4,f);break;case 1:if(Gl(c,f,l),s=f,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){$t(s,s.return,Y)}if(s=f,c=s.updateQueue,c!==null){var E=s.stateNode;try{var M=c.shared.hiddenCallbacks;if(M!==null)for(c.shared.hiddenCallbacks=null,c=0;c<M.length;c++)sp(M[c],E)}catch(Y){$t(s,s.return,Y)}}l&&y&64&&vg(f),Ui(f,f.return);break;case 27:Sg(f);case 26:case 5:Gl(c,f,l),l&&s===null&&y&4&&xg(f),Ui(f,f.return);break;case 12:Gl(c,f,l);break;case 31:Gl(c,f,l),l&&y&4&&Tg(c,f);break;case 13:Gl(c,f,l),l&&y&4&&jg(c,f);break;case 22:f.memoizedState===null&&Gl(c,f,l),Ui(f,f.return);break;case 30:break;default:Gl(c,f,l)}n=n.sibling}}function of(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&wi(l))}function cf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&wi(e))}function tl(e,n,l,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ag(e,n,l,s),n=n.sibling}function Ag(e,n,l,s){var c=n.flags;switch(n.tag){case 0:case 11:case 15:tl(e,n,l,s),c&2048&&zi(9,n);break;case 1:tl(e,n,l,s);break;case 3:tl(e,n,l,s),c&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&wi(e)));break;case 12:if(c&2048){tl(e,n,l,s),e=n.stateNode;try{var f=n.memoizedProps,y=f.id,E=f.onPostCommit;typeof E=="function"&&E(y,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){$t(n,n.return,M)}}else tl(e,n,l,s);break;case 31:tl(e,n,l,s);break;case 13:tl(e,n,l,s);break;case 23:break;case 22:f=n.stateNode,y=n.alternate,n.memoizedState!==null?f._visibility&2?tl(e,n,l,s):Hi(e,n):f._visibility&2?tl(e,n,l,s):(f._visibility|=2,Os(e,n,l,s,(n.subtreeFlags&10256)!==0||!1)),c&2048&&of(y,n);break;case 24:tl(e,n,l,s),c&2048&&cf(n.alternate,n);break;default:tl(e,n,l,s)}}function Os(e,n,l,s,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,y=n,E=l,M=s,Y=y.flags;switch(y.tag){case 0:case 11:case 15:Os(f,y,E,M,c),zi(8,y);break;case 23:break;case 22:var Z=y.stateNode;y.memoizedState!==null?Z._visibility&2?Os(f,y,E,M,c):Hi(f,y):(Z._visibility|=2,Os(f,y,E,M,c)),c&&Y&2048&&of(y.alternate,y);break;case 24:Os(f,y,E,M,c),c&&Y&2048&&cf(y.alternate,y);break;default:Os(f,y,E,M,c)}n=n.sibling}}function Hi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,s=n,c=s.flags;switch(s.tag){case 22:Hi(l,s),c&2048&&of(s.alternate,s);break;case 24:Hi(l,s),c&2048&&cf(s.alternate,s);break;default:Hi(l,s)}n=n.sibling}}var Bi=8192;function Ms(e,n,l){if(e.subtreeFlags&Bi)for(e=e.child;e!==null;)Og(e,n,l),e=e.sibling}function Og(e,n,l){switch(e.tag){case 26:Ms(e,n,l),e.flags&Bi&&e.memoizedState!==null&&pS(l,el,e.memoizedState,e.memoizedProps);break;case 5:Ms(e,n,l);break;case 3:case 4:var s=el;el=Uo(e.stateNode.containerInfo),Ms(e,n,l),el=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Bi,Bi=16777216,Ms(e,n,l),Bi=s):Ms(e,n,l));break;default:Ms(e,n,l)}}function Mg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function $i(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Un=s,_g(s,e)}Mg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kg(e),e=e.sibling}function kg(e){switch(e.tag){case 0:case 11:case 15:$i(e),e.flags&2048&&hr(9,e,e.return);break;case 3:$i(e);break;case 12:$i(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ro(e)):$i(e);break;default:$i(e)}}function Ro(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Un=s,_g(s,e)}Mg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:hr(8,n,n.return),Ro(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Ro(n));break;default:Ro(n)}e=e.sibling}}function _g(e,n){for(;Un!==null;){var l=Un;switch(l.tag){case 0:case 11:case 15:hr(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:wi(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,Un=s;else e:for(l=e;Un!==null;){s=Un;var c=s.sibling,f=s.return;if(Rg(s),s===l){Un=null;break e}if(c!==null){c.return=f,Un=c;break e}Un=f}}}var A0={getCacheForType:function(e){var n=In(Nn),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return In(Nn).controller.signal}},O0=typeof WeakMap=="function"?WeakMap:Map,Dt=0,Jt=null,ft=null,mt=0,Bt=0,Ta=null,mr=!1,ks=!1,df=!1,Xl=0,hn=0,pr=0,es=0,ff=0,ja=0,_s=0,qi=null,ya=null,hf=!1,No=0,Lg=0,To=1/0,jo=null,gr=null,_n=0,vr=null,Ls=null,Il=0,mf=0,pf=null,zg=null,Yi=0,gf=null;function Da(){return(Dt&2)!==0&&mt!==0?mt&-mt:B.T!==null?Ef():K()}function Ug(){if(ja===0)if((mt&536870912)===0||vt){var e=Qt;Qt<<=1,(Qt&3932160)===0&&(Qt=262144),ja=e}else ja=536870912;return e=Ra.current,e!==null&&(e.flags|=32),ja}function xa(e,n,l){(e===Jt&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)&&(zs(e,0),yr(e,mt,ja,!1)),dt(e,l),((Dt&2)===0||e!==Jt)&&(e===Jt&&((Dt&2)===0&&(es|=l),hn===4&&yr(e,mt,ja,!1)),ml(e))}function Hg(e,n,l){if((Dt&6)!==0)throw Error(i(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Rt(e,n),c=s?_0(e,n):yf(e,n,!0),f=s;do{if(c===0){ks&&!s&&yr(e,n,0,!1);break}else{if(l=e.current.alternate,f&&!M0(l)){c=yf(e,n,!1),f=!1;continue}if(c===2){if(f=n,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var E=e;c=qi;var M=E.current.memoizedState.isDehydrated;if(M&&(zs(E,y).flags|=256),y=yf(E,y,!1),y!==2){if(df&&!M){E.errorRecoveryDisabledLanes|=f,es|=f,c=4;break e}f=ya,ya=c,f!==null&&(ya===null?ya=f:ya.push.apply(ya,f))}c=y}if(f=!1,c!==2)continue}}if(c===1){zs(e,0),yr(e,n,0,!0);break}e:{switch(s=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:yr(s,n,ja,!mr);break e;case 2:ya=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(c=No+300-Oe(),10<c)){if(yr(s,n,ja,!mr),zt(s,0,!0)!==0)break e;Il=n,s.timeoutHandle=pv(Bg.bind(null,s,l,ya,jo,hf,n,ja,es,_s,mr,f,"Throttled",-0,0),c);break e}Bg(s,l,ya,jo,hf,n,ja,es,_s,mr,f,null,-0,0)}}break}while(!0);ml(e)}function Bg(e,n,l,s,c,f,y,E,M,Y,Z,ae,G,P){if(e.timeoutHandle=-1,ae=n.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},Og(n,f,ae);var Ce=(f&62914560)===f?No-Oe():(f&4194048)===f?Lg-Oe():0;if(Ce=gS(ae,Ce),Ce!==null){Il=f,e.cancelPendingCommit=Ce(Ig.bind(null,e,n,f,l,s,c,y,E,M,Z,ae,null,G,P)),yr(e,f,y,!Y);return}}Ig(e,n,f,l,s,c,y,E,M)}function M0(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var s=0;s<l.length;s++){var c=l[s],f=c.getSnapshot;c=c.value;try{if(!Ea(f(),c))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function yr(e,n,l,s){n&=~ff,n&=~es,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var c=n;0<c;){var f=31-Lt(c),y=1<<f;s[f]=-1,c&=~y}l!==0&&Sn(e,l,n)}function Do(){return(Dt&6)===0?(Vi(0),!1):!0}function vf(){if(ft!==null){if(Bt===0)var e=ft.return;else e=ft,zl=Gr=null,Md(e),Ts=null,Ni=0,e=ft;for(;e!==null;)gg(e.alternate,e),e=e.return;ft=null}}function zs(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,J0(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Il=0,vf(),Jt=e,ft=l=_l(e.current,null),mt=n,Bt=0,Ta=null,mr=!1,ks=Rt(e,n),df=!1,_s=ja=ff=es=pr=hn=0,ya=qi=null,hf=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var c=31-Lt(s),f=1<<c;n|=e[c],s&=~f}return Xl=n,Qu(),l}function $g(e,n){nt=null,B.H=ki,n===Ns||n===no?(n=np(),Bt=3):n===bd?(n=np(),Bt=4):Bt=n===Qd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ta=n,ft===null&&(hn=1,vo(e,Ua(n,e.current)))}function qg(){var e=Ra.current;return e===null?!0:(mt&4194048)===mt?qa===null:(mt&62914560)===mt||(mt&536870912)!==0?e===qa:!1}function Yg(){var e=B.H;return B.H=ki,e===null?ki:e}function Vg(){var e=B.A;return B.A=A0,e}function Co(){hn=4,mr||(mt&4194048)!==mt&&Ra.current!==null||(ks=!0),(pr&134217727)===0&&(es&134217727)===0||Jt===null||yr(Jt,mt,ja,!1)}function yf(e,n,l){var s=Dt;Dt|=2;var c=Yg(),f=Vg();(Jt!==e||mt!==n)&&(jo=null,zs(e,n)),n=!1;var y=hn;e:do try{if(Bt!==0&&ft!==null){var E=ft,M=Ta;switch(Bt){case 8:vf(),y=6;break e;case 3:case 2:case 9:case 6:Ra.current===null&&(n=!0);var Y=Bt;if(Bt=0,Ta=null,Us(e,E,M,Y),l&&ks){y=0;break e}break;default:Y=Bt,Bt=0,Ta=null,Us(e,E,M,Y)}}k0(),y=hn;break}catch(Z){$g(e,Z)}while(!0);return n&&e.shellSuspendCounter++,zl=Gr=null,Dt=s,B.H=c,B.A=f,ft===null&&(Jt=null,mt=0,Qu()),y}function k0(){for(;ft!==null;)Fg(ft)}function _0(e,n){var l=Dt;Dt|=2;var s=Yg(),c=Vg();Jt!==e||mt!==n?(jo=null,To=Oe()+500,zs(e,n)):ks=Rt(e,n);e:do try{if(Bt!==0&&ft!==null){n=ft;var f=Ta;t:switch(Bt){case 1:Bt=0,Ta=null,Us(e,n,f,1);break;case 2:case 9:if(ep(f)){Bt=0,Ta=null,Gg(n);break}n=function(){Bt!==2&&Bt!==9||Jt!==e||(Bt=7),ml(e)},f.then(n,n);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:ep(f)?(Bt=0,Ta=null,Gg(n)):(Bt=0,Ta=null,Us(e,n,f,7));break;case 5:var y=null;switch(ft.tag){case 26:y=ft.memoizedState;case 5:case 27:var E=ft;if(y?Av(y):E.stateNode.complete){Bt=0,Ta=null;var M=E.sibling;if(M!==null)ft=M;else{var Y=E.return;Y!==null?(ft=Y,Ao(Y)):ft=null}break t}}Bt=0,Ta=null,Us(e,n,f,5);break;case 6:Bt=0,Ta=null,Us(e,n,f,6);break;case 8:vf(),hn=6;break e;default:throw Error(i(462))}}L0();break}catch(Z){$g(e,Z)}while(!0);return zl=Gr=null,B.H=s,B.A=c,Dt=l,ft!==null?0:(Jt=null,mt=0,Qu(),hn)}function L0(){for(;ft!==null&&!Yn();)Fg(ft)}function Fg(e){var n=mg(e.alternate,e,Xl);e.memoizedProps=e.pendingProps,n===null?Ao(e):ft=n}function Gg(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=ug(l,n,n.pendingProps,n.type,void 0,mt);break;case 11:n=ug(l,n,n.pendingProps,n.type.render,n.ref,mt);break;case 5:Md(n);default:gg(l,n),n=ft=Vm(n,Xl),n=mg(l,n,Xl)}e.memoizedProps=e.pendingProps,n===null?Ao(e):ft=n}function Us(e,n,l,s){zl=Gr=null,Md(n),Ts=null,Ni=0;var c=n.return;try{if(w0(e,c,n,l,mt)){hn=1,vo(e,Ua(l,e.current)),ft=null;return}}catch(f){if(c!==null)throw ft=c,f;hn=1,vo(e,Ua(l,e.current)),ft=null;return}n.flags&32768?(vt||s===1?e=!0:ks||(mt&536870912)!==0?e=!1:(mr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ra.current,s!==null&&s.tag===13&&(s.flags|=16384))),Xg(n,e)):Ao(n)}function Ao(e){var n=e;do{if((n.flags&32768)!==0){Xg(n,mr);return}e=n.return;var l=T0(n.alternate,n,Xl);if(l!==null){ft=l;return}if(n=n.sibling,n!==null){ft=n;return}ft=n=e}while(n!==null);hn===0&&(hn=5)}function Xg(e,n){do{var l=j0(e.alternate,e);if(l!==null){l.flags&=32767,ft=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){ft=e;return}ft=e=l}while(e!==null);hn=6,ft=null}function Ig(e,n,l,s,c,f,y,E,M){e.cancelPendingCommit=null;do Oo();while(_n!==0);if((Dt&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(f=n.lanes|n.childLanes,f|=rd,Ke(e,l,f,y,E,M),e===Jt&&(ft=Jt=null,mt=0),Ls=n,vr=e,Il=l,mf=f,pf=c,zg=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,B0(At,function(){return Jg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=B.T,B.T=null,c=V.p,V.p=2,y=Dt,Dt|=4;try{D0(e,n,l)}finally{Dt=y,V.p=c,B.T=s}}_n=1,Qg(),Pg(),Kg()}}function Qg(){if(_n===1){_n=0;var e=vr,n=Ls,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var s=V.p;V.p=2;var c=Dt;Dt|=4;try{Dg(n,e);var f=Af,y=_m(e.containerInfo),E=f.focusedElem,M=f.selectionRange;if(y!==E&&E&&E.ownerDocument&&km(E.ownerDocument.documentElement,E)){if(M!==null&&ed(E)){var Y=M.start,Z=M.end;if(Z===void 0&&(Z=Y),"selectionStart"in E)E.selectionStart=Y,E.selectionEnd=Math.min(Z,E.value.length);else{var ae=E.ownerDocument||document,G=ae&&ae.defaultView||window;if(G.getSelection){var P=G.getSelection(),Ce=E.textContent.length,Ye=Math.min(M.start,Ce),Gt=M.end===void 0?Ye:Math.min(M.end,Ce);!P.extend&&Ye>Gt&&(y=Gt,Gt=Ye,Ye=y);var U=Mm(E,Ye),L=Mm(E,Gt);if(U&&L&&(P.rangeCount!==1||P.anchorNode!==U.node||P.anchorOffset!==U.offset||P.focusNode!==L.node||P.focusOffset!==L.offset)){var $=ae.createRange();$.setStart(U.node,U.offset),P.removeAllRanges(),Ye>Gt?(P.addRange($),P.extend(L.node,L.offset)):($.setEnd(L.node,L.offset),P.addRange($))}}}}for(ae=[],P=E;P=P.parentNode;)P.nodeType===1&&ae.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ae.length;E++){var W=ae[E];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Vo=!!Cf,Af=Cf=null}finally{Dt=c,V.p=s,B.T=l}}e.current=n,_n=2}}function Pg(){if(_n===2){_n=0;var e=vr,n=Ls,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var s=V.p;V.p=2;var c=Dt;Dt|=4;try{wg(e,n.alternate,n)}finally{Dt=c,V.p=s,B.T=l}}_n=3}}function Kg(){if(_n===4||_n===3){_n=0,ye();var e=vr,n=Ls,l=Il,s=zg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?_n=5:(_n=0,Ls=vr=null,Zg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(gr=null),H(l),n=n.stateNode,J&&typeof J.onCommitFiberRoot=="function")try{J.onCommitFiberRoot(gn,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=B.T,c=V.p,V.p=2,B.T=null;try{for(var f=e.onRecoverableError,y=0;y<s.length;y++){var E=s[y];f(E.value,{componentStack:E.stack})}}finally{B.T=n,V.p=c}}(Il&3)!==0&&Oo(),ml(e),c=e.pendingLanes,(l&261930)!==0&&(c&42)!==0?e===gf?Yi++:(Yi=0,gf=e):Yi=0,Vi(0)}}function Zg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,wi(n)))}function Oo(){return Qg(),Pg(),Kg(),Jg()}function Jg(){if(_n!==5)return!1;var e=vr,n=mf;mf=0;var l=H(Il),s=B.T,c=V.p;try{V.p=32>l?32:l,B.T=null,l=pf,pf=null;var f=vr,y=Il;if(_n=0,Ls=vr=null,Il=0,(Dt&6)!==0)throw Error(i(331));var E=Dt;if(Dt|=4,kg(f.current),Ag(f,f.current,y,l),Dt=E,Vi(0,!1),J&&typeof J.onPostCommitFiberRoot=="function")try{J.onPostCommitFiberRoot(gn,f)}catch{}return!0}finally{V.p=c,B.T=s,Zg(e,n)}}function Wg(e,n,l){n=Ua(l,n),n=Id(e.stateNode,n,2),e=cr(e,n,2),e!==null&&(dt(e,2),ml(e))}function $t(e,n,l){if(e.tag===3)Wg(e,e,l);else for(;n!==null;){if(n.tag===3){Wg(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(gr===null||!gr.has(s))){e=Ua(l,e),l=eg(2),s=cr(n,l,2),s!==null&&(tg(l,s,n,e),dt(s,2),ml(s));break}}n=n.return}}function xf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new O0;var c=new Set;s.set(n,c)}else c=s.get(n),c===void 0&&(c=new Set,s.set(n,c));c.has(l)||(df=!0,c.add(l),e=z0.bind(null,e,n,l),n.then(e,e))}function z0(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Jt===e&&(mt&l)===l&&(hn===4||hn===3&&(mt&62914560)===mt&&300>Oe()-No?(Dt&2)===0&&zs(e,0):ff|=l,_s===mt&&(_s=0)),ml(e)}function ev(e,n){n===0&&(n=Pt()),e=Yr(e,n),e!==null&&(dt(e,n),ml(e))}function U0(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),ev(e,l)}function H0(e,n){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),ev(e,l)}function B0(e,n){return _t(e,n)}var Mo=null,Hs=null,bf=!1,ko=!1,Sf=!1,xr=0;function ml(e){e!==Hs&&e.next===null&&(Hs===null?Mo=Hs=e:Hs=Hs.next=e),ko=!0,bf||(bf=!0,q0())}function Vi(e,n){if(!Sf&&ko){Sf=!0;do for(var l=!1,s=Mo;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var f=0;else{var y=s.suspendedLanes,E=s.pingedLanes;f=(1<<31-Lt(42|e)+1)-1,f&=c&~(y&~E),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(l=!0,lv(s,f))}else f=mt,f=zt(s,s===Jt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Rt(s,f)||(l=!0,lv(s,f));s=s.next}while(l);Sf=!1}}function $0(){tv()}function tv(){ko=bf=!1;var e=0;xr!==0&&Z0()&&(e=xr);for(var n=Oe(),l=null,s=Mo;s!==null;){var c=s.next,f=nv(s,n);f===0?(s.next=null,l===null?Mo=c:l.next=c,c===null&&(Hs=l)):(l=s,(e!==0||(f&3)!==0)&&(ko=!0)),s=c}_n!==0&&_n!==5||Vi(e),xr!==0&&(xr=0)}function nv(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-Lt(f),E=1<<y,M=c[y];M===-1?((E&l)===0||(E&s)!==0)&&(c[y]=nn(E,n)):M<=n&&(e.expiredLanes|=E),f&=~E}if(n=Jt,l=mt,l=zt(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Wt(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Rt(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&Wt(s),H(l)){case 2:case 8:l=lt;break;case 32:l=At;break;case 268435456:l=tn;break;default:l=At}return s=av.bind(null,e),l=_t(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&Wt(s),e.callbackPriority=2,e.callbackNode=null,2}function av(e,n){if(_n!==0&&_n!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Oo()&&e.callbackNode!==l)return null;var s=mt;return s=zt(e,e===Jt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Hg(e,s,n),nv(e,Oe()),e.callbackNode!=null&&e.callbackNode===l?av.bind(null,e):null)}function lv(e,n){if(Oo())return null;Hg(e,n,!0)}function q0(){W0(function(){(Dt&6)!==0?_t(Ge,$0):tv()})}function Ef(){if(xr===0){var e=ws;e===0&&(e=$e,$e<<=1,($e&261888)===0&&($e=256)),xr=e}return xr}function rv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:an(""+e)}function sv(e,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,e.id&&l.setAttribute("form",e.id),n.parentNode.insertBefore(l,n),e=new FormData(e),l.parentNode.removeChild(l),e}function Y0(e,n,l,s,c){if(n==="submit"&&l&&l.stateNode===c){var f=rv((c[je]||null).action),y=s.submitter;y&&(n=(n=y[je]||null)?rv(n.formAction):y.getAttribute("formAction"),n!==null&&(f=n,y=null));var E=new Ml("action","action",null,s,c);e.push({event:E,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xr!==0){var M=y?sv(c,y):new FormData(c);qd(l,{pending:!0,data:M,method:c.method,action:f},null,M)}}else typeof f=="function"&&(E.preventDefault(),M=y?sv(c,y):new FormData(c),qd(l,{pending:!0,data:M,method:c.method,action:f},f,M))},currentTarget:c}]})}}for(var wf=0;wf<ld.length;wf++){var Rf=ld[wf],V0=Rf.toLowerCase(),F0=Rf[0].toUpperCase()+Rf.slice(1);Wa(V0,"on"+F0)}Wa(Um,"onAnimationEnd"),Wa(Hm,"onAnimationIteration"),Wa(Bm,"onAnimationStart"),Wa("dblclick","onDoubleClick"),Wa("focusin","onFocus"),Wa("focusout","onBlur"),Wa(s0,"onTransitionRun"),Wa(i0,"onTransitionStart"),Wa(u0,"onTransitionCancel"),Wa($m,"onTransitionEnd"),On("onMouseEnter",["mouseout","mouseover"]),On("onMouseLeave",["mouseout","mouseover"]),On("onPointerEnter",["pointerout","pointerover"]),On("onPointerLeave",["pointerout","pointerover"]),En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),En("onBeforeInput",["compositionend","keypress","textInput","paste"]),En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),G0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fi));function iv(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var s=e[l],c=s.event;s=s.listeners;e:{var f=void 0;if(n)for(var y=s.length-1;0<=y;y--){var E=s[y],M=E.instance,Y=E.currentTarget;if(E=E.listener,M!==f&&c.isPropagationStopped())break e;f=E,c.currentTarget=Y;try{f(c)}catch(Z){Iu(Z)}c.currentTarget=null,f=M}else for(y=0;y<s.length;y++){if(E=s[y],M=E.instance,Y=E.currentTarget,E=E.listener,M!==f&&c.isPropagationStopped())break e;f=E,c.currentTarget=Y;try{f(c)}catch(Z){Iu(Z)}c.currentTarget=null,f=M}}}}function ht(e,n){var l=n[Me];l===void 0&&(l=n[Me]=new Set);var s=e+"__bubble";l.has(s)||(uv(n,e,2,!1),l.add(s))}function Nf(e,n,l){var s=0;n&&(s|=4),uv(l,e,s,n)}var _o="_reactListening"+Math.random().toString(36).slice(2);function Tf(e){if(!e[_o]){e[_o]=!0,Kt.forEach(function(l){l!=="selectionchange"&&(G0.has(l)||Nf(l,!1,e),Nf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[_o]||(n[_o]=!0,Nf("selectionchange",!1,n))}}function uv(e,n,l,s){switch(Uv(n)){case 2:var c=xS;break;case 8:c=bS;break;default:c=qf}l=c.bind(null,n,l,e),c=void 0,!mi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(n,l,{capture:!0,passive:c}):e.addEventListener(n,l,!0):c!==void 0?e.addEventListener(n,l,{passive:c}):e.addEventListener(n,l,!1)}function jf(e,n,l,s,c){var f=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var y=s.tag;if(y===3||y===4){var E=s.stateNode.containerInfo;if(E===c)break;if(y===4)for(y=s.return;y!==null;){var M=y.tag;if((M===3||M===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;E!==null;){if(y=Ht(E),y===null)return;if(M=y.tag,M===5||M===6||M===26||M===27){s=f=y;continue e}E=E.parentNode}}s=s.return}hi(function(){var Y=f,Z=jl(l),ae=[];e:{var G=qm.get(e);if(G!==void 0){var P=Ml,Ce=e;switch(e){case"keypress":if(hs(l)===0)break e;case"keydown":case"keyup":P=Rn;break;case"focusin":Ce="focus",P=me;break;case"focusout":Ce="blur",P=me;break;case"beforeblur":case"afterblur":P=me;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":P=Vu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=F;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=cl;break;case Um:case Hm:case Bm:P=ie;break;case $m:P=Fu;break;case"scroll":case"scrollend":P=Ic;break;case"wheel":P=Pc;break;case"copy":case"cut":case"paste":P=ge;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=kt;break;case"toggle":case"beforetoggle":P=Ib}var Ye=(n&4)!==0,Gt=!Ye&&(e==="scroll"||e==="scrollend"),U=Ye?G!==null?G+"Capture":null:G;Ye=[];for(var L=Y,$;L!==null;){var W=L;if($=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||$===null||U===null||(W=_a(L,U),W!=null&&Ye.push(Gi(L,W,$))),Gt)break;L=L.return}0<Ye.length&&(G=new P(G,Ce,null,l,Z),ae.push({event:G,listeners:Ye}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",G&&l!==Sa&&(Ce=l.relatedTarget||l.fromElement)&&(Ht(Ce)||Ce[be]))break e;if((P||G)&&(G=Z.window===Z?Z:(G=Z.ownerDocument)?G.defaultView||G.parentWindow:window,P?(Ce=l.relatedTarget||l.toElement,P=Y,Ce=Ce?Ht(Ce):null,Ce!==null&&(Gt=o(Ce),Ye=Ce.tag,Ce!==Gt||Ye!==5&&Ye!==27&&Ye!==6)&&(Ce=null)):(P=null,Ce=Y),P!==Ce)){if(Ye=Vu,W="onMouseLeave",U="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ye=kt,W="onPointerLeave",U="onPointerEnter",L="pointer"),Gt=P==null?G:ot(P),$=Ce==null?G:ot(Ce),G=new Ye(W,L+"leave",P,l,Z),G.target=Gt,G.relatedTarget=$,W=null,Ht(Z)===Y&&(Ye=new Ye(U,L+"enter",Ce,l,Z),Ye.target=$,Ye.relatedTarget=Gt,W=Ye),Gt=W,P&&Ce)t:{for(Ye=X0,U=P,L=Ce,$=0,W=U;W;W=Ye(W))$++;W=0;for(var Be=L;Be;Be=Ye(Be))W++;for(;0<$-W;)U=Ye(U),$--;for(;0<W-$;)L=Ye(L),W--;for(;$--;){if(U===L||L!==null&&U===L.alternate){Ye=U;break t}U=Ye(U),L=Ye(L)}Ye=null}else Ye=null;P!==null&&ov(ae,G,P,Ye,!1),Ce!==null&&Gt!==null&&ov(ae,Gt,Ce,Ye,!0)}}e:{if(G=Y?ot(Y):window,P=G.nodeName&&G.nodeName.toLowerCase(),P==="select"||P==="input"&&G.type==="file")var Tt=Tm;else if(Rm(G))if(jm)Tt=a0;else{Tt=t0;var ke=e0}else P=G.nodeName,!P||P.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?Y&&Lr(Y.elementType)&&(Tt=Tm):Tt=n0;if(Tt&&(Tt=Tt(e,Y))){Nm(ae,Tt,l,Z);break e}ke&&ke(e,G,Y),e==="focusout"&&Y&&G.type==="number"&&Y.memoizedProps.value!=null&&Nt(G,"number",G.value)}switch(ke=Y?ot(Y):window,e){case"focusin":(Rm(ke)||ke.contentEditable==="true")&&(ps=ke,td=Y,bi=null);break;case"focusout":bi=td=ps=null;break;case"mousedown":nd=!0;break;case"contextmenu":case"mouseup":case"dragend":nd=!1,Lm(ae,l,Z);break;case"selectionchange":if(r0)break;case"keydown":case"keyup":Lm(ae,l,Z)}var st;if(Zc)e:{switch(e){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else ms?Em(e,l)&&(pt="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(pt="onCompositionStart");pt&&(xm&&l.locale!=="ko"&&(ms||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&ms&&(st=qu()):(La=Z,pi="value"in La?La.value:La.textContent,ms=!0)),ke=Lo(Y,pt),0<ke.length&&(pt=new tt(pt,e,null,l,Z),ae.push({event:pt,listeners:ke}),st?pt.data=st:(st=wm(l),st!==null&&(pt.data=st)))),(st=Pb?Kb(e,l):Zb(e,l))&&(pt=Lo(Y,"onBeforeInput"),0<pt.length&&(ke=new tt("onBeforeInput","beforeinput",null,l,Z),ae.push({event:ke,listeners:pt}),ke.data=st)),Y0(ae,e,Y,l,Z)}iv(ae,n)})}function Gi(e,n,l){return{instance:e,listener:n,currentTarget:l}}function Lo(e,n){for(var l=n+"Capture",s=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=_a(e,l),c!=null&&s.unshift(Gi(e,c,f)),c=_a(e,n),c!=null&&s.push(Gi(e,c,f))),e.tag===3)return s;e=e.return}return[]}function X0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ov(e,n,l,s,c){for(var f=n._reactName,y=[];l!==null&&l!==s;){var E=l,M=E.alternate,Y=E.stateNode;if(E=E.tag,M!==null&&M===s)break;E!==5&&E!==26&&E!==27||Y===null||(M=Y,c?(Y=_a(l,f),Y!=null&&y.unshift(Gi(l,Y,M))):c||(Y=_a(l,f),Y!=null&&y.push(Gi(l,Y,M)))),l=l.return}y.length!==0&&e.push({event:n,listeners:y})}var I0=/\r\n?/g,Q0=/\u0000|\uFFFD/g;function cv(e){return(typeof e=="string"?e:""+e).replace(I0,`
49
+ `).replace(Q0,"")}function dv(e,n){return n=cv(n),cv(e)===n}function Ft(e,n,l,s,c,f){switch(l){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||nr(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&nr(e,""+s);break;case"className":sl(e,"class",s);break;case"tabIndex":sl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":sl(e,l,s);break;case"style":fa(e,s,f);break;case"data":if(n!=="object"){sl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=an(""+s),e.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(l==="formAction"?(n!=="input"&&Ft(e,n,"name",c.name,c,null),Ft(e,n,"formEncType",c.formEncType,c,null),Ft(e,n,"formMethod",c.formMethod,c,null),Ft(e,n,"formTarget",c.formTarget,c,null)):(Ft(e,n,"encType",c.encType,c,null),Ft(e,n,"method",c.method,c,null),Ft(e,n,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=an(""+s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=ea);break;case"onScroll":s!=null&&ht("scroll",e);break;case"onScrollEnd":s!=null&&ht("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(l=s.__html,l!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=l}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}l=an(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""+s):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":s===!0?e.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(l,s):e.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(l):e.setAttribute(l,s);break;case"popover":ht("beforetoggle",e),ht("toggle",e),Jn(e,"popover",s);break;case"xlinkActuate":Ie(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ie(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ie(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ie(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ie(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ie(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ie(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ie(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ie(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Jn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ds.get(l)||l,Jn(e,l,s))}}function Df(e,n,l,s,c,f){switch(l){case"style":fa(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(l=s.__html,l!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=l}}break;case"children":typeof s=="string"?nr(e,s):(typeof s=="number"||typeof s=="bigint")&&nr(e,""+s);break;case"onScroll":s!=null&&ht("scroll",e);break;case"onScrollEnd":s!=null&&ht("scrollend",e);break;case"onClick":s!=null&&(e.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vn.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(c=l.endsWith("Capture"),n=l.slice(2,c?l.length-7:void 0),f=e[je]||null,f=f!=null?f[l]:null,typeof f=="function"&&e.removeEventListener(n,f,c),typeof s=="function")){typeof f!="function"&&f!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(n,s,c);break e}l in e?e[l]=s:s===!0?e.setAttribute(l,""):Jn(e,l,s)}}}function Pn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",e),ht("load",e);var s=!1,c=!1,f;for(f in l)if(l.hasOwnProperty(f)){var y=l[f];if(y!=null)switch(f){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ft(e,n,f,y,l,null)}}c&&Ft(e,n,"srcSet",l.srcSet,l,null),s&&Ft(e,n,"src",l.src,l,null);return;case"input":ht("invalid",e);var E=f=y=c=null,M=null,Y=null;for(s in l)if(l.hasOwnProperty(s)){var Z=l[s];if(Z!=null)switch(s){case"name":c=Z;break;case"type":y=Z;break;case"checked":M=Z;break;case"defaultChecked":Y=Z;break;case"value":f=Z;break;case"defaultValue":E=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,n));break;default:Ft(e,n,s,Z,l,null)}}di(e,f,E,M,Y,y,c,!1);return;case"select":ht("invalid",e),s=y=f=null;for(c in l)if(l.hasOwnProperty(c)&&(E=l[c],E!=null))switch(c){case"value":f=E;break;case"defaultValue":y=E;break;case"multiple":s=E;default:Ft(e,n,c,E,l,null)}n=f,l=y,e.multiple=!!s,n!=null?il(e,!!s,n,!1):l!=null&&il(e,!!s,l,!0);return;case"textarea":ht("invalid",e),f=c=s=null;for(y in l)if(l.hasOwnProperty(y)&&(E=l[y],E!=null))switch(y){case"value":s=E;break;case"defaultValue":c=E;break;case"children":f=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(i(91));break;default:Ft(e,n,y,E,l,null)}Za(e,s,c,f);return;case"option":for(M in l)if(l.hasOwnProperty(M)&&(s=l[M],s!=null))switch(M){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ft(e,n,M,s,l,null)}return;case"dialog":ht("beforetoggle",e),ht("toggle",e),ht("cancel",e),ht("close",e);break;case"iframe":case"object":ht("load",e);break;case"video":case"audio":for(s=0;s<Fi.length;s++)ht(Fi[s],e);break;case"image":ht("error",e),ht("load",e);break;case"details":ht("toggle",e);break;case"embed":case"source":case"link":ht("error",e),ht("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in l)if(l.hasOwnProperty(Y)&&(s=l[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ft(e,n,Y,s,l,null)}return;default:if(Lr(n)){for(Z in l)l.hasOwnProperty(Z)&&(s=l[Z],s!==void 0&&Df(e,n,Z,s,l,void 0));return}}for(E in l)l.hasOwnProperty(E)&&(s=l[E],s!=null&&Ft(e,n,E,s,l,null))}function P0(e,n,l,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,y=null,E=null,M=null,Y=null,Z=null;for(P in l){var ae=l[P];if(l.hasOwnProperty(P)&&ae!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":M=ae;default:s.hasOwnProperty(P)||Ft(e,n,P,null,s,ae)}}for(var G in s){var P=s[G];if(ae=l[G],s.hasOwnProperty(G)&&(P!=null||ae!=null))switch(G){case"type":f=P;break;case"name":c=P;break;case"checked":Y=P;break;case"defaultChecked":Z=P;break;case"value":y=P;break;case"defaultValue":E=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,n));break;default:P!==ae&&Ft(e,n,G,P,s,ae)}}_r(e,y,E,M,Y,Z,f,c);return;case"select":P=y=E=G=null;for(f in l)if(M=l[f],l.hasOwnProperty(f)&&M!=null)switch(f){case"value":break;case"multiple":P=M;default:s.hasOwnProperty(f)||Ft(e,n,f,null,s,M)}for(c in s)if(f=s[c],M=l[c],s.hasOwnProperty(c)&&(f!=null||M!=null))switch(c){case"value":G=f;break;case"defaultValue":E=f;break;case"multiple":y=f;default:f!==M&&Ft(e,n,c,f,s,M)}n=E,l=y,s=P,G!=null?il(e,!!l,G,!1):!!s!=!!l&&(n!=null?il(e,!!l,n,!0):il(e,!!l,l?[]:"",!1));return;case"textarea":P=G=null;for(E in l)if(c=l[E],l.hasOwnProperty(E)&&c!=null&&!s.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ft(e,n,E,null,s,c)}for(y in s)if(c=s[y],f=l[y],s.hasOwnProperty(y)&&(c!=null||f!=null))switch(y){case"value":G=c;break;case"defaultValue":P=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&Ft(e,n,y,c,s,f)}$u(e,G,P);return;case"option":for(var Ce in l)if(G=l[Ce],l.hasOwnProperty(Ce)&&G!=null&&!s.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Ft(e,n,Ce,null,s,G)}for(M in s)if(G=s[M],P=l[M],s.hasOwnProperty(M)&&G!==P&&(G!=null||P!=null))switch(M){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Ft(e,n,M,G,s,P)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in l)G=l[Ye],l.hasOwnProperty(Ye)&&G!=null&&!s.hasOwnProperty(Ye)&&Ft(e,n,Ye,null,s,G);for(Y in s)if(G=s[Y],P=l[Y],s.hasOwnProperty(Y)&&G!==P&&(G!=null||P!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Ft(e,n,Y,G,s,P)}return;default:if(Lr(n)){for(var Gt in l)G=l[Gt],l.hasOwnProperty(Gt)&&G!==void 0&&!s.hasOwnProperty(Gt)&&Df(e,n,Gt,void 0,s,G);for(Z in s)G=s[Z],P=l[Z],!s.hasOwnProperty(Z)||G===P||G===void 0&&P===void 0||Df(e,n,Z,G,s,P);return}}for(var U in l)G=l[U],l.hasOwnProperty(U)&&G!=null&&!s.hasOwnProperty(U)&&Ft(e,n,U,null,s,G);for(ae in s)G=s[ae],P=l[ae],!s.hasOwnProperty(ae)||G===P||G==null&&P==null||Ft(e,n,ae,G,s,P)}function fv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function K0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var c=l[s],f=c.transferSize,y=c.initiatorType,E=c.duration;if(f&&E&&fv(y)){for(y=0,E=c.responseEnd,s+=1;s<l.length;s++){var M=l[s],Y=M.startTime;if(Y>E)break;var Z=M.transferSize,ae=M.initiatorType;Z&&fv(ae)&&(M=M.responseEnd,y+=Z*(M<E?1:(E-Y)/(M-Y)))}if(--s,n+=8*(f+y)/(c.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Cf=null,Af=null;function zo(e){return e.nodeType===9?e:e.ownerDocument}function hv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Of(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 Mf=null;function Z0(){var e=window.event;return e&&e.type==="popstate"?e===Mf?!1:(Mf=e,!0):(Mf=null,!1)}var pv=typeof setTimeout=="function"?setTimeout:void 0,J0=typeof clearTimeout=="function"?clearTimeout:void 0,gv=typeof Promise=="function"?Promise:void 0,W0=typeof queueMicrotask=="function"?queueMicrotask:typeof gv<"u"?function(e){return gv.resolve(null).then(e).catch(eS)}:pv;function eS(e){setTimeout(function(){throw e})}function br(e){return e==="head"}function vv(e,n){var l=n,s=0;do{var c=l.nextSibling;if(e.removeChild(l),c&&c.nodeType===8)if(l=c.data,l==="/$"||l==="/&"){if(s===0){e.removeChild(c),Ys(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")Xi(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Xi(l);for(var f=l.firstChild;f;){var y=f.nextSibling,E=f.nodeName;f[Pe]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&f.rel.toLowerCase()==="stylesheet"||l.removeChild(f),f=y}}else l==="body"&&Xi(e.ownerDocument.body);l=c}while(l);Ys(n)}function yv(e,n){var l=e;e=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=s}while(l)}function kf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":kf(l),qe(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function tS(e,n,l,s){for(;e.nodeType===1;){var c=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Pe])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Ya(e.nextSibling),e===null)break}return null}function nS(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Ya(e.nextSibling),e===null))return null;return e}function xv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ya(e.nextSibling),e===null))return null;return e}function _f(e){return e.data==="$?"||e.data==="$~"}function Lf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function aS(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ya(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 zf=null;function bv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return Ya(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function Sv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function Ev(e,n,l){switch(n=zo(l),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Xi(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);qe(e)}var Va=new Map,wv=new Set;function Uo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ql=V.d;V.d={f:lS,r:rS,D:sS,C:iS,L:uS,m:oS,X:dS,S:cS,M:fS};function lS(){var e=Ql.f(),n=Do();return e||n}function rS(e){var n=Ze(e);n!==null&&n.tag===5&&n.type==="form"?$p(n):Ql.r(e)}var Bs=typeof document>"u"?null:document;function Rv(e,n,l){var s=Bs;if(s&&typeof n=="string"&&n){var c=Gn(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),wv.has(c)||(wv.add(c),e={rel:e,crossOrigin:l,href:n},s.querySelector(c)===null&&(n=s.createElement("link"),Pn(n,"link",e),ct(n),s.head.appendChild(n)))}}function sS(e){Ql.D(e),Rv("dns-prefetch",e,null)}function iS(e,n){Ql.C(e,n),Rv("preconnect",e,n)}function uS(e,n,l){Ql.L(e,n,l);var s=Bs;if(s&&e&&n){var c='link[rel="preload"][as="'+Gn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+Gn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+Gn(l.imageSizes)+'"]')):c+='[href="'+Gn(e)+'"]';var f=c;switch(n){case"style":f=$s(e);break;case"script":f=qs(e)}Va.has(f)||(e=b({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),Va.set(f,e),s.querySelector(c)!==null||n==="style"&&s.querySelector(Ii(f))||n==="script"&&s.querySelector(Qi(f))||(n=s.createElement("link"),Pn(n,"link",e),ct(n),s.head.appendChild(n)))}}function oS(e,n){Ql.m(e,n);var l=Bs;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+Gn(s)+'"][href="'+Gn(e)+'"]',f=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=qs(e)}if(!Va.has(f)&&(e=b({rel:"modulepreload",href:e},n),Va.set(f,e),l.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qi(f)))return}s=l.createElement("link"),Pn(s,"link",e),ct(s),l.head.appendChild(s)}}}function cS(e,n,l){Ql.S(e,n,l);var s=Bs;if(s&&e){var c=rt(s).hoistableStyles,f=$s(e);n=n||"default";var y=c.get(f);if(!y){var E={loading:0,preload:null};if(y=s.querySelector(Ii(f)))E.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},l),(l=Va.get(f))&&Uf(e,l);var M=y=s.createElement("link");ct(M),Pn(M,"link",e),M._p=new Promise(function(Y,Z){M.onload=Y,M.onerror=Z}),M.addEventListener("load",function(){E.loading|=1}),M.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ho(y,n,s)}y={type:"stylesheet",instance:y,count:1,state:E},c.set(f,y)}}}function dS(e,n){Ql.X(e,n);var l=Bs;if(l&&e){var s=rt(l).hoistableScripts,c=qs(e),f=s.get(c);f||(f=l.querySelector(Qi(c)),f||(e=b({src:e,async:!0},n),(n=Va.get(c))&&Hf(e,n),f=l.createElement("script"),ct(f),Pn(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(c,f))}}function fS(e,n){Ql.M(e,n);var l=Bs;if(l&&e){var s=rt(l).hoistableScripts,c=qs(e),f=s.get(c);f||(f=l.querySelector(Qi(c)),f||(e=b({src:e,async:!0,type:"module"},n),(n=Va.get(c))&&Hf(e,n),f=l.createElement("script"),ct(f),Pn(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(c,f))}}function Nv(e,n,l,s){var c=(c=Se.current)?Uo(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=$s(l.href),l=rt(c).hoistableStyles,s=l.get(n),s||(s={type:"style",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=$s(l.href);var f=rt(c).hoistableStyles,y=f.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=c.querySelector(Ii(e)))&&!f._p&&(y.instance=f,y.state.loading=5),Va.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Va.set(e,l),f||hS(c,e,l,y.state))),n&&s===null)throw Error(i(528,""));return y}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=qs(l),l=rt(c).hoistableScripts,s=l.get(n),s||(s={type:"script",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function $s(e){return'href="'+Gn(e)+'"'}function Ii(e){return'link[rel="stylesheet"]['+e+"]"}function Tv(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function hS(e,n,l,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),Pn(n,"link",l),ct(n),e.head.appendChild(n))}function qs(e){return'[src="'+Gn(e)+'"]'}function Qi(e){return"script[async]"+e}function jv(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Gn(l.href)+'"]');if(s)return n.instance=s,ct(s),s;var c=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ct(s),Pn(s,"style",c),Ho(s,l.precedence,e),n.instance=s;case"stylesheet":c=$s(l.href);var f=e.querySelector(Ii(c));if(f)return n.state.loading|=4,n.instance=f,ct(f),f;s=Tv(l),(c=Va.get(c))&&Uf(s,c),f=(e.ownerDocument||e).createElement("link"),ct(f);var y=f;return y._p=new Promise(function(E,M){y.onload=E,y.onerror=M}),Pn(f,"link",s),n.state.loading|=4,Ho(f,l.precedence,e),n.instance=f;case"script":return f=qs(l.src),(c=e.querySelector(Qi(f)))?(n.instance=c,ct(c),c):(s=l,(c=Va.get(f))&&(s=b({},l),Hf(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),ct(c),Pn(c,"link",s),e.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Ho(s,l.precedence,e));return n.instance}function Ho(e,n,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,f=c,y=0;y<s.length;y++){var E=s[y];if(E.dataset.precedence===n)f=E;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function Uf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Hf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Bo=null;function Dv(e,n,l){if(Bo===null){var s=new Map,c=Bo=new Map;c.set(l,s)}else c=Bo,s=c.get(l),s||(s=new Map,c.set(l,s));if(s.has(e))return s;for(s.set(e,null),l=l.getElementsByTagName(e),c=0;c<l.length;c++){var f=l[c];if(!(f[Pe]||f[he]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(n)||"";y=e+y;var E=s.get(y);E?E.push(f):s.set(y,[f])}}return s}function Cv(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function mS(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Av(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pS(e,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=$s(s.href),f=n.querySelector(Ii(c));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=$o.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=f,ct(f);return}f=n.ownerDocument||n,s=Tv(s),(c=Va.get(c))&&Uf(s,c),f=f.createElement("link"),ct(f);var y=f;y._p=new Promise(function(E,M){y.onload=E,y.onerror=M}),Pn(f,"link",s),l.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=$o.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var Bf=0;function gS(e,n){return e.stylesheets&&e.count===0&&Yo(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&Yo(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&Bf===0&&(Bf=62500*K0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yo(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Bf?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function $o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qo=null;function Yo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qo=new Map,n.forEach(vS,e),qo=null,$o.call(e))}function vS(e,n){if(!(n.state.loading&4)){var l=qo.get(e);if(l)var s=l.get(null);else{l=new Map,qo.set(e,l);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var y=c[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(l.set(y.dataset.precedence,y),s=y)}s&&l.set(null,s)}c=n.instance,y=c.getAttribute("data-precedence"),f=l.get(y)||s,f===s&&l.set(null,c),l.set(y,c),this.count++,s=$o.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),n.state.loading|=4}}var Pi={$$typeof:q,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function yS(e,n,l,s,c,f,y,E,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.hiddenUpdates=Ut(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Ov(e,n,l,s,c,f,y,E,M,Y,Z,ae){return e=new yS(e,n,l,y,M,Y,Z,ae,E),n=1,f===!0&&(n|=24),f=wa(3,null,null,n),e.current=f,f.stateNode=e,n=vd(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:s,isDehydrated:l,cache:n},Sd(f),e}function Mv(e){return e?(e=ys,e):ys}function kv(e,n,l,s,c,f){c=Mv(c),s.context===null?s.context=c:s.pendingContext=c,s=or(n),s.payload={element:l},f=f===void 0?null:f,f!==null&&(s.callback=f),l=cr(e,s,n),l!==null&&(xa(l,e,n),ji(l,e,n))}function _v(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function $f(e,n){_v(e,n),(e=e.alternate)&&_v(e,n)}function Lv(e){if(e.tag===13||e.tag===31){var n=Yr(e,67108864);n!==null&&xa(n,e,67108864),$f(e,67108864)}}function zv(e){if(e.tag===13||e.tag===31){var n=Da();n=_(n);var l=Yr(e,n);l!==null&&xa(l,e,n),$f(e,n)}}var Vo=!0;function xS(e,n,l,s){var c=B.T;B.T=null;var f=V.p;try{V.p=2,qf(e,n,l,s)}finally{V.p=f,B.T=c}}function bS(e,n,l,s){var c=B.T;B.T=null;var f=V.p;try{V.p=8,qf(e,n,l,s)}finally{V.p=f,B.T=c}}function qf(e,n,l,s){if(Vo){var c=Yf(s);if(c===null)jf(e,n,s,Fo,l),Hv(e,s);else if(ES(c,e,n,l,s))s.stopPropagation();else if(Hv(e,s),n&4&&-1<SS.indexOf(e)){for(;c!==null;){var f=Ze(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=gt(f.pendingLanes);if(y!==0){var E=f;for(E.pendingLanes|=2,E.entangledLanes|=2;y;){var M=1<<31-Lt(y);E.entanglements[1]|=M,y&=~M}ml(f),(Dt&6)===0&&(To=Oe()+500,Vi(0))}}break;case 31:case 13:E=Yr(f,2),E!==null&&xa(E,f,2),Do(),$f(f,2)}if(f=Yf(s),f===null&&jf(e,n,s,Fo,l),f===c)break;c=f}c!==null&&s.stopPropagation()}else jf(e,n,s,null,l)}}function Yf(e){return e=jl(e),Vf(e)}var Fo=null;function Vf(e){if(Fo=null,e=Ht(e),e!==null){var n=o(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=h(n),e!==null)return e;e=null}else if(l===31){if(e=m(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Fo=e,null}function Uv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ze()){case Ge:return 2;case lt:return 8;case At:case Ot:return 32;case tn:return 268435456;default:return 32}default:return 32}}var Ff=!1,Sr=null,Er=null,wr=null,Ki=new Map,Zi=new Map,Rr=[],SS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Hv(e,n){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":Er=null;break;case"mouseover":case"mouseout":wr=null;break;case"pointerover":case"pointerout":Ki.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zi.delete(n.pointerId)}}function Ji(e,n,l,s,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:f,targetContainers:[c]},n!==null&&(n=Ze(n),n!==null&&Lv(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function ES(e,n,l,s,c){switch(n){case"focusin":return Sr=Ji(Sr,e,n,l,s,c),!0;case"dragenter":return Er=Ji(Er,e,n,l,s,c),!0;case"mouseover":return wr=Ji(wr,e,n,l,s,c),!0;case"pointerover":var f=c.pointerId;return Ki.set(f,Ji(Ki.get(f)||null,e,n,l,s,c)),!0;case"gotpointercapture":return f=c.pointerId,Zi.set(f,Ji(Zi.get(f)||null,e,n,l,s,c)),!0}return!1}function Bv(e){var n=Ht(e.target);if(n!==null){var l=o(n);if(l!==null){if(n=l.tag,n===13){if(n=h(l),n!==null){e.blockedOn=n,ne(e.priority,function(){zv(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,ne(e.priority,function(){zv(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Go(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=Yf(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);Sa=s,l.target.dispatchEvent(s),Sa=null}else return n=Ze(l),n!==null&&Lv(n),e.blockedOn=l,!1;n.shift()}return!0}function $v(e,n,l){Go(e)&&l.delete(n)}function wS(){Ff=!1,Sr!==null&&Go(Sr)&&(Sr=null),Er!==null&&Go(Er)&&(Er=null),wr!==null&&Go(wr)&&(wr=null),Ki.forEach($v),Zi.forEach($v)}function Xo(e,n){e.blockedOn===n&&(e.blockedOn=null,Ff||(Ff=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wS)))}var Io=null;function qv(e){Io!==e&&(Io=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Io===e&&(Io=null);for(var n=0;n<e.length;n+=3){var l=e[n],s=e[n+1],c=e[n+2];if(typeof s!="function"){if(Vf(s||l)===null)continue;break}var f=Ze(l);f!==null&&(e.splice(n,3),n-=3,qd(f,{pending:!0,data:c,method:l.method,action:s},s,c))}}))}function Ys(e){function n(M){return Xo(M,e)}Sr!==null&&Xo(Sr,e),Er!==null&&Xo(Er,e),wr!==null&&Xo(wr,e),Ki.forEach(n),Zi.forEach(n);for(var l=0;l<Rr.length;l++){var s=Rr[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Rr.length&&(l=Rr[0],l.blockedOn===null);)Bv(l),l.blockedOn===null&&Rr.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var c=l[s],f=l[s+1],y=c[je]||null;if(typeof f=="function")y||qv(l);else if(y){var E=null;if(f&&f.hasAttribute("formAction")){if(c=f,y=f[je]||null)E=y.formAction;else if(Vf(c)!==null)continue}else E=y.action;typeof E=="function"?l[s+1]=E:(l.splice(s,3),s-=3),qv(l)}}}function Yv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return c=y})},focusReset:"manual",scroll:"manual"})}function n(){c!==null&&(c(),c=null),s||setTimeout(l,20)}function l(){if(!s&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function Gf(e){this._internalRoot=e}Qo.prototype.render=Gf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var l=n.current,s=Da();kv(l,s,e,n,null,null)},Qo.prototype.unmount=Gf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;kv(e.current,2,null,e,null,null),Do(),n[be]=null}};function Qo(e){this._internalRoot=e}Qo.prototype.unstable_scheduleHydration=function(e){if(e){var n=K();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Rr.length&&n!==0&&n<Rr[l].priority;l++);Rr.splice(l,0,e),l===0&&Bv(e)}};var Vv=a.version;if(Vv!=="19.2.7")throw Error(i(527,Vv,"19.2.7"));V.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(n),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var RS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{gn=Po.inject(RS),J=Po}catch{}}return eu.createRoot=function(e,n){if(!u(e))throw Error(i(299));var l=!1,s="",c=Kp,f=Zp,y=Jp;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=Ov(e,1,!1,null,null,l,s,null,c,f,y,Yv),e[be]=n.current,Tf(e),new Gf(n)},eu.hydrateRoot=function(e,n,l){if(!u(e))throw Error(i(299));var s=!1,c="",f=Kp,y=Zp,E=Jp,M=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(f=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError),l.formState!==void 0&&(M=l.formState)),n=Ov(e,1,!0,n,l??null,s,c,M,f,y,E,Yv),n.context=Mv(null),l=n.current,s=Da(),s=_(s),c=or(s),c.callback=null,cr(l,c,s),l=s,n.current.lanes=l,dt(n,l),ml(n),e[be]=n.current,Tf(e),new Qo(n)},eu.version="19.2.7",eu}var Wv;function HS(){if(Wv)return Qf.exports;Wv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Qf.exports=US(),Qf.exports}var BS=HS();/**
50
+ * react-router v7.18.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var px=t=>{throw TypeError(t)},gx=(t,a,r)=>a.has(t)||px("Cannot "+r),Fa=(t,a,r)=>(gx(t,a,"read from private field"),r?r.call(t):a.get(t)),ou=(t,a,r)=>a.has(t)?px("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,r),pl=(t,a,r,i)=>(gx(t,a,"write to private field"),a.set(t,r),r),jc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,zh=/^[\\/]{2}/;function vx(t,a){return a+t.replace(/\\/g,"/")}var ey="popstate";function ty(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function $S(t={}){function a(i,u){var g;let o=(g=u.state)==null?void 0:g.masked,{pathname:h,search:m,hash:p}=o||i.location;return yu("",{pathname:h,search:m,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default",o?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function r(i,u){return typeof u=="string"?u:Sl(u)}return YS(a,r,null,t)}function We(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function bn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function qS(){return Math.random().toString(36).substring(2,10)}function ny(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function yu(t,a,r=null,i,u){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?El(a):a,state:r,key:a&&a.key||i||qS(),mask:u}}function Sl({pathname:t="/",search:a="",hash:r=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function El(t){let a={};if(t){let r=t.indexOf("#");r>=0&&(a.hash=t.substring(r),t=t.substring(0,r));let i=t.indexOf("?");i>=0&&(a.search=t.substring(i),t=t.substring(0,i)),t&&(a.pathname=t)}return a}function YS(t,a,r,i={}){let{window:u=document.defaultView,v5Compat:o=!1}=i,h=u.history,m="POP",p=null,g=x();g==null&&(g=0,h.replaceState({...h.state,idx:g},""));function x(){return(h.state||{idx:null}).idx}function b(){m="POP";let N=x(),z=N==null?null:N-g;g=N,p&&p({action:m,location:C.location,delta:z})}function w(N,z){m="PUSH";let I=ty(N)?N:yu(C.location,N,z);g=x()+1;let q=ny(I,g),Q=C.createHref(I.mask||I);try{h.pushState(q,"",Q)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;u.location.assign(Q)}o&&p&&p({action:m,location:C.location,delta:1})}function S(N,z){m="REPLACE";let I=ty(N)?N:yu(C.location,N,z);g=x();let q=ny(I,g),Q=C.createHref(I.mask||I);h.replaceState(q,"",Q),o&&p&&p({action:m,location:C.location,delta:0})}function R(N){return yx(u,N)}let C={get action(){return m},get location(){return t(u,h)},listen(N){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(ey,b),p=N,()=>{u.removeEventListener(ey,b),p=null}},createHref(N){return a(u,N)},createURL:R,encodeLocation(N){let z=R(N);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:w,replace:S,go(N){return h.go(N)}};return C}function yx(t,a,r=!1){let i="http://localhost";t&&(i=t.location.origin!=="null"?t.location.origin:t.location.href),We(i,"No window.location.(origin|href) available to create URL");let u=typeof a=="string"?a:Sl(a);return u=u.replace(/ $/,"%20"),!r&&zh.test(u)&&(u=i+u),new URL(u,i)}var cu,ay=class{constructor(t){if(ou(this,cu,new Map),t)for(let[a,r]of t)this.set(a,r)}get(t){if(Fa(this,cu).has(t))return Fa(this,cu).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Fa(this,cu).set(t,a)}};cu=new WeakMap;var VS=new Set(["lazy","caseSensitive","path","id","index","children"]);function FS(t){return VS.has(t)}var GS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function XS(t){return GS.has(t)}function IS(t){return t.index===!0}function xu(t,a,r=[],i={},u=!1){return t.map((o,h)=>{let m=[...r,String(h)],p=typeof o.id=="string"?o.id:m.join("-");if(We(o.index!==!0||!o.children,"Cannot specify children on an index route"),We(u||!i[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),IS(o)){let g={...o,id:p};return i[p]=ly(g,a(g)),g}else{let g={...o,id:p,children:void 0};return i[p]=ly(g,a(g)),o.children&&(g.children=xu(o.children,a,m,i,u)),g}})}function ly(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function xx(t,a,r="/"){return nl(t,a,r,!1)}function nl(t,a,r,i,u){let o=typeof a=="string"?El(a):a,h=Pa(o.pathname||"/",r);if(h==null)return null;let m=u??uc(t),p=null,g=r1(h);for(let x=0;p==null&&x<m.length;++x)p=l1(m[x],g,i);return p}function QS(t,a){let{route:r,pathname:i,params:u}=t;return{id:r.id,pathname:i,params:u,data:a[r.id],loaderData:a[r.id],handle:r.handle}}function uc(t){let a=bx(t);return PS(a),a}function bx(t,a=[],r=[],i="",u=!1){let o=(h,m,p=u,g)=>{let x={relativePath:g===void 0?h.path||"":g,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&p)return;We(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let b=Qa([i,x.relativePath]),w=r.concat(x);h.children&&h.children.length>0&&(We(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),bx(h.children,a,w,b,p)),!(h.path==null&&!h.index)&&a.push({path:b,score:n1(b,h.index),routesMeta:w.map((S,R)=>{let[C,N]=wx(S.relativePath,S.caseSensitive,R===w.length-1);return{...S,matcher:C,compiledParams:N}})})};return t.forEach((h,m)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))o(h,m);else for(let g of Sx(h.path))o(h,m,!0,g)}),a}function Sx(t){let a=t.split("/");if(a.length===0)return[];let[r,...i]=a,u=r.endsWith("?"),o=r.replace(/\?$/,"");if(i.length===0)return u?[o,""]:[o];let h=Sx(i.join("/")),m=[];return m.push(...h.map(p=>p===""?o:[o,p].join("/"))),u&&m.push(...h),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function PS(t){t.sort((a,r)=>a.score!==r.score?r.score-a.score:a1(a.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var KS=/^:[\w-]+$/,ZS=3,JS=2,WS=1,e1=10,t1=-2,ry=t=>t==="*";function n1(t,a){let r=t.split("/"),i=r.length;return r.some(ry)&&(i+=t1),a&&(i+=JS),r.filter(u=>!ry(u)).reduce((u,o)=>u+(KS.test(o)?ZS:o===""?WS:e1),i)}function a1(t,a){return t.length===a.length&&t.slice(0,-1).every((i,u)=>i===a[u])?t[t.length-1]-a[a.length-1]:0}function l1(t,a,r=!1){let{routesMeta:i}=t,u={},o="/",h=[];for(let m=0;m<i.length;++m){let p=i[m],g=m===i.length-1,x=o==="/"?a:a.slice(o.length)||"/",b={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},w=p.matcher&&p.compiledParams?Ex(b,x,p.matcher,p.compiledParams):gc(b,x),S=p.route;if(!w&&g&&r&&!i[i.length-1].route.index&&(w=gc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!w)return null;Object.assign(u,w.params),h.push({params:u,pathname:Qa([o,w.pathname]),pathnameBase:u1(Qa([o,w.pathnameBase])),route:S}),w.pathnameBase!=="/"&&(o=Qa([o,w.pathnameBase]))}return h}function gc(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,i]=wx(t.path,t.caseSensitive,t.end);return Ex(t,a,r,i)}function Ex(t,a,r,i){let u=a.match(r);if(!u)return null;let o=u[0],h=o.replace(/(.)\/+$/,"$1"),m=u.slice(1);return{params:i.reduce((g,{paramName:x,isOptional:b},w)=>{if(x==="*"){let R=m[w]||"";h=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const S=m[w];return b&&!S?g[x]=void 0:g[x]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:h,pattern:t}}function wx(t,a=!1,r=!0){bn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],u="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p,g,x)=>{if(i.push({paramName:m,isOptional:p!=null}),p){let b=x.charAt(g+h.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),u+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?u+="\\/*$":t!==""&&t!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),i]}function r1(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return bn(!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 Pa(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,i=t.charAt(r);return i&&i!=="/"?null:t.slice(r)||"/"}function s1({basename:t,pathname:a}){return a==="/"?t:Qa([t,a])}var Uh=t=>jc.test(t);function i1(t,a="/"){let{pathname:r,search:i="",hash:u=""}=typeof t=="string"?El(t):t,o;return r?(r=Bh(r),r.startsWith("/")?o=sy(r.substring(1),"/"):o=sy(r,a)):o=a,{pathname:o,search:o1(i),hash:c1(u)}}function sy(t,a){let r=vc(a).split("/");return t.split("/").forEach(u=>{u===".."?r.length>1&&r.pop():u!=="."&&r.push(u)}),r.length>1?r.join("/"):"/"}function Jf(t,a,r,i){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Rx(t){return t.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function Hh(t){let a=Rx(t);return a.map((r,i)=>i===a.length-1?r.pathname:r.pathnameBase)}function Dc(t,a,r,i=!1){let u;typeof t=="string"?u=El(t):(u={...t},We(!u.pathname||!u.pathname.includes("?"),Jf("?","pathname","search",u)),We(!u.pathname||!u.pathname.includes("#"),Jf("#","pathname","hash",u)),We(!u.search||!u.search.includes("#"),Jf("#","search","hash",u)));let o=t===""||u.pathname==="",h=o?"/":u.pathname,m;if(h==null)m=r;else{let b=a.length-1;if(!i&&h.startsWith("..")){let w=h.split("/");for(;w[0]==="..";)w.shift(),b-=1;u.pathname=w.join("/")}m=b>=0?a[b]:"/"}let p=i1(u,m),g=h&&h!=="/"&&h.endsWith("/"),x=(o||h===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var Bh=t=>t.replace(/[\\/]{2,}/g,"/"),Qa=t=>Bh(t.join("/")),vc=t=>t.replace(/\/+$/,""),u1=t=>vc(t).replace(/^\/*/,"/"),o1=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,c1=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,wl=(t,a=302)=>{let r=a;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let i=new Headers(r.headers);return i.set("Location",t),new Response(null,{...r,headers:i})},d1=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ru=class{constructor(t,a,r,i=!1){this.status=t,this.statusText=a||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ws(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Nu(t){let a=t.map(r=>r.route.path).filter(Boolean);return Qa(a)||"/"}var Nx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tx(t,a){let r=t;if(typeof r!="string"||!jc.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,u=!1;if(Nx)try{let o=new URL(window.location.href),h=zh.test(r)?new URL(vx(r,o.protocol)):new URL(r),m=Pa(h.pathname,a);h.origin===o.origin&&m!=null?r=m+h.search+h.hash:u=!0}catch{bn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:r}}var Ar=Symbol("Uninstrumented");function f1(t,a){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(u=>u({id:a.id,index:a.index,path:a.path,instrument(o){let h=Object.keys(r);for(let m of h)o[m]&&r[m].push(o[m])}}));let i={};if(typeof a.lazy=="function"&&r.lazy.length>0){let u=Ps(r.lazy,a.lazy,()=>{});u&&(i.lazy=u)}if(typeof a.lazy=="object"){let u=a.lazy;["middleware","loader","action"].forEach(o=>{let h=u[o],m=r[`lazy.${o}`];if(typeof h=="function"&&m.length>0){let p=Ps(m,h,()=>{});p&&(i.lazy=Object.assign(i.lazy||{},{[o]:p}))}})}return["loader","action"].forEach(u=>{let o=a[u];if(typeof o=="function"&&r[u].length>0){let h=o[Ar]??o,m=Ps(r[u],h,(...p)=>iy(p[0]));m&&(u==="loader"&&h.hydrate===!0&&(m.hydrate=!0),m[Ar]=h,i[u]=m)}}),a.middleware&&a.middleware.length>0&&r.middleware.length>0&&(i.middleware=a.middleware.map(u=>{let o=u[Ar]??u,h=Ps(r.middleware,o,(...m)=>iy(m[0]));return h?(h[Ar]=o,h):u})),i}function h1(t,a){let r={navigate:[],fetch:[]};if(a.forEach(i=>i({instrument(u){let o=Object.keys(u);for(let h of o)u[h]&&r[h].push(u[h])}})),r.navigate.length>0){let i=t.navigate[Ar]??t.navigate,u=Ps(r.navigate,i,(...o)=>{let[h,m]=o;return{to:typeof h=="number"||typeof h=="string"?h:h?Sl(h):".",...uy(t,m??{})}});u&&(u[Ar]=i,t.navigate=u)}if(r.fetch.length>0){let i=t.fetch[Ar]??t.fetch,u=Ps(r.fetch,i,(...o)=>{let[h,,m,p]=o;return{href:m??".",fetcherKey:h,...uy(t,p??{})}});u&&(u[Ar]=i,t.fetch=u)}return t}function Ps(t,a,r){return t.length===0?null:async(...i)=>{let u=await jx(t,r(...i),()=>a(...i),t.length-1);if(u.type==="error")throw u.value;return u.value}}async function jx(t,a,r,i){let u=t[i],o;if(u){let h,m=async()=>(h?console.error("You cannot call instrumented handlers more than once"):h=jx(t,a,r,i-1),o=await h,We(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await u(m,a)}catch(p){console.error("An instrumentation function threw an error:",p)}h||await m(),await h}else try{o={type:"success",value:await r()}}catch(h){o={type:"error",value:h}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function iy(t){let{request:a,context:r,params:i,pattern:u}=t;return{request:m1(a),params:{...i},pattern:u,context:p1(r)}}function uy(t,a){return{currentUrl:Sl(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 m1(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function p1(t){if(v1(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var g1=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function v1(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")===g1}var Dx=["POST","PUT","PATCH","DELETE"],y1=new Set(Dx),x1=["GET",...Dx],b1=new Set(x1),Cx=new Set([301,302,303,307,308]),S1=new Set([307,308]),Wf={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ax={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},E1=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Ox="remix-router-transitions",Mx=Symbol("ResetLoaderData"),ts,Xs,jr,Is,w1=class{constructor(t){ou(this,ts),ou(this,Xs),ou(this,jr),ou(this,Is),pl(this,ts,t),pl(this,Xs,uc(t))}get stableRoutes(){return Fa(this,ts)}get activeRoutes(){return Fa(this,jr)??Fa(this,ts)}get branches(){return Fa(this,Is)??Fa(this,Xs)}get hasHMRRoutes(){return Fa(this,jr)!=null}setRoutes(t){pl(this,ts,t),pl(this,Xs,uc(t))}setHmrRoutes(t){pl(this,jr,t),pl(this,Is,uc(t))}commitHmrRoutes(){Fa(this,jr)&&(pl(this,ts,Fa(this,jr)),pl(this,Xs,Fa(this,Is)),pl(this,jr,void 0),pl(this,Is,void 0))}};ts=new WeakMap;Xs=new WeakMap;jr=new WeakMap;Is=new WeakMap;function R1(t){const a=t.window?t.window:typeof window<"u"?window:void 0,r=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";We(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],u=t.mapRouteProperties||E1,o=u;if(t.instrumentations){let A=t.instrumentations;o=_=>({...u(_),...f1(A.map(H=>H.route).filter(Boolean),_)})}let h={},m=new w1(xu(t.routes,o,void 0,h)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||C1,x={...t.future},b=null,w=new Set,S=null,R=null,C=null,N=null,z=t.hydrationData!=null,I=nl(m.activeRoutes,t.history.location,p,!1,m.branches),q=!1,Q=null,ee,te;if(I==null&&!t.patchRoutesOnNavigation){let A=Ga(404,{pathname:t.history.location.pathname}),{matches:_,route:H}=Ko(m.activeRoutes);ee=!0,te=!ee,I=_,Q={[H.id]:A}}else if(I&&!t.hydrationData&&Ut(I,m.activeRoutes,t.history.location.pathname).active&&(I=null),I)if(I.some(A=>A.route.lazy))ee=!1,te=!ee;else if(!I.some(A=>$h(A.route)))ee=!0,te=!ee;else{let A=t.hydrationData?t.hydrationData.loaderData:null,_=t.hydrationData?t.hydrationData.errors:null,H=I;if(_){let K=I.findIndex(ne=>_[ne.route.id]!==void 0);H=H.slice(0,K+1)}te=!1,ee=!0,H.forEach(K=>{let ne=kx(K.route,A,_);te=te||ne.renderFallback,ee=ee&&!ne.shouldLoad})}else{ee=!1,te=!ee,I=[];let A=Ut(null,m.activeRoutes,t.history.location.pathname);A.active&&A.matches&&(q=!0,I=A.matches)}let D,j={historyAction:t.history.action,location:t.history.location,matches:I,initialized:ee,renderFallback:te,navigation:Wf,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||Q,fetchers:new Map,blockers:new Map},re="POP",ue=null,xe=!1,pe,Te=!1,Ae=new Map,Re=null,B=!1,V=!1,de=new Set,fe=new Map,Ne=0,O=-1,X=new Map,se=new Set,ce=new Map,we=new Map,Se=new Set,He=new Map,it,Fe=null;function et(){if(b=t.history.listen(({action:A,location:_,delta:H})=>{if(it){it(),it=void 0;return}bn(He.size===0||H!=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=Yt({currentLocation:j.location,nextLocation:_,historyAction:A});if(K&&H!=null){let ne=new Promise(Ee=>{it=Ee});t.history.go(H*-1),Qt(K,{state:"blocked",location:_,proceed(){Qt(K,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),ne.then(()=>t.history.go(H))},reset(){let Ee=new Map(j.blockers);Ee.set(K,tu),ut({blockers:Ee})}}),ue==null||ue.resolve(),ue=null;return}return Xt(A,_)}),r){Q1(a,Ae);let A=()=>P1(a,Ae);a.addEventListener("pagehide",A),Re=()=>a.removeEventListener("pagehide",A)}return j.initialized||Xt("POP",j.location,{initialHydration:!0}),D}function en(){b&&b(),Re&&Re(),w.clear(),pe&&pe.abort(),j.fetchers.forEach((A,_)=>gn(j.fetchers,_)),j.blockers.forEach((A,_)=>$e(_))}function qt(A){if(w.add(A),S){let{newErrors:_}=S;S=null,A(j,{deletedFetchers:[],newErrors:_,viewTransitionOpts:void 0,flushSync:!1})}return()=>w.delete(A)}function ut(A,_={}){A.matches&&(A.matches=A.matches.map(ne=>{let Ee=h[ne.route.id],he=ne.route;return he.element!==Ee.element||he.errorElement!==Ee.errorElement||he.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ne,route:Ee}:ne})),j={...j,...A};let H=[],K=[];j.fetchers.forEach((ne,Ee)=>{ne.state==="idle"&&(Se.has(Ee)?H.push(Ee):K.push(Ee))}),Se.forEach(ne=>{!j.fetchers.has(ne)&&!fe.has(ne)&&H.push(ne)}),w.size===0&&(S={newErrors:A.errors??null}),[...w].forEach(ne=>ne(j,{deletedFetchers:H,newErrors:A.errors??null,viewTransitionOpts:_.viewTransitionOpts,flushSync:_.flushSync===!0})),H.forEach(ne=>gn(j.fetchers,ne)),K.forEach(ne=>j.fetchers.delete(ne))}function le(A,_,{flushSync:H}={}){var _e,Xe;let K=j.actionData!=null&&j.navigation.formMethod!=null&&sa(j.navigation.formMethod)&&j.navigation.state==="loading"&&((_e=A.state)==null?void 0:_e._isRedirect)!==!0,ne;_.actionData?Object.keys(_.actionData).length>0?ne=_.actionData:ne=null:K?ne=j.actionData:ne=null;let Ee=_.loaderData?yy(j.loaderData,_.loaderData,_.matches||[],_.errors):j.loaderData,he=j.blockers;he.size>0&&(he=new Map(he),he.forEach((De,Pe)=>he.set(Pe,tu)));let je=B?!1:Pt(A,_.matches||j.matches),be=xe===!0||j.navigation.formMethod!=null&&sa(j.navigation.formMethod)&&((Xe=A.state)==null?void 0:Xe._isRedirect)!==!0;m.commitHmrRoutes(),B||re==="POP"||(re==="PUSH"?t.history.push(A,A.state):re==="REPLACE"&&t.history.replace(A,A.state));let Me;if(re==="POP"){let De=Ae.get(j.location.pathname);De&&De.has(A.pathname)?Me={currentLocation:j.location,nextLocation:A}:Ae.has(A.pathname)&&(Me={currentLocation:A,nextLocation:j.location})}else if(Te){let De=Ae.get(j.location.pathname);De?De.add(A.pathname):(De=new Set([A.pathname]),Ae.set(j.location.pathname,De)),Me={currentLocation:j.location,nextLocation:A}}ut({..._,actionData:ne,loaderData:Ee,historyAction:re,location:A,initialized:!0,renderFallback:!1,navigation:Wf,revalidation:"idle",restoreScrollPosition:je,preventScrollReset:be,blockers:he},{viewTransitionOpts:Me,flushSync:H===!0}),re="POP",xe=!1,Te=!1,B=!1,V=!1,ue==null||ue.resolve(),ue=null,Fe==null||Fe.resolve(),Fe=null}async function Le(A,_){if(ue==null||ue.resolve(),ue=null,typeof A=="number"){ue||(ue=Ey());let qe=ue.promise;return t.history.go(A),qe}let H=Rh(j.location,j.matches,p,A,_==null?void 0:_.fromRouteId,_==null?void 0:_.relative),{path:K,submission:ne,error:Ee}=oy(!1,H,_),he;_!=null&&_.mask&&(he={pathname:"",search:"",hash:"",...typeof _.mask=="string"?El(_.mask):{...j.location.mask,..._.mask}});let je=j.location,be=yu(je,K,_&&_.state,void 0,he);be={...be,...t.history.encodeLocation(be)};let Me=_&&_.replace!=null?_.replace:void 0,_e="PUSH";Me===!0?_e="REPLACE":Me===!1||ne!=null&&sa(ne.formMethod)&&ne.formAction===j.location.pathname+j.location.search&&(_e="REPLACE");let Xe=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,De=(_&&_.flushSync)===!0,Pe=Yt({currentLocation:je,nextLocation:be,historyAction:_e});if(Pe){Qt(Pe,{state:"blocked",location:be,proceed(){Qt(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:be}),Le(A,_)},reset(){let qe=new Map(j.blockers);qe.set(Pe,tu),ut({blockers:qe})}});return}await Xt(_e,be,{submission:ne,pendingError:Ee,preventScrollReset:Xe,replace:_&&_.replace,enableViewTransition:_&&_.viewTransition,flushSync:De,callSiteDefaultShouldRevalidate:_&&_.defaultShouldRevalidate})}function at(){Fe||(Fe=Ey()),At(),ut({revalidation:"loading"});let A=Fe.promise;return j.navigation.state==="submitting"?A:j.navigation.state==="idle"?(Xt(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),A):(Xt(re||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:Te===!0}),A)}async function Xt(A,_,H){pe&&pe.abort(),pe=null,re=A,B=(H&&H.startUninterruptedRevalidation)===!0,nn(j.location,j.matches),xe=(H&&H.preventScrollReset)===!0,Te=(H&&H.enableViewTransition)===!0;let K=m.activeRoutes,ne=H!=null&&H.initialHydration&&j.matches&&j.matches.length>0&&!q?j.matches:nl(K,_,p,!1,m.branches),Ee=(H&&H.flushSync)===!0;if(ne&&j.initialized&&!V&&H1(j.location,_)&&!(H&&H.submission&&sa(H.submission.formMethod))){le(_,{matches:ne},{flushSync:Ee});return}let he=Ut(ne,K,_.pathname);if(he.active&&he.matches&&(ne=he.matches),!ne){let{error:Ze,notFoundMatches:ot,route:rt}=gt(_.pathname);le(_,{matches:ot,loaderData:{},errors:{[rt.id]:Ze}},{flushSync:Ee});return}let je=H&&H.overrideNavigation?{...H.overrideNavigation,matches:ne,historyAction:A}:void 0;pe=new AbortController;let be=Qs(t.history,_,pe.signal,H&&H.submission),Me=t.getContext?await t.getContext():new ay,_e;if(H&&H.pendingError)_e=[Cr(ne).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&sa(H.submission.formMethod)){let Ze=await Cn(be,_,H.submission,ne,A,Me,he.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:Ee});if(Ze.shortCircuited)return;if(Ze.pendingActionResult){let[ot,rt]=Ze.pendingActionResult;if(Ca(rt)&&Ws(rt.error)&&rt.error.status===404){pe=null,le(_,{matches:Ze.matches,loaderData:{},errors:{[ot]:rt.error}});return}}ne=Ze.matches||ne,_e=Ze.pendingActionResult,je=eh(_,ne,A,H.submission),Ee=!1,he.active=!1,be=Qs(t.history,be.url,be.signal)}let{shortCircuited:Xe,matches:De,loaderData:Pe,errors:qe,workingFetchers:Ht}=await pn(be,_,ne,A,Me,he.active,je,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,Ee,_e,H&&H.callSiteDefaultShouldRevalidate);Xe||(pe=null,le(_,{matches:De||ne,...xy(_e),loaderData:Pe,errors:qe,...Ht?{fetchers:Ht}:{}}))}async function Cn(A,_,H,K,ne,Ee,he,je,be={}){At();let Me=X1(_,K,ne,H);if(ut({navigation:Me},{flushSync:be.flushSync===!0}),he){let De=await dt(K,_.pathname,A.signal);if(De.type==="aborted")return{shortCircuited:!0};if(De.type==="error"){if(De.partialMatches.length===0){let{matches:qe,route:Ht}=Ko(m.activeRoutes);return{matches:qe,pendingActionResult:[Ht.id,{type:"error",error:De.error}]}}let Pe=Cr(De.partialMatches).route.id;return{matches:De.partialMatches,pendingActionResult:[Pe,{type:"error",error:De.error}]}}else if(De.matches)K=De.matches;else{let{notFoundMatches:Pe,error:qe,route:Ht}=gt(_.pathname);return{matches:Pe,pendingActionResult:[Ht.id,{type:"error",error:qe}]}}}let _e,Xe=oc(K,_);if(!Xe.route.action&&!Xe.route.lazy)_e={type:"error",error:Ga(405,{method:A.method,pathname:_.pathname,routeId:Xe.route.id})};else{let De=Zs(o,h,A,_,K,Xe,je?[]:i,Ee),Pe=await Ge(A,_,De,Ee,null);if(_e=Pe[Xe.route.id],!_e){for(let qe of K)if(Pe[qe.route.id]){_e=Pe[qe.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(as(_e)){let De;return be&&be.replace!=null?De=be.replace:De=py(_e.response.headers.get("Location"),new URL(A.url),p,t.history)===j.location.pathname+j.location.search,await ze(A,_e,!0,{submission:H,replace:De}),{shortCircuited:!0}}if(Ca(_e)){let De=Cr(K,Xe.route.id);return(be&&be.replace)!==!0&&(re="PUSH"),{matches:K,pendingActionResult:[De.route.id,_e,Xe.route.id]}}return{matches:K,pendingActionResult:[Xe.route.id,_e]}}async function pn(A,_,H,K,ne,Ee,he,je,be,Me,_e,Xe,De,Pe){let qe=he||eh(_,H,K,je),Ht=je||be||Sy(qe),Ze=!B&&!_e;if(Ee){if(Ze){let xt=_t(De);ut({navigation:qe,...xt!==void 0?{actionData:xt}:{}},{flushSync:Xe})}let Ie=await dt(H,_.pathname,A.signal);if(Ie.type==="aborted")return{shortCircuited:!0};if(Ie.type==="error"){if(Ie.partialMatches.length===0){let{matches:Zt,route:Wn}=Ko(m.activeRoutes);return{matches:Zt,loaderData:{},errors:{[Wn.id]:Ie.error}}}let xt=Cr(Ie.partialMatches).route.id;return{matches:Ie.partialMatches,loaderData:{},errors:{[xt]:Ie.error}}}else if(Ie.matches)H=Ie.matches;else{let{error:xt,notFoundMatches:Zt,route:Wn}=gt(_.pathname);return{matches:Zt,loaderData:{},errors:{[Wn.id]:xt}}}}let ot=m.activeRoutes,{dsMatches:rt,revalidatingFetchers:ct}=cy(A,ne,o,h,t.history,j,H,Ht,_,_e?[]:i,_e===!0,V,de,Se,ce,se,ot,p,t.patchRoutesOnNavigation!=null,m.branches,De,Pe);if(O=++Ne,!t.dataStrategy&&!rt.some(Ie=>Ie.shouldLoad)&&!rt.some(Ie=>Ie.route.middleware&&Ie.route.middleware.length>0)&&ct.length===0){let Ie=new Map(j.fetchers),xt=er(Ie);return le(_,{matches:H,loaderData:{},errors:De&&Ca(De[1])?{[De[0]]:De[1].error}:null,...xy(De),...xt?{fetchers:Ie}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(Ze){let Ie={};if(!Ee){Ie.navigation=qe;let xt=_t(De);xt!==void 0&&(Ie.actionData=xt)}ct.length>0&&(Ie.fetchers=Wt(ct)),ut(Ie,{flushSync:Xe})}ct.forEach(Ie=>{St(Ie.key),Ie.controller&&fe.set(Ie.key,Ie.controller)});let Kt=()=>ct.forEach(Ie=>St(Ie.key));pe&&pe.signal.addEventListener("abort",Kt);let{loaderResults:Vn,fetcherResults:En}=await lt(rt,ct,A,_,ne);if(A.signal.aborted)return{shortCircuited:!0};pe&&pe.signal.removeEventListener("abort",Kt),ct.forEach(Ie=>fe.delete(Ie.key));let On=Zo(Vn);if(On)return await ze(A,On.result,!0,{replace:Me}),{shortCircuited:!0};if(On=Zo(En),On)return se.add(On.key),await ze(A,On.result,!0,{replace:Me}),{shortCircuited:!0};let Mn=new Map(j.fetchers),{loaderData:Fn,errors:da}=vy(j,H,Vn,De,ct,En,Mn);_e&&j.errors&&(da={...j.errors,...da});let tr=er(Mn),Jn=Zn(O,Mn),sl=tr||Jn||ct.length>0;return{matches:H,loaderData:Fn,errors:da,...sl?{workingFetchers:Mn}:{}}}function _t(A){if(A&&!Ca(A[1]))return{[A[0]]:A[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function Wt(A){let _=new Map(j.fetchers);return A.forEach(H=>{let K=_.get(H.key),ne=nu(void 0,K?K.data:void 0);_.set(H.key,ne)}),_}async function Yn(A,_,H,K){St(A);let ne=(K&&K.flushSync)===!0,Ee=m.activeRoutes,he=Rh(j.location,j.matches,p,H,_,K==null?void 0:K.relative),je=nl(Ee,he,p,!1,m.branches),be=Ut(je,Ee,he);if(be.active&&be.matches&&(je=be.matches),!je){tn(A,_,Ga(404,{pathname:he}),{flushSync:ne});return}let{path:Me,submission:_e,error:Xe}=oy(!0,he,K);if(Xe){tn(A,_,Xe,{flushSync:ne});return}let De=t.getContext?await t.getContext():new ay,Pe=(K&&K.preventScrollReset)===!0;if(_e&&sa(_e.formMethod)){await ye(A,_,Me,je,De,be.active,ne,Pe,_e,K&&K.defaultShouldRevalidate);return}ce.set(A,{routeId:_,path:Me}),await Oe(A,_,Me,je,De,be.active,ne,Pe,_e)}async function ye(A,_,H,K,ne,Ee,he,je,be,Me){At(),ce.delete(A);let _e=j.fetchers.get(A);Ot(A,I1(be,_e),{flushSync:he});let Xe=new AbortController,De=Qs(t.history,H,Xe.signal,be);if(Ee){let bt=await dt(K,new URL(De.url).pathname,De.signal,A);if(bt.type==="aborted")return;if(bt.type==="error"){tn(A,_,bt.error,{flushSync:he});return}else if(bt.matches)K=bt.matches;else{tn(A,_,Ga(404,{pathname:H}),{flushSync:he});return}}let Pe=oc(K,H);if(!Pe.route.action&&!Pe.route.lazy){let bt=Ga(405,{method:be.formMethod,pathname:H,routeId:_});tn(A,_,bt,{flushSync:he});return}fe.set(A,Xe);let qe=Ne,Ht=Zs(o,h,De,H,K,Pe,i,ne),Ze=await Ge(De,H,Ht,ne,A),ot=Ze[Pe.route.id];if(!ot){for(let bt of Ht)if(Ze[bt.route.id]){ot=Ze[bt.route.id];break}}if(De.signal.aborted){fe.get(A)===Xe&&fe.delete(A);return}if(Se.has(A)){if(as(ot)||Ca(ot)){Ot(A,yl(void 0));return}}else{if(as(ot))if(fe.delete(A),O>qe){Ot(A,yl(void 0));return}else return se.add(A),Ot(A,nu(be)),ze(De,ot,!1,{fetcherSubmission:be,preventScrollReset:je});if(Ca(ot)){tn(A,_,ot.error);return}}let rt=j.navigation.location||j.location,ct=Qs(t.history,rt,Xe.signal),Kt=m.activeRoutes,Vn=j.navigation.state!=="idle"?nl(Kt,j.navigation.location,p,!1,m.branches):j.matches;We(Vn,"Didn't find any matches after fetcher action");let En=++Ne;X.set(A,En);let{dsMatches:On,revalidatingFetchers:Mn}=cy(ct,ne,o,h,t.history,j,Vn,be,rt,i,!1,V,de,Se,ce,se,Kt,p,t.patchRoutesOnNavigation!=null,m.branches,[Pe.route.id,ot],Me),Fn=nu(be,ot.data),da=new Map(j.fetchers);da.set(A,Fn),Mn.filter(bt=>bt.key!==A).forEach(bt=>{let ba=bt.key,Gn=da.get(ba),_r=nu(void 0,Gn?Gn.data:void 0);da.set(ba,_r),St(ba),bt.controller&&fe.set(ba,bt.controller)}),ut({fetchers:da});let tr=()=>Mn.forEach(bt=>St(bt.key));Xe.signal.addEventListener("abort",tr);let{loaderResults:Jn,fetcherResults:sl}=await lt(On,Mn,ct,rt,ne);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",tr),X.delete(A),fe.delete(A),Mn.forEach(bt=>fe.delete(bt.key));let Ie=j.fetchers.has(A),xt=bt=>{if(!Ie)return bt;let ba=new Map(bt.fetchers);return ba.set(A,yl(ot.data)),{...bt,fetchers:ba}},Zt=Zo(Jn);if(Zt)return j=xt(j),ze(ct,Zt.result,!1,{preventScrollReset:je});if(Zt=Zo(sl),Zt)return se.add(Zt.key),j=xt(j),ze(ct,Zt.result,!1,{preventScrollReset:je});let Wn=new Map(j.fetchers);Ie&&Wn.set(A,yl(ot.data));let{loaderData:kn,errors:Tl}=vy(j,Vn,Jn,void 0,Mn,sl,Wn);Zn(En,Wn),j.navigation.state==="loading"&&En>O?(We(re,"Expected pending action"),pe&&pe.abort(),le(j.navigation.location,{matches:Vn,loaderData:kn,errors:Tl,fetchers:Wn})):(ut({errors:Tl,loaderData:yy(j.loaderData,kn,Vn,Tl),fetchers:Wn}),V=!1)}async function Oe(A,_,H,K,ne,Ee,he,je,be){let Me=j.fetchers.get(A);Ot(A,nu(be,Me?Me.data:void 0),{flushSync:he});let _e=new AbortController,Xe=Qs(t.history,H,_e.signal);if(Ee){let ot=await dt(K,new URL(Xe.url).pathname,Xe.signal,A);if(ot.type==="aborted")return;if(ot.type==="error"){tn(A,_,ot.error,{flushSync:he});return}else if(ot.matches)K=ot.matches;else{tn(A,_,Ga(404,{pathname:H}),{flushSync:he});return}}let De=oc(K,H);fe.set(A,_e);let Pe=Ne,qe=Zs(o,h,Xe,H,K,De,i,ne),Ht=await Ge(Xe,H,qe,ne,A),Ze=Ht[De.route.id];if(!Ze){for(let ot of K)if(Ht[ot.route.id]){Ze=Ht[ot.route.id];break}}if(fe.get(A)===_e&&fe.delete(A),!Xe.signal.aborted){if(Se.has(A)){Ot(A,yl(void 0));return}if(as(Ze))if(O>Pe){Ot(A,yl(void 0));return}else{se.add(A),await ze(Xe,Ze,!1,{preventScrollReset:je});return}if(Ca(Ze)){tn(A,_,Ze.error);return}Ot(A,yl(Ze.data))}}async function ze(A,_,H,{submission:K,fetcherSubmission:ne,preventScrollReset:Ee,replace:he}={}){H||(ue==null||ue.resolve(),ue=null),_.response.headers.has("X-Remix-Revalidate")&&(V=!0);let je=_.response.headers.get("Location");We(je,"Expected a Location header on the redirect Response"),je=py(je,new URL(A.url),p,t.history);let be=yu(j.location,je,{_isRedirect:!0});if(r){let qe=!1;if(_.response.headers.has("X-Remix-Reload-Document"))qe=!0;else if(Uh(je)){const Ht=yx(a,je,!0);qe=Ht.origin!==a.location.origin||Pa(Ht.pathname,p)==null}if(qe){he?a.location.replace(je):a.location.assign(je);return}}pe=null;let Me=he===!0||_.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:_e,formAction:Xe,formEncType:De}=j.navigation;!K&&!ne&&_e&&Xe&&De&&(K=Sy(j.navigation));let Pe=K||ne;if(S1.has(_.response.status)&&Pe&&sa(Pe.formMethod))await Xt(Me,be,{submission:{...Pe,formAction:je},preventScrollReset:Ee||xe,enableViewTransition:H?Te:void 0});else{let qe=eh(be,[],Me,K);await Xt(Me,be,{overrideNavigation:qe,fetcherSubmission:ne,preventScrollReset:Ee||xe,enableViewTransition:H?Te:void 0})}}async function Ge(A,_,H,K,ne){var je;let Ee,he={};try{Ee=await O1(g,A,_,H,ne,K,!1)}catch(be){return H.filter(Me=>Me.shouldLoad).forEach(Me=>{he[Me.route.id]={type:"error",error:be}}),he}if(A.signal.aborted)return he;if(!sa(A.method))for(let be of H){if(((je=Ee[be.route.id])==null?void 0:je.type)==="error")break;!Ee.hasOwnProperty(be.route.id)&&!j.loaderData.hasOwnProperty(be.route.id)&&(!j.errors||!j.errors.hasOwnProperty(be.route.id))&&be.shouldCallHandler()&&(Ee[be.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${be.route.id}`)})}for(let[be,Me]of Object.entries(Ee))if(Y1(Me)){let _e=Me.result;he[be]={type:"redirect",response:L1(_e,A,be,H,p)}}else he[be]=await _1(Me);return he}async function lt(A,_,H,K,ne){let Ee=Ge(H,K,A,ne,null),he=Promise.all(_.map(async Me=>{if(Me.matches&&Me.match&&Me.request&&Me.controller){let Xe=(await Ge(Me.request,Me.path,Me.matches,ne,Me.key))[Me.match.route.id];return{[Me.key]:Xe}}else return Promise.resolve({[Me.key]:{type:"error",error:Ga(404,{pathname:Me.path})}})})),je=await Ee,be=(await he).reduce((Me,_e)=>Object.assign(Me,_e),{});return{loaderResults:je,fetcherResults:be}}function At(){V=!0,ce.forEach((A,_)=>{fe.has(_)&&de.add(_),St(_)})}function Ot(A,_,H={}){let K=new Map(j.fetchers);K.set(A,_),ut({fetchers:K},{flushSync:(H&&H.flushSync)===!0})}function tn(A,_,H,K={}){let ne=Cr(j.matches,_),Ee=new Map(j.fetchers);gn(Ee,A),ut({errors:{[ne.route.id]:H},fetchers:Ee},{flushSync:(K&&K.flushSync)===!0})}function It(A){return we.set(A,(we.get(A)||0)+1),Se.has(A)&&Se.delete(A),j.fetchers.get(A)||Ax}function ca(A,_){St(A,_==null?void 0:_.reason),Ot(A,yl(null))}function gn(A,_){let H=j.fetchers.get(_);fe.has(_)&&!(H&&H.state==="loading"&&X.has(_))&&St(_),ce.delete(_),X.delete(_),se.delete(_),Se.delete(_),de.delete(_),A.delete(_)}function J(A){let _=(we.get(A)||0)-1;_<=0?(we.delete(A),Se.add(A)):we.set(A,_),ut({fetchers:new Map(j.fetchers)})}function St(A,_){let H=fe.get(A);H&&(H.abort(_),fe.delete(A))}function Lt(A,_){for(let H of A){let K=_.get(H);We(K,`Expected fetcher: ${H}`);let ne=yl(K.data);_.set(H,ne)}}function er(A){let _=[],H=!1;for(let K of se){let ne=A.get(K);We(ne,`Expected fetcher: ${K}`),ne.state==="loading"&&(se.delete(K),_.push(K),H=!0)}return Lt(_,A),H}function Zn(A,_){let H=[];for(let[K,ne]of X)if(ne<A){let Ee=_.get(K);We(Ee,`Expected fetcher: ${K}`),Ee.state==="loading"&&(St(K),X.delete(K),H.push(K))}return Lt(H,_),H.length>0}function Nl(A,_){let H=j.blockers.get(A)||tu;return He.get(A)!==_&&He.set(A,_),H}function $e(A){j.blockers.delete(A),He.delete(A)}function Qt(A,_){let H=j.blockers.get(A)||tu;We(H.state==="unblocked"&&_.state==="blocked"||H.state==="blocked"&&_.state==="blocked"||H.state==="blocked"&&_.state==="proceeding"||H.state==="blocked"&&_.state==="unblocked"||H.state==="proceeding"&&_.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${_.state}`);let K=new Map(j.blockers);K.set(A,_),ut({blockers:K})}function Yt({currentLocation:A,nextLocation:_,historyAction:H}){if(He.size===0)return;He.size>1&&bn(!1,"A router only supports one blocker at a time");let K=Array.from(He.entries()),[ne,Ee]=K[K.length-1],he=j.blockers.get(ne);if(!(he&&he.state==="proceeding")&&Ee({currentLocation:A,nextLocation:_,historyAction:H}))return ne}function gt(A){let _=Ga(404,{pathname:A}),H=m.activeRoutes,{matches:K,route:ne}=Ko(H);return{notFoundMatches:K,route:ne,error:_}}function zt(A,_,H){if(R=A,N=_,C=H||null,!z&&j.navigation===Wf){z=!0;let K=Pt(j.location,j.matches);K!=null&&ut({restoreScrollPosition:K})}return()=>{R=null,N=null,C=null}}function Rt(A,_){return C&&C(A,_.map(K=>QS(K,j.loaderData)))||A.key}function nn(A,_){if(R&&N){let H=Rt(A,_);R[H]=N()}}function Pt(A,_){if(R){let H=Rt(A,_),K=R[H];if(typeof K=="number")return K}return null}function Ut(A,_,H){if(t.patchRoutesOnNavigation){let K=m.branches;if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:nl(_,H,p,!0,K)}}else return{active:!0,matches:nl(_,H,p,!0,K)||[]}}return{active:!1,matches:null}}async function dt(A,_,H,K){if(!t.patchRoutesOnNavigation)return{type:"success",matches:A};let ne=A;for(;;){let Ee=h;try{await t.patchRoutesOnNavigation({signal:H,path:_,matches:ne,fetcherKey:K,patch:(Me,_e)=>{H.aborted||dy(Me,_e,m,Ee,o,!1)}})}catch(Me){return{type:"error",error:Me,partialMatches:ne}}if(H.aborted)return{type:"aborted"};let he=m.branches,je=nl(m.activeRoutes,_,p,!1,he),be=null;if(je){if(Object.keys(je[0].params).length===0)return{type:"success",matches:je};if(be=nl(m.activeRoutes,_,p,!0,he),!(be&&ne.length<be.length&&Ke(ne,be.slice(0,ne.length))))return{type:"success",matches:je}}if(be||(be=nl(m.activeRoutes,_,p,!0,he)),!be||Ke(ne,be))return{type:"success",matches:null};ne=be}}function Ke(A,_){return A.length===_.length&&A.every((H,K)=>H.route.id===_[K].route.id)}function Sn(A){h={},m.setHmrRoutes(xu(A,o,void 0,h))}function An(A,_,H=!1){dy(A,_,m,h,o,H),m.hasHMRRoutes||ut({})}return D={get basename(){return p},get future(){return x},get state(){return j},get routes(){return m.stableRoutes},get branches(){return m.branches},get manifest(){return h},get window(){return a},initialize:et,subscribe:qt,enableScrollRestoration:zt,navigate:Le,fetch:Yn,revalidate:at,createHref:A=>t.history.createHref(A),encodeLocation:A=>t.history.encodeLocation(A),getFetcher:It,resetFetcher:ca,deleteFetcher:J,dispose:en,getBlocker:Nl,deleteBlocker:$e,patchRoutes:An,_internalFetchControllers:fe,_internalSetRoutes:Sn,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){ut(A)}},t.instrumentations&&(D=h1(D,t.instrumentations.map(A=>A.router).filter(Boolean))),D}function N1(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Rh(t,a,r,i,u,o){let h,m;if(u){h=[];for(let g of a)if(h.push(g),g.route.id===u){m=g;break}}else h=a,m=a[a.length-1];let p=Dc(i||".",Hh(h),Pa(t.pathname,r)||t.pathname,o==="path");if(i==null&&(p.search=t.search,p.hash=t.hash),(i==null||i===""||i===".")&&m){let g=Yh(p.search);if(m.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&g){let x=new URLSearchParams(p.search),b=x.getAll("index");x.delete("index"),b.filter(S=>S).forEach(S=>x.append("index",S));let w=x.toString();p.search=w?`?${w}`:""}}return r!=="/"&&(p.pathname=s1({basename:r,pathname:p.pathname})),Sl(p)}function oy(t,a,r){if(!r||!N1(r))return{path:a};if(r.formMethod&&!G1(r.formMethod))return{path:a,error:Ga(405,{method:r.formMethod})};let i=()=>({path:a,error:Ga(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),h=$x(a);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!sa(o))return i();let b=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((w,[S,R])=>`${w}${S}=${R}
59
+ `,""):String(r.body);return{path:a,submission:{formMethod:o,formAction:h,formEncType:r.formEncType,formData:void 0,json:void 0,text:b}}}else if(r.formEncType==="application/json"){if(!sa(o))return i();try{let b=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:a,submission:{formMethod:o,formAction:h,formEncType:r.formEncType,formData:void 0,json:b,text:void 0}}}catch{return i()}}}We(typeof FormData=="function","FormData is not available in this environment");let m,p;if(r.formData)m=jh(r.formData),p=r.formData;else if(r.body instanceof FormData)m=jh(r.body),p=r.body;else if(r.body instanceof URLSearchParams)m=r.body,p=gy(m);else if(r.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(r.body),p=gy(m)}catch{return i()}let g={formMethod:o,formAction:h,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(sa(g.formMethod))return{path:a,submission:g};let x=El(a);return t&&x.search&&Yh(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Sl(x),submission:g}}function cy(t,a,r,i,u,o,h,m,p,g,x,b,w,S,R,C,N,z,I,q,Q,ee){var B;let te=Q?Ca(Q[1])?Q[1].error:Q[1].data:void 0,D=u.createURL(o.location),j=u.createURL(p),re;if(x&&o.errors){let V=Object.keys(o.errors)[0];re=h.findIndex(de=>de.route.id===V)}else if(Q&&Ca(Q[1])){let V=Q[0];re=h.findIndex(de=>de.route.id===V)-1}let ue=Q?Q[1].statusCode:void 0,xe=ue&&ue>=400,pe={currentUrl:D,currentParams:((B=o.matches[0])==null?void 0:B.params)||{},nextUrl:j,nextParams:h[0].params,...m,actionResult:te,actionStatus:ue},Te=Nu(h),Ae=h.map((V,de)=>{let{route:fe}=V,Ne=null;if(re!=null&&de>re)Ne=!1;else if(fe.lazy)Ne=!0;else if(!$h(fe))Ne=!1;else if(x){let{shouldLoad:ce}=kx(fe,o.loaderData,o.errors);Ne=ce}else T1(o.loaderData,o.matches[de],V)&&(Ne=!0);if(Ne!==null)return Nh(r,i,t,p,Te,V,g,a,Ne);let O=!1;typeof ee=="boolean"?O=ee:xe?O=!1:(b||D.pathname+D.search===j.pathname+j.search||D.search!==j.search||j1(o.matches[de],V))&&(O=!0);let X={...pe,defaultShouldRevalidate:O},se=fu(V,X);return Nh(r,i,t,p,Te,V,g,a,se,X,ee)}),Re=[];return R.forEach((V,de)=>{if(x||!h.some(Se=>Se.route.id===V.routeId)||S.has(de))return;let fe=o.fetchers.get(de),Ne=fe&&fe.state!=="idle"&&fe.data===void 0,O=nl(N,V.path,z??"/",!1,q);if(!O){if(I&&Ne)return;Re.push({key:de,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(C.has(de))return;let X=oc(O,V.path),se=new AbortController,ce=Qs(u,V.path,se.signal),we=null;if(w.has(de))w.delete(de),we=Zs(r,i,ce,V.path,O,X,g,a);else if(Ne)b&&(we=Zs(r,i,ce,V.path,O,X,g,a));else{let Se;typeof ee=="boolean"?Se=ee:xe?Se=!1:Se=b;let He={...pe,defaultShouldRevalidate:Se};fu(X,He)&&(we=Zs(r,i,ce,V.path,O,X,g,a,He))}we&&Re.push({key:de,routeId:V.routeId,path:V.path,matches:we,match:X,request:ce,controller:se})}),{dsMatches:Ae,revalidatingFetchers:Re}}function $h(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function kx(t,a,r){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!$h(t))return{shouldLoad:!1,renderFallback:!1};let i=a!=null&&t.id in a,u=r!=null&&r[t.id]!==void 0;if(!i&&u)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let o=!i&&!u;return{shouldLoad:o,renderFallback:o}}function T1(t,a,r){let i=!a||r.route.id!==a.route.id,u=!t.hasOwnProperty(r.route.id);return i||u}function j1(t,a){let r=t.route.path;return t.pathname!==a.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==a.params["*"]}function fu(t,a){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(a);if(typeof r=="boolean")return r}return a.defaultShouldRevalidate}function dy(t,a,r,i,u,o){let h;if(t){let g=i[t];We(g,`No route found to patch children into: routeId = ${t}`),g.children||(g.children=[]),h=g.children}else h=r.activeRoutes;let m=[],p=[];if(a.forEach(g=>{let x=h.find(b=>_x(g,b));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=xu(m,u,[t||"_","patch",String((h==null?void 0:h.length)||"0")],i);h.push(...g)}if(o&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:x,newRoute:b}=p[g],w=x,[S]=xu([b],u,[],{},!0);Object.assign(w,{element:S.element?S.element:w.element,errorElement:S.errorElement?S.errorElement:w.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:w.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function _x(t,a){var r;return"id"in t&&"id"in a&&t.id===a.id?!0:t.index===a.index&&t.path===a.path&&t.caseSensitive===a.caseSensitive?(!t.children||t.children.length===0)&&(!a.children||a.children.length===0)?!0:((r=t.children)==null?void 0:r.every((i,u)=>{var o;return(o=a.children)==null?void 0:o.some(h=>_x(i,h))}))??!1:!1}var fy=new WeakMap,Lx=({key:t,route:a,manifest:r,mapRouteProperties:i})=>{let u=r[a.id];if(We(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let o=u.lazy[t];if(!o)return;let h=fy.get(u);h||(h={},fy.set(u,h));let m=h[t];if(m)return m;let p=(async()=>{let g=FS(t),b=u[t]!==void 0&&t!=="hasErrorBoundary";if(g)bn(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),h[t]=Promise.resolve();else if(b)bn(!1,`Route "${u.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let w=await o();w!=null&&(Object.assign(u,{[t]:w}),Object.assign(u,i(u)))}typeof u.lazy=="object"&&(u.lazy[t]=void 0,Object.values(u.lazy).every(w=>w===void 0)&&(u.lazy=void 0))})();return h[t]=p,p},hy=new WeakMap;function D1(t,a,r,i,u){let o=r[t.id];if(We(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=hy.get(o);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let b=(async()=>{We(typeof t.lazy=="function","No lazy route function found");let w=await t.lazy(),S={};for(let R in w){let C=w[R];if(C===void 0)continue;let N=XS(R),I=o[R]!==void 0&&R!=="hasErrorBoundary";N?bn(!N,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?bn(!I,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):S[R]=C}Object.assign(o,S),Object.assign(o,{...i(o),lazy:void 0})})();return hy.set(o,b),b.catch(()=>{}),{lazyRoutePromise:b,lazyHandlerPromise:b}}let h=Object.keys(t.lazy),m=[],p;for(let x of h){if(u&&u.includes(x))continue;let b=Lx({key:x,route:t,manifest:r,mapRouteProperties:i});b&&(m.push(b),x===a&&(p=b))}let g=m.length>0?Promise.all(m).then(()=>{}):void 0;return g==null||g.catch(()=>{}),p==null||p.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:p}}async function my(t){let a=t.matches.filter(u=>u.shouldLoad),r={};return(await Promise.all(a.map(u=>u.resolve()))).forEach((u,o)=>{r[a[o].route.id]=u}),r}async function C1(t){return t.matches.some(a=>a.route.middleware)?zx(t,()=>my(t)):my(t)}function zx(t,a){return A1(t,a,i=>{if(F1(i))throw i;return i},$1,r);function r(i,u,o){if(o)return Promise.resolve(Object.assign(o.value,{[u]:{type:"error",result:i}}));{let{matches:h}=t,m=Math.min(Math.max(h.findIndex(g=>g.route.id===u),0),Math.max(h.findIndex(g=>g.shouldCallHandler()),0)),p=Cr(h,h[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:i}})}}}async function A1(t,a,r,i,u){let{matches:o,...h}=t,m=o.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await Ux(h,m,a,r,i,u)}async function Ux(t,a,r,i,u,o,h=0){let{request:m}=t;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let p=a[h];if(!p)return await r();let[g,x]=p,b,w=async()=>{if(b)throw new Error("You may only call `next()` once per middleware");try{return b={value:await Ux(t,a,r,i,u,o,h+1)},b.value}catch(S){return b={value:await o(S,g,b)},b.value}};try{let S=await x(t,w),R=S!=null?i(S):void 0;return u(R)?R:b?R??b.value:(b={value:await w()},b.value)}catch(S){return await o(S,g,b)}}function Hx(t,a,r,i,u){let o=Lx({key:"middleware",route:i.route,manifest:a,mapRouteProperties:t}),h=D1(i.route,sa(r.method)?"action":"loader",a,t,u);return{middleware:o,route:h.lazyRoutePromise,handler:h.lazyHandlerPromise}}function Nh(t,a,r,i,u,o,h,m,p,g=null,x){let b=!1,w=Hx(t,a,r,o,h);return{...o,_lazyPromises:w,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return b=!0,g?typeof x=="boolean"?fu(o,{...g,defaultShouldRevalidate:x}):typeof S=="boolean"?fu(o,{...g,defaultShouldRevalidate:S}):fu(o,g):p},resolve(S){let{lazy:R,loader:C,middleware:N}=o.route,z=b||p||S&&!sa(r.method)&&(R||C),I=N&&N.length>0&&!C&&!R;return z&&(sa(r.method)||!I)?M1({request:r,path:i,pattern:u,match:o,lazyHandlerPromise:w==null?void 0:w.handler,lazyRoutePromise:w==null?void 0:w.route,handlerOverride:S,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function Zs(t,a,r,i,u,o,h,m,p=null){return u.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Hx(t,a,r,g,h),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Nh(t,a,r,i,Nu(u),g,h,m,!0,p))}async function O1(t,a,r,i,u,o,h){i.some(x=>{var b;return(b=x._lazyPromises)==null?void 0:b.middleware})&&await Promise.all(i.map(x=>{var b;return(b=x._lazyPromises)==null?void 0:b.middleware}));let m={request:a,url:Bx(a,r),pattern:Nu(i),params:i[0].params,context:o,matches:i},g=await t({...m,fetcherKey:u,runClientMiddleware:x=>{let b=m;return zx(b,()=>x({...b,fetcherKey:u,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(x=>{var b,w;return[(b=x._lazyPromises)==null?void 0:b.handler,(w=x._lazyPromises)==null?void 0:w.route]}))}catch{}return g}async function M1({request:t,path:a,pattern:r,match:i,lazyHandlerPromise:u,lazyRoutePromise:o,handlerOverride:h,scopedContext:m}){let p,g,x=sa(t.method),b=x?"action":"loader",w=S=>{let R,C=new Promise((I,q)=>R=q);g=()=>R(),t.signal.addEventListener("abort",g);let N=I=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${i.route.id}]`)):S({request:t,url:Bx(t,a),pattern:r,params:i.params,context:m},...I!==void 0?[I]:[]),z=(async()=>{try{return{type:"data",result:await(h?h(q=>N(q)):N())}}catch(I){return{type:"error",result:I}}})();return Promise.race([z,C])};try{let S=x?i.route.action:i.route.loader;if(u||o)if(S){let R,[C]=await Promise.all([w(S).catch(N=>{R=N}),u,o]);if(R!==void 0)throw R;p=C}else{await u;let R=x?i.route.action:i.route.loader;if(R)[p]=await Promise.all([w(R),o]);else if(b==="action"){let C=new URL(t.url),N=C.pathname+C.search;throw Ga(405,{method:t.method,pathname:N,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(S)p=await w(S);else{let R=new URL(t.url),C=R.pathname+R.search;throw Ga(404,{pathname:C})}}catch(S){return{type:"error",result:S}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function k1(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 _1(t){var i,u,o,h,m;let{result:a,type:r}=t;if(qh(a)){let p;try{p=await k1(a)}catch(g){return{type:"error",error:g}}return r==="error"?{type:"error",error:new Ru(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return r==="error"?by(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:(i=a.init)==null?void 0:i.status,headers:(u=a.init)!=null&&u.headers?new Headers(a.init.headers):void 0}:{type:"error",error:B1(a),statusCode:Ws(a)?a.status:void 0,headers:(o=a.init)!=null&&o.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Ws(a)?a.status:void 0}:by(a)?{type:"data",data:a.data,statusCode:(h=a.init)==null?void 0:h.status,headers:(m=a.init)!=null&&m.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function L1(t,a,r,i,u){let o=t.headers.get("Location");if(We(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Uh(o)){let h=i.slice(0,i.findIndex(m=>m.route.id===r)+1);o=Rh(new URL(a.url),h,u,o),t.headers.set("Location",o)}return t}var z1=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Th(t){try{return z1.includes(new URL(t).protocol)}catch{return!1}}function py(t,a,r,i){if(Uh(t)){let u=t,o=zh.test(u)?new URL(vx(u,a.protocol)):new URL(u);if(Th(o.toString()))throw new Error("Invalid redirect location");let h=Pa(o.pathname,r)!=null;if(o.origin===a.origin&&h)return Bh(o.pathname)+o.search+o.hash}try{let u=i.createURL(t);if(Th(u.toString()))throw new Error("Invalid redirect location")}catch{}return t}function Qs(t,a,r,i){let u=t.createURL($x(a)).toString(),o={signal:r};if(i&&sa(i.formMethod)){let{formMethod:h,formEncType:m}=i;o.method=h.toUpperCase(),m==="application/json"?(o.headers=new Headers({"Content-Type":m}),o.body=JSON.stringify(i.json)):m==="text/plain"?o.body=i.text:m==="application/x-www-form-urlencoded"&&i.formData?o.body=jh(i.formData):o.body=i.formData}return new Request(u,o)}function Bx(t,a){let r=new URL(t.url),i=typeof a=="string"?El(a):a;if(r.pathname=i.pathname||"/",i.search){let u=new URLSearchParams(i.search),o=u.getAll("index");u.delete("index");for(let h of o.filter(Boolean))u.append("index",h);r.search=u.size?`?${u.toString()}`:""}else r.search="";return r.hash=i.hash||"",r}function jh(t){let a=new URLSearchParams;for(let[r,i]of t.entries())a.append(r,typeof i=="string"?i:i.name);return a}function gy(t){let a=new FormData;for(let[r,i]of t.entries())a.append(r,i);return a}function U1(t,a,r,i=!1,u=!1){let o={},h=null,m,p=!1,g={},x=r&&Ca(r[1])?r[1].error:void 0;return t.forEach(b=>{if(!(b.route.id in a))return;let w=b.route.id,S=a[w];if(We(!as(S),"Cannot handle redirect results in processLoaderData"),Ca(S)){let R=S.error;if(x!==void 0&&(R=x,x=void 0),h=h||{},u)h[w]=R;else{let C=Cr(t,w);h[C.route.id]==null&&(h[C.route.id]=R)}i||(o[w]=Mx),p||(p=!0,m=Ws(S.error)?S.error.status:500),S.headers&&(g[w]=S.headers)}else o[w]=S.data,S.statusCode&&S.statusCode!==200&&!p&&(m=S.statusCode),S.headers&&(g[w]=S.headers)}),x!==void 0&&r&&(h={[r[0]]:x},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:h,statusCode:m||200,loaderHeaders:g}}function vy(t,a,r,i,u,o,h){let{loaderData:m,errors:p}=U1(a,r,i);return u.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:b,controller:w}=g;if(w&&w.signal.aborted)return;let S=o[x];if(We(S,"Did not find corresponding fetcher result"),Ca(S)){let R=Cr(t.matches,b==null?void 0:b.route.id);p&&p[R.route.id]||(p={...p,[R.route.id]:S.error}),h.delete(x)}else if(as(S))We(!1,"Unhandled fetcher revalidation redirect");else{let R=yl(S.data);h.set(x,R)}}),{loaderData:m,errors:p}}function yy(t,a,r,i){let u=Object.entries(a).filter(([,o])=>o!==Mx).reduce((o,[h,m])=>(o[h]=m,o),{});for(let o of r){let h=o.route.id;if(!a.hasOwnProperty(h)&&t.hasOwnProperty(h)&&o.route.loader&&(u[h]=t[h]),i&&i.hasOwnProperty(h))break}return u}function xy(t){return t?Ca(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Cr(t,a){return(a?t.slice(0,t.findIndex(i=>i.route.id===a)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function Ko(t){let a=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Ga(t,{pathname:a,routeId:r,method:i,type:u,message:o}={}){let h="Unknown Server Error",m="Unknown @remix-run/router error";return t===400?(h="Bad Request",i&&a&&r?m=`You made a ${i} request to "${a}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:u==="invalid-body"&&(m="Unable to encode submission body")):t===403?(h="Forbidden",m=`Route "${r}" does not match URL "${a}"`):t===404?(h="Not Found",m=`No route matches URL "${a}"`):t===405&&(h="Method Not Allowed",i&&a&&r?m=`You made a ${i.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:i&&(m=`Invalid request method "${i.toUpperCase()}"`)),new Ru(t||500,h,new Error(m),!0)}function Zo(t){let a=Object.entries(t);for(let r=a.length-1;r>=0;r--){let[i,u]=a[r];if(as(u))return{key:i,result:u}}}function $x(t){let a=typeof t=="string"?El(t):t;return Sl({...a,hash:""})}function H1(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function B1(t){var a,r;return new Ru(((a=t.init)==null?void 0:a.status)??500,((r=t.init)==null?void 0:r.statusText)??"Internal Server Error",t.data)}function $1(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,r])=>typeof a=="string"&&q1(r))}function q1(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function Y1(t){return qh(t.result)&&Cx.has(t.result.status)}function Ca(t){return t.type==="error"}function as(t){return(t&&t.type)==="redirect"}function by(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function qh(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function V1(t){return Cx.has(t)}function F1(t){return qh(t)&&V1(t.status)&&t.headers.has("Location")}function G1(t){return b1.has(t.toUpperCase())}function sa(t){return y1.has(t.toUpperCase())}function Yh(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function oc(t,a){let r=typeof a=="string"?El(a).search:a.search;if(t[t.length-1].route.index&&Yh(r||""))return t[t.length-1];let i=Rx(t);return i[i.length-1]}function Sy(t){let{formMethod:a,formAction:r,formEncType:i,text:u,formData:o,json:h}=t;if(!(!a||!r||!i)){if(u!=null)return{formMethod:a,formAction:r,formEncType:i,formData:void 0,json:void 0,text:u};if(o!=null)return{formMethod:a,formAction:r,formEncType:i,formData:o,json:void 0,text:void 0};if(h!==void 0)return{formMethod:a,formAction:r,formEncType:i,formData:void 0,json:h,text:void 0}}}function eh(t,a,r,i){return i?{state:"loading",location:t,matches:a,historyAction:r,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:t,matches:a,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function X1(t,a,r,i){return{state:"submitting",location:t,matches:a,historyAction:r,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function nu(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 I1(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 yl(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Q1(t,a){try{let r=t.sessionStorage.getItem(Ox);if(r){let i=JSON.parse(r);for(let[u,o]of Object.entries(i||{}))o&&Array.isArray(o)&&a.set(u,new Set(o||[]))}}catch{}}function P1(t,a){if(a.size>0){let r={};for(let[i,u]of a)r[i]=[...u];try{t.sessionStorage.setItem(Ox,JSON.stringify(r))}catch(i){bn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function Ey(){let t,a,r=new Promise((i,u)=>{t=async o=>{i(o);try{await r}catch{}},a=async o=>{u(o);try{await r}catch{}}});return{promise:r,resolve:t,reject:a}}var is=v.createContext(null);is.displayName="DataRouter";var ai=v.createContext(null);ai.displayName="DataRouterState";var qx=v.createContext(!1);function Yx(){return v.useContext(qx)}var Vh=v.createContext({isTransitioning:!1});Vh.displayName="ViewTransition";var Fh=v.createContext(new Map);Fh.displayName="Fetchers";var K1=v.createContext(null);K1.displayName="Await";var Ka=v.createContext(null);Ka.displayName="Navigation";var Cc=v.createContext(null);Cc.displayName="Location";var rl=v.createContext({outlet:null,matches:[],isDataRoute:!1});rl.displayName="Route";var Gh=v.createContext(null);Gh.displayName="RouteError";var Vx="REACT_ROUTER_ERROR",Z1="REDIRECT",J1="ROUTE_ERROR_RESPONSE";function W1(t){if(t.startsWith(`${Vx}:${Z1}:{`))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 eE(t){if(t.startsWith(`${Vx}:${J1}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Ru(a.status,a.statusText,a.data)}catch{}}function tE(t,{relative:a}={}){We(Tu(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=v.useContext(Ka),{hash:u,pathname:o,search:h}=ju(t,{relative:a}),m=o;return r!=="/"&&(m=o==="/"?r:Qa([r,o])),i.createHref({pathname:m,search:h,hash:u})}function Tu(){return v.useContext(Cc)!=null}function Rl(){return We(Tu(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Cc).location}var Fx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gx(t){v.useContext(Ka).static||v.useLayoutEffect(t)}function Mr(){let{isDataRoute:t}=v.useContext(rl);return t?mE():nE()}function nE(){We(Tu(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(is),{basename:a,navigator:r}=v.useContext(Ka),{matches:i}=v.useContext(rl),{pathname:u}=Rl(),o=JSON.stringify(Hh(i)),h=v.useRef(!1);return Gx(()=>{h.current=!0}),v.useCallback((p,g={})=>{if(bn(h.current,Fx),!h.current)return;if(typeof p=="number"){r.go(p);return}let x=Dc(p,JSON.parse(o),u,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Qa([a,x.pathname])),(g.replace?r.replace:r.push)(x,g.state,g)},[a,r,o,u,t])}var aE=v.createContext(null);function lE(t){let a=v.useContext(rl).outlet;return v.useMemo(()=>a&&v.createElement(aE.Provider,{value:t},a),[a,t])}function ju(t,{relative:a}={}){let{matches:r}=v.useContext(rl),{pathname:i}=Rl(),u=JSON.stringify(Hh(r));return v.useMemo(()=>Dc(t,JSON.parse(u),i,a==="path"),[t,u,i,a])}function rE(t,a,r){We(Tu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(Ka),{matches:u}=v.useContext(rl),o=u[u.length-1],h=o?o.params:{},m=o?o.pathname:"/",p=o?o.pathnameBase:"/",g=o&&o.route;{let N=g&&g.path||"";Px(m,!g||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${N}">) 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="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let x=Rl(),b;b=x;let w=b.pathname||"/",S=w;if(p!=="/"){let N=p.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(N.length).join("/")}let R=r&&r.state.matches.length?r.state.matches.map(N=>Object.assign(N,{route:r.manifest[N.route.id]||N.route})):xx(t,{pathname:S});return bn(g||R!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),bn(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),cE(R&&R.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:Qa([p,i.encodeLocation?i.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:Qa([p,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),u,r)}function sE(){let t=Qx(),a=Ws(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},h=null;return console.error("Error handled by React Router default ErrorBoundary:",t),h=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},a),r?v.createElement("pre",{style:u},r):null,h)}var iE=v.createElement(sE,null),Xx=class extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const r=eE(t.digest);r&&(t=r)}let a=t!==void 0?v.createElement(rl.Provider,{value:this.props.routeContext},v.createElement(Gh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(uE,{error:t},a):a}};Xx.contextType=qx;var th=new WeakMap;function uE({children:t,error:a}){let{basename:r}=v.useContext(Ka);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let i=W1(a.digest);if(i){let u=th.get(a);if(u)throw u;let o=Tx(i.location,r),h=o.absoluteURL||o.to;if(Th(h))throw new Error("Invalid redirect location");if(Nx&&!th.get(a))if(o.isExternal||i.reloadDocument)window.location.href=h;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw th.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return t}function oE({routeContext:t,match:a,children:r}){let i=v.useContext(is);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(rl.Provider,{value:t},r)}function cE(t,a=[],r){let i=r==null?void 0:r.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(a.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let u=t,o=i==null?void 0:i.errors;if(o!=null){let x=u.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);We(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let h=!1,m=-1;if(r&&i){h=i.renderFallback;for(let x=0;x<u.length;x++){let b=u[x];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=x),b.route.id){let{loaderData:w,errors:S}=i,R=b.route.loader&&!w.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||R){r.isStatic&&(h=!0),m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}}let p=r==null?void 0:r.onError,g=i&&p?(x,b)=>{var w,S;p(x,{location:i.location,params:((S=(w=i.matches)==null?void 0:w[0])==null?void 0:S.params)??{},pattern:Nu(i.matches),errorInfo:b})}:void 0;return u.reduceRight((x,b,w)=>{let S,R=!1,C=null,N=null;i&&(S=o&&b.route.id?o[b.route.id]:void 0,C=b.route.errorElement||iE,h&&(m<0&&w===0?(Px("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,N=null):m===w&&(R=!0,N=b.route.hydrateFallbackElement||null)));let z=a.concat(u.slice(0,w+1)),I=()=>{let q;return S?q=C:R?q=N:b.route.Component?q=v.createElement(b.route.Component,null):b.route.element?q=b.route.element:q=x,v.createElement(oE,{match:b,routeContext:{outlet:x,matches:z,isDataRoute:i!=null},children:q})};return i&&(b.route.ErrorBoundary||b.route.errorElement||w===0)?v.createElement(Xx,{location:i.location,revalidation:i.revalidation,component:C,error:S,children:I(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:g}):I()},null)}function Xh(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ix(t){let a=v.useContext(is);return We(a,Xh(t)),a}function Du(t){let a=v.useContext(ai);return We(a,Xh(t)),a}function dE(t){let a=v.useContext(rl);return We(a,Xh(t)),a}function Ac(t){let a=dE(t),r=a.matches[a.matches.length-1];return We(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function fE(){return Ac("useRouteId")}function kr(){let t=Du("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:r,...i}=t.navigation;return i},[t.navigation])}function hE(){let t=Ix("useRevalidator"),a=Du("useRevalidator"),r=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:r,state:a.revalidation}),[r,a.revalidation])}function us(){let t=Du("useLoaderData"),a=Ac("useLoaderData");return t.loaderData[a]}function Cu(t){return Du("useRouteLoaderData").loaderData[t]}function Qx(){var i;let t=v.useContext(Gh),a=Du("useRouteError"),r=Ac("useRouteError");return t!==void 0?t:(i=a.errors)==null?void 0:i[r]}function mE(){let{router:t}=Ix("useNavigate"),a=Ac("useNavigate"),r=v.useRef(!1);return Gx(()=>{r.current=!0}),v.useCallback(async(u,o={})=>{bn(r.current,Fx),r.current&&(typeof u=="number"?await t.navigate(u):await t.navigate(u,{fromRouteId:a,...o}))},[t,a])}var wy={};function Px(t,a,r){!a&&!wy[t]&&(wy[t]=!0,bn(!1,r))}var Ry={};function Ny(t,a){!t&&!Ry[a]&&(Ry[a]=!0,console.warn(a))}var pE="useOptimistic",Ty=kS[pE],gE=()=>{};function vE(t){return Ty?Ty(t):[t,gE]}function yE(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&bn(!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&&bn(!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&&bn(!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 xE=["HydrateFallback","hydrateFallbackElement"],bE=class{constructor(){this.status="pending",this.promise=new Promise((t,a)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",a(r))}})}};function SE({router:t,flushSync:a,onError:r,useTransitions:i}){i=Yx()||i;let[o,h]=v.useState(t.state),[m,p]=vE(o),[g,x]=v.useState(),[b,w]=v.useState({isTransitioning:!1}),[S,R]=v.useState(),[C,N]=v.useState(),[z,I]=v.useState(),q=v.useRef(new Map),Q=v.useCallback((j,{deletedFetchers:re,newErrors:ue,flushSync:xe,viewTransitionOpts:pe})=>{ue&&r&&Object.values(ue).forEach(Ae=>{var Re;return r(Ae,{location:j.location,params:((Re=j.matches[0])==null?void 0:Re.params)??{},pattern:Nu(j.matches)})}),j.fetchers.forEach((Ae,Re)=>{Ae.data!==void 0&&q.current.set(Re,Ae.data)}),re.forEach(Ae=>q.current.delete(Ae)),Ny(xe===!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 Te=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(Ny(pe==null||Te,"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."),!pe||!Te){a&&xe?a(()=>h(j)):i===!1?h(j):v.startTransition(()=>{i===!0&&p(Ae=>jy(Ae,j)),h(j)});return}if(a&&xe){a(()=>{C&&(S==null||S.resolve(),C.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:pe.currentLocation,nextLocation:pe.nextLocation})});let Ae=t.window.document.startViewTransition(()=>{a(()=>h(j))});Ae.finished.finally(()=>{a(()=>{R(void 0),N(void 0),x(void 0),w({isTransitioning:!1})})}),a(()=>N(Ae));return}C?(S==null||S.resolve(),C.skipTransition(),I({state:j,currentLocation:pe.currentLocation,nextLocation:pe.nextLocation})):(x(j),w({isTransitioning:!0,flushSync:!1,currentLocation:pe.currentLocation,nextLocation:pe.nextLocation}))},[t.window,a,C,S,i,p,r]);v.useLayoutEffect(()=>t.subscribe(Q),[t,Q]),v.useEffect(()=>{b.isTransitioning&&!b.flushSync&&R(new bE)},[b]),v.useEffect(()=>{if(S&&g&&t.window){let j=g,re=S.promise,ue=t.window.document.startViewTransition(async()=>{i===!1?h(j):v.startTransition(()=>{i===!0&&p(xe=>jy(xe,j)),h(j)}),await re});ue.finished.finally(()=>{R(void 0),N(void 0),x(void 0),w({isTransitioning:!1})}),N(ue)}},[g,S,t.window,i,p]),v.useEffect(()=>{S&&g&&m.location.key===g.location.key&&S.resolve()},[S,C,m.location,g]),v.useEffect(()=>{!b.isTransitioning&&z&&(x(z.state),w({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}),I(void 0))},[b.isTransitioning,z]);let ee=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:j=>t.navigate(j),push:(j,re,ue)=>t.navigate(j,{state:re,preventScrollReset:ue==null?void 0:ue.preventScrollReset}),replace:(j,re,ue)=>t.navigate(j,{replace:!0,state:re,preventScrollReset:ue==null?void 0:ue.preventScrollReset})}),[t]),te=t.basename||"/",D=v.useMemo(()=>({router:t,navigator:ee,static:!1,basename:te,onError:r}),[t,ee,te,r]);return v.createElement(v.Fragment,null,v.createElement(is.Provider,{value:D},v.createElement(ai.Provider,{value:m},v.createElement(Fh.Provider,{value:q.current},v.createElement(Vh.Provider,{value:b},v.createElement(RE,{basename:te,location:m.location,navigationType:m.historyAction,navigator:ee,useTransitions:i},v.createElement(EE,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:r})))))),null)}function jy(t,a){return{...t,navigation:a.navigation.state!=="idle"?a.navigation:t.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:t.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:t.actionData,fetchers:a.fetchers}}var EE=v.memo(wE);function wE({routes:t,manifest:a,future:r,state:i,isStatic:u,onError:o}){return rE(t,void 0,{manifest:a,state:i,isStatic:u,onError:o})}function Au(t){return lE(t.context)}function RE({basename:t="/",children:a=null,location:r,navigationType:i="POP",navigator:u,static:o=!1,useTransitions:h}){We(!Tu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:m,navigator:u,static:o,useTransitions:h,future:{}}),[m,u,o,h]);typeof r=="string"&&(r=El(r));let{pathname:g="/",search:x="",hash:b="",state:w=null,key:S="default",mask:R}=r,C=v.useMemo(()=>{let N=Pa(g,m);return N==null?null:{location:{pathname:N,search:x,hash:b,state:w,key:S,mask:R},navigationType:i}},[m,g,x,b,w,S,i,R]);return bn(C!=null,`<Router basename="${m}"> is not able to match the URL "${g}${x}${b}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:v.createElement(Ka.Provider,{value:p},v.createElement(Cc.Provider,{children:a,value:C}))}var cc="get",dc="application/x-www-form-urlencoded";function Oc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function NE(t){return Oc(t)&&t.tagName.toLowerCase()==="button"}function TE(t){return Oc(t)&&t.tagName.toLowerCase()==="form"}function jE(t){return Oc(t)&&t.tagName.toLowerCase()==="input"}function DE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function CE(t,a){return t.button===0&&(!a||a==="_self")&&!DE(t)}function Dh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,r)=>{let i=t[r];return a.concat(Array.isArray(i)?i.map(u=>[r,u]):[[r,i]])},[]))}function AE(t,a){let r=Dh(t);return a&&a.forEach((i,u)=>{r.has(u)||a.getAll(u).forEach(o=>{r.append(u,o)})}),r}var Jo=null;function OE(){if(Jo===null)try{new FormData(document.createElement("form"),0),Jo=!1}catch{Jo=!0}return Jo}var ME=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nh(t){return t!=null&&!ME.has(t)?(bn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dc}"`),null):t}function kE(t,a){let r,i,u,o,h;if(TE(t)){let m=t.getAttribute("action");i=m?Pa(m,a):null,r=t.getAttribute("method")||cc,u=nh(t.getAttribute("enctype"))||dc,o=new FormData(t)}else if(NE(t)||jE(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?Pa(p,a):null,r=t.getAttribute("formmethod")||m.getAttribute("method")||cc,u=nh(t.getAttribute("formenctype"))||nh(m.getAttribute("enctype"))||dc,o=new FormData(m,t),!OE()){let{name:g,type:x,value:b}=t;if(x==="image"){let w=g?`${g}.`:"";o.append(`${w}x`,"0"),o.append(`${w}y`,"0")}else g&&o.append(g,b)}}else{if(Oc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=cc,i=null,u=dc,h=t}return o&&u==="text/plain"&&(h=o,o=void 0),{action:i,method:r.toLowerCase(),encType:u,formData:o,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ih(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Kx(t,a,r,i){let u=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:a&&Pa(u.pathname,a)==="/"?u.pathname=`${vc(a)}/_root.${i}`:u.pathname=`${vc(u.pathname)}.${i}`,u}async function _E(t,a){if(t.id in a)return a[t.id];try{let r=await import(t.module);return a[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function LE(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 zE(t,a,r){let i=await Promise.all(t.map(async u=>{let o=a.routes[u.route.id];if(o){let h=await _E(o,r);return h.links?h.links():[]}return[]}));return $E(i.flat(1).filter(LE).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Dy(t,a,r,i,u,o){let h=(p,g)=>r[g]?p.route.id!==r[g].route.id:!0,m=(p,g)=>{var x;return r[g].pathname!==p.pathname||((x=r[g].route.path)==null?void 0:x.endsWith("*"))&&r[g].params["*"]!==p.params["*"]};return o==="assets"?a.filter((p,g)=>h(p,g)||m(p,g)):o==="data"?a.filter((p,g)=>{var b;let x=i.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(h(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let w=p.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function UE(t,a,{includeHydrateFallback:r}={}){return HE(t.map(i=>{let u=a.routes[i.route.id];if(!u)return[];let o=[u.module];return u.clientActionModule&&(o=o.concat(u.clientActionModule)),u.clientLoaderModule&&(o=o.concat(u.clientLoaderModule)),r&&u.hydrateFallbackModule&&(o=o.concat(u.hydrateFallbackModule)),u.imports&&(o=o.concat(u.imports)),o}).flat(1))}function HE(t){return[...new Set(t)]}function BE(t){let a={},r=Object.keys(t).sort();for(let i of r)a[i]=t[i];return a}function $E(t,a){let r=new Set;return new Set(a),t.reduce((i,u)=>{let o=JSON.stringify(BE(u));return r.has(o)||(r.add(o),i.push({key:o,link:u})),i},[])}function Qh(){let t=v.useContext(is);return Ih(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function qE(){let t=v.useContext(ai);return Ih(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Ph=v.createContext(void 0);Ph.displayName="FrameworkContext";function Mc(){let t=v.useContext(Ph);return Ih(t,"You must render this element inside a <HydratedRouter> element"),t}function YE(t,a){let r=v.useContext(Ph),[i,u]=v.useState(!1),[o,h]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:b}=a,w=v.useRef(null);v.useEffect(()=>{if(t==="render"&&h(!0),t==="viewport"){let C=z=>{z.forEach(I=>{h(I.isIntersecting)})},N=new IntersectionObserver(C,{threshold:.5});return w.current&&N.observe(w.current),()=>{N.disconnect()}}},[t]),v.useEffect(()=>{if(i){let C=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(C)}}},[i]);let S=()=>{u(!0)},R=()=>{u(!1),h(!1)};return r?t!=="intent"?[o,w,{}]:[o,w,{onFocus:au(m,S),onBlur:au(p,R),onMouseEnter:au(g,S),onMouseLeave:au(x,R),onTouchStart:au(b,S)}]:[!1,w,{}]}function au(t,a){return r=>{t&&t(r),r.defaultPrevented||a(r)}}function VE({page:t,...a}){let r=Yx(),{nonce:i}=Mc(),{router:u}=Qh(),o=v.useMemo(()=>xx(u.routes,t,u.basename),[u.routes,t,u.basename]);return o?(a.nonce==null&&i&&(a={...a,nonce:i}),r?v.createElement(GE,{page:t,matches:o,...a}):v.createElement(XE,{page:t,matches:o,...a})):null}function FE(t){let{manifest:a,routeModules:r}=Mc(),[i,u]=v.useState([]);return v.useEffect(()=>{let o=!1;return zE(t,a,r).then(h=>{o||u(h)}),()=>{o=!0}},[t,a,r]),i}function GE({page:t,matches:a,...r}){let i=Rl(),{future:u}=Mc(),{basename:o}=Qh(),h=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let m=Kx(t,o,u.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?p=!0:g.push(x.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[o,u.v8_trailingSlashAwareDataRequests,t,i,a]);return v.createElement(v.Fragment,null,h.map(m=>v.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})))}function XE({page:t,matches:a,...r}){let i=Rl(),{future:u,manifest:o,routeModules:h}=Mc(),{basename:m}=Qh(),{loaderData:p,matches:g}=qE(),x=v.useMemo(()=>Dy(t,a,g,o,i,"data"),[t,a,g,o,i]),b=v.useMemo(()=>Dy(t,a,g,o,i,"assets"),[t,a,g,o,i]),w=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let C=new Set,N=!1;if(a.forEach(I=>{var Q;let q=o.routes[I.route.id];!q||!q.hasLoader||(!x.some(ee=>ee.route.id===I.route.id)&&I.route.id in p&&((Q=h[I.route.id])!=null&&Q.shouldRevalidate)||q.hasClientLoader?N=!0:C.add(I.route.id))}),C.size===0)return[];let z=Kx(t,m,u.v8_trailingSlashAwareDataRequests,"data");return N&&C.size>0&&z.searchParams.set("_routes",a.filter(I=>C.has(I.route.id)).map(I=>I.route.id).join(",")),[z.pathname+z.search]},[m,u.v8_trailingSlashAwareDataRequests,p,i,o,x,a,t,h]),S=v.useMemo(()=>UE(b,o),[b,o]),R=FE(b);return v.createElement(v.Fragment,null,w.map(C=>v.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...r})),S.map(C=>v.createElement("link",{key:C,rel:"modulepreload",href:C,...r})),R.map(({key:C,link:N})=>v.createElement("link",{key:C,nonce:r.nonce,...N,crossOrigin:N.crossOrigin??r.crossOrigin})))}function IE(...t){return a=>{t.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var QE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{QE&&(window.__reactRouterVersion="7.18.0")}catch{}function PE(t,a){return R1({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:$S({window:a==null?void 0:a.window}),hydrationData:KE(),routes:t,mapRouteProperties:yE,hydrationRouteProperties:xE,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 KE(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:ZE(t.errors)}),t}function ZE(t){if(!t)return null;let a=Object.entries(t),r={};for(let[i,u]of a)if(u&&u.__type==="RouteErrorResponse")r[i]=new Ru(u.status,u.statusText,u.data,u.internal===!0);else if(u&&u.__type==="Error"){if(typeof u.__subType=="string"&&d1.includes(u.__subType)){let o=window[u.__subType];if(typeof o=="function")try{let h=new o(u.message);h.stack="",r[i]=h}catch{}}if(r[i]==null){let o=new Error(u.message);o.stack="",r[i]=o}}else r[i]=u;return r}var wt=v.forwardRef(function({onClick:a,discover:r="render",prefetch:i="none",relative:u,reloadDocument:o,replace:h,mask:m,state:p,target:g,to:x,preventScrollReset:b,viewTransition:w,defaultShouldRevalidate:S,...R},C){let{basename:N,navigator:z,useTransitions:I}=v.useContext(Ka),q=typeof x=="string"&&jc.test(x),Q=Tx(x,N);x=Q.to;let ee=tE(x,{relative:u}),te=Rl(),D=null;if(m){let Re=Dc(m,[],te.mask?te.mask.pathname:"/",!0);N!=="/"&&(Re.pathname=Re.pathname==="/"?N:Qa([N,Re.pathname])),D=z.createHref(Re)}let[j,re,ue]=YE(i,R),xe=WE(x,{replace:h,mask:m,state:p,target:g,preventScrollReset:b,relative:u,viewTransition:w,defaultShouldRevalidate:S,useTransitions:I});function pe(Re){a&&a(Re),Re.defaultPrevented||xe(Re)}let Te=!(Q.isExternal||o),Ae=v.createElement("a",{...R,...ue,href:(Te?D:void 0)||Q.absoluteURL||ee,onClick:Te?pe:a,ref:IE(C,re),target:g,"data-discover":!q&&r==="render"?"true":void 0});return j&&!q?v.createElement(v.Fragment,null,Ae,v.createElement(VE,{page:ee})):Ae});wt.displayName="Link";var Zx=v.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:i="",end:u=!1,style:o,to:h,viewTransition:m,children:p,...g},x){let b=ju(h,{relative:g.relative}),w=Rl(),S=v.useContext(ai),{navigator:R,basename:C}=v.useContext(Ka),N=S!=null&&aw(b)&&m===!0,z=R.encodeLocation?R.encodeLocation(b).pathname:b.pathname,I=w.pathname,q=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(I=I.toLowerCase(),q=q?q.toLowerCase():null,z=z.toLowerCase()),q&&C&&(q=Pa(q,C)||q);const Q=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let ee=I===z||!u&&I.startsWith(z)&&I.charAt(Q)==="/",te=q!=null&&(q===z||!u&&q.startsWith(z)&&q.charAt(z.length)==="/"),D={isActive:ee,isPending:te,isTransitioning:N},j=ee?a:void 0,re;typeof i=="function"?re=i(D):re=[i,ee?"active":null,te?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ue=typeof o=="function"?o(D):o;return v.createElement(wt,{...g,"aria-current":j,className:re,ref:x,style:ue,to:h,viewTransition:m},typeof p=="function"?p(D):p)});Zx.displayName="NavLink";var ka=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:r,reloadDocument:i,replace:u,state:o,method:h=cc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:w,...S},R)=>{let{useTransitions:C}=v.useContext(Ka),N=Jh(),z=nw(m,{relative:g}),I=h.toLowerCase()==="get"?"get":"post",q=typeof m=="string"&&jc.test(m),Q=ee=>{if(p&&p(ee),ee.defaultPrevented)return;ee.preventDefault();let te=ee.nativeEvent.submitter,D=(te==null?void 0:te.getAttribute("formmethod"))||h,j=()=>N(te||ee.currentTarget,{fetcherKey:a,method:D,navigate:r,replace:u,state:o,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:w});C&&r!==!1?v.startTransition(()=>j()):j()};return v.createElement("form",{ref:R,method:I,action:z,onSubmit:i?p:Q,...S,"data-discover":!q&&t==="render"?"true":void 0})});ka.displayName="Form";function Jx(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kh(t){let a=v.useContext(is);return We(a,Jx(t)),a}function JE(t){let a=v.useContext(ai);return We(a,Jx(t)),a}function WE(t,{target:a,replace:r,mask:i,state:u,preventScrollReset:o,relative:h,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=Mr(),b=Rl(),w=ju(t,{relative:h});return v.useCallback(S=>{if(CE(S,a)){S.preventDefault();let R=r!==void 0?r:Sl(b)===Sl(w),C=()=>x(t,{replace:R,mask:i,state:u,preventScrollReset:o,relative:h,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>C()):C()}},[b,x,w,r,i,u,a,t,o,h,m,p,g])}function Zh(t){bn(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(Dh(t)),r=v.useRef(!1),i=Rl(),u=v.useMemo(()=>AE(i.search,r.current?null:a.current),[i.search]),o=Mr(),h=v.useCallback((m,p)=>{const g=Dh(typeof m=="function"?m(new URLSearchParams(u)):m);r.current=!0,o("?"+g,p)},[o,u]);return[u,h]}var ew=0,tw=()=>`__${String(++ew)}__`;function Jh(){let{router:t}=Kh("useSubmit"),{basename:a}=v.useContext(Ka),r=fE(),i=t.fetch,u=t.navigate;return v.useCallback(async(o,h={})=>{let{action:m,method:p,encType:g,formData:x,body:b}=kE(o,a);if(h.navigate===!1){let w=h.fetcherKey||tw();await i(w,r,h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:b,formMethod:h.method||p,formEncType:h.encType||g,flushSync:h.flushSync})}else await u(h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:b,formMethod:h.method||p,formEncType:h.encType||g,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,u,a,r])}function nw(t,{relative:a}={}){let{basename:r}=v.useContext(Ka),i=v.useContext(rl);We(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),o={...ju(t||".",{relative:a})},h=Rl();if(t==null){o.search=h.search;let m=new URLSearchParams(o.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let x=m.toString();o.search=x?`?${x}`:""}}return(!t||t===".")&&u.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Qa([r,o.pathname])),Sl(o)}function rs({key:t}={}){var ee;let{router:a}=Kh("useFetcher"),r=JE("useFetcher"),i=v.useContext(Fh),u=v.useContext(rl),o=(ee=u.matches[u.matches.length-1])==null?void 0:ee.route.id;We(i,"useFetcher must be used inside a FetchersContext"),We(u,"useFetcher must be used inside a RouteContext"),We(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let h=v.useId(),[m,p]=v.useState(t||h);t&&t!==m&&p(t);let{deleteFetcher:g,getFetcher:x,resetFetcher:b,fetch:w}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let S=v.useCallback(async(te,D)=>{We(o,"No routeId available for fetcher.load()"),await w(m,o,te,D)},[m,o,w]),R=Jh(),C=v.useCallback(async(te,D)=>{await R(te,{...D,navigate:!1,fetcherKey:m})},[m,R]),N=v.useCallback(te=>b(m,te),[b,m]),z=v.useMemo(()=>{let te=v.forwardRef((D,j)=>v.createElement(ka,{...D,navigate:!1,fetcherKey:m,ref:j}));return te.displayName="fetcher.Form",te},[m]),I=r.fetchers.get(m)||Ax,q=i.get(m);return v.useMemo(()=>({Form:z,submit:C,load:S,reset:N,...I,data:q}),[z,C,S,N,I,q])}function aw(t,{relative:a}={}){let r=v.useContext(Vh);We(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Kh("useViewTransitionState"),u=ju(t,{relative:a});if(!r.isTransitioning)return!1;let o=Pa(r.currentLocation.pathname,i)||r.currentLocation.pathname,h=Pa(r.nextLocation.pathname,i)||r.nextLocation.pathname;return gc(u.pathname,h)!=null||gc(u.pathname,o)!=null}var Zl=mx();function lw(t){return v.createElement(SE,{flushSync:Zl.flushSync,...t})}/**
62
+ * @license lucide-react v1.21.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const Wx=(...t)=>t.filter((a,r,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===r).join(" ").trim();/**
67
+ * @license lucide-react v1.21.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const rw=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 sw=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,r,i)=>i?i.toUpperCase():r.toLowerCase());/**
77
+ * @license lucide-react v1.21.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Cy=t=>{const a=sw(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 ah={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 iw=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},uw=v.createContext({}),ow=()=>v.useContext(uw),cw=v.forwardRef(({color:t,size:a,strokeWidth:r,absoluteStrokeWidth:i,className:u="",children:o,iconNode:h,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:b=!1,color:w="currentColor",className:S=""}=ow()??{},R=i??b?Number(r??x)*24/Number(a??g):r??x;return v.createElement("svg",{ref:p,...ah,width:a??g??ah.width,height:a??g??ah.height,stroke:t??w,strokeWidth:R,className:Wx("lucide",S,u),...!o&&!iw(m)&&{"aria-hidden":"true"},...m},[...h.map(([C,N])=>v.createElement(C,N)),...Array.isArray(o)?o:[o]])});/**
92
+ * @license lucide-react v1.21.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const zn=(t,a)=>{const r=v.forwardRef(({className:i,...u},o)=>v.createElement(cw,{ref:o,iconNode:a,className:Wx(`lucide-${rw(Cy(t))}`,`lucide-${t}`,i),...u}));return r.displayName=Cy(t),r};/**
97
+ * @license lucide-react v1.21.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const dw=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],kc=zn("arrow-left",dw);/**
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 fw=[["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"}]],hw=zn("chart-column",fw);/**
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 mw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eb=zn("check",mw);/**
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 pw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ss=zn("chevron-down",pw);/**
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 gw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tb=zn("chevron-right",gw);/**
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 vw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],yw=zn("circle-check",vw);/**
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 xw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],nb=zn("copy",xw);/**
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 bw=[["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"}]],Sw=zn("download",bw);/**
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 Ew=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ww=zn("file-text",Ew);/**
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 Rw=[["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"}]],Nw=zn("git-branch",Rw);/**
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 Tw=[["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"}]],jw=zn("grip-vertical",Tw);/**
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 Dw=[["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"}]],Cw=zn("house",Dw);/**
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 Aw=[["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"}]],yc=zn("layers",Aw);/**
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 Ow=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],ab=zn("list-todo",Ow);/**
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 Mw=[["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"}]],kw=zn("moon",Mw);/**
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 _w=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ei=zn("pencil",_w);/**
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 Lw=[["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"}]],zw=zn("sun",Lw);/**
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 Uw=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ti=zn("trash-2",Uw);/**
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 Hw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bw=zn("x",Hw),$w="/api",qw=120,Yw=40;function _c(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 Lc(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(_c),handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??""}}function zc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[]}}function lb(t){var a,r,i;return{...t,scope:t.scope??[],outOfScope:t.outOfScope??[],decisions:t.decisions??[],globalRules:t.globalRules??[],technologies:t.technologies??[],tools:t.tools??[],acceptedDecisions:t.acceptedDecisions??[],planRoot:t.planRoot??"",projectRoot:t.projectRoot??"",workflowRules:{beforePhaseStart:((a=t.workflowRules)==null?void 0:a.beforePhaseStart)??[],beforeTaskStart:((r=t.workflowRules)==null?void 0:r.beforeTaskStart)??[],afterPhaseComplete:((i=t.workflowRules)==null?void 0:i.afterPhaseComplete)??[]}}}async function Ay(t,a){try{return await fetch(`${$w}${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 on(t,a){let r=await Ay(t,a),i=0;for(;r.status===503&&i<Yw;)await new Promise(u=>setTimeout(u,qw)),i+=1,r=await Ay(t,a);if(!r.ok){const u=await r.text().catch(()=>r.statusText);throw new Response(u||r.statusText,{status:r.status,statusText:r.statusText})}return r.json()}async function rb(){return lb(await on("/project"))}async function Vw(t){return lb(await on("/project",{method:"PUT",body:JSON.stringify(t)}))}async function Fw(){return on("/ui-config")}async function sb(){return(await on("/features")).map(zc)}async function Ou(t){return zc(await on(`/features/${t}`))}async function Gw(t){return zc(await on("/features",{method:"POST",body:JSON.stringify(t)}))}async function ib(t){return zc(await on(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function Xw(t){return on(`/features/${t}`,{method:"DELETE"})}async function Wh(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await on(`/phases${a}`)).map(Lc)}async function Uc(t){return Lc(await on(`/phases/${t}`))}async function Iw(t){return Lc(await on("/phases",{method:"POST",body:JSON.stringify(t)}))}async function ub(t){return Lc(await on(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function Qw(t){return on(`/phases/${t}`,{method:"DELETE"})}async function Pw(t,a){return _c(await on(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function Hc(t){return _c(await on(`/tasks/${t}`))}async function em(t){return _c(await on(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function Kw(t){return on(`/tasks/${t}`,{method:"DELETE"})}async function ob(){return on("/tasks/active")}async function cb(){return(await on("/handoffs")).handoffs??[]}async function Zw(t){return on(`/phases/${t}/handoff`)}async function Jw(t){return on(`/phases/${t}/handoff`,{method:"DELETE"})}async function Ww(t=!1){return on(`/export?full=${t?"true":"false"}`)}async function eR(){return on("/repair",{method:"POST"})}async function lh(t,a){return on("/reorder",{method:"POST",body:JSON.stringify({kind:t,ids:a})})}function tR(){const[t,a]=v.useState(()=>{if(typeof window>"u")return"dark";const r=window.localStorage.getItem("plan-ui-theme");return r||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return v.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),window.localStorage.setItem("plan-ui-theme",t)},[t]),{theme:t,toggleTheme:()=>a(r=>r==="dark"?"light":"dark")}}function nR({liveStatus:t}){const a=t==="live"?{label:"Live",className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",dotClassName:"bg-emerald-500"}:t==="reconnecting"?{label:"Reconnecting…",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-400",dotClassName:"bg-amber-500 animate-pulse"}:t==="disconnected"?{label:"Disconnected",className:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-400",dotClassName:"bg-rose-500"}:{label:"Connecting…",className:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-400",dotClassName:"bg-sky-500 animate-pulse"};return d.jsxs("span",{className:`inline-flex min-h-11 items-center gap-2 rounded-[14px] border px-3 py-2 text-sm font-semibold ${a.className}`,children:[d.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${a.dotClassName}`}),d.jsx("span",{className:"hidden sm:inline",children:a.label})]})}function aR({projectName:t,projectRoot:a,planRoot:r,handoffExists:i,liveStatus:u}){const{theme:o,toggleTheme:h}=tR(),[m,p]=v.useState(!1),[g,x]=v.useState(!1),[b,w]=v.useState(null),S=[{to:"/",label:"Dashboard",icon:Cw},{to:"/features",label:"Features",icon:yc},...i?[{to:"/handoff",label:"Handoff",icon:ww}]:[]];async function R(C){w(C?"full":"summary");try{const z=await Ww(C),I=new Blob([z.markdown],{type:"text/markdown;charset=utf-8"}),q=URL.createObjectURL(I),Q=document.createElement("a");Q.href=q,Q.download=C?"EXPORT-full.md":z.filePath||"EXPORT.md",document.body.appendChild(Q),Q.click(),Q.remove(),URL.revokeObjectURL(q),x(!1)}catch(z){window.alert(`Export failed: ${z instanceof Error?z.message:String(z)}`)}finally{w(null)}}return d.jsx("div",{className:"border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:d.jsxs("div",{className:"page-container flex flex-col gap-3 py-2.5 md:flex-row md:items-center md:justify-between sm:gap-4 sm:py-3",children:[d.jsxs(wt,{to:"/",className:"flex min-w-0 items-center gap-3",children:[d.jsx("div",{className:"surface-card flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] text-[var(--accent)]",children:d.jsx(yc,{className:"h-4 w-4"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"truncate text-sm font-black tracking-tight",children:t??"Agent Plan"}),r?d.jsx("span",{className:"shrink-0 rounded-full border border-[var(--border)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[10px] font-semibold text-[var(--text-subtle)]",children:".planner/"}):null]}),a?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"truncate text-[11px] text-[var(--text-subtle)]",title:a,children:a}),d.jsx("button",{type:"button",onClick:async C=>{C.preventDefault(),C.stopPropagation(),a&&(await navigator.clipboard.writeText(a).catch(()=>{}),p(!0),window.setTimeout(()=>p(!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:m?"Copied":"Copy project path","aria-label":m?"Copied":"Copy project path",children:m?d.jsx(eb,{className:"h-3.5 w-3.5"}):d.jsx(nb,{className:"h-3.5 w-3.5"})})]}):null]})]}),d.jsxs("div",{className:"flex items-center justify-end gap-2 sm:gap-3",children:[d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:d.jsx(nR,{liveStatus:u})}),d.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:S.map(C=>d.jsxs(Zx,{to:C.to,end:C.to==="/",className:({isActive:N})=>`inline-flex min-h-11 items-center gap-2 rounded-[14px] border px-3 py-2 text-sm font-semibold transition sm:px-4 ${N?"border-transparent bg-[var(--accent-soft)] text-[var(--accent)]":"border-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`,children:[d.jsx(C.icon,{className:"h-4 w-4"}),d.jsx("span",{className:"hidden sm:inline",children:C.label})]},C.to))}),d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":g,onClick:()=>x(C=>!C),className:"inline-flex min-h-11 items-center gap-2 rounded-[14px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-3 py-2 text-sm font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:px-4",children:[d.jsx(Sw,{className:"h-4 w-4"}),d.jsx("span",{className:"hidden sm:inline",children:"Export"}),d.jsx(ss,{className:`h-4 w-4 transition-transform ${g?"rotate-180":""}`})]}),g?d.jsxs("div",{role:"menu",className:"absolute right-0 z-50 mt-2 min-w-44 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[d.jsxs("button",{type:"button",role:"menuitem",disabled:b!==null,onClick:()=>void R(!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",b==="summary"?d.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),d.jsxs("button",{type:"button",role:"menuitem",disabled:b!==null,onClick:()=>void R(!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",b==="full"?d.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]}),d.jsx("button",{type:"button",onClick:h,className:"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)]",children:o==="dark"?d.jsx(zw,{className:"h-4 w-4"}):d.jsx(kw,{className:"h-4 w-4"})})]})]})})}function Oy(t,a,r){t.split(`
192
+ `).forEach((u,o)=>{o>0&&a.push(d.jsx("br",{},`${r}-br-${o}`)),u&&a.push(u)})}function lu(t,a){const r=[],i=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let u=0,o=null,h=0;for(;(o=i.exec(t))!==null;)o.index>u&&Oy(t.slice(u,o.index),r,`${a}-${h}`),o[2]&&o[3]?r.push(d.jsx("a",{href:o[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:o[2]},`${a}-link-${h}`)):o[4]?r.push(d.jsx("strong",{className:"font-semibold text-[var(--text)]",children:o[4]},`${a}-strong-${h}`)):o[5]?r.push(d.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:o[5]},`${a}-code-${h}`)):o[6]&&r.push(d.jsx("em",{className:"italic",children:o[6]},`${a}-em-${h}`)),u=i.lastIndex,h+=1;return u<t.length&&Oy(t.slice(u),r,`${a}-tail`),r}function lR(t,a){var u;const r=t.split(`
193
+ `);if(t.startsWith("```")){const o=t.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return d.jsx("pre",{className:"overflow-x-auto rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] p-3 text-sm font-mono text-[var(--text)]",children:d.jsx("code",{children:o})},`code-${a}`)}const i=t.match(/^(#{1,6})\s+(.+)$/);if(i&&i[2]){const o=((u=i[1])==null?void 0:u.length)??1,h=i[2],m=o<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return d.jsx("p",{className:m,children:lu(h,`h-${a}`)},`h-${a}`)}return r.every(o=>/^\s*>\s?/.test(o))?d.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:r.map((o,h)=>d.jsx("div",{children:lu(o.replace(/^\s*>\s?/,""),`bq-${a}-${h}`)},`bq-${a}-${h}`))},`bq-${a}`):/^\s*([-*_])\1{2,}\s*$/.test(t.trim())?d.jsx("hr",{className:"border-[var(--border)]"},`hr-${a}`):r.every(o=>/^\s*[-*]\s+/.test(o))?d.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:r.map((o,h)=>d.jsx("li",{className:"list-disc",children:lu(o.replace(/^\s*[-*]\s+/,""),`ul-${a}-${h}`)},`ul-${a}-${h}`))},`ul-${a}`):r.every(o=>/^\s*\d+\.\s+/.test(o))?d.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:r.map((o,h)=>d.jsx("li",{children:lu(o.replace(/^\s*\d+\.\s+/,""),`ol-${a}-${h}`)},`ol-${a}-${h}`))},`ol-${a}`):d.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:lu(t,`p-${a}`)},`p-${a}`)}function $n({text:t,className:a=""}){if(!(t!=null&&t.trim()))return null;const r=t.trim().split(/\n\s*\n/).filter(Boolean);return d.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${a}`,children:r.map((i,u)=>lR(i,u))})}const My={feature:{soft:"rgba(139, 92, 246, 0.16)",strong:"var(--color-entity-feature)"},phase:{soft:"rgba(6, 182, 212, 0.16)",strong:"var(--color-entity-phase)"},task:{soft:"rgba(16, 185, 129, 0.16)",strong:"var(--color-entity-task)"}};function bl(t){return String(t&&t>0?t:0).padStart(3,"0")}function li({featureNum:t,phaseNum:a,taskNum:r}){const i=[];return t!==void 0&&i.push(`F${bl(t)}`),a!==void 0&&i.push(`P${bl(a)}`),r!==void 0&&i.push(`T${bl(r)}`),i.join("/")}async function rR(t){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(t),!0}catch{}try{const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.top="-1000px",a.style.opacity="0",document.body.appendChild(a),a.focus(),a.select();const r=document.execCommand("copy");return a.remove(),r}catch{return!1}}function os({type:t,number:a}){const r=My[t]||My.task,i=(r==null?void 0:r.soft)||"transparent",u=(r==null?void 0:r.strong)||"inherit";return d.jsxs("span",{className:"shrink-0 inline-flex items-center justify-center font-mono text-[11px] font-bold leading-none px-2 py-1 rounded-md transition-colors",style:{backgroundColor:i,color:u},children:[t?t.charAt(0).toUpperCase():"?",bl(a)]})}function xc({type:t,phaseNum:a,featureNum:r}){return t==="feature"?null:t==="phase"?r===void 0?null:d.jsx("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:d.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",bl(r)]})}):t==="task"?a===void 0?null:d.jsxs("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:[d.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",bl(a)]}),r!==void 0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),d.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",bl(r)]})]})]}):null}function Jl({featureNum:t,phaseNum:a,taskNum:r}){return d.jsxs("span",{className:"entity-path-badge",children:[t!==void 0?d.jsxs("span",{className:"entity-path-seg entity-path-seg--feature",children:["F",bl(t)]}):null,a!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),d.jsxs("span",{className:"entity-path-seg entity-path-seg--phase",children:["P",bl(a)]})]}):null,r!==void 0?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),d.jsxs("span",{className:"entity-path-seg entity-path-seg--task",children:["T",bl(r)]})]}):null]})}function Wl({id:t,children:a}){const[r,i]=v.useState(!1);return d.jsxs("button",{type:"button",onClick:async u=>{u.preventDefault(),u.stopPropagation(),await rR(t)&&(i(!0),window.setTimeout(()=>i(!1),1200))},title:r?"Copied":`Copy ${t}`,"aria-label":r?"Copied":`Copy ${t}`,className:"copyable-id group inline-flex items-center gap-1.5",children:[a,d.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:r?d.jsx(eb,{className:"h-3 w-3 text-emerald-500"}):d.jsx(nb,{className:"h-3 w-3"})})]})}function ri({shortId:t}){return d.jsx(Wl,{id:t,children:d.jsx("span",{className:"short-id-badge",children:t})})}function tm({updatedAt:t}){const a=`Phase handoff pending${t?` · updated ${new Date(t).toLocaleString()}`:""}`;return d.jsxs("a",{href:"/handoff",className:"handoff-badge shrink-0",title:a,"aria-label":a,children:[d.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),d.jsx("path",{d:"M9 2v3h3"}),d.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),d.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}function sR({activeTasks:t}){const a=v.useMemo(()=>{const r=new Set;return t.filter(i=>{const u=`${i.id}-${i.title}-${i.phaseId}`;return r.has(u)?!1:(r.add(u),!0)})},[t]);return a.length===0?null:d.jsx("div",{className:"border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:d.jsx("div",{className:"page-container py-2.5",children:d.jsxs("div",{className:"grid gap-2",children:[d.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["In-progress tasks (",a.length,")"]}),d.jsx("div",{className:"grid grid-cols-1 max-h-[35vh] gap-1.5 overflow-y-auto pr-1",children:a.map(r=>{const i=r.featureId?`/features/${r.featureId}/phases/${r.phaseId}/tasks/${r.id}`:"/features";return d.jsx(wt,{to:i,className:"flex min-w-0 items-center gap-2 rounded-[10px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--accent-soft)] hover:text-[var(--accent)]",children:d.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[r.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 rounded-full bg-[var(--accent)]","aria-label":"In progress"}):null,d.jsx(os,{type:"task",number:r.number}),d.jsx(xc,{type:"task",phaseNum:r.phaseNumber,featureNum:r.featureNumber}),d.jsx("span",{className:"min-w-0 truncate font-medium",children:r.title})]})},r.id)})})]})})})}function iR({project:t,activeTasks:a,handoffExists:r,serverInfo:i}){const u=kr(),[o,h]=v.useState("connecting");return v.useEffect(()=>{const m=p=>{var x;const g=(x=p.detail)==null?void 0:x.status;g&&h(g)};return window.addEventListener("agent-plan:ws-status",m),()=>window.removeEventListener("agent-plan:ws-status",m)},[]),d.jsxs("div",{className:"page-shell",children:[d.jsxs("header",{className:"sticky top-0 z-30",children:[d.jsx(aR,{projectName:t==null?void 0:t.name,projectRoot:t==null?void 0:t.projectRoot,planRoot:t==null?void 0:t.planRoot,handoffExists:r,liveStatus:o}),d.jsx(sR,{activeTasks:a})]}),d.jsxs("div",{className:"page-container py-8",children:[d.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),d.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:d.jsx(wt,{to:"/",className:"hover:text-[var(--accent)]",children:(t==null?void 0:t.name)??"Agent Plan"})}),t!=null&&t.projectRoot?d.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:t.projectRoot,children:t.projectRoot}):null,i?d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[d.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-semibold uppercase tracking-[0.12em] ${i.mode==="lan"?"bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] text-[var(--accent)]":"bg-[var(--surface-elevated)] text-[var(--text-muted)]"}`,children:[d.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full bg-current"}),i.mode==="lan"?"LAN visible":"Local only"]}),d.jsx("a",{href:i.localUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:i.localUrl}),i.lanUrl?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),d.jsx("a",{href:i.lanUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:i.lanUrl})]}):null]}):null,t!=null&&t.description?d.jsx($n,{text:t.description,className:"mt-2 max-w-3xl"}):null]}),u.state!=="idle"?d.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),d.jsx(Au,{})]})]})}const du={create:{key:"n",meta:!0,ctrl:!0},edit:{key:"e",meta:!0,ctrl:!0},delete:{key:"d",meta:!0,ctrl:!0},submit:{key:"Enter",primary:!0}},db=v.createContext(du);function fb(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function uR(t){return typeof t!="string"}function oR(t){return{create:(t==null?void 0:t.create)??du.create,edit:(t==null?void 0:t.edit)??du.edit,delete:(t==null?void 0:t.delete)??du.delete,submit:(t==null?void 0:t.submit)??du.submit}}function cR(t){const a=[],r=fb();t.primary&&a.push(r?"⌘":"Ctrl"),t.meta&&a.push(r?"⌘":"Meta"),t.ctrl&&a.push(r?"⌃":"Ctrl"),t.shift&&a.push(r?"⇧":"Shift"),t.alt&&a.push(r?"⌥":"Alt");const i=t.key==="Backspace"?r?"⌫":"Backspace":t.key==="Enter"?r?"↩":"Enter":t.key.length===1?t.key.toUpperCase():t.key;return a.push(i),r?a.join(""):a.join("+")}function dR(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function fR(t,a){const r=a.key.length===1?a.key.toLowerCase():a.key,i=t.key.length===1?t.key.toLowerCase():t.key,u=fb(),o=a.meta??(a.primary?u:!1),h=a.ctrl??(a.primary?!u:!1);return i===r&&!!o===t.metaKey&&!!h===t.ctrlKey&&!!a.shift===t.shiftKey&&!!a.alt===t.altKey}function hR({shortcuts:t,children:a}){return v.createElement(db.Provider,{value:oR(t)},a)}function hb(t){const a=v.useContext(db);if(t)return uR(t)?t:a[t]}function Kn(t,a,r){const i=hb(t);v.useEffect(()=>{if(!i||(r==null?void 0:r.enabled)===!1)return;const u=o=>{!(r!=null&&r.allowInEditable)&&dR(o.target)||fR(o,i)&&(o.preventDefault(),a())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[a,r==null?void 0:r.allowInEditable,r==null?void 0:r.enabled,i])}const mR=1500,pR=80,gR=12e3,vR=5e3;function yR(){const{revalidate:t}=hE(),a=v.useRef(null),r=v.useRef(null),i=v.useRef(null),u=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{let h=!0;const m=Q=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:Q}}))},p=()=>{r.current!==null&&(window.clearTimeout(r.current),r.current=null)},g=()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null)},x=()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},b=()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},w=()=>{g(),i.current=window.setTimeout(()=>{t()},pR)},S=()=>{!h||r.current!==null||(m("reconnecting"),r.current=window.setTimeout(()=>{r.current=null,N()},mR))},R=()=>{b(),x();const Q=a.current;if(a.current=null,Q&&(Q.readyState===WebSocket.OPEN||Q.readyState===WebSocket.CONNECTING))try{Q.close()}catch{}},C=()=>{b(),x(),u.current=window.setInterval(()=>{const Q=a.current;if(!(!Q||Q.readyState!==WebSocket.OPEN)){try{Q.send(JSON.stringify({type:"ping"}))}catch{R(),S();return}x(),o.current=window.setTimeout(()=>{R(),S()},vR)}},gR)},N=()=>{if(!h)return;const Q=a.current;if(Q&&(Q.readyState===WebSocket.OPEN||Q.readyState===WebSocket.CONNECTING))return;m(r.current!==null?"reconnecting":"connecting"),p();const ee=window.location.protocol==="https:"?"wss":"ws",te=new WebSocket(`${ee}://${window.location.host}/ws`);a.current=te,te.onopen=()=>{p(),m("live"),C()},te.onmessage=D=>{x();try{const j=JSON.parse(D.data);if(!j.type||j.type==="pong"||j.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:j})),j.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":w();break;default:break}}catch{}},te.onclose=()=>{b(),x(),a.current===te&&(a.current=null),h&&S()},te.onerror=()=>{try{te.close()}catch{}}},z=()=>{const Q=a.current;(!Q||Q.readyState===WebSocket.CLOSED||Q.readyState===WebSocket.CLOSING)&&N()},I=()=>{document.visibilityState==="visible"&&z()},q=()=>{z()};return m("connecting"),N(),window.addEventListener("online",q),document.addEventListener("visibilitychange",I),()=>{h=!1,m("disconnected"),window.removeEventListener("online",q),document.removeEventListener("visibilitychange",I),p(),g(),b(),x(),R()}},[t]),null}async function xR(){const[t,a,r,i]=await Promise.all([rb(),Fw(),ob(),cb()]);return{project:t,uiConfig:a,activeTasks:r,handoffs:i}}function bR(){const{project:t,uiConfig:a,activeTasks:r,handoffs:i}=us();return v.useEffect(()=>{var u;document.title=(u=t==null?void 0:t.name)!=null&&u.trim()?`${t.name} · Agent Plan`:"Agent Plan"},[t==null?void 0:t.name]),d.jsxs(hR,{shortcuts:a.shortcuts,children:[d.jsx(yR,{}),d.jsx(iR,{project:t,activeTasks:r,handoffExists:i.length>0,serverInfo:a.server})]})}function SR(){const t=Qx(),a=Ws(t),r=a&&t.status===503,i=a?r?"Planner web UI disconnected":`Request failed (${t.status})`:"Planner web UI unavailable",u=a?t.data||t.statusText:t instanceof Error?t.message:"The planner web UI could not reach its local server.";return v.useEffect(()=>{document.title="Agent Plan"},[]),d.jsx("div",{className:"page-shell min-h-screen",children:d.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:d.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[d.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),d.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:i}),d.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(u)}),d.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:r?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),d.jsx("p",{children:"What to do:"}),d.jsxs("ul",{className:"grid gap-1 pl-5",children:[d.jsxs("li",{className:"list-disc",children:["restart Pi or run ",d.jsx("code",{children:"planner-web start"})]}),d.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),d.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),d.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),d.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:d.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex min-h-11 items-center rounded-[14px] bg-[var(--accent)] px-4 py-2 text-sm font-semibold text-white transition hover:opacity-90",children:"Reload page"})})]})})})}async function ER(){const[t,a,r]=await Promise.all([sb(),Wh(),ob()]);return{features:t,phases:a,activeTasks:r}}function wR({shortcut:t}){const a=hb(t);return a?d.jsx("span",{className:"rounded-md border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[11px] font-bold tracking-wide text-[var(--text-muted)]",children:cR(a)}):null}const RR={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 yt({variant:t="secondary",className:a="",children:r,shortcut:i,...u}){return d.jsxs("button",{className:`inline-flex min-h-11 items-center justify-center gap-2 rounded-[14px] border px-4 py-2 text-sm font-semibold transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)] disabled:cursor-not-allowed disabled:opacity-60 ${RR[t]} ${a}`,...u,children:[d.jsx("span",{children:r}),i?d.jsx(wR,{shortcut:i}):null]})}function qn({className:t="",children:a,...r}){return d.jsx("div",{className:`surface-card p-6 ${t}`,...r,children:a})}function NR({decisions:t}){return t.length===0?null:d.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[d.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",t.length,")"]}),d.jsx("div",{className:"mt-4 grid gap-3",children:t.map(a=>d.jsxs("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[d.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?d.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",d.jsx($n,{text:a.decision})]}):null,a.rationale?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",d.jsx($n,{text:a.rationale})]}):null,a.implementationNotes?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",d.jsx($n,{text:a.implementationNotes})]}):null]},a.id))})]})}function TR({project:t}){var x,b,w;const a=t.scope??[],r=t.outOfScope??[],i=t.technologies??[],u=t.tools??[],o=t.globalRules??[],h=t.decisions??[],m=t.acceptedDecisions??[],p={beforePhaseStart:((x=t.workflowRules)==null?void 0:x.beforePhaseStart)??[],beforeTaskStart:((b=t.workflowRules)==null?void 0:b.beforeTaskStart)??[],afterPhaseComplete:((w=t.workflowRules)==null?void 0:w.afterPhaseComplete)??[]};return a.length>0||r.length>0||i.length>0||u.length>0||o.length>0||h.length>0||m.length>0||p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?d.jsx(qn,{className:"grid gap-4",children:d.jsxs("details",{className:"group",children:[d.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"AI Consolidated Context"}),d.jsxs("div",{className:"mt-4 grid gap-4",children:[a.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"In scope"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:a.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,r.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Out of scope"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:r.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,i.length>0||u.length>0?d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Technologies"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:i.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,u.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Tools"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:u.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null]}):null,o.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Global rules"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:o.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?d.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[d.jsx("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:"Workflow rules"}),d.jsxs("div",{className:"mt-4 grid gap-4 text-sm text-[var(--text-muted)]",children:[p.beforePhaseStart.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before phase start"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforePhaseStart.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.beforeTaskStart.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before task start"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforeTaskStart.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.afterPhaseComplete.length>0?d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"After phase complete"}),d.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.afterPhaseComplete.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null]})]}):null,h.length>0?d.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[d.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Legacy decisions (",h.length,")"]}),d.jsx("ul",{className:"mt-4 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:h.map(S=>d.jsx("li",{className:"list-disc",children:S},S))})]}):null,d.jsx(NR,{decisions:m})]})]})}):null}function Oa({status:t}){return d.jsx("span",{className:`status-chip status-${t}`,children:t})}function jR(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function DR({features:t,phases:a}){const r=v.useMemo(()=>{const i=new Map(t.map(u=>[u.id,u.name]));return a.flatMap(u=>u.tasks.filter(o=>o.status==="done").map(o=>({task:o,phase:u,feature:t.find(h=>h.id===u.featureId),featureName:u.featureId?i.get(u.featureId)??u.featureId:"Unlinked feature",completedAt:o.completedAt||o.updatedAt}))).sort((u,o)=>o.completedAt.localeCompare(u.completedAt)).slice(0,3)},[t,a]);return d.jsxs(qn,{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),d.jsx("div",{className:"grid gap-3",children:r.length>0?r.map(({task:i,phase:u,feature:o,featureName:h,completedAt:m})=>d.jsxs(wt,{to:u.featureId?`/features/${u.featureId}/phases/${u.id}/tasks/${i.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(os,{type:"task",number:i.number}),d.jsx(xc,{type:"task",phaseNum:u.number,featureNum:o==null?void 0:o.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Oa,{status:i.status})})]}),d.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:i.title}),d.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[d.jsx(xc,{type:"phase",featureNum:o==null?void 0:o.number}),d.jsxs("span",{className:"min-w-0 truncate",children:[h," · ",u.title]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",jR(m)]})]},i.id)):d.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const CR=4200;function AR(t){return t.reduce((a,r)=>a+r.tasks.length,0)}function OR(t){return t.reduce((a,r)=>a+r.tasks.filter(i=>i.status==="done").length,0)}function MR(t){return String(t&&t>0?t:0).padStart(3,"0")}function kR(t,a){const r=new Map;for(const i of a){if(!i.featureId)continue;const u=r.get(i.featureId)??[];u.push(i),r.set(i.featureId,u)}return t.map(i=>{const u=r.get(i.id)??[],o=u.reduce((g,x)=>g+x.tasks.length,0),h=u.reduce((g,x)=>g+x.tasks.filter(b=>b.status==="done").length,0),m=u.map(g=>{const x=[...g.tasks].sort((w,S)=>(w.priority??0)-(S.priority??0)||w.number-S.number||w.createdAt.localeCompare(S.createdAt)||w.title.localeCompare(S.title)),b=x.some(w=>w.status==="in-progress");return{phase:g,totalTasks:g.tasks.length,doneTasks:g.tasks.filter(w=>w.status==="done").length,allTasks:x,hasActiveTask:b}}),p=m.some(({phase:g,allTasks:x})=>g.status==="in-progress"||g.status==="discovery"||x.some(b=>b.status==="in-progress"));return{feature:i,totalTasks:o,doneTasks:h,allPhases:m.sort((g,x)=>(g.phase.priority??0)-(x.phase.priority??0)||g.phase.number-x.phase.number),hasActiveTask:m.some(g=>g.hasActiveTask),isActive:p}}).sort((i,u)=>(i.feature.priority??0)-(u.feature.priority??0)||i.feature.number-u.feature.number||i.feature.name.localeCompare(u.feature.name))}function Wo({title:t,value:a,valueSuffix:r,subtitle:i,icon:u,valueClassName:o,iconClassName:h}){return d.jsxs(qn,{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:t}),d.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[d.jsx("p",{className:`text-3xl font-black tracking-tight ${o??"text-[var(--text)]"}`,children:a}),r?d.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:r}):null]}),d.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:i})]}),d.jsx("div",{className:`surface-card flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] bg-[var(--accent-soft)] ${h??"text-[var(--accent)]"}`,children:u})]})}function ky(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 _R({features:t,phases:a}){const r=t.filter(x=>x.status==="done").length,i=Math.max(t.length-r,0),u=a.filter(x=>x.status==="done").length,o=Math.max(a.length-u,0),h=AR(a),m=OR(a),p=Math.max(h-m,0),g=h>0?Math.round(m/h*100):0;return d.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[d.jsx(Wo,{title:"Features",value:String(t.length),valueSuffix:"total",subtitle:d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[r," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[i," left"]})]}),icon:d.jsx(yc,{className:"h-4 w-4"})}),d.jsx(Wo,{title:"Phases",value:String(a.length),valueSuffix:"total",subtitle:d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[u," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[o," left"]})]}),icon:d.jsx(hw,{className:"h-4 w-4"})}),d.jsx(Wo,{title:"Tasks",value:String(h),valueSuffix:"total",subtitle:d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[m," done"]}),d.jsx("span",{children:" · "}),d.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[p," left"]})]}),icon:d.jsx(ab,{className:"h-4 w-4"})}),d.jsx(Wo,{title:"Completion",value:`${g}%`,subtitle:"Task completion rate",valueClassName:ky(g),iconClassName:ky(g),icon:d.jsx(yw,{className:"h-4 w-4"})})]})}function LR(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return v.useMemo(()=>i=>{a.forEach(u=>u(i))},a)}const Bc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function si(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function nm(t){return"nodeType"in t}function oa(t){var a,r;return t?si(t)?t:nm(t)&&(a=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?a:window:window}function am(t){const{Document:a}=oa(t);return t instanceof a}function Mu(t){return si(t)?!1:t instanceof oa(t).HTMLElement}function mb(t){return t instanceof oa(t).SVGElement}function ii(t){return t?si(t)?t.document:nm(t)?am(t)?t:Mu(t)||mb(t)?t.ownerDocument:document:document:document}const al=Bc?v.useLayoutEffect:v.useEffect;function $c(t){const a=v.useRef(t);return al(()=>{a.current=t}),v.useCallback(function(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return a.current==null?void 0:a.current(...i)},[])}function zR(){const t=v.useRef(null),a=v.useCallback((i,u)=>{t.current=setInterval(i,u)},[]),r=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[a,r]}function bu(t,a){a===void 0&&(a=[t]);const r=v.useRef(t);return al(()=>{r.current!==t&&(r.current=t)},a),r}function ku(t,a){const r=v.useRef();return v.useMemo(()=>{const i=t(r.current);return r.current=i,i},[...a])}function bc(t){const a=$c(t),r=v.useRef(null),i=v.useCallback(u=>{u!==r.current&&(a==null||a(u,r.current)),r.current=u},[]);return[r,i]}function Sc(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let rh={};function _u(t,a){return v.useMemo(()=>{if(a)return a;const r=rh[t]==null?0:rh[t]+1;return rh[t]=r,t+"-"+r},[t,a])}function pb(t){return function(a){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return i.reduce((o,h)=>{const m=Object.entries(h);for(const[p,g]of m){const x=o[p];x!=null&&(o[p]=x+t*g)}return o},{...a})}}const Js=pb(1),Ec=pb(-1);function UR(t){return"clientX"in t&&"clientY"in t}function qc(t){if(!t)return!1;const{KeyboardEvent:a}=oa(t.target);return a&&t instanceof a}function HR(t){if(!t)return!1;const{TouchEvent:a}=oa(t.target);return a&&t instanceof a}function wc(t){if(HR(t)){if(t.touches&&t.touches.length){const{clientX:a,clientY:r}=t.touches[0];return{x:a,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:a,clientY:r}=t.changedTouches[0];return{x:a,y:r}}}return UR(t)?{x:t.clientX,y:t.clientY}:null}const Or=Object.freeze({Translate:{toString(t){if(!t)return;const{x:a,y:r}=t;return"translate3d("+(a?Math.round(a):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:a,scaleY:r}=t;return"scaleX("+a+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[Or.Translate.toString(t),Or.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:a,duration:r,easing:i}=t;return a+" "+r+"ms "+i}}}),_y="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function BR(t){return t.matches(_y)?t:t.querySelector(_y)}const $R={display:"none"};function qR(t){let{id:a,value:r}=t;return un.createElement("div",{id:a,style:$R},r)}function YR(t){let{id:a,announcement:r,ariaLiveType:i="assertive"}=t;const u={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return un.createElement("div",{id:a,style:u,role:"status","aria-live":i,"aria-atomic":!0},r)}function VR(){const[t,a]=v.useState("");return{announce:v.useCallback(i=>{i!=null&&a(i)},[]),announcement:t}}const gb=v.createContext(null);function FR(t){const a=v.useContext(gb);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(t)},[t,a])}function GR(){const[t]=v.useState(()=>new Set),a=v.useCallback(i=>(t.add(i),()=>t.delete(i)),[t]);return[v.useCallback(i=>{let{type:u,event:o}=i;t.forEach(h=>{var m;return(m=h[u])==null?void 0:m.call(h,o)})},[t]),a]}const XR={draggable:`
194
+ To pick up a draggable item, press the space bar.
195
+ While dragging, use the arrow keys to move the item.
196
+ Press space again to drop the item in its new position, or press escape to cancel.
197
+ `},IR={onDragStart(t){let{active:a}=t;return"Picked up draggable item "+a.id+"."},onDragOver(t){let{active:a,over:r}=t;return r?"Draggable item "+a.id+" was moved over droppable area "+r.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(t){let{active:a,over:r}=t;return r?"Draggable item "+a.id+" was dropped over droppable area "+r.id:"Draggable item "+a.id+" was dropped."},onDragCancel(t){let{active:a}=t;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function QR(t){let{announcements:a=IR,container:r,hiddenTextDescribedById:i,screenReaderInstructions:u=XR}=t;const{announce:o,announcement:h}=VR(),m=_u("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),FR(v.useMemo(()=>({onDragStart(b){let{active:w}=b;o(a.onDragStart({active:w}))},onDragMove(b){let{active:w,over:S}=b;a.onDragMove&&o(a.onDragMove({active:w,over:S}))},onDragOver(b){let{active:w,over:S}=b;o(a.onDragOver({active:w,over:S}))},onDragEnd(b){let{active:w,over:S}=b;o(a.onDragEnd({active:w,over:S}))},onDragCancel(b){let{active:w,over:S}=b;o(a.onDragCancel({active:w,over:S}))}}),[o,a])),!p)return null;const x=un.createElement(un.Fragment,null,un.createElement(qR,{id:i,value:u.draggable}),un.createElement(YR,{id:m,announcement:h}));return r?Zl.createPortal(x,r):x}var Ln;(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"})(Ln||(Ln={}));function Rc(){}function PR(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function KR(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return v.useMemo(()=>[...a].filter(i=>i!=null),[...a])}const ll=Object.freeze({x:0,y:0});function ZR(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function JR(t,a){const r=wc(t);if(!r)return"0 0";const i={x:(r.x-a.left)/a.width*100,y:(r.y-a.top)/a.height*100};return i.x+"% "+i.y+"%"}function WR(t,a){let{data:{value:r}}=t,{data:{value:i}}=a;return r-i}function eN(t,a){let{data:{value:r}}=t,{data:{value:i}}=a;return i-r}function tN(t,a){if(!t||t.length===0)return null;const[r]=t;return r[a]}function Ly(t,a,r){return a===void 0&&(a=t.left),r===void 0&&(r=t.top),{x:a+t.width*.5,y:r+t.height*.5}}const nN=t=>{let{collisionRect:a,droppableRects:r,droppableContainers:i}=t;const u=Ly(a,a.left,a.top),o=[];for(const h of i){const{id:m}=h,p=r.get(m);if(p){const g=ZR(Ly(p),u);o.push({id:m,data:{droppableContainer:h,value:g}})}}return o.sort(WR)};function aN(t,a){const r=Math.max(a.top,t.top),i=Math.max(a.left,t.left),u=Math.min(a.left+a.width,t.left+t.width),o=Math.min(a.top+a.height,t.top+t.height),h=u-i,m=o-r;if(i<u&&r<o){const p=a.width*a.height,g=t.width*t.height,x=h*m,b=x/(p+g-x);return Number(b.toFixed(4))}return 0}const lN=t=>{let{collisionRect:a,droppableRects:r,droppableContainers:i}=t;const u=[];for(const o of i){const{id:h}=o,m=r.get(h);if(m){const p=aN(m,a);p>0&&u.push({id:h,data:{droppableContainer:o,value:p}})}}return u.sort(eN)};function rN(t,a,r){return{...t,scaleX:a&&r?a.width/r.width:1,scaleY:a&&r?a.height/r.height:1}}function vb(t,a){return t&&a?{x:t.left-a.left,y:t.top-a.top}:ll}function sN(t){return function(r){for(var i=arguments.length,u=new Array(i>1?i-1:0),o=1;o<i;o++)u[o-1]=arguments[o];return u.reduce((h,m)=>({...h,top:h.top+t*m.y,bottom:h.bottom+t*m.y,left:h.left+t*m.x,right:h.right+t*m.x}),{...r})}}const iN=sN(1);function yb(t){if(t.startsWith("matrix3d(")){const a=t.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(t.startsWith("matrix(")){const a=t.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function uN(t,a,r){const i=yb(a);if(!i)return t;const{scaleX:u,scaleY:o,x:h,y:m}=i,p=t.left-h-(1-u)*parseFloat(r),g=t.top-m-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),x=u?t.width/u:t.width,b=o?t.height/o:t.height;return{width:x,height:b,top:g,right:p+x,bottom:g+b,left:p}}const oN={ignoreTransform:!1};function ui(t,a){a===void 0&&(a=oN);let r=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=oa(t).getComputedStyle(t);g&&(r=uN(r,g,x))}const{top:i,left:u,width:o,height:h,bottom:m,right:p}=r;return{top:i,left:u,width:o,height:h,bottom:m,right:p}}function zy(t){return ui(t,{ignoreTransform:!0})}function cN(t){const a=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:a,bottom:r,width:a,height:r}}function dN(t,a){return a===void 0&&(a=oa(t).getComputedStyle(t)),a.position==="fixed"}function fN(t,a){a===void 0&&(a=oa(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(u=>{const o=a[u];return typeof o=="string"?r.test(o):!1})}function lm(t,a){const r=[];function i(u){if(a!=null&&r.length>=a||!u)return r;if(am(u)&&u.scrollingElement!=null&&!r.includes(u.scrollingElement))return r.push(u.scrollingElement),r;if(!Mu(u)||mb(u)||r.includes(u))return r;const o=oa(t).getComputedStyle(u);return u!==t&&fN(u,o)&&r.push(u),dN(u,o)?r:i(u.parentNode)}return t?i(t):r}function xb(t){const[a]=lm(t,1);return a??null}function sh(t){return!Bc||!t?null:si(t)?t:nm(t)?am(t)||t===ii(t).scrollingElement?window:Mu(t)?t:null:null}function bb(t){return si(t)?t.scrollX:t.scrollLeft}function Sb(t){return si(t)?t.scrollY:t.scrollTop}function Ch(t){return{x:bb(t),y:Sb(t)}}var Hn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Hn||(Hn={}));function Eb(t){return!Bc||!t?!1:t===document.scrollingElement}function wb(t){const a={x:0,y:0},r=Eb(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},u=t.scrollTop<=a.y,o=t.scrollLeft<=a.x,h=t.scrollTop>=i.y,m=t.scrollLeft>=i.x;return{isTop:u,isLeft:o,isBottom:h,isRight:m,maxScroll:i,minScroll:a}}const hN={x:.2,y:.2};function mN(t,a,r,i,u){let{top:o,left:h,right:m,bottom:p}=r;i===void 0&&(i=10),u===void 0&&(u=hN);const{isTop:g,isBottom:x,isLeft:b,isRight:w}=wb(t),S={x:0,y:0},R={x:0,y:0},C={height:a.height*u.y,width:a.width*u.x};return!g&&o<=a.top+C.height?(S.y=Hn.Backward,R.y=i*Math.abs((a.top+C.height-o)/C.height)):!x&&p>=a.bottom-C.height&&(S.y=Hn.Forward,R.y=i*Math.abs((a.bottom-C.height-p)/C.height)),!w&&m>=a.right-C.width?(S.x=Hn.Forward,R.x=i*Math.abs((a.right-C.width-m)/C.width)):!b&&h<=a.left+C.width&&(S.x=Hn.Backward,R.x=i*Math.abs((a.left+C.width-h)/C.width)),{direction:S,speed:R}}function pN(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:h}=window;return{top:0,left:0,right:o,bottom:h,width:o,height:h}}const{top:a,left:r,right:i,bottom:u}=t.getBoundingClientRect();return{top:a,left:r,right:i,bottom:u,width:t.clientWidth,height:t.clientHeight}}function Rb(t){return t.reduce((a,r)=>Js(a,Ch(r)),ll)}function gN(t){return t.reduce((a,r)=>a+bb(r),0)}function vN(t){return t.reduce((a,r)=>a+Sb(r),0)}function Nb(t,a){if(a===void 0&&(a=ui),!t)return;const{top:r,left:i,bottom:u,right:o}=a(t);xb(t)&&(u<=0||o<=0||r>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const yN=[["x",["left","right"],gN],["y",["top","bottom"],vN]];class rm{constructor(a,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=lm(r),u=Rb(i);this.rect={...a},this.width=a.width,this.height=a.height;for(const[o,h,m]of yN)for(const p of h)Object.defineProperty(this,p,{get:()=>{const g=m(i),x=u[o]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hu{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...r)})},this.target=a}add(a,r,i){var u;(u=this.target)==null||u.addEventListener(a,r,i),this.listeners.push([a,r,i])}}function xN(t){const{EventTarget:a}=oa(t);return t instanceof a?t:ii(t)}function ih(t,a){const r=Math.abs(t.x),i=Math.abs(t.y);return typeof a=="number"?Math.sqrt(r**2+i**2)>a:"x"in a&&"y"in a?r>a.x&&i>a.y:"x"in a?r>a.x:"y"in a?i>a.y:!1}var Xa;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Xa||(Xa={}));function Uy(t){t.preventDefault()}function bN(t){t.stopPropagation()}var Ct;(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"})(Ct||(Ct={}));const Tb={start:[Ct.Space,Ct.Enter],cancel:[Ct.Esc],end:[Ct.Space,Ct.Enter,Ct.Tab]},SN=(t,a)=>{let{currentCoordinates:r}=a;switch(t.code){case Ct.Right:return{...r,x:r.x+25};case Ct.Left:return{...r,x:r.x-25};case Ct.Down:return{...r,y:r.y+25};case Ct.Up:return{...r,y:r.y-25}}};class jb{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:r}}=a;this.props=a,this.listeners=new hu(ii(r)),this.windowListeners=new hu(oa(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:r}=this.props,i=a.node.current;i&&Nb(i),r(ll)}handleKeyDown(a){if(qc(a)){const{active:r,context:i,options:u}=this.props,{keyboardCodes:o=Tb,coordinateGetter:h=SN,scrollBehavior:m="smooth"}=u,{code:p}=a;if(o.end.includes(p)){this.handleEnd(a);return}if(o.cancel.includes(p)){this.handleCancel(a);return}const{collisionRect:g}=i.current,x=g?{x:g.left,y:g.top}:ll;this.referenceCoordinates||(this.referenceCoordinates=x);const b=h(a,{active:r,context:i.current,currentCoordinates:x});if(b){const w=Ec(b,x),S={x:0,y:0},{scrollableAncestors:R}=i.current;for(const C of R){const N=a.code,{isTop:z,isRight:I,isLeft:q,isBottom:Q,maxScroll:ee,minScroll:te}=wb(C),D=pN(C),j={x:Math.min(N===Ct.Right?D.right-D.width/2:D.right,Math.max(N===Ct.Right?D.left:D.left+D.width/2,b.x)),y:Math.min(N===Ct.Down?D.bottom-D.height/2:D.bottom,Math.max(N===Ct.Down?D.top:D.top+D.height/2,b.y))},re=N===Ct.Right&&!I||N===Ct.Left&&!q,ue=N===Ct.Down&&!Q||N===Ct.Up&&!z;if(re&&j.x!==b.x){const xe=C.scrollLeft+w.x,pe=N===Ct.Right&&xe<=ee.x||N===Ct.Left&&xe>=te.x;if(pe&&!w.y){C.scrollTo({left:xe,behavior:m});return}pe?S.x=C.scrollLeft-xe:S.x=N===Ct.Right?C.scrollLeft-ee.x:C.scrollLeft-te.x,S.x&&C.scrollBy({left:-S.x,behavior:m});break}else if(ue&&j.y!==b.y){const xe=C.scrollTop+w.y,pe=N===Ct.Down&&xe<=ee.y||N===Ct.Up&&xe>=te.y;if(pe&&!w.x){C.scrollTo({top:xe,behavior:m});return}pe?S.y=C.scrollTop-xe:S.y=N===Ct.Down?C.scrollTop-ee.y:C.scrollTop-te.y,S.y&&C.scrollBy({top:-S.y,behavior:m});break}}this.handleMove(a,Js(Ec(b,this.referenceCoordinates),S))}}}handleMove(a,r){const{onMove:i}=this.props;a.preventDefault(),i(r)}handleEnd(a){const{onEnd:r}=this.props;a.preventDefault(),this.detach(),r()}handleCancel(a){const{onCancel:r}=this.props;a.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}jb.activators=[{eventName:"onKeyDown",handler:(t,a,r)=>{let{keyboardCodes:i=Tb,onActivation:u}=a,{active:o}=r;const{code:h}=t.nativeEvent;if(i.start.includes(h)){const m=o.activatorNode.current;return m&&t.target!==m?!1:(t.preventDefault(),u==null||u({event:t.nativeEvent}),!0)}return!1}}];function Hy(t){return!!(t&&"distance"in t)}function By(t){return!!(t&&"delay"in t)}class sm{constructor(a,r,i){var u;i===void 0&&(i=xN(a.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=a,this.events=r;const{event:o}=a,{target:h}=o;this.props=a,this.events=r,this.document=ii(h),this.documentListeners=new hu(this.document),this.listeners=new hu(i),this.windowListeners=new hu(oa(h)),this.initialCoordinates=(u=wc(o))!=null?u:ll,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:r,bypassActivationConstraint:i}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.DragStart,Uy),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),this.windowListeners.add(Xa.ContextMenu,Uy),this.documentListeners.add(Xa.Keydown,this.handleKeydown),r){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(By(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Hy(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,r){const{active:i,onPending:u}=this.props;u(i,a,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:a}=this,{onStart:r}=this.props;a&&(this.activated=!0,this.documentListeners.add(Xa.Click,bN,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xa.SelectionChange,this.removeTextSelection),r(a))}handleMove(a){var r;const{activated:i,initialCoordinates:u,props:o}=this,{onMove:h,options:{activationConstraint:m}}=o;if(!u)return;const p=(r=wc(a))!=null?r:ll,g=Ec(u,p);if(!i&&m){if(Hy(m)){if(m.tolerance!=null&&ih(g,m.tolerance))return this.handleCancel();if(ih(g,m.distance))return this.handleStart()}if(By(m)&&ih(g,m.tolerance))return this.handleCancel();this.handlePending(m,g);return}a.cancelable&&a.preventDefault(),h(p)}handleEnd(){const{onAbort:a,onEnd:r}=this.props;this.detach(),this.activated||a(this.props.active),r()}handleCancel(){const{onAbort:a,onCancel:r}=this.props;this.detach(),this.activated||a(this.props.active),r()}handleKeydown(a){a.code===Ct.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const EN={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class im extends sm{constructor(a){const{event:r}=a,i=ii(r.target);super(a,EN,i)}}im.activators=[{eventName:"onPointerDown",handler:(t,a)=>{let{nativeEvent:r}=t,{onActivation:i}=a;return!r.isPrimary||r.button!==0?!1:(i==null||i({event:r}),!0)}}];const wN={move:{name:"mousemove"},end:{name:"mouseup"}};var Ah;(function(t){t[t.RightClick=2]="RightClick"})(Ah||(Ah={}));class RN extends sm{constructor(a){super(a,wN,ii(a.event.target))}}RN.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:r}=t,{onActivation:i}=a;return r.button===Ah.RightClick?!1:(i==null||i({event:r}),!0)}}];const uh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class NN extends sm{constructor(a){super(a,uh)}static setup(){return window.addEventListener(uh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(uh.move.name,a)};function a(){}}}NN.activators=[{eventName:"onTouchStart",handler:(t,a)=>{let{nativeEvent:r}=t,{onActivation:i}=a;const{touches:u}=r;return u.length>1?!1:(i==null||i({event:r}),!0)}}];var mu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(mu||(mu={}));var Nc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nc||(Nc={}));function TN(t){let{acceleration:a,activator:r=mu.Pointer,canScroll:i,draggingRect:u,enabled:o,interval:h=5,order:m=Nc.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:b,threshold:w}=t;const S=DN({delta:b,disabled:!o}),[R,C]=zR(),N=v.useRef({x:0,y:0}),z=v.useRef({x:0,y:0}),I=v.useMemo(()=>{switch(r){case mu.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case mu.DraggableRect:return u}},[r,u,p]),q=v.useRef(null),Q=v.useCallback(()=>{const te=q.current;if(!te)return;const D=N.current.x*z.current.x,j=N.current.y*z.current.y;te.scrollBy(D,j)},[]),ee=v.useMemo(()=>m===Nc.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!o||!g.length||!I){C();return}for(const te of ee){if((i==null?void 0:i(te))===!1)continue;const D=g.indexOf(te),j=x[D];if(!j)continue;const{direction:re,speed:ue}=mN(te,j,I,a,w);for(const xe of["x","y"])S[xe][re[xe]]||(ue[xe]=0,re[xe]=0);if(ue.x>0||ue.y>0){C(),q.current=te,R(Q,h),N.current=ue,z.current=re;return}}N.current={x:0,y:0},z.current={x:0,y:0},C()},[a,Q,i,C,o,h,JSON.stringify(I),JSON.stringify(S),R,g,ee,x,JSON.stringify(w)])}const jN={x:{[Hn.Backward]:!1,[Hn.Forward]:!1},y:{[Hn.Backward]:!1,[Hn.Forward]:!1}};function DN(t){let{delta:a,disabled:r}=t;const i=Sc(a);return ku(u=>{if(r||!i||!u)return jN;const o={x:Math.sign(a.x-i.x),y:Math.sign(a.y-i.y)};return{x:{[Hn.Backward]:u.x[Hn.Backward]||o.x===-1,[Hn.Forward]:u.x[Hn.Forward]||o.x===1},y:{[Hn.Backward]:u.y[Hn.Backward]||o.y===-1,[Hn.Forward]:u.y[Hn.Forward]||o.y===1}}},[r,a,i])}function CN(t,a){const r=a!=null?t.get(a):void 0,i=r?r.node.current:null;return ku(u=>{var o;return a==null?null:(o=i??u)!=null?o:null},[i,a])}function AN(t,a){return v.useMemo(()=>t.reduce((r,i)=>{const{sensor:u}=i,o=u.activators.map(h=>({eventName:h.eventName,handler:a(h.handler,i)}));return[...r,...o]},[]),[t,a])}var Su;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Su||(Su={}));var Oh;(function(t){t.Optimized="optimized"})(Oh||(Oh={}));const $y=new Map;function ON(t,a){let{dragging:r,dependencies:i,config:u}=a;const[o,h]=v.useState(null),{frequency:m,measure:p,strategy:g}=u,x=v.useRef(t),b=N(),w=bu(b),S=v.useCallback(function(z){z===void 0&&(z=[]),!w.current&&h(I=>I===null?z:I.concat(z.filter(q=>!I.includes(q))))},[w]),R=v.useRef(null),C=ku(z=>{if(b&&!r)return $y;if(!z||z===$y||x.current!==t||o!=null){const I=new Map;for(let q of t){if(!q)continue;if(o&&o.length>0&&!o.includes(q.id)&&q.rect.current){I.set(q.id,q.rect.current);continue}const Q=q.node.current,ee=Q?new rm(p(Q),Q):null;q.rect.current=ee,ee&&I.set(q.id,ee)}return I}return z},[t,o,r,b,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{b||S()},[r,b]),v.useEffect(()=>{o&&o.length>0&&h(null)},[JSON.stringify(o)]),v.useEffect(()=>{b||typeof m!="number"||R.current!==null||(R.current=setTimeout(()=>{S(),R.current=null},m))},[m,b,S,...i]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:o!=null};function N(){switch(g){case Su.Always:return!1;case Su.BeforeDragging:return r;default:return!r}}}function um(t,a){return ku(r=>t?r||(typeof a=="function"?a(t):t):null,[a,t])}function MN(t,a){return um(t,a)}function kN(t){let{callback:a,disabled:r}=t;const i=$c(a),u=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,r]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function Yc(t){let{callback:a,disabled:r}=t;const i=$c(a),u=v.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[r]);return v.useEffect(()=>()=>u==null?void 0:u.disconnect(),[u]),u}function _N(t){return new rm(ui(t),t)}function qy(t,a,r){a===void 0&&(a=_N);const[i,u]=v.useState(null);function o(){u(p=>{if(!t)return null;if(t.isConnected===!1){var g;return(g=p??r)!=null?g:null}const x=a(t);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const h=kN({callback(p){if(t)for(const g of p){const{type:x,target:b}=g;if(x==="childList"&&b instanceof HTMLElement&&b.contains(t)){o();break}}}}),m=Yc({callback:o});return al(()=>{o(),t?(m==null||m.observe(t),h==null||h.observe(document.body,{childList:!0,subtree:!0})):(m==null||m.disconnect(),h==null||h.disconnect())},[t]),i}function LN(t){const a=um(t);return vb(t,a)}const Yy=[];function zN(t){const a=v.useRef(t),r=ku(i=>t?i&&i!==Yy&&t&&a.current&&t.parentNode===a.current.parentNode?i:lm(t):Yy,[t]);return v.useEffect(()=>{a.current=t},[t]),r}function UN(t){const[a,r]=v.useState(null),i=v.useRef(t),u=v.useCallback(o=>{const h=sh(o.target);h&&r(m=>m?(m.set(h,Ch(h)),new Map(m)):null)},[]);return v.useEffect(()=>{const o=i.current;if(t!==o){h(o);const m=t.map(p=>{const g=sh(p);return g?(g.addEventListener("scroll",u,{passive:!0}),[g,Ch(g)]):null}).filter(p=>p!=null);r(m.length?new Map(m):null),i.current=t}return()=>{h(t),h(o)};function h(m){m.forEach(p=>{const g=sh(p);g==null||g.removeEventListener("scroll",u)})}},[u,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((o,h)=>Js(o,h),ll):Rb(t):ll,[t,a])}function Vy(t,a){a===void 0&&(a=[]);const r=v.useRef(null);return v.useEffect(()=>{r.current=null},a),v.useEffect(()=>{const i=t!==ll;i&&!r.current&&(r.current=t),!i&&r.current&&(r.current=null)},[t]),r.current?Ec(t,r.current):ll}function HN(t){v.useEffect(()=>{if(!Bc)return;const a=t.map(r=>{let{sensor:i}=r;return i.setup==null?void 0:i.setup()});return()=>{for(const r of a)r==null||r()}},t.map(a=>{let{sensor:r}=a;return r}))}function BN(t,a){return v.useMemo(()=>t.reduce((r,i)=>{let{eventName:u,handler:o}=i;return r[u]=h=>{o(h,a)},r},{}),[t,a])}function Db(t){return v.useMemo(()=>t?cN(t):null,[t])}const Fy=[];function $N(t,a){a===void 0&&(a=ui);const[r]=t,i=Db(r?oa(r):null),[u,o]=v.useState(Fy);function h(){o(()=>t.length?t.map(p=>Eb(p)?i:new rm(a(p),p)):Fy)}const m=Yc({callback:h});return al(()=>{m==null||m.disconnect(),h(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),u}function Cb(t){if(!t)return null;if(t.children.length>1)return t;const a=t.children[0];return Mu(a)?a:t}function qN(t){let{measure:a}=t;const[r,i]=v.useState(null),u=v.useCallback(g=>{for(const{target:x}of g)if(Mu(x)){i(b=>{const w=a(x);return b?{...b,width:w.width,height:w.height}:w});break}},[a]),o=Yc({callback:u}),h=v.useCallback(g=>{const x=Cb(g);o==null||o.disconnect(),x&&(o==null||o.observe(x)),i(x?a(x):null)},[a,o]),[m,p]=bc(h);return v.useMemo(()=>({nodeRef:m,rect:r,setRef:p}),[r,m,p])}const YN=[{sensor:im,options:{}},{sensor:jb,options:{}}],VN={current:{}},fc={draggable:{measure:zy},droppable:{measure:zy,strategy:Su.WhileDragging,frequency:Oh.Optimized},dragOverlay:{measure:ui}};class pu extends Map{get(a){var r;return a!=null&&(r=super.get(a))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:r}=a;return!r})}getNodeFor(a){var r,i;return(r=(i=this.get(a))==null?void 0:i.node.current)!=null?r:void 0}}const FN={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new pu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fc,measureDroppableContainers:Rc,windowRect:null,measuringScheduled:!1},Ab={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rc,draggableNodes:new Map,over:null,measureDroppableContainers:Rc},Lu=v.createContext(Ab),Ob=v.createContext(FN);function GN(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new pu}}}function XN(t,a){switch(a.type){case Ln.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Ln.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 Ln.DragEnd:case Ln.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ln.RegisterDroppable:{const{element:r}=a,{id:i}=r,u=new pu(t.droppable.containers);return u.set(i,r),{...t,droppable:{...t.droppable,containers:u}}}case Ln.SetDroppableDisabled:{const{id:r,key:i,disabled:u}=a,o=t.droppable.containers.get(r);if(!o||i!==o.key)return t;const h=new pu(t.droppable.containers);return h.set(r,{...o,disabled:u}),{...t,droppable:{...t.droppable,containers:h}}}case Ln.UnregisterDroppable:{const{id:r,key:i}=a,u=t.droppable.containers.get(r);if(!u||i!==u.key)return t;const o=new pu(t.droppable.containers);return o.delete(r),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function IN(t){let{disabled:a}=t;const{active:r,activatorEvent:i,draggableNodes:u}=v.useContext(Lu),o=Sc(i),h=Sc(r==null?void 0:r.id);return v.useEffect(()=>{if(!a&&!i&&o&&h!=null){if(!qc(o)||document.activeElement===o.target)return;const m=u.get(h);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[p.current,g.current]){if(!x)continue;const b=BR(x);if(b){b.focus();break}}})}},[i,a,u,h,o]),null}function Mb(t,a){let{transform:r,...i}=a;return t!=null&&t.length?t.reduce((u,o)=>o({transform:u,...i}),r):r}function QN(t){return v.useMemo(()=>({draggable:{...fc.draggable,...t==null?void 0:t.draggable},droppable:{...fc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...fc.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 PN(t){let{activeNode:a,measure:r,initialRect:i,config:u=!0}=t;const o=v.useRef(!1),{x:h,y:m}=typeof u=="boolean"?{x:u,y:u}:u;al(()=>{if(!h&&!m||!a){o.current=!1;return}if(o.current||!i)return;const g=a==null?void 0:a.node.current;if(!g||g.isConnected===!1)return;const x=r(g),b=vb(x,i);if(h||(b.x=0),m||(b.y=0),o.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const w=xb(g);w&&w.scrollBy({top:b.y,left:b.x})}},[a,h,m,i,r])}const Vc=v.createContext({...ll,scaleX:1,scaleY:1});var Dr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Dr||(Dr={}));const KN=v.memo(function(a){var r,i,u,o;let{id:h,accessibility:m,autoScroll:p=!0,children:g,sensors:x=YN,collisionDetection:b=lN,measuring:w,modifiers:S,...R}=a;const C=v.useReducer(XN,void 0,GN),[N,z]=C,[I,q]=GR(),[Q,ee]=v.useState(Dr.Uninitialized),te=Q===Dr.Initialized,{draggable:{active:D,nodes:j,translate:re},droppable:{containers:ue}}=N,xe=D!=null?j.get(D):null,pe=v.useRef({initial:null,translated:null}),Te=v.useMemo(()=>{var Yt;return D!=null?{id:D,data:(Yt=xe==null?void 0:xe.data)!=null?Yt:VN,rect:pe}:null},[D,xe]),Ae=v.useRef(null),[Re,B]=v.useState(null),[V,de]=v.useState(null),fe=bu(R,Object.values(R)),Ne=_u("DndDescribedBy",h),O=v.useMemo(()=>ue.getEnabled(),[ue]),X=QN(w),{droppableRects:se,measureDroppableContainers:ce,measuringScheduled:we}=ON(O,{dragging:te,dependencies:[re.x,re.y],config:X.droppable}),Se=CN(j,D),He=v.useMemo(()=>V?wc(V):null,[V]),it=Qt(),Fe=MN(Se,X.draggable.measure);PN({activeNode:D!=null?j.get(D):null,config:it.layoutShiftCompensation,initialRect:Fe,measure:X.draggable.measure});const et=qy(Se,X.draggable.measure,Fe),en=qy(Se?Se.parentElement:null),qt=v.useRef({activatorEvent:null,active:null,activeNode:Se,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:ue,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ut=ue.getNodeFor((r=qt.current.over)==null?void 0:r.id),le=qN({measure:X.dragOverlay.measure}),Le=(i=le.nodeRef.current)!=null?i:Se,at=te?(u=le.rect)!=null?u:et:null,Xt=!!(le.nodeRef.current&&le.rect),Cn=LN(Xt?null:et),pn=Db(Le?oa(Le):null),_t=zN(te?ut??Se:null),Wt=$N(_t),Yn=Mb(S,{transform:{x:re.x-Cn.x,y:re.y-Cn.y,scaleX:1,scaleY:1},activatorEvent:V,active:Te,activeNodeRect:et,containerNodeRect:en,draggingNodeRect:at,over:qt.current.over,overlayNodeRect:le.rect,scrollableAncestors:_t,scrollableAncestorRects:Wt,windowRect:pn}),ye=He?Js(He,re):null,Oe=UN(_t),ze=Vy(Oe),Ge=Vy(Oe,[et]),lt=Js(Yn,ze),At=at?iN(at,Yn):null,Ot=Te&&At?b({active:Te,collisionRect:At,droppableRects:se,droppableContainers:O,pointerCoordinates:ye}):null,tn=tN(Ot,"id"),[It,ca]=v.useState(null),gn=Xt?Yn:Js(Yn,Ge),J=rN(gn,(o=It==null?void 0:It.rect)!=null?o:null,et),St=v.useRef(null),Lt=v.useCallback((Yt,gt)=>{let{sensor:zt,options:Rt}=gt;if(Ae.current==null)return;const nn=j.get(Ae.current);if(!nn)return;const Pt=Yt.nativeEvent,Ut=new zt({active:Ae.current,activeNode:nn,event:Pt,options:Rt,context:qt,onAbort(Ke){if(!j.get(Ke))return;const{onDragAbort:An}=fe.current,A={id:Ke};An==null||An(A),I({type:"onDragAbort",event:A})},onPending(Ke,Sn,An,A){if(!j.get(Ke))return;const{onDragPending:H}=fe.current,K={id:Ke,constraint:Sn,initialCoordinates:An,offset:A};H==null||H(K),I({type:"onDragPending",event:K})},onStart(Ke){const Sn=Ae.current;if(Sn==null)return;const An=j.get(Sn);if(!An)return;const{onDragStart:A}=fe.current,_={activatorEvent:Pt,active:{id:Sn,data:An.data,rect:pe}};Zl.unstable_batchedUpdates(()=>{A==null||A(_),ee(Dr.Initializing),z({type:Ln.DragStart,initialCoordinates:Ke,active:Sn}),I({type:"onDragStart",event:_}),B(St.current),de(Pt)})},onMove(Ke){z({type:Ln.DragMove,coordinates:Ke})},onEnd:dt(Ln.DragEnd),onCancel:dt(Ln.DragCancel)});St.current=Ut;function dt(Ke){return async function(){const{active:An,collisions:A,over:_,scrollAdjustedTranslate:H}=qt.current;let K=null;if(An&&H){const{cancelDrop:ne}=fe.current;K={activatorEvent:Pt,active:An,collisions:A,delta:H,over:_},Ke===Ln.DragEnd&&typeof ne=="function"&&await Promise.resolve(ne(K))&&(Ke=Ln.DragCancel)}Ae.current=null,Zl.unstable_batchedUpdates(()=>{z({type:Ke}),ee(Dr.Uninitialized),ca(null),B(null),de(null),St.current=null;const ne=Ke===Ln.DragEnd?"onDragEnd":"onDragCancel";if(K){const Ee=fe.current[ne];Ee==null||Ee(K),I({type:ne,event:K})}})}}},[j]),er=v.useCallback((Yt,gt)=>(zt,Rt)=>{const nn=zt.nativeEvent,Pt=j.get(Rt);if(Ae.current!==null||!Pt||nn.dndKit||nn.defaultPrevented)return;const Ut={active:Pt};Yt(zt,gt.options,Ut)===!0&&(nn.dndKit={capturedBy:gt.sensor},Ae.current=Rt,Lt(zt,gt))},[j,Lt]),Zn=AN(x,er);HN(x),al(()=>{et&&Q===Dr.Initializing&&ee(Dr.Initialized)},[et,Q]),v.useEffect(()=>{const{onDragMove:Yt}=fe.current,{active:gt,activatorEvent:zt,collisions:Rt,over:nn}=qt.current;if(!gt||!zt)return;const Pt={active:gt,activatorEvent:zt,collisions:Rt,delta:{x:lt.x,y:lt.y},over:nn};Zl.unstable_batchedUpdates(()=>{Yt==null||Yt(Pt),I({type:"onDragMove",event:Pt})})},[lt.x,lt.y]),v.useEffect(()=>{const{active:Yt,activatorEvent:gt,collisions:zt,droppableContainers:Rt,scrollAdjustedTranslate:nn}=qt.current;if(!Yt||Ae.current==null||!gt||!nn)return;const{onDragOver:Pt}=fe.current,Ut=Rt.get(tn),dt=Ut&&Ut.rect.current?{id:Ut.id,rect:Ut.rect.current,data:Ut.data,disabled:Ut.disabled}:null,Ke={active:Yt,activatorEvent:gt,collisions:zt,delta:{x:nn.x,y:nn.y},over:dt};Zl.unstable_batchedUpdates(()=>{ca(dt),Pt==null||Pt(Ke),I({type:"onDragOver",event:Ke})})},[tn]),al(()=>{qt.current={activatorEvent:V,active:Te,activeNode:Se,collisionRect:At,collisions:Ot,droppableRects:se,draggableNodes:j,draggingNode:Le,draggingNodeRect:at,droppableContainers:ue,over:It,scrollableAncestors:_t,scrollAdjustedTranslate:lt},pe.current={initial:at,translated:At}},[Te,Se,Ot,At,j,Le,at,se,ue,It,_t,lt]),TN({...it,delta:re,draggingRect:At,pointerCoordinates:ye,scrollableAncestors:_t,scrollableAncestorRects:Wt});const Nl=v.useMemo(()=>({active:Te,activeNode:Se,activeNodeRect:et,activatorEvent:V,collisions:Ot,containerNodeRect:en,dragOverlay:le,draggableNodes:j,droppableContainers:ue,droppableRects:se,over:It,measureDroppableContainers:ce,scrollableAncestors:_t,scrollableAncestorRects:Wt,measuringConfiguration:X,measuringScheduled:we,windowRect:pn}),[Te,Se,et,V,Ot,en,le,j,ue,se,It,ce,_t,Wt,X,we,pn]),$e=v.useMemo(()=>({activatorEvent:V,activators:Zn,active:Te,activeNodeRect:et,ariaDescribedById:{draggable:Ne},dispatch:z,draggableNodes:j,over:It,measureDroppableContainers:ce}),[V,Zn,Te,et,z,Ne,j,It,ce]);return un.createElement(gb.Provider,{value:q},un.createElement(Lu.Provider,{value:$e},un.createElement(Ob.Provider,{value:Nl},un.createElement(Vc.Provider,{value:J},g)),un.createElement(IN,{disabled:(m==null?void 0:m.restoreFocus)===!1})),un.createElement(QR,{...m,hiddenTextDescribedById:Ne}));function Qt(){const Yt=(Re==null?void 0:Re.autoScrollEnabled)===!1,gt=typeof p=="object"?p.enabled===!1:p===!1,zt=te&&!Yt&&!gt;return typeof p=="object"?{...p,enabled:zt}:{enabled:zt}}}),ZN=v.createContext(null),Gy="button",JN="Draggable";function WN(t){let{id:a,data:r,disabled:i=!1,attributes:u}=t;const o=_u(JN),{activators:h,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:b,over:w}=v.useContext(Lu),{role:S=Gy,roleDescription:R="draggable",tabIndex:C=0}=u??{},N=(p==null?void 0:p.id)===a,z=v.useContext(N?Vc:ZN),[I,q]=bc(),[Q,ee]=bc(),te=BN(h,a),D=bu(r);al(()=>(b.set(a,{id:a,key:o,node:I,activatorNode:Q,data:D}),()=>{const re=b.get(a);re&&re.key===o&&b.delete(a)}),[b,a]);const j=v.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":i,"aria-pressed":N&&S===Gy?!0:void 0,"aria-roledescription":R,"aria-describedby":x.draggable}),[i,S,C,N,R,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:j,isDragging:N,listeners:i?void 0:te,node:I,over:w,setNodeRef:q,setActivatorNodeRef:ee,transform:z}}function kb(){return v.useContext(Ob)}const e2="Droppable",t2={timeout:25};function n2(t){let{data:a,disabled:r=!1,id:i,resizeObserverConfig:u}=t;const o=_u(e2),{active:h,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Lu),x=v.useRef({disabled:r}),b=v.useRef(!1),w=v.useRef(null),S=v.useRef(null),{disabled:R,updateMeasurementsFor:C,timeout:N}={...t2,...u},z=bu(C??i),I=v.useCallback(()=>{if(!b.current){b.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(z.current)?z.current:[z.current]),S.current=null},N)},[N]),q=Yc({callback:I,disabled:R||!h}),Q=v.useCallback((j,re)=>{q&&(re&&(q.unobserve(re),b.current=!1),j&&q.observe(j))},[q]),[ee,te]=bc(Q),D=bu(a);return v.useEffect(()=>{!q||!ee.current||(q.disconnect(),b.current=!1,q.observe(ee.current))},[ee,q]),v.useEffect(()=>(m({type:Ln.RegisterDroppable,element:{id:i,key:o,disabled:r,node:ee,rect:w,data:D}}),()=>m({type:Ln.UnregisterDroppable,key:o,id:i})),[i]),v.useEffect(()=>{r!==x.current.disabled&&(m({type:Ln.SetDroppableDisabled,id:i,key:o,disabled:r}),x.current.disabled=r)},[i,o,r,m]),{active:h,rect:w,isOver:(p==null?void 0:p.id)===i,node:ee,over:p,setNodeRef:te}}function a2(t){let{animation:a,children:r}=t;const[i,u]=v.useState(null),[o,h]=v.useState(null),m=Sc(r);return!r&&!i&&m&&u(m),al(()=>{if(!o)return;const p=i==null?void 0:i.key,g=i==null?void 0:i.props.id;if(p==null||g==null){u(null);return}Promise.resolve(a(g,o)).then(()=>{u(null)})},[a,i,o]),un.createElement(un.Fragment,null,r,i?v.cloneElement(i,{ref:h}):null)}const l2={x:0,y:0,scaleX:1,scaleY:1};function r2(t){let{children:a}=t;return un.createElement(Lu.Provider,{value:Ab},un.createElement(Vc.Provider,{value:l2},a))}const s2={position:"fixed",touchAction:"none"},i2=t=>qc(t)?"transform 250ms ease":void 0,u2=v.forwardRef((t,a)=>{let{as:r,activatorEvent:i,adjustScale:u,children:o,className:h,rect:m,style:p,transform:g,transition:x=i2}=t;if(!m)return null;const b=u?g:{...g,scaleX:1,scaleY:1},w={...s2,width:m.width,height:m.height,top:m.top,left:m.left,transform:Or.Transform.toString(b),transformOrigin:u&&i?JR(i,m):void 0,transition:typeof x=="function"?x(i):x,...p};return un.createElement(r,{className:h,style:w,ref:a},o)}),o2=t=>a=>{let{active:r,dragOverlay:i}=a;const u={},{styles:o,className:h}=t;if(o!=null&&o.active)for(const[m,p]of Object.entries(o.active))p!==void 0&&(u[m]=r.node.style.getPropertyValue(m),r.node.style.setProperty(m,p));if(o!=null&&o.dragOverlay)for(const[m,p]of Object.entries(o.dragOverlay))p!==void 0&&i.node.style.setProperty(m,p);return h!=null&&h.active&&r.node.classList.add(h.active),h!=null&&h.dragOverlay&&i.node.classList.add(h.dragOverlay),function(){for(const[p,g]of Object.entries(u))r.node.style.setProperty(p,g);h!=null&&h.active&&r.node.classList.remove(h.active)}},c2=t=>{let{transform:{initial:a,final:r}}=t;return[{transform:Or.Transform.toString(a)},{transform:Or.Transform.toString(r)}]},d2={duration:250,easing:"ease",keyframes:c2,sideEffects:o2({styles:{active:{opacity:"0"}}})};function f2(t){let{config:a,draggableNodes:r,droppableContainers:i,measuringConfiguration:u}=t;return $c((o,h)=>{if(a===null)return;const m=r.get(o);if(!m)return;const p=m.node.current;if(!p)return;const g=Cb(h);if(!g)return;const{transform:x}=oa(h).getComputedStyle(h),b=yb(x);if(!b)return;const w=typeof a=="function"?a:h2(a);return Nb(p,u.draggable.measure),w({active:{id:o,data:m.data,node:p,rect:u.draggable.measure(p)},draggableNodes:r,dragOverlay:{node:h,rect:u.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:u,transform:b})})}function h2(t){const{duration:a,easing:r,sideEffects:i,keyframes:u}={...d2,...t};return o=>{let{active:h,dragOverlay:m,transform:p,...g}=o;if(!a)return;const x={x:m.rect.left-h.rect.left,y:m.rect.top-h.rect.top},b={scaleX:p.scaleX!==1?h.rect.width*p.scaleX/m.rect.width:1,scaleY:p.scaleY!==1?h.rect.height*p.scaleY/m.rect.height:1},w={x:p.x-x.x,y:p.y-x.y,...b},S=u({...g,active:h,dragOverlay:m,transform:{initial:p,final:w}}),[R]=S,C=S[S.length-1];if(JSON.stringify(R)===JSON.stringify(C))return;const N=i==null?void 0:i({active:h,dragOverlay:m,...g}),z=m.node.animate(S,{duration:a,easing:r,fill:"forwards"});return new Promise(I=>{z.onfinish=()=>{N==null||N(),I()}})}}let Xy=0;function m2(t){return v.useMemo(()=>{if(t!=null)return Xy++,Xy},[t])}const p2=un.memo(t=>{let{adjustScale:a=!1,children:r,dropAnimation:i,style:u,transition:o,modifiers:h,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:b,activeNodeRect:w,containerNodeRect:S,draggableNodes:R,droppableContainers:C,dragOverlay:N,over:z,measuringConfiguration:I,scrollableAncestors:q,scrollableAncestorRects:Q,windowRect:ee}=kb(),te=v.useContext(Vc),D=m2(b==null?void 0:b.id),j=Mb(h,{activatorEvent:x,active:b,activeNodeRect:w,containerNodeRect:S,draggingNodeRect:N.rect,over:z,overlayNodeRect:N.rect,scrollableAncestors:q,scrollableAncestorRects:Q,transform:te,windowRect:ee}),re=um(w),ue=f2({config:i,draggableNodes:R,droppableContainers:C,measuringConfiguration:I}),xe=re?N.setRef:void 0;return un.createElement(r2,null,un.createElement(a2,{animation:ue},b&&D?un.createElement(u2,{key:D,id:b.id,ref:xe,as:m,activatorEvent:x,adjustScale:a,className:p,transition:o,rect:re,style:{zIndex:g,...u},transform:j},r):null))});function gu(t,a,r){const i=t.slice();return i.splice(r<0?i.length+r:r,0,i.splice(a,1)[0]),i}function g2(t,a){return t.reduce((r,i,u)=>{const o=a.get(i);return o&&(r[u]=o),r},Array(t.length))}function ec(t){return t!==null&&t>=0}function v2(t,a){if(t===a)return!0;if(t.length!==a.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==a[r])return!1;return!0}function y2(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const _b=t=>{let{rects:a,activeIndex:r,overIndex:i,index:u}=t;const o=gu(a,i,r),h=a[u],m=o[u];return!m||!h?null:{x:m.left-h.left,y:m.top-h.top,scaleX:m.width/h.width,scaleY:m.height/h.height}},tc={scaleX:1,scaleY:1},om=t=>{var a;let{activeIndex:r,activeNodeRect:i,index:u,rects:o,overIndex:h}=t;const m=(a=o[r])!=null?a:i;if(!m)return null;if(u===r){const g=o[h];return g?{x:0,y:r<h?g.top+g.height-(m.top+m.height):g.top-m.top,...tc}:null}const p=x2(o,u,r);return u>r&&u<=h?{x:0,y:-m.height-p,...tc}:u<r&&u>=h?{x:0,y:m.height+p,...tc}:{x:0,y:0,...tc}};function x2(t,a,r){const i=t[a],u=t[a-1],o=t[a+1];return i?r<a?u?i.top-(u.top+u.height):o?o.top-(i.top+i.height):0:o?o.top-(i.top+i.height):u?i.top-(u.top+u.height):0:0}const Lb="Sortable",zb=un.createContext({activeIndex:-1,containerId:Lb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_b,disabled:{draggable:!1,droppable:!1}});function cm(t){let{children:a,id:r,items:i,strategy:u=_b,disabled:o=!1}=t;const{active:h,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=kb(),b=_u(Lb,r),w=m.rect!==null,S=v.useMemo(()=>i.map(te=>typeof te=="object"&&"id"in te?te.id:te),[i]),R=h!=null,C=h?S.indexOf(h.id):-1,N=g?S.indexOf(g.id):-1,z=v.useRef(S),I=!v2(S,z.current),q=N!==-1&&C===-1||I,Q=y2(o);al(()=>{I&&R&&x(S)},[I,S,R,x]),v.useEffect(()=>{z.current=S},[S]);const ee=v.useMemo(()=>({activeIndex:C,containerId:b,disabled:Q,disableTransforms:q,items:S,overIndex:N,useDragOverlay:w,sortedRects:g2(S,p),strategy:u}),[C,b,Q.draggable,Q.droppable,q,S,N,p,w,u]);return un.createElement(zb.Provider,{value:ee},a)}const b2=t=>{let{id:a,items:r,activeIndex:i,overIndex:u}=t;return gu(r,i,u).indexOf(a)},S2=t=>{let{containerId:a,isSorting:r,wasDragging:i,index:u,items:o,newIndex:h,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!i||m!==o&&u===h?!1:r?!0:h!==u&&a===p},E2={duration:200,easing:"ease"},Ub="transform",w2=Or.Transition.toString({property:Ub,duration:0,easing:"linear"}),R2={roleDescription:"sortable"};function N2(t){let{disabled:a,index:r,node:i,rect:u}=t;const[o,h]=v.useState(null),m=v.useRef(r);return al(()=>{if(!a&&r!==m.current&&i.current){const p=u.current;if(p){const g=ui(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)&&h(x)}}r!==m.current&&(m.current=r)},[a,r,i,u]),v.useEffect(()=>{o&&h(null)},[o]),o}function T2(t){let{animateLayoutChanges:a=S2,attributes:r,disabled:i,data:u,getNewIndex:o=b2,id:h,strategy:m,resizeObserverConfig:p,transition:g=E2}=t;const{items:x,containerId:b,activeIndex:w,disabled:S,disableTransforms:R,sortedRects:C,overIndex:N,useDragOverlay:z,strategy:I}=v.useContext(zb),q=j2(i,S),Q=x.indexOf(h),ee=v.useMemo(()=>({sortable:{containerId:b,index:Q,items:x},...u}),[b,u,Q,x]),te=v.useMemo(()=>x.slice(x.indexOf(h)),[x,h]),{rect:D,node:j,isOver:re,setNodeRef:ue}=n2({id:h,data:ee,disabled:q.droppable,resizeObserverConfig:{updateMeasurementsFor:te,...p}}),{active:xe,activatorEvent:pe,activeNodeRect:Te,attributes:Ae,setNodeRef:Re,listeners:B,isDragging:V,over:de,setActivatorNodeRef:fe,transform:Ne}=WN({id:h,data:ee,attributes:{...R2,...r},disabled:q.draggable}),O=LR(ue,Re),X=!!xe,se=X&&!R&&ec(w)&&ec(N),ce=!z&&V,we=ce&&se?Ne:null,He=se?we??(m??I)({rects:C,activeNodeRect:Te,activeIndex:w,overIndex:N,index:Q}):null,it=ec(w)&&ec(N)?o({id:h,items:x,activeIndex:w,overIndex:N}):Q,Fe=xe==null?void 0:xe.id,et=v.useRef({activeId:Fe,items:x,newIndex:it,containerId:b}),en=x!==et.current.items,qt=a({active:xe,containerId:b,isDragging:V,isSorting:X,id:h,index:Q,items:x,newIndex:et.current.newIndex,previousItems:et.current.items,previousContainerId:et.current.containerId,transition:g,wasDragging:et.current.activeId!=null}),ut=N2({disabled:!qt,index:Q,node:j,rect:D});return v.useEffect(()=>{X&&et.current.newIndex!==it&&(et.current.newIndex=it),b!==et.current.containerId&&(et.current.containerId=b),x!==et.current.items&&(et.current.items=x)},[X,it,b,x]),v.useEffect(()=>{if(Fe===et.current.activeId)return;if(Fe!=null&&et.current.activeId==null){et.current.activeId=Fe;return}const Le=setTimeout(()=>{et.current.activeId=Fe},50);return()=>clearTimeout(Le)},[Fe]),{active:xe,activeIndex:w,attributes:Ae,data:ee,rect:D,index:Q,newIndex:it,items:x,isOver:re,isSorting:X,isDragging:V,listeners:B,node:j,overIndex:N,over:de,setNodeRef:O,setActivatorNodeRef:fe,setDroppableNodeRef:ue,setDraggableNodeRef:Re,transform:ut??He,transition:le()};function le(){if(ut||en&&et.current.newIndex===Q)return w2;if(!(ce&&!qc(pe)||!g)&&(X||qt))return Or.Transition.toString({...g,property:Ub})}}function j2(t,a){var r,i;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:a.draggable,droppable:(i=t==null?void 0:t.droppable)!=null?i:a.droppable}}Ct.Down,Ct.Right,Ct.Up,Ct.Left;const Fc=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Gc=[{value:"draft",label:"Draft"},{value:"discovery",label:"Discovery"},{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],zu=[{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"}],ru=Fc.map(t=>t.value),su=Gc.map(t=>t.value),iu=zu.map(t=>t.value);function oh(t,a,r){if(t.includes(a)){const i=t.filter(u=>u!==a);return i.length===0?[...r]:i}return[...t,a]}function ch(t,a){return a.includes(t)}function gl(t,a){return`agent-plan:dashboard:${t}:${a}`}function dh(t,a,r){if(typeof window>"u")return a;try{const i=window.localStorage.getItem(t);if(!i)return a;const u=JSON.parse(i);if(!Array.isArray(u))return a;const o=`${t}-schema`,h=r.slice().sort().join(",");if(window.localStorage.getItem(o)!==h)return window.localStorage.setItem(o,h),a;const p=u.filter(g=>typeof g=="string"&&r.includes(g));return p.length>0?p:a}catch{return a}}function fh(t,a,r){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,r.slice().sort().join(",")))}function hh(t,a){if(typeof window>"u")return a;const r=window.localStorage.getItem(t);return r===null?a:r==="true"}const Iy={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Qy=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function Hb(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function D2(t){return new Set(Hb(t).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function Py(t){const a=t.toUpperCase();return a==="AND"||a==="OR"}function mh(t,a){const r=t??new Set;for(const i of D2(a))r.add(i);return r}function C2(t,a){const r=t??new Set;for(const i of Hb(a).map(u=>u.toUpperCase()))r.add(i);return r}function A2(t){const a=t.trim();if(!a)return{...Iy};const r={...Iy},i=[],u=[];let o=0;for(;o<a.length;){const m=a[o];if(m==='"'){const p=a.indexOf('"',o+1);if(p===-1){u.push(a.slice(o+1));break}u.push(a.slice(o+1,p)),o=p+1}else if(m===" ")o+=1;else{let p=o;for(;p<a.length&&a[p]!==" ";)p+=1;u.push(a.slice(o,p)),o=p}}let h=0;for(;h<u.length;){const m=u[h];if(Py(m)){h+=1;continue}const p=m.match(Qy);if(p){const g=(p[1]??"").toLowerCase();let x=p[2]??"";if(x.trim()===""&&h+1<u.length){let b=h+1;for(;b<u.length&&Py(u[b]);)b+=1;b<u.length&&!u[b].match(Qy)&&(x=u[b],h=b)}if(g==="feature"){const b=mh(r.featureNumbers,x);b.size&&(r.featureNumbers=b)}else if(g==="phase"){const b=mh(r.phaseNumbers,x);b.size&&(r.phaseNumbers=b)}else if(g==="task"){const b=mh(r.taskNumbers,x);b.size&&(r.taskNumbers=b)}else if(g==="id"){const b=C2(r.shortIds,x);b.size&&(r.shortIds=b)}else g==="status"?x.trim()&&(r.status=x.toLowerCase()):g==="feature-status"?x.trim()&&(r.featureStatus=x.toLowerCase()):g==="phase-status"?x.trim()&&(r.phaseStatus=x.toLowerCase()):g==="title"&&x.trim()&&(r.text=x.toLowerCase())}else i.push(m.toLowerCase());h+=1}return i.length>0&&!r.text&&(r.text=i.join(" ")),r}function O2(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function M2(t,a){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 r=t.text;if(![a.task.title,a.task.shortId??"",a.phase.title,a.phase.shortId??"",a.feature.name,a.feature.shortId??""].join(" ").toLowerCase().includes(r))return!1}return!0}function k2({features:t,phases:a,projectStorageScope:r}){const i=gl(r,"show-all-features"),u=gl(r,"tree-open-mode"),o=gl(r,"expanded-features"),h=gl(r,"expanded-phases"),m=gl(r,"feature-status-filters"),p=gl(r,"phase-status-filters"),g=gl(r,"task-status-filters"),x=gl(r,"hide-done"),b=gl(r,"hide-planned"),w=gl(r,"only-active-branches"),[S,R]=v.useState(""),C=v.useMemo(()=>kR(t,a),[t,a]),N=v.useMemo(()=>A2(S),[S]),z=O2(N),{matchedTaskIds:I,matchedFeatureIds:q,matchedPhaseIds:Q}=v.useMemo(()=>{const ye=new Set,Oe=new Set,ze=new Set;if(!z)return{matchedTaskIds:ye,matchedFeatureIds:Oe,matchedPhaseIds:ze};for(const Ge of C)for(const lt of Ge.allPhases)for(const At of lt.allTasks)M2(N,{feature:Ge.feature,phase:lt.phase,task:At})&&(ye.add(At.id),Oe.add(Ge.feature.id),ze.add(lt.phase.id));return{matchedTaskIds:ye,matchedFeatureIds:Oe,matchedPhaseIds:ze}},[z,N,C]),[ee,te]=v.useState(()=>{if(typeof window>"u")return!0;const ye=window.localStorage.getItem(i);return ye===null?!0:ye==="true"}),[D,j]=v.useState(()=>{if(typeof window>"u")return"all";const ye=window.localStorage.getItem(u);return ye==="smart"||ye==="none"||ye==="all"?ye:"all"}),[re,ue]=v.useState(()=>{if(typeof window>"u")return[];try{const ye=window.localStorage.getItem(o);return ye?JSON.parse(ye):[]}catch{return[]}}),[xe,pe]=v.useState(()=>{if(typeof window>"u")return[];try{const ye=window.localStorage.getItem(h);return ye?JSON.parse(ye):[]}catch{return[]}}),[Te,Ae]=v.useState(()=>dh(m,ru,ru)),[Re,B]=v.useState(()=>dh(p,su,su)),[V,de]=v.useState(()=>dh(g,iu,iu)),[fe,Ne]=v.useState(()=>hh(x,!1)),[O,X]=v.useState(()=>hh(b,!1)),[se,ce]=v.useState(()=>hh(w,!1)),[we,Se]=v.useState([]),[He,it]=v.useState([]),[Fe,et]=v.useState([]),en=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(i,String(ee))},[ee,i]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,D)},[D,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(o,JSON.stringify(re))},[re,o]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(h,JSON.stringify(xe))},[xe,h]),v.useEffect(()=>{typeof window>"u"||fh(m,Te,ru)},[Te,m]),v.useEffect(()=>{typeof window>"u"||fh(p,Re,su)},[Re,p]),v.useEffect(()=>{typeof window>"u"||fh(g,V,iu)},[V,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(fe))},[fe,x]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(b,String(O))},[O,b]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(w,String(se))},[se,w]),v.useEffect(()=>()=>{Object.values(en.current).forEach(ye=>window.clearTimeout(ye)),en.current={}},[]);const qt=v.useMemo(()=>{let ye=[...Te];return fe&&(ye=ye.filter(Oe=>Oe!=="done")),O&&(ye=ye.filter(Oe=>Oe!=="planned")),ye},[Te,fe,O]),ut=v.useMemo(()=>{let ye=[...Re];return fe&&(ye=ye.filter(Oe=>Oe!=="done")),O&&(ye=ye.filter(Oe=>Oe!=="planned"&&Oe!=="draft")),ye},[Re,fe,O]),le=v.useMemo(()=>{let ye=[...V];return fe&&(ye=ye.filter(Oe=>Oe!=="done")),O&&(ye=ye.filter(Oe=>Oe!=="planned")),ye},[V,fe,O]),Le=v.useMemo(()=>{if(z)return C.map(ze=>({...ze,allPhases:ze.allPhases.map(Ge=>({...Ge,allTasks:Ge.allTasks.filter(lt=>I.has(lt.id))})).filter(Ge=>Ge.allTasks.length>0)})).filter(ze=>ze.allPhases.length>0);const ye=!ee||se;return(ee?C:C.filter(ze=>ze.isActive)).filter(({feature:ze})=>ch(ze.status,qt)).map(ze=>({...ze,allPhases:ze.allPhases.filter(({phase:Ge,hasActiveTask:lt})=>ch(Ge.status,ut)?ye?Ge.status==="in-progress"||Ge.status==="discovery"||lt:!0:!1).map(Ge=>({...Ge,allTasks:Ge.allTasks.filter(lt=>!!ch(lt.status,le))})).filter(Ge=>Ge.allTasks.length>0||ee||!ye)})).filter(({hasActiveTask:ze,allPhases:Ge})=>ye?ze||Ge.some(lt=>lt.hasActiveTask):Ge.length>0||ee)},[z,I,C,qt,ut,le,se,ee]);v.useEffect(()=>{if(D==="none"){ue([]),pe([]);return}if(D==="all"){ue(Le.filter(({feature:ze})=>ze.status!=="done").map(({feature:ze})=>ze.id)),pe(Le.flatMap(({allPhases:ze})=>ze.map(({phase:Ge})=>Ge.id)));return}const ye=new Set(Le.map(({feature:ze})=>ze.id)),Oe=new Set(Le.flatMap(({allPhases:ze})=>ze.map(({phase:Ge})=>Ge.id)));ue(ze=>ze.filter(Ge=>ye.has(Ge))),pe(ze=>ze.filter(Ge=>Oe.has(Ge)))},[Le,D]),v.useEffect(()=>{z&&(j("smart"),ue(Array.from(q)),pe(Array.from(Q)))},[z,q,Q]);const at=ye=>{j("smart"),ue(Oe=>Oe.includes(ye)?Oe.filter(ze=>ze!==ye):[...Oe,ye])},Xt=ye=>{j("smart"),pe(Oe=>Oe.includes(ye)?Oe.filter(ze=>ze!==ye):[...Oe,ye])},Cn=()=>{j("smart"),ue(Le.map(({feature:ye})=>ye.id)),pe(Le.flatMap(({allPhases:ye})=>ye.map(({phase:Oe})=>Oe.id)))};return v.useEffect(()=>{const ye=(ze,Ge)=>{const lt=Ge.filter(At=>!!At);for(const At of lt){const Ot=`${ze}:${At}`,tn=ze==="feature"?Se:ze==="phase"?it:et;tn(It=>It.includes(At)?It:[...It,At]),en.current[Ot]!==void 0&&window.clearTimeout(en.current[Ot]),en.current[Ot]=window.setTimeout(()=>{tn(It=>It.filter(ca=>ca!==At)),delete en.current[Ot]},CR)}},Oe=ze=>{var At,Ot,tn,It,ca,gn;const lt=ze.detail;if(lt!=null&&lt.type){if(lt.type==="features-updated"){const J=((At=lt.data)==null?void 0:At.featureId)??((Ot=lt.data)==null?void 0:Ot.id);ye("feature",[J]),J&&(j("smart"),ue(St=>St.includes(J)?St:[...St,J]));return}if(lt.type==="phases-updated"){const J=(tn=lt.data)==null?void 0:tn.featureId,St=((It=lt.data)==null?void 0:It.phaseId)??((ca=lt.data)==null?void 0:ca.id);ye("phase",[St]),ye("feature",[J]),ye("task",[(gn=lt.data)==null?void 0:gn.taskId]),j("smart"),J&&ue(Lt=>Lt.includes(J)?Lt:[...Lt,J]),St&&pe(Lt=>Lt.includes(St)?Lt:[...Lt,St])}}};return window.addEventListener("agent-plan:ws-event",Oe),()=>{window.removeEventListener("agent-plan:ws-event",Oe)}},[]),{workTree:C,displayedWorkTree:Le,treeOpenMode:D,setTreeOpenMode:j,expandAll:Cn,expandedFeatureIds:re,expandedPhaseIds:xe,toggleExpandedFeature:at,toggleExpandedPhase:Xt,recentFeatureIds:we,recentPhaseIds:He,recentTaskIds:Fe,showAllFeatures:ee,setShowAllFeatures:te,featureStatusFilters:Te,phaseStatusFilters:Re,taskStatusFilters:V,hideDone:fe,setHideDone:Ne,hidePlanned:O,setHidePlanned:X,onlyActiveBranches:se,setOnlyActiveBranches:ce,resetFilters:()=>{te(!0),Ne(!1),X(!1),Ae(ru),B(su),de(iu),ce(!1),j("all")},toggleFeatureStatusFilter:ye=>Ae(Oe=>oh(Oe,ye,ru)),togglePhaseStatusFilter:ye=>B(Oe=>oh(Oe,ye,su)),toggleTaskStatusFilter:ye=>de(Oe=>oh(Oe,ye,iu)),searchQuery:S,setSearchQuery:R,searchActive:z,matchedTaskIds:I,matchedFeatureIds:q,matchedPhaseIds:Q}}const Bb=v.createContext(null);function dm({id:t,children:a}){const r=T2({id:t}),i={transform:Or.Transform.toString(r.transform),transition:r.transition};return d.jsx(Bb.Provider,{value:r,children:d.jsx("div",{ref:r.setNodeRef,style:i,className:r.isDragging?"ap-sortable--dragging":"",children:a})})}function fm(){const t=v.useContext(Bb);return t?d.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...t.listeners,...t.attributes,children:d.jsx(jw,{className:"h-4 w-4"})}):null}const hm="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function _2(){return d.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"})}function ni({status:t,doneTasks:a,totalTasks:r,recentlyChanged:i,className:u}){const o=a!=null&&r!=null;return d.jsxs("div",{className:u,children:[i?d.jsx(_2,{}):null,o?d.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",r||0,")"]}):null,d.jsx("span",{className:"shrink-0",children:d.jsx(Oa,{status:t})})]})}function L2({entry:t,expanded:a,recentlyChanged:r,onToggle:i,isPhaseExpanded:u,onTogglePhase:o,isPhaseRecentlyChanged:h,isTaskRecentlyChanged:m,highlightedTaskIds:p}){const{feature:g,totalTasks:x,doneTasks:b,allPhases:w,hasActiveTask:S}=t;return d.jsxs("div",{className:`surface-card min-w-0 px-3 py-3 transition-colors sm:px-4 ${g.status==="in-progress"?"ap-in-progress":S?"border-[color:var(--color-status-in-progress)]/40 bg-[color:color-mix(in_srgb,var(--color-status-in-progress)_7%,transparent)]":""} ${g.status==="done"?"!opacity-70 !bg-[color:color-mix(in_srgb,var(--color-status-done)_10%,transparent)] !border-[color:color-mix(in_srgb,var(--color-status-done)_35%,transparent)]":""} ${r?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[d.jsxs("div",{className:`flex min-w-0 flex-col gap-1.5 rounded-[12px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${r?"bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]":""}`,children:[d.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[d.jsx("button",{type:"button",onClick:i,className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":a?`Collapse feature ${g.name}`:`Expand feature ${g.name}`,"aria-expanded":a,children:d.jsx(tb,{className:`h-4 w-4 transition ${a?"rotate-90":"rotate-0"}`})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(fm,{}),d.jsx(Wl,{id:li({featureNum:g.number}),children:d.jsx(Jl,{featureNum:g.number})}),g.shortId?d.jsx(ri,{shortId:g.shortId}):null,S?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ni,{status:g.status,doneTasks:b,totalTasks:x,recentlyChanged:r,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(wt,{to:`/features/${g.id}`,className:`entity-link--feature ${hm} underline-offset-4 hover:underline`,children:g.name})]})]}),d.jsx(ni,{status:g.status,doneTasks:b,totalTasks:x,recentlyChanged:r,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&w.length>0?d.jsx("div",{className:"mt-2 ml-1.5 grid grid-cols-1 gap-2 border-l border-[var(--border)] pl-3 sm:ml-4 sm:pl-4",children:d.jsx(cm,{items:w.map(R=>R.phase.id),strategy:om,children:w.map(R=>d.jsx(dm,{id:R.phase.id,children:d.jsx(z2,{feature:g,phaseEntry:R,expanded:u(R.phase.id),recentlyChanged:h(R.phase.id),onToggle:()=>o(R.phase.id),isTaskRecentlyChanged:m,highlightedTaskIds:p})},R.phase.id))})}):null]})}function z2({feature:t,phaseEntry:a,expanded:r,recentlyChanged:i,onToggle:u,isTaskRecentlyChanged:o,highlightedTaskIds:h}){const{phase:m,totalTasks:p,doneTasks:g,allTasks:x,hasActiveTask:b}=a;return d.jsxs("div",{className:`work-tree-row grid min-w-0 grid-cols-1 gap-2 rounded-[12px] p-3 transition-colors ${m.status==="in-progress"?"ap-in-progress":b?"border border-[color:color-mix(in_srgb,var(--color-status-in-progress)_35%,transparent)] bg-[color:color-mix(in_srgb,var(--color-status-in-progress)_6%,transparent)]":""} ${m.status==="done"?"opacity-70 bg-[color:color-mix(in_srgb,var(--color-status-done)_6%,transparent)]":""} ${i?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[d.jsxs("div",{className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${i?"bg-[color:color-mix(in_srgb,var(--accent)_8%,transparent)]":""}`,children:[d.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[d.jsx("button",{type:"button",onClick:u,className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":r?`Collapse phase ${m.title}`:`Expand phase ${m.title}`,"aria-expanded":r,children:d.jsx(tb,{className:`h-4 w-4 transition ${r?"rotate-90":"rotate-0"}`})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(fm,{}),d.jsx(Wl,{id:li({featureNum:t==null?void 0:t.number,phaseNum:m.number}),children:d.jsx(Jl,{featureNum:t==null?void 0:t.number,phaseNum:m.number})}),m.shortId?d.jsx(ri,{shortId:m.shortId}):null,m.handoff?d.jsx(tm,{updatedAt:m.handoffUpdatedAt}):null,b?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ni,{status:m.status,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(wt,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${hm} underline-offset-4 hover:underline`,children:m.title})]})]}),d.jsx(ni,{status:m.status,doneTasks:g,totalTasks:p,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),r?x.length>0?d.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l border-[var(--border)] pl-3 sm:ml-4 sm:pl-4",children:d.jsx(cm,{items:x.map(w=>w.id),strategy:om,children:x.map(w=>d.jsx(dm,{id:w.id,children:d.jsx(U2,{feature:t,phase:m,task:w,recentlyChanged:o(w.id),highlighted:h==null?void 0:h.has(w.id)})},w.id))})}):d.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function U2({feature:t,phase:a,task:r,recentlyChanged:i,highlighted:u}){return d.jsxs("div",{className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${r.status==="in-progress"?"ap-in-progress":""} ${r.status==="done"?"opacity-60 bg-[color:color-mix(in_srgb,var(--color-status-done)_6%,transparent)] text-[var(--text-muted)]":""} ${i?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""} ${u?"ap-search-hit":""}`,children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(fm,{}),d.jsx(Wl,{id:li({featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:r.number}),children:d.jsx(Jl,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:r.number})}),r.shortId?d.jsx(ri,{shortId:r.shortId}):null,r.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),d.jsx(ni,{status:r.status,recentlyChanged:i,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),d.jsx(wt,{to:`/features/${t.id}/phases/${a.id}/tasks/${r.id}`,className:`entity-link--task ${hm} underline-offset-4 hover:underline`,children:r.title})]}),d.jsx(ni,{status:r.status,recentlyChanged:i,className:"hidden shrink-0 items-center gap-2 sm:flex"})]})}var k=(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})({}),ra=(function(t){return t[t.EXPECT_TERM=0]="EXPECT_TERM",t[t.EXPECT_VALUE=1]="EXPECT_VALUE",t})(ra||{}),Ks=class{constructor(t,a){mn(this,"input");mn(this,"pos");mn(this,"state");mn(this,"tokens");mn(this,"options");this.input=t,this.pos=0,this.state=ra.EXPECT_TERM,this.tokens=[],this.options=a||{}}tokenize(){for(this.tokens=[],this.pos=0,this.state=ra.EXPECT_TERM;this.pos<this.input.length;)this.state===ra.EXPECT_VALUE?this.readValue():this.readTerm();return this.tokens}peek(){return this.input[this.pos]}peekAt(t){return this.input[this.pos+t]}advance(){return this.input[this.pos++]}isWhitespace(t){return t===" "||t===" "||t===`
198
+ `||t==="\r"}isAlpha(t){return/[a-zA-Z_]/.test(t)}isAlphaNumeric(t){return/[a-zA-Z0-9_.\-]/.test(t)}readWhitespace(){const t=this.pos;for(;this.pos<this.input.length&&this.isWhitespace(this.peek());)this.advance();this.tokens.push({type:k.WHITESPACE,value:this.input.slice(t,this.pos),start:t,end:this.pos})}readQuotedString(){const t=this.pos,a=this.advance();for(;this.pos<this.input.length;){const r=this.advance();if(r==="\\"&&this.pos<this.input.length)this.advance();else if(r===a)break}this.tokens.push({type:k.QUOTED_VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=ra.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:k.LPAREN,value:"(",start:this.pos,end:this.pos+1}),this.advance();return}if(t===")"){this.tokens.push({type:k.RPAREN,value:")",start:this.pos,end:this.pos+1}),this.advance();return}if(t==="~"||t==="^"){const r=this.pos,i=t==="~"?k.TILDE:k.BOOST;for(this.advance();this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:i,value:this.input.slice(r,this.pos),start:r,end:this.pos});return}if(t==="["||t==="{"){this.readRangeValue();return}if(t==="#"&&this.options.savedSearches){this.readSavedSearch();return}if(t==="!"&&this.options.historySearch){this.readHistoryRef();return}if(t==="-"||t==="+"){const r=this.peekAt(1);if(r&&(this.isAlpha(r)||r==='"'||r==="("||r==="#"||r==="!"||r==="["||r==="{")||!r||r===")"||r===" "||r===" "||r===`
199
+ `||r==="\r"){this.tokens.push({type:k.PREFIX_OP,value:t,start:this.pos,end:this.pos+1}),this.advance();return}}if(t==="&"&&this.peekAt(1)==="&"){this.tokens.push({type:k.AND,value:"&&",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if(t==="|"&&this.peekAt(1)==="|"){this.tokens.push({type:k.OR,value:"||",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if((t===">"||t==="<")&&this.state===ra.EXPECT_TERM){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:k.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos}),this.state=ra.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:k.FIELD_NAME,value:this.input.slice(a,this.pos),start:a,end:this.pos}),this.tokens.push({type:k.COLON,value:":",start:this.pos,end:this.pos+1}),this.advance(),this.state=ra.EXPECT_VALUE;return}this.advance()}if(this.pos>a){const r=this.input.slice(a,this.pos),i=r.toUpperCase();i==="AND"?this.tokens.push({type:k.AND,value:r,start:a,end:this.pos}):i==="OR"?this.tokens.push({type:k.OR,value:r,start:a,end:this.pos}):i==="NOT"?this.tokens.push({type:k.NOT,value:r,start:a,end:this.pos}):r.includes("*")||r.includes("?")?this.tokens.push({type:k.WILDCARD,value:r,start:a,end:this.pos}):this.tokens.push({type:k.VALUE,value:r,start:a,end:this.pos}),this.tryReadModifier()}}readValue(){const t=this.peek();if(this.isWhitespace(t)){this.readWhitespace(),this.state=ra.EXPECT_TERM;return}if(t==='"'){this.readQuotedString(),this.state=ra.EXPECT_TERM;return}if(t==="("||t===")"){this.state=ra.EXPECT_TERM,this.readTerm();return}if(t===">"||t==="<"){const r=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:k.COMPARISON_OP,value:this.input.slice(r,this.pos),start:r,end:this.pos});return}if(t==="["||t==="{"){this.readRangeValue();return}if(t==="/"){this.readRegex(),this.state=ra.EXPECT_TERM;return}const a=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!==")"&&this.peek()!=="("&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^";){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}this.advance()}if(this.pos>a){const r=this.input.slice(a,this.pos);r.includes("*")||r.includes("?")?this.tokens.push({type:k.WILDCARD,value:r,start:a,end:this.pos}):this.tokens.push({type:k.VALUE,value:r,start:a,end:this.pos}),this.tryReadModifier()}this.state=ra.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:k.RANGE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.state=ra.EXPECT_TERM}tryReadModifier(){for(;this.pos<this.input.length&&(this.peek()==="~"||this.peek()==="^");){const t=this.pos,a=this.advance()==="~"?k.TILDE:k.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:k.REGEX,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=ra.EXPECT_TERM;return}this.advance()}this.tokens.push({type:k.VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.state=ra.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:k.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:k.HISTORY_REF,value:this.input.slice(t,this.pos),start:t,end:this.pos})}},ls=class{constructor(t){mn(this,"tokens");mn(this,"pos");mn(this,"nonWsTokens");mn(this,"errors",[]);this.tokens=t,this.nonWsTokens=t.filter(a=>a.type!==k.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(t){if(t.type!==k.QUOTED_VALUE)return!1;const a=t.value;if(a.length<2)return!0;const r=a[0];return a[a.length-1]!==r}stripQuotes(t){const a=t.value;return this.isUnclosedQuote(t)?a.slice(1):a.slice(1,-1)}checkUnclosedQuote(t){this.isUnclosedQuote(t)&&this.errors.push({type:"Error",value:t.value[0],message:"Missing closing quote",start:t.start,end:t.start+1})}parse(){if(this.nonWsTokens.length===0)return null;let t=this.parseOr();for(;this.peek();){const a=this.peek();if(a.type===k.RPAREN)this.advance(),this.errors.push({type:"Error",value:a.value,message:"Unexpected closing parenthesis",start:a.start,end:a.end});else{const r=this.parseOr();t={type:"BooleanExpr",operator:"AND",left:t,right:r,implicit:!0,start:t.start,end:r.end}}}return t}peek(){return this.nonWsTokens[this.pos]}advance(){return this.nonWsTokens[this.pos++]}match(t){var a;if(((a=this.peek())==null?void 0:a.type)===t)return this.advance()}parseOr(){var a;let t=this.parseAnd();for(;((a=this.peek())==null?void 0:a.type)===k.OR;){const r=this.advance(),i=this.parseAnd();if(i.type==="Error"&&i.value===""){this.errors.push({type:"Error",value:r.value,message:"Missing search term after OR",start:r.start,end:r.end});break}t={type:"BooleanExpr",operator:"OR",left:t,right:i,sourceOperator:r.value,start:t.start,end:i.end}}return t}parseAnd(){let t=this.parseNot();for(;;){const a=this.peek();if(!a)break;if(a.type===k.AND){const r=this.advance(),i=this.parseNot();if(i.type==="Error"&&i.value===""){this.errors.push({type:"Error",value:r.value,message:"Missing search term after AND",start:r.start,end:r.end});break}t={type:"BooleanExpr",operator:"AND",left:t,right:i,sourceOperator:r.value,start:t.start,end:i.end}}else{if(a.type===k.OR||a.type===k.RPAREN)break;{const r=this.parseNot();t={type:"BooleanExpr",operator:"AND",left:t,right:r,implicit:!0,start:t.start,end:r.end}}}}return t}parseNot(){var t;if(((t=this.peek())==null?void 0:t.type)===k.NOT){const a=this.advance(),r=this.parsePrimary();return r.type==="Error"&&r.value===""?(this.errors.push({type:"Error",value:a.value,message:"Missing search term after NOT",start:a.start,end:a.end}),r):{type:"Not",expression:r,sourceOperator:a.value,start:a.start,end:r.end}}return this.parsePrimary()}applyGroupBoost(t){var a;if(((a=this.peek())==null?void 0:a.type)===k.BOOST){const r=this.advance(),i=r.value.slice(1),u=parseFloat(i);t.boost=isNaN(u)?1:u,t.end=r.end}return t}applyModifiers(t){var a,r;if(t.type!=="BareTerm"&&t.type!=="FieldValue")return t;if(((a=this.peek())==null?void 0:a.type)===k.TILDE){const i=this.advance(),u=i.value.slice(1),o=parseInt(u,10);t.quoted?t.proximity=isNaN(o)?0:o:t.fuzzy=isNaN(o)?0:o,t.end=i.end}if(((r=this.peek())==null?void 0:r.type)===k.BOOST){const i=this.advance(),u=i.value.slice(1),o=parseFloat(u);t.boost=isNaN(o)?1:o,t.end=i.end}return t}parseRangeBound(t,a){const r=t.length-t.trimStart().length,i=t.trim();return i.startsWith('"')&&i.endsWith('"')&&i.length>=2?{value:i.slice(1,-1),quoted:!0,valueStart:a+r,valueEnd:a+r+i.length}:i.startsWith('"')?{value:i.slice(1),quoted:!0,valueStart:a+r,valueEnd:a+r+i.length}:{value:i,quoted:!1,valueStart:a+r,valueEnd:a+r+i.length}}parseRange(t){const a=t.value,r=a[0],i=r==="[",u=a[a.length-1],o=u==="]"||u==="}",h=u==="]";o||this.errors.push({type:"Error",value:r,message:"Unclosed range expression",start:t.start,end:t.start+1});const m=o?a.slice(1,-1):a.slice(1),p=m.match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/),g=t.start+1;if(!p){this.errors.push({type:"Error",value:a,message:"Range expression missing TO keyword",start:t.start,end:t.end});const S=this.parseRangeBound(m,g);return{type:"Range",lower:S.value,upper:"",lowerInclusive:i,upperInclusive:o?h:!0,lowerQuoted:S.quoted,upperQuoted:!1,lowerStart:S.valueStart,lowerEnd:S.valueEnd,upperStart:t.end,upperEnd:t.end,start:t.start,end:t.end}}const x=this.parseRangeBound(p[1],g),b=g+p[1].length+(m.length-p[1].length-p[2].length),w=this.parseRangeBound(p[2],b);return{type:"Range",lower:x.value,upper:w.value,lowerInclusive:i,upperInclusive:o?h:!0,lowerQuoted:x.quoted,upperQuoted:w.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:w.valueStart,upperEnd:w.valueEnd,start:t.start,end:t.end}}parsePrimary(){var r,i,u;const t=this.peek();if(!t)return{type:"Error",value:"",message:"Unexpected end of input",start:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0,end:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0};if(t.type===k.AND){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected AND",start:o.start,end:o.end}),this.parsePrimary()}if(t.type===k.OR){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected OR",start:o.start,end:o.end}),this.parsePrimary()}if(t.type===k.PREFIX_OP){const o=this.advance(),h=this.parsePrimary();return o.value==="-"?{type:"Not",expression:h,sourceOperator:o.value,start:o.start,end:h.end}:{...h,start:o.start}}if(t.type===k.LPAREN){const o=this.advance();if(!this.peek()||this.peek().type===k.RPAREN){const g=this.match(k.RPAREN);g||this.errors.push({type:"Error",value:o.value,message:"Unclosed parenthesis",start:o.start,end:o.end});const x={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:o.end,end:o.end},start:o.start,end:g?g.end:o.end};return this.applyGroupBoost(x)}const h=this.parseOr(),m=this.match(k.RPAREN);m||this.errors.push({type:"Error",value:o.value,message:"Missing closing parenthesis",start:o.start,end:o.end});const p={type:"Group",expression:h,start:o.start,end:m?m.end:h.end};return this.applyGroupBoost(p)}if(t.type===k.SAVED_SEARCH){const o=this.advance();return{type:"SavedSearch",name:o.value.slice(1),start:o.start,end:o.end}}if(t.type===k.HISTORY_REF){const o=this.advance();return{type:"HistoryRef",ref:o.value.slice(1),start:o.start,end:o.end}}if(t.type===k.FIELD_NAME){const o=this.advance(),h=this.match(k.COLON);if(h){let m=":";const p=this.match(k.COMPARISON_OP);if(p&&(m=p.value),((r=this.peek())==null?void 0:r.type)===k.LPAREN){const x=this.advance();if(!this.peek()||this.peek().type===k.RPAREN){const R=this.match(k.RPAREN);R||this.errors.push({type:"Error",value:x.value,message:"Unclosed parenthesis",start:x.start,end:x.end});const C={type:"FieldGroup",field:o.value,expression:{type:"BareTerm",value:"",quoted:!1,start:x.end,end:x.end},start:o.start,end:R?R.end:x.end};return this.applyGroupBoost(C)}const b=this.parseOr(),w=this.match(k.RPAREN);w||this.errors.push({type:"Error",value:x.value,message:"Missing closing parenthesis",start:x.start,end:x.end});const S={type:"FieldGroup",field:o.value,expression:b,start:o.start,end:w?w.end:b.end};return this.applyGroupBoost(S)}if(((i=this.peek())==null?void 0:i.type)===k.RANGE){const x=this.advance(),b=this.parseRange(x);return b.field=o.value,b.start=o.start,b}if(((u=this.peek())==null?void 0:u.type)===k.REGEX){const x=this.advance();return{type:"Regex",pattern:x.value.slice(1,-1),start:o.start,end:x.end}}const g=this.peek();if(g&&(g.type===k.VALUE||g.type===k.QUOTED_VALUE||g.type===k.WILDCARD)){const x=this.advance(),b=x.type===k.QUOTED_VALUE;b&&this.checkUnclosedQuote(x);const w=b?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:o.value,operator:m,value:w,quoted:b,start:o.start,end:x.end})}return{type:"FieldValue",field:o.value,operator:m,value:"",quoted:!1,start:o.start,end:p?p.end:h.end}}return{type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end}}if(t.type===k.COMPARISON_OP){const o=this.advance(),h=this.peek();if(h&&(h.type===k.VALUE||h.type===k.QUOTED_VALUE)){const m=this.advance();return{type:"BareTerm",value:o.value+m.value,quoted:!1,start:o.start,end:m.end}}return{type:"Error",value:o.value,message:"Comparison operator without value",start:o.start,end:o.end}}if(t.type===k.QUOTED_VALUE){const o=this.advance();return this.checkUnclosedQuote(o),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(o),quoted:!0,start:o.start,end:o.end})}if(t.type===k.WILDCARD){const o=this.advance();return this.applyModifiers({type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end})}if(t.type===k.RANGE){const o=this.advance();return this.parseRange(o)}if(t.type===k.REGEX){const o=this.advance();return{type:"Regex",pattern:o.value.slice(1,-1),start:o.start,end:o.end}}if(t.type===k.VALUE){const o=this.advance();return this.applyModifiers({type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end})}if(t.type===k.RPAREN){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected closing parenthesis",start:o.start,end:o.end}),{type:"Error",value:o.value,message:"Unexpected closing parenthesis",start:o.start,end:o.end}}const a=this.advance();return{type:"Error",value:a.value,message:`Unexpected token: ${a.value}`,start:a.start,end:a.end}}static getCursorContext(t,a){let r,i;for(const o of t)if(o.type!==k.WHITESPACE){if(a>=o.start&&a<=o.end){r=o;break}o.end<=a&&(i=o)}const u=o=>{let h=0;for(let m=o;m>=0;m--){const p=t[m];if(p.type!==k.WHITESPACE){if(p.type===k.RPAREN){h++;continue}if(p.type===k.LPAREN){if(h>0){h--;continue}for(let g=m-1;g>=0;g--)if(t[g].type!==k.WHITESPACE){if(t[g].type===k.COLON){for(let x=g-1;x>=0;x--)if(t[x].type!==k.WHITESPACE){if(t[x].type===k.FIELD_NAME)return t[x].value;break}}break}}}}return""};if((r==null?void 0:r.type)===k.COLON){let o="";const h=t.indexOf(r);for(let m=h-1;m>=0;m--){if(t[m].type===k.FIELD_NAME){o=t[m].value;break}if(t[m].type!==k.WHITESPACE)break}if(!o&&a===r.start)return{type:"FIELD_NAME",partial:"",token:r};if(a===r.end){for(let m=h+1;m<t.length;m++)if(t[m].type!==k.WHITESPACE){if(t[m].type===k.VALUE||t[m].type===k.QUOTED_VALUE||t[m].type===k.WILDCARD||t[m].type===k.RANGE)return{type:"FIELD_VALUE",partial:t[m].type===k.QUOTED_VALUE?t[m].value.slice(1,t[m].value.endsWith('"')||t[m].value.endsWith("'")?-1:void 0):t[m].value,fieldName:o,token:t[m]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}}if((r==null?void 0:r.type)===k.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===k.HISTORY_REF)return{type:"HISTORY_REF",partial:r.value.slice(1),token:r};if((r==null?void 0:r.type)===k.RANGE){const o=t.indexOf(r);let h="";for(let m=o-1;m>=0;m--){if(t[m].type===k.FIELD_NAME){h=t[m].value;break}if(!(t[m].type===k.WHITESPACE||t[m].type===k.COLON))break}return{type:"RANGE",partial:"",fieldName:h,token:r}}if((i==null?void 0:i.type)===k.COLON||(i==null?void 0:i.type)===k.COMPARISON_OP){const o=t.indexOf(i);let h="";for(let m=o-1;m>=0;m--){if(t[m].type===k.FIELD_NAME){h=t[m].value;break}if(!(t[m].type===k.WHITESPACE||t[m].type===k.COLON||t[m].type===k.COMPARISON_OP))break}return r&&(r.type===k.VALUE||r.type===k.QUOTED_VALUE||r.type===k.WILDCARD)?{type:"FIELD_VALUE",partial:r.type===k.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:h,token:r}:{type:"FIELD_VALUE",partial:"",fieldName:h,token:i}}if((r==null?void 0:r.type)===k.VALUE||(r==null?void 0:r.type)===k.QUOTED_VALUE||(r==null?void 0:r.type)===k.WILDCARD){const o=t.indexOf(r);for(let h=o-1;h>=0;h--)if(t[h].type!==k.WHITESPACE){if(t[h].type===k.COLON||t[h].type===k.COMPARISON_OP){let m="";for(let p=h-1;p>=0;p--){if(t[p].type===k.FIELD_NAME){m=t[p].value;break}if(!(t[p].type===k.WHITESPACE||t[p].type===k.COLON||t[p].type===k.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:r.type===k.QUOTED_VALUE?r.value.slice(1,r.value.endsWith('"')||r.value.endsWith("'")?-1:void 0):r.value,fieldName:m,token:r}}break}}if((r==null?void 0:r.type)===k.QUOTED_VALUE)return{type:"FIELD_NAME",partial:r.value,token:r};if((r==null?void 0:r.type)===k.FIELD_NAME||(r==null?void 0:r.type)===k.VALUE){const o=u(t.indexOf(r));return o?{type:"FIELD_VALUE",partial:r.value,fieldName:o,token:r}:{type:"FIELD_NAME",partial:r.value,token:r}}if((i==null?void 0:i.type)===k.PREFIX_OP){const o=u(t.indexOf(i));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(i&&(i.type===k.AND||i.type===k.OR||i.type===k.NOT)){const o=u(t.indexOf(i));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(t.length===0||t.every(o=>o.type===k.WHITESPACE))return{type:"EMPTY",partial:""};if((r==null?void 0:r.type)===k.LPAREN||(i==null?void 0:i.type)===k.LPAREN){const o=(r==null?void 0:r.type)===k.LPAREN?r:i,h=u(t.indexOf(o));return h?{type:"FIELD_VALUE",partial:"",fieldName:h,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if((r==null?void 0:r.type)===k.TILDE||(r==null?void 0:r.type)===k.BOOST)return{type:"OPERATOR",partial:""};if(i&&(i.type===k.VALUE||i.type===k.QUOTED_VALUE||i.type===k.RPAREN||i.type===k.RANGE||i.type===k.TILDE||i.type===k.BOOST)){const o=u(t.indexOf(i));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function Mh(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const r=Mh(t.left,a);if(r)return r;const i=Mh(t.right,a);return i||null}return t}function H2(t,a,r){if(!t)return null;const i=Mh(t,r);if(!i)return null;let u=i.start,o=i.end;const h=a.slice(o).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(h)return o+=h[0].length,{start:u,end:o};const m=a.slice(0,u).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return m&&m.index!==void 0&&m.index>0&&(u-=m[0].length),{start:u,end:o}}var B2={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:{}},$2={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"},q2=["AND","OR","NOT"];function Ky(t){return t.replace(/\r\n/g,`
200
+ `).replace(/\r/g,`
201
+ `).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036\u00AB\u00BB]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/[\u00A0\u202F\u2007]/g," ").replace(/[\uFF01-\uFF5E]/g,a=>String.fromCharCode(a.charCodeAt(0)-65248))}var Zy={"(":")","[":"]",'"':'"',"'":"'"};function Y2(t,a,r,i,u){const o=t.slice(0,a),h=t.slice(a,r),m=t.slice(r);return{newValue:o+i+h+u+m,newCursorPos:r+2,newSelStart:a+1,newSelEnd:r+1}}function V2(t){if(!t.textContent)return"";const a=[];function r(i){var u;if(i.nodeType===Node.TEXT_NODE)a.push(i.textContent||"");else if(i.nodeName==="BR")(u=i.hasAttribute)!=null&&u.call(i,"data-sentinel")||a.push(`
202
+ `);else for(let o=0;o<i.childNodes.length;o++)r(i.childNodes[o])}return r(t),a.join("")}function Jy(t,a,r){let i=-1,u=-1;for(let o=0;o<t.length;o++){const h=t[o];a>=h.start&&a<=h.end&&(i=o),u===-1&&r>=h.start&&r<=h.end&&(u=o)}return[i,u]}function F2(t,a,r){if(t){let i=t.end;if(t.type===k.FIELD_NAME&&r){const u=r.indexOf(t);if(u>=0){for(let o=u+1;o<r.length;o++)if(r[o].type!==k.WHITESPACE){r[o].type===k.COLON&&(i=r[o].end);break}}}return{start:t.start,end:i}}return{start:a,end:a}}var ph=class $b{constructor(a,r=[],i=[],u=10,o={}){mn(this,"fields");mn(this,"fieldMap");mn(this,"savedSearches");mn(this,"searchHistory");mn(this,"maxSuggestions");mn(this,"options");mn(this,"defaultFieldName");mn(this,"defaultFieldShowFieldSuggs",!1);this.fields=a,this.fieldMap=new Map(a.map(h=>[h.name,h]));for(const h of a)if(h.aliases)for(const m of h.aliases)this.fieldMap.set(m,h);this.savedSearches=r,this.searchHistory=i,this.maxSuggestions=u,this.options={showSavedSearchHint:o.showSavedSearchHint??!1,showHistoryHint:o.showHistoryHint??!1}}resolveField(a){return this.fieldMap.get(a)}updateSavedSearches(a){this.savedSearches=a}updateSearchHistory(a){this.searchHistory=a}setDefaultField(a){this.defaultFieldName=a==null?void 0:a.name,this.defaultFieldShowFieldSuggs=(a==null?void 0:a.showFieldSuggestions)??!1}getSuggestions(a,r){let i=ls.getCursorContext(a,r);const u=F2(i.token,r,a);if(this.defaultFieldName&&(i.type==="FIELD_NAME"||i.type==="EMPTY")){i={...i,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const o=this.resolveField(this.defaultFieldName);if((o==null?void 0:o.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:i};const h=this.getValueSuggestions(o,i.partial,u.start,u.end);if(this.defaultFieldShowFieldSuggs){const m=this.getFieldSuggestions(i.partial,u.start,u.end);return{suggestions:[...h,...m],showDatePicker:!1,context:i}}return{suggestions:h,showDatePicker:!1,context:i}}switch(i.type){case"FIELD_NAME":case"EMPTY":{const o=this.getFieldSuggestions(i.partial,u.start,u.end),h=!i.partial&&o.length>0?this.getSpecialHints(u.start,u.end):[];return{suggestions:this.sortByPriority([...o,...h]),showDatePicker:!1,context:i}}case"FIELD_VALUE":{const o=i.fieldName?this.resolveField(i.fieldName):void 0;return(o==null?void 0:o.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:i}:{suggestions:this.getValueSuggestions(o,i.partial,u.start,u.end),showDatePicker:!1,context:i}}case"OPERATOR":{const o=this.getOperatorSuggestions(i.partial,u.start,u.end),h=this.getFieldSuggestions("",u.start,u.end),m=this.getSpecialHints(u.start,u.end);return{suggestions:this.sortByPriority([...o,...h,...m]),showDatePicker:!1,context:i}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(i.partial,u.start,u.end),showDatePicker:!1,context:i};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(i.partial,u.start,u.end),showDatePicker:!1,context:i};case"RANGE":{const o=i.fieldName?this.resolveField(i.fieldName):void 0;return(o==null?void 0:o.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:i}:{suggestions:[],showDatePicker:!1,context:i}}default:return{suggestions:[],showDatePicker:!1,context:i}}}getFieldSuggestions(a,r,i){const u=a.toLowerCase();return this.fields.filter(o=>!o.hide).map(o=>{const h=o.name.toLowerCase(),m=(o.label||"").toLowerCase(),p=(o.aliases||[]).map(x=>x.toLowerCase());let g=0;return h.startsWith(u)?g=4:m.startsWith(u)||p.some(x=>x.startsWith(u))?g=3:h.includes(u)?g=2:(m.includes(u)||p.some(x=>x.includes(u)))&&(g=1),{field:o,score:g}}).filter(o=>o.score>0).sort((o,h)=>h.score-o.score).slice(0,this.maxSuggestions).map(o=>({text:o.field.name+":",label:o.field.label||o.field.name,description:o.field.description,type:o.field.type,replaceStart:r,replaceEnd:i,matchPartial:a,priority:10}))}getValueSuggestions(a,r,i,u){if(!a)return[];if(a.type==="boolean")return["true","false"].filter(o=>o.startsWith(r.toLowerCase())).map(o=>({text:o,label:o,type:"boolean",replaceStart:i,replaceEnd:u,matchPartial:r}));if(a.placeholder!==!1){const o=a.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[a.type];if(o)return[{text:"",label:o,type:"hint",replaceStart:i,replaceEnd:u}]}return[]}getOperatorSuggestions(a,r,i){const u=a.toLowerCase();return q2.filter(o=>o.toLowerCase().startsWith(u)).map(o=>({text:o+" ",label:o,description:o==="AND"?"Both conditions must match":o==="OR"?"Either condition must match":"Negate the following condition",type:"operator",replaceStart:r,replaceEnd:i,matchPartial:a,priority:30}))}sortByPriority(a){return a.sort((r,i)=>(i.priority??0)-(r.priority??0))}getSpecialHints(a,r){const i=[],u=this.savedSearches.length>0||this.options.hasSavedSearchProvider,o=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&u&&i.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:a,replaceEnd:r,priority:20}),this.options.showHistoryHint&&o&&i.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:a,replaceEnd:r,priority:20}),i}getSavedSearchSuggestions(a,r,i){return this.savedSearches.slice(0,this.maxSuggestions).map(u=>({text:u.query,label:u.label||u.query,description:u.description,type:"savedSearch",replaceStart:r,replaceEnd:i,matchPartial:a,sourceData:u}))}getHistorySuggestions(a,r,i){return this.searchHistory.slice(0,this.maxSuggestions).map(u=>({text:$b.wrapHistoryQuery(u.query),label:u.label||u.query,description:u.description,type:"history",replaceStart:r,replaceEnd:i,matchPartial:a,sourceData:u}))}static wrapHistoryQuery(a){try{const r=new ls(new Ks(a).tokenize()).parse();if(r&&r.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function nc(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var G2=[/^\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 X2(t){for(const a of G2)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function gh(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function I2(t){if(/^now$/i.test(t))return new Date;const a=t.match(/^now([+-])(\d+)([dhms])$/i);if(a){const u=new Date,o=a[1]==="+"?1:-1,h=parseInt(a[2],10);switch(a[3].toLowerCase()){case"d":u.setDate(u.getDate()+o*h);break;case"h":u.setHours(u.getHours()+o*h);break;case"m":u.setMinutes(u.getMinutes()+o*h);break;case"s":u.setSeconds(u.getSeconds()+o*h);break}return u}const r=t.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/);if(r)return new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10));const i=new Date(t);return isNaN(i.getTime())?null:i}function Wy(t,a){return new Date(t,a+1,0).getDate()}function Q2(t,a){return new Date(t,a,1).getDay()}function uu(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function ex(t,a,r){if(!a||!r)return!1;const i=t.getTime(),u=a.getTime(),o=r.getTime();return i>=Math.min(u,o)&&i<=Math.max(u,o)}var P2=["January","February","March","April","May","June","July","August","September","October","November","December"];function K2(t){return P2[t]}function ac(t,a){if(t==="")return null;const r=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(r){const i=vh(r[1].trim(),a);if(i)return`Range start: ${i}`;const u=vh(r[2].trim(),a);return u?`Range end: ${u}`:null}return vh(t,a)}function vh(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||X2(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function lc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var rc={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function sc(t){if(t.length<=1)return t;const a=[...t].sort((i,u)=>{const o=rc[i.type??"SYNTAX_ERROR"],h=rc[u.type??"SYNTAX_ERROR"];return o!==h?o-h:i.start-u.start}),r=[];for(const i of a)r.some(u=>rc[u.type??"SYNTAX_ERROR"]<rc[i.type??"SYNTAX_ERROR"]&&u.start<=i.start&&u.end>=i.end)||r.push(i);return r}var tx=class{constructor(t){mn(this,"fields");this.fields=new Map(t.map(a=>[a.name,a]));for(const a of t)if(a.aliases)for(const r of a.aliases)this.fields.set(r,a)}validate(t,a,r,i){if(!t)return[];const u=[],o=i?this.fields.get(i):void 0;return this.walkNode(t,u,a,r,o),this.checkAmbiguousPrecedence(t,u),u}walkNode(t,a,r,i,u){switch(t.type){case"BareTerm":if(t.fuzzy!==void 0&&t.fuzzy>2&&a.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${t.fuzzy})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),t.proximity!==void 0&&t.proximity<0&&a.push({message:`Proximity value must be non-negative (got ${t.proximity})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),u&&t.value!==""){let o=null;switch(u.type){case"number":o=nc(t.value);break;case"date":o=ac(t.value,i);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(o=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(o=`"${t.value}" is not a valid IP address`);break}o&&a.push({message:o,start:t.start,end:t.end,field:u.name,type:"INVALID_VALUE"})}if(r&&t.value!==""){const o=lc(r({value:t.value,position:"bare_term",quoted:t.quoted,fieldName:u==null?void 0:u.name,fieldConfig:u}));o&&a.push({message:o.message,start:t.start,end:t.end,severity:o.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(t,a),t.field&&t.field!=="*"){const o=this.fields.get(t.field);o?this.validateRangeBounds(o,t,a,r,i):a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"})}break;case"FieldValue":{if(t.field==="*")return;if(t.value===""){const m=t.operator===":"?":":t.operator;a.push({message:`Missing value after "${t.field}${m}"`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});return}const o=this.fields.get(t.field);if(!o){a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"});return}t.fuzzy!==void 0&&t.fuzzy>2&&a.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${t.fuzzy})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"}),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});let h=null;switch(o.type){case"number":h=nc(t.value);break;case"date":h=ac(t.value,i);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(h=`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("*")&&(h=`"${t.value}" is not a valid IP address`);break}if(t.operator!==":"&&o.type!=="number"&&o.type!=="date"&&(h=`Comparison operator "${t.operator}" is not valid for ${o.type} fields`),!h&&r){const m=lc(r({value:t.value,position:"field_value",fieldName:o.name,fieldConfig:o,quoted:t.quoted,operator:t.operator!==":"?t.operator:void 0}));if(m){const p=t.end-t.value.length;a.push({message:m.message,start:p,end:t.end,field:t.field,severity:m.severity,type:"CUSTOM"})}}if(h){const m=t.end-t.value.length,p=t.operator!==":"&&o.type!=="number"&&o.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";a.push({message:h,start:m,end:t.end,field:t.field,type:p})}break}case"FieldGroup":if(t.field==="*")this.walkNode(t.expression,a,r,i,u);else{const o=this.fields.get(t.field);o?this.walkFieldGroup(t.expression,o,a,r,i):a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"})}t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break;case"BooleanExpr":this.walkNode(t.left,a,r,i,u),this.walkNode(t.right,a,r,i,u);break;case"Group":this.walkNode(t.expression,a,r,i,u),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break;case"Not":this.walkNode(t.expression,a,r,i,u);break;case"Error":a.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,a,r,i,u){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(a,t.value,t.quoted,":",t.start,t.end,r,i,u);break;case"FieldValue":this.walkNode(t,r,i,u);break;case"Range":this.validateRangeBounds(a,t,r,i,u);break;case"BooleanExpr":this.walkFieldGroup(t.left,a,r,i,u),this.walkFieldGroup(t.right,a,r,i,u);break;case"Group":this.walkFieldGroup(t.expression,a,r,i,u);break;case"Not":this.walkFieldGroup(t.expression,a,r,i,u);break;default:this.walkNode(t,r,i,u);break}}validateFieldValue(t,a,r,i,u,o,h,m,p){let g=null;switch(t.type){case"number":g=nc(a);break;case"date":g=ac(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=lc(m({value:a,position:"field_group_term",fieldName:t.name,fieldConfig:t,quoted:r,operator:i!==":"?i:void 0}));x&&h.push({message:x.message,start:u,end:o,field:t.name,severity:x.severity,type:"CUSTOM"})}if(g){const x=i!==":"&&t.type!=="number"&&t.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";h.push({message:g,start:u,end:o,field:t.name,type:x})}}validateEmptyRangeBounds(t,a){t.lower!=="*"&&t.lower.trim()===""&&a.push({message:"Missing lower bound in range",start:t.start,end:t.start+1,field:t.field,type:"SYNTAX_ERROR"}),t.upper!=="*"&&t.upper.trim()===""&&a.push({message:"Missing upper bound in range",start:t.end-1,end:t.end,field:t.field,type:"SYNTAX_ERROR"})}validateRangeBounds(t,a,r,i,u){const o=[];a.lower!=="*"&&a.lower.trim()!==""&&o.push({value:a.lower,label:"Range start",start:a.lowerStart,end:a.lowerEnd,position:"range_start",inclusive:a.lowerInclusive}),a.upper!=="*"&&a.upper.trim()!==""&&o.push({value:a.upper,label:"Range end",start:a.upperStart,end:a.upperEnd,position:"range_end",inclusive:a.upperInclusive});for(const h of o){let m=null;switch(t.type){case"number":m=nc(h.value),m&&(m=`${h.label}: ${m}`);break;case"date":m=ac(h.value,u),m&&(m=`${h.label}: ${m}`);break;case"boolean":m="Range queries are not supported for boolean fields";break}if(!m&&i){const p=lc(i({value:h.value,position:h.position,fieldName:t.name,fieldConfig:t,quoted:!1,inclusive:h.inclusive}));p&&r.push({message:p.message,start:h.start,end:h.end,field:t.name,severity:p.severity,type:"CUSTOM"})}if(m){const p=t.type==="boolean"?"SYNTAX_ERROR":"INVALID_VALUE";r.push({message:m,start:h.start,end:h.end,field:t.name,type:p})}}}checkAmbiguousPrecedence(t,a){const r=new Set;this.findAndFlagAmbiguity(t,a,r)}findAndFlagAmbiguity(t,a,r){if(t.type==="BooleanExpr"&&!r.has(t)){const i=new Set,u=[];this.collectBoolOps(t,i,u),i.size>1&&(a.push({message:"Ambiguous precedence: mix of AND and OR without parentheses. Add parentheses to clarify.",start:t.start,end:t.end,severity:"warning",type:"AMBIGUOUS_PRECEDENCE"}),u.forEach(o=>r.add(o))),this.collectLeaves(t).forEach(o=>this.findAndFlagAmbiguity(o,a,r))}else t.type==="Group"||t.type==="FieldGroup"?this.findAndFlagAmbiguity(t.expression,a,r):t.type==="Not"?this.findAndFlagAmbiguity(t.expression,a,r):t.type==="BooleanExpr"&&this.collectLeaves(t).forEach(i=>this.findAndFlagAmbiguity(i,a,r))}collectBoolOps(t,a,r){t.type==="BooleanExpr"&&(a.add(t.operator),r.push(t),this.collectBoolOps(t.left,a,r),this.collectBoolOps(t.right,a,r))}collectLeaves(t){return t.type!=="BooleanExpr"?[t]:[...this.collectLeaves(t.left),...this.collectLeaves(t.right)]}};function Aa(...t){return t.filter(Boolean).join(" ")}function Uu(t){return{...B2,...t}}function Hu(t){return{...$2,...t}}function Z2(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function J2(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 W2(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function eT(t,a){const r=a.inputPadding.split(/\s+/),i=r[0]||"8px";return{position:"absolute",top:i,left:r.length>=4?r[3]:r.length>=2?r[1]:i,right:r.length>=4||r.length>=2?r[1]:i,color:t.placeholder,pointerEvents:"none",fontSize:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,userSelect:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}function qb(t,a){return{position:"absolute",zIndex:a.dropdownZIndex,backgroundColor:t.background,border:`1px solid ${a.dropdownBorderColor}`,borderRadius:a.dropdownBorderRadius,boxShadow:a.dropdownShadow,maxHeight:a.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:a.dropdownMinWidth,maxWidth:a.dropdownMaxWidth,padding:"4px 0"}}function nx(t,a,r){return{padding:r.dropdownItemPadding,cursor:"pointer",fontSize:r.dropdownItemFontSize,fontFamily:r.fontFamily,backgroundColor:t?a.dropdownSelected:"transparent",color:t?"#ffffff":a.text,display:"flex",alignItems:"center",gap:r.dropdownItemContentGap,lineHeight:"1.4"}}function Vs(t){return{flex:1,fontWeight:500}}function yh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function tT(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 nT(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 aT={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function lT(t){const a=[];let r=0,i="";function u(){i&&(a.push({type:"text",text:i}),i="")}t.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),r=1);const o=t.lastIndexOf("/"),h=o>0?o:t.length;for(;r<h;){const m=t[r];if(m==="\\"&&r+1<h){u(),a.push({type:"escape",text:t.slice(r,r+2)}),r+=2;continue}if(m==="["){u();let p=r+1;for(p<h&&t[p]==="^"&&p++,p<h&&t[p]==="]"&&p++;p<h&&t[p]!=="]";)t[p]==="\\"&&p+1<h&&p++,p++;p<h&&p++,a.push({type:"charClass",text:t.slice(r,p)}),r=p;continue}if(m==="("){u();let p="(";if(r+1<h&&t[r+1]==="?"){let g=r+2;for(;g<h&&g<r+4&&/[:<>=!]/.test(t[g]);)g++;p=t.slice(r,g)}a.push({type:"groupOpen",text:p}),r+=p.length;continue}if(m===")"){u(),a.push({type:"groupClose",text:")"}),r++;continue}if(m==="+"||m==="*"||m==="?"){u();let p=m;r+1<h&&t[r+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),r+=p.length;continue}if(m==="{"){u();let p=r+1;for(;p<h&&t[p]!=="}";)p++;p<h&&p++,a.push({type:"quantifier",text:t.slice(r,p)}),r=p;continue}if(m==="^"||m==="$"){u(),a.push({type:"anchor",text:m}),r++;continue}if(m==="|"){u(),a.push({type:"alternation",text:"|"}),r++;continue}i+=m,r++}return u(),o>0&&o<t.length&&a.push({type:"delimiter",text:"/"}),a}function rT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function sT(t,a,r){const i=lT(t.value).map(u=>{const o=a[aT[u.type]]||a.regexText,h=u.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${u.type}" style="color:${o};font-weight:${h}">${rT(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--regex${r?" "+r:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${i}</span>`}var iT={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function uT(t){const a=[];let r=0;r<t.length&&(t[r]==="["||t[r]==="{")&&(a.push({type:"bracket",text:t[r]}),r++);const i=t.length-1,u=i>=0&&(t[i]==="]"||t[i]==="}"),o=u?i:t.length;for(;r<o;){const h=t[r];if(h===" "||h===" "){let p=r;for(;p<o&&(t[p]===" "||t[p]===" ");)p++;a.push({type:"whitespace",text:t.slice(r,p)}),r=p;continue}if((h==="T"||h==="t")&&r+1<o&&(t[r+1]==="O"||t[r+1]==="o")){const p=r===0||t[r-1]===" "||t[r-1]===" "||t[r-1]==="["||t[r-1]==="{",g=r+2>=o||t[r+2]===" "||t[r+2]===" ";if(p&&g){a.push({type:"toKeyword",text:t.slice(r,r+2)}),r+=2;continue}}if(h==='"'){let p=r+1;for(;p<o&&t[p]!=='"';)t[p]==="\\"&&p+1<o&&p++,p++;p<o&&p++,a.push({type:"quotedValue",text:t.slice(r,p)}),r=p;continue}if(h==="*"){a.push({type:"wildcard",text:"*"}),r++;continue}let m=r;for(;m<o&&t[m]!==" "&&t[m]!==" "&&t[m]!=='"';)m++;if(m>r){const p=t.slice(r,m);a.push({type:"bareValue",text:p}),r=m}else a.push({type:"bareValue",text:h}),r++}return u&&a.push({type:"bracket",text:t[i]}),a}function ax(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function oT(t,a,r){const i=uT(t.value).map(u=>{if(u.type==="whitespace")return ax(u.text);const o=a[iT[u.type]]||a.fieldValue,h=u.type==="toKeyword"||u.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${u.type}" style="color:${o};font-weight:${h}">${ax(u.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--range${r?" "+r:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${i}</span>`}function Yb(t,a){if(a<0)return null;const r=t.filter(o=>o.type===k.LPAREN||o.type===k.RPAREN);if(r.length===0)return null;const i=r.find(o=>o.end===a);if(i){const o=lx(r,i);if(o)return o}const u=r.find(o=>o.start===a);if(u){const o=lx(r,u);if(o)return o}return null}function lx(t,a){if(a.type===k.LPAREN){const r=t.indexOf(a);let i=0;for(let u=r;u<t.length;u++)if(t[u].type===k.LPAREN?i++:t[u].type===k.RPAREN&&i--,i===0)return{openStart:a.start,closeStart:t[u].start}}else{const r=t.indexOf(a);let i=0;for(let u=r;u>=0;u--)if(t[u].type===k.RPAREN?i++:t[u].type===k.LPAREN&&i--,i===0)return{openStart:t[u].start,closeStart:a.start}}return null}var cT={[k.FIELD_NAME]:"field-name",[k.COLON]:"colon",[k.VALUE]:"value",[k.QUOTED_VALUE]:"quoted-value",[k.AND]:"and",[k.OR]:"or",[k.NOT]:"not",[k.COMPARISON_OP]:"comparison-op",[k.LPAREN]:"lparen",[k.RPAREN]:"rparen",[k.SAVED_SEARCH]:"saved-search",[k.HISTORY_REF]:"history-ref",[k.PREFIX_OP]:"prefix-op",[k.WILDCARD]:"wildcard",[k.REGEX]:"regex",[k.RANGE]:"range",[k.TILDE]:"tilde",[k.BOOST]:"boost",[k.WHITESPACE]:"whitespace",[k.UNKNOWN]:"unknown"},dT={[k.FIELD_NAME]:"fieldName",[k.COLON]:"operator",[k.VALUE]:"fieldValue",[k.QUOTED_VALUE]:"quoted",[k.AND]:"booleanOp",[k.OR]:"booleanOp",[k.NOT]:"booleanOp",[k.COMPARISON_OP]:"operator",[k.LPAREN]:"paren",[k.RPAREN]:"paren",[k.SAVED_SEARCH]:"savedSearch",[k.HISTORY_REF]:"historyRef",[k.PREFIX_OP]:"operator",[k.WILDCARD]:"wildcard",[k.REGEX]:"quoted",[k.RANGE]:"fieldValue",[k.TILDE]:"operator",[k.BOOST]:"operator",[k.WHITESPACE]:"text",[k.UNKNOWN]:"error"};function Fs(t,a,r){const i=Uu(a);if(t.length===0)return"";const u=(r==null?void 0:r.cursorOffset)!==void 0?Yb(t,r.cursorOffset):null,o=a==null?void 0:a.valueTypes,h=r==null?void 0:r.fieldTypeMap;let m;if(o&&h){m=new Array(t.length);let g,x=!1;const b=[];for(let w=0;w<t.length;w++){const S=t[w];S.type===k.FIELD_NAME?(g=S.value,x=!1):S.type===k.COLON&&g?x=!0:S.type===k.WHITESPACE||(S.type===k.LPAREN?(x&&g?b.push(h.get(g.toLowerCase())):b.push(void 0),g=void 0,x=!1):S.type===k.RPAREN?(b.pop(),g=void 0,x=!1):S.type===k.VALUE||S.type===k.QUOTED_VALUE||S.type===k.RANGE||S.type===k.REGEX||S.type===k.WILDCARD?(x&&g?m[w]=h.get(g.toLowerCase()):b.length>0&&(m[w]=b[b.length-1]),g=void 0,x=!1):(S.type===k.AND||S.type===k.OR||(S.type,k.NOT),g=void 0,x=!1))}}let p=t.map((g,x)=>{let b=i[dT[g.type]||"text"]||i.text;if(o&&m){const C=m[x];C&&o[C]&&(b=o[C])}const w=fT(g.value);if(g.type===k.WHITESPACE)return w.replace(/\n/g,"<br>");if(g.type===k.REGEX)return sT(g,i,r==null?void 0:r.tokenClassName);if(g.type===k.RANGE)return oT(g,i,r==null?void 0:r.tokenClassName);let S="normal";(g.type===k.AND||g.type===k.OR||g.type===k.NOT)&&(S="600"),g.type===k.FIELD_NAME&&(S="500");let R="";return u&&(g.type===k.LPAREN||g.type===k.RPAREN)&&(g.start===u.openStart||g.start===u.closeStart)&&(S="700",R=`background-color:${i.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${cT[g.type]}${r!=null&&r.tokenClassName?" "+r.tokenClassName:""}`}" style="color:${b};font-weight:${S};${R}" data-token-start="${g.start}" data-token-end="${g.end}">${w}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function fT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}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 rx(t,a,r){if(!a||a.length===0)return t;const i=t.toLowerCase(),u=a.toLowerCase(),o=i.indexOf(u);if(o===-1)return t;const h=t.slice(0,o),m=t.slice(o,o+a.length),p=t.slice(o+a.length),g={fontWeight:700,textDecoration:"underline",textDecorationColor:r?"rgba(255,255,255,0.6)":"#0969da",textUnderlineOffset:"2px"};return v.createElement(v.Fragment,null,h,v.createElement("span",{className:"ei-highlight-match",style:g},m),p)}function hT({suggestions:t,selectedIndex:a,onSelect:r,position:i,colors:u,styles:o,visible:h,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:b,listRefCallback:w,renderType:S,classNames:R}){const C=v.useRef(null),N=v.useRef(null);v.useEffect(()=>{const D=document.createElement("div");return document.body.appendChild(D),C.current=D,()=>{document.body.removeChild(D),C.current=null}},[]);const z=x&&b?x(b):null,I=z!=null;if(v.useEffect(()=>{if(N.current){const D=I?a+1:a,j=N.current.children[D];j&&j.scrollIntoView({block:"nearest"})}},[a,I]),!C.current||!h||t.length===0||!i)return null;const q=Uu(u),Q=Hu(o),ee={...qb(q,Q),top:`${i.top}px`,left:`${i.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},te=v.createElement("div",{className:Aa("ei-dropdown",R==null?void 0:R.dropdown),style:ee,ref:D=>{N.current=D,w==null||w(D)},onMouseDown:D=>D.preventDefault()},I&&v.createElement("div",{className:Aa("ei-dropdown-header",R==null?void 0:R.dropdownHeader),style:{padding:Q.dropdownItemPadding||"4px 10px",fontSize:"11px",color:q.placeholder,borderBottom:`1px solid ${q.dropdownHover}`,userSelect:"none"}},z),t.map((D,j)=>{const re=j===a,ue=nx(re,q,Q),xe=(B,V,de)=>({key:j,className:Aa("ei-dropdown-item",B,re&&"ei-dropdown-item--selected",R==null?void 0:R.dropdownItem),style:{...ue,...V},title:de,onClick:()=>r(D),onMouseEnter:fe=>{fe.currentTarget.style.backgroundColor=re?q.dropdownSelected:q.dropdownHover},onMouseLeave:fe=>{fe.currentTarget.style.backgroundColor=re?q.dropdownSelected:"transparent"}}),pe=B=>{if(S===!1||!D.type||D.type==="hint")return null;const V=typeof S=="function"?S(D.type,{text:D.text,label:D.label,description:D.description,type:D.type}):D.type;return V!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...tT(re,Q),...B}},V):null},Te={flexDirection:"column",alignItems:"flex-start"},Ae={display:"flex",alignItems:"center",gap:Q.dropdownItemContentGap,width:"100%"};if(D.type==="hint"&&(D.text==="#"||D.text==="!"))return v.createElement("div",{...xe("ei-dropdown-item--hint",{opacity:re?1:.7}),onMouseEnter:B=>{B.currentTarget.style.backgroundColor=re?q.dropdownSelected:q.dropdownHover,B.currentTarget.style.opacity="1"},onMouseLeave:B=>{B.currentTarget.style.backgroundColor=re?q.dropdownSelected:"transparent",B.currentTarget.style.opacity=re?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:Vs()},D.label),D.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:yh()},D.description));if(D.type==="error")return v.createElement("div",{key:j,className:Aa("ei-dropdown-item","ei-dropdown-item--error",R==null?void 0:R.dropdownItem),style:{...ue,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...Vs(),color:q.error}},D.label||"Error loading suggestions"));if(D.type==="noResults")return v.createElement("div",{key:j,className:Aa("ei-dropdown-item","ei-dropdown-item--no-results",R==null?void 0:R.dropdownItem),style:{...ue,cursor:"default",opacity:.7}},D.customContent);if(D.type==="loading")return v.createElement("div",{key:j,className:Aa("ei-dropdown-item","ei-dropdown-item--loading",R==null?void 0:R.dropdownItem),style:{...ue,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...Vs(),fontStyle:"italic"}},D.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:`${q.placeholder} transparent ${q.placeholder} transparent`,borderRadius:"50%"}}));if(D.type==="hint"){const B=nx(!1,q,Q);return v.createElement("div",{key:j,className:Aa("ei-dropdown-item","ei-dropdown-item--hint",R==null?void 0:R.dropdownItem),style:{...B,cursor:"default",opacity:D.customContent?1:.6}},D.customContent?D.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:Vs()},D.label))}if(D.type==="history"&&p&&D.sourceData){const B=p(D.sourceData,re);if(B!=null)return v.createElement("div",xe("ei-dropdown-item--history",Te),B)}if(D.type==="savedSearch"&&g&&D.sourceData){const B=g(D.sourceData,re);if(B!=null)return v.createElement("div",xe("ei-dropdown-item--saved-search"),B)}if((D.type==="history"||D.type==="savedSearch")&&D.description!=null){const B=D.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let V;const de=D.text.startsWith("(")&&D.text.endsWith(")")?D.text.slice(1,-1):D.text;return D.label!==de&&(V=D.text),v.createElement("div",xe(B,Te,V),v.createElement("span",{className:"ei-dropdown-item-label",style:{...Vs(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},rx(D.label,D.matchPartial,re)),v.createElement("span",{style:Ae},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...yh(),flex:1}},D.description),pe({marginLeft:"auto"})))}const Re=D.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",xe(Re),v.createElement("span",{className:"ei-dropdown-item-label",style:Vs()},rx(D.label,D.matchPartial,re)),D.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:yh()},D.description),pe())}));return Zl.createPortal(te,C.current)}var mT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xh(t){return Math.floor(t/10)*10}function pT({onSelect:t,colors:a,styles:r,initialMode:i,initialStart:u,initialEnd:o,presets:h,className:m}){const p=i==="range"&&o?o:u??new Date,[g,x]=v.useState(i??"single"),[b,w]=v.useState("days"),[S,R]=v.useState(p.getFullYear()),[C,N]=v.useState(p.getMonth()),[z,I]=v.useState(u??null),[q,Q]=v.useState(o??null),[ee,te]=v.useState(null),D=Uu(a),j=nT(D,Hu(r)),re=()=>{b==="days"?C===0?(N(11),R(le=>le-1)):N(le=>le-1):R(b==="months"?le=>le-1:le=>le-10)},ue=()=>{b==="days"?C===11?(N(0),R(le=>le+1)):N(le=>le+1):R(b==="months"?le=>le+1:le=>le+10)},xe=()=>{R(b==="days"?le=>le-1:b==="months"?le=>le-10:le=>le-100)},pe=()=>{R(b==="days"?le=>le+1:b==="months"?le=>le+10:le=>le+100)},Te=()=>{b==="days"?w("months"):b==="months"&&w("years")},Ae=le=>{N(le),w("days")},Re=le=>{R(le),w("months")},B=le=>{if(g==="single"){t(gh(le));return}if(!z||q)I(le),Q(null),te(null);else{const[Le,at]=z<=le?[z,le]:[le,z];I(Le),Q(at),te(null),t(`[${gh(Le)} TO ${gh(at)}]`)}},V=z&&!q?ee:q,de=le=>{x(le),I(null),Q(null),te(null)},fe=b==="days"?`${K2(C)} ${S}`:b==="months"?`${S}`:`${xh(S)}–${xh(S)+9}`,Ne=b!=="years",O=new Date,X=Wy(S,C),se=Q2(S,C),ce=["Su","Mo","Tu","We","Th","Fr","Sa"],we=[],Se=(le,Le,at)=>{const Xt=uu(le,O),Cn=z&&uu(le,z),pn=V&&uu(le,V),_t=ex(le,z,V),Wt=Cn||pn,Yn={...j.day,...at?j.dayOtherMonth:{},...Xt?j.dayToday:{},..._t?j.dayInRange:{},...Wt?j.daySelected:{}},ye=g==="range"&&z&&!q;return v.createElement("button",{key:Le,className:"ei-datepicker-day",style:Yn,onClick:()=>B(le),onMouseEnter:Oe=>{ye?te(le):Wt||(Oe.currentTarget.style.backgroundColor=D.dropdownHover)},onMouseLeave:Oe=>{!ye&&!Wt&&(Oe.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},le.getDate())};if(se>0){const le=Wy(S,C-1);for(let Le=se-1;Le>=0;Le--){const at=le-Le,Xt=new Date(S,C-1,at);we.push(Se(Xt,`prev${at}`,!0))}}for(let le=1;le<=X;le++){const Le=new Date(S,C,le);we.push(Se(Le,String(le),!1))}const He=we.length%7;if(He>0){const le=7-He;for(let Le=1;Le<=le;Le++){const at=new Date(S,C+1,Le);we.push(Se(at,`next${Le}`,!0))}}const it={...j.day,padding:"10px 4px",fontSize:"13px"},Fe={...it,...j.dayToday},et=h??[{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"}],en={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},qt=le=>{le.currentTarget.style.backgroundColor="#eef1f5"},ut=le=>{le.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:Aa("ei-datepicker",m),style:j.container,onMouseDown:le=>le.preventDefault(),onMouseLeave:()=>te(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:j.rangeToggle},["single","range"].map(le=>v.createElement("button",{key:le,style:{...j.rangeToggleButton,...g===le?j.rangeToggleButtonActive:{}},onClick:()=>de(le)},le.charAt(0).toUpperCase()+le.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:j.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:j.navButton,onClick:xe,onMouseEnter:qt,onMouseLeave:ut},"«"),v.createElement("button",{style:j.navButton,onClick:re,onMouseEnter:qt,onMouseLeave:ut},"‹")),v.createElement("button",{style:{...j.monthLabel,backgroundColor:"transparent",border:"none",cursor:Ne?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:Ne?Te:void 0,onMouseEnter:le=>{Ne&&(le.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:le=>{le.currentTarget.style.backgroundColor="transparent"}},fe),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:j.navButton,onClick:ue,onMouseEnter:qt,onMouseLeave:ut},"›"),v.createElement("button",{style:j.navButton,onClick:pe,onMouseEnter:qt,onMouseLeave:ut},"»"))),b==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:j.weekDays},ce.map(le=>v.createElement("div",{key:le,style:j.weekDay},le))),v.createElement("div",{className:"ei-datepicker-days",style:j.days},we)),b==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},mT.map((le,Le)=>{const at=new Date(S,Le,1),Xt=ex(at,z,V),Cn=z&&uu(new Date(z.getFullYear(),z.getMonth(),1),at)||V&&uu(new Date(V.getFullYear(),V.getMonth(),1),at),pn=Le===O.getMonth()&&S===O.getFullYear(),_t=g==="range"&&z&&!q;return v.createElement("button",{key:le,style:{...pn?Fe:it,...Xt?j.dayInRange:{},...Cn?j.daySelected:{}},onClick:()=>Ae(Le),onMouseEnter:Wt=>{_t?te(at):Cn||(Wt.currentTarget.style.backgroundColor=D.dropdownHover)},onMouseLeave:Wt=>{!_t&&!Cn&&(Wt.currentTarget.style.backgroundColor=Xt?"rgba(9, 105, 218, 0.1)":"transparent")}},le)})),b==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(le,Le)=>{const at=xh(S)-1+Le,Xt=Le===0||Le===11,Cn=at===O.getFullYear(),pn=new Date(at,0,1),_t=z&&V&&at>=Math.min(z.getFullYear(),V.getFullYear())&&at<=Math.max(z.getFullYear(),V.getFullYear()),Wt=z&&z.getFullYear()===at||V&&V.getFullYear()===at,Yn=g==="range"&&z&&!q;return v.createElement("button",{key:at,style:{...Cn?Fe:it,...Xt?j.dayOtherMonth:{},..._t?j.dayInRange:{},...Wt?j.daySelected:{}},onClick:()=>Re(at),onMouseEnter:ye=>{Yn?te(pn):Wt||(ye.currentTarget.style.backgroundColor=D.dropdownHover)},onMouseLeave:ye=>{!Yn&&!Wt&&(ye.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},at)})),(()=>{const le=et.filter(Le=>!Le.type||Le.type===g);return le.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...j.quickOptions,...en}},le.map(Le=>v.createElement("button",{key:`${Le.type??"both"}-${Le.value}`,style:j.quickOption,onClick:()=>t(Le.value)},Le.label)))})())}var gT=30,vT=150;function sx(t,a){let r=0;const i=u=>{if(u.nodeType===Node.TEXT_NODE){const o=(u.textContent||"").length;return r+o>=a?{node:u,offset:a-r}:(r+=o,null)}if(u.nodeName==="BR"){if(r+1>=a){const o=u.parentNode;if(o)return{node:o,offset:Array.from(o.childNodes).indexOf(u)+1}}return r+=1,null}for(let o=0;o<u.childNodes.length;o++){const h=i(u.childNodes[o]);if(h)return h}return null};return i(t)}function yT(t,a,r){const i=sx(t,a),u=sx(t,r);if(!i||!u)return[];const o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(u.node,u.offset);const h=t.getBoundingClientRect(),m=o.getClientRects();if(m.length===0)return[];const p=[];for(let g=0;g<m.length;g++){const x=m[g];x.width<1||p.push({left:x.left-h.left,top:x.top-h.top,width:Math.max(x.width,6),height:x.height})}return p}function xT(t,a,r){if(!a||t.length===0)return[];const i=[];let u=0;for(const o of t){if(u>=gT)break;if(r>=o.start&&r<=o.end)continue;const h=yT(a,o.start,o.end);for(const m of h)i.push({left:m.left,top:m.top,width:m.width,height:m.height,error:o});u++}return i}var ix=28,ux=4;function bT(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 ST({errors:t,editorRef:a,cursorOffset:r,colors:i,styles:u,containerRef:o,classNames:h}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[b,w]=v.useState([]),S=v.useRef([]),R=v.useRef(null),C=v.useRef(null);if(v.useEffect(()=>{if(C.current&&clearTimeout(C.current),t.length===0){w([]),S.current=[],p(null);return}return C.current=setTimeout(()=>{const q=xT(t,a,r);w(q),S.current=q},vT),()=>{C.current&&clearTimeout(C.current)}},[t,a,r]),v.useEffect(()=>{const q=o;if(!q||!a)return;const Q=D=>{const j=a.getBoundingClientRect(),re=D.clientX-j.left,ue=D.clientY-j.top;let xe=-1;for(let pe=0;pe<S.current.length;pe++){const Te=S.current[pe];if(re>=Te.left&&re<=Te.left+Te.width&&ue>=Te.top&&ue<=Te.top+Te.height+6){xe=pe;break}}xe>=0?(p(xe),x({x:re,clientY:D.clientY})):p(null)},ee=()=>{p(null)},te=new AbortController;return q.addEventListener("mousemove",Q,{signal:te.signal}),q.addEventListener("mouseleave",ee,{signal:te.signal}),()=>te.abort()},[o,a]),v.useEffect(()=>{const q=R.current;if(!q||m==null)return;const Q=q.getBoundingClientRect();if(Q.right>window.innerWidth-8){const ee=Q.right-window.innerWidth+8;q.style.transform=`translateX(-${ee}px)`}else q.style.transform=""}),b.length===0)return null;const N=Uu(i),z=Hu(u),I=m!=null?b[m]:null;return v.createElement(v.Fragment,null,b.map((q,Q)=>{const ee=q.error.severity==="warning",te=bT(ee?N.warning:N.error),D=q.top+q.height-2;return v.createElement("div",{key:`wave-${Q}`,className:Aa("ei-squiggly",ee?"ei-squiggly--warning":"ei-squiggly--error",h==null?void 0:h.squiggly),style:{position:"absolute",left:`${q.left}px`,top:`${D}px`,width:`${q.width}px`,height:"4px",zIndex:1,backgroundImage:te,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),I!=null&&(()=>{const q=I.error.severity==="warning"?N.warning:N.error,Q=a==null?void 0:a.getBoundingClientRect(),ee=((Q==null?void 0:Q.left)??0)+g.x,te=((Q==null?void 0:Q.top)??0)+I.top+I.height+2,D=((Q==null?void 0:Q.top)??0)+I.top,j=window.innerHeight-g.clientY<ix+20?D-ix-ux:te+ux;return Zl.createPortal(v.createElement("div",{ref:R,className:Aa("ei-tooltip",h==null?void 0:h.tooltip),style:{position:"fixed",top:`${j}px`,left:`${ee}px`,zIndex:z.dropdownZIndex,backgroundColor:N.background,color:q,border:`1px solid ${q}`,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"}},I.error.message),document.body)})())}function Eu(t,a,r){let i=0,u=!1;function o(h){var m;if(u)return!0;if(h===a){if(h.nodeType===Node.TEXT_NODE)i+=r;else for(let p=0;p<r&&p<h.childNodes.length;p++)if(o(h.childNodes[p]))return!0;return u=!0,!0}if(h.nodeType===Node.TEXT_NODE)return i+=(h.textContent||"").length,!1;if(h.nodeName==="BR")return(m=h.hasAttribute)!=null&&m.call(h,"data-sentinel")||(i+=1),!1;for(let p=0;p<h.childNodes.length;p++)if(o(h.childNodes[p]))return!0;return!1}return o(t),i}function Tr(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const r=a.getRangeAt(0);return Eu(t,r.startContainer,r.startOffset)}function vl(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const r=a.getRangeAt(0);return{start:Eu(t,r.startContainer,r.startOffset),end:Eu(t,r.endContainer,r.endOffset)}}function Kl(t,a){const r=window.getSelection();if(!r)return;const i=kh(t,a);if(!i)return;const u=document.createRange();u.setStart(i.node,i.offset),u.collapse(!0),r.removeAllRanges(),r.addRange(u)}function Pl(t,a,r){if(a===r){Kl(t,a);return}const i=window.getSelection();if(!i)return;const u=kh(t,a),o=kh(t,r);if(!u||!o)return;const h=document.createRange();h.setStart(u.node,u.offset),h.setEnd(o.node,o.offset),i.removeAllRanges(),i.addRange(h)}function kh(t,a){let r=0;function i(h){var m;if(h.nodeType===Node.TEXT_NODE){const p=(h.textContent||"").length;return r+p>=a?{node:h,offset:a-r}:(r+=p,null)}if(h.nodeName==="BR"){if((m=h.hasAttribute)!=null&&m.call(h,"data-sentinel"))return null;if(r+1>=a){const p=h.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(h)+1}}return r+=1,null}for(let p=0;p<h.childNodes.length;p++){const g=i(h.childNodes[p]);if(g)return g}return null}const u=i(t);if(u)return u;const o=Vb(t);return o?{node:o,offset:(o.textContent||"").length}:{node:t,offset:0}}function Vb(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const r=Vb(t.childNodes[a]);if(r)return r}return null}function ET(t){const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);r.deleteContents();const i=document.createTextNode(t);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),a.removeAllRanges(),a.addRange(r)}function wT(){const t=window.getSelection();if(!t||t.rangeCount===0)return;const a=t.getRangeAt(0);a.deleteContents();const r=document.createElement("br");a.insertNode(r),a.setStartAfter(r),a.collapse(!0),t.removeAllRanges(),t.addRange(a)}function ic(t){var m;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);let i=r.getBoundingClientRect();if(i.width===0&&i.height===0){const p=document.createElement("span");p.textContent="​",r.insertNode(p),i=p.getBoundingClientRect(),(m=p.parentNode)==null||m.removeChild(p),a.removeAllRanges(),a.addRange(r)}const u=t.getBoundingClientRect(),o=i.top-u.top+t.scrollTop,h=i.bottom-u.top+t.scrollTop;h>t.scrollTop+t.clientHeight?t.scrollTop=h-t.clientHeight:o<t.scrollTop&&(t.scrollTop=o)}function bh(){var i,u;const t=window.getSelection();if(!t||t.rangeCount===0)return null;const a=t.getRangeAt(0),r=a.getBoundingClientRect();if(r.width===0&&r.height===0||a.collapsed&&a.startContainer.nodeType===Node.ELEMENT_NODE&&a.startOffset>0&&((i=a.startContainer.childNodes[a.startOffset-1])==null?void 0:i.nodeName)==="BR"){const o=document.createElement("span");o.textContent="​",a.insertNode(o);const h=o.getBoundingClientRect();return(u=o.parentNode)==null||u.removeChild(o),t.removeAllRanges(),t.addRange(a),h}return r}function ox(t,a){return Math.min(t,a)}function Sh(t,a,r){const i=window.innerHeight,u=window.innerWidth;let o=t.bottom+window.scrollY+4,h=t.left+window.scrollX;return t.bottom+a+4>i&&(o=t.top+window.scrollY-a-4),h+r>u&&(h=u-r-8),h<8&&(h=8),{top:o,left:h}}var RT=new Set([k.VALUE,k.QUOTED_VALUE,k.WILDCARD]);function NT(t,a,r){for(const i of t)if(a>=i.start&&a<=i.end&&RT.has(i.type))return a===i.start&&r===i.end?null:{start:i.start,end:i.end};return null}var TT=new Set([k.VALUE,k.QUOTED_VALUE,k.WILDCARD,k.FIELD_NAME,k.RANGE,k.SAVED_SEARCH,k.HISTORY_REF,k.REGEX]);function jT(t,a,r){const i=[];for(const u of a)if(r>=u.start&&r<=u.end&&TT.has(u.type)){i.push({start:u.start,end:u.end});break}return t&&hc(t,r,i),DT(i)}function hc(t,a,r){if(a<t.start||a>t.end)return!1;let i=!1;switch(t.type){case"BooleanExpr":i=hc(t.left,a,r)||i,i=hc(t.right,a,r)||i;break;case"Group":case"Not":case"FieldGroup":i=hc(t.expression,a,r)||i;break}return r.push({start:t.start,end:t.end}),!0}function DT(t){t.sort((r,i)=>r.end-r.start-(i.end-i.start)||r.start-i.start);const a=[];for(const r of t){const i=a[a.length-1];i&&i.start===r.start&&i.end===r.end||a.push(r)}return a}var CT=60,AT=" ";function OT(t,a){const r=(a==null?void 0:a.maxLineLength)??CT,i=(a==null?void 0:a.indent)??AT,u={whitespace:a==null?void 0:a.whitespaceOperator,and:a==null?void 0:a.andOperator,or:a==null?void 0:a.orOperator,not:a==null?void 0:a.notOperator};let o;return typeof t=="string"?o=new ls(new Ks(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():o=t,o?pc(o,0,r,i,u):""}function MT(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function Fb(t,a){const r=a.not??t.sourceOperator??"NOT";return{op:r,sep:/^[a-zA-Z]/.test(r)?" ":""}}function xl(t,a){switch(t.type){case"FieldValue":{const r=t.quoted?`"${t.value}"`:t.value,i=t.operator===":"?":":`:${t.operator}`;let u=`${t.field}${i}${r}`;return t.fuzzy!=null&&(u+=`~${t.fuzzy}`),t.proximity!=null&&(u+=`~${t.proximity}`),t.boost!=null&&(u+=`^${t.boost}`),u}case"BareTerm":{let r=t.quoted?`"${t.value}"`:t.value;return t.fuzzy!=null&&(r+=`~${t.fuzzy}`),t.proximity!=null&&(r+=`~${t.proximity}`),t.boost!=null&&(r+=`^${t.boost}`),r}case"Range":{const r=t.lowerInclusive?"[":"{",i=t.upperInclusive?"]":"}",u=`${r}${t.lowerQuoted?`"${t.lower}"`:t.lower} TO ${t.upperQuoted?`"${t.upper}"`:t.upper}${i}`;return t.field?`${t.field}:${u}`:u}case"Regex":return`/${t.pattern}/`;case"SavedSearch":return`#${t.name}`;case"HistoryRef":return`!${t.ref}`;case"Not":{const{op:r,sep:i}=Fb(t,a);return`${r}${i}${xl(t.expression,a)}`}case"Group":{let r=`(${xl(t.expression,a)})`;return t.boost!=null&&(r+=`^${t.boost}`),r}case"FieldGroup":{let r=`${t.field}:(${xl(t.expression,a)})`;return t.boost!=null&&(r+=`^${t.boost}`),r}case"BooleanExpr":{const r=MT(t,a),i=r?` ${r} `:" ";return`${xl(t.left,a)}${i}${xl(t.right,a)}`}case"Error":return t.value}}function kT(t){const a=t.operator,r=!!t.implicit,i=[],u=o=>{o.type==="BooleanExpr"&&o.operator===a&&!!o.implicit===r?(u(o.left),u(o.right)):i.push(o)};return u(t),{operator:a,implicit:r,sourceOperator:t.sourceOperator,operands:i}}function mc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?mc(t.left)||mc(t.right):t.type==="Not"?mc(t.expression):!1}var _T={and:"AND",or:"OR",not:"NOT"};function LT(t,a){return!!(xl(t,_T).length>a||mc(t))}function pc(t,a,r,i,u){const o=i.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:h,implicit:m,sourceOperator:p,operands:g}=kT(t),x=m?u.whitespace??"":h==="AND"?u.and??p??"AND":u.or??p??"OR",b=x?` ${x} `:" ",w=g.map(S=>xl(S,u)).join(b);return w.length<=r?w:g.map((S,R)=>{const C=pc(S,a,r,i,u);return R===0?C:x?`${o}${x} ${C}`:`${o}${C}`}).join(`
203
+ `)}case"Group":{if(!LT(t.expression,r)){let m=`(${xl(t.expression,u)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let h=`(
204
+ ${zT(pc(t.expression,a+1,r,i,u),a+1,i)}
205
+ ${o})`;return t.boost!=null&&(h+=`^${t.boost}`),h}case"FieldGroup":{let h=`${t.field}:(${xl(t.expression,u)})`;return t.boost!=null&&(h+=`^${t.boost}`),h}case"Not":{const{op:h,sep:m}=Fb(t,u);return`${h}${m}${pc(t.expression,a,r,i,u)}`}default:return xl(t,u)}}function zT(t,a,r){const i=r.repeat(a);return t.split(`
206
+ `).map(u=>u.startsWith(i)?u:i+u).join(`
207
+ `)}function UT(t){return t?vu(t):[]}function cx(t){return t.type==="BooleanExpr"}function vu(t){switch(t.type){case"BooleanExpr":return _h(t);case"Group":{const a=[],r=t.expression;return cx(r)?(a.push({start:t.start,end:t.end}),a.push(...vu(r)),a.push({start:t.start,end:t.end})):a.push({start:t.start,end:t.end}),a}case"FieldGroup":{const a=[];a.push({start:t.start,end:t.end});const r=t.expression;return cx(r)&&a.push(...vu(r)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...vu(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 _h(t){return t.type==="BooleanExpr"?[..._h(t.left),..._h(t.right)]:vu(t)}function HT(t,a,r,i){if(t.length===0)return null;if(a>=0&&a<t.length){const u=i==="forward"?a+1:a-1;return u>=0&&u<t.length?{stop:t[u],index:u}:null}if(i==="forward"){for(let u=0;u<t.length;u++)if(t[u].start>=r)return{stop:t[u],index:u};return{stop:t[t.length-1],index:t.length-1}}else{for(let u=t.length-1;u>=0;u--)if(t[u].end<=r)return{stop:t[u],index:u};return{stop:t[0],index:0}}}var BT=class{constructor(t=100){mn(this,"stack",[]);mn(this,"index",-1);mn(this,"maxSize");this.maxSize=t}push(t){if(this.index>=0&&this.stack[this.index].value===t.value){this.stack[this.index].cursorPos=t.cursorPos;return}this.stack=this.stack.slice(0,this.index+1),this.stack.push(t),this.stack.length>this.maxSize&&this.stack.shift(),this.index=this.stack.length-1}replaceCurrent(t){this.index>=0?this.stack[this.index]=t:this.push(t)}undo(){return this.index<=0?null:(this.index--,this.stack[this.index])}redo(){return this.index>=this.stack.length-1?null:(this.index++,this.stack[this.index])}canUndo(){return this.index>0}canRedo(){return this.index<this.stack.length-1}current(){return this.index>=0?this.stack[this.index]:null}clear(){this.stack=[],this.index=-1}get length(){return this.stack.length}};function $T(t,a){const r=i=>(a==null?void 0:a(i))??I2(i);if(t.type==="RANGE"&&t.token){const i=t.token.value,u=(i.endsWith("]")||i.endsWith("}")?i.slice(1,-1):i.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(u)return{mode:"range",start:r(u[1].trim()),end:r(u[2].trim())}}if(t.type==="FIELD_VALUE"&&t.partial){const i=r(t.partial);if(i)return{mode:"single",start:i,end:null}}return null}function qT(t,a){var r,i,u,o;return((t==null?void 0:t.mode)??"single")!==((a==null?void 0:a.mode)??"single")||(((r=t==null?void 0:t.start)==null?void 0:r.getTime())??0)!==(((i=a==null?void 0:a.start)==null?void 0:i.getTime())??0)?!0:(((u=t==null?void 0:t.end)==null?void 0:u.getTime())??0)!==(((o=a==null?void 0:a.end)==null?void 0:o.getTime())??0)}function YT({position:t,colors:a,onSelect:r,colorConfig:i,styleConfig:u,datePickerInit:o,fixedWidth:h,datePresets:m,datePickerClassName:p}){const g=v.useRef(null),[x,b]=v.useState(!1);if(v.useEffect(()=>{const R=document.createElement("div");return document.body.appendChild(R),g.current=R,b(!0),()=>{document.body.removeChild(R),g.current=null}},[]),!x||!g.current)return null;const w=Hu(u),S={position:"absolute",zIndex:w.dropdownZIndex,...qb(a,w),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...h!=null?{width:`${h}px`,minWidth:"unset",maxWidth:"unset"}:{}};return Zl.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:S,onMouseDown:R=>R.preventDefault()},v.createElement(pT,{onSelect:r,colors:i,styles:u,initialMode:o==null?void 0:o.mode,initialStart:o==null?void 0:o.start,initialEnd:o==null?void 0:o.end,presets:m,className:p})),g.current)}function VT(t){const{fields:a,onSearch:r,onChange:i,onValidationChange:u,value:o,defaultValue:h,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:b,placeholder:w,className:S,classNames:R,style:C,dropdown:N,features:z,inputRef:I,datePresets:q,onKeyDown:Q,onFocus:ee,onBlur:te,onTab:D,validateValue:j,parseDate:re,plainModeLength:ue,interceptPaste:xe,defaultField:pe,trailingSpaceOnAccept:Te=!0,collapseOnBlur:Ae=!1}=t,Re=typeof pe=="string"?{name:pe,showFieldSuggestions:!1}:pe?{showFieldSuggestions:!1,...pe}:void 0,B=Re==null?void 0:Re.name,V=(N==null?void 0:N.open)??(N==null?void 0:N.mode)??"always",de=typeof V=="function",fe=de?null:V,Ne=(N==null?void 0:N.alignToInput)??!1,O=N==null?void 0:N.maxSuggestions,X=O||10,se=N==null?void 0:N.suggestDebounceMs,ce=parseInt((b==null?void 0:b.dropdownMaxHeight)||"300",10)||300,we=(z==null?void 0:z.savedSearches)??!!m,Se=(z==null?void 0:z.historySearch)??!!p,He=(N==null?void 0:N.showSavedSearchHint)??we,it=(N==null?void 0:N.showHistoryHint)??Se,Fe=(N==null?void 0:N.showOperators)!==!1,et=(de||fe!=="input")&&(N==null?void 0:N.onNavigation)!==!1,en=(N==null?void 0:N.navigationDelay)??0,qt=(N==null?void 0:N.loadingDelay)??0,ut=N==null?void 0:N.renderFieldHint,le=N==null?void 0:N.renderHistoryItem,Le=N==null?void 0:N.renderSavedSearchItem,at=N==null?void 0:N.renderHeader,Xt=N==null?void 0:N.renderNoResults,Cn=N==null?void 0:N.renderType,pn=(N==null?void 0:N.autoSelect)??!1,_t=(N==null?void 0:N.homeEndKeys)??!1,Wt=(z==null?void 0:z.multiline)!==!1,Yn=(z==null?void 0:z.smartSelectAll)??!1,ye=(z==null?void 0:z.expandSelection)??!1,Oe=(z==null?void 0:z.wildcardWrap)??!1,ze=(z==null?void 0:z.clauseNavigation)??!1,Ge=z==null?void 0:z.formatQuery,lt=!!Ge,At=typeof Ge=="object"?Ge:void 0,Ot=v.useMemo(()=>({savedSearches:we,historySearch:Se}),[we,Se]),tn=Array.isArray(a)?a:[],[It,ca]=v.useState(tn);v.useEffect(()=>{if(Array.isArray(a)){ca(a);return}let T=!1;return a().then(F=>{T||ca(F)}),()=>{T=!0}},[a]);const gn=v.useMemo(()=>{const T=new Map;for(const F of It)if(T.set(F.name.toLowerCase(),F.type),F.aliases)for(const ve of F.aliases)T.set(ve.toLowerCase(),F.type);return T},[It]),J=v.useRef(null),[St,Lt]=v.useState(null),er=v.useCallback(T=>{J.current=T,Lt(T)},[]),Zn=v.useRef(null),Nl=v.useRef(null),$e=v.useRef(o||h||""),Qt=v.useRef(null),Yt=v.useRef(!1),gt=v.useRef(!1),zt=v.useRef(new BT),Rt=v.useRef(null),nn=v.useRef(new Set),Pt=v.useRef(null),Ut=v.useRef(null),dt=v.useRef(null),Ke=v.useRef(null),Sn=v.useRef(!1),An=v.useRef(null),A=v.useRef(null),_=v.useRef(null),H=v.useRef("input"),K=v.useRef(null),ne=v.useRef(-1),Ee=v.useRef(()=>{}),he=v.useRef(new ph(tn,[],[],O||10,{showSavedSearchHint:He,showHistoryHint:it,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));he.current.setDefaultField(Re);const je=v.useRef(new tx(tn)),be=v.useRef(j);be.current=j;const[Me,_e]=v.useState([]),[Xe,De]=v.useState(null),[Pe,qe]=v.useState([]),[Ht,Ze]=v.useState(-1),[ot,rt]=v.useState(!1),[ct,Kt]=v.useState(!1),[Vn,En]=v.useState(null),[On,Mn]=v.useState([]),[Fn,da]=v.useState(!1),[tr,Jn]=v.useState(!$e.current),[sl,Ie]=v.useState(ue!=null&&$e.current.length>=ue),[xt,Zt]=v.useState(0),[Wn,kn]=v.useState(0),[Tl,bt]=v.useState(""),[ba,Gn]=v.useState(null),[_r,di]=v.useState(null),Nt=v.useRef({tokens:Me,ast:Xe,suggestions:Pe,selectedSuggestionIndex:Ht,showDropdown:ot,showDatePicker:ct,cursorOffset:xt,selectionEnd:Wn,autocompleteContext:Tl,validationErrors:On,cursorContext:ba});Nt.current={tokens:Me,ast:Xe,suggestions:Pe,selectedSuggestionIndex:Ht,showDropdown:ot,showDatePicker:ct,cursorOffset:xt,selectionEnd:Wn,autocompleteContext:Tl,validationErrors:On,cursorContext:ba};const il=v.useCallback((T,F)=>{if(Ne&&Zn.current){const me=Zn.current.getBoundingClientRect();return{top:me.bottom+window.scrollY+4,left:me.left+window.scrollX}}const ve=bh();return ve?Sh(ve,T,F):null},[Ne]),$u=v.useCallback(()=>{if(!(!Ne||!Zn.current))return Zn.current.getBoundingClientRect().width},[Ne]),Za=v.useCallback((T,F,ve="dropdown")=>{const me=ve==="datePicker"?T:ox(T,ce);if(Ne&&ve!=="datePicker"){rt(!0),En(il(me,F));return}const Ve=requestAnimationFrame(()=>{nn.current.delete(Ve),ve==="datePicker"?Kt(!0):rt(!0);const ie=bh();En(ie?Sh(ie,me,F):null)});nn.current.add(Ve)},[Ne,il,ce]),nr=80,Xc=60,cs=v.useCallback((T,F)=>{if(!J.current)return;const ve=Fs(T,x,{cursorOffset:F,tokenClassName:R==null?void 0:R.token,fieldTypeMap:gn});J.current.innerHTML=ve,document.activeElement===J.current&&Kl(J.current,F)},[x]),fa=v.useCallback((T,F)=>{const ve=ue!=null&&T.length>=ue;if(Ie(ve),ve){if(_e([]),De(null),Mn([]),Jn(T.length===0),qe([]),Nt.current.tokens=[],rt(!1),Kt(!1),J.current){const ge=Tr(J.current);J.current.querySelector("span")&&(J.current.textContent=T,Kl(J.current,ge)),Zt(ge),kn(ge)}i&&i(T,null),u&&u([]);return}const me=new Ks(T,Ot).tokenize(),Ve=new ls(me),ie=Ve.parse(),oe=sc([...Ve.getErrors().map(ge=>({message:ge.message,start:ge.start,end:ge.end,type:"SYNTAX_ERROR"})),...je.current.validate(ie,be.current,re,B)]);if(J.current){const ge=Tr(J.current);F&&me.length>nr?(Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(()=>{Ut.current=null,J.current&&cs(me,Tr(J.current))},Xc)):(Ut.current&&(clearTimeout(Ut.current),Ut.current=null),cs(me,ge)),_e(me),De(ie),Mn(oe),Jn(T.length===0),Zt(ge),kn(ge),Nt.current.tokens=me,F&&Ee.current(me,ge)}else _e(me),De(ie),Mn(oe),Jn(T.length===0),Nt.current.tokens=me;i&&i(T,ie),u&&u(oe)},[x,i,u,cs,ue]),Lr=v.useCallback((T,F)=>{if(!ut||F.type!=="FIELD_VALUE"||!F.fieldName)return T;const ve=he.current.resolveField(F.fieldName);if(!ve)return T;const me=ut(ve,F.partial);return me==null?T:T.some(Ve=>Ve.type==="hint")?T.map(Ve=>Ve.type==="hint"?{...Ve,customContent:me}:Ve):[{text:"",label:"",type:"hint",customContent:me,replaceStart:F.start??0,replaceEnd:F.end??0},...T]},[ut]),ds=v.useCallback(T=>{if(!Xt)return!1;const F=Xt({cursorContext:T,partial:T.partial});return F==null?!1:(qe([{text:"",label:"",type:"noResults",customContent:F,replaceStart:0,replaceEnd:0}]),Ze(-1),Kt(!1),Za(32,300),!0)},[Xt]),ha=v.useCallback((T,F,ve)=>{var ge,Qe,tt;const me=he.current.getSuggestions(T,F);Fe||(me.suggestions=me.suggestions.filter(Ue=>Ue.type!=="operator"));const Ve=me.context.type;if(Gn(me.context),de){if(V({trigger:H.current,context:me.context,suggestions:me.suggestions,isOpen:Nt.current.showDropdown||Nt.current.showDatePicker,value:$e.current,selectionStart:F,selectionEnd:ve??F})===!1){rt(!1),Kt(!1),qe([]);return}}else{if(fe==="never"){rt(!1),Kt(!1),qe([]);return}if(fe==="manual"){if(_.current&&_.current!==Ve){_.current=null,rt(!1),Kt(!1),qe([]);return}if(!_.current){rt(!1),Kt(!1),qe([]);return}}if(fe==="input"&&H.current!=="input"&&H.current!=="ctrlSpace"){rt(!1),Kt(!1),qe([]);return}if(fe==="always"&&T.some(Ue=>(Ue.type===k.AND||Ue.type===k.OR||Ue.type===k.NOT||Ue.type===k.TILDE||Ue.type===k.BOOST)&&F>=Ue.start&&F<=Ue.end)){rt(!1),Kt(!1),qe([]);return}}const ie=me.context.fieldName?he.current.resolveField(me.context.fieldName):void 0,oe=!!(g&&me.context.type==="FIELD_VALUE"&&me.context.fieldName&&(ie==null?void 0:ie.type)!=="boolean"&&(ie==null?void 0:ie.suggestions)!==!1)||typeof m=="function"&&me.context.type==="SAVED_SEARCH"||typeof p=="function"&&me.context.type==="HISTORY_REF";if(me.showDatePicker){Sn.current=!1,(ge=Pt.current)==null||ge.abort(),Qt.current&&clearTimeout(Qt.current),Ke.current&&(clearTimeout(Ke.current),Ke.current=null);const Ue=$T(me.context,re),wn=An.current;An.current=Ue,di(Ue);const Mt=me.context.token;Mt&&(Mt.type==="COLON"||Mt.type==="COMPARISON_OP")?A.current={start:Mt.end,end:Mt.end}:Mt?A.current={start:Mt.start,end:Mt.end}:A.current={start:F,end:F},Nt.current.showDatePicker&&qT(wn,Ue)&&Kt(!1),qe([]),Ne||rt(!1),bt(Ve),Za(350,300,"datePicker");return}if(oe){const Ue=me.context.token,wn=Ue?Ue.start:F,Mt=Ue?Ue.end:F,na=()=>{Ke.current=null,qe([{text:"",label:"Searching...",type:"loading",replaceStart:wn,replaceEnd:Mt}]),Ne||rt(!1),Kt(!1),Ze(-1),Za(32,300)};Ke.current&&clearTimeout(Ke.current),qt>0?Ke.current=setTimeout(na,qt):na(),bt(Ve)}else{Sn.current=!1,(Qe=Pt.current)==null||Qe.abort(),Qt.current&&clearTimeout(Qt.current),Ke.current&&(clearTimeout(Ke.current),Ke.current=null);const Ue=Lr(me.suggestions,me.context);Ue.length>0?(qe(Ue),Ne||rt(!1),Kt(!1),Ze(me.context.partial||pn?0:-1),bt(Ve),Za(Ue.length*32,300)):(bt(Ve),ds(me.context)||(rt(!1),Kt(!1),qe([])))}if(oe){const Ue=me.context.partial,wn=se||200;Sn.current=!0,Qt.current&&clearTimeout(Qt.current),(tt=Pt.current)==null||tt.abort();const Mt=new AbortController;Pt.current=Mt,Qt.current=setTimeout(async()=>{const na=me.context.token,aa=na?na.start:F,ma=na?na.end:F;try{let Rn;if(me.context.type==="SAVED_SEARCH"&&typeof m=="function"){const cn=await m(Ue);if(Mt.signal.aborted)return;Rn=cn.map(kt=>({text:kt.query,label:kt.label||kt.query,description:kt.description,type:"savedSearch",replaceStart:aa,replaceEnd:ma,matchPartial:Ue,sourceData:kt}))}else if(me.context.type==="HISTORY_REF"&&typeof p=="function"){const cn=await p(Ue);if(Mt.signal.aborted)return;Rn=cn.map(kt=>({text:ph.wrapHistoryQuery(kt.query),label:kt.label||kt.query,description:kt.description,type:"history",replaceStart:aa,replaceEnd:ma,matchPartial:Ue,sourceData:kt}))}else{const cn=me.context.fieldName,kt=he.current.resolveField(cn),Br=await g(kt?kt.name:cn,Ue);if(Mt.signal.aborted)return;Rn=Br.map(cl=>({text:cl.text,label:cl.label||cl.text,description:cl.description,type:cl.type,replaceStart:aa,replaceEnd:ma,matchPartial:Ue}))}if(Ke.current&&(clearTimeout(Ke.current),Ke.current=null),Rn=Rn.slice(0,X),Rn.length>0){if(Re!=null&&Re.showFieldSuggestions){const cn=he.current.getFieldSuggestions(Ue,aa,ma);Rn=[...Rn,...cn].slice(0,X)}qe(Rn),Ze(Ue||pn?0:-1),Za(Rn.length*32,300)}else{const cn=he.current.getSuggestions(Nt.current.tokens,Nt.current.cursorOffset);if(!(Ue&&ds(cn.context))){const kt=Lr(cn.suggestions.filter(Br=>Br.type==="hint"),cn.context);kt.length>0?(qe(kt),Ze(cn.context.partial||pn?0:-1),Za(kt.length*32,300)):ds(cn.context)||(rt(!1),qe([]))}}}catch(Rn){Ke.current&&(clearTimeout(Ke.current),Ke.current=null),Mt.signal.aborted||(qe([{text:"",label:Rn instanceof Error?Rn.message:"Error loading suggestions",type:"error",replaceStart:aa,replaceEnd:ma}]),Ze(-1),Za(32,300),Sn.current=!1)}},wn)}},[g,m,p,se,Lr,il,Za,Ne,V,de,fe,Fe,X,qt,pn,ds]);Ee.current=ha;const an=v.useCallback(()=>{var T;rt(!1),Kt(!1),di(null),An.current=null,A.current=null,qe([]),Ze(-1),Sn.current=!1,(T=Pt.current)==null||T.abort(),Qt.current&&(clearTimeout(Qt.current),Qt.current=null),dt.current&&(clearTimeout(dt.current),dt.current=null),_.current=null},[]),ea=v.useCallback((T,F,ve)=>{if(dt.current&&(clearTimeout(dt.current),dt.current=null),!et){(Nt.current.showDropdown||Nt.current.showDatePicker)&&an();return}H.current="navigation",en>0?dt.current=setTimeout(()=>{dt.current=null,ha(T,F,ve)},en):ha(T,F,ve)},[et,en,ha,an]),Sa=v.useCallback((T,F,ve)=>{$e.current=T,Rt.current&&(clearTimeout(Rt.current),Rt.current=null),zt.current.push({value:T,cursorPos:F});const me=new Ks(T,Ot).tokenize(),Ve=new ls(me),ie=Ve.parse(),oe=sc([...Ve.getErrors().map(ge=>({message:ge.message,start:ge.start,end:ge.end,type:"SYNTAX_ERROR"})),...je.current.validate(ie,be.current,re,B)]);if(J.current){const ge=Fs(me,x,{cursorOffset:F,tokenClassName:R==null?void 0:R.token,fieldTypeMap:gn});J.current.innerHTML=ge,Kl(J.current,F)}if(_e(me),De(ie),Mn(oe),Jn(T.length===0),Zt(F),kn(F),rt(!1),Kt(!1),i&&i(T,ie),u&&u(oe),ve){const ge=requestAnimationFrame(()=>{nn.current.delete(ge),ve(me,ie)});nn.current.add(ge)}},[x,i,u]),jl=v.useCallback((T,F="Enter",ve,me)=>{if(!T)return;const Ve=Nt.current,ie=Ve.autocompleteContext,oe=ie==="FIELD_VALUE"||ie==="SAVED_SEARCH"||ie==="HISTORY_REF";if(oe&&(H.current="navigation"),T.type==="hint"&&(T.text==="#"||T.text==="!")){const cn=T.text,kt=T.replaceStart,Br=Math.max(T.replaceEnd,Ve.selectionEnd),cl=$e.current.slice(0,kt),Qc=$e.current.slice(Br),Fu=cl+cn+Qc,Gu=cl.length+cn.length;Sa(Fu,Gu,(Pc,Kc)=>{ve?ve(Fu,Kc):ha(Pc,Gu)});return}if(T.type==="hint")return;const ge=Ve.autocompleteContext==="FIELD_VALUE",Qe=Math.min(T.replaceStart,Ve.cursorOffset),tt=Math.max(T.replaceEnd,Ve.selectionEnd),Ue=$e.current.slice(0,Qe),wn=$e.current.slice(tt);let Mt="",na=wn;oe&&Te&&(wn.length===0?Mt=" ":/^[ \t\r\n]+$/.test(wn)&&!wn.startsWith("\\ ")&&(Mt=" ",na=""));const aa=Ue+T.text+Mt+na,ma=Ue.length+T.text.length+Mt.length,Rn=F==="Enter"&&ge;Sa(aa,ma,(cn,kt)=>{ve?ve(aa,kt):Rn?r&&r(aa,kt,me):ha(cn,ma)})},[Sa,ha,r,Te]);v.useEffect(()=>{Array.isArray(m)&&he.current.updateSavedSearches(m),Array.isArray(p)&&he.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{he.current=new ph(It,[],[],O||10,{showSavedSearchHint:He,showHistoryHint:it,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),he.current.setDefaultField(Re),je.current=new tx(It),Array.isArray(m)&&he.current.updateSavedSearches(m),Array.isArray(p)&&he.current.updateSearchHistory(p),$e.current&&fa($e.current,!1)},[It,O,He,it]),v.useEffect(()=>{I&&I({getValue:()=>$e.current,setValue:T=>{$e.current=T,fa(T,!1)},focus:()=>{var T;return(T=J.current)==null?void 0:T.focus()},blur:()=>{var T;return(T=J.current)==null?void 0:T.blur()},getAST:()=>Nt.current.ast,getValidationErrors:()=>Nt.current.validationErrors,setSelection:(T,F)=>{J.current&&(J.current.focus(),Pl(J.current,T,F),Zt(T),kn(F))}})},[I,fa]),v.useEffect(()=>{const T=$e.current;zt.current.push({value:T,cursorPos:T.length}),T&&fa(T,!1)},[]),v.useEffect(()=>{o!==void 0&&o!==$e.current&&($e.current=o,fa(o,!1))},[o,fa]),v.useEffect(()=>()=>{var T;Qt.current&&clearTimeout(Qt.current),Ut.current&&clearTimeout(Ut.current),dt.current&&clearTimeout(dt.current),Ke.current&&clearTimeout(Ke.current),nn.current.forEach(F=>cancelAnimationFrame(F)),nn.current.clear(),(T=Pt.current)==null||T.abort()},[]),v.useEffect(()=>{if(de){const T=Nt.current;T.cursorContext&&V({trigger:"modeChange",context:T.cursorContext,suggestions:T.suggestions,isOpen:T.showDropdown||T.showDatePicker,value:$e.current,selectionStart:T.cursorOffset,selectionEnd:T.selectionEnd})===!1&&(rt(!1),Kt(!1),qe([]))}else fe==="never"&&(rt(!1),Kt(!1),qe([]));_.current=null},[V]);const ul=v.useRef(!1);v.useLayoutEffect(()=>{if(ul.current){ul.current=!1;return}const T=Nl.current;if(!T||!Vn)return;const F=T.getBoundingClientRect(),ve=window.innerWidth;if(F.right>ve-8){const me=F.right-ve+8;ul.current=!0,En(Ve=>Ve&&{...Ve,left:Math.max(8,Ve.left-me)})}},[Vn,ot,ct,Pe]),v.useEffect(()=>{const T=()=>{const F=Nt.current;if(!(!F.showDropdown&&!F.showDatePicker))if(F.showDropdown&&Ne&&Zn.current){const ve=Zn.current.getBoundingClientRect();En({top:ve.bottom+window.scrollY+4,left:ve.left+window.scrollX})}else{const ve=bh();ve&&En(Sh(ve,F.showDatePicker?350:ox(F.suggestions.length*32,ce),300))}};return window.addEventListener("resize",T),window.addEventListener("scroll",T,!0),()=>{window.removeEventListener("resize",T),window.removeEventListener("scroll",T,!0)}},[Ne,ce]),v.useEffect(()=>{const T=J.current;if(!T)return;const F=()=>{(Nt.current.showDropdown||Nt.current.showDatePicker)&&an()};return T.addEventListener("scroll",F),()=>T.removeEventListener("scroll",F)},[an]);const Dl=v.useRef(null),fi=v.useRef(x);v.useEffect(()=>{if(!J.current)return;const T=Nt.current.tokens;if(T.length===0||Fn&&Wn!==xt)return;const F=Fn?xt:-1,ve=x!==fi.current;fi.current=x;const me=Yb(T,F),Ve=me?`${me.openStart},${me.closeStart}`:null;if(Ve===Dl.current&&!ve)return;Dl.current=Ve;const ie=Fn?Tr(J.current):-1,oe=Fs(T,x,{cursorOffset:F,tokenClassName:R==null?void 0:R.token,fieldTypeMap:gn});J.current.innerHTML=oe,Fn&&ie>=0&&Kl(J.current,ie)},[xt,Wn,Fn,x]);const ol=Ae&&!Fn,hi=v.useRef(ol);v.useEffect(()=>{if(!J.current)return;const T=hi.current;if(hi.current=ol,T!==ol)if(ol)J.current.innerHTML=J.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const F=Nt.current.tokens;if(F.length>0){const ve=Fn?Tr(J.current):-1,me=Fs(F,x,{cursorOffset:ve,tokenClassName:R==null?void 0:R.token,fieldTypeMap:gn});J.current.innerHTML=me,Fn&&ve>=0&&Kl(J.current,ve)}}},[ol,x]);const _a=v.useCallback(()=>{if(Yt.current||!J.current)return;K.current=null,ne.current=-1,dt.current&&(clearTimeout(dt.current),dt.current=null);let T=V2(J.current);if(T===$e.current)return;let F=Tr(J.current);const ve=Ky(T);ve!==T&&(T=ve,F=Math.min(F,T.length)),$e.current=T;const me=zt.current,Ve=me.current();if(Ve&&Math.abs(T.length-Ve.value.length)<=2&&Rt.current?me.replaceCurrent({value:T,cursorPos:F}):me.push({value:T,cursorPos:F}),Rt.current&&clearTimeout(Rt.current),Rt.current=setTimeout(()=>{Rt.current=null},300),H.current="input",!de&&fe==="input"){const ie=F>0?T[F-1]:"";if(!ie||ie.trim()===""){fa(T,!1),an(),J.current&&ic(J.current);return}}fa(T,!0),J.current&&ic(J.current)},[fa,de,fe,an]),Ja=v.useCallback(()=>{Yt.current=!0},[]),mi=v.useCallback(()=>{Yt.current=!1,_a()},[_a]),Cl=v.useCallback(T=>{if(!T)return;$e.current=T.value;const F=new Ks(T.value,Ot).tokenize(),ve=new ls(F),me=ve.parse(),Ve=sc([...ve.getErrors().map(oe=>({message:oe.message,start:oe.start,end:oe.end,type:"SYNTAX_ERROR"})),...je.current.validate(me,be.current,re,B)]),ie=T.selStart!=null&&T.selStart!==T.cursorPos;if(J.current){const oe=Fs(F,x,{cursorOffset:T.cursorPos,tokenClassName:R==null?void 0:R.token,fieldTypeMap:gn});J.current.innerHTML=oe,ie?Pl(J.current,T.selStart,T.cursorPos):Kl(J.current,T.cursorPos)}_e(F),De(me),Mn(Ve),Jn(T.value.length===0),Zt(ie?T.selStart:T.cursorPos),kn(T.cursorPos),an(),i&&i(T.value,me),u&&u(Ve)},[x,i,u,an]),La=v.useCallback(()=>{const T=Nl.current;if(!T)return 10;const F=T.clientHeight,ve=T.querySelectorAll(".ei-dropdown-item")[0];if(!ve)return 10;const me=ve.offsetHeight;return me<=0?10:Math.max(1,Math.floor(F/me))},[]),pi=v.useCallback(T=>{var me,Ve;if(Q&&Q(T),T.defaultPrevented)return;const F=Nt.current,ve=T.nativeEvent.code;if(lt&&ve==="KeyF"&&T.altKey&&T.shiftKey&&!T.ctrlKey&&!T.metaKey){T.preventDefault();const ie=OT($e.current,At);ie!==$e.current&&Sa(ie,ie.length);return}if(J.current&&J.current.childNodes.length>40){const ie=window.getSelection();if(ie!=null&&!ie.isCollapsed){const oe=vl(J.current);if(oe.end-oe.start>20){const ge=T.key==="Backspace"||T.key==="Delete"||T.key==="x"&&(T.ctrlKey||T.metaKey),Qe=!T.ctrlKey&&!T.metaKey&&!T.altKey&&T.key.length===1;(ge||Qe)&&(J.current.textContent=$e.current,Pl(J.current,oe.start,oe.end))}}}{let ie=null,oe=null;if(Zy[T.key])ie=T.key,oe=Zy[T.key];else if(Oe&&T.key==="*"&&J.current){const ge=vl(J.current);if(ge.start!==ge.end){const[Qe,tt]=Jy(F.tokens,ge.start,ge.end);if(Qe>=0&&Qe===tt){const Ue=F.tokens[Qe];(Ue.type===k.VALUE||Ue.type===k.WILDCARD)&&(ie="*",oe="*")}}}if(ie&&oe&&J.current){const ge=vl(J.current);if(ge.start!==ge.end){T.preventDefault();const{newValue:Qe,newSelStart:tt,newSelEnd:Ue}=Y2($e.current,ge.start,ge.end,ie,oe),wn=zt.current,Mt=wn.current();Mt&&Mt.value===$e.current&&(Mt.selStart=ge.start,Mt.cursorPos=ge.end),$e.current=Qe,Rt.current&&(clearTimeout(Rt.current),Rt.current=null),wn.push({value:Qe,cursorPos:Ue,selStart:tt});const na=new Ks(Qe,Ot).tokenize(),aa=new ls(na),ma=aa.parse(),Rn=sc([...aa.getErrors().map(kt=>({message:kt.message,start:kt.start,end:kt.end,type:"SYNTAX_ERROR"})),...je.current.validate(ma,be.current,re,B)]),cn=Fs(na,x,{cursorOffset:Ue,tokenClassName:R==null?void 0:R.token,fieldTypeMap:gn});J.current.innerHTML=cn,Pl(J.current,tt,Ue),_e(na),De(ma),Mn(Rn),Jn(!1),Zt(tt),kn(Ue),an(),i&&i(Qe,ma),u&&u(Rn);return}}}if(T.key==="z"&&(T.ctrlKey||T.metaKey)&&!T.shiftKey){T.preventDefault(),Cl(zt.current.undo());return}if(T.key==="y"&&(T.ctrlKey||T.metaKey)||T.key==="z"&&(T.ctrlKey||T.metaKey)&&T.shiftKey){T.preventDefault(),Cl(zt.current.redo());return}if(T.key==="a"&&(T.ctrlKey||T.metaKey)&&Yn&&J.current){const ie=vl(J.current),oe=NT(F.tokens,ie.start,ie.end);if(oe){T.preventDefault(),Pl(J.current,oe.start,oe.end),Zt(oe.start),kn(oe.end);return}}if(ye&&T.altKey&&T.shiftKey&&(ve==="ArrowRight"||ve==="ArrowLeft")&&J.current){const ie=ve==="ArrowRight";let oe=K.current;if(!oe){const Qe=vl(J.current),tt=jT(F.ast,F.tokens,Qe.start);if(tt.length===0)return;oe={ranges:tt,level:-1},K.current=oe}const ge=ie?Math.min(oe.level+1,oe.ranges.length-1):Math.max(oe.level-1,-1);if(ge===oe.level)return;if(oe.level=ge,ge<0){const Qe=vl(J.current);Kl(J.current,Qe.start),K.current=null}else{T.preventDefault();const Qe=oe.ranges[ge];Pl(J.current,Qe.start,Qe.end),Zt(Qe.start),kn(Qe.end)}return}if(K.current=null,ze&&T.ctrlKey&&T.altKey&&(ve==="ArrowRight"||ve==="ArrowLeft")&&J.current){T.preventDefault();const ie=ve==="ArrowRight"?"forward":"backward",oe=UT(F.ast),ge=vl(J.current),Qe=ie==="forward"?ge.end:ge.start,tt=HT(oe,ne.current,Qe,ie);tt&&(ne.current=tt.index,Pl(J.current,tt.stop.start,tt.stop.end),Zt(tt.stop.start),kn(tt.stop.end));return}if(ne.current=-1,T.key===" "&&(T.ctrlKey||T.metaKey)){T.preventDefault(),H.current="ctrlSpace",!de&&fe==="manual"&&(_.current=he.current.getSuggestions(F.tokens,F.cursorOffset).context.type),ha(F.tokens,F.cursorOffset);return}if(T.key==="Enter"&&(T.ctrlKey||T.metaKey)){T.preventDefault(),an(),r&&r($e.current,F.ast,T);return}if(T.key==="Enter"&&T.shiftKey&&Wt){T.preventDefault(),wT();const ie=J.current?Tr(J.current):$e.current.length+1,oe=$e.current,ge=oe.slice(0,ie-1)+`
208
+ `+oe.slice(ie-1);$e.current=ge,K.current=null,dt.current&&(clearTimeout(dt.current),dt.current=null),H.current="input",zt.current.push({value:ge,cursorPos:ie}),fa(ge,!0),J.current&&ic(J.current);return}if((T.key==="Backspace"||T.key==="Delete")&&J.current&&!J.current.textContent){const ie=$e.current;if(!ie)return;const{start:oe,end:ge}=vl(J.current);let Qe,tt;if(oe!==ge)Qe=ie.slice(0,oe)+ie.slice(ge),tt=oe;else if(T.key==="Backspace"&&oe>0)Qe=ie.slice(0,oe-1)+ie.slice(oe),tt=oe-1;else if(T.key==="Delete"&&oe<ie.length)Qe=ie.slice(0,oe)+ie.slice(oe+1),tt=oe;else return;T.preventDefault(),$e.current=Qe,K.current=null,dt.current&&(clearTimeout(dt.current),dt.current=null),H.current="input",zt.current.push({value:Qe,cursorPos:tt}),Kl(J.current,tt),fa(Qe,!0),J.current&&ic(J.current);return}if(gt.current=!1,F.showDropdown&&F.suggestions.length>0)switch(T.key){case"ArrowDown":T.preventDefault(),gt.current=!0,Ze(ie=>ie>=F.suggestions.length-1?0:ie+1);return;case"ArrowUp":T.preventDefault(),gt.current=!0,Ze(ie=>ie<=0?F.suggestions.length-1:ie-1);return;case"PageDown":{T.preventDefault(),gt.current=!0;const ie=La();Ze(oe=>Math.min(oe+ie,F.suggestions.length-1));return}case"PageUp":{T.preventDefault(),gt.current=!0;const ie=La();Ze(oe=>Math.max(oe-ie,0));return}case"Home":if(_t&&F.selectedSuggestionIndex>=0){T.preventDefault(),gt.current=!0,Ze(0);return}break;case"End":if(_t&&F.selectedSuggestionIndex>=0){T.preventDefault(),gt.current=!0,Ze(F.suggestions.length-1);return}break;case"Enter":if(F.selectedSuggestionIndex>=0){const ie=F.suggestions[F.selectedSuggestionIndex];if(ie.type==="loading"||ie.type==="error"){T.preventDefault(),an(),r&&r($e.current,F.ast,T);return}if(ie.type==="hint"&&ie.text!=="#"&&ie.text!=="!"){T.preventDefault(),an();const oe=$e.current,ge=F.cursorOffset;if(ge<=oe.length&&oe[ge]!==" "){const Qe=oe.slice(0,ge),tt=oe.slice(ge),Ue=Qe+" "+tt;Sa(Ue,ge+1,()=>{r&&r(Ue,F.ast,T)})}else r&&r(oe,F.ast,T);return}T.preventDefault(),jl(ie,"Enter",void 0,T);return}T.preventDefault(),an(),r&&r($e.current,F.ast,T);return;case"Tab":if(D){T.preventDefault();const ie=F.selectedSuggestionIndex>=0?F.suggestions[F.selectedSuggestionIndex]:null,oe=ie&&ie.type!=="loading"&&ie.type!=="error"&&!(ie.type==="hint"&&ie.text!=="#"&&ie.text!=="!")?ie:null,ge=D({suggestion:oe,cursorContext:F.cursorContext||{type:"EMPTY",partial:""},query:$e.current});ge.accept&&oe?jl(oe,"Tab",(Qe,tt)=>{var Ue;ge.submit&&r&&r(Qe,tt,T),ge.blur&&((Ue=J.current)==null||Ue.blur())},T):(an(),ge.submit&&r&&r($e.current,F.ast,T),ge.blur&&((me=J.current)==null||me.blur()));return}if(F.selectedSuggestionIndex>=0){const ie=F.suggestions[F.selectedSuggestionIndex];if(ie.type==="hint"&&ie.text!=="#"&&ie.text!=="!"){T.preventDefault(),an();const oe=$e.current,ge=F.cursorOffset;if(ge<=oe.length&&oe[ge]!==" "){const Qe=oe.slice(0,ge),tt=oe.slice(ge),Ue=Qe+" "+tt,wn=ge+1;Sa(Ue,wn,Mt=>{ha(Mt,wn)})}return}T.preventDefault(),jl(ie,"Tab",void 0,T);return}break;case"Escape":T.preventDefault(),an();return}if(T.key==="Tab"&&D){T.preventDefault();const ie=D({suggestion:null,cursorContext:F.cursorContext||{type:"EMPTY",partial:""},query:$e.current});ie.submit&&r&&r($e.current,F.ast,T),ie.blur&&((Ve=J.current)==null||Ve.blur());return}if(F.showDatePicker&&T.key==="Escape"){T.preventDefault(),an();return}if(T.key==="Enter"&&!F.showDropdown&&!F.showDatePicker){T.preventDefault(),r&&r($e.current,F.ast,T);return}},[r,an,jl,Sa,Cl,Wt,de,fe,ha,Q,D,Yn,ye,ze,_t,La,lt]),fs=v.useCallback(T=>{if(gt.current){gt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(T.key)){if(!J.current)return;const F=vl(J.current);Zt(F.start),kn(F.end),ea(Nt.current.tokens,F.start,F.end)}},[ea]),qu=v.useCallback(()=>{da(!0),ee==null||ee();const T=requestAnimationFrame(()=>{if(nn.current.delete(T),J.current){const F=Nt.current.tokens,ve=F.length>0?Tr(J.current):0;Zt(ve),kn(ve),ea(F,ve)}});nn.current.add(T)},[_a,ea,ee]),hs=v.useCallback(()=>{var T;da(!1),rt(!1),Kt(!1),qe([]),Sn.current=!1,(T=Pt.current)==null||T.abort(),Qt.current&&(clearTimeout(Qt.current),Qt.current=null),Ke.current&&(clearTimeout(Ke.current),Ke.current=null),Zt(-1),te==null||te()},[te]),Al=v.useRef(!1),Yu=v.useCallback(T=>{if(!J.current||T.detail!==2&&T.detail!==3)return;if(T.detail===3){if(!Nt.current.ast)return;const ge=document.caretRangeFromPoint(T.clientX,T.clientY);if(!ge)return;const Qe=Eu(J.current,ge.startContainer,ge.startOffset),tt=H2(Nt.current.ast,$e.current,Qe);if(!tt||tt.start>=tt.end)return;T.preventDefault(),Al.current=!0,Pl(J.current,tt.start,tt.end);return}T.preventDefault(),Al.current=!0;const F=document.caretRangeFromPoint(T.clientX,T.clientY);if(!F)return;const ve=Eu(J.current,F.startContainer,F.startOffset),me=$e.current,Ve=ge=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(ge);let ie=ve;for(;ie>0&&Ve(me[ie-1]);)ie--;let oe=ve;for(;oe<me.length&&Ve(me[oe]);)oe++;ie<oe&&Pl(J.current,ie,oe)},[]),ta=v.useCallback(T=>{Al.current&&(T.preventDefault(),Al.current=!1)},[]),Ol=v.useCallback(()=>{if(!J.current)return;const T=vl(J.current);if(Zt(T.start),kn(T.end),T.start!==T.end){const[F,ve]=Jy(Nt.current.tokens,T.start,T.end);if(F!==ve){an();return}}ea(Nt.current.tokens,T.start,T.end)},[ea,an]),Ml=v.useCallback(T=>{Rt.current&&(clearTimeout(Rt.current),Rt.current=null),ET(T),_a()},[_a]),zr=v.useCallback(T=>{T.preventDefault();const F=Ky(T.clipboardData.getData("text/plain"));if(xe){const ve=xe(F,T);ve!=null&&typeof(ve==null?void 0:ve.then)=="function"?ve.then(me=>{me!=null&&Ml(me)}).catch(()=>{}):ve!=null&&Ml(ve)}else Ml(F)},[xe,Ml]),Ic=v.useCallback(T=>{H.current="navigation";const F=Nt.current,ve=A.current,me=ve?ve.start:F.cursorOffset,Ve=ve?ve.end:F.cursorOffset,ie=$e.current.slice(0,me),oe=$e.current.slice(Ve);let ge="",Qe=oe;Te&&T.length>0&&(oe.length===0?ge=" ":/^[ \t\r\n]+$/.test(oe)&&!oe.startsWith("\\ ")&&(ge=" ",Qe=""));const tt=ie+T+ge+Qe,Ue=ie.length+T.length+ge.length;Sa(tt,Ue,wn=>{J.current&&J.current.focus(),ha(wn,Ue)})},[Sa,ha,Te]),ar=Uu(x),Ur=Hu(b),Hr=Z2(ar,C),kl={...J2(ar,Ur),...Fn?W2(Ur):{}};ol&&(kl.whiteSpace="nowrap",kl.overflow="hidden",kl.textOverflow="ellipsis");const Vu=eT(ar,Ur);return v.createElement("div",{ref:Zn,style:Hr,className:Aa("ei-container",S,R==null?void 0:R.container)},v.createElement("div",{ref:er,contentEditable:!0,suppressContentEditableWarning:!0,className:Aa("ei-editor",R==null?void 0:R.editor),style:kl,onInput:_a,onKeyDown:pi,onKeyUp:fs,onMouseDown:Yu,onMouseUp:ta,onFocus:qu,onBlur:hs,onClick:Ol,onPaste:zr,onCompositionStart:Ja,onCompositionEnd:mi,spellCheck:!1}),tr&&!Fn?v.createElement("div",{className:Aa("ei-placeholder",R==null?void 0:R.placeholder),style:Vu},w):null,v.createElement(ST,{errors:On,editorRef:St,cursorOffset:xt,colors:x,styles:b,containerRef:Zn.current,classNames:R?{squiggly:R.squiggly,tooltip:R.tooltip}:void 0}),v.createElement(hT,{suggestions:Pe,selectedIndex:Ht,onSelect:T=>jl(T,"Tab"),position:Vn,colors:x,styles:b,visible:ot,fixedWidth:$u(),renderHistoryItem:le,renderSavedSearchItem:Le,renderDropdownHeader:at,cursorContext:ba,listRefCallback:T=>{Nl.current=T},renderType:Cn,classNames:R?{dropdown:R.dropdown,dropdownHeader:R.dropdownHeader,dropdownItem:R.dropdownItem}:void 0}),ct&&Vn?v.createElement(YT,{position:Vn,colors:ar,onSelect:Ic,colorConfig:x,styleConfig:b,datePickerInit:_r,fixedWidth:void 0,datePresets:q,datePickerClassName:R==null?void 0:R.datePicker}):null)}const FT=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function dx(t){var u;const a=window.getSelection();if(!a||a.rangeCount===0)return((u=t.textContent)==null?void 0:u.length)??0;const r=a.getRangeAt(0),i=r.cloneRange();return i.selectNodeContents(t),i.setEnd(r.endContainer,r.endOffset),i.toString().length}function GT(t){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const r=a.key.toLowerCase(),i=a.currentTarget,u=i.isContentEditable?i:i.querySelector("[contenteditable='true'], [contenteditable]")??i,o=t.current;if(r==="h"&&o){a.preventDefault();const m=o.getValue();let p=dx(u);(p<0||p>m.length)&&(p=m.length),p>0&&(o.setValue(m.slice(0,p-1)+m.slice(p)),o.setSelection(p-1,p-1));return}if(r==="u"&&o){a.preventDefault();const m=o.getValue();let p=dx(u);if((p<0||p>m.length)&&(p=m.length),p===0)return;let g=p;for(;g>0&&/\s/.test(m[g-1]??"");)g--;if(g===p)for(;g>0&&!/\s/.test(m[g-1]??"");)g--;g<p&&(o.setValue(m.slice(0,g)+m.slice(p)),o.setSelection(g,g));return}const h=r==="j"?"ArrowDown":r==="k"?"ArrowUp":null;h&&(a.preventDefault(),u.dispatchEvent(new KeyboardEvent("keydown",{key:h,bubbles:!0,cancelable:!0})))}}function Eh(t){return String(t>0?t:0).padStart(3,"0")}function XT({features:t,phases:a,query:r,onQuery:i}){const u=v.useRef(null),o=GT(u),h=[{name:"feature",label:"Feature",type:"number",description:"Feature number, e.g. 1 (F001)"},{name:"phase",label:"Phase",type:"number",description:"Phase number, e.g. 2 (P002)"},{name:"task",label:"Task",type:"number",description:"Task number, e.g. 10 (T010). Comma-list supported."},{name:"id",label:"Short ID",type:"string",description:"Global 5-char short id, e.g. UUXD1"},{name:"status",label:"Status",type:"string",description:"Task status"},{name:"feature-status",label:"Feature status",type:"string",description:"Status of the feature"},{name:"phase-status",label:"Phase status",type:"string",description:"Status of the phase"},{name:"title",label:"Title",type:"string",description:"Substring match on title"}],m=v.useMemo(()=>{const g=[...new Set(t.map(R=>R.number))].sort((R,C)=>R-C),x=[...new Set(a.map(R=>R.number))].sort((R,C)=>R-C),b=[...new Set(a.flatMap(R=>R.tasks.map(C=>C.number)))].sort((R,C)=>R-C),w=[...new Set([...t.map(R=>R.shortId),...a.flatMap(R=>[R.shortId,...R.tasks.map(C=>C.shortId)])].filter(Boolean))],S=[...new Set(a.flatMap(R=>R.tasks.map(C=>C.title)))];return{featureNums:g,phaseNums:x,taskNums:b,shortIds:w,titles:S}},[t,a]);async function p(g,x){const b=x.toLowerCase();return g==="feature"?m.featureNums.filter(w=>String(w).startsWith(x)).slice(0,20).map(w=>({text:String(w),label:`F${Eh(w)}`})):g==="phase"?m.phaseNums.filter(w=>String(w).startsWith(x)).slice(0,20).map(w=>({text:String(w),label:`P${Eh(w)}`})):g==="task"?m.taskNums.filter(w=>String(w).startsWith(x)).slice(0,20).map(w=>({text:String(w),label:`T${Eh(w)}`})):g==="id"?m.shortIds.filter(w=>w.toLowerCase().startsWith(b)).slice(0,20).map(w=>({text:w,label:w})):g==="status"||g==="feature-status"||g==="phase-status"?FT.filter(w=>w.startsWith(b)).map(w=>({text:w,label:w})):g==="title"?m.titles.filter(w=>w.toLowerCase().includes(b)).slice(0,20).map(w=>({text:w,label:w.length>44?w.slice(0,44)+"…":w})):[]}return d.jsx("div",{className:"search-bar",children:d.jsx(VT,{fields:h,value:r,onChange:g=>i(g),onSearch:g=>i(g),fetchSuggestions:p,onKeyDown:o,inputRef:g=>{u.current=g},placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function IT(t,a){if(Object.keys(a).length===0)return t;const r=o=>{const h=a[o];return h?new Map(h.map((m,p)=>[m,p])):null},i=r("__features__");return(i?[...t].sort((o,h)=>(i.get(o.feature.id)??1/0)-(i.get(h.feature.id)??1/0)):t).map(o=>{const h=r(`phase-scope:${o.feature.id}`),m=h?[...o.allPhases].sort((p,g)=>(h.get(p.phase.id)??1/0)-(h.get(g.phase.id)??1/0)):o.allPhases;return{...o,allPhases:m.map(p=>{const g=r(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((b,w)=>(g.get(b.id)??1/0)-(g.get(w.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function QT({features:t,phases:a,activeTasks:r,projectStorageScope:i}){const u=k2({features:t,phases:a,projectStorageScope:i}),[o,h]=v.useState({});v.useEffect(()=>{h({})},[u.displayedWorkTree]);const m=v.useMemo(()=>IT(u.displayedWorkTree,o),[u.displayedWorkTree,o]),[p,g]=v.useState(!1),[x,b]=v.useState(null),[w,S]=v.useState(null),R=D=>S(String(D.active.id)),[C,N]=v.useState(0);v.useEffect(()=>{const D=document.querySelector("header");if(!D)return;const j=()=>N(D.offsetHeight);j();const re=new ResizeObserver(j);return re.observe(D),window.addEventListener("resize",j),()=>{re.disconnect(),window.removeEventListener("resize",j)}},[]),v.useEffect(()=>{const D=window.setTimeout(()=>{const j=document.querySelector(".ap-search-sticky"),re=document.querySelector("header");if(!j||!re)return;const ue=j.getBoundingClientRect();if(ue.top<0){const xe=ue.top+window.scrollY-re.offsetHeight;window.scrollTo({top:Math.max(0,xe),behavior:"smooth"})}},60);return()=>window.clearTimeout(D)},[u.searchQuery,u.hideDone,u.hidePlanned,u.onlyActiveBranches]);const z=KR(PR(im,{activationConstraint:{distance:5}})),I=async D=>{const{active:j,over:re}=D;if(S(null),!re||j.id===re.id)return;const ue=String(j.id),xe=String(re.id),pe=m.map(Te=>Te.feature.id);if(pe.includes(ue)&&pe.includes(xe)){const Te=gu(pe,pe.indexOf(ue),pe.indexOf(xe));h(Ae=>({...Ae,__features__:Te})),await lh("feature",Te).catch(()=>{});return}for(const Te of m){const Ae=Te.allPhases.map(Re=>Re.phase.id);if(Ae.includes(ue)&&Ae.includes(xe)){const Re=gu(Ae,Ae.indexOf(ue),Ae.indexOf(xe));h(B=>({...B,[`phase-scope:${Te.feature.id}`]:Re})),await lh("phase",Re).catch(()=>{});return}}for(const Te of m)for(const Ae of Te.allPhases){const Re=Ae.allTasks.map(B=>B.id);if(Re.includes(ue)&&Re.includes(xe)){const B=gu(Re,Re.indexOf(ue),Re.indexOf(xe));h(V=>({...V,[`task-scope:${Ae.phase.id}`]:B})),await lh("task",B).catch(()=>{});return}}},q=D=>u.expandedPhaseIds.includes(D),Q=D=>u.recentPhaseIds.includes(D),ee=D=>u.recentTaskIds.includes(D),te=()=>{if(!w)return null;for(const D of m){if(D.feature.id===w)return d.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Jl,{featureNum:D.feature.number}),d.jsx(Oa,{status:D.feature.status})]}),d.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:D.feature.name})]});for(const j of D.allPhases){if(j.phase.id===w)return d.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Jl,{featureNum:D.feature.number,phaseNum:j.phase.number}),d.jsx(Oa,{status:j.phase.status})]}),d.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:j.phase.title})]});for(const re of j.allTasks)if(re.id===w)return d.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Jl,{featureNum:D.feature.number,phaseNum:j.phase.number,taskNum:re.number}),d.jsx(Oa,{status:re.status})]}),d.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:re.title})]})}}return null};return d.jsxs(qn,{className:"grid gap-4",children:[d.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(yt,{type:"button",variant:"secondary",onClick:()=>u.expandAll(),children:"Expand all"}),d.jsx(yt,{type:"button",variant:"secondary",onClick:()=>u.setTreeOpenMode("none"),children:"Collapse all"})]})]}),d.jsxs("div",{className:"ap-search-sticky z-20",style:{top:C},children:[d.jsx(XT,{features:t,phases:a,query:u.searchQuery,onQuery:u.setSearchQuery}),u.searchActive?d.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:[u.matchedTaskIds.size," match",u.matchedTaskIds.size===1?"":"es"," — clear the box to reset."]}):null,d.jsx("div",{className:"grid grid-cols-1 gap-2 rounded-[14px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 sm:rounded-[18px] sm:px-4 sm:py-3",children:d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:gap-2",children:[d.jsx("button",{type:"button",onClick:()=>u.setHideDone(D=>!D),className:`status-chip transition ${u.hideDone?"status-done":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Hide done"}),d.jsx("button",{type:"button",onClick:()=>u.setHidePlanned(D=>!D),className:`status-chip transition ${u.hidePlanned?"status-planned":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Hide planned"}),d.jsx("button",{type:"button",onClick:()=>u.setOnlyActiveBranches(D=>!D),className:`status-chip transition ${u.onlyActiveBranches?"status-in-progress":"border border-[var(--border)] bg-transparent text-[var(--text-muted)]"}`,children:"Only active"}),d.jsx(yt,{type:"button",variant:"secondary",className:"!min-h-9 !px-3 !py-1 !text-xs sm:!min-h-11 sm:!px-4 sm:!py-2 sm:!text-sm",onClick:u.resetFilters,children:"Reset"}),d.jsx(yt,{type:"button",variant:"secondary",className:"!min-h-9 !px-3 !py-1 !text-xs sm:!min-h-11 sm:!px-4 sm:!py-2 sm:!text-sm",disabled:p,onClick:async()=>{g(!0),b(null);try{const D=await eR(),j=D.migrated,re=D.integrity.duplicatePhaseIds.length,ue=D.integrity.danglingPhaseIds.length;b(`Repair done: renamed ${j.renamed}, repaired ${j.repaired} refs, inferred ${j.inferred}. Integrity: ${re} duplicate, ${ue} dangling.`)}catch(D){b(`Repair failed: ${D instanceof Error?D.message:String(D)}`)}finally{g(!1)}},children:p?"Repairing…":"Repair"}),x?d.jsx("span",{className:"hidden text-xs text-[var(--text-muted)] sm:inline sm:truncate",children:x}):null]})})]}),d.jsx("div",{className:"grid gap-3",children:m.length>0?d.jsxs(KN,{sensors:z,collisionDetection:nN,onDragStart:R,onDragEnd:I,children:[d.jsx(cm,{items:m.map(D=>D.feature.id),strategy:om,children:m.map(D=>d.jsx(dm,{id:D.feature.id,children:d.jsx(L2,{entry:D,expanded:u.expandedFeatureIds.includes(D.feature.id),recentlyChanged:u.recentFeatureIds.includes(D.feature.id),onToggle:()=>u.toggleExpandedFeature(D.feature.id),isPhaseExpanded:q,onTogglePhase:u.toggleExpandedPhase,isPhaseRecentlyChanged:Q,isTaskRecentlyChanged:ee,highlightedTaskIds:u.searchActive?u.matchedTaskIds:void 0})},D.feature.id))}),d.jsx(p2,{dropAnimation:{duration:150,easing:"ease"},children:te()})]}):r.length>0?r.map(D=>{const j=D.featureId?`/features/${D.featureId}/phases/${D.phaseId}/tasks/${D.id}`:"/features";return d.jsxs(wt,{to:j,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[D.status==="in-progress"?d.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,d.jsxs("span",{className:"truncate",children:["T",MR(D.number)," — ",D.title]})]}),d.jsx(Oa,{status:D.status})]}),d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:D.phaseId})]},D.id)}):d.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function PT(){const{features:t,phases:a,activeTasks:r}=us(),{project:i}=Cu("root"),u=Mr();Kn("edit",()=>u("/project/edit"));const h=i.projectRoot||i.planRoot||i.name||"default";return d.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[d.jsx(qn,{className:"grid grid-cols-1 gap-4",children:d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Project Goal"}),i.goal?d.jsx($n,{text:i.goal,className:"mt-2 max-w-4xl"}):d.jsx("p",{className:"mt-2 max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),d.jsx(wt,{to:"/project/edit",children:d.jsx(yt,{type:"button",shortcut:"edit",children:"Edit project"})})]})}),d.jsx(TR,{project:i}),d.jsx(_R,{features:t,phases:a}),d.jsx(QT,{features:t,phases:a,activeTasks:r,projectStorageScope:h}),d.jsx(DR,{features:t,phases:a})]})}async function KT(){const[t,a]=await Promise.all([sb(),Wh()]);return{features:t,phases:a}}function wu(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function Tc(t){const a=[];return t.active&&a.push(`${t.active} active`),t.planned&&a.push(`${t.planned} planned`),t.done&&a.push(`${t.done} done`),t.blocked&&a.push(`${t.blocked} blocked`),t.canceled&&a.push(`${t.canceled} canceled`),a.join(" · ")}function ZT(t){const a=wu();for(const r of t){if(r.status==="in-progress"||r.status==="discovery"){a.active+=1;continue}if(r.status==="planned"||r.status==="draft"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function Gb(t){const a=wu();for(const r of t){if(r.status==="in-progress"){a.active+=1;continue}if(r.status==="planned"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function JT(t){const a=wu();for(const r of t){if(r.status==="in-progress"){a.active+=1;continue}if(r.status==="planned"){a.planned+=1;continue}if(r.status==="done"){a.done+=1;continue}if(r.status==="blocked"){a.blocked+=1;continue}r.status==="canceled"&&(a.canceled+=1)}return a}function WT({feature:t,phasesCount:a,tasksCount:r,phaseSummary:i,taskSummary:u,activity:o}){var C;const h=rs(),m=rs(),g=((C=h.formData)==null?void 0:C.get("status"))??t.status,x=h.state!=="idle",b=m.state!=="idle",w=Tc(i),S=Tc(u),R=t.description||(o?`${o.doneTasks}/${r} done · ${o.remainingTasks} left${o.blockedTasks?` · ${o.blockedTasks} blocked`:""}`:"");return d.jsxs("div",{className:"surface-card px-4 py-2",children:[d.jsxs("div",{className:"grid gap-2 xl:grid-cols-[minmax(0,1fr)_minmax(0,132px)_minmax(0,152px)_124px_44px_44px] xl:items-center",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(os,{type:"feature",number:t.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Oa,{status:g})})]}),d.jsx(wt,{to:`/features/${t.id}`,className:"entity-link--feature min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline lg:w-auto lg:truncate",children:t.name})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[d.jsx(wt,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:d.jsx(yt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(m.Form,{method:"post",action:`/features/${t.id}/delete`,onSubmit:N=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||N.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",disabled:b||x,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[a," phases"]}),w?d.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r," tasks"]}),S?d.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),d.jsx(h.Form,{method:"post",action:`/features/${t.id}/status`,className:"w-full xl:w-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx("select",{name:"status",value:g,disabled:x||b,"aria-busy":x,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:N=>h.submit(N.currentTarget.form),children:Fc.map(N=>d.jsx("option",{value:N.value,children:N.label},N.value))}),d.jsx(ss,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),d.jsx(wt,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:d.jsx(yt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(m.Form,{method:"post",action:`/features/${t.id}/delete`,className:"hidden xl:block",onSubmit:N=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||N.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",disabled:b||x,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]}),R?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:R}):null]})}const ej={feature:{label:"Feature",Icon:yc},phase:{label:"Phase",Icon:Nw},task:{label:"Task",Icon:ab}};function tj({kind:t,label:a}){const{Icon:r,label:i}=ej[t];return d.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[d.jsx(r,{className:"h-3.5 w-3.5"}),d.jsx("span",{children:a??i})]})}function Ia({className:t="",...a}){return d.jsx("input",{className:`field-control ${t}`,...a})}function Bu({className:t="",...a}){return d.jsx("select",{className:`field-control ${t}`,...a})}function mm({query:t,status:a,statusOptions:r,placeholder:i,clearTo:u,resultsLabel:o}){const h=Jh();return d.jsxs(ka,{method:"get",className:"surface-card grid gap-3 p-3 md:grid-cols-[minmax(0,1fr)_200px_auto_auto] md:items-end sm:p-4",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),d.jsx(Ia,{id:"list-filter-query",name:"q",defaultValue:t,placeholder:i,className:"min-h-11 py-2.5",onChange:m=>h(m.currentTarget.form)})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),d.jsxs("div",{className:"relative",children:[d.jsxs(Bu,{id:"list-filter-status",name:"status",defaultValue:a,className:"min-h-11 appearance-none py-2.5 pr-8",children:[d.jsx("option",{value:"",children:"All statuses"}),r.map(m=>d.jsx("option",{value:m.value,children:m.label},m.value))]}),d.jsx(ss,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}),d.jsx(yt,{type:"submit",variant:"secondary",className:"min-h-11",children:"Apply filters"}),d.jsx(wt,{to:u,className:"inline-flex min-h-11 items-center justify-center rounded-[14px] px-3 text-sm font-semibold text-[var(--text-muted)] transition hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",children:"Clear"}),d.jsx("div",{className:"text-sm text-[var(--text-muted)] md:col-span-4",children:o})]})}function pm(t,a){const r=t.trim().toLowerCase();return r?a.some(i=>i==null?void 0:i.toLowerCase().includes(r)):!0}function nj(t){const a=new Map,r=new Map,i=new Map,u=new Map,o=new Map;for(const h of t)h.featureId&&o.set(h.featureId,[...o.get(h.featureId)??[],h]);for(const[h,m]of o)a.set(h,m.length),r.set(h,m.reduce((p,g)=>p+g.tasks.length,0)),i.set(h,ZT(m)),u.set(h,Gb(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,tasksByFeature:r,phaseSummaryByFeature:i,taskSummaryByFeature:u}}function aj(){var w,S;const{features:t,phases:a}=us(),{phasesByFeature:r,tasksByFeature:i,phaseSummaryByFeature:u,taskSummaryByFeature:o}=nj(a),h=Mr(),[m]=Zh(),p=((w=m.get("q"))==null?void 0:w.trim())??"",g=((S=m.get("status"))==null?void 0:S.trim())??"",x=v.useCallback(()=>h("new"),[h]);Kn("create",x);const b=v.useMemo(()=>t.filter(R=>(!g||R.status===g)&&pm(p,[R.name,R.id,R.description])),[t,p,g]);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(qn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{children:[d.jsx(tj,{kind:"feature",label:"Features"}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter by name or status, then inspect child phases and tasks directly from the rows."})]}),d.jsx(wt,{to:"new",children:d.jsx(yt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),d.jsx(mm,{query:p,status:g,statusOptions:Fc,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:b.length===t.length?`${t.length} features`:`${b.length} of ${t.length} features`}),d.jsx("div",{className:"grid gap-3",children:b.length>0?b.map(R=>d.jsx(WT,{feature:R,phasesCount:r.get(R.id)??0,tasksCount:i.get(R.id)??0,phaseSummary:u.get(R.id)??wu(),taskSummary:o.get(R.id)??wu()},R.id)):d.jsx(qn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),d.jsx(Au,{})]})}async function lj({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[r,i]=await Promise.all([Ou(a),Wh(a)]);return{feature:r,phases:i}}function rj({featureId:t,feature:a,phase:r}){var x;const i=rs(),u=rs(),h=((x=i.formData)==null?void 0:x.get("status"))??r.status,m=i.state!=="idle",p=u.state!=="idle",g=Tc(Gb(r.tasks));return d.jsxs("div",{className:"surface-card px-4 py-2",children:[d.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(os,{type:"phase",number:r.number}),d.jsx(xc,{type:"phase",featureNum:a.number}),r.handoff?d.jsx(tm,{updatedAt:r.handoffUpdatedAt}):null,d.jsx("span",{className:"shrink-0",children:d.jsx(Oa,{status:h})})]}),d.jsx(wt,{to:`/features/${t}/phases/${r.id}`,className:"entity-link--phase min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline lg:w-auto lg:truncate",children:r.title})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[d.jsx(wt,{to:`/features/${t}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,children:d.jsx(yt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${r.id}/delete`,onSubmit:b=>{window.confirm(`Delete phase “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r.tasks.length," tasks"]}),g?d.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),d.jsx(i.Form,{method:"post",action:`/features/${t}/phases/${r.id}/status`,className:"w-full lg:w-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx("select",{name:"status",value:h,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:b=>i.submit(b.currentTarget.form),children:Gc.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))}),d.jsx(ss,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),d.jsx(wt,{to:`/features/${t}/phases/${r.id}/edit`,"aria-label":`Edit phase ${r.title}`,className:"hidden lg:block",children:d.jsx(yt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${r.id}/delete`,className:"hidden lg:block",onSubmit:b=>{window.confirm(`Delete phase “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]}),r.summary?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:r.summary}):null]})}function gm({items:t,className:a=""}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:t.map((r,i)=>{const u=i===t.length-1,o=r.to&&!u?d.jsx(wt,{to:r.to,className:"font-semibold text-[var(--accent)] hover:underline",children:r.label}):d.jsx("span",{className:u?"text-[var(--text)]":"text-[var(--text-muted)]",children:r.label});return d.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[i>0?d.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,d.jsx("span",{className:"min-w-0 break-words",children:o})]},`${r.label}-${i}`)})})}function xn({className:t="",children:a,...r}){return d.jsx("div",{className:`surface-card p-4 ${t}`,...r,children:a})}function vm({decisions:t}){return t.length===0?null:d.jsxs("details",{className:"group mt-4",children:[d.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:d.jsxs("span",{children:["Accepted decisions (",t.length,")"]})}),d.jsx("div",{className:"mt-2 grid gap-3",children:t.map(a=>d.jsxs("div",{className:"surface-card px-4 py-3",children:[d.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?d.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),d.jsx($n,{text:a.decision,className:"mt-1"})]}):null,a.rationale?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),d.jsx($n,{text:a.rationale,className:"mt-1"})]}):null,a.implementationNotes?d.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),d.jsx($n,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}function sj(t){return t.reduce((a,r)=>a+r.tasks.length,0)}function ij(t){let a=0,r=0,i=0,u=0;for(const o of t)for(const h of o.tasks)h.status==="in-progress"&&(a+=1),h.status==="done"&&(r+=1),h.status==="blocked"&&(i+=1),["done","canceled"].includes(h.status)||(u+=1);return{inProgress:a,done:r,blocked:i,remaining:u}}function uj(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function oj(){var C,N;const{feature:t,phases:a}=us(),r=t.acceptedDecisions??[],i=sj(a),u=ij(a),o=uj(a),[h]=Zh(),m=((C=h.get("q"))==null?void 0:C.trim())??"",p=((N=h.get("status"))==null?void 0:N.trim())??"",g=v.useMemo(()=>a.filter(z=>(!p||z.status===p)&&pm(m,[z.title,z.id,z.summary,z.description])),[a,m,p]),x=Mr(),b=v.useRef(null),w=v.useCallback(()=>x("edit"),[x]),S=v.useCallback(()=>x("phases/new"),[x]),R=v.useCallback(()=>{var z;(z=b.current)==null||z.requestSubmit()},[]);return Kn("edit",w),Kn("create",S),Kn("delete",R),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(wt,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(kc,{className:"h-4 w-4"})," Back to features"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(gm,{items:[{label:"Features",to:"/features"},{label:t.name}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(Wl,{id:li({featureNum:t.number}),children:d.jsx(Jl,{featureNum:t.number})}),t.shortId?d.jsx(ri,{shortId:t.shortId}):null,d.jsx(Oa,{status:t.status})]}),d.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:t.name}),t.description?d.jsx($n,{text:t.description,className:"plan-description mt-3 max-w-4xl"}):null,d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(wt,{to:"edit",children:d.jsx(yt,{type:"button",shortcut:"edit",children:"Edit feature"})}),d.jsx(ka,{ref:b,method:"post",action:`/features/${t.id}/delete`,className:"inline-flex",onSubmit:z=>{window.confirm(`Delete feature "${t.name}"?`)||z.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),d.jsxs(qn,{className:"grid gap-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(o==null?void 0:o.title)||"No active phase"})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.length})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:i})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Window"}),d.jsxs("p",{className:"mt-2 text-sm font-semibold text-[var(--text)]",children:[t.startDate||"Not set"," → ",t.endDate||"Not set"]})]})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]})]}),t.workDone||t.workRemaining?d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.workDone?d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done:"}),d.jsx($n,{text:t.workDone,className:"mt-2"})]}):null,t.workRemaining?d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining:"}),d.jsx($n,{text:t.workRemaining,className:"mt-2"})]}):null]}):null,r.length>0?d.jsx(vm,{decisions:r}):null]}),d.jsxs(qn,{className:"grid gap-5",children:[d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[d.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[d.jsx(os,{type:"phase",number:0}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter this feature's phases by name or status."})]}),d.jsx(wt,{to:"phases/new",children:d.jsx(yt,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),d.jsx(mm,{query:m,status:p,statusOptions:Gc,placeholder:"Search phase title, id, or summary",clearTo:`/features/${t.id}`,resultsLabel:g.length===a.length?`${a.length} phases`:`${g.length} of ${a.length} phases`}),d.jsx("div",{className:"grid gap-3",children:g.length>0?g.map(z=>d.jsx(rj,{featureId:t.id,feature:t,phase:z},z.id)):d.jsx(qn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),d.jsx(Au,{})]})}async function cj({params:t}){const{featureId:a,phaseId:r}=t;if(!a||!r)throw new Response("featureId and phaseId required",{status:400});const[i,u]=await Promise.all([Ou(a),Uc(r)]);return{feature:i,phase:u}}function fx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function dj({featureId:t,phaseId:a,task:r}){var x;const i=rs(),u=rs(),h=((x=i.formData)==null?void 0:x.get("status"))??r.status,m=i.state!=="idle",p=u.state!=="idle",g=Tc(JT(r.subtasks));return d.jsxs("div",{className:"surface-card px-4 py-2",children:[d.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:flex-row lg:items-center lg:gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(os,{type:"task",number:r.number}),d.jsx("span",{className:"shrink-0",children:d.jsx(Oa,{status:h})})]}),d.jsx(wt,{to:`/features/${t}/phases/${a}/tasks/${r.id}`,className:"entity-link--task min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline lg:w-auto lg:truncate",children:r.title})]}),d.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[d.jsx(wt,{to:`/features/${t}/phases/${a}/tasks/${r.id}/edit`,"aria-label":`Edit task ${r.title}`,children:d.jsx(yt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${r.id}/delete`,onSubmit:b=>{window.confirm(`Delete task “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]})]}),d.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[d.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[r.subtasks.length," subtasks · ",r.checklist.length," checklist"]}),g?d.jsx("div",{className:"mt-0.5 break-words",children:g}):d.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),d.jsx(i.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${r.id}/status`,className:"w-full lg:w-auto",children:d.jsxs("div",{className:"relative",children:[d.jsx("select",{name:"status",value:h,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:b=>i.submit(b.currentTarget.form),children:zu.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))}),d.jsx(ss,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),d.jsx(wt,{to:`/features/${t}/phases/${a}/tasks/${r.id}/edit`,"aria-label":`Edit task ${r.title}`,className:"hidden lg:block",children:d.jsx(yt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:d.jsx(ei,{className:"h-3.5 w-3.5"})})}),d.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${a}/tasks/${r.id}/delete`,className:"hidden lg:block",onSubmit:b=>{window.confirm(`Delete task “${r.title}”? This cannot be undone.`)||b.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${r.title}`,children:d.jsx(ti,{className:"h-4 w-4"})})})]}),d.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[r.startedAt?d.jsxs("span",{children:["Started ",fx(r.startedAt)]}):null,r.completedAt?d.jsxs("span",{children:["Completed ",fx(r.completedAt)]}):null]}),r.description?d.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:r.description}):null]})}function fj(t){let a=0,r=0,i=0,u=0;for(const o of t.tasks)o.status==="in-progress"&&(a+=1),o.status==="done"&&(r+=1),o.status==="blocked"&&(i+=1),["done","canceled"].includes(o.status)||(u+=1);return{inProgress:a,done:r,blocked:i,remaining:u}}function hj(){var R,C;const{feature:t,phase:a}=us(),r=a.decisions??[],i=a.acceptedDecisions??[],u=fj(a),[o]=Zh(),h=((R=o.get("q"))==null?void 0:R.trim())??"",m=((C=o.get("status"))==null?void 0:C.trim())??"",p=v.useMemo(()=>a.tasks.filter(N=>(!m||N.status===m)&&pm(h,[N.title,N.id,N.description,N.shortName])),[a.tasks,h,m]),g=Mr(),x=v.useRef(null),b=v.useCallback(()=>g("edit"),[g]),w=v.useCallback(()=>g("tasks/new"),[g]),S=v.useCallback(()=>{var N;(N=x.current)==null||N.requestSubmit()},[]);return Kn("edit",b),Kn("create",w),Kn("delete",S),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(wt,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(kc,{className:"h-4 w-4"})," Back to feature"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(gm,{items:[{label:"Features",to:"/features"},{label:t.name,to:`/features/${t.id}`},{label:a.title}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(Wl,{id:li({featureNum:t.number,phaseNum:a.number}),children:d.jsx(Jl,{featureNum:t.number,phaseNum:a.number})}),a.shortId?d.jsx(ri,{shortId:a.shortId}):null,a.handoff?d.jsx(tm,{updatedAt:a.handoffUpdatedAt}):null,d.jsx(Oa,{status:a.status})]}),d.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:a.title}),a.summary?d.jsx($n,{text:a.summary,className:"mt-3 max-w-4xl"}):null,d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(wt,{to:"edit",children:d.jsx(yt,{type:"button",shortcut:"edit",children:"Edit phase"})}),d.jsx(wt,{to:"tasks/new",children:d.jsx(yt,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})}),d.jsx(ka,{ref:x,method:"post",action:`/features/${t.id}/phases/${a.id}/delete`,className:"inline-flex",onSubmit:N=>{window.confirm(`Delete phase "${a.title}"?`)||N.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),d.jsxs(qn,{className:"grid gap-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.tasks.length})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]})]}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.goals.length})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.dependencies.length})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),d.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.completionCriteria.length})]})]}),a.description?d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Description:"}),d.jsx($n,{text:a.description,className:"plan-description mt-2"})]}):null,r.length>0?d.jsxs("details",{className:"group mt-4",children:[d.jsx("summary",{className:"flex items-center gap-2 cursor-pointer font-semibold text-[var(--text)] select-none",children:d.jsxs("span",{children:["Decisions (",r.length,")"]})}),d.jsx("div",{className:"mt-2 ml-4 space-y-2 border-l-2 border-[var(--border)] pl-4",children:r.map((N,z)=>d.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:d.jsx($n,{text:N})},z))})]}):null,i.length>0?d.jsx(vm,{decisions:i}):null]}),d.jsxs(qn,{className:"grid gap-5",children:[d.jsxs("div",{children:[d.jsx(os,{type:"task",number:0}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter this phase's tasks by name or status."})]}),d.jsx(mm,{query:h,status:m,statusOptions:zu,placeholder:"Search task title, id, or description",clearTo:`/features/${t.id}/phases/${a.id}`,resultsLabel:p.length===a.tasks.length?`${a.tasks.length} tasks`:`${p.length} of ${a.tasks.length} tasks`}),d.jsx("div",{className:"grid gap-3",children:p.length>0?p.map(N=>d.jsx(dj,{featureId:t.id,phaseId:a.id,task:N},N.id)):d.jsx(qn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),d.jsx(Au,{})]})}async function mj({params:t}){const{featureId:a,phaseId:r,taskId:i}=t;if(!a||!r||!i)throw new Response("featureId, phaseId and taskId required",{status:400});const[u,o,h]=await Promise.all([Ou(a),Uc(r),Hc(i)]);return{feature:u,phase:o,task:h}}function wh(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function pj({featureId:t,phaseId:a,taskId:r,item:i}){const u=rs(),o=u.formData?u.formData.get("checked")==="true":i.checked,h=u.state!=="idle";return d.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[d.jsx("input",{type:"checkbox",checked:o,onChange:()=>u.submit({checked:i.checked?"false":"true"},{method:"post",action:`/features/${t}/phases/${a}/tasks/${r}/checklist/${i.id}/toggle`}),disabled:h,className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]","aria-label":`Toggle checklist item ${i.title}`}),d.jsx("div",{className:"min-w-0",children:d.jsx("p",{className:`text-sm ${o?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:i.title})})]})}function gj(){var x,b,w;const{feature:t,phase:a,task:r}=us(),i=r.decisions??[],u=r.acceptedDecisions??[],o=r.checklist??[],h=Mr(),m=v.useRef(null),p=v.useCallback(()=>h("edit"),[h]),g=v.useCallback(()=>{var S;(S=m.current)==null||S.requestSubmit()},[]);return Kn("edit",p),Kn("delete",g),d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(wt,{to:`/features/${t.id}/phases/${a.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(kc,{className:"h-4 w-4"})," Back to phase"]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx(gm,{items:[{label:"Features",to:"/features"},{label:t.name,to:`/features/${t.id}`},{label:a.title,to:`/features/${t.id}/phases/${a.id}`},{label:r.title}]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsx(Wl,{id:li({featureNum:t.number,phaseNum:a.number,taskNum:r.number}),children:d.jsx(Jl,{featureNum:t.number,phaseNum:a.number,taskNum:r.number})}),r.shortId?d.jsx(ri,{shortId:r.shortId}):null,d.jsx(Oa,{status:r.status})]}),d.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:r.title}),d.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[d.jsx(wt,{to:"edit",children:d.jsx(yt,{type:"button",shortcut:"edit",children:"Edit task"})}),d.jsx(ka,{ref:m,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${r.id}/delete`,className:"inline-flex",onSubmit:S=>{window.confirm(`Delete task "${r.title}"?`)||S.preventDefault()},children:d.jsx(yt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),d.jsxs(qn,{className:"grid gap-4",children:[r.description?d.jsx($n,{text:r.description,className:"plan-description"}):null,r.notes?d.jsxs("details",{className:"group mt-4 border border-[var(--border)] rounded-lg overflow-hidden",children:[d.jsxs("summary",{className:"flex items-center justify-between p-3 cursor-pointer font-semibold text-[var(--text)] bg-[var(--surface-elevated)] hover:bg-[var(--surface-strong)] transition-colors select-none",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("span",{className:"text-sm",children:"Notes"})}),d.jsx(ss,{className:"h-4 w-4 transition-transform group-open:rotate-180 text-[var(--text-muted)]"})]}),d.jsx("div",{className:"p-3 border-t border-[var(--border)] bg-[var(--surface)]",children:d.jsx($n,{text:r.notes})})]}):d.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:"No notes"}),d.jsxs("details",{className:"group mt-4 border border-[var(--border)] rounded-lg overflow-hidden",open:r.statusLog&&r.statusLog.length>0,children:[d.jsxs("summary",{className:"flex items-center justify-between p-3 cursor-pointer font-semibold text-[var(--text)] bg-[var(--surface-elevated)] hover:bg-[var(--surface-strong)] transition-colors select-none",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"text-sm",children:["Status History (",((x=r.statusLog)==null?void 0:x.length)??0,")"]})}),d.jsx(ss,{className:"h-4 w-4 transition-transform group-open:rotate-180 text-[var(--text-muted)]"})]}),d.jsx("div",{className:"p-3 border-t border-[var(--border)] bg-[var(--surface)]",children:r.statusLog&&r.statusLog.length>0?d.jsx("div",{className:"mt-3 ml-2 border-l-2 border-[var(--border)] pl-4 space-y-3",children:[...r.statusLog].reverse().map((S,R)=>d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:"absolute -left-[21px] top-1.5 h-2.5 w-2.5 rounded-full border-2 border-[var(--border)] bg-[var(--surface)]"}),d.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[d.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:wh(S.date)}),d.jsxs("span",{className:`text-xs font-bold px-1.5 py-0.5 rounded-full ${S.toStatus==="done"?"bg-[color:color-mix(in_srgb,var(--color-status-done)_16%,transparent)] text-[var(--color-status-done)]":S.toStatus==="blocked"?"bg-[color:color-mix(in_srgb,var(--color-status-blocked)_16%,transparent)] text-[var(--color-status-blocked)]":S.toStatus==="canceled"?"bg-[color:color-mix(in_srgb,var(--color-status-canceled)_16%,transparent)] text-[var(--color-status-canceled)]":S.toStatus==="in-progress"?"bg-[color:color-mix(in_srgb,var(--color-status-in-progress)_16%,transparent)] text-[var(--color-status-in-progress)]":"bg-[color:color-mix(in_srgb,var(--color-status-planned)_16%,transparent)] text-[var(--color-status-planned)]"}`,children:[S.fromStatus," → ",S.toStatus]})]}),S.title&&S.title!==`${S.fromStatus} → ${S.toStatus}`?d.jsx("p",{className:"mt-1 text-sm font-medium text-[var(--text)]",children:S.title}):null,S.description?d.jsx("p",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:S.description}):null]},S.id))}):d.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."})})]}),i.length>0?d.jsxs("details",{className:"group mt-4",children:[d.jsx("summary",{className:"flex items-center gap-2 cursor-pointer font-semibold text-[var(--text)] select-none",children:d.jsxs("span",{children:["Decisions (",i.length,")"]})}),d.jsx("div",{className:"mt-2 ml-4 space-y-2 border-l-2 border-[var(--border)] pl-4",children:i.map((S,R)=>d.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:d.jsx($n,{text:S})},R))})]}):null,u.length>0?d.jsx(vm,{decisions:u}):null,d.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:o.length})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),d.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((b=r.subtasks)==null?void 0:b.length)??0})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Started"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:r.startedAt?wh(r.startedAt):"—"})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completed"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:r.completedAt?wh(r.completedAt):"—"})]}),d.jsxs(xn,{children:[d.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phase"}),d.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:a.title})]})]}),o.length?d.jsxs("div",{className:"grid gap-3",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-[var(--text)]",children:"Checklist"}),d.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:"Always visible and linked to the real task checklist."})]}),d.jsx("div",{className:"grid gap-2",children:o.map(S=>d.jsx(pj,{featureId:t.id,phaseId:a.id,taskId:r.id,item:S},S.id))})]}):null,(w=r.subtasks)!=null&&w.length?d.jsxs("details",{className:"surface-card px-4 py-4",children:[d.jsx("summary",{className:"cursor-pointer list-none text-sm font-bold text-[var(--text)]",children:"Subtasks"}),d.jsx("div",{className:"mt-3 grid gap-2",children:r.subtasks.map(S=>d.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:S.title}),d.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:S.id})]}),d.jsx(Oa,{status:S.status})]},S.id))})]}):null]}),d.jsx(Au,{})]})}const vj=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function oi({title:t,description:a,children:r}){const i=Mr(),u=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{var g;const h=u.current;if(!h)return;const m=document.activeElement;(g=o.current)==null||g.focus();const p=x=>{if(x.key==="Escape"){x.preventDefault(),i(-1);return}if(x.key!=="Tab")return;const b=Array.from(h.querySelectorAll(vj)).filter(C=>C.offsetParent!==null);if(b.length===0){x.preventDefault(),h.focus();return}const w=b[0],S=b[b.length-1],R=document.activeElement;x.shiftKey?(R===w||!h.contains(R))&&(x.preventDefault(),S.focus()):R===S&&(x.preventDefault(),w.focus())};return window.addEventListener("keydown",p),()=>{var x;window.removeEventListener("keydown",p),(x=m==null?void 0:m.focus)==null||x.call(m)}},[i]),d.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[d.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>i(-1),"aria-label":"Close modal",tabIndex:-1}),d.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:d.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"surface-panel flex max-h-[calc(100vh-2rem)] w-full max-w-2xl flex-col overflow-hidden p-6 outline-none md:max-h-[calc(100vh-3rem)] md:p-8",children:[d.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:t}),a?d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:a}):null]}),d.jsx("button",{ref:o,type:"button",onClick:()=>i(-1),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] text-[var(--text-muted)] transition hover:text-[var(--text)]","aria-label":"Close modal",children:d.jsx(Bw,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:r})]})})]})}function ci({className:t="",children:a,...r}){return d.jsx("div",{className:`sticky bottom-0 mt-2 flex justify-end gap-3 border-t border-[var(--border)] bg-[var(--surface)] px-1 pt-4 pb-1 backdrop-blur-xl ${t}`,...r,children:a})}function Et({label:t,children:a}){return d.jsxs("label",{className:"grid gap-2",children:[d.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:t}),a]})}function Bn(t){return d.jsx("textarea",{className:"field-control field-textarea",...t})}function yj(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Kn("submit",i,{allowInEditable:!0}),d.jsx(oi,{title:"Create feature",description:"Top-level container for phases and tasks.",children:d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Feature name",children:d.jsx(Ia,{name:"name",placeholder:"Products page implementation",required:!0})}),d.jsx(Et,{label:"Description",children:d.jsx(Bn,{name:"description",placeholder:"Short context for the feature"})}),d.jsx(ci,{children:d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function xj(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var h;return(h=r.current)==null?void 0:h.requestSubmit()},[]);Kn("submit",i,{allowInEditable:!0});const o=Cu("feature-detail").feature;return d.jsx(oi,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Name",children:d.jsx(Ia,{name:"name",defaultValue:o.name,required:!0})}),d.jsx(Et,{label:"Description",children:d.jsx(Bn,{name:"description",defaultValue:o.description})}),d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsx(Et,{label:"Start date",children:d.jsx(Ia,{type:"date",name:"startDate",defaultValue:o.startDate})}),d.jsx(Et,{label:"End date",children:d.jsx(Ia,{type:"date",name:"endDate",defaultValue:o.endDate})})]}),d.jsx(Et,{label:"Status",children:d.jsx(Bu,{name:"status",defaultValue:o.status,children:Fc.map(h=>d.jsx("option",{value:h.value,children:h.label},h.value))})}),d.jsx(Et,{label:"Priority",children:d.jsx(Ia,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),d.jsx(Et,{label:"Work done",children:d.jsx(Bn,{name:"workDone",defaultValue:o.workDone})}),d.jsx(Et,{label:"Work remaining",children:d.jsx(Bn,{name:"workRemaining",defaultValue:o.workRemaining})}),d.jsx(ci,{children:d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function bj(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Kn("submit",i,{allowInEditable:!0}),d.jsx(oi,{title:"Create phase",description:"A phase belongs to the current feature.",children:d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Phase title",children:d.jsx(Ia,{name:"title",placeholder:"API creation",required:!0})}),d.jsx(Et,{label:"Summary",children:d.jsx(Bn,{name:"summary",placeholder:"Brief phase summary"})}),d.jsx(Et,{label:"Description",children:d.jsx(Bn,{name:"description",placeholder:"Initial implementation notes"})}),d.jsx(ci,{children:d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function Gs(t){return t.join(`
209
+ `)}function Sj(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var h;return(h=r.current)==null?void 0:h.requestSubmit()},[]);Kn("submit",i,{allowInEditable:!0});const o=Cu("phase-detail").phase;return d.jsx(oi,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Title",children:d.jsx(Ia,{name:"title",defaultValue:o.title,required:!0})}),d.jsx(Et,{label:"Status",children:d.jsx(Bu,{name:"status",defaultValue:o.status,children:Gc.map(h=>d.jsx("option",{value:h.value,children:h.label},h.value))})}),d.jsx(Et,{label:"Priority",children:d.jsx(Ia,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),d.jsx(Et,{label:"Summary",children:d.jsx(Bn,{name:"summary",defaultValue:o.summary})}),d.jsx(Et,{label:"Description",children:d.jsx(Bn,{name:"description",defaultValue:o.description})}),d.jsx(Et,{label:"Goals (one per line)",children:d.jsx(Bn,{name:"goals",defaultValue:Gs(o.goals)})}),d.jsx(Et,{label:"Non-goals (one per line)",children:d.jsx(Bn,{name:"nonGoals",defaultValue:Gs(o.nonGoals)})}),d.jsx(Et,{label:"Dependencies (one per line)",children:d.jsx(Bn,{name:"dependencies",defaultValue:Gs(o.dependencies)})}),d.jsx(Et,{label:"Risks (one per line)",children:d.jsx(Bn,{name:"risks",defaultValue:Gs(o.risks)})}),d.jsx(Et,{label:"Open questions (one per line)",children:d.jsx(Bn,{name:"openQuestions",defaultValue:Gs(o.openQuestions)})}),d.jsx(Et,{label:"Completion criteria (one per line)",children:d.jsx(Bn,{name:"completionCriteria",defaultValue:Gs(o.completionCriteria)})}),d.jsx(ci,{children:d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function Ej(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var u;return(u=r.current)==null?void 0:u.requestSubmit()},[]);return Kn("submit",i,{allowInEditable:!0}),d.jsx(oi,{title:"Create task",description:"A task belongs to the current phase.",children:d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Task title",children:d.jsx(Ia,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),d.jsx(Et,{label:"Description",children:d.jsx(Bn,{name:"description",placeholder:"Initial task context"})}),d.jsx(Et,{label:"Status",children:d.jsx(Bu,{name:"status",defaultValue:"planned",children:zu.map(u=>d.jsx("option",{value:u.value,children:u.label},u.value))})}),d.jsx(ci,{children:d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function wj(t){return t.map(a=>a.title).join(`
210
+ `)}function Rj(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var h;return(h=r.current)==null?void 0:h.requestSubmit()},[]);Kn("submit",i,{allowInEditable:!0});const o=Cu("task-detail").task;return d.jsx(oi,{title:"Edit task",description:"Update execution details and checklist items.",children:d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Title",children:d.jsx(Ia,{name:"title",defaultValue:o.title,required:!0})}),d.jsx(Et,{label:"Status",children:d.jsx(Bu,{name:"status",defaultValue:o.status,children:zu.map(h=>d.jsx("option",{value:h.value,children:h.label},h.value))})}),d.jsx(Et,{label:"Priority",children:d.jsx(Ia,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),d.jsx(Et,{label:"Description",children:d.jsx(Bn,{name:"description",defaultValue:o.description})}),d.jsx(Et,{label:"Checklist (one per line)",children:d.jsx(Bn,{name:"checklist",defaultValue:wj(o.checklist)})}),d.jsx(ci,{children:d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function Nj(){const a=kr().state!=="idle",r=v.useRef(null),i=v.useCallback(()=>{var o;return(o=r.current)==null?void 0:o.requestSubmit()},[]);Kn("submit",i,{allowInEditable:!0});const{project:u}=Cu("root");return d.jsxs("div",{className:"grid gap-8",children:[d.jsxs(wt,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[d.jsx(kc,{className:"h-4 w-4"})," Back to dashboard"]}),d.jsxs(qn,{className:"grid gap-5",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project goal"}),d.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Define the main objective of the project. This long-form goal appears in the Project Goal card on the dashboard."})]}),d.jsxs(ka,{ref:r,method:"post",className:"grid gap-4",children:[d.jsx(Et,{label:"Project goal",children:d.jsx(Bn,{name:"goal",defaultValue:u.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx(wt,{to:"/",children:d.jsx(yt,{type:"button",variant:"ghost",children:"Cancel"})}),d.jsx(yt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save goal"})]})]})]})]})}function Ma(t,a){const r=t.get(a);if(typeof r!="string"||r.trim()==="")throw new Response(`Missing field: ${a}`,{status:400});return r.trim()}function ua(t,a){const r=t.get(a);return typeof r=="string"?r.trim():""}function ym(t,a){const r=t.get(a);if(typeof r!="string")return 0;const i=r.trim();if(i==="")return 0;const u=Number(i);return Number.isFinite(u)?u:0}function ns(t,a){return ua(t,a).split(`
211
+ `).map(r=>r.trim()).filter(Boolean)}function dn(t,a){const r=t[a];if(!r)throw new Response(`Missing route param: ${a}`,{status:400});return r}async function Tj({request:t}){const a=await t.formData();return await Gw({name:Ma(a,"name"),description:ua(a,"description")}),wl("/features")}async function jj({request:t,params:a}){const r=dn(a,"featureId"),i=await Ou(r),u=await t.formData();return await ib({...i,name:Ma(u,"name"),description:ua(u,"description"),startDate:ua(u,"startDate"),endDate:ua(u,"endDate"),status:Ma(u,"status"),priority:ym(u,"priority"),workDone:ua(u,"workDone"),workRemaining:ua(u,"workRemaining")}),wl(`/features/${r}`)}async function Dj({params:t}){return await Xw(dn(t,"featureId")),wl("/features")}async function Cj({request:t,params:a}){const r=dn(a,"featureId"),i=await Ou(r),u=await t.formData();return await ib({...i,status:Ma(u,"status")}),null}async function Aj({request:t,params:a}){const r=dn(a,"featureId"),i=await t.formData();return await Iw({featureId:r,title:Ma(i,"title"),summary:ua(i,"summary"),description:ua(i,"description")}),wl(`/features/${r}`)}async function Oj({request:t,params:a}){const r=dn(a,"featureId"),i=dn(a,"phaseId"),u=await Uc(i),o=await t.formData();return await ub({...u,title:Ma(o,"title"),status:Ma(o,"status"),priority:ym(o,"priority"),summary:ua(o,"summary"),description:ua(o,"description"),goals:ns(o,"goals"),nonGoals:ns(o,"nonGoals"),dependencies:ns(o,"dependencies"),risks:ns(o,"risks"),openQuestions:ns(o,"openQuestions"),completionCriteria:ns(o,"completionCriteria")}),wl(`/features/${r}/phases/${i}`)}async function Mj({params:t}){const a=dn(t,"featureId"),r=dn(t,"phaseId");return await Qw(r),wl(`/features/${a}`)}async function kj({request:t,params:a}){const r=dn(a,"phaseId"),i=await Uc(r),u=await t.formData();return await ub({...i,status:Ma(u,"status")}),null}async function _j({request:t,params:a}){const r=dn(a,"featureId"),i=dn(a,"phaseId"),u=await t.formData();return await Pw(i,{title:Ma(u,"title"),description:ua(u,"description"),status:ua(u,"status")||"planned"}),wl(`/features/${r}/phases/${i}`)}function Lj(t,a){const r=new Map(t.map(u=>[u.id,u])),i=new Map(t.map(u=>[u.title.trim().toLowerCase(),u]));return a.map((u,o)=>{var p;const h=u.trim().toLowerCase(),m=r.get(((p=t[o])==null?void 0:p.id)??"")??i.get(h);return m?{...m,title:u.trim()}:{id:`check-${o+1}-${h.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,title:u.trim(),checked:!1}})}async function zj({request:t,params:a}){const r=dn(a,"featureId"),i=dn(a,"phaseId"),u=dn(a,"taskId"),o=await Hc(u),h=await t.formData();return await em({...o,phaseId:i,title:Ma(h,"title"),status:Ma(h,"status"),priority:ym(h,"priority"),description:ua(h,"description"),checklist:Lj(o.checklist,ns(h,"checklist"))}),wl(`/features/${r}/phases/${i}/tasks/${u}`)}async function Uj({params:t}){const a=dn(t,"featureId"),r=dn(t,"phaseId"),i=dn(t,"taskId");return await Kw(i),wl(`/features/${a}/phases/${r}`)}async function Hj({request:t,params:a}){const r=dn(a,"phaseId"),i=dn(a,"taskId"),u=await Hc(i),o=await t.formData();return await em({...u,phaseId:r,status:Ma(o,"status")}),null}async function Bj({request:t}){const a=await rb(),r=await t.formData();return await Vw({...a,goal:ua(r,"goal")}),wl("/")}function hx(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function $j(){return{handoffs:await cb()}}function qj(){var S;const{handoffs:t}=us(),[a,r]=v.useState(((S=t[0])==null?void 0:S.phaseId)??null),[i,u]=v.useState(""),[o,h]=v.useState(""),[m,p]=v.useState(!1),[g,x]=v.useState(0);v.useEffect(()=>{let R=!1;if(!a){u(""),h("");return}return p(!0),Zw(a).then(C=>{R||(u(C.content),h(C.updatedAt))}).catch(()=>{R||(u(""),h(""))}).finally(()=>{R||p(!1)}),()=>{R=!0}},[a,g]),v.useEffect(()=>{const R=C=>{const N=C.detail;((N==null?void 0:N.type)==="handoffUpdated"||(N==null?void 0:N.type)==="handoffCleared")&&x(z=>z+1)};return window.addEventListener("agent-plan:ws-event",R),()=>window.removeEventListener("agent-plan:ws-event",R)},[]);const b=t.find(R=>R.phaseId===a)??null;async function w(){a&&(await Jw(a),r(null),u(""),h(""))}return t.length===0?d.jsxs(qn,{className:"grid gap-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Entity-scoped handoffs written on phases (phase.handoff field)."})]}),d.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):d.jsxs("div",{className:"grid gap-4 lg:grid-cols-[280px_1fr]",children:[d.jsxs(qn,{className:"grid gap-1 p-3",children:[d.jsxs("h2",{className:"px-2 pb-2 text-sm font-bold text-[var(--text)]",children:["Pending (",t.length,")"]}),d.jsx("ul",{className:"grid gap-1",children:t.map(R=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>r(R.phaseId),className:`grid w-full gap-1 rounded-xl px-2 py-2 text-left ${a===R.phaseId?"bg-[var(--surface-elevated)]":"hover:bg-[var(--surface-card)]"}`,children:[d.jsx("span",{className:"flex flex-wrap items-center gap-2",children:d.jsx(Wl,{id:R.compositeRef,children:R.compositeRef})}),d.jsx("span",{className:"truncate text-xs text-[var(--text-muted)]",children:R.firstLine}),d.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:hx(R.updatedAt)})]})},R.phaseId))})]}),d.jsxs(qn,{className:"grid gap-4",children:[d.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[d.jsxs("div",{className:"grid gap-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b?d.jsx(Wl,{id:b.compositeRef,children:b.compositeRef}):null,d.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["Updated ",hx(o)]})]}),d.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:(b==null?void 0:b.firstLine)??"Handoff"})]}),b?d.jsx("button",{type:"button",onClick:w,className:"rounded-lg border border-[var(--border)] px-3 py-2 text-sm text-[var(--text-muted)] hover:bg-[var(--surface-card)]",children:"Clear handoff"}):null]}),d.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:m?d.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Loading…"}):i?d.jsx($n,{text:i,className:"formatted-text max-w-none"}):d.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"Select a handoff from the list."})})]})]})}async function Yj({request:t,params:a}){dn(a,"featureId");const r=dn(a,"phaseId"),i=dn(a,"taskId"),u=dn(a,"itemId"),o=await t.formData(),h=Ma(o,"checked")==="true",m=await Hc(i);return await em({...m,phaseId:r,checklist:m.checklist.map(p=>p.id===u?{...p,checked:h}:p)}),Response.json({ok:!0,taskId:i,itemId:u,checked:h})}const Vj=PE([{id:"root",path:"/",loader:xR,element:d.jsx(bR,{}),errorElement:d.jsx(SR,{}),children:[{index:!0,loader:ER,element:d.jsx(PT,{})},{path:"features",id:"features",loader:KT,element:d.jsx(aj,{}),children:[{path:"new",element:d.jsx(yj,{}),action:Tj}]},{path:"features/:featureId",id:"feature-detail",loader:lj,element:d.jsx(oj,{}),children:[{path:"edit",element:d.jsx(xj,{}),action:jj},{path:"phases/new",element:d.jsx(bj,{}),action:Aj}]},{path:"project/edit",element:d.jsx(Nj,{}),action:Bj},{path:"handoff",loader:$j,element:d.jsx(qj,{})},{path:"features/:featureId/delete",action:Dj},{path:"features/:featureId/status",action:Cj},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:cj,element:d.jsx(hj,{}),children:[{path:"edit",element:d.jsx(Sj,{}),action:Oj},{path:"tasks/new",element:d.jsx(Ej,{}),action:_j}]},{path:"features/:featureId/phases/:phaseId/delete",action:Mj},{path:"features/:featureId/phases/:phaseId/status",action:kj},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:mj,element:d.jsx(gj,{}),children:[{path:"edit",element:d.jsx(Rj,{}),action:zj}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:Uj},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:Hj},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:Yj}]}]),Xb=document.getElementById("root");if(!Xb)throw new Error("#root not found");BS.createRoot(Xb).render(d.jsx(v.StrictMode,{children:d.jsx(lw,{router:Vj})}));