@dubusoft/toodo-linux-x64 1.3.2-dev.7 → 1.3.2-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/toodo +0 -0
- package/bin/toodo-server +0 -0
- package/package.json +1 -1
- package/web/assets/{index-fpG1wq7n.js → index-GlVAlGcC.js} +4 -4
- package/web/assets/{markdown-C9D2w1Lj.js → markdown-BKJM8xjI.js} +1 -1
- package/web/assets/{server-access-CKo4KViI.js → server-access-DKlT6LdN.js} +1 -1
- package/web/assets/{task-graph-4bqrDL_v.js → task-graph-C475dM5B.js} +1 -1
- package/web/index.html +1 -1
- package/web/sw.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-BKJM8xjI.js","assets/dist-ZmB2kPfR.js","assets/task-graph-C475dM5B.js","assets/workspace-list-B8ackOK7.js","assets/button-Dghi8qWf.js","assets/connection-BFaD-ecb.js","assets/event-BTxkSTih.js","assets/task-graph-DLioOiRN.css","assets/server-access-DKlT6LdN.js","assets/offline-screen-CnvrTPjs.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,i as t,n,r,s as i,t as a}from"./dist-ZmB2kPfR.js";import{$ as o,A as s,At as c,B as l,Bt as u,C as d,Ct as f,D as p,Dt as m,E as h,Et as g,F as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,K as E,Kt as D,L as O,Lt as k,M as A,Mt as j,N as M,Nt as N,O as P,Ot as F,P as ee,Pt as I,Q as L,R as te,Rt as ne,S as re,St as R,T as ie,U as ae,Ut as z,V as oe,Vt as se,W as ce,Wt as B,X as V,Y as H,Z as le,_ as ue,_t as de,a as fe,at as pe,b as me,bt as he,c as ge,ct as _e,d as ve,dt as ye,et as be,f as xe,ft as Se,g as Ce,gt as we,h as Te,ht as Ee,i as De,it as Oe,j as ke,jt as Ae,k as je,kt as Me,l as Ne,lt as Pe,m as Fe,mt as Ie,n as Le,nt as Re,o as ze,ot as Be,p as Ve,pt as He,q as Ue,qt as We,r as Ge,rt as Ke,s as qe,st as Je,t as Ye,tt as Xe,u as Ze,ut as Qe,v as $e,vt as et,w as tt,wt as nt,x as rt,xt as it,y as at,yt as ot,z as st,zt as ct}from"./workspace-list-B8ackOK7.js";import{A as lt,C as ut,D as dt,E as ft,F as pt,I as mt,L as ht,M as gt,N as _t,O as vt,P as yt,S as bt,T as xt,_ as St,a as Ct,b as wt,c as Tt,d as Et,f as Dt,g as U,h as W,i as Ot,j as kt,k as At,l as jt,m as Mt,n as Nt,o as Pt,p as Ft,r as It,s as Lt,t as G,u as Rt,v as zt,w as Bt,x as Vt,y as Ht}from"./button-Dghi8qWf.js";import{a as Ut,c as Wt,l as Gt,n as Kt,o as qt,t as Jt}from"./connection-BFaD-ecb.js";import{a as Yt,c as Xt,i as Zt,r as Qt}from"./event-BTxkSTih.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var $t=class extends w{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ae({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=en(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=en(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=en(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=en(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){I.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>u(t,e))}findAll(e={}){return this.getAll().filter(t=>u(e,t))}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return I.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function en(e){return e.options.scope?.id}var tn=class extends w{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ct(r,t),a=this.get(i);return a||(a=new j({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){I.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>se(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>se(e,t)):t}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){I.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){I.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nn=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new tn,this.#t=e.mutationCache||new $t,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(B(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=k(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return I.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;I.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return I.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=I.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(S).catch(S)}invalidateQueries(e,t={}){return I.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=I.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(S)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(S)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(B(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(B(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return N.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ne(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{z(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ne(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{z(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ct(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===b&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rn=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),an=e(((e,t)=>{t.exports=rn()})),on=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),sn=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=on()})),cn=e((e=>{var n=an(),r=t(),i=sn();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),F=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),I=Symbol.for(`react.memo`),L=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.legacy_hidden`),re=Symbol.for(`react.memo_cache_sentinel`),R=Symbol.for(`react.view_transition`),ie=Symbol.for(`react.recoverable`),ae=Symbol.iterator;function z(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case F:return`Suspense`;case ee:return`SuspenseList`;case te:return`Activity`;case R:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case I:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case L:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,B=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,pe(_e,e)),t=me.current;var n=dp(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),sh._currentValue=H)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -7,12 +7,12 @@ import{a as e,i as t,n,r,s as i,t as a}from"./dist-ZmB2kPfR.js";import{$ as o,A
|
|
|
7
7
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);case 30:return we(`ViewTransition`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=n.unstable_scheduleCallback,je=n.unstable_cancelCallback,Me=n.unstable_shouldYield,Ne=n.unstable_requestPaint,Pe=n.unstable_now,Fe=n.unstable_getCurrentPriorityLevel,Ie=n.unstable_ImmediatePriority,Le=n.unstable_UserBlockingPriority,Re=n.unstable_NormalPriority,ze=n.unstable_LowPriority,Be=n.unstable_IdlePriority,Ve=n.log,He=n.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(e){var t=e&42;if(t!==0)return t;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&-e;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 et(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ke(n),i=1<<r;t|=e[r],n&=~i}return t}function rt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 it(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ke(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(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 ft(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pt(){var e=V.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function mt(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[gt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function U(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function W(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ot(e){e[Ct]=!0}function kt(e){e[wt]=void 0}var At=new Set,jt={};function Mt(e,t){Nt(e,t),Nt(e+`Capture`,t)}function Nt(e,t){for(jt[e]=t,e=0;e<t.length;e++)At.add(t[e])}var Pt=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]*$`),Ft={},It={};function Lt(e){return ke.call(It,e)?!0:ke.call(Ft,e)?!1:Pt.test(e)?It[e]=!0:(Ft[e]=!0,!1)}var G=!1;function Rt(){var e=G;return G=!1,e}function zt(e,t,n){if(Lt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Bt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var qt=/[\n"\\]/g;function Jt(e){return e.replace(qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Yt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Zt(e,Ht(n)):o===`number`&&e.value==t?Zt(e,Ht(e.value)):Zt(e,Ht(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ht(s):e.removeAttribute(`name`)}function Xt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Gt(e)}function Zt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function Qt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ht(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $t(e,t,n){t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Ht(n)}function en(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ce(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function tn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var nn=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 rn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||nn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,G=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(rn(e,i,r),G=!0)}else for(var o in t)t.hasOwnProperty(o)&&rn(e,o,t[o])}function cn(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 ln=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`],[`maskType`,`mask-type`],[`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`]]),un=/^[\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 dn(e){return un.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function fn(){}var pn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,gn=null;function _n(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Yt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[_t]||null;if(!i)throw Error(a(90));Yt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Kt(r)}break a;case`textarea`:$t(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Qt(e,!!n.multiple,t,!1)}}}var vn=!1;function yn(e,t,n){if(vn)return e(t,n);vn=!0;try{return e(t)}finally{if(vn=!1,(hn!==null||gn!==null)&&(Id(),hn&&(t=hn,e=gn,gn=hn=null,_n(t),e)))for(t=0;t<e.length;t++)_n(e[t])}}function bn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Sn=!1;if(xn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Sn=!0}}),window.addEventListener(`test`,Cn,Cn),window.removeEventListener(`test`,Cn,Cn)}catch{Sn=!1}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return En=i.slice(e,1<r?1-r:void 0)}function On(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kn(){return!0}function An(){return!1}function jn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?kn:An,this.isPropagationStopped=An,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=T({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=T({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xn,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!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(T({},zn,{dataTransfer:0})),Hn=jn(T({},Pn,{relatedTarget:0})),Un=jn(T({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Wn=jn(T({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Gn=jn(T({},Mn,{data:0})),Kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},qn={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`},Jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jn[e])?!!t[e]:!1}function Xn(){return Yn}var Zn=jn(T({},Pn,{key:function(e){if(e.key){var t=Kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Qn=jn(T({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=jn(T({},Mn,{submitter:0})),er=jn(T({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xn})),tr=jn(T({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=jn(T({},zn,{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})),rr=jn(T({},Mn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=xn&&`CompositionEvent`in window,or=null;xn&&`documentMode`in document&&(or=document.documentMode);var sr=xn&&`TextEvent`in window&&!or,cr=xn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=Dn(),En=Tn=wn=null,pr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=qf(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){zf(e,0)}function Sr(e){if(Kt(U(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(xn){var Tr;if(xn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,mn(e)),yn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ke.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lr(e.document)}return t}function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ur=xn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kr&&Ir(Kr,r)||(Kr=r,r=qf(Gr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function K(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:K(`Animation`,`AnimationEnd`),animationiteration:K(`Animation`,`AnimationIteration`),animationstart:K(`Animation`,`AnimationStart`),transitionrun:K(`Transition`,`TransitionRun`),transitionstart:K(`Transition`,`TransitionStart`),transitioncancel:K(`Transition`,`TransitionCancel`),transitionend:K(`Transition`,`TransitionEnd`)},Xr={},Zr={};xn&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionrun`),ri=Qr(`transitionstart`),ii=Qr(`transitioncancel`),ai=Qr(`transitionend`),oi=new Map,si=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);si.push(`scrollEnd`);function ci(e,t){oi.set(e,t),Mt(t,[e])}var li=0;function ui(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=_d.identifierPrefix;var n=li++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Td;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function fi(e,t){return e=di(e),t=di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var pi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},mi=[],hi=0,gi=0;function q(){for(var e=hi,t=gi=hi=0;t<e;){var n=mi[t];mi[t++]=null;var r=mi[t];mi[t++]=null;var i=mi[t];mi[t++]=null;var a=mi[t];if(mi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&bi(n,i,a)}}function _i(e,t,n,r){mi[hi++]=e,mi[hi++]=t,mi[hi++]=n,mi[hi++]=r,gi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function vi(e,t,n,r){return _i(e,t,n,r),xi(e)}function yi(e,t){return _i(e,null,null,t),xi(e)}function bi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ke(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function xi(e){if(50<Ed)throw Ed=0,Dd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Si={};function Ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wi(e,t,n,r){return new Ci(e,t,n,r)}function Ti(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ei(e,t){var n=e.alternate;return n===null?(n=wi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Di(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Oi(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Ti(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case te:return e=wi(31,n,t,i),e.elementType=te,e.lanes=o,e;case k:return ki(n.children,i,o,t);case A:s=8,i|=24;break;case j:return e=wi(12,n,t,i|2),e.elementType=j,e.lanes=o,e;case F:return e=wi(13,n,t,i),e.elementType=F,e.lanes=o,e;case ee:return e=wi(19,n,t,i),e.elementType=ee,e.lanes=o,e;case ne:case R:return e=i|32,e=wi(30,n,t,e),e.elementType=R,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case P:s=11;break a;case I:s=14;break a;case L:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=wi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ki(e,t,n,r){return e=wi(7,e,r,t),e.lanes=n,e}function Ai(e,t,n){return e=wi(6,e,null,t),e.lanes=n,e}function ji(e){var t=wi(18,null,null,0);return t.stateNode=e,t}function Mi(e,t,n){return t=wi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ni=new WeakMap;function Pi(e,t){if(typeof e==`object`&&e){var n=Ni.get(e);return n===void 0?(t={value:e,source:t,stack:Oe(t)},Ni.set(e,t),t):n}return{value:e,source:t,stack:Oe(t)}}var Fi=[],Ii=0,Li=null,Ri=0,zi=[],Bi=0,Vi=null,Hi=1,Ui=``;function Wi(e,t){Fi[Ii++]=Ri,Fi[Ii++]=Li,Li=e,Ri=t}function Gi(e,t,n){zi[Bi++]=Hi,zi[Bi++]=Ui,zi[Bi++]=Vi,Vi=e;var r=Hi;e=Ui;var i=32-Ke(r)-1;r&=~(1<<i),n+=1;var a=32-Ke(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Hi=1<<32-Ke(t)+i|n<<i|r,Ui=a+e}else Hi=1<<a|n<<i|r,Ui=e}function Ki(e){e.return!==null&&(Wi(e,1),Gi(e,1,0))}function qi(e){for(;e===Li;)Li=Fi[--Ii],Fi[Ii]=null,Ri=Fi[--Ii],Fi[Ii]=null;for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Ui=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null}function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Ui,zi[Bi++]=Vi,Hi=t.id,Ui=t.overflow,Vi=e}var Yi=null,Xi=null,J=!1,Zi=null,Qi=!1,$i=Error(a(519));function ea(e){throw oa(Pi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),$i}function ta(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Bf(`cancel`,t),Bf(`close`,t);break;case`iframe`:case`object`:case`embed`:Bf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Lf.length;n++)Bf(Lf[n],t);break;case`source`:Bf(`error`,t);break;case`img`:case`image`:case`link`:Bf(`error`,t),Bf(`load`,t);break;case`details`:Bf(`toggle`,t);break;case`input`:Bf(`invalid`,t),Xt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bf(`invalid`,t);break;case`textarea`:Bf(`invalid`,t),en(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&(Bf(`beforetoggle`,t),Bf(`toggle`,t)),r.onScroll!=null&&Bf(`scroll`,t),r.onScrollEnd!=null&&Bf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||ea(e,!0)}function na(e){for(Yi=e.return;Yi;)switch(Yi.tag){case 5:case 31:case 13:Qi=!1;return;case 27:case 3:Qi=!0;return;default:Yi=Yi.return}}function ra(e){if(e!==Yi)return!1;if(!J)return na(e),J=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Xi&&ea(e),na(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Xi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Xi=dm(e)}else t===27?(t=Xi,Sp(e.type)?(e=um,um=null,Xi=e):Xi=t):Xi=Yi?lm(e.stateNode.nextSibling):null;return!0}function ia(){Xi=Yi=null,J=!1}function aa(){var e=Zi;return e!==null&&(ld===null?ld=e:ld.push.apply(ld,e),Zi=null),e}function oa(e){Zi===null?Zi=[e]:Zi.push(e)}var sa=de(null),ca=null,la=null;function ua(e,t,n){pe(sa,t._currentValue),t._currentValue=n}function da(e){e._currentValue=sa.current,fe(sa)}function fa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function pa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),fa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),fa(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),fa(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ma(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Fr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===_e.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&pa(t,e,n,r),t.flags|=262144,e!==null}function ha(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ga(e){ca=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _a(e){return ya(ca,e)}function va(e,t){return ca===null&&ga(e),ya(e,t)}function ya(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},la===null){if(e===null)throw Error(a(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return n}var ba=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},xa=n.unstable_scheduleCallback,Sa=n.unstable_NormalPriority,Ca={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wa(){return{controller:new ba,data:new Map,refCount:0}}function Ta(e){e.refCount--,e.refCount===0&&xa(Sa,function(){e.controller.abort()})}function Ea(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Da=null;function Oa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ka=null,Aa=0,ja=0,Ma=null;function Na(e,t){if(ka===null){var n=ka=[];Aa=0,ja=Mf(),Ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Aa++,t.then(Pa,Pa),t}function Pa(){if(--Aa===0&&(Da=null,ka!==null)){Ma!==null&&(Ma.status=`fulfilled`);var e=ka;ka=null,ja=0,Ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ia=B.S;B.S=function(e,t){if(fd=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&Na(e,t),Da!==null)for(var n=vf;n!==null;)Ea(n,Da),n=n.next;if(n=e.types,n!==null){for(var r=vf;r!==null;)Ea(r,n),r=r.next;if(ja!==0){r=Da,r===null&&(r=Da=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ia!==null&&Ia(e,t)};var La=de(null);function Ra(){var e=La.current;return e===null?Yu.pooledCache:e}function za(e,t){t===null?pe(La,La.current):pe(La,t.pool)}function Ba(){var e=Ra();return e===null?null:{parent:Ca._currentValue,pool:e}}var Va=Error(a(460)),Ha=Error(a(474)),Ua=Error(a(542)),Wa={then:function(){}};function Ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Xa(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=Yu,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Xa(e),e}throw Ja=t,Va}}function qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ja=e,Va):e}}var Ja=null;function Ya(){if(Ja===null)throw Error(a(459));var e=Ja;return Ja=null,e}function Xa(e){if(e===Va||e===Ua)throw Error(a(483))}var Za=null,Qa=0;function $a(e){var t=Qa;return Qa+=1,Za===null&&(Za=[]),Ka(Za,e,t)}function eo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function to(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function no(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Ei(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ai(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===k?(e=d(e,t,n.props.children,r,n.key),eo(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===L&&qa(a)===t.type)?(t=i(t,n.props),eo(t,n),t.return=e,t):(t=Oi(n.type,n.key,n.props,null,e.mode,r),eo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Mi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ki(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ai(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Oi(t.type,t.key,t.props,null,e.mode,n),eo(n,t),n.return=e,n;case O:return t=Mi(t,e.mode,n),t.return=e,t;case L:return t=qa(t),f(e,t,n)}if(ce(t)||z(t))return t=ki(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,$a(t),n);if(t.$$typeof===N)return f(e,va(e,t),n);to(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case L:return n=qa(n),p(e,t,n,r)}if(ce(n)||z(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,$a(n),r);if(n.$$typeof===N)return p(e,t,va(e,n),r);to(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case L:return r=qa(r),m(e,t,n,r,i)}if(ce(r)||z(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,$a(r),i);if(r.$$typeof===N)return m(e,t,n,va(t,r),i);to(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),J&&Wi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return J&&Wi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),J&&Wi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),J&&Wi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return J&&Wi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),J&&Wi(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),eo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===L&&qa(l)===r.type){n(e,r.sibling),c=i(r,o.props),eo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=ki(o.props.children,e.mode,c,o.key),eo(c,o),c.return=e,e=c):(c=Oi(o.type,o.key,o.props,null,e.mode,c),eo(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Mi(o,e.mode,c),c.return=e,e=c}return s(e);case L:return o=qa(o),_(e,r,o,c)}if(ce(o))return h(e,r,o,c);if(z(o)){if(l=z(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,$a(o),c);if(o.$$typeof===N)return _(e,r,va(e,o),c);to(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Ai(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Qa=0;var i=_(e,t,n,r);return Za=null,i}catch(t){if(t===Va||t===Ua)throw t;var a=wi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ro=no(!0),io=no(!1),ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ju&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=xi(e),bi(e,null,n),t}return _i(e,r,t,n),xi(e)}function uo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}function fo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var po=!1;function mo(){if(po){var e=Ma;if(e!==null)throw e}}function ho(e,t,n,r){po=!1;var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?($&f)===f:(r&f)===f){f!==0&&f===ja&&(po=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:ao=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),rd|=o,e.lanes=o,e.memoizedState=d}}function go(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function _o(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)go(n[e],t)}var vo=de(null),yo=de(0);function bo(e,t){e=td,pe(yo,e),pe(vo,t),td=e|t.baseLanes}function xo(){pe(yo,td),pe(vo,vo.current)}function So(){td=yo.current,fe(vo),fe(yo)}var Co=de(null),wo=null;function To(e){var t=e.alternate;pe(Ao,Ao.current&1),pe(Co,e),wo===null&&(t===null||vo.current!==null||t.memoizedState!==null)&&(wo=e)}function Eo(e){pe(Ao,Ao.current),pe(Co,e),wo===null&&(wo=e)}function Do(e){e.tag===22?(pe(Ao,Ao.current),pe(Co,e),wo===null&&(wo=e)):Oo()}function Oo(){pe(Ao,Ao.current),pe(Co,Co.current)}function ko(e){fe(Co),wo===e&&(wo=null),fe(Ao)}var Ao=de(0);function jo(e,t){pe(Co,Co.current),pe(Ao,t)}function Mo(e){fe(Ao),fe(Co),wo===e&&(wo=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Po=0,Y=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(a(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return Po=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?cc:lc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){B.H=sc;var t=Fo!==null&&Fo.next!==null;if(Po=0,Io=Fo=Y=null,Lo=!1,Vo=0,Ho=null,t)throw Error(a(300));e===null||Tc||(e=e.dependencies,e!==null&&ha(e)&&(Tc=!0))}function Jo(e,t,n,r){Y=e;var i=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=i)throw Error(a(301));if(i+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}B.H=uc,o=t(n,r)}while(Ro);return o}function Yo(){var e=B.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Y.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}Po=0,Io=Fo=Y=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Y.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Y.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Y.alternate===null?Error(a(467)):Error(a(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Y.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ka(Ho,e,t),t=Y,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?cc:lc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===ie)return;if(e.$$typeof===N)return _a(e)}throw Error(a(438,String(e)))}function is(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ts(),Y.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=re;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Po&f)===f:($&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ja&&(d=!0);else if((Po&p)===p){u=u.next,p===ja&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Y.lanes|=p,rd|=p;f=u.action,zo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Y.lanes|=f,rd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(Tc=!0,d&&(n=Ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function cs(e){var t=es(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Fr(o,t.memoizedState)||(Tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Y,i=es(),o=J;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Fr((Fo||i).memoizedState,n);if(s&&(i.memoizedState=n,Tc=!0),i=i.queue,Ps(fs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Yu===null)throw Error(a(349));o||Po&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=ts(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function ms(e){var t=yi(e,2);t!==null&&jd(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,i){if(ic(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};B.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=B.T,o={};o.types=a===null?null:a.types,B.T=o;try{var s=n(i,r),c=B.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),B.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(J){var n=Yu.formState;if(n!==null){a:{var r=Y;if(J){if(Xi){b:{for(var i=Xi,a=Qi;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Xi=lm(i.nextSibling),r=i.data===`F!`;break a}}ea(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=tc.bind(null,Y,r),r.dispatch=n,r=hs(!1),a=rc.bind(null,Y,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Va?Ua:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=ts(),Y.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function As(){return es().memoizedState}function js(e,t,n,r){var i=$o();Y.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Y.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=ts(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=es().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(Ju&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(4,4,e,t)}function zs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function X(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||Po&1073741824&&!($&261930)?e.memoizedState=t:(e.memoizedState=n,e=kd(),Y.lanes|=e,rd|=e,n)}function Ws(e,t,n,r){return Fr(n,t)?n:vo.current===null?!(Po&106)||Po&1073741824&&!($&261930)?(Tc=!0,e.memoizedState=n):(e=kd(),Y.lanes|=e,rd|=e,t):(e=Us(e,n,r),Fr(e,t)||(Tc=!0),e)}function Gs(e,t,n,r,i){var a=V.p;V.p=a!==0&&8>a?a:8;var o=B.T,s={};s.types=o===null?null:o.types,B.T=s,rc(e,!1,t,n);try{var c=i(),l=B.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,Fa(c,r),Od(e)):nc(e,t,r,Od(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},Od())}finally{V.p=a,o!==null&&s.types!==null&&(o.types=s.types),B.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Js(e).queue;Gs(e,i,t,H,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:H},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},Od())}function Xs(){return _a(sh)}function Zs(){return es().memoizedState}function Qs(){return es().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Od();e=co(n);var r=lo(t,e,n);r!==null&&(jd(r,t,n),uo(r,t,n)),t={cache:wa()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=Od();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=vi(e,t,n,r),n!==null&&(jd(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,Od())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Fr(s,o))return _i(e,t,i,0),Yu===null&&q(),!1}catch{}if(n=vi(e,t,i,r),n!==null)return jd(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Mf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(a(479))}else t=vi(e,n,r,2),t!==null&&jd(t,e,2)}function ic(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function ac(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var sc={readContext:_a,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},cc={readContext:_a,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:_a,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){Ge(!0);try{n(t)}finally{Ge(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ec.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=tc.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Us($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Gs.bind(null,Y,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,i=$o();if(J){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Yu===null)throw Error(a(349));$&127||us(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Yu.identifierPrefix;if(J){var n=Ui,r=Hi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=$s.bind(null,Y)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(Ju&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:_a,use:rs,useCallback:Hs,useContext:_a,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:X,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:Qs,useEffectEvent:Is},uc={readContext:_a,use:rs,useCallback:Hs,useContext:_a,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:X,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=es();return Fo===null?Us(n,e,t):Ws(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Zs,useHostTransitionStatus:Xs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:Qs,useEffectEvent:Is};function Z(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Od(),i=co(r);i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(jd(t,e,r),uo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Od(),i=co(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(jd(t,e,r),uo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Od(),r=co(n);r.tag=2,t!=null&&(r.callback=t),t=lo(e,r,n),t!==null&&(jd(t,e,n),uo(t,e,n))}};function fc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ir(n,r)||!Ir(i,a):!0}function pc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function mc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function hc(e){pi(e)}function gc(e){console.error(e)}function _c(e){pi(e)}function vc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function yc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function bc(e,t,n){return n=co(n),n.tag=3,n.payload={element:null},n.callback=function(){vc(e,t)},n}function xc(e){return e=co(e),e.tag=3,e}function Sc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){yc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){yc(t,n,r),typeof i!=`function`&&(hd===null?hd=new Set([this]):hd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Cc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ma(t,n,i,!0),n=Co.current,n!==null){switch(n.tag){case 31:case 13:case 19:return wo===null?Ud():n.alternate===null&&nd===0&&(nd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ff(e,r,i)),!1;case 22:return n.flags|=65536,r===Wa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ff(e,r,i)),!1}throw Error(a(435,n.tag))}return ff(e,r,i),Ud(),!1}if(J)return t=Co.current,t===null?(r!==$i&&(t=Error(a(423),{cause:r}),oa(Pi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Pi(r,n),i=bc(e.stateNode,r,i),fo(e,i),nd!==4&&(nd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==$i&&(e=Error(a(422),{cause:r}),oa(Pi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Pi(o,n),cd===null?cd=[o]:cd.push(o),nd!==4&&(nd=2),t===null)return!0;r=Pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=bc(n.stateNode,r,e),fo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(hd===null||!hd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=xc(i),Sc(i,e,n,r),fo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var wc=Error(a(461)),Tc=!1;function Ec(e,t,n,r){t.child=e===null?io(t,null,n,r):ro(t,e.child,n,r)}function Dc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ga(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Tc?(Zo(e,t,i),tl(e,t,i)):(J&&s&&Ki(t),t.flags|=1,Ec(e,t,r,i),t.child)}function Oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ti(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,kc(e,t,a,r,i)):(e=Oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!nl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return tl(e,t,i)}return t.flags|=1,e=Ei(a,r),e.ref=t.ref,e.return=t,t.child=e}function kc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(Tc=!1,t.pendingProps=r=a,nl(e,i))e.flags&131072&&(Tc=!0);else return t.lanes=e.lanes,tl(e,t,i)}}return Lc(e,t,n,r,i)}function Ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Mc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&za(t,a===null?null:a.cachePool),a===null?xo():bo(t,a),Do(t);else return r=t.lanes=536870912,Mc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&za(t,null),xo(),Oo()):(za(t,a.cachePool),bo(t,a),Oo(),t.memoizedState=null);return Ec(e,t,i,n),t.child}function jc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mc(e,t,n,r,i){var a=Ra();return a=a===null?null:{parent:Ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&za(t,null),xo(),Do(t),e!==null&&ma(e,t,r,!0),t.childLanes=i,null}function Nc(e,t){return t=Kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Pc(e,t,n){return ro(t,e.child,null,n),e=Nc(t,t.pendingProps),e.flags|=2,ko(t),t.memoizedState=null,e}function Fc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(J){if(r.mode===`hidden`)return e=Nc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},jc(null,e);if(Eo(t),(e=Xi)?(e=am(e,Qi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi===null?null:{id:Hi,overflow:Ui},retryLane:536870912,hydrationErrors:null},n=ji(e),n.return=t,t.child=n,Yi=t,Xi=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return Nc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Eo(t),i){if(t.flags&256)t.flags&=-257,t=Pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Tc||ma(e,t,n,!1),i=(n&e.childLanes)!==0,Tc||i){if(vo.current===null){if(r=Yu,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,yi(e,s),jd(r,e,s),wc;Ud()}t=Pc(e,t,n)}else e=o.treeContext,Xi=lm(s.nextSibling),Yi=t,J=!0,Zi=null,Qi=!1,e!==null&&Ji(t,e),t=Nc(t,r),t.flags|=134221824;return t}return e=Ei(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ic(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Lc(e,t,n,r,i){return ga(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Tc?(Zo(e,t,i),tl(e,t,i)):(J&&r&&Ki(t),t.flags|=1,Ec(e,t,n,i),t.child)}function Rc(e,t,n,r,i,a){return ga(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Tc?(Zo(e,t,a),tl(e,t,a)):(J&&r&&Ki(t),t.flags|=1,Ec(e,t,n,a),t.child)}function zc(e,t,n,r,i){if(ga(t),t.stateNode===null){var a=Si,o=n.contextType;typeof o==`object`&&o&&(a=_a(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=dc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},oo(t),o=n.contextType,a.context=typeof o==`object`&&o?_a(o):Si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Z(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&dc.enqueueReplaceState(a,a.state,null),ho(t,r,a,i),mo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=mc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Si,typeof u==`object`&&u&&(o=_a(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&pc(t,a,r,o),ao=!1;var f=t.memoizedState;a.state=f,ho(t,r,a,i),mo(),l=t.memoizedState,s||f!==l||ao?(typeof d==`function`&&(Z(t,n,d,r),l=t.memoizedState),(c=ao||fc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,so(e,t),o=t.memoizedProps,u=mc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Si,typeof l==`object`&&l&&(c=_a(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&pc(t,a,r,c),ao=!1,f=t.memoizedState,a.state=f,ho(t,r,a,i),mo();var p=t.memoizedState;o!==d||f!==p||ao||e!==null&&e.dependencies!==null&&ha(e.dependencies)?(typeof s==`function`&&(Z(t,n,s,r),p=t.memoizedState),(u=ao||fc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ha(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Ic(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ro(t,e.child,null,i),t.child=ro(t,null,n,i)):Ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=tl(e,t,i),e}function Bc(e,t,n,r){return ia(),t.flags|=256,Ec(e,t,n,r),t.child}var Vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hc(e){return{baseLanes:e,cachePool:Ba()}}function Uc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=od),e}function Wc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(J){if(i?To(t):Oo(),(e=Xi)?(e=am(e,Qi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi===null?null:{id:Hi,overflow:Ui},retryLane:536870912,hydrationErrors:null},n=ji(e),n.return=t,t.child=n,Yi=t,Xi=null)):e=null,e===null)throw ea(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Oo(),i=t.mode,a=Kc({mode:`hidden`,children:a},i),r=ki(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Hc(n),r.childLanes=Uc(e,o,n),t.memoizedState=Vc,jc(null,r)):(To(t),Gc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Jc(e,t,a,o,r,c,s,n)}return i?(Oo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ei(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ki(i,a,n,null),i.flags|=2):i=Ei(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,jc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Hc(n):(a=i.cachePool,a===null?a=Ba():(s=Ca._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Uc(e,o,n),t.memoizedState=Vc,jc(e.child,r)):(To(t),n=e.child,e=n.sibling,n=Ei(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Gc(e,t){return t=Kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Kc(e,t){return e=wi(22,e,null,t),e.lanes=0,e}function qc(e,t,n){return ro(t,e.child,null,n),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jc(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(To(t),t.flags&=-257,qc(e,t,c)):t.memoizedState===null?(Oo(),o=i.fallback,s=t.mode,i=Kc({mode:`visible`,children:i.children},s),o=ki(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,ro(t,e.child,null,c),i=t.child,i.memoizedState=Hc(c),i.childLanes=Uc(e,r,c),t.memoizedState=Vc,jc(null,i)):(Oo(),t.child=e.child,t.flags|=128,null);if(To(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,oa({value:i,source:null,stack:null})),qc(e,t,c)}if(Tc||ma(e,t,c,!1),r=(c&e.childLanes)!==0,Tc||r){if(vo.current!==null)return qc(e,t,c);if(r=Yu,r!==null&&(i=ut(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,yi(e,i),jd(r,e,i),wc;return om(o)||Ud(),qc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Xi=lm(o.nextSibling),Yi=t,J=!0,Zi=null,Qi=!1,e!==null&&Ji(t,e),t=Gc(t,i.children),t.flags|=134221824,t)}function Yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fa(e.return,t,n)}function Xc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function Zc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Qc(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function $c(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?(Qc(e),Ec(e,t,r,n),Qc(e)):Ec(e,t,r,n),r=J?Ri:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yc(e,n,t);else if(e.tag===19)Yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Xc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Qc(t)),Zc(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Zc(t,!0,n,null,a,r);break;case`together`:Zc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Xc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Zc(t,!1,i,n,a,r)}return t.child}function el(e,t,n){var r=t.pendingProps;return ua(t,t.type,r.value),Ec(e,t,r.children,n),t.child}function tl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ma(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Ei(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ei(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ha(e)))}function rl(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ua(t,Ca,e.memoizedState.cache),ia();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return To(t),t.flags|=128,null;r=ma(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Wc(e,t,n):(To(t),e=tl(e,t,n),e===null?null:e.sibling)}To(t);break;case 19:if(t.flags&128)return $c(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ma(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return $c(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,Ac(e,t,n,t.pendingProps);case 24:ua(t,Ca,e.memoizedState.cache)}return tl(e,t,n)}function il(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Tc=!0;else{if(!nl(e,n)&&!(t.flags&128))return Tc=!1,rl(e,t,n);Tc=!!(e.flags&131072)}}else Tc=!1,J&&t.flags&1048576&&Gi(t,Ri,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=qa(t.elementType),t.type=e,typeof e==`function`)Ti(e)?(r=mc(e,r),t.tag=1,t=zc(null,t,e,r,n)):(t.tag=0,t=Lc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===P){t.tag=11,t=Dc(null,t,e,r,n);break a}if(i===I){t.tag=14,t=Oc(null,t,e,r,n);break a}if(i===N){t.tag=10,t.type=e,t=el(null,t,n);break a}}throw t=se(e)||e,Error(a(306,t,``))}}return t;case 0:return Lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=mc(r,t.pendingProps),zc(e,t,r,i,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,so(e,t),ho(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ua(t,Ca,r),r!==o.cache&&pa(t,[Ca],n,!0),mo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Bc(e,t,r,n);break a}if(r!==i){i=Pi(Error(a(424)),t),oa(i),t=Bc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Xi=lm(e.firstChild),Yi=t,J=!0,Zi=null,Qi=!0,n=io(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ia(),r===i){t=tl(e,t,n);break a}Ec(e,t,r,n)}t=t.child}return t;case 26:return Ic(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:J||(t.stateNode=fp(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&J&&(r=t.stateNode=hm(t.type,t.pendingProps,ge.current),Yi=t,Qi=!0,i=Xi,Sp(t.type)?(um=i,Xi=lm(r.firstChild)):Xi=i),Ec(e,t,t.pendingProps.children,n),Ic(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&J&&((i=r=Xi)&&(r=rm(r,t.type,t.pendingProps,Qi),r===null?i=!1:(t.stateNode=r,Yi=t,Xi=lm(r.firstChild),Qi=!1,i=!0)),i||ea(t)),be(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(i,o)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Ko(e,t,Yo,null,null,n),sh._currentValue=i),Ic(e,t),Ec(e,t,r,n),t.child;case 6:return e===null&&J&&((e=n=Xi)&&(n=im(n,t.pendingProps,Qi),n===null?e=!1:(t.stateNode=n,Yi=t,Xi=null,e=!0)),e||ea(t)),null;case 13:return Wc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ro(t,null,r,n):Ec(e,t,r,n),t.child;case 11:return Dc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Ic(e,t),Ec(e,t,r,n),t.child;case 8:return Ec(e,t,t.pendingProps.children,n),t.child;case 12:return Ec(e,t,t.pendingProps.children,n),t.child;case 10:return el(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ga(t),i=_a(i),r=r(i),t.flags|=1,Ec(e,t,r,n),t.child;case 14:return Oc(e,t,t.type,t.pendingProps,n);case 15:return kc(e,t,t.type,t.pendingProps,n);case 19:return $c(e,t,n);case 31:return Fc(e,t,n);case 22:return Ac(e,t,n,t.pendingProps);case 24:return ga(t),r=_a(Ca),e===null?(i=Ra(),i===null&&(i=Yu,o=wa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},oo(t),ua(t,Ca,i)):((e.lanes&n)!==0&&(so(e,t),ho(t,null,null,n),mo()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,ua(t,Ca,r),r!==i.cache&&pa(t,[Ca],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ua(t,Ca,r))),Ec(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:J&&Ki(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Ic(e,t),Ec(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function al(e){e.flags|=4}function ol(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Bd())e.flags|=8192;else throw Ja=Wa,Ha}}else e.flags&=-16777217}function sl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Bd())e.flags|=8192;else throw Ja=Wa,Ha}}function cl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:it(),e.lanes|=t,sd|=t)}function ll(e,t){if(!J)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ul(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function dl(e,t,n){var r=t.pendingProps;switch(qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ul(t),null;case 1:return ul(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),da(Ca),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ra(t)?al(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,aa())),ul(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(al(t),o===null?(ul(t),ol(t,i,null,r,n)):(ul(t),sl(t,o))):o?o===e.memoizedState?(ul(t),t.flags&=-16777217):(al(t),ul(t),sl(t,o)):(e=e.memoizedProps,e!==r&&al(t),ul(t),ol(t,i,e,r,n)),null;case 27:if(xe(t),n=ge.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&al(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return ul(t),t.subtreeFlags&=-33554433,null}e=me.current,ra(t)?ta(t,e):(e=hm(i,r,n),t.stateNode=e,al(t))}return ul(t),t.subtreeFlags&=-33554433,null;case 5:if(xe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&al(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return ul(t),t.subtreeFlags&=-33554433,null}if(o=me.current,ra(t))ta(t,o);else{var s=lp(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[gt]=t,o[_t]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&al(t)}}return ul(t),t.subtreeFlags&=-33554433,ol(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&al(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ge.current,ra(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Yi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ea(t,!0)}else e=lp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return ul(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ra(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[gt]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ul(t),e=!1}else n=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ko(t),t):(ko(t),null);if(t.flags&128)throw Error(a(558))}return ul(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ra(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[gt]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ul(t),i=!1}else i=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ko(t),t):(ko(t),null)}return ko(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),cl(t,t.updateQueue),ul(t),null);case 4:return ye(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,ul(t),null;case 10:return da(t.type),ul(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return ul(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)ll(r,!1);else{if(nd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,ll(r,!1),e=o.updateQueue,t.updateQueue=e,cl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Di(n,e),n=n.sibling;return jo(t,Ao.current&1|2),J&&Wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>pd&&(t.flags|=128,i=!0,ll(r,!1),t.lanes=4194304)}}else{if(!i){if(e=No(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,cl(t,e),ll(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!J)return ul(t),null}else 2*Pe()-r.renderingStartTime>pd&&n!==536870912&&(t.flags|=128,i=!0,ll(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,o=Ao.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||J?jo(t,o):(n=o,pe(Co,t),pe(Ao,n),wo===null&&(wo=t)),J&&Wi(t,r.treeForkCount),e}return ul(t),null;case 22:case 23:return ko(t),So(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ul(t),t.subtreeFlags&6&&(t.flags|=8192)):ul(t),n=t.updateQueue,n!==null&&cl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&fe(La),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),da(Ca),ul(t),null;case 25:return null;case 30:return t.flags|=33554432,ul(t),null}throw Error(a(156,t.tag))}function fl(e,t){switch(qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return da(Ca),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(ko(t),t.alternate===null)throw Error(a(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ye(),null;case 10:return da(t.type),null;case 22:case 23:return ko(t),So(),e!==null&&fe(La),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return da(Ca),null;case 25:return null;default:return null}}function pl(e,t){switch(qi(t),t.tag){case 3:da(Ca),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&ko(t);break;case 13:ko(t);break;case 19:Mo(t);break;case 10:da(t.type);break;case 22:case 23:ko(t),So(),e!==null&&fe(La);break;case 24:da(Ca)}}function ml(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){df(t,t.return,e)}}function hl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){df(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){df(t,t.return,e)}}function gl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_o(t,n)}catch(t){df(e,e.return,t)}}}function _l(e,t,n){n.props=mc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){df(e,t,n)}}function vl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=ui(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){df(e,t,n)}}function yl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){df(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){df(e,t,n)}else n.current=null}}function bl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function xl(e){for(var t=e.return;t!==null&&(wl(t)&&em(e.stateNode,t.stateNode),!Cl(t));)t=t.return}function Sl(e){for(var t=e.return;t!==null&&(wl(t)&&tm(e.stateNode,t.stateNode),!Cl(t));)t=t.return}function Cl(e){return e.tag===5||e.tag===3||e.tag===27}function wl(e){return e&&e.tag===7&&e.stateNode!==null}function Tl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){df(e,e.return,t)}}function El(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[_t]=t}catch(t){df(e,e.return,t)}}function Dl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ol(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Dl(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&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fn)),bl(e,r),G=!0;else if(i!==4&&(i===27&&(bl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(kl(e,t,n,r),e=e.sibling;e!==null;)kl(e,t,n,r),e=e.sibling}function Al(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),bl(e,r),G=!0;else if(i!==4&&(i===27&&(bl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[gt]=e,t[_t]=n}catch(t){df(e,e.return,t)}}var Ml=!1,Nl=null;function Pl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ml=!0)}var Fl=null;function Il(){var e=Fl;return Fl=null,e}var Ll=0;function Rl(e,t,n,r,i){return Ll=0,zl(e.child,t,n,r,i)}function zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Ml=!0,Tp(o,Ll===0?t:t+`_`+Ll,n),Ll++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||zl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Bl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Bl(e.child,t)),e=e.sibling}function Vl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Vl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=fi(t.default,t.share),t!==`none`&&(Rl(e,n,t,null,!1)||Bl(e.child,!1))}e=e.sibling}}function Hl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=ui(r,n),a=fi(r.default,n.paired?r.share:r.enter);a===`none`?Vl(e):Rl(e,i,a,null,!1)?(Vl(e),n.paired||t||Ad(e,r.onEnter)):Bl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Hl(e,t),e=e.sibling;else Vl(e)}function Ul(e){if(Nl!==null&&Nl.size!==0){var t=Nl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=fi(n.default,n.share);if(a!==`none`&&(Rl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ad(e,n.onShare)):Bl(e.child,!1)),t.delete(r),t.size===0)break}}}Ul(e)}e=e.sibling}}}function Wl(e){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode),r=Nl===null?void 0:Nl.get(n),i=fi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Rl(e,n,i,null,!1)?r===void 0?Ad(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Nl.delete(n),Ad(e,t.onShare)):Bl(e.child,!1)),Nl!==null&&Ul(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e),e=e.sibling;else Nl!==null&&Ul(e)}function Gl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode);t=fi(t.default,t.update),e.flags&=-5,t!==`none`&&Rl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Gl(e);e=e.sibling}}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Bl(e.child,!1))}Kl(e)}e=e.sibling}}function ql(e){if(e.tag===30)e.stateNode.paired=null,Bl(e.child,!1),Kl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Kl(e)}function Jl(e){for(e=e.child;e!==null;)e.tag===30?Bl(e.child,!1):e.subtreeFlags&33554432&&Jl(e),e=e.sibling}function Yl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ll<a.length){var l=a[Ll],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Ll===0?n:n+`_`+Ll,i),s&&e.flags&4||(Fl===null&&(Fl=[]),Fl.push(c,Ll===0?r:r+`_`+Ll,t.memoizedProps)),Ll++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Yl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Xl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=ui(n,r),a=fi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ll=0,i=Yl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ad(e,n.onUpdate))}else e.subtreeFlags&33554432&&Xl(e,t);e=e.sibling}}var Zl=!1,Ql=!1,$l=!1,eu=!1,tu=typeof WeakSet==`function`?WeakSet:Set,nu=null,ru=!1,iu=!1,au=!1,ou=!1;function su(e,t,n){if(e=e.containerInfo,sp=gh,e=Vr(e),Hr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,nu=t,t=n?9270:1024;nu!==null;){if(e=nu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Wl(r[a]);if(e.alternate===null&&e.flags&2)n&&Pl(e),cu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Wl(r),cu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Pl(e),cu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,nu=r):(n&&Gl(e),cu(n))}}Nl=null}function cu(e){for(;nu!==null;){var t=nu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=mc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){df(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=ui(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=fi(i.default,i.update),i!==`none`&&Rl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,nu=r;break}nu=t.return}}function lu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ku(e,n),r&4&&ml(5,n);break;case 1:if(ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){df(n,n.return,e)}else{var i=mc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){df(n,n.return,e)}}}r&64&&gl(n),r&512&&vl(n,n.return);break;case 3:if(ku(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{_o(e,t)}catch(e){df(n,n.return,e)}}break;case 27:t===null&&r&4&&jl(n);case 26:case 5:ku(e,n),t===null&&r&4&&Tl(n),r&512&&vl(n,n.return);break;case 12:ku(e,n);break;case 31:ku(e,n),r&4&&vu(e,n);break;case 13:ku(e,n),r&4&&yu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Zl,!r){var a=t!==null&&t.memoizedState!==null||Ql;t=Zl,i=Ql,Zl=r,(Ql=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ju(e,n,r)):ku(e,n),Zl=t,Ql=i}break;case 30:ku(e,n),r&512&&vl(n,n.return);break;case 7:r&512&&vl(n,n.return);default:ku(e,n)}}function uu(e,t){for(e=e.child;e!==null;)du(e,t),e=e.sibling}function du(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){df(e,e.return,t)}fu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,G=!0}catch(t){df(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){df(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&uu(e,t);break;default:uu(e,t)}}function fu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:du(n,r);break a;case 22:n.memoizedState===null&&fu(n,r);break a;default:fu(n,r)}}e=e.sibling}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),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 mu=null,hu=!1;function gu(e,t,n){for(n=n.child;n!==null;)_u(e,t,n),n=n.sibling}function _u(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:Ql||yl(n,t),gu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ql&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ql||yl(n,t),Sl(n);var r=mu,i=hu;Sp(n.type)&&(mu=n.stateNode,hu=!1),gu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),mu=r,hu=i;break;case 5:Ql||yl(n,t),Sl(n);case 6:if(n.tag===6&&Sl(n),r=mu,i=hu,mu=null,gu(e,t,n),mu=r,hu=i,mu!==null){if(hu)try{(mu.nodeType===9?mu.body:mu.nodeName===`HTML`?mu.ownerDocument.body:mu).removeChild(n.stateNode),G=!0}catch(e){df(n,t,e)}else try{mu.removeChild(n.stateNode),G=!0}catch(e){df(n,t,e)}}break;case 18:mu!==null&&(hu?(e=mu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(mu,n.stateNode));break;case 4:r=mu,i=hu,mu=n.stateNode.containerInfo,hu=!0,gu(e,t,n),mu=r,hu=i;break;case 0:case 11:case 14:case 15:hl(2,n,t),Ql||hl(4,n,t),gu(e,t,n);break;case 1:Ql||(yl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&_l(n,t,r)),gu(e,t,n);break;case 21:gu(e,t,n);break;case 22:Ql=(r=Ql)||n.memoizedState!==null,gu(e,t,n),Ql=r;break;case 30:yl(n,t),gu(e,t,n);break;case 7:Ql||yl(n,t),gu(e,t,n);break;default:gu(e,t,n)}}function vu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){df(t,t.return,e)}}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){df(t,t.return,e)}}function bu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tu),t;default:throw Error(a(435,e.tag))}}function xu(e,t){var n=bu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=gf.bind(null,e,t);t.then(r,r)}})}function Su(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){mu=l.stateNode,hu=!1;break a}break;case 5:mu=l.stateNode,hu=!1;break a;case 3:case 4:mu=l.stateNode.containerInfo,hu=!0;break a}l=l.return}if(mu===null)throw Error(a(160));_u(s,c,o),mu=null,hu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e,n),t=t.sibling}var Cu=null;function wu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Su(t,e,n),Tu(e),i&4&&(hl(3,e,e.return),ml(3,e),hl(5,e,e.return));break;case 1:Su(t,e,n),Tu(e),i&512&&(Ql||r===null||yl(r,r.return)),i&64&&Zl&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Cu,Su(t,e,n),Tu(e),i&512&&(Ql||r===null||yl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Zl)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[gt]=e,Ot(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[gt]=e,Ot(r),t=r}e.stateNode=t}}else Zl||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&El(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||Ql||t.parentNode.removeChild(t)):i.count--,n===null?Zl||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Su(t,e,n),Tu(e),i&512&&(Ql||r===null||yl(r,r.return)),r!==null&&i&4&&El(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=$l,$l=!1,Su(t,e,n),$l=o,Tu(e),i&512&&(Ql||r===null||yl(r,r.return)),e.flags&32){t=e.stateNode;try{tn(t,``),G=!0}catch(t){df(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,El(e,t,r===null?t:r.memoizedProps)),i&1024&&(eu=!0);break;case 6:if(Su(t,e,n),Tu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,G=!0}catch(t){df(e,e.return,t)}}break;case 3:if(G=!1,Wm=null,o=Cu,Cu=bm(t.containerInfo),Su(t,e,n),Cu=o,Tu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){df(e,e.return,t)}eu&&(eu=!1,Eu(e)),G=!1;break;case 4:i=$l,$l=Zl,r=Rt(),o=Cu,Cu=bm(e.stateNode.containerInfo),Su(t,e,n),Tu(e),Cu=o,G&&iu&&(au=!0),G=r,$l=i;break;case 12:Su(t,e,n),Tu(e);break;case 31:Su(t,e,n),Tu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 13:Su(t,e,n),Tu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(dd=Pe()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Zl,l=Ql,u=$l;Zl=c||o,$l=u||o,Ql=l||s,Su(t,e,n),Ql=l,$l=u,Zl=c,Tu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Zl||Ql||(t=s||Ql,n=Zl,r=Ql,Zl=o||Zl,Ql=t,Au(e,2),Zl=n,Ql=r),!o&&$l||uu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,xu(e,n))));break;case 19:Su(t,e,n),Tu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 30:i&512&&(Ql||r===null||yl(r,r.return)),i=Rt(),o=iu,s=(n&335544064)===n,c=e.memoizedProps,iu=s&&fi(c.default,c.update)!==`none`,Su(t,e,n),Tu(e),s&&r!==null&&G&&(e.flags|=4),iu=o,G=i;break;case 21:break;case 7:i&512&&(Ql||r===null||yl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Su(t,e,n),Tu(e)}}function Tu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Dl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(wl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Cl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Al(e,Ol(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(tn(l,``),n.flags&=-33),Al(e,Ol(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;kl(e,Ol(e),u,s);break;default:throw Error(a(161))}}catch(t){df(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Du(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ou(t,e),t=t.sibling;else Xl(t,!1)}function Ou(e,t){var n=e.alternate;if(n===null)Hl(e,!1);else switch(e.tag){case 3:if(ou=ru=!1,Il(),Du(t,e),!ru&&!au){if(e=Fl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),ou=!0}Fl=null;break;case 5:Du(t,e);break;case 4:r=ru,ru=!1,Du(t,e),ru&&(au=!0),ru=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Du(t,e):Hl(e,!1));break;case 30:r=ru,i=Il(),ru=!1,Du(t,e),ru&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=ui(a,o),o=ui(n.memoizedProps,o);var s=fi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ll=0,t=Yl(e,n,t,o,s,a,!0),Ll!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ad(e,e.memoizedProps.onUpdate),Fl=i):i!==null&&(i.push.apply(i,Fl),Fl=i),ru=e.flags&32?!0:r;break;default:Du(t,e)}}function ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lu(e,t.alternate,t),t=t.sibling}function Au(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:hl(4,n,n.return),Au(n,r);break;case 1:yl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&_l(n,n.return,i),Au(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:yl(n,n.return),n.tag!==5&&n.tag!==27||Sl(n),Au(n,r);break;case 6:Sl(n);break;case 26:yl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Ql||i.parentNode.removeChild(i),Au(n,r);break;case 22:n.memoizedState===null&&Au(n,r);break;case 30:yl(n,n.return),Au(n,r);break;case 7:yl(n,n.return);default:Au(n,r)}e=e.sibling}}function ju(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:ju(i,a,n),ml(4,a);break;case 1:if(ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){df(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)go(l[i],c)}catch(e){df(r,r.return,e)}}s&&o&64&&gl(a),vl(a,a.return);break;case 27:n&2&&jl(a);case 5:a.tag!==5&&a.tag!==27||xl(a),ju(i,a,n),s&&r===null&&o&4&&Tl(a),vl(a,a.return);break;case 6:xl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Zl||Km(bm(c.ownerDocument),a.type,c),ju(i,a,n),s&&r===null&&o&4&&Tl(a),vl(a,a.return);break;case 12:ju(i,a,n);break;case 31:ju(i,a,n),s&&o&4&&vu(i,a);break;case 13:ju(i,a,n),s&&o&4&&yu(i,a);break;case 22:a.memoizedState===null&&ju(i,a,n),vl(a,a.return);break;case 30:ju(i,a,n),vl(a,a.return);break;case 7:vl(a,a.return);default:ju(i,a,n)}t=t.sibling}}function Mu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ta(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ta(e))}function Pu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Fu(e,t,n,r),t=t.sibling;else i&&Jl(t)}function Fu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Pu(e,t,n,r),a&2048&&ml(9,t);break;case 1:Pu(e,t,n,r);break;case 3:Pu(e,t,n,r),i&&ou&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ta(a)));break;case 12:if(a&2048){Pu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){df(t,t.return,e)}}else Pu(e,t,n,r);break;case 31:Pu(e,t,n,r);break;case 13:Pu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ql(t),o._visibility&2?Pu(e,t,n,r):(o._visibility|=2,Iu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ql(s),o._visibility&2?Pu(e,t,n,r):Lu(e,t)),a&2048&&Mu(s,t);break;case 24:Pu(e,t,n,r),a&2048&&Nu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Bl(a.child,!0),Bl(t.child,!0))),Pu(e,t,n,r);break;default:Pu(e,t,n,r)}}function Iu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Iu(a,o,s,c,i),ml(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Iu(a,o,s,c,i)):u._visibility&2?Iu(a,o,s,c,i):Lu(a,o),i&&l&2048&&Mu(o.alternate,o);break;case 24:Iu(a,o,s,c,i),i&&l&2048&&Nu(o.alternate,o);break;default:Iu(a,o,s,c,i)}t=t.sibling}}function Lu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Lu(n,r),i&2048&&Mu(r.alternate,r);break;case 24:Lu(n,r),i&2048&&Nu(r.alternate,r);break;default:Lu(n,r)}t=t.sibling}}var Ru=8192;function zu(e,t,n){if(e.subtreeFlags&Ru)for(e=e.child;e!==null;)Bu(e,t,n),e=e.sibling}function Bu(e,t,n){switch(e.tag){case 26:zu(e,t,n),e.flags&Ru&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Cu,e.memoizedState,e.memoizedProps));break;case 5:zu(e,t,n),e.flags&Ru&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Cu;Cu=bm(e.stateNode.containerInfo),zu(e,t,n),Cu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ru,Ru=16777216,zu(e,t,n),Ru=r):zu(e,t,n));break;case 30:if((e.flags&Ru)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Nl===null&&(Nl=new Map),Nl.set(r,i)}zu(e,t,n);break;default:zu(e,t,n)}}function Vu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uu(e),e=e.sibling}function Uu(e){switch(e.tag){case 0:case 11:case 15:Hu(e),e.flags&2048&&hl(9,e,e.return);break;case 3:Hu(e);break;case 12:Hu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Hu(e);break;default:Hu(e)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hl(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Gu(e,t){for(;nu!==null;){var n=nu;switch(n.tag){case 0:case 11:case 15:hl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nu=r;else a:for(n=e;nu!==null;){r=nu;var i=r.sibling,a=r.return;if(pu(r),r===n){nu=null;break a}if(i!==null){i.return=a,nu=i;break a}nu=a}}}var Ku={getCacheForType:function(e){var t=_a(Ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return _a(Ca).controller.signal}},qu=typeof WeakMap==`function`?WeakMap:Map,Ju=0,Yu=null,Q=null,$=0,Xu=0,Zu=null,Qu=!1,$u=!1,ed=!1,td=0,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=null,ld=null,ud=!1,dd=0,fd=0,pd=1/0,md=null,hd=null,gd=0,_d=null,vd=null,yd=0,bd=0,xd=null,Sd=null,Cd=null,wd=null,Td=null,Ed=0,Dd=null;function Od(){return Ju&2&&$!==0?$&-$:B.T===null?pt():Mf()}function kd(){if(od===0){if(!($&536870912)||J){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),od=e}else od=536870912}return e=Co.current,e!==null&&(e.flags|=32),od}function Ad(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(ui(e.memoizedProps,n))),wd===null&&(wd=[]),wd.push(t.bind(null,r))}}function jd(e,t,n){(e===Yu&&(Xu===2||Xu===9)||e.cancelPendingCommit!==null)&&(Rd(e,0),Fd(e,$,od,!1)),ot(e,n),(!(Ju&2)||e!==Yu)&&(e===Yu&&(!(Ju&2)&&(id|=n),nd===4&&Fd(e,$,od,!1)),wf(e))}function Md(e,t,n){if(Ju&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||tt(e,t),i=r?Kd(e,t):Wd(e,t,!0),o=r;do{if(i===0){$u&&!r&&Fd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Pd(n))i=Wd(e,t,!1),o=!1;else{if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=cd;var l=c.current.memoizedState.isDehydrated;if(l&&(Rd(c,s).flags|=256),s=Wd(c,s,!1),s!==2&&s!==6){if(ed&&!l){c.errorRecoveryDisabledLanes|=o,id|=o,i=4;break a}o=ld,ld=i,o!==null&&(ld===null?ld=o:ld.push.apply(ld,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Rd(e,0),Fd(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Fd(r,t,od,!Qu);break a;case 2:ld=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=dd+300-Pe(),10<i)){if(Fd(r,t,od,!Qu),et(r,0,!0)!==0)break a;yd=t,r.timeoutHandle=gp(Nd.bind(null,r,n,ld,md,ud,t,od,id,sd,Qu,o,`Throttled`,-0,0),i);break a}Nd(r,n,ld,md,ud,t,od,id,sd,Qu,o,null,-0,0)}break}}while(1);wf(e)}function Nd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fn},Nl=null,Bu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?dd-Pe():(a&4194048)===a?fd-Pe():0,m=eh(d,m),m!==null)?(yd=a,e.cancelPendingCommit=m($d.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Fd(e,a,o,!l)):$d(e,t,a,n,r,i,o,s,c,l,u,d)}function Pd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Fr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fd(e,t,n,r){t=nt(e,t),t&=~ad,t&=~id,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ke(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ct(e,n,t)}function Id(){return Ju&6?!0:(Tf(0,!1),!1)}function Ld(){if(Q!==null){if(Xu===0)var e=Q.return;else e=Q,la=ca=null,Qo(e),Za=null,Qa=0,e=Q;for(;e!==null;)pl(e.alternate,e),e=e.return;Q=null}}function Rd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yd=0,Ld(),Yu=e,Q=n=Ei(e.current,null),$=t,Xu=0,Zu=null,Qu=!1,$u=tt(e,t),ed=!1,sd=od=ad=id=rd=nd=0,ld=cd=null,ud=!1,td=nt(e,t),q(),n}function zd(e,t){Y=null,B.H=sc,t===Va||t===Ua?(t=Ya(),Xu=3):t===Ha?(t=Ya(),Xu=4):Xu=t===wc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Zu=t,Q===null&&(nd=1,vc(e,Pi(t,e.current)))}function Bd(){var e=Co.current;return e===null?!0:($&4194048)===$?wo===null:($&62914560)===$||$&536870912?e===wo:!1}function Vd(){var e=B.H;return B.H=sc,e===null?sc:e}function Hd(){var e=B.A;return B.A=Ku,e}function Ud(){nd=4,Qu||($&4194048)!==$&&Co.current!==null||($u=!0),!(rd&134217727)&&!(id&134217727)||Yu===null||Fd(Yu,$,od,!1)}function Wd(e,t,n){var r=Ju;Ju|=2;var i=Vd(),a=Hd();(Yu!==e||$!==t)&&(md=null,Rd(e,t)),t=!1;var o=nd;a:do try{if(Xu!==0&&Q!==null){var s=Q,c=Zu;switch(Xu){case 8:Ld(),o=6;break a;case 3:case 2:case 9:case 6:Co.current===null&&(t=!0);var l=Xu;if(Xu=0,Zu=null,Xd(e,s,c,l),n&&$u){o=0;break a}break;default:l=Xu,Xu=0,Zu=null,Xd(e,s,c,l)}}Gd(),o=nd;break}catch(t){zd(e,t)}while(1);return t&&e.shellSuspendCounter++,la=ca=null,Ju=r,B.H=i,B.A=a,Q===null&&(Yu=null,$=0,q()),o}function Gd(){for(;Q!==null;)Jd(Q)}function Kd(e,t){var n=Ju;Ju|=2;var r=Vd(),i=Hd();Yu!==e||$!==t?(md=null,pd=Pe()+500,Rd(e,t)):$u=tt(e,t);a:do try{if(Xu!==0&&Q!==null){t=Q;var o=Zu;b:switch(Xu){case 1:Xu=0,Zu=null,Xd(e,t,o,1);break;case 2:case 9:if(Ga(o)){Xu=0,Zu=null,Yd(t);break}t=function(){Xu!==2&&Xu!==9||Yu!==e||(Xu=7),wf(e)},o.then(t,t);break a;case 3:Xu=7;break a;case 4:Xu=5;break a;case 7:Ga(o)?(Xu=0,Zu=null,Yd(t)):(Xu=0,Zu=null,Xd(e,t,o,7));break;case 5:var s=null;switch(Q.tag){case 26:s=Q.memoizedState;case 5:case 27:var c=Q;if(s?Ym(s):c.stateNode.complete){Xu=0,Zu=null;var l=c.sibling;if(l!==null)Q=l;else{var u=c.return;u===null?Q=null:(Q=u,Zd(u))}break b}}Xu=0,Zu=null,Xd(e,t,o,5);break;case 6:Xu=0,Zu=null,Xd(e,t,o,6);break;case 8:Ld(),nd=6;break a;default:throw Error(a(462))}}qd();break}catch(t){zd(e,t)}while(1);return la=ca=null,B.H=r,B.A=i,Ju=n,Q===null?(Yu=null,$=0,q(),nd):0}function qd(){for(;Q!==null&&!Me();)Jd(Q)}function Jd(e){var t=il(e.alternate,e,td);e.memoizedProps=e.pendingProps,t===null?Zd(e):Q=t}function Yd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Rc(n,t,t.pendingProps,t.type,void 0,$);break;case 11:t=Rc(n,t,t.pendingProps,t.type.render,t.ref,$);break;case 5:Qo(t);var r=t;r===Yi&&(J?(na(r),r.tag===5&&r.stateNode!=null&&(Xi=r.stateNode)):(na(r),J=!0));default:pl(n,t),t=Q=Di(t,td),t=il(n,t,td)}e.memoizedProps=e.pendingProps,t===null?Zd(e):Q=t}function Xd(e,t,n,r){la=ca=null,Qo(t),Za=null,Qa=0;var i=t.return;try{if(Cc(e,i,t,n,$)){nd=1,vc(e,Pi(n,e.current)),Q=null;return}}catch(t){if(i!==null)throw Q=i,t;nd=1,vc(e,Pi(n,e.current)),Q=null;return}t.flags&32768?(J||r===1?e=!0:$u||$&536870912?e=!1:(Qu=e=!0,(r===2||r===9||r===3||r===6)&&(r=Co.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qd(t,e)):Zd(t)}function Zd(e){var t=e;do{if(t.flags&32768){Qd(t,Qu);return}e=t.return;var n=dl(t.alternate,t,td);if(n!==null){Q=n;return}if(t=t.sibling,t!==null){Q=t;return}Q=t=e}while(t!==null);nd===0&&(nd=5)}function Qd(e,t){do{var n=fl(e.alternate,e);if(n!==null){n.flags&=32767,Q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Q=e;return}Q=e=n}while(e!==null);nd=6,Q=null}function $d(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do cf();while(gd!==0);if(Ju&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===Yu&&(Q=Yu=null,$=0),vd=t,_d=e,yd=n,xd=i,Sd=r,ef(e,t,n,s,c,l,f)}}function ef(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(bd=s,s|=gi,st(e,n,s,r,i,a),wd=null,(n&335544064)===n?(Td=Oa(e),r=10262):(Td=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,_f(Re,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ml=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=B.T,B.T=null,i=V.p,V.p=2,a=Ju,Ju|=4;try{su(e,t,n)}finally{Ju=a,V.p=i,B.T=r}}gd=1,Ml?Cd=Mp(o,e.containerInfo,Td,rf,af,nf,of,lf,tf,null,null):(rf(),af(),of())}function tf(e){if(gd!==0){var t=_d.onRecoverableError;t(e,{componentStack:null})}}function nf(){gd===3&&(gd=0,Ou(vd,_d),gd=4)}function rf(){if(gd===1){gd=0;var e=_d,t=vd,n=yd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=B.T,B.T=null;var i=V.p;V.p=2;var a=Ju;Ju|=4;try{iu=au=!1,wu(t,e,n),n=cp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=zr(s,h),v=zr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Ju=a,V.p=i,B.T=r}}e.current=t,gd=2}}function af(){if(gd===2){gd=0;var e=_d,t=vd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=B.T,B.T=null;var r=V.p;V.p=2;var i=Ju;Ju|=4;try{lu(e,t.alternate,t)}finally{Ju=i,V.p=r,B.T=n}}gd=3}}function of(){if(gd===4||gd===3){gd=0;var e=Cd;Cd=null,Ne();var t=_d,n=vd,r=yd,i=Sd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?gd=5:(gd=0,vd=_d=null,sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(hd=null),ft(r),n=n.stateNode,We&&typeof We.onCommitFiberRoot==`function`)try{We.onCommitFiberRoot(Ue,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=B.T,a=V.p,V.p=2,B.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{B.T=n,V.p=a}}if(i=wd,o=Td,Td=null,i!==null&&(wd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);yd&3&&cf(),wf(t),a=t.pendingLanes,r&261930&&a&42?t===Dd?Ed++:(Ed=0,Dd=t):(Ed=0,Dd=null),Tf(0,!1)}}function sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ta(t)))}function cf(){return Cd!==null&&(Cd.skipTransition(),Cd=null),rf(),af(),of(),lf()}function lf(){if(gd!==5)return!1;var e=_d,t=bd;bd=0;var n=ft(yd),r=B.T,i=V.p;try{V.p=32>n?32:n,B.T=null,n=xd,xd=null;var o=_d,s=yd;if(gd=0,vd=_d=null,yd=0,Ju&6)throw Error(a(331));var c=Ju;if(Ju|=4,Uu(o.current),Fu(o,o.current,s,n),Ju=c,Tf(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{V.p=i,B.T=r,sf(e,t)}}function uf(e,t,n){t=Pi(n,t),t=bc(e.stateNode,t,2),e=lo(e,t,2),e!==null&&(ot(e,2),wf(e))}function df(e,t,n){if(e.tag===3)uf(e,e,n);else for(;t!==null;){if(t.tag===3){uf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hd===null||!hd.has(r))){e=Pi(n,e),n=xc(2),r=lo(t,n,2),r!==null&&(Sc(n,r,t,e),ot(r,2),wf(r));break}}t=t.return}}function ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ed=!0,i.add(n),e=pf.bind(null,e,t,n),t.then(e,e))}function pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yu===e&&($&n)===n&&(nd===4||nd===3&&($&62914560)===$&&300>Pe()-dd?Ju&2?ad|=n:Rd(e,0):ad|=n,sd===$&&(sd=0)),wf(e)}function mf(e,t){t===0&&(t=it()),e=yi(e,t),e!==null&&(ot(e,t),wf(e))}function hf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mf(e,n)}function gf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),mf(e,n)}function _f(e,t){return Ae(e,t)}var vf=null,yf=null,bf=!1,xf=!1,Sf=!1,Cf=0;function wf(e){e!==yf&&e.next===null&&(yf===null?vf=yf=e:yf=yf.next=e),xf=!0,bf||(bf=!0,jf())}function Tf(e,t){if(!Sf&&xf){Sf=!0;do for(var n=!1,r=vf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Af(r,a))}else a=$,a=et(r,r===Yu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,Af(r,a))}r=r.next}while(n);Sf=!1}}function Ef(){Df()}function Df(){xf=bf=!1;var e=0;Cf!==0&&hp()&&(e=Cf);for(var t=Pe(),n=null,r=vf;r!==null;){var i=r.next,a=Of(r,t);a===0?(r.next=null,n===null?vf=i:n.next=i,i===null&&(yf=n)):(n=r,(e!==0||a&3)&&(xf=!0)),r=i}gd!==0&&gd!==5||Tf(e,!1),Cf!==0&&(Cf=0)}function Of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ke(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=rt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Yu,n=$,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xu===2||Xu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),ft(n)){case 2:case 8:n=Le;break;case 32:n=Re;break;case 268435456:n=Be;break;default:n=Re}return r=kf.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(gd!==0&&gd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cf()&&e.callbackNode!==n)return null;var r=$;return r=et(e,e===Yu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Md(e,r,t),Of(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?kf.bind(null,e):null)}function Af(e,t){if(cf())return null;Md(e,t,!0)}function jf(){bp(function(){Ju&6?Ae(Ie,Ef):Df()})}function Mf(){if(Cf===0){var e=ja;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),Cf=e}return Cf}function Nf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function Pf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Nf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?Nf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Nn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ff=0;Ff<si.length;Ff++){var If=si[Ff];ci(If.toLowerCase(),`on`+(If[0].toUpperCase()+If.slice(1)))}ci($r,`onAnimationEnd`),ci(ei,`onAnimationIteration`),ci(ti,`onAnimationStart`),ci(`dblclick`,`onDoubleClick`),ci(`focusin`,`onFocus`),ci(`focusout`,`onBlur`),ci(ni,`onTransitionRun`),ci(ri,`onTransitionStart`),ci(ii,`onTransitionCancel`),ci(ai,`onTransitionEnd`),Nt(`onMouseEnter`,[`mouseout`,`mouseover`]),Nt(`onMouseLeave`,[`mouseout`,`mouseover`]),Nt(`onPointerEnter`,[`pointerout`,`pointerover`]),Nt(`onPointerLeave`,[`pointerout`,`pointerover`]),Mt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Mt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Mt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Mt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Lf=`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(` `),Rf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Lf));function zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){pi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){pi(e)}i.currentTarget=null,a=c}}}}function Bf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,At.forEach(function(t){t!==`selectionchange`&&(Rf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=Et(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}yn(function(){var r=a,i=mn(n),o=[];a:{var c=oi.get(e);if(c!==void 0){var l=Nn,u=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:l=Zn;break;case`focusin`:u=`focus`,l=Hn;break;case`focusout`:u=`blur`,l=Hn;break;case`beforeblur`:case`afterblur`:l=Hn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=er;break;case $r:case ei:case ti:l=Un;break;case ai:l=tr;break;case`scroll`:case`scrollend`:l=Fn;break;case`wheel`:l=nr;break;case`copy`:case`cut`:case`paste`:l=Wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Qn;break;case`submit`:l=$n;break;case`toggle`:case`beforetoggle`:l=rr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=bn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==pn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Et(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:U(c),h=l==null?u:U(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Jf):null,c!==null&&Yf(o,u,c,d,!1),l!==null&&f!==null&&Yf(o,f,l,d,!0)))}a:{if(c=r?U(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?U(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(o,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(o,n,i)}var y;if(ar)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,pr=!0)),v=qf(r,b),0<v.length&&(b=new Gn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Gn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Pf(o,e,r,n,i)}zf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=bn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=bn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=bn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
10
|
-
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&tn(e,``+r);else return;break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);return;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=dn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=ln.get(n)||n,zt(e,n,r);else return}G=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:on(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)tn(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[_t]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}G=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}return}G=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,o,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:ep(e,t,r,d,n,null)}}Xt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Bf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Qt(e,!!r,n,!0):Qt(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:ep(e,t,s,c,n,null)}en(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(G=!0),o=m;break;case`name`:m!==f&&(G=!0),i=m;break;case`checked`:m!==f&&(G=!0),u=m;break;case`defaultChecked`:m!==f&&(G=!0),d=m;break;case`value`:m!==f&&(G=!0),s=m;break;case`defaultValue`:m!==f&&(G=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Yt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(G=!0),p=o;break;case`defaultValue`:o!==l&&(G=!0),c=o;break;case`multiple`:o!==l&&(G=!0),s=o;default:o!==l&&ep(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Qt(e,!!n,n?[]:``,!1):Qt(e,!!n,t,!0)):Qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(G=!0),p=i;break;case`defaultValue`:i!==o&&(G=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ep(e,t,s,i,r,o)}$t(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(G=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[gt]=r,n[_t]=t,np(n,e,t),Ot(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),Tt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=V.d;V.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){kt(o)}),Ot(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=W(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ot(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=W(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ot(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=W(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ot(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=ge.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=W(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=W(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=W(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+Jt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=kt.bind(null,t),np(t,`link`,n),Ot(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Jt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Ot(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ot(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[gt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=wi(3,null,null,t),e.current=a,a.stateNode=e,t=wa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},oo(a),e}function uh(e){return e?(e=Si,e):Si}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=lo(e,r,t),n!==null&&(jd(n,e,t),uo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=yi(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=dt(t);var n=yi(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=B.T;B.T=null;var a=V.p;try{V.p=2,yh(e,t,n,r)}finally{V.p=a,B.T=i}}function vh(e,t,n,r){var i=B.T;B.T=null;var a=V.p;try{V.p=8,yh(e,t,n,r)}finally{V.p=a,B.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Ju&6)&&(pd=Pe()+500,Tf(0,!1))}}break;case 31:case 13:s=yi(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=mn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Et(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Et(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,mt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Dt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,t){e.blockedOn===t&&(e.blockedOn=null,wh||(wh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[vt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:B,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ue=Jh.inject(qh),We=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=hc,s=gc,c=_c;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[vt]=t.current,Uf(e),new Wh(t)}})),ln=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=cn()})),un={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};un.node;var dn=n(un),fn={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};fn.node;var pn=n(fn),mn={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};mn.node;var hn=n(mn),gn={name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]};gn.node;var _n=n(gn),vn={name:`chart-column`,size:24,node:[[`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`}]],aliases:[`bar-chart-3`]};vn.node;var yn=n(vn),bn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};bn.node;var xn=n(bn),Sn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Sn.node;var Cn=n(Sn),wn={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};wn.node;var Tn=n(wn),En={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};En.node;var Dn=n(En),On={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};On.node;var kn=n(On),An={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};An.node;var jn=n(An),Mn={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Mn.node;var Nn=n(Mn),Pn={name:`copy`,size:24,node:[[`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`}]]};Pn.node;var Fn=n(Pn),In={name:`crosshair`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]};In.node;var Ln=n(In),Rn={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};Rn.node;var zn=n(Rn),Bn={name:`download`,size:24,node:[[`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`}]]};Bn.node;var Vn=n(Bn),Hn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Hn.node;var Un=n(Hn),Wn={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Wn.node;var Gn=n(Wn),Kn={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};Kn.node;var qn=n(Kn),Jn={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Jn.node;var Yn=n(Jn),Xn={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};Xn.node;var Zn=n(Xn),Qn={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Qn.node;var $n=n(Qn),er={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};er.node;var tr=n(er),nr={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};nr.node;var rr=n(nr),ir={name:`layers`,size:24,node:[[`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`}]],aliases:[`layers-3`]};ir.node;var ar=n(ir),or={name:`list-todo`,size:24,node:[[`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`}]]};or.node;var sr=n(or),cr={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};cr.node;var lr=n(cr),ur={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};ur.node;var dr=n(ur),fr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};fr.node;var pr=n(fr),mr={name:`moon`,size:24,node:[[`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`}]]};mr.node;var hr=n(mr),gr={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};gr.node;var _r=n(gr),vr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};vr.node;var yr=n(vr),br={name:`pencil`,size:24,node:[[`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`}]]};br.node;var xr=n(br),Sr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Sr.node;var Cr=n(Sr),wr={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};wr.node;var Tr=n(wr),Er={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Er.node;var Dr=n(Er),Or={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Or.node;var kr=n(Or),Ar={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Ar.node;var jr=n(Ar),Mr={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Mr.node;var Nr=n(Mr),Pr={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};Pr.node;var Fr=n(Pr),Ir={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ir.node;var Lr=n(Ir),Rr={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Rr.node;var zr=n(Rr),Br={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};Br.node;var Vr=n(Br),Hr={name:`sun`,size:24,node:[[`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`}]]};Hr.node;var Ur=n(Hr),Wr={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};Wr.node;var Gr=n(Wr),Kr={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Kr.node;var qr=n(Kr);function Jr(e){return e?.ownerDocument||document}var K=i(t(),1),Yr=i(ln(),1),Xr={planned:`Blocked`,ready:`Ready`,paused:`Paused`,in_progress:`In progress`,in_review:`Awaiting completion`,done:`Done`,not_adopted:`Not adopted`},Zr=`Planned on`,Qr={neutral:`bg-muted text-foreground/70`,info:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,progress:`bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-200`,review:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,success:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,attention:`bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-200`,danger:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`},$r={neutral:`text-muted-foreground`,info:`text-sky-700 dark:text-sky-300`,progress:`text-blue-700 dark:text-blue-300`,review:`text-violet-700 dark:text-violet-300`,success:`text-emerald-700 dark:text-emerald-300`,attention:`text-amber-700 dark:text-amber-300`,danger:`text-rose-700 dark:text-rose-300`},ei={neutral:`border-border text-muted-foreground`,info:`border-sky-300 text-sky-700 dark:border-sky-800 dark:text-sky-300`,progress:`border-blue-300 text-blue-700 dark:border-blue-800 dark:text-blue-300`,review:`border-violet-300 text-violet-700 dark:border-violet-800 dark:text-violet-300`,success:`border-emerald-300 text-emerald-700 dark:border-emerald-800 dark:text-emerald-300`,attention:`border-amber-300 text-amber-700 dark:border-amber-800 dark:text-amber-300`,danger:`border-rose-300 text-rose-700 dark:border-rose-800 dark:text-rose-300`},ti=`border-input text-foreground/70`,ni={info:`border border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-800 dark:bg-sky-950 dark:text-sky-100`,attention:`border border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`},ri={neutral:`bg-neutral-400`,info:`bg-sky-500`,progress:`bg-blue-500`,review:`bg-violet-500`,success:`bg-emerald-500`,attention:`bg-amber-500`,danger:`bg-rose-500`},ii={neutral:`border-muted-foreground`,info:`border-sky-500`,progress:`border-blue-500`,review:`border-violet-500`,success:`border-emerald-500`,attention:`border-amber-500`,danger:`border-rose-500 dark:border-rose-400`},ai={done:`border-emerald-500 bg-emerald-100 dark:bg-emerald-950`,ready:`border-amber-500 shadow-none`,blocked:`border-dashed border-muted-foreground shadow-none`,paused:`border-dashed border-muted-foreground bg-muted shadow-none`,behindDue:`border-2 border-rose-500 dark:border-rose-400`},oi=`border-foreground/70`,si=`text-foreground`,ci=[[`plannedAt`,`Planned`],[`startedAt`,`Started`],[`reviewAt`,Xr.in_review],[`completedAt`,`Completed`],[`reopenedAt`,`Reopened`],[`pausedAt`,Xr.paused]];function li(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}var ui=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`,style:`short`}),di=604800;function fi(e,t=Date.now()/1e3){let n=e-t,r=Math.abs(n);if(r<60)return`just now`;if(r<di){let[e,t]=r<3600?[Math.trunc(n/60),`minute`]:r<86400?[Math.trunc(n/3600),`hour`]:[Math.trunc(n/86400),`day`];return ui.format(e,t)}let i=new Date(e*1e3),a=i.getFullYear()===new Date(t*1e3).getFullYear();return i.toLocaleDateString(`en`,{month:`short`,day:`numeric`,...a?{}:{year:`numeric`}})}function pi(e){return new Date(e*1e3).toLocaleString(`en`,{dateStyle:`medium`,timeStyle:`short`})}function mi(e){let t=[];for(let n of e){let e=t.at(-1);e!==void 0&&e.end===null&&(e.end=n.at),n.status!==`done`&&(n.status===`planned`?t.length>0&&t.push({state:`paused`,start:n.at,end:null}):t.push({state:n.status,start:n.at,end:null}))}return t}function hi(e,t){let n=mi(e);return n.length===0?null:n.filter(e=>e.state!==`paused`).reduce((e,n)=>e+Math.max((n.end??t)-n.start,0),0)}function gi(e){return ci.flatMap(([t,n])=>{let r=e[t];return r===null?[]:[{label:n,at:r}]}).sort((e,t)=>e.at-t.at)}var q=r();function _i(e){let t={type:`http`,url:e.url,headers:{Authorization:`Bearer ${e.token??``}`}};return JSON.stringify({mcpServers:{toodo:t}},null,2)}async function vi(e){let t={Authorization:`Bearer ${e.token??``}`,"Content-Type":`application/json`,Accept:`application/json, text/event-stream`},n=await Ut(`/mcp`,{method:`POST`,headers:t,body:JSON.stringify({jsonrpc:`2.0`,id:1,method:`initialize`,params:{protocolVersion:`2025-06-18`,capabilities:{},clientInfo:{name:`toodo-web`,version:`1`}}})}),r=await n.text();if(!n.ok)return{ok:!1,message:r.trim()||`The MCP server answered ${n.status} ${n.statusText}.`};let i=n.headers.get(`mcp-session-id`);i&&Ut(`/mcp`,{method:`DELETE`,headers:{...t,"mcp-session-id":i}}).catch(()=>{});let a;try{a=JSON.parse(r)?.result?.serverInfo?.title}catch{a=void 0}return typeof a!=`string`||!a.includes(e.instance)?{ok:!1,message:`The answer came from another server (${String(a??`no server title`)}), not instance ${e.instance}.`}:{ok:!0,message:`Connected: instance ${e.instance} accepts this token.`}}var yi={no_header:`no Authorization header`,not_bearer:`the header was not Bearer <token>`,wrong_token:`a token this server does not accept (old, mistyped, or another server's)`,web_token:`the web sign-in token instead of the MCP token`};function bi(e){return e.split(/(?<=\/)(?!\/)/).map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&(0,q.jsx)(`wbr`,{}),e]},t))}var xi={open:{label:`Connected`,className:ri.success},connecting:{label:`Connecting`,className:ri.attention},retrying:{label:`Retrying`,className:`bg-destructive`}};function Si({tunnels:e}){return e.length===0?null:(0,q.jsx)(`ul`,{"aria-label":`Remote machines`,className:`flex flex-col gap-1`,children:e.map(e=>{let t=xi[e.state];return(0,q.jsxs)(`li`,{"aria-label":`Tunnel to ${e.machine}`,className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 shrink-0 rounded-full`,t.className)}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.machine}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:t.label})]}),e.error&&(0,q.jsx)(`span`,{className:`break-words text-destructive`,children:e.error})]},e.machine)})})}function Ci(){let e=(l().data??[]).filter(e=>e.state===`retrying`).length;return e===0?null:(0,q.jsx)(`span`,{className:`text-destructive`,children:e===1?`1 tunnel retrying`:`${e} tunnels retrying`})}function wi(){let e=st(),t=l(),[n,r]=(0,K.useState)(null),[i,o]=(0,K.useState)(null);async function s(e,t){try{await navigator.clipboard.writeText(e),r(`Copied ${t}.`)}catch(e){r(`Could not copy: ${String(e)}`)}}async function c(e){o(`testing`);try{o(await vi(e))}catch(e){o({ok:!1,message:`Could not reach the MCP server: ${String(e)}`})}}let u=e.data,d=u?.lastRejection;return(0,q.jsxs)(`section`,{"aria-label":`Agent access`,className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Agents on the server can plan tasks and connect dependencies through the Toodo server's MCP endpoint.`}),u&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`MCP server URL`,children:bi(u.url)}),u.error?(0,q.jsxs)(`p`,{role:`alert`,className:`text-destructive`,children:[`MCP server is not running: `,u.error]}):u.token&&(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,q.jsx)(G,{size:`xs`,onClick:()=>void s(_i(u),`the MCP config`),children:`Copy MCP config`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>void s(u.token??``,`the MCP token for agents`),children:`Copy MCP token for agents`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,disabled:i===`testing`,onClick:()=>void c(u),children:`Test connection`})]}),i&&i!==`testing`&&(0,q.jsx)(`p`,{role:`status`,"aria-label":`Connection test`,className:a(`break-words`,!i.ok&&`text-destructive`),children:i.message}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`The MCP token is for agents only; the web app signs in with the server's web token (`,(0,q.jsx)(`code`,{children:`web-token`}),`). Server instance `,(0,q.jsx)(`code`,{"aria-label":`Server instance`,children:u.instance}),`, which agents see in`,` `,(0,q.jsx)(`code`,{children:`401`}),` replies and `,(0,q.jsx)(`code`,{children:`serverInfo`}),`.`]}),d&&(0,q.jsxs)(`p`,{"aria-label":`Last rejected agent request`,className:`break-words text-destructive`,children:[`Last rejected agent request`,` `,(0,q.jsx)(`time`,{dateTime:new Date(d.at*1e3).toISOString(),title:pi(d.at),children:fi(d.at)}),`: `,yi[d.reason],d.count>1&&` (${d.count} since the server started)`,`.`]}),!u.error&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Agents on SSH machines use the same config: the server forwards its port to each machine with a workspace.`}),(0,q.jsx)(Si,{tunnels:t.data??[]})]})]}),n&&(0,q.jsx)(`p`,{role:`status`,children:n})]})}function Ti(){let e=C(),t=(0,K.useSyncExternalStore)(qt,Kt)!==`reachable`;if(e.isPending||e.data?.running||t)return null;let n=e.isError?e.error.message:`The herdr server is not running.`;return(0,q.jsxs)(`div`,{role:`alert`,className:a(`mb-4 flex items-center justify-between gap-3 rounded-lg px-3 py-2`,ni.attention),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium`,children:`herdr is not available`}),(0,q.jsxs)(`p`,{className:`text-xs break-words`,children:[n,` Start herdr, then retry. Tasks cannot be started until herdr is running.`]})]}),(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>e.refetch(),disabled:e.isFetching,children:e.isFetching?`Checking...`:`Retry`})]})}function Ei(){let e=(0,K.useSyncExternalStore)(it,he),[t,n]=(0,K.useState)(!1);return e===`none`?null:(0,q.jsxs)(`div`,{role:`region`,"aria-label":`Install Toodo`,className:a(`mb-4 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg px-3 py-2`,ni.info),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-56 flex-col gap-0.5`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium`,children:`Install Toodo on this device`}),(0,q.jsx)(`p`,{className:`text-xs break-words`,children:e===`prompt`?`It opens in its own window and can show notifications.`:(0,q.jsxs)(q.Fragment,{children:[`Tap `,(0,q.jsx)(Fr,{"aria-label":`Share`,className:`inline size-3.5 align-text-bottom`}),`, then`,` `,(0,q.jsx)(`span`,{className:`font-medium`,children:`Add to Home Screen`}),`. Notifications need the installed app.`]})})]}),(0,q.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[e===`prompt`&&(0,q.jsxs)(G,{size:`sm`,disabled:t,onClick:()=>{n(!0),ot().finally(()=>n(!1))},children:[(0,q.jsx)(Vn,{}),`Install`]}),(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:et,children:e===`prompt`?`Not now`:`Dismiss`})]})]})}var Di={on_time:`On time`,late:`Late`,overdue:`Overdue`,upcoming:`Due`};function Oi(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r+1).getTime()/1e3}function ki(e,t){if(e.dueDate===null)return null;let n=Oi(e.dueDate);if(e.status===`done`){let{completedAt:t}=e.milestones;return t===null?null:t<n?`on_time`:`late`}return t>=n?`overdue`:`upcoming`}function Ai(e,t){if(e.dueDate===null)return 0;let n=e.status===`done`?e.milestones.completedAt??t:t;return Math.max(n-Oi(e.dueDate),0)}function ji(e){return String(Math.round(e*100)/100)}var Mi={hours:`h`,days:`d`,weeks:`w`,months:`mo`},Ni={hours:3600,days:86400,weeks:604800,months:2592e3};function Pi(e){return`${ji(e.amount)}${Mi[e.unit]}`}function Fi(e){return e?e.amount*Ni[e.unit]:null}function Ii(e){let t=e.trim();if(t===``)return null;let n=/^\d+(\.\d+)?$/.test(t)?Number(t):NaN;return n>0&&n<=1e4?n:NaN}var Li=[`planned`,`in_progress`];function Ri(e){return e?.resolution===`not_adopted`}function zi(e,t){return e.dependsOn.every(e=>{let n=t.get(e);return n?.status===`done`&&!Ri(n)})}function Bi(e,t){return e.status!==`planned`||e.dependsOn.some(e=>Ri(t.get(e)))?[]:e.dependsOn.filter(e=>t.get(e)?.status!==`done`)}function Vi(e){let t=e.mergeable===`conflicting`;if(e.behind===0&&!t)return null;let n=[];return e.behind>0&&n.push(`${e.behind} ${e.behind===1?`commit`:`commits`} behind ${e.base}`),t?n.push(`pull request has merge conflicts`):e.mergeable===`mergeable`&&n.push(`no merge conflicts`),n.join(`; `)}function Hi(e){return e.status===`planned`&&(e.milestones.startedAt!==null||e.branch!==null)}function Ui(e,t){return e.notes.some(e=>e.kind===`blocker`&&e.at===t)}function Wi(e,t){let n=e.milestones.pausedAt;return Hi(e)&&n!==null&&zi(e,t)&&(Ui(e,n)||e.dependsOn.some(e=>(t.get(e)?.milestones.completedAt??-1/0)>=n))}function Gi(e){return e.status===`planned`&&!Hi(e)}function Ki(e,t){let n=e.dependsOn.map(e=>{let n=t.get(e);return Ri(n)?null:n?.milestones.completedAt??null});return n.length===0||n.includes(null)?null:Math.max(...n)}function qi(e,t){return`${e}->${t}`}function Ji(e){let t=new Set(e.map(e=>e.id));return e.flatMap(e=>e.dependsOn.filter(e=>t.has(e)).map(t=>({id:qi(t,e.id),source:t,target:e.id})))}function Yi(e,t,n){if(t===n)return!1;let r=e.find(e=>e.id===t),i=e.find(e=>e.id===n);return r!==void 0&&i!==void 0&&Li.includes(i.status)&&!i.dependsOn.includes(t)}function Xi(e,t){let n=new Set([t]),r=e=>{let r=[t],i=new Set([t]);for(let t=r.pop();t!==void 0;t=r.pop())for(let a of e(t))i.has(a)||(i.add(a),n.add(a),r.push(a))},i=new Map(e.map(e=>[e.id,e]));return r(e=>i.get(e)?.dependsOn.filter(e=>i.has(e))??[]),r(t=>e.filter(e=>e.dependsOn.includes(t)).map(e=>e.id)),n}var J=[`hour`,`day`,`week`,`month`],Zi={hour:960,day:48,week:12,month:3},Qi=120;function $i(e,t,n){let r=e.x+8,i=t.x-8,a=t.y-n/2;return`M ${e.x} ${e.y} H ${r} V ${a} H ${i} V ${t.y} H ${t.x}`}var ea=86400;function ta(e,t){let{plannedAt:n,startedAt:r,reviewAt:i,completedAt:a,pausedAt:o}=e.milestones;if(Gi(e))return{start:t,end:t};let s=r??i;if(e.status===`in_progress`||e.status===`in_review`)return s===null?null:{start:Math.min(s,t),end:t};let c=[n,r,i].filter(e=>e!==null),l=(e.status===`done`?a:o)??(c.length>0?Math.max(...c):null);return l===null?null:{start:Math.min(s??l,l),end:l}}function na(e,{start:t,end:n}){let r=mi(e.timeline),{reviewAt:i}=e.milestones;return(r.length>0?r.map(e=>({phase:e.state,start:e.start,end:e.end??n})):[{phase:`in_progress`,start:t,end:i??n},{phase:`in_review`,start:i??n,end:n}]).map(e=>({...e,start:Math.max(e.start,t),end:Math.min(e.end,n)})).filter(e=>e.end>e.start)}function ra(e,t,n,r,i){let{plannedAt:a}=e.milestones;if(a===null||i(Math.max(a,r))>=n)return null;let o=i(Math.max(a,r)),s=t!==null&&t>a&&t>=r?i(t):null;return{x:o-n,planned:a>=r,readyX:s!==null&&s<n?s-n:null}}function ia(e,t){let n=[],r=0;for(let i of t)i.x>r&&n.push({x:r,width:Math.min(i.x,e)-r}),r=Math.max(r,i.x+i.width);return r<e&&n.push({x:r,width:e-r}),n}function aa(e){let t=new Set(e.map(({task:e})=>e.id)),n=new Map(e.map(({task:e})=>[e.id,e.dependsOn.filter(e=>t.has(e)).length])),r=(e,t)=>e.interval.start-t.interval.start||e.task.id-t.task.id,i=new Set,a=[],o=e.filter(({task:e})=>n.get(e.id)===0);for(;a.length<e.length;){o.length===0&&(o=[e.filter(({task:e})=>!i.has(e.id)).sort(r)[0]]),o.sort(r);let t=o.shift();a.push(t),i.add(t.task.id);for(let r of e)if(!i.has(r.task.id)&&r.task.dependsOn.includes(t.task.id)){let e=n.get(r.task.id)-1;n.set(r.task.id,e),e===0&&o.push(r)}}return a}var oa=e=>String(e).padStart(2,`0`),sa={hour:{minor:`hour`,major:`day`},day:{minor:`day`,major:`month`},week:{minor:`week`,major:`month`},month:{minor:`month`,major:`year`}},ca={hour:e=>`${oa(e.getHours())}:00`,day:e=>`${oa(e.getMonth()+1)}-${oa(e.getDate())}`,week:e=>`${oa(e.getMonth()+1)}-${oa(e.getDate())}`,month:e=>`${e.getFullYear()}-${oa(e.getMonth()+1)}`,year:e=>String(e.getFullYear())},la={...ca,day:e=>`${e.getFullYear()}-${oa(e.getMonth()+1)}-${oa(e.getDate())}`};function ua(e,t){let n=new Date(e*1e3);return n.setMinutes(0,0,0),t!==`hour`&&n.setHours(0),t===`week`?n.setDate(n.getDate()-(n.getDay()+6)%7):t===`month`?n.setDate(1):t===`year`&&n.setMonth(0,1),n}function da(e,t){t===`hour`?e.setHours(e.getHours()+1):t===`day`?e.setDate(e.getDate()+1):t===`week`?e.setDate(e.getDate()+7):t===`month`?e.setMonth(e.getMonth()+1):e.setFullYear(e.getFullYear()+1)}function fa(e,t,n){let r=[];for(let i=ua(e,n);i.getTime()/1e3<t;da(i,n))r.push(new Date(i));return r}function pa(e,t,n){let r=Zi[e.scale],i=t=>(t-e.start)/ea*r,a=e.start+t/r*ea,o=e.start+n/r*ea;e.period!==null&&(a=Math.max(a,e.period.start),o=Math.min(o,e.period.end));let{minor:s,major:c}=sa[e.scale];return{ticks:fa(a,o,s).filter(e=>e.getTime()/1e3>=a).map(e=>({at:e.getTime()/1e3,x:i(e.getTime()/1e3),label:ca[s](e)})),majorTicks:fa(a,o,c).map(t=>{let n=new Date(t);da(n,c);let r=t.getTime()/1e3,a=n.getTime()/1e3;return e.period!==null&&(r=Math.max(r,e.period.start),a=Math.min(a,e.period.end)),{at:r,x:i(r),right:i(a),label:la[c](t)}})}}function ma(e){return e.length*6+6}function ha(e,t,n,r){let i=Math.max(e.x,n);return r!==null&&i<r.x+r.width&&i+t>r.x&&(i=r.x+r.width),i+t>e.right?null:i-e.x}function ga(e,{now:t,scale:n,period:r}){let i=new Map(e.map(e=>[e.id,e])),a=[],o=[];for(let n of e){let e=ta(n,t);e===null?a.push(n):(r===null||e.start<r.end&&e.end>=r.start)&&o.push({task:n,interval:e})}let s,c;if(r!==null)({start:s,end:c}=r);else{let e=o.map(({task:e,interval:t})=>Math.min(t.start,e.milestones.plannedAt??t.start)),n=o.flatMap(({task:e})=>e.dueDate===null?[]:[Oi(e.dueDate)]);s=ua(Math.min(t,...e,...n.map(e=>e-ea)),`day`).getTime()/1e3;let r=ua(Math.max(t,...o.map(({interval:e})=>e.end),...n.map(e=>e-1)),`day`);da(r,`day`),c=r.getTime()/1e3}let l=e=>(e-s)/ea*Zi[n],u=new Map,d=aa(o).map(({task:e,interval:r},a)=>{let o={start:Math.max(r.start,s),end:Math.min(r.end,c)},d=Gi(e),f,p,m=[],h=[];if(d){let t=e.dependsOn.flatMap(e=>{let t=i.get(e);if(t?.status===`done`&&!Ri(t))return[];let n=u.get(e);return n===void 0?[]:[n+16]});f=Math.max(l(o.start),...t);let r=Fi(e.estimate);p=Math.max(r===null?0:r/ea*Zi[n],28)}else{f=l(o.start),p=Math.max(l(o.end)-f,4);for(let t of na(e,o)){let e={x:l(t.start)-f,width:l(t.end)-l(t.start)};t.phase===`paused`?e.width>=6&&h.push(e):m.push({phase:t.phase,...e})}let n=l(Math.min(t,c))-f;Hi(e)&&n-p>=6&&(h=[...h,{x:p,width:n-p}])}u.set(e.id,f+p);let g=e.dueDate===null?null:Oi(e.dueDate);return{task:e,row:a,x:f,width:p,pending:d,phases:m,blocks:ia(p,h),pauses:h,lead:ra(e,Ki(e,i),f,s,l),dueX:g!==null&&g>=s&&g<=c?l(g)-f:null,dueState:ki(e,t)}});return{bars:d,unplaced:a,rows:d.length,start:s,end:c,width:Math.max(l(c),...d.map(e=>e.x+Math.max(e.width,Qi))),scale:n,period:r,nowX:t>=s&&t<=c?l(t):null}}function _a(e){return{start:new Date(e,0,1).getTime()/1e3,end:new Date(e+1,0,1).getTime()/1e3}}function va(e,t){let n=new Date(t*1e3).getFullYear(),r=e.flatMap(e=>e.milestones.plannedAt===null?[]:[e.milestones.plannedAt]),i=new Date(Math.min(t,...r)*1e3).getFullYear();return Array.from({length:n-i+1},(e,t)=>n-t)}function ya(e,t){return e.scale!==`month`&&e.nowX!==null?{x:16-e.nowX,y:Math.min(0,t.panel-t.height-8),zoom:1}:{x:Math.min(16,t.visible-e.width-16),y:0,zoom:1}}function ba(e,t){let n=e.notes.at(-1);if(e.status===`done`||n?.kind!==`blocker`)return null;let r=e.timeline.some(e=>e.status===`in_progress`&&e.at>n.at),i=n.at===e.milestones.pausedAt&&Wi(e,t);return r||i?null:n}var xa=[`agent_blocked`,`blocker_note`,`ci_failed`,`changes_requested`];function Sa(e,t,n,r=new Map(e.map(e=>[e.id,e]))){let i=new Map(t.map(e=>[e.taskId,e.status])),a=new Map(n.map(e=>[e.taskId,e])),o=e=>xa.indexOf(e.reasons[0]);return e.flatMap(e=>{let t=e.status===`in_progress`||e.status===`in_review`?i.get(e.id)??null:null,n=e.status===`in_review`?a.get(e.id):void 0,o=xa.filter(i=>{switch(i){case`agent_blocked`:return t===`blocked`;case`blocker_note`:return ba(e,r)!==null;case`ci_failed`:return n?.checks===`failing`;case`changes_requested`:return n?.review===`changes_requested`}});return o.length>0?[{task:e,reasons:o,agentStatus:t}]:[]}).sort((e,t)=>o(e)-o(t)||e.task.id-t.task.id)}var Ca={agent_blocked:`Agent needs input`,blocker_note:`Blocker`,ci_failed:`CI failed`,changes_requested:`Changes requested`},wa={agent_blocked:Qr.attention,blocker_note:Qr.attention,ci_failed:Qr.danger,changes_requested:Qr.attention};function Ta({onShow:e}){let t=pe(),n=$e(),r=ce(),i=C(),o=ee(),s=Sa(t.data??[],n.data??[],r.data??[]);return s.length===0?null:(0,q.jsxs)(`section`,{"aria-labelledby":`attention-heading`,className:`flex flex-col gap-1`,children:[(0,q.jsxs)(`h2`,{id:`attention-heading`,className:a(`flex items-center gap-1.5 px-1 text-xs font-medium uppercase`,$r.attention),children:[(0,q.jsx)(dn,{"aria-hidden":!0,className:`size-3.5`}),`Needs attention`,(0,q.jsx)(`span`,{className:a(`ml-auto rounded-full px-1.5 tabular-nums`,Qr.attention),children:s.length})]}),(0,q.jsx)(`ul`,{"aria-label":`Tasks needing attention`,className:`flex max-h-60 flex-col gap-0.5 overflow-y-auto`,children:s.map(({task:t,reasons:n,agentStatus:r})=>(0,q.jsxs)(`li`,{className:`flex items-start gap-0.5 rounded-md hover:bg-sidebar-accent`,children:[(0,q.jsxs)(`button`,{type:`button`,title:`Show on the timeline`,className:`flex min-w-0 flex-1 flex-col gap-1 rounded-md px-1.5 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>e(t.id),children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs`,children:[(0,q.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,t.id]}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:t.title})]}),(0,q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,q.jsx)(`span`,{"data-reason":e,className:a(`rounded-full px-1.5 text-[11px] font-medium leading-4`,wa[e]),children:Ca[e]},e))})]}),r!==null&&t.herdrWorkspaceId!==null&&(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,className:`mt-0.5`,"aria-label":`Focus agent pane of #${t.id}`,title:`Focus agent pane`,disabled:i.data?.running!==!0||o.isPending,onClick:()=>o.mutate(t.id),children:(0,q.jsx)(Ln,{})})]},t.id))}),o.error&&(0,q.jsx)(`p`,{role:`alert`,className:`px-1 text-xs text-destructive`,children:o.error.message})]})}function Ea({type:e,className:t}){return(0,q.jsx)(`span`,{"data-task-type":e,className:a(`shrink-0 rounded-md border px-1.5 font-mono text-xs`,ti,t),children:e})}function Da({taskId:e,prerequisite:t,pending:n,onConfirm:r,onCancel:i}){return(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Confirm prerequisite of #${e}`,className:a(`flex flex-wrap items-center gap-2 rounded-md px-2 py-1.5 text-xs`,ni.attention),onKeyDown:ze(i,n),children:[(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Adding `,t,` as a prerequisite pauses #`,e,` and closes its herdr workspace, which stops its agent; the worktree is kept.`]}),(0,q.jsxs)(G,{size:`xs`,variant:`destructive`,disabled:n,onClick:r,children:[(0,q.jsx)(yr,{}),n?`Pausing...`:`Pause and add`]}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,disabled:n,onClick:i,children:`Back`})]})}function Oa({label:e,full:t,short:n,className:r}){let[i,o]=(0,K.useState)(`idle`);(0,K.useEffect)(()=>{if(i===`idle`)return;let e=setTimeout(()=>o(`idle`),2e3);return()=>clearTimeout(e)},[i]);async function s(){try{await navigator.clipboard.writeText(t),o(`copied`)}catch{o(`failed`)}}return(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-0.5`,children:[(0,q.jsx)(`span`,{title:t,className:a(`truncate`,r),children:n}),(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy ${e}`,title:`Copy ${t}`,className:`shrink-0 text-muted-foreground`,onClick:()=>void s(),children:i===`copied`?(0,q.jsx)(xn,{}):(0,q.jsx)(Fn,{})}),(0,q.jsx)(`span`,{role:`status`,className:a(`shrink-0 text-xs`,i===`failed`?`text-destructive`:`sr-only`),children:i===`copied`?`Copied`:i===`failed`?`Could not copy`:``})]})}function ka(e,t,n=!1){let[r,i]=(0,K.useState)(!1),a=(0,K.useRef)(null),o=()=>{e?(a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i(!0)):t()},s=e=>{let t=a.current;t?.isConnected&&t.matches(`input, textarea, select`)?t.focus():(e instanceof Element?e.closest(`form`):null)?.querySelector(`textarea, input:not([type=checkbox]), select`)?.focus(),i(!1)};return{asking:r,request:o,keep:s,discard:()=>{i(!1),t()},onKeyDown:e=>{e.key!==`Escape`||n||e.defaultPrevented||(e.preventDefault(),r?s(e.target):o())}}}function Aa({label:e,question:t,onKeep:n,onDiscard:r}){return(0,q.jsxs)(`div`,{role:`group`,"aria-label":e,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,children:[(0,q.jsx)(`span`,{className:`mr-1`,children:t}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`outline`,autoFocus:!0,onClick:e=>n(e.currentTarget),children:`Keep editing`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`destructive`,onClick:r,children:`Discard changes`})]})}var ja=80,Ma=`(max-width: 47.99rem)`;function Na(e){let[t,n]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(t===null)return;let e=window.matchMedia?.(Ma),r=()=>n(null);return e?.addEventListener(`change`,r),()=>e?.removeEventListener(`change`,r)},[t!==null]);function r(e){window.matchMedia?.(`(max-width: 47.99rem)`).matches&&e.button===0&&!e.target.closest(`button`)&&(e.currentTarget.setPointerCapture?.(e.pointerId),n({pointer:e.pointerId,startY:e.clientY,offset:0}))}function i(e){t?.pointer===e.pointerId&&n({...t,offset:Math.max(0,e.clientY-t.startY)})}function a(r){t?.pointer===r.pointerId&&(n(null),r.type===`pointerup`&&r.clientY-t.startY>=ja&&e())}return{dragging:t!==null,offset:t?.offset??0,handlers:{onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a}}}function Pa({ref:e,width:t,takeFocus:n=!0,returnFocus:r,onClose:i,banner:a,children:o}){let s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(r);l.current=r;let u=Na(i);(0,K.useLayoutEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=s.current;return n&&c.current?.focus({preventScroll:!0}),()=>{let n=document.activeElement;if(n!==null&&n!==document.body&&!t?.contains(n))return;let r=l.current?.()??e;r?.isConnected&&r.focus({preventScroll:!0})}},[]);let d=u.handlers;return(0,q.jsxs)(`aside`,{ref:t=>{s.current=t,typeof e==`function`?e(t):e&&(e.current=t)},"aria-label":`Task details`,"data-dragging":u.dragging?``:void 0,className:`fixed z-40 flex flex-col overflow-hidden border bg-card shadow-xl max-md:inset-x-0 max-md:bottom-0 max-md:max-h-[90dvh] max-md:rounded-t-2xl max-md:border-b-0 max-md:pb-[env(safe-area-inset-bottom)] max-md:transition-transform max-md:data-dragging:transition-none motion-reduce:transition-none md:inset-y-4 md:right-4 md:w-(--sheet-width) md:rounded-xl`,style:{"--sheet-width":t,transform:u.offset===0?void 0:`translateY(${u.offset}px)`},children:[(0,q.jsx)(`div`,{className:`flex shrink-0 justify-center pt-2 pb-1 md:hidden touch-none`,...d,children:(0,q.jsx)(`span`,{"data-grabber":!0,"aria-hidden":!0,className:`h-1 w-9 rounded-full bg-muted-foreground/40`})}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-2 max-md:touch-none max-md:pt-0`,...d,children:[(0,q.jsx)(`h3`,{ref:c,tabIndex:-1,className:`text-xs font-medium text-muted-foreground outline-none`,children:`Task details`}),(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Close details`,title:`Close details (Esc)`,onClick:i,children:(0,q.jsx)(nt,{})})]}),a,(0,q.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:o})]})}var Fa={idle:`Agent idle`,working:`Agent working`,blocked:`Agent needs input`,done:`Agent done`},Ia={idle:Qr.neutral,working:Qr.info,blocked:Qr.attention,done:Qr.success};function La({taskId:e,status:t,className:n}){return(0,q.jsxs)(`span`,{"aria-label":`Agent of #${e}`,className:a(`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,Ia[t],n),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full bg-current`,t===`working`&&`motion-safe:animate-pulse`)}),Fa[t]]})}var Ra={passing:`CI passed`,failing:`CI failed`,pending:`CI running`},za={passing:Qr.success,failing:Qr.danger,pending:Qr.info},Ba={approved:`Approved`,changes_requested:`Changes requested`,pending:`Review pending`},Va={approved:Qr.success,changes_requested:Qr.attention,pending:Qr.neutral},Ha=`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`;function Ua({taskId:e,status:t}){return(0,q.jsxs)(q.Fragment,{children:[t.checks&&(0,q.jsxs)(`span`,{"aria-label":`CI of #${e}`,className:a(Ha,za[t.checks]),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full bg-current`,t.checks===`pending`&&`motion-safe:animate-pulse`)}),Ra[t.checks]]}),(0,q.jsx)(`span`,{"aria-label":`Review of #${e}`,className:a(Ha,Va[t.review]),children:Ba[t.review]})]})}var Wa=`(max-width: 47.99rem)`;function Ga(){let[e,t]=(0,K.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(Wa).matches);return(0,K.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(Wa),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Ka({label:e,expanded:t,onExpandedChange:n,onSubmit:r,children:i}){let o=(0,K.useRef)(null),s=(0,K.useRef)(!1),c=Ga(),l=t&&c;(0,K.useEffect)(()=>{if(!t)return;let e=e=>{e.target instanceof Node&&!o.current?.contains(e.target)&&n(!1)};return document.addEventListener(`click`,e),document.addEventListener(`focusin`,e),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`focusin`,e)}},[t]);let u=()=>{s.current?s.current=!1:t||n(!0)};function d(){n(!1);let e=o.current?.querySelector(`input`);e&&e!==document.activeElement&&(s.current=!0,e.focus())}function f(e){e.key===`Escape`&&t&&!e.defaultPrevented&&(e.preventDefault(),n(!1))}return(0,q.jsxs)(q.Fragment,{children:[l&&(0,q.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-black/40`}),(0,q.jsx)(`div`,{role:l?`dialog`:void 0,"aria-modal":l||void 0,"aria-label":l?e:void 0,className:a(l&&`fixed inset-x-0 bottom-0 z-50 max-h-[90dvh] overflow-y-auto rounded-t-xl bg-card pb-[env(safe-area-inset-bottom)] shadow-xl`),children:(0,q.jsxs)(`form`,{ref:o,"aria-label":e,"data-expanded":t||void 0,onSubmit:r,onFocus:u,onInput:u,onKeyDown:f,className:a(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,l&&`border-0 shadow-none`),children:[t&&(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium`,children:e}),(0,q.jsx)(G,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Close ${e}`,title:`Close (Esc)`,onClick:d,children:(0,q.jsx)(nt,{})})]}),i]})})]})}var qa=`modulepreload`,Ja=function(e){return`/`+e},Ya={},Xa=function(e){return e.pathname.endsWith(`.css`)},Za=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Qa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ja(t,n);let r=s(t),i=Xa(r);return Za(Ya,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:qa,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},$a=(0,K.lazy)(()=>Qa(()=>import(`./markdown-C9D2w1Lj.js`),__vite__mapDeps([0,1])));function eo({label:e,value:t,onChange:n,placeholder:r,className:i}){let[o,s]=(0,K.useState)(!1),c=(0,K.useId)();return(0,q.jsxs)(`div`,{className:a(`flex min-w-0 flex-col gap-1 max-md:gap-2`,i),children:[(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Mode of ${e}`,className:`flex gap-0.5 max-md:gap-2`,children:[(0,q.jsx)(G,{type:`button`,size:`xs`,variant:o?`ghost`:`default`,"aria-pressed":!o,onClick:()=>s(!1),children:`Write`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:o?`default`:`ghost`,"aria-pressed":o,onClick:()=>s(!0),children:`Preview`})]}),o?(0,q.jsx)(`div`,{role:`region`,"aria-label":`Preview of ${e}`,className:`min-h-16 rounded-lg border border-input px-2.5 py-1.5`,children:t.trim()?(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:t}),children:(0,q.jsx)($a,{source:t})}):(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview`})}):(0,q.jsx)(`textarea`,{className:a(qe,`h-auto min-h-16 resize-y py-1.5 max-md:h-auto`),rows:3,placeholder:r,"aria-label":e,"aria-describedby":c,value:t,onChange:e=>n(e.target.value)}),(0,q.jsx)(`p`,{id:c,className:`text-xs text-muted-foreground`,children:`Markdown supported`})]})}var to=K.createContext(void 0);function no(e){let t=K.useContext(to);if(t===void 0&&!e)throw Error(Ft(33));return t}var ro=K.createContext(void 0);function io(e){let t=K.useContext(ro);if(t===void 0&&!e)throw Error(Ft(36));return t}var ao=`data-starting-style`,oo=`data-ending-style`,so={[ao]:``},co={[oo]:``},lo={transitionStatus(e){return e===`starting`?so:e===`ending`?co:null}},uo=`data-open`,fo=`data-closed`,po=`data-anchor-hidden`,mo=`data-popup-open`,ho=`data-pressed`,go={[mo]:``,[ho]:``},_o={[uo]:``},vo={[fo]:``},yo={[po]:``},bo={open(e){return e?go:null}},xo={open(e){return e?_o:vo},anchorHidden(e){return e?yo:null}},So={...xo,...lo},Co=K.createContext(void 0);function wo(e=!0){let t=K.useContext(Co);if(t===void 0&&!e)throw Error(Ft(25));return t}var To=`none`,Eo=`trigger-press`,Do=`trigger-hover`,Oo=`trigger-focus`,ko=`outside-press`,Ao=`item-press`,jo=`focus-out`,Mo=`escape-key`,No=`list-navigation`,Po=`keyboard`,Y=`pointer`,Fo=`cancel-open`,Io=`sibling-open`,Lo=`imperative-action`,Ro=K.createContext(null);function zo(e=`root`){let t=K.useContext(Ro),n=K.useContext(ro);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Bo={visible:!0,ref:null};function Vo(){return Bo}function Ho(e,t,n=`root`){let r=zo(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Vo)({label:e.label,children:e.children,render:e.render}),a=jt(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Uo(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Wo,platform:Go,maxTouchPoints:Ko}=Uo(),qo=Wo.toLowerCase(),Jo=Go.toLowerCase(),Yo=/^i(os$|p)/.test(Jo)||Jo===`macintel`&&Ko>1,Xo=`android`,Zo=Jo===Xo||qo.includes(Xo),Qo=!Yo&&Jo.startsWith(`mac`);Jo.startsWith(`win`),!Zo&&/^(linux|chrome os)/.test(Jo);var $o=Qo||Yo,es=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!es&&qo.includes(`firefox`),!es&&qo.includes(`chrom`);var ts=$o,ns=/jsdom|happydom/.test(qo);function rs(e){e.preventDefault()}function is(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=io(),u=wo(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return K.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?rs:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Ao})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Qo&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Et(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var as={type:`regular-item`};function os(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=K.useRef(null),{getButtonProps:d,buttonRef:f}=Rt({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=is({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=K.useCallback(e=>Mt(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=jt(u,f);return K.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var ss=K.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function cs(){return K.useContext(ss)}function ls(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=cs(),u=K.useRef(-1),[d,f]=K.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=K.useRef(null),h=K.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return W(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function us(){let[,e]=K.useState({});return K.useCallback(()=>{e({})},[])}var ds=0;function fs(e,t=`mui`){let n=K.useRef(void 0),r=us(),i=e??n.current;return K.useEffect(()=>{n.current??(ds+=1,n.current=`${t}-${ds}`,e??r())},[e,t,r]),i}var ps=zt.useId;function ms(e,t){if(ps!==void 0){let n=ps();return e??(t?`${t}-${n}`:n)}return fs(e,t)}function hs(e){return ms(e,`base-ui`)}function gs(e,t,n,r){let i=!1,a=!1,o=r??Pt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function _s(e,t,n){let r=n??Pt;return{reason:e,event:t??new Event(`base-ui`),...r}}function vs(e){K.useEffect(e,Ct)}var ys=null;globalThis.requestAnimationFrame;var bs=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},xs=class e{static create(){return new e}static request(e){return bs.request(e)}static cancel(e){return bs.cancel(e)}currentId=ys;request(e){this.cancel(),this.currentId=bs.request(()=>{this.currentId=ys,e()})}cancel=()=>{this.currentId!==ys&&(bs.cancel(this.currentId),this.currentId=ys)};disposeEffect=()=>this.cancel};function Ss(){let e=St(xs.create).current;return vs(e.disposeEffect),e}function Cs(e,t=!1,n=!1,r=!1){let[i,a]=K.useState(e&&t?`idle`:void 0),[o,s]=K.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),W(()=>{if(!e&&o&&i!==`ending`&&n){let e=xs.request(()=>{a(`ending`)});return()=>{xs.cancel(e)}}},[e,o,i,n]),W(()=>{if(!e||t||i===void 0)return;let n=xs.request(()=>{a(void 0)});return()=>{xs.cancel(n)}},[t,e,i]),W(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=xs.request(()=>{a(`idle`)});return()=>{xs.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function ws(e){return e==null?e:`current`in e?e.current:e}function Ts(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Es=i(sn(),1),Ds=null;function Os(e){if(!Ds){let e=[];Ds=e,queueMicrotask(()=>{Ds=null,Es.flushSync(()=>{for(let t of e)t()})})}Ds.push(e)}function ks(e,t=!1,n=!1){let r=Ss();return U((i,a=null)=>{r.cancel();let o=ws(e);if(o==null)return;let s=o,c=()=>{n?Os(()=>{a?.aborted||i()}):Es.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Ts(s).map(e=>e.finished.then(Lt))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Ts(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=ao;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function As(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=U(a),s=ks(r,n,i);K.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var js=K.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=io(),f=ls({guess:!0,label:a}),p=hs(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=os({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:as});return Ot(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Ms=K.forwardRef(function(e,t){let n=Ho(e,t);return n.visible?(0,q.jsx)(js,{...e,ref:n.ref}):null}),Ns=0,Ps=class e{static create(){return new e}currentId=Ns;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ns,t()},e)}isStarted(){return this.currentId!==Ns}clear=()=>{this.currentId!==Ns&&(clearTimeout(this.currentId),this.currentId=Ns)};disposeEffect=()=>this.clear};function Fs(){let e=St(Ps.create).current;return vs(e.disposeEffect),e}function Is(e){e.preventDefault(),e.stopPropagation()}function Ls(e){return`nativeEvent`in e}function Rs(e){return e.pointerType===``&&e.isTrusted?!0:Zo&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function zs(e){return ns?!1:!Zo&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Zo||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Bs(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Vs(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Hs(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&yt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Us(e,t){let n=e;for(;n;){if(At(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(yt(n)?n.host:null)}return null}function Ws(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Gs=`data-base-ui-focusable`,Ks=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,qs=`ArrowLeft`,Js=`ArrowRight`,Ys=`ArrowUp`,Xs=`ArrowDown`,Zs=`data-trigger-disabled`;function Qs(e,t){if(!At(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Zs);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(Zs);return!1}function $s(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ec(e){return e.matches(`html,body`)}function tc(e){return lt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function nc(e){return Us(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ks}`)!=null}function rc(e){return e?e.getAttribute(`role`)===`combobox`&&tc(e):!1}function ic(e){if(!e||ns)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ac(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function oc(e,t){return t!=null&&!Bs(t)?0:typeof e==`function`?e():e}function sc(e,t,n){let r=oc(e,n);return typeof r==`number`?r:r?.[t]}function cc(e){return typeof e==`function`?e():e}function lc(e,t){return t||e===`click`||e===`mousedown`}function uc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function dc(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function fc(e){let t=St(pc,e).current;return t.next=e,W(t.effect),t}function pc(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var mc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},hc={...mc,position:`fixed`,margin:0,top:0,left:0};({...mc});var gc=K.forwardRef(function(e,t){let[n,r]=K.useState();W(()=>{ts&&es&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:hc,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),_c=Math.min,vc=Math.max,yc=Math.round,bc=Math.floor,xc=e=>({x:e,y:e}),Sc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Cc(e,t,n){return vc(e,_c(t,n))}function wc(e,t){return typeof e==`function`?e(t):e}function Tc(e){return e.split(`-`)[0]}function Ec(e){return e.split(`-`)[1]}function Dc(e){return e===`x`?`y`:`x`}function Oc(e){return e===`y`?`height`:`width`}function kc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ac(e){return Dc(kc(e))}function jc(e,t,n){n===void 0&&(n=!1);let r=Ec(e),i=Ac(e),a=Oc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bc(o)),[o,Bc(o)]}function Mc(e){let t=Bc(e);return[Nc(e),t,Nc(t)]}function Nc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Pc=[`left`,`right`],Fc=[`right`,`left`],Ic=[`top`,`bottom`],Lc=[`bottom`,`top`];function Rc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fc:Pc:t?Pc:Fc;case`left`:case`right`:return t?Ic:Lc;default:return[]}}function zc(e,t,n,r){let i=Ec(e),a=Rc(Tc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Nc)))),a}function Bc(e){let t=Tc(e);return Sc[t]+e.slice(t.length)}function Vc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Hc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vc(e)}function Uc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Wc(e,t){return t<0||t>=e.length}function Gc(e,t){return Jc(e.current,{disabledIndices:t})}function Kc(e,t){return Jc(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function qc(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Jc(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Wc(e,u)?-1:u,wrapped:d}}function Jc(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Yc(e,a,r));return a}function Yc(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Zc(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Xc(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Zc(e,t=e?Ht(e):null){return!e||!e.isConnected||!t||Xc(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Qc=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function $c(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return yt(n)?n.host:null}function el(e){for(let t of Array.from(e.children))if(ut(t)===`summary`)return t;return null}function tl(e,t){let n=el(t);return!!n&&(e===n||X(n,e))}function nl(e){let t=e?ut(e):``;return e!=null&&e.matches(Qc)&&(t!==`summary`||e.parentElement!=null&&ut(e.parentElement)===`details`&&el(e.parentElement)===e)&&(t!==`details`||el(e)==null)&&(t!==`input`||e.type!==`hidden`)}function rl(e){if(!nl(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=$c(t)){let n=t!==e,r=ut(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ut(t)===`details`&&!t.open&&!tl(e,t)||t.hasAttribute(`hidden`)||!r&&!il(t,n))return!1}return!0}function il(e,t){let n=Ht(e);return t?n.display!==`none`:Zc(e,n)}function al(e){let t=e.tabIndex;if(t<0){let t=ut(e);if(t===`details`||t===`audio`||t===`video`||lt(e)&&e.isContentEditable)return 0}return t}function ol(e){if(ut(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function sl(e,t){let n=ol(e);if(!n)return!0;let r=t.find(e=>{let t=ol(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ol(e);return t?.name===n.name&&t.form===n.form})===n}function cl(e){if(lt(e)&&ut(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return lt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ll(e,t){cl(e).forEach(e=>{nl(e)&&t.push(e),ll(e,t)})}function ul(e,t,n){cl(e).forEach(e=>{lt(e)&&e.matches(t)&&n.push(e),ul(e,t,n)})}function dl(e){return rl(e)&&al(e)>=0}function fl(e){let t=[];return ll(e,t),t.filter(rl)}function pl(e){let t=fl(e);return t.filter(e=>al(e)>=0&&sl(e,t))}function ml(e,t){let n=pl(e),r=n.length;if(r===0)return;let i=Hs(Jr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function hl(e){return ml(Jr(e).body,1)||e}function gl(e){return ml(Jr(e).body,-1)||e}function _l(e,t,n){if(!e)return null;let r=[];ll(Jr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(rl);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!X(n,o)&&dl(o)&&sl(o,a))return o}return r[i]}function vl(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function yl(e){pl(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function bl(e){let t=[];ul(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function xl(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...xl(e,t.id,n)])}function Sl(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Cl(e){return`data-base-ui-${e}`}var wl=0;function Tl(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(wl);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Lt;let o=requestAnimationFrame(a);return wl=o,()=>{wl===o&&(cancelAnimationFrame(o),wl=0)}}var El=`data-base-ui-inert`,Dl=new WeakMap,Ol=new WeakSet,kl=new WeakMap,Al=0;function jl(e){return e?yt(e)?e.host:jl(e.parentNode):null}var Ml=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=jl(t);return e.contains(n)?n:null}).filter(e=>e!=null),Nl=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Pl=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ut(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Fl(e,t,n,{mark:r=!0}){let i=Ml(t,e),a=r?Pl(t,Nl(i),new Set(i)):[],o=[],s=[];if(n){let e=Ml(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Pl(t,Nl(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Dl.get(e)||0)+1;Dl.set(e,r),o.push(e),r===1&&n&&Ol.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(kl.get(e)||0)+1;kl.set(e,t),s.push(e),t===1&&e.setAttribute(El,``)}),Al+=1,()=>{o.forEach(e=>{let t=(Dl.get(e)||0)-1;Dl.set(e,t),t||(Ol.has(e)||e.removeAttribute(`aria-hidden`),Ol.delete(e))}),r&&s.forEach(e=>{let t=(kl.get(e)||0)-1;kl.set(e,t),t||e.removeAttribute(El)}),--Al,Al||(Dl=new WeakMap,Ol=new WeakSet,kl=new WeakMap)}}function Il(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Jr(e[0]).body;return Fl(e,i,n,{mark:r})}var Ll={style:{transition:`none`}},Rl={fallbackAxisSide:`none`},zl={fallbackAxisSide:`end`},Bl={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Vl=K.createContext(null),Hl=()=>K.useContext(Vl),Ul=Cl(`portal`);function Wl(e={}){let{ref:t,container:n,componentProps:r=Pt,elementProps:i}=e,a=ms(),o=Hl()?.portalNode,[s,c]=K.useState(null),[l,u]=K.useState(null),d=U(e=>{e!==null&&u(e)}),f=K.useRef(null);W(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(gt(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Ot(`div`,r,{ref:[t,d],props:[{id:a,[Ul]:``},i]}),m=s&&p?Es.createPortal(p,s):null;return{node:l,nodeId:K.isValidElement(p)?p.props.id:void 0,subtree:m}}var Gl=K.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Wl({container:o,ref:t,componentProps:e,elementProps:c}),f=K.useRef(null),p=K.useRef(null),m=K.useRef(null),h=K.useRef(null),[g,_]=K.useState(null),v=K.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;K.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&vl(e)&&(e.type===`focusin`?v.current&&=(bl(l),!1):(yl(l),v.current=!0))}return dc(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,y]),W(()=>{l&&b===!0&&v.current&&(bl(l),v.current=!1)},[b,l]);let S=K.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,q.jsxs)(K.Fragment,{children:[d,(0,q.jsxs)(Vl.Provider,{value:S,children:[x&&l&&(0,q.jsx)(gc,{"data-type":`outside`,ref:f,onFocus:e=>{vl(e,l)?m.current?.focus():gl(g?g.domReference:null)?.focus()}}),x&&l&&(0,q.jsx)(`span`,{role:s,"aria-owns":u,style:Bl}),l&&Es.createPortal(a,l),x&&l&&(0,q.jsx)(gc,{"data-type":`outside`,ref:p,onFocus:e=>{vl(e,l)?h.current?.focus():(hl(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,gs(`focus-out`,e.nativeEvent)))}})]})]})});function Kl(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ql=class{nodesRef={current:[]};events=Kl();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Jl=K.createContext(null),Yl=K.createContext(null),Xl=()=>K.useContext(Jl)?.id||null,Zl=e=>{let t=K.useContext(Yl);return e??t};function Ql(e){let t=ms(),n=Zl(e),r=Xl();return W(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function $l(e){let{children:t,id:n}=e,r=Xl();return(0,q.jsx)(Jl.Provider,{value:K.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function eu(e){let{children:t,externalTree:n}=e,r=St(()=>n??new ql).current;return(0,q.jsx)(Yl.Provider,{value:r,children:t})}function tu(e,t){let n=dt(Ws(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Rs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var nu=20,ru=[];function iu(){ru=ru.filter(e=>e.deref()?.isConnected)}function au(e){iu(),e&&ut(e)!==`body`&&(ru.push(new WeakRef(e)),ru.length>nu&&(ru=ru.slice(-20)))}function ou(){return iu(),ru[ru.length-1]?.deref()}function su(e){return e?dl(e)?e:pl(e)[0]||e:null}function cu(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=fl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return dl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function lu(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=U(()=>b.current.floatingContext?.nodeId),S=i===!1,C=rc(_)&&S,w=fc(i),T=fc(a),E=fc(o),D=fc(u),O=fc(g),k=Zl(m),A=Hl(),j=K.useRef(!1),M=K.useRef(!1),N=K.useRef(!1),P=K.useRef(null),F=K.useRef(``),ee=K.useRef(``),I=K.useRef(null),L=K.useRef(null),te=jt(I,p,A?.beforeInsideRef),ne=jt(L,A?.afterInsideRef),re=Fs(),R=Fs(),ie=Ss(),ae=A!=null,z=ac(v),oe=U((e=z)=>e?pl(e):[]),se=U(()=>h?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&X(z,Hs(Jr(z)))&&oe().length===0&&!C&&Is(e)}return Z(Jr(z),`keydown`,e)},[r,z,c,C,oe]),K.useEffect(()=>{if(r||!g)return;let e=Jr(z);function t(){N.current=!1}function n(e){let t=Ws(e),n=se(),r=X(v,t)||X(_,t)||X(A?.portalNode,t)||n.some(e=>e===t||X(e,t));N.current=!r,ee.current=e.pointerType||`keyboard`,Us(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,R.start(0,()=>{M.current=!1}))}function i(){ee.current=`keyboard`}return dc(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,v,_,z,g,A,R,se]),K.useEffect(()=>{if(r||!l)return;let e=Jr(z);function n(){M.current=!0,R.start(0,()=>{M.current=!1})}function i(e){let t=Ws(e);dl(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Ws(n);c&&r==null&&a!=null&&X(v,a)&&au(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=se(),p=r?.hasAttribute(Cl(`focus-guard`))&&[I.current,L.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,ws(f),ws(d)].includes(r),m=!(X(_,r)||X(v,r)||X(r,v)||X(A?.portalNode,r)||u.some(e=>e===r||X(e,r))||l.hasMatchingElement(e=>X(e,r))||p||k&&(xl(k.nodesRef.current,o).find(e=>X(e.context?.elements.floating,r)||X(e.context?.elements.domReference,r))||Sl(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,ac(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&z&&cu(z),s&&i!==_&&!Zc(a)&&Hs(e)===e.body){if(lt(z)&&(z.focus(),s===`popup`)){ie.request(()=>{z.focus()});return}let e=oe(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||z;lt(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==ou())&&(j.current=!0,t.setOpen(!1,gs(jo,n)))})}function o(){N.current||(b.current.insideReactTree=!0,re.start(0,()=>{b.current.insideReactTree=!1}))}let u=lt(_)?_:null;if(v||u)return dc(u&&Z(u,`focusout`,a),u&&Z(u,`pointerdown`,n),v&&Z(v,`focusin`,i),v&&Z(v,`focusout`,a),v&&A&&Z(v,`focusout`,o,!0))},[r,_,v,z,c,k,A,t,l,s,oe,C,x,b,re,R,ie,d,f,se]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Cl(`portal`)}]`)||[]),t=(k?Sl(k.nodesRef.current,x()):[]).find(e=>rc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Il([v,...e,I.current,L.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...se(),t,ws(f),ws(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=Il([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,se]),W(()=>{if(!g||r||!lt(z))return;F.current=``,ee.current=``;let e=Jr(z),t=Hs(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||X(z,t))return;let i=null,a=()=>(i??=oe(z),i[0]||z),o;o=r===!0||r===null?a():ws(r),o||=a();let s=X(z,Hs(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&Rs(c);Tl(o,{sync:l,preventScroll:o===z,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Hs(e);return!(t!==o&&X(z,t))}})})},[r,g,z,oe,w,D,O,b]);let ce=K.useRef(null);W(()=>{if(r||!z){ce.current=null;return}ce.current&&=(ce.current.cancelled=!0,null);let e=Jr(z),t=Hs(e),n=D.current==null;au(t);function i(e){if(e.open||(F.current=tu(e.nativeEvent,ee.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Cl(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Rs(e.nativeEvent)||zs(e.nativeEvent))j.current=!1;else{let e=!1;Jr(z).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ut(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ou()||null,typeof i==`boolean`?s:ws(i)||s||null}return()=>{y.off(`openchange`,i);let t=Hs(e),n=se(),r=X(v,t)||n.some(e=>e===t||X(e,t))||k&&xl(k.nodesRef.current,x(),!1).some(e=>X(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};ce.current=l,queueMicrotask(()=>{ce.current===l&&(ce.current=null);let n=su(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&<(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,z,T,E,D,y,k,_,x,se]),W(()=>{if(!es||g||!v)return;let e=Hs(Jr(v));lt(e)&&tc(e)&&X(v,e)&&e.blur()},[g,v]),W(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),W(()=>{if(!r&&z)return cu(z),()=>{queueMicrotask(iu)}},[r,z]);let B=!r&&(!c||!C)&&(ae||c);return(0,q.jsxs)(K.Fragment,{children:[B&&(0,q.jsx)(gc,{"data-type":`inside`,ref:te,onFocus:e=>{if(c){let e=oe();Tl(e[e.length-1])}else A?.portalNode&&(j.current=!1,vl(e,A.portalNode)?hl(_)?.focus():ws(f??A.beforeOutsideRef)?.focus())}}),n,B&&(0,q.jsx)(gc,{"data-type":`inside`,ref:ne,onFocus:e=>{c?Tl(oe()[0]):A?.portalNode&&(l&&(j.current=!0),vl(e,A.portalNode)?gl(_)?.focus():ws(d??A.afterOutsideRef)?.focus())}})]})}function uu(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Eo}=t,l=e.context.dataRef,u=K.useRef(void 0),d=Ss(),f=Fs(),p=K.useMemo(()=>{function t(t,n,r,i){let a=gs(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Bs(e.pointerType,!0)&&zs(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Bs(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Ws(s),p=tc(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Bs(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return K.useMemo(()=>n?{reference:p}:Pt,[n,p])}function du(){return!1}function fu(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function pu(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=du,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Zl(c),m=U(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=U(()=>a),{escapeKey:v,outsidePress:y}=fu(s),b=K.useRef(!1),x=K.useRef(!1),S=K.useRef(!1),C=K.useRef(!1),w=K.useRef(!1),T=K.useRef(``),E=K.useRef(null),D=Fs(),O=Fs(),k=Fs(),A=U(()=>{O.clear(),d.current.insideReactTree=!1}),j=U(e=>{let t=d.current.floatingContext?.nodeId;return(p?xl(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=U(t=>$s(t,e.select(`floatingElement`))||$s(t,e.select(`domReferenceElement`))),N=U(t=>{o()&&e.setOpen(!1,gs(Eo,t.nativeEvent))}),P=U(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Ls(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=gs(Mo,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=U(()=>{d.current.insideReactTree=!0,O.start(0,A)}),ee=U(t=>{if(!l||!n||t.button!==0)return;let r=Ws(t.nativeEvent);X(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),I=U(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});K.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),K.useEffect(()=>A,[A]),K.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Ps,i=Jr(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(es?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&xl(p.nodesRef.current,t).some(t=>$s(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=Ws(n),i=`[${Cl(`inert`)}]`,a=At(r)?r.getRootNode():null,o=Array.from((yt(a)?a:Jr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>X(e,r))))return;let c=At(r)?r:null;for(;c&&!kt(c);){let e=ft(c);if(kt(e)||!At(e))break;c=e}if(!(o.length&&At(r)&&!ec(r)&&!X(r,e.select(`floatingElement`))&&o.every(e=>!X(c,e)))){if(lt(r)&&!(`touches`in n)){let e=kt(r),t=Ht(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!Rs(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}(typeof h!=`function`||h(n))&&(j(`__outsidePressBubbles`)||(e.setOpen(!1,gs(ko,n)),A()))}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function ee(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function I(e,t){let n=Ws(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function L(e){T.current=`touch`,I(e,ee)}function te(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&I(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function ne(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function re(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function R(e){I(e,re)}function ie(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function ae(e){I(e,ie)}let z=dc(r&&dc(Z(i,`keydown`,P),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),g&&dc(Z(i,`click`,te,!0),Z(i,`pointerdown`,te,!0),Z(i,`pointerup`,ne,!0),Z(i,`pointercancel`,ne,!0),Z(i,`mousedown`,te,!0),Z(i,`mouseup`,ne,!0),Z(i,`touchstart`,L,{capture:!0,passive:!0}),Z(i,`touchmove`,R,{capture:!0,passive:!0}),Z(i,`touchend`,ae,{capture:!0,passive:!0})));return()=>{z(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let L=K.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),te=K.useMemo(()=>({onKeyDown:P,onPointerDown:I,onMouseDown:I,onClickCapture:F,onMouseDownCapture(e){F(),ee(e)},onPointerDownCapture(e){F(),ee(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,ee,I]);return K.useMemo(()=>n?{reference:L,floating:te,trigger:L}:{},[n,L,te])}function mu(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),W(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};At(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function hu(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=U(i),{mounted:c,setMounted:l,transitionStatus:u}=Cs(t,!1,!1,o),d=!t&&r;W(()=>{t&&s(!1)},[t,s]);let f=K.useRef(c),p=K.useRef(!1),m=us(),h=()=>{f.current=!1,l(!1),a()};W(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=U(()=>{f.current&&(t?(p.current=!0,m()):h())});return As({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var gu={tabIndex:-1,[Gs]:``};function _u({handle:e,store:t}){return W(()=>e.attachStore(t),[e,t]),null}function vu(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function yu(e,t){let n=K.useRef(null);return U(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),vu(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),vu(t))})}function bu(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function xu(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Su(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=yu(e,n),o=U(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=U(e=>{a(e),e&&o(e)});return W(()=>(s(t.current),()=>s(null)),[s,t,n,e]),W(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Cu(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=K.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);W(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=gs(To);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function wu(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=hu({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return St(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Tu(e,t){e.useSyncedValues(t),W(()=>()=>{e.update({activeTriggerProps:Pt,inactiveTriggerProps:Pt,popupProps:Pt})},[e])}var Eu=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Du=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Ou=e(((e,t)=>{t.exports=Du()})),ku=e((e=>{var n=t(),r=Ou();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Au=e(((e,t)=>{t.exports=ku()})),ju=[],Mu=void 0;function Nu(){return Mu}function Pu(e){ju.push(e)}function Fu(e){let t=(t,n)=>{let r=St(Lu).current,i;try{Mu=r;for(let e of ju)e.before(r);i=e(t,n);for(let e of ju)e.after(r);r.didInitialize=!0}finally{Mu=void 0}return i};return t.displayName=e.displayName||e.name,t}function Iu(e){return K.forwardRef(Fu(e))}function Lu(){return{didInitialize:!1}}var Ru=Ou(),zu=i(Au(),1),Bu=Tt(19)?Uu:Wu;function Vu(e,t,n,r,i){return Bu(e,t,n,r,i)}function Hu(e,t,n,r,i){let a=K.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Ru.useSyncExternalStore)(e.subscribe,a,a)}Pu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Ru.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Uu(e,t,n,r,i){let a=Nu();if(!a)return Hu(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Wu(e,t,n,r,i){return(0,zu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Gu=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Vu(this,e,t,n,r)}},Ku=class extends Gu{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){K.useDebugValue(e);let n=this;W(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;W(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);W(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){K.useDebugValue(e);let n=this,r=t!==void 0;W(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return K.useDebugValue(e),Vu(this,this.selectors[e],t,n,r)}useContextCallback(e,t){K.useDebugValue(e);let n=U(t??Lt);this.context[e]=n}useStateSetter(e){let t=K.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},qu={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Ju=class extends Ku{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Kl(),nested:n,triggerElements:i},qu),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Vs(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Yu(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ju({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Pt,inactiveTriggerProps:Pt,popupProps:Pt}}var Q=e=>e.triggerIdProp??e.activeTriggerId,$=e=>e.openProp??e.open,Xu=e=>(e.popupElement?.id??e.floatingId)||void 0;function Zu(e,t){return t!==void 0&&$(e)&&Q(e)===t}function Qu(e,t){return Zu(e,t)?!0:t!==void 0&&$(e)&&Q(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var $u={open:$,mounted:e=>e.mounted,transitionStatus:e=>$(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Q,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Xu,isTriggerActive:(e,t)=>t!==void 0&&Q(e)===t,isOpenedByTrigger:(e,t)=>Zu(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Q(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Qu(e,t)?Xu(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ed(e){let t=K.useCallback(t=>e===void 0?Lt:e.subscribeStore(t),[e]),n=K.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Ru.useSyncExternalStore)(t,n,()=>e?.serverStore)}var td=Qo&&es;function nd(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=K.useRef(!1),s=K.useRef(null),c=K.useRef(!0),l=Fs();K.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=dt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&<(t)&&t===Hs(Jr(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return dc(Z(r,`blur`,i),td&&Z(r,`keydown`,a,!0),td&&Z(r,`pointerdown`,l,!0))},[e,n]),K.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);At(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=K.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Ws(n.nativeEvent);if(At(a)){if(td&&!n.relatedTarget){if(!c.current&&!tc(a))return}else if(!ic(a))return}let u=Qs(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,gs(Oo,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,gs(Oo,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=At(r)&&r.hasAttribute(Cl(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Hs(Jr(t));(r||n!==t)&&(X(a.current.floatingContext?.refs.floating.current,n)||X(t,n)||o||Qs(r??n,e.context.triggerElements)||e.setOpen(!1,gs(Oo,i)))})}}},[a,r,e,l]);return K.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var rd=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ps;restTimeout=new Ps;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},id=new WeakMap;function ad(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&id.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),id.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function od(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=id.get(n);a&&a!==e&&ad(a),ad(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,id.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function sd(e){let t=e.context.dataRef.current,n=St(()=>t.hoverInteractionState??rd.create()).current;return t.hoverInteractionState||=n,vs(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function cd(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Zl(),u=Xl(),d=sd(e),f=Fs(),p=U(()=>lc(c.current.openEvent?.type,d.interactedInside)),m=U(()=>uc(c.current.openEvent?.type)),h=U(()=>{ad(d)});W(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),K.useEffect(()=>h,[h]),W(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&At(s)&&o){let e=s,t=o,n=Jr(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Us(e,`[data-rootownerid]`)??n.body;return od(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),K.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&xl(l.nodesRef.current,u).length>0)}function a(t){let n=sc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,gs(Do,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Ws(e);nc(t)?d.interactedInside=Us(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Qs(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&At(o)&&xl(l.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,gs(Do,n)),l.events.emit(`floating.closed`,n)})}let y=o;return dc(y&&Z(y,`mouseenter`,g),y&&Z(y,`mouseleave`,_),y&&Z(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var ld={current:null};function ud(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ld,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Zl(l),v=sd(e),y=K.useRef(!1),b=fc(i),x=fc(r),S=fc(o),C=fc(n),w=fc(p),T=fc(f),E=U(()=>lc(h.current.openEvent?.type,v.interactedInside)),D=U(()=>w.current?.()!==!1),O=U((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!X(t,n);if(!At(r))return!1;let a=r;return i.hasMatchingElement(e=>X(e,a))&&(!t||!X(t,a))}),k=U(()=>{v.handler&&=(Jr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=U(()=>{ad(v)});return u&&(v.handleCloseOptions=i?.__options),K.useEffect(()=>k,[k]),K.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Do,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),K.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=sc(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,gs(Do,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,gs(Do,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!At(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Bs(v.pointerType))return;let n=cc(S.current),r=sc(x.current,`open`,v.pointerType),i=Ws(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(At(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(X(t,i)){c=t;break}}At(o)&&At(s)&&!e.context.triggerElements.hasElement(o)&&X(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&At(c)&&At(s)&&X(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,gs(Do,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,gs(Do,t,c))}):g&&D()&&e.setOpen(!0,gs(Do,t,c)))}function o(n){if(E()){A();return}k();let r=Jr(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Qs(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!X(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){X(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Z(r,`mouseout`,l):void 0;return s?dc(Z(r,`mousemove`,i,{once:!0}),Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f):dc(Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),K.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!Bs(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;od(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=cc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,gs(Do,n,r))}v.pointerType===`touch`?Es.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function dd(e){return es&&e.movementX===0&&e.movementY===0}function fd(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function pd(e,t){return fd(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function md(e,t,n){return fd(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function hd(e,t,n){return fd(t,n?e===qs:e===Js,e===Xs)}function gd(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:fd(t,n?e===Js:e===qs,e===Ys)}function _d(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=ac(E),A=rc(D),j=fc(k),M=Xl(),N=Zl(x),P=K.useRef(f),F=K.useRef(o??-1),ee=K.useRef(null),I=K.useRef(!0),L=U(e=>{i(F.current===-1?null:F.current,e)}),te=K.useRef(!!E),ne=K.useRef(T),re=K.useRef(!1),R=K.useRef(!1),ie=K.useRef(null),ae=fc(h),z=fc(T),oe=fc(o),se=fc(b),ce=Ss(),B=Ss(),V=U(()=>{ce.cancel();function e(e){d||(ie.current=Tl(e,{sync:re.current,preventScroll:!0}))}let t=n.current[F.current],r=R.current;t&&e(t),(re.current?e=>e():e=>ce.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});W(()=>{O.current.orientation=g},[O,g]),W(()=>{T||(ee.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),W(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(R.current=!0,L())):te.current&&(F.current=-1,L()))},[a,T,E,o,L]),W(()=>{if(a){if(!T)re.current=!1;else if(E){if(r==null){if(re.current=!1,oe.current!=null)return;if(te.current&&(F.current=-1,V()),(!ne.current||!te.current)&&P.current&&(ee.current!=null||P.current===!0&&ee.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>B.request(e):queueMicrotask)(t),e+=1):(F.current=ee.current==null||md(ee.current,_,u)||l?Gc(n):Kc(n),ee.current=null,L())};t()}}else Wc(n.current,r)||(F.current=r,V(),R.current=!1)}}},[a,T,E,r,oe,l,n,_,u,L,V,B]),W(()=>{if(!a||E||!N||d||!te.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=Hs(Jr(D??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),W(()=>{ne.current=T,te.current=!!E});let H=r!=null,le=U(e=>{if(!z.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,L(e))}),ue=U(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=U(()=>Gc(n,ae.current)),fe=U(t=>{if(I.current=!1,re.current=!0,t.which===229||!z.current&&t.currentTarget===j.current)return;if(l&&gd(t.key,g,u,w)){pd(t.key,ue())||Is(t),e.setOpen(!1,gs(No,t.nativeEvent));let n=S?.current??D;lt(n)&&n.focus();return}r!=null&&r!==F.current&&!Wc(n.current,r)&&(F.current=r);let i=F.current,a=Gc(n,h),o=Kc(n,h);if(A||(t.key===`Home`&&(Is(t),F.current=a,L(t)),t.key===`End`&&(Is(t),F.current=o,L(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,L(t)),g===`both`)return}if(pd(t.key,g)){Is(t);let e=Hs(t.currentTarget.ownerDocument);if(T&&!d&&X(t.currentTarget,e)&&!n.current.some(t=>t!=null&&X(t,e))){F.current=md(t.key,g,u)?a:o,L(t),r===F.current&&V();return}let{index:l,wrapped:f}=qc(n.current,i,{decrement:!md(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(re.current=!1),F.current=l,L(t)}}),pe=K.useMemo(()=>({onFocus(e){re.current=!0,le(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){dd(e)||(re.current=!0,R.current=!1,p&&le(e))},onPointerLeave(e){if(!z.current||!I.current||e.pointerType===`touch`)return;re.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&se.current&&(ie.current?.(),ie.current=null,F.current=-1,L(e),!d)){let e=j.current,t=Hs(Jr(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[le,z,j,p,n,L,se,d]),me=K.useMemo(()=>d&&T&&H&&{"aria-activedescendant":`${y}-${r}`},[d,T,H,y,r]),he=K.useMemo(()=>({...A?{}:me,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=Ws(t.nativeEvent);if(n&&!X(j.current,n))return;Is(t);let r=gs(jo,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&<(i)&&i.focus()}else fe(t)},onPointerMove(e){dd(e)||(I.current=!0)}}),[me,fe,j,A,e,T,d,D,S]),ge=K.useMemo(()=>{function t(t){e.setOpen(!0,gs(No,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Rs(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&zs(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);I.current=!1;let i=n.key.startsWith(`Arrow`),a=hd(n.key,ue(),u),o=pd(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||tc(n.currentTarget)))return fe(n);if(r||m||!i){if(s){let e=pd(n.key,ue());ee.current=l&&e?null:n.key}l?a&&(Is(n),r?(F.current=de(),L(n),d&&j.current?.focus()):t(n)):o&&(oe.current!=null&&(F.current=oe.current),Is(n),!r&&m?t(n):fe(n),r&&L(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,L(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[fe,f,de,l,L,e,m,g,_,ue,u,oe,d,j]),_e=K.useMemo(()=>({...me,...ge}),[me,ge]);return K.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function vd(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=U(s),f=e.useState(`open`),p=Fs(),m=K.useRef(``),h=K.useRef(u??i??-1),g=K.useRef(null),_=U(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Zc(n)||n?.matches(`:disabled`)?!1:o==null||!Yc(Ct,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Is(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Is(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=U(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);X(r,n)||X(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});W(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=K.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return K.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var yd=.1,bd=yd*yd,xd=.5;function Sd(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Cd(e,t,n,r,i,a,o,s,c,l){let u=!1;return Sd(e,t,n,r,i,a)&&(u=!u),Sd(e,t,i,a,o,s)&&(u=!u),Sd(e,t,o,s,c,l)&&(u=!u),Sd(e,t,c,l,n,r)&&(u=!u),u}function wd(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Td(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Ed(e={}){let{blockPointerEvents:t=!1}=e,n=new Ps,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*bd;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Ws(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&At(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&xl(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Td(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Td(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Td(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Td(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!wd(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?xd/2:xd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+xd+1,o=C||T?S.bottom-xd:S.top,s=C?T?S.bottom-xd:S.top:S.bottom-xd;M=Cd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?xd/2:xd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-xd,o=C||T?S.top+xd:S.bottom,s=C?T?S.top+xd:S.bottom:S.top+xd;M=Cd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?xd/2:xd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+xd+1,o=w||E?S.right-xd:S.left,s=w?E?S.right-xd:S.left:S.right-xd;M=Cd(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?xd/2:xd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-xd,o=w||E?S.left+xd:S.right,s=w?E?S.left+xd:S.right:S.left+xd;M=Cd(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Dd(e,t,n){let{reference:r,floating:i}=e,a=kc(t),o=Ac(t),s=Oc(o),c=Tc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ec(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Od(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=wc(t,e),p=Hc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Uc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Uc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var kd=50,Ad=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Od},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Dd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<kd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Dd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},jd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Tc(r),_=kc(o),v=Tc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bc(o)]:Mc(o)),x=p!==`none`;!d&&x&&b.push(...zc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=jc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===kc(t)||T.every(e=>kc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=kc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Md=new Set([`left`,`top`]);async function Nd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Tc(n),s=Ec(n),c=kc(n)===`y`,l=Md.has(o)?-1:1,u=a&&c?-1:1,d=wc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Pd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Nd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Fd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=wc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=kc(i),p=Dc(f),m=u[p],h=u[f],g=(e,t)=>Cc(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Id=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=wc(e,t),u={x:n,y:r},d=kc(i),f=Dc(d),p=u[f],m=u[d],h=wc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Md.has(Tc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ld=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=wc(e,t),c=await i.detectOverflow(t,s),l=Tc(n),u=Ec(n),d=kc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=_c(p-c[m],g),y=_c(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*vc(c.left,c.right):S=p-2*vc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Rd(e){let t=Ht(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=lt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=yc(n)!==a||yc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zd(e){return At(e)?e:e.contextElement}function Bd(e){let t=zd(e);if(!lt(t))return xc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Rd(t),o=(a?yc(n.width):n.width)/r,s=(a?yc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Vd=xc(0);function Hd(e){let t=dt(e);return!ht()||!t.visualViewport?Vd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ud(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===dt(e)}function Wd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zd(e),o=xc(1);t&&(r?At(r)&&(o=Bd(r)):o=Bd(e));let s=Ud(a,n,r)?Hd(a):xc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=dt(a),t=At(r)?dt(r):r,n=e,i=bt(n);for(;i&&t!==n;){let e=Bd(i),t=i.getBoundingClientRect(),r=Ht(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=dt(i),i=bt(n)}}return Uc({width:u,height:d,x:c,y:l})}function Gd(e,t){let n=Bt(e).scrollLeft;return t?t.left+n:Wd(Vt(e)).left+n}function Kd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gd(e,n),y:n.top+t.scrollTop}}function qd(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vt(r),s=t?mt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xc(1),u=xc(0),d=lt(r);if((d||!a)&&((ut(r)!==`body`||_t(o))&&(c=Bt(r)),d)){let e=Wd(r);l=Bd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Kd(o,c):xc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Jd(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Yd(e){let t=Bt(e),n=e.ownerDocument.body,r=vc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=vc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Gd(e),o=-t.scrollTop;return Ht(n).direction===`rtl`&&(a+=vc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xd=25;function Zd(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=dt(e),a=Vt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ht()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Gd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xd&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qd(e,t){let n=Wd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Bd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $d(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Zd(e,n,t);else if(t===`document`)r=Yd(Vt(e));else if(At(t))r=Qd(t,n);else{let n=Hd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Uc(r)}function ef(e,t){let n=t.get(e);if(n)return n;let r=xt(e,[],!1).filter(e=>At(e)&&ut(e)!==`body`),i=null,a=Ht(e).position===`fixed`,o=a?ft(e):e;for(;At(o)&&!kt(o);){let e=Ht(o),t=vt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ft(o)}return t.set(e,r),r}function tf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?mt(t)?[]:ef(t,this._c):[].concat(n),r],o=$d(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$d(t,a[e],i);s=vc(n.top,s),c=_c(n.right,c),l=_c(n.bottom,l),u=vc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nf(e){let{width:t,height:n}=Rd(e);return{width:t,height:n}}function rf(e,t,n){let r=lt(t),i=Vt(t),a=n===`fixed`,o=Wd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xc(0);if((r||!a)&&((ut(t)!==`body`||_t(i))&&(s=Bt(t)),r)){let e=Wd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Gd(i));let l=i&&!r&&!a?Kd(i,s):xc(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function af(e){return Ht(e).position===`static`}function of(e,t){if(!lt(e)||Ht(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vt(e)===n&&(n=n.ownerDocument.body),n}function sf(e,t){let n=dt(e);if(mt(e))return n;if(!lt(e)){let t=ft(e);for(;t&&!kt(t);){if(At(t)&&!af(t))return t;t=ft(t)}return n}let r=of(e,t);for(;r&&pt(r)&&af(r);)r=of(r,t);return r&&kt(r)&&af(r)&&!vt(r)?n:r||wt(e)||n}var cf=async function(e){let t=this.getOffsetParent||sf,n=this.getDimensions,r=await n(e.floating);return{reference:rf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lf(e){return Ht(e).direction===`rtl`}var uf={convertOffsetParentRelativeRectToViewportRelativeRect:qd,getDocumentElement:Vt,getClippingRect:tf,getOffsetParent:sf,getElementRects:cf,getClientRects:Jd,getDimensions:nf,getScale:Bd,isElement:At,isRTL:lf};function df(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ff(e,t,n){let r=null,i,a=Vt(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=bc(d),h=bc(a.clientWidth-(u+f)),g=bc(a.clientHeight-(d+p)),_=bc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vc(0,_c(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!df(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=dt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=zd(e),u=i||a?[...l?xt(l):[],...t?xt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ff(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wd(e):null;c&&g();function g(){let t=Wd(e);h&&!df(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var mf=Pd,hf=Fd,gf=jd,_f=Ld,vf=Id,yf=(e,t,n)=>{let r=new Map,i=n??{},a={...uf,...i.platform,_c:r};return Ad(e,t,{...i,platform:a})},bf=typeof document<`u`?K.useLayoutEffect:function(){};function xf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cf(e,t){let n=Sf(e);return Math.round(t*n)/n}function wf(e){let t=K.useRef(e);return bf(()=>{t.current=e}),t}function Tf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=K.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=K.useState(r);xf(f,r)||p(r);let[m,h]=K.useState(null),[g,_]=K.useState(null),v=K.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=K.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K.useRef(null),C=K.useRef(null),w=K.useRef(u),T=c!=null,E=wf(c),D=wf(i),O=wf(l),k=K.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!xf(w.current,t)&&(w.current=t,Es.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bf(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K.useRef(!1);bf(()=>(A.current=!0,()=>{A.current=!1}),[]),bf(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=K.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=K.useMemo(()=>({reference:b,floating:x}),[b,x]),N=K.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Cf(M.floating,u.x),r=Cf(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sf(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return K.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ef=(e,t)=>{let n=mf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Df=(e,t)=>{let n=hf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Of=(e,t)=>({fn:vf(e).fn,options:[e,t]}),kf=(e,t)=>{let n=gf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Af=(e,t)=>{let n=_f(e);return{name:n.name,fn:n.fn,options:[e,t]}},jf=K.createContext(void 0);function Mf(e){let t=K.useContext(jf);if(t===void 0&&!e)throw Error(Ft(69));return t}var Nf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Pf(e){return e===`starting`?Ll:Pt}var Ff=K.createContext(void 0);function If(){return K.useContext(Ff)}function Lf(e,t){let n=It(e.render);if(K.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Rf(e,t,n){let r=Lf(e,t),i=r===t?void 0:r;return[r,K.useCallback(e=>n?.(e?i:void 0),[i,n])]}function zf(e,t,n){let r=It(e.render),i=K.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Bf=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=io(),m=If(),{side:h,align:g}=no(),_=Mf(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,ee]=Rf(e,u,d),I=zf(e,C,N),L=w.type===`menu`?m:void 0,te=w.type===`context-menu`,ne=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(ne=()=>l.state.activeIndex===null&&P),As({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),K.useEffect(()=>{function e(e){l.setOpen(!1,gs(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),cd(D,{enabled:A&&!j&&!te&&w.type!==`menubar`,closeDelay:k});let re=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:R,handleFocus:ie}=(K.useContext(Ro)?.useParentHandoff??Hf)(l,w,v,f),ae={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},z=Ot(`div`,e,{state:ae,ref:[t,l.context.popupRef,re,ee],stateAttributesMapping:So,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":I},onKeyDown(e){L?.onPopupKeyDown?.(e),_&&Nf.has(e.key)&&e.stopPropagation()},onFocus:ie},Pf(y),c,{"data-rootownerid":E}]}),oe=w.type===void 0||te;(C||w.type===`menubar`&&T!==`outside-press`)&&(oe=!0);let se=L?.getReturnElement??R;return(0,q.jsx)(lu,{context:D,openInteractionType:M,modal:te,disabled:!x,returnFocus:a??se??oe,explicitReturnFocus:a===void 0&&se?!1:void 0,initialFocus:ne,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:z})}),Vf={parentVirtualFocusRef:void 0,handleFocus:void 0};function Hf(){return Vf}var Uf=K.forwardRef(function(e,t){let n=zo()?.Popup??Bf;return(0,q.jsx)(n,{...e,ref:t})}),Wf=K.createContext(void 0);function Gf(){let e=K.useContext(Wf);if(e===void 0)throw Error(Ft(32));return e}var Kf=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=io();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,q.jsx)(Wf.Provider,{value:n,children:(0,q.jsx)(Gl,{ref:t,...r,portalOwnerRole:o})})});function qf(e){return Tt(19)?e:e?`true`:void 0}function Jf(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=K.useState(null),d=K.useRef(null),f=Zl(n),p=K.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Tf({...e,elements:{...p,...l&&{reference:l}}}),h=K.useCallback(e=>{let t=At(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=K.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=K.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=K.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return W(()=>{o&&(d.current=o)},[o]),W(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),K.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var Yf=K.createContext(void 0);function Xf(){return K.useContext(Yf)?.direction??`ltr`}var Zf=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wc(e,t)||{};if(l==null)return{};let d=Hc(u),f={x:n,y:r},p=Ac(i),m=Oc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Cc(D,k,O),j=!c.arrow&&Ec(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Qf=(e,t)=>{let{name:n,fn:r}=Zf(e);return{name:n,fn:r,options:[e,t]}},$f={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},ep={sideX:`left`,sideY:`top`},tp=`--available-width`,np=`--available-height`,rp=`--anchor-width`,ip=`--anchor-height`,ap=`--transform-origin`,op=tp,sp=np;function cp(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function lp(e,t,n){let{rects:r,placement:i}=e;return{side:cp(t,Tc(i),n),align:Ec(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function up(e){return dp(e,Jf)}function dp(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=U(O),A=O?k:n,j=fc(n),M=fc(g),N=Xf()===`rtl`,[P,F]=K.useState(null);!g&&P!==null&&F(null);let ee=x===`placement`,I=P?Tc(P):null,L=P&&ee?Ec(P)||`center`:null,te=I||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],ne=L||o,re=ne===`center`?te:`${te}-${ne}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let ie=+(i===`bottom`),ae=+(i===`top`),z=+(i===`right`),oe=+(i===`left`),se={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},ce=K.useRef(null),B=fc(a),V=fc(s),H=typeof a==`function`?0:a,le=typeof s==`function`?0:s,ue=[];p&&ue.push(p),ue.push(Ef(e=>{let t=lp(e,i,N),n=typeof B.current==`function`?B.current(t):B.current,r=typeof V.current==`function`?V.current(t):V.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[H,le,N,i]));let de=w===`none`&&C!==`shift`,fe=!de&&(u||E||C===`shift`),pe=C===`none`?null:kf({...se,padding:{top:R.top+1+ie,right:R.right+1+oe,bottom:R.bottom+1+ae,left:R.left+1+z},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),me=de?null:Df({...se,rootBoundary:D,mainAxis:w!==`none`,crossAxis:fe,limiter:u||E?void 0:Of(e=>{if(!ce.current)return{};let{width:t,height:n}=ce.current.getBoundingClientRect(),r=kc(Tc(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[se,u,E,D,R,w]);C===`shift`||w===`shift`||ne===`center`?ue.push(me,pe):ue.push(pe,me),ue.push(Af({...se,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(op,`${t}px`),i.setProperty(sp,`${n}px`);let a=dt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(rp,`${u}px`),i.setProperty(ip,`${d}px`)}}),Qf(e=>({element:ce.current||Jr(e.elements.floating).createElement(`div`),padding:ce.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Tc(r),u=Ec(r),d=kc(l)===`y`,f=ce.current,p=typeof a==`function`?a(lp(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(ap,d?`${m} ${h}`:`${h} ${m}`),{}}},$f,b),W(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let he=K.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:ge,elements:_e,x:ve,y:ye,middlewareData:be,update:xe,placement:Se,context:Ce,isPositioned:we,floatingStyles:Te}=t({rootContext:h,open:m?g:void 0,placement:re,middleware:ue,strategy:r,whileElementsMounted:m?void 0:(...e)=>pf(...e,he),nodeId:y,externalTree:S}),{sideX:Ee,sideY:De}=be.adaptiveOrigin||ep,Oe=we?r:`fixed`,ke=K.useMemo(()=>{let e;return e=we?b?{position:Oe,[Ee]:ve,[De]:ye}:{...Te,position:Oe}:{position:Oe,top:0,left:0},e[op]=`100vw`,e[sp]=`100vh`,we||(e.opacity=0),e},[b,Oe,Ee,ve,De,ye,Te,we]),Ae=K.useRef(null);W(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(fp(t)?t.current:t)||null;n!==Ae.current&&(ge.setPositionReference(n),Ae.current=n)},[g,ge,A,j]),K.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&fp(e)&&e.current!==Ae.current&&(ge.setPositionReference(e.current),Ae.current=e.current)},[g,ge,A,j]),K.useEffect(()=>{if(m&&g&&_e.reference&&_e.floating)return pf(_e.reference,_e.floating,xe,he)},[m,g,_e,xe,he]);let je=Tc(Se),Me=cp(i,je,N),Ne=Ec(Se)||`center`,Pe=!!be.hide?.referenceHidden;W(()=>{x&&g&&we&&(je!==te||ee&&Ne!==ne)&&F(Se)},[x,ee,g,we,Se,je,Ne,te,ne]);let Fe=K.useMemo(()=>({position:`absolute`,top:be.arrow?.y,left:be.arrow?.x}),[be.arrow]),Ie=be.arrow?.centerOffset!==0;return K.useMemo(()=>({positionerStyles:ke,arrowStyles:Fe,arrowRef:ce,arrowUncentered:Ie,side:Me,align:Ne,physicalSide:je,anchorHidden:Pe,refs:ge,context:Ce,isPositioned:we,update:xe}),[ke,Fe,ce,Ie,Me,Ne,je,Pe,ge,Ce,we,xe])}function fp(e){return e!=null&&`current`in e}function pp(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=U(i),[,o]=K.useState(0),s=St(hp).current,c=St(mp).current,l=K.useRef(0),u=K.useRef(!0),d=K.useRef(null),f=K.useRef(null),p=U(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=U((e,t)=>{c.set(e,t),p()}),h=U(e=>{c.delete(e),p()}),g=U(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!vp(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&yp(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=_p(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=U(()=>{let[e,t]=gp(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});W(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),W(()=>{u.current&&v()}),W(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=U(e=>(s.add(e),()=>{s.delete(e)})),b=K.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,q.jsx)(ss.Provider,{value:b,children:t})}function mp(){return new Map}function hp(){return new Set}function gp(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>yp(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function _p(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function vp(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function yp(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var bp=K.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function xp(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=K.useRef(null),o=K.useRef(null),s=ks(r);W(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),W(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Sp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Ot(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Pf(r),i],stateAttributesMapping:xo})}var Cp={},wp={},Tp=``;function Ep(e,t){return _t(e)?e:t}function Dp(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ep(t,n)).overflowY)}function Op(e){if(typeof document>`u`)return!1;let t=Jr(e);return dt(t).innerWidth-t.documentElement.clientWidth>0}function kp(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Jr(e),n=t.documentElement,r=t.body,i=Ep(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ap(e){let t=Jr(e),n=t.documentElement,r=t.body,i=Ep(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function jp(e){let t=Jr(e),n=t.documentElement,r=t.body,i=dt(n),a=0,o=0,s=!1,c=xs.create();if(es&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Cp={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Tp=n.style.scrollBehavior,wp={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Ep(n,r);s=kp(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Cp),Object.assign(r.style,wp),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Tp)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Mp=new class{lockCount=0;restore=null;timeoutLock=Ps.create();timeoutUnlock=Ps.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Jr(e),n=t.documentElement,r=t.body,i=dt(n);if(Dp(i,n,r)){let t=new i.MutationObserver(()=>{Dp(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Yo||!Op(e);this.restore=a?Ap(e):jp(e)}};function Np(e=!0,t=null){W(()=>{if(e)return Mp.acquire(t)},[e,t])}var Pp=20;function Fp(e,t,n,r){let[i,a]=K.useState(!1);W(()=>{if(!e||!t||n==null){a(!1);return}let r=Jr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Pp)},[e,t,n]),Np(e&&(!t||i),r)}var Ip=K.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Rl,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=io(),x=Gf(),S=wo(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),ee=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=w.useState(`domReferenceElement`),te=n,ne=c,re=l,R=s,ie=h;C.type===`context-menu`&&(te=n??C.context?.anchor,R??=`start`,!o&&R!==`center`&&(re=e.alignOffset??2,ne=e.sideOffset??-5));let ae=o,z=R;C.type===`menu`?(ae??=`inline-end`,z??=`start`,ie=e.collisionAvoidance??zl):C.type===`menubar`&&(ae??=C.context.orientation===`vertical`?`inline-end`:`bottom`,z??=`start`);let oe=C.type===`context-menu`,se=up({anchor:te,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ae,sideOffset:ne,align:z,alignOffset:re,arrowPadding:oe?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:ee,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:ie,shift:oe?{crossAxis:!(`side`in ie&&ie.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});K.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===ee&&v.set(`hoverEnabled`,!1),e.nodeId!==ee&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,gs(Io)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,ee]),K.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,gs(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ce=Fs();K.useEffect(()=>{D||ce.clear()},[D,ce]),K.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ce.isStarted()||ce.start(e,()=>{v.setOpen(!1,gs(Io))}):v.setOpen(!1,gs(Io))}else ce.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ce]),K.useEffect(()=>{let e={open:D,nodeId:ee,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,ee,I]),xp({store:v,domReference:L,positionerElement:M,open:D});let B={open:D,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:C.type===`menu`,instant:N},V=C.type===`menubar`&&C.context.modal;Fp(D&&(V||O&&F!==`trigger-hover`),k===`touch`,M,A);let H=Sp(e,B,{styles:se.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),le=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ue=null;return C.type===`menubar`?ue=C.context.contentElement:C.type===void 0&&(ue=A),(0,q.jsxs)(to.Provider,{value:se,children:[le&&(0,q.jsx)(bp,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:qf(!D),cutout:ue}),(0,q.jsx)($l,{id:ee,children:(0,q.jsx)(pp,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:H})})]})}),Lp=K.createContext(null);function Rp(e){let t=K.useContext(Lp);if(t===null&&!e)throw Error(Ft(5));return t}function zp(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Bp(e,t){let n=K.useRef(e),r=U(t);W(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Vp(e,t){let{onClick:n,onPointerDown:r}=zp(U((n,r)=>{(typeof e==`function`?e():e)||t(r||(Yo?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Hp(e){let[t,n]=K.useState(null),r=Vp(e,n);return Bp(e,t=>{t&&!e&&n(null)}),K.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Up(e){return e==null?To:e.type.startsWith(`key`)?Po:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Y:To}var Wp={...$u,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=$u.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>es&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!$u.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Gp=class extends Ku{constructor(e,t,n=!1){let r=new Eu,i=qp(r,t,n,e);super(i,Kp(r),Wp),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Kp(e){return{positionerRef:K.createRef(),popupRef:K.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:K.createRef(),beforeTriggerFocusGuardRef:K.createRef(),beforeContentFocusGuardRef:K.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function qp(e,t,n=!1,r){return{...Yu(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Pt,inputProps:Pt,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ql,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Pt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Jp=K.createContext(null);function Yp(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Xp(e,t){return e===`list-navigation`||Yp(e,t)}var Zp=Fu(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=wo(!0),C=io(!0),w=Rp(!0),T=C?.store,E=C?.virtualFocus??!1,D=K.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=hs(),k=hs(),[A,j]=K.useState(void 0),M=(A??k)||void 0,N=Xl(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,ee=St(()=>F?P?.state.instantType:void 0).current,I=St(()=>{let e=new Gp({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:ee},M,N!=null);return e.context.virtualFocusRef=y,e}).current;I.useControlledProp(`openProp`,n),I.useControlledProp(`triggerIdProp`,m),I.useContextCallback(`onOpenChangeComplete`,i);let L=I.useState(`floatingTreeRoot`),te=Ql(L),ne=I.useState(`open`),re=I.useState(`activeTriggerElement`),R=I.useState(`positionerElement`),ie=I.useState(`hoverEnabled`),ae=I.useState(`disabled`),z=I.useState(`lastOpenChangeReason`),oe=I.useState(`parent`),se=I.useState(`activeIndex`),ce=I.useState(`keyboardOpen`),B=I.useState(`payload`),V=I.useState(`floatingParentNodeId`),H=K.useRef(null),le=K.useRef(oe.type!==`context-menu`),ue=Fs(),de=K.useRef(!0),fe=Fs(),pe=V!=null,{openMethod:me,triggerProps:he}=Hp(ne);I.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:oe.type===void 0?c:void 0,openMethod:me,rootId:O}),Cu(I);let{forceUnmount:ge,transitionStatus:_e}=wu(ne,I,()=>{I.set(`allowMouseEnter`,!1)},F),ve=ks(I.context.popupRef);K.useEffect(()=>{if(ee===void 0)return;let e=()=>{I.state.instantType===ee&&I.set(`instantType`,void 0)};if(!ne){e();return}if(_e!==void 0)return;if(I.context.popupRef.current==null){e();return}let t=new AbortController;return ve(e,t.signal),()=>{t.abort()}},[ee,ne,_e,ve,I]),W(()=>{S&&!C?I.update({parent:{type:`context-menu`,context:S},floatingNodeId:te,floatingParentNodeId:N}):(C||!I.select(`activeTriggerElement`))&&I.update({floatingNodeId:te,floatingParentNodeId:N})},[S,C,te,N,re,I]),K.useEffect(()=>{ne||(H.current=null),oe.type===`context-menu`&&(ne?ue.start(500,()=>{le.current=!0}):(ue.clear(),le.current=!1))},[ue,ne,oe.type]),W(()=>{!ne&&!ie&&I.set(`hoverEnabled`,!0)},[ne,ie,I]);let ye=U((e,t)=>{let n=t.reason;if(!e&&!I.select(`open`)||ne===e&&t.trigger===re&&z===n)return;let i=xu(t);if(!e&&t.trigger==null&&(t.trigger=re??void 0),r?.(e,t),t.isCanceled)return;I.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);H.current=t.event;let s=bu(I.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Xp(n,a),s.instantType=oe.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Yp(n,a)?`click`:o?`dismiss`:void 0,I.update(s)}),be=mu({popupStore:I,floatingRootContext:I.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:ye}),xe=be.context.events;W(()=>{let e=({open:e,eventDetails:t})=>ye(e,t);return xe.on(`setOpen`,e),()=>{xe?.off(`setOpen`,e)}},[xe,ye]),W(()=>I.subscribeToParentMenu(),[I]);let Se=K.useCallback(()=>{I.setOpen(!1,gs(Lo))},[I]);K.useImperativeHandle(d,()=>({unmount:ge,close:Se}),[ge,Se]);let Ce;oe.type===`context-menu`&&(Ce=oe.context),K.useImperativeHandle(Ce?.positionerRef,()=>R,[R]),K.useImperativeHandle(Ce?.actionsRef,()=>({setOpen:ye}),[ye]);let we=pu(be,{enabled:!ae,bubbles:{escapeKey:f&&oe.type===`menu`},outsidePress(){return oe.type!==`context-menu`||H.current?.type===`contextmenu`||le.current},externalTree:pe?L:void 0}),Te=Xf(),Ee=_d(be,{enabled:!ae,listRef:I.context.itemDomElements,activeIndex:se,virtual:v,nested:oe.type===`menubar`||!v&&oe.type!==void 0,parentOrientation:oe.type===`menubar`?oe.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?ce:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:Te===`rtl`,disabledIndices:Ct,onNavigate(e,t){I.setActiveIndex(e,Up(t),t?.nativeEvent)},openOnArrowKeyDown:oe.type!==`context-menu`&&!(v&&_),externalTree:!v&&pe?L:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),De=K.useCallback(e=>{I.context.typingRef.current=e},[I]),Oe=vd(be,{enabled:!ae&&!v,listRef:I.context.itemLabels,elementsRef:I.context.itemDomElements,activeIndex:se,resetMs:500,onMatch:(e,t)=>{ne&&e!==se&&I.setActiveIndex(e,Po,t.nativeEvent)},onTyping:De}),ke=U(a),Ae=K.useRef(-1),je=U(()=>{let e=I.state.activeIndex,t=e===null?void 0:I.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&I.context.reportedItem===t)return;Ae.current=n,I.context.reportedItem=t,v&&I.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=I.context;I.context.highlightReason=To,I.context.highlightEvent=void 0,a&&ke(t,_s(r,i,{label:t===void 0?void 0:I.context.itemLabels.current[n]??void 0}))});W(()=>{je()},[se,je]);let Me=K.useMemo(()=>{if(!v)return Ee.reference;if(!Ee.trigger)return Pt;let{onFocus:e,...t}=Ee.trigger;return t},[v,Ee.reference,Ee.trigger]);I.useSyncedValue(`inputProps`,v?Ee.reference??Pt:Pt);let Ne=K.useMemo(()=>{let e=Mt(Oe.reference,Me,we.reference,{onMouseMove(){I.set(`allowMouseEnter`,!0)}},he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=ne,e},[I,Oe.reference,Me,we.reference,he,ne]),Pe=K.useMemo(()=>{let e=Mt(Ee.trigger,we.trigger,he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,we.trigger,he]);St(()=>(I.update({inactiveTriggerProps:Pe}),null)),Tu(I,{floatingRootContext:be,activeTriggerProps:Ne,inactiveTriggerProps:Pe,popupProps:K.useMemo(()=>Mt(gu,{onMouseMove(){I.set(`allowMouseEnter`,!0),oe.type===`menu`&&I.set(`hoverEnabled`,!1)},onClick(){I.select(`hoverEnabled`)&&I.set(`hoverEnabled`,!1)},onKeyDown(e){let t=I.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,we.floating),[oe.type,I,Oe.floating,Ee.floating,we.floating]),itemProps:Ee.item??Pt});let Fe=K.useMemo(()=>({store:I,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:je}),[I,D,u,l,b,k,v,E,je]),Ie=typeof t==`function`?t({payload:B}):t,Le=(0,q.jsxs)(ro.Provider,{value:Fe,children:[p&&(0,q.jsx)(_u,{handle:p,store:I}),Ie]});return(oe.type===void 0||oe.type===`context-menu`)&&(Le=(0,q.jsx)(eu,{externalTree:L,children:Le})),Le});function Qp(e){let t=K.useContext(Jp);if(t===null)return(0,q.jsx)(Zp,{...e});let n=t.Root;return(0,q.jsx)(Jp.Provider,{value:null,children:(0,q.jsx)(n,{...t.options,...e})})}var $p=5;function em(e,t){let n=tm(t);return e.clientX>=n.left-$p&&e.clientX<=n.right+$p&&e.clientY>=n.top-$p&&e.clientY<=n.bottom+$p}function tm(e){let t=e.getBoundingClientRect(),n=dt(e);if(ns)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function nm(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Dt(),{ref:i,index:a}=ls(e),o=n===a,s=K.useRef(null),c=jt(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function rm(e){let{render:t,className:n,style:r,state:i=Pt,props:a=Ct,refs:o=Ct,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=nm({metadata:s});return Ot(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function im(e){if(lt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!kt(e))return im(ft(e))}function am(e,t){function n(n,r,i){let a=n.currentTarget;Es.flushSync(()=>{e.setOpen(!1,gs(jo,n.nativeEvent,a))}),_l(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&vl(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function om(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=K.useRef(!1);return K.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Jr(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Pt,[t,n,r])}var sm=Iu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=io(!0),h=ed(d)??m?.store;if(!h)throw Error(Ft(85));let g=hs(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=K.useRef(null),S=lm(),C=Dt(!0),w=Zl(),T=K.useMemo(()=>w??new ql,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Su(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:Ql(T),floatingParentNodeId:Xl(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Rt({disabled:A,native:o});K.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=K.useRef(null),P=Fs(),F=U(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(N.current,t)||X(h.select(`positionerElement`),t)||t===N.current||(t==null||im(t)!==h.select(`rootId`))&&(em(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:Fo}))});K.useEffect(()=>{let e=Jr(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let ee=O&&S.context.hasSubmenuOpen,I=ud(v,{enabled:(c??ee)&&!A&&(!O||ee&&!D),handleClose:Ed({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),L=cm(y,h.select(`lastOpenChangeReason`)),te=uu(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&L}),ne=nd(v,{enabled:!A&&ee}),re=om({open:y,enabled:O,mouseDownAction:`open`}),R=K.useMemo(()=>Mt(ne.reference,te.reference),[ne.reference,te.reference]),ie=h.useState(`triggerProps`,D),ae=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:z,handleFocusTargetFocus:oe}=am(h,x),se={disabled:A,open:y},ce=[N,t,M,E,x],B=[R,I??Pt,ie,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Jr(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},ae,O?{role:`menuitem`}:{},re,p,j],V=Ot(`button`,e,{enabled:!O,stateAttributesMapping:bo,state:se,ref:ce,props:B});return O?(0,q.jsx)(rm,{tag:`button`,render:n,className:r,style:i,state:se,refs:ce,props:B,stateAttributesMapping:bo}):y?(0,q.jsxs)(K.Fragment,{children:[(0,q.jsx)(gc,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:z},`${g}-pre-focus-guard`),(0,q.jsx)(K.Fragment,{children:V},g),(0,q.jsx)(gc,{ref:h.context.triggerFocusTargetRef,onFocus:oe},`${g}-post-focus-guard`)]}):(0,q.jsx)(K.Fragment,{children:V},g)});function cm(e,t){let n=Fs(),[r,i]=K.useState(!1);return W(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function lm(){let e=Rp(!0);return K.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function um({label:e,actions:t}){let n=(0,K.useSyncExternalStore)(qt,Kt),r=n===`unreachable`||n===`retrying`;return(0,q.jsxs)(Qp,{children:[(0,q.jsx)(sm,{"aria-label":e,title:`More actions`,className:Nt({variant:`outline`,size:`icon-xs`}),children:(0,q.jsx)(Un,{})}),(0,q.jsx)(Kf,{children:(0,q.jsx)(Ip,{side:`bottom`,align:`end`,sideOffset:4,className:`z-50`,children:(0,q.jsx)(Uf,{"aria-label":e,finalFocus:()=>!(document.activeElement instanceof HTMLElement&&document.activeElement.matches(`input, textarea, select`)),className:`flex min-w-44 flex-col rounded-lg border bg-popover p-1 text-sm text-popover-foreground shadow-lg outline-none`,children:t.map(e=>(0,q.jsxs)(Ms,{"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled||e.changesData&&r,onClick:e.onSelect,className:a(`flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-muted max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0`,e.destructive?`text-destructive data-[highlighted]:bg-destructive/10 dark:data-[highlighted]:bg-destructive/20`:`[&_svg]:text-muted-foreground`),children:[e.icon,e.label]},e.key))})})})]})}var dm={completed:`Completed`,opened_for_review:Xr.in_review,started:`Started`,worked_on:`Worked on`,planned:`Planned`},fm=Object.keys(dm),pm={week:`week`,month:`month`,quarter:`quarter`,year:`year`,custom:`period`},mm={week:`Week review`,month:`Month review`,quarter:`Quarter review`,year:`Year review`,custom:`Review`};function hm(e){let[t,n,r]=e.split(`-`).map(Number);return[t,n-1,r]}function gm(e,t=0){let[n,r,i]=hm(e);return new Date(n,r,i+t)}function _m(e){return li(e.getTime()/1e3)}function vm(e){let t=(e.getDay()+6)%7;return _m(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t))}function ym(e,t){return _m(gm(e,t))}function bm(e){return{kind:`week`,from:e,to:ym(e,6)}}var xm={month:1,quarter:3,year:12};function Sm(e,t,n){let r=xm[e];return{kind:e,from:_m(new Date(t,n,1)),to:_m(new Date(t,n+r,0))}}function Cm(e,t){let[n,r]=hm(t);switch(e){case`week`:return bm(vm(gm(t)));case`month`:return Sm(e,n,r);case`quarter`:return Sm(e,n,r-r%3);case`year`:return Sm(e,n,0);case`custom`:return{kind:e,from:t,to:t}}}function wm(e,t){switch(e.kind){case`week`:return bm(ym(e.from,7*t));case`month`:case`quarter`:case`year`:{let[n,r]=hm(e.from);return Sm(e.kind,n,r+xm[e.kind]*t)}case`custom`:{let n=Tm(e);return{kind:`custom`,from:ym(e.from,n*t),to:ym(e.to,n*t)}}}}function Tm(e){return Math.round((gm(e.to,1).getTime()-gm(e.from).getTime())/864e5)}function Em(e){return{start:gm(e.from).getTime()/1e3,end:gm(e.to,1).getTime()/1e3}}function Dm(e){let[t,n]=hm(e.from);switch(e.kind){case`month`:return e.from.slice(0,7);case`quarter`:return`${t} Q${Math.floor(n/3)+1}`;case`year`:return String(t);case`week`:case`custom`:return`${e.from} to ${e.to}`}}function Om(e){return fm.flatMap(t=>{let n=e.filter(e=>e.outcome===t);return n.length===0?[]:[{outcome:t,entries:n}]})}function km(e){return e.split(`
|
|
10
|
+
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&tn(e,``+r);else return;break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);return;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=dn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=ln.get(n)||n,zt(e,n,r);else return}G=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:on(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)tn(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[_t]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}G=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}return}G=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,o,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:ep(e,t,r,d,n,null)}}Xt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Bf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Qt(e,!!r,n,!0):Qt(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:ep(e,t,s,c,n,null)}en(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(G=!0),o=m;break;case`name`:m!==f&&(G=!0),i=m;break;case`checked`:m!==f&&(G=!0),u=m;break;case`defaultChecked`:m!==f&&(G=!0),d=m;break;case`value`:m!==f&&(G=!0),s=m;break;case`defaultValue`:m!==f&&(G=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Yt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(G=!0),p=o;break;case`defaultValue`:o!==l&&(G=!0),c=o;break;case`multiple`:o!==l&&(G=!0),s=o;default:o!==l&&ep(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Qt(e,!!n,n?[]:``,!1):Qt(e,!!n,t,!0)):Qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(G=!0),p=i;break;case`defaultValue`:i!==o&&(G=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ep(e,t,s,i,r,o)}$t(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(G=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[gt]=r,n[_t]=t,np(n,e,t),Ot(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),Tt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=V.d;V.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){kt(o)}),Ot(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=W(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ot(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=W(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ot(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=W(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ot(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=ge.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=W(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=W(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=W(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+Jt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=kt.bind(null,t),np(t,`link`,n),Ot(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Jt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Ot(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ot(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[gt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=wi(3,null,null,t),e.current=a,a.stateNode=e,t=wa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},oo(a),e}function uh(e){return e?(e=Si,e):Si}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=lo(e,r,t),n!==null&&(jd(n,e,t),uo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=yi(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=dt(t);var n=yi(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=B.T;B.T=null;var a=V.p;try{V.p=2,yh(e,t,n,r)}finally{V.p=a,B.T=i}}function vh(e,t,n,r){var i=B.T;B.T=null;var a=V.p;try{V.p=8,yh(e,t,n,r)}finally{V.p=a,B.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Ju&6)&&(pd=Pe()+500,Tf(0,!1))}}break;case 31:case 13:s=yi(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=mn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Et(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Et(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,mt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Dt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,t){e.blockedOn===t&&(e.blockedOn=null,wh||(wh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[vt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:B,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ue=Jh.inject(qh),We=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=hc,s=gc,c=_c;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[vt]=t.current,Uf(e),new Wh(t)}})),ln=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=cn()})),un={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};un.node;var dn=n(un),fn={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};fn.node;var pn=n(fn),mn={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};mn.node;var hn=n(mn),gn={name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]};gn.node;var _n=n(gn),vn={name:`chart-column`,size:24,node:[[`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`}]],aliases:[`bar-chart-3`]};vn.node;var yn=n(vn),bn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};bn.node;var xn=n(bn),Sn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Sn.node;var Cn=n(Sn),wn={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};wn.node;var Tn=n(wn),En={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};En.node;var Dn=n(En),On={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};On.node;var kn=n(On),An={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};An.node;var jn=n(An),Mn={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Mn.node;var Nn=n(Mn),Pn={name:`copy`,size:24,node:[[`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`}]]};Pn.node;var Fn=n(Pn),In={name:`crosshair`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]};In.node;var Ln=n(In),Rn={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};Rn.node;var zn=n(Rn),Bn={name:`download`,size:24,node:[[`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`}]]};Bn.node;var Vn=n(Bn),Hn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Hn.node;var Un=n(Hn),Wn={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Wn.node;var Gn=n(Wn),Kn={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};Kn.node;var qn=n(Kn),Jn={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Jn.node;var Yn=n(Jn),Xn={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};Xn.node;var Zn=n(Xn),Qn={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Qn.node;var $n=n(Qn),er={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};er.node;var tr=n(er),nr={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};nr.node;var rr=n(nr),ir={name:`layers`,size:24,node:[[`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`}]],aliases:[`layers-3`]};ir.node;var ar=n(ir),or={name:`list-todo`,size:24,node:[[`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`}]]};or.node;var sr=n(or),cr={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};cr.node;var lr=n(cr),ur={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};ur.node;var dr=n(ur),fr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};fr.node;var pr=n(fr),mr={name:`moon`,size:24,node:[[`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`}]]};mr.node;var hr=n(mr),gr={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};gr.node;var _r=n(gr),vr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};vr.node;var yr=n(vr),br={name:`pencil`,size:24,node:[[`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`}]]};br.node;var xr=n(br),Sr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Sr.node;var Cr=n(Sr),wr={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};wr.node;var Tr=n(wr),Er={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Er.node;var Dr=n(Er),Or={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Or.node;var kr=n(Or),Ar={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Ar.node;var jr=n(Ar),Mr={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Mr.node;var Nr=n(Mr),Pr={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};Pr.node;var Fr=n(Pr),Ir={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ir.node;var Lr=n(Ir),Rr={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Rr.node;var zr=n(Rr),Br={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};Br.node;var Vr=n(Br),Hr={name:`sun`,size:24,node:[[`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`}]]};Hr.node;var Ur=n(Hr),Wr={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};Wr.node;var Gr=n(Wr),Kr={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Kr.node;var qr=n(Kr);function Jr(e){return e?.ownerDocument||document}var K=i(t(),1),Yr=i(ln(),1),Xr={planned:`Blocked`,ready:`Ready`,paused:`Paused`,in_progress:`In progress`,in_review:`Awaiting completion`,done:`Done`,not_adopted:`Not adopted`},Zr=`Planned on`,Qr={neutral:`bg-muted text-foreground/70`,info:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,progress:`bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-200`,review:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,success:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,attention:`bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-200`,danger:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`},$r={neutral:`text-muted-foreground`,info:`text-sky-700 dark:text-sky-300`,progress:`text-blue-700 dark:text-blue-300`,review:`text-violet-700 dark:text-violet-300`,success:`text-emerald-700 dark:text-emerald-300`,attention:`text-amber-700 dark:text-amber-300`,danger:`text-rose-700 dark:text-rose-300`},ei={neutral:`border-border text-muted-foreground`,info:`border-sky-300 text-sky-700 dark:border-sky-800 dark:text-sky-300`,progress:`border-blue-300 text-blue-700 dark:border-blue-800 dark:text-blue-300`,review:`border-violet-300 text-violet-700 dark:border-violet-800 dark:text-violet-300`,success:`border-emerald-300 text-emerald-700 dark:border-emerald-800 dark:text-emerald-300`,attention:`border-amber-300 text-amber-700 dark:border-amber-800 dark:text-amber-300`,danger:`border-rose-300 text-rose-700 dark:border-rose-800 dark:text-rose-300`},ti=`border-input text-foreground/70`,ni={info:`border border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-800 dark:bg-sky-950 dark:text-sky-100`,attention:`border border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`},ri={neutral:`bg-neutral-400`,info:`bg-sky-500`,progress:`bg-blue-500`,review:`bg-violet-500`,success:`bg-emerald-500`,attention:`bg-amber-500`,danger:`bg-rose-500`},ii={neutral:`border-muted-foreground`,info:`border-sky-500`,progress:`border-blue-500`,review:`border-violet-500`,success:`border-emerald-500`,attention:`border-amber-500`,danger:`border-rose-500 dark:border-rose-400`},ai={done:`border-emerald-500 bg-emerald-100 dark:bg-emerald-950`,ready:`border-amber-500 shadow-none`,blocked:`border-dashed border-muted-foreground shadow-none`,paused:`border-dashed border-muted-foreground bg-muted shadow-none`,behindDue:`border-2 border-rose-500 dark:border-rose-400`},oi=`border-foreground/70`,si=`text-foreground`,ci=[[`plannedAt`,`Planned`],[`startedAt`,`Started`],[`reviewAt`,Xr.in_review],[`completedAt`,`Completed`],[`reopenedAt`,`Reopened`],[`pausedAt`,Xr.paused]];function li(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}var ui=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`,style:`short`}),di=604800;function fi(e,t=Date.now()/1e3){let n=e-t,r=Math.abs(n);if(r<60)return`just now`;if(r<di){let[e,t]=r<3600?[Math.trunc(n/60),`minute`]:r<86400?[Math.trunc(n/3600),`hour`]:[Math.trunc(n/86400),`day`];return ui.format(e,t)}let i=new Date(e*1e3),a=i.getFullYear()===new Date(t*1e3).getFullYear();return i.toLocaleDateString(`en`,{month:`short`,day:`numeric`,...a?{}:{year:`numeric`}})}function pi(e){return new Date(e*1e3).toLocaleString(`en`,{dateStyle:`medium`,timeStyle:`short`})}function mi(e){let t=[];for(let n of e){let e=t.at(-1);e!==void 0&&e.end===null&&(e.end=n.at),n.status!==`done`&&(n.status===`planned`?t.length>0&&t.push({state:`paused`,start:n.at,end:null}):t.push({state:n.status,start:n.at,end:null}))}return t}function hi(e,t){let n=mi(e);return n.length===0?null:n.filter(e=>e.state!==`paused`).reduce((e,n)=>e+Math.max((n.end??t)-n.start,0),0)}function gi(e){return ci.flatMap(([t,n])=>{let r=e[t];return r===null?[]:[{label:n,at:r}]}).sort((e,t)=>e.at-t.at)}var q=r();function _i(e){let t={type:`http`,url:e.url,headers:{Authorization:`Bearer ${e.token??``}`}};return JSON.stringify({mcpServers:{toodo:t}},null,2)}async function vi(e){let t={Authorization:`Bearer ${e.token??``}`,"Content-Type":`application/json`,Accept:`application/json, text/event-stream`},n=await Ut(`/mcp`,{method:`POST`,headers:t,body:JSON.stringify({jsonrpc:`2.0`,id:1,method:`initialize`,params:{protocolVersion:`2025-06-18`,capabilities:{},clientInfo:{name:`toodo-web`,version:`1`}}})}),r=await n.text();if(!n.ok)return{ok:!1,message:r.trim()||`The MCP server answered ${n.status} ${n.statusText}.`};let i=n.headers.get(`mcp-session-id`);i&&Ut(`/mcp`,{method:`DELETE`,headers:{...t,"mcp-session-id":i}}).catch(()=>{});let a;try{a=JSON.parse(r)?.result?.serverInfo?.title}catch{a=void 0}return typeof a!=`string`||!a.includes(e.instance)?{ok:!1,message:`The answer came from another server (${String(a??`no server title`)}), not instance ${e.instance}.`}:{ok:!0,message:`Connected: instance ${e.instance} accepts this token.`}}var yi={no_header:`no Authorization header`,not_bearer:`the header was not Bearer <token>`,wrong_token:`a token this server does not accept (old, mistyped, or another server's)`,web_token:`the web sign-in token instead of the MCP token`};function bi(e){return e.split(/(?<=\/)(?!\/)/).map((e,t)=>(0,q.jsxs)(`span`,{children:[t>0&&(0,q.jsx)(`wbr`,{}),e]},t))}var xi={open:{label:`Connected`,className:ri.success},connecting:{label:`Connecting`,className:ri.attention},retrying:{label:`Retrying`,className:`bg-destructive`}};function Si({tunnels:e}){return e.length===0?null:(0,q.jsx)(`ul`,{"aria-label":`Remote machines`,className:`flex flex-col gap-1`,children:e.map(e=>{let t=xi[e.state];return(0,q.jsxs)(`li`,{"aria-label":`Tunnel to ${e.machine}`,className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 shrink-0 rounded-full`,t.className)}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.machine}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:t.label})]}),e.error&&(0,q.jsx)(`span`,{className:`break-words text-destructive`,children:e.error})]},e.machine)})})}function Ci(){let e=(l().data??[]).filter(e=>e.state===`retrying`).length;return e===0?null:(0,q.jsx)(`span`,{className:`text-destructive`,children:e===1?`1 tunnel retrying`:`${e} tunnels retrying`})}function wi(){let e=st(),t=l(),[n,r]=(0,K.useState)(null),[i,o]=(0,K.useState)(null);async function s(e,t){try{await navigator.clipboard.writeText(e),r(`Copied ${t}.`)}catch(e){r(`Could not copy: ${String(e)}`)}}async function c(e){o(`testing`);try{o(await vi(e))}catch(e){o({ok:!1,message:`Could not reach the MCP server: ${String(e)}`})}}let u=e.data,d=u?.lastRejection;return(0,q.jsxs)(`section`,{"aria-label":`Agent access`,className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Agents on the server can plan tasks and connect dependencies through the Toodo server's MCP endpoint.`}),u&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`MCP server URL`,children:bi(u.url)}),u.error?(0,q.jsxs)(`p`,{role:`alert`,className:`text-destructive`,children:[`MCP server is not running: `,u.error]}):u.token&&(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,q.jsx)(G,{size:`xs`,onClick:()=>void s(_i(u),`the MCP config`),children:`Copy MCP config`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,onClick:()=>void s(u.token??``,`the MCP token for agents`),children:`Copy MCP token for agents`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,disabled:i===`testing`,onClick:()=>void c(u),children:`Test connection`})]}),i&&i!==`testing`&&(0,q.jsx)(`p`,{role:`status`,"aria-label":`Connection test`,className:a(`break-words`,!i.ok&&`text-destructive`),children:i.message}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`The MCP token is for agents only; the web app signs in with the server's web token (`,(0,q.jsx)(`code`,{children:`web-token`}),`). Server instance `,(0,q.jsx)(`code`,{"aria-label":`Server instance`,children:u.instance}),`, which agents see in`,` `,(0,q.jsx)(`code`,{children:`401`}),` replies and `,(0,q.jsx)(`code`,{children:`serverInfo`}),`.`]}),d&&(0,q.jsxs)(`p`,{"aria-label":`Last rejected agent request`,className:`break-words text-destructive`,children:[`Last rejected agent request`,` `,(0,q.jsx)(`time`,{dateTime:new Date(d.at*1e3).toISOString(),title:pi(d.at),children:fi(d.at)}),`: `,yi[d.reason],d.count>1&&` (${d.count} since the server started)`,`.`]}),!u.error&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Agents on SSH machines use the same config: the server forwards its port to each machine with a workspace.`}),(0,q.jsx)(Si,{tunnels:t.data??[]})]})]}),n&&(0,q.jsx)(`p`,{role:`status`,children:n})]})}function Ti(){let e=C(),t=Qe().data?.some(e=>e.runner===`herdr`)??!1,n=(0,K.useSyncExternalStore)(qt,Kt)!==`reachable`;if(!t||e.isPending||e.data?.running||n)return null;let r=e.isError?e.error.message:`The herdr server is not running.`;return(0,q.jsxs)(`div`,{role:`alert`,className:a(`mb-4 flex items-center justify-between gap-3 rounded-lg px-3 py-2`,ni.attention),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium`,children:`herdr is not available`}),(0,q.jsxs)(`p`,{className:`text-xs break-words`,children:[r,` Start herdr, then retry. Tasks of herdr workspaces cannot be started until herdr is running.`]})]}),(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>e.refetch(),disabled:e.isFetching,children:e.isFetching?`Checking...`:`Retry`})]})}function Ei(){let e=(0,K.useSyncExternalStore)(it,he),[t,n]=(0,K.useState)(!1);return e===`none`?null:(0,q.jsxs)(`div`,{role:`region`,"aria-label":`Install Toodo`,className:a(`mb-4 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg px-3 py-2`,ni.info),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-56 flex-col gap-0.5`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium`,children:`Install Toodo on this device`}),(0,q.jsx)(`p`,{className:`text-xs break-words`,children:e===`prompt`?`It opens in its own window and can show notifications.`:(0,q.jsxs)(q.Fragment,{children:[`Tap `,(0,q.jsx)(Fr,{"aria-label":`Share`,className:`inline size-3.5 align-text-bottom`}),`, then`,` `,(0,q.jsx)(`span`,{className:`font-medium`,children:`Add to Home Screen`}),`. Notifications need the installed app.`]})})]}),(0,q.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[e===`prompt`&&(0,q.jsxs)(G,{size:`sm`,disabled:t,onClick:()=>{n(!0),ot().finally(()=>n(!1))},children:[(0,q.jsx)(Vn,{}),`Install`]}),(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:et,children:e===`prompt`?`Not now`:`Dismiss`})]})]})}var Di={on_time:`On time`,late:`Late`,overdue:`Overdue`,upcoming:`Due`};function Oi(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r+1).getTime()/1e3}function ki(e,t){if(e.dueDate===null)return null;let n=Oi(e.dueDate);if(e.status===`done`){let{completedAt:t}=e.milestones;return t===null?null:t<n?`on_time`:`late`}return t>=n?`overdue`:`upcoming`}function Ai(e,t){if(e.dueDate===null)return 0;let n=e.status===`done`?e.milestones.completedAt??t:t;return Math.max(n-Oi(e.dueDate),0)}function ji(e){return String(Math.round(e*100)/100)}var Mi={hours:`h`,days:`d`,weeks:`w`,months:`mo`},Ni={hours:3600,days:86400,weeks:604800,months:2592e3};function Pi(e){return`${ji(e.amount)}${Mi[e.unit]}`}function Fi(e){return e?e.amount*Ni[e.unit]:null}function Ii(e){let t=e.trim();if(t===``)return null;let n=/^\d+(\.\d+)?$/.test(t)?Number(t):NaN;return n>0&&n<=1e4?n:NaN}var Li=[`planned`,`in_progress`];function Ri(e){return e?.resolution===`not_adopted`}function zi(e,t){return e.dependsOn.every(e=>{let n=t.get(e);return n?.status===`done`&&!Ri(n)})}function Bi(e,t){return e.status!==`planned`||e.dependsOn.some(e=>Ri(t.get(e)))?[]:e.dependsOn.filter(e=>t.get(e)?.status!==`done`)}function Vi(e){let t=e.mergeable===`conflicting`;if(e.behind===0&&!t)return null;let n=[];return e.behind>0&&n.push(`${e.behind} ${e.behind===1?`commit`:`commits`} behind ${e.base}`),t?n.push(`pull request has merge conflicts`):e.mergeable===`mergeable`&&n.push(`no merge conflicts`),n.join(`; `)}function Hi(e){return e.status===`planned`&&(e.milestones.startedAt!==null||e.branch!==null)}function Ui(e,t){return e.notes.some(e=>e.kind===`blocker`&&e.at===t)}function Wi(e,t){let n=e.milestones.pausedAt;return Hi(e)&&n!==null&&zi(e,t)&&(Ui(e,n)||e.dependsOn.some(e=>(t.get(e)?.milestones.completedAt??-1/0)>=n))}function Gi(e){return e.status===`planned`&&!Hi(e)}function Ki(e,t){let n=e.dependsOn.map(e=>{let n=t.get(e);return Ri(n)?null:n?.milestones.completedAt??null});return n.length===0||n.includes(null)?null:Math.max(...n)}function qi(e,t){return`${e}->${t}`}function Ji(e){let t=new Set(e.map(e=>e.id));return e.flatMap(e=>e.dependsOn.filter(e=>t.has(e)).map(t=>({id:qi(t,e.id),source:t,target:e.id})))}function Yi(e,t,n){if(t===n)return!1;let r=e.find(e=>e.id===t),i=e.find(e=>e.id===n);return r!==void 0&&i!==void 0&&Li.includes(i.status)&&!i.dependsOn.includes(t)}function Xi(e,t){let n=new Set([t]),r=e=>{let r=[t],i=new Set([t]);for(let t=r.pop();t!==void 0;t=r.pop())for(let a of e(t))i.has(a)||(i.add(a),n.add(a),r.push(a))},i=new Map(e.map(e=>[e.id,e]));return r(e=>i.get(e)?.dependsOn.filter(e=>i.has(e))??[]),r(t=>e.filter(e=>e.dependsOn.includes(t)).map(e=>e.id)),n}var J=[`hour`,`day`,`week`,`month`],Zi={hour:960,day:48,week:12,month:3},Qi=120;function $i(e,t,n){let r=e.x+8,i=t.x-8,a=t.y-n/2;return`M ${e.x} ${e.y} H ${r} V ${a} H ${i} V ${t.y} H ${t.x}`}var ea=86400;function ta(e,t){let{plannedAt:n,startedAt:r,reviewAt:i,completedAt:a,pausedAt:o}=e.milestones;if(Gi(e))return{start:t,end:t};let s=r??i;if(e.status===`in_progress`||e.status===`in_review`)return s===null?null:{start:Math.min(s,t),end:t};let c=[n,r,i].filter(e=>e!==null),l=(e.status===`done`?a:o)??(c.length>0?Math.max(...c):null);return l===null?null:{start:Math.min(s??l,l),end:l}}function na(e,{start:t,end:n}){let r=mi(e.timeline),{reviewAt:i}=e.milestones;return(r.length>0?r.map(e=>({phase:e.state,start:e.start,end:e.end??n})):[{phase:`in_progress`,start:t,end:i??n},{phase:`in_review`,start:i??n,end:n}]).map(e=>({...e,start:Math.max(e.start,t),end:Math.min(e.end,n)})).filter(e=>e.end>e.start)}function ra(e,t,n,r,i){let{plannedAt:a}=e.milestones;if(a===null||i(Math.max(a,r))>=n)return null;let o=i(Math.max(a,r)),s=t!==null&&t>a&&t>=r?i(t):null;return{x:o-n,planned:a>=r,readyX:s!==null&&s<n?s-n:null}}function ia(e,t){let n=[],r=0;for(let i of t)i.x>r&&n.push({x:r,width:Math.min(i.x,e)-r}),r=Math.max(r,i.x+i.width);return r<e&&n.push({x:r,width:e-r}),n}function aa(e){let t=new Set(e.map(({task:e})=>e.id)),n=new Map(e.map(({task:e})=>[e.id,e.dependsOn.filter(e=>t.has(e)).length])),r=(e,t)=>e.interval.start-t.interval.start||e.task.id-t.task.id,i=new Set,a=[],o=e.filter(({task:e})=>n.get(e.id)===0);for(;a.length<e.length;){o.length===0&&(o=[e.filter(({task:e})=>!i.has(e.id)).sort(r)[0]]),o.sort(r);let t=o.shift();a.push(t),i.add(t.task.id);for(let r of e)if(!i.has(r.task.id)&&r.task.dependsOn.includes(t.task.id)){let e=n.get(r.task.id)-1;n.set(r.task.id,e),e===0&&o.push(r)}}return a}var oa=e=>String(e).padStart(2,`0`),sa={hour:{minor:`hour`,major:`day`},day:{minor:`day`,major:`month`},week:{minor:`week`,major:`month`},month:{minor:`month`,major:`year`}},ca={hour:e=>`${oa(e.getHours())}:00`,day:e=>`${oa(e.getMonth()+1)}-${oa(e.getDate())}`,week:e=>`${oa(e.getMonth()+1)}-${oa(e.getDate())}`,month:e=>`${e.getFullYear()}-${oa(e.getMonth()+1)}`,year:e=>String(e.getFullYear())},la={...ca,day:e=>`${e.getFullYear()}-${oa(e.getMonth()+1)}-${oa(e.getDate())}`};function ua(e,t){let n=new Date(e*1e3);return n.setMinutes(0,0,0),t!==`hour`&&n.setHours(0),t===`week`?n.setDate(n.getDate()-(n.getDay()+6)%7):t===`month`?n.setDate(1):t===`year`&&n.setMonth(0,1),n}function da(e,t){t===`hour`?e.setHours(e.getHours()+1):t===`day`?e.setDate(e.getDate()+1):t===`week`?e.setDate(e.getDate()+7):t===`month`?e.setMonth(e.getMonth()+1):e.setFullYear(e.getFullYear()+1)}function fa(e,t,n){let r=[];for(let i=ua(e,n);i.getTime()/1e3<t;da(i,n))r.push(new Date(i));return r}function pa(e,t,n){let r=Zi[e.scale],i=t=>(t-e.start)/ea*r,a=e.start+t/r*ea,o=e.start+n/r*ea;e.period!==null&&(a=Math.max(a,e.period.start),o=Math.min(o,e.period.end));let{minor:s,major:c}=sa[e.scale];return{ticks:fa(a,o,s).filter(e=>e.getTime()/1e3>=a).map(e=>({at:e.getTime()/1e3,x:i(e.getTime()/1e3),label:ca[s](e)})),majorTicks:fa(a,o,c).map(t=>{let n=new Date(t);da(n,c);let r=t.getTime()/1e3,a=n.getTime()/1e3;return e.period!==null&&(r=Math.max(r,e.period.start),a=Math.min(a,e.period.end)),{at:r,x:i(r),right:i(a),label:la[c](t)}})}}function ma(e){return e.length*6+6}function ha(e,t,n,r){let i=Math.max(e.x,n);return r!==null&&i<r.x+r.width&&i+t>r.x&&(i=r.x+r.width),i+t>e.right?null:i-e.x}function ga(e,{now:t,scale:n,period:r}){let i=new Map(e.map(e=>[e.id,e])),a=[],o=[];for(let n of e){let e=ta(n,t);e===null?a.push(n):(r===null||e.start<r.end&&e.end>=r.start)&&o.push({task:n,interval:e})}let s,c;if(r!==null)({start:s,end:c}=r);else{let e=o.map(({task:e,interval:t})=>Math.min(t.start,e.milestones.plannedAt??t.start)),n=o.flatMap(({task:e})=>e.dueDate===null?[]:[Oi(e.dueDate)]);s=ua(Math.min(t,...e,...n.map(e=>e-ea)),`day`).getTime()/1e3;let r=ua(Math.max(t,...o.map(({interval:e})=>e.end),...n.map(e=>e-1)),`day`);da(r,`day`),c=r.getTime()/1e3}let l=e=>(e-s)/ea*Zi[n],u=new Map,d=aa(o).map(({task:e,interval:r},a)=>{let o={start:Math.max(r.start,s),end:Math.min(r.end,c)},d=Gi(e),f,p,m=[],h=[];if(d){let t=e.dependsOn.flatMap(e=>{let t=i.get(e);if(t?.status===`done`&&!Ri(t))return[];let n=u.get(e);return n===void 0?[]:[n+16]});f=Math.max(l(o.start),...t);let r=Fi(e.estimate);p=Math.max(r===null?0:r/ea*Zi[n],28)}else{f=l(o.start),p=Math.max(l(o.end)-f,4);for(let t of na(e,o)){let e={x:l(t.start)-f,width:l(t.end)-l(t.start)};t.phase===`paused`?e.width>=6&&h.push(e):m.push({phase:t.phase,...e})}let n=l(Math.min(t,c))-f;Hi(e)&&n-p>=6&&(h=[...h,{x:p,width:n-p}])}u.set(e.id,f+p);let g=e.dueDate===null?null:Oi(e.dueDate);return{task:e,row:a,x:f,width:p,pending:d,phases:m,blocks:ia(p,h),pauses:h,lead:ra(e,Ki(e,i),f,s,l),dueX:g!==null&&g>=s&&g<=c?l(g)-f:null,dueState:ki(e,t)}});return{bars:d,unplaced:a,rows:d.length,start:s,end:c,width:Math.max(l(c),...d.map(e=>e.x+Math.max(e.width,Qi))),scale:n,period:r,nowX:t>=s&&t<=c?l(t):null}}function _a(e){return{start:new Date(e,0,1).getTime()/1e3,end:new Date(e+1,0,1).getTime()/1e3}}function va(e,t){let n=new Date(t*1e3).getFullYear(),r=e.flatMap(e=>e.milestones.plannedAt===null?[]:[e.milestones.plannedAt]),i=new Date(Math.min(t,...r)*1e3).getFullYear();return Array.from({length:n-i+1},(e,t)=>n-t)}function ya(e,t){return e.scale!==`month`&&e.nowX!==null?{x:16-e.nowX,y:Math.min(0,t.panel-t.height-8),zoom:1}:{x:Math.min(16,t.visible-e.width-16),y:0,zoom:1}}function ba(e,t){let n=e.notes.at(-1);if(e.status===`done`||n?.kind!==`blocker`)return null;let r=e.timeline.some(e=>e.status===`in_progress`&&e.at>n.at),i=n.at===e.milestones.pausedAt&&Wi(e,t);return r||i?null:n}var xa=[`agent_blocked`,`blocker_note`,`ci_failed`,`changes_requested`];function Sa(e,t,n,r=new Map(e.map(e=>[e.id,e]))){let i=new Map(t.map(e=>[e.taskId,e.status])),a=new Map(n.map(e=>[e.taskId,e])),o=e=>xa.indexOf(e.reasons[0]);return e.flatMap(e=>{let t=e.status===`in_progress`||e.status===`in_review`?i.get(e.id)??null:null,n=e.status===`in_review`?a.get(e.id):void 0,o=xa.filter(i=>{switch(i){case`agent_blocked`:return t===`blocked`;case`blocker_note`:return ba(e,r)!==null;case`ci_failed`:return n?.checks===`failing`;case`changes_requested`:return n?.review===`changes_requested`}});return o.length>0?[{task:e,reasons:o,agentStatus:t}]:[]}).sort((e,t)=>o(e)-o(t)||e.task.id-t.task.id)}var Ca={agent_blocked:`Agent needs input`,blocker_note:`Blocker`,ci_failed:`CI failed`,changes_requested:`Changes requested`},wa={agent_blocked:Qr.attention,blocker_note:Qr.attention,ci_failed:Qr.danger,changes_requested:Qr.attention};function Ta({onShow:e}){let t=pe(),n=$e(),r=ce(),i=C(),o=ee(),s=Sa(t.data??[],n.data??[],r.data??[]);return s.length===0?null:(0,q.jsxs)(`section`,{"aria-labelledby":`attention-heading`,className:`flex flex-col gap-1`,children:[(0,q.jsxs)(`h2`,{id:`attention-heading`,className:a(`flex items-center gap-1.5 px-1 text-xs font-medium uppercase`,$r.attention),children:[(0,q.jsx)(dn,{"aria-hidden":!0,className:`size-3.5`}),`Needs attention`,(0,q.jsx)(`span`,{className:a(`ml-auto rounded-full px-1.5 tabular-nums`,Qr.attention),children:s.length})]}),(0,q.jsx)(`ul`,{"aria-label":`Tasks needing attention`,className:`flex max-h-60 flex-col gap-0.5 overflow-y-auto`,children:s.map(({task:t,reasons:n,agentStatus:r})=>(0,q.jsxs)(`li`,{className:`flex items-start gap-0.5 rounded-md hover:bg-sidebar-accent`,children:[(0,q.jsxs)(`button`,{type:`button`,title:`Show on the timeline`,className:`flex min-w-0 flex-1 flex-col gap-1 rounded-md px-1.5 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>e(t.id),children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs`,children:[(0,q.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,t.id]}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:t.title})]}),(0,q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,q.jsx)(`span`,{"data-reason":e,className:a(`rounded-full px-1.5 text-[11px] font-medium leading-4`,wa[e]),children:Ca[e]},e))})]}),r!==null&&t.herdrWorkspaceId!==null&&(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,className:`mt-0.5`,"aria-label":`Focus agent pane of #${t.id}`,title:`Focus agent pane`,disabled:i.data?.running!==!0||o.isPending,onClick:()=>o.mutate(t.id),children:(0,q.jsx)(Ln,{})})]},t.id))}),o.error&&(0,q.jsx)(`p`,{role:`alert`,className:`px-1 text-xs text-destructive`,children:o.error.message})]})}function Ea({type:e,className:t}){return(0,q.jsx)(`span`,{"data-task-type":e,className:a(`shrink-0 rounded-md border px-1.5 font-mono text-xs`,ti,t),children:e})}function Da({taskId:e,prerequisite:t,pending:n,onConfirm:r,onCancel:i}){return(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Confirm prerequisite of #${e}`,className:a(`flex flex-wrap items-center gap-2 rounded-md px-2 py-1.5 text-xs`,ni.attention),onKeyDown:ze(i,n),children:[(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Adding `,t,` as a prerequisite pauses #`,e,` and closes its herdr workspace, which stops its agent; the worktree is kept.`]}),(0,q.jsxs)(G,{size:`xs`,variant:`destructive`,disabled:n,onClick:r,children:[(0,q.jsx)(yr,{}),n?`Pausing...`:`Pause and add`]}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,disabled:n,onClick:i,children:`Back`})]})}function Oa({label:e,full:t,short:n,className:r}){let[i,o]=(0,K.useState)(`idle`);(0,K.useEffect)(()=>{if(i===`idle`)return;let e=setTimeout(()=>o(`idle`),2e3);return()=>clearTimeout(e)},[i]);async function s(){try{await navigator.clipboard.writeText(t),o(`copied`)}catch{o(`failed`)}}return(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-0.5`,children:[(0,q.jsx)(`span`,{title:t,className:a(`truncate`,r),children:n}),(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy ${e}`,title:`Copy ${t}`,className:`shrink-0 text-muted-foreground`,onClick:()=>void s(),children:i===`copied`?(0,q.jsx)(xn,{}):(0,q.jsx)(Fn,{})}),(0,q.jsx)(`span`,{role:`status`,className:a(`shrink-0 text-xs`,i===`failed`?`text-destructive`:`sr-only`),children:i===`copied`?`Copied`:i===`failed`?`Could not copy`:``})]})}function ka(e,t,n=!1){let[r,i]=(0,K.useState)(!1),a=(0,K.useRef)(null),o=()=>{e?(a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i(!0)):t()},s=e=>{let t=a.current;t?.isConnected&&t.matches(`input, textarea, select`)?t.focus():(e instanceof Element?e.closest(`form`):null)?.querySelector(`textarea, input:not([type=checkbox]), select`)?.focus(),i(!1)};return{asking:r,request:o,keep:s,discard:()=>{i(!1),t()},onKeyDown:e=>{e.key!==`Escape`||n||e.defaultPrevented||(e.preventDefault(),r?s(e.target):o())}}}function Aa({label:e,question:t,onKeep:n,onDiscard:r}){return(0,q.jsxs)(`div`,{role:`group`,"aria-label":e,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,children:[(0,q.jsx)(`span`,{className:`mr-1`,children:t}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`outline`,autoFocus:!0,onClick:e=>n(e.currentTarget),children:`Keep editing`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`destructive`,onClick:r,children:`Discard changes`})]})}var ja=80,Ma=`(max-width: 47.99rem)`;function Na(e){let[t,n]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(t===null)return;let e=window.matchMedia?.(Ma),r=()=>n(null);return e?.addEventListener(`change`,r),()=>e?.removeEventListener(`change`,r)},[t!==null]);function r(e){window.matchMedia?.(`(max-width: 47.99rem)`).matches&&e.button===0&&!e.target.closest(`button`)&&(e.currentTarget.setPointerCapture?.(e.pointerId),n({pointer:e.pointerId,startY:e.clientY,offset:0}))}function i(e){t?.pointer===e.pointerId&&n({...t,offset:Math.max(0,e.clientY-t.startY)})}function a(r){t?.pointer===r.pointerId&&(n(null),r.type===`pointerup`&&r.clientY-t.startY>=ja&&e())}return{dragging:t!==null,offset:t?.offset??0,handlers:{onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a}}}function Pa({ref:e,width:t,takeFocus:n=!0,returnFocus:r,onClose:i,banner:a,children:o}){let s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(r);l.current=r;let u=Na(i);(0,K.useLayoutEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=s.current;return n&&c.current?.focus({preventScroll:!0}),()=>{let n=document.activeElement;if(n!==null&&n!==document.body&&!t?.contains(n))return;let r=l.current?.()??e;r?.isConnected&&r.focus({preventScroll:!0})}},[]);let d=u.handlers;return(0,q.jsxs)(`aside`,{ref:t=>{s.current=t,typeof e==`function`?e(t):e&&(e.current=t)},"aria-label":`Task details`,"data-dragging":u.dragging?``:void 0,className:`fixed z-40 flex flex-col overflow-hidden border bg-card shadow-xl max-md:inset-x-0 max-md:bottom-0 max-md:max-h-[90dvh] max-md:rounded-t-2xl max-md:border-b-0 max-md:pb-[env(safe-area-inset-bottom)] max-md:transition-transform max-md:data-dragging:transition-none motion-reduce:transition-none md:inset-y-4 md:right-4 md:w-(--sheet-width) md:rounded-xl`,style:{"--sheet-width":t,transform:u.offset===0?void 0:`translateY(${u.offset}px)`},children:[(0,q.jsx)(`div`,{className:`flex shrink-0 justify-center pt-2 pb-1 md:hidden touch-none`,...d,children:(0,q.jsx)(`span`,{"data-grabber":!0,"aria-hidden":!0,className:`h-1 w-9 rounded-full bg-muted-foreground/40`})}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-2 max-md:touch-none max-md:pt-0`,...d,children:[(0,q.jsx)(`h3`,{ref:c,tabIndex:-1,className:`text-xs font-medium text-muted-foreground outline-none`,children:`Task details`}),(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Close details`,title:`Close details (Esc)`,onClick:i,children:(0,q.jsx)(nt,{})})]}),a,(0,q.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:o})]})}var Fa={idle:`Agent idle`,working:`Agent working`,blocked:`Agent needs input`,done:`Agent done`},Ia={idle:Qr.neutral,working:Qr.info,blocked:Qr.attention,done:Qr.success};function La({taskId:e,status:t,className:n}){return(0,q.jsxs)(`span`,{"aria-label":`Agent of #${e}`,className:a(`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,Ia[t],n),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full bg-current`,t===`working`&&`motion-safe:animate-pulse`)}),Fa[t]]})}var Ra={passing:`CI passed`,failing:`CI failed`,pending:`CI running`},za={passing:Qr.success,failing:Qr.danger,pending:Qr.info},Ba={approved:`Approved`,changes_requested:`Changes requested`,pending:`Review pending`},Va={approved:Qr.success,changes_requested:Qr.attention,pending:Qr.neutral},Ha=`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`;function Ua({taskId:e,status:t}){return(0,q.jsxs)(q.Fragment,{children:[t.checks&&(0,q.jsxs)(`span`,{"aria-label":`CI of #${e}`,className:a(Ha,za[t.checks]),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full bg-current`,t.checks===`pending`&&`motion-safe:animate-pulse`)}),Ra[t.checks]]}),(0,q.jsx)(`span`,{"aria-label":`Review of #${e}`,className:a(Ha,Va[t.review]),children:Ba[t.review]})]})}var Wa=`(max-width: 47.99rem)`;function Ga(){let[e,t]=(0,K.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(Wa).matches);return(0,K.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(Wa),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Ka({label:e,expanded:t,onExpandedChange:n,onSubmit:r,children:i}){let o=(0,K.useRef)(null),s=(0,K.useRef)(!1),c=Ga(),l=t&&c;(0,K.useEffect)(()=>{if(!t)return;let e=e=>{e.target instanceof Node&&!o.current?.contains(e.target)&&n(!1)};return document.addEventListener(`click`,e),document.addEventListener(`focusin`,e),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`focusin`,e)}},[t]);let u=()=>{s.current?s.current=!1:t||n(!0)};function d(){n(!1);let e=o.current?.querySelector(`input`);e&&e!==document.activeElement&&(s.current=!0,e.focus())}function f(e){e.key===`Escape`&&t&&!e.defaultPrevented&&(e.preventDefault(),n(!1))}return(0,q.jsxs)(q.Fragment,{children:[l&&(0,q.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-black/40`}),(0,q.jsx)(`div`,{role:l?`dialog`:void 0,"aria-modal":l||void 0,"aria-label":l?e:void 0,className:a(l&&`fixed inset-x-0 bottom-0 z-50 max-h-[90dvh] overflow-y-auto rounded-t-xl bg-card pb-[env(safe-area-inset-bottom)] shadow-xl`),children:(0,q.jsxs)(`form`,{ref:o,"aria-label":e,"data-expanded":t||void 0,onSubmit:r,onFocus:u,onInput:u,onKeyDown:f,className:a(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,l&&`border-0 shadow-none`),children:[t&&(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium`,children:e}),(0,q.jsx)(G,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Close ${e}`,title:`Close (Esc)`,onClick:d,children:(0,q.jsx)(nt,{})})]}),i]})})]})}var qa=`modulepreload`,Ja=function(e){return`/`+e},Ya={},Xa=function(e){return e.pathname.endsWith(`.css`)},Za=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Qa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ja(t,n);let r=s(t),i=Xa(r);return Za(Ya,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:qa,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},$a=(0,K.lazy)(()=>Qa(()=>import(`./markdown-BKJM8xjI.js`),__vite__mapDeps([0,1])));function eo({label:e,value:t,onChange:n,placeholder:r,className:i}){let[o,s]=(0,K.useState)(!1),c=(0,K.useId)();return(0,q.jsxs)(`div`,{className:a(`flex min-w-0 flex-col gap-1 max-md:gap-2`,i),children:[(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Mode of ${e}`,className:`flex gap-0.5 max-md:gap-2`,children:[(0,q.jsx)(G,{type:`button`,size:`xs`,variant:o?`ghost`:`default`,"aria-pressed":!o,onClick:()=>s(!1),children:`Write`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:o?`default`:`ghost`,"aria-pressed":o,onClick:()=>s(!0),children:`Preview`})]}),o?(0,q.jsx)(`div`,{role:`region`,"aria-label":`Preview of ${e}`,className:`min-h-16 rounded-lg border border-input px-2.5 py-1.5`,children:t.trim()?(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:t}),children:(0,q.jsx)($a,{source:t})}):(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview`})}):(0,q.jsx)(`textarea`,{className:a(qe,`h-auto min-h-16 resize-y py-1.5 max-md:h-auto`),rows:3,placeholder:r,"aria-label":e,"aria-describedby":c,value:t,onChange:e=>n(e.target.value)}),(0,q.jsx)(`p`,{id:c,className:`text-xs text-muted-foreground`,children:`Markdown supported`})]})}var to=K.createContext(void 0);function no(e){let t=K.useContext(to);if(t===void 0&&!e)throw Error(Ft(33));return t}var ro=K.createContext(void 0);function io(e){let t=K.useContext(ro);if(t===void 0&&!e)throw Error(Ft(36));return t}var ao=`data-starting-style`,oo=`data-ending-style`,so={[ao]:``},co={[oo]:``},lo={transitionStatus(e){return e===`starting`?so:e===`ending`?co:null}},uo=`data-open`,fo=`data-closed`,po=`data-anchor-hidden`,mo=`data-popup-open`,ho=`data-pressed`,go={[mo]:``,[ho]:``},_o={[uo]:``},vo={[fo]:``},yo={[po]:``},bo={open(e){return e?go:null}},xo={open(e){return e?_o:vo},anchorHidden(e){return e?yo:null}},So={...xo,...lo},Co=K.createContext(void 0);function wo(e=!0){let t=K.useContext(Co);if(t===void 0&&!e)throw Error(Ft(25));return t}var To=`none`,Eo=`trigger-press`,Do=`trigger-hover`,Oo=`trigger-focus`,ko=`outside-press`,Ao=`item-press`,jo=`focus-out`,Mo=`escape-key`,No=`list-navigation`,Po=`keyboard`,Y=`pointer`,Fo=`cancel-open`,Io=`sibling-open`,Lo=`imperative-action`,Ro=K.createContext(null);function zo(e=`root`){let t=K.useContext(Ro),n=K.useContext(ro);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Bo={visible:!0,ref:null};function Vo(){return Bo}function Ho(e,t,n=`root`){let r=zo(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Vo)({label:e.label,children:e.children,render:e.render}),a=jt(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Uo(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Wo,platform:Go,maxTouchPoints:Ko}=Uo(),qo=Wo.toLowerCase(),Jo=Go.toLowerCase(),Yo=/^i(os$|p)/.test(Jo)||Jo===`macintel`&&Ko>1,Xo=`android`,Zo=Jo===Xo||qo.includes(Xo),Qo=!Yo&&Jo.startsWith(`mac`);Jo.startsWith(`win`),!Zo&&/^(linux|chrome os)/.test(Jo);var $o=Qo||Yo,es=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!es&&qo.includes(`firefox`),!es&&qo.includes(`chrom`);var ts=$o,ns=/jsdom|happydom/.test(qo);function rs(e){e.preventDefault()}function is(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=io(),u=wo(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return K.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?rs:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Ao})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Qo&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Et(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var as={type:`regular-item`};function os(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=K.useRef(null),{getButtonProps:d,buttonRef:f}=Rt({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=is({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=K.useCallback(e=>Mt(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=jt(u,f);return K.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var ss=K.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function cs(){return K.useContext(ss)}function ls(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=cs(),u=K.useRef(-1),[d,f]=K.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=K.useRef(null),h=K.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return W(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function us(){let[,e]=K.useState({});return K.useCallback(()=>{e({})},[])}var ds=0;function fs(e,t=`mui`){let n=K.useRef(void 0),r=us(),i=e??n.current;return K.useEffect(()=>{n.current??(ds+=1,n.current=`${t}-${ds}`,e??r())},[e,t,r]),i}var ps=zt.useId;function ms(e,t){if(ps!==void 0){let n=ps();return e??(t?`${t}-${n}`:n)}return fs(e,t)}function hs(e){return ms(e,`base-ui`)}function gs(e,t,n,r){let i=!1,a=!1,o=r??Pt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function _s(e,t,n){let r=n??Pt;return{reason:e,event:t??new Event(`base-ui`),...r}}function vs(e){K.useEffect(e,Ct)}var ys=null;globalThis.requestAnimationFrame;var bs=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},xs=class e{static create(){return new e}static request(e){return bs.request(e)}static cancel(e){return bs.cancel(e)}currentId=ys;request(e){this.cancel(),this.currentId=bs.request(()=>{this.currentId=ys,e()})}cancel=()=>{this.currentId!==ys&&(bs.cancel(this.currentId),this.currentId=ys)};disposeEffect=()=>this.cancel};function Ss(){let e=St(xs.create).current;return vs(e.disposeEffect),e}function Cs(e,t=!1,n=!1,r=!1){let[i,a]=K.useState(e&&t?`idle`:void 0),[o,s]=K.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),W(()=>{if(!e&&o&&i!==`ending`&&n){let e=xs.request(()=>{a(`ending`)});return()=>{xs.cancel(e)}}},[e,o,i,n]),W(()=>{if(!e||t||i===void 0)return;let n=xs.request(()=>{a(void 0)});return()=>{xs.cancel(n)}},[t,e,i]),W(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=xs.request(()=>{a(`idle`)});return()=>{xs.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function ws(e){return e==null?e:`current`in e?e.current:e}function Ts(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Es=i(sn(),1),Ds=null;function Os(e){if(!Ds){let e=[];Ds=e,queueMicrotask(()=>{Ds=null,Es.flushSync(()=>{for(let t of e)t()})})}Ds.push(e)}function ks(e,t=!1,n=!1){let r=Ss();return U((i,a=null)=>{r.cancel();let o=ws(e);if(o==null)return;let s=o,c=()=>{n?Os(()=>{a?.aborted||i()}):Es.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Ts(s).map(e=>e.finished.then(Lt))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Ts(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=ao;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function As(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=U(a),s=ks(r,n,i);K.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var js=K.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=io(),f=ls({guess:!0,label:a}),p=hs(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=os({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:as});return Ot(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Ms=K.forwardRef(function(e,t){let n=Ho(e,t);return n.visible?(0,q.jsx)(js,{...e,ref:n.ref}):null}),Ns=0,Ps=class e{static create(){return new e}currentId=Ns;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ns,t()},e)}isStarted(){return this.currentId!==Ns}clear=()=>{this.currentId!==Ns&&(clearTimeout(this.currentId),this.currentId=Ns)};disposeEffect=()=>this.clear};function Fs(){let e=St(Ps.create).current;return vs(e.disposeEffect),e}function Is(e){e.preventDefault(),e.stopPropagation()}function Ls(e){return`nativeEvent`in e}function Rs(e){return e.pointerType===``&&e.isTrusted?!0:Zo&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function zs(e){return ns?!1:!Zo&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Zo||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Bs(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Vs(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Hs(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&yt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Us(e,t){let n=e;for(;n;){if(At(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(yt(n)?n.host:null)}return null}function Ws(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Gs=`data-base-ui-focusable`,Ks=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,qs=`ArrowLeft`,Js=`ArrowRight`,Ys=`ArrowUp`,Xs=`ArrowDown`,Zs=`data-trigger-disabled`;function Qs(e,t){if(!At(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Zs);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(Zs);return!1}function $s(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ec(e){return e.matches(`html,body`)}function tc(e){return lt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function nc(e){return Us(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ks}`)!=null}function rc(e){return e?e.getAttribute(`role`)===`combobox`&&tc(e):!1}function ic(e){if(!e||ns)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ac(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function oc(e,t){return t!=null&&!Bs(t)?0:typeof e==`function`?e():e}function sc(e,t,n){let r=oc(e,n);return typeof r==`number`?r:r?.[t]}function cc(e){return typeof e==`function`?e():e}function lc(e,t){return t||e===`click`||e===`mousedown`}function uc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function dc(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function fc(e){let t=St(pc,e).current;return t.next=e,W(t.effect),t}function pc(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var mc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},hc={...mc,position:`fixed`,margin:0,top:0,left:0};({...mc});var gc=K.forwardRef(function(e,t){let[n,r]=K.useState();W(()=>{ts&&es&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:hc,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),_c=Math.min,vc=Math.max,yc=Math.round,bc=Math.floor,xc=e=>({x:e,y:e}),Sc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Cc(e,t,n){return vc(e,_c(t,n))}function wc(e,t){return typeof e==`function`?e(t):e}function Tc(e){return e.split(`-`)[0]}function Ec(e){return e.split(`-`)[1]}function Dc(e){return e===`x`?`y`:`x`}function Oc(e){return e===`y`?`height`:`width`}function kc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ac(e){return Dc(kc(e))}function jc(e,t,n){n===void 0&&(n=!1);let r=Ec(e),i=Ac(e),a=Oc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bc(o)),[o,Bc(o)]}function Mc(e){let t=Bc(e);return[Nc(e),t,Nc(t)]}function Nc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Pc=[`left`,`right`],Fc=[`right`,`left`],Ic=[`top`,`bottom`],Lc=[`bottom`,`top`];function Rc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fc:Pc:t?Pc:Fc;case`left`:case`right`:return t?Ic:Lc;default:return[]}}function zc(e,t,n,r){let i=Ec(e),a=Rc(Tc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Nc)))),a}function Bc(e){let t=Tc(e);return Sc[t]+e.slice(t.length)}function Vc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Hc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vc(e)}function Uc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Wc(e,t){return t<0||t>=e.length}function Gc(e,t){return Jc(e.current,{disabledIndices:t})}function Kc(e,t){return Jc(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function qc(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Jc(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Wc(e,u)?-1:u,wrapped:d}}function Jc(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Yc(e,a,r));return a}function Yc(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Zc(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Xc(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Zc(e,t=e?Ht(e):null){return!e||!e.isConnected||!t||Xc(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Qc=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function $c(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return yt(n)?n.host:null}function el(e){for(let t of Array.from(e.children))if(ut(t)===`summary`)return t;return null}function tl(e,t){let n=el(t);return!!n&&(e===n||X(n,e))}function nl(e){let t=e?ut(e):``;return e!=null&&e.matches(Qc)&&(t!==`summary`||e.parentElement!=null&&ut(e.parentElement)===`details`&&el(e.parentElement)===e)&&(t!==`details`||el(e)==null)&&(t!==`input`||e.type!==`hidden`)}function rl(e){if(!nl(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=$c(t)){let n=t!==e,r=ut(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ut(t)===`details`&&!t.open&&!tl(e,t)||t.hasAttribute(`hidden`)||!r&&!il(t,n))return!1}return!0}function il(e,t){let n=Ht(e);return t?n.display!==`none`:Zc(e,n)}function al(e){let t=e.tabIndex;if(t<0){let t=ut(e);if(t===`details`||t===`audio`||t===`video`||lt(e)&&e.isContentEditable)return 0}return t}function ol(e){if(ut(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function sl(e,t){let n=ol(e);if(!n)return!0;let r=t.find(e=>{let t=ol(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ol(e);return t?.name===n.name&&t.form===n.form})===n}function cl(e){if(lt(e)&&ut(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return lt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ll(e,t){cl(e).forEach(e=>{nl(e)&&t.push(e),ll(e,t)})}function ul(e,t,n){cl(e).forEach(e=>{lt(e)&&e.matches(t)&&n.push(e),ul(e,t,n)})}function dl(e){return rl(e)&&al(e)>=0}function fl(e){let t=[];return ll(e,t),t.filter(rl)}function pl(e){let t=fl(e);return t.filter(e=>al(e)>=0&&sl(e,t))}function ml(e,t){let n=pl(e),r=n.length;if(r===0)return;let i=Hs(Jr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function hl(e){return ml(Jr(e).body,1)||e}function gl(e){return ml(Jr(e).body,-1)||e}function _l(e,t,n){if(!e)return null;let r=[];ll(Jr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(rl);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!X(n,o)&&dl(o)&&sl(o,a))return o}return r[i]}function vl(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function yl(e){pl(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function bl(e){let t=[];ul(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function xl(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...xl(e,t.id,n)])}function Sl(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Cl(e){return`data-base-ui-${e}`}var wl=0;function Tl(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(wl);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Lt;let o=requestAnimationFrame(a);return wl=o,()=>{wl===o&&(cancelAnimationFrame(o),wl=0)}}var El=`data-base-ui-inert`,Dl=new WeakMap,Ol=new WeakSet,kl=new WeakMap,Al=0;function jl(e){return e?yt(e)?e.host:jl(e.parentNode):null}var Ml=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=jl(t);return e.contains(n)?n:null}).filter(e=>e!=null),Nl=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Pl=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ut(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Fl(e,t,n,{mark:r=!0}){let i=Ml(t,e),a=r?Pl(t,Nl(i),new Set(i)):[],o=[],s=[];if(n){let e=Ml(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Pl(t,Nl(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Dl.get(e)||0)+1;Dl.set(e,r),o.push(e),r===1&&n&&Ol.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(kl.get(e)||0)+1;kl.set(e,t),s.push(e),t===1&&e.setAttribute(El,``)}),Al+=1,()=>{o.forEach(e=>{let t=(Dl.get(e)||0)-1;Dl.set(e,t),t||(Ol.has(e)||e.removeAttribute(`aria-hidden`),Ol.delete(e))}),r&&s.forEach(e=>{let t=(kl.get(e)||0)-1;kl.set(e,t),t||e.removeAttribute(El)}),--Al,Al||(Dl=new WeakMap,Ol=new WeakSet,kl=new WeakMap)}}function Il(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Jr(e[0]).body;return Fl(e,i,n,{mark:r})}var Ll={style:{transition:`none`}},Rl={fallbackAxisSide:`none`},zl={fallbackAxisSide:`end`},Bl={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Vl=K.createContext(null),Hl=()=>K.useContext(Vl),Ul=Cl(`portal`);function Wl(e={}){let{ref:t,container:n,componentProps:r=Pt,elementProps:i}=e,a=ms(),o=Hl()?.portalNode,[s,c]=K.useState(null),[l,u]=K.useState(null),d=U(e=>{e!==null&&u(e)}),f=K.useRef(null);W(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(gt(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Ot(`div`,r,{ref:[t,d],props:[{id:a,[Ul]:``},i]}),m=s&&p?Es.createPortal(p,s):null;return{node:l,nodeId:K.isValidElement(p)?p.props.id:void 0,subtree:m}}var Gl=K.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Wl({container:o,ref:t,componentProps:e,elementProps:c}),f=K.useRef(null),p=K.useRef(null),m=K.useRef(null),h=K.useRef(null),[g,_]=K.useState(null),v=K.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;K.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&vl(e)&&(e.type===`focusin`?v.current&&=(bl(l),!1):(yl(l),v.current=!0))}return dc(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,y]),W(()=>{l&&b===!0&&v.current&&(bl(l),v.current=!1)},[b,l]);let S=K.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,q.jsxs)(K.Fragment,{children:[d,(0,q.jsxs)(Vl.Provider,{value:S,children:[x&&l&&(0,q.jsx)(gc,{"data-type":`outside`,ref:f,onFocus:e=>{vl(e,l)?m.current?.focus():gl(g?g.domReference:null)?.focus()}}),x&&l&&(0,q.jsx)(`span`,{role:s,"aria-owns":u,style:Bl}),l&&Es.createPortal(a,l),x&&l&&(0,q.jsx)(gc,{"data-type":`outside`,ref:p,onFocus:e=>{vl(e,l)?h.current?.focus():(hl(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,gs(`focus-out`,e.nativeEvent)))}})]})]})});function Kl(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ql=class{nodesRef={current:[]};events=Kl();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Jl=K.createContext(null),Yl=K.createContext(null),Xl=()=>K.useContext(Jl)?.id||null,Zl=e=>{let t=K.useContext(Yl);return e??t};function Ql(e){let t=ms(),n=Zl(e),r=Xl();return W(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function $l(e){let{children:t,id:n}=e,r=Xl();return(0,q.jsx)(Jl.Provider,{value:K.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function eu(e){let{children:t,externalTree:n}=e,r=St(()=>n??new ql).current;return(0,q.jsx)(Yl.Provider,{value:r,children:t})}function tu(e,t){let n=dt(Ws(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Rs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var nu=20,ru=[];function iu(){ru=ru.filter(e=>e.deref()?.isConnected)}function au(e){iu(),e&&ut(e)!==`body`&&(ru.push(new WeakRef(e)),ru.length>nu&&(ru=ru.slice(-20)))}function ou(){return iu(),ru[ru.length-1]?.deref()}function su(e){return e?dl(e)?e:pl(e)[0]||e:null}function cu(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=fl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return dl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function lu(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=U(()=>b.current.floatingContext?.nodeId),S=i===!1,C=rc(_)&&S,w=fc(i),T=fc(a),E=fc(o),D=fc(u),O=fc(g),k=Zl(m),A=Hl(),j=K.useRef(!1),M=K.useRef(!1),N=K.useRef(!1),P=K.useRef(null),F=K.useRef(``),ee=K.useRef(``),I=K.useRef(null),L=K.useRef(null),te=jt(I,p,A?.beforeInsideRef),ne=jt(L,A?.afterInsideRef),re=Fs(),R=Fs(),ie=Ss(),ae=A!=null,z=ac(v),oe=U((e=z)=>e?pl(e):[]),se=U(()=>h?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&X(z,Hs(Jr(z)))&&oe().length===0&&!C&&Is(e)}return Z(Jr(z),`keydown`,e)},[r,z,c,C,oe]),K.useEffect(()=>{if(r||!g)return;let e=Jr(z);function t(){N.current=!1}function n(e){let t=Ws(e),n=se(),r=X(v,t)||X(_,t)||X(A?.portalNode,t)||n.some(e=>e===t||X(e,t));N.current=!r,ee.current=e.pointerType||`keyboard`,Us(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,R.start(0,()=>{M.current=!1}))}function i(){ee.current=`keyboard`}return dc(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,v,_,z,g,A,R,se]),K.useEffect(()=>{if(r||!l)return;let e=Jr(z);function n(){M.current=!0,R.start(0,()=>{M.current=!1})}function i(e){let t=Ws(e);dl(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Ws(n);c&&r==null&&a!=null&&X(v,a)&&au(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=se(),p=r?.hasAttribute(Cl(`focus-guard`))&&[I.current,L.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,ws(f),ws(d)].includes(r),m=!(X(_,r)||X(v,r)||X(r,v)||X(A?.portalNode,r)||u.some(e=>e===r||X(e,r))||l.hasMatchingElement(e=>X(e,r))||p||k&&(xl(k.nodesRef.current,o).find(e=>X(e.context?.elements.floating,r)||X(e.context?.elements.domReference,r))||Sl(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,ac(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&z&&cu(z),s&&i!==_&&!Zc(a)&&Hs(e)===e.body){if(lt(z)&&(z.focus(),s===`popup`)){ie.request(()=>{z.focus()});return}let e=oe(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||z;lt(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==ou())&&(j.current=!0,t.setOpen(!1,gs(jo,n)))})}function o(){N.current||(b.current.insideReactTree=!0,re.start(0,()=>{b.current.insideReactTree=!1}))}let u=lt(_)?_:null;if(v||u)return dc(u&&Z(u,`focusout`,a),u&&Z(u,`pointerdown`,n),v&&Z(v,`focusin`,i),v&&Z(v,`focusout`,a),v&&A&&Z(v,`focusout`,o,!0))},[r,_,v,z,c,k,A,t,l,s,oe,C,x,b,re,R,ie,d,f,se]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Cl(`portal`)}]`)||[]),t=(k?Sl(k.nodesRef.current,x()):[]).find(e=>rc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Il([v,...e,I.current,L.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...se(),t,ws(f),ws(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=Il([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,se]),W(()=>{if(!g||r||!lt(z))return;F.current=``,ee.current=``;let e=Jr(z),t=Hs(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||X(z,t))return;let i=null,a=()=>(i??=oe(z),i[0]||z),o;o=r===!0||r===null?a():ws(r),o||=a();let s=X(z,Hs(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&Rs(c);Tl(o,{sync:l,preventScroll:o===z,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Hs(e);return!(t!==o&&X(z,t))}})})},[r,g,z,oe,w,D,O,b]);let ce=K.useRef(null);W(()=>{if(r||!z){ce.current=null;return}ce.current&&=(ce.current.cancelled=!0,null);let e=Jr(z),t=Hs(e),n=D.current==null;au(t);function i(e){if(e.open||(F.current=tu(e.nativeEvent,ee.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Cl(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Rs(e.nativeEvent)||zs(e.nativeEvent))j.current=!1;else{let e=!1;Jr(z).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ut(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ou()||null,typeof i==`boolean`?s:ws(i)||s||null}return()=>{y.off(`openchange`,i);let t=Hs(e),n=se(),r=X(v,t)||n.some(e=>e===t||X(e,t))||k&&xl(k.nodesRef.current,x(),!1).some(e=>X(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};ce.current=l,queueMicrotask(()=>{ce.current===l&&(ce.current=null);let n=su(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&<(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,z,T,E,D,y,k,_,x,se]),W(()=>{if(!es||g||!v)return;let e=Hs(Jr(v));lt(e)&&tc(e)&&X(v,e)&&e.blur()},[g,v]),W(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),W(()=>{if(!r&&z)return cu(z),()=>{queueMicrotask(iu)}},[r,z]);let B=!r&&(!c||!C)&&(ae||c);return(0,q.jsxs)(K.Fragment,{children:[B&&(0,q.jsx)(gc,{"data-type":`inside`,ref:te,onFocus:e=>{if(c){let e=oe();Tl(e[e.length-1])}else A?.portalNode&&(j.current=!1,vl(e,A.portalNode)?hl(_)?.focus():ws(f??A.beforeOutsideRef)?.focus())}}),n,B&&(0,q.jsx)(gc,{"data-type":`inside`,ref:ne,onFocus:e=>{c?Tl(oe()[0]):A?.portalNode&&(l&&(j.current=!0),vl(e,A.portalNode)?gl(_)?.focus():ws(d??A.afterOutsideRef)?.focus())}})]})}function uu(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Eo}=t,l=e.context.dataRef,u=K.useRef(void 0),d=Ss(),f=Fs(),p=K.useMemo(()=>{function t(t,n,r,i){let a=gs(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Bs(e.pointerType,!0)&&zs(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Bs(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Ws(s),p=tc(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Bs(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return K.useMemo(()=>n?{reference:p}:Pt,[n,p])}function du(){return!1}function fu(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function pu(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=du,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Zl(c),m=U(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=U(()=>a),{escapeKey:v,outsidePress:y}=fu(s),b=K.useRef(!1),x=K.useRef(!1),S=K.useRef(!1),C=K.useRef(!1),w=K.useRef(!1),T=K.useRef(``),E=K.useRef(null),D=Fs(),O=Fs(),k=Fs(),A=U(()=>{O.clear(),d.current.insideReactTree=!1}),j=U(e=>{let t=d.current.floatingContext?.nodeId;return(p?xl(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=U(t=>$s(t,e.select(`floatingElement`))||$s(t,e.select(`domReferenceElement`))),N=U(t=>{o()&&e.setOpen(!1,gs(Eo,t.nativeEvent))}),P=U(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Ls(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=gs(Mo,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=U(()=>{d.current.insideReactTree=!0,O.start(0,A)}),ee=U(t=>{if(!l||!n||t.button!==0)return;let r=Ws(t.nativeEvent);X(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),I=U(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});K.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),K.useEffect(()=>A,[A]),K.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Ps,i=Jr(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(es?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&xl(p.nodesRef.current,t).some(t=>$s(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=Ws(n),i=`[${Cl(`inert`)}]`,a=At(r)?r.getRootNode():null,o=Array.from((yt(a)?a:Jr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>X(e,r))))return;let c=At(r)?r:null;for(;c&&!kt(c);){let e=ft(c);if(kt(e)||!At(e))break;c=e}if(!(o.length&&At(r)&&!ec(r)&&!X(r,e.select(`floatingElement`))&&o.every(e=>!X(c,e)))){if(lt(r)&&!(`touches`in n)){let e=kt(r),t=Ht(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!Rs(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}(typeof h!=`function`||h(n))&&(j(`__outsidePressBubbles`)||(e.setOpen(!1,gs(ko,n)),A()))}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function ee(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function I(e,t){let n=Ws(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function L(e){T.current=`touch`,I(e,ee)}function te(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&I(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function ne(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function re(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function R(e){I(e,re)}function ie(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function ae(e){I(e,ie)}let z=dc(r&&dc(Z(i,`keydown`,P),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),g&&dc(Z(i,`click`,te,!0),Z(i,`pointerdown`,te,!0),Z(i,`pointerup`,ne,!0),Z(i,`pointercancel`,ne,!0),Z(i,`mousedown`,te,!0),Z(i,`mouseup`,ne,!0),Z(i,`touchstart`,L,{capture:!0,passive:!0}),Z(i,`touchmove`,R,{capture:!0,passive:!0}),Z(i,`touchend`,ae,{capture:!0,passive:!0})));return()=>{z(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let L=K.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),te=K.useMemo(()=>({onKeyDown:P,onPointerDown:I,onMouseDown:I,onClickCapture:F,onMouseDownCapture(e){F(),ee(e)},onPointerDownCapture(e){F(),ee(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,ee,I]);return K.useMemo(()=>n?{reference:L,floating:te,trigger:L}:{},[n,L,te])}function mu(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),W(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};At(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function hu(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=U(i),{mounted:c,setMounted:l,transitionStatus:u}=Cs(t,!1,!1,o),d=!t&&r;W(()=>{t&&s(!1)},[t,s]);let f=K.useRef(c),p=K.useRef(!1),m=us(),h=()=>{f.current=!1,l(!1),a()};W(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=U(()=>{f.current&&(t?(p.current=!0,m()):h())});return As({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var gu={tabIndex:-1,[Gs]:``};function _u({handle:e,store:t}){return W(()=>e.attachStore(t),[e,t]),null}function vu(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function yu(e,t){let n=K.useRef(null);return U(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),vu(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),vu(t))})}function bu(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function xu(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Su(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=yu(e,n),o=U(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=U(e=>{a(e),e&&o(e)});return W(()=>(s(t.current),()=>s(null)),[s,t,n,e]),W(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Cu(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=K.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);W(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=gs(To);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function wu(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=hu({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return St(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Tu(e,t){e.useSyncedValues(t),W(()=>()=>{e.update({activeTriggerProps:Pt,inactiveTriggerProps:Pt,popupProps:Pt})},[e])}var Eu=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Du=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Ou=e(((e,t)=>{t.exports=Du()})),ku=e((e=>{var n=t(),r=Ou();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Au=e(((e,t)=>{t.exports=ku()})),ju=[],Mu=void 0;function Nu(){return Mu}function Pu(e){ju.push(e)}function Fu(e){let t=(t,n)=>{let r=St(Lu).current,i;try{Mu=r;for(let e of ju)e.before(r);i=e(t,n);for(let e of ju)e.after(r);r.didInitialize=!0}finally{Mu=void 0}return i};return t.displayName=e.displayName||e.name,t}function Iu(e){return K.forwardRef(Fu(e))}function Lu(){return{didInitialize:!1}}var Ru=Ou(),zu=i(Au(),1),Bu=Tt(19)?Uu:Wu;function Vu(e,t,n,r,i){return Bu(e,t,n,r,i)}function Hu(e,t,n,r,i){let a=K.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Ru.useSyncExternalStore)(e.subscribe,a,a)}Pu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Ru.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Uu(e,t,n,r,i){let a=Nu();if(!a)return Hu(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Wu(e,t,n,r,i){return(0,zu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Gu=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Vu(this,e,t,n,r)}},Ku=class extends Gu{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){K.useDebugValue(e);let n=this;W(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;W(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);W(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){K.useDebugValue(e);let n=this,r=t!==void 0;W(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return K.useDebugValue(e),Vu(this,this.selectors[e],t,n,r)}useContextCallback(e,t){K.useDebugValue(e);let n=U(t??Lt);this.context[e]=n}useStateSetter(e){let t=K.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},qu={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Ju=class extends Ku{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Kl(),nested:n,triggerElements:i},qu),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Vs(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Yu(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ju({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Pt,inactiveTriggerProps:Pt,popupProps:Pt}}var Q=e=>e.triggerIdProp??e.activeTriggerId,$=e=>e.openProp??e.open,Xu=e=>(e.popupElement?.id??e.floatingId)||void 0;function Zu(e,t){return t!==void 0&&$(e)&&Q(e)===t}function Qu(e,t){return Zu(e,t)?!0:t!==void 0&&$(e)&&Q(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var $u={open:$,mounted:e=>e.mounted,transitionStatus:e=>$(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Q,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Xu,isTriggerActive:(e,t)=>t!==void 0&&Q(e)===t,isOpenedByTrigger:(e,t)=>Zu(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Q(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Qu(e,t)?Xu(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ed(e){let t=K.useCallback(t=>e===void 0?Lt:e.subscribeStore(t),[e]),n=K.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Ru.useSyncExternalStore)(t,n,()=>e?.serverStore)}var td=Qo&&es;function nd(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=K.useRef(!1),s=K.useRef(null),c=K.useRef(!0),l=Fs();K.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=dt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&<(t)&&t===Hs(Jr(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return dc(Z(r,`blur`,i),td&&Z(r,`keydown`,a,!0),td&&Z(r,`pointerdown`,l,!0))},[e,n]),K.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);At(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=K.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Ws(n.nativeEvent);if(At(a)){if(td&&!n.relatedTarget){if(!c.current&&!tc(a))return}else if(!ic(a))return}let u=Qs(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,gs(Oo,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,gs(Oo,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=At(r)&&r.hasAttribute(Cl(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Hs(Jr(t));(r||n!==t)&&(X(a.current.floatingContext?.refs.floating.current,n)||X(t,n)||o||Qs(r??n,e.context.triggerElements)||e.setOpen(!1,gs(Oo,i)))})}}},[a,r,e,l]);return K.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var rd=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ps;restTimeout=new Ps;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},id=new WeakMap;function ad(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&id.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),id.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function od(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=id.get(n);a&&a!==e&&ad(a),ad(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,id.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function sd(e){let t=e.context.dataRef.current,n=St(()=>t.hoverInteractionState??rd.create()).current;return t.hoverInteractionState||=n,vs(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function cd(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Zl(),u=Xl(),d=sd(e),f=Fs(),p=U(()=>lc(c.current.openEvent?.type,d.interactedInside)),m=U(()=>uc(c.current.openEvent?.type)),h=U(()=>{ad(d)});W(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),K.useEffect(()=>h,[h]),W(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&At(s)&&o){let e=s,t=o,n=Jr(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Us(e,`[data-rootownerid]`)??n.body;return od(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),K.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&xl(l.nodesRef.current,u).length>0)}function a(t){let n=sc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,gs(Do,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Ws(e);nc(t)?d.interactedInside=Us(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Qs(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&At(o)&&xl(l.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,gs(Do,n)),l.events.emit(`floating.closed`,n)})}let y=o;return dc(y&&Z(y,`mouseenter`,g),y&&Z(y,`mouseleave`,_),y&&Z(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var ld={current:null};function ud(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ld,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Zl(l),v=sd(e),y=K.useRef(!1),b=fc(i),x=fc(r),S=fc(o),C=fc(n),w=fc(p),T=fc(f),E=U(()=>lc(h.current.openEvent?.type,v.interactedInside)),D=U(()=>w.current?.()!==!1),O=U((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!X(t,n);if(!At(r))return!1;let a=r;return i.hasMatchingElement(e=>X(e,a))&&(!t||!X(t,a))}),k=U(()=>{v.handler&&=(Jr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=U(()=>{ad(v)});return u&&(v.handleCloseOptions=i?.__options),K.useEffect(()=>k,[k]),K.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Do,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),K.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=sc(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,gs(Do,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,gs(Do,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!At(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Bs(v.pointerType))return;let n=cc(S.current),r=sc(x.current,`open`,v.pointerType),i=Ws(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(At(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(X(t,i)){c=t;break}}At(o)&&At(s)&&!e.context.triggerElements.hasElement(o)&&X(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&At(c)&&At(s)&&X(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,gs(Do,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,gs(Do,t,c))}):g&&D()&&e.setOpen(!0,gs(Do,t,c)))}function o(n){if(E()){A();return}k();let r=Jr(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Qs(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!X(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){X(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Z(r,`mouseout`,l):void 0;return s?dc(Z(r,`mousemove`,i,{once:!0}),Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f):dc(Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),K.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!Bs(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;od(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=cc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,gs(Do,n,r))}v.pointerType===`touch`?Es.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function dd(e){return es&&e.movementX===0&&e.movementY===0}function fd(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function pd(e,t){return fd(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function md(e,t,n){return fd(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function hd(e,t,n){return fd(t,n?e===qs:e===Js,e===Xs)}function gd(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:fd(t,n?e===Js:e===qs,e===Ys)}function _d(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=ac(E),A=rc(D),j=fc(k),M=Xl(),N=Zl(x),P=K.useRef(f),F=K.useRef(o??-1),ee=K.useRef(null),I=K.useRef(!0),L=U(e=>{i(F.current===-1?null:F.current,e)}),te=K.useRef(!!E),ne=K.useRef(T),re=K.useRef(!1),R=K.useRef(!1),ie=K.useRef(null),ae=fc(h),z=fc(T),oe=fc(o),se=fc(b),ce=Ss(),B=Ss(),V=U(()=>{ce.cancel();function e(e){d||(ie.current=Tl(e,{sync:re.current,preventScroll:!0}))}let t=n.current[F.current],r=R.current;t&&e(t),(re.current?e=>e():e=>ce.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});W(()=>{O.current.orientation=g},[O,g]),W(()=>{T||(ee.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),W(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(R.current=!0,L())):te.current&&(F.current=-1,L()))},[a,T,E,o,L]),W(()=>{if(a){if(!T)re.current=!1;else if(E){if(r==null){if(re.current=!1,oe.current!=null)return;if(te.current&&(F.current=-1,V()),(!ne.current||!te.current)&&P.current&&(ee.current!=null||P.current===!0&&ee.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>B.request(e):queueMicrotask)(t),e+=1):(F.current=ee.current==null||md(ee.current,_,u)||l?Gc(n):Kc(n),ee.current=null,L())};t()}}else Wc(n.current,r)||(F.current=r,V(),R.current=!1)}}},[a,T,E,r,oe,l,n,_,u,L,V,B]),W(()=>{if(!a||E||!N||d||!te.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=Hs(Jr(D??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),W(()=>{ne.current=T,te.current=!!E});let H=r!=null,le=U(e=>{if(!z.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,L(e))}),ue=U(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=U(()=>Gc(n,ae.current)),fe=U(t=>{if(I.current=!1,re.current=!0,t.which===229||!z.current&&t.currentTarget===j.current)return;if(l&&gd(t.key,g,u,w)){pd(t.key,ue())||Is(t),e.setOpen(!1,gs(No,t.nativeEvent));let n=S?.current??D;lt(n)&&n.focus();return}r!=null&&r!==F.current&&!Wc(n.current,r)&&(F.current=r);let i=F.current,a=Gc(n,h),o=Kc(n,h);if(A||(t.key===`Home`&&(Is(t),F.current=a,L(t)),t.key===`End`&&(Is(t),F.current=o,L(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,L(t)),g===`both`)return}if(pd(t.key,g)){Is(t);let e=Hs(t.currentTarget.ownerDocument);if(T&&!d&&X(t.currentTarget,e)&&!n.current.some(t=>t!=null&&X(t,e))){F.current=md(t.key,g,u)?a:o,L(t),r===F.current&&V();return}let{index:l,wrapped:f}=qc(n.current,i,{decrement:!md(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(re.current=!1),F.current=l,L(t)}}),pe=K.useMemo(()=>({onFocus(e){re.current=!0,le(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){dd(e)||(re.current=!0,R.current=!1,p&&le(e))},onPointerLeave(e){if(!z.current||!I.current||e.pointerType===`touch`)return;re.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&se.current&&(ie.current?.(),ie.current=null,F.current=-1,L(e),!d)){let e=j.current,t=Hs(Jr(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[le,z,j,p,n,L,se,d]),me=K.useMemo(()=>d&&T&&H&&{"aria-activedescendant":`${y}-${r}`},[d,T,H,y,r]),he=K.useMemo(()=>({...A?{}:me,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=Ws(t.nativeEvent);if(n&&!X(j.current,n))return;Is(t);let r=gs(jo,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&<(i)&&i.focus()}else fe(t)},onPointerMove(e){dd(e)||(I.current=!0)}}),[me,fe,j,A,e,T,d,D,S]),ge=K.useMemo(()=>{function t(t){e.setOpen(!0,gs(No,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Rs(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&zs(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);I.current=!1;let i=n.key.startsWith(`Arrow`),a=hd(n.key,ue(),u),o=pd(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||tc(n.currentTarget)))return fe(n);if(r||m||!i){if(s){let e=pd(n.key,ue());ee.current=l&&e?null:n.key}l?a&&(Is(n),r?(F.current=de(),L(n),d&&j.current?.focus()):t(n)):o&&(oe.current!=null&&(F.current=oe.current),Is(n),!r&&m?t(n):fe(n),r&&L(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,L(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[fe,f,de,l,L,e,m,g,_,ue,u,oe,d,j]),_e=K.useMemo(()=>({...me,...ge}),[me,ge]);return K.useMemo(()=>a?{reference:_e,floating:he,item:pe,trigger:ge}:{},[a,_e,he,ge,pe])}function vd(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=U(s),f=e.useState(`open`),p=Fs(),m=K.useRef(``),h=K.useRef(u??i??-1),g=K.useRef(null),_=U(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Zc(n)||n?.matches(`:disabled`)?!1:o==null||!Yc(Ct,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Is(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Is(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=U(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);X(r,n)||X(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});W(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=K.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return K.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var yd=.1,bd=yd*yd,xd=.5;function Sd(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Cd(e,t,n,r,i,a,o,s,c,l){let u=!1;return Sd(e,t,n,r,i,a)&&(u=!u),Sd(e,t,i,a,o,s)&&(u=!u),Sd(e,t,o,s,c,l)&&(u=!u),Sd(e,t,c,l,n,r)&&(u=!u),u}function wd(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Td(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Ed(e={}){let{blockPointerEvents:t=!1}=e,n=new Ps,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*bd;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Ws(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&At(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&xl(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Td(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Td(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Td(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Td(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!wd(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?xd/2:xd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+xd+1,o=C||T?S.bottom-xd:S.top,s=C?T?S.bottom-xd:S.top:S.bottom-xd;M=Cd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?xd/2:xd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-xd,o=C||T?S.top+xd:S.bottom,s=C?T?S.top+xd:S.bottom:S.top+xd;M=Cd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?xd/2:xd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+xd+1,o=w||E?S.right-xd:S.left,s=w?E?S.right-xd:S.left:S.right-xd;M=Cd(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?xd/2:xd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-xd,o=w||E?S.left+xd:S.right,s=w?E?S.left+xd:S.right:S.left+xd;M=Cd(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Dd(e,t,n){let{reference:r,floating:i}=e,a=kc(t),o=Ac(t),s=Oc(o),c=Tc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ec(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Od(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=wc(t,e),p=Hc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Uc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Uc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var kd=50,Ad=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Od},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Dd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<kd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Dd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},jd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Tc(r),_=kc(o),v=Tc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bc(o)]:Mc(o)),x=p!==`none`;!d&&x&&b.push(...zc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=jc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===kc(t)||T.every(e=>kc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=kc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Md=new Set([`left`,`top`]);async function Nd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Tc(n),s=Ec(n),c=kc(n)===`y`,l=Md.has(o)?-1:1,u=a&&c?-1:1,d=wc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Pd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Nd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Fd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=wc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=kc(i),p=Dc(f),m=u[p],h=u[f],g=(e,t)=>Cc(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Id=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=wc(e,t),u={x:n,y:r},d=kc(i),f=Dc(d),p=u[f],m=u[d],h=wc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Md.has(Tc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ld=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=wc(e,t),c=await i.detectOverflow(t,s),l=Tc(n),u=Ec(n),d=kc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=_c(p-c[m],g),y=_c(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*vc(c.left,c.right):S=p-2*vc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Rd(e){let t=Ht(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=lt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=yc(n)!==a||yc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zd(e){return At(e)?e:e.contextElement}function Bd(e){let t=zd(e);if(!lt(t))return xc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Rd(t),o=(a?yc(n.width):n.width)/r,s=(a?yc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Vd=xc(0);function Hd(e){let t=dt(e);return!ht()||!t.visualViewport?Vd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ud(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===dt(e)}function Wd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zd(e),o=xc(1);t&&(r?At(r)&&(o=Bd(r)):o=Bd(e));let s=Ud(a,n,r)?Hd(a):xc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=dt(a),t=At(r)?dt(r):r,n=e,i=bt(n);for(;i&&t!==n;){let e=Bd(i),t=i.getBoundingClientRect(),r=Ht(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=dt(i),i=bt(n)}}return Uc({width:u,height:d,x:c,y:l})}function Gd(e,t){let n=Bt(e).scrollLeft;return t?t.left+n:Wd(Vt(e)).left+n}function Kd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gd(e,n),y:n.top+t.scrollTop}}function qd(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vt(r),s=t?mt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xc(1),u=xc(0),d=lt(r);if((d||!a)&&((ut(r)!==`body`||_t(o))&&(c=Bt(r)),d)){let e=Wd(r);l=Bd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Kd(o,c):xc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Jd(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Yd(e){let t=Bt(e),n=e.ownerDocument.body,r=vc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=vc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Gd(e),o=-t.scrollTop;return Ht(n).direction===`rtl`&&(a+=vc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xd=25;function Zd(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=dt(e),a=Vt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ht()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Gd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xd&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qd(e,t){let n=Wd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Bd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $d(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Zd(e,n,t);else if(t===`document`)r=Yd(Vt(e));else if(At(t))r=Qd(t,n);else{let n=Hd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Uc(r)}function ef(e,t){let n=t.get(e);if(n)return n;let r=xt(e,[],!1).filter(e=>At(e)&&ut(e)!==`body`),i=null,a=Ht(e).position===`fixed`,o=a?ft(e):e;for(;At(o)&&!kt(o);){let e=Ht(o),t=vt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ft(o)}return t.set(e,r),r}function tf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?mt(t)?[]:ef(t,this._c):[].concat(n),r],o=$d(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$d(t,a[e],i);s=vc(n.top,s),c=_c(n.right,c),l=_c(n.bottom,l),u=vc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nf(e){let{width:t,height:n}=Rd(e);return{width:t,height:n}}function rf(e,t,n){let r=lt(t),i=Vt(t),a=n===`fixed`,o=Wd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xc(0);if((r||!a)&&((ut(t)!==`body`||_t(i))&&(s=Bt(t)),r)){let e=Wd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Gd(i));let l=i&&!r&&!a?Kd(i,s):xc(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function af(e){return Ht(e).position===`static`}function of(e,t){if(!lt(e)||Ht(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vt(e)===n&&(n=n.ownerDocument.body),n}function sf(e,t){let n=dt(e);if(mt(e))return n;if(!lt(e)){let t=ft(e);for(;t&&!kt(t);){if(At(t)&&!af(t))return t;t=ft(t)}return n}let r=of(e,t);for(;r&&pt(r)&&af(r);)r=of(r,t);return r&&kt(r)&&af(r)&&!vt(r)?n:r||wt(e)||n}var cf=async function(e){let t=this.getOffsetParent||sf,n=this.getDimensions,r=await n(e.floating);return{reference:rf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lf(e){return Ht(e).direction===`rtl`}var uf={convertOffsetParentRelativeRectToViewportRelativeRect:qd,getDocumentElement:Vt,getClippingRect:tf,getOffsetParent:sf,getElementRects:cf,getClientRects:Jd,getDimensions:nf,getScale:Bd,isElement:At,isRTL:lf};function df(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ff(e,t,n){let r=null,i,a=Vt(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=bc(d),h=bc(a.clientWidth-(u+f)),g=bc(a.clientHeight-(d+p)),_=bc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vc(0,_c(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!df(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=dt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=zd(e),u=i||a?[...l?xt(l):[],...t?xt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ff(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wd(e):null;c&&g();function g(){let t=Wd(e);h&&!df(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var mf=Pd,hf=Fd,gf=jd,_f=Ld,vf=Id,yf=(e,t,n)=>{let r=new Map,i=n??{},a={...uf,...i.platform,_c:r};return Ad(e,t,{...i,platform:a})},bf=typeof document<`u`?K.useLayoutEffect:function(){};function xf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cf(e,t){let n=Sf(e);return Math.round(t*n)/n}function wf(e){let t=K.useRef(e);return bf(()=>{t.current=e}),t}function Tf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=K.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=K.useState(r);xf(f,r)||p(r);let[m,h]=K.useState(null),[g,_]=K.useState(null),v=K.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=K.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K.useRef(null),C=K.useRef(null),w=K.useRef(u),T=c!=null,E=wf(c),D=wf(i),O=wf(l),k=K.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!xf(w.current,t)&&(w.current=t,Es.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bf(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K.useRef(!1);bf(()=>(A.current=!0,()=>{A.current=!1}),[]),bf(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=K.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=K.useMemo(()=>({reference:b,floating:x}),[b,x]),N=K.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Cf(M.floating,u.x),r=Cf(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sf(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return K.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ef=(e,t)=>{let n=mf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Df=(e,t)=>{let n=hf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Of=(e,t)=>({fn:vf(e).fn,options:[e,t]}),kf=(e,t)=>{let n=gf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Af=(e,t)=>{let n=_f(e);return{name:n.name,fn:n.fn,options:[e,t]}},jf=K.createContext(void 0);function Mf(e){let t=K.useContext(jf);if(t===void 0&&!e)throw Error(Ft(69));return t}var Nf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Pf(e){return e===`starting`?Ll:Pt}var Ff=K.createContext(void 0);function If(){return K.useContext(Ff)}function Lf(e,t){let n=It(e.render);if(K.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Rf(e,t,n){let r=Lf(e,t),i=r===t?void 0:r;return[r,K.useCallback(e=>n?.(e?i:void 0),[i,n])]}function zf(e,t,n){let r=It(e.render),i=K.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Bf=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=io(),m=If(),{side:h,align:g}=no(),_=Mf(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,ee]=Rf(e,u,d),I=zf(e,C,N),L=w.type===`menu`?m:void 0,te=w.type===`context-menu`,ne=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(ne=()=>l.state.activeIndex===null&&P),As({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),K.useEffect(()=>{function e(e){l.setOpen(!1,gs(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),cd(D,{enabled:A&&!j&&!te&&w.type!==`menubar`,closeDelay:k});let re=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:R,handleFocus:ie}=(K.useContext(Ro)?.useParentHandoff??Hf)(l,w,v,f),ae={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},z=Ot(`div`,e,{state:ae,ref:[t,l.context.popupRef,re,ee],stateAttributesMapping:So,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":I},onKeyDown(e){L?.onPopupKeyDown?.(e),_&&Nf.has(e.key)&&e.stopPropagation()},onFocus:ie},Pf(y),c,{"data-rootownerid":E}]}),oe=w.type===void 0||te;(C||w.type===`menubar`&&T!==`outside-press`)&&(oe=!0);let se=L?.getReturnElement??R;return(0,q.jsx)(lu,{context:D,openInteractionType:M,modal:te,disabled:!x,returnFocus:a??se??oe,explicitReturnFocus:a===void 0&&se?!1:void 0,initialFocus:ne,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:z})}),Vf={parentVirtualFocusRef:void 0,handleFocus:void 0};function Hf(){return Vf}var Uf=K.forwardRef(function(e,t){let n=zo()?.Popup??Bf;return(0,q.jsx)(n,{...e,ref:t})}),Wf=K.createContext(void 0);function Gf(){let e=K.useContext(Wf);if(e===void 0)throw Error(Ft(32));return e}var Kf=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=io();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,q.jsx)(Wf.Provider,{value:n,children:(0,q.jsx)(Gl,{ref:t,...r,portalOwnerRole:o})})});function qf(e){return Tt(19)?e:e?`true`:void 0}function Jf(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=K.useState(null),d=K.useRef(null),f=Zl(n),p=K.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Tf({...e,elements:{...p,...l&&{reference:l}}}),h=K.useCallback(e=>{let t=At(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=K.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=K.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=K.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return W(()=>{o&&(d.current=o)},[o]),W(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),K.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var Yf=K.createContext(void 0);function Xf(){return K.useContext(Yf)?.direction??`ltr`}var Zf=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wc(e,t)||{};if(l==null)return{};let d=Hc(u),f={x:n,y:r},p=Ac(i),m=Oc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Cc(D,k,O),j=!c.arrow&&Ec(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Qf=(e,t)=>{let{name:n,fn:r}=Zf(e);return{name:n,fn:r,options:[e,t]}},$f={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},ep={sideX:`left`,sideY:`top`},tp=`--available-width`,np=`--available-height`,rp=`--anchor-width`,ip=`--anchor-height`,ap=`--transform-origin`,op=tp,sp=np;function cp(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function lp(e,t,n){let{rects:r,placement:i}=e;return{side:cp(t,Tc(i),n),align:Ec(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function up(e){return dp(e,Jf)}function dp(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=U(O),A=O?k:n,j=fc(n),M=fc(g),N=Xf()===`rtl`,[P,F]=K.useState(null);!g&&P!==null&&F(null);let ee=x===`placement`,I=P?Tc(P):null,L=P&&ee?Ec(P)||`center`:null,te=I||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],ne=L||o,re=ne===`center`?te:`${te}-${ne}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let ie=+(i===`bottom`),ae=+(i===`top`),z=+(i===`right`),oe=+(i===`left`),se={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},ce=K.useRef(null),B=fc(a),V=fc(s),H=typeof a==`function`?0:a,le=typeof s==`function`?0:s,ue=[];p&&ue.push(p),ue.push(Ef(e=>{let t=lp(e,i,N),n=typeof B.current==`function`?B.current(t):B.current,r=typeof V.current==`function`?V.current(t):V.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[H,le,N,i]));let de=w===`none`&&C!==`shift`,fe=!de&&(u||E||C===`shift`),pe=C===`none`?null:kf({...se,padding:{top:R.top+1+ie,right:R.right+1+oe,bottom:R.bottom+1+ae,left:R.left+1+z},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),me=de?null:Df({...se,rootBoundary:D,mainAxis:w!==`none`,crossAxis:fe,limiter:u||E?void 0:Of(e=>{if(!ce.current)return{};let{width:t,height:n}=ce.current.getBoundingClientRect(),r=kc(Tc(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[se,u,E,D,R,w]);C===`shift`||w===`shift`||ne===`center`?ue.push(me,pe):ue.push(pe,me),ue.push(Af({...se,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(op,`${t}px`),i.setProperty(sp,`${n}px`);let a=dt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(rp,`${u}px`),i.setProperty(ip,`${d}px`)}}),Qf(e=>({element:ce.current||Jr(e.elements.floating).createElement(`div`),padding:ce.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Tc(r),u=Ec(r),d=kc(l)===`y`,f=ce.current,p=typeof a==`function`?a(lp(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(ap,d?`${m} ${h}`:`${h} ${m}`),{}}},$f,b),W(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let he=K.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:ge,elements:_e,x:ve,y:ye,middlewareData:be,update:xe,placement:Se,context:Ce,isPositioned:we,floatingStyles:Te}=t({rootContext:h,open:m?g:void 0,placement:re,middleware:ue,strategy:r,whileElementsMounted:m?void 0:(...e)=>pf(...e,he),nodeId:y,externalTree:S}),{sideX:Ee,sideY:De}=be.adaptiveOrigin||ep,Oe=we?r:`fixed`,ke=K.useMemo(()=>{let e;return e=we?b?{position:Oe,[Ee]:ve,[De]:ye}:{...Te,position:Oe}:{position:Oe,top:0,left:0},e[op]=`100vw`,e[sp]=`100vh`,we||(e.opacity=0),e},[b,Oe,Ee,ve,De,ye,Te,we]),Ae=K.useRef(null);W(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(fp(t)?t.current:t)||null;n!==Ae.current&&(ge.setPositionReference(n),Ae.current=n)},[g,ge,A,j]),K.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&fp(e)&&e.current!==Ae.current&&(ge.setPositionReference(e.current),Ae.current=e.current)},[g,ge,A,j]),K.useEffect(()=>{if(m&&g&&_e.reference&&_e.floating)return pf(_e.reference,_e.floating,xe,he)},[m,g,_e,xe,he]);let je=Tc(Se),Me=cp(i,je,N),Ne=Ec(Se)||`center`,Pe=!!be.hide?.referenceHidden;W(()=>{x&&g&&we&&(je!==te||ee&&Ne!==ne)&&F(Se)},[x,ee,g,we,Se,je,Ne,te,ne]);let Fe=K.useMemo(()=>({position:`absolute`,top:be.arrow?.y,left:be.arrow?.x}),[be.arrow]),Ie=be.arrow?.centerOffset!==0;return K.useMemo(()=>({positionerStyles:ke,arrowStyles:Fe,arrowRef:ce,arrowUncentered:Ie,side:Me,align:Ne,physicalSide:je,anchorHidden:Pe,refs:ge,context:Ce,isPositioned:we,update:xe}),[ke,Fe,ce,Ie,Me,Ne,je,Pe,ge,Ce,we,xe])}function fp(e){return e!=null&&`current`in e}function pp(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=U(i),[,o]=K.useState(0),s=St(hp).current,c=St(mp).current,l=K.useRef(0),u=K.useRef(!0),d=K.useRef(null),f=K.useRef(null),p=U(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=U((e,t)=>{c.set(e,t),p()}),h=U(e=>{c.delete(e),p()}),g=U(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!vp(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&yp(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=_p(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=U(()=>{let[e,t]=gp(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});W(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),W(()=>{u.current&&v()}),W(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=U(e=>(s.add(e),()=>{s.delete(e)})),b=K.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,q.jsx)(ss.Provider,{value:b,children:t})}function mp(){return new Map}function hp(){return new Set}function gp(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>yp(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function _p(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function vp(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function yp(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var bp=K.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function xp(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=K.useRef(null),o=K.useRef(null),s=ks(r);W(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),W(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Sp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Ot(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Pf(r),i],stateAttributesMapping:xo})}var Cp={},wp={},Tp=``;function Ep(e,t){return _t(e)?e:t}function Dp(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ep(t,n)).overflowY)}function Op(e){if(typeof document>`u`)return!1;let t=Jr(e);return dt(t).innerWidth-t.documentElement.clientWidth>0}function kp(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Jr(e),n=t.documentElement,r=t.body,i=Ep(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ap(e){let t=Jr(e),n=t.documentElement,r=t.body,i=Ep(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function jp(e){let t=Jr(e),n=t.documentElement,r=t.body,i=dt(n),a=0,o=0,s=!1,c=xs.create();if(es&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Cp={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Tp=n.style.scrollBehavior,wp={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Ep(n,r);s=kp(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Cp),Object.assign(r.style,wp),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Tp)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Mp=new class{lockCount=0;restore=null;timeoutLock=Ps.create();timeoutUnlock=Ps.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Jr(e),n=t.documentElement,r=t.body,i=dt(n);if(Dp(i,n,r)){let t=new i.MutationObserver(()=>{Dp(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Yo||!Op(e);this.restore=a?Ap(e):jp(e)}};function Np(e=!0,t=null){W(()=>{if(e)return Mp.acquire(t)},[e,t])}var Pp=20;function Fp(e,t,n,r){let[i,a]=K.useState(!1);W(()=>{if(!e||!t||n==null){a(!1);return}let r=Jr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Pp)},[e,t,n]),Np(e&&(!t||i),r)}var Ip=K.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Rl,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=io(),x=Gf(),S=wo(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),ee=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=w.useState(`domReferenceElement`),te=n,ne=c,re=l,R=s,ie=h;C.type===`context-menu`&&(te=n??C.context?.anchor,R??=`start`,!o&&R!==`center`&&(re=e.alignOffset??2,ne=e.sideOffset??-5));let ae=o,z=R;C.type===`menu`?(ae??=`inline-end`,z??=`start`,ie=e.collisionAvoidance??zl):C.type===`menubar`&&(ae??=C.context.orientation===`vertical`?`inline-end`:`bottom`,z??=`start`);let oe=C.type===`context-menu`,se=up({anchor:te,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ae,sideOffset:ne,align:z,alignOffset:re,arrowPadding:oe?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:ee,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:ie,shift:oe?{crossAxis:!(`side`in ie&&ie.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});K.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===ee&&v.set(`hoverEnabled`,!1),e.nodeId!==ee&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,gs(Io)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,ee]),K.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,gs(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ce=Fs();K.useEffect(()=>{D||ce.clear()},[D,ce]),K.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ce.isStarted()||ce.start(e,()=>{v.setOpen(!1,gs(Io))}):v.setOpen(!1,gs(Io))}else ce.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ce]),K.useEffect(()=>{let e={open:D,nodeId:ee,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,ee,I]),xp({store:v,domReference:L,positionerElement:M,open:D});let B={open:D,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:C.type===`menu`,instant:N},V=C.type===`menubar`&&C.context.modal;Fp(D&&(V||O&&F!==`trigger-hover`),k===`touch`,M,A);let H=Sp(e,B,{styles:se.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),le=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ue=null;return C.type===`menubar`?ue=C.context.contentElement:C.type===void 0&&(ue=A),(0,q.jsxs)(to.Provider,{value:se,children:[le&&(0,q.jsx)(bp,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:qf(!D),cutout:ue}),(0,q.jsx)($l,{id:ee,children:(0,q.jsx)(pp,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:H})})]})}),Lp=K.createContext(null);function Rp(e){let t=K.useContext(Lp);if(t===null&&!e)throw Error(Ft(5));return t}function zp(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Bp(e,t){let n=K.useRef(e),r=U(t);W(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Vp(e,t){let{onClick:n,onPointerDown:r}=zp(U((n,r)=>{(typeof e==`function`?e():e)||t(r||(Yo?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Hp(e){let[t,n]=K.useState(null),r=Vp(e,n);return Bp(e,t=>{t&&!e&&n(null)}),K.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Up(e){return e==null?To:e.type.startsWith(`key`)?Po:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Y:To}var Wp={...$u,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=$u.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>es&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!$u.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Gp=class extends Ku{constructor(e,t,n=!1){let r=new Eu,i=qp(r,t,n,e);super(i,Kp(r),Wp),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Kp(e){return{positionerRef:K.createRef(),popupRef:K.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:K.createRef(),beforeTriggerFocusGuardRef:K.createRef(),beforeContentFocusGuardRef:K.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function qp(e,t,n=!1,r){return{...Yu(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Pt,inputProps:Pt,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ql,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Pt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Jp=K.createContext(null);function Yp(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Xp(e,t){return e===`list-navigation`||Yp(e,t)}var Zp=Fu(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=wo(!0),C=io(!0),w=Rp(!0),T=C?.store,E=C?.virtualFocus??!1,D=K.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=hs(),k=hs(),[A,j]=K.useState(void 0),M=(A??k)||void 0,N=Xl(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,ee=St(()=>F?P?.state.instantType:void 0).current,I=St(()=>{let e=new Gp({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:ee},M,N!=null);return e.context.virtualFocusRef=y,e}).current;I.useControlledProp(`openProp`,n),I.useControlledProp(`triggerIdProp`,m),I.useContextCallback(`onOpenChangeComplete`,i);let L=I.useState(`floatingTreeRoot`),te=Ql(L),ne=I.useState(`open`),re=I.useState(`activeTriggerElement`),R=I.useState(`positionerElement`),ie=I.useState(`hoverEnabled`),ae=I.useState(`disabled`),z=I.useState(`lastOpenChangeReason`),oe=I.useState(`parent`),se=I.useState(`activeIndex`),ce=I.useState(`keyboardOpen`),B=I.useState(`payload`),V=I.useState(`floatingParentNodeId`),H=K.useRef(null),le=K.useRef(oe.type!==`context-menu`),ue=Fs(),de=K.useRef(!0),fe=Fs(),pe=V!=null,{openMethod:me,triggerProps:he}=Hp(ne);I.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:oe.type===void 0?c:void 0,openMethod:me,rootId:O}),Cu(I);let{forceUnmount:ge,transitionStatus:_e}=wu(ne,I,()=>{I.set(`allowMouseEnter`,!1)},F),ve=ks(I.context.popupRef);K.useEffect(()=>{if(ee===void 0)return;let e=()=>{I.state.instantType===ee&&I.set(`instantType`,void 0)};if(!ne){e();return}if(_e!==void 0)return;if(I.context.popupRef.current==null){e();return}let t=new AbortController;return ve(e,t.signal),()=>{t.abort()}},[ee,ne,_e,ve,I]),W(()=>{S&&!C?I.update({parent:{type:`context-menu`,context:S},floatingNodeId:te,floatingParentNodeId:N}):(C||!I.select(`activeTriggerElement`))&&I.update({floatingNodeId:te,floatingParentNodeId:N})},[S,C,te,N,re,I]),K.useEffect(()=>{ne||(H.current=null),oe.type===`context-menu`&&(ne?ue.start(500,()=>{le.current=!0}):(ue.clear(),le.current=!1))},[ue,ne,oe.type]),W(()=>{!ne&&!ie&&I.set(`hoverEnabled`,!0)},[ne,ie,I]);let ye=U((e,t)=>{let n=t.reason;if(!e&&!I.select(`open`)||ne===e&&t.trigger===re&&z===n)return;let i=xu(t);if(!e&&t.trigger==null&&(t.trigger=re??void 0),r?.(e,t),t.isCanceled)return;I.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);H.current=t.event;let s=bu(I.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Xp(n,a),s.instantType=oe.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Yp(n,a)?`click`:o?`dismiss`:void 0,I.update(s)}),be=mu({popupStore:I,floatingRootContext:I.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:ye}),xe=be.context.events;W(()=>{let e=({open:e,eventDetails:t})=>ye(e,t);return xe.on(`setOpen`,e),()=>{xe?.off(`setOpen`,e)}},[xe,ye]),W(()=>I.subscribeToParentMenu(),[I]);let Se=K.useCallback(()=>{I.setOpen(!1,gs(Lo))},[I]);K.useImperativeHandle(d,()=>({unmount:ge,close:Se}),[ge,Se]);let Ce;oe.type===`context-menu`&&(Ce=oe.context),K.useImperativeHandle(Ce?.positionerRef,()=>R,[R]),K.useImperativeHandle(Ce?.actionsRef,()=>({setOpen:ye}),[ye]);let we=pu(be,{enabled:!ae,bubbles:{escapeKey:f&&oe.type===`menu`},outsidePress(){return oe.type!==`context-menu`||H.current?.type===`contextmenu`||le.current},externalTree:pe?L:void 0}),Te=Xf(),Ee=_d(be,{enabled:!ae,listRef:I.context.itemDomElements,activeIndex:se,virtual:v,nested:oe.type===`menubar`||!v&&oe.type!==void 0,parentOrientation:oe.type===`menubar`?oe.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?ce:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:Te===`rtl`,disabledIndices:Ct,onNavigate(e,t){I.setActiveIndex(e,Up(t),t?.nativeEvent)},openOnArrowKeyDown:oe.type!==`context-menu`&&!(v&&_),externalTree:!v&&pe?L:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),De=K.useCallback(e=>{I.context.typingRef.current=e},[I]),Oe=vd(be,{enabled:!ae&&!v,listRef:I.context.itemLabels,elementsRef:I.context.itemDomElements,activeIndex:se,resetMs:500,onMatch:(e,t)=>{ne&&e!==se&&I.setActiveIndex(e,Po,t.nativeEvent)},onTyping:De}),ke=U(a),Ae=K.useRef(-1),je=U(()=>{let e=I.state.activeIndex,t=e===null?void 0:I.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&I.context.reportedItem===t)return;Ae.current=n,I.context.reportedItem=t,v&&I.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=I.context;I.context.highlightReason=To,I.context.highlightEvent=void 0,a&&ke(t,_s(r,i,{label:t===void 0?void 0:I.context.itemLabels.current[n]??void 0}))});W(()=>{je()},[se,je]);let Me=K.useMemo(()=>{if(!v)return Ee.reference;if(!Ee.trigger)return Pt;let{onFocus:e,...t}=Ee.trigger;return t},[v,Ee.reference,Ee.trigger]);I.useSyncedValue(`inputProps`,v?Ee.reference??Pt:Pt);let Ne=K.useMemo(()=>{let e=Mt(Oe.reference,Me,we.reference,{onMouseMove(){I.set(`allowMouseEnter`,!0)}},he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=ne,e},[I,Oe.reference,Me,we.reference,he,ne]),Pe=K.useMemo(()=>{let e=Mt(Ee.trigger,we.trigger,he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,we.trigger,he]);St(()=>(I.update({inactiveTriggerProps:Pe}),null)),Tu(I,{floatingRootContext:be,activeTriggerProps:Ne,inactiveTriggerProps:Pe,popupProps:K.useMemo(()=>Mt(gu,{onMouseMove(){I.set(`allowMouseEnter`,!0),oe.type===`menu`&&I.set(`hoverEnabled`,!1)},onClick(){I.select(`hoverEnabled`)&&I.set(`hoverEnabled`,!1)},onKeyDown(e){let t=I.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,we.floating),[oe.type,I,Oe.floating,Ee.floating,we.floating]),itemProps:Ee.item??Pt});let Fe=K.useMemo(()=>({store:I,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:je}),[I,D,u,l,b,k,v,E,je]),Ie=typeof t==`function`?t({payload:B}):t,Le=(0,q.jsxs)(ro.Provider,{value:Fe,children:[p&&(0,q.jsx)(_u,{handle:p,store:I}),Ie]});return(oe.type===void 0||oe.type===`context-menu`)&&(Le=(0,q.jsx)(eu,{externalTree:L,children:Le})),Le});function Qp(e){let t=K.useContext(Jp);if(t===null)return(0,q.jsx)(Zp,{...e});let n=t.Root;return(0,q.jsx)(Jp.Provider,{value:null,children:(0,q.jsx)(n,{...t.options,...e})})}var $p=5;function em(e,t){let n=tm(t);return e.clientX>=n.left-$p&&e.clientX<=n.right+$p&&e.clientY>=n.top-$p&&e.clientY<=n.bottom+$p}function tm(e){let t=e.getBoundingClientRect(),n=dt(e);if(ns)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function nm(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Dt(),{ref:i,index:a}=ls(e),o=n===a,s=K.useRef(null),c=jt(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function rm(e){let{render:t,className:n,style:r,state:i=Pt,props:a=Ct,refs:o=Ct,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=nm({metadata:s});return Ot(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function im(e){if(lt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!kt(e))return im(ft(e))}function am(e,t){function n(n,r,i){let a=n.currentTarget;Es.flushSync(()=>{e.setOpen(!1,gs(jo,n.nativeEvent,a))}),_l(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&vl(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function om(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=K.useRef(!1);return K.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Jr(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Pt,[t,n,r])}var sm=Iu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=io(!0),h=ed(d)??m?.store;if(!h)throw Error(Ft(85));let g=hs(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=K.useRef(null),S=lm(),C=Dt(!0),w=Zl(),T=K.useMemo(()=>w??new ql,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Su(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:Ql(T),floatingParentNodeId:Xl(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Rt({disabled:A,native:o});K.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=K.useRef(null),P=Fs(),F=U(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(N.current,t)||X(h.select(`positionerElement`),t)||t===N.current||(t==null||im(t)!==h.select(`rootId`))&&(em(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:Fo}))});K.useEffect(()=>{let e=Jr(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let ee=O&&S.context.hasSubmenuOpen,I=ud(v,{enabled:(c??ee)&&!A&&(!O||ee&&!D),handleClose:Ed({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),L=cm(y,h.select(`lastOpenChangeReason`)),te=uu(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&L}),ne=nd(v,{enabled:!A&&ee}),re=om({open:y,enabled:O,mouseDownAction:`open`}),R=K.useMemo(()=>Mt(ne.reference,te.reference),[ne.reference,te.reference]),ie=h.useState(`triggerProps`,D),ae=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:z,handleFocusTargetFocus:oe}=am(h,x),se={disabled:A,open:y},ce=[N,t,M,E,x],B=[R,I??Pt,ie,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Jr(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},ae,O?{role:`menuitem`}:{},re,p,j],V=Ot(`button`,e,{enabled:!O,stateAttributesMapping:bo,state:se,ref:ce,props:B});return O?(0,q.jsx)(rm,{tag:`button`,render:n,className:r,style:i,state:se,refs:ce,props:B,stateAttributesMapping:bo}):y?(0,q.jsxs)(K.Fragment,{children:[(0,q.jsx)(gc,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:z},`${g}-pre-focus-guard`),(0,q.jsx)(K.Fragment,{children:V},g),(0,q.jsx)(gc,{ref:h.context.triggerFocusTargetRef,onFocus:oe},`${g}-post-focus-guard`)]}):(0,q.jsx)(K.Fragment,{children:V},g)});function cm(e,t){let n=Fs(),[r,i]=K.useState(!1);return W(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function lm(){let e=Rp(!0);return K.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function um({label:e,actions:t}){let n=(0,K.useSyncExternalStore)(qt,Kt),r=n===`unreachable`||n===`retrying`;return(0,q.jsxs)(Qp,{children:[(0,q.jsx)(sm,{"aria-label":e,title:`More actions`,className:Nt({variant:`outline`,size:`icon-xs`}),children:(0,q.jsx)(Un,{})}),(0,q.jsx)(Kf,{children:(0,q.jsx)(Ip,{side:`bottom`,align:`end`,sideOffset:4,className:`z-50`,children:(0,q.jsx)(Uf,{"aria-label":e,finalFocus:()=>!(document.activeElement instanceof HTMLElement&&document.activeElement.matches(`input, textarea, select`)),className:`flex min-w-44 flex-col rounded-lg border bg-popover p-1 text-sm text-popover-foreground shadow-lg outline-none`,children:t.map(e=>(0,q.jsxs)(Ms,{"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled||e.changesData&&r,onClick:e.onSelect,className:a(`flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-muted max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0`,e.destructive?`text-destructive data-[highlighted]:bg-destructive/10 dark:data-[highlighted]:bg-destructive/20`:`[&_svg]:text-muted-foreground`),children:[e.icon,e.label]},e.key))})})})]})}var dm={completed:`Completed`,opened_for_review:Xr.in_review,started:`Started`,worked_on:`Worked on`,planned:`Planned`},fm=Object.keys(dm),pm={week:`week`,month:`month`,quarter:`quarter`,year:`year`,custom:`period`},mm={week:`Week review`,month:`Month review`,quarter:`Quarter review`,year:`Year review`,custom:`Review`};function hm(e){let[t,n,r]=e.split(`-`).map(Number);return[t,n-1,r]}function gm(e,t=0){let[n,r,i]=hm(e);return new Date(n,r,i+t)}function _m(e){return li(e.getTime()/1e3)}function vm(e){let t=(e.getDay()+6)%7;return _m(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t))}function ym(e,t){return _m(gm(e,t))}function bm(e){return{kind:`week`,from:e,to:ym(e,6)}}var xm={month:1,quarter:3,year:12};function Sm(e,t,n){let r=xm[e];return{kind:e,from:_m(new Date(t,n,1)),to:_m(new Date(t,n+r,0))}}function Cm(e,t){let[n,r]=hm(t);switch(e){case`week`:return bm(vm(gm(t)));case`month`:return Sm(e,n,r);case`quarter`:return Sm(e,n,r-r%3);case`year`:return Sm(e,n,0);case`custom`:return{kind:e,from:t,to:t}}}function wm(e,t){switch(e.kind){case`week`:return bm(ym(e.from,7*t));case`month`:case`quarter`:case`year`:{let[n,r]=hm(e.from);return Sm(e.kind,n,r+xm[e.kind]*t)}case`custom`:{let n=Tm(e);return{kind:`custom`,from:ym(e.from,n*t),to:ym(e.to,n*t)}}}}function Tm(e){return Math.round((gm(e.to,1).getTime()-gm(e.from).getTime())/864e5)}function Em(e){return{start:gm(e.from).getTime()/1e3,end:gm(e.to,1).getTime()/1e3}}function Dm(e){let[t,n]=hm(e.from);switch(e.kind){case`month`:return e.from.slice(0,7);case`quarter`:return`${t} Q${Math.floor(n/3)+1}`;case`year`:return String(t);case`week`:case`custom`:return`${e.from} to ${e.to}`}}function Om(e){return fm.flatMap(t=>{let n=e.filter(e=>e.outcome===t);return n.length===0?[]:[{outcome:t,entries:n}]})}function km(e){return e.split(`
|
|
11
11
|
`,1)[0]}function Am(e,t){return`${e} ${e===1?t:`${t}s`}`}function jm(e){return/\/pull\/(\d+)/.exec(e)?.[1]??null}function Mm(e){return`#${e.number}, +${e.additions}/-${e.deletions} in ${Am(e.changedFiles,`file`)}, ${Am(e.reviewCount,`review`)}`}function Nm(e){return e.split(/\s*\n\s*/).join(` `)}function Pm(e){switch(e.resolution){case`merged`:return`Merged`;case`completed`:return`Completed`;case`not_adopted`:return`Not adopted`;case null:return null}}function Fm(e){if(e.length===0)return null;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return{median:t.length%2==1?t[n]:(t[n-1]+t[n])/2,tasks:t.length}}function Im(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return[...t].map(([e,t])=>({key:e,count:t})).sort((e,t)=>t.count-e.count||e.key.localeCompare(t.key))}function Lm(e,t){return e.flatMap(e=>{let[n,r]=t(e);return n===null||r===null?[]:[r-n]})}function Rm(e,t,n){let r=new Map(n.map(e=>[e.id,e.name])),i=t.filter(e=>e.outcome===`completed`),a=Ym(e),o=i.flatMap(({task:e})=>e.pullRequest?[e.pullRequest]:[]);return{outcomes:Om(t).map(e=>({outcome:e.outcome,count:e.entries.length})),commits:t.reduce((e,t)=>e+t.commits.length,0),completedByType:Im(i.map(e=>e.task.taskType)).map(({key:e,count:t})=>({taskType:e,count:t})),completedByWorkspace:Im(i.map(e=>r.get(e.task.workspaceId)??`workspace ${e.task.workspaceId}`)).map(({key:e,count:t})=>({workspace:e,count:t})),leadTime:Fm(Lm(i,({task:e,at:t})=>[e.milestones.plannedAt,t])),cycleTime:Fm(Lm(i,({task:e,at:t})=>[e.milestones.startedAt,t])),activeTime:Fm(i.flatMap(({task:e,at:t})=>{let n=hi(e.timeline,t);return n===null?[]:[n]})),reviewTime:Fm(Lm(i,({task:e,at:t})=>[e.milestones.reviewAt,e.pullRequestMergedAt??t])),completedPerMonth:a.length<2?null:a.map(e=>({month:e,count:i.filter(t=>li(t.at).startsWith(e)).length})),changes:o.length===0?null:o.reduce((e,t)=>({pullRequests:e.pullRequests+1,additions:e.additions+t.additions,deletions:e.deletions+t.deletions,changedFiles:e.changedFiles+t.changedFiles}),{pullRequests:0,additions:0,deletions:0,changedFiles:0}),notAdopted:i.filter(({task:e})=>e.resolution===`not_adopted`).length}}function zm(e,t,n){let r=Math.min(n,Em(e).end),i=t.filter(e=>e.outcome===`completed`),a=i.flatMap(({task:e,at:t})=>{let n=Fi(e.estimate),r=hi(e.timeline,t);return n===null||r===null?[]:[{estimated:n,actual:r}]}),o=i.flatMap(({task:e})=>{let t=ki(e,n);return t===`on_time`||t===`late`?[t]:[]}),s=t.flatMap(({task:e,outcome:t})=>{if(e.dueDate===null)return[];if(e.status===`done`)return t===`completed`&&ki(e,n)===`late`?[{task:e,dueDate:e.dueDate,done:!0,secondsLate:Ai(e,n)}]:[];let i=Oi(e.dueDate);return r>=i?[{task:e,dueDate:e.dueDate,done:!1,secondsLate:r-i}]:[]}).sort((e,t)=>t.secondsLate-e.secondsLate||e.task.id-t.task.id);return t.some(({task:e})=>e.estimate!==null||e.dueDate!==null)?{time:a.length===0?null:{tasks:a.length,estimated:a.reduce((e,{estimated:t})=>e+t,0),actual:a.reduce((e,{actual:t})=>e+t,0)},dueDates:o.length===0?null:{tasks:o.length,onTime:o.filter(e=>e===`on_time`).length},late:s}:null}function Bm(e){return`${Xm(e.estimated)} estimated, ${Xm(e.actual)} active (${Am(e.tasks,`task`)}, ${(e.actual/e.estimated).toFixed(2)}x)`}function Vm(e){return`${e.onTime} of ${e.tasks} (${Math.round(e.onTime/e.tasks*100)}%)`}function Hm({task:e,dueDate:t,done:n,secondsLate:r}){let i=e.milestones.completedAt;return`due ${t}, ${n&&i!==null?`done ${li(i)}`:`still open`}, ${Xm(r)} ${n?`late`:`overdue`}`}var Um=3,Wm=3;function Gm(e){let t=e.filter(e=>e.outcome===`completed`),n=t.flatMap(({task:e})=>e.pullRequest?[{task:e,pullRequest:e.pullRequest}]:[]),r=t.filter(({task:e})=>e.taskType===`rnd`).map(({task:e,at:t})=>({task:e,at:t,adopted:e.resolution!==`not_adopted`})).sort((e,t)=>e.at-t.at||e.task.id-t.task.id),i=t.flatMap(({task:e,at:t})=>{let n=Fi(e.estimate),r=hi(e.timeline,t);return n===null||r===null||r<=n?[]:[{task:e,estimated:n,actual:r}]}).sort((e,t)=>t.actual-t.estimated-(e.actual-e.estimated)||e.task.id-t.task.id).slice(0,Wm);if(n.length===0&&r.length===0&&i.length===0)return null;let a=({pullRequest:e})=>e.additions+e.deletions;return{pullRequests:n.length===0?null:n.reduce((e,{pullRequest:t})=>({pullRequests:e.pullRequests+1,additions:e.additions+t.additions,deletions:e.deletions+t.deletions,changedFiles:e.changedFiles+t.changedFiles,reviews:e.reviews+t.reviewCount,reviewed:e.reviewed+ +(t.reviewCount>0)}),{pullRequests:0,additions:0,deletions:0,changedFiles:0,reviews:0,reviewed:0}),largest:[...n].sort((e,t)=>a(t)-a(e)||e.task.id-t.task.id).slice(0,Um),research:r,overruns:i}}function Km(e){return`${Am(e.reviews,`review`)} on ${e.reviewed} of ${Am(e.pullRequests,`pull request`)}`}function qm(e){let t=[`## Year in review`,``];if(e.pullRequests&&t.push(`- Merged pull requests: ${Jm(e.pullRequests)}`,`- Reviews: ${Km(e.pullRequests)}`),e.largest.length>0){t.push(`- Largest pull requests:`);for(let{task:n,pullRequest:r}of e.largest)t.push(` - [${n.taskType}] ${n.title} (${Mm(r)})`)}if(e.research.length>0){t.push(`- Research conclusions:`);for(let{task:n,adopted:r}of e.research){let e=n.completionNote?`: ${Nm(n.completionNote)}`:``;t.push(` - ${n.title} (${r?`adopted`:`not adopted`})${e}`)}}if(e.overruns.length>0){t.push(`- Largest estimate overruns:`);for(let{task:n,estimated:r,actual:i}of e.overruns)t.push(` - [${n.taskType}] ${n.title} (estimated ${Xm(r)}, ${Xm(i)} active)`)}return t.push(``),t}function Jm(e){return`+${e.additions}/-${e.deletions} in ${Am(e.changedFiles,`file`)} (${Am(e.pullRequests,`pull request`)})`}function Ym(e){let[t,n]=hm(e.from),r=e.to.slice(0,7),i=[];for(let e=0;;e+=1){let a=_m(new Date(t,n+e,1)).slice(0,7);if(i.push(a),a>=r)return i}}function Xm(e){let t=e/3600;return t<1?`<1h`:Math.round(t)<24?`${Math.round(t)}h`:`${(t/24).toFixed(1)}d`}function Zm(e){return e===null?`no data`:`${Xm(e.median)} (${e.tasks} ${e.tasks===1?`task`:`tasks`})`}var Qm=[`leadTime`,`cycleTime`,`activeTime`,`reviewTime`],$m={leadTime:`Median lead time (planned to completed)`,cycleTime:`Median cycle time (started to completed)`,activeTime:`Median active time (started to completed, without pauses)`,reviewTime:`Median review time (awaiting completion to merged)`};function eh(e,t,n,r){let i=new Map(n.map(e=>[e.id,e.name])),a=[`# ${mm[e.kind]}: ${Dm(e)}`,``],o=Om(t);if(o.length===0)return a.push(`No recorded activity.`,``),a.join(`
|
|
12
12
|
`);let s=Rm(e,t,n);a.push(`## Summary`,``,`- ${s.outcomes.map(({outcome:e,count:t})=>`${dm[e]}: ${t}`).join(`, `)}`,`- Commits: ${s.commits}`),s.notAdopted>0&&a.push(`- Concluded without merging (not adopted): ${s.notAdopted}`),s.completedByType.length>0&&a.push(`- Completed by type: ${s.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)}`,`- Completed by workspace: ${s.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)}`),s.changes&&a.push(`- Changes in completed pull requests: ${Jm(s.changes)}`);for(let e of Qm)a.push(`- ${$m[e]}: ${Zm(s[e])}`);let c=zm(e,t,r);if(c?.time&&a.push(`- Estimate vs active time: ${Bm(c.time)}`),c?.dueDates&&a.push(`- Due dates met: ${Vm(c.dueDates)}`),a.push(``),c&&c.late.length>0){a.push(`## Late (${c.late.length})`,``);for(let e of c.late)a.push(`- [${e.task.taskType}] ${e.task.title} (${Hm(e)})`);a.push(``)}let l=e.kind===`year`?Gm(t):null;if(l&&a.push(...qm(l)),s.completedPerMonth){a.push(`| Month | Completed |`,`| --- | --- |`);for(let{month:e,count:t}of s.completedPerMonth)a.push(`| ${e} | ${t} |`);a.push(``)}let{start:u,end:d}=Em(e);for(let e of o){a.push(`## ${dm[e.outcome]} (${e.entries.length})`,``);for(let{task:t,at:n,commits:r}of e.entries){let e=t.resolution===`not_adopted`,o=[i.get(t.workspaceId)??`workspace ${t.workspaceId}`,li(n)];e&&o.push(`not adopted`),t.resolution===`completed`&&o.push(`Completed`),t.estimate&&o.push(`estimate ${Pi(t.estimate)}`),t.dueDate&&o.push(`due ${t.dueDate}`),t.issue&&o.push(t.issue.url),t.pullRequestUrl&&o.push(t.pullRequestUrl),t.pullRequest&&o.push(Mm(t.pullRequest)),a.push(`- [${t.taskType}] ${t.title} (${o.join(`, `)})`),t.completionNote&&a.push(` - ${e?`Conclusion`:`Note`}: ${Nm(t.completionNote)}`);for(let e of t.notes)e.at>=u&&e.at<d&&a.push(` - ${e.kind===`blocker`?`Blocker`:`Progress`}: ${Nm(e.body)}`);for(let e of r)a.push(` - \`${e.sha.slice(0,7)}\` ${km(e.message)}`)}a.push(``)}return a.join(`
|
|
13
13
|
`)}function th(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${li(e)} ${n(t.getHours())}:${n(t.getMinutes())}`}function nh(e){let t=e===null?``:String(e);return/[",\r\n]/.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}var rh=[`Task`,`Workspace`,`Type`,`Title`,`Outcome`,`Outcome at`,`Resolution`,`Planned`,`Started`,`Awaiting completion`,`Completed`,`Merged`,`Pull request`,`Issue`,`Commits in period`,`Active hours`,`Estimate`,`Estimate unit`,`Due date`,`Due status`,`Additions`,`Deletions`,`Changed files`,`Reviews`,`Completion note`];function ih(e,t,n){let r=new Map(t.map(e=>[e.id,e.name])),i=e=>e===null?null:th(e);return`\uFEFF${[rh,...e.map(({task:e,outcome:t,at:a,commits:o})=>[e.id,r.get(e.workspaceId)??`workspace ${e.workspaceId}`,e.taskType,e.title,dm[t],th(a),Pm(e),i(e.milestones.plannedAt),i(e.milestones.startedAt),i(e.milestones.reviewAt),i(e.milestones.completedAt),i(e.pullRequestMergedAt),e.pullRequestUrl,e.issue?.url??null,o.length,oh(hi(e.timeline,n)),e.estimate?.amount??null,e.estimate?.unit??null,e.dueDate,ah(e,n),e.pullRequest?.additions??null,e.pullRequest?.deletions??null,e.pullRequest?.changedFiles??null,e.pullRequest?.reviewCount??null,e.completionNote&&Nm(e.completionNote)])].map(e=>e.map(nh).join(`,`)).join(`\r
|
|
14
14
|
`)}\r\n`}function ah(e,t){let n=ki(e,t);return n===null?null:n===`upcoming`?`Not due yet`:Di[n]}function oh(e){return e===null?null:Math.round(e/360)/10}function sh(e,t){return`toodo-review-${Dm(e).replaceAll(` `,`-`)}.${t}`}var ch=[`planned`,`ready`,`paused`,`in_progress`,`in_review`,`done`,`not_adopted`];function lh(e,t){return Ri(e)?`not_adopted`:Hi(e)?Wi(e,t)?`ready`:`paused`:e.status===`planned`&&zi(e,t)?`ready`:e.status}var uh=[`attention`,`in_progress`,`in_review`,`ready`,`planned`,`done`],dh={attention:`Needs attention`,in_progress:`In progress`,in_review:`Awaiting completion`,ready:`Ready`,planned:`Planned`,done:`Done`};function fh(e,t){switch(lh(e,t)){case`in_progress`:return`in_progress`;case`in_review`:return`in_review`;case`ready`:return`ready`;case`planned`:case`paused`:return`planned`;case`done`:case`not_adopted`:return`done`}}function ph(e,t,n){let r=e.filter(e=>n.includes(e.id)).sort((e,t)=>n.indexOf(e.id)-n.indexOf(t.id));return uh.map(i=>({group:i,tasks:i===`attention`?r:e.filter(e=>!n.includes(e.id)&&fh(e,t)===i)})).filter(e=>e.tasks.length>0)}var mh={query:``,statuses:[],type:null},hh={...mh,statuses:ch.filter(e=>e!==`done`&&e!==`not_adopted`)};function gh(e){return e.query.trim()!==``||e.statuses.length>0||e.type!==null}function _h(e,t){return ch.filter(n=>n===t!==e.includes(n))}function vh(e){let t=/^#?(\d+)$/.exec(e.trim());return t===null?null:Number(t[1])}function yh(e,t,n){if(t.statuses.length>0&&!t.statuses.includes(lh(e,n))||t.type!==null&&e.taskType!==t.type)return!1;let r=`${e.title}\n${e.description}`.toLocaleLowerCase();return t.query.toLocaleLowerCase().split(/\s+/).filter(e=>e!==``).every(e=>r.includes(e))}function bh({at:e,prefix:t=``,className:n}){return(0,q.jsx)(`time`,{className:n,dateTime:new Date(e*1e3).toISOString(),title:pi(e),children:`${t}${fi(e)}`})}var xh=/^\s*(```|~~~)/,Sh=/^\s*([-*_])(\s*\1){2,}\s*$/,Ch=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,wh=/^\s*(>\s*)*(#{1,6}\s+|[-*+]\s+|\d+[.)]\s+)?(\[[ xX]\]\s+)?/;function Th(e){return e.replace(/!?\[([^\]]*)\]\((?:[^()]|\([^()]*\))*\)/g,`$1`).replace(/<((?:https?|mailto):[^>\s]+)>/g,`$1`).replace(/`+/g,``).replace(/(\*\*|__|~~)(?=\S)(.+?)(?<=\S)\1/g,`$2`).replace(/(?<![\w*])([*_])(?=[^\s*_])(.+?)(?<=[^\s*_])\1(?![\w*])/g,`$2`).replace(/\s*\|\s*/g,` `)}var Eh=/^\s*#{1,6}(\s|$)/;function Dh(e){let t=[],n=!1;for(let r of e.split(/\r?\n/))if(xh.test(r)){if(n=!n,t.length>0)break}else if(!n){if(r.trim()===``||Eh.test(r)||Sh.test(r)){if(t.length>0)break}else t.push(r)}return Oh(t.join(`
|
|
15
|
-
`))}function Oh(e){return e.split(/\r?\n/).filter(e=>!xh.test(e)&&!Sh.test(e)&&!Ch.test(e)).map(e=>Th(e.replace(wh,``))).join(` `).replace(/\s+/g,` `).trim()}var kh={manual:[`manual`,`url`,`command`],local_merge:[`manual`,`url`,`command`],pr_merge:[`manual`,`url`,`command`,`pr_open_ci_green`]};function Ah(e){let{source:t,completion:n,runner:r}=e??{source:`github`,completion:`pr_merge`,runner:`herdr`};return{git:t!==`none`,github:t===`github`,herdr:r===`herdr`,pullRequests:t===`github`&&r===`herdr`,merge:n!==`manual`,criterionKinds:kh[n]}}async function jh(e){window.open(e,`_blank`,`noopener,noreferrer`)}var Mh=(0,K.lazy)(()=>Qa(()=>import(`./markdown-C9D2w1Lj.js`),__vite__mapDeps([0,1]))),Nh=(0,K.lazy)(()=>Qa(()=>import(`./task-graph-4bqrDL_v.js`).then(e=>({default:e.TaskGraph})),__vite__mapDeps([2,1,3,4,5,6,7]))),Ph=[`feat`,`fix`,`modify`,`refactor`,`docs`,`test`,`chore`,`rnd`];function Fh(e,t){return e.status===`done`&&e.resolution===`completed`?`Completed`:Xr[lh(e,t)]}var Ih={planned:`neutral`,ready:`attention`,paused:`neutral`,in_progress:`progress`,in_review:`review`,done:`success`,not_adopted:`neutral`},Lh=a(Qr.neutral,`ring-1 ring-inset ring-muted-foreground/40`);function Rh(e){return e===`not_adopted`?Lh:Qr[Ih[e]]}var zh=a(Rh(`done`),`border-transparent hover:bg-emerald-200 dark:hover:bg-emerald-900 disabled:bg-emerald-100 disabled:opacity-60 dark:disabled:bg-emerald-950`);function Bh(e,t){return Rh(lh(e,t))}function Vh(e,t,{byId:n,workspaceName:r}){let i=n.get(e);return i===void 0||i.workspaceId===t?`#${e}`:`${r(i.workspaceId)} #${e}`}function Hh({workspace:e,timelineScale:t,onTimelineScaleChange:n,draft:r=Ug,onDraftChange:i,shownTask:o=null,onTaskShown:s}){let c=pe(),l=Qe(),[u,d]=(0,K.useState)(`timeline`),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(null),g=$e(),_=ce(),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(null),S=new Map(l.data?.map(e=>[e.id,e])),C={byId:new Map(c.data?.map(e=>[e.id,e])),workspaceName:e=>S.get(e)?.name??`Workspace ${e}`,capabilities:e=>Ah(S.get(e))},w=e===null?c.data:c.data?.filter(t=>t.workspaceId===e.id),T=e===null&&u===`timeline`,E=m??(T?hh:mh),D=[...new Set(c.data?.map(e=>e.workspaceId))].sort((e,t)=>C.workspaceName(e).localeCompare(C.workspaceName(t))),O=f!==null&&D.includes(f)?f:null,k=vh(E.query),A=k===null?void 0:C.byId.get(k),j=A!==void 0&&yh(A,{...E,query:``},C.byId)?A:void 0,M=w?.filter(e=>e!==j&&(!T||O===null||e.workspaceId===O)&&yh(e,E,C.byId)),N=j===void 0?M??[]:[j,...M??[]],P=o===null?void 0:C.byId.get(o.id);(0,K.useEffect)(()=>{P!==void 0&&(d(`timeline`),p(e=>e===P.workspaceId?e:null),h(e=>yh(P,e??hh,C.byId)?e:mh))},[o,P===void 0]);let F=O===null?[]:(w??[]).filter(e=>e!==j&&e.workspaceId!==O&&N.some(t=>t.dependsOn.includes(e.id)));return(0,q.jsxs)(`section`,{"aria-labelledby":`tasks-heading`,className:`flex flex-1 flex-col gap-4 max-md:gap-3`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col max-md:gap-2`,children:[(0,q.jsx)(`h2`,{id:`tasks-heading`,className:`text-xl font-semibold tracking-tight`,children:e?.name??`All workspaces`}),e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Cg,{workspace:e}),Ah(e).merge&&(0,q.jsx)(xg,{workspace:e})]}):(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground max-md:hidden`,children:`Tasks of every workspace and the dependencies between them.`})]}),e&&Ah(e).herdr&&(0,q.jsx)(wg,{workspace:e}),e&&i&&(0,q.jsx)(Wg,{workspace:e,draft:r,onChange:i}),c.isPending&&(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading tasks...`}),c.isError&&(0,q.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load tasks: `,c.error.message]}),w?.length===0&&(0,q.jsx)(bg,{title:e?`No tasks in this workspace yet.`:`No tasks yet.`,hint:e?`Plan the first task above; tasks can depend on each other across workspaces.`:`Pick a workspace in the sidebar to plan its tasks.`}),c.data&&w&&M&&w.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e===null&&(0,q.jsx)(`div`,{role:`group`,"aria-label":`Task view`,className:`flex gap-1 max-md:gap-2`,children:[`timeline`,`list`].map(e=>(0,q.jsx)(G,{size:`xs`,variant:u===e?`default`:`ghost`,"aria-pressed":u===e,onClick:()=>d(e),children:e===`list`?`List`:`Timeline`},e))}),T&&(0,q.jsxs)(`select`,{"aria-label":`Timeline workspace`,className:`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,value:O??`all`,onChange:e=>p(e.target.value===`all`?null:Number(e.target.value)),children:[(0,q.jsx)(`option`,{value:`all`,children:`All workspaces`}),D.map(e=>(0,q.jsx)(`option`,{value:e,children:C.workspaceName(e)},e))]}),(0,q.jsx)(Wh,{filter:E,onChange:h})]}),M.length===0&&j===void 0?(0,q.jsx)(bg,{icon:(0,q.jsx)(jr,{}),title:`No tasks match the search and filters.`,hint:`Change the search text, status, or type, or clear the filters.`}):T?(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading timeline...`}),children:(0,q.jsx)(Nh,{tasks:[...N,...F],allTasks:c.data,dimmed:new Set(F.map(e=>e.id)),workspaceLabel:e=>O===null||e.workspaceId!==O?C.workspaceName(e.workspaceId):null,statusLabel:e=>Fh(e,C.byId),statusStyle:e=>Bh(e,C.byId),ready:e=>lh(e,C.byId)===`ready`,scale:t,onScaleChange:n,shownTaskId:o?.id??null,onTaskShown:()=>s?.(),renderDetail:(e,t)=>(0,q.jsx)(Yh,{task:e,tasks:c.data??[],context:C,showWorkspace:!0,detailed:!0,navigation:t},e.id)})}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{role:`region`,"aria-label":`Tasks`,className:`flex flex-col gap-4`,children:[j&&(0,q.jsxs)(`section`,{"aria-label":`Task number match`,className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`h3`,{className:`text-sm font-medium text-muted-foreground`,children:[`Task `,(0,q.jsxs)(`span`,{className:`tabular-nums font-normal`,children:[`#`,j.id]})]}),(0,q.jsx)(`ul`,{"aria-label":`Task number match`,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:(0,q.jsx)(Yh,{task:j,tasks:c.data,context:C,showWorkspace:e===null||j.workspaceId!==e.id,onShowDetails:()=>x(j.id)})})]}),ph(M,C.byId,Sa(M,g.data??[],_.data??[],C.byId).map(e=>e.task.id)).map(({group:t,tasks:n})=>{let r=t===`done`&&!(v??gh(E)),i=dh[t],o=(0,q.jsx)(`span`,{className:`tabular-nums font-normal`,children:n.length});return(0,q.jsxs)(`section`,{"aria-label":i,className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h3`,{className:`flex items-center gap-1.5 text-sm font-medium text-muted-foreground`,children:t===`done`?(0,q.jsxs)(`button`,{type:`button`,"aria-expanded":!r,className:`flex items-center gap-1.5 rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>y(r),children:[(0,q.jsx)(Cn,{"aria-hidden":!0,className:a(`size-4 transition-transform`,r&&`-rotate-90`)}),i,` `,o]}):(0,q.jsxs)(q.Fragment,{children:[i,` `,o]})}),!r&&(0,q.jsx)(`ul`,{"aria-label":i,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:n.map(t=>(0,q.jsx)(Yh,{task:t,tasks:c.data,context:C,showWorkspace:e===null,onShowDetails:()=>x(t.id)},t.id))})]},t)})]}),b!==null&&C.byId.has(b)&&(0,q.jsx)(Uh,{onClose:()=>x(null),children:(0,q.jsx)(Yh,{task:C.byId.get(b),tasks:c.data,context:C,showWorkspace:!0,detailed:!0,navigation:{open:x,canOpen:e=>C.byId.has(e)}},b)})]})]})]})}function Uh({onClose:e,children:t}){let n=(0,K.useRef)(null),[r,i]=(0,K.useState)(!1);function a(){n.current?.querySelector(`form[data-dirty]`)?i(!0):e()}return(0,K.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[role=menu]`)||(r?i(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select`)||a())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,q.jsx)(Pa,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:a,banner:r&&(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Unsaved changes`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-muted px-4 py-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,autoFocus:!0,onClick:()=>i(!1),children:`Keep editing`}),(0,q.jsx)(G,{size:`xs`,variant:`destructive`,onClick:e,children:`Discard changes`})]}),children:t})}function Wh({filter:e,onChange:t}){return(0,q.jsxs)(`div`,{role:`search`,"aria-label":`Task filters`,className:`flex flex-1 flex-wrap items-center justify-end gap-2 max-md:grid max-md:basis-full max-md:grid-cols-2`,children:[(0,q.jsx)(`input`,{type:`search`,"aria-label":`Search tasks`,placeholder:`Search title, description, or #number`,className:a(De,`w-56 max-md:col-span-2 max-md:w-full`),value:e.query,onChange:n=>t({...e,query:n.target.value})}),(0,q.jsx)(`div`,{role:`group`,"aria-label":`Status filter`,className:`flex flex-wrap gap-1 max-md:col-span-2 max-md:gap-2`,children:ch.map(n=>{let r=e.statuses.includes(n),i=Ih[n];return(0,q.jsxs)(`button`,{type:`button`,className:a(`inline-flex h-6 shrink-0 items-center gap-1 rounded-full border px-2 text-xs font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,r?a(Rh(n),`border-transparent hover:brightness-95 dark:hover:brightness-125`):a(ei[i],`bg-transparent hover:bg-muted`)),"aria-pressed":r,onClick:()=>t({...e,statuses:_h(e.statuses,n)}),children:[r?(0,q.jsx)(xn,{"aria-hidden":!0,className:`size-3`}):(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full`,ri[i])}),Xr[n]]},n)})}),(0,q.jsxs)(`select`,{"aria-label":`Type filter`,className:De,value:e.type??`all`,onChange:n=>t({...e,type:n.target.value===`all`?null:n.target.value}),children:[(0,q.jsx)(`option`,{value:`all`,children:`All types`}),Ph.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))]}),gh(e)&&(0,q.jsxs)(G,{size:`xs`,variant:`ghost`,onClick:()=>t(mh),children:[(0,q.jsx)(nt,{}),`Clear filters`]})]})}var Gh=[`planned`,`done`],Kh={delete:`Confirm delete`,"force-delete":`Confirm force delete`};function qh(e,t,n){return e===`force-delete`?`Force delete #${t}? Its worktree is removed with its modified and untracked files, and its herdr workspace is closed; the branch is kept.`:n?`Delete #${t}? Its worktree and herdr workspace are removed; the branch is kept.`:`Delete #${t} and its history from Toodo?`}function Jh({task:e,detailed:t}){let n=gi(e.milestones);return n.length===0?null:t?(0,q.jsx)(dg,{label:`Timeline`,children:(0,q.jsx)(`dl`,{"aria-label":`Timeline of #${e.id}`,className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:n.map(({label:e,at:t})=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(bh,{at:t})})]},e))})}):(0,q.jsx)(`p`,{"aria-label":`Timeline of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:n.map(({label:e,at:t})=>(0,q.jsx)(bh,{at:t,prefix:`${e} `},e))})}function Yh({task:e,tasks:t,context:n,showWorkspace:r,detailed:i=!1,navigation:o,onShowDetails:s}){let c=C(),l=$e(),u=ce(),f=Re(),p=x(),m=ee(),h=y(),g=oe(),_=ie(),v=ae(),b=ke(),S=Ce(),w=E(),T=V(),D=d(),[O,k]=(0,K.useState)(!1),[A,j]=(0,K.useState)(!1),[M,N]=(0,K.useState)(!1),[P,F]=(0,K.useState)(null),[I,L]=(0,K.useState)(!1),[te,ne]=(0,K.useState)(!1),[re,R]=(0,K.useState)(null),[z,se]=(0,K.useState)(null),B=c.data?.running===!0,H=n.capabilities(e.workspaceId),le=e.status===`in_review`,ue=e.status===`in_progress`||le,de=H.herdr&&ue&&e.worktreePath!==null,fe=l.data?.find(t=>t.taskId===e.id)?.status,pe=H.pullRequests&&le?u.data?.find(t=>t.taskId===e.id):void 0,me=h.isPending||g.isPending||_.isPending,he=e.status===`done`,ge=e.criteria.every(e=>e.state===`met`),_e=e.criteria.filter(e=>e.state!==`met`).length,ve=le||e.status===`in_progress`&&ge,ye=Hi(e),be=e.status===`planned`&&zi(e,n.byId),Se=e.status===`planned`?e.dependsOn.filter(e=>Ri(n.byId.get(e))):[],we=!ue&&e.worktreePath!==null,Te=we&&b.error instanceof xe&&b.error.kind===`rejected`,Ee=Li.includes(e.status),De=Bi(e,n.byId),Oe=ba(e,n.byId),Ae=S.isPending||w.isPending,je=f.error??p.error??m.error??h.error??g.error??_.error??v.error??b.error??T.error??D.error??S.error??w.error,Me=t.filter(t=>t.id!==e.id&&!e.dependsOn.includes(t.id)),Pe=[...new Set([e.workspaceId,...Me.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:Me.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0);function Fe(t){b.mutate({id:e.id,force:t===`force-delete`},{onSettled:()=>R(null)})}let Ie=e.herdrWorkspaceId!==null&&!B,Le=B?null:c.isPending?`Checking whether herdr is running...`:"herdr is not running on the server; start it there (`herdr status --json` shows whether it runs), then try again",Be=e=>Le??e,Ve=e.status===`planned`?{key:`start`,changesData:!0,label:f.isPending?`Starting...`:ye?`Resume`:`Start`,ariaLabel:`${ye?`Resume`:`Start`} #${e.id}`,icon:(0,q.jsx)(Cr,{}),title:be?H.herdr?Be(void 0):void 0:Se.length>0?`A dependency was not adopted; remove it to start`:`Waits until all its dependencies are done`,disabled:!be||H.herdr&&!B||f.isPending,onSelect:()=>f.mutate(e.id)}:null,He=H.herdr&&ue&&(e.worktreePath===null||e.worktreeMissing)&&e.branch!==null?{key:`restore`,changesData:!0,label:T.isPending?`Restoring...`:`Restore worktree`,ariaLabel:`Restore worktree of #${e.id}`,icon:(0,q.jsx)(qn,{}),title:Be(`Check out ${e.branch} into a new worktree and open it in herdr`),disabled:!B||T.isPending,onSelect:()=>T.mutate(e.id)}:null,Ue=H.pullRequests&&de&&!le?{key:`open-pr`,changesData:!0,label:g.isPending?`Pushing...`:`Open PR`,ariaLabel:`Open pull request for #${e.id}`,icon:(0,q.jsx)(tr,{}),disabled:me,onSelect:()=>g.mutate(e.id)}:null,We=ve?{key:`complete`,changesData:!0,label:_.isPending?`Completing...`:`Complete`,ariaLabel:`Complete #${e.id}`,icon:(0,q.jsx)(xn,{}),className:zh,title:ge?Ie?Be(void 0):H.herdr?`Complete the task; its herdr workspace is closed and the worktree kept`:void 0:`${_e} of ${e.criteria.length} criteria not met yet; check the manual ones under Criteria, Toodo checks the automatic ones every minute`,disabled:me||Ie||!ge,onSelect:()=>_.mutate(e.id)}:null,Ge=H.pullRequests&&de&&le?{key:`push`,changesData:!0,label:g.isPending?`Pushing...`:`Push to PR`,ariaLabel:`Push #${e.id} to its pull request`,icon:(0,q.jsx)(qr,{}),disabled:me,onSelect:()=>g.mutate(e.id)}:null,Ke=H.herdr&&ue&&e.herdrWorkspaceId?{key:`open`,changesData:!0,label:`Open in herdr`,ariaLabel:`Open #${e.id} in herdr`,icon:(0,q.jsx)(zr,{}),title:Be(void 0),disabled:!B||p.isPending,onSelect:()=>p.mutate(e.id)}:null,qe=i&&H.herdr&&ue&&e.herdrWorkspaceId&&fe?{key:`focus`,changesData:!0,label:`Focus agent pane`,ariaLabel:`Focus agent pane of #${e.id}`,icon:(0,q.jsx)(Ln,{}),title:Be(`Focus the herdr pane of the agent working on this task`),disabled:!B||m.isPending,onSelect:()=>m.mutate(e.id)}:null,Je=de?{key:`refresh`,changesData:!0,label:h.isPending?`Refreshing...`:`Refresh commits`,ariaLabel:`Refresh commits of #${e.id}`,icon:(0,q.jsx)(Dr,{className:a(h.isPending&&`animate-spin`)}),disabled:me,onSelect:()=>h.mutate(e.id)}:null,Ye=ue?{key:`conclude`,label:`Conclude`,ariaLabel:`Conclude #${e.id} without merging`,icon:(0,q.jsx)(kn,{}),title:Ie?Be(void 0):H.pullRequests?`Finish without merging, e.g. research whose result is not adopted; an open pull request is closed`:`Finish without merging, e.g. research whose result is not adopted`,disabled:me||Ie,onSelect:()=>N(!0)}:null,Xe=[Ve,He,Ue,We,Ke].find(e=>e!==null)??null,Qe=[Ve,He,Ue,We,Ge,Ke,qe,Je,Ye].filter(e=>e!==null&&e!==Xe),et=[H.github&&!he&&e.issue===null&&!I?{key:`link-issue`,label:`Link issue`,ariaLabel:`Link issue to #${e.id}`,icon:(0,q.jsx)(Dn,{}),title:`Link a GitHub issue; the pull request closes it on merge`,onSelect:()=>L(!0)}:null,he?null:{key:`edit`,label:`Edit`,ariaLabel:`Edit #${e.id}`,icon:(0,q.jsx)(xr,{}),onSelect:()=>k(!0)},ue?{key:`pause`,changesData:!0,label:`Pause`,ariaLabel:`Pause #${e.id}`,icon:(0,q.jsx)(yr,{}),title:H.herdr?`Pause: stop working on the task; it keeps its branch, worktree, and pull request and can be resumed`:`Pause: stop working on the task; it can be resumed`,disabled:v.isPending,onSelect:()=>v.mutate(e.id)}:null,he&&Ri(e)?{key:`shipped`,label:`Complete as shipped by...`,ariaLabel:`Complete #${e.id} as shipped by another task or pull request`,icon:(0,q.jsx)($n,{}),title:H.github?`The work did ship, through another task or a merged pull request: mark it done as that one ended`:`The work did ship, through another task: mark it done as that one ended`,onSelect:()=>F(`shipped`)}:null,he?{key:`outcome`,label:`Change outcome`,ariaLabel:`Change outcome of #${e.id}`,icon:(0,q.jsx)(Gn,{}),title:`Correct how the task ended, e.g. merged work that was reverted; the change is kept as a note`,onSelect:()=>F(`outcome`)}:null,he?{key:`reopen`,label:`Reopen`,ariaLabel:`Reopen #${e.id}`,icon:(0,q.jsx)(kr,{}),title:H.herdr?`Reopen a task completed or concluded by mistake; it is paused and resumes on its branch`:`Reopen a task completed or concluded by mistake; it is paused and can be resumed`,onSelect:()=>F(`reopen`)}:null,he&&e.completionNote===null&&!te?{key:`add-note`,label:`Add note`,ariaLabel:`Add completion note to #${e.id}`,icon:(0,q.jsx)(Vr,{}),onSelect:()=>ne(!0)}:null,Gh.includes(e.status)?{key:`delete`,label:`Delete`,ariaLabel:`Delete #${e.id}`,icon:(0,q.jsx)(Gr,{}),title:we?Be(`Delete the task and remove its worktree and herdr workspace; the branch is kept`):`Delete`,disabled:we&&!B,destructive:!0,onSelect:()=>R(`delete`)}:null].filter(e=>e!==null),tt=s?{key:`details`,label:`Details`,ariaLabel:`Show details of #${e.id}`,icon:(0,q.jsx)(_r,{}),onSelect:s}:null,rt=i?et:[...tt?[tt]:[],...Qe,...et],it=i?[Xe,...Qe]:[Xe],at=Le!==null&&it.some(e=>e?.disabled===!0&&e.title===Le),ot=gi(e.milestones).at(-1),st=e.criteria.filter(e=>e.state===`met`).length,ct=e.criteria.filter(e=>e.state===`failed`).length,lt=i?``:Dh(e.description);function ut(e,t){return(0,q.jsxs)(G,{size:`xs`,variant:t,changesData:e.changesData,"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled,onClick:e.onSelect,className:e.className,children:[e.icon,e.label]},e.key)}return(0,q.jsxs)(`li`,{"data-task-row":i?void 0:e.id,className:a(`flex flex-col`,i?`gap-3 p-4`:`gap-1.5 px-4 py-3 max-md:gap-2`),children:[O?(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)($h,{task:e,byId:n.byId}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Editing`})]}),(0,q.jsx)(eg,{task:e,capabilities:H,onDone:()=>k(!1)})]}):(0,q.jsxs)(`div`,{className:a(`flex min-w-0 flex-col`,i?`gap-1.5`:`gap-0.5`),children:[(0,q.jsxs)(`div`,{className:a(`flex min-w-0 items-center gap-2`,i?`flex-wrap`:`max-md:flex-wrap max-md:gap-y-1`),children:[(0,q.jsx)($h,{task:e,byId:n.byId}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),r&&(0,q.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-xs text-muted-foreground`,children:n.workspaceName(e.workspaceId)}),(0,q.jsx)(Ea,{type:e.taskType}),!i&&(0,q.jsx)(`button`,{type:`button`,className:`break-words-keep line-clamp-2 min-w-0 cursor-pointer rounded-sm text-left text-base font-semibold outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:order-last max-md:min-h-11 max-md:basis-full md:flex-1 md:text-sm`,title:e.title,onClick:s,children:e.title}),pe&&(0,q.jsx)(Ua,{taskId:e.id,status:pe}),ue&&fe&&(0,q.jsx)(La,{taskId:e.id,status:fe}),Oe&&(0,q.jsx)(`span`,{role:`note`,"aria-label":`Blocker on #${e.id}: ${Oe.body}`,title:Oe.body,className:a(`shrink-0 rounded-md px-1.5 text-xs font-medium`,Qr.attention),children:`Blocker`})]}),i&&(0,q.jsx)(`h3`,{className:`break-words-keep text-base font-semibold leading-snug`,children:e.title}),i&&e.description.trim()&&(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:e.description}),children:(0,q.jsx)(Mh,{source:e.description})}),lt&&(0,q.jsx)(`p`,{className:`break-words-keep line-clamp-2 text-sm text-muted-foreground`,children:lt}),!i&&(0,q.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground empty:hidden`,children:[Se.length>0&&(0,q.jsxs)(`span`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:$r.attention,children:[Se.map(t=>Vh(t,e.workspaceId,n)).join(`, `),` not adopted`]}),De.length>0&&(0,q.jsxs)(`span`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:$r.neutral,children:[`Waiting on `,De.map(t=>Vh(t,e.workspaceId,n)).join(`, `)]}),e.dueDate!==null&&(0,q.jsx)(Xh,{task:e}),de&&(0,q.jsx)(Zh,{taskId:e.id}),!he&&e.criteria.length>0&&(0,q.jsxs)(`span`,{children:[st,`/`,e.criteria.length,` criteria met`]}),!he&&ct>0&&(0,q.jsxs)(`span`,{className:a(`font-medium`,$r.danger),children:[ct,` failed`]}),ot&&(0,q.jsx)(bh,{at:ot.at,prefix:`${ot.label} `})]})]}),i&&!O&&(0,q.jsx)(Vg,{task:e,detailed:!0}),z===null?i&&(e.dependsOn.length>0||Ee&&Me.length>0)&&(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Dependencies of #${e.id}`,className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground max-md:gap-2`,children:[e.dependsOn.length>0&&(0,q.jsx)(`span`,{children:`Depends on`}),e.dependsOn.map(t=>(0,q.jsxs)(`span`,{className:a(`inline-flex h-6 items-center gap-0.5 rounded-md border px-1.5 tabular-nums max-md:h-auto max-md:pr-0`,n.byId.get(t)?.status===`done`&&`line-through decoration-muted-foreground/60`,Se.includes(t)&&ei.attention),title:Se.includes(t)?`${n.byId.get(t)?.title} (not adopted)`:n.byId.get(t)?.title,children:[(0,q.jsx)(`span`,{children:Vh(t,e.workspaceId,n)}),Ee&&(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove dependency #${t} from #${e.id}`,title:`Remove dependency`,className:`flex items-center justify-center self-stretch rounded-sm p-0.5 hover:bg-muted hover:text-foreground disabled:opacity-50 max-md:size-11`,disabled:Ae,onClick:()=>w.mutate({id:e.id,dependsOn:t}),children:(0,q.jsx)(nt,{className:`size-3`})})]},t)),Ee&&Me.length>0&&(0,q.jsxs)(`select`,{"aria-label":`Add dependency to #${e.id}`,title:e.status===`in_progress`?H.herdr?`A prerequisite that is not done pauses this task and closes its herdr workspace; the worktree is kept`:`A prerequisite that is not done pauses this task`:void 0,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`max-w-48`),value:``,disabled:Ae,onChange:t=>{if(t.target.value){let n=Number(t.target.value);S.mutate({id:e.id,dependsOn:n,confirmPause:!1},{onSuccess:e=>e===`confirm_pause`&&se(n)})}},children:[(0,q.jsx)(`option`,{value:``,children:`Add dependency...`}),Pe.map(e=>(0,q.jsx)(`optgroup`,{label:n.workspaceName(e.workspaceId),children:e.tasks.map(e=>(0,q.jsxs)(`option`,{value:e.id,children:[`#`,e.id,` `,e.title]},e.id))},e.workspaceId))]})]}):(0,q.jsx)(Da,{taskId:e.id,prerequisite:Vh(z,e.workspaceId,n),pending:S.isPending,onConfirm:()=>S.mutate({id:e.id,dependsOn:z,confirmPause:!0},{onSettled:()=>se(null)}),onCancel:()=>se(null)}),i&&Se.length>0&&(0,q.jsxs)(`p`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:a(`text-xs`,$r.attention),children:[Se.map(t=>Vh(t,e.workspaceId,n)).join(`, `),` `,Se.length===1?`was`:`were`,` not adopted. Remove the dependency or change the plan to start this task.`]}),i&&De.length>0&&(0,q.jsxs)(`p`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:a(`text-xs`,$r.neutral),children:[`Waiting on `,De.map(t=>Vh(t,e.workspaceId,n)).join(`, `)]}),H.herdr&&ye&&De.length>0&&e.herdrWorkspaceId!==null&&(0,q.jsx)(lg,{taskId:e.id,collapsed:A,blockedReason:Le,disabled:!B||D.isPending,onClose:()=>D.mutate(e.id),onKeep:()=>j(!0)}),i&&de&&(0,q.jsx)(Qh,{taskId:e.id}),i&&(0,q.jsx)(Dg,{task:e}),i&&(0,q.jsx)(Jh,{task:e,detailed:!0}),i&&H.herdr&&e.branch&&(0,q.jsx)(dg,{label:`Branch`,children:(0,q.jsx)(`span`,{className:`break-all font-mono select-all`,children:e.branch})}),i&&H.herdr&&e.worktreePath&&(0,q.jsx)(dg,{label:`Worktree`,children:(0,q.jsx)(Oa,{label:`worktree path of #${e.id}`,full:Ne(e.worktreePath),short:Ze(e.worktreePath),className:`font-mono`})}),i&&H.pullRequests&&e.pullRequestUrl&&(0,q.jsxs)(dg,{label:`Pull request`,children:[(0,q.jsx)(`span`,{className:`break-all font-mono select-all`,children:e.pullRequestUrl}),e.pullRequest&&(0,q.jsx)(`span`,{"aria-label":`Pull request of #${e.id}`,className:`text-muted-foreground`,children:Mm(e.pullRequest)})]}),i&&e.mergedWith&&(0,q.jsx)(ug,{task:e,mergedWith:e.mergedWith,through:e.mergedWith.taskId===null?null:Vh(e.mergedWith.taskId,e.workspaceId,n),detailed:!0}),(i&&e.issue!==null||I)&&(0,q.jsx)(cg,{task:e,detailed:i,linking:I,onDone:()=>L(!1)}),i&&(0,q.jsx)(fg,{task:e,tasks:t,context:n,navigation:o}),i&&(0,q.jsx)(pg,{task:e,detailed:!0}),i&&(0,q.jsx)(gg,{task:e,capabilities:H}),i&&(0,q.jsx)(yg,{task:e,detailed:!0}),he&&!O&&(i||te)&&(0,q.jsx)(og,{task:e,adding:te,onAdded:()=>ne(!1)}),je&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:je.message}),at&&!O&&!M&&P===null&&(0,q.jsx)(`p`,{role:`note`,"aria-label":`herdr unavailable for #${e.id}`,className:`text-xs text-muted-foreground`,children:Le}),M&&!O&&(0,q.jsx)(tg,{task:e,capabilities:H,onDone:()=>N(!1),onShipped:()=>{N(!1),F(`shipped`)}}),P===`shipped`&&!O&&(0,q.jsx)(ag,{task:e,tasks:t,context:n,onDone:()=>F(null)}),P===`outcome`&&!O&&(0,q.jsx)(ig,{task:e,onDone:()=>F(null)}),P===`reopen`&&!O&&(0,q.jsx)(rg,{task:e,capabilities:H,onDone:()=>F(null)}),!O&&!M&&P===null&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[Xe&&ut(Xe,i?`default`:`outline`),i&&Qe.map(e=>ut(e,`outline`)),(0,q.jsx)(`div`,{role:re?`group`:void 0,"aria-label":re?`Delete #${e.id}?`:void 0,className:a(`ml-auto flex items-center gap-1 max-md:gap-2`,re&&`basis-full flex-wrap justify-end`),onKeyDown:re?ze(()=>R(null),b.isPending):void 0,children:re?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:qh(re,e.id,we)}),(0,q.jsxs)(G,{size:`xs`,variant:`destructive`,"aria-label":`${Kh[re]} #${e.id}`,disabled:b.isPending,onClick:()=>Fe(re),children:[(0,q.jsx)(Gr,{}),b.isPending?`Deleting...`:Kh[re]]}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>R(null),children:`Back`},`back`)]}):(0,q.jsxs)(q.Fragment,{children:[Te&&(0,q.jsx)(G,{size:`xs`,variant:`destructive`,"aria-label":`Force delete #${e.id}`,title:Be(`Delete the task and discard the modified and untracked files of its worktree`),disabled:!B,onClick:()=>R(`force-delete`),children:`Force delete`}),rt.length>0&&(0,q.jsx)(um,{label:`More actions for #${e.id}`,actions:rt})]})})]})]})}function Xh({task:e}){let t=ki(e,Date.now()/1e3);return(0,q.jsxs)(`span`,{"data-due-state":t??void 0,className:a((t===`late`||t===`overdue`)&&a(`font-medium`,$r.danger)),children:[t===null||t===`upcoming`?`Due`:Di[t],` `,e.dueDate]})}function Zh({taskId:e}){let t=rt(e,!0),n=t.data?Vi(t.data):null;if(!t.data||n===null)return null;let r=t.data.mergeable===`conflicting`;return(0,q.jsx)(`span`,{role:`note`,"aria-label":`Base freshness of #${e}`,"data-conflicting":r||void 0,className:r?$r.danger:$r.attention,children:n})}function Qh({taskId:e}){let t=rt(e,!0),n=`Base freshness of #${e}`,r=(0,q.jsxs)(G,{type:`button`,variant:`ghost`,size:`xs`,className:`ml-1.5 h-5 px-1.5 align-middle`,"aria-label":`Recheck base freshness of #${e}`,title:`Check again whether the branch is behind its base`,disabled:t.isFetching,onClick:()=>void t.refetch(),children:[(0,q.jsx)(Dr,{className:a(`size-3`,t.isFetching&&`animate-spin`)}),`Recheck`]});if(t.error)return(0,q.jsxs)(`p`,{role:`note`,"aria-label":n,className:`text-xs text-muted-foreground`,title:t.error.message,children:[`Could not check whether the branch is behind its base`,r]});let i=t.data,o=i?Vi(i):null;if(!i||o===null)return null;let s=i.mergeable===`conflicting`;return(0,q.jsxs)(`p`,{role:`note`,"aria-label":n,"data-conflicting":s||void 0,className:a(`text-xs`,s?$r.danger:$r.attention),title:[i.fetchError&&`Fetching origin failed: ${i.fetchError}`,i.mergeableError].filter(Boolean).join(`
|
|
15
|
+
`))}function Oh(e){return e.split(/\r?\n/).filter(e=>!xh.test(e)&&!Sh.test(e)&&!Ch.test(e)).map(e=>Th(e.replace(wh,``))).join(` `).replace(/\s+/g,` `).trim()}var kh={manual:[`manual`,`url`,`command`],local_merge:[`manual`,`url`,`command`],pr_merge:[`manual`,`url`,`command`,`pr_open_ci_green`]};function Ah(e){let{source:t,completion:n,runner:r}=e??{source:`github`,completion:`pr_merge`,runner:`herdr`};return{git:t!==`none`,github:t===`github`,herdr:r===`herdr`,pullRequests:t===`github`&&r===`herdr`,merge:n!==`manual`,criterionKinds:kh[n]}}async function jh(e){window.open(e,`_blank`,`noopener,noreferrer`)}var Mh=(0,K.lazy)(()=>Qa(()=>import(`./markdown-BKJM8xjI.js`),__vite__mapDeps([0,1]))),Nh=(0,K.lazy)(()=>Qa(()=>import(`./task-graph-C475dM5B.js`).then(e=>({default:e.TaskGraph})),__vite__mapDeps([2,1,3,4,5,6,7]))),Ph=[`feat`,`fix`,`modify`,`refactor`,`docs`,`test`,`chore`,`rnd`];function Fh(e,t){return e.status===`done`&&e.resolution===`completed`?`Completed`:Xr[lh(e,t)]}var Ih={planned:`neutral`,ready:`attention`,paused:`neutral`,in_progress:`progress`,in_review:`review`,done:`success`,not_adopted:`neutral`},Lh=a(Qr.neutral,`ring-1 ring-inset ring-muted-foreground/40`);function Rh(e){return e===`not_adopted`?Lh:Qr[Ih[e]]}var zh=a(Rh(`done`),`border-transparent hover:bg-emerald-200 dark:hover:bg-emerald-900 disabled:bg-emerald-100 disabled:opacity-60 dark:disabled:bg-emerald-950`);function Bh(e,t){return Rh(lh(e,t))}function Vh(e,t,{byId:n,workspaceName:r}){let i=n.get(e);return i===void 0||i.workspaceId===t?`#${e}`:`${r(i.workspaceId)} #${e}`}function Hh({workspace:e,timelineScale:t,onTimelineScaleChange:n,draft:r=Ug,onDraftChange:i,shownTask:o=null,onTaskShown:s}){let c=pe(),l=Qe(),[u,d]=(0,K.useState)(`timeline`),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(null),g=$e(),_=ce(),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(null),S=new Map(l.data?.map(e=>[e.id,e])),C={byId:new Map(c.data?.map(e=>[e.id,e])),workspaceName:e=>S.get(e)?.name??`Workspace ${e}`,capabilities:e=>Ah(S.get(e))},w=e===null?c.data:c.data?.filter(t=>t.workspaceId===e.id),T=e===null&&u===`timeline`,E=m??(T?hh:mh),D=[...new Set(c.data?.map(e=>e.workspaceId))].sort((e,t)=>C.workspaceName(e).localeCompare(C.workspaceName(t))),O=f!==null&&D.includes(f)?f:null,k=vh(E.query),A=k===null?void 0:C.byId.get(k),j=A!==void 0&&yh(A,{...E,query:``},C.byId)?A:void 0,M=w?.filter(e=>e!==j&&(!T||O===null||e.workspaceId===O)&&yh(e,E,C.byId)),N=j===void 0?M??[]:[j,...M??[]],P=o===null?void 0:C.byId.get(o.id);(0,K.useEffect)(()=>{P!==void 0&&(d(`timeline`),p(e=>e===P.workspaceId?e:null),h(e=>yh(P,e??hh,C.byId)?e:mh))},[o,P===void 0]);let F=O===null?[]:(w??[]).filter(e=>e!==j&&e.workspaceId!==O&&N.some(t=>t.dependsOn.includes(e.id)));return(0,q.jsxs)(`section`,{"aria-labelledby":`tasks-heading`,className:`flex flex-1 flex-col gap-4 max-md:gap-3`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col max-md:gap-2`,children:[(0,q.jsx)(`h2`,{id:`tasks-heading`,className:`text-xl font-semibold tracking-tight`,children:e?.name??`All workspaces`}),e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Cg,{workspace:e}),Ah(e).merge&&(0,q.jsx)(xg,{workspace:e})]}):(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground max-md:hidden`,children:`Tasks of every workspace and the dependencies between them.`})]}),e&&Ah(e).herdr&&(0,q.jsx)(wg,{workspace:e}),e&&i&&(0,q.jsx)(Wg,{workspace:e,draft:r,onChange:i}),c.isPending&&(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading tasks...`}),c.isError&&(0,q.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load tasks: `,c.error.message]}),w?.length===0&&(0,q.jsx)(bg,{title:e?`No tasks in this workspace yet.`:`No tasks yet.`,hint:e?`Plan the first task above; tasks can depend on each other across workspaces.`:`Pick a workspace in the sidebar to plan its tasks.`}),c.data&&w&&M&&w.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e===null&&(0,q.jsx)(`div`,{role:`group`,"aria-label":`Task view`,className:`flex gap-1 max-md:gap-2`,children:[`timeline`,`list`].map(e=>(0,q.jsx)(G,{size:`xs`,variant:u===e?`default`:`ghost`,"aria-pressed":u===e,onClick:()=>d(e),children:e===`list`?`List`:`Timeline`},e))}),T&&(0,q.jsxs)(`select`,{"aria-label":`Timeline workspace`,className:`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,value:O??`all`,onChange:e=>p(e.target.value===`all`?null:Number(e.target.value)),children:[(0,q.jsx)(`option`,{value:`all`,children:`All workspaces`}),D.map(e=>(0,q.jsx)(`option`,{value:e,children:C.workspaceName(e)},e))]}),(0,q.jsx)(Wh,{filter:E,onChange:h})]}),M.length===0&&j===void 0?(0,q.jsx)(bg,{icon:(0,q.jsx)(jr,{}),title:`No tasks match the search and filters.`,hint:`Change the search text, status, or type, or clear the filters.`}):T?(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading timeline...`}),children:(0,q.jsx)(Nh,{tasks:[...N,...F],allTasks:c.data,dimmed:new Set(F.map(e=>e.id)),workspaceLabel:e=>O===null||e.workspaceId!==O?C.workspaceName(e.workspaceId):null,statusLabel:e=>Fh(e,C.byId),statusStyle:e=>Bh(e,C.byId),ready:e=>lh(e,C.byId)===`ready`,scale:t,onScaleChange:n,shownTaskId:o?.id??null,onTaskShown:()=>s?.(),renderDetail:(e,t)=>(0,q.jsx)(Yh,{task:e,tasks:c.data??[],context:C,showWorkspace:!0,detailed:!0,navigation:t},e.id)})}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{role:`region`,"aria-label":`Tasks`,className:`flex flex-col gap-4`,children:[j&&(0,q.jsxs)(`section`,{"aria-label":`Task number match`,className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`h3`,{className:`text-sm font-medium text-muted-foreground`,children:[`Task `,(0,q.jsxs)(`span`,{className:`tabular-nums font-normal`,children:[`#`,j.id]})]}),(0,q.jsx)(`ul`,{"aria-label":`Task number match`,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:(0,q.jsx)(Yh,{task:j,tasks:c.data,context:C,showWorkspace:e===null||j.workspaceId!==e.id,onShowDetails:()=>x(j.id)})})]}),ph(M,C.byId,Sa(M,g.data??[],_.data??[],C.byId).map(e=>e.task.id)).map(({group:t,tasks:n})=>{let r=t===`done`&&!(v??gh(E)),i=dh[t],o=(0,q.jsx)(`span`,{className:`tabular-nums font-normal`,children:n.length});return(0,q.jsxs)(`section`,{"aria-label":i,className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h3`,{className:`flex items-center gap-1.5 text-sm font-medium text-muted-foreground`,children:t===`done`?(0,q.jsxs)(`button`,{type:`button`,"aria-expanded":!r,className:`flex items-center gap-1.5 rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>y(r),children:[(0,q.jsx)(Cn,{"aria-hidden":!0,className:a(`size-4 transition-transform`,r&&`-rotate-90`)}),i,` `,o]}):(0,q.jsxs)(q.Fragment,{children:[i,` `,o]})}),!r&&(0,q.jsx)(`ul`,{"aria-label":i,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:n.map(t=>(0,q.jsx)(Yh,{task:t,tasks:c.data,context:C,showWorkspace:e===null,onShowDetails:()=>x(t.id)},t.id))})]},t)})]}),b!==null&&C.byId.has(b)&&(0,q.jsx)(Uh,{onClose:()=>x(null),children:(0,q.jsx)(Yh,{task:C.byId.get(b),tasks:c.data,context:C,showWorkspace:!0,detailed:!0,navigation:{open:x,canOpen:e=>C.byId.has(e)}},b)})]})]})]})}function Uh({onClose:e,children:t}){let n=(0,K.useRef)(null),[r,i]=(0,K.useState)(!1);function a(){n.current?.querySelector(`form[data-dirty]`)?i(!0):e()}return(0,K.useEffect)(()=>{function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[role=menu]`)||(r?i(!1):e.target instanceof HTMLElement&&e.target.closest(`input, textarea, select`)||a())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,q.jsx)(Pa,{ref:n,width:`min(480px, max(360px, 40vw), calc(100vw - 32px))`,onClose:a,banner:r&&(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Unsaved changes`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-muted px-4 py-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Discard your unsaved changes?`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,autoFocus:!0,onClick:()=>i(!1),children:`Keep editing`}),(0,q.jsx)(G,{size:`xs`,variant:`destructive`,onClick:e,children:`Discard changes`})]}),children:t})}function Wh({filter:e,onChange:t}){return(0,q.jsxs)(`div`,{role:`search`,"aria-label":`Task filters`,className:`flex flex-1 flex-wrap items-center justify-end gap-2 max-md:grid max-md:basis-full max-md:grid-cols-2`,children:[(0,q.jsx)(`input`,{type:`search`,"aria-label":`Search tasks`,placeholder:`Search title, description, or #number`,className:a(De,`w-56 max-md:col-span-2 max-md:w-full`),value:e.query,onChange:n=>t({...e,query:n.target.value})}),(0,q.jsx)(`div`,{role:`group`,"aria-label":`Status filter`,className:`flex flex-wrap gap-1 max-md:col-span-2 max-md:gap-2`,children:ch.map(n=>{let r=e.statuses.includes(n),i=Ih[n];return(0,q.jsxs)(`button`,{type:`button`,className:a(`inline-flex h-6 shrink-0 items-center gap-1 rounded-full border px-2 text-xs font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,r?a(Rh(n),`border-transparent hover:brightness-95 dark:hover:brightness-125`):a(ei[i],`bg-transparent hover:bg-muted`)),"aria-pressed":r,onClick:()=>t({...e,statuses:_h(e.statuses,n)}),children:[r?(0,q.jsx)(xn,{"aria-hidden":!0,className:`size-3`}):(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full`,ri[i])}),Xr[n]]},n)})}),(0,q.jsxs)(`select`,{"aria-label":`Type filter`,className:De,value:e.type??`all`,onChange:n=>t({...e,type:n.target.value===`all`?null:n.target.value}),children:[(0,q.jsx)(`option`,{value:`all`,children:`All types`}),Ph.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))]}),gh(e)&&(0,q.jsxs)(G,{size:`xs`,variant:`ghost`,onClick:()=>t(mh),children:[(0,q.jsx)(nt,{}),`Clear filters`]})]})}var Gh=[`planned`,`done`],Kh={delete:`Confirm delete`,"force-delete":`Confirm force delete`};function qh(e,t,n){return e===`force-delete`?`Force delete #${t}? Its worktree is removed with its modified and untracked files, and its herdr workspace is closed; the branch is kept.`:n?`Delete #${t}? Its worktree and herdr workspace are removed; the branch is kept.`:`Delete #${t} and its history from Toodo?`}function Jh({task:e,detailed:t}){let n=gi(e.milestones);return n.length===0?null:t?(0,q.jsx)(dg,{label:`Timeline`,children:(0,q.jsx)(`dl`,{"aria-label":`Timeline of #${e.id}`,className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:n.map(({label:e,at:t})=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(bh,{at:t})})]},e))})}):(0,q.jsx)(`p`,{"aria-label":`Timeline of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:n.map(({label:e,at:t})=>(0,q.jsx)(bh,{at:t,prefix:`${e} `},e))})}function Yh({task:e,tasks:t,context:n,showWorkspace:r,detailed:i=!1,navigation:o,onShowDetails:s}){let c=C(),l=$e(),u=ce(),f=Re(),p=x(),m=ee(),h=y(),g=oe(),_=ie(),v=ae(),b=ke(),S=Ce(),w=E(),T=V(),D=d(),[O,k]=(0,K.useState)(!1),[A,j]=(0,K.useState)(!1),[M,N]=(0,K.useState)(!1),[P,F]=(0,K.useState)(null),[I,L]=(0,K.useState)(!1),[te,ne]=(0,K.useState)(!1),[re,R]=(0,K.useState)(null),[z,se]=(0,K.useState)(null),B=c.data?.running===!0,H=n.capabilities(e.workspaceId),le=e.status===`in_review`,ue=e.status===`in_progress`||le,de=H.herdr&&ue&&e.worktreePath!==null,fe=l.data?.find(t=>t.taskId===e.id)?.status,pe=H.pullRequests&&le?u.data?.find(t=>t.taskId===e.id):void 0,me=h.isPending||g.isPending||_.isPending,he=e.status===`done`,ge=e.criteria.every(e=>e.state===`met`),_e=e.criteria.filter(e=>e.state!==`met`).length,ve=le||e.status===`in_progress`&&ge,ye=Hi(e),be=e.status===`planned`&&zi(e,n.byId),Se=e.status===`planned`?e.dependsOn.filter(e=>Ri(n.byId.get(e))):[],we=!ue&&e.worktreePath!==null,Te=we&&b.error instanceof xe&&b.error.kind===`rejected`,Ee=Li.includes(e.status),De=Bi(e,n.byId),Oe=ba(e,n.byId),Ae=S.isPending||w.isPending,je=f.error??p.error??m.error??h.error??g.error??_.error??v.error??b.error??T.error??D.error??S.error??w.error,Me=t.filter(t=>t.id!==e.id&&!e.dependsOn.includes(t.id)),Pe=[...new Set([e.workspaceId,...Me.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:Me.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0);function Fe(t){b.mutate({id:e.id,force:t===`force-delete`},{onSettled:()=>R(null)})}let Ie=e.herdrWorkspaceId!==null&&!B,Le=B?null:c.isPending?`Checking whether herdr is running...`:"herdr is not running on the server; start it there (`herdr status --json` shows whether it runs), then try again",Be=e=>Le??e,Ve=e.status===`planned`?{key:`start`,changesData:!0,label:f.isPending?`Starting...`:ye?`Resume`:`Start`,ariaLabel:`${ye?`Resume`:`Start`} #${e.id}`,icon:(0,q.jsx)(Cr,{}),title:be?H.herdr?Be(void 0):void 0:Se.length>0?`A dependency was not adopted; remove it to start`:`Waits until all its dependencies are done`,disabled:!be||H.herdr&&!B||f.isPending,onSelect:()=>f.mutate(e.id)}:null,He=H.herdr&&ue&&(e.worktreePath===null||e.worktreeMissing)&&e.branch!==null?{key:`restore`,changesData:!0,label:T.isPending?`Restoring...`:`Restore worktree`,ariaLabel:`Restore worktree of #${e.id}`,icon:(0,q.jsx)(qn,{}),title:Be(`Check out ${e.branch} into a new worktree and open it in herdr`),disabled:!B||T.isPending,onSelect:()=>T.mutate(e.id)}:null,Ue=H.pullRequests&&de&&!le?{key:`open-pr`,changesData:!0,label:g.isPending?`Pushing...`:`Open PR`,ariaLabel:`Open pull request for #${e.id}`,icon:(0,q.jsx)(tr,{}),disabled:me,onSelect:()=>g.mutate(e.id)}:null,We=ve?{key:`complete`,changesData:!0,label:_.isPending?`Completing...`:`Complete`,ariaLabel:`Complete #${e.id}`,icon:(0,q.jsx)(xn,{}),className:zh,title:ge?Ie?Be(void 0):H.herdr?`Complete the task; its herdr workspace is closed and the worktree kept`:void 0:`${_e} of ${e.criteria.length} criteria not met yet; check the manual ones under Criteria, Toodo checks the automatic ones every minute`,disabled:me||Ie||!ge,onSelect:()=>_.mutate(e.id)}:null,Ge=H.pullRequests&&de&&le?{key:`push`,changesData:!0,label:g.isPending?`Pushing...`:`Push to PR`,ariaLabel:`Push #${e.id} to its pull request`,icon:(0,q.jsx)(qr,{}),disabled:me,onSelect:()=>g.mutate(e.id)}:null,Ke=H.herdr&&ue&&e.herdrWorkspaceId?{key:`open`,changesData:!0,label:`Open in herdr`,ariaLabel:`Open #${e.id} in herdr`,icon:(0,q.jsx)(zr,{}),title:Be(void 0),disabled:!B||p.isPending,onSelect:()=>p.mutate(e.id)}:null,qe=i&&H.herdr&&ue&&e.herdrWorkspaceId&&fe?{key:`focus`,changesData:!0,label:`Focus agent pane`,ariaLabel:`Focus agent pane of #${e.id}`,icon:(0,q.jsx)(Ln,{}),title:Be(`Focus the herdr pane of the agent working on this task`),disabled:!B||m.isPending,onSelect:()=>m.mutate(e.id)}:null,Je=de?{key:`refresh`,changesData:!0,label:h.isPending?`Refreshing...`:`Refresh commits`,ariaLabel:`Refresh commits of #${e.id}`,icon:(0,q.jsx)(Dr,{className:a(h.isPending&&`animate-spin`)}),disabled:me,onSelect:()=>h.mutate(e.id)}:null,Ye=ue?{key:`conclude`,label:`Conclude`,ariaLabel:`Conclude #${e.id} without merging`,icon:(0,q.jsx)(kn,{}),title:Ie?Be(void 0):H.pullRequests?`Finish without merging, e.g. research whose result is not adopted; an open pull request is closed`:`Finish without merging, e.g. research whose result is not adopted`,disabled:me||Ie,onSelect:()=>N(!0)}:null,Xe=[Ve,He,Ue,We,Ke].find(e=>e!==null)??null,Qe=[Ve,He,Ue,We,Ge,Ke,qe,Je,Ye].filter(e=>e!==null&&e!==Xe),et=[H.github&&!he&&e.issue===null&&!I?{key:`link-issue`,label:`Link issue`,ariaLabel:`Link issue to #${e.id}`,icon:(0,q.jsx)(Dn,{}),title:`Link a GitHub issue; the pull request closes it on merge`,onSelect:()=>L(!0)}:null,he?null:{key:`edit`,label:`Edit`,ariaLabel:`Edit #${e.id}`,icon:(0,q.jsx)(xr,{}),onSelect:()=>k(!0)},ue?{key:`pause`,changesData:!0,label:`Pause`,ariaLabel:`Pause #${e.id}`,icon:(0,q.jsx)(yr,{}),title:H.herdr?`Pause: stop working on the task; it keeps its branch, worktree, and pull request and can be resumed`:`Pause: stop working on the task; it can be resumed`,disabled:v.isPending,onSelect:()=>v.mutate(e.id)}:null,he&&Ri(e)?{key:`shipped`,label:`Complete as shipped by...`,ariaLabel:`Complete #${e.id} as shipped by another task or pull request`,icon:(0,q.jsx)($n,{}),title:H.github?`The work did ship, through another task or a merged pull request: mark it done as that one ended`:`The work did ship, through another task: mark it done as that one ended`,onSelect:()=>F(`shipped`)}:null,he?{key:`outcome`,label:`Change outcome`,ariaLabel:`Change outcome of #${e.id}`,icon:(0,q.jsx)(Gn,{}),title:`Correct how the task ended, e.g. merged work that was reverted; the change is kept as a note`,onSelect:()=>F(`outcome`)}:null,he?{key:`reopen`,label:`Reopen`,ariaLabel:`Reopen #${e.id}`,icon:(0,q.jsx)(kr,{}),title:H.herdr?`Reopen a task completed or concluded by mistake; it is paused and resumes on its branch`:`Reopen a task completed or concluded by mistake; it is paused and can be resumed`,onSelect:()=>F(`reopen`)}:null,he&&e.completionNote===null&&!te?{key:`add-note`,label:`Add note`,ariaLabel:`Add completion note to #${e.id}`,icon:(0,q.jsx)(Vr,{}),onSelect:()=>ne(!0)}:null,Gh.includes(e.status)?{key:`delete`,label:`Delete`,ariaLabel:`Delete #${e.id}`,icon:(0,q.jsx)(Gr,{}),title:we?Be(`Delete the task and remove its worktree and herdr workspace; the branch is kept`):`Delete`,disabled:we&&!B,destructive:!0,onSelect:()=>R(`delete`)}:null].filter(e=>e!==null),tt=s?{key:`details`,label:`Details`,ariaLabel:`Show details of #${e.id}`,icon:(0,q.jsx)(_r,{}),onSelect:s}:null,rt=i?et:[...tt?[tt]:[],...Qe,...et],it=i?[Xe,...Qe]:[Xe],at=Le!==null&&it.some(e=>e?.disabled===!0&&e.title===Le),ot=gi(e.milestones).at(-1),st=e.criteria.filter(e=>e.state===`met`).length,ct=e.criteria.filter(e=>e.state===`failed`).length,lt=i?``:Dh(e.description);function ut(e,t){return(0,q.jsxs)(G,{size:`xs`,variant:t,changesData:e.changesData,"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled,onClick:e.onSelect,className:e.className,children:[e.icon,e.label]},e.key)}return(0,q.jsxs)(`li`,{"data-task-row":i?void 0:e.id,className:a(`flex flex-col`,i?`gap-3 p-4`:`gap-1.5 px-4 py-3 max-md:gap-2`),children:[O?(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)($h,{task:e,byId:n.byId}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Editing`})]}),(0,q.jsx)(eg,{task:e,capabilities:H,onDone:()=>k(!1)})]}):(0,q.jsxs)(`div`,{className:a(`flex min-w-0 flex-col`,i?`gap-1.5`:`gap-0.5`),children:[(0,q.jsxs)(`div`,{className:a(`flex min-w-0 items-center gap-2`,i?`flex-wrap`:`max-md:flex-wrap max-md:gap-y-1`),children:[(0,q.jsx)($h,{task:e,byId:n.byId}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),r&&(0,q.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-xs text-muted-foreground`,children:n.workspaceName(e.workspaceId)}),(0,q.jsx)(Ea,{type:e.taskType}),!i&&(0,q.jsx)(`button`,{type:`button`,className:`break-words-keep line-clamp-2 min-w-0 cursor-pointer rounded-sm text-left text-base font-semibold outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:order-last max-md:min-h-11 max-md:basis-full md:flex-1 md:text-sm`,title:e.title,onClick:s,children:e.title}),pe&&(0,q.jsx)(Ua,{taskId:e.id,status:pe}),ue&&fe&&(0,q.jsx)(La,{taskId:e.id,status:fe}),Oe&&(0,q.jsx)(`span`,{role:`note`,"aria-label":`Blocker on #${e.id}: ${Oe.body}`,title:Oe.body,className:a(`shrink-0 rounded-md px-1.5 text-xs font-medium`,Qr.attention),children:`Blocker`})]}),i&&(0,q.jsx)(`h3`,{className:`break-words-keep text-base font-semibold leading-snug`,children:e.title}),i&&e.description.trim()&&(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:e.description}),children:(0,q.jsx)(Mh,{source:e.description})}),lt&&(0,q.jsx)(`p`,{className:`break-words-keep line-clamp-2 text-sm text-muted-foreground`,children:lt}),!i&&(0,q.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground empty:hidden`,children:[Se.length>0&&(0,q.jsxs)(`span`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:$r.attention,children:[Se.map(t=>Vh(t,e.workspaceId,n)).join(`, `),` not adopted`]}),De.length>0&&(0,q.jsxs)(`span`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:$r.neutral,children:[`Waiting on `,De.map(t=>Vh(t,e.workspaceId,n)).join(`, `)]}),e.dueDate!==null&&(0,q.jsx)(Xh,{task:e}),de&&(0,q.jsx)(Zh,{taskId:e.id}),!he&&e.criteria.length>0&&(0,q.jsxs)(`span`,{children:[st,`/`,e.criteria.length,` criteria met`]}),!he&&ct>0&&(0,q.jsxs)(`span`,{className:a(`font-medium`,$r.danger),children:[ct,` failed`]}),ot&&(0,q.jsx)(bh,{at:ot.at,prefix:`${ot.label} `})]})]}),i&&!O&&(0,q.jsx)(Vg,{task:e,detailed:!0}),z===null?i&&(e.dependsOn.length>0||Ee&&Me.length>0)&&(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Dependencies of #${e.id}`,className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground max-md:gap-2`,children:[e.dependsOn.length>0&&(0,q.jsx)(`span`,{children:`Depends on`}),e.dependsOn.map(t=>(0,q.jsxs)(`span`,{className:a(`inline-flex h-6 items-center gap-0.5 rounded-md border px-1.5 tabular-nums max-md:h-auto max-md:pr-0`,n.byId.get(t)?.status===`done`&&`line-through decoration-muted-foreground/60`,Se.includes(t)&&ei.attention),title:Se.includes(t)?`${n.byId.get(t)?.title} (not adopted)`:n.byId.get(t)?.title,children:[(0,q.jsx)(`span`,{children:Vh(t,e.workspaceId,n)}),Ee&&(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove dependency #${t} from #${e.id}`,title:`Remove dependency`,className:`flex items-center justify-center self-stretch rounded-sm p-0.5 hover:bg-muted hover:text-foreground disabled:opacity-50 max-md:size-11`,disabled:Ae,onClick:()=>w.mutate({id:e.id,dependsOn:t}),children:(0,q.jsx)(nt,{className:`size-3`})})]},t)),Ee&&Me.length>0&&(0,q.jsxs)(`select`,{"aria-label":`Add dependency to #${e.id}`,title:e.status===`in_progress`?H.herdr?`A prerequisite that is not done pauses this task and closes its herdr workspace; the worktree is kept`:`A prerequisite that is not done pauses this task`:void 0,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`max-w-48`),value:``,disabled:Ae,onChange:t=>{if(t.target.value){let n=Number(t.target.value);S.mutate({id:e.id,dependsOn:n,confirmPause:!1},{onSuccess:e=>e===`confirm_pause`&&se(n)})}},children:[(0,q.jsx)(`option`,{value:``,children:`Add dependency...`}),Pe.map(e=>(0,q.jsx)(`optgroup`,{label:n.workspaceName(e.workspaceId),children:e.tasks.map(e=>(0,q.jsxs)(`option`,{value:e.id,children:[`#`,e.id,` `,e.title]},e.id))},e.workspaceId))]})]}):(0,q.jsx)(Da,{taskId:e.id,prerequisite:Vh(z,e.workspaceId,n),pending:S.isPending,onConfirm:()=>S.mutate({id:e.id,dependsOn:z,confirmPause:!0},{onSettled:()=>se(null)}),onCancel:()=>se(null)}),i&&Se.length>0&&(0,q.jsxs)(`p`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:a(`text-xs`,$r.attention),children:[Se.map(t=>Vh(t,e.workspaceId,n)).join(`, `),` `,Se.length===1?`was`:`were`,` not adopted. Remove the dependency or change the plan to start this task.`]}),i&&De.length>0&&(0,q.jsxs)(`p`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:a(`text-xs`,$r.neutral),children:[`Waiting on `,De.map(t=>Vh(t,e.workspaceId,n)).join(`, `)]}),H.herdr&&ye&&De.length>0&&e.herdrWorkspaceId!==null&&(0,q.jsx)(lg,{taskId:e.id,collapsed:A,blockedReason:Le,disabled:!B||D.isPending,onClose:()=>D.mutate(e.id),onKeep:()=>j(!0)}),i&&de&&(0,q.jsx)(Qh,{taskId:e.id}),i&&(0,q.jsx)(Dg,{task:e}),i&&(0,q.jsx)(Jh,{task:e,detailed:!0}),i&&H.herdr&&e.branch&&(0,q.jsx)(dg,{label:`Branch`,children:(0,q.jsx)(`span`,{className:`break-all font-mono select-all`,children:e.branch})}),i&&H.herdr&&e.worktreePath&&(0,q.jsx)(dg,{label:`Worktree`,children:(0,q.jsx)(Oa,{label:`worktree path of #${e.id}`,full:Ne(e.worktreePath),short:Ze(e.worktreePath),className:`font-mono`})}),i&&H.pullRequests&&e.pullRequestUrl&&(0,q.jsxs)(dg,{label:`Pull request`,children:[(0,q.jsx)(`span`,{className:`break-all font-mono select-all`,children:e.pullRequestUrl}),e.pullRequest&&(0,q.jsx)(`span`,{"aria-label":`Pull request of #${e.id}`,className:`text-muted-foreground`,children:Mm(e.pullRequest)})]}),i&&e.mergedWith&&(0,q.jsx)(ug,{task:e,mergedWith:e.mergedWith,through:e.mergedWith.taskId===null?null:Vh(e.mergedWith.taskId,e.workspaceId,n),detailed:!0}),(i&&e.issue!==null||I)&&(0,q.jsx)(cg,{task:e,detailed:i,linking:I,onDone:()=>L(!1)}),i&&(0,q.jsx)(fg,{task:e,tasks:t,context:n,navigation:o}),i&&(0,q.jsx)(pg,{task:e,detailed:!0}),i&&(0,q.jsx)(gg,{task:e,capabilities:H}),i&&(0,q.jsx)(yg,{task:e,detailed:!0}),he&&!O&&(i||te)&&(0,q.jsx)(og,{task:e,adding:te,onAdded:()=>ne(!1)}),je&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:je.message}),at&&!O&&!M&&P===null&&(0,q.jsx)(`p`,{role:`note`,"aria-label":`herdr unavailable for #${e.id}`,className:`text-xs text-muted-foreground`,children:Le}),M&&!O&&(0,q.jsx)(tg,{task:e,capabilities:H,onDone:()=>N(!1),onShipped:()=>{N(!1),F(`shipped`)}}),P===`shipped`&&!O&&(0,q.jsx)(ag,{task:e,tasks:t,context:n,onDone:()=>F(null)}),P===`outcome`&&!O&&(0,q.jsx)(ig,{task:e,onDone:()=>F(null)}),P===`reopen`&&!O&&(0,q.jsx)(rg,{task:e,capabilities:H,onDone:()=>F(null)}),!O&&!M&&P===null&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[Xe&&ut(Xe,i?`default`:`outline`),i&&Qe.map(e=>ut(e,`outline`)),(0,q.jsx)(`div`,{role:re?`group`:void 0,"aria-label":re?`Delete #${e.id}?`:void 0,className:a(`ml-auto flex items-center gap-1 max-md:gap-2`,re&&`basis-full flex-wrap justify-end`),onKeyDown:re?ze(()=>R(null),b.isPending):void 0,children:re?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:qh(re,e.id,we)}),(0,q.jsxs)(G,{size:`xs`,variant:`destructive`,"aria-label":`${Kh[re]} #${e.id}`,disabled:b.isPending,onClick:()=>Fe(re),children:[(0,q.jsx)(Gr,{}),b.isPending?`Deleting...`:Kh[re]]}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>R(null),children:`Back`},`back`)]}):(0,q.jsxs)(q.Fragment,{children:[Te&&(0,q.jsx)(G,{size:`xs`,variant:`destructive`,"aria-label":`Force delete #${e.id}`,title:Be(`Delete the task and discard the modified and untracked files of its worktree`),disabled:!B,onClick:()=>R(`force-delete`),children:`Force delete`}),rt.length>0&&(0,q.jsx)(um,{label:`More actions for #${e.id}`,actions:rt})]})})]})]})}function Xh({task:e}){let t=ki(e,Date.now()/1e3);return(0,q.jsxs)(`span`,{"data-due-state":t??void 0,className:a((t===`late`||t===`overdue`)&&a(`font-medium`,$r.danger)),children:[t===null||t===`upcoming`?`Due`:Di[t],` `,e.dueDate]})}function Zh({taskId:e}){let t=rt(e,!0),n=t.data?Vi(t.data):null;if(!t.data||n===null)return null;let r=t.data.mergeable===`conflicting`;return(0,q.jsx)(`span`,{role:`note`,"aria-label":`Base freshness of #${e}`,"data-conflicting":r||void 0,className:r?$r.danger:$r.attention,children:n})}function Qh({taskId:e}){let t=rt(e,!0),n=`Base freshness of #${e}`,r=(0,q.jsxs)(G,{type:`button`,variant:`ghost`,size:`xs`,className:`ml-1.5 h-5 px-1.5 align-middle`,"aria-label":`Recheck base freshness of #${e}`,title:`Check again whether the branch is behind its base`,disabled:t.isFetching,onClick:()=>void t.refetch(),children:[(0,q.jsx)(Dr,{className:a(`size-3`,t.isFetching&&`animate-spin`)}),`Recheck`]});if(t.error)return(0,q.jsxs)(`p`,{role:`note`,"aria-label":n,className:`text-xs text-muted-foreground`,title:t.error.message,children:[`Could not check whether the branch is behind its base`,r]});let i=t.data,o=i?Vi(i):null;if(!i||o===null)return null;let s=i.mergeable===`conflicting`;return(0,q.jsxs)(`p`,{role:`note`,"aria-label":n,"data-conflicting":s||void 0,className:a(`text-xs`,s?$r.danger:$r.attention),title:[i.fetchError&&`Fetching origin failed: ${i.fetchError}`,i.mergeableError].filter(Boolean).join(`
|
|
16
16
|
`)||void 0,children:[o,i.fetchError&&` (not up to date: fetching origin failed)`,r]})}function $h({task:e,byId:t}){return(0,q.jsxs)(`span`,{className:a(`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,Bh(e,t)),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-current opacity-80`}),Fh(e,t)]})}function eg({task:e,capabilities:t,onDone:n}){let r=Be(),[i,o]=(0,K.useState)(e.taskType),[s,c]=(0,K.useState)(e.title),[l,u]=(0,K.useState)(e.description),[d]=(0,K.useState)(()=>({estimate:e.estimate===null?``:String(e.estimate.amount),estimateUnit:e.estimate?.unit??`hours`,dueDate:e.dueDate??``})),[f,p]=(0,K.useState)(d),[m]=(0,K.useState)(()=>e.criteria.map(e=>Mg(e))),[h,g]=(0,K.useState)(m),[_,v]=(0,K.useState)(!1),y=h.some(e=>kg(e.kind)),b=Tg(f),x=JSON.stringify(Ng(h))!==JSON.stringify(Ng(m)),S=h.some(e=>Pg(e)!==null),C=i!==e.taskType||s!==e.title||l!==e.description||f.estimate!==d.estimate||f.estimateUnit!==d.estimateUnit||f.dueDate!==d.dueDate||x||_,w=ka(C,n,r.isPending);function T(t){t.preventDefault(),!(b===void 0||S)&&r.mutate({id:e.id,taskType:i,title:s.trim(),description:l.trim(),estimate:b,dueDate:f.dueDate||null,criteria:x&&e.status!==`done`?Ng(h):null,mergeCriterion:_&&!y&&e.status!==`done`},{onSuccess:n})}return(0,q.jsxs)(`form`,{onSubmit:T,"aria-label":`Edit task #${e.id}`,"data-dirty":C||void 0,className:`flex flex-col gap-1 max-md:gap-2`,onKeyDown:w.onKeyDown,children:[(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`select`,{"aria-label":`Type of #${e.id}`,className:a(qe,`w-28`),value:i,onChange:e=>o(e.target.value),children:Ph.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))}),(0,q.jsx)(`input`,{className:qe,"aria-label":`Title of #${e.id}`,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:!0})]}),(0,q.jsx)(eo,{label:`Description of #${e.id}`,placeholder:`Description (optional, Markdown)`,value:l,onChange:u}),(0,q.jsx)(Eg,{suffix:` of #${e.id}`,plan:f,onChange:p}),e.status!==`done`&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:[(0,q.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`}),t.merge&&(0,q.jsxs)(`label`,{className:`flex items-center gap-1.5 max-md:min-h-11`,title:`Keep or add the criterion that its pull request is merged, or its branch merged locally in a repository without origin`,children:[(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":`Done when merged, #${e.id}`,checked:y||_,onChange:e=>{v(e.target.checked&&!y),e.target.checked||g(h.filter(e=>!kg(e.kind)))}}),`Done when merged`]})]}),(0,q.jsx)(Fg,{taskId:e.id,capabilities:t,criteria:h,onChange:g})]}),w.asking?(0,q.jsx)(Aa,{label:`Discard changes to #${e.id}`,question:`Discard your changes to #${e.id}?`,onKeep:w.keep,onDiscard:w.discard}):(0,q.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,q.jsx)(G,{type:`submit`,size:`xs`,disabled:r.isPending||b===void 0||S,children:r.isPending?`Saving...`:`Save`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:w.request,children:`Discard`})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function tg({task:e,capabilities:t,onDone:n,onShipped:r}){let i=p(),[o,s]=(0,K.useState)(``),c=ka(o.trim()!==``,n,i.isPending);function l(t){t.preventDefault(),i.mutate({id:e.id,note:o.trim()},{onSuccess:n})}return(0,q.jsxs)(`form`,{onSubmit:l,"aria-label":`Conclude #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:c.onKeyDown,children:[(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Finish #`,e.id,` without merging. It is marked not adopted`,t.herdr&&(t.pullRequests?`, its pull request is closed with the conclusion as a comment, and the branch is kept`:` and its branch is kept`),`. Tasks that depend on it stay blocked.`]}),(0,q.jsx)(`textarea`,{className:a(qe,`h-auto min-h-16 py-1.5`),"aria-label":`Conclusion of #${e.id}`,placeholder:`What was tried, what was found, and why it is not adopted.`,value:o,onChange:e=>s(e.target.value),required:!0,autoFocus:!0}),c.asking?(0,q.jsx)(Aa,{label:`Discard conclusion of #${e.id}`,question:`Discard your conclusion of #${e.id}?`,onKeep:c.keep,onDiscard:c.discard}):(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsxs)(G,{type:`submit`,size:`xs`,variant:`destructive`,disabled:i.isPending||o.trim()===``,children:[(0,q.jsx)(kn,{}),i.isPending?`Concluding...`:`Conclude without merge`]}),(0,q.jsxs)(G,{type:`button`,size:`xs`,variant:`outline`,"aria-label":`Complete #${e.id} as shipped by another task or pull request`,title:t.github?`The work shipped through another task or a merged pull request: complete the task instead`:`The work shipped through another task: complete the task instead`,disabled:i.isPending,onClick:r,children:[(0,q.jsx)($n,{}),`Complete as shipped by...`]}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:c.request,children:`Back`})]}),i.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.error.message})]})}var ng={merged:`Merged`,completed:`Completed`,not_adopted:Xr.not_adopted};function rg({task:e,capabilities:t,onDone:n}){let r=T(),[i,o]=(0,K.useState)(``),s=ka(i.trim()!==``,n,r.isPending);function c(t){t.preventDefault(),r.mutate({id:e.id,reason:i.trim()},{onSuccess:n})}return(0,q.jsxs)(`form`,{onSubmit:c,"aria-label":`Reopen #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:s.onKeyDown,children:[(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Reopen #`,e.id,`: it is paused`,t.herdr&&` with its branch and commits`,`, and Resume continues the work. Its outcome and completion note are cleared and kept, with your reason, as a progress note.`]}),(0,q.jsx)(`textarea`,{className:a(qe,`h-auto min-h-16 py-1.5`),"aria-label":`Reason to reopen #${e.id}`,placeholder:`Why is the task not finished after all?`,value:i,onChange:e=>o(e.target.value),required:!0,autoFocus:!0}),s.asking?(0,q.jsx)(Aa,{label:`Discard reason to reopen #${e.id}`,question:`Discard your reason to reopen #${e.id}?`,onKeep:s.keep,onDiscard:s.discard}):(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsxs)(G,{changesData:!0,type:`submit`,size:`xs`,disabled:r.isPending||i.trim()===``,children:[(0,q.jsx)(kr,{}),r.isPending?`Reopening...`:`Reopen`]}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:s.request,children:`Back`})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function ig({task:e,onDone:t}){let n=Xe(),r=Object.keys(ng).filter(t=>t!==e.resolution),[i,o]=(0,K.useState)(r[0]),[s,c]=(0,K.useState)(``),l=ka(s.trim()!==``,t,n.isPending);function u(r){r.preventDefault(),n.mutate({id:e.id,resolution:i,note:s.trim()},{onSuccess:t})}return(0,q.jsxs)(`form`,{onSubmit:u,"aria-label":`Outcome of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:l.onKeyDown,children:[(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`#`,e.id,` is done as `,e.resolution===null?`done`:ng[e.resolution].toLowerCase(),`. Correct how it ended; the earlier outcome and note are kept as a progress note. Tasks that depend on it wait while it is not adopted.`]}),(0,q.jsx)(`select`,{"aria-label":`New outcome of #${e.id}`,className:a(qe,`w-40`),value:i,onChange:e=>o(e.target.value),children:r.map(e=>(0,q.jsx)(`option`,{value:e,children:ng[e]},e))}),(0,q.jsx)(`textarea`,{className:a(qe,`h-auto min-h-16 py-1.5`),"aria-label":`Outcome note of #${e.id}`,placeholder:`What happened, e.g. the change was reverted. This becomes the completion note.`,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:!0}),l.asking?(0,q.jsx)(Aa,{label:`Discard outcome of #${e.id}`,question:`Discard the new outcome of #${e.id}?`,onKeep:l.keep,onDiscard:l.discard}):(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsxs)(G,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||s.trim()===``,children:[(0,q.jsx)(Gn,{}),n.isPending?`Saving...`:`Change outcome`]}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:l.request,children:`Back`})]}),n.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function ag({task:e,tasks:t,context:n,onDone:r}){let i=h(),{github:a}=n.capabilities(e.workspaceId),o=t.filter(t=>t.id!==e.id&&t.status===`done`&&(t.resolution===`merged`||t.resolution===`completed`)).sort((e,t)=>t.id-e.id),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(``),d=s!==``,f=d||l.trim()!==``,p=ka(f,r,i.isPending);function m(t){t.preventDefault(),i.mutate({id:e.id,mergedWithTask:d?Number(s):null,pullRequestUrl:d?null:l.trim()},{onSuccess:r})}return(0,q.jsxs)(`form`,{onSubmit:m,"aria-label":`Complete #${e.id} as shipped by`,className:`flex flex-col gap-1`,onKeyDown:p.onKeyDown,children:[(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Complete #`,e.id,` as shipped by another task`,a&&` or a merged pull request into its base branch`,`. It becomes done as that one ended, and tasks that depend on it can start.`,a&&` An open pull request of its own must be closed first.`]}),(0,q.jsxs)(`select`,{"aria-label":`Task that shipped #${e.id}`,className:qe,value:s,onChange:e=>c(e.target.value),autoFocus:!0,children:[(0,q.jsx)(`option`,{value:``,children:a?`A pull request URL instead`:`Choose a task...`}),o.map(t=>(0,q.jsxs)(`option`,{value:t.id,children:[Vh(t.id,e.workspaceId,n),` `,t.title]},t.id))]}),a&&!d&&(0,q.jsx)(`input`,{className:`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,type:`url`,"aria-label":`Pull request that shipped #${e.id}`,placeholder:`https://github.com/owner/repo/pull/123`,value:l,onChange:e=>u(e.target.value)}),p.asking?(0,q.jsx)(Aa,{label:`Discard completion of #${e.id}`,question:`Discard completing #${e.id} as shipped by another?`,onKeep:p.keep,onDiscard:p.discard}):(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsxs)(G,{changesData:!0,type:`submit`,size:`xs`,disabled:i.isPending||!f,children:[(0,q.jsx)($n,{}),i.isPending?`Completing...`:`Complete as shipped`]}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:p.request,children:`Back`})]}),i.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.error.message})]})}function og({task:e,adding:t,onAdded:n}){let r=be(),[i,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(``),l=e.completionNote??``,u=i||t;function d(){o(!1),n()}let f=ka(s.trim()!==l.trim(),()=>{c(l),d()},r.isPending);function p(){c(l),o(!0)}function m(t){t.preventDefault(),r.mutate({id:e.id,note:s},{onSuccess:d})}return u?(0,q.jsxs)(`form`,{onSubmit:m,"aria-label":`Completion note form of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:f.onKeyDown,children:[(0,q.jsx)(`textarea`,{className:a(qe,`h-auto min-h-16 py-1.5`),"aria-label":`Completion note for #${e.id}`,placeholder:`What did this achieve? Impact, decisions, follow-ups. Reviews include this note.`,value:s,onChange:e=>c(e.target.value),autoFocus:!0}),f.asking?(0,q.jsx)(Aa,{label:`Discard note of #${e.id}`,question:`Discard your note for #${e.id}?`,onKeep:f.keep,onDiscard:f.discard}):(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{type:`submit`,size:`xs`,disabled:r.isPending||s.trim()===l||Ri(e)&&s.trim()===``,children:r.isPending?`Saving...`:`Save note`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:f.request,children:`Discard`})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]}):e.completionNote===null?null:(0,q.jsxs)(`div`,{className:`flex items-start gap-1 rounded-md bg-muted/60 px-2 py-1`,children:[(0,q.jsx)(Vr,{"aria-hidden":!0,className:`mt-0.5 size-3 shrink-0 text-muted-foreground`}),(0,q.jsx)(`p`,{"aria-label":`Completion note of #${e.id}`,className:`min-w-0 flex-1 whitespace-pre-line break-words-keep text-xs`,children:e.completionNote}),(0,q.jsx)(G,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit completion note of #${e.id}`,title:`Edit note`,onClick:p,children:(0,q.jsx)(xr,{})})]})}function sg(e){let t=/^#?(\d{1,9})$/.exec(e.trim()),n=t?Number(t[1]):0;return n>0?n:null}function cg({task:e,detailed:t,linking:n,onDone:r}){let i=O(),o=je(),[s,c]=(0,K.useState)(``),l=sg(s),u=i.isPending||o.isPending,d=i.error??o.error,f=e.status!==`done`,p=ka(s.trim()!==``,()=>{c(``),r()},u);function m(t){t.preventDefault(),l!==null&&i.mutate({id:e.id,number:l},{onSuccess:r})}let h=e.issue,_=h?(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs`,children:[!t&&(0,q.jsx)(Dn,{"aria-hidden":!0,className:`size-3 shrink-0 text-muted-foreground`}),!t&&(0,q.jsx)(`span`,{className:`sr-only`,children:`Issue `}),(0,q.jsxs)(`span`,{"aria-label":`Issue of #${e.id}`,title:h.url,className:`shrink-0 font-medium tabular-nums`,children:[`#`,h.number]}),(0,q.jsx)(`span`,{className:a(`min-w-0 font-mono text-muted-foreground select-all`,t?`break-all`:`truncate`),children:h.url}),f&&(0,q.jsx)(G,{changesData:!0,size:`icon-xs`,variant:`ghost`,"aria-label":`Unlink issue from #${e.id}`,title:`Unlink the issue; a pull request keeps its closing reference`,disabled:u,onClick:()=>i.mutate({id:e.id,number:null}),children:(0,q.jsx)(nt,{})})]}):n&&(0,q.jsxs)(`form`,{onSubmit:m,"aria-label":`Issue form of #${e.id}`,className:`flex flex-wrap items-center gap-1`,onKeyDown:p.onKeyDown,children:[(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 w-28`),inputMode:`numeric`,placeholder:`Issue #`,"aria-label":`Issue number of #${e.id}`,value:s,onChange:e=>c(e.target.value),autoFocus:!0}),p.asking?(0,q.jsx)(Aa,{label:`Discard issue number of #${e.id}`,question:`Discard the issue number?`,onKeep:p.keep,onDiscard:p.discard}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{type:`submit`,size:`xs`,disabled:l===null||u,children:i.isPending?`Linking...`:`Link`}),(0,q.jsxs)(G,{changesData:!0,type:`button`,size:`xs`,variant:`outline`,"aria-label":`Create issue for #${e.id}`,title:`Open a GitHub issue with the title and description of this task and link it`,disabled:u,onClick:()=>o.mutate(e.id,{onSuccess:r}),children:[(0,q.jsx)(g,{}),o.isPending?`Creating...`:`Create issue`]}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:p.request,children:`Discard`})]})]});return(0,q.jsxs)(q.Fragment,{children:[t&&h?(0,q.jsx)(dg,{label:`Issue`,children:_}):_,d&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:d.message})]})}function lg({taskId:e,collapsed:t,blockedReason:n,disabled:r,onClose:i,onKeep:o}){let s=(0,q.jsxs)(G,{size:`xs`,variant:`destructive`,"aria-label":`Close herdr workspace of #${e}`,title:n??`Close the herdr workspace, which ends its agent session; the worktree is kept`,disabled:r,onClick:i,children:[(0,q.jsx)(nt,{}),`Close workspace`]});return t?(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:`herdr workspace still open`}),s]}):(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Herdr workspace of paused #${e}`,className:a(`flex flex-col gap-2 rounded-md p-2 text-xs`,ni.attention),children:[(0,q.jsx)(`p`,{children:`Paused for a new prerequisite, but its herdr workspace is still open. Close it? This ends its agent session; the worktree is kept for resuming.`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[s,(0,q.jsx)(G,{size:`xs`,variant:`ghost`,"aria-label":`Keep herdr workspace of #${e} open`,onClick:o,children:`Keep open`})]})]})}function ug({task:e,mergedWith:t,through:n,detailed:r}){let i=t.pullRequestUrl;if(i===null){let t=`Shipped with task of #${e.id}`;return r?(0,q.jsx)(dg,{label:`Shipped with`,children:(0,q.jsx)(`span`,{"aria-label":t,children:n??`A deleted task`})}):(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs`,children:[(0,q.jsx)($n,{"aria-hidden":!0,className:`size-3 shrink-0 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Shipped with`}),(0,q.jsx)(`span`,{"aria-label":t,children:n??`a deleted task`})]})}let a=`Shipped with pull request of #${e.id}`;return r?(0,q.jsxs)(dg,{label:`Shipped with`,children:[(0,q.jsx)(`span`,{"aria-label":a,className:`break-all font-mono select-all`,children:i}),n&&(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Pull request of `,n]})]}):(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs`,children:[(0,q.jsx)($n,{"aria-hidden":!0,className:`size-3 shrink-0 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Shipped with`}),(0,q.jsx)(`span`,{"aria-label":a,className:`truncate select-all font-mono`,children:i}),n&&(0,q.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[`of `,n]})]})}function dg({label:e,children:t}){return(0,q.jsxs)(`section`,{"aria-label":e,className:`flex flex-col gap-0.5 text-xs`,children:[(0,q.jsx)(`h4`,{className:`font-medium text-muted-foreground`,children:e}),t]})}function fg({task:e,tasks:t,context:n,navigation:r}){let i=Oe(),o=ue(),s=Ue(),c=(i.data??[]).flatMap(({taskId:t,relatedId:n})=>t===e.id?[n]:n===e.id?[t]:[]).filter(e=>n.byId.has(e)),l=t.filter(t=>t.id!==e.id&&!c.includes(t.id)),u=[...new Set([e.workspaceId,...l.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:l.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),d=o.isPending||s.isPending,f=o.error??s.error;if(c.length===0&&u.length===0)return null;let p=u.length>0&&(0,q.jsxs)(`select`,{"aria-label":`Add related task to #${e.id}`,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`max-w-48`),value:``,disabled:d,onChange:t=>{t.target.value&&o.mutate({taskId:e.id,relatedId:Number(t.target.value)})},children:[(0,q.jsx)(`option`,{value:``,children:`Add related task...`}),u.map(e=>(0,q.jsx)(`optgroup`,{label:n.workspaceName(e.workspaceId),children:e.tasks.map(e=>(0,q.jsxs)(`option`,{value:e.id,children:[`#`,e.id,` `,e.title]},e.id))},e.workspaceId))]}),m=f&&(0,q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:f.message});return c.length===0?(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs`,children:[p,m]}):(0,q.jsxs)(dg,{label:`Related`,children:[(0,q.jsxs)(`ul`,{"aria-label":`Related tasks of #${e.id}`,className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[c.map(t=>{let i=n.byId.get(t),a=Vh(t,e.workspaceId,n);return(0,q.jsxs)(`li`,{className:`inline-flex h-6 min-w-0 items-center rounded-md border max-md:h-11 max-md:gap-2 max-md:border-0`,children:[(0,q.jsxs)(`button`,{type:`button`,"aria-label":`Open related task ${a}`,title:i?.title,className:`h-full min-w-0 max-w-56 truncate rounded-l-md px-1.5 tabular-nums hover:bg-muted max-md:rounded-md max-md:border max-md:px-3 disabled:cursor-default disabled:hover:bg-transparent`,disabled:r===void 0||!r.canOpen(t),onClick:()=>r?.open(t),children:[a,` `,i?.title]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove related task #${t} from #${e.id}`,title:`Remove related task`,className:`flex h-full items-center justify-center rounded-r-md p-1 text-muted-foreground hover:bg-muted max-md:w-11 max-md:rounded-md max-md:border hover:text-foreground disabled:opacity-50`,disabled:d,onClick:()=>s.mutate({taskId:e.id,relatedId:t}),children:(0,q.jsx)(nt,{className:`size-3`})})]},t)}),p]}),m]})}function pg({task:e,detailed:t}){let n=e.status!==`planned`||Hi(e),r=tt(e.id,n);if(r.isError)return(0,q.jsxs)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:[`Failed to load commits: `,r.error.message]});if(!r.data||r.data.length===0)return null;let i=(0,q.jsx)(`ul`,{"aria-label":`Commits of #${e.id}`,className:a(`flex flex-col gap-0.5`,!t&&`mt-1`),children:r.data.map(e=>(0,q.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,q.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,q.jsx)(`span`,{className:t?`min-w-0 break-words-keep`:`truncate`,children:e.message.split(`
|
|
17
17
|
`,1)[0]})]},e.sha))});return t?(0,q.jsx)(dg,{label:`Commits (${r.data.length})`,children:i}):i}var mg={commit:{label:`Commit`,icon:Zn,tone:`neutral`},pr_opened:{label:`Pull request opened`,icon:tr,tone:`review`},checks_passed:{label:`CI passed`,icon:Tn,tone:`success`},checks_failed:{label:`CI failed`,icon:jn,tone:`danger`},pr_merged:{label:`Merged`,icon:$n,tone:`success`}};function hg({url:e}){let t=jm(e),n=t=>{t.preventDefault(),jh(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,q.jsx)(`a`,{href:e,title:e,"aria-label":t?`Pull request #${t}`:`Pull request`,onClick:n,onAuxClick:n,className:`shrink-0 text-primary underline underline-offset-2 hover:no-underline`,children:t?`#${t}`:`PR`})}function gg({task:e,capabilities:t}){let n=t.git&&t.merge,r=Ke(e.id,n&&(e.status!==`planned`||Hi(e)));return n?r.isError?(0,q.jsxs)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:[`Failed to load git activity: `,r.error.message]}):!r.data||r.data.length===0?null:(0,q.jsx)(dg,{label:`Git activity`,children:(0,q.jsx)(`ol`,{"aria-label":`Git activity of #${e.id}`,className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-0.5 max-md:gap-y-1.5`,children:r.data.map(({kind:e,externalRef:t,title:n,author:r,occurredAt:i})=>{let{label:o,icon:s,tone:c}=mg[e];return(0,q.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-baseline`,title:r??void 0,children:[(0,q.jsx)(bh,{className:`text-muted-foreground`,at:i}),(0,q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 max-md:flex-wrap max-md:gap-y-0`,children:[(0,q.jsxs)(`span`,{className:a(`inline-flex shrink-0 items-baseline gap-1`,$r[c]),children:[(0,q.jsx)(s,{"aria-hidden":!0,className:`size-3 self-center`}),o]}),e===`pr_opened`||e===`pr_merged`?(0,q.jsx)(hg,{url:t}):(0,q.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:t.slice(0,7)}),(0,q.jsx)(`span`,{className:`min-w-0 break-words-keep max-md:basis-full`,children:n})]})]},`${e}:${t}`)})})}):null}var _g={progress:`Progress`,blocker:`Blocker`};function vg({kind:e}){return(0,q.jsx)(`span`,{"data-note-kind":e,className:a(`shrink-0 rounded-md px-1.5 font-medium`,e===`blocker`?Qr.attention:Qr.neutral),children:_g[e]})}function yg({task:e,detailed:t}){let n=e.notes;if(n.length===0)return null;if(!t){let t=n[n.length-1];return(0,q.jsxs)(`p`,{"aria-label":`Latest note of #${e.id}`,className:`flex min-w-0 items-center gap-1.5 text-xs`,title:pi(t.at),children:[(0,q.jsx)(vg,{kind:t.kind}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:Oh(t.body)}),n.length>1&&(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`+${n.length-1} more`})]})}return(0,q.jsx)(dg,{label:`Notes (${n.length})`,children:(0,q.jsx)(`ol`,{"aria-label":`Notes of #${e.id}`,className:`flex flex-col gap-2`,children:n.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(vg,{kind:e.kind}),(0,q.jsx)(bh,{className:`text-muted-foreground`,at:e.at})]}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep`,children:e.body}),children:(0,q.jsx)(Mh,{source:e.body})})]},t))})})}function bg({title:e,hint:t,icon:n,action:r}){return(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-1 rounded-xl border border-dashed px-6 py-10 text-center`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`mb-1 text-muted-foreground [&_svg]:size-6`,children:n??(0,q.jsx)(rr,{})}),(0,q.jsx)(`p`,{className:`text-sm font-medium`,children:e}),t&&(0,q.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:t}),r&&(0,q.jsx)(`div`,{className:`mt-2`,children:r})]})}function xg({workspace:e}){let t=Je(),n=t.isPending?t.variables.agentMerge:e.agentMerge,r=(0,K.useSyncExternalStore)(qt,Kt),i=r===`unreachable`||r===`retrying`;return(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,q.jsx)(`label`,{htmlFor:`agent-merge`,className:`shrink-0`,children:`Agent merge`}),(0,q.jsxs)(`select`,{id:`agent-merge`,className:a(De,`max-w-72`),value:n,disabled:t.isPending||i,onChange:n=>t.mutate({...e,agentMerge:n.target.value}),children:[(0,q.jsx)(`option`,{value:`never`,children:`Never, stop at the pull request`}),(0,q.jsxs)(`option`,{value:`afterChecks`,children:[`Into `,e.defaultBaseBranch,` after checks pass`]})]}),t.isError&&(0,q.jsx)(`span`,{role:`alert`,className:`truncate text-xs text-destructive`,children:t.error.message})]})}var Sg=`:new`;function Cg({workspace:e}){let t=Je(),n=P(),r=pe(),{git:i}=Ah(e),o=r.data?.filter(t=>t.workspaceId===e.id&&t.status===`in_review`),s=o===void 0||o.length>0,[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(``),[m,h]=(0,K.useState)(e.defaultBaseBranch),g=Pe(e.id,c!==null),_=fe(e.location),v=e.defaultBaseBranch,y=[...new Set([...g.data?.names??[],v])].sort(),b=f.trim(),x=t.isPending||n.isPending,S=!x&&(c===Sg?b!==``&&!y.includes(b)&&m!==``:c!==v),C=t.error??n.error,w=ka(c===Sg&&b!==``,()=>l(null),x);function T(){t.reset(),n.reset(),p(``),h(v),l(v)}function E(r){if(r.preventDefault(),c===null||!S)return;let i={onSuccess:()=>l(null)};c===Sg?n.mutate({workspace:e.id,name:b,from:m},i):t.mutate({...e,defaultBaseBranch:c},i)}return u?(0,q.jsx)(Ye,{workspace:e,onClose:()=>d(!1)}):c===null?(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-sm text-muted-foreground max-md:flex-wrap`,children:[(0,q.jsx)(Oa,{label:`workspace path`,full:_,short:ge(e.location)}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,"aria-label":`Move workspace`,title:`Point the workspace at its repository on another machine or in another folder`,onClick:()=>d(!0),children:`Move`}),i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`shrink-0`,children:`· base`}),(0,q.jsx)(`code`,{className:`text-foreground`,children:e.defaultBaseBranch})]}),e.pathProblem&&(0,q.jsx)(Le,{problem:e.pathProblem,className:`max-md:basis-full`}),i&&(0,q.jsx)(G,{size:`xs`,variant:`ghost`,"aria-label":`Change base branch`,disabled:s,onClick:T,children:`Change`}),o&&o.length>0&&(0,q.jsxs)(`span`,{className:`text-xs max-md:basis-full md:truncate`,children:[`Locked while `,o.map(e=>`#${e.id}`).join(`, `),` `,o.length>1?`are`:`is`,` `,`awaiting completion`]})]}):(0,q.jsxs)(`form`,{onSubmit:E,"aria-label":`Base branch`,className:`flex flex-col gap-1.5`,onKeyDown:w.onKeyDown,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,q.jsxs)(`span`,{className:`truncate`,children:[_,` ·`]}),(0,q.jsx)(`label`,{htmlFor:`base-branch`,className:`shrink-0`,children:`Base branch`}),(0,q.jsxs)(`select`,{id:`base-branch`,className:a(De,`max-w-56 font-mono`),value:c,onChange:e=>l(e.target.value),autoFocus:!0,children:[y.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e)),(0,q.jsx)(`option`,{value:Sg,children:`New branch...`})]}),g.isFetching&&(0,q.jsx)(`span`,{className:`text-xs`,children:`Loading branches...`})]}),c===Sg&&(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,q.jsx)(`label`,{htmlFor:`new-base-branch`,className:`shrink-0`,children:`Name`}),(0,q.jsx)(`input`,{id:`new-base-branch`,"aria-label":`New branch name`,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`max-w-56 font-mono`),value:f,onChange:e=>p(e.target.value),placeholder:`release/2026`,autoFocus:!0}),(0,q.jsx)(`label`,{htmlFor:`new-base-branch-from`,className:`shrink-0`,children:`from`}),(0,q.jsx)(`select`,{id:`new-base-branch-from`,"aria-label":`Start new branch from`,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`max-w-56 font-mono`),value:m,onChange:e=>h(e.target.value),children:y.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))}),y.includes(b)&&(0,q.jsxs)(`span`,{className:`text-xs`,children:[`Branch `,b,` already exists; pick it above.`]})]}),w.asking?(0,q.jsx)(Aa,{label:`Discard new branch name`,question:`Discard the new branch name?`,onKeep:w.keep,onDiscard:w.discard}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(G,{type:`submit`,size:`sm`,variant:`outline`,disabled:!S,children:c===Sg?`Create and save`:`Save`}),(0,q.jsx)(G,{type:`button`,size:`sm`,variant:`ghost`,onClick:w.request,children:`Discard`})]}),(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`New task branches start from this branch and pull requests target it.`,c===Sg&&` The new branch is pushed to origin.`]}),g.error&&(0,q.jsxs)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:[`Failed to load branches: `,g.error.message]}),g.data?.fetchError&&(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,title:g.data.fetchError,children:`Could not fetch origin; showing the branches known locally.`}),C&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:C.message})]})}function wg({workspace:e}){let t=Fe(e.location),n=te(t),r=o(),[i,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),u=n.data?.worktreeRoot??``,d=t.kind===`local`?`the server`:t.label,f=n.error??r.error,p=ka(i!==null&&i.trim()!==u,()=>{s(null),l(!1)},r.isPending);function m(e){e.preventDefault(),r.mutate({machine:t,worktreeRoot:(i??u).trim()||null},{onSuccess:()=>{s(null),l(!1)}})}return n.isSuccess&&u&&!c?(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,q.jsx)(qn,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,q.jsxs)(`span`,{className:`shrink-0`,children:[`Worktrees on `,d,` in`]}),(0,q.jsx)(`code`,{className:`truncate text-foreground`,title:u,children:u}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,"aria-label":`Change worktree root`,onClick:()=>l(!0),children:`Change`})]}):(0,q.jsxs)(`form`,{onSubmit:m,"aria-label":`Worktree root`,onKeyDown:c?p.onKeyDown:void 0,className:a(`flex flex-col gap-1.5 rounded-xl border p-3`,n.isSuccess&&!u&&`border-amber-300 bg-amber-50/60 dark:border-amber-900 dark:bg-amber-950/30`),children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 max-md:flex-wrap`,children:[(0,q.jsxs)(`label`,{htmlFor:`worktree-root`,className:`shrink-0 text-xs text-muted-foreground max-md:basis-full`,children:[`Worktree root on `,d]}),(0,q.jsx)(`input`,{id:`worktree-root`,className:a(qe,`font-mono max-md:min-w-0 max-md:flex-1`),placeholder:/^([a-zA-Z]:|\\\\)/.test(e.location.path)?`D:\\worktrees`:`/srv/worktrees`,value:i??u,onChange:e=>s(e.target.value),disabled:!n.isSuccess}),(0,q.jsx)(G,{type:`submit`,size:`sm`,variant:`outline`,disabled:i===null||r.isPending,children:`Save`}),c&&!p.asking&&(0,q.jsx)(G,{type:`button`,size:`sm`,variant:`ghost`,onClick:p.request,children:`Discard`})]}),p.asking&&(0,q.jsx)(Aa,{label:`Discard worktree root change`,question:`Discard the new worktree root?`,onKeep:p.keep,onDiscard:p.discard}),n.isSuccess&&!u&&(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set a worktree root to start tasks on this machine.`}),f&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:f.message})]})}function Tg(e){let t=Ii(e.estimate);return t===null?null:Number.isNaN(t)?void 0:{unit:e.estimateUnit,amount:t}}function Eg({suffix:e,plan:t,onChange:n}){let r=Tg(t)===void 0;return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,q.jsxs)(`label`,{className:`flex items-center gap-1`,children:[`Estimate`,(0,q.jsx)(`input`,{className:a(qe,`w-20`),inputMode:`decimal`,placeholder:`Optional`,"aria-label":`Estimate${e}`,"aria-invalid":r,title:`Optional: expected size, a number greater than 0`,value:t.estimate,onChange:e=>n({...t,estimate:e.target.value})})]}),(0,q.jsxs)(`select`,{"aria-label":`Estimate unit${e}`,className:a(De,`w-24`),value:t.estimateUnit,onChange:e=>n({...t,estimateUnit:e.target.value}),children:[(0,q.jsx)(`option`,{value:`hours`,children:`hours`}),(0,q.jsx)(`option`,{value:`days`,children:`days`}),(0,q.jsx)(`option`,{value:`weeks`,children:`weeks`}),(0,q.jsx)(`option`,{value:`months`,children:`months`})]}),(0,q.jsxs)(`label`,{className:`flex items-center gap-1`,children:[`Due`,(0,q.jsx)(`input`,{type:`date`,className:a(qe,`w-40`),"aria-label":`Due date${e}`,value:t.dueDate,onChange:e=>n({...t,dueDate:e.target.value})})]})]})}function Dg({task:e}){return e.estimate===null&&e.dueDate===null?null:(0,q.jsxs)(`p`,{"aria-label":`Plan of #${e.id}`,className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:[e.estimate!==null&&(0,q.jsxs)(`span`,{children:[`Estimate `,Pi(e.estimate)]}),e.dueDate!==null&&(0,q.jsx)(Xh,{task:e})]})}var Og={manual:`Manual`,url:`URL responds`,command:`Command succeeds`,pr_open_ci_green:`PR open with green CI`,pr_merged:`PR merged`,branch_merged_locally:`Merged locally`};function kg(e){return e===`pr_merged`||e===`branch_merged_locally`}function Ag(e){return e===`url`||e===`command`}var jg=0;function Mg(e){if(jg+=1,e===void 0)return{key:jg,id:null,text:``,kind:`manual`,target:``};let t=Ag(e.kind)?e.target??``:``;return{key:jg,id:e.id,text:e.text,kind:e.kind,target:t}}function Ng(e){return e.filter(e=>e.text.trim()!==``).map(e=>({...e.id===null?{}:{id:e.id},text:e.text.trim(),kind:e.kind,target:Ag(e.kind)?e.target.trim():null}))}function Pg(e){if(e.text.trim()===``)return null;let t=e.target.trim();return e.kind===`url`&&!/^https?:\/\/\S*$/.test(t)?`Enter an http:// or https:// URL`:e.kind===`command`&&t===``?`Enter the command to run`:null}function Fg({criteria:e,capabilities:t,onChange:n,taskId:r}){let[i,o]=(0,K.useState)(null),s=r===void 0?``:` of #${r}`,c=(t,r)=>n(e.map(e=>e.key===t?{...e,...r}:e));function l(){let t=Mg();o(t.key),n([...e,t])}return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 max-md:gap-2`,children:[e.length>0&&(0,q.jsx)(`ol`,{className:`flex flex-col gap-1 max-md:gap-2`,children:e.map((r,o)=>{let l=o+1,u=Pg(r),d=!t.criterionKinds.includes(r.kind);return(0,q.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1 max-md:grid max-md:grid-cols-[1rem_1fr_auto] max-md:gap-2 max-md:rounded-lg max-md:border max-md:p-2`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`w-4 shrink-0 text-right text-xs tabular-nums text-muted-foreground`,children:l}),(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-48 max-md:col-span-2`),"aria-label":`Criterion ${l} text${s}`,placeholder:`What has to hold, e.g. Docs updated`,value:r.text,onChange:e=>c(r.key,{text:e.target.value}),autoFocus:r.key===i}),(0,q.jsx)(`select`,{"aria-label":`Criterion ${l} kind${s}`,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`h-7 max-md:col-start-2 max-md:row-start-2`),value:r.kind,disabled:d,title:d?`The merge criterion keeps its kind`:`How the criterion is checked`,onChange:e=>c(r.key,{kind:e.target.value}),children:(d?[r.kind]:t.criterionKinds).map(e=>(0,q.jsx)(`option`,{value:e,children:Og[e]},e))}),Ag(r.kind)&&(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-40 font-mono max-md:col-span-2 max-md:col-start-2 max-md:row-start-3 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`),"aria-label":`Criterion ${l} target${s}`,"aria-invalid":u!==null,title:u??(r.kind===`url`?`Toodo checks that a GET of this URL succeeds`:t.herdr?`Toodo checks that this command exits with 0 in the task worktree`:`Toodo checks that this command exits with 0 in the workspace directory`),placeholder:r.kind===`url`?`https://example.com/health`:`npm test`,value:r.target,onChange:e=>c(r.key,{target:e.target.value})}),(0,q.jsx)(G,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Remove criterion ${l}${s}`,title:`Remove criterion`,className:`max-md:col-start-3 max-md:row-start-2`,onClick:()=>n(e.filter(e=>e.key!==r.key)),children:(0,q.jsx)(nt,{})})]},r.key)})}),(0,q.jsxs)(G,{type:`button`,size:`xs`,variant:`ghost`,className:`self-start`,"aria-label":r===void 0?void 0:`Add criterion to #${r}`,onClick:l,children:[(0,q.jsx)(g,{}),`Add criterion`]})]})}var Ig={pending:`Pending`,met:`Met`,failed:`Failed`},Lg={pending:$r.neutral,met:$r.success,failed:$r.danger},Rg={user:`you`,agent:`an agent`,toodo:`Toodo`};function zg({state:e}){let t=e===`met`?Tn:e===`failed`?jn:Nn;return(0,q.jsx)(`span`,{role:`img`,"aria-label":Ig[e],className:a(`flex size-4 shrink-0 items-center justify-center`,Lg[e]),children:(0,q.jsx)(t,{"aria-hidden":!0,className:`size-3.5`})})}function Bg(e){if(e.checkedBy===null)return null;let t=e.checkedAt===null?``:` ${fi(e.checkedAt)}`;return`Checked by ${Rg[e.checkedBy]}${t}`}function Vg({task:e,detailed:t}){let n=e.criteria;if(n.length===0)return null;let r=(0,q.jsx)(`ul`,{"aria-label":`Criteria of #${e.id}`,className:`flex flex-col gap-0.5`,children:n.map(n=>(0,q.jsx)(Hg,{task:e,criterion:n,detailed:t},n.id))});if(!t)return r;let i=n.filter(e=>e.state===`met`).length;return(0,q.jsx)(dg,{label:`Criteria (${i} of ${n.length} met)`,children:r})}function Hg({task:e,criterion:t,detailed:n}){let r=re(),[i,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(``),l=t.kind===`manual`&&e.status!==`done`,u=Bg(t),d=Ag(t.kind)?t.target:null;function f(){o(!1),c(``)}let p=ka(s.trim()!==``,f,r.isPending);function m(n){i?f():n?(r.reset(),o(!0)):r.mutate({taskId:e.id,criterionId:t.id,met:!1,evidence:null})}function h(n){n.preventDefault(),r.mutate({taskId:e.id,criterionId:t.id,met:!0,evidence:s.trim()||null},{onSuccess:f})}return(0,q.jsxs)(`li`,{"data-criterion-state":t.state,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,title:n?void 0:[u,t.evidence,d].filter(Boolean).join(`
|
|
18
|
-
`)||void 0,children:[l?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`label`,{className:`flex size-4 shrink-0 items-center justify-center max-md:-mx-3.5 max-md:size-11`,children:(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":`Check criterion ${t.id} of #${e.id}`,checked:t.state===`met`||i,disabled:r.isPending,onChange:e=>m(e.target.checked)})}),t.state===`failed`&&(0,q.jsx)(zg,{state:`failed`})]}):(0,q.jsx)(zg,{state:t.state}),(0,q.jsx)(`span`,{className:a(`min-w-0`,n?`break-words-keep`:`truncate`,t.state===`failed`&&$r.danger),children:t.text}),t.kind!==`manual`&&(0,q.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-muted-foreground`,children:Og[t.kind]}),!n&&t.evidence&&(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:t.evidence})]}),n&&d&&(0,q.jsx)(`code`,{className:`ml-5.5 break-all text-muted-foreground`,children:d}),n&&(t.evidence||u)&&(0,q.jsxs)(`p`,{className:`ml-5.5 whitespace-pre-line break-words-keep text-muted-foreground`,children:[t.evidence,t.evidence&&u&&` · `,t.checkedBy!==null&&(0,q.jsxs)(q.Fragment,{children:[`Checked by `,Rg[t.checkedBy],t.checkedAt!==null&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(bh,{at:t.checkedAt})]})]})]}),i&&(0,q.jsxs)(`form`,{onSubmit:h,className:`ml-5.5 flex flex-wrap items-center gap-1`,onKeyDown:p.onKeyDown,children:[(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-48`),"aria-label":`Evidence for criterion ${t.id}`,placeholder:`Evidence (optional), e.g. a link or what you checked`,value:s,onChange:e=>c(e.target.value),autoFocus:!0}),p.asking?(0,q.jsx)(Aa,{label:`Discard evidence for criterion ${t.id}`,question:`Discard the evidence?`,onKeep:p.keep,onDiscard:p.discard}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{type:`submit`,size:`xs`,disabled:r.isPending,children:r.isPending?`Saving...`:`Save`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:p.request,children:`Cancel`})]})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`ml-5.5 text-destructive`,children:r.error.message})]})}var Ug={taskType:`feat`,title:``,description:``,issue:``,criteria:[],mergeCriterion:!0,estimate:``,estimateUnit:`hours`,dueDate:``};function Wg({workspace:e,draft:t,onChange:n}){let r=s(),i=Ah(e),[o,c]=(0,K.useState)(!1),{taskType:l,title:u,description:d,issue:f}=t,p=sg(f),m=f.trim()!==``&&p===null,h=Tg(t),_=t.criteria.some(e=>Pg(e)!==null),v=e=>n({...t,taskType:e}),y=e=>n({...t,title:e}),b=e=>n({...t,description:e}),x=e=>n({...t,issue:e});function S(a){if(a.preventDefault(),h===void 0||_)return;let o=()=>{n({...t,title:``,description:``,issue:``,estimate:``,dueDate:``,criteria:[]}),c(!1)};r.mutate({workspaceId:e.id,taskType:l,title:u,description:d,estimate:h,dueDate:t.dueDate||null,criteria:Ng(t.criteria),mergeCriterion:i.merge&&t.mergeCriterion,issue:p},{onSuccess:o,onError:e=>e instanceof Ve&&o()})}return(0,q.jsxs)(Ka,{label:`New task`,expanded:o,onExpandedChange:c,onSubmit:S,children:[(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[o&&(0,q.jsx)(`select`,{"aria-label":`Task type`,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-28 shrink-0 font-mono`),value:l,onChange:e=>v(e.target.value),children:Ph.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))}),(0,q.jsx)(`input`,{className:a(qe,`min-w-0`),placeholder:o?`Task title`:`New task`,"aria-label":`Task title`,value:u,onChange:e=>y(e.target.value),required:!0}),(0,q.jsxs)(G,{type:`submit`,disabled:r.isPending||m||h===void 0||_,children:[(0,q.jsx)(g,{}),`Add task`]})]}),o&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,q.jsx)(eo,{label:`Description`,placeholder:`Description (optional, Markdown)`,value:d,onChange:b,className:`flex-1`}),i.github&&(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`mt-7 w-36 shrink-0 max-md:mt-13`),inputMode:`numeric`,placeholder:`Issue # (optional)`,"aria-label":`Issue number`,"aria-invalid":m,title:`An issue of the workspace repository; the pull request closes it on merge`,value:f,onChange:e=>x(e.target.value)})]}),(0,q.jsx)(Eg,{suffix:``,plan:t,onChange:e=>n({...t,...e})}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 border-t pt-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:[(0,q.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`}),i.merge&&(0,q.jsxs)(`label`,{className:`flex items-center gap-1.5 max-md:min-h-11`,title:`Add the criterion that its pull request is merged, or its branch merged locally in a repository without origin`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:t.mergeCriterion,onChange:e=>n({...t,mergeCriterion:e.target.checked})}),`Done when merged`]})]}),(0,q.jsx)(Fg,{capabilities:i,criteria:t.criteria,onChange:e=>n({...t,criteria:e})})]})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var Gg={completed:$r.success,opened_for_review:$r.review,started:$r.progress,worked_on:$r.progress,planned:$r.neutral},Kg=a(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,Qr.neutral),qg=[{kind:`week`,label:`Week`},{kind:`month`,label:`Month`},{kind:`quarter`,label:`Quarter`},{kind:`year`,label:`Year`},{kind:`custom`,label:`Custom`}];function Jg(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}function Yg({disabled:e,children:t}){let[n,r]=(0,K.useState)(!1),i=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)},t=e=>e.key===`Escape`&&r(!1);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,q.jsxs)(`div`,{ref:i,className:`relative`,children:[(0,q.jsxs)(G,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":n,disabled:e,onClick:()=>r(!n),children:[(0,q.jsx)(Vn,{}),(0,q.jsx)(`span`,{className:`max-md:sr-only`,children:`Export`})]}),n&&(0,q.jsx)(`div`,{role:`menu`,"aria-label":`Export review`,className:`absolute right-0 z-10 mt-1 flex w-48 flex-col rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:t(()=>r(!1))})]})}function Xg({onSelect:e,children:t}){return(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e,className:`rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted max-md:min-h-11`,children:t})}function Zg({onShowTask:e}){let[t,n]=(0,K.useState)(()=>Cm(`week`,li(Date.now()/1e3))),[r,i]=(0,K.useState)(null),{start:o,end:s}=Em(t),c=le(o,s),l=Qe(),u=new Map(l.data?.map(e=>[e.id,e.name])),d=pm[t.kind];function f(e){i(null),n(e)}function p(e){e!==t.kind&&f(e===`custom`?{...t,kind:e}:Cm(e,t.from))}async function h(e){try{await navigator.clipboard.writeText(eh(t,e,l.data??[],Date.now()/1e3)),i(`Copied as Markdown.`)}catch(e){i(`Could not copy: ${String(e)}`)}}function g(e,n){let r=l.data??[],a=e===`csv`?ih(n,r,Date.now()/1e3):eh(t,n,r,Date.now()/1e3),o=sh(t,e);Jg(o,a,e===`csv`?`text/csv`:`text/markdown`),i(`Downloaded ${o}`)}return(0,q.jsxs)(`section`,{"aria-labelledby":`review-heading`,className:`flex flex-col gap-4`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h2`,{id:`review-heading`,className:`text-xl font-semibold tracking-tight`,children:mm[t.kind]}),(0,q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Work recorded from `,t.from,` to `,t.to,` across all workspaces.`]})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`div`,{role:`group`,"aria-label":`Review period`,className:`flex rounded-md border p-0.5 max-md:w-full`,children:qg.map(({kind:e,label:n})=>(0,q.jsx)(G,{size:`sm`,variant:t.kind===e?`default`:`ghost`,"aria-pressed":t.kind===e,onClick:()=>p(e),children:n},e))}),t.kind===`week`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`label`,{htmlFor:`week-start`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`Week starting`}),(0,q.jsx)(`input`,{id:`week-start`,type:`date`,required:!0,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40 max-md:w-0 max-md:min-w-0 max-md:flex-1`),value:t.from,onChange:e=>e.target.value&&f(bm(e.target.value))})]}),t.kind===`custom`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`label`,{htmlFor:`review-from`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`From`}),(0,q.jsx)(`input`,{id:`review-from`,type:`date`,required:!0,max:t.to,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.from,onChange:e=>e.target.value&&e.target.value<=t.to&&f({...t,from:e.target.value})}),(0,q.jsx)(`label`,{htmlFor:`review-to`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`To`}),(0,q.jsx)(`input`,{id:`review-to`,type:`date`,required:!0,min:t.from,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.to,onChange:e=>e.target.value&&e.target.value>=t.from&&f({...t,to:e.target.value})})]}),t.kind!==`week`&&t.kind!==`custom`&&(0,q.jsx)(`span`,{className:`px-1 text-sm font-medium`,children:Dm(t)}),(0,q.jsx)(G,{size:`icon-sm`,variant:`outline`,"aria-label":`Previous ${d}`,title:`Previous ${d}`,onClick:()=>f(wm(t,-1)),children:(0,q.jsx)(m,{})}),(0,q.jsx)(G,{size:`icon-sm`,variant:`outline`,"aria-label":`Next ${d}`,title:`Next ${d}`,onClick:()=>f(wm(t,1)),children:(0,q.jsx)(F,{})}),t.kind!==`custom`&&(0,q.jsxs)(G,{size:`sm`,variant:`ghost`,onClick:()=>f(Cm(t.kind,li(Date.now()/1e3))),children:[(0,q.jsx)(_n,{className:`md:hidden`,"aria-hidden":!0}),(0,q.jsxs)(`span`,{className:`max-md:sr-only`,children:[`This `,d]})]}),(0,q.jsx)(`div`,{className:`ml-auto`,children:(0,q.jsx)(Yg,{disabled:!c.data,children:e=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Xg,{onSelect:()=>{e(),c.data&&h(c.data)},children:`Copy as Markdown`}),(0,q.jsx)(Xg,{onSelect:()=>{e(),c.data&&g(`md`,c.data)},children:`Save as Markdown`}),(0,q.jsx)(Xg,{onSelect:()=>{e(),c.data&&g(`csv`,c.data)},children:`Save as CSV`})]})})})]}),r&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:r}),c.isPending&&(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading the review...`}),c.isError&&(0,q.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load the review: `,c.error.message]}),c.data?.length===0&&(0,q.jsx)(bg,{title:`No recorded activity in this ${d}.`,hint:`Pick another period to look at earlier work.`,action:(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>f(wm(t,-1)),children:[`Show the `,d,` before`]})}),c.data&&c.data.length>0&&(0,q.jsx)(t_,{period:t,entries:c.data,workspaces:l.data??[]}),c.data&&(0,q.jsx)(e_,{period:t,entries:c.data}),t.kind===`year`&&c.data&&(0,q.jsx)($g,{entries:c.data}),c.data&&Om(c.data).map(t=>(0,q.jsxs)(`section`,{"aria-label":dm[t.outcome],className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`h3`,{className:a(`text-sm font-semibold`,Gg[t.outcome]),children:[dm[t.outcome],` `,(0,q.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.entries.length,`)`]})]}),(0,q.jsx)(`ul`,{className:`flex flex-col divide-y rounded-lg border`,children:t.entries.map(({task:t,at:n,commits:r})=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 px-3 py-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Ea,{type:t.taskType}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`#`,t.id]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Open #${t.id} ${t.title}`,title:t.title,onClick:()=>e?.(t.id),className:`min-w-0 flex-1 truncate text-left text-sm font-medium hover:underline max-md:min-h-11`,children:t.title}),t.resolution===`not_adopted`&&(0,q.jsx)(`span`,{className:Kg,children:`Not adopted`}),t.resolution===`completed`&&(0,q.jsx)(`span`,{className:a(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,Qr.success),children:`Completed`}),t.pullRequestUrl&&(0,q.jsx)(Qg,{url:t.pullRequestUrl,stats:t.pullRequest}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground max-md:hidden`,children:[u.get(t.workspaceId)??`Workspace ${t.workspaceId}`,` · `,(0,q.jsx)(bh,{at:n})]})]}),t.completionNote&&(0,q.jsx)(`p`,{"aria-label":`Completion note of #${t.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:t.completionNote}),r.length>0&&(0,q.jsx)(`ul`,{"aria-label":`Commits of #${t.id} this ${d}`,className:`flex flex-col gap-0.5`,children:r.map(e=>(0,q.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,q.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,q.jsx)(`span`,{className:`truncate`,children:km(e.message)})]},e.sha))})]},t.id))})]},t.outcome))]})}function Qg({url:e,stats:t}){let n=jm(e),r=t=>{t.preventDefault(),jh(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,q.jsx)(`a`,{href:e,title:t?`${e} \u00b7 ${Mm(t)}`:e,"aria-label":n?`Pull request #${n}`:`Pull request`,onClick:r,onAuxClick:r,className:`shrink-0 text-xs text-primary underline underline-offset-2 hover:no-underline max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:n?`#${n}`:`PR`})}function $g({entries:e}){let t=Gm(e);return t===null?null:(0,q.jsxs)(`section`,{"aria-labelledby":`year-in-review-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsx)(`h3`,{id:`year-in-review-heading`,className:`text-sm font-semibold`,children:`Year in review`}),t.pullRequests&&(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Merged pull requests`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.pullRequests})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Lines changed`}),(0,q.jsxs)(`dd`,{className:`text-lg font-semibold`,children:[(0,q.jsxs)(`span`,{children:[`+`,t.pullRequests.additions]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,q.jsxs)(`span`,{children:[`-`,t.pullRequests.deletions]})]})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Files changed`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.changedFiles})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Reviews`}),(0,q.jsxs)(`dd`,{className:`text-lg font-semibold`,title:Km(t.pullRequests),children:[t.pullRequests.reviews,(0,q.jsxs)(`span`,{className:`ml-1 text-xs font-normal text-muted-foreground`,children:[`on `,t.pullRequests.reviewed,` of `,t.pullRequests.pullRequests]})]})]})]}),t.largest.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest pull requests`}),(0,q.jsx)(`ol`,{"aria-label":`Largest pull requests`,className:`flex flex-col gap-1`,children:t.largest.map(({task:e,pullRequest:t})=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(Ea,{type:e.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:Mm(t)})]},e.id))})]}),t.research.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Research conclusions`}),(0,q.jsx)(`ul`,{"aria-label":`Research conclusions`,className:`flex flex-col divide-y rounded-md border`,children:t.research.map(({task:e,at:t,adopted:n})=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsx)(`span`,{className:a(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,n?Qr.success:Qr.neutral),children:n?`Adopted`:`Not adopted`}),(0,q.jsx)(bh,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,at:t})]}),(0,q.jsx)(`p`,{"aria-label":`Research conclusion of #${e.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:e.completionNote??(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`No conclusion written.`})})]},e.id))})]}),t.overruns.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest estimate overruns`}),(0,q.jsx)(`ol`,{"aria-label":`Largest estimate overruns`,className:`flex flex-col gap-1`,children:t.overruns.map(({task:e,estimated:t,actual:n})=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(Ea,{type:e.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[`estimated `,Xm(t),`, `,Xm(n),` active`]})]},e.id))})]})]})}function e_({period:e,entries:t}){let n=zm(e,t,Date.now()/1e3);return n===null?null:(0,q.jsxs)(`section`,{"aria-labelledby":`plan-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsx)(`h3`,{id:`plan-heading`,className:`text-sm font-semibold`,children:`Plan vs actual`}),(0,q.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Estimate vs active time`}),(0,q.jsx)(`dd`,{children:n.time?Bm(n.time):`No completed task had an estimate`})]}),(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Due dates met`}),(0,q.jsx)(`dd`,{children:n.dueDates?Vm(n.dueDates):`No completed task had a due date`})]})]}),n.late.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Late tasks`}),(0,q.jsx)(`ul`,{"aria-label":`Late tasks`,className:`flex flex-col gap-1`,children:n.late.map(e=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[(0,q.jsx)(Ea,{type:e.task.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.task.title})]}),(0,q.jsx)(`span`,{className:a(`ml-auto shrink-0 text-xs`,$r.danger),children:Hm(e)})]},e.task.id))})]})]})}function t_({period:e,entries:t,workspaces:n}){let r=Rm(e,t,n),i=Math.max(1,...(r.completedPerMonth??[]).map(({count:e})=>e));return(0,q.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[r.outcomes.map(({outcome:e,count:t})=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:dm[e]}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t})]},e)),r.notAdopted>0&&(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Not adopted`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.notAdopted})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Commits`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.commits})]})]}),(0,q.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[Qm.map(e=>{let t=r[e];return(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:$m[e]}),(0,q.jsx)(`dd`,{children:t===null?`No data`:`${Xm(t.median)} (${t.tasks} ${t.tasks===1?`task`:`tasks`})`})]},e)}),r.changes&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Changes in completed pull requests`}),(0,q.jsx)(`dd`,{children:Jm(r.changes)})]}),r.completedByType.length>0&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by type`}),(0,q.jsx)(`dd`,{children:r.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)})]}),r.completedByWorkspace.length>0&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by workspace`}),(0,q.jsx)(`dd`,{children:r.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)})]})]}),r.completedPerMonth&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Completed per month`}),(0,q.jsx)(`ul`,{"aria-label":`Completed per month`,className:`flex flex-col gap-0.5`,children:r.completedPerMonth.map(({month:e,count:t})=>(0,q.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`w-16 shrink-0 font-mono text-muted-foreground`,children:e}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`h-2 rounded-sm`,ri.success),style:{width:`${t/i*60}%`,minWidth:t>0?4:0}}),(0,q.jsx)(`span`,{children:t})]},e))})]})]})}var n_=`h-7 w-16 rounded-md border bg-background px-2 text-sm`;function r_(e){return e.split(/[\\/]/).pop()??e}function i_(e){return e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var a_={automatic:`Automatic`,preRestore:`Before restore`};function o_(e){return e.kind===`upload`?e.file.name:r_(e.path)}function s_(){let e=me(),t=M(),n=A(),r=H(),i=_e(),a=(0,K.useRef)(null),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),u=t.isPending,d=r.isPending||i.isPending;function f(){l(null),t.mutate(void 0,{onSuccess:e=>l(`Downloaded ${e}`)})}function p(){l(null),a.current?.click()}function m(e){l(null);let t={onSuccess:t=>{s(null),l(`Restored ${o_(e)}. The previous data was saved as ${r_(t.path)}.`)}};e.kind===`upload`?i.mutate(e.file,t):r.mutate(r_(e.path),t)}let h=t.error??n.error??r.error??i.error??e.error;return(0,q.jsxs)(`section`,{"aria-label":`Backups`,className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:f,disabled:u,children:u?`Exporting...`:`Export...`}),(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:p,disabled:d,children:`Restore...`}),(0,q.jsx)(`input`,{ref:a,type:`file`,accept:`.sqlite3,.db`,"aria-label":`Database file to restore`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s({kind:`upload`,file:t})}})]}),o&&(0,q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm restore`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,q.jsxs)(`p`,{className:`text-xs break-words`,children:[`Replace all workspaces and tasks with `,(0,q.jsx)(`span`,{className:`font-medium`,children:o_(o)}),`? The current data is backed up first.`]}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{size:`xs`,variant:`destructive`,onClick:()=>m(o),disabled:d,children:d?`Restoring...`:`Replace data`}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,onClick:()=>s(null),disabled:d,children:`Cancel`})]})]}),c&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs break-words text-muted-foreground`,children:c}),h&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs break-words text-destructive`,children:h.message}),(0,q.jsx)(c_,{}),(0,q.jsxs)(`ul`,{"aria-label":`Saved backups`,className:`flex flex-col divide-y`,children:[e.data?.length===0&&(0,q.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No backups yet.`}),e.data?.map(e=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5 text-xs first:pt-0`,title:e.path,children:[(0,q.jsxs)(`span`,{className:`flex flex-col`,children:[(0,q.jsx)(`time`,{className:`font-medium`,dateTime:new Date(e.createdAt*1e3).toISOString(),children:pi(e.createdAt)}),(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,q.jsx)(bh,{at:e.createdAt}),` · `,a_[e.kind],` · `,i_(e.sizeBytes)]})]}),(0,q.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`outline`,"aria-label":`Download backup from ${pi(e.createdAt)}`,disabled:n.isPending,onClick:()=>{l(null),n.mutate(r_(e.path),{onSuccess:e=>l(`Downloaded ${e}`)})},children:`Download`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,"aria-label":`Restore this backup from ${pi(e.createdAt)}`,onClick:()=>{l(null),s({kind:`backup`,path:e.path})},children:`Restore this backup`})]})]},e.path))]})]})}function c_(){let e=at();if(!e.data)return null;let{enabled:t,intervalHours:n,keep:r}=e.data;return(0,q.jsx)(l_,{initial:e.data},`${t}-${n}-${r}`)}function l_({initial:e}){let t=L(),[n,r]=(0,K.useState)(e.enabled),[i,a]=(0,K.useState)(String(e.intervalHours)),[o,s]=(0,K.useState)(String(e.keep));function c(e){e.preventDefault(),t.mutate({enabled:n,intervalHours:Number(i),keep:Number(o)})}return(0,q.jsxs)(`form`,{onSubmit:c,"aria-label":`Automatic backups`,className:`flex flex-col gap-1 text-xs`,children:[(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),`Back up automatically`]}),(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Every`,(0,q.jsx)(`input`,{className:n_,type:`number`,min:1,max:720,"aria-label":`Hours between backups`,value:i,onChange:e=>a(e.target.value),disabled:!n,required:!0}),`hours`]}),(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Keep`,(0,q.jsx)(`input`,{className:n_,type:`number`,min:1,max:100,"aria-label":`Backups to keep`,value:o,onChange:e=>s(e.target.value),disabled:!n,required:!0}),`latest`]}),t.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:t.error.message}),(0,q.jsx)(G,{type:`submit`,size:`xs`,variant:`outline`,className:`self-start`,disabled:t.isPending,children:t.isPending?`Saving...`:`Save schedule`})]})}var u_=[`connected-apps`];function d_(e){return e.split(` `).includes(`toodo.write`)?`Read and write access`:`Read access`}function f_({url:e}){let[t,n]=(0,K.useState)(null);async function r(e){try{await navigator.clipboard.writeText(e),n(`Copied the MCP URL.`)}catch(e){n(`Could not copy (${String(e)}). Select the URL and copy it by hand.`)}}return e===null?(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`To connect ChatGPT or Claude, restart the server with `,(0,q.jsx)(`code`,{children:`TOODO_PUBLIC_URL`}),` set to the`,` `,(0,q.jsx)(`code`,{children:`https://`}),` origin they reach it at; see `,(0,q.jsx)(`code`,{children:`docs/server.md`}),`.`]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Add this URL to ChatGPT or Claude as a remote MCP connector with OAuth, leaving client ID and secret empty, then approve the app with `,(0,q.jsx)(`code`,{children:`web-token`}),`.`]}),(0,q.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`Public MCP URL`,children:e}),(0,q.jsx)(G,{size:`xs`,className:`self-start`,onClick:()=>void r(e),children:`Copy MCP URL`}),t&&(0,q.jsx)(`p`,{role:`status`,children:t})]})}function p_({app:e}){let t=We(),[n,r]=(0,K.useState)(!1),i=Me({mutationFn:()=>Te(f.revokeConnectedApp(e.grantId)),onSuccess:()=>t.invalidateQueries({queryKey:u_})}),a=e.clientName??e.clientId;return(0,q.jsxs)(`li`,{"aria-label":`App ${a}`,className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:d_(e.scopes)}),(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,q.jsx)(bh,{at:e.createdAt,prefix:`Connected `}),` · `,e.lastUsedAt===null?`Not used yet`:(0,q.jsx)(bh,{at:e.lastUsedAt,prefix:`Last used `})]}),n?(0,q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${a}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:ze(()=>r(!1),i.isPending),children:[(0,q.jsx)(`p`,{children:`The app's tokens stop working at once; to use it later, connect it again from the app.`}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,q.jsx)(G,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${a}`,onClick:()=>r(!0),children:`Revoke`}),i.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function m_(){let e=c({queryKey:u_,queryFn:()=>Te(f.listConnectedApps())});return(0,q.jsxs)(`section`,{"aria-label":`Connected apps`,className:`flex flex-col gap-2 text-sm`,children:[e.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f_,{url:e.data.publicMcpUrl}),e.data.apps.length===0?(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`No apps connected yet.`}):(0,q.jsx)(`ul`,{"aria-label":`Apps with access`,className:`flex flex-col gap-2`,children:e.data.apps.map(e=>(0,q.jsx)(p_,{app:e},e.grantId))})]})]})}var h_=class extends Error{constructor(){super(`The server did not accept this token.`)}};async function g_(e){if(e.status===401)throw new h_;if(!e.ok)throw Error(await Yt(e));return e}async function __(e,t){return(await(await g_(await Gt.fetch(`/api/devices`,{headers:Zt(e)}))).json()).some(e=>e.current)?e:(await(await g_(await Gt.fetch(`/api/devices`,{method:`POST`,headers:{...Zt(e),"Content-Type":`application/json`},body:JSON.stringify({label:t})}))).json()).token}async function v_(){return await(await Qt(`/api/devices`)).json()}async function y_(e){return(await(await Qt(`/api/devices`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({label:e})})).json()).token}async function b_(e){return await(await Qt(`/api/devices/${e}/revoke`,{method:`POST`})).json()}function x_(e){let t=[[`Edg/`,`Edge`],[`Firefox/`,`Firefox`],[`Chrome/`,`Chrome`],[`Safari/`,`Safari`]].find(([t])=>e.includes(t))?.[1]??`Browser`,n=[[`Android`,`Android`],[`iPhone`,`iOS`],[`iPad`,`iPadOS`],[`Windows`,`Windows`],[`Mac OS`,`macOS`],[`Linux`,`Linux`]].find(([t])=>e.includes(t))?.[1];return n?`${t} on ${n}`:t}var S_=[`devices`];function C_({devices:e}){let t=We(),n=Me({mutationFn:()=>y_(x_(navigator.userAgent)),onSuccess:e=>(Xt(e),t.invalidateQueries({queryKey:S_}))}),r=e.find(e=>e.current);return(0,q.jsxs)(`div`,{role:`group`,"aria-label":`This browser`,className:`flex flex-col gap-1 rounded-md bg-muted px-2 py-1.5`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`This browser: `}),(0,q.jsx)(`span`,{className:`font-medium break-words`,children:r?r.label:`shared token`})]}),!r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Register it to give it a token of its own that you can revoke alone.`}),(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`outline`,className:`self-start`,disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?`Registering...`:`Register this browser`})]}),n.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:n.error.message})]})}function w_({device:e}){let t=We(),[n,r]=(0,K.useState)(!1),i=Me({mutationFn:()=>b_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:S_})}),a=e.revokedAt!==null;return(0,q.jsxs)(`li`,{"aria-label":`Device ${e.label}`,"data-revoked":a,className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{className:a?`truncate text-muted-foreground line-through`:`truncate font-medium`,children:e.label}),e.current&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`(this device)`})]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.revokedAt===null?(0,q.jsx)(bh,{at:e.lastSeenAt,prefix:`Last seen `}):(0,q.jsx)(bh,{at:e.revokedAt,prefix:`Revoked `})}),!a&&(n?(0,q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${e.label}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:ze(()=>r(!1),i.isPending),children:[(0,q.jsx)(`p`,{children:e.current?`This browser signs out and needs the shared token to sign in again.`:`The device's token stops working for good.`}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,q.jsx)(G,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${e.label}`,onClick:()=>r(!0),children:`Revoke`})),i.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function T_(){let e=c({queryKey:S_,queryFn:v_});return e.data?(0,q.jsxs)(q.Fragment,{children:[e.data.filter(e=>e.revokedAt===null).length,` signed in`]}):null}function E_(){let e=c({queryKey:S_,queryFn:v_});return(0,q.jsxs)(`section`,{"aria-label":`Devices`,className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Each browser signs in with the shared token once and then keeps its own token. Revoke a lost device here.`}),e.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,q.jsx)(C_,{devices:e.data}),e.data&&(0,q.jsx)(`ul`,{"aria-label":`Signed-in devices`,className:`flex flex-col gap-2`,children:e.data.map(e=>(0,q.jsx)(w_,{device:e},e.id))})]})}var D_=[`push`],O_=[{key:`agent`,label:`Agent finished or needs input`},{key:`pullRequests`,label:`Pull request checks and reviews`},{key:`completion`,label:`Task awaiting completion`}],k_={"needs-install":`Add Toodo to the Home Screen to get notifications (iOS 16.4 or later).`,unsupported:`This browser cannot get notifications from Toodo.`};function A_({subscription:e,permission:t}){return e?`on`:t===`denied`?`blocked`:`off`}function j_({state:e}){let t=We(),n=e=>t.setQueryData(D_,t=>t&&{...t,subscription:e}),r=()=>t.invalidateQueries({queryKey:D_}),i=Me({mutationFn:t=>Se(t,e.publicKey),onSuccess:n,onError:r}),a=Me({mutationFn:ye,onSuccess:()=>n(null),onError:r}),o=Me({mutationFn:we,onSuccess:n}),s=Me({mutationFn:de}),c=[i,a,o,s].reduce((e,t)=>t.submittedAt>e.submittedAt?t:e),l=()=>i.mutate(Notification.requestPermission()),{subscription:u}=e,d=(o.isPending?o.variables:void 0)??u?.settings;return(0,q.jsxs)(q.Fragment,{children:[u&&d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`font-medium`,children:`Notifications are on for this device.`}),(0,q.jsxs)(`fieldset`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`legend`,{className:`mb-1 text-muted-foreground`,children:`Notify about`}),O_.map(({key:e,label:t})=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:d[e],disabled:o.isPending,onChange:t=>o.mutate({...d,[e]:t.target.checked})}),t]},e))]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`outline`,disabled:s.isPending,onClick:()=>s.mutate(),children:`Send test notification`}),(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`ghost`,"aria-label":`Disable notifications on this device`,disabled:a.isPending,onClick:()=>a.mutate(),children:`Disable notifications`})]})]}):e.permission===`denied`?(0,q.jsx)(`p`,{children:`Notifications are blocked for Toodo in the browser settings. Allow them there to turn them on.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`font-medium`,children:`Notifications are off for this device.`}),(0,q.jsx)(G,{size:`xs`,className:`self-start`,"aria-label":`Enable notifications on this device`,disabled:i.isPending,onClick:l,children:`Enable notifications`})]}),c===s&&s.isSuccess&&(0,q.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:`Test notification sent.`}),c.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.error.message})]})}function M_(){let[e]=(0,K.useState)(Ee);return{support:e,state:c({queryKey:D_,queryFn:He,enabled:e===`supported`})}}function N_(){let{state:e}=M_();return e.data?(0,q.jsx)(q.Fragment,{children:A_(e.data)}):null}function P_(){let{support:e,state:t}=M_();return(0,q.jsxs)(`section`,{"aria-label":`Notifications`,className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:e===`supported`?`Alerts reach this device even while Toodo is closed.`:k_[e]}),t.isLoading&&(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Checking this device...`}),t.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:t.error.message}),t.data&&(0,q.jsx)(j_,{state:t.data})]})}var F_=[`light`,`dark`,`system`],I_=`toodo-theme`,L_=`(prefers-color-scheme: dark)`,R_=new Set;function z_(e){return F_.includes(e)}function B_(){let e=localStorage.getItem(I_);return z_(e)?e:`system`}function V_(){let e=B_(),t=e===`dark`||e===`system`&&window.matchMedia(L_).matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`}function H_(e){localStorage.setItem(I_,e),V_(),R_.forEach(e=>e())}function U_(){V_(),window.matchMedia(L_).addEventListener(`change`,V_)}function W_(e){return R_.add(e),()=>R_.delete(e)}function G_(){return(0,K.useSyncExternalStore)(W_,B_)}var K_=[{value:`light`,label:`Light theme`,Icon:Ur},{value:`dark`,label:`Dark theme`,Icon:hr},{value:`system`,label:`System theme`,Icon:pr}];function q_(){let e=G_();return(0,q.jsx)(`div`,{role:`group`,"aria-label":`Theme`,className:`flex gap-0.5 rounded-lg border p-0.5`,children:K_.map(({value:t,label:n,Icon:r})=>(0,q.jsx)(G,{variant:e===t?`default`:`ghost`,size:`icon-sm`,"aria-label":n,"aria-pressed":e===t,title:n,onClick:()=>H_(t),children:(0,q.jsx)(r,{})},t))})}var J_=[{id:`general`,label:`General`,icon:(0,q.jsx)(Lr,{})},{id:`agents`,label:`Agent access`,icon:(0,q.jsx)(hn,{}),status:(0,q.jsx)(Ci,{})},{id:`apps`,label:`Connected apps`,icon:(0,q.jsx)(Tr,{})},{id:`devices`,label:`Devices`,icon:(0,q.jsx)(dr,{}),status:(0,q.jsx)(T_,{})},{id:`notifications`,label:`Notifications`,icon:(0,q.jsx)(pn,{}),status:(0,q.jsx)(N_,{})},{id:`backups`,label:`Backups`,icon:(0,q.jsx)(zn,{})}];function Y_(){let e=c({queryKey:[`app-info`],queryFn:()=>f.appInfo()});return(0,q.jsxs)(`section`,{"aria-label":`General`,className:`flex flex-col gap-5 text-sm`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:`Theme`}),(0,q.jsx)(q_,{})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:`Version`}),(0,q.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:e.data?`v${e.data.version}`:`Connecting to backend...`})]})]})}var X_=e=>`settings-tab-${e}`,Z_=e=>`settings-panel-${e}`;function Q_({open:e,section:t,onShow:n,onClose:r,returnFocus:i}){let o=(0,K.useRef)(null),s=(0,K.useRef)(null),c=t??`general`,l=(0,K.useRef)(r);l.current=r;let u=(0,K.useRef)(i);u.current=i;let d=Ga();(0,K.useLayoutEffect)(()=>{if(e)return d&&t!==null?s.current?.focus({preventScroll:!0}):document.getElementById(X_(c))?.focus({preventScroll:!0}),()=>{let e=document.activeElement;if(e!==null&&e!==document.body&&!o.current?.contains(e))return;let t=u.current();t?.isConnected&&t.focus({preventScroll:!0})}},[e]),(0,K.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),l.current()),e.key===`Tab`&&ve(o.current,e)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let f=e=>{n(e),d&&requestAnimationFrame(()=>s.current?.focus({preventScroll:!0}))},p=()=>{n(null),requestAnimationFrame(()=>document.getElementById(X_(c))?.focus({preventScroll:!0}))},h=e=>{let t=J_.findIndex(e=>e.id===c),r=e.key===`ArrowDown`?(t+1)%J_.length:e.key===`ArrowUp`?(t-1+J_.length)%J_.length:e.key===`Home`?0:e.key===`End`?J_.length-1:null;if(r===null)return;e.preventDefault();let i=J_[r].id;n(i),document.getElementById(X_(i))?.focus()},g=J_.find(e=>e.id===c)??J_[0];return(0,q.jsxs)(`div`,{hidden:!e,className:`fixed inset-0 z-50`,children:[(0,q.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40 max-md:hidden`,onClick:()=>r()}),(0,q.jsxs)(`div`,{ref:o,role:`dialog`,"aria-modal":!0,"aria-labelledby":`settings-title`,className:a(`relative flex overflow-hidden bg-background text-foreground`,`max-md:h-full max-md:flex-col max-md:pt-[env(safe-area-inset-top)] max-md:pb-[env(safe-area-inset-bottom)]`,`md:absolute md:top-1/2 md:left-1/2 md:h-[min(40rem,calc(100dvh-4rem))] md:w-[min(52rem,calc(100vw-4rem))] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:shadow-xl`),children:[(0,q.jsxs)(`div`,{className:a(`flex min-h-0 flex-col gap-2 overflow-y-auto bg-sidebar p-3 text-sidebar-foreground md:w-56 md:shrink-0 md:border-r`,`max-md:flex-1`,t!==null&&`max-md:hidden`),children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-1`,children:[(0,q.jsx)(`h2`,{id:`settings-title`,className:`text-lg font-semibold tracking-tight md:text-base`,children:`Settings`}),(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close settings`,onClick:()=>r(),children:(0,q.jsx)(nt,{})})]}),(0,q.jsx)(`div`,{role:`tablist`,"aria-orientation":`vertical`,"aria-label":`Settings sections`,className:`flex flex-col gap-0.5`,onKeyDown:h,children:J_.map(e=>{let t=e.id===c;return(0,q.jsxs)(`button`,{id:X_(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":Z_(e.id),tabIndex:t?0:-1,onClick:()=>f(e.id),className:a(`flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,t&&`md:bg-secondary md:font-medium`),children:[e.icon,(0,q.jsx)(`span`,{children:e.label}),e.status&&(0,q.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.status}),(0,q.jsx)(F,{"aria-hidden":!0,className:a(`md:hidden`,!e.status&&`ml-auto`)})]},e.id)})})]}),(0,q.jsxs)(`div`,{className:a(`flex min-h-0 min-w-0 flex-1 flex-col`,t===null&&`max-md:hidden`),children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b px-2 py-2 md:px-6 md:py-3`,children:[(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`md:hidden`,"aria-label":`Back to settings`,onClick:p,children:(0,q.jsx)(m,{})}),(0,q.jsx)(`h3`,{ref:s,tabIndex:-1,className:`text-base font-semibold outline-none`,children:g.label}),(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":`Close settings`,title:`Close settings (Esc)`,onClick:()=>r(),children:(0,q.jsx)(nt,{})})]}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-6`,children:J_.map(e=>(0,q.jsx)(`div`,{id:Z_(e.id),role:`tabpanel`,"aria-labelledby":X_(e.id),hidden:e.id!==c,children:e.id===`general`?(0,q.jsx)(Y_,{}):e.id===`agents`?(0,q.jsx)(wi,{}):e.id===`apps`?(0,q.jsx)(m_,{}):e.id===`devices`?(0,q.jsx)(E_,{}):e.id===`notifications`?(0,q.jsx)(P_,{}):(0,q.jsx)(s_,{})},e.id))})]})]})]})}function $_(){let e=Qe();_();let[t,n]=(0,K.useState)(`all`),[r,i]=(0,K.useState)(!1),o=e=>{i(e===`review`),c(!1)},[s,c]=(0,K.useState)(!1),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(!1),f=(0,K.useRef)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(null),v=(0,K.useRef)(null),y=(0,K.useRef)(!1),b=e=>{p||(y.current=s),g(e),m(!0),c(!1)};(0,K.useEffect)(()=>{if(s?u.current?.focus():d.current&&!p&&l.current?.focus(),d.current=s,!s)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&c(!1),e.key===`Tab`&&ve(f.current,e)},t=()=>{window.innerWidth>=768&&c(!1)};return document.addEventListener(`keydown`,e),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`keydown`,e),window.removeEventListener(`resize`,t)}},[s]);let[x,S]=(0,K.useState)(`week`),[C,w]=(0,K.useState)(new Map),T=(e,t)=>w(n=>new Map(n).set(e,t)),[E,D]=(0,K.useState)(null),O=e=>{n(`all`),o(null),D({id:e})};(0,K.useEffect)(()=>Ie(O),[]);let k=t===`all`&&!r,A=e.data?.find(e=>e.id===t)??e.data?.[0];return(0,q.jsxs)(`div`,{className:`flex h-screen bg-background text-foreground`,children:[s&&(0,q.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-black/40 md:hidden`,onClick:()=>c(!1)}),(0,q.jsxs)(`aside`,{ref:f,inert:p,role:s?`dialog`:void 0,"aria-modal":s||void 0,"aria-label":s?`Menu`:void 0,className:a(`flex min-h-0 w-64 shrink-0 flex-col gap-4 overflow-y-auto border-r bg-sidebar p-3 text-sidebar-foreground`,`max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-40 max-md:shadow-lg`,!s&&`max-md:hidden`),children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`h1`,{className:`flex items-center gap-2 px-1 text-lg font-semibold tracking-tight`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground`,children:(0,q.jsx)(sr,{className:`size-4`})}),`Toodo`]}),(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close menu`,ref:u,onClick:()=>c(!1),children:(0,q.jsx)(nt,{})})]}),(0,q.jsx)(Ta,{onShow:O}),(0,q.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(G,{variant:r?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":r,onClick:()=>o(`review`),children:[(0,q.jsx)(yn,{}),`Review`]}),(0,q.jsxs)(G,{variant:k?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":k,disabled:!e.data?.length,onClick:()=>{n(`all`),o(null)},children:[(0,q.jsx)(ar,{}),`All workspaces`]})]}),(0,q.jsx)(Ge,{selectedId:r||k?null:A?.id??null,onSelect:e=>{n(e),o(null)}}),(0,q.jsxs)(G,{variant:`ghost`,className:`mt-auto shrink-0 justify-start`,"aria-haspopup":`dialog`,"aria-expanded":p,ref:v,onClick:()=>b(null),children:[(0,q.jsx)(Nr,{}),`Settings`,(0,q.jsx)(`span`,{className:`ml-auto text-xs font-normal`,children:(0,q.jsx)(Ci,{})})]})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,inert:s||p,children:[(0,q.jsxs)(`header`,{className:`flex items-center gap-2 border-b px-2 py-1.5 md:hidden`,children:[(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open menu`,ref:l,onClick:()=>c(!0),children:(0,q.jsx)(lr,{})}),(0,q.jsx)(`span`,{className:`font-semibold tracking-tight`,children:`Toodo`})]}),(0,q.jsxs)(`main`,{className:`relative flex min-w-0 flex-1 flex-col overflow-y-auto px-4 py-4 md:px-8 md:py-6`,children:[(0,q.jsx)(Ei,{}),(0,q.jsx)(Ti,{}),r?(0,q.jsx)(Zg,{onShowTask:O}):k&&e.data?.length?(0,q.jsx)(Hh,{workspace:null,timelineScale:x,onTimelineScaleChange:S,shownTask:E,onTaskShown:()=>D(null)},`all`):A?(0,q.jsx)(Hh,{workspace:A,timelineScale:x,onTimelineScaleChange:S,draft:C.get(A.id),onDraftChange:e=>T(A.id,e)},A.id):!e.isPending&&!e.isError&&(0,q.jsx)(bg,{icon:(0,q.jsx)(Yn,{}),title:`Create a workspace to start planning tasks.`,hint:`Clone a repository, open one already cloned, or make a folder a new repository, on the server or a saved herdr machine.`})]})]}),(0,q.jsx)(Q_,{open:p,section:h,onShow:b,onClose:()=>m(!1),returnFocus:()=>y.current?l.current:v.current})]})}U_();var ev=new nn,tv=Yr.createRoot(document.getElementById(`root`));function nv(e){tv.render((0,q.jsx)(K.StrictMode,{children:(0,q.jsx)(D,{client:ev,children:e})}))}R(),Wt(),Promise.all([Qa(()=>import(`./server-access-CKo4KViI.js`),__vite__mapDeps([8,1,3,4,5,6])),Qa(()=>import(`./offline-screen-CnvrTPjs.js`),__vite__mapDeps([9,1,4,5])),Qa(()=>import(`./event-BTxkSTih.js`).then(e=>e.t),__vite__mapDeps([6,1,5]))]).then(([{ServerAccess:e},{ConnectionGate:t},{onReconnect:n}])=>{n(()=>void ev.invalidateQueries()),Jt(()=>void ev.invalidateQueries()),`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.error(`Toodo: could not register the service worker`,e)}),nv((0,q.jsx)(t,{children:(0,q.jsx)(e,{children:(0,q.jsx)($_,{})})}))});export{_a as A,Xr as B,ya as C,J as D,$i as E,gi as F,sn as G,ii as H,ai as I,si as L,Di as M,Pi as N,va as O,hi as P,oi as R,ha as S,pa as T,$r as U,ri as V,Ln as W,Li as _,bg as a,Hi as b,Xm as c,Pa as d,Da as f,Ji as g,Yi as h,__ as i,ki as j,Bi as k,Au as l,ma as m,h_ as n,jh as o,Ea as p,x_ as r,bh as s,G_ as t,La as u,Vi as v,Xi as w,ga as x,Ri as y,Zr as z};
|
|
18
|
+
`)||void 0,children:[l?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`label`,{className:`flex size-4 shrink-0 items-center justify-center max-md:-mx-3.5 max-md:size-11`,children:(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":`Check criterion ${t.id} of #${e.id}`,checked:t.state===`met`||i,disabled:r.isPending,onChange:e=>m(e.target.checked)})}),t.state===`failed`&&(0,q.jsx)(zg,{state:`failed`})]}):(0,q.jsx)(zg,{state:t.state}),(0,q.jsx)(`span`,{className:a(`min-w-0`,n?`break-words-keep`:`truncate`,t.state===`failed`&&$r.danger),children:t.text}),t.kind!==`manual`&&(0,q.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-muted-foreground`,children:Og[t.kind]}),!n&&t.evidence&&(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:t.evidence})]}),n&&d&&(0,q.jsx)(`code`,{className:`ml-5.5 break-all text-muted-foreground`,children:d}),n&&(t.evidence||u)&&(0,q.jsxs)(`p`,{className:`ml-5.5 whitespace-pre-line break-words-keep text-muted-foreground`,children:[t.evidence,t.evidence&&u&&` · `,t.checkedBy!==null&&(0,q.jsxs)(q.Fragment,{children:[`Checked by `,Rg[t.checkedBy],t.checkedAt!==null&&(0,q.jsxs)(q.Fragment,{children:[` `,(0,q.jsx)(bh,{at:t.checkedAt})]})]})]}),i&&(0,q.jsxs)(`form`,{onSubmit:h,className:`ml-5.5 flex flex-wrap items-center gap-1`,onKeyDown:p.onKeyDown,children:[(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-48`),"aria-label":`Evidence for criterion ${t.id}`,placeholder:`Evidence (optional), e.g. a link or what you checked`,value:s,onChange:e=>c(e.target.value),autoFocus:!0}),p.asking?(0,q.jsx)(Aa,{label:`Discard evidence for criterion ${t.id}`,question:`Discard the evidence?`,onKeep:p.keep,onDiscard:p.discard}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{type:`submit`,size:`xs`,disabled:r.isPending,children:r.isPending?`Saving...`:`Save`}),(0,q.jsx)(G,{type:`button`,size:`xs`,variant:`ghost`,onClick:p.request,children:`Cancel`})]})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`ml-5.5 text-destructive`,children:r.error.message})]})}var Ug={taskType:`feat`,title:``,description:``,issue:``,criteria:[],mergeCriterion:!0,estimate:``,estimateUnit:`hours`,dueDate:``};function Wg({workspace:e,draft:t,onChange:n}){let r=s(),i=Ah(e),[o,c]=(0,K.useState)(!1),{taskType:l,title:u,description:d,issue:f}=t,p=sg(f),m=f.trim()!==``&&p===null,h=Tg(t),_=t.criteria.some(e=>Pg(e)!==null),v=e=>n({...t,taskType:e}),y=e=>n({...t,title:e}),b=e=>n({...t,description:e}),x=e=>n({...t,issue:e});function S(a){if(a.preventDefault(),h===void 0||_)return;let o=()=>{n({...t,title:``,description:``,issue:``,estimate:``,dueDate:``,criteria:[]}),c(!1)};r.mutate({workspaceId:e.id,taskType:l,title:u,description:d,estimate:h,dueDate:t.dueDate||null,criteria:Ng(t.criteria),mergeCriterion:i.merge&&t.mergeCriterion,issue:p},{onSuccess:o,onError:e=>e instanceof Ve&&o()})}return(0,q.jsxs)(Ka,{label:`New task`,expanded:o,onExpandedChange:c,onSubmit:S,children:[(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[o&&(0,q.jsx)(`select`,{"aria-label":`Task type`,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-28 shrink-0 font-mono`),value:l,onChange:e=>v(e.target.value),children:Ph.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))}),(0,q.jsx)(`input`,{className:a(qe,`min-w-0`),placeholder:o?`Task title`:`New task`,"aria-label":`Task title`,value:u,onChange:e=>y(e.target.value),required:!0}),(0,q.jsxs)(G,{type:`submit`,disabled:r.isPending||m||h===void 0||_,children:[(0,q.jsx)(g,{}),`Add task`]})]}),o&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,q.jsx)(eo,{label:`Description`,placeholder:`Description (optional, Markdown)`,value:d,onChange:b,className:`flex-1`}),i.github&&(0,q.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`mt-7 w-36 shrink-0 max-md:mt-13`),inputMode:`numeric`,placeholder:`Issue # (optional)`,"aria-label":`Issue number`,"aria-invalid":m,title:`An issue of the workspace repository; the pull request closes it on merge`,value:f,onChange:e=>x(e.target.value)})]}),(0,q.jsx)(Eg,{suffix:``,plan:t,onChange:e=>n({...t,...e})}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 border-t pt-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:[(0,q.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`}),i.merge&&(0,q.jsxs)(`label`,{className:`flex items-center gap-1.5 max-md:min-h-11`,title:`Add the criterion that its pull request is merged, or its branch merged locally in a repository without origin`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:t.mergeCriterion,onChange:e=>n({...t,mergeCriterion:e.target.checked})}),`Done when merged`]})]}),(0,q.jsx)(Fg,{capabilities:i,criteria:t.criteria,onChange:e=>n({...t,criteria:e})})]})]}),r.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var Gg={completed:$r.success,opened_for_review:$r.review,started:$r.progress,worked_on:$r.progress,planned:$r.neutral},Kg=a(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,Qr.neutral),qg=[{kind:`week`,label:`Week`},{kind:`month`,label:`Month`},{kind:`quarter`,label:`Quarter`},{kind:`year`,label:`Year`},{kind:`custom`,label:`Custom`}];function Jg(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}function Yg({disabled:e,children:t}){let[n,r]=(0,K.useState)(!1),i=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)},t=e=>e.key===`Escape`&&r(!1);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,q.jsxs)(`div`,{ref:i,className:`relative`,children:[(0,q.jsxs)(G,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":n,disabled:e,onClick:()=>r(!n),children:[(0,q.jsx)(Vn,{}),(0,q.jsx)(`span`,{className:`max-md:sr-only`,children:`Export`})]}),n&&(0,q.jsx)(`div`,{role:`menu`,"aria-label":`Export review`,className:`absolute right-0 z-10 mt-1 flex w-48 flex-col rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:t(()=>r(!1))})]})}function Xg({onSelect:e,children:t}){return(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e,className:`rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted max-md:min-h-11`,children:t})}function Zg({onShowTask:e}){let[t,n]=(0,K.useState)(()=>Cm(`week`,li(Date.now()/1e3))),[r,i]=(0,K.useState)(null),{start:o,end:s}=Em(t),c=le(o,s),l=Qe(),u=new Map(l.data?.map(e=>[e.id,e.name])),d=pm[t.kind];function f(e){i(null),n(e)}function p(e){e!==t.kind&&f(e===`custom`?{...t,kind:e}:Cm(e,t.from))}async function h(e){try{await navigator.clipboard.writeText(eh(t,e,l.data??[],Date.now()/1e3)),i(`Copied as Markdown.`)}catch(e){i(`Could not copy: ${String(e)}`)}}function g(e,n){let r=l.data??[],a=e===`csv`?ih(n,r,Date.now()/1e3):eh(t,n,r,Date.now()/1e3),o=sh(t,e);Jg(o,a,e===`csv`?`text/csv`:`text/markdown`),i(`Downloaded ${o}`)}return(0,q.jsxs)(`section`,{"aria-labelledby":`review-heading`,className:`flex flex-col gap-4`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h2`,{id:`review-heading`,className:`text-xl font-semibold tracking-tight`,children:mm[t.kind]}),(0,q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Work recorded from `,t.from,` to `,t.to,` across all workspaces.`]})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`div`,{role:`group`,"aria-label":`Review period`,className:`flex rounded-md border p-0.5 max-md:w-full`,children:qg.map(({kind:e,label:n})=>(0,q.jsx)(G,{size:`sm`,variant:t.kind===e?`default`:`ghost`,"aria-pressed":t.kind===e,onClick:()=>p(e),children:n},e))}),t.kind===`week`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`label`,{htmlFor:`week-start`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`Week starting`}),(0,q.jsx)(`input`,{id:`week-start`,type:`date`,required:!0,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40 max-md:w-0 max-md:min-w-0 max-md:flex-1`),value:t.from,onChange:e=>e.target.value&&f(bm(e.target.value))})]}),t.kind===`custom`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`label`,{htmlFor:`review-from`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`From`}),(0,q.jsx)(`input`,{id:`review-from`,type:`date`,required:!0,max:t.to,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.from,onChange:e=>e.target.value&&e.target.value<=t.to&&f({...t,from:e.target.value})}),(0,q.jsx)(`label`,{htmlFor:`review-to`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`To`}),(0,q.jsx)(`input`,{id:`review-to`,type:`date`,required:!0,min:t.from,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.to,onChange:e=>e.target.value&&e.target.value>=t.from&&f({...t,to:e.target.value})})]}),t.kind!==`week`&&t.kind!==`custom`&&(0,q.jsx)(`span`,{className:`px-1 text-sm font-medium`,children:Dm(t)}),(0,q.jsx)(G,{size:`icon-sm`,variant:`outline`,"aria-label":`Previous ${d}`,title:`Previous ${d}`,onClick:()=>f(wm(t,-1)),children:(0,q.jsx)(m,{})}),(0,q.jsx)(G,{size:`icon-sm`,variant:`outline`,"aria-label":`Next ${d}`,title:`Next ${d}`,onClick:()=>f(wm(t,1)),children:(0,q.jsx)(F,{})}),t.kind!==`custom`&&(0,q.jsxs)(G,{size:`sm`,variant:`ghost`,onClick:()=>f(Cm(t.kind,li(Date.now()/1e3))),children:[(0,q.jsx)(_n,{className:`md:hidden`,"aria-hidden":!0}),(0,q.jsxs)(`span`,{className:`max-md:sr-only`,children:[`This `,d]})]}),(0,q.jsx)(`div`,{className:`ml-auto`,children:(0,q.jsx)(Yg,{disabled:!c.data,children:e=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Xg,{onSelect:()=>{e(),c.data&&h(c.data)},children:`Copy as Markdown`}),(0,q.jsx)(Xg,{onSelect:()=>{e(),c.data&&g(`md`,c.data)},children:`Save as Markdown`}),(0,q.jsx)(Xg,{onSelect:()=>{e(),c.data&&g(`csv`,c.data)},children:`Save as CSV`})]})})})]}),r&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:r}),c.isPending&&(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading the review...`}),c.isError&&(0,q.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load the review: `,c.error.message]}),c.data?.length===0&&(0,q.jsx)(bg,{title:`No recorded activity in this ${d}.`,hint:`Pick another period to look at earlier work.`,action:(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>f(wm(t,-1)),children:[`Show the `,d,` before`]})}),c.data&&c.data.length>0&&(0,q.jsx)(t_,{period:t,entries:c.data,workspaces:l.data??[]}),c.data&&(0,q.jsx)(e_,{period:t,entries:c.data}),t.kind===`year`&&c.data&&(0,q.jsx)($g,{entries:c.data}),c.data&&Om(c.data).map(t=>(0,q.jsxs)(`section`,{"aria-label":dm[t.outcome],className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`h3`,{className:a(`text-sm font-semibold`,Gg[t.outcome]),children:[dm[t.outcome],` `,(0,q.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.entries.length,`)`]})]}),(0,q.jsx)(`ul`,{className:`flex flex-col divide-y rounded-lg border`,children:t.entries.map(({task:t,at:n,commits:r})=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 px-3 py-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Ea,{type:t.taskType}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`#`,t.id]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Open #${t.id} ${t.title}`,title:t.title,onClick:()=>e?.(t.id),className:`min-w-0 flex-1 truncate text-left text-sm font-medium hover:underline max-md:min-h-11`,children:t.title}),t.resolution===`not_adopted`&&(0,q.jsx)(`span`,{className:Kg,children:`Not adopted`}),t.resolution===`completed`&&(0,q.jsx)(`span`,{className:a(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,Qr.success),children:`Completed`}),t.pullRequestUrl&&(0,q.jsx)(Qg,{url:t.pullRequestUrl,stats:t.pullRequest}),(0,q.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground max-md:hidden`,children:[u.get(t.workspaceId)??`Workspace ${t.workspaceId}`,` · `,(0,q.jsx)(bh,{at:n})]})]}),t.completionNote&&(0,q.jsx)(`p`,{"aria-label":`Completion note of #${t.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:t.completionNote}),r.length>0&&(0,q.jsx)(`ul`,{"aria-label":`Commits of #${t.id} this ${d}`,className:`flex flex-col gap-0.5`,children:r.map(e=>(0,q.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,q.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,q.jsx)(`span`,{className:`truncate`,children:km(e.message)})]},e.sha))})]},t.id))})]},t.outcome))]})}function Qg({url:e,stats:t}){let n=jm(e),r=t=>{t.preventDefault(),jh(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,q.jsx)(`a`,{href:e,title:t?`${e} \u00b7 ${Mm(t)}`:e,"aria-label":n?`Pull request #${n}`:`Pull request`,onClick:r,onAuxClick:r,className:`shrink-0 text-xs text-primary underline underline-offset-2 hover:no-underline max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:n?`#${n}`:`PR`})}function $g({entries:e}){let t=Gm(e);return t===null?null:(0,q.jsxs)(`section`,{"aria-labelledby":`year-in-review-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsx)(`h3`,{id:`year-in-review-heading`,className:`text-sm font-semibold`,children:`Year in review`}),t.pullRequests&&(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Merged pull requests`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.pullRequests})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Lines changed`}),(0,q.jsxs)(`dd`,{className:`text-lg font-semibold`,children:[(0,q.jsxs)(`span`,{children:[`+`,t.pullRequests.additions]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,q.jsxs)(`span`,{children:[`-`,t.pullRequests.deletions]})]})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Files changed`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.changedFiles})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Reviews`}),(0,q.jsxs)(`dd`,{className:`text-lg font-semibold`,title:Km(t.pullRequests),children:[t.pullRequests.reviews,(0,q.jsxs)(`span`,{className:`ml-1 text-xs font-normal text-muted-foreground`,children:[`on `,t.pullRequests.reviewed,` of `,t.pullRequests.pullRequests]})]})]})]}),t.largest.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest pull requests`}),(0,q.jsx)(`ol`,{"aria-label":`Largest pull requests`,className:`flex flex-col gap-1`,children:t.largest.map(({task:e,pullRequest:t})=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(Ea,{type:e.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:Mm(t)})]},e.id))})]}),t.research.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Research conclusions`}),(0,q.jsx)(`ul`,{"aria-label":`Research conclusions`,className:`flex flex-col divide-y rounded-md border`,children:t.research.map(({task:e,at:t,adopted:n})=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsx)(`span`,{className:a(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,n?Qr.success:Qr.neutral),children:n?`Adopted`:`Not adopted`}),(0,q.jsx)(bh,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,at:t})]}),(0,q.jsx)(`p`,{"aria-label":`Research conclusion of #${e.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:e.completionNote??(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`No conclusion written.`})})]},e.id))})]}),t.overruns.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest estimate overruns`}),(0,q.jsx)(`ol`,{"aria-label":`Largest estimate overruns`,className:`flex flex-col gap-1`,children:t.overruns.map(({task:e,estimated:t,actual:n})=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsx)(Ea,{type:e.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,q.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[`estimated `,Xm(t),`, `,Xm(n),` active`]})]},e.id))})]})]})}function e_({period:e,entries:t}){let n=zm(e,t,Date.now()/1e3);return n===null?null:(0,q.jsxs)(`section`,{"aria-labelledby":`plan-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsx)(`h3`,{id:`plan-heading`,className:`text-sm font-semibold`,children:`Plan vs actual`}),(0,q.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Estimate vs active time`}),(0,q.jsx)(`dd`,{children:n.time?Bm(n.time):`No completed task had an estimate`})]}),(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Due dates met`}),(0,q.jsx)(`dd`,{children:n.dueDates?Vm(n.dueDates):`No completed task had a due date`})]})]}),n.late.length>0&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Late tasks`}),(0,q.jsx)(`ul`,{"aria-label":`Late tasks`,className:`flex flex-col gap-1`,children:n.late.map(e=>(0,q.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[(0,q.jsx)(Ea,{type:e.task.taskType}),(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.task.title})]}),(0,q.jsx)(`span`,{className:a(`ml-auto shrink-0 text-xs`,$r.danger),children:Hm(e)})]},e.task.id))})]})]})}function t_({period:e,entries:t,workspaces:n}){let r=Rm(e,t,n),i=Math.max(1,...(r.completedPerMonth??[]).map(({count:e})=>e));return(0,q.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,q.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[r.outcomes.map(({outcome:e,count:t})=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:dm[e]}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:t})]},e)),r.notAdopted>0&&(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Not adopted`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.notAdopted})]}),(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Commits`}),(0,q.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.commits})]})]}),(0,q.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[Qm.map(e=>{let t=r[e];return(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:$m[e]}),(0,q.jsx)(`dd`,{children:t===null?`No data`:`${Xm(t.median)} (${t.tasks} ${t.tasks===1?`task`:`tasks`})`})]},e)}),r.changes&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Changes in completed pull requests`}),(0,q.jsx)(`dd`,{children:Jm(r.changes)})]}),r.completedByType.length>0&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by type`}),(0,q.jsx)(`dd`,{children:r.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)})]}),r.completedByWorkspace.length>0&&(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by workspace`}),(0,q.jsx)(`dd`,{children:r.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)})]})]}),r.completedPerMonth&&(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Completed per month`}),(0,q.jsx)(`ul`,{"aria-label":`Completed per month`,className:`flex flex-col gap-0.5`,children:r.completedPerMonth.map(({month:e,count:t})=>(0,q.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`w-16 shrink-0 font-mono text-muted-foreground`,children:e}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:a(`h-2 rounded-sm`,ri.success),style:{width:`${t/i*60}%`,minWidth:t>0?4:0}}),(0,q.jsx)(`span`,{children:t})]},e))})]})]})}var n_=`h-7 w-16 rounded-md border bg-background px-2 text-sm`;function r_(e){return e.split(/[\\/]/).pop()??e}function i_(e){return e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var a_={automatic:`Automatic`,preRestore:`Before restore`};function o_(e){return e.kind===`upload`?e.file.name:r_(e.path)}function s_(){let e=me(),t=M(),n=A(),r=H(),i=_e(),a=(0,K.useRef)(null),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),u=t.isPending,d=r.isPending||i.isPending;function f(){l(null),t.mutate(void 0,{onSuccess:e=>l(`Downloaded ${e}`)})}function p(){l(null),a.current?.click()}function m(e){l(null);let t={onSuccess:t=>{s(null),l(`Restored ${o_(e)}. The previous data was saved as ${r_(t.path)}.`)}};e.kind===`upload`?i.mutate(e.file,t):r.mutate(r_(e.path),t)}let h=t.error??n.error??r.error??i.error??e.error;return(0,q.jsxs)(`section`,{"aria-label":`Backups`,className:`flex flex-col gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:f,disabled:u,children:u?`Exporting...`:`Export...`}),(0,q.jsx)(G,{size:`sm`,variant:`outline`,onClick:p,disabled:d,children:`Restore...`}),(0,q.jsx)(`input`,{ref:a,type:`file`,accept:`.sqlite3,.db`,"aria-label":`Database file to restore`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s({kind:`upload`,file:t})}})]}),o&&(0,q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm restore`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,q.jsxs)(`p`,{className:`text-xs break-words`,children:[`Replace all workspaces and tasks with `,(0,q.jsx)(`span`,{className:`font-medium`,children:o_(o)}),`? The current data is backed up first.`]}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{size:`xs`,variant:`destructive`,onClick:()=>m(o),disabled:d,children:d?`Restoring...`:`Replace data`}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,onClick:()=>s(null),disabled:d,children:`Cancel`})]})]}),c&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs break-words text-muted-foreground`,children:c}),h&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs break-words text-destructive`,children:h.message}),(0,q.jsx)(c_,{}),(0,q.jsxs)(`ul`,{"aria-label":`Saved backups`,className:`flex flex-col divide-y`,children:[e.data?.length===0&&(0,q.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No backups yet.`}),e.data?.map(e=>(0,q.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5 text-xs first:pt-0`,title:e.path,children:[(0,q.jsxs)(`span`,{className:`flex flex-col`,children:[(0,q.jsx)(`time`,{className:`font-medium`,dateTime:new Date(e.createdAt*1e3).toISOString(),children:pi(e.createdAt)}),(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,q.jsx)(bh,{at:e.createdAt}),` · `,a_[e.kind],` · `,i_(e.sizeBytes)]})]}),(0,q.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`outline`,"aria-label":`Download backup from ${pi(e.createdAt)}`,disabled:n.isPending,onClick:()=>{l(null),n.mutate(r_(e.path),{onSuccess:e=>l(`Downloaded ${e}`)})},children:`Download`}),(0,q.jsx)(G,{size:`xs`,variant:`outline`,"aria-label":`Restore this backup from ${pi(e.createdAt)}`,onClick:()=>{l(null),s({kind:`backup`,path:e.path})},children:`Restore this backup`})]})]},e.path))]})]})}function c_(){let e=at();if(!e.data)return null;let{enabled:t,intervalHours:n,keep:r}=e.data;return(0,q.jsx)(l_,{initial:e.data},`${t}-${n}-${r}`)}function l_({initial:e}){let t=L(),[n,r]=(0,K.useState)(e.enabled),[i,a]=(0,K.useState)(String(e.intervalHours)),[o,s]=(0,K.useState)(String(e.keep));function c(e){e.preventDefault(),t.mutate({enabled:n,intervalHours:Number(i),keep:Number(o)})}return(0,q.jsxs)(`form`,{onSubmit:c,"aria-label":`Automatic backups`,className:`flex flex-col gap-1 text-xs`,children:[(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),`Back up automatically`]}),(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Every`,(0,q.jsx)(`input`,{className:n_,type:`number`,min:1,max:720,"aria-label":`Hours between backups`,value:i,onChange:e=>a(e.target.value),disabled:!n,required:!0}),`hours`]}),(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Keep`,(0,q.jsx)(`input`,{className:n_,type:`number`,min:1,max:100,"aria-label":`Backups to keep`,value:o,onChange:e=>s(e.target.value),disabled:!n,required:!0}),`latest`]}),t.isError&&(0,q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:t.error.message}),(0,q.jsx)(G,{type:`submit`,size:`xs`,variant:`outline`,className:`self-start`,disabled:t.isPending,children:t.isPending?`Saving...`:`Save schedule`})]})}var u_=[`connected-apps`];function d_(e){return e.split(` `).includes(`toodo.write`)?`Read and write access`:`Read access`}function f_({url:e}){let[t,n]=(0,K.useState)(null);async function r(e){try{await navigator.clipboard.writeText(e),n(`Copied the MCP URL.`)}catch(e){n(`Could not copy (${String(e)}). Select the URL and copy it by hand.`)}}return e===null?(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`To connect ChatGPT or Claude, restart the server with `,(0,q.jsx)(`code`,{children:`TOODO_PUBLIC_URL`}),` set to the`,` `,(0,q.jsx)(`code`,{children:`https://`}),` origin they reach it at; see `,(0,q.jsx)(`code`,{children:`docs/server.md`}),`.`]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Add this URL to ChatGPT or Claude as a remote MCP connector with OAuth, leaving client ID and secret empty, then approve the app with `,(0,q.jsx)(`code`,{children:`web-token`}),`.`]}),(0,q.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`Public MCP URL`,children:e}),(0,q.jsx)(G,{size:`xs`,className:`self-start`,onClick:()=>void r(e),children:`Copy MCP URL`}),t&&(0,q.jsx)(`p`,{role:`status`,children:t})]})}function p_({app:e}){let t=We(),[n,r]=(0,K.useState)(!1),i=Me({mutationFn:()=>Te(f.revokeConnectedApp(e.grantId)),onSuccess:()=>t.invalidateQueries({queryKey:u_})}),a=e.clientName??e.clientId;return(0,q.jsxs)(`li`,{"aria-label":`App ${a}`,className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:d_(e.scopes)}),(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,q.jsx)(bh,{at:e.createdAt,prefix:`Connected `}),` · `,e.lastUsedAt===null?`Not used yet`:(0,q.jsx)(bh,{at:e.lastUsedAt,prefix:`Last used `})]}),n?(0,q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${a}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:ze(()=>r(!1),i.isPending),children:[(0,q.jsx)(`p`,{children:`The app's tokens stop working at once; to use it later, connect it again from the app.`}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,q.jsx)(G,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${a}`,onClick:()=>r(!0),children:`Revoke`}),i.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function m_(){let e=c({queryKey:u_,queryFn:()=>Te(f.listConnectedApps())});return(0,q.jsxs)(`section`,{"aria-label":`Connected apps`,className:`flex flex-col gap-2 text-sm`,children:[e.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(f_,{url:e.data.publicMcpUrl}),e.data.apps.length===0?(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`No apps connected yet.`}):(0,q.jsx)(`ul`,{"aria-label":`Apps with access`,className:`flex flex-col gap-2`,children:e.data.apps.map(e=>(0,q.jsx)(p_,{app:e},e.grantId))})]})]})}var h_=class extends Error{constructor(){super(`The server did not accept this token.`)}};async function g_(e){if(e.status===401)throw new h_;if(!e.ok)throw Error(await Yt(e));return e}async function __(e,t){return(await(await g_(await Gt.fetch(`/api/devices`,{headers:Zt(e)}))).json()).some(e=>e.current)?e:(await(await g_(await Gt.fetch(`/api/devices`,{method:`POST`,headers:{...Zt(e),"Content-Type":`application/json`},body:JSON.stringify({label:t})}))).json()).token}async function v_(){return await(await Qt(`/api/devices`)).json()}async function y_(e){return(await(await Qt(`/api/devices`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({label:e})})).json()).token}async function b_(e){return await(await Qt(`/api/devices/${e}/revoke`,{method:`POST`})).json()}function x_(e){let t=[[`Edg/`,`Edge`],[`Firefox/`,`Firefox`],[`Chrome/`,`Chrome`],[`Safari/`,`Safari`]].find(([t])=>e.includes(t))?.[1]??`Browser`,n=[[`Android`,`Android`],[`iPhone`,`iOS`],[`iPad`,`iPadOS`],[`Windows`,`Windows`],[`Mac OS`,`macOS`],[`Linux`,`Linux`]].find(([t])=>e.includes(t))?.[1];return n?`${t} on ${n}`:t}var S_=[`devices`];function C_({devices:e}){let t=We(),n=Me({mutationFn:()=>y_(x_(navigator.userAgent)),onSuccess:e=>(Xt(e),t.invalidateQueries({queryKey:S_}))}),r=e.find(e=>e.current);return(0,q.jsxs)(`div`,{role:`group`,"aria-label":`This browser`,className:`flex flex-col gap-1 rounded-md bg-muted px-2 py-1.5`,children:[(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`This browser: `}),(0,q.jsx)(`span`,{className:`font-medium break-words`,children:r?r.label:`shared token`})]}),!r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Register it to give it a token of its own that you can revoke alone.`}),(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`outline`,className:`self-start`,disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?`Registering...`:`Register this browser`})]}),n.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:n.error.message})]})}function w_({device:e}){let t=We(),[n,r]=(0,K.useState)(!1),i=Me({mutationFn:()=>b_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:S_})}),a=e.revokedAt!==null;return(0,q.jsxs)(`li`,{"aria-label":`Device ${e.label}`,"data-revoked":a,className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{className:a?`truncate text-muted-foreground line-through`:`truncate font-medium`,children:e.label}),e.current&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`(this device)`})]}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.revokedAt===null?(0,q.jsx)(bh,{at:e.lastSeenAt,prefix:`Last seen `}):(0,q.jsx)(bh,{at:e.revokedAt,prefix:`Revoked `})}),!a&&(n?(0,q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${e.label}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:ze(()=>r(!1),i.isPending),children:[(0,q.jsx)(`p`,{children:e.current?`This browser signs out and needs the shared token to sign in again.`:`The device's token stops working for good.`}),(0,q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,q.jsx)(G,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,q.jsx)(G,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${e.label}`,onClick:()=>r(!0),children:`Revoke`})),i.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function T_(){let e=c({queryKey:S_,queryFn:v_});return e.data?(0,q.jsxs)(q.Fragment,{children:[e.data.filter(e=>e.revokedAt===null).length,` signed in`]}):null}function E_(){let e=c({queryKey:S_,queryFn:v_});return(0,q.jsxs)(`section`,{"aria-label":`Devices`,className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Each browser signs in with the shared token once and then keeps its own token. Revoke a lost device here.`}),e.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,q.jsx)(C_,{devices:e.data}),e.data&&(0,q.jsx)(`ul`,{"aria-label":`Signed-in devices`,className:`flex flex-col gap-2`,children:e.data.map(e=>(0,q.jsx)(w_,{device:e},e.id))})]})}var D_=[`push`],O_=[{key:`agent`,label:`Agent finished or needs input`},{key:`pullRequests`,label:`Pull request checks and reviews`},{key:`completion`,label:`Task awaiting completion`}],k_={"needs-install":`Add Toodo to the Home Screen to get notifications (iOS 16.4 or later).`,unsupported:`This browser cannot get notifications from Toodo.`};function A_({subscription:e,permission:t}){return e?`on`:t===`denied`?`blocked`:`off`}function j_({state:e}){let t=We(),n=e=>t.setQueryData(D_,t=>t&&{...t,subscription:e}),r=()=>t.invalidateQueries({queryKey:D_}),i=Me({mutationFn:t=>Se(t,e.publicKey),onSuccess:n,onError:r}),a=Me({mutationFn:ye,onSuccess:()=>n(null),onError:r}),o=Me({mutationFn:we,onSuccess:n}),s=Me({mutationFn:de}),c=[i,a,o,s].reduce((e,t)=>t.submittedAt>e.submittedAt?t:e),l=()=>i.mutate(Notification.requestPermission()),{subscription:u}=e,d=(o.isPending?o.variables:void 0)??u?.settings;return(0,q.jsxs)(q.Fragment,{children:[u&&d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`font-medium`,children:`Notifications are on for this device.`}),(0,q.jsxs)(`fieldset`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`legend`,{className:`mb-1 text-muted-foreground`,children:`Notify about`}),O_.map(({key:e,label:t})=>(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:d[e],disabled:o.isPending,onChange:t=>o.mutate({...d,[e]:t.target.checked})}),t]},e))]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`outline`,disabled:s.isPending,onClick:()=>s.mutate(),children:`Send test notification`}),(0,q.jsx)(G,{changesData:!0,size:`xs`,variant:`ghost`,"aria-label":`Disable notifications on this device`,disabled:a.isPending,onClick:()=>a.mutate(),children:`Disable notifications`})]})]}):e.permission===`denied`?(0,q.jsx)(`p`,{children:`Notifications are blocked for Toodo in the browser settings. Allow them there to turn them on.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`font-medium`,children:`Notifications are off for this device.`}),(0,q.jsx)(G,{size:`xs`,className:`self-start`,"aria-label":`Enable notifications on this device`,disabled:i.isPending,onClick:l,children:`Enable notifications`})]}),c===s&&s.isSuccess&&(0,q.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:`Test notification sent.`}),c.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.error.message})]})}function M_(){let[e]=(0,K.useState)(Ee);return{support:e,state:c({queryKey:D_,queryFn:He,enabled:e===`supported`})}}function N_(){let{state:e}=M_();return e.data?(0,q.jsx)(q.Fragment,{children:A_(e.data)}):null}function P_(){let{support:e,state:t}=M_();return(0,q.jsxs)(`section`,{"aria-label":`Notifications`,className:`flex flex-col gap-2 text-sm`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:e===`supported`?`Alerts reach this device even while Toodo is closed.`:k_[e]}),t.isLoading&&(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Checking this device...`}),t.error&&(0,q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:t.error.message}),t.data&&(0,q.jsx)(j_,{state:t.data})]})}var F_=[`light`,`dark`,`system`],I_=`toodo-theme`,L_=`(prefers-color-scheme: dark)`,R_=new Set;function z_(e){return F_.includes(e)}function B_(){let e=localStorage.getItem(I_);return z_(e)?e:`system`}function V_(){let e=B_(),t=e===`dark`||e===`system`&&window.matchMedia(L_).matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`}function H_(e){localStorage.setItem(I_,e),V_(),R_.forEach(e=>e())}function U_(){V_(),window.matchMedia(L_).addEventListener(`change`,V_)}function W_(e){return R_.add(e),()=>R_.delete(e)}function G_(){return(0,K.useSyncExternalStore)(W_,B_)}var K_=[{value:`light`,label:`Light theme`,Icon:Ur},{value:`dark`,label:`Dark theme`,Icon:hr},{value:`system`,label:`System theme`,Icon:pr}];function q_(){let e=G_();return(0,q.jsx)(`div`,{role:`group`,"aria-label":`Theme`,className:`flex gap-0.5 rounded-lg border p-0.5`,children:K_.map(({value:t,label:n,Icon:r})=>(0,q.jsx)(G,{variant:e===t?`default`:`ghost`,size:`icon-sm`,"aria-label":n,"aria-pressed":e===t,title:n,onClick:()=>H_(t),children:(0,q.jsx)(r,{})},t))})}var J_=[{id:`general`,label:`General`,icon:(0,q.jsx)(Lr,{})},{id:`agents`,label:`Agent access`,icon:(0,q.jsx)(hn,{}),status:(0,q.jsx)(Ci,{})},{id:`apps`,label:`Connected apps`,icon:(0,q.jsx)(Tr,{})},{id:`devices`,label:`Devices`,icon:(0,q.jsx)(dr,{}),status:(0,q.jsx)(T_,{})},{id:`notifications`,label:`Notifications`,icon:(0,q.jsx)(pn,{}),status:(0,q.jsx)(N_,{})},{id:`backups`,label:`Backups`,icon:(0,q.jsx)(zn,{})}];function Y_(){let e=c({queryKey:[`app-info`],queryFn:()=>f.appInfo()});return(0,q.jsxs)(`section`,{"aria-label":`General`,className:`flex flex-col gap-5 text-sm`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:`Theme`}),(0,q.jsx)(q_,{})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:`Version`}),(0,q.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:e.data?`v${e.data.version}`:`Connecting to backend...`})]})]})}var X_=e=>`settings-tab-${e}`,Z_=e=>`settings-panel-${e}`;function Q_({open:e,section:t,onShow:n,onClose:r,returnFocus:i}){let o=(0,K.useRef)(null),s=(0,K.useRef)(null),c=t??`general`,l=(0,K.useRef)(r);l.current=r;let u=(0,K.useRef)(i);u.current=i;let d=Ga();(0,K.useLayoutEffect)(()=>{if(e)return d&&t!==null?s.current?.focus({preventScroll:!0}):document.getElementById(X_(c))?.focus({preventScroll:!0}),()=>{let e=document.activeElement;if(e!==null&&e!==document.body&&!o.current?.contains(e))return;let t=u.current();t?.isConnected&&t.focus({preventScroll:!0})}},[e]),(0,K.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),l.current()),e.key===`Tab`&&ve(o.current,e)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let f=e=>{n(e),d&&requestAnimationFrame(()=>s.current?.focus({preventScroll:!0}))},p=()=>{n(null),requestAnimationFrame(()=>document.getElementById(X_(c))?.focus({preventScroll:!0}))},h=e=>{let t=J_.findIndex(e=>e.id===c),r=e.key===`ArrowDown`?(t+1)%J_.length:e.key===`ArrowUp`?(t-1+J_.length)%J_.length:e.key===`Home`?0:e.key===`End`?J_.length-1:null;if(r===null)return;e.preventDefault();let i=J_[r].id;n(i),document.getElementById(X_(i))?.focus()},g=J_.find(e=>e.id===c)??J_[0];return(0,q.jsxs)(`div`,{hidden:!e,className:`fixed inset-0 z-50`,children:[(0,q.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40 max-md:hidden`,onClick:()=>r()}),(0,q.jsxs)(`div`,{ref:o,role:`dialog`,"aria-modal":!0,"aria-labelledby":`settings-title`,className:a(`relative flex overflow-hidden bg-background text-foreground`,`max-md:h-full max-md:flex-col max-md:pt-[env(safe-area-inset-top)] max-md:pb-[env(safe-area-inset-bottom)]`,`md:absolute md:top-1/2 md:left-1/2 md:h-[min(40rem,calc(100dvh-4rem))] md:w-[min(52rem,calc(100vw-4rem))] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:shadow-xl`),children:[(0,q.jsxs)(`div`,{className:a(`flex min-h-0 flex-col gap-2 overflow-y-auto bg-sidebar p-3 text-sidebar-foreground md:w-56 md:shrink-0 md:border-r`,`max-md:flex-1`,t!==null&&`max-md:hidden`),children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-1`,children:[(0,q.jsx)(`h2`,{id:`settings-title`,className:`text-lg font-semibold tracking-tight md:text-base`,children:`Settings`}),(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close settings`,onClick:()=>r(),children:(0,q.jsx)(nt,{})})]}),(0,q.jsx)(`div`,{role:`tablist`,"aria-orientation":`vertical`,"aria-label":`Settings sections`,className:`flex flex-col gap-0.5`,onKeyDown:h,children:J_.map(e=>{let t=e.id===c;return(0,q.jsxs)(`button`,{id:X_(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":Z_(e.id),tabIndex:t?0:-1,onClick:()=>f(e.id),className:a(`flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,t&&`md:bg-secondary md:font-medium`),children:[e.icon,(0,q.jsx)(`span`,{children:e.label}),e.status&&(0,q.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.status}),(0,q.jsx)(F,{"aria-hidden":!0,className:a(`md:hidden`,!e.status&&`ml-auto`)})]},e.id)})})]}),(0,q.jsxs)(`div`,{className:a(`flex min-h-0 min-w-0 flex-1 flex-col`,t===null&&`max-md:hidden`),children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b px-2 py-2 md:px-6 md:py-3`,children:[(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`md:hidden`,"aria-label":`Back to settings`,onClick:p,children:(0,q.jsx)(m,{})}),(0,q.jsx)(`h3`,{ref:s,tabIndex:-1,className:`text-base font-semibold outline-none`,children:g.label}),(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":`Close settings`,title:`Close settings (Esc)`,onClick:()=>r(),children:(0,q.jsx)(nt,{})})]}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-6`,children:J_.map(e=>(0,q.jsx)(`div`,{id:Z_(e.id),role:`tabpanel`,"aria-labelledby":X_(e.id),hidden:e.id!==c,children:e.id===`general`?(0,q.jsx)(Y_,{}):e.id===`agents`?(0,q.jsx)(wi,{}):e.id===`apps`?(0,q.jsx)(m_,{}):e.id===`devices`?(0,q.jsx)(E_,{}):e.id===`notifications`?(0,q.jsx)(P_,{}):(0,q.jsx)(s_,{})},e.id))})]})]})]})}function $_(){let e=Qe();_();let[t,n]=(0,K.useState)(`all`),[r,i]=(0,K.useState)(!1),o=e=>{i(e===`review`),c(!1)},[s,c]=(0,K.useState)(!1),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(!1),f=(0,K.useRef)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(null),v=(0,K.useRef)(null),y=(0,K.useRef)(!1),b=e=>{p||(y.current=s),g(e),m(!0),c(!1)};(0,K.useEffect)(()=>{if(s?u.current?.focus():d.current&&!p&&l.current?.focus(),d.current=s,!s)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&c(!1),e.key===`Tab`&&ve(f.current,e)},t=()=>{window.innerWidth>=768&&c(!1)};return document.addEventListener(`keydown`,e),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`keydown`,e),window.removeEventListener(`resize`,t)}},[s]);let[x,S]=(0,K.useState)(`week`),[C,w]=(0,K.useState)(new Map),T=(e,t)=>w(n=>new Map(n).set(e,t)),[E,D]=(0,K.useState)(null),O=e=>{n(`all`),o(null),D({id:e})};(0,K.useEffect)(()=>Ie(O),[]);let k=t===`all`&&!r,A=e.data?.find(e=>e.id===t)??e.data?.[0];return(0,q.jsxs)(`div`,{className:`flex h-screen bg-background text-foreground`,children:[s&&(0,q.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-black/40 md:hidden`,onClick:()=>c(!1)}),(0,q.jsxs)(`aside`,{ref:f,inert:p,role:s?`dialog`:void 0,"aria-modal":s||void 0,"aria-label":s?`Menu`:void 0,className:a(`flex min-h-0 w-64 shrink-0 flex-col gap-4 overflow-y-auto border-r bg-sidebar p-3 text-sidebar-foreground`,`max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-40 max-md:shadow-lg`,!s&&`max-md:hidden`),children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`h1`,{className:`flex items-center gap-2 px-1 text-lg font-semibold tracking-tight`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground`,children:(0,q.jsx)(sr,{className:`size-4`})}),`Toodo`]}),(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close menu`,ref:u,onClick:()=>c(!1),children:(0,q.jsx)(nt,{})})]}),(0,q.jsx)(Ta,{onShow:O}),(0,q.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsxs)(G,{variant:r?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":r,onClick:()=>o(`review`),children:[(0,q.jsx)(yn,{}),`Review`]}),(0,q.jsxs)(G,{variant:k?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":k,disabled:!e.data?.length,onClick:()=>{n(`all`),o(null)},children:[(0,q.jsx)(ar,{}),`All workspaces`]})]}),(0,q.jsx)(Ge,{selectedId:r||k?null:A?.id??null,onSelect:e=>{n(e),o(null)}}),(0,q.jsxs)(G,{variant:`ghost`,className:`mt-auto shrink-0 justify-start`,"aria-haspopup":`dialog`,"aria-expanded":p,ref:v,onClick:()=>b(null),children:[(0,q.jsx)(Nr,{}),`Settings`,(0,q.jsx)(`span`,{className:`ml-auto text-xs font-normal`,children:(0,q.jsx)(Ci,{})})]})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,inert:s||p,children:[(0,q.jsxs)(`header`,{className:`flex items-center gap-2 border-b px-2 py-1.5 md:hidden`,children:[(0,q.jsx)(G,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open menu`,ref:l,onClick:()=>c(!0),children:(0,q.jsx)(lr,{})}),(0,q.jsx)(`span`,{className:`font-semibold tracking-tight`,children:`Toodo`})]}),(0,q.jsxs)(`main`,{className:`relative flex min-w-0 flex-1 flex-col overflow-y-auto px-4 py-4 md:px-8 md:py-6`,children:[(0,q.jsx)(Ei,{}),(0,q.jsx)(Ti,{}),r?(0,q.jsx)(Zg,{onShowTask:O}):k&&e.data?.length?(0,q.jsx)(Hh,{workspace:null,timelineScale:x,onTimelineScaleChange:S,shownTask:E,onTaskShown:()=>D(null)},`all`):A?(0,q.jsx)(Hh,{workspace:A,timelineScale:x,onTimelineScaleChange:S,draft:C.get(A.id),onDraftChange:e=>T(A.id,e)},A.id):!e.isPending&&!e.isError&&(0,q.jsx)(bg,{icon:(0,q.jsx)(Yn,{}),title:`Create a workspace to start planning tasks.`,hint:`Clone a repository, open one already cloned, or make a folder a new repository, on the server or a saved herdr machine.`})]})]}),(0,q.jsx)(Q_,{open:p,section:h,onShow:b,onClose:()=>m(!1),returnFocus:()=>y.current?l.current:v.current})]})}U_();var ev=new nn,tv=Yr.createRoot(document.getElementById(`root`));function nv(e){tv.render((0,q.jsx)(K.StrictMode,{children:(0,q.jsx)(D,{client:ev,children:e})}))}R(),Wt(),Promise.all([Qa(()=>import(`./server-access-DKlT6LdN.js`),__vite__mapDeps([8,1,3,4,5,6])),Qa(()=>import(`./offline-screen-CnvrTPjs.js`),__vite__mapDeps([9,1,4,5])),Qa(()=>import(`./event-BTxkSTih.js`).then(e=>e.t),__vite__mapDeps([6,1,5]))]).then(([{ServerAccess:e},{ConnectionGate:t},{onReconnect:n}])=>{n(()=>void ev.invalidateQueries()),Jt(()=>void ev.invalidateQueries()),`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.error(`Toodo: could not register the service worker`,e)}),nv((0,q.jsx)(t,{children:(0,q.jsx)(e,{children:(0,q.jsx)($_,{})})}))});export{_a as A,Xr as B,ya as C,J as D,$i as E,gi as F,sn as G,ii as H,ai as I,si as L,Di as M,Pi as N,va as O,hi as P,oi as R,ha as S,pa as T,$r as U,ri as V,Ln as W,Li as _,bg as a,Hi as b,Xm as c,Pa as d,Da as f,Ji as g,Yi as h,__ as i,ki as j,Bi as k,Au as l,ma as m,h_ as n,jh as o,Ea as p,x_ as r,bh as s,G_ as t,La as u,Vi as v,Xi as w,ga as x,Ri as y,Zr as z};
|