@dubusoft/toodo-linux-arm64 1.11.1-dev.190 → 1.11.1-dev.192

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.
Files changed (41) hide show
  1. package/bin/toodo +0 -0
  2. package/bin/toodo-server +0 -0
  3. package/package.json +1 -1
  4. package/web/assets/Item-CVXI6XsR.js +2 -0
  5. package/web/assets/{LayoutChangeSnapshot-CKXseiXe.js → LayoutChangeSnapshot-Bqg4192Z.js} +1 -1
  6. package/web/assets/{MenuBottomSheet-DTrICmho.js → MenuBottomSheet-CeALVyiC.js} +1 -1
  7. package/web/assets/{MenuBottomSheetActionList-PkbkLEyi.js → MenuBottomSheetActionList-DFd0KkKB.js} +1 -1
  8. package/web/assets/Selector-DoBdC70u.js +2 -0
  9. package/web/assets/SwipeActionsLayer-B7GU5Iq8.js +1 -0
  10. package/web/assets/{Tooltip-D5RzAbgJ.js → Tooltip-D2N09Hzl.js} +1 -1
  11. package/web/assets/{button-CBaPb4j9.js → button-HISRpujD.js} +1 -1
  12. package/web/assets/{details-sheet-Bi7DoMJh.js → details-sheet-DZm5HiKY.js} +1 -1
  13. package/web/assets/{focusReturn-BAqtMp_d.js → focusReturn-DgQoALUE.js} +1 -1
  14. package/web/assets/index-B09gU1NJ.css +2 -0
  15. package/web/assets/index-BhedIiZp.js +69 -0
  16. package/web/assets/{markdown-Bh9eEY5s.js → markdown-DMV9aINp.js} +1 -1
  17. package/web/assets/{offline-screen-DE0QwTVx.js → offline-screen-D2oNUAkw.js} +1 -1
  18. package/web/assets/padding.stylex-DG4aFJ6m.js +1 -0
  19. package/web/assets/queries-Bcvk9W54.js +1 -0
  20. package/web/assets/review-BlpOrNhk.js +1 -0
  21. package/web/assets/{server-access-dLztdn9t.js → server-access-yl-6avZn.js} +1 -1
  22. package/web/assets/task-details-DvCtIgd-.js +2 -0
  23. package/web/assets/task-graph-yrbG5llV.js +8 -0
  24. package/web/assets/{useLayerDismissal-BWIjwIJ-.js → useLayerDismissal-D77qBJbE.js} +1 -1
  25. package/web/assets/useLinkComponent-DLC334Kf.js +4 -0
  26. package/web/assets/useTooltip-Dd70k22y.js +1 -0
  27. package/web/index.html +12 -12
  28. package/web/sw.js +10 -5
  29. package/web/version.json +1 -1
  30. package/web/assets/Item-CYeHP9x3.js +0 -2
  31. package/web/assets/Selector-D_XL1cT9.js +0 -2
  32. package/web/assets/SwipeActionsLayer-DIWq2pow.js +0 -1
  33. package/web/assets/index-CsInHoHY.js +0 -64
  34. package/web/assets/index-bmzrMLgi.css +0 -2
  35. package/web/assets/padding.stylex-Q-kmgnXU.js +0 -1
  36. package/web/assets/queries-01NiAvqS.js +0 -1
  37. package/web/assets/review-2RqEEvjf.js +0 -1
  38. package/web/assets/task-details-DK77SGWd.js +0 -2
  39. package/web/assets/task-graph-CZXSZ3LO.js +0 -8
  40. package/web/assets/useLinkComponent-CqCWDM4X.js +0 -4
  41. package/web/assets/useTooltip-C_x74aGj.js +0 -1
@@ -1,64 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-Bh9eEY5s.js","assets/rolldown-runtime-XKyaHtl9.js","assets/opener-DWhHPoCL.js","assets/createLucideIcon-DtNDbJdC.js","assets/jsx-runtime-C3cWAN_r.js","assets/MenuBottomSheetActionList-PkbkLEyi.js","assets/Item-CYeHP9x3.js","assets/focusOutline.stylex-ZXdUNMFw.js","assets/useLayerDismissal-BWIjwIJ-.js","assets/useLinkComponent-CqCWDM4X.js","assets/mergeProps-Poh9JbFs.js","assets/useDevWarning-DtAYt56R.js","assets/useTooltip-C_x74aGj.js","assets/primaryClick-88oQu3_u.js","assets/inputHold-CZa_Ny55.js","assets/disabledInteraction-u9yjM5Jo.js","assets/focusReturn-BAqtMp_d.js","assets/LayoutChangeSnapshot-CKXseiXe.js","assets/MenuBottomSheet-DTrICmho.js","assets/task-details-DK77SGWd.js","assets/button-CBaPb4j9.js","assets/session-sBDFnC3r.js","assets/details-sheet-Bi7DoMJh.js","assets/Selector-D_XL1cT9.js","assets/padding.stylex-Q-kmgnXU.js","assets/reducedMotion-DCkUC6gt.js","assets/queries-01NiAvqS.js","assets/event-CSYkpd32.js","assets/task-graph-CZXSZ3LO.js","assets/task-graph-DLioOiRN.css","assets/review-2RqEEvjf.js","assets/server-access-dLztdn9t.js","assets/offline-screen-DE0QwTVx.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{n as r,t as i}from"./jsx-runtime-C3cWAN_r.js";import{$t as a,A as o,At as s,B as c,Bt as l,Ct as u,Dt as d,Et as f,F as p,Ft as m,Gt as h,H as g,Ht as _,I as v,J as y,Jt as b,Kt as x,L as S,Lt as C,Mt as w,Nt as T,Ot as E,Pt as D,Qt as O,R as k,S as A,St as j,Tt as ee,Ut as M,Vt as N,X as P,Xt as F,Y as I,Yt as L,Z as R,Zt as z,_ as te,_t as B,bt as ne,d as re,dt as ie,en as V,et as ae,f as H,h as U,ht as W,i as oe,in as G,lt as K,m as se,n as q,nn as ce,nt as le,p as ue,qt as de,r as fe,rn as J,s as pe,t as me,tn as he,tt as ge,u as _e,ut as ve,v as Y,wt as ye,x as be,z as xe,zt as Se}from"./focusOutline.stylex-ZXdUNMFw.js";import{A as Ce,C as we,D as Te,E as Ee,F as De,I as Oe,M as ke,N as Ae,O as je,P as Me,S as Ne,T as Pe,_ as Fe,a as Ie,b as Le,c as Re,d as ze,f as Be,g as Ve,h as He,i as Ue,j as We,k as Ge,l as Ke,m as qe,n as Je,o as Ye,p as Xe,r as Ze,s as Qe,t as $e,u as et,v as tt,w as nt,x as rt,y as it}from"./Selector-D_XL1cT9.js";import{B as at,F as ot,H as st,I as ct,J as lt,N as ut,P as dt,Q as ft,R as pt,U as mt,V as ht,W as gt,X as _t,Y as vt,Z as yt,_ as bt,a as xt,c as St,d as Ct,l as wt,o as Tt,p as Et,q as Dt,r as Ot,s as kt,t as At,tt as jt,v as Mt,z as Nt}from"./useLinkComponent-CqCWDM4X.js";import{$ as Pt,A as Ft,D as It,E as Lt,J as Rt,O as zt,Q as Bt,X as Vt,Z as Ht,_ as Ut,a as Wt,at as Gt,b as Kt,c as qt,d as Jt,et as Yt,f as Xt,h as Zt,i as Qt,it as $t,l as en,m as tn,n as nn,nt as rn,ot as an,p as on,r as sn,s as cn,st as ln,t as un,tt as dn,v as fn,x as pn}from"./useLayerDismissal-BWIjwIJ-.js";import{n as mn,t as hn}from"./mergeProps-Poh9JbFs.js";import{S as gn,a as _n,g as vn,h as yn,i as bn,n as xn,o as Sn,s as Cn,t as wn,v as Tn,x as En,y as Dn}from"./inputHold-CZa_Ny55.js";import{$ as On,$t as kn,A as An,At as jn,Bt as Mn,C as Nn,D as Pn,F as Fn,Ft as In,Gt as Ln,Ht as Rn,I as zn,It as Bn,Jt as Vn,K as Hn,Kt as Un,Lt as Wn,N as Gn,Nt as Kn,O as qn,P as Jn,Pt as Yn,Q as Xn,Qt as Zn,Rt as Qn,S as $n,St as er,T as tr,U as nr,Ut as rr,V as ir,Vt as ar,W as or,Wt as sr,X as cr,Xt as lr,Y as ur,Yt as dr,Z as fr,Zt as pr,_t as mr,at as hr,b as gr,bt as _r,c as vr,ct as yr,d as br,dt as xr,en as Sr,et as Cr,f as wr,ft as Tr,g as Er,gt as Dr,h as Or,ht as kr,i as Ar,it as jr,j as Mr,jt as Nr,k as Pr,kt as Fr,l as Ir,lt as Lr,m as Rr,n as zr,nt as Br,o as Vr,ot as Hr,p as Ur,pt as Wr,q as Gr,qt as Kr,r as qr,rt as Jr,s as Yr,st as Xr,tt as Zr,ut as Qr,v as $r,vt as ei,w as ti,wt as ni,x as ri,xt as ii,y as ai,yt as oi,zt as si}from"./queries-01NiAvqS.js";import{t as ci}from"./createLucideIcon-DtNDbJdC.js";import{D as li,O as ui,S as di,_ as fi,b as pi,d as mi,f as hi,g as gi,h as _i,k as vi,m as yi,p as bi,t as xi,u as Si,v as Ci,w as wi,x as Ti,y as Ei}from"./Item-CYeHP9x3.js";import{B as Di,D as Oi,E as ki,H as Ai,I as ji,L as Mi,O as Ni,R as Pi,T as Fi,V as Ii,_ as Li,c as Ri,f as zi,g as Bi,j as Vi,l as Hi,m as Ui,n as Wi,r as Gi,t as Ki,u as qi,v as Ji,w as Yi,y as Xi,z as Zi}from"./useTooltip-C_x74aGj.js";import{n as Qi}from"./disabledInteraction-u9yjM5Jo.js";import{c as $i,d as ea,f as ta,i as na,l as ra,n as ia,p as aa,r as oa,s as sa,t as X,u as ca}from"./button-CBaPb4j9.js";import{C as la,S as ua,_ as da,a as fa,b as pa,c as ma,g as ha,h as ga,n as _a,o as va,s as ya,t as ba,v as xa,y as Sa}from"./padding.stylex-Q-kmgnXU.js";import{a as Ca,i as wa,n as Ta,o as Ea,r as Da,s as Oa,t as ka}from"./resolveSnapPoint-CBS37OcT.js";import{a as Aa,c as ja,f as Ma,i as Na,l as Pa,n as Fa,p as Ia,r as La,s as Ra,t as za,u as Ba}from"./focusReturn-BAqtMp_d.js";import{i as Va,n as Ha,r as Ua,t as Wa}from"./primaryClick-88oQu3_u.js";import{a as Ga,c as Ka,d as qa,f as Ja,i as Ya,m as Xa,n as Za,o as Qa,p as $a,s as eo,t as to,u as no}from"./reducedMotion-DCkUC6gt.js";import{t as ro}from"./useDevWarning-DtAYt56R.js";import{a as io,b as ao,d as oo,g as so,n as co,p as lo,s as uo,t as fo,u as po,v as mo,x as ho,y as go}from"./session-sBDFnC3r.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 Z=t(r(),1),_o={"color-scheme":`dark`,"--color-text-primary":`var(--color-on-dark)`,"--color-icon-primary":`var(--color-on-dark)`,"--color-accent":`var(--color-on-dark)`},vo={"color-scheme":`light`,"--color-text-primary":`var(--color-on-light)`,"--color-icon-primary":`var(--color-on-light)`,"--color-accent":`var(--color-on-light)`};function yo(e){return Array.isArray(e)?`light-dark(${e[0]}, ${e[1]})`:e}function bo(e,t,n){let r={...e===`dark`?_o:vo,...n?.tokens};if(t?.tokens)for(let[e,n]of Object.entries(t.tokens))n!==void 0&&(r[e]=yo(n));return{tokens:r,components:De(n?.components,t?.components)}}var xo={"--color-syntax-keyword":`var(--color-text-accent)`,"--color-syntax-string":`var(--color-text-green)`,"--color-syntax-comment":`var(--color-text-secondary)`,"--color-syntax-number":`var(--color-text-orange)`,"--color-syntax-function":`var(--color-text-blue)`,"--color-syntax-type":`var(--color-text-purple)`,"--color-syntax-variable":`var(--color-text-primary)`,"--color-syntax-operator":`var(--color-text-cyan)`,"--color-syntax-constant":`var(--color-text-orange)`,"--color-syntax-tag":`var(--color-text-red)`,"--color-syntax-attribute":`var(--color-text-teal)`,"--color-syntax-property":`var(--color-text-cyan)`,"--color-syntax-punctuation":`var(--color-text-secondary)`,"--color-syntax-background":`var(--color-background-muted)`,"--color-syntax-added":`color-mix(in srgb, var(--color-success-muted) 25%, transparent)`,"--color-syntax-removed":`color-mix(in srgb, var(--color-error-muted) 25%, transparent)`,"--color-syntax-diff-header":`var(--color-background-muted)`,"--color-syntax-added-marker":`var(--color-text-green)`,"--color-syntax-removed-marker":`var(--color-text-red)`},So={"--color-data-categorical-blue":`light-dark(#0171E3, #0171E3)`,"--color-data-categorical-orange":`light-dark(#EB6E00, #EB6E00)`,"--color-data-categorical-purple":`light-dark(#6B1EFD, #6B1EFD)`,"--color-data-categorical-green":`light-dark(#0B991F, #0B991F)`,"--color-data-categorical-pink":`light-dark(#F351C0, #F351C0)`,"--color-data-categorical-cyan":`light-dark(#0171A4, #0171A4)`,"--color-data-categorical-red":`light-dark(#F5394F, #F5394F)`,"--color-data-categorical-teal":`light-dark(#08A3A3, #08A3A3)`,"--color-data-categorical-brown":`light-dark(#965E03, #965E03)`,"--color-data-categorical-indigo":`light-dark(#6F8AFF, #6F8AFF)`,"--color-data-neutral":`light-dark(#8494A3, #8C939B)`,"--color-data-blue-5":`light-dark(#02165E, #02165E)`,"--color-data-blue-4":`light-dark(#004CBC, #004CBC)`,"--color-data-blue-3":`light-dark(#2694FE, #2694FE)`,"--color-data-blue-2":`light-dark(#78BEFF, #78BEFF)`,"--color-data-blue-1":`light-dark(#DBECFF, #DBECFF)`,"--color-data-shamrock-5":`light-dark(#0B603D, #0B603D)`,"--color-data-shamrock-4":`light-dark(#138546, #138546)`,"--color-data-shamrock-3":`light-dark(#24BB5E, #24BB5E)`,"--color-data-shamrock-2":`light-dark(#8EF7AA, #8EF7AA)`,"--color-data-shamrock-1":`light-dark(#D6FEE4, #D6FEE4)`,"--color-data-orange-5":`light-dark(#A13F04, #A13F04)`,"--color-data-orange-4":`light-dark(#D66100, #D66100)`,"--color-data-orange-3":`light-dark(#FD9537, #FD9537)`,"--color-data-orange-2":`light-dark(#FDB876, #FDB876)`,"--color-data-orange-1":`light-dark(#FFE6CF, #FFE6CF)`,"--color-data-pink-5":`light-dark(#8E1073, #8E1073)`,"--color-data-pink-4":`light-dark(#D123A1, #D123A1)`,"--color-data-pink-3":`light-dark(#F989D3, #F989D3)`,"--color-data-pink-2":`light-dark(#FEADE3, #FEADE3)`,"--color-data-pink-1":`light-dark(#FCE3F4, #FCE3F4)`,"--color-data-purple-5":`light-dark(#3E0697, #3E0697)`,"--color-data-purple-4":`light-dark(#6B1EFD, #6B1EFD)`,"--color-data-purple-3":`light-dark(#9081FF, #9081FF)`,"--color-data-purple-2":`light-dark(#B3B0FE, #B3B0FE)`,"--color-data-purple-1":`light-dark(#E8E8FB, #E8E8FB)`,"--color-data-red-5":`light-dark(#9D0519, #9D0519)`,"--color-data-red-4":`light-dark(#D31130, #D31130)`,"--color-data-red-3":`light-dark(#FB7D87, #FB7D87)`,"--color-data-red-2":`light-dark(#FFB2B8, #FFB2B8)`,"--color-data-red-1":`light-dark(#FEE4E6, #FEE4E6)`,"--color-data-teal-5":`light-dark(#08767D, #08767D)`,"--color-data-teal-4":`light-dark(#0C9293, #0C9293)`,"--color-data-teal-3":`light-dark(#0DB7AF, #0DB7AF)`,"--color-data-teal-2":`light-dark(#6CE6D8, #6CE6D8)`,"--color-data-teal-1":`light-dark(#D7FCF8, #D7FCF8)`,"--color-data-yellow-5":`light-dark(#8A5001, #8A5001)`,"--color-data-yellow-4":`light-dark(#D69804, #D69804)`,"--color-data-yellow-3":`light-dark(#FBCE03, #FBCE03)`,"--color-data-yellow-2":`light-dark(#FCEC85, #FCEC85)`,"--color-data-yellow-1":`light-dark(#FDF6BA, #FDF6BA)`,"--color-data-gray-5":`light-dark(#25363F, #333338)`,"--color-data-gray-4":`light-dark(#5D6C7B, #666A72)`,"--color-data-gray-3":`light-dark(#AFB9C4, #B2B8BE)`,"--color-data-gray-2":`light-dark(#CCD3DB, #D0D3D6)`,"--color-data-gray-1":`light-dark(#F1F4F7, #F2F4F6)`},Co={...xo,...So},wo={...Se,...O,...z,...C,...h,...b,...L,...N,...M,...ce,...V,...x,...he,...Co};function To(e){return`__inputTokens`in e||e.__built===!0}function Eo(e){if(e===void 0)return`undefined`;if(e===null)return`null`;if(typeof e!=`object`)return typeof e;let t=Object.keys(e);return`an object with keys [${t.slice(0,4).join(`, `)}${t.length>4?`, …`:``}]`}var Do=[`--duration-slow-min`,`--duration-slow`,`--duration-slow-max`];function Oo(e,t,n){let r=[...`slow`in t&&!(`slow`in n)?Do:[],...`easing`in t&&!(`easing`in n)?[`--ease-standard`]:[]];if(r.length===0)return;let i=e.tokens;return Object.fromEntries(r.flatMap(e=>i[e]===void 0?[]:[[e,i[e]]]))}function ko(e,t){let n=e;if((n.fast!==void 0||n.medium!==void 0||n.ratio!==void 0||n.slow!==void 0||n.easing!==void 0)&&(n.fast===void 0||n.medium===void 0||n.ratio===void 0))throw Error(`defineTheme("${t}"): \`motion\` sets a duration scale field, so it must supply \`fast\`, \`medium\`, and \`ratio\` unless each missing field is inherited from \`extends\`.`)}function Ao(e){let{palette:t}=e;if(t!==void 0){if(typeof t==`object`&&t&&t.kind===`theme-palette`&&typeof t.tokens==`object`)return t;throw Error(`defineTheme("${e.name}"): \`palette\` must be made by themePalette() from @astryxdesign/core/palette, got ${t===null?`null`:typeof t==`object`?`a plain object`:typeof t}. Wrap the seeds: palette: themePalette({accent: '#5b3cc4'}).`)}}function jo(e,t){let n={};for(let[r,i]of Object.entries(e.components)){n[r]={};for(let[e,a]of Object.entries(i)){let i=t?.[r]?.[e],o=e=>i!=null&&i[e]!==void 0,s={};for(let e of[`@light`,`@dark`]){let t=Object.entries(a[e]).filter(([e])=>!o(e));t.length&&(s[e]=Object.fromEntries(t))}n[r][e]=s}}return De(n,t)}function Mo(e){if(`extends`in e&&Lo(e.extends)&&!To(e.extends))throw Error(`defineTheme("${e.name}"): \`extends\` must be a theme from defineTheme(), got a plain object named "${e.extends.name}", which is theme input, not a theme. Pass it through defineTheme() first (extends: defineTheme({...})), or import the theme its own file defines.`);if(`extends`in e&&!Lo(e.extends))throw Error(`defineTheme("${e.name}"): \`extends\` must be a theme from defineTheme(), got ${Eo(e.extends)}. Check that the import naming your base theme resolves to its source and exports that name — a generated \`<theme>.js\` artifact sitting next to the source exports \`<name>Theme\`, not the source's own export.`);let t=e.extends,n=Ao(e),r=t?.__axes?.motion,i=e.motion!=null&&r!=null?{...r,...e.motion}:e.motion;i!=null&&ko(i,e.name);let a=e.motion!=null&&t!=null&&r!=null?Oo(t,r,e.motion):void 0,o={typography:e.typography,color:e.color,radius:e.radius,motion:i,syntax:e.syntax,tokens:a!=null&&Object.keys(a).length>0?{...a,...n?.tokens,...e.tokens}:n?{...n.tokens,...e.tokens}:e.tokens,components:n?jo(n,e.components):e.components},s={typography:e.typography,color:e.color,radius:e.radius,motion:e.motion},c=t?{tokens:t.tokens,components:t.components}:void 0,{tokens:l,components:u}=je(o,c,{inheritedCharacter:r?.character}),d=bo(`dark`,e.onDark,t?.__onDark),f=bo(`light`,e.onLight,t?.__onLight),p=Te(e,t,l,wo),m=Ee(t?.__axes,s),h=nt(e.name,t?.__adaptations,e.adaptations),g=Pe(e.name,h,m,l,p?.localTokens,u),_=t?.__icons??t?.icons,v=e.icons&&_?{..._,...e.icons}:e.icons??_,y=Io(v),b=e.iconVariants===void 0?t?.iconVariants:[...e.iconVariants],x=No(v,e.icons,t,b),S=Po(t?.__componentIcons??t?.componentIcons,e.componentIcons),C=Fo(S),w=e.indicators&&t?.indicators?{...t.indicators,...e.indicators}:e.indicators??t?.indicators,T={name:e.name,tokens:l,...p?{localTokens:p.localTokens,__localTokenOwners:p.owners,__localTokenLineage:p.lineage}:{},components:u,icons:y,...y===v?{}:{__icons:v},...b===void 0?{}:{iconVariants:b},...x===void 0?{}:{__iconEntryVariants:x},...C===void 0?{}:{componentIcons:C},...C===S?{}:{__componentIcons:S},indicators:w,__inputTokens:t?.__inputTokens||n||e.tokens?{...t?.__inputTokens,...n?.tokens,...e.tokens}:void 0,__onDark:d,__onLight:f,__adaptations:h,__adaptationRules:g,__axes:m};return jt(T),T}function No(e,t,n,r){if(e==null||n==null)return;let i=n.__iconEntryVariants,a;for(let[o,s]of Object.entries(e)){if(typeof s!=`function`||t!=null&&Object.hasOwn(t,o))continue;let e=i!=null&&Object.hasOwn(i,o)?i[o]:n.iconVariants;e!==r&&(a??={},a[o]=e)}return a}function Po(e,t){if(t==null)return e;let n={...e};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function Fo(e){if(e==null||!Object.values(e).some(e=>typeof e==`function`))return e;let t={};for(let[n,r]of Object.entries(e))typeof r!=`function`&&(t[n]=r);return t}function Io(e){if(e==null||!Object.values(e).some(e=>typeof e==`function`))return e;let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?r({size:`md`}):r;return t}function Lo(e){return typeof e==`object`&&!!e&&`name`in e&&`tokens`in e&&!(`styles`in e)}function Ro(e){let t=``;for(let n of e){let e=n.codePointAt(0)??0;t+=n===`"`||n===`\\`||e<32||e===127?`\\${(e===0?65533:e).toString(16)} `:n}return t}function zo(e){return e===`base`?``:e.split(`+`).map(e=>{let t=e.indexOf(`:`),n=t===-1?e:e.slice(0,t),r=t===-1?e:e.slice(t+1);return`[${j(n)}="${Ro(r)}"]`}).join(``)}var Bo=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Vo=[`start-start`,`start-end`,`end-start`,`end-end`],Ho={avatar:[{property:`borderRadius`,vars:[`--_avatar-radius`]}],banner:[{property:`borderRadius`,vars:[`--_banner-radius`]}],"bottom-sheet":[{property:`padding`,expand:`container`}],button:[{property:`borderRadius`,vars:[`--_button-radius`]}],card:[{property:`borderRadius`,vars:[`--_card-radius`],corners:!0},{property:`padding`,expand:`container`}],"chat-composer":[{property:`borderRadius`,vars:[`--_chat-composer-radius`]},{property:`padding`,vars:[`--_chat-composer-padding`]}],"checkbox-input":[{property:`gap`,vars:[`--_checkbox-input-gap`],replaces:!0}],dialog:[{property:`borderRadius`,vars:[`--_dialog-radius`],corners:!0},{property:`padding`,expand:`container`}],drawer:[{property:`padding`,expand:`container`}],"context-menu":[{property:`borderRadius`,vars:[`--_dropdown-menu-radius`],corners:!0},{property:`padding`,vars:[`--_dropdown-menu-padding`]}],"dropdown-menu":[{property:`borderRadius`,vars:[`--_dropdown-menu-radius`],corners:!0},{property:`padding`,vars:[`--_dropdown-menu-padding`]}],field:[{property:`borderRadius`,vars:[`--_field-radius`]}],"hover-card":[{property:`borderRadius`,vars:[`--_hovercard-radius`]}],icon:[{property:`width`,vars:[`--_icon-width`],replaces:!0},{property:`height`,vars:[`--_icon-height`],replaces:!0}],item:[{property:`paddingInline`,vars:[`--_item-inset-inline`]}],"number-input":[{property:`padding`,expand:`container`},{property:`borderRadius`,vars:[`--_field-radius`]}],popover:[{property:`borderRadius`,vars:[`--_popover-radius`]}],"progress-bar-mark":[{property:`width`,vars:[`--_progressbar-mark-width`],replaces:!0},{property:`height`,vars:[`--_progressbar-mark-height`],replaces:!0}],section:[{property:`padding`,expand:`container`}],"segmented-control":[{property:`borderRadius`,vars:[`--_segmented-control-radius`]},{property:`padding`,vars:[`--_segmented-control-padding`]}],"switch-field":[{property:`gap`,vars:[`--_switch-field-gap`],replaces:!0}],"switch-thumb":[{property:`width`,vars:[`--_switch-thumb-width`],replaces:!0},{property:`height`,vars:[`--_switch-thumb-height`],replaces:!0}],"table-row":[{property:`backgroundColor`,vars:[`--table-row-overlay`]}],"text-area":[{property:`paddingInline`,vars:[`--_textarea-inline-padding`],replaces:!0}]};function Uo(e,t){let n=Ho[e];return n?n.filter(e=>e.property===t):[]}var Wo=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},Go=e=>(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)*255;function Ko(e,t){let n=e.a;return{r:e.r*n+t.r*(1-n),g:e.g*n+t.g*(1-n),b:e.b*n+t.b*(1-n),a:1}}function qo({r:e,g:t,b:n}){return .2126*Wo(e)+.7152*Wo(t)+.0722*Wo(n)}function Jo(e,t){let n=t.a<1?Ko(t,{r:255,g:255,b:255,a:1}):t,r=qo(e.a<1?Ko(e,n):e),i=qo(n);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}function Yo({r:e,g:t,b:n}){let r=Wo(e),i=Wo(t),a=Wo(n),o=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*a),s=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*a),c=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*a),l=.2104542553*o+.793617785*s-.0040720468*c,u=1.9779984951*o-2.428592205*s+.4505937099*c,d=.0259040371*o+.7827717662*s-.808675766*c;return{l,c:Math.hypot(u,d),h:Math.atan2(d,u)}}function Xo({l:e,c:t,h:n}){let r=t*Math.cos(n),i=t*Math.sin(n),a=(e+.3963377774*r+.2158037573*i)**3,o=(e-.1055613458*r-.0638541728*i)**3,s=(e-.0894841775*r-1.291485548*i)**3;return[4.0767416621*a-3.3077115913*o+.2309699292*s,-1.2684380046*a+2.6097574011*o-.3413193965*s,-.0041960863*a-.7034186147*o+1.707614701*s]}function Zo(e){let t=e.c;for(let n=0;n<40;n++){let n=Xo({...e,c:t});if(n.every(e=>e>=-1e-4&&e<=1.0001)){let[e,t,r]=n.map(e=>Go(Math.min(1,Math.max(0,e))));return{r:e,g:t,b:r,a:1}}t*=.9}let[n,r,i]=Xo({...e,c:0}).map(e=>Go(Math.min(1,Math.max(0,e))));return{r:n,g:r,b:i,a:1}}var Qo=[.2,.95];function $o(e){let{l:t,c:n}=Yo(e);return n>=.03&&t>=Qo[0]&&t<=Qo[1]}function es(e,t,n){let r=e=>t.every(t=>Jo(e,t)>=n),i={...e,a:1};if(r(i))return i;let a=t.reduce((e,t)=>e+qo(t),0)/t.length,o=Yo(i),s=a>.18,c=s?0:o.l,l=s?o.l:1,u=e=>Zo({...o,l:e}),d=u(+!s);if(!r(d))return null;for(let e=0;e<32;e++){let e=(c+l)/2,t=r(u(e));s?t?c=e:l=e:t?l=e:c=e}let f=u(s?c:l);return r(f)?f:d}function ts(e){return e===void 0?null:ke(e)}function ns(e){let t=We(e.r,e.g,e.b);return e.a>=1?t:`${t}${Math.round(e.a*255).toString(16).padStart(2,`0`).toUpperCase()}`}var rs=[`info`,`success`,`warning`,`error`],is=4.5,as=4.58,os=[`light`,`dark`];function ss(e){return`--color-${e}`}function cs(e){let t=[],n=0,r=``;for(let i of e)i===`(`&&n++,i===`)`&&n--,i===`,`&&n===0?(t.push(r.trim()),r=``):r+=i;return t.push(r.trim()),t}function ls(e,t,n,r=new Set){if(!r.has(t))return us(e,e[t]??Se[t],n,new Set([...r,t]))}function us(e,t,n,r){if(Array.isArray(t))return us(e,t[n===`light`?0:1],n,r);if(typeof t!=`string`)return;let i=t.trim();if(/^light-dark\(/i.test(i)&&i.endsWith(`)`)){let[t,a]=cs(i.slice(i.indexOf(`(`)+1,-1));return us(e,n===`light`?t:a,n,r)}let a=/^var\(\s*(--[\w-]+)\s*(?:,(.*))?\)$/s.exec(i);return a?ls(e,a[1],n,r)??(a[2]?us(e,a[2],n,r):void 0):i}var ds={};function fs(e){let t=new Set([...Object.keys(Se),...Object.keys(e)]),n=n=>{let r={};for(let i of t){let t=ls(e,i,n);t!==void 0&&(r[i]=t)}return r};return{light:n(`light`),dark:n(`dark`)}}var ps;function ms(){return ps??=fs(ds),ps}function hs(e,t,n){let r=ts(t[ss(e)]);if(r!==null&&$o(r))return{...r,a:1};let i=ts(ms()[n][ss(e)]);return i===null?null:{...i,a:1}}function gs(e,t){return e.a<1?Ko(e,t):e}function _s(e,t,n){let r=ts(t[ss(e)]),i=hs(e,t,n),a=ts(t[`--color-background-surface`]),o=ts(t[`--color-background-card`]),s=ts(t[`--color-${e}-muted`]),c=ts(t[`--color-on-dark`]),l=ts(t[`--color-on-light`]);if(r===null||i===null||a===null||o===null||s===null||c===null||l===null)return null;let u=gs(a,{r:255,g:255,b:255,a:1}),d=gs(o,u),f=gs(r,u),p={},m=gs(c,f),h=gs(l,f),g=Jo(m,f)>=Jo(h,f)?m:h,_={r:255,g:255,b:255,a:1},v={r:0,g:0,b:0,a:1};p.on=Jo(g,f)>=is?g:Jo(_,f)>=Jo(v,f)?_:v;let y=es(i,[u,d],as);y!==null&&(p.text=y);let b=es(i,[Ko(s.a<1?s:{...s,a:1},u)],as);return b!==null&&(p.onMuted=b),p}var vs={on:e=>`--color-on-${e}`,text:e=>`--color-text-${e}`,onMuted:e=>`--color-on-${e}-muted`};function ys(e,t={}){let n=new Set(Object.keys(e)),r=n.has(`--color-background-surface`)||n.has(`--color-background-card`),i=n.has(`--color-on-dark`)||n.has(`--color-on-light`),a=fs({...t,...e}),o=[];for(let e of rs){let t=n.has(ss(e)),s=n.has(`--color-${e}-muted`),c={on:t||i,text:t||r,onMuted:t||s||r};if(!c.on&&!c.text&&!c.onMuted)continue;let l=os.map(t=>_s(e,a[t],t));if(!l.some(e=>e===null))for(let t of Object.keys(vs)){let r=vs[t](e);if(!c[t]||n.has(r))continue;let[i,a]=l.map(e=>e?.[t]);i!==void 0&&a!==void 0&&o.push([r,`light-dark(${ns(i)}, ${ns(a)})`])}}return o}function bs(e){return e===`
3
- `||e===`\r`||e===`\f`}function xs(e){return e===` `||e===` `||bs(e)}function Ss(e){return/^[0-9a-fA-F]$/.test(e)}function Cs(e){return/^[A-Za-z_]$/.test(e)||e.charCodeAt(0)>=128}function ws(e){return Cs(e)||/^[0-9-]$/.test(e)}function Ts(e){let t=e.replace(/\r\n?|\f/g,`
4
- `).replace(/\0/g,`�`),n=``;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e);if(r>=55296&&r<=56319){let r=t.charCodeAt(e+1);r>=56320&&r<=57343?(n+=t[e]+t[e+1],e++):n+=`�`}else n+=r>=56320&&r<=57343?`�`:t[e]}return n}var Es=/[\x01-\x08\x0b\x0e-\x1f\x7f]/;function Ds(e,t){return e[t]===`\\`&&t+1<e.length&&!bs(e[t+1])}function Os(e,t){let n=e[t];if(n===`-`){let n=e[t+1];return n!==void 0&&(n===`-`||Cs(n)||Ds(e,t+1))}return n===`\\`?Ds(e,t):n!==void 0&&Cs(n)}function ks(e,t){if(Ss(e[t])){let n=t;for(;n<e.length&&n-t<6&&Ss(e[n]);)n++;return n<e.length&&xs(e[n])&&n++,n}return t+((e.codePointAt(t)??0)>65535?2:1)}function As(e,t){let n=``,r=t;for(;r<e.length;){let t=e[r];if(ws(t))n+=t,r++;else if(Ds(e,r)){let t=ks(e,r+1);if(Ss(e[r+1])){let i=e.slice(r+1,t).trim(),a=parseInt(i,16);n+=a===0||a>1114111||a>=55296&&a<=57343?`�`:String.fromCodePoint(a)}else n+=e.slice(r+1,t);r=t}else break}return{end:r,name:n}}function js(e,t){let n=e[t],r=t+1;for(;r<e.length;){let t=e[r];if(t===n)return{end:r+1};if(bs(t))return{reason:`a newline inside a quoted string makes a bad string`};if(t===`\\`){if(r+1>=e.length)break;r=bs(e[r+1])?r+2:ks(e,r+1)}else r++}return{reason:`an unclosed ${n} string would swallow the rest of the rule`}}function Ms(e,t){let n=t;for(;n<e.length;){let t=e[n];if(t===`)`)return{end:n+1};if(xs(t)){for(;n<e.length&&xs(e[n]);)n++;if(n>=e.length)break;return e[n]===`)`?{end:n+1}:{reason:`whitespace inside an unquoted url() makes a bad url`}}if(Es.test(t))return{reason:`a non-printable character inside url() makes a bad url`};if(t===`"`||t===`'`||t===`(`)return{reason:`"${t}" inside an unquoted url() makes a bad url; quote the URL instead`};if(t===`\\`){if(!Ds(e,n))return{reason:`a stray backslash inside url() makes a bad url`};n=ks(e,n+1)}else n++}return{reason:`an unclosed url( would swallow the rest of the rule`}}var Ns={"(":`)`,"[":`]`,"{":`}`};function Ps(e){let t=Ts(e),n=[],r=0;for(;r<t.length;){let e=t[r];if(e===`/`&&t[r+1]===`*`){let e=t.indexOf(`*/`,r+2);if(e===-1)return`an unclosed /* comment would swallow the rest of the rule`;r=e+2}else if(e===`"`||e===`'`){let e=js(t,r);if(`reason`in e)return e.reason;r=e.end}else if(Os(t,r)){let e=As(t,r);if(r=e.end,t[r]===`(`&&e.name.toLowerCase()===`url`){let e=r+1;for(;e<t.length&&xs(t[e]);)e++;if(t[e]===`"`||t[e]===`'`){n.push(`)`),r+=1;continue}let i=Ms(t,e);if(`reason`in i)return i.reason;r=i.end}}else if(e===`\\`){if(r+1>=t.length)return`a trailing backslash would escape the declaration terminator`;r=bs(t[r+1])?r+1:ks(t,r+1)}else if(e===`(`||e===`[`||e===`{`){if(e===`{`&&n.length===0)return`an unquoted "{" would open a nested block`;n.push(Ns[e]),r++}else if(e===`)`||e===`]`||e===`}`){if(n.length===0)return e===`}`?`an unquoted "}" would close the rule`:`an unbalanced "${e}" has nothing to close`;let t=n.pop();if(t!==e)return`"${e}" does not close the open "${t===`)`?`(`:t===`]`?`[`:`{`}"`;r++}else{if(e===`;`&&n.length===0)return`an unquoted ";" would end the declaration`;r++}}if(n.length>0){let e=n[n.length-1];return`an unclosed "${e===`)`?`(`:e===`]`?`[`:`{`}" would swallow the rest of the rule`}return null}function Fs(e,t){let n=t;for(;;){for(;n<e.length&&xs(e[n]);)n++;if(e[n]!==`/`||e[n+1]!==`*`)return n;let t=e.indexOf(`*/`,n+2);if(t===-1)return e.length;n=t+2}}function Is(e,t){let n=Fs(e,t+1);if(!Os(e,n))return null;let r=As(e,n);if(!r.name.startsWith(`--`))return null;let i=Fs(e,r.end);return e[i]===`,`||e[i]===`)`?r.name:null}function Ls(e,t){let n=e[t],r=e[t+1],i=e[t+2];return n===`+`||n===`-`?/^[0-9]$/.test(r??``)||r===`.`&&/^[0-9]$/.test(i??``):/^[0-9]$/.test(n??``)||n===`.`&&/^[0-9]$/.test(r??``)}function Rs(e,t){let n=t;for((e[n]===`+`||e[n]===`-`)&&n++;/^[0-9]$/.test(e[n]??``);)n++;if(e[n]===`.`&&/^[0-9]$/.test(e[n+1]??``))for(n+=2;/^[0-9]$/.test(e[n]??``);)n++;if((e[n]===`e`||e[n]===`E`)&&(/^[0-9]$/.test(e[n+1]??``)||(e[n+1]===`+`||e[n+1]===`-`)&&/^[0-9]$/.test(e[n+2]??``)))for(n++,(e[n]===`+`||e[n]===`-`)&&n++;/^[0-9]$/.test(e[n]??``);)n++;return n}var zs=new Map,Bs=4096;function Vs(e){let t=zs.get(e);if(t!==void 0)return t;let n=Ps(e);if(n!==null){let t={reason:n,references:[],important:!1,singleVarReference:null};return zs.size>=Bs&&zs.clear(),zs.set(e,t),t}let r=Ts(e),i=[],a=[],o=[],s=[],c=0,l=e=>{a.length===0&&(c++,s.length===0&&s.push(e),o.push(e),o.length>2&&o.shift())},u=0;for(;u<r.length;){let e=r[u];if(xs(e))u++;else if(e===`/`&&r[u+1]===`*`)u=r.indexOf(`*/`,u+2)+2;else if(e===`"`||e===`'`){l({type:`other`,value:e});let t=js(r,u);u=`end`in t?t.end:r.length}else{if(e===`#`){let e=u+1;if(ws(r[e])||Ds(r,e)){l({type:`other`,value:`#`}),u=As(r,e).end;continue}}if(e===`@`&&Os(r,u+1))l({type:`other`,value:`@`}),u=As(r,u+1).end;else if(Ls(r,u))l({type:`other`,value:e}),u=Rs(r,u),Os(r,u)?u=As(r,u).end:r[u]===`%`&&u++;else if(Os(r,u)){let e=As(r,u);u=e.end;let t=r[u]===`(`,n=t&&e.name.toLowerCase()===`var`?Is(r,u):null;if(l(n===null?{type:t?`other`:`ident`,value:e.name}:{type:`var-function`,value:e.name,reference:n}),t){if(n!==null&&i.push(n),e.name.toLowerCase()===`url`){let e=u+1;for(;e<r.length&&xs(r[e]);)e++;if(r[e]!==`"`&&r[e]!==`'`){let t=Ms(r,e);u=`end`in t?t.end:r.length;continue}}a.push(`)`),u++}}else e===`(`||e===`[`||e===`{`?(l({type:`other`,value:e}),a.push(Ns[e]),u++):e===`)`||e===`]`||e===`}`?(a.pop(),u++):(l(e===`!`?{type:`delim`,value:e}:{type:`other`,value:e}),u++)}}let d=o.at(-2),f=o.at(-1),p=d?.type===`delim`&&d.value===`!`&&f?.type===`ident`&&f.value.toLowerCase()===`important`,m=s[0],h={reason:null,references:i,important:p,singleVarReference:c-(p?2:0)==1&&m?.type===`var-function`?m.reference??null:null};return zs.size>=Bs&&zs.clear(),zs.set(e,h),h}function Hs(e){let t=Ts(e);if(t.length===0||!Os(t,0))return null;let n=As(t,0);return n.end===t.length?n.name:null}function Us(e){let t=Ts(e);if(t.length===0||!Os(t,0))return`a property name must be a CSS identifier`;let{end:n}=As(t,0);return n===t.length?null:`a property name must be one CSS identifier; "${t[n]}" cannot appear in one`}var Ws=[[`--color-text-info`,`--color-text-blue`],[`--color-text-success`,`--color-text-green`],[`--color-text-warning`,`--color-text-yellow`],[`--color-text-error`,`--color-text-red`],[`--color-on-info-muted`,`--color-text-blue`],[`--color-on-success-muted`,`--color-text-green`],[`--color-on-warning-muted`,`--color-text-yellow`],[`--color-on-error-muted`,`--color-text-red`],[`--color-icon-info`,`--color-text-info`],[`--color-icon-success`,`--color-text-success`],[`--color-icon-warning`,`--color-text-warning`],[`--color-icon-error`,`--color-text-error`],[`--color-border-info`,`--color-text-info`],[`--color-border-success`,`--color-text-success`],[`--color-border-warning`,`--color-text-warning`],[`--color-border-error`,`--color-text-error`],[`--duration-exit`,`--duration-fast`],[`--radius-chat`,`--radius-container`]],Gs=new Map(Ws.map(([e],t)=>[e,t]));function Ks(e){return typeof e==`string`?e:String(e)}function qs(e,...t){for(let n of t)for(let[t,r]of Object.entries(n??{})){if(r===void 0)continue;let n=Hs(t),i=Ks(r),a=Vs(i);n!==null&&a.reason===null&&(!e.important.has(n)||a.important)&&(e.values[n]=i,a.important?e.important.add(n):e.important.delete(n))}}function Js(...e){let t={values:{},important:new Set};return qs(t,...e),t}function Ys(e,t,n){let r=[...Vs(n).references],i=new Set;for(;r.length>0;){let n=r.pop();if(n!==void 0){if(n===t)return!0;if(!i.has(n)&&Object.prototype.hasOwnProperty.call(e,n)){i.add(n);for(let i of Vs(Ks(e[n])).references)(i===t||Object.prototype.hasOwnProperty.call(e,i))&&r.push(i)}}}return!1}var Xs={sm:1,md:2,lg:3,xl:4,"2xl":5};function Zs(e,t,n,r,i){let a=e.width?.from;if(a!==void 0&&t<Xs[a])return!1;let o=e.width?.below;return o!==void 0&&t>=Xs[o]?!1:(e.pointer===void 0||e.pointer===n)&&(e.contrast===void 0||e.contrast===r)&&(e.motion===void 0||e.motion===i)}var Qs=new WeakMap;function $s(e){let t=Qs.get(e);if(t!==void 0)return t;let n=new Map;for(let t=0;t<=5;t++)for(let r of[`coarse`,`fine`,`none`])for(let i of[`more`,`less`,`no-preference`,`custom`])for(let a of[`reduce`,`no-preference`]){let o=e.flatMap((e,n)=>Zs(e.when,t,r,i,a)?[n]:[]);n.set(o.join(`,`),o)}let r=[...n.values()];return Qs.set(e,r),r}function ec(e,t,n,r,i,a=[]){let o=Js(e,Object.fromEntries(n),t);for(let e of i){let t=r[e];qs(o,t.tokens,Object.fromEntries(a[e]??[]),t.localTokens)}for(let e of i)qs(o,Object.fromEntries(nc(r[e].tokens)));return o.values}function tc(e,t={},n=[]){let r=ys(e,t),i=Js(e,Object.fromEntries(r),t).values,a=$s(n).map(i=>({indexes:i,values:ec(e,t,r,n,i)}));for(let[e,t]of Ws){let n=`var(${t})`;if(!(i[e]!==void 0||i[t]===void 0&&!r.some(([e])=>e===t))&&a.every(({values:t})=>t[e]!==void 0||!Ys(t,e,n))){r.push([e,n]);for(let{values:t}of a)t[e]===void 0&&(t[e]=n)}}return r.sort(([e],[t])=>(Gs.get(e)??0)-(Gs.get(t)??0))}function nc(e){let t=Js(e).values;return Ws.flatMap(([e])=>{let n=t[e];return n===void 0?[]:[[e,Ks(n)]]})}var rc={largeTitle:[31,32,33,34,36,38,40,44,48,52,56,60],title1:[25,26,27,28,30,32,34,38,43,48,53,58],title2:[19,20,21,22,24,26,28,34,39,44,50,56],title3:[17,18,19,20,22,24,26,31,37,43,49,55],body:[14,15,16,17,19,21,23,28,33,40,47,53],footnote:[12,12,12,13,15,17,19,23,27,33,38,44],caption1:[11,11,11,12,14,16,18,22,26,32,37,43],caption2:[11,11,11,11,13,15,17,20,24,29,34,40]},ic=`data-astryx-text-size-probe`;function ac(e){e.setAttribute(ic,``)}var oc=3;function sc(e){return rc.body.findIndex(t=>Math.abs(t-e)<.5)}var cc={"--font-size-4xs":`caption2`,"--font-size-3xs":`caption2`,"--font-size-2xs":`caption2`,"--font-size-xs":`caption1`,"--font-size-sm":`footnote`,"--font-size-base":`body`,"--font-size-lg":`title3`,"--font-size-xl":`title2`,"--font-size-2xl":`title1`,"--font-size-3xl":`title1`,"--font-size-4xl":`largeTitle`,"--font-size-5xl":`largeTitle`};function lc(e){return`--_dynamic-type-${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`}var uc=Object.keys(rc).filter(e=>Object.values(cc).includes(e));function dc(e){return String(Number(e.toFixed(4)))}function fc(e){return e<0||e===oc?``:hc(t=>dc(rc[t][e]/rc[t][oc]))}var pc=`env(preferred-text-scale, 1)`;function mc(){return hc(()=>pc)}function hc(e){let t=e=>e.map(([e,t])=>` ${e}: ${t};`).join(`
5
- `);return`@layer astryx-base {\n:root {\n${t(_c(V))}\n}\n}\n:root {\n${t(uc.map(t=>[lc(t),e(t)]))}\n}`}function gc(e){return`--_scaled-${e.slice(2)}`}function _c(e){let t=Object.keys(cc),n=t=>{let[n,r]=xc(t&&e[t]||``);return yc(n)?{value:n,important:r}:null};return t.flatMap((r,i)=>{let a=n(r);if(a===null)return[];let{value:o,important:s}=a,c=`calc(${o} * var(${lc(cc[r])}, 1))`,l=t[i+1],u=n(l),d=c;if(l!==void 0&&(e[l]===void 0||u)){let e=Sc(o),t=u&&Sc(u.value);d=e!==null&&t!=null&&e<=t?`min(${c}, var(${gc(l)}))`:`min(${c}, max(var(${gc(l)}, ${o}), ${o}))`}return[[gc(r),d],[r,`var(${gc(r)})${s}`]]})}var vc=Object.entries(he).flatMap(([e,t])=>{let n=/^var\((--font-size-[a-z0-9]+)\)$/.exec(t)?.[1];return e.endsWith(`-size`)&&n!==void 0&&n in cc?[[e,n]]:[]});function yc(e){return/\d[a-z]/i.test(e)&&!/var\(|%|\d(?:em|ex|ch|ic|cap|lh)\b/i.test(e)}function bc(e){let t=new Map(_c(Object.fromEntries(e))),n=new Map(vc);return e.flatMap(([e,r])=>{let i=t.get(e);if(i!==void 0){let n=gc(e);return[[n,t.get(n)??``],[e,i]]}let[a,o]=xc(r),s=n.get(e);return[[e,s!==void 0&&yc(a)?`calc(${a} * var(${lc(cc[s])}, 1))${o}`:r]]})}function xc(e){let t=/\s*!\s*important\s*$/i.exec(e);return t?[e.slice(0,t.index),` !important`]:[e,``]}function Sc(e){let t=/^(-?\d*\.?\d+)(px|rem)$/.exec(e?.trim()??``);return t==null?null:Number(t[1])*(t[2]===`rem`?16:1)}function Cc(e){let t=wc.get(e);if(t==null){let n=Tc(e);if(n==null)return;t={holders:0,stop:n},wc.set(e,t)}t.holders+=1;let n=t,r=!1;return()=>{r||(r=!0,--n.holders,n.holders===0&&(wc.delete(e),n.stop()))}}var wc=new WeakMap;function Tc(e){let t=e.defaultView;if(t==null||typeof t.CSSStyleSheet!=`function`||!Array.isArray(e.adoptedStyleSheets))return;if(!t.CSS?.supports?.(`font`,`-apple-system-body`))return Ec(e,t);let n=e.createElement(`span`);n.setAttribute(`aria-hidden`,`true`),ac(n),n.style.cssText=`position:fixed;inset:0 auto auto 0;inline-size:1em;block-size:1em;visibility:hidden;pointer-events:none;font:-apple-system-body`,(e.body??e.documentElement).append(n);let r=new t.CSSStyleSheet;e.adoptedStyleSheets=[...e.adoptedStyleSheets,r];let i=rn(n,()=>r.replaceSync(fc(sc(Number.parseFloat(t.getComputedStyle(n).fontSize)))));return()=>{i(),n.remove(),e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==r)}}function Ec(e,t){if(e.querySelector(`meta[name="text-scale"][content="scale" i]`)!=null)return;let n=new t.CSSStyleSheet;return n.replaceSync(mc()),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n)}}var Dc=`[data-astryx-press="on"]`,Oc=`[data-astryx-pressable]`,kc=`:is(${Dc}, ${Dc} :where(:not(${Oc}, ${Dc} ${Oc} *)), :where(:not(${Oc})):has(${Dc}))`,Ac=`data-astryx-scheme`;function jc(e,t){t===null?e.removeAttribute(Ac):e.setAttribute(Ac,t)}function Mc(e){return`html[${Ac}="${e}"]`}var Nc=`html:not([${Ac}])`,Pc=`data-astryx-media-dark-page`;function Fc(e){return`[${Pc}="${e}"]`}function Ic(e,t,n,r){if(n===null||r===null)return null;let i=Ge(n,e),a=Ge(r,e);if(t!==null){let n=Ge(t,e);if(n>=i&&n>=a)return`off`}return i>=a?`dark`:`light`}var Lc=[`--color-background-inverted`,`--color-background-error-inverted`];function Rc(e,t){let n=ke(e[t]??``);if(n===null||n.a<1)return null;let r=Ic(n,null,ke(e[`--color-on-dark`]??``),ke(e[`--color-on-light`]??``));return r===`dark`||r===`light`?r:null}function zc(e){let t=new Set;for(let n of Lc){let r=Rc(e.light,n),i=Rc(e.dark,n);r!==null&&i!==null&&r!==i&&t.add(i)}return t}function Bc(e){return`[data-${E}-theme="${e}"]`}var Vc=`[data-${E}-theme]`;function Hc(e){let[t,n]=e.split(`@`),r=`[data-${E}-media="${t}"]`;if(n===void 0)return r;if(n.startsWith(`unflipped`)){let e=t===`dark`?`light`:`dark`;return`${r}:where(:not(${[...Uc(!1),...n===`unflipped-preference`?Uc(!0):[]].map(t=>`${t} ${Fc(e)}`).join(`, `)}))`}return Uc(n===`dark-page-preference`).map(e=>`:where(${e}) ${Fc(t)}`).join(`, `)}function Uc(e){let t=`:scope:not([${Pl}="light"], [${Pl}="dark"])`,n=`:is([${Pl}="light"], [${Pl}="dark"])`,r=`${t}:not(${n} *)`;return e?[`${r}:where(${Nc} *)`,`${n} ${t}`]:[`:scope[${Pl}="dark"]`,`${r}:where(${Mc(`dark`)} *)`]}function Wc(e){return e.split(`@`)[0]}function Gc(e,t){return`.${ee}-${e}${t}`}function Kc(e,t,n){let r=Gc(e,t);return n?`:is(${Hc(n)}) :is(${r})`:r}var qc=`:where(:not(:disabled,[aria-disabled="true"]))`;function Jc(e,t){let n=[],r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t];a===`(`?r++:a===`)`?r=Math.max(0,r-1):a===`,`&&r===0&&(n.push(e.slice(i,t).trim()),i=t+1)}n.push(e.slice(i).trim());let a=Qc(t);return n.map(e=>`${e}${a}`).join(`, `)}var Yc=`(pointer: coarse)`,Xc=/:active(?![-\w])/g;function Zc(e,t,n){if(!new RegExp(Xc.source).test(t))return[` ${Jc(e,t)} {\n${n}\n }`];let r=t.replace(Xc,kc);return[` @media not all and ${Yc} {\n ${Jc(e,t)} {\n${n}\n }\n }`,` @media ${Yc} {\n ${Jc(e,r)} {\n${n}\n }\n }`]}function Qc(e){if(!/^:hover(?![-\w])/.test(e)||e.includes(`[aria-disabled`))return e;let t=e.indexOf(`::`);return t===-1?e+qc:e.slice(0,t)+qc+e.slice(t)}function $c(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var el=new Set([`padding`,`paddingBlock`,`paddingInline`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInlineStart`,`paddingInlineEnd`]),tl={paddingTop:`paddingBlockStart`,paddingBottom:`paddingBlockEnd`},nl=new Set([...el,...Object.keys(tl)]),rl={borderTopLeftRadius:`top-left`,borderTopRightRadius:`top-right`,borderBottomRightRadius:`bottom-right`,borderBottomLeftRadius:`bottom-left`,borderStartStartRadius:`start-start`,borderStartEndRadius:`start-end`,borderEndStartRadius:`end-start`,borderEndEndRadius:`end-end`};function il(e){let t=0,n=-1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`(`)t++;else if(i===`)`)t--;else if(i===`/`&&t===0){if(n!==-1)return null;n=r}}let r=(n===-1?[e]:[e.slice(0,n),e.slice(n+1)]).map(e=>{let t=ln(e.trim());if(t.length<1||t.length>4)return null;let[n,r=n,i=n,a=r]=t;return[n,r,i,a]});if(r.some(e=>e==null))return null;let[i,a]=r;return i.map((e,t)=>a&&a[t]!==e?`${e} ${a[t]}`:e)}function al(e){let t={};for(let[n,r]of e)switch(tl[n]??n){case`padding`:{let e=ln(r);if(e.length===0)break;e.length===1?(t.blockStart=e[0],t.blockEnd=e[0],t.inline=e[0]):e.length===2?(t.blockStart=e[0],t.blockEnd=e[0],t.inline=e[1]):e.length>=3&&(t.blockStart=e[0],t.inline=e[1],t.blockEnd=e[2]);break}case`paddingBlock`:{let e=ln(r);if(e.length===0)break;t.blockStart=e[0],t.blockEnd=e[1]??e[0];break}case`paddingInline`:{let e=ln(r);if(e.length===0)break;e.length===1?t.inline=e[0]:(t.inlineStart=e[0],t.inlineEnd=e[1]);break}case`paddingBlockStart`:t.blockStart=r;break;case`paddingBlockEnd`:t.blockEnd=r;break;case`paddingInlineStart`:t.inlineStart=r;break;case`paddingInlineEnd`:t.inlineEnd=r}return t}function ol(e,t,n=!1){let r=f(`${e}-padding`),i=[],a=t.inlineStart??t.inline,o=t.inlineEnd??t.inline;if(a!=null&&o!=null&&a===o&&t.blockStart!=null&&t.blockEnd!=null&&a===t.blockStart&&t.blockStart===t.blockEnd?i.push([r,a??``]):(t.inlineStart!=null||t.inlineEnd!=null?(a!=null&&i.push([`${r}-inline-start`,a]),o!=null&&i.push([`${r}-inline-end`,o])):t.inline!=null&&i.push([`${r}-inline`,t.inline]),t.blockStart!=null&&i.push([`${r}-block-start`,t.blockStart]),t.blockEnd!=null&&i.push([`${r}-block-end`,t.blockEnd])),n){let e=new Set(i.map(([e])=>e)),t=e.has(r)?[`${r}-inline`,`${r}-inline-start`,`${r}-inline-end`,`${r}-block-start`,`${r}-block-end`]:e.has(`${r}-inline`)?[`${r}-inline-start`,`${r}-inline-end`]:[];for(let n of t)e.has(n)||i.push([n,`initial`])}return i}var sl=e=>{console.warn(`[astryx theme] ${e}`)};function cl(e){return e?t=>e.push(t):sl}function ll(e){let t=JSON.stringify(e);return t.length>80?`${t.slice(0,77)}..."`:t}function ul(e,t,n,r,i){e(`dropped "${t}" in ${r}: ${i} (value: ${ll(n)})`)}function dl(e,t,n,r){let i=Us(e)??Ps(t);return i===null||(ul(r,e,t,n,i),!1)}function fl(e,t,n,r=e=>e){let i=[];for(let[a,o]of e){if(o===void 0)continue;let e=Ks(o),s=r(a);dl(s,e,t,n)&&i.push(` ${s}: ${e};`)}return i.join(`
6
- `)}var pl=new Map(Ws),ml=/^--color-(?:info|success|warning|error|on-|background-surface|background-card)/;function hl(e){return!(`__adaptations`in e)&&!(`__adaptationRules`in e)?[]:Wl(e)}function gl(e,t){return Vs(Ks(e)).singleVarReference===t}function _l(e,t){let n=pl.get(e);return n!==void 0&&gl(t,n)?t:`inherit`}function vl(e,t,n,r){let i=n.map(()=>[]),a=Js(e,Object.fromEntries(r),t).values,o=$s(n).map(a=>({indexes:a,values:ec(e,t,r,n,a,i)}));for(let[r,s]of n.entries()){let n=Js(s.tokens,s.localTokens).values;if(Object.keys(n).some(e=>ml.test(e))){let o=new Map(ys({...e,...s.tokens},{...t,...s.localTokens}));for(let[e,t]of o)n[e]===void 0&&a[e]!==t&&i[r].push([e,t])}let c=new Map(i[r]),l={...n,...Object.fromEntries(c)};for(let[e,t]of Ws){let s=`var(${t})`,u=a[e];if(c.has(e)||n[e]!==void 0||l[t]===void 0&&!i[r].some(([e])=>e===t)||u!==void 0)continue;let d=o.filter(({indexes:e})=>e.includes(r));if(d.every(({values:t})=>t[e]!==void 0||!Ys(t,e,s))){i[r].push([e,s]);for(let{values:t}of d)t[e]===void 0&&(t[e]=s)}}}return i}function yl(e,t,n,r,i){let a=[],o=Js(t,Object.fromEntries(i),n).values,s=new Set(ys(t,n).map(([e])=>e)),c=Js(e).values,l=r.map(e=>new Map(nc(e.tokens))),u=$s(r).map(e=>({indexes:e,values:{...c}})),d=(e,t,n)=>{let r=Js({[e]:t});for(let t of n){let n=l[t].get(e);n!==void 0&&qs(r,{[e]:_l(e,n)})}return Ks(r.values[e])};for(let[e,t]of Ws){let n=`var(${t})`,r=o[e];if(c[e]!==void 0||c[t]===void 0&&!a.some(([e])=>e===t)||r!==void 0&&!gl(r,t)&&!s.has(e))continue;let i=u.map(({indexes:t,values:r})=>({values:r,candidate:d(e,n,t)}));if(i.every(({values:t,candidate:n})=>t[e]===n||!Ys(t,e,n))){a.push([e,n]);for(let{values:t,candidate:n}of i)t[e]=n}}let f=new Set(rs.filter(e=>c[`--color-${e}`]!==void 0&&c[`--color-on-${e}`]===void 0).map(e=>`--color-on-${e}`));if(f.size>0)for(let[r,i]of ys({...t,...e},n))f.has(r)&&o[r]!==i&&a.push([r,i]);return a}function bl(e,t,n,r=Object.entries(e.tokens)){let i=[fl(bc(r),`${t}tokens`,n),fl(Object.entries(e.localTokens??{}),`${t}localTokens`,n)].filter(e=>e.length>0).join(`
7
- `);return r.length>0||Object.keys(e.localTokens??{}).length>0?` :scope {\n${i}\n }`:null}function xl(e,t,n){return`${e}components.${t}[${JSON.stringify(n)}]`}var Sl=new WeakMap,Cl;function wl(e){return Object.entries(e??{}).map(([e,t])=>[e,typeof t,Ks(t)])}function Tl(e,t){return JSON.stringify([wl(e.tokens),wl(e.localTokens),t.map(e=>[e.query,e.when,wl(e.tokens),wl(e.localTokens),e.components])])}function El(e){let t=Wl(e),n=Tl(e,t),r=Sl.get(e);if(r?.signature===n)return r.context;let i={theme:e,rules:t,rootAliases:tc(e.tokens,e.localTokens,t)};return Sl.set(e,{signature:n,context:i}),i}function Dl(e){return Cl?.theme===e?Cl:El(e)}function Ol(e){return e.adaptationAliases??=vl(e.theme.tokens,e.theme.localTokens,e.rules,e.rootAliases),e.adaptationAliases}function kl(e,t){let n=[],r=cl(t),i=e=>`var(${e})`,a=Cl?.theme===e?Cl:void 0,o=a?.rules??hl(e),s=a?.rootAliases??tc(e.tokens,e.localTokens,o),c=bl(e,``,r,[...Object.entries(e.tokens),...s]);c!==null&&n.push(c),e.tokens[`--font-family-body`]&&n.push(` :scope {
8
- font-family: var(--font-family-body);
9
- }`);let l=Oe(e.components);return l&&Nl(l,n,{sink:r,darkPageSides:zc(fs({...e.localTokens,...e.tokens}))}),Rl(i,n),Bl(l||{},n),Hl(l||{},n),jl(l||{},n),n}var Al={normal:`var(--font-weight-normal)`,medium:`var(--font-weight-medium)`,semibold:`var(--font-weight-semibold)`,bold:`var(--font-weight-bold)`};function jl(e,t,{surface:n,inheritedComponents:r,forceAll:i=!1,authoredOnly:a=!1}={}){let o=e.heading,s=o&&typeof o==`object`&&!Array.isArray(o)?o:void 0;if(!s&&!i)return;let c=r?.heading,l=c&&typeof c==`object`?c:void 0;for(let[e,r]of Object.entries(Al)){let i=`weight:${e}`,o=s?Ml(s,i):void 0;if(a&&o===void 0)continue;let c=l?Ml(l,i):void 0,u=o??c??r,d=Kc(`heading`,zo(i),n);t.push(` ${d} { font-weight: ${u}; }`)}}function Ml(e,t){let n=e[t];if(typeof n!=`object`||!n||Array.isArray(n))return;let r=n.fontWeight;return typeof r==`string`&&Ps(r)===null?r:void 0}function Nl(e,t,{resetInheritedPaddingSpecificity:n=!1,surface:r,sink:i=sl,location:a=``,darkPageSides:o=new Set}={}){for(let[s,c]of Object.entries(e))for(let[e,l]of Object.entries(c)){let c=(e,a,l,u,d)=>{let f=[],p=[];for(let[t,n]of Object.entries(e)){if(typeof n==`object`&&n&&(t.startsWith(`:`)||d&&(t===`@light`||t===`@dark`))){p.push([t,n]);continue}let e=typeof n==`object`&&n?JSON.stringify(n):`${n}`;dl($c(t),e,l,i)&&f.push([t,e])}let m=Ll(s,f,n);if(m.length>0){let e=fl(m,l,i,$c);t.push(u(` ${a} {\n${e}\n }`))}for(let[e,r]of p){let o=e.startsWith(`:`)&&!e.includes(`::`)&&!/:(before|after|first-line|first-letter)(?![-\w])/i.test(e),c=`${l}[${JSON.stringify(e)}]`,d=[];if(o)for(let[e,t]of Object.entries(r)){if(t===void 0)continue;let n=Ks(t);dl($c(e),n,c,i)&&d.push([e,n])}let f=o?Ll(s,d,n):Object.entries(r);if(e.startsWith(`:`)&&f.length>0){let n=fl(f,c,i,$c);for(let r of Zc(a,e,n))t.push(u(r))}}if(d)for(let e of[`dark`,`light`]){let t=p.find(([t])=>t===`@${e}`)?.[1];if(!t)continue;let n=(n,r)=>c(t,n,`${l}[${JSON.stringify(`@${e}`)}]`,r,!1);if(r){Wc(r)===e&&n(a,u);continue}let i=e=>`:is(${a}):where(${e} *)`,s=`:where(:not(:scope [data-${E}-media] *))`;n(`${i(`:scope[${Pl}="${e}"]`)}${s}`,u);let d=`:scope:not([${Pl}="light"], [${Pl}="dark"])`,f=`:is([${Pl}="light"], [${Pl}="dark"])`,m=t=>u(` @media (prefers-color-scheme: ${e}) {\n${t}\n }`),h=`${i(`${d}:not(${f} *)`)}${s}`;n(`${h}:where(${Mc(e)} *)`,u),n(`${h}:where(${Nc} *)`,m),n(`${i(`${f} ${d}`)}${s}`,m);let g=`:is(${a}):where(${Il(e).join(`, `)})`,_=(e,t)=>Uc(t).flatMap(t=>Fl(`${t} ${Fc(e)}`,e)),v=e=>u(` @media (prefers-color-scheme: dark) {\n${e}\n }`),y=[...o].filter(t=>t!==e);if(y.length===0)n(g,u);else{let e=y.flatMap(e=>_(e,!1)),t=y.flatMap(e=>_(e,!0));n(`${g}:where(:not(${e.join(`, `)}))`,e=>u(` @media not all and (prefers-color-scheme: dark) {\n${e}\n }`)),n(`${g}:where(:not(${[...e,...t].join(`, `)}))`,v)}o.has(e)&&(n(`:is(${a}):where(${_(e,!1).join(`, `)})`,u),n(`:is(${a}):where(${_(e,!0).join(`, `)})`,v))}};c(l,Kc(s,zo(e),r),xl(a,s,e),e=>e,!0)}}var Pl=`data-theme`;function Fl(e,t){let n=t===`dark`?`light`:`dark`,r=`${Hc(n)} ${Hc(t)}`;return Array.from({length:2},(t,i)=>{let a=[e,...Array.from({length:i},()=>r)].join(` `);return`${a} *:not(${a} ${Hc(n)} *)`})}function Il(e){let t=e===`dark`?`light`:`dark`,n=(n,r)=>Array.from({length:n},(i,a)=>Hc((n-1-a)%2==0?r:r===e?t:e)).join(` `);return Array.from({length:4},(r,i)=>`:scope ${n(i+1,e)} *:not(:scope ${n(i+2,t)} *)`)}function Ll(e,t,n){let r=t,i=[],a=!1,o=new Set,s=new Map,c=Uo(e,`borderRadius`).filter(e=>e.corners).flatMap(e=>e.vars??[]);for(let[n,r]of t){if(c.length>0){if(n===`borderRadius`){let e=il(r);for(let t of c){for(let e of Object.values(rl))s.delete(`${t}-${e}`);if(e){Bo.forEach((n,r)=>{s.set(`${t}-${n}`,e[r])});for(let e of Vo)s.set(`${t}-${e}`,`initial`)}}}else if(n in rl)for(let e of c){let t=`${e}-${rl[n]}`;s.delete(t),s.set(t,r)}}let t=Uo(e,n),l=el.has(n)&&n!==`padding`?Uo(e,`padding`):[];for(let e of[...t,...l])if(e.expand===`container`&&el.has(n)&&(a=!0),e.replaces&&o.add(n),e.vars)for(let t of e.vars)i.push([t,r]);n in tl&&Uo(e,`padding`).some(e=>e.expand===`container`)&&(a=!0)}if(a){let i=t.filter(([e])=>nl.has(e)),a=t.filter(([e])=>!nl.has(e)),o=ol(e,al(i),n);r=[...a,...o]}return o.size>0&&(r=r.filter(([e])=>!o.has(e))),i.push(...s),i.length>0&&(r=[...r,...i]),r}function Rl(e,t){t.push(` :where(h1, h2, h3, h4, h5, h6) {
10
- font-family: var(--font-family-heading);
11
- color: var(--color-text-primary);
12
- }`);for(let n=1;n<=6;n++)t.push(` :where(h${n}) {
13
- font-size: ${e(`--text-heading-${n}-size`)};
14
- font-weight: ${e(`--text-heading-${n}-weight`)};
15
- line-height: ${e(`--text-heading-${n}-leading`)};
16
- }`);t.push(` :where(p) {
17
- font-family: var(--font-family-body);
18
- font-size: ${e(`--text-body-size`)};
19
- font-weight: ${e(`--text-body-weight`)};
20
- line-height: ${e(`--text-body-leading`)};
21
- color: var(--color-text-primary);
22
- }`),t.push(` :where(small) {
23
- font-size: ${e(`--text-supporting-size`)};
24
- font-weight: ${e(`--text-supporting-weight`)};
25
- line-height: ${e(`--text-supporting-leading`)};
26
- color: var(--color-text-secondary);
27
- }`),t.push(` :where(code, pre) {
28
- font-family: var(--font-family-code);
29
- font-size: ${e(`--text-code-size`)};
30
- line-height: ${e(`--text-code-leading`)};
31
- }`),t.push(` :where(hr) {
32
- border: none;
33
- border-top: 1px solid var(--color-border);
34
- }`)}var zl=new Set([`primary`,`secondary`,`accent`]);function Bl(e,t,n){let r={primary:`var(--color-text-primary)`,secondary:`var(--color-text-secondary)`,disabled:`var(--color-text-disabled)`,placeholder:`var(--color-text-secondary)`,accent:`var(--color-text-accent)`,inherit:`inherit`},i=`text`in e,a=`heading`in e,o=`link`in e;if(i||a||o){for(let[e,s]of Object.entries(r))if(i&&t.push(` ${Kc(`text`,zo(`color:${e}`),n)} { color: ${s}; }`),a&&t.push(` ${Kc(`heading`,zo(`color:${e}`),n)} { color: ${s}; }`),o){let r=Kc(`link`,zo(`color:${e}`),n);t.push(` ${r} { color: ${s}; }`),zl.has(e)&&t.push(` @media (hover: hover) {\n ${r}:where(:hover)${qc} { color: color-mix(in srgb, ${s}, var(--color-tint-hover) 15%); }\n }`)}}}var Vl={"4xs":`var(--font-size-4xs)`,"3xs":`var(--font-size-3xs)`,"2xs":`var(--font-size-2xs)`,xsm:`var(--font-size-xs)`,sm:`var(--font-size-sm)`,base:`var(--font-size-base)`,lg:`var(--font-size-lg)`,xl:`var(--font-size-xl)`,"2xl":`var(--font-size-2xl)`,"3xl":`var(--font-size-3xl)`,"4xl":`var(--font-size-4xl)`};function Hl(e,t,n){if(`text`in e)for(let[e,r]of Object.entries(Vl)){let i=zo(`size:${e}`);t.push(` ${Kc(`text`,i,n)} { font-size: ${r}; }`)}}function Ul(e,t){let n=kl(e,t),r=[],i=[];for(let e of n)e.trimStart().startsWith(`:where(`)?r.push(e):i.push(e);return{component:i,prose:r}}function Wl(e){let t=e.__adaptations===void 0?void 0:nt(e.name,e.__adaptations,void 0);return Array.isArray(e.__adaptationRules)?e.__adaptationRules:t===void 0?[]:Pe(e.name,t,e.__axes??{},e.tokens,e.localTokens,e.components)??[]}function Gl(e,t){let n=[],r=Bc(e.name),i=cl(t),{rules:a,rootAliases:o}=Dl(e),s=new Map,c=()=>{},l=(t,n)=>{let r=t.includes(`@`)&&!t.endsWith(`@unflipped`)?c:i,l=Wc(t),u=l===`dark`?e.__onDark:e.__onLight;if(!u)return;let d=l===`dark`?`onDark.`:`onLight.`,f=yl(u.tokens,e.tokens,e.localTokens,a,o);s.set(l,f);let p=[...Object.entries(u.tokens),...f];if(p.length>0){let e=fl(bc(p),`${d}tokens`,r);n.push(` ${Hc(t)} {\n${e}\n }`)}u.components&&(Nl(u.components,n,{resetInheritedPaddingSpecificity:!0,surface:t,sink:r,location:d}),Bl(u.components,n,t),Hl(u.components,n,t),jl(u.components,n,{surface:t,inheritedComponents:e.components}))},u=zc(fs({...e.localTokens,...e.tokens})),d=(t,n)=>{let r=t===`dark`?e.__onDark:e.__onLight,i=n===`dark`?e.__onDark:e.__onLight;return r?!i||r.components?!1:Object.keys(r.tokens).every(e=>e in i.tokens):!0};for(let e of[`dark`,`light`]){let t=e===`dark`?`light`:`dark`;if(!u.has(t)||d(e,t)){l(e,n);continue}let r=[];l(`${e}@unflipped`,r),r.length>0&&n.push(` @media not all and (prefers-color-scheme: dark) {\n${r.join(`
35
-
36
- `)}\n }`);let i=[];l(`${e}@unflipped-preference`,i),i.length>0&&n.push(` @media (prefers-color-scheme: dark) {\n${i.join(`
37
-
38
- `)}\n }`)}for(let e of u){l(`${e}@dark-page`,n);let t=[];l(`${e}@dark-page-preference`,t),t.length>0&&n.push(` @media (prefers-color-scheme: dark) {\n${t.join(`
39
-
40
- `)}\n }`)}let f=[];for(let[t,n]of a.entries()){let a=nc(n.tokens);if(a.length===0)continue;let o=[];for(let n of[`dark`,`light`]){if(!(n===`dark`?e.__onDark:e.__onLight))continue;let r=new Set((s.get(n)??[]).map(([e])=>e)),c=a.filter(([e])=>r.has(e)).map(([e,t])=>[e,_l(e,t)]);if(c.length===0)continue;let l=fl(c,`adaptations[${t}].on${n}.statusRoles.`,i);o.push(` ${Hc(n)} {\n${l}\n }`),u.has(n)&&o.push(` ${Hc(`${n}@dark-page`)} {\n${l}\n }`,` @media (prefers-color-scheme: dark) {\n ${Hc(`${n}@dark-page-preference`)} {\n${l}\n }\n }`)}o.length>0&&f.push(Jl(n.query,o,r))}if(n.length===0&&f.length===0)return``;let p=[];if(n.length>0){let e=n.join(`
41
-
42
- `);p.push(`@scope (${r}) to (${Vc}) {\n${e}\n}`)}return p.push(...f),p.join(`
43
-
44
- `)}function Kl(e,t,n,r,i){let a=[],o=bl(e,t,n,[...Object.entries(e.tokens),...r]);return o!==null&&a.push(o),e.components&&(Nl(e.components,a,{resetInheritedPaddingSpecificity:!0,sink:n,location:t,darkPageSides:i}),Bl(e.components,a),Hl(e.components,a)),a}function ql(e){let t=e?.heading;return typeof t==`object`&&!!t&&!Array.isArray(t)}function Jl(e,t,n){return`@media ${e} {\n @scope (${n}) to (${Vc}) {\n${t.map(Xl).join(`
45
-
46
- `)}\n }\n}`}function Yl(e,t){let n=cl(t),r=Dl(e),{rules:i}=r;if(i.length===0)return{prose:``,component:``};let a=Bc(e.name),o=[],s=i.some(e=>ql(e.components)),c=Ol(r),l=zc(fs({...e.localTokens,...e.tokens}));for(let[e,t]of i.entries()){let r=Kl(t,`adaptations[${e}].`,n,c[e],l);r.length!==0&&o.push(Jl(t.query,r,a))}for(let[e,t]of i.entries()){let r=nc(t.tokens);if(r.length===0)continue;let i=bl({tokens:{}},`adaptations[${e}].statusRoles.`,n,r);i!==null&&o.push(Jl(t.query,[i],a))}if(s){let t=[];jl(e.components??{},t,{forceAll:!0}),o.push(`@scope (${a}) to (${Vc}) {\n${t.join(`
47
-
48
- `)}\n}`);for(let e of i){let t=[];jl(e.components??{},t,{authoredOnly:!0}),t.length>0&&o.push(Jl(e.query,t,a))}}return{prose:``,component:o.join(`
49
-
50
- `)}}function Xl(e){return` ${e}`}function Zl(e,t){if(Cl?.theme===e)return Ql(e,t);let n=Cl;Cl=El(e);try{return Ql(e,t)}finally{Cl=n}}function Ql(e,t){let{component:n,prose:r}=Ul(e,t),i=Bc(e.name),a=Vc,o=``;r.length>0&&(o=`@scope (${i}) to (${a}) {\n${r.join(`
51
-
52
- `)}\n}`);let s=``;n.length>0&&(s=`@scope (${i}) to (${a}) {\n${n.join(`
53
-
54
- `)}\n}`);let c=Yl(e,t);c.component&&(s=s?`${s}\n\n${c.component}`:c.component);let l=Gl(e,t);return l&&(s=s?`${s}\n\n${l}`:l),{prose:o,component:s}}function $l(e){let t=e.trim();if(!t.startsWith(`light-dark(`)||!t.endsWith(`)`))return null;let n=t.slice(11,-1);return an(n)}function eu(e,t){if(Array.isArray(e))return t===`dark`?e[1]:e[0];let n=$l(e);return n===null?e:t===`dark`?n[1]:n[0]}function tu(e){let t=e.trim(),n=t.match(/\s+([\d.]+)%$/);return n?{color:t.slice(0,n.index).trim(),percentage:parseFloat(n[1])}:{color:t,percentage:null}}function nu(e){let t=e.match(/^in\s+([\w-]+)\s*,\s*(.+)$/s);if(!t)return null;let[,n,r]=t;if(n.toLowerCase()!==`srgb`)return null;let i=an(r);if(i===null)return null;let a=tu(i[0]),o=tu(i[1]);if(a===null||o===null)return null;let s=ke(a.color),c=ke(o.color);if(s===null||c===null)return null;let l,u;a.percentage!==null&&o.percentage!==null?(l=a.percentage,u=o.percentage):a.percentage===null?o.percentage===null?(l=50,u=50):(u=o.percentage,l=100-u):(l=a.percentage,u=100-l);let d=l+u;if(d<=0)return null;let f=l/d,p=u/d,m=d<100?d/100:1,h=f*s.a+p*c.a,g=(e,t)=>f*e*s.a+p*t*c.a,_=g(s.r,c.r),v=g(s.g,c.g),y=g(s.b,c.b),b=h===0?{r:0,g:0,b:0}:{r:_/h,g:v/h,b:y/h};return Ce({...b,a:h*m})}function ru(e){let t=e.indexOf(`color-mix(`);if(t===-1)return e;let n=t+9,r=$t(e,n);if(r===-1)return e;let i=ru(e.slice(n+1,r)),a=nu(i)??`color-mix(${i})`;return e.slice(0,t)+a+ru(e.slice(r+1))}function iu(e){let t={};for(let[n,r]of Object.entries(wo))t[n]=eu(r,e);return Gt(t,ru)}function au(e){return`var(${e})`}Object.fromEntries(Object.keys(wo).map(e=>[e,au(e)]));function ou(e,t){let{mode:n}=t,r={};if(e==null)return iu(n);for(let[e,t]of Object.entries(wo))r[e]=eu(t,n);let i=new Set(Object.keys(e.localTokens??{}));for(let[t,i]of Object.entries(e.localTokens??{}))r[t]=eu(i,n);for(let[t,i]of tc(e.tokens,e.localTokens??{}))r[t]=eu(i,n);for(let[t,i]of Object.entries(e.tokens))r[t]=eu(i,n);if(e.__inputTokens)for(let[t,i]of Object.entries(e.__inputTokens))i!==void 0&&(r[t]=eu(i,n));return Object.fromEntries(Object.entries(Gt(r,ru)).filter(([e])=>!i.has(e)))}var Q=i(),su={base:{k1xSpc:`xjp7ctv`,kMwMTN:`x1tgivj0`,kMv6JI:`x9ynric`,kGuDYH:`xjm74w1`,kLWn49:`xw6l6zx`,$$css:!0},light:{kQNsl9:`x19aimcq`,$$css:!0},dark:{kQNsl9:`xntwwlm`,$$css:!0},system:{kQNsl9:`x108lcm5`,$$css:!0},reducedMotion:{"--_astryx-reduced-motion":`x1e3mt4b`,$$css:!0}},cu=dn(`ThemeNestingContext`,1,!1);cu.displayName=`ThemeNestingContext`;var lu=new Map,uu=`@layer reset, astryx-base, astryx-theme;`;function du(e,t){let{prose:n,component:r}=Zl(e),i=[];if(n){let r=document.createElement(`style`);r.setAttribute(d(`theme-prose`),e.name),r.setAttribute(d(`id`),t),r.textContent=`${uu}\n@layer reset {\n${n}\n}`,document.head.appendChild(r),i.push(r)}if(r){let n=document.createElement(`style`);n.setAttribute(d(`theme`),e.name),n.setAttribute(d(`id`),t),n.textContent=`${uu}\n@layer astryx-theme {\n${r}\n}`,document.head.appendChild(n),i.push(n)}return i}function fu(e,t,n){for(let t of e.styles)t.remove();e.theme=t,e.styles=du(t,n)}function pu(e){let t=(0,Z.useId)(),[n]=(0,Z.useState)(()=>({}));(0,Z.useInsertionEffect)(()=>{if(e==null||e.__built)return;let r=`astryx-theme-${e.name}`,i=lu.get(r);i??(`${e.name}`,`${e.name}`,i={users:new Map,owner:n,formerOwner:null,theme:e,styles:du(e,t)},lu.set(r,i)),i.users.set(n,{theme:e,id:t}),i.formerOwner===n&&(i.owner=n,i.formerOwner=null,i.theme!==e&&fu(i,e,t));let a=i;return()=>{if(a.users.delete(n),a.users.size===0){for(let e of a.styles)e.remove();lu.delete(r);return}if(a.owner!==n)return;let[e,t]=[...a.users][0];a.owner=e,a.formerOwner=n,t.theme!==a.theme&&fu(a,t.theme,t.id)}},[e,t,n])}function mu(e,t,n,r,i){G(()=>{if(!e&&typeof document<`u`)return t===`light`||t===`dark`?document.documentElement.setAttribute(`data-theme`,t):document.documentElement.removeAttribute(`data-theme`),n==null?document.documentElement.removeAttribute(d(`theme`)):document.documentElement.setAttribute(d(`theme`),n),jc(document.documentElement,i),gn(document.documentElement,r),r?document.documentElement.style.setProperty(Ae,`1`):document.documentElement.style.removeProperty(Ae),()=>{document.documentElement.removeAttribute(`data-theme`),document.documentElement.removeAttribute(d(`theme`)),jc(document.documentElement,null),gn(document.documentElement,!1),document.documentElement.style.removeProperty(Ae)}},[e,t,n,r,i])}function hu(e){G(()=>{if(!(e||typeof document>`u`))return Cc(document)},[e])}var gu=new Set([`light`,`dark`,`system`]);function _u(e){let t=typeof e==`string`?`the string "${e}"`:e===null?`null`:typeof e==`object`?`an object that defineTheme() did not make`:`a value of type ${typeof e}`,n=typeof e==`string`&&gu.has(e)?`To set the color mode, use mode="${e}".`:`Pass a theme from defineTheme() or a theme package.`;`${typeof e==`string`?e:e===null?`null`:typeof e}`,`${t}${n}`}function vu({theme:e,mode:t=`system`,children:n}){let r=(0,Z.use)(cu),i=(0,Z.use)(lt),a=(0,Z.use)(vt),o=a?.mode,s=o===`light`||o===`dark`,c=(0,Z.use)(Dt),l=s?`preference`:c,u=Lo(e)?e:null,d=u??i?.theme??null;(0,Z.useEffect)(()=>{u??_u(e)},[u,e]),u!=null&&jt(u),pu(u);let f=Me(d?.__axes?.motion).reducedMotion===`always`,p=t===`light`||t===`dark`,m=ft(!r&&!p);mu(r,t,d?.name??null,f,p?t:m),hu(r);let h=t===`dark`?su.dark:t===`light`?su.light:s?su.system:null,g=(0,Z.useMemo)(()=>d==null?null:{theme:d,mode:t},[d,t]),_=d==null&&(a?.themeless??!r),v=(0,Z.useMemo)(()=>({mode:t,themeless:_}),[t,_]),[y]=(0,Z.useState)(()=>yt(g));G(()=>{y.set(g)},[y,g]);let b=(0,Q.jsx)(cu,{value:!0,children:(0,Q.jsx)(`div`,{...J(su.base,h,f&&su.reducedMotion),"data-astryx-theme":d?.name,...En(f),"data-theme":t===`system`?void 0:t,children:n})});return(0,Q.jsx)(Dt,{value:l,children:(0,Q.jsx)(vt,{value:v,children:(0,Q.jsx)(lt,{value:g,children:(0,Q.jsx)(_t,{value:y,children:b})})})})}vu.displayName=`Theme`;function yu(e){let t;if(e.then(e=>(t=e,e),Kr)?.catch?.(Kr),t!==void 0)return{data:t}}function bu(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function xu(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(Kr),r}function Su(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:xu(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function Cu(e){return e.state.isPaused}function wu(e){return e.state.status===`success`}function Tu(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??Cu,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[bu(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??wu,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[Su(e,o,a)]:[])}}function Eu(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?yu(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l,...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l}});c&&!d&&!h&&!g&&l>m.state.dataUpdatedAt&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(Kr)})}var Du=class extends Zn{#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 Qn({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=Ou(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=Ou(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=Ou(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=Ou(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ar.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ln(t,e))}findAll(e={}){return this.getAll().filter(t=>Ln(e,t))}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ar.batch(()=>Promise.all(e.map(e=>e.continue().catch(Kr))))}};function Ou(e){return e.options.scope?.id}var ku=class extends Zn{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??sr(r,t),a=this.get(i);return a||(a=new si({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(){ar.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=>Un(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Un(e,t)):t}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ar.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ar.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Au=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ku,this.#t=e.mutationCache||new Du,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=pr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mn.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(dr(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=Rn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ar.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;ar.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ar.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=ar.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return ar.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=ar.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(Kr)),r?Promise.resolve():t}));return Promise.all(r).then(Kr)}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(dr(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(dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}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(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Mn.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(rr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Vn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(rr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Vn(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||=sr(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===lr&&(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()}},ju=n((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}}}})),Mu=n(((e,t)=>{t.exports=ju()})),Nu=n((e=>{var t=Mu(),n=r(),i=Yt();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`),ee=Symbol.for(`react.consumer`),M=Symbol.for(`react.context`),N=Symbol.for(`react.forward_ref`),P=Symbol.for(`react.suspense`),F=Symbol.for(`react.suspense_list`),I=Symbol.for(`react.memo`),L=Symbol.for(`react.lazy`),R=Symbol.for(`react.activity`),z=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),B=Symbol.for(`react.view_transition`),ne=Symbol.for(`react.recoverable`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var V=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===V?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 P:return`Suspense`;case F:return`SuspenseList`;case R:return`Activity`;case B:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case M:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case N: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?ae(e.type)||`Memo`:t;case L:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var H=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},G=[],K=-1;function se(e){return{current:e}}function q(e){0>K||(e.current=G[K],G[K]=null,K--)}function ce(e,t){K++,G[K]=e.current,e.current=t}var le=se(null),ue=se(null),de=se(null),fe=se(null);function J(e,t){switch(ce(de,t),ce(ue,e),ce(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}q(le),ce(le,e)}function pe(){q(le),q(ue),q(de)}function me(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,ce(fe,e)),t=le.current;var n=fp(t,e.type);t!==n&&(ce(ue,e),ce(le,n))}function he(e){ue.current===e&&(q(le),q(ue)),fe.current===e&&(q(fe),ch._currentValue=oe)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
55
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
56
- `+ge+e+_e}var Y=!1;function ye(e,t){if(!e||Y)return``;Y=!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(`
57
- `),l=s.split(`
58
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
59
- `+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{Y=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return ve(`Activity`);case 30:return ve(`ViewTransition`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
60
- Error generating stack: `+e.message+`
61
- `+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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 qe(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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-ze(n),i=1<<r;t|=e[r],n&=~i}return t}function Xe(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 Ze(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(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-ze(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&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=W.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function st(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct,_t=`__reactLoad$`+ct;function vt(e){delete e[lt],delete e[ut],delete e[pt],delete e[mt]}function yt(e){var t;if(t=e[lt])return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[lt])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function St(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[gt]=!0}function wt(e){e[_t]=void 0}var Tt=new Set,Et={};function Dt(e,t){Ot(e,t),Ot(e+`Capture`,t)}function Ot(e,t){for(Et[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var kt=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]*$`),At={},jt={};function Mt(e){return Se.call(jt,e)?!0:Se.call(At,e)?!1:kt.test(e)?jt[e]=!0:(At[e]=!0,!1)}var Nt=!1;function Pt(){var e=Nt;return Nt=!1,e}function Ft(e,t,n){if(Mt(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 It(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 Lt(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 Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(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 Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Ut=/[\n"\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(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=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,Rt(n)):o===`number`&&e.value==t?qt(e,Rt(e.value)):qt(e,Rt(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=``+Rt(s):e.removeAttribute(`name`)}function Kt(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)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(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),Vt(e)}function qt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function Jt(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=``+Rt(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 Xt(e,t,n){t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Rt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(H(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=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 en(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||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(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]=``,Nt=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(en(e,i,r),Nt=!0)}else for(var o in t)t.hasOwnProperty(o)&&en(e,o,t[o])}function nn(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 rn=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`]]),an=/^[\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 on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var un=null,dn=null;function fn(e){var t=bt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(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="`+Wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ut]||null;if(!i)throw Error(a(90));Gt(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&&Ht(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var pn=!1;function mn(e,t,n){if(pn)return e(t,n);pn=!0;try{return e(t)}finally{if(pn=!1,(un!==null||dn!==null)&&(Ld(),un&&(t=un,e=dn,dn=un=null,fn(t),e)))for(t=0;t<e.length;t++)fn(e[t])}}function hn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||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 gn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.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 xn=i.slice(e,1<r?1-r:void 0)}function Cn(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 wn(){return!0}function Tn(){return!1}function En(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)?wn:Tn,this.isPropagationStopped=Tn,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=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=T({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=T({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,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!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(T({},Pn,{dataTransfer:0})),Ln=En(T({},kn,{relatedTarget:0})),Rn=En(T({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(T({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(T({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(T({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(T({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(T({},Dn,{submitter:0})),Yn=En(T({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Xn=En(T({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Zn=En(T({},Pn,{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})),Qn=En(T({},Dn,{newState:0,oldState:0,source:0})),$n=[9,13,27,32],er=gn&&`CompositionEvent`in window,tr=null;gn&&`documentMode`in document&&(tr=document.documentMode);var nr=gn&&`TextEvent`in window&&!tr,rr=gn&&(!er||tr&&8<tr&&11>=tr),ir=` `,ar=!1;function or(e,t){switch(e){case`keyup`:return $n.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var cr=!1;function lr(e,t){switch(e){case`compositionend`:return sr(t);case`keypress`:return t.which===32?(ar=!0,ir):null;case`textInput`:return e=t.data,e===ir&&ar?null:e;default:return null}}function ur(e,t){if(cr)return e===`compositionend`||!er&&or(e,t)?(e=Sn(),xn=bn=yn=null,cr=!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 rr&&t.locale!==`ko`?null:t.data;default:return null}}var dr={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 fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!dr[e.type]:t===`textarea`}function pr(e,t,n,r){un?dn?dn.push(r):dn=[r]:un=r,t=Jf(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var mr=null,hr=null;function gr(e){Bf(e,0)}function _r(e){if(Ht(xt(e)))return e}function vr(e,t){if(e===`change`)return t}var yr=!1;if(gn){var br;if(gn){var xr=`oninput`in document;if(!xr){var Sr=document.createElement(`div`);Sr.setAttribute(`oninput`,`return;`),xr=typeof Sr.oninput==`function`}br=xr}else br=!1;yr=br&&(!document.documentMode||9<document.documentMode)}function Cr(){mr&&(mr.detachEvent(`onpropertychange`,wr),hr=mr=null)}function wr(e){if(e.propertyName===`value`&&_r(hr)){var t=[];pr(t,hr,e,ln(e)),mn(gr,t)}}function Tr(e,t,n){e===`focusin`?(Cr(),mr=t,hr=n,mr.attachEvent(`onpropertychange`,wr)):e===`focusout`&&Cr()}function Er(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return _r(hr)}function Dr(e,t){if(e===`click`)return _r(t)}function Or(e,t){if(e===`input`||e===`change`)return _r(t)}function kr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ar=typeof Object.is==`function`?Object.is:kr;function jr(e,t){if(Ar(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(!Se.call(t,i)||!Ar(e[i],t[i]))return!1}return!0}function Mr(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 Nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=Nr(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=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mr(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=Mr(e.document)}return t}function Lr(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 Rr=gn&&`documentMode`in document&&11>=document.documentMode,zr=null,Br=null,Vr=null,Hr=!1;function Ur(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zr==null||zr!==Mr(r)||(r=zr,`selectionStart`in r&&Lr(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}),Vr&&jr(Vr,r)||(Vr=r,r=Jf(Br,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function Wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Gr={animationend:Wr(`Animation`,`AnimationEnd`),animationiteration:Wr(`Animation`,`AnimationIteration`),animationstart:Wr(`Animation`,`AnimationStart`),transitionrun:Wr(`Transition`,`TransitionRun`),transitionstart:Wr(`Transition`,`TransitionStart`),transitioncancel:Wr(`Transition`,`TransitionCancel`),transitionend:Wr(`Transition`,`TransitionEnd`)},Kr={},qr={};gn&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),`TransitionEvent`in window||delete Gr.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!Gr[e])return e;var t=Gr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`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(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),Dt(t,[e])}var ai=0;function oi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=ai++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;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 ci(e,t){return e=si(e),t=si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var li=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)},ui=[],di=0,fi=0;function pi(){for(var e=di,t=fi=di=0;t<e;){var n=ui[t];ui[t++]=null;var r=ui[t];ui[t++]=null;var i=ui[t];ui[t++]=null;var a=ui[t];if(ui[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&&_i(n,i,a)}}function mi(e,t,n,r){ui[di++]=e,ui[di++]=t,ui[di++]=n,ui[di++]=r,fi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function hi(e,t,n,r){return mi(e,t,n,r),vi(e)}function gi(e,t){return mi(e,null,null,t),vi(e)}function _i(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-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function vi(e){if(50<Dd)throw Dd=0,Od=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var yi={};function bi(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 xi(e,t,n,r){return new bi(e,t,n,r)}function Si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,t){var n=e.alternate;return n===null?(n=xi(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 wi(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 Ti(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Si(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,le.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case R:return e=xi(31,n,t,i),e.elementType=R,e.lanes=o,e;case k:return Ei(n.children,i,o,t);case A:s=8,i|=24;break;case j:return e=xi(12,n,t,i|2),e.elementType=j,e.lanes=o,e;case P:return e=xi(13,n,t,i),e.elementType=P,e.lanes=o,e;case F:return e=xi(19,n,t,i),e.elementType=F,e.lanes=o,e;case z:case B:return e=i|32,e=xi(30,n,t,e),e.elementType=B,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case ee:s=9;break a;case N: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=xi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Ei(e,t,n,r){return e=xi(7,e,r,t),e.lanes=n,e}function Di(e,t,n){return e=xi(6,e,null,t),e.lanes=n,e}function Oi(e){var t=xi(18,null,null,0);return t.stateNode=e,t}function ki(e,t,n){return t=xi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ai=new WeakMap;function ji(e,t){if(typeof e==`object`&&e){var n=Ai.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},Ai.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var Mi=[],Ni=0,Pi=null,Fi=0,Ii=[],Li=0,Ri=null,zi=1,Bi=``;function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Pi,Pi=e,Fi=t}function Hi(e,t,n){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,Ri=e;var r=zi;e=Bi;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,zi=1<<32-ze(t)+i|n<<i|r,Bi=a+e}else zi=1<<a|n<<i|r,Bi=e}function Ui(e){e.return!==null&&(Vi(e,1),Hi(e,1,0))}function Wi(e){for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null;for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,Bi=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null}function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Bi,Ii[Li++]=Ri,zi=t.id,Bi=t.overflow,Ri=e}var Ki=null,qi=null,Ji=!1,Yi=null,Xi=!1,Zi=Error(a(519));function Qi(e){throw ia(ji(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Zi}function $i(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:Vf(`cancel`,t),Vf(`close`,t);break;case`iframe`:case`object`:case`embed`:Vf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)Vf(Rf[n],t);break;case`source`:Vf(`error`,t);break;case`img`:case`image`:case`link`:Vf(`error`,t),Vf(`load`,t);break;case`details`:Vf(`toggle`,t);break;case`input`:Vf(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Vf(`invalid`,t);break;case`textarea`:Vf(`invalid`,t),Zt(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||ep(t.textContent,n)?(r.popover!=null&&(Vf(`beforetoggle`,t),Vf(`toggle`,t)),r.onScroll!=null&&Vf(`scroll`,t),r.onScrollEnd!=null&&Vf(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Qi(e,!0)}function ea(e){for(Ki=e.return;Ki;)switch(Ki.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:Ki=Ki.return}}function ta(e){if(e!==Ki)return!1;if(!Ji)return ea(e),Ji=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&qi&&Qi(e),ea(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));qi=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));qi=fm(e)}else t===27?(t=qi,Cp(e.type)?(e=dm,dm=null,qi=e):qi=t):qi=Ki?um(e.stateNode.nextSibling):null;return!0}function na(){qi=Ki=null,Ji=!1}function ra(){var e=Yi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Yi=null),e}function ia(e){Yi===null?Yi=[e]:Yi.push(e)}var aa=se(null),oa=null,sa=null;function X(e,t,n){ce(aa,t._currentValue),t._currentValue=n}function ca(e){e._currentValue=aa.current,q(aa)}function la(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 ua(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),la(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),la(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),la(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 da(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;Ar(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===fe.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}i=i.return}return e!==null&&ua(t,e,n,r),t.flags|=262144,e!==null}function fa(e){for(e=e.firstContext;e!==null;){if(!Ar(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pa(e){oa=e,sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ma(e){return ga(oa,e)}function ha(e,t){return oa===null&&pa(e),ga(e,t)}function ga(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sa===null){if(e===null)throw Error(a(308));sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sa=sa.next=t;return n}var _a=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()})}},va=t.unstable_scheduleCallback,ya=t.unstable_NormalPriority,ba={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xa(){return{controller:new _a,data:new Map,refCount:0}}function Sa(e){e.refCount--,e.refCount===0&&va(ya,function(){e.controller.abort()})}function Ca(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 wa=null;function Ta(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ea=null,Da=0,Oa=0,ka=null;function Aa(e,t){if(Ea===null){var n=Ea=[];Da=0,Oa=Nf(),ka={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Da++,t.then(ja,ja),t}function ja(){if(--Da===0&&(wa=null,Ea!==null)){ka!==null&&(ka.status=`fulfilled`);var e=Ea;Ea=null,Oa=0,ka=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ma(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 Na=U.S;U.S=function(e,t){if(pd=De(),typeof t==`object`&&t&&typeof t.then==`function`&&Aa(e,t),wa!==null)for(var n=yf;n!==null;)Ca(n,wa),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Ca(r,n),r=r.next;if(Oa!==0){r=wa,r===null&&(r=wa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Na!==null&&Na(e,t)};var Pa=se(null);function Fa(){var e=Pa.current;return e===null?Ju.pooledCache:e}function Ia(e,t){t===null?ce(Pa,Pa.current):ce(Pa,t.pool)}function La(){var e=Fa();return e===null?null:{parent:ba._currentValue,pool:e}}var Ra=Error(a(460)),za=Error(a(474)),Ba=Error(a(542)),Va={then:function(){}};function Ha(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ua(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,qa(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=Ju,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,qa(e),e}throw Ga=t,Ra}}function Wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ga=e,Ra):e}}var Ga=null;function Ka(){if(Ga===null)throw Error(a(459));var e=Ga;return Ga=null,e}function qa(e){if(e===Ra||e===Ba)throw Error(a(483))}var Ja=null,Ya=0;function Xa(e){var t=Ya;return Ya+=1,Ja===null&&(Ja=[]),Ua(Ja,e,t)}function Za(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Qa(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 $a(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=Ci(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=Di(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),Za(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===L&&Wa(a)===t.type)?(t=i(t,n.props),Za(t,n),t.return=e,t):(t=Ti(n.type,n.key,n.props,null,e.mode,r),Za(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=ki(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=Ei(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=Di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ti(t.type,t.key,t.props,null,e.mode,n),Za(n,t),n.return=e,n;case O:return t=ki(t,e.mode,n),t.return=e,t;case L:return t=Wa(t),f(e,t,n)}if(H(t)||ie(t))return t=Ei(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Xa(t),n);if(t.$$typeof===M)return f(e,ha(e,t),n);Qa(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=Wa(n),p(e,t,n,r)}if(H(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Xa(n),r);if(n.$$typeof===M)return p(e,t,ha(e,n),r);Qa(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=Wa(r),m(e,t,n,r,i)}if(H(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Xa(r),i);if(r.$$typeof===M)return m(e,t,n,ha(t,r),i);Qa(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),Ji&&Vi(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 Ji&&Vi(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)}),Ji&&Vi(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),Ji&&Vi(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 Ji&&Vi(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)}),Ji&&Vi(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),Za(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===L&&Wa(l)===r.type){n(e,r.sibling),c=i(r,o.props),Za(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ei(o.props.children,e.mode,c,o.key),Za(c,o),c.return=e,e=c):(c=Ti(o.type,o.key,o.props,null,e.mode,c),Za(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=ki(o,e.mode,c),c.return=e,e=c}return s(e);case L:return o=Wa(o),_(e,r,o,c)}if(H(o))return h(e,r,o,c);if(ie(o)){if(l=ie(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,Xa(o),c);if(o.$$typeof===M)return _(e,r,ha(e,o),c);Qa(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=Di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ya=0;var i=_(e,t,n,r);return Ja=null,i}catch(t){if(t===Ra||t===Ba)throw t;var a=xi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var eo=$a(!0),to=$a(!1),no=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function io(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 ao(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=vi(e),_i(e,null,n),t}return mi(e,r,t,n),vi(e)}function so(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,nt(e,n)}}function co(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 lo=!1;function uo(){if(lo){var e=ka;if(e!==null)throw e}}function fo(e,t,n,r){lo=!1;var i=e.updateQueue;no=!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?(Xu&f)===f:(r&f)===f){f!==0&&f===Oa&&(lo=!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:no=!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),id|=o,e.lanes=o,e.memoizedState=d}}function po(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function mo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)po(n[e],t)}var ho=se(null),go=se(0);function Z(e,t){e=nd,ce(go,e),ce(ho,t),nd=e|t.baseLanes}function _o(){ce(go,nd),ce(ho,ho.current)}function vo(){nd=go.current,q(ho),q(go)}var yo=se(null),bo=null;function xo(e){var t=e.alternate;ce(Eo,Eo.current&1),ce(yo,e),bo===null&&(t===null||ho.current!==null||t.memoizedState!==null)&&(bo=e)}function So(e){ce(Eo,Eo.current),ce(yo,e),bo===null&&(bo=e)}function Co(e){e.tag===22?(ce(Eo,Eo.current),ce(yo,e),bo===null&&(bo=e)):wo()}function wo(){ce(Eo,Eo.current),ce(yo,yo.current)}function To(e){q(yo),bo===e&&(bo=null),q(Eo)}var Eo=se(0);function Do(e,t){ce(yo,yo.current),ce(Eo,t)}function Oo(e){q(Eo),q(yo),bo===e&&(bo=null)}function ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(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 Ao=0,jo=null,Mo=null,No=null,Po=!1,Fo=!1,Io=!1,Lo=0,Ro=0,zo=null,Bo=0;function Vo(){throw Error(a(321))}function Ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ar(e[n],t[n]))return!1;return!0}function Uo(e,t,n,r,i,a){return Ao=a,jo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?oc:sc,Io=!1,a=n(r,i),Io=!1,Fo&&(a=Go(t,n,r,i)),Wo(e),a}function Wo(e){U.H=ac;var t=Mo!==null&&Mo.next!==null;if(Ao=0,No=Mo=jo=null,Po=!1,Ro=0,zo=null,t)throw Error(a(300));e===null||wc||(e=e.dependencies,e!==null&&fa(e)&&(wc=!0))}function Go(e,t,n,r){jo=e;var i=0;do{if(Fo&&(zo=null),Ro=0,Fo=!1,25<=i)throw Error(a(301));if(i+=1,No=Mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=cc,o=t(n,r)}while(Fo);return o}function Ko(){var e=U.H,t=e.useState()[0];return t=typeof t.then==`function`?$o(t):t,e=e.useState()[0],(Mo===null?null:Mo.memoizedState)!==e&&(jo.flags|=1024),t}function qo(){var e=Lo!==0;return Lo=0,e}function Jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Yo(e){if(Po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Po=!1}Ao=0,No=Mo=jo=null,Fo=!1,Ro=Lo=0,zo=null}function Xo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return No===null?jo.memoizedState=No=e:No=No.next=e,No}function Zo(){if(Mo===null){var e=jo.alternate;e=e===null?null:e.memoizedState}else e=Mo.next;var t=No===null?jo.memoizedState:No.next;if(t!==null)No=t,Mo=e;else{if(e===null)throw jo.alternate===null?Error(a(467)):Error(a(310));Mo=e,e={memoizedState:Mo.memoizedState,baseState:Mo.baseState,baseQueue:Mo.baseQueue,queue:Mo.queue,next:null},No===null?jo.memoizedState=No=e:No=No.next=e}return No}function Qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $o(e){var t=Ro;return Ro+=1,zo===null&&(zo=[]),e=Ua(zo,e,t),t=jo,(No===null?t.memoizedState:No.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?oc:sc),e}function es(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return $o(e);if(e.$$typeof===ne)return;if(e.$$typeof===M)return ma(e)}throw Error(a(438,String(e)))}function ts(e){var t=null,n=jo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=jo.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=Qo(),jo.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]=te;return t.index++,n}function ns(e,t){return typeof t==`function`?t(e):t}function rs(e){return is(Zo(),Mo,e)}function is(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?(Ao&f)===f:(Xu&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===Oa&&(d=!0);else if((Ao&p)===p){u=u.next,p===Oa&&(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,jo.lanes|=p,id|=p;f=u.action,Io&&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,jo.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ar(o,e.memoizedState)&&(wc=!0,d&&(n=ka,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 as(e){var t=Zo(),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);Ar(o,t.memoizedState)||(wc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function os(e,t,n){var r=jo,i=Zo(),o=Ji;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Ar((Mo||i).memoizedState,n);if(s&&(i.memoizedState=n,wc=!0),i=i.queue,js(ls.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||No!==null&&!!(No.memoizedState.tag&1),Es(e?9:8,{destroy:void 0},cs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Ju===null)throw Error(a(349));o||Ao&127||ss(r,t,n)}return n}function ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jo.updateQueue,t===null?(t=Qo(),jo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cs(e,t,n,r){t.value=n,t.getSnapshot=r,us(t)&&ds(e)}function ls(e,t,n){return n(function(){us(t)&&ds(e)})}function us(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ar(e,n)}catch{return!0}}function ds(e){var t=gi(e,2);t!==null&&Md(t,e,2)}function fs(e){var t=Xo();if(typeof e==`function`){var n=e;if(e=n(),Io){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:e},t}function ps(e,t,n,r){return e.baseState=n,is(e,Mo,typeof r==`function`?r:ns)}function ms(e,t,n,r,i){if(nc(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)}};U.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,hs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function hs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=U.T,o={};o.types=a===null?null:a.types,U.T=o;try{var s=n(i,r),c=U.S;c!==null&&c(o,s),gs(e,t,s)}catch(n){vs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),U.T=a}}else try{a=n(i,r),gs(e,t,a)}catch(n){vs(e,t,n)}}function gs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){_s(e,t,n)},function(n){return vs(e,t,n)}):_s(e,t,n)}function _s(e,t,n){t.status=`fulfilled`,t.value=n,ys(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,hs(e,n)))}function vs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ys(t),t=t.next;while(t!==r)}e.action=null}function ys(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bs(e,t){return t}function xs(e,t){if(Ji){var n=Ju.formState;if(n!==null){a:{var r=jo;if(Ji){if(qi){b:{for(var i=qi,a=Xi;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){qi=um(i.nextSibling),r=i.data===`F!`;break a}}Qi(r)}r=!1}r&&(t=n[0])}}return n=Xo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:t},n.queue=r,n=$s.bind(null,jo,r),r.dispatch=n,r=fs(!1),a=tc.bind(null,jo,!1,r.queue),r=Xo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ms.bind(null,jo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ss(e){return Cs(Zo(),Mo,e)}function Cs(e,t,n){if(t=is(e,t,bs)[0],e=rs(ns)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=$o(t)}catch(e){throw e===Ra?Ba:e}else r=t;t=Zo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(jo.flags|=2048,Es(9,{destroy:void 0},ws.bind(null,i,n),null)),[r,a,e]}function ws(e,t){e.action=t}function Ts(e){var t=Zo(),n=Mo;if(n!==null)return Cs(t,n,e);Zo(),t=t.memoizedState,n=Zo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=jo.updateQueue,t===null&&(t=Qo(),jo.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 Ds(){return Zo().memoizedState}function Os(e,t,n,r){var i=Xo();jo.flags|=e,i.memoizedState=Es(1|t,{destroy:void 0},n,r===void 0?null:r)}function ks(e,t,n,r){var i=Zo();r=r===void 0?null:r;var a=i.memoizedState.inst;Mo!==null&&r!==null&&Ho(r,Mo.memoizedState.deps)?i.memoizedState=Es(t,a,n,r):(jo.flags|=e,i.memoizedState=Es(1|t,a,n,r))}function As(e,t){Os(8390656,8,e,t)}function js(e,t){ks(2048,8,e,t)}function Ms(e){jo.flags|=4;var t=jo.updateQueue;if(t===null)t=Qo(),jo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ns(e){var t=Zo().memoizedState;return Ms({ref:t,nextImpl:e}),function(){if(qu&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Ps(e,t){return ks(4,2,e,t)}function Fs(e,t){return ks(4,4,e,t)}function Is(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 Ls(e,t,n){n=n==null?null:n.concat([e]),ks(4,4,Is.bind(null,t,e),n)}function Rs(){}function zs(e,t){var n=Zo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bs(e,t){var n=Zo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ho(t,r[1]))return r[0];if(r=e(),Io){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Vs(e,t,n){return n===void 0||Ao&1073741824&&!(Xu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),jo.lanes|=e,id|=e,n)}function Hs(e,t,n,r){return Ar(n,t)?n:ho.current===null?!(Ao&106)||Ao&1073741824&&!(Xu&261930)?(wc=!0,e.memoizedState=n):(e=Ad(),jo.lanes|=e,id|=e,t):(e=Vs(e,n,r),Ar(e,t)||(wc=!0),e)}function Us(e,t,n,r,i){var a=W.p;W.p=a!==0&&8>a?a:8;var o=U.T,s={};s.types=o===null?null:o.types,U.T=s,tc(e,!1,t,n);try{var c=i(),l=U.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ec(e,t,Ma(c,r),kd(e)):ec(e,t,r,kd(e))}catch(n){ec(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{W.p=a,o!==null&&s.types!==null&&(o.types=s.types),U.T=o}}function Ws(){}function Gs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ks(e).queue;Us(e,i,t,oe,n===null?Ws:function(){return qs(e),n(r)})}function Ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function qs(e){var t=Ks(e);t.next===null&&(t=e.alternate.memoizedState),ec(e,t.next.queue,{},kd())}function Js(){return ma(ch)}function Ys(){return Zo().memoizedState}function Xs(){return Zo().memoizedState}function Zs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=ao(n);var r=oo(t,e,n);r!==null&&(Md(r,t,n),so(r,t,n)),t={cache:xa()},e.payload=t;return}t=t.return}}function Qs(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},nc(e)?rc(t,n):(n=hi(e,t,n,r),n!==null&&(Md(n,e,r),ic(n,t,r)))}function $s(e,t,n){ec(e,t,n,kd())}function ec(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(nc(e))rc(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,Ar(s,o))return mi(e,t,i,0),Ju===null&&pi(),!1}catch{}if(n=hi(e,t,i,r),n!==null)return Md(n,e,r),ic(n,t,r),!0}return!1}function tc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},nc(e)){if(t)throw Error(a(479))}else t=hi(e,n,r,2),t!==null&&Md(t,e,2)}function nc(e){var t=e.alternate;return e===jo||t!==null&&t===jo}function rc(e,t){Fo=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ic(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var ac={readContext:ma,use:es,useCallback:Vo,useContext:Vo,useEffect:Vo,useImperativeHandle:Vo,useLayoutEffect:Vo,useInsertionEffect:Vo,useMemo:Vo,useReducer:Vo,useRef:Vo,useState:Vo,useDebugValue:Vo,useDeferredValue:Vo,useTransition:Vo,useSyncExternalStore:Vo,useId:Vo,useHostTransitionStatus:Vo,useFormState:Vo,useActionState:Vo,useOptimistic:Vo,useMemoCache:Vo,useCacheRefresh:Vo,useEffectEvent:Vo},oc={readContext:ma,use:es,useCallback:function(e,t){return Xo().memoizedState=[e,t===void 0?null:t],e},useContext:ma,useEffect:As,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Os(4194308,4,Is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){Os(4,2,e,t)},useMemo:function(e,t){var n=Xo();t=t===void 0?null:t;var r=e();if(Io){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Xo();if(n!==void 0){var i=n(t);if(Io){Re(!0);try{n(t)}finally{Re(!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=Qs.bind(null,jo,e),[r.memoizedState,e]},useRef:function(e){var t=Xo();return e={current:e},t.memoizedState=e},useState:function(e){e=fs(e);var t=e.queue,n=$s.bind(null,jo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Rs,useDeferredValue:function(e,t){return Vs(Xo(),e,t)},useTransition:function(){var e=fs(!1);return e=Us.bind(null,jo,e.queue,!0,!1),Xo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=jo,i=Xo();if(Ji){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Ju===null)throw Error(a(349));Xu&127||ss(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,As(ls.bind(null,r,o,e),[e]),r.flags|=2048,Es(9,{destroy:void 0},cs.bind(null,r,o,n,t),null),n},useId:function(){var e=Xo(),t=Ju.identifierPrefix;if(Ji){var n=Bi,r=zi;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Js,useFormState:xs,useActionState:xs,useOptimistic:function(e){var t=Xo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=tc.bind(null,jo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ts,useCacheRefresh:function(){return Xo().memoizedState=Zs.bind(null,jo)},useEffectEvent:function(e){var t=Xo(),n={impl:e};return t.memoizedState=n,function(){if(qu&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},sc={readContext:ma,use:es,useCallback:zs,useContext:ma,useEffect:js,useImperativeHandle:Ls,useInsertionEffect:Ps,useLayoutEffect:Fs,useMemo:Bs,useReducer:rs,useRef:Ds,useState:function(){return rs(ns)},useDebugValue:Rs,useDeferredValue:function(e,t){return Hs(Zo(),Mo.memoizedState,e,t)},useTransition:function(){var e=rs(ns)[0],t=Zo().memoizedState;return[typeof e==`boolean`?e:$o(e),t]},useSyncExternalStore:os,useId:Ys,useHostTransitionStatus:Js,useFormState:Ss,useActionState:Ss,useOptimistic:function(e,t){return ps(Zo(),Mo,e,t)},useMemoCache:ts,useCacheRefresh:Xs,useEffectEvent:Ns},cc={readContext:ma,use:es,useCallback:zs,useContext:ma,useEffect:js,useImperativeHandle:Ls,useInsertionEffect:Ps,useLayoutEffect:Fs,useMemo:Bs,useReducer:as,useRef:Ds,useState:function(){return as(ns)},useDebugValue:Rs,useDeferredValue:function(e,t){var n=Zo();return Mo===null?Vs(n,e,t):Hs(n,Mo.memoizedState,e,t)},useTransition:function(){var e=as(ns)[0],t=Zo().memoizedState;return[typeof e==`boolean`?e:$o(e),t]},useSyncExternalStore:os,useId:Ys,useHostTransitionStatus:Js,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){var n=Zo();return Mo===null?(n.baseState=e,[e,n.queue.dispatch]):ps(n,Mo,e,t)},useMemoCache:ts,useCacheRefresh:Xs,useEffectEvent:Ns};function lc(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 uc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=ao(r);i.payload=t,n!=null&&(i.callback=n),t=oo(e,i,r),t!==null&&(Md(t,e,r),so(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=ao(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=oo(e,i,r),t!==null&&(Md(t,e,r),so(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=ao(n);r.tag=2,t!=null&&(r.callback=t),t=oo(e,r,n),t!==null&&(Md(t,e,n),so(t,e,n))}};function dc(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?!jr(n,r)||!jr(i,a):!0}function fc(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&&uc.enqueueReplaceState(t,t.state,null)}function pc(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 mc(e){li(e)}function hc(e){console.error(e)}function gc(e){li(e)}function _c(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function vc(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 yc(e,t,n){return n=ao(n),n.tag=3,n.payload={element:null},n.callback=function(){_c(e,t)},n}function bc(e){return e=ao(e),e.tag=3,e}function xc(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(){vc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){vc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Sc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&da(t,n,i,!0),n=yo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return bo===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Va?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)),pf(e,r,i)),!1}throw Error(a(435,n.tag))}return pf(e,r,i),Wd(),!1}if(Ji)return t=yo.current,t===null?(r!==Zi&&(t=Error(a(423),{cause:r}),ia(ji(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ji(r,n),i=yc(e.stateNode,r,i),co(e,i),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Zi&&(e=Error(a(422),{cause:r}),ia(ji(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=ji(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=ji(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=yc(n.stateNode,r,e),co(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`&&(gd===null||!gd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=bc(i),xc(i,e,n,r),co(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Cc=Error(a(461)),wc=!1;function Tc(e,t,n,r){t.child=e===null?to(t,null,n,r):eo(t,e.child,n,r)}function Ec(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 pa(t),r=Uo(e,t,n,o,a,i),s=qo(),e!==null&&!wc?(Jo(e,t,i),el(e,t,i)):(Ji&&s&&Ui(t),t.flags|=1,Tc(e,t,r,i),t.child)}function Dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Oc(e,t,a,r,i)):(e=Ti(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!tl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?jr:n,n(o,r)&&e.ref===t.ref)return el(e,t,i)}return t.flags|=1,e=Ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function Oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(jr(a,r)&&e.ref===t.ref){if(wc=!1,t.pendingProps=r=a,tl(e,i))e.flags&131072&&(wc=!0);else return t.lanes=e.lanes,el(e,t,i)}}return Ic(e,t,n,r,i)}function kc(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 jc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ia(t,a===null?null:a.cachePool),a===null?_o():Z(t,a),Co(t);else return r=t.lanes=536870912,jc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ia(t,null),_o(),wo()):(Ia(t,a.cachePool),Z(t,a),wo(),t.memoizedState=null);return Tc(e,t,i,n),t.child}function Ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jc(e,t,n,r,i){var a=Fa();return a=a===null?null:{parent:ba._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ia(t,null),_o(),Co(t),e!==null&&da(e,t,r,!0),t.childLanes=i,null}function Mc(e,t){return t=Gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nc(e,t,n){return eo(t,e.child,null,n),e=Mc(t,t.pendingProps),e.flags|=2,To(t),t.memoizedState=null,e}function Pc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ji){if(r.mode===`hidden`)return e=Mc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ac(null,e);if(So(t),(e=qi)?(e=om(e,Xi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=536870912,null}return Mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(So(t),i){if(t.flags&256)t.flags&=-257,t=Nc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(wc||da(e,t,n,!1),i=(n&e.childLanes)!==0,wc||i){if(ho.current===null){if(r=Ju,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,gi(e,s),Md(r,e,s),Cc;Wd()}t=Nc(e,t,n)}else e=o.treeContext,qi=um(s.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Mc(t,r),t.flags|=134221824;return t}return e=Ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fc(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 Ic(e,t,n,r,i){return pa(t),n=Uo(e,t,n,r,void 0,i),r=qo(),e!==null&&!wc?(Jo(e,t,i),el(e,t,i)):(Ji&&r&&Ui(t),t.flags|=1,Tc(e,t,n,i),t.child)}function Lc(e,t,n,r,i,a){return pa(t),t.updateQueue=null,n=Go(t,r,n,i),Wo(e),r=qo(),e!==null&&!wc?(Jo(e,t,a),el(e,t,a)):(Ji&&r&&Ui(t),t.flags|=1,Tc(e,t,n,a),t.child)}function Rc(e,t,n,r,i){if(pa(t),t.stateNode===null){var a=yi,o=n.contextType;typeof o==`object`&&o&&(a=ma(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=uc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ro(t),o=n.contextType,a.context=typeof o==`object`&&o?ma(o):yi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(lc(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&&uc.enqueueReplaceState(a,a.state,null),fo(t,r,a,i),uo(),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=pc(n,s);a.props=c;var l=a.context,u=n.contextType;o=yi,typeof u==`object`&&u&&(o=ma(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)&&fc(t,a,r,o),no=!1;var f=t.memoizedState;a.state=f,fo(t,r,a,i),uo(),l=t.memoizedState,s||f!==l||no?(typeof d==`function`&&(lc(t,n,d,r),l=t.memoizedState),(c=no||dc(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,io(e,t),o=t.memoizedProps,u=pc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=yi,typeof l==`object`&&l&&(c=ma(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)&&fc(t,a,r,c),no=!1,f=t.memoizedState,a.state=f,fo(t,r,a,i),uo();var p=t.memoizedState;o!==d||f!==p||no||e!==null&&e.dependencies!==null&&fa(e.dependencies)?(typeof s==`function`&&(lc(t,n,s,r),p=t.memoizedState),(u=no||dc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&fa(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,Fc(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=eo(t,e.child,null,i),t.child=eo(t,null,n,i)):Tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=el(e,t,i),e}function zc(e,t,n,r){return na(),t.flags|=256,Tc(e,t,n,r),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vc(e){return{baseLanes:e,cachePool:La()}}function Hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Uc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Eo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Ji){if(i?xo(t):wo(),(e=qi)?(e=om(e,Xi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ri===null?null:{id:zi,overflow:Bi},retryLane:536870912,hydrationErrors:null},n=Oi(e),n.return=t,t.child=n,Ki=t,qi=null)):e=null,e===null)throw Qi(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(wo(),i=t.mode,a=Gc({mode:`hidden`,children:a},i),r=Ei(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Vc(n),r.childLanes=Hc(e,o,n),t.memoizedState=Bc,Ac(null,r)):(xo(t),Wc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return qc(e,t,a,o,r,c,s,n)}return i?(wo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ci(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ei(i,a,n,null),i.flags|=2):i=Ci(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ac(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Vc(n):(a=i.cachePool,a===null?a=La():(s=ba._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Hc(e,o,n),t.memoizedState=Bc,Ac(e.child,r)):(xo(t),n=e.child,e=n.sibling,n=Ci(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 Wc(e,t){return t=Gc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Gc(e,t){return e=xi(22,e,null,t),e.lanes=0,e}function Kc(e,t,n){return eo(t,e.child,null,n),e=Wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qc(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(xo(t),t.flags&=-257,Kc(e,t,c)):t.memoizedState===null?(wo(),o=i.fallback,s=t.mode,i=Gc({mode:`visible`,children:i.children},s),o=Ei(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,eo(t,e.child,null,c),i=t.child,i.memoizedState=Vc(c),i.childLanes=Hc(e,r,c),t.memoizedState=Bc,Ac(null,i)):(wo(),t.child=e.child,t.flags|=128,null);if(xo(t),cm(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,ia({value:i,source:null,stack:null})),Kc(e,t,c)}if(wc||da(e,t,c,!1),r=(c&e.childLanes)!==0,wc||r){if(ho.current!==null)return Kc(e,t,c);if(r=Ju,r!==null&&(i=rt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,gi(e,i),Md(r,e,i),Cc;return sm(o)||Wd(),Kc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,qi=um(o.nextSibling),Ki=t,Ji=!0,Yi=null,Xi=!1,e!==null&&Gi(t,e),t=Wc(t,i.children),t.flags|=134221824,t)}function Jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),la(e.return,t,n)}function Yc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&ko(n)===null&&(t=e),e=e.sibling}return t}function Xc(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 Zc(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 Qc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Eo.current;if(t.flags&128)return Do(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Do(t,o),i===`backwards`&&e!==null?(Zc(e),Tc(e,t,r,n),Zc(e)):Tc(e,t,r,n),r=Ji?Fi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jc(e,n,t);else if(e.tag===19)Jc(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=Yc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Zc(t)),Xc(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&&ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Xc(t,!0,n,null,a,r);break;case`together`:Xc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Yc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Xc(t,!1,i,n,a,r)}return t.child}function $c(e,t,n){var r=t.pendingProps;return X(t,t.type,r.value),Tc(e,t,r.children,n),t.child}function el(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(da(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=Ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&fa(e)))}function nl(e,t,n){switch(t.tag){case 3:J(t,t.stateNode.containerInfo),X(t,ba,e.memoizedState.cache),na();break;case 27:case 5:me(t);break;case 4:J(t,t.stateNode.containerInfo);break;case 10:X(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,So(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return xo(t),t.flags|=128,null;r=da(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Uc(e,t,n):(xo(t),e=el(e,t,n),e===null?null:e.sibling)}xo(t);break;case 19:if(t.flags&128)return Qc(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(da(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Qc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Do(t,Eo.current),r)break;return null;case 22:return t.lanes=0,kc(e,t,n,t.pendingProps);case 24:X(t,ba,e.memoizedState.cache)}return el(e,t,n)}function rl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)wc=!0;else{if(!tl(e,n)&&!(t.flags&128))return wc=!1,nl(e,t,n);wc=!!(e.flags&131072)}}else wc=!1,Ji&&t.flags&1048576&&Hi(t,Fi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Wa(t.elementType),t.type=e,typeof e==`function`)Si(e)?(r=pc(e,r),t.tag=1,t=Rc(null,t,e,r,n)):(t.tag=0,t=Ic(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===N){t.tag=11,t=Ec(null,t,e,r,n);break a}if(i===I){t.tag=14,t=Dc(null,t,e,r,n);break a}if(i===M){t.tag=10,t.type=e,t=$c(null,t,n);break a}}throw t=ae(e)||e,Error(a(306,t,``))}}return t;case 0:return Ic(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=pc(r,t.pendingProps),Rc(e,t,r,i,n);case 3:a:{if(J(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,io(e,t),fo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,X(t,ba,r),r!==o.cache&&ua(t,[ba],n,!0),uo(),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=zc(e,t,r,n);break a}if(r!==i){i=ji(Error(a(424)),t),ia(i),t=zc(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(qi=um(e.firstChild),Ki=t,Ji=!0,Yi=null,Xi=!0,n=to(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(na(),r===i){t=el(e,t,n);break a}Tc(e,t,r,n)}t=t.child}return t;case 26:return Fc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ji||(t.stateNode=pp(t.type,t.pendingProps,de.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Ji&&(r=t.stateNode=gm(t.type,t.pendingProps,de.current),Ki=t,Xi=!0,i=qi,Cp(t.type)?(dm=i,qi=um(r.firstChild)):qi=i),Tc(e,t,t.pendingProps.children,n),Fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ji&&((i=r=qi)&&(r=im(r,t.type,t.pendingProps,Xi),r===null?i=!1:(t.stateNode=r,Ki=t,qi=um(r.firstChild),Xi=!1,i=!0)),i||Qi(t)),me(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(i,o)?r=null:s!==null&&mp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Uo(e,t,Ko,null,null,n),ch._currentValue=i),Fc(e,t),Tc(e,t,r,n),t.child;case 6:return e===null&&Ji&&((e=n=qi)&&(n=am(n,t.pendingProps,Xi),n===null?e=!1:(t.stateNode=n,Ki=t,qi=null,e=!0)),e||Qi(t)),null;case 13:return Uc(e,t,n);case 4:return J(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=eo(t,null,r,n):Tc(e,t,r,n),t.child;case 11:return Ec(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Fc(e,t),Tc(e,t,r,n),t.child;case 8:return Tc(e,t,t.pendingProps.children,n),t.child;case 12:return Tc(e,t,t.pendingProps.children,n),t.child;case 10:return $c(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,pa(t),i=ma(i),r=r(i),t.flags|=1,Tc(e,t,r,n),t.child;case 14:return Dc(e,t,t.type,t.pendingProps,n);case 15:return Oc(e,t,t.type,t.pendingProps,n);case 19:return Qc(e,t,n);case 31:return Pc(e,t,n);case 22:return kc(e,t,n,t.pendingProps);case 24:return pa(t),r=ma(ba),e===null?(i=Fa(),i===null&&(i=Ju,o=xa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},ro(t),X(t,ba,i)):((e.lanes&n)!==0&&(io(e,t),fo(t,null,null,n),uo()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,X(t,ba,r),r!==i.cache&&ua(t,[ba],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),X(t,ba,r))),Tc(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:Ji&&Ui(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Fc(e,t),Tc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function il(e){e.flags|=4}function al(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(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(Vd())e.flags|=8192;else throw Ga=Va,za}}else e.flags&=-16777217}function ol(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Vd())e.flags|=8192;else throw Ga=Va,za}}function sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,cd|=t)}function cl(e,t){if(!Ji)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 ll(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 ul(e,t,n){var r=t.pendingProps;switch(Wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ll(t),null;case 1:return ll(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ca(ba),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ta(t)?il(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ra())),ll(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(il(t),o===null?(ll(t),al(t,i,null,r,n)):(ll(t),ol(t,o))):o?o===e.memoizedState?(ll(t),t.flags&=-16777217):(il(t),ll(t),ol(t,o)):(e=e.memoizedProps,e!==r&&il(t),ll(t),al(t,i,e,r,n)),null;case 27:if(he(t),n=de.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return ll(t),t.subtreeFlags&=-33554433,null}e=le.current,ta(t)?$i(t,e):(e=gm(i,r,n),t.stateNode=e,il(t))}return ll(t),t.subtreeFlags&=-33554433,null;case 5:if(he(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return ll(t),t.subtreeFlags&=-33554433,null}if(o=le.current,ta(t))$i(t,o);else{var s=up(de.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[lt]=t,o[ut]=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(rp(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&&il(t)}}return ll(t),t.subtreeFlags&=-33554433,al(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=de.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ki,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||Qi(t,!0)}else e=up(e).createTextNode(r),e[lt]=t,t.stateNode=e}return ll(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ta(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[lt]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ll(t),e=!1}else n=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(To(t),t):(To(t),null);if(t.flags&128)throw Error(a(558))}return ll(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ta(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[lt]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ll(t),i=!1}else i=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(To(t),t):(To(t),null)}return To(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),sl(t,t.updateQueue),ll(t),null);case 4:return pe(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,ll(t),null;case 10:return ca(t.type),ll(t),null;case 19:if(Oo(t),r=t.memoizedState,r===null)return ll(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)cl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ko(e),o!==null){for(t.flags|=128,cl(r,!1),e=o.updateQueue,t.updateQueue=e,sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wi(n,e),n=n.sibling;return Do(t,Eo.current&1|2),Ji&&Vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>md&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=ko(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,sl(t,e),cl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Ji)return ll(t),null}else 2*De()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,i=!0,cl(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=De(),e.sibling=null,o=Eo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Ji?Do(t,o):(n=o,ce(yo,t),ce(Eo,n),bo===null&&(bo=t)),Ji&&Vi(t,r.treeForkCount),e}return ll(t),null;case 22:case 23:return To(t),vo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ll(t),t.subtreeFlags&6&&(t.flags|=8192)):ll(t),n=t.updateQueue,n!==null&&sl(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&&q(Pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ca(ba),ll(t),null;case 25:return null;case 30:return t.flags|=33554432,ll(t),null}throw Error(a(156,t.tag))}function dl(e,t){switch(Wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ca(ba),pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(To(t),t.alternate===null)throw Error(a(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(To(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oo(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 pe(),null;case 10:return ca(t.type),null;case 22:case 23:return To(t),vo(),e!==null&&q(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ca(ba),null;case 25:return null;default:return null}}function fl(e,t){switch(Wi(t),t.tag){case 3:ca(ba),pe();break;case 26:case 27:case 5:he(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&To(t);break;case 13:To(t);break;case 19:Oo(t);break;case 10:ca(t.type);break;case 22:case 23:To(t),vo(),e!==null&&q(Pa);break;case 24:ca(ba)}}function pl(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){ff(t,t.return,e)}}function ml(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function hl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{mo(t,n)}catch(t){ff(e,e.return,t)}}}function gl(e,t,n){n.props=pc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function _l(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=oi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);p(e.child,!1,$p,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){ff(e,t,n)}}function vl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function yl(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++)tm(e.stateNode,t[n])}function bl(e){for(var t=e.return;t!==null&&(Cl(t)&&tm(e.stateNode,t.stateNode),!Sl(t));)t=t.return}function xl(e){for(var t=e.return;t!==null&&(Cl(t)&&nm(e.stateNode,t.stateNode),!Sl(t));)t=t.return}function Sl(e){return e.tag===5||e.tag===3||e.tag===27}function Cl(e){return e&&e.tag===7&&e.stateNode!==null}function wl(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){ff(e,e.return,t)}}function Tl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[ut]=t}catch(t){ff(e,e.return,t)}}function El(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function Dl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||El(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&&Cp(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 Ol(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=sn)),yl(e,r),Nt=!0;else if(i!==4&&(i===27&&(yl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ol(e,t,n,r),e=e.sibling;e!==null;)Ol(e,t,n,r),e=e.sibling}function kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),yl(e,r),Nt=!0;else if(i!==4&&(i===27&&(yl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[lt]=e,t[ut]=n}catch(t){ff(e,e.return,t)}}var jl=!1,Ml=null;function Nl(e){(e.tag===30||e.subtreeFlags&33554432)&&(jl=!0)}var Pl=null;function Fl(){var e=Pl;return Pl=null,e}var Il=0;function Ll(e,t,n,r,i){return Il=0,Rl(e.child,t,n,r,i)}function Rl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);jl=!0,Ep(o,Il===0?t:t+`_`+Il,n),Il++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Rl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function zl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||zl(e.child,t),e=e.sibling}function Bl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Bl(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=ci(t.default,t.share),t!==`none`&&(Ll(e,n,t,null,!1)||zl(e.child,!1))}e=e.sibling}}function Vl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=oi(r,n),a=ci(r.default,n.paired?r.share:r.enter);a===`none`?Bl(e):Ll(e,i,a,null,!1)?(Bl(e),n.paired||t||jd(e,r.onEnter)):zl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Vl(e,t),e=e.sibling;else Bl(e)}function Hl(e){if(Ml!==null&&Ml.size!==0){var t=Ml;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=ci(n.default,n.share);if(a!==`none`&&(Ll(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):zl(e.child,!1)),t.delete(r),t.size===0)break}}}Hl(e)}e=e.sibling}}}function Ul(e){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode),r=Ml===null?void 0:Ml.get(n),i=ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ll(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ml.delete(n),jd(e,t.onShare)):zl(e.child,!1)),Ml!==null&&Hl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e),e=e.sibling;else Ml!==null&&Hl(e)}function Wl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=oi(t,e.stateNode);t=ci(t.default,t.update),e.flags&=-5,t!==`none`&&Ll(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Wl(e);e=e.sibling}}function Gl(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,zl(e.child,!1))}Gl(e)}e=e.sibling}}function Kl(e){if(e.tag===30)e.stateNode.paired=null,zl(e.child,!1),Gl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Gl(e)}function ql(e){for(e=e.child;e!==null;)e.tag===30?zl(e.child,!1):e.subtreeFlags&33554432&&ql(e),e=e.sibling}function Jl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Il<a.length){var l=a[Il],u=kp(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&&Ep(c,Il===0?n:n+`_`+Il,i),s&&e.flags&4||(Pl===null&&(Pl=[]),Pl.push(c,Il===0?r:r+`_`+Il,t.memoizedProps)),Il++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Jl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Yl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=oi(n,r),a=ci(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Il=0,i=Jl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Yl(e,t);e=e.sibling}}var Xl=!1,Zl=!1,Ql=!1,$l=!1,eu=typeof WeakSet==`function`?WeakSet:Set,tu=null,nu=!1,ru=!1,iu=!1,au=!1;function ou(e,t,n){if(e=e.containerInfo,cp=_h,e=Ir(e),Lr(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(lp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,tu=t,t=n?9270:1024;tu!==null;){if(e=tu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ul(r[a]);if(e.alternate===null&&e.flags&2)n&&Nl(e),Q(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ul(r),Q(n);continue}if(r!==null&&r.memoizedState!==null){n&&Nl(e),Q(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,tu=r):(n&&Wl(e),Q(n))}}Ml=null}function Q(e){for(;tu!==null;){var t=tu,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=pc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(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=oi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=ci(i.default,i.update),i!==`none`&&Ll(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,tu=r;break}tu=t.return}}function su(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Du(e,n),r&4&&pl(5,n);break;case 1:if(Du(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=pc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&hl(n),r&512&&_l(n,n.return);break;case 3:if(Du(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{mo(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Al(n);case 26:case 5:Du(e,n),t===null&&r&4&&wl(n),r&512&&_l(n,n.return);break;case 12:Du(e,n);break;case 31:Du(e,n),r&4&&gu(e,n);break;case 13:Du(e,n),r&4&&_u(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||Xl,!r){var a=t!==null&&t.memoizedState!==null||Zl;t=Xl,i=Zl,Xl=r,(Zl=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ku(e,n,r)):Du(e,n),Xl=t,Zl=i}break;case 30:Du(e,n),r&512&&_l(n,n.return);break;case 7:r&512&&_l(n,n.return);default:Du(e,n)}}function cu(e,t){for(e=e.child;e!==null;)lu(e,t),e=e.sibling}function lu(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){ff(e,e.return,t)}uu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Nt=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&cu(e,t);break;default:cu(e,t)}}function uu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:lu(n,r);break a;case 22:n.memoizedState===null&&uu(n,r);break a;default:uu(n,r)}}e=e.sibling}}function du(e){var t=e.alternate;t!==null&&(e.alternate=null,du(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(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 fu=null,pu=!1;function mu(e,t,n){for(n=n.child;n!==null;)hu(e,t,n),n=n.sibling}function hu(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:Zl||vl(n,t),mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Zl&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zl||vl(n,t),xl(n);var r=fu,i=pu;Cp(n.type)&&(fu=n.stateNode,pu=!1),mu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),fu=r,pu=i;break;case 5:Zl||vl(n,t),xl(n);case 6:if(n.tag===6&&xl(n),r=fu,i=pu,fu=null,mu(e,t,n),fu=r,pu=i,fu!==null){if(pu)try{(fu.nodeType===9?fu.body:fu.nodeName===`HTML`?fu.ownerDocument.body:fu).removeChild(n.stateNode),Nt=!0}catch(e){ff(n,t,e)}else try{fu.removeChild(n.stateNode),Nt=!0}catch(e){ff(n,t,e)}}break;case 18:fu!==null&&(pu?(e=fu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Uh(e)):wp(fu,n.stateNode));break;case 4:r=fu,i=pu,fu=n.stateNode.containerInfo,pu=!0,mu(e,t,n),fu=r,pu=i;break;case 0:case 11:case 14:case 15:ml(2,n,t),Zl||ml(4,n,t),mu(e,t,n);break;case 1:Zl||(vl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&gl(n,t,r)),mu(e,t,n);break;case 21:mu(e,t,n);break;case 22:Zl=(r=Zl)||n.memoizedState!==null,mu(e,t,n),Zl=r;break;case 30:vl(n,t),mu(e,t,n);break;case 7:Zl||vl(n,t),mu(e,t,n);break;default:mu(e,t,n)}}function gu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Uh(e)}catch(e){ff(t,t.return,e)}}}function _u(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Uh(e)}catch(e){ff(t,t.return,e)}}function vu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new eu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new eu),t;default:throw Error(a(435,e.tag))}}function yu(e,t){var n=vu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function bu(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(Cp(l.type)){fu=l.stateNode,pu=!1;break a}break;case 5:fu=l.stateNode,pu=!1;break a;case 3:case 4:fu=l.stateNode.containerInfo,pu=!0;break a}l=l.return}if(fu===null)throw Error(a(160));hu(s,c,o),fu=null,pu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Su(t,e,n),t=t.sibling}var xu=null;function Su(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}bu(t,e,n),Cu(e),i&4&&(ml(3,e,e.return),pl(3,e),ml(5,e,e.return));break;case 1:bu(t,e,n),Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),i&64&&Xl&&(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=xu,bu(t,e,n),Cu(e),i&512&&(Zl||r===null||vl(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(Xl)e.stateNode=pp(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[gt]||r[lt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),rp(r,t,n),r[lt]=e,Ct(r),t=r;break a;case`link`:if(o=Km(`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),rp(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Km(`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),rp(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[lt]=e,Ct(r),t=r}e.stateNode=t}}else Xl||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Tl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||Zl||t.parentNode.removeChild(t)):i.count--,n===null?Xl||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:bu(t,e,n),Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),r!==null&&i&4&&Tl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=Ql,Ql=!1,bu(t,e,n),Ql=o,Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),e.flags&32){t=e.stateNode;try{Qt(t,``),Nt=!0}catch(t){ff(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Tl(e,t,r===null?t:r.memoizedProps)),i&1024&&($l=!0);break;case 6:if(bu(t,e,n),Cu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Nt=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(Nt=!1,Gm=null,o=xu,xu=xm(t.containerInfo),bu(t,e,n),xu=o,Cu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Uh(t.containerInfo)}catch(t){ff(e,e.return,t)}$l&&($l=!1,wu(e)),Nt=!1;break;case 4:i=Ql,Ql=Xl,r=Pt(),o=xu,xu=xm(e.stateNode.containerInfo),bu(t,e,n),Cu(e),xu=o,Nt&&ru&&(iu=!0),Nt=r,Ql=i;break;case 12:bu(t,e,n),Cu(e);break;case 31:bu(t,e,n),Cu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 13:bu(t,e,n),Cu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=De()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Xl,l=Zl,u=Ql;Xl=c||o,Ql=u||o,Zl=l||s,bu(t,e,n),Zl=l,Ql=u,Xl=c,Cu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Xl||Zl||(t=s||Zl,n=Xl,r=Zl,Xl=o||Xl,Zl=t,Ou(e,2),Xl=n,Zl=r),!o&&Ql||cu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,yu(e,n))));break;case 19:bu(t,e,n),Cu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 30:i&512&&(Zl||r===null||vl(r,r.return)),i=Pt(),o=ru,s=(n&335544064)===n,c=e.memoizedProps,ru=s&&ci(c.default,c.update)!==`none`,bu(t,e,n),Cu(e),s&&r!==null&&Nt&&(e.flags|=4),ru=o,Nt=i;break;case 21:break;case 7:i&512&&(Zl||r===null||vl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:bu(t,e,n),Cu(e)}}function Cu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(El(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Cl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Sl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;kl(e,Dl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(Qt(l,``),n.flags&=-33),kl(e,Dl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ol(e,Dl(e),u,s);break;default:throw Error(a(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Tu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Eu(t,e),t=t.sibling;else Yl(t,!1)}function Eu(e,t){var n=e.alternate;if(n===null)Vl(e,!1);else switch(e.tag){case 3:if(au=nu=!1,Fl(),Tu(t,e),!nu&&!iu){if(e=Pl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(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`})),au=!0}Pl=null;break;case 5:Tu(t,e);break;case 4:r=nu,nu=!1,Tu(t,e),nu&&(iu=!0),nu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Tu(t,e):Vl(e,!1));break;case 30:r=nu,i=Fl(),nu=!1,Tu(t,e),nu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=oi(a,o),o=oi(n.memoizedProps,o);var s=ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Il=0,t=Jl(e,n,t,o,s,a,!0),Il!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Pl=i):i!==null&&(i.push.apply(i,Pl),Pl=i),nu=e.flags&32?!0:r;break;default:Tu(t,e)}}function Du(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)su(e,t.alternate,t),t=t.sibling}function Ou(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:ml(4,n,n.return),Ou(n,r);break;case 1:vl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&gl(n,n.return,i),Ou(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:vl(n,n.return),n.tag!==5&&n.tag!==27||xl(n),Ou(n,r);break;case 6:xl(n);break;case 26:vl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Zl||i.parentNode.removeChild(i),Ou(n,r);break;case 22:n.memoizedState===null&&Ou(n,r);break;case 30:vl(n,n.return),Ou(n,r);break;case 7:vl(n,n.return);default:Ou(n,r)}e=e.sibling}}function ku(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:ku(i,a,n),pl(4,a);break;case 1:if(ku(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)po(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&hl(a),_l(a,a.return);break;case 27:n&2&&Al(a);case 5:a.tag!==5&&a.tag!==27||bl(a),ku(i,a,n),s&&r===null&&o&4&&wl(a),_l(a,a.return);break;case 6:bl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Xl||qm(xm(c.ownerDocument),a.type,c),ku(i,a,n),s&&r===null&&o&4&&wl(a),_l(a,a.return);break;case 12:ku(i,a,n);break;case 31:ku(i,a,n),s&&o&4&&gu(i,a);break;case 13:ku(i,a,n),s&&o&4&&_u(i,a);break;case 22:a.memoizedState===null&&ku(i,a,n),_l(a,a.return);break;case 30:ku(i,a,n),_l(a,a.return);break;case 7:_l(a,a.return);default:ku(i,a,n)}t=t.sibling}}function Au(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&&Sa(n))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Sa(e))}function Nu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Pu(e,t,n,r),t=t.sibling;else i&&ql(t)}function Pu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Kl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Nu(e,t,n,r),a&2048&&pl(9,t);break;case 1:Nu(e,t,n,r);break;case 3:Nu(e,t,n,r),i&&au&&(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&&Sa(a)));break;case 12:if(a&2048){Nu(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){ff(t,t.return,e)}}else Nu(e,t,n,r);break;case 31:Nu(e,t,n,r);break;case 13:Nu(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&&Kl(t),o._visibility&2?Nu(e,t,n,r):(o._visibility|=2,Fu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Kl(s),o._visibility&2?Nu(e,t,n,r):Iu(e,t)),a&2048&&Au(s,t);break;case 24:Nu(e,t,n,r),a&2048&&ju(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(zl(a.child,!0),zl(t.child,!0))),Nu(e,t,n,r);break;default:Nu(e,t,n,r)}}function Fu(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:Fu(a,o,s,c,i),pl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Fu(a,o,s,c,i)):u._visibility&2?Fu(a,o,s,c,i):Iu(a,o),i&&l&2048&&Au(o.alternate,o);break;case 24:Fu(a,o,s,c,i),i&&l&2048&&ju(o.alternate,o);break;default:Fu(a,o,s,c,i)}t=t.sibling}}function Iu(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:Iu(n,r),i&2048&&Au(r.alternate,r);break;case 24:Iu(n,r),i&2048&&ju(r.alternate,r);break;default:Iu(n,r)}t=t.sibling}}var Lu=8192;function Ru(e,t,n){if(e.subtreeFlags&Lu)for(e=e.child;e!==null;)zu(e,t,n),e=e.sibling}function zu(e,t,n){switch(e.tag){case 26:Ru(e,t,n),e.flags&Lu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,xu,e.memoizedState,e.memoizedProps));break;case 5:Ru(e,t,n),e.flags&Lu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=xu;xu=xm(e.stateNode.containerInfo),Ru(e,t,n),xu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Lu,Lu=16777216,Ru(e,t,n),Lu=r):Ru(e,t,n));break;case 30:if((e.flags&Lu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ml===null&&(Ml=new Map),Ml.set(r,i)}Ru(e,t,n);break;default:Ru(e,t,n)}}function Bu(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 Vu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tu=r,Wu(r,e)}Bu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hu(e),e=e.sibling}function Hu(e){switch(e.tag){case 0:case 11:case 15:Vu(e),e.flags&2048&&ml(9,e,e.return);break;case 3:Vu(e);break;case 12:Vu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uu(e)):Vu(e);break;default:Vu(e)}}function Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tu=r,Wu(r,e)}Bu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ml(8,t,t.return),Uu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Uu(t));break;default:Uu(t)}e=e.sibling}}function Wu(e,t){for(;tu!==null;){var n=tu;switch(n.tag){case 0:case 11:case 15:ml(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:Sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tu=r;else a:for(n=e;tu!==null;){r=tu;var i=r.sibling,a=r.return;if(du(r),r===n){tu=null;break a}if(i!==null){i.return=a,tu=i;break a}tu=a}}}var Gu={getCacheForType:function(e){var t=ma(ba),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ma(ba).controller.signal}},Ku=typeof WeakMap==`function`?WeakMap:Map,qu=0,Ju=null,Yu=null,Xu=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return qu&2&&Xu!==0?Xu&-Xu:U.T===null?ot():Nf()}function Ad(){if(sd===0){if(!(Xu&536870912)||Ji){var e=We;We<<=1,!(We&3932160)&&(We=262144),sd=e}else sd=536870912}return e=yo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(oi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Ju&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Xu,sd,!1)),$e(e,n),qu&2&&e===Ju||(e===Ju&&(!(qu&2)&&(ad|=n),rd===4&&Id(e,Xu,sd,!1)),Tf(e))}function Nd(e,t,n){if(qu&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Je(e,t),i=r?qd(e,t):Gd(e,t,!0),o=r;do{if(i===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fd(n))i=Gd(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=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,i=4;break a}o=ud,ud=i,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){zd(e,0),Id(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:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=fd+300-De(),10<i)){if(Id(r,t,sd,!$u),qe(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=_p(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),i);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);Tf(e)}function Pd(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:sn},Ml=null,zu(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=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-De():(a&4194048)===a?pd-De():0,m=th(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(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(!Ar(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 Id(e,t,n,r){t=Ye(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function Ld(){return qu&6?!0:(Ef(0,!1),!1)}function Rd(){if(Yu!==null){if(Zu===0)var e=Yu.return;else e=Yu,sa=oa=null,Yo(e),Ja=null,Ya=0,e=Yu;for(;e!==null;)fl(e.alternate,e),e=e.return;Yu=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Ju=e,Yu=n=Ci(e.current,null),Xu=t,Zu=0,Qu=null,$u=!1,ed=Je(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=Ye(e,t),pi(),n}function Bd(e,t){jo=null,U.H=ac,t===Ra||t===Ba?(t=Ka(),Zu=3):t===za?(t=Ka(),Zu=4):Zu=t===Cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Yu===null&&(rd=1,_c(e,ji(t,e.current)))}function Vd(){var e=yo.current;return e===null?!0:(Xu&4194048)===Xu?bo===null:(Xu&62914560)===Xu||Xu&536870912?e===bo:!1}function Hd(){var e=U.H;return U.H=ac,e===null?ac:e}function Ud(){var e=U.A;return U.A=Gu,e}function Wd(){rd=4,$u||(Xu&4194048)!==Xu&&yo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Ju===null||Id(Ju,Xu,sd,!1)}function Gd(e,t,n){var r=qu;qu|=2;var i=Hd(),a=Ud();(Ju!==e||Xu!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Yu!==null){var s=Yu,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:yo.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,sa=oa=null,qu=r,U.H=i,U.A=a,Yu===null&&(Ju=null,Xu=0,pi()),o}function Kd(){for(;Yu!==null;)Yd(Yu)}function qd(e,t){var n=qu;qu|=2;var r=Hd(),i=Ud();Ju!==e||Xu!==t?(hd=null,md=De()+500,zd(e,t)):ed=Je(e,t);a:do try{if(Zu!==0&&Yu!==null){t=Yu;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,o,1);break;case 2:case 9:if(Ha(o)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Ju!==e||(Zu=7),Tf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ha(o)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Yu.tag){case 26:s=Yu.memoizedState;case 5:case 27:var c=Yu;if(s?Xm(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Yu=l;else{var u=c.return;u===null?Yu=null:(Yu=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,o,5);break;case 6:Zu=0,Qu=null,Zd(e,t,o,6);break;case 8:Rd(),rd=6;break a;default:throw Error(a(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return sa=oa=null,U.H=r,U.A=i,qu=n,Yu===null?(Ju=null,Xu=0,pi(),rd):0}function Jd(){for(;Yu!==null&&!Te();)Yd(Yu)}function Yd(e){var t=rl(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Yu=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lc(n,t,t.pendingProps,t.type,void 0,Xu);break;case 11:t=Lc(n,t,t.pendingProps,t.type.render,t.ref,Xu);break;case 5:Yo(t);var r=t;r===Ki&&(Ji?(ea(r),r.tag===5&&r.stateNode!=null&&(qi=r.stateNode)):(ea(r),Ji=!0));default:fl(n,t),t=Yu=wi(t,nd),t=rl(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Yu=t}function Zd(e,t,n,r){sa=oa=null,Yo(t),Ja=null,Ya=0;var i=t.return;try{if(Sc(e,i,t,n,Xu)){rd=1,_c(e,ji(n,e.current)),Yu=null;return}}catch(t){if(i!==null)throw Yu=i,t;rd=1,_c(e,ji(n,e.current)),Yu=null;return}t.flags&32768?(Ji||r===1?e=!0:ed||Xu&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=yo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=ul(t.alternate,t,nd);if(n!==null){Yu=n;return}if(t=t.sibling,t!==null){Yu=t;return}Yu=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=dl(e.alternate,e);if(n!==null){n.flags&=32767,Yu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Yu=e;return}Yu=e=n}while(e!==null);rd=6,Yu=null}function ef(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(qu&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===Ju&&(Yu=Ju=null,Xu=0),yd=t,vd=e,bd=n,Sd=i,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=fi,et(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Ta(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(je,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=U.T,U.T=null,i=W.p,W.p=2,a=qu,qu|=4;try{ou(e,t,n)}finally{qu=a,W.p=i,U.T=r}}_d=1,jl?wd=Np(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Eu(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=U.T,U.T=null;var i=W.p;W.p=2;var a=qu;qu|=4;try{ru=iu=!1,Su(t,e,n),n=lp;var o=Ir(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Fr(s.ownerDocument.documentElement,s)){if(c!==null&&Lr(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 _=Pr(s,h),v=Pr(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}}_h=!!cp,lp=cp=null}finally{qu=a,W.p=i,U.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=U.T,U.T=null;var r=W.p;W.p=2;var i=qu;qu|=4;try{su(e,t.alternate,t)}finally{qu=i,W.p=r,U.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Ee();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),at(r),n=n.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=U.T,a=W.p,W.p=2,U.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{U.T=n,W.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=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);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Sa(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=at(bd),r=U.T,i=W.p;try{W.p=32>n?32:n,U.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,qu&6)throw Error(a(331));var c=qu;if(qu|=4,Hu(o.current),Pu(o,o.current,s,n),qu=c,Ef(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{W.p=i,U.T=r,cf(e,t)}}function df(e,t,n){t=ji(n,t),t=yc(e.stateNode,t,2),e=oo(e,t,2),e!==null&&($e(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=ji(n,e),n=bc(2),r=oo(t,n,2),r!==null&&(xc(n,r,t,e),$e(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ku;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)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ju===e&&(Xu&n)===n&&(rd===4||rd===3&&(Xu&62914560)===Xu&&300>De()-fd?qu&2?od|=n:zd(e,0):od|=n,cd===Xu&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=Ze()),e=gi(e,t),e!==null&&($e(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return Ce(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Xu,a=qe(r,r===Ju?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&gp()&&(e=wf);for(var t=De(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ju,n=Xu,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),at(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=Af.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Xu;return r=qe(e,e===Ju?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,De()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){xp(function(){qu&6?Ce(ke,Df):Of()})}function Nf(){if(wf===0){var e=Oa;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new On(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Gs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Gs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ri.length;If++){var Lf=ri[If];ii(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Ot(`onMouseEnter`,[`mouseout`,`mouseover`]),Ot(`onMouseLeave`,[`mouseout`,`mouseover`]),Ot(`onPointerEnter`,[`pointerout`,`pointerover`]),Ot(`onPointerLeave`,[`pointerout`,`pointerover`]),Dt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Dt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Dt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Dt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(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){li(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){li(e)}i.currentTarget=null,a=c}}}}function Vf(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Tt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!_n||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 Kf(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=yt(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}mn(function(){var r=a,i=ln(n),o=[];a:{var c=ni.get(e);if(c!==void 0){var l=On,u=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:l=Kn;break;case`focusin`:u=`focus`,l=Ln;break;case`focusout`:u=`blur`,l=Ln;break;case`beforeblur`:case`afterblur`:l=Ln;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=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Yn;break;case Yr:case Xr:case Zr:l=Rn;break;case ti:l=Xn;break;case`scroll`:case`scrollend`:l=An;break;case`wheel`:l=Zn;break;case`copy`:case`cut`:case`paste`:l=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=qn;break;case`submit`:l=Jn;break;case`toggle`:case`beforetoggle`:l=Qn}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=hn(m,p),g!=null&&d.push(qf(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!==cn&&(u=n.relatedTarget||n.fromElement)&&(yt(u)||u[dt]))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?yt(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=Fn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:xt(c),h=l==null?u:xt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,yt(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,Yf):null,c!==null&&Xf(o,u,c,d,!1),l!==null&&f!==null&&Xf(o,f,l,d,!0)))}a:{if(c=r?xt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=vr;else if(fr(c)){if(yr)_=Or;else{_=Er;var v=Tr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&nn(r.elementType)&&(_=vr):_=Dr;if(_&&=_(e,r)){pr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?xt(r):window,e){case`focusin`:(fr(v)||v.contentEditable===`true`)&&(zr=v,Br=r,Vr=null);break;case`focusout`:Vr=Br=zr=null;break;case`mousedown`:Hr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Hr=!1,Ur(o,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(o,n,i)}var y;if(er)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 cr?or(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(rr&&n.locale!==`ko`&&(cr||b!==`onCompositionStart`?b===`onCompositionEnd`&&cr&&(y=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,cr=!0)),v=Jf(r,b),0<v.length&&(b=new Bn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=sr(n),y!==null&&(b.data=y)))),(y=nr?lr(e,n):ur(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=hn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=hn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=hn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=hn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
62
- `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||Qt(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&Qt(e,``+r);else return;break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);return;case`data`:if(t!==`object`){It(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=on(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`&&tp(e,t,`name`,i.name,i,null),tp(e,t,`formEncType`,i.formEncType,i,null),tp(e,t,`formMethod`,i.formMethod,i,null),tp(e,t,`formTarget`,i.formTarget,i,null)):(tp(e,t,`encType`,i.encType,i,null),tp(e,t,`method`,i.method,i,null),tp(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);return;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`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=on(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`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(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=rn.get(n)||n,Ft(e,n,r);else return}Nt=!0}function np(e,t,n,r,i,o){switch(n){case`style`:tn(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`)Qt(e,r);else if(typeof r==`number`||typeof r==`bigint`)Qt(e,``+r);else return;break;case`onScroll`:r!=null&&Vf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Vf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Et.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[ut]||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}Nt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}return}Nt=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Vf(`error`,e),Vf(`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:tp(e,t,o,s,n,null)}}i&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Vf(`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:tp(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Vf(`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:tp(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in Vf(`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:tp(e,t,s,c,n,null)}Zt(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:tp(e,t,l,r,n,null)}return;case`dialog`:Vf(`beforetoggle`,e),Vf(`toggle`,e),Vf(`cancel`,e),Vf(`close`,e);break;case`iframe`:case`object`:Vf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)Vf(Rf[r],e);break;case`image`:Vf(`error`,e),Vf(`load`,e);break;case`details`:Vf(`toggle`,e);break;case`embed`:case`source`:case`link`:Vf(`error`,e),Vf(`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:tp(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(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&&(Nt=!0),o=m;break;case`name`:m!==f&&(Nt=!0),i=m;break;case`checked`:m!==f&&(Nt=!0),u=m;break;case`defaultChecked`:m!==f&&(Nt=!0),d=m;break;case`value`:m!==f&&(Nt=!0),s=m;break;case`defaultValue`:m!==f&&(Nt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}Gt(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)||tp(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&&(Nt=!0),p=o;break;case`defaultValue`:o!==l&&(Nt=!0),c=o;break;case`multiple`:o!==l&&(Nt=!0),s=o;default:o!==l&&tp(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(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:tp(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&&(Nt=!0),p=i;break;case`defaultValue`:i!==o&&(Nt=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&tp(e,t,s,i,r,o)}Xt(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:tp(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&&(Nt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[lt]=r,n[ut]=t,rp(n,e,t),Ct(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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),Uh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Uh(t)}function Tp(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 Ep(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 Dp(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 Op(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 kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(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`&&(jp(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+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.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 Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.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},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.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(Vp(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=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.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,zp(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,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=v(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=up(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(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}Ip.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Up,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||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=yt(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 Qp(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)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Up,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),Qp(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),Qp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=v(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[gt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(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 hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===sn&&(e.onclick=null),vt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var ym=new Map,bm=new Set;function xm(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 Sm=W.d;W.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Ld();return e||t}function wm(e){var t=bt(e);t!==null&&t.tag===5&&t.type===`form`?qs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[_t]=!0,o.onload=o.onerror=function(){wt(o)}),Ct(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=T({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=St(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);Ct(c),rp(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=St(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Ct(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=St(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Ct(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var i=(i=de.current)?xm(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=Fm(n.href),t=St(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=Fm(n.href);var o=St(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.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},ym.set(e,o)),Rm(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=zm(n),t=St(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 Fm(e){return`href="`+Wt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[_t]){r.loading=1;return}}else t=e.createElement(`link`),t[_t]=!0,t.onload=t.onerror=wt.bind(null,t),rp(t,`link`,n),Ct(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 zm(e){return`[src="`+Wt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Ct(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`),Ct(r),rp(r,`style`,i),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Fm(n.href);var o=e.querySelector(Im(i));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Lm(n),(i=ym.get(i))&&Um(r,i),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(i=e.querySelector(Bm(o)))?(t.instance=i,Ct(i),i):(r=n,(i=ym.get(o))&&(r=T({},n),Wm(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ct(i),rp(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[gt]||a[lt]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:M,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function lh(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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(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 uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=xi(3,null,null,t),e.current=a,a.stateNode=e,t=xa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ro(a),e}function dh(e){return e?(e=yi,e):yi}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=ao(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=oo(e,r,t),n!==null&&(Md(n,e,t),so(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&Md(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=kd();t=it(t);var n=gi(e,t);n!==null&&Md(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=2,bh(e,t,n,r)}finally{W.p=a,U.T=i}}function yh(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=8,bh(e,t,n,r)}finally{W.p=a,U.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Kf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(qu&6)&&(md=De()+500,Ef(0,!1))}}break;case 31:case 13:s=gi(a,2),s!==null&&Md(s,a,2),Ld(),mh(a,2)}if(a=xh(r),a===null&&Kf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function xh(e){return e=ln(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=yt(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 Sh=e,null}function wh(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=bt(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function Ih(e){var t=yt(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,st(e.priority,function(){gh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,st(e.priority,function(){gh(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 Lh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=bt(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rh(e,t,n){Lh(e)&&n.delete(t)}function zh(){Th=!1,Eh!==null&&Lh(Eh)&&(Eh=null),Dh!==null&&Lh(Dh)&&(Dh=null),Oh!==null&&Lh(Oh)&&(Oh=null),kh.forEach(Rh),Ah.forEach(Rh)}function Bh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zh)))}var Vh=null;function Hh(e){Vh!==e&&(Vh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vh===e&&(Vh=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(Ch(r||n)===null)continue;break}var a=bt(n);a!==null&&(e.splice(t,3),t-=3,Gs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Uh(e){function t(t){return Bh(t,e)}Eh!==null&&Bh(Eh,e),Dh!==null&&Bh(Dh,e),Oh!==null&&Bh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)Ih(n),n.blockedOn===null&&jh.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[ut]||null;if(typeof a==`function`)o||Hh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hh(n)}}}function Wh(){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 Gh(e){this._internalRoot=e}Kh.prototype.render=Gh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;fh(n,kd(),e,t,null,null)},Kh.prototype.unmount=Gh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),Ld(),t[dt]=null}};function Kh(e){this._internalRoot=e}Kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&Ih(e)}};var qh=n.version;if(qh!==`19.3.1`)throw Error(a(527,qh,`19.3.1`));W.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 Jh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:U,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{Ie=Yh.inject(Jh),Le=Yh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=mc,s=hc,c=gc;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=uh(e,1,!1,null,null,n,r,null,i,s,c,Wh),e[dt]=t.current,Wf(e),new Gh(t)}})),Pu=n(((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=Nu()})),Fu={name:`alarm-clock-off`,size:24,node:[[`path`,{d:`M6.87 6.87a8 8 0 1 0 11.26 11.26`,key:`3on8tj`}],[`path`,{d:`M19.9 14.25a8 8 0 0 0-9.15-9.15`,key:`15ghsc`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.26 18.67 4 21`,key:`yzmioq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M4 4 2 6`,key:`1ycko6`}]]};Fu.node;var Iu=ci(Fu),Lu={name:`alarm-clock`,size:24,node:[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]};Lu.node;var Ru=ci(Lu),zu={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};zu.node;var Bu=ci(zu),Vu={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`}]]};Vu.node;var Hu=ci(Vu),Uu={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`}]]};Uu.node;var Wu=ci(Uu),Gu={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`}]]};Gu.node;var Ku=ci(Gu),qu={name:`calendar-range`,size:24,node:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M17 13h-6`,key:`1qbiup`}],[`path`,{d:`M13 17H7`,key:`1x38vv`}],[`path`,{d:`M7 13h.01`,key:`1vezk1`}],[`path`,{d:`M17 17h.01`,key:`1sd3ek`}]]};qu.node;var Ju=ci(qu),Yu={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`]};Yu.node;var Xu=ci(Yu),Zu={name:`chart-gantt`,size:24,node:[[`path`,{d:`M10 6h8`,key:`zvc2xc`}],[`path`,{d:`M12 16h6`,key:`yi5mkt`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M8 11h7`,key:`wz2hg0`}]]};Zu.node;var Qu=ci(Zu),$u={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};$u.node;var ed=ci($u),td={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};td.node;var nd=ci(td),rd={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};rd.node;var id=ci(rd),ad={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};ad.node;var od=ci(ad),sd={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};sd.node;var cd=ci(sd),ld={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`}]]};ld.node;var ud=ci(ld),dd={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`}]]};dd.node;var fd=ci(dd),pd={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`}]]};pd.node;var md=ci(pd),hd={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`]};hd.node;var gd=ci(hd),_d={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`}]]};_d.node;var vd=ci(_d),yd={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`}]]};yd.node;var bd=ci(yd),xd={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`}]]};xd.node;var Sd=ci(xd),Cd={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`}]]};Cd.node;var wd=ci(Cd),Td={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`}]]};Td.node;var Ed=ci(Td),Dd={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Dd.node;var Od=ci(Dd),kd={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`]};kd.node;var Ad=ci(kd),jd={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`}]]};jd.node;var Md=ci(jd),Nd={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};Nd.node;var Pd=ci(Nd),Fd={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Fd.node;var Id=ci(Fd),Ld={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`}]]};Ld.node;var Rd=ci(Ld),zd={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`}]]};zd.node;var Bd=ci(zd),Vd={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`}]]};Vd.node;var Hd=ci(Vd),Ud={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`}]]};Ud.node;var Wd=ci(Ud),Gd={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`}]]};Gd.node;var Kd=ci(Gd),qd={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`}]]};qd.node;var Jd=ci(qd),Yd={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`}]]};Yd.node;var Xd=ci(Yd),Zd={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`}]]};Zd.node;var Qd=ci(Zd),$d={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};$d.node;var ef=ci($d),tf={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`}]]};tf.node;var nf=ci(tf),rf={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`}]]};rf.node;var af=ci(rf),of={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};of.node;var sf=ci(of),cf={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`}]]};cf.node;var lf=ci(cf),uf={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`}]]};uf.node;var df=ci(uf),ff={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`}]]};ff.node;var pf=ci(ff),mf={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`}]]};mf.node;var hf=ci(mf),gf={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};gf.node;var _f=ci(gf),vf={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`}]]};vf.node;var yf=ci(vf),bf={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`]};bf.node;var xf=ci(bf),Sf={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};Sf.node;var Cf=ci(Sf),wf={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};wf.node;var Tf=ci(wf),Ef={x1odsvnm:`x1odsvnm`,$$css:!0};function Df(e,t=!1){let n=(0,Z.useCallback)(t=>{let n=e.current?.firstElementChild;n instanceof HTMLElement&&Object.assign(n.style,t?me:q)},[e]),r=(0,Z.useCallback)(e=>{if(t)return;let r=e.target;r instanceof HTMLElement&&!r.matches(`:focus-visible`)||n(!0)},[t,n]),i=(0,Z.useCallback)(()=>n(!1),[n]);return(0,Z.useMemo)(()=>({focusProps:{onFocus:r,onBlur:i}}),[r,i])}var Of=new Map;function kf(e,t){let n=Bi(t,e);if(n==null)return null;let r=v([e,n],t),i=performance.now(),a=n.ownerDocument.defaultView,o=!1,s=Ci(()=>{o=!0}),c=[],l=a==null?()=>{}:K(a,`contextmenu`,e=>{c.push(e)}),u=()=>c.some(e=>e.defaultPrevented);return e=>{r(),s(),o?(e&&ae(n.ownerDocument,{cancelsTouchEnd:!0}),l()):!e||performance.now()-i<500||u()?l():Af(n,u,l)}}function Af(e,t,n){Of.get(e)?.();let r=e.ownerDocument.defaultView;if(r==null){n();return}let i=null,a=K(r,`touchend`,e=>{i??=e}),o=[a,K(r,`pointerdown`,()=>{a(),n()}),n],s=null,c=()=>{for(let e of o)e();s?.(),s=null,Of.get(e)===c&&Of.delete(e)};Of.set(e,c),s=ji(e,{onClicked:()=>{s=null,c()},onNoClick:()=>{if(s=null,c(),i?.defaultPrevented===!0||t())return;let n=e.querySelector(`input`);n!=null&&n.isConnected&&Pi(n)}})}function jf(){for(let e of[...Of.values()])e()}function Mf(){qi({start:kf,endWaits:jf})}var Nf={"@astryx.spinner.loading":`Loading`},Pf=Bt(`CheckboxRowPressContext`,1,!1);Pf.displayName=`CheckboxRowPressContext`,ht(Nf),Mf();var Ff={container:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1s448w1`,$$css:!0},containerLabelHidden:{kOIVth:`xxhr3t`,$$css:!0},hitAreaHost:{kVAEAm:`xrxqdxo`,$$css:!0},indicatorRowPressImage:{"--_indicator-press-image":`x1y1g3jp`,"--_indicator-active-press":`x1bl9l2n`,$$css:!0},checkboxWrapper:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kHBbk8:`xc8icb0`,$$css:!0},indicatorPressOverlay:{k5JduY:`x1s928wv xf7ekc6`,kwXMNM:`x1j6awrg`,kv0HGH:`xarstr8`,kUfP38:`xtb6wbx`,kloYau:`x2q1x1w`,$$css:!0},indicatorRowPressOverlay:{ks3ayO:`xyhc2n1`,kNctxI:`xlvbopx`,$$css:!0},input:{kVAEAm:`x10l6tqk`,k87sOh:`xwa60dl`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kSiTet:`xg01cxk`,kkrTdU:`x1ypdohk x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},inputCoarse:{kjFi6P:`xkagaj0`,kHzOjL:`x80b3aj`,$$css:!0},inputDisabled:{kkrTdU:`xt0e3qv`,$$css:!0}},If={sm:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`xvy4d1p`,kZKoxP:`xxk0z11`,$$css:!0}},Lf={width:e=>[{kzqmXN:e==null?e:`x5lhr3w`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function Rf({id:e,label:t,isLabelHidden:n=!1,description:r,onChange:i,changeAction:a,isLoading:o=!1,value:s,isDisabled:c=!1,htmlName:l,disabledMessage:u,isReadOnly:d=!1,isOptional:f=!1,isRequired:p=!1,size:m=`md`,onFocus:h,onBlur:g,labelIcon:_,status:v,width:y,xstyle:b,className:x,style:S,ref:C,"aria-describedby":w,...T}){let E=Tt(),D=(0,Z.use)(Pf),O=!c&&!D,k=(0,Z.useId)(),A=e||k,j=(0,Z.useId)(),ee=(0,Z.useId)(),[,M]=(0,Z.useTransition)(),[N,P]=(0,Z.useOptimistic)(s),F=o||N!==s,I=c&&!!u,L=(0,Z.useId)(),R=Qt(),z=Ei(`checkbox`),te=(0,Z.useRef)(null),B=at();pi(F,B(`@astryx.spinner.loading`),te);let{focusProps:ne}=Df(te),re=!n&&!c&&!d,ie=(0,Z.useRef)(null),V=dt(re),ae=(0,Z.useRef)(null),H=Vt(ae,V),U=(0,Z.useRef)(null),W=e=>{U.current=e.target===e.currentTarget?{x:e.clientX,y:e.clientY}:null},oe=e=>{let t=U.current;if(U.current=null,t==null||e.detail===0||e.target!==e.currentTarget)return;let n=e.currentTarget.getBoundingClientRect();(t.x<n.left||t.x>n.right||t.y<n.top||t.y>n.bottom)&&ie.current?.click()},G=N===`indeterminate`,K=N===!0,se=(0,Z.useCallback)(e=>{e&&(e.indeterminate=G)},[G]),q=[];w&&q.push(w),r&&q.push(j),v?.message&&q.push(ee),I&&q.push(L);let ce=q.length>0?q.join(` `):void 0;return(0,Q.jsxs)(`div`,{...hn(ye(`checkbox-input`,{size:m}),J(y!=null&&Lf.width(y),b),x,S),children:[(0,Q.jsxs)(`div`,{ref:H,onPointerDown:re?W:void 0,onClick:re?oe:void 0,...O?E:void 0,...J(Ff.container,n&&Ff.containerLabelHidden,re&&Ff.hitAreaHost,re&&ut.layer,!c&&Ef,!c&&(D?Ff.indicatorRowPressImage:Ot.handDown),O&&kt.pressedAlpha),children:[(0,Q.jsxs)(`div`,{...c?void 0:Li,...J(Ff.checkboxWrapper,!c&&Ff.indicatorPressOverlay,!c&&(D?Ff.indicatorRowPressOverlay:[Ot.activeFill,Ot.image])),...ne,children:[(0,Q.jsx)(`input`,{...Qi(T,c),ref:Vt(C,se,ie),id:A,type:`checkbox`,name:c?void 0:l,checked:K,"aria-disabled":c?`true`:void 0,form:c?``:void 0,onClick:c?void 0:T.onClick,readOnly:d,required:p,"aria-required":p?`true`:void 0,onChange:e=>{if(c||F||d){e.target.indeterminate=G;return}let t=e.target.checked;i?.(t,e),a&&!e.defaultPrevented&&M(async()=>{P(t),await a(t,e)})},onFocus:h,onBlur:g,"aria-readonly":d||void 0,"aria-describedby":ce,"aria-invalid":v?.type===`error`||!p&&void 0,"aria-busy":F||void 0,...J(Ff.input,Ti.centerInline(`-50%`),Ff.inputCoarse,If[m],c&&Ff.inputDisabled)}),(0,Q.jsx)(`span`,{ref:te,className:`xjp7ctv`,children:(0,Q.jsx)(z,{state:G?`indeterminate`:K?`checked`:`unchecked`,size:m,isDisabled:c,children:F?(0,Q.jsx)(wt,{size:`sm`,shade:`inherit`}):null})})]}),(0,Q.jsx)(`div`,{className:`x78zum5 xdt5ytf`,children:(0,Q.jsx)(wi,{...ye(`checkbox-label`),label:t,inputID:A,isLabelHidden:n,isDisabled:c,isOptional:f,isRequired:p,labelIcon:_,description:r,descriptionID:j})})]}),v?.message&&(0,Q.jsx)(di,{type:v.type,message:v.message,id:ee,variant:`detached`}),c&&u?(0,Q.jsxs)(Q.Fragment,{children:[R?(0,Q.jsx)(St,{id:L,children:u}):null,(0,Q.jsx)(zf,{message:u,messageID:R?void 0:L,rowRef:ae,inputRef:ie})]}):null]})}function zf({message:e,messageID:t,rowRef:n,inputRef:r}){let i=Ki({placement:`above`,focusTrigger:`always`}),{interactionRef:a,positionRef:o}=i;return G(()=>(a(n.current),o(r.current),()=>{a(null),o(null)}),[a,o,n,r]),i.renderTooltip((0,Q.jsx)(`span`,{id:t,children:e}))}Rf.displayName=`CheckboxInput`;var Bf={gregory:!0,iso8601:!0,buddhist:!0,roc:!0,japanese:!0,persian:!0,indian:!0,hebrew:!0,chinese:!0,dangi:!0,coptic:!0,ethiopic:!0,ethioaa:!0,"islamic-civil":!0,"islamic-tbla":!0,"islamic-umalqura":!0};Object.keys(Bf);var Vf=new Set([`gregory`,`iso8601`,`buddhist`,`roc`,`japanese`]);function Hf(e){return e===`gregory`||e===`iso8601`}function Uf(e){return Vf.has(e)}function Wf(e){return Object.hasOwn(Bf,e)}function Gf(){let e=globalThis.Temporal;return typeof e?.PlainDate==`function`?e:void 0}var Kf=new WeakMap;function qf(e){if(Uf(e))return!0;let t=Gf();if(t==null)return!1;let n=Kf.get(t);n??(n=new Map,Kf.set(t,n));let r=n.get(e);if(r==null){try{new t.PlainDate(2e3,1,1,e),r=!0}catch{r=!1}n.set(e,r)}return r}function Jf(e,t){let n=Gf();if(n==null)throw Error(`The "${e}" calendar needs Temporal.`);return new n.PlainDate(t.year,t.month,t.day,e)}function Yf(e){let t=e.withCalendar(`iso8601`);return{year:t.year,month:t.month,day:t.day}}function Xf(e,t){return{start:e,end:Wp(e,t-1),length:t}}function Zf(e,t){return Xf({year:e,month:t,day:1},Vp(e,t))}function Qf(e){return Xf(Yf(e),e.daysInMonth)}function $f(e,t){return Uf(e)?t.day:Jf(e,t).day}function ep(e,t){return Uf(e)?Zf(t.year,t.month):Qf(Jf(e,t).with({day:1}))}var tp={buddhist:543,roc:-1911};function np(e,t){if(Uf(e))return{year:t.start.year+(tp[e]??0),month:t.start.month};let{year:n,month:r}=Jf(e,t.start);return{year:n,month:r}}function rp(e,{year:t,month:n}){if(Uf(e)){let r=Math.min(n,wp(e,t));return Zf(t-(tp[e]??0),r)}return Qf(Jf(e,{year:2e3,month:1,day:1}).with({year:t,month:n,day:1}))}function ip(e,t,n){if(n===0)return t;if(Uf(e)){let{year:e,month:r}=Up(t.start,n);return Zf(e,r)}return Qf(Jf(e,t.start).add({months:n}))}function ap(e,t,n){return Uf(e)?Up(t,n):Yf(Jf(e,t).add({months:n}))}function op(e,t,n){return Uf(e)?Up(t,n*12):Yf(Jf(e,t).add({years:n}))}function sp(e,t){return Zp(e,[t.start,t.end])}function cp(e){return Wp(e.start,Math.floor(e.length/2))}function lp(e,t,n,r){return im(r!=null&&up(e,t,n)?Wp(t.start,Math.min(Math.max(r,1),t.length)-1):cp(t),n,dp(e))}function up(e,t,n){return!Hf(e)&&Dp(e,t.start,n).era!==Dp(e,t.end,n).era}function dp(e){return e===`iso8601`?`gregory`:e}function fp(e,t,n,r){return lm(t,{...n,calendar:e},r)}var pp=new Set([`era`,`year`,`relatedYear`,`yearName`,`month`]);function mp(e){return e.filter(e=>pp.has(e.type)).map(e=>e.value).join(`|`)}function hp(e,t,n,r,i){return yp(gp(e,t,n,r,i))}function gp(e,t,n,r,{relatedYear:i=!1}={}){let a=vp(e,t,fp(dp(e),t,n,r),n,r);return i?_p(e,t,a,n,r):a}function _p(e,t,n,r,i){if(e!==`chinese`&&e!==`dangi`||!qf(e)||n.some(e=>e.type===`relatedYear`))return n;let{numberingSystem:a}=pm(i,{...r,calendar:e,timeZone:`UTC`}).resolvedOptions(),{year:o}=Jf(e,t),s=gm(o,i,a);return n.map(e=>/^year(Name)?$/.test(e.type)?{...e,value:s}:e)}function vp(e,t,n,r,i){if(Uf(e)||!qf(e))return n;let a=Jf(e,t),o=fp(e,Wp(t,Math.floor(a.daysInMonth/2)-(a.day-1)),r,i),s=fp(e,t,{day:`numeric`},`en-u-nu-latn`).find(e=>e.type===`day`)?.value;if(Number(s)===a.day&&mp(n)===mp(o))return n;let{numberingSystem:c}=pm(i,{...r,calendar:e,timeZone:`UTC`}).resolvedOptions(),l=new Map(o.map(e=>[e.type,e.value]));return n.map(e=>e.type===`day`?{...e,value:gm(a.day,i,c)}:pp.has(e.type)?{...e,value:l.get(e.type)??e.value}:e)}function yp(e){return e.map(e=>e.value).join(``)}function bp(e,t){let n=Gf();if(n==null)throw Error(`The "${e}" calendar needs Temporal.`);try{return Yf(n.PlainDate.from({...t,calendar:e},{overflow:`reject`}))}catch(e){if(e instanceof RangeError||e instanceof TypeError)return null;throw e}}function xp(e,t){return Uf(e)?12:Jf(e,t).monthsInYear}function Sp(e,t,n){return Uf(e)?(n.start.year-t.start.year)*12+(n.start.month-t.start.month):Jf(e,t.start).until(Jf(e,n.start),{largestUnit:`months`}).months}function Cp(e,t,n){return Uf(e)?Zf(t,n):rp(e,{year:t,month:n})}function wp(e,t){return Uf(e)?12:xp(e,Cp(e,t,1).start)}function Tp(e,t,n){return hp(e,Wp(t.start,Math.floor(t.length/2)),om,n)}var Ep=new Set([`era`,`year`,`relatedYear`]);function Dp(e,t,n){let r=fp(e,t,{era:`short`,year:`numeric`,month:`long`,day:`numeric`},n),i=r.find(e=>e.type===`era`)?.value,a=r.findIndex(e=>Ep.has(e.type));if(a===-1)return{era:i,label:null};let o=a;return r.forEach((e,t)=>{Ep.has(e.type)&&(o=t)}),{era:i,label:r.slice(a,o+1).filter(e=>Ep.has(e.type)||e.type===`literal`).map(e=>e.value).join(``).replace(/\s+/g,` `).trim()}}function Op(e,t,n){if(Hf(e))return!1;let r=wp(e,t),i=Dp(e,Cp(e,t,1).start,n),a=Dp(e,Cp(e,t,r).end,n);return i.era!==a.era&&i.label!=null&&a.label!=null}function kp(e,t,n,r){if(Hf(e))return String(t);let i=wp(e,t);if(r!=null&&Op(e,t,n)){let a=Cp(e,t,Math.min(Math.max(r.month,1),i)),o=Math.min(Math.max(r.day,1),a.length);return Dp(e,Wp(a.start,o-1),n).label??String(t)}return Dp(e,Cp(e,t,Math.floor(i/2)+1).start,n).label??String(t)}var Ap=typeof Intl.Segmenter==`function`?new Intl.Segmenter(void 0,{granularity:`grapheme`}):null;function jp(e){return Ap?[...Ap.segment(e)].map(e=>e.segment):[...e]}function Mp(e){return e===``?0:jp(e).length}function Np(e){if(Ap){let t=Ap.segment(e)[Symbol.iterator]().next();return t.done?``:t.value.segment}let t=e.codePointAt(0);return t==null?``:String.fromCodePoint(t)}var Pp=new Set([`es`,`fr`,`it`,`nl`,`pl`,`ru`,`uk`]);function Fp(e,t,n){if(!Number.isInteger(e)||e<1)throw RangeError(`year must be a positive integer, got ${e}`);if(!Number.isInteger(t)||t<1||t>12)throw RangeError(`month must be 1–12, got ${t}`);let r=Vp(e,t);if(!Number.isInteger(n)||n<1||n>r)throw RangeError(`day must be 1–${r} for ${e}-${String(t).padStart(2,`0`)}, got ${n}`);return{year:e,month:t,day:n}}function Ip(e){let[t,n,r]=e.split(`-`).map(Number);return Fp(t,n,r)}function Lp(e){return`${String(e.year).padStart(4,`0`)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`}function Rp(e){let t=new Date(0,0,1);return t.setFullYear(e.year,e.month-1,e.day),t}function zp(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function Bp(){return zp(new Date)}function Vp(e,t){return t===2?e%4==0&&e%100!=0||e%400==0?29:28:[0,31,0,31,30,31,30,31,31,30,31,30,31][t]}function Hp(e){return Rp(e).getDay()}function Up(e,t){let n=e.year*12+(e.month-1)+t,r=Math.floor(n/12),i=(n%12+12)%12+1;return{year:r,month:i,day:Math.min(e.day,Vp(r,i))}}function Wp(e,t){let n=Rp(e);return n.setDate(n.getDate()+t),zp(n)}function Gp(e,t,n,r=0,i=0,a=0){let o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(r,i,a),o.getTime()}function Kp(e,t){let n=Gp(e.year,e.month-1,e.day),r=Gp(t.year,t.month-1,t.day);return Math.round((r-n)/864e5)}function qp(e,t){return e.year===t.year?e.month===t.month?e.day-t.day:e.month-t.month:e.year-t.year}function Jp(e,t){return qp(e,t)<0}function Yp(e,t){return qp(e,t)>0}function Xp(e,t){return qp(e,t)===0}function Zp(e,t){return qp(e,t[0])>=0&&qp(e,t[1])<=0}function Qp(e,{min:t,max:n,isDateDisabled:r,searchDays:i=366}){let a=e;if(t!=null&&qp(a,t)<0&&(a=t),n!=null&&qp(a,n)>0&&(a=n),r==null||!r(a))return a;let o=e=>(t==null||qp(e,t)>=0)&&(n==null||qp(e,n)<=0)&&!r(e);for(let e=1;e<=i;e+=1){let t=Wp(a,e);if(o(t))return t;let n=Wp(a,-e);if(o(n))return n}return a}function $p(e){let t=864e5,n=Gp(e.year,e.month-1,e.day),r=n+(4-(new Date(n).getUTCDay()||7))*t,i=(r-Gp(new Date(r).getUTCFullYear(),0,1))/t+1;return Math.ceil(i/7)}var em={weekday:`long`,year:`numeric`,month:`long`,day:`numeric`},tm={weekday:`short`,month:`short`,day:`numeric`,year:`numeric`},nm={year:`numeric`,month:`long`,day:`numeric`},rm={year:`numeric`,month:`long`};function im(e,t,n=`gregory`){let r=cm(e,{...rm,calendar:n},t),i;try{i=new Intl.Locale(t).language}catch{return r}if(!Pp.has(i))return r;let a=Np(r);return a.toLocaleUpperCase(t)+r.slice(a.length)}function am(e,t=`short`){let n={weekday:t},r=pm(e,{...n,calendar:`gregory`}).resolvedOptions().locale;return new Intl.Locale(r).language===new Intl.Locale(e).language?Array.from({length:7},(t,r)=>cm({year:1970,month:1,day:4+r},n,e)):null}var om={month:`long`},sm={month:`short`,day:`numeric`,year:`numeric`};function cm(e,t,n=`en`){let r=t.calendar??`gregory`;if(r!==`gregory`&&Wf(r))return hp(r,e,t,n);let[i,a]=um(e,t,n);return i.format(a)}function lm(e,t,n){let[r,i]=um(e,t,n);return r.formatToParts(i)}function um(e,t,n){let r=t.calendar??`gregory`;return t.timeZone==null?dm.some(e=>t[e]!=null)?[new Intl.DateTimeFormat(n,{...t,calendar:r}),Rp(e)]:[pm(n,{...t,calendar:r,timeZone:`UTC`}),Gp(e.year,e.month-1,e.day)]:[pm(n,{...t,calendar:r}),Rp(e)]}var dm=[`timeZoneName`,`hour`,`minute`,`second`,`fractionalSecondDigits`,`dayPeriod`,`timeStyle`],fm=new Map;function pm(e,t){let n=JSON.stringify([e,Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))]),r=fm.get(n);return r??(r=new Intl.DateTimeFormat(e,t),fm.set(n,r)),r}function mm(e=`en`){try{let t=new Intl.DisplayNames(e,{type:`dateTimeField`}).of(`weekOfYear`);if(t!=null&&t!==``)return t}catch{}return`week`}var hm=new Map;function gm(e,t,n){let r=`${t}|${n??``}`,i=hm.get(r);return i??(i=new Intl.NumberFormat(t,{useGrouping:!1,numberingSystem:n}),hm.set(r,i)),i.format(e)}var _m={date:sm,date_long:nm,date_weekday:tm};function vm(e,t,n=`en`,r=`gregory`){return t===`system_date`?Lp(e):cm(e,{..._m[t],calendar:r},n)}function ym(e=`en`){let t=new Intl.DateTimeFormat(e,{calendar:`gregory`}).formatToParts(new Date(2e3,0,15));return t.findIndex(e=>e.type===`day`)<t.findIndex(e=>e.type===`month`)}var bm=RegExp(`^[^\\p{L}]+$`,`u`),xm=RegExp(`^\\d{4}[^\\p{L}\\d]`,`u`);function Sm(e,t=`en`){let n=e.trim();if(!n)return null;let r=new Date().getFullYear(),i=n.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(i){let[,e,t,n]=i;return Tm(+e,+t,+n)}let a=n.match(/^([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4})$/);if(a){let[,e,t,n]=a,r=wm(e);if(r!==null)return Tm(+n,r,+t)}let o=n.match(/^(\d{1,2})\s+([A-Za-z]+),?\s+(\d{4})$/);if(o){let[,e,t,n]=o,r=wm(t);if(r!==null)return Tm(+n,r,+e)}let s=n.match(/^([A-Za-z]+)\s+(\d{1,2})$/);if(s){let[,e,t]=s,n=wm(e);if(n!==null)return Tm(r,n,+t)}let c=n.match(/^(\d{1,2})\s+([A-Za-z]+)$/);if(c){let[,e,t]=c,n=wm(t);if(n!==null)return Tm(r,n,+e)}let l=n.match(/^(\d{1,2})([-/.])(\d{1,2})([-/.])(\d{4})$/);if(l){let[,e,n,r,i,a]=l;return n===i?Cm(+e,+r,+a,t):null}let u=n.match(/^(\d{1,2})[-/.](\d{1,2})$/);if(u){let[,e,n]=u;return Cm(+e,+n,r,t)}if(/^\d+$/.test(n)||ym(t)&&bm.test(n)&&!xm.test(n))return null;let d=new Date(n);if(!isNaN(d.getTime())){let e=zp(d);return Tm(e.year,e.month,e.day)}return null}function Cm(e,t,n,r){let i,a;if(e>12&&t<=12)i=e,a=t;else if(t>12&&e<=12)a=e,i=t;else if(e>12&&t>12)return null;else ym(r)?(i=e,a=t):(a=e,i=t);return Tm(n,a,i)}function wm(e){return{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,sept:9,october:10,oct:10,november:11,nov:11,december:12,dec:12}[e.toLowerCase()]??null}function Tm(e,t,n){try{return Fp(e,t,n)}catch{return null}}function Em(e,t){return Wf(e)?e:(`${e}`,`${e}`,`gregory`)}function Dm(e,t){return qf(e)?e:(`${e}`,`${e}`,`gregory`)}function Om(e,t){return Dm(Em(e,t),t)}function km(e,t){let n=(0,Z.use)(st);return Om(e??n.calendar??`gregory`,t)}function Am(){return(0,Z.use)(st).locale}function jm(){return(0,Z.use)(st).direction}var Mm=RegExp(`\\p{Nd}`,`u`),Nm=/[\u200B-\u200D\u200E\u200F\u061C\u2066-\u2069\uFEFF]/g;function Pm(e){let t=e.codePointAt(0);if(t==null||!Mm.test(e))return null;for(let e=t;t-e<10;e--)if(!Mm.test(String.fromCodePoint(e-1)))return t-e;return null}function Fm(e){let t=``;for(let n of e){if(!Mm.test(n)){t+=n;continue}let e=Pm(n);if(e==null)return null;t+=String(e)}return t}var Im=new Map;function Lm(e){let t=e??``,n=Im.get(t);if(n===void 0){let r;try{r=new Intl.NumberFormat(e)}catch{r=new Intl.NumberFormat(`en`)}let i=r.formatToParts(12345.6),a=r.formatToParts(11111111111).filter(e=>e.type===`integer`).map(e=>e.value.length),o=a.length>1;n={group:(i.find(e=>e.type===`group`)?.value??`,`).normalize(`NFKC`),decimal:i.find(e=>e.type===`decimal`)?.value??`.`,primaryGroupSize:o?a[a.length-1]:3,secondaryGroupSize:o?a[a.length-2]:3},Im.set(t,n)}return n}var Rm=RegExp(`\\p{Sc}`,`u`),zm=`−‒–-`,Bm=RegExp(`^[0-9,.' ’٫٬]+$`),Vm=/^(?:\d+\.?\d*|\.\d+)$/;function Hm(e,t,n,r,i,a){let o=e,s=null;if(n!==``&&e.includes(n)){let t=e.indexOf(n);if(e.includes(n,t+n.length)||(o=e.slice(0,t),s=e.slice(t+n.length),!/^\d*$/.test(s)))return null}let c;if(t!==``&&o.includes(t)){let e=o.split(t);if(e.length-1<a||!e.every(e=>/^\d+$/.test(e)))return null;let n=e[0];if(e[e.length-1].length!==r||n.length>i)return null;for(let t=1;t<e.length-1;t++)if(e[t].length!==i)return null;c=e.join(``)}else{if(!/^\d*$/.test(o))return null;c=o}return c===``&&(s==null||s===``)?null:s==null?c:`${c}.${s}`}function Um(e){return/^[\s'\u2019]$/.test(e)}function Wm(e,t){if(!Bm.test(e))return null;let{group:n,decimal:r,primaryGroupSize:i,secondaryGroupSize:a}=Lm(t),o=Hm(e,n,r,i,a,1);if(o!=null)return o;if(Vm.test(e))return e;let s=[...new Set(e.replace(/\d/g,``))];if(s.length===0||s.length>2)return null;for(let t of s){let n=e.split(t).length-1,r=Um(t)?1:2;if(n<r)continue;let i=s.find(e=>e!==t)??``;if(i!==``&&e.split(i).length-1!=1)continue;let a=Hm(e,t,i,3,3,r);if(a!=null)return a}return null}function Gm(e,t){let n=Fm(e.normalize(`NFKC`).replace(Nm,``));if(n==null)return null;let r=n.trim(),i=1,a=/^\((.*)\)$/s.exec(r);a&&(i=-1,r=a[1].trim()),r=Km(r);let o=!1,s=RegExp(`^([+${zm}])\\s*`).exec(r);if(s)o=!0,i=s[1]===`+`?i:-i,r=r.slice(s[0].length);else{let e=RegExp(`\\s*([+${zm}])$`).exec(r);e&&(o=!0,i=e[1]===`+`?i:-i,r=r.slice(0,r.length-e[0].length))}if(a&&o)return null;r=Km(r);let c=0,l=/\s*[eE]\s*([+-]?\d+)$/.exec(r);l&&(c=Number(l[1]),r=r.slice(0,r.length-l[0].length));let u=r.trim();if(u===``)return null;let d=Wm(u,t);if(d==null)return null;let f=Number(d);if(!Number.isFinite(f))return null;let p=c===0?f:Number((f*10**c).toPrecision(15));if(!Number.isFinite(p))return null;let m=i*p;return Object.is(m,-0)?0:m}function Km(e){let t=e.trim();return Rm.test(t.charAt(0))&&(t=t.slice(1).trim()),Rm.test(t.charAt(t.length-1))&&(t=t.slice(0,-1).trim()),t}function qm(e,t){let{decimal:n}=Lm(t),r=String(e);return n===`.`?r:r.replace(`.`,n)}function Jm(e,t){let n=e.trim();if(n===``)return null;let r=Gm(n,t.locale);return r==null||!Number.isFinite(r)||t.isIntegerOnly&&!Number.isInteger(r)?null:r}function Ym(e,t){let n=Jm(e,t);return n===null||t.min!=null&&n<t.min||t.max!=null&&n>t.max?null:n}function Xm(e){return{min:e.min==null?null:e.isIntegerOnly?Math.ceil(e.min):e.min,max:e.max==null?null:e.isIntegerOnly?Math.floor(e.max):e.max}}function Zm(e,t){let n=e.trim();if(n===``)return null;let r=Gm(n,t.locale);if(r==null||!Number.isFinite(r))return{kind:`unreadable`};if(t.isIntegerOnly&&!Number.isInteger(r))return{kind:`fractional`,value:r};let{min:i,max:a}=Xm(t);return i!=null&&a!=null&&i>a?{kind:`outOfRange`,value:r}:null}function Qm(e,t){if(e.trim()===``)return t.hasClear?{type:`clear`}:{type:`revert`};let n=Jm(e,t);if(n===null)return{type:`revert`};let{min:r,max:i}=Xm(t);if(r!=null&&i!=null&&r>i)return{type:`revert`};let a=r!=null&&n<r?r:i!=null&&n>i?i:n;return{type:`commit`,value:a,didClamp:a!==n}}function $m(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(!Object.is(e[r],t[r]))return!1;return!0}function eh(e){let{entryError:t,rejectionMessage:n,status:r,isStatusAnnounced:i,callerErrorPrecedence:a,onEntryErrorChange:o}=e,[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(null),u=ve(o),d=o!=null,f=d&&!$m(t,s),p=(a===`always`||d)&&r?.type===`error`&&r.message?r.message:null,m=n==null||f||p!=null?r:{type:`error`,message:n},h=m?.type===`error`?m.message??null:null,[g,_]=(0,Z.useState)({message:h,isRepeatable:!0}),v=`${n!=null}:${h}`,[y,b]=(0,Z.useState)(v);d&&v!==y&&(b(v),n==null?g.message===h&&g.isRepeatable||_({message:h,isRepeatable:!0}):g.isRepeatable&&g.message!==h&&_({message:g.message,isRepeatable:!1}));let x=``;if(n!=null&&!f){if(p==null)x=i?``:n;else if(d){let e=g.isRepeatable&&g.message===p;x=!i||e?p:``}else x=n}let S=(0,Z.useCallback)(e=>{o!=null&&(c(e),$m(e,l.current)||(l.current=e,o(e)))},[o]);return(0,Z.useEffect)(()=>{o!=null&&($m(t,l.current)||(l.current=t,o(t)),$m(t,s)||c(t))},[t,s,o]),(0,Z.useEffect)(()=>()=>{l.current!=null&&(l.current=null,u.current?.(null))},[u]),{fieldStatus:m,alertMessage:x,reportEntryError:S}}function th(e,t){let[n,r]=(0,Z.useState)({value:e,keepSignal:t}),i=!Object.is(n.value,e),a=!Object.is(n.keepSignal,t);return!i&&!a?!1:(r({value:e,keepSignal:t}),i&&!a)}var nh={"@astryx.numberInput.clearLabel":`Clear {label}`,"@astryx.numberInput.decrementLabel":`Decrement {label}`,"@astryx.numberInput.incrementLabel":`Increment {label}`,"@astryx.numberInput.invalidNumber":`Invalid number`},rh=Yt(),ih=a[`--spacing-1`],ah=a[`--spacing-2`],oh=`var(--astryx-number-input-padding, ${ih})`,sh=`var(--astryx-number-input-padding-inline, ${`var(--astryx-number-input-padding, ${ah})`})`;`${sh}`,`${sh}`,`${oh}`,`${oh}`;var ch={wrapper:{kY2c9j:`x1vjfegm`,kLKAdn:`x4kswst`,kGO01o:`x3jnfsm`,kZCmMZ:`x1jni19p`,kwRFfy:`x17sfb9`,$$css:!0},wrapperWithNumberSteppers:{kwRFfy:`xyri2b x1r3kph8`,$$css:!0},numberStepperButton:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kMwMTN:`xv9yike`,kWkggS:`x10xzikg`,kkrTdU:`x1ypdohk x16khyan`,kI3sdo:`x1a2a7pz`,$$css:!0},numberStepperButtonDisabled:{kMwMTN:`xqa6c3m`,kkrTdU:`xt0e3qv`,kKwaWg:`x18o3ruo`,$$css:!0},decrementButton:{kEafiO:`x11xkdxz`,kPef9Z:`x13fuv20`,kLZC3w:`x1mly77v`,$$css:!0},incrementIcon:{k3aq6I:`x19jd1h0`,$$css:!0}},lh={sm:{kZKoxP:`x6k0iem`,$$css:!0},md:{kZKoxP:`x1ueg155`,$$css:!0},lg:{kZKoxP:`xssyfek`,$$css:!0}};ht(nh);function uh(e,t){return t==null?null:t.kind===`unreadable`?{kind:`unreadable`,text:e}:{kind:t.kind,text:e,value:t.value}}var dh={delayMs:500,firstIntervalMs:250,acceleration:.9,minIntervalMs:50};function fh(e){let[t,n]=String(e).toLowerCase().split(`e`),r=t.split(`.`)[1]?.length??0,i=n==null?0:Number(n);return Math.max(0,r-i)}function ph(e,t){return e==null||!Number.isFinite(e)||e<=0||t&&!Number.isInteger(e)?1:e}function mh({currentValue:e,direction:t,min:n,max:r,step:i,isIntegerOnly:a}){let o=ph(i,a),s=n!=null&&(!a||Number.isInteger(n))?n:0,c;if(e==null)c=t===1?n??0:r??0,a&&(c=t===1?Math.ceil(c):Math.floor(c));else{let n=(e-s)/o,r=2**-52*Math.max(1,Math.abs(n))*4;c=s+(t===1?Math.floor(n+r)+1:Math.ceil(n-r)-1)*o}let l=Math.min(12,Math.max(fh(o),fh(s)));return c=Number(c.toFixed(l)),n!=null&&(c=Math.max(n,c)),r!=null&&(c=Math.min(r,c)),!Number.isFinite(c)||a&&!Number.isInteger(c)?e:Object.is(c,-0)?0:c}function hh({label:e,isLabelHidden:t=!1,description:n,isOptional:r=!1,isRequired:i=!1,isDisabled:a=!1,isReadOnly:o=!1,disabledMessage:s,startIcon:c,labelIcon:l,status:u,onEntryErrorChange:d,entryErrorBehavior:f,statusVariant:p=`attached`,size:m,onChange:h,value:g,placeholder:_,labelTooltip:y,hasAutoFocus:b=!1,htmlName:x,autoComplete:C,min:w,max:T,step:E,formatValue:D,isWheelEnabled:O=!0,hasNumberSteppers:k=!1,units:A,isIntegerOnly:j=!1,onFocus:ee,onBlur:M,hasClear:N,onEnter:P,onKeyDown:F,width:I,containerXstyle:L,containerClassName:R,containerStyle:z,controlXstyle:te,controlClassName:B,controlStyle:ne,ref:re,id:ie,"aria-describedby":V,"aria-labelledby":ae,...H}){let{rest:U,container:W}=ze(`NumberInput`,H,{containerXstyle:L,containerClassName:R,containerStyle:z}),oe=Tt(),G=at(),K=Am(),se=li({isRequired:i,isOptional:r}),q=aa(m,`md`),ce=(0,Z.useId)(),le=ie??ce,ue=(0,Z.useId)(),de=(0,Z.useId)(),fe=(0,Z.useId)(),pe=(0,Z.useId)(),me=(0,Z.useId)(),he=(0,Z.useRef)(null);ua(he);let ge=(0,Z.useRef)(null),_e=ca(),ve=(0,Z.use)(ra),Y=a||ve.isDisabled,[be,xe]=(0,Z.useState)(null),[Se,Ce]=(0,Z.useState)(null);Se!==null&&(Y||o)&&Ce(null);let[we,Te]=(0,Z.useState)(!1),[Ee,De]=(0,Z.useState)(null),[Oe,ke]=(0,Z.useState)(!1),Ae=(0,Z.useMemo)(()=>({min:w,max:T,isIntegerOnly:j,locale:K}),[j,K,T,w]);Y&&(be!==null||Ee!==null||Oe)&&(xe(null),De(null),ke(!1));let je=th(g,Ee),Me=!1;je&&(Ee!==null||Oe)&&(xe(null),De(null),ke(!1),Me=!0);let[Ne,Pe]=(0,Z.useState)(Ae);if(Ne!==Ae&&(Pe(Ae),!Me&&Ee!==null&&be!==null)){let e=uh(be,Zm(be,Ae));$m(e,Ee)||De(e)}let Ie=Y?null:Ee,Re=Se===null?Ie:null,Ue=G(`@astryx.numberInput.invalidNumber`),{fieldStatus:We,alertMessage:Ge,reportEntryError:Ke}=eh({entryError:Ie,rejectionMessage:Re==null?null:Ue,status:u,isStatusAnnounced:!_e,callerErrorPrecedence:`always`,onEntryErrorChange:d}),Je=(0,Z.useCallback)(()=>{xe(null),De(null),ke(!1),Ke(null)},[Ke]),Ye=Y&&!!s,Ze=Qi(U,Y),Qe=Ki({placement:`above`,focusTrigger:`always`,isEnabled:Ye}),{statusIcon:$e,describedBy:et}=Be({status:We,statusVariant:p,isInGroup:!!_e}),{ariaLabelledBy:nt,ariaDescribedBy:ot}=qe(de,[n?fe:null,!_e&&p!==`tooltip`&&We?.message?pe:null,et,A?me:null,Ye?Qe.describedBy:null],_e),st=ae==null?nt:He(nt??ue,ae),ct=(0,Z.useCallback)(e=>Ym(e,{min:w,max:T,isIntegerOnly:j,locale:K}),[j,K,T,w]),lt=(0,Z.useMemo)(()=>g==null?``:D?.(g)??String(g),[D,g]),ut=(0,Z.useMemo)(()=>Se===null?be===null?g==null?``:we?qm(g,K):lt:be:qm(Se,K),[lt,Se,we,K,be,g]),dt=g==null?``:!D&&we?qm(g,K):String(g),ft=(0,Z.useCallback)(e=>{if(Y||o)return;let t=e.target.value;xe(t),ke(!1),Ee!==null&&Zm(t,Ae)===null&&(De(null),Ke(null))},[Y,o,Ae,Ke,Ee]),pt=(0,Z.useCallback)(e=>{let t=e.currentTarget,n=be??(g==null?``:qm(g,K)),r=t.value.length>0&&t.value!==n&&t.selectionStart===0&&t.selectionEnd===t.value.length;Te(!0),ee?.(e),r&&((0,rh.flushSync)(()=>{}),t.setSelectionRange(0,t.value.length))},[ee,be,g,K]),ht=(0,Z.useCallback)(e=>{if(be===null)return;if(Y){Je();return}let t=uh(be,Zm(be,Ae));if(t!=null){De(t),Ke(t),e===`blur`&&ke(!0);return}De(null),ke(!1),Ke(null);let n=Qm(be,{...Ae,hasClear:!!N});(e===`blur`||n.type===`commit`&&n.didClamp)&&xe(null),n.type===`clear`?N&&g!=null&&h(null):n.type===`commit`&&n.value!==g&&h(n.value)},[Je,N,Y,h,be,Ae,Ke,g]),_t=(0,Z.useCallback)(e=>{ht(`blur`),Te(!1),M?.(e)},[ht,M]),vt=(0,Z.useMemo)(()=>be===null?g??null:be.trim()===``?null:ct(be)??g??null,[ct,be,g]),yt=(0,Z.useCallback)(e=>mh({currentValue:vt,direction:e,min:w,max:T,step:E,isIntegerOnly:j}),[j,T,w,E,vt]),bt=(0,Z.useCallback)(e=>{if(Y||o)return;let t=yt(e);t!=null&&(Je(),t!==g&&h(t))},[Je,yt,Y,o,h,g]),xt=(0,Z.useRef)(null),Ct=(0,Z.useRef)(!1),wt=(0,Z.useRef)(null),Et=(0,Z.useCallback)(()=>{let e=xt.current;e!=null&&(xt.current=null,wt.current=e.held==null?null:e.pointerId,e.timer!=null&&clearTimeout(e.timer),e.unlockSelection?.(),Ce(null))},[]);(0,Z.useEffect)(()=>{let e=xt.current;e!=null&&(Y||o)&&(e.isFrozen=!0,e.timer!=null&&(clearTimeout(e.timer),e.timer=null))},[Y,o]);let Dt=(0,Z.useCallback)(()=>()=>{Et()},[Et]),Ot=(e,t,n)=>{if(Ct.current=!1,wt.current===n.pointerId&&(wt.current=null),Et(),n.button!==0||n.pointerType===`touch`||!t||Y||o)return;let r=yt(e);if(r==null)return;n.currentTarget.setPointerCapture?.(n.pointerId);let i={direction:e,min:w,max:T,step:E,isIntegerOnly:j},a={pointerId:n.pointerId,timer:null,held:null,intervalMs:dh.firstIntervalMs,isFrozen:!1,unlockSelection:S(n.pointerType)?v([n.currentTarget],n.target):null},s=()=>{let e=a.held==null?r:mh({currentValue:a.held,...i});e==null||e===a.held?a.timer=null:(a.held=e,Ce(e),a.timer=setTimeout(s,a.intervalMs),a.intervalMs=Math.max(dh.minIntervalMs,a.intervalMs*dh.acceleration))};a.timer=setTimeout(s,dh.delayMs),xt.current=a},At=e=>{let t=xt.current;t!=null&&(t.unlockSelection==null?(Et(),wt.current=t.pointerId,Ct.current=!0):e.preventDefault())},jt=(e,t)=>{let n=xt.current;n==null||n.pointerId!==t?wt.current===t&&(wt.current=null,e===`release`&&(Ct.current=!0)):(xt.current=null,n.timer!=null&&clearTimeout(n.timer),n.unlockSelection?.(),n.held!=null&&(Ct.current=e===`release`,Ce(null),n.isFrozen||Y||o||(Je(),n.held!==g&&h(n.held))))},Mt=(0,Z.useCallback)(e=>{if(Y)e.key===`Enter`&&e.preventDefault();else if(!nn(e.nativeEvent)){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)){if(F?.(e),e.defaultPrevented)return;e.preventDefault(),bt(e.key===`ArrowUp`?1:-1)}else e.key===`Enter`&&(ht(`Enter`),P?.()),F?.(e)}},[ht,Y,P,F,bt]),Nt=(0,Z.useCallback)(e=>{if(e==null||!O)return;let t=t=>{document.activeElement!==e||Y||o||t.deltaY===0||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||(t.preventDefault(),t.stopPropagation(),bt(t.deltaY<0?1:-1))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[Y,o,O,bt]),Ft=(0,Z.useMemo)(()=>Pt(re,he,Nt),[re,Nt]),{canIncrement:It,canDecrement:Lt}=(0,Z.useMemo)(()=>{let e=Se??vt,t={currentValue:e,min:w,max:T,step:E,isIntegerOnly:j};return{canIncrement:mh({...t,direction:1})!==e,canDecrement:mh({...t,direction:-1})!==e}},[Se,j,T,w,E,vt]),Rt=(0,Z.useCallback)(e=>{N&&h(null),Je(),!e||e.detail===0?he.current?.focus():he.current?.focus({preventScroll:!0})},[Je,N,h]),{onClick:zt,onMouseUp:Bt}=vi({containerRef:ge,inputRef:he,disabled:Y}),Vt=(0,Q.jsxs)(`div`,{ref:e=>{ge.current=e,Qe.ref(e)},onClick:zt,onMouseUp:Bt,..._e?$i:void 0,...hn(ye(`number-input`,{size:q,status:We?.type??null,disabled:Y?`disabled`:null,readonly:o?`readonly`:null}),J(Le.base,Le.textField,ch.wrapper,k&&ch.wrapperWithNumberSteppers,lh[q],Y&&Le.disabled,Y&&Xe.ring,We&&Fe[We.type],We&&!Y&&it[We.type],We&&tt[We.type],_e&&sa.inGroup,te),B,ne),children:[c&&gt(c,{size:`sm`,color:`secondary`}),_e&&(0,Q.jsx)(St,{id:de,children:e}),(0,Q.jsx)(`input`,{...Ze,ref:Ft,id:le,name:Y||D||Oe?void 0:x,type:`text`,inputMode:j?`numeric`:`decimal`,role:`spinbutton`,autoComplete:C,value:ut,onChange:ft,onFocus:pt,onBlur:_t,onKeyDown:Mt,placeholder:_,"aria-disabled":Y?`true`:void 0,readOnly:o||Y||void 0,autoFocus:b,"data-autofocus":b||void 0,"aria-valuemin":w??void 0,"aria-valuemax":T??void 0,"aria-valuenow":g??void 0,"aria-valuetext":g==null||!D?void 0:lt,"aria-describedby":[V,ot].filter(Boolean).join(` `)||void 0,"aria-required":se?`true`:void 0,"aria-invalid":We?.type===`error`||Re!=null?`true`:void 0,"aria-labelledby":st,...{0:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5`},2:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 xt0e3qv`},1:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xv1l7n4`},3:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xt0e3qv xv1l7n4`}}[!!Y<<1|Re!=null]}),x&&!Y&&(D||Oe)&&(0,Q.jsx)(`input`,{type:`hidden`,name:x,value:dt}),A&&(0,Q.jsx)(`span`,{id:me,className:`x9ynric xjm74w1 xw6l6zx xv1l7n4 x2lah0s`,children:A}),(0,Q.jsx)(St,{as:`div`,role:`alert`,"aria-live":`assertive`,children:Ge}),N&&g!=null&&!Y&&!o&&(0,Q.jsx)(Ve,{label:G(`@astryx.numberInput.clearLabel`,{label:e}),onClick:Rt}),$e,k&&(0,Q.jsxs)(`div`,{ref:Dt,className:`xkh2ocl x78zum5 xhj50sb xdt5ytf x2lah0s x12xnipv x5j3pgv x13i4uq0 xgbv0en x1t7ytsu x14ydlgx xb3r6kr x1g2gkjz xoao14b`,children:[(0,Q.jsx)(`button`,{type:`button`,tabIndex:-1,...oe,"aria-disabled":Y||o||!It||void 0,"aria-label":G(`@astryx.numberInput.incrementLabel`,{label:e}),onPointerDown:e=>{e.preventDefault(),Ot(1,It,e)},onContextMenu:At,onPointerUp:e=>jt(`release`,e.pointerId),onPointerCancel:e=>jt(`cancel`,e.pointerId),onLostPointerCapture:e=>jt(`cancel`,e.pointerId),onClick:e=>{let t=Ct.current;Ct.current=!1,t&&e.detail>0?he.current?.focus():Y||o||!It||(he.current?.focus(),bt(1))},...hn(ye(`number-input-stepper`,{direction:`increment`}),J(ch.numberStepperButton,kt.backgroundImage,(Y||o||!It)&&ch.numberStepperButtonDisabled)),children:(0,Q.jsx)(mt,{icon:`numberInput:stepperDown`,size:`xsm`,color:`inherit`,xstyle:ch.incrementIcon})}),(0,Q.jsx)(`button`,{type:`button`,tabIndex:-1,...oe,"aria-disabled":Y||o||!Lt||void 0,"aria-label":G(`@astryx.numberInput.decrementLabel`,{label:e}),onPointerDown:e=>{e.preventDefault(),Ot(-1,Lt,e)},onContextMenu:At,onPointerUp:e=>jt(`release`,e.pointerId),onPointerCancel:e=>jt(`cancel`,e.pointerId),onLostPointerCapture:e=>jt(`cancel`,e.pointerId),onClick:e=>{let t=Ct.current;Ct.current=!1,t&&e.detail>0?he.current?.focus():Y||o||!Lt||(he.current?.focus(),bt(-1))},...hn(ye(`number-input-stepper`,{direction:`decrement`}),J(ch.numberStepperButton,kt.backgroundImage,ch.decrementButton,(Y||o||!Lt)&&ch.numberStepperButtonDisabled)),children:(0,Q.jsx)(mt,{icon:`numberInput:stepperDown`,size:`xsm`,color:`inherit`})})]})]});return _e?(0,Q.jsxs)(Q.Fragment,{children:[Vt,Ye&&Qe.renderTooltip(s)]}):(0,Q.jsxs)(rt,{...W,label:e,isLabelHidden:t,description:n,inputID:le,labelID:ae==null?void 0:ue,descriptionID:n?fe:void 0,isOptional:r,isRequired:i,isDisabled:Y,labelIcon:l,status:We?{type:We.type,message:We.message,messageID:We.message?pe:void 0}:void 0,statusVariant:p,labelTooltip:y,width:I,children:[Vt,Ye&&Qe.renderTooltip(s)]})}hh.displayName=`NumberInput`;var gh=t(Pu(),1);function _h(e){return e.split(/[\\/]/).pop()??e}function vh(e){return e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var yh={automatic:`Automatic`,preRestore:`Before restore`,preMigration:`Before update`};function bh(){return vr().data?.lastFailure?(0,Q.jsx)(`span`,{className:`text-destructive`,children:`Backup failed`}):null}function xh(){let e=vr().data?.lastFailure;return e?(0,Q.jsxs)(`p`,{role:`alert`,"aria-label":`Automatic backup failed`,className:`text-xs break-words text-destructive`,children:[`The automatic backup `,(0,Q.jsx)(Dr,{at:e.at}),` failed: `,e.message]}):null}function Sh(e){return e.kind===`upload`?e.file.name:_h(e.path)}function Ch(){let e=Ir(),t=$n(),n=ri(),r=Jn(),i=On(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.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 ${Sh(e)}. The previous data was saved as ${_h(t.path)}.`)}};e.kind===`upload`?i.mutate(e.file,t):r.mutate(_h(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)(X,{size:`sm`,variant:`secondary`,label:u?`Exporting...`:`Export...`,onClick:f,isDisabled:u}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Restore...`,onClick:p,isDisabled:d}),(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:Sh(o)}),`? The current data is backed up first.`]}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{size:`sm`,variant:`destructive`,label:d?`Restoring...`:`Replace data`,onClick:()=>m(o),isDisabled:d}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Cancel`,onClick:()=>s(null),isDisabled:d})]})]}),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)(xh,{}),(0,Q.jsx)(wh,{}),(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:oi(e.createdAt)}),(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Q.jsx)(Dr,{at:e.createdAt}),` · `,yh[e.kind],` · `,vh(e.sizeBytes)]})]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`secondary`,label:`Download backup from ${oi(e.createdAt)}`,isDisabled:n.isPending,onClick:()=>{l(null),n.mutate(_h(e.path),{onSuccess:e=>l(`Downloaded ${e}`)})},children:`Download`}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Restore this backup from ${oi(e.createdAt)}`,onClick:()=>{l(null),s({kind:`backup`,path:e.path})},children:`Restore this backup`})]})]},e.path))]})]})}function wh(){let e=Yr();if(!e.data)return null;let{enabled:t,intervalHours:n,keep:r,directory:i}=e.data;return(0,Q.jsx)(Th,{initial:e.data},`${t}-${n}-${r}-${i??``}`)}function Th({initial:e}){let t=ir(),[n,r]=(0,Z.useState)(e.enabled),[i,a]=(0,Z.useState)(e.intervalHours),[o,s]=(0,Z.useState)(e.keep),[c,l]=(0,Z.useState)(e.directory??``);function u(e){e.preventDefault(),t.mutate({enabled:n,intervalHours:i,keep:o,directory:c.trim()||null})}return(0,Q.jsxs)(`form`,{onSubmit:u,"aria-label":`Automatic backups`,className:`flex flex-col gap-1 text-xs`,children:[(0,Q.jsx)(Rf,{size:`sm`,label:`Back up automatically`,value:n,onChange:r}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[`Every`,(0,Q.jsx)(hh,{size:`sm`,width:80,label:`Hours between backups`,isLabelHidden:!0,isIntegerOnly:!0,min:1,max:720,value:i,onChange:a,isDisabled:!n}),`hours`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[`Keep`,(0,Q.jsx)(hh,{size:`sm`,width:80,label:`Backups to keep`,isLabelHidden:!0,isIntegerOnly:!0,min:1,max:100,value:o,onChange:s,isDisabled:!n}),`latest`]}),(0,Q.jsx)(Ke,{size:`sm`,label:`Backup directory`,description:`An absolute path on the server, e.g. on another disk. Every backup goes there, including the one before an update.`,placeholder:`the server's data directory`,hasSpellCheck:!1,value:c,onChange:l}),t.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:t.error.message}),(0,Q.jsx)(X,{type:`submit`,size:`sm`,variant:`secondary`,className:`self-start`,label:t.isPending?`Saving...`:`Save backup settings`,isDisabled:t.isPending})]})}function Eh(e,t,n){let r=Qt(),[i,a]=(0,Z.useState)(()=>r?e:n);return i!==n&&!r&&t!==i&&a(n),[i,(0,Z.useCallback)(()=>a(n),[n])]}var Dh=[`overflow`,`overscrollBehaviorY`,`scrollbarGutter`],Oh={overflow:[`overflow`,`overflowX`,`overflowY`],overscrollBehaviorY:[`overscrollBehaviorY`],scrollbarGutter:[`scrollbarGutter`]},kh=D(`hooks/root-scroll-styles/state`,1,()=>({claims:{overflow:[],overscrollBehaviorY:[],scrollbarGutter:[]},held:new Map,nextClaimId:0,lockCount:0,lockListeners:new Set}));function Ah(e){let t=e.documentElement,{body:n}=e,r=e.defaultView;if(n==null||r==null)return t;let i=e=>{let t=r.getComputedStyle(e);return(t.overflowX||`visible`)===`visible`&&(t.overflowY||`visible`)===`visible`};return i(t)&&!i(n)?n:t}function jh(e,t){return e===`overflow`?[Ah(t)]:e===`scrollbarGutter`||t.body==null?[t.documentElement]:[t.documentElement,t.body]}function Mh(e){let t=kh.held.get(e);if(t==null)return;let n=kh.claims[e],r=n[n.length-1];for(let n of t){let{style:t}=n.element;if(r!=null)t[e]=r.value,n.written=r.value;else if(t[e]===n.written){t[e]=``;for(let r of Oh[e]){let e=n.pageValues[r];e&&(t[r]=e)}}}r??kh.held.delete(e)}function Nh(e){if(typeof document>`u`)return()=>{};kh.nextClaimId+=1;let t=kh.nextClaimId,n=[];for(let r of Dh){let i=e[r];i!=null&&(kh.claims[r].length===0&&kh.held.set(r,jh(r,document).map(e=>{let t={};for(let n of Oh[r])t[n]=e.style[n];return{element:e,pageValues:t,written:``}})),kh.claims[r].push({id:t,value:i}),n.push(r),Mh(r))}let r=!1;return()=>{if(!r){r=!0;for(let e of n){let n=kh.claims[e],r=n.findIndex(e=>e.id===t);r!==-1&&n.splice(r,1),Mh(e)}}}}function Ph(e){let t=kh.lockCount>0;kh.lockCount=Math.max(0,kh.lockCount+e);let n=kh.lockCount>0;if(n!==t)for(let e of[...kh.lockListeners])e(n)}var Fh=5,Ih=m(`gestures/page-hold/holds-by-document`,1);function Lh(e){return e.touches==null?[]:Array.from(e.touches)}function Rh(e){let t={decisions:new Set,touch:null,unsubscribers:[],stopPointerDown:null,stopWatchingPointer:null,onPointerDown:n=>{if(n.pointerType!==`touch`&&n.pointerType!==`pen`)return;t.stopPointerDown?.(),t.stopPointerDown=null;let r=e.defaultView;zh(e,t),W(r)&&(Bh(e,t,!0),t.touch={id:null,x:n.clientX,y:n.clientY,verdict:null})},onTouchStart:e=>{let n=Lh(e),r=t.touch;if(r?.id!=null&&n.some(e=>e.identifier===r.id)&&!Array.from(e.changedTouches).some(e=>e.identifier===r.id))return;let i=n[0];t.touch=n.length===1&&i!=null?{id:i.identifier,x:i.clientX,y:i.clientY,verdict:null}:null},onTouchMove:n=>{let r=Lh(n),i=r[0];t.touch?.id===null&&r.length===1&&i!=null&&(t.touch={...t.touch,id:i.identifier});let a=t.touch;if(r.length===1&&i!=null&&a!=null&&i.identifier===a.id&&Oa.get(e)?.isTouchClaimed(a.id)!==!0){if(a.verdict==null){let e=i.clientX-a.x,r=i.clientY-a.y;if(Math.max(Math.abs(e),Math.abs(r))<Fh)return;let o=n.composedPath()[0]??n.target;a.verdict=[...t.decisions].some(t=>t.decide(o,e,r))}a.verdict&&n.cancelable&&n.preventDefault()}}};return t}function zh(e,t){t.stopWatchingPointer??=B(e.defaultView,n=>Bh(e,t,n))}function Bh(e,t,n){let r=e.defaultView;if(r!=null&&n!==t.unsubscribers.length>0){if(n)t.unsubscribers=[K(r,`touchstart`,t.onTouchStart),K(r,`touchmove`,t.onTouchMove,{cancels:!0})];else{for(let e of t.unsubscribers.splice(0))e();t.touch=null}}}function Vh(e,t){let n=Ih.get(e);n??(n=Rh(e),Ih.set(e,n));let r=n,i={decide:t};r.decisions.add(i);let a=e.defaultView;r.decisions.size===1&&a!=null&&(r.stopPointerDown=K(a,`pointerdown`,r.onPointerDown),W(a)&&(zh(e,r),Bh(e,r,!0)));let o=!0;return()=>{o&&(o=!1,r.decisions.delete(i),r.decisions.size===0&&(r.stopPointerDown?.(),r.stopPointerDown=null,r.stopWatchingPointer?.(),r.stopWatchingPointer=null,Bh(e,r,!1)))}}function Hh(e,t,n,r,i){let a=n?0:r,o=n?i:0;if(wa(e,a,o))return!0;if(!wa(e,-a,-o))return!1;let s=n?t.overscrollBehaviorY:t.overscrollBehaviorX;return s===`contain`||s===`none`}function Uh(e,t){let n=e.ownerDocument.defaultView?.CSS;return typeof n?.supports==`function`&&n.supports(`selector(${t})`)&&e.matches(t)}function Wh(e,t){return t.position===`fixed`||Uh(e,`:modal`)||Uh(e,`:popover-open`)}function Gh(e){return(e.defaultView?.visualViewport?.scale??1)>1}function Kh(e){return e.matches(`input[type="range"]:not(:disabled)`)}function qh(e,t,n){if(!(e instanceof Node))return!1;let r=e.ownerDocument??document,i=r.defaultView;if(i==null)return!1;let a=Math.abs(n)>=Math.abs(t);for(let o=e;o!=null;o=g(o)){if(!(o instanceof Element))continue;if(Kh(o))return!0;if(o===r.documentElement||o===r.body||o===r.scrollingElement)break;let e=i.getComputedStyle(o);if(Hh(o,e,a,t,n))return!0;if(Wh(o,e))break}return!1}var Jh={settle(){},release(){}};function Yh(){return typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`scrollbar-gutter`,`stable`)}function Xh(e){if(typeof window>`u`||typeof document>`u`)return Jh;let t=document.documentElement.clientWidth;if(t===0||window.innerWidth<=t)return Jh;if(Yh()){let e=null;return{settle(){e??=Nh({scrollbarGutter:`stable`})},release(){e?.(),e=null}}}let n=e.style.paddingRight,r=e.getBoundingClientRect().width,i=!1,a=!1;return{settle(){if(a)return;a=!0;let t=e.getBoundingClientRect().width-r;if(t<=0)return;let n=Number.parseFloat(window.getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${n+t}px`,i=!0},release(){i&&=(e.style.paddingRight=n,!1)}}}var Zh=D(`hooks/use-scroll-lock/lock`,1,()=>({count:0,active:null}));function Qh(e){(0,Z.useEffect)(()=>{if(e){if(Zh.count===0){let e=Xh(document.documentElement),t=Nh({overflow:`hidden`,overscrollBehaviorY:`none`}),n=Vh(document,(e,t,n)=>!Gh(document)&&!qh(e,t,n));e.settle(),Zh.active={releaseRootStyle:t,releasePageHold:n,gutter:e}}return Zh.count+=1,Ph(1),()=>{if(--Zh.count,Ph(-1),Zh.count!==0||Zh.active==null)return;let e=Zh.active;Zh.active=null,e.releasePageHold(),e.releaseRootStyle(),e.gutter.release()}}},[e])}function $h(e,{isModal:t=!0,entrance:n=e,capMs:r}={}){if(n==null||typeof n.getAnimations!=`function`)return null;let i=n.getAnimations().filter(tg);if(i.length===0||!W(e.ownerDocument.defaultView))return null;let a=Promise.all(i.map(async e=>e.finished));return wn(e,{until:r==null?a:Promise.race([a,eg(r)]),scope:t?`viewport`:`surface`})}async function eg(e){await new Promise(t=>{setTimeout(t,e)})}function tg(e){if(e.playState!==`running`)return!1;let t=e.effect?.getComputedTiming().endTime;return typeof t==`number`&&Number.isFinite(t)}function ng(e){try{return e.matches(`:popover-open`)}catch{return!1}}function rg(e){return Array.from(e.ownerDocument.querySelectorAll(`[popover="auto"], [popover=""]`)).filter(t=>!t.contains(e)&&ng(t))}function ig(e,t){let n=(0,Z.useRef)(!1),r=(0,Z.useRef)(!1),i=(0,Z.useRef)([]),a=(0,Z.useRef)(0);return{onPointerDownCapture:(0,Z.useCallback)(e=>{let t=e.target===e.currentTarget;n.current=t,r.current=!1,i.current=t?rg(e.currentTarget):[],a.current=Oi(e.currentTarget.ownerDocument)},[]),onPointerUpCapture:(0,Z.useCallback)(e=>{r.current=n.current&&e.target===e.currentTarget,n.current=!1},[]),onPointerCancelCapture:(0,Z.useCallback)(()=>{n.current=!1,r.current=!1,i.current=[]},[]),onClick:(0,Z.useCallback)(o=>{let s=r.current,c=i.current.some(e=>!ng(e))||Oi(o.currentTarget.ownerDocument)!==a.current;n.current=!1,r.current=!1,i.current=[],t&&s&&!c&&o.target===o.currentTarget&&e()},[t,e])}}var ag={fromHostRadius:{"--_container-corner-start-start":`xyglmdk xo6h1o1`,"--_container-corner-start-end":`xmq3u8m x5rr2qb`,"--_container-corner-end-start":`xp1ds82 x1pmdxx9`,"--_container-corner-end-end":`x137k1ec x135ma50`,$$css:!0},publish:{"--container-corner-start-start":`xcfde6v x1jxik6w x1x9b3rp`,"--container-corner-start-end":`x1os27km x18wmv1g x1fj5z48`,"--container-corner-end-start":`x102ry9 xcwbja2 xpl7j7d`,"--container-corner-end-end":`x1q2p8vm x1jkigeo xrfh3k4`,$$css:!0}},og=dn(`DialogContext`,1,null);og.displayName=`DialogContext`;function sg(){return(0,Z.use)(og)}var cg=Bt(`LayoutContainerContext`,1,null);cg.displayName=`LayoutContainerContext`;function lg(e){return tn(e)&&!e.inert&&e.getAttribute(`aria-hidden`)!==`true`}function ug(e){for(let t=e;t!=null;t=t.parent){let e=t.dialogRef.current;if(tn(e))return e}return null}var dg=D(`hooks/modal-announce/presented`,1,()=>[]);function fg(e){let t=dg.indexOf(e);t!==-1&&dg.splice(t,1),e.open&&dg.push(e)}function pg(e){let t=dg.indexOf(e);t!==-1&&dg.splice(t,1)}function mg(){for(let e=dg.length-1;e>=0;--e)if(lg(dg[e]))return dg[e];return null}function hg(e){for(let t=dg.length-1;t>=0;--t){let n=dg[t];if(n!==e&&lg(n))return n;if(tn(n))return`covered`}let t=null;for(let n of document.querySelectorAll(`dialog`))n!==e&&!dg.includes(n)&&lg(n)&&(t=n);return t}function gg(){for(let e of document.querySelectorAll(`dialog`))if(tn(e))return!0;return!1}var _g=w(`hooks/modal-announce/held`,1);function vg(e,t,n,r){let i=_g.get(e);i??(i={polite:[],assertive:[]},_g.set(e,i));let a=i[n].find(e=>e.text===t);a??(a={text:t,receipts:[]},i[n].push(a)),a.receipts.push(r);let o=a;r.withdraw=()=>yg(e,n,o,r)}function yg(e,t,n,r){let i=_g.get(e),a=n.receipts.indexOf(r);i==null||!i[t].includes(n)||a<0||(n.receipts.splice(a,1),n.receipts.length===0&&(i[t]=i[t].filter(e=>e!==n),i.polite.length===0&&i.assertive.length===0&&_g.delete(e)))}function bg(e,t){let n=_g.get(e);n!=null&&(n[t]=[],n.polite.length===0&&n.assertive.length===0&&_g.delete(e))}function xg(e){let t=_g.get(e);if(t!=null){_g.delete(e);for(let n of[`polite`,`assertive`])Jt(t[n],t=>lg(e)?Dg(e,t,n):Cg(e,t,n))}}function Sg(){for(let e of[..._g.keys()])xg(e)}function Cg(e,t,n){let r=hg(e);if(r===`covered`||r==null&&gg()){let r={withdraw:null};return vg(e,t,n,r),Xt(r)}return r==null?cn(t,n):Dg(r,t,n)}function wg(e){for(let t of[`polite`,`assertive`])Jt(Eg(e,t),n=>Cg(e,n,t))}function Tg(e,t){qt(e,t),bg(e,t)}function Eg(e,t){let n=Zt(e,t);if(n==null)return[];let r=Ut(n);return qt(e,t),r}function Dg(e,t,n=`polite`){if(!lg(e))return Cg(e,t,n);let r=mg();return r!=null&&r!==e&&dg.includes(e)?(qt(e,n),null):Kt(e,t,n,{isExposed:()=>lg(e),redirect:t=>Jt(t,t=>Cg(e,t,n))})}var Og=m(`hooks/modal-announce/deferred-by-scope`,1);function kg(e,t,n){let r=Og.get(e);if(r==null){let t={frame:requestAnimationFrame(()=>{Og.delete(e);let n=ug(e);for(let e of[`polite`,`assertive`])t.clears[e]&&(n==null?en(e):Tg(n,e)),Jt(t.words[e],t=>n==null?cn(t,e):Dg(n,t,e))}),words:{polite:[],assertive:[]},clears:{polite:!1,assertive:!1}};r=t,Og.set(e,r)}let i=r;if(!t){for(let e of i.words[n])for(let t of e.receipts)t.withdraw=null;return i.words[n]=[],i.clears[n]=!0,null}let a=i.words[n].find(e=>e.text===t);a??(a={text:t,receipts:[]},i.words[n].push(a));let o=a,s={withdraw:null};return s.withdraw=()=>{let e=o.receipts.indexOf(s);e<0||(o.receipts.splice(e,1),o.receipts.length===0&&(i.words[n]=i.words[n].filter(e=>e!==o)))},o.receipts.push(s),Xt(s)}function Ag(e){for(let t=e;t!=null;t=t.parent){let e=t.dialogRef.current;if(tn(e))return!1;if(t.isOpen&&(e==null||!e.open))return!0}return!1}function jg(e,t,n){if(Ag(e))return kg(e,t,n);let r=ug(e);return t?r==null?cn(t,n):Dg(r,t,n):(r==null?en(n):Tg(r,n),null)}on({announce:jg,announceInModal:Dg});function Mg({dialogRef:e,isOpen:t,children:n}){let r=(0,Z.use)(Wt),i=(0,Z.useMemo)(()=>({dialogRef:e,isOpen:!1,parent:r}),[e,r]);G(()=>{i.isOpen=t},[i,t]);let a=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let n=e.current;if(n==null||a.current!=null||!t&&!n.open)return;fg(n);let r=n.open,i=()=>{o(),pg(n),a.current=null},o=()=>s(),s=be(n,{attributes:!0,attributeFilter:[`open`,`inert`,`aria-hidden`]},()=>{n.open!==r&&(r=n.open,fg(n)),lg(n)||wg(n),(!n.open||lg(n))&&Sg(),n.open||i()});a.current={dialog:n,stop:o}},[e,t]),(0,Z.useEffect)(()=>()=>{let e=a.current;e!=null&&(a.current=null,e.stop(),wg(e.dialog),pg(e.dialog),Sg())},[]),(0,Q.jsx)(Wt,{value:i,children:n})}function Ng(e,t=16){let n=e.getBoundingClientRect(),r=e.ownerDocument.defaultView??window,i=n.left+n.width/2-r.innerWidth/2,a=n.top+n.height/2-r.innerHeight/2,o=Math.sqrt(i*i+a*a)||1;return{x:Math.round(i/o*t),y:Math.round(a/o*t)}}`${a[`--spacing-4`]}`,`${a[`--spacing-4`]}`,`${a[`--spacing-4`]}`,`${a[`--spacing-4`]}`,`${a[`--spacing-4`]}`,`${a[`--spacing-4`]}`;var Pg={dialog:{kVAEAm:`xixxii4`,kogj98:`x1bpp3o7`,kmVPX3:`x1717udv`,kMzoRj:`xc342km x13rsnn2`,ksu8eU:`xng3xce xx61lck`,kVAM5u:`x1w1tqly`,kWkggS:`x10xzikg`,kMwMTN:`x1tgivj0`,"--_dialog-radius":`xvuvksw`,"--_dialog-radius-top-left":`x1y3jq2x`,"--_dialog-radius-top-right":`xlpx7ml`,"--_dialog-radius-bottom-right":`x4ydc98`,"--_dialog-radius-bottom-left":`xv2r9mv`,"--_dialog-radius-start-start":`xos9d3l`,"--_dialog-radius-start-end":`x19o6w7e`,"--_dialog-radius-end-start":`xr78w03`,"--_dialog-radius-end-end":`x1e9su33`,kaIpWk:`xuacgfc`,kGVxlE:`x1kcpxr7`,k1xSpc:`x1s85apg`,kXwgrk:`xdt5ytf`,kZKoxP:`xg7h5cd`,kZeWKH:`xish69e`,kSiTet:`xg01cxk`,k44tkh:`xqgcaz x1jq6yc9`,kyAemX:`x128ha8g xr5m3f0`,kWV6AL:`xskzprw`,$$css:!0},open:{k1xSpc:`x78zum5`,kSiTet:`x1hc1fzr`,kKVMdj:`x1ewfqum x6mpr79 xtuz6mp`,$$css:!0},openSettled:{kKVMdj:`x1a5igra`,$$css:!0},backdrop:{kGyWv1:`xnixb3f`,$$css:!0},fullscreen:{kzqmXN:`x1o6l61p`,kZKoxP:`xtdtrs8`,ks0D6T:`xlbgzzq`,kskxy:`x1wj9ous`,"--_dialog-radius":`x1fg9z59`,kaIpWk:`x2u8bby`,kMzoRj:`xc342km`,kogj98:`x1ghz6dp`,kpwlN0:`x10a8y8t`,$$css:!0},fullscreenOpen:{kKVMdj:`xqcmdr3 x6mpr79 xtuz6mp`,$$css:!0},fullscreenSafeArea:{kLKAdn:`x15ld1ci`,kGO01o:`x1rgxemn`,kZCmMZ:`xqmdmw x1i7f2ot`,kwRFfy:`x1by8st6 xtjjor6`,$$css:!0},inner:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kUk6DE:`x12lumcd`,kAzted:`x2lwn1j`,kVQacm:`xb3r6kr`,kaIpWk:`x1pjcqnp`,$$css:!0},innerCorners:{"--_container-host-radius":`x16uw05s`,"--_container-host-radius-top-left":`xf2u9b1`,"--_container-host-radius-top-right":`xochy8w`,"--_container-host-radius-bottom-right":`xzxjxqs`,"--_container-host-radius-bottom-left":`x1cr5oa`,"--_container-host-radius-start-start":`xmj80jq`,"--_container-host-radius-start-end":`x1fxna2m`,"--_container-host-radius-end-start":`x1o7ryb1`,"--_container-host-radius-end-end":`x1sgv71z`,$$css:!0},inlineWrapper:{kmVPX3:`x1717udv`,kWkggS:`x10xzikg`,"--_dialog-radius":`xvuvksw`,"--_dialog-radius-top-left":`x1y3jq2x`,"--_dialog-radius-top-right":`xlpx7ml`,"--_dialog-radius-bottom-right":`x4ydc98`,"--_dialog-radius-bottom-left":`xv2r9mv`,"--_dialog-radius-start-start":`xos9d3l`,"--_dialog-radius-start-end":`x19o6w7e`,"--_dialog-radius-end-start":`xr78w03`,"--_dialog-radius-end-end":`x1e9su33`,kaIpWk:`xuacgfc`,kGVxlE:`x1kcpxr7`,kMzoRj:`xc342km x13rsnn2`,ksu8eU:`xng3xce xx61lck`,kVAM5u:`x1w1tqly`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kZKoxP:`xg7h5cd`,kZeWKH:`xish69e`,$$css:!0}},Fg=a[`--spacing-4`],Ig=`min(100%, ${`calc(100dvw - ${Fg} - ${Fg})`})`;function Lg(e){return typeof e==`number`?`${e}px`:e}function Rg(e,t){return{width:Lg(e),maxWidth:Ig,maxHeight:Lg(t)}}var zg={kogj98:`x1ghz6dp`,$$css:!0},Bg={sizing:(e,t,n)=>[{kzqmXN:e==null?e:`x5lhr3w`,ks0D6T:t==null?t:`xf68679`,kskxy:n==null?n:`x1jols5v`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e),"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(t),"--x-maxHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(n)}],position:(e,t,n,r)=>[zg,{k87sOh:e==null?e:`xjbys53`,kLqNvP:t==null?t:`x1lxsm33`,kt4wiu:n==null?n:`xqxgn94`,krVfgx:r==null?r:`x1nqzi6q`,$$css:!0},{"--x-top":(e=>typeof e==`number`?e+`px`:e??void 0)(e),"--x-insetInlineStart":(e=>typeof e==`number`?e+`px`:e??void 0)(t),"--x-insetInlineEnd":(e=>typeof e==`number`?e+`px`:e??void 0)(n),"--x-bottom":(e=>typeof e==`number`?e+`px`:e??void 0)(r)}]};function Vg(e){return typeof e==`number`?`${e}px`:e}function Hg(e){let{top:t,bottom:n,start:r,end:i}=e;return{top:t===void 0?`auto`:Vg(t),bottom:n===void 0?`auto`:Vg(n),insetInlineStart:r===void 0?`auto`:Vg(r),insetInlineEnd:i===void 0?`auto`:Vg(i)}}function Ug({isOpen:e,isInline:t=!1,onOpenChange:n,width:r=400,maxHeight:i=`75dvh`,position:a,variant:o=`standard`,purpose:s=`info`,padding:c,children:l,xstyle:u,className:d,style:f,ref:p,...m}){let h=Qt(),g=e&&(t||!h),[_]=Eh(e&&!t,g,!1),v=_&&g,y=c==null,b=c??4,x=ga[b],S=o===`fullscreen`,C=S?null:Rg(r,i),w=(0,Z.useId)(),T=m[`aria-label`]!=null||m[`aria-labelledby`]!=null,E=(0,Z.useRef)(null);pa(E,g&&!t);let D=(0,Z.useCallback)(e=>{E.current=e,e&&!T&&(e.querySelector(`#${CSS.escape(w)}`)==null?e.removeAttribute(`aria-labelledby`):e.setAttribute(`aria-labelledby`,w))},[w,T]),O=(0,Z.useCallback)(e=>{let t=E.current;t==null||T||(e===void 0?D(t):e?t.setAttribute(`aria-labelledby`,w):t.getAttribute(`aria-labelledby`)===w&&t.removeAttribute(`aria-labelledby`))},[D,T,w]),k=(0,Z.useMemo)(()=>({isInline:t,titleId:w,syncDefaultName:O}),[t,w,O]),{ref:A}=Ft(),j=Vt(p,D,A),ee=(0,Z.useRef)(null),M=(0,Z.useRef)(null),N=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{let e=!t&&g;if(e&&!N.current){let e=E.current?.ownerDocument??document,t=e.hasFocus()?e:document;ee.current=t.activeElement,M.current!=null&&za(M.current);let n=ee.current;M.current=Ma({getLayer:()=>E.current,opener:I(n)?n:null,doc:t,isFocusMovedInOnOpen:!0,focus:e=>La(e,{preventScroll:!0})})}N.current=e},[g,t]);let P=s!==`required`,F=s===`info`;(0,Z.useEffect)(()=>{if(t)return;let e=E.current;if(e){if(g){let t=ee.current;if(t&&t!==t.ownerDocument.body){let n=Ng(t);e.style.setProperty(`--dialog-dir-x`,`${n.x}px`),e.style.setProperty(`--dialog-dir-y`,`${n.y}px`)}else e.style.setProperty(`--dialog-dir-x`,`0px`),e.style.setProperty(`--dialog-dir-y`,`16px`);if(!e.open){e.showModal();let t=[...e.querySelectorAll(`[data-autofocus]:not([data-autofocus="dialog-title"])`),...e.querySelectorAll(`[data-autofocus="dialog-title"]`)];for(let n of t){if(n.closest(`dialog`)!==e)continue;let t=n.closest(`[hidden], [inert], [aria-hidden="true"]`);if(!(t!=null&&e.contains(t))&&(Fa(n),n.ownerDocument.activeElement===n))break}}return $h(e)??void 0}{let t=M.current;M.current=null;let n=t!=null&&Na(t);e.open&&e.close(),t!=null&&(Pa(t,{wasStranded:n}),za(t)),ee.current=null}}},[g,t]),(0,Z.useEffect)(()=>{let e=E.current;if(t||e==null)return;let n=ja(e);return()=>{let t=M.current;t!=null&&(n(()=>{Pa(t,{warnsWhenNothingQualifies:!1})}),queueMicrotask(()=>{e.isConnected||za(t)}))}},[t]);let L=_n(E,g&&!t);Qh(g&&!t);let{shouldDismissOnCloseRequest:R}=un({isActive:g,isEnabled:!t,escapeBehavior:P?`close`:`block`,onDismiss:()=>{n(!1)},getContainer:()=>E.current}),[z]=(0,Z.useState)(mn);(0,Z.useEffect)(()=>{let e=E.current?.querySelector(`#${CSS.escape(w)}`)!=null;g&&!t&&!T&&!e&&z(`Dialog`,"open dialog has no accessible name. Add a DialogHeader with a `title`, or pass `aria-label`/`aria-labelledby`.")},[g,t,T,w,z]);let te=ig((0,Z.useCallback)(()=>{n(!1)},[n]),F),B=e=>{e.target===e.currentTarget&&(e.preventDefault(),R()&&P&&n(!1))},ne=(0,Q.jsx)(`div`,{ref:L,...J(Pg.inner,...da(y?{useThemeDefault:`dialog`,maxHeight:C?.maxHeight}:{paddingInnerX:x,paddingInnerY:x,paddingOuterX:x,paddingOuterY:x,maxHeight:C?.maxHeight}),!y&&b!==4&&ha[b],!y&&b!==4&&fa[b],!y&&b!==4&&_a[b],!y&&b!==4&&ba[b],S&&y&&Pg.fullscreenSafeArea,Pg.innerCorners,ag.fromHostRadius,ag.publish),children:(0,Q.jsx)(og,{value:k,children:(0,Q.jsx)(cg,{value:`dialog`,children:l})})}),re=a!=null&&!S,{onClick:ie,...V}=m,{open:ae,...H}=V,U={...H,onClick:ie};return t?g?(0,Q.jsx)(`div`,{...U,...hn(ye(`dialog`,{variant:o}),J(It.reset,Lt.reset,Pg.inlineWrapper,pn.reset,C&&Bg.sizing(C.width,C.maxWidth,C.maxHeight),S&&Pg.fullscreen,u),d,f),"data-testid":m[`data-testid`],children:(0,Q.jsx)(sn,{children:(0,Q.jsx)(Ht,{children:ne})})}):null:(0,Q.jsx)(`dialog`,{ref:j,...H,...hn(ye(`dialog`,{variant:o}),fe.focusVisible(It.reset,Lt.reset,Pg.dialog,pn.reset,g&&Pg.open,Pg.backdrop,C&&Bg.sizing(C.width,C.maxWidth,C.maxHeight),re&&(()=>{let e=Hg(a);return Bg.position(e.top,e.insetInlineStart,e.insetInlineEnd,e.bottom)})(),S&&Pg.fullscreen,S&&g&&Pg.fullscreenOpen,v&&Pg.openSettled,u),d,f),...Rt({...H,onClick:fi(te.onClick,ie)}),onPointerDownCapture:fi(te.onPointerDownCapture,H.onPointerDownCapture),onPointerUpCapture:fi(te.onPointerUpCapture,H.onPointerUpCapture),onPointerCancelCapture:fi(te.onPointerCancelCapture,H.onPointerCancelCapture),onCancel:B,"aria-modal":h?void 0:`true`,...s===`required`?{role:`alertdialog`}:void 0,children:(0,Q.jsx)(Mg,{dialogRef:E,isOpen:g,children:(0,Q.jsx)(sn,{children:(0,Q.jsx)(Ht,{children:ne})})})})}Ug.displayName=`Dialog`;var Wg={xo0ftvq:`xo0ftvq`,$$css:!0},Gg={x1sz7nw1:`x1sz7nw1`,$$css:!0},Kg=Bt(`LayoutDividerContext`,1,null);Kg.displayName=`LayoutDividerContext`;var qg={header:{kmuXW:`x2lah0s`,$$css:!0},inner:{kB7OPa:`x9f619`,ks0D6T:`xjl2t3p`,kUOVxO:`xvueqy4`,kZCmMZ:`xaku5ci`,kwRFfy:`x19eyx77`,kLKAdn:`xuqi0w`,kGO01o:`xg476vw`,"--container-padding-inline-start":`xt2a87w`,"--container-padding-inline-end":`xhq06x6`,"--container-padding-block-start":`x186o6qk`,"--container-padding-block-end":`xi9ns85`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},divider:{kt9PQ7:`xso031l`,kfdmCh:`x1q0q8m5`,kL6WhQ:`xw8gpjh`,$$css:!0}},Jg={sizing:e=>[{kZKoxP:e==null?e:`x16ye13r`,$$css:!0},{"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function Yg({children:e,hasDivider:t,height:n,label:r,padding:i,paddingBlockEnd:a,role:o,xstyle:s,className:c,style:l,ref:u,...d}){let f=(0,Z.use)(Kg),p=(0,Z.use)(cg),m=t??f?.defaultHasDividers??!1,h=i===0;return(0,Q.jsx)(`div`,{ref:u,role:o,"aria-label":r,...hn(ye(`layout-header`,{container:p}),J(Wg,qg.header,Jg.sizing(n??null),m&&qg.divider,s),c,l),...d,"data-divider":m||void 0,children:(0,Q.jsx)(`div`,{...J(qg.inner,h&&qg.fullBleed,i!=null&&ha[i],i!=null&&fa[i],i!=null&&_a[i],i!=null&&ba[i],a!=null&&ma[a],a!=null&&ba[a],xa.publish),children:e})})}Yg.displayName=`LayoutHeader`,ht({"@astryx.dialog.close":`Close`});var Xg={titleFocusable:{kI3sdo:`x1a2a7pz`,$$css:!0}};function Zg({title:e,subtitle:t,onOpenChange:n,startContent:r,endContent:i,endContentEdgeCompensation:a,hasDivider:o,xstyle:s,className:c,style:l,ref:u,...d}){let f=at(),p=(0,Z.useRef)(null),m=sg(),h=m?.isInline!==!0,g=m?.titleId,_=m?.syncDefaultName,v=(0,Z.useCallback)(e=>{if(e!=null)return _?.(!0),()=>_?.(!1)},[_]),y=Vt(p,v),b=xt(t),x=xt(r),S=xt(i),C=a==null?n!=null:a===`block`||a===`all`,w=a==null?n!=null:a===`inline`||a===`all`;return(0,Z.useEffect)(()=>{let e=p.current;if(!h||e==null)return;let t=e.closest(`dialog`);(t==null||t.open)&&e.focus()},[h]),(0,Q.jsx)(Yg,{ref:u,hasDivider:o,xstyle:s,className:c,style:l,...d,children:(0,Q.jsxs)(`div`,{...hn(ye(`dialog-header`),{0:{className:`x78zum5 x1cy8zhl x1qughib xjcht0a xze4tu6 x19f99yv x10qot8m`},1:{className:`x78zum5 x1cy8zhl x1qughib xjcht0a xze4tu6 x10qot8m x1189i8c`}}[!(!C||!S&&n==null)|0]),children:[x&&(0,Q.jsx)(`div`,{...hn(ye(`dialog-header-start-content`),{className:`x78zum5 x6s0dn4 x1txdalj x2lah0s xjn4mhx`}),children:r}),(0,Q.jsxs)(`div`,{...hn(ye(`dialog-header-title-block`),{className:`x78zum5 xdt5ytf xsn7fz1 x98rzlu xeuugli x1om7iy4`}),children:[(0,Q.jsx)(gi,{ref:y,id:g,level:2,tabIndex:-1,"data-autofocus":h?`dialog-title`:void 0,xstyle:Xg.titleFocusable,children:e}),b&&(0,Q.jsx)(Ct,{type:`body`,size:`sm`,color:`secondary`,children:t})]}),(S||n!=null)&&(0,Q.jsxs)(`div`,{...hn(ye(`dialog-header-end-content`),{0:{className:`x78zum5 x6s0dn4 x1txdalj x2lah0s xlzjpy3`},2:{className:`x78zum5 x6s0dn4 x1txdalj x2lah0s xlzjpy3 x1189i8c`},1:{className:`x78zum5 x6s0dn4 x1txdalj x2lah0s xlzjpy3 x3kzqx6`},3:{className:`x78zum5 x6s0dn4 x1txdalj x2lah0s xlzjpy3 x1189i8c x3kzqx6`}}[!!C<<1|!!w]),children:[i,n&&(0,Q.jsx)(na,{variant:`ghost`,label:f(`@astryx.dialog.close`),tooltip:f(`@astryx.dialog.close`),icon:(0,Q.jsx)(mt,{icon:`close`,color:`inherit`,...ye(`dialog-header-close-icon`)}),onClick:()=>{n?.(!1)},isIconOnly:!0})]})]})})}Zg.displayName=`DialogHeader`;var Qg={center:{kGNEyG:`x6s0dn4`,$$css:!0},end:{kGNEyG:`xuk3077`,$$css:!0},start:{kGNEyG:`x1cy8zhl`,$$css:!0},stretch:{kGNEyG:`x1qjc9v5`,$$css:!0}},$g={start:{kjj79g:`x1nhvcw1`,$$css:!0},center:{kjj79g:`xl56j7k`,$$css:!0},end:{kjj79g:`x13a6bvl`,$$css:!0},between:{kjj79g:`x1qughib`,$$css:!0},around:{kjj79g:`x1l1ennw`,$$css:!0},evenly:{kjj79g:`xaw8158`,$$css:!0}},e_={horizontal:{kXwgrk:`x1q0g3np`,$$css:!0},vertical:{kXwgrk:`xdt5ytf`,$$css:!0}},t_={nowrap:{kwnvtZ:`xozqiw3`,$$css:!0},wrap:{kwnvtZ:`x1a02dak`,$$css:!0},"wrap-reverse":{kwnvtZ:`x8hhl5t`,$$css:!0}},n_={stack:{k1xSpc:`x78zum5`,$$css:!0}},r_={0:{k1C7PZ:`x1o57wo1`,khm7nJ:`x6yxi7o`,$$css:!0},1:{k1C7PZ:`x1lfs0n9`,khm7nJ:`x1ngg2t4`,$$css:!0},2:{k1C7PZ:`xak3so`,khm7nJ:`x1x7z4sm`,$$css:!0},3:{k1C7PZ:`xewh9hi`,khm7nJ:`x4olc9o`,$$css:!0},4:{k1C7PZ:`xty4p9g`,khm7nJ:`xtx9w7w`,$$css:!0},5:{k1C7PZ:`x1eqhezk`,khm7nJ:`x1iu6piu`,$$css:!0},6:{k1C7PZ:`x3qlgwd`,khm7nJ:`xczp1bk`,$$css:!0},8:{k1C7PZ:`xicv188`,khm7nJ:`xgx0vcf`,$$css:!0},10:{k1C7PZ:`x1p37tyl`,khm7nJ:`x1xpicb7`,$$css:!0},"0.5":{k1C7PZ:`x1kihgfc`,khm7nJ:`x1tw44j4`,$$css:!0},"1.5":{k1C7PZ:`x1thn6ci`,khm7nJ:`xhq53yo`,$$css:!0}};function i_({crossAlign:e,direction:t,gap:n,mainAlign:r,wrap:i}){return[n_.stack,e_[t],n!=null&&r_[n],e!=null&&Qg[e],r!=null&&$g[r],i!=null&&t_[i]]}var a_={reset:{kAzted:`x2lwn1j`,k7Eaqz:`xeuugli`,$$css:!0}},o_={center:{kSGwAc:`xamitd3`,$$css:!0},end:{kSGwAc:`xpvyfi4`,$$css:!0},start:{kSGwAc:`xqcrz7y`,$$css:!0},stretch:{kSGwAc:`xkh2ocl`,$$css:!0}},s_={fill:{kzQI83:`x1iyjqo2`,$$css:!0},static:{kzQI83:`x1c4vz4f`,kmuXW:`x2lah0s`,$$css:!0}};function c_({crossAlignSelf:e,size:t}={}){return[a_.reset,s_[t??`static`],e!=null&&o_[e]]}var l_={"@astryx.scrollRegion.label":`Content`},u_={isScrollable:!1,atStart:!0,atEnd:!0};function d_(e,t){let n=e.toLowerCase(),r=n.startsWith(`vertical`)||n.startsWith(`sideways`),i=t===`rtl`;return r?{inline:`y`,block:`x`,inlineReversed:n===`sideways-lr`?!i:i,blockReversed:n.endsWith(`-rl`)}:{inline:`x`,block:`y`,inlineReversed:i,blockReversed:!1}}function f_(e){return e===`auto`||e===`scroll`||e===`overlay`}function p_(e,t){let n=getComputedStyle(e);return t===`x`?{clientExtent:e.clientWidth,contentExtent:e.scrollWidth,offset:e.scrollLeft,overflow:n.overflowX}:{clientExtent:e.clientHeight,contentExtent:e.scrollHeight,offset:e.scrollTop,overflow:n.overflowY}}function m_(e,t){return e.isConnected&&t.display!==`none`&&e.clientWidth>0&&e.clientHeight>0}function h_(e,t,n){if(!m_(e,getComputedStyle(e)))return null;let r=n[t],i=r===`x`?e.clientWidth:e.clientHeight;return(r===`x`?e.scrollWidth:e.scrollHeight)-i>1}function g_(e,t,n){if(!m_(e,getComputedStyle(e)))return null;let r=n[t],i=p_(e,r),a=i.contentExtent-i.clientExtent;return!f_(i.overflow)||a<=1?u_:{isScrollable:!0,...__(i.offset,a,n[`${t}Reversed`])}}function __(e,t,n){let r=Math.min(t,Math.max(0,n?Math.abs(e):e));return{atStart:r<=1,atEnd:r>=t-1}}function v_(e,t,n){if(!e.isConnected||e.clientWidth<=0||e.clientHeight<=0)return null;let r=n[t]===`x`,i=n[`${t}Reversed`],a=r?e.scrollLeft:e.scrollTop,o=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;return{overflows:o>1,...__(a,o,i),contradictsMapping:i?a>1:a<-1}}var y_={attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`],characterData:!0,childList:!0,subtree:!0};function b_(e,t){let n=!0,r=null,i=null,a=()=>{if(r=null,!n)return;let a=getComputedStyle(e),o=d_(a.writingMode,a.direction),s=g_(e,`inline`,o),c=g_(e,`block`,o);if(s==null||c==null)return;let l=s.isScrollable||c.isScrollable;l!==i&&(i=l,t(l))},o=()=>{n&&r==null&&(r=window.requestAnimationFrame(a))},s=new Map,c=()=>{let t=new Set(Array.from(e.children));for(let[e,n]of s)t.has(e)||(n(),s.delete(e));for(let e of t)s.has(e)||s.set(e,rn(e,o))},l=()=>{c(),o()};a(),c();let u=rn(e,o),d=be(e,y_,l);window.addEventListener(`resize`,o),window.visualViewport?.addEventListener(`resize`,o),e.addEventListener(`load`,o,!0),e.addEventListener(`transitionend`,o),e.addEventListener(`animationend`,o);let f=document.fonts;return f?.addEventListener?.(`loadingdone`,o),f?.ready.then(o),()=>{n=!1,r!=null&&(window.cancelAnimationFrame(r),r=null),u(),d();for(let e of s.values())e();s.clear(),window.removeEventListener(`resize`,o),window.visualViewport?.removeEventListener(`resize`,o),e.removeEventListener(`load`,o,!0),e.removeEventListener(`transitionend`,o),e.removeEventListener(`animationend`,o),f?.removeEventListener?.(`loadingdone`,o)}}ht(l_);function x_({isScrollable:e,role:t,label:n}){let r=at(),[i,a]=(0,Z.useState)(!1),o=t!=null,s=(0,Z.useCallback)(t=>{if(t==null||!e||o)a(!1);else return b_(t,a)},[o,e]),c=!o&&e&&i;return{ref:s,role:t??(c?`group`:void 0),"aria-label":n??(c?r(`@astryx.scrollRegion.label`):void 0)}}var S_=dn(`LayoutAreaContext`,1,null);S_.displayName=`LayoutAreaContext`;var C_=Bt(`LayoutSlotsContext`,1,{hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1});C_.displayName=`LayoutSlotsContext`;function w_(e){if(e==null||typeof e==`number`)return!0;let t=e.trim().toLowerCase();return t.includes(`%`)?!1:t===`0`||/^-?(?:\d+(?:\.\d+)?|\.\d+)[a-z]+$/.test(t)||/^(?:calc|min|max|clamp)\(/.test(t)}var T_={layoutOuter:{keTefX:`xojxgvx`,k71WvV:`x1fcf3bl`,keoZOQ:`x1sa9bsh`,k1K539:`x6h7pi7`,$$css:!0},layoutInner:{"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,"--layout-content-width":`x1vpwbdg`,"--layout-alignment-width":`x19kr0ht`,"--layout-padding-own-outer-x":`x1vii845`,"--layout-padding-own-outer-y":`xojybgt`,"--_layout-flush-block-start":`xu9n9za`,"--_layout-flush-block-end":`xt8hc1d`,$$css:!0},fill:{kZKoxP:`x12qplqi`,kskxy:`xenllk4`,$$css:!0},auto:{kAzted:`x1us19tq`,$$css:!0},middle:{kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,"--_layout-flush-block-start":`x1akq5vd`,"--_layout-flush-block-end":`x51rtne`,$$css:!0},middleQuery:{k9g6sI:`xsw3flo`,$$css:!0},singleColumnContent:{kzqmXN:`xh8yej3`,ks0D6T:`xjl2t3p xpgkkid`,kUOVxO:`xvueqy4`,$$css:!0},singlePanelMiddle:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,ks0D6T:`xjl2t3p xnpzo02`,kUOVxO:`xvueqy4 xb0m1lw`,$$css:!0},singleStartPanel:{kZCmMZ:`x1vvd0s7`,$$css:!0},singleEndPanel:{kwRFfy:`xxdn8bs`,$$css:!0},fullBleed:{"--layout-padding-own-outer-x":`xbjcssu`,"--layout-padding-own-outer-y":`x1bz2q72`,$$css:!0}},E_={kzqmXN:`xh8yej3`,kUOVxO:`xvueqy4`,$$css:!0},D_={contentWidthVar:e=>[{"--layout-content-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x4906uf`,$$css:!0},{"--x---layout-content-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentAlignmentWidthVar:e=>[{"--layout-alignment-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x1b1nz06`,$$css:!0},{"--x---layout-alignment-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentWidth:e=>[E_,{ks0D6T:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xf68679`,$$css:!0},{"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}]};function O_({area:e,children:t}){return t==null?null:(0,Q.jsx)(S_,{value:e,children:t})}var k_={"x-default-marker":`x-default-marker`,$$css:!0};function A_({children:e,content:t,contentWidth:n,defaultHasDividers:r,end:i,footer:a,header:o,height:s=`fill`,padding:c,ref:l,start:u,xstyle:d,className:f,style:p,...m}){let h=s===`fill`,g=t??e,_=(0,Z.useMemo)(()=>r==null?null:{defaultHasDividers:r},[r]),v=xt(o),y=xt(a),b=xt(u),x=xt(i),S=b&&x,C=b!==x,w=n!=null&&w_(n),T=(0,Z.useMemo)(()=>({hasHeader:v,hasFooter:y,hasStart:b,hasEnd:x}),[v,y,b,x]),E=(0,Q.jsx)(C_,{value:T,children:(0,Q.jsx)(`div`,{...m,ref:l,...hn(ye(`layout`,{height:s}),J(T_.layoutOuter,h?T_.fill:T_.auto,d),f,p),children:(0,Q.jsxs)(`div`,{...J(k_,T_.layoutInner,...i_({direction:`vertical`}),h?T_.fill:T_.auto,c===0&&T_.fullBleed,c!=null&&va[c],c!=null&&ya[c],n!=null&&D_.contentWidthVar(n),w&&D_.contentAlignmentWidthVar(n)),children:[(0,Q.jsx)(O_,{area:`header`,children:o}),(0,Q.jsxs)(`div`,{...J(...i_({direction:`horizontal`}),T_.middle,n!=null&&(!w||S)&&D_.contentWidth(n),w&&!S&&T_.middleQuery,w&&C&&T_.singlePanelMiddle,w&&b&&!x&&T_.singleStartPanel,w&&!b&&x&&T_.singleEndPanel),children:[(0,Q.jsx)(O_,{area:`start`,children:u}),(0,Q.jsx)(`div`,{...J(...c_({size:`fill`}),w&&!b&&!x&&T_.singleColumnContent),children:(0,Q.jsx)(O_,{area:`content`,children:g})}),(0,Q.jsx)(O_,{area:`end`,children:i})]}),(0,Q.jsx)(O_,{area:`footer`,children:a})]})})});return _==null?E:(0,Q.jsx)(Kg,{value:_,children:E})}A_.displayName=`Layout`;var j_={footer:{kmuXW:`x2lah0s`,$$css:!0},inner:{kB7OPa:`x9f619`,ks0D6T:`xjl2t3p`,kUOVxO:`xvueqy4`,kZCmMZ:`xaku5ci`,kwRFfy:`x19eyx77`,kLKAdn:`xqty4a`,kGO01o:`x1363qu6`,"--container-padding-inline-start":`xt2a87w`,"--container-padding-inline-end":`xhq06x6`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`xfsxxt8`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},divider:{kEafiO:`x178xt8z`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,$$css:!0}},M_={sizing:e=>[{kZKoxP:e==null?e:`x16ye13r`,$$css:!0},{"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function N_({children:e,hasDivider:t,height:n,label:r,padding:i,role:a,xstyle:o,className:s,style:c,ref:l,...u}){let d=(0,Z.use)(Kg),f=(0,Z.use)(cg),p=t??d?.defaultHasDividers??!1,m=i===0;return(0,Q.jsx)(`div`,{ref:l,role:a,"aria-label":r,...hn(ye(`layout-footer`,{container:f}),J(Gg,j_.footer,M_.sizing(n??null),p&&j_.divider,o),s,c),...u,"data-divider":p||void 0,children:(0,Q.jsx)(`div`,{...J(j_.inner,m&&j_.fullBleed,i!=null&&ha[i],i!=null&&fa[i],i!=null&&_a[i],i!=null&&ba[i],xa.publish),children:e})})}N_.displayName=`LayoutFooter`;var P_={content:{kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,kVQacm:`x7giv3`,kZCmMZ:`xwjyata`,kwRFfy:`x1peupej`,kLKAdn:`x1q01h0h`,kGO01o:`x12g7ifj`,"--container-padding-inline-start":`x408pgh`,"--container-padding-inline-end":`xikqloz`,"--container-padding-block-start":`xzrhu1o`,"--container-padding-block-end":`x165zlxo`,$$css:!0},noStart:{kZCmMZ:`xaku5ci`,"--container-padding-inline-start":`xt2a87w`,$$css:!0},noEnd:{kwRFfy:`x19eyx77`,"--container-padding-inline-end":`xhq06x6`,$$css:!0},noHeader:{kLKAdn:`xuqi0w`,"--container-padding-block-start":`x186o6qk`,$$css:!0},noFooter:{kGO01o:`x1363qu6`,"--container-padding-block-end":`xfsxxt8`,$$css:!0},scrollable:{kVQacm:`xysyzu8`,$$css:!0},constrainedNoPanelsStart:{kZCmMZ:`xhlv5e7`,$$css:!0},constrainedNoPanelsEnd:{kwRFfy:`x1ahicqp`,$$css:!0},constrainedSingleStartPanel:{kwRFfy:`xy07wb4`,$$css:!0},constrainedSingleEndPanel:{kZCmMZ:`xxjme2g`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0}};function F_({children:e,isScrollable:t=!0,padding:n,label:r,role:i,xstyle:a,className:o,style:s,ref:c,...l}){let{hasHeader:u,hasFooter:d,hasStart:f,hasEnd:p}=(0,Z.use)(C_),m=n===0,h=x_({isScrollable:t,role:i,label:r}),g=(0,Z.use)(cg),_=Vt(c,h.ref);return(0,Q.jsx)(`div`,{ref:_,role:h.role,"aria-label":h[`aria-label`],...hn(ye(`layout-content`,{container:g}),J(P_.content,!f&&!m&&n==null&&P_.noStart,!p&&!m&&n==null&&P_.noEnd,!u&&!m&&n==null&&P_.noHeader,!d&&!m&&n==null&&P_.noFooter,t&&P_.scrollable,m&&P_.fullBleed,n!=null&&ha[n],n!=null&&fa[n],n!=null&&_a[n],n!=null&&ba[n],!f&&!p&&!m&&P_.constrainedNoPanelsStart,!f&&!p&&!m&&P_.constrainedNoPanelsEnd,f&&!p&&!m&&P_.constrainedSingleStartPanel,!f&&p&&!m&&P_.constrainedSingleEndPanel,xa.publish,a),o,s),...l,children:e})}F_.displayName=`LayoutContent`;function I_(e,t,n=Y.rubberBand.coefficient){if(!(t>0))return 0;let r=(1-1/(Math.abs(e)*n/t+1))*t;return e<0?-r:r}function L_(e,t,n=Y.rubberBand.coefficient){if(!(t>0))return 0;let r=Math.abs(e);if(r>=t)return e<0?-1/0:1/0;let i=t/n*r/(t-r);return e<0?-i:i}var R_=dn(`CommandPaletteContext`,1,null);R_.displayName=`CommandPaletteContext`;function z_(){return(0,Z.use)(R_)}var B_=dn(`BusyStartSettleContext`,1,null);B_.displayName=`BusyStartSettleContext`,ht({"@astryx.commandPalette.list.label":`Commands`});var V_={list:{kORKVm:`x1odjw0f`,kskxy:`xmz0i5r`,kmVPX3:`x9epnlk`,kUk6DE:`x98rzlu`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,$$css:!0}};function H_({children:e,label:t,ref:n,xstyle:r,className:i,style:a,...o}){let s=at(),c=t??s(`@astryx.commandPalette.list.label`),l=z_(),u=!l||l.selectableItems.length>0;return(0,Q.jsx)(`div`,{ref:n,...o,id:l?.listId??o.id,role:u?`listbox`:void 0,"aria-label":u?c:void 0,...hn(ye(`command-palette-list`),J(V_.list,r),i,a),children:e})}H_.displayName=`CommandPaletteList`;var U_={item:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,kg3NbH:`xrrkdod`,k8WAf4:`xce4md1`,kaIpWk:`xx3sua9`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kLWn49:`x1kq96og`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,kfSwDN:`x87ps6o`,$$css:!0},itemHighlighted:{kWkggS:`x1lmrjuc`,$$css:!0},itemDisabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0},itemSelected:{kWkggS:`xgcxg3y`,$$css:!0}};function W_({value:e,onSelect:t,isHighlighted:n,isSelected:r,isDisabled:i=!1,children:a,ref:o,xstyle:s,className:c,style:l,id:u,onClick:d,onMouseEnter:f,...p}){let m=Tt(),h=z_(),g=sg()?.isInline===!0,_=(0,Z.useRef)(null),v=(0,Z.useRef)(!1),y=(0,Z.useMemo)(()=>h?.selectableItems.findIndex(t=>t.value===e)??-1,[h?.selectableItems,e]),b=n??(h?h.highlightedIndex===y&&y>=0:!1),x=r??(h?h.value===e:!1);(0,Z.useEffect)(()=>{if(h)return;let e=g&&!v.current;v.current=!0,e||b&&_.current&&_.current.scrollIntoView?.({block:`nearest`})},[h,b,g]);let S=(0,Z.useCallback)(()=>{t?.(e),h&&(h.selectItem(e),h.onClose())},[e,t,h]);return(0,Q.jsx)(`div`,{ref:Vt(o,_),...p,id:h&&y>=0?h.getItemId(y):u,role:`option`,"aria-selected":x,"aria-disabled":i||void 0,"data-value":e,...m,onClick:i?void 0:Et(d,S),onMouseEnter:f,...hn(ye(`command-palette-item`,{highlighted:b?`highlighted`:null,selected:x?`selected`:null,disabled:i?`disabled`:null}),J(U_.item,!i&&kt.backgroundColor,b&&U_.itemHighlighted,x&&U_.itemSelected,i&&U_.itemDisabled,s),c,l),children:a})}W_.displayName=`CommandPaletteItem`;var G_={group:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,k8WAf4:`xu0wf1k`,$$css:!0}};function K_({heading:e,children:t,ref:n,xstyle:r,className:i,style:a,...o}){return(0,Q.jsxs)(`div`,{ref:n,role:`group`,"aria-label":e,...hn(ye(`command-palette-group`),J(G_.group,r),i,a),...o,children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,...hn(ye(`command-palette-group-heading`),{className:`xrrkdod xu0wf1k x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o`}),children:e}),t]})}K_.displayName=`CommandPaletteGroup`,ht({"@astryx.commandPalette.input.label":`Search commands`,"@astryx.commandPalette.input.placeholder":`Search…`,"@astryx.commandPalette.loading":`Loading`});var q_={wrapper:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,kg3NbH:`x1pzlopt`,k8WAf4:`x8o8v82`,kmuXW:`x2lah0s`,$$css:!0},input:{kUk6DE:`x98rzlu`,k7Eaqz:`xeuugli`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kMwMTN:`x1tgivj0`,kMv6JI:`x9ynric`,kGuDYH:`xjm74w1 xf9zqsd`,kLWn49:`xw6l6zx`,kmVPX3:`x1717udv`,k8Qsv1:`xeyghm5`,$$css:!0}};function J_({value:e,onValueChange:t,placeholder:n,label:r,hasAutoFocus:i=!0,endContent:a,onChange:o,onKeyDown:s,onFocus:c,onBlur:l,ref:u,xstyle:d,className:f,style:p,...m}){let h=at(),g=n??h(`@astryx.commandPalette.input.placeholder`),_=z_(),v=!_||_.selectableItems.length>0,y=sg(),b=(0,Z.useRef)(null),x=pi(_?.isBusy===!0,h(`@astryx.commandPalette.loading`),b),S=(0,Z.use)(B_);(0,Z.useEffect)(()=>{if(S!=null)return S(x),()=>S(null)},[S,x]);let[C,w]=(0,Z.useState)(!1),{ref:T,readModality:E}=Ft(),D=(0,Z.useCallback)(e=>{w(E()===`keyboard`),c?.(e)},[c,E]),O=(0,Z.useCallback)(e=>{w(!1),l?.(e)},[l]),k=e??_?.search,A=t??_?.setSearch,j=m[`aria-label`]??r??h(`@astryx.commandPalette.input.label`),ee=xt(a),M=e=>Object.hasOwn(m,e),N=M(`aria-haspopup`)&&m[`aria-haspopup`]!==!1&&m[`aria-haspopup`]!==`false`,P=!_&&(m.role===`combobox`||M(`aria-expanded`)||M(`aria-autocomplete`)||M(`aria-controls`)||M(`aria-owns`)||M(`aria-activedescendant`)||N),F=M(`role`)?m.role:P?`combobox`:`searchbox`,I=i&&y?.isInline!==!0;(0,Z.useEffect)(()=>{I&&b.current&&requestAnimationFrame(()=>{b.current?.focus()})},[I]);let L=(0,Z.useCallback)(e=>{s?.(e),e.defaultPrevented||nn(e.nativeEvent)||_?.onKeyDown(e)},[_,s]);return(0,Q.jsxs)(`div`,{...hn(ye(`command-palette-input`),J(q_.wrapper,d),f,p),children:[(0,Q.jsx)(`span`,{className:`x78zum5 x6s0dn4 x2lah0s xv1l7n4`,children:(0,Q.jsx)(mt,{icon:`search`,size:`sm`,color:`inherit`})}),(0,Q.jsx)(`input`,{...m,ref:Vt(u,b,T),...C?fe.focusVisible(q_.input):fe.suppressed(q_.input),type:`text`,...et({enterKeyHint:`search`,hasAutoCorrect:!1}),role:_?`combobox`:F,"aria-expanded":_?_.isOpen&&v:M(`aria-expanded`)?m[`aria-expanded`]:P||void 0,"aria-autocomplete":_?`list`:M(`aria-autocomplete`)?m[`aria-autocomplete`]:P?`list`:void 0,"aria-controls":_?v?_.listId:void 0:m[`aria-controls`],"aria-activedescendant":_?v&&_.highlightedIndex>=0&&_.highlightedIndex<_.selectableItems.length?_.getItemId(_.highlightedIndex):void 0:m[`aria-activedescendant`],"aria-label":j,placeholder:g,value:k,"data-autofocus":I||void 0,onChange:e=>{A?.(e.target.value),o?.(e)},onKeyDown:L,onFocus:D,onBlur:O}),(_?.isBusy||ee)&&(0,Q.jsxs)(`span`,{className:`x78zum5 x6s0dn4 xzye2dw x2lah0s`,children:[_?.isBusy&&(0,Q.jsx)(`span`,{className:`x78zum5 x6s0dn4 x2lah0s xv1l7n4 x1hc1fzr x19991ni xjd9b36 x5h36tt x4itv7f`,children:(0,Q.jsx)(wt,{size:`sm`,"aria-hidden":`true`})}),ee&&a]})]})}J_.displayName=`CommandPaletteInput`,ht({"@astryx.kbd.key.alt":`Alt`,"@astryx.kbd.key.altShort":`Alt`,"@astryx.kbd.key.backspace":`Backspace`,"@astryx.kbd.key.command":`Command`,"@astryx.kbd.key.control":`Control`,"@astryx.kbd.key.controlShort":`Ctrl`,"@astryx.kbd.key.down":`Down arrow`,"@astryx.kbd.key.enter":`Enter`,"@astryx.kbd.key.escape":`Escape`,"@astryx.kbd.key.escapeShort":`Esc`,"@astryx.kbd.key.left":`Left arrow`,"@astryx.kbd.key.plus":`Plus`,"@astryx.kbd.key.right":`Right arrow`,"@astryx.kbd.key.shift":`Shift`,"@astryx.kbd.key.shiftShort":`Shift`,"@astryx.kbd.key.tab":`Tab`,"@astryx.kbd.key.up":`Up arrow`,"@astryx.kbd.key.windowsShort":`Win`,"@astryx.kbd.shortcut":`{shortcut} + {key}`});var Y_={wrapper:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xzye2dw`,kmuXW:`x2lah0s`,$$css:!0}},X_=new Map([[`enter`,`↵`],[`backspace`,`⌫`],[`tab`,`⇥`],[`up`,`↑`],[`down`,`↓`],[`left`,`←`],[`right`,`→`],[`plus`,`+`]]),Z_=new Map([[`mod`,`⌘`],[`meta`,`⌘`],[`ctrl`,`⌃`],[`alt`,`⌥`],[`shift`,`⇧`]]),Q_=new Map([[`mod`,`@astryx.kbd.key.controlShort`],[`ctrl`,`@astryx.kbd.key.controlShort`],[`alt`,`@astryx.kbd.key.altShort`],[`shift`,`@astryx.kbd.key.shiftShort`],[`meta`,`@astryx.kbd.key.windowsShort`]]),$_=new Map([[`esc`,`escape`],[`return`,`enter`]]);function ev(e,t,n){let r=t?Z_.get(e):void 0;if(r!=null)return r;let i=t?void 0:Q_.get(e);return i==null?e===`escape`?n(`@astryx.kbd.key.escapeShort`):X_.get(e)??e.toUpperCase():n(i)}var tv=new Map([[`ctrl`,`@astryx.kbd.key.control`],[`alt`,`@astryx.kbd.key.alt`],[`shift`,`@astryx.kbd.key.shift`],[`enter`,`@astryx.kbd.key.enter`],[`backspace`,`@astryx.kbd.key.backspace`],[`escape`,`@astryx.kbd.key.escape`],[`tab`,`@astryx.kbd.key.tab`],[`up`,`@astryx.kbd.key.up`],[`down`,`@astryx.kbd.key.down`],[`left`,`@astryx.kbd.key.left`],[`right`,`@astryx.kbd.key.right`],[`plus`,`@astryx.kbd.key.plus`]]);function nv(e,t,n){if(e===`mod`)return n(t?`@astryx.kbd.key.command`:`@astryx.kbd.key.control`);let r=tv.get(e);return r?n(r):e.toUpperCase()}function rv(){return()=>{}}function iv(){return!1}function av({keys:e,ref:t,xstyle:n,className:r,style:i,...a}){let o=at(),s=(0,Z.useSyncExternalStore)(rv,Ha,iv),c=new Map,l=e.split(`+`).map(e=>e.trim().toLowerCase()).map(e=>{let t=c.get(e)??0;return c.set(e,t+1),{key:$_.get(e)??e,reactKey:`${e}:${t}`}}),u=l.map(({key:e})=>nv(e,s,o)).reduce((e,t,n)=>n===0?t:o(`@astryx.kbd.shortcut`,{shortcut:e,key:t}),``);return(0,Q.jsx)(`span`,{...a,ref:t,role:`img`,"aria-label":u,...hn(ye(`kbd`),J(Y_.wrapper,n),r,i),children:l.map(({key:e,reactKey:t})=>(0,Q.jsx)(`kbd`,{"aria-hidden":`true`,...hn(ye(`kbd-key`),{className:`x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x1tn5z8q x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle x1tgivj0 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o`}),children:ev(e,s,o)},t))})}av.displayName=`Kbd`,ht({"@astryx.commandPalette.footer.close":`Close`,"@astryx.commandPalette.footer.navigate":`Navigate`,"@astryx.commandPalette.footer.select":`Select`});var ov={footer:{k1xSpc:`x78zum5`,kwnvtZ:`x1a02dak`,kGNEyG:`x6s0dn4`,kOIVth:`x18g69wz`,kg3NbH:`x1pzlopt`,k8WAf4:`xce4md1`,kmuXW:`x2lah0s`,kMv6JI:`x9ynric`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,kMwMTN:`xv1l7n4`,$$css:!0}};function sv({children:e,ref:t,xstyle:n,className:r,style:i,...a}){let o=at();return(0,Q.jsx)(`div`,{ref:t,...hn(ye(`command-palette-footer`),J(ov.footer,n),r,i),...a,children:e??(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`x78zum5 x6s0dn4 xzye2dw`,children:[(0,Q.jsx)(av,{keys:`up`}),(0,Q.jsx)(av,{keys:`down`}),o(`@astryx.commandPalette.footer.navigate`)]}),(0,Q.jsxs)(`span`,{className:`x78zum5 x6s0dn4 xzye2dw`,children:[(0,Q.jsx)(av,{keys:`enter`}),o(`@astryx.commandPalette.footer.select`)]}),(0,Q.jsxs)(`span`,{className:`x78zum5 x6s0dn4 xzye2dw`,children:[(0,Q.jsx)(av,{keys:`escape`}),o(`@astryx.commandPalette.footer.close`)]})]})})}sv.displayName=`CommandPaletteFooter`;var cv={empty:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,k8WAf4:`xmfvnks`,kg3NbH:`x1pzlopt`,kMv6JI:`x9ynric`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,kMwMTN:`xv1l7n4`,k9WMMc:`x2b8uid`,kHjlTd:`xj0a0fe`,"--_astryx-text-overflow-wrap":`x5ujdhh`,$$css:!0}};function lv({ref:e,children:t,xstyle:n,className:r,style:i,...a}){return(0,Q.jsx)(`div`,{ref:e,...hn(ye(`command-palette-empty`),J(cv.empty,n),r,i),...a,children:t})}lv.displayName=`CommandPaletteEmpty`,ht({"@astryx.commandPalette.emptyBootstrap":`Type to search`,"@astryx.commandPalette.emptySearch":`No results`,"@astryx.commandPalette.label":`Command palette`,"@astryx.commandPalette.resultCount":`{count, number} {count, plural, one {result} other {results}}`});function uv(e){let t=e.auxiliaryData;return typeof t?.group==`string`?t.group:void 0}function dv(e){if(!e.some(e=>uv(e)!=null))return e.map(e=>({value:e.id,label:e.label}));let t=[],n=new Map,r=[];for(let i of e){let e=uv(i);e==null?r.push(i):(n.has(e)||(t.push(e),n.set(e,[])),n.get(e)?.push(i))}let i=[];for(let e of t)for(let t of n.get(e)??[])i.push({value:t.id,label:t.label});for(let e of r)i.push({value:e.id,label:e.label});return i}function fv(e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n].value;t.has(r)||t.set(r,n)}return e=>t.get(e)}function pv({items:e,value:t,renderItem:n}){let r=e=>(0,Q.jsx)(W_,{value:e.id,children:n?n(e,e.id===t):e.label},e.id);if(!e.some(e=>uv(e)!=null))return(0,Q.jsx)(Q.Fragment,{children:e.map(r)});let i=[],a=new Map,o=[];for(let t of e){let e=uv(t);e==null?o.push(t):(a.has(e)||(i.push(e),a.set(e,[])),a.get(e)?.push(t))}return(0,Q.jsxs)(Q.Fragment,{children:[i.map(e=>(0,Q.jsx)(K_,{heading:e,children:(a.get(e)??[]).map(r)},e)),o.map(r)]})}function mv({ref:e,isOpen:t,isInline:n,onOpenChange:r,searchSource:i,input:a,footer:o,renderItem:s,emptySearchText:c,emptyBootstrapText:l,value:u,onValueChange:d,label:f,width:p=640,maxHeight:m=480,...h}){let g=at(),_=f??g(`@astryx.commandPalette.label`),v=c??g(`@astryx.commandPalette.emptySearch`),y=l??g(`@astryx.commandPalette.emptyBootstrap`),b=(0,Z.useId)(),[x,S]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(``),[T,E]=(0,Z.useState)([]),[D,O]=(0,Z.useTransition)(),[k,A]=(0,Z.useOptimistic)(x),[j,ee]=(0,Z.useOptimistic)(T),M=(0,Z.useRef)(k);M.current=k;let N=D,P=(0,Z.useRef)(0),F=(0,Z.useRef)(null),I=(0,Z.useRef)(null),L=(0,Z.useCallback)(e=>{I.current=e},[]),R=fn(),z=u??C,te=(0,Z.useCallback)(e=>{u===void 0&&w(e),d?.(e)},[u,d]),B=(0,Z.useMemo)(()=>dv(j),[j]),ne=(0,Z.useMemo)(()=>fv(B),[B]),re=(0,Z.useCallback)(()=>{P.current++,S(``),E([]),u===void 0&&w(``),i.cancel?.(),R(``),r(!1)},[r,i,u,R]),ie=(0,Z.useCallback)(e=>{te(e)},[te]),V=Re({selectableItems:B,value:z,isOpen:!0,onOpen:()=>{},onClose:()=>{},onSelect:e=>{ie(e),re()},listboxId:b}),ae=(0,Z.useCallback)(e=>{i.cancel?.();let t=++P.current;V.setHighlightedIndex(-1),O(async()=>{let r=e===``;if(!r&&T.length>0){let t=e.toLowerCase().trim();ee(T.filter(e=>e.label.toLowerCase().includes(t)))}let a=[];try{let t=r?i.bootstrap():i.search(e);a=await Promise.resolve(t)}catch{}if(P.current===t&&(r||I.current?.(),S(e),ee(a),E(a),r?R(``):a.length>0&&R(g(`@astryx.commandPalette.resultCount`,{count:a.length})),r&&z!=null&&z!==``)){let e=a.findIndex(e=>e.id===z);if(e>=0){if(n){let t=a[e];t&&V.onItemMouseEnter({value:t.id},e)}else V.setHighlightedIndex(e)}}})},[i,T,O,z,n,V,ee,R,g]),H=(0,Z.useRef)(ae);H.current=ae;let U=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!t){U.current=null;return}let e=U.current!==null&&U.current!==i;return U.current=i,H.current(e?M.current:``),()=>i.cancel?.()},[t,i]);let W=(0,Z.useCallback)(e=>{if(e.key===`Escape`)n&&(e.preventDefault(),re());else if(e.key===`Enter`){if(e.preventDefault(),V.highlightedIndex>=0&&V.highlightedIndex<B.length){let e=B[V.highlightedIndex];e&&!e.disabled&&(ie(e.value),re())}}else e.key!==`Home`&&e.key!==`End`&&e.key!==` `&&V.onKeyDown(e)},[V,re,n,B,ie]),oe=(0,Z.useCallback)(e=>{let t=e.target.closest?.(`[role="option"]`);if(!t||t.getAttribute(`aria-disabled`)===`true`)return;let n=t.getAttribute(`data-value`);if(n==null)return;let r=ne(n);r!==void 0&&V.onItemMouseEnter(B[r],r)},[V,B,ne]),G=(0,Z.useMemo)(()=>({search:k,setSearch:e=>{O(()=>{A(e)}),ae(e)},value:z,setValue:te,listId:b,highlightedIndex:V.highlightedIndex,setHighlightedIndex:V.setHighlightedIndex,getItemId:V.getItemId,selectableItems:B,searchResults:j,selectItem:ie,onKeyDown:W,onClose:re,isOpen:t,isBusy:N}),[k,A,ae,z,te,b,V.highlightedIndex,V.setHighlightedIndex,V.getItemId,B,j,ie,W,re,t,N]),K=k!==``,se=!K&&j.length===0,q=K&&x!==``&&j.length===0;Gi(F,q&&!D,x);let ce;return ce=se?(0,Q.jsx)(lv,{ref:F,children:y}):q?(0,Q.jsx)(lv,{ref:F,children:v}):j.length===0?(0,Q.jsx)(lv,{"aria-hidden":`true`,children:`\xA0`}):(0,Q.jsx)(pv,{items:j,value:z,renderItem:s}),(0,Q.jsx)(Ug,{ref:e,isOpen:t,isInline:n,onOpenChange:e=>{e?r(!0):re()},width:p,maxHeight:m,purpose:`info`,"aria-label":_,...h,children:(0,Q.jsx)(R_,{value:G,children:(0,Q.jsx)(A_,{defaultHasDividers:!0,header:(0,Q.jsx)(Yg,{hasDivider:!0,padding:0,children:(0,Q.jsx)(B_,{value:L,children:a??(0,Q.jsx)(J_,{})})}),content:(0,Q.jsx)(F_,{padding:0,children:(0,Q.jsx)(H_,{onMouseOver:oe,children:ce})}),footer:(0,Q.jsx)(N_,{hasDivider:!0,padding:0,children:o??(0,Q.jsx)(sv,{})})})})})}mv.displayName=`CommandPalette`;var hv=[{keys:[`Ctrl+K`,`Cmd+K`],description:`Open the command palette: jump to a task or run an action`},{keys:[`j`,`k`],description:`Select the next or previous task in the list or on the timeline`},{keys:[`Enter`],description:`Open the details of the selected task`},{keys:[`Esc`],description:`Close the details, the palette, or a dialog`},{keys:[`/`],description:`Search tasks`},{keys:[`?`],description:`Show these shortcuts`},{keys:[`Up`,`Down`,`Home`,`End`],description:`On a timeline bar, move the selection between rows`}];function gv(e){return e instanceof HTMLElement&&(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true'], [contenteditable='']`)!==null)}function _v(e){return(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`}var vv=`[aria-haspopup='menu'][aria-expanded='true']`;function yv(){return[...document.querySelectorAll(`[aria-modal='true'], ${vv}`)].some(e=>e.closest(`[hidden]`)===null)}function bv(e){return!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!gv(e.target)&&!yv()}function xv(e,t){let n=t.toLowerCase().split(/\s+/).filter(e=>e!==``);return e.filter(e=>{let t=`${e.label} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))})}function Sv(e){let t=(0,Z.useRef)(e);t.current=e,(0,Z.useLayoutEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return()=>{let t=document.activeElement;(t===null||t===document.body||t.closest(`dialog`))&&e?.isConnected&&e.focus({preventScroll:!0})}},[]),(0,Z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),t.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[])}function Cv(){let e=z_(),t=e?.selectableItems[0]?.value;return(0,Z.useEffect)(()=>{e!==null&&t!==void 0&&e.highlightedIndex===-1&&e.setHighlightedIndex(0)},[e?.searchResults,t]),null}function wv({commands:e,onClose:t}){Sv(t);let n=e.map(e=>({id:e.id,label:e.label,auxiliaryData:e})),r=new Map(n.map(e=>[e.id,e.auxiliaryData]));return(0,Q.jsx)(mv,{isOpen:!0,onOpenChange:e=>!e&&t(),label:`Command palette`,searchSource:{search:t=>{let r=new Set(xv(e,t));return n.filter(e=>r.has(e.auxiliaryData))},bootstrap:()=>n},onValueChange:e=>{let n=r.get(e);n!==void 0&&(t(),n.run())},emptySearchText:`No actions or tasks match.`,input:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(J_,{label:`Search actions and tasks`,placeholder:`Jump to a task or run an action...`}),(0,Q.jsx)(Cv,{})]}),renderItem:({auxiliaryData:e})=>(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,children:[e.icon,(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint&&(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.hint})]})})}function Tv({onClose:e}){return Sv(e),(0,Q.jsxs)(Ug,{isOpen:!0,onOpenChange:t=>!t&&e(),width:448,children:[(0,Q.jsx)(Zg,{title:`Keyboard shortcuts`,onOpenChange:t=>!t&&e()}),(0,Q.jsx)(`dl`,{className:`flex min-h-0 flex-col gap-2 overflow-y-auto py-4 text-sm`,children:hv.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,Q.jsx)(`dt`,{className:`flex w-32 shrink-0 flex-wrap gap-1`,children:e.keys.map(e=>(0,Q.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 font-mono text-xs`,children:e},e))}),(0,Q.jsx)(`dd`,{className:`text-muted-foreground`,children:e.description})]},e.description))}),(0,Q.jsx)(`p`,{className:`border-t pt-2 text-xs text-muted-foreground`,children:`Letter shortcuts do nothing while you type in a field.`})]})}var Ev=48,Dv=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Ev-t;return n},Ov=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},kv=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Ev;n+=i>>>1^-(i&1),t[r]=n}return t},Av=384,jv=[],Mv=Ov(Dv(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Nv=Ov(Dv(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Pv=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Fv=(()=>{let e=Mv.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Mv[n];i<Mv[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Mv[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Mv[i];a<Mv[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Iv=Dv(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Lv=Ov(Dv(`123333359346463635126536711576`)),Rv=Dv(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),zv=Dv(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Bv=kv(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Vv=(()=>{let e=new Int32Array(319).fill(-1),t=kv(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=kv(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Hv=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Uv=kv(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Wv=kv(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Gv=kv(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),Kv=new Int32Array(995),qv=new Int32Array(995),Jv=new Int32Array(995),Yv=``,Xv=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Uv.length;r++)for(let i of Hv[Gv[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Xv[a*2]=Yv.length,Xv[a*2+1]=i.length,Yv+=i),Kv[n]=Uv[r],qv[n]=Wv[r],Jv[n]=a,n++}}var Zv=kv(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Qv=Ov(Dv(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),$v=kv(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),ey=Dv(`ij`),ty=Dv(`—`),ny=Dv(`1`),ry={GROUP_COUNT:Av,customValidatorNames:jv,edgeStart:Mv,labelStart:Nv,labelText:Pv,edgeTarget:Fv,nodeGroup:Iv,nodeVlist:Vv,vlistPat:Lv,vlistOps:Rv,vlistRef:zv,vlistGroup:Bv,litAnchor:Kv,litGroup:qv,litPool:Jv,poolOffsets:Xv,poolText:Yv,adjGid:Zv,adjStart:Qv,adjTgt:$v,patGid:ey,patTgt:ty,postfixLookupGroups:ny,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},iy=`line`in Error(),ay=-1,oy=-1,sy=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},cy=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},ly=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let ee=i.length-1,M=new Uint8Array(ee),N=0,P=!0;for(let e=0;e<m.length;e++){M[m[e]]=1;let t=_[g[e]*2+1];t>N&&(N=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(P=!1)}let F=1;for(;F<m.length*2;)F<<=1;let I=new Int32Array(F).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(sy(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&F-1;for(;I[n]!==-1;)n=n+1&F-1;I[n]=e}let L=(e,t,n,r)=>{let i=(sy(t,n,r)^Math.imul(e,2654435761)|0)&F-1,a=r-n;for(;;){let r=I[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&F-1}},R=n.cacheSize??8192,z=n.prefix??e.prefix??``,te=z===``?``:z+`:`,B=te.length,ne=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),re=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,V=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,U=-1,W=-1,oe=-1,G=-1,K=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,se=e=>/\s/.test(String.fromCharCode(e)),q=(e,t,n)=>{if(H=0,U=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;oe=t+1,G=n-1;let a=t+1;if(K(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!K(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(U=t+1,W=a,oe=a+1)}},ce=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},le=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ue=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,de=e=>!!e&&!Number.isNaN(Number(e)),fe=(e,t,n)=>{if(n-t<11||!ce(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ce(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ce(e,t+10,t+18,`-normal/`)},J=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],he=(e,t,n,r)=>{if(e>=10){if(e>=25)return ne[e-25](t.slice(n,r));let i=e-10;if(H!==J[i])return!1;if(U>=0){for(let e of pe[i])if(ce(t,U,W,e))return!0;return!1}switch(me[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(oe,G);return re.test(e)&&!ie.test(e)}case 3:return de(t.slice(oe,G));case 4:return ae.test(t.slice(oe,G));default:return V.test(t.slice(oe,G))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return le.test(t.slice(n,r));case 5:return de(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&de(t.slice(n,r-1));case 8:return ue.test(t.slice(n,r));default:return fe(t,n,r)}},ge=new Set(typeof E==`string`?E.split(` `):E),_e=(e,t,n,r,i,a)=>{let o=sy(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ve=new Map,Y=new Map,ye=2,be=4096,xe=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ge.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Y.get(s);return c===void 0&&Y.set(s,c=ye++),c},Se=new Map,Ce=r,we=r+4096,Te=()=>Ce++,Ee=2097152,De=8192,Oe=new Int32Array(De),ke=Array(De).fill(null),Ae=new Int32Array(De),je=new Int32Array(De),Me=new Uint8Array(De),Ne=0,Pe=(e,t,n,r,i,a,o,s)=>{let c=e;if(ke[e]!==null){if(ke[e|1]===null)c=e|1;else if(!(Ne++&3))c=e|Ne>>2&1;else return}ke[c]=t.slice(n,r),Oe[c]=i,Ae[c]=a,je[c]=o,Me[c]=s},Fe=()=>ke.fill(null),Ie=256,Le=[new Int32Array(Ie),new Int32Array(Ie),new Int32Array(Ie),new Int32Array(Ie)],[Re,ze,Be,Ve]=Le,He=new Uint8Array(Ie),Ue=new Uint8Array(Ie),We=()=>{Ie*=2,Le=Le.map(e=>{let t=new Int32Array(Ie);return t.set(e),t}),[Re,ze,Be,Ve]=Le;let e=new Uint8Array(Ie);e.set(He),He=e,Ue=new Uint8Array(Ie)},Ge=64,Ke=new Int32Array(Ge),qe=new Int32Array(Ge),Je=new Int32Array(r),Ye=2048,Xe=21,Ze=new Float64Array(Ye),Qe=new Int32Array(Ye),$e=0,et=(e,t)=>{if(e===0&&t<r)return Je[t]===$e?1:(Je[t]=$e,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Xe;for(;Qe[i]===$e;){if(Ze[i]===n)return 1;i=i+1&Ye-1}return Ze[i]=n,Qe[i]=$e,0},tt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?ay:_e(Se,e,t+1,r,0,Te)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=qe[t];if(r>n)continue;let i=Ke[t],a=n-r;if(M[i]===1&&a>0&&a<=N){let t=e.charCodeAt(r);if(P===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;q(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(he(d[t],e,r,n))return p[h+t]}return ay},nt=e=>{let t=e.length,n=0,c=0,u=!1;(ye>be||ve.size>be)&&(ve=new Map,Y=new Map,ye=2,Fe()),Ce>we&&(Se=new Map,Ce=r,Fe());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&se(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&se(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ie&&We();let _=n++;Re[_]=p,ze[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Oe[y]===v&&ke[y]!==null&&ke[y].length===g?t=y:Oe[y|1]===v&&ke[y|1]!==null&&ke[y|1].length===g&&(t=y|1),t>=0){let n=ke[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Be[_]=Ae[t],Ve[_]=je[t],He[_]=Me[t];continue}}}let b=p;if(B!==0){if(h-p<=B||!e.startsWith(te,p)){Be[_]=ay,Pe(y,e,p,h,v,ay,0,0);continue}b=p+B}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let ee=E;D-E>1&&e.charCodeAt(E)===45&&(ee=E+1);let N=0,P=0,F=0,I=-1,L=0;(l[0]>=0||M[0]===1)&&(Ke[0]=0,qe[0]=ee,L=1);let R=oy,z=0;for(let t=ee;t<D;t++)if(t===A&&(R=P<F?oy:N,z=L),N!==oy){let n=e.charCodeAt(t),r=-1;if(P<F)o.charCodeAt(P)===n?(P++,P===F&&(r=N=I)):N=oy;else{let e=i[N],t=i[N+1],c=oy;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(P=e+1,F=a[i+1],I=s[i],c=N);break}}N=c}if(r>=0&&(l[r]>=0||M[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Ge){Ge*=2;let e=new Int32Array(Ge);e.set(Ke),Ke=e;let t=new Int32Array(Ge);t.set(qe),qe=t}Ke[L]=r,qe[L]=t+2,L++}}A===D&&(R=P<F?oy:N,z=L);let ne=P<F?oy:N,re,ie=!1;if(A>=0){if(ie=!0,re=tt(e,E,A,R,z),re!==ay&&re<r&&j[re]){let t=tt(e,E,D,ne,L);t!==ay&&t!==re&&(re=t,ie=!1)}else re===ay&&(re=tt(e,E,D,ne,L),ie=!1)}else re=tt(e,E,D,ne,L);let V=0,ae=0;re===ay?Be[_]=ay:(ae=+!!ie,V=b>=C?+!!O:_e(ve,e,b,C,+!!O,e=>xe(e,O)),Be[_]=re,He[_]=ae,Ve[_]=V),Pe(y,e,p,h,v,re,V,ae)}if(n===0)return``;if(n===1)return Re[0]===0&&ze[0]===t?e:e.slice(Re[0],ze[0]);if(n*k>Ye){for(;n*k>Ye;)Ye<<=1,Xe--;Ze=new Float64Array(Ye),Qe=new Int32Array(Ye)}if(ye>=Ee||Ce>=Ee)throw Error(`cn: too many distinct classes in one merge`);$e=$e+1|0,$e===0&&(Je.fill(0),Qe.fill(0),$e=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Be[e];if(t===ay){Ue[e]=1;continue}let n=Ve[e];if(et(n,t)===1)Ue[e]=0,f=!0;else if(Ue[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)et(n,x[e]);if(He[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&et(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ue[m]){m++;continue}let t=Re[m],r=ze[m],i=m+1;for(;i<n&&Ue[i]&&Re[i]===r+1&&e.charCodeAt(r)===32;)r=ze[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},rt=16384,it=new Int32Array(rt*2),at=0,ot=1,st=Object.create(null),ct=Object.create(null),lt=new Map,ut=new Map,dt=0,ft=0,pt=()=>{at^=rt,ot=ot+1|0,ft=0},mt=e=>{let t=st[e];if(t!==void 0)return t;let n=cy(e,0,e.length),r=(n&16383)+at,i=it[r]===(n^ot)||it[r^rt]===(n^ot-1);return i&&(t=ct[e],t!==void 0)?(st[e]=t,t):(t=nt(e),i?(st[e]=t,++dt>R&&(dt=0,ct=st,st=Object.create(null),pt())):(it[r]=n^ot,++ft>rt&&pt()),t)},ht=e=>{let t=lt.get(e);if(t!==void 0)return t;let n=cy(e,0,e.length),r=(n&16383)+at,i=it[r]===(n^ot)||it[r^rt]===(n^ot-1);return i&&(t=ut.get(e),t!==void 0)?(lt.set(e,t),t):(t=nt(e),i?(lt.set(e,t),++dt>R&&(dt=0,ut=lt,lt=new Map,pt())):(it[r]=n^ot,++ft>rt&&pt()),t)},gt=e=>{let t=cy(e,0,e.length),n=(t&16383)+at;return it[n]===(t^ot)||it[n^rt]===(t^ot-1)||(it[n]=t^ot,++ft>rt&&pt(),!1)},_t=R===0?nt:iy?e=>{let t=lt.get(e);return t===void 0?ht(e):t}:mt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?_t(arguments[0]):_t(fy.apply(null,arguments))},mergeString:_t,seenBefore:R===0?()=>!1:gt,mergeUncached:nt}},uy=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:uy(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},dy=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:uy(i,t);a&&(n&&(n+=` `),n+=a)}return n},fy=function(){return dy(arguments,!1)},py=256,my=16,hy=1024,gy=4096,_y=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(gy).fill(``),l=Array(gy).fill(``),u=Array(gy).fill(``));let i=cy(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=uy(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>my&&(_.miss=my,_.skip=hy,_.e.length=0,_.at=0);let u=_.e;u.length<py?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(uy(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},vy=ly(ry),yy=_y(vy.mergeString,vy);vy.merge;var by=class extends Z.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){console.error(`Toodo: ${this.props.label} failed to render`,e,t.componentStack)}componentDidUpdate(e){this.state.error!==null&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){let{error:e}=this.state;if(e===null)return this.props.children;let t=this.props.as??`div`;return(0,Q.jsxs)(t,{role:`alert`,className:yy(`flex flex-col items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/5 p-4 text-sm`,this.props.className),children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 font-medium`,children:[(0,Q.jsx)(Cf,{"aria-hidden":!0,className:`size-4 shrink-0 text-destructive`}),xy(this.props.label),` could not be shown.`]}),(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Something went wrong while showing it. Try again, or reload the page if it keeps happening.`}),e.message&&(0,Q.jsx)(`p`,{className:`font-mono text-xs break-all text-muted-foreground`,children:e.message}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Try again`,icon:(0,Q.jsx)(af,{}),onClick:()=>this.setState({error:null})}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Reload page`,onClick:()=>window.location.reload()})]})]})}};function xy(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Sy(){let e=(0,Z.useSyncExternalStore)(Tr,xr),[t,n]=(0,Z.useState)(!1);return e===`none`?null:(0,Q.jsxs)(`div`,{role:`region`,"aria-label":`Install Toodo`,className:yy(`mb-4 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg px-3 py-2`,Yn.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)(df,{"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.jsx)(X,{size:`sm`,variant:`primary`,label:`Install`,icon:(0,Q.jsx)(md,{}),isDisabled:t,onClick:()=>{n(!0),Qr().finally(()=>n(!1))}}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:e===`prompt`?`Not now`:`Dismiss`,onClick:Lr})]})]})}var Cy=new RegExp(String.raw`[\p{Script=Adlam}\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Mandaic}\p{Script=Nko}\p{Script=Samaritan}\p{Script=Syriac}\p{Script=Thaana}\u061B\u061C\u061F\u0640\u200F\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]`,`u`);new RegExp(String.raw`[\p{Letter}\p{Nl}\p{Nd}\u200E]`,`u`),new RegExp(String.raw`\p{Mark}`,`u`);function wy(e){for(let t of e)if(Cy.test(t))return!0;return!1}function Ty(e){return typeof e!=`string`&&typeof e!=`number`||wy(String(e))?{}:{dir:`ltr`}}var Ey={base:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kOIVth:`xzye2dw`,kZKoxP:`x1grt7ep`,k8WAf4:`xt970qd`,kg3NbH:`xf314gf`,kaIpWk:`xjspbzw`,kMv6JI:`xjb2p0i`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,k63SB2:`x1e4wzip`,khDVqt:`xuxw1ft`,kzqmXN:`xeq5yr9`,ks0D6T:`x193iq5w`,k7Eaqz:`xeuugli`,$$css:!0},grows:{kAzted:`x1tn5z8q`,$$css:!0}},Dy={neutral:{kWkggS:`xxqga8b`,kMwMTN:`xzfxgs9`,$$css:!0},info:{kWkggS:`xcc0xtb`,kMwMTN:`x1jxcxwi`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},success:{kWkggS:`xdsz4j9`,kMwMTN:`xri61p4`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},warning:{kWkggS:`x1q8g9m5`,kMwMTN:`xrebv38`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},error:{kWkggS:`x1pjz0fi`,kMwMTN:`x1m024r3`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},blue:{kWkggS:`x1o0wnni`,kMwMTN:`x1vvqiwl`,$$css:!0},cyan:{kWkggS:`x1rgj867`,kMwMTN:`x1txnczv`,$$css:!0},green:{kWkggS:`x1sqjeoo`,kMwMTN:`xltfdvo`,$$css:!0},orange:{kWkggS:`x1e9xt6e`,kMwMTN:`xm47u9q`,$$css:!0},pink:{kWkggS:`xnpoty2`,kMwMTN:`xiuofww`,$$css:!0},purple:{kWkggS:`x16i6n6f`,kMwMTN:`x1m9wyeb`,$$css:!0},red:{kWkggS:`x1cibrc5`,kMwMTN:`x1joocv1`,$$css:!0},teal:{kWkggS:`x1jtji5o`,kMwMTN:`x9x0lbs`,$$css:!0},yellow:{kWkggS:`x1bo7t0x`,kMwMTN:`xdhq94a`,$$css:!0}};function Oy({variant:e=`neutral`,label:t,icon:n,xstyle:r,className:i,style:a,ref:o,...s}){let c=typeof t==`number`?String(t):typeof t==`string`&&t.length>0?t:void 0,l=xt(t);return(0,Q.jsxs)(`span`,{ref:o,...hn(ye(`badge`,{variant:e}),J(Ey.base,l&&Ey.grows,Dy[e],r),i,a),title:c,...s,children:[n,(0,Q.jsx)(`span`,{...Ty(t),className:`xb3r6kr xlyipyv xeuugli x4ej8vm`,children:t})]})}Oy.displayName=`Badge`;var ky={on_time:`On time`,late:`Late`,overdue:`Overdue`,upcoming:`Due`};function Ay(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r+1).getTime()/1e3}function jy(e,t){if(e.dueDate===null)return null;let n=Ay(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 My(e,t){if(e.dueDate===null)return 0;let n=e.status===`done`?e.milestones.completedAt??t:t;return Math.max(n-Ay(e.dueDate),0)}function Ny(e){return[...e.estimate===null?[`estimate`]:[],...e.dueDate===null?[`dueDate`]:[]]}function Py(e){return e.length===0?null:`No ${e.map(e=>e===`estimate`?`estimate`:`due date`).join(` or `)}`}function Fy(e){return String(Math.round(e*100)/100)}var Iy={hours:`h`,days:`d`,weeks:`w`,months:`mo`},Ly={hours:3600,days:86400,weeks:604800,months:2592e3};function Ry(e){return`${Fy(e.amount)}${Iy[e.unit]}`}function zy(e){return e?e.amount*Ly[e.unit]:null}function By(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}function Vy(e){let t=e.split(`,`).map(e=>e.trim()).filter(e=>e!==``);return[...new Set(t)].sort()}function Hy(e){return e.join(`, `)}var Uy=[`planned`,`in_progress`,`in_review`];function Wy(e){return e?.resolution===`not_adopted`}function Gy(e,t){return e.dependsOn.every(e=>{let n=t.get(e);return n?.status===`done`&&!Wy(n)})}function Ky(e,t){return e.status!==`planned`||e.dependsOn.some(e=>Wy(t.get(e)))?[]:e.dependsOn.filter(e=>t.get(e)?.status!==`done`)}function qy(e){return e.status===`planned`&&e.milestones.startedAt!==null}function Jy(e,t){return e.notes.some(e=>e.kind===`blocker`&&e.at===t)}function Yy(e,t){let n=e.milestones.pausedAt;return qy(e)&&n!==null&&Gy(e,t)&&(Jy(e,n)||e.dependsOn.some(e=>(t.get(e)?.milestones.completedAt??-1/0)>=n))}function Xy(e){return e.status===`planned`&&!qy(e)}function Zy(e,t){return qy(e)&&e.wait!==null?Math.max(e.wait.until,t):null}function Qy(e,t){let n=e.dependsOn.map(e=>{let n=t.get(e);return Wy(n)?null:n?.milestones.completedAt??null});return n.length===0||n.includes(null)?null:Math.max(...n)}function $y(e,t){return`${e}->${t}`}function eb(e){let t=new Set(e.map(e=>e.id));return e.flatMap(e=>e.dependsOn.filter(e=>t.has(e)).map(t=>({id:$y(t,e.id),source:t,target:e.id})))}function tb(e,t,n){if(t===n)return!1;let r=new Map(e.map(e=>[e.id,e])),i=r.get(t),a=r.get(n);if(i===void 0||a===void 0||!Uy.includes(a.status)||a.dependsOn.includes(t))return!1;let o=[t],s=new Set(o);for(let e=o.pop();e!==void 0;e=o.pop())for(let t of r.get(e)?.dependsOn??[]){if(t===n)return!1;s.has(t)||(s.add(t),o.push(t))}return!0}function nb(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 rb=[`hour`,`day`,`week`,`month`],ib={hour:960,day:48,week:12,month:3},ab=120;function ob(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 sb=86400;function cb(e,t){let{plannedAt:n,startedAt:r,reviewAt:i,completedAt:a,pausedAt:o}=e.milestones;if(Xy(e)){let n=Math.max(e.wait?.until??t,t);return{start:n,end:n}}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 lb(e,{start:t,end:n}){let r=ni(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 ub(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 db(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 fb(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}function pb(e,t){let n=[],r=[];for(let i of e){let e=cb(i,t);e===null?r.push(i):n.push({task:i,interval:e})}return[...fb(n).map(({task:e})=>e),...r]}var mb=e=>String(e).padStart(2,`0`),hb={hour:{minor:`hour`,major:`day`},day:{minor:`day`,major:`month`},week:{minor:`week`,major:`month`},month:{minor:`month`,major:`year`}},gb={hour:e=>`${mb(e.getHours())}:00`,day:e=>`${mb(e.getMonth()+1)}-${mb(e.getDate())}`,week:e=>`${mb(e.getMonth()+1)}-${mb(e.getDate())}`,month:e=>`${e.getFullYear()}-${mb(e.getMonth()+1)}`,year:e=>String(e.getFullYear())},_b={...gb,day:e=>`${e.getFullYear()}-${mb(e.getMonth()+1)}-${mb(e.getDate())}`};function vb(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 yb(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 bb(e,t,n){let r=[];for(let i=vb(e,n);i.getTime()/1e3<t;yb(i,n))r.push(new Date(i));return r}function xb(e,t,n){let r=ib[e.scale],i=t=>(t-e.start)/sb*r,a=e.start+t/r*sb,o=e.start+n/r*sb;e.period!==null&&(a=Math.max(a,e.period.start),o=Math.min(o,e.period.end));let{minor:s,major:c}=hb[e.scale];return{ticks:bb(a,o,s).filter(e=>e.getTime()/1e3>=a).map(e=>({at:e.getTime()/1e3,x:i(e.getTime()/1e3),label:gb[s](e)})),majorTicks:bb(a,o,c).map(t=>{let n=new Date(t);yb(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:_b[c](t)}})}}function Sb(e){return e.length*6+6}function Cb(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 wb(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=cb(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?[]:[Ay(e.dueDate)]);s=vb(Math.min(t,...e,...n.map(e=>e-sb)),`day`).getTime()/1e3;let r=o.flatMap(({task:e})=>Zy(e,t)??[]),i=vb(Math.max(t,...o.map(({interval:e})=>e.end),...r,...n.map(e=>e-1)),`day`);yb(i,`day`),c=i.getTime()/1e3}let l=e=>(e-s)/sb*ib[n],u=new Map,d=fb(o).map(({task:e,interval:r},a)=>{let o={start:Math.max(r.start,s),end:Math.min(r.end,c)},d=Xy(e),f,p,m=[],h=[],g=null;if(d){let t=e.dependsOn.flatMap(e=>{let t=i.get(e);if(t?.status===`done`&&!Wy(t))return[];let n=u.get(e);return n===void 0?[]:[n+16]});f=Math.max(l(o.start),...t);let r=zy(e.estimate);p=Math.max(r===null?0:r/sb*ib[n],28)}else{f=l(o.start),p=Math.max(l(o.end)-f,4);for(let t of lb(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=Zy(e,t),r=l(Math.min(n??t,c))-f;qy(e)&&r-p>=6&&(h=[...h,{x:p,width:r-p}]),n!==null&&n<c&&r>=p&&(g={x:r,width:28},p=r+28)}u.set(e.id,f+p);let _=e.dueDate===null?null:Ay(e.dueDate);return{task:e,row:a,x:f,width:p,pending:d,phases:m,blocks:db(p,h),resume:g,pauses:h,lead:ub(e,Qy(e,i),f,s,l),dueX:_!==null&&_>=s&&_<=c?l(_)-f:null,dueState:jy(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,ab))),scale:n,period:r,nowX:t>=s&&t<=c?l(t):null}}function Tb(e){return{start:new Date(e,0,1).getTime()/1e3,end:new Date(e+1,0,1).getTime()/1e3}}function Eb(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 Db(e,t){return e.scale!==`month`&&e.nowX!==null?{x:16-e.nowX,y:0,zoom:1}:{x:Math.min(16,t.visible-e.width-16),y:0,zoom:1}}function Ob(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&&Yy(e,t);return r||i?null:n}var kb=[`blocker_note`,`stalled`];function Ab(e){let t=[...e.milestones.startedAt===null?[]:[e.milestones.startedAt],...e.timeline.map(e=>e.at),...e.notes.map(e=>e.at)];return t.length===0?null:Math.max(...t)}function jb(e,t,n=new Map(e.map(e=>[e.id,e]))){let r=e=>kb.indexOf(e.reasons[0]);return e.flatMap(e=>{let r=kb.filter(r=>{switch(r){case`blocker_note`:return Ob(e,n)!==null;case`stalled`:{let n=Ab(e);return e.status===`in_progress`&&n!==null&&t-n>604800}}});return r.length>0?[{task:e,reasons:r}]:[]}).sort((e,t)=>r(e)-r(t)||e.task.id-t.task.id)}var Mb={blocker_note:`Blocker`,stalled:`Stalled`},Nb={blocker_note:`warning`,stalled:`neutral`};function Pb({onShow:e}){let t=jb(ur().data??[],Date.now()/1e3);return t.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:yy(`flex items-center gap-1.5 px-1 text-xs font-medium uppercase`,In.attention),children:[(0,Q.jsx)(Hu,{"aria-hidden":!0,className:`size-3.5`}),`Needs attention`,(0,Q.jsx)(`span`,{className:yy(`ml-auto rounded-full px-1.5 tabular-nums`,jn.attention),children:t.length})]}),(0,Q.jsx)(`ul`,{"aria-label":`Tasks needing attention`,className:`flex max-h-60 flex-col gap-0.5 overflow-y-auto`,children:t.map(({task:t,reasons:n})=>(0,Q.jsx)(`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)(Oy,{"data-reason":e,variant:Nb[e],label:Mb[e]},e))})]})},t.id))})]})}function Fb(e,t,n){let r=[];for(let i of e)if(i!=null)for(let e of i.querySelectorAll(t)){if(e.matches(`:disabled, [aria-disabled="true"]`)||n?.(e)===!1)continue;let{left:t,top:i,right:a,bottom:o}=e.getBoundingClientRect();r.push({element:e,left:t,top:i,right:a,bottom:o})}return r}function Ib(e){let t=null;for(let n of e){if(n==null)continue;let e=n.getBoundingClientRect();t==null?t={left:e.left,top:e.top,right:e.right,bottom:e.bottom,view:n.ownerDocument.defaultView}:(t.left=Math.min(t.left,e.left),t.top=Math.min(t.top,e.top),t.right=Math.max(t.right,e.right),t.bottom=Math.max(t.bottom,e.bottom))}return t}function Lb(e,t,n,r){let i=(e,t,n)=>Math.min(Math.max(e,t),n);return t===`x`?[i(n,e.left,e.right),(e.top+e.bottom)/2]:[(e.left+e.right)/2,i(r,e.top,e.bottom)]}function Rb(e){let t=[],n=null,r=null,i=null,a=!1,o=!1,s=0,c=0,l=new Map,u=null,d=null,f=t=>{let n=e().paintsHighlight;return typeof n==`function`?n(t):n!==!1},p=e=>{let t=l.get(e);t!=null&&(clearTimeout(t),l.delete(e))},m=e=>{f(e)&&(p(e),e.setAttribute(Ri,`on`))},h=e=>{f(e)&&(p(e),e.removeAttribute(Ri))},g=e=>{f(e)&&(p(e),e.setAttribute(Ri,`fading`),l.set(e,setTimeout(()=>{l.delete(e),e.getAttribute(`data-astryx-press`)===`fading`&&e.removeAttribute(Ri)},zi(e))))},_=t=>{if(t===n)return;let r=n;r!=null&&h(r),n=t,t!=null&&m(t),e().onHighlightChange?.(t,r)},v=()=>{let{roots:t,itemSelector:n,isItem:r}=e();return Fb(t(),n,r)},y=(n,r)=>{let{resolveTarget:a,highlightExpansion:o,tracksAlong:s}=e(),[c,l]=u==null||s==null?[n,r]:Lb(u,s,n,r);if(a!=null)return t.length===0?null:a(c,l,t);let d=null;for(let e of t)if(c>=e.left-o&&c<=e.right+o&&l>=e.top-o&&l<=e.bottom+o){if(i!=null&&e.element.contains(i))return e.element;d??=e.element}return d},b=()=>{t=[],n=null,r=null,i=null,a=!1,o=!1,u=null,d?.(),d=null},x=()=>{let t=n,r=a;b(),t!=null&&(h(t),r&&e().onHighlightChange?.(null,t))},S=t=>{t!=null&&(d=K(t,`keydown`,t=>{t.key===`Escape`&&a&&(t.preventDefault(),x(),e().onCancel?.())},{cancels:!0}))};return{begin(l,f,{inert:p=!1,landed:g=null}={}){let _=n;_!=null&&h(_),d?.(),d=null,t=p?[]:v();let{roots:b,tracksAlong:x}=e();u=p||x==null?null:Ib(b()),u!=null&&S(u.view),n=null,a=!0,o=p,i=g,s=l,c=f,e().onMove?.(l,f);let C=y(l,f);r=C,C!=null&&(n=C,m(C)),C!==_&&e().onHighlightChange?.(C,_)},move(t,n){a&&(s=t,c=n,e().onMove?.(t,n),_(y(t,n)))},end(){let t=n,r=a;if(b(),!r||t==null||(g(t),t.matches(`:disabled, [aria-disabled="true"]`)))return null;let{onActivate:i,onActivated:o,swallowsNativeClick:s}=e();if(i!=null)i(t),s===!0&&ae(t.ownerDocument);else{let e=s===!0?Pi(t):Mi(t);o?.(t,e)}return t},cancel:x,offsetBy(e,n){for(let r of u==null?t:[...t,u])r.left+=e,r.right+=e,r.top+=n,r.bottom+=n},remeasure(){a&&!o&&(t=v(),u!=null&&(u=Ib(e().roots())??u),_(y(s,c)))},get highlighted(){return n},get beganOn(){return r},get isTracking(){return a},dispose(){for(let[e,t]of l)clearTimeout(t),e.getAttribute(`data-astryx-press`)===`fading`&&e.removeAttribute(Ri);l.clear(),b()}}}var zb={viewportSize(){return typeof window>`u`?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight}},isRtl(e){return typeof window>`u`||!y(e)?!1:(e.ownerDocument.defaultView??window).getComputedStyle(e).direction===`rtl`},viewRect(e){if(!y(e))return null;let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}},Bb=new Set([`began`,`changed`,`ended`,`cancelled`]),Vb={possible:[`began`,`ended`,`failed`],began:[`changed`,`ended`,`cancelled`],changed:[`changed`,`ended`,`cancelled`],ended:[`possible`],cancelled:[`possible`],failed:[`possible`]};function Hb(e,t){return Vb[e].includes(t)}function Ub(e){return e===`ended`||e===`cancelled`||e===`failed`}function Wb(e){return e===`began`||e===`changed`}var Gb={panX:!0,panY:!0,pinchZoom:!0,doubleTapZoom:!0},Kb={panX:!0,panY:!0,pinchZoom:!0,doubleTapZoom:!1},qb=1,Jb=class{id=qb++;view=null;arena=null;pending=null;stateValue=`possible`;listeners=new Set;transitionListeners=new Set;failureRequirements=new Set;simultaneousWith=new Set;touches=new Map;seenTouchIds=new Set;lastLocation={x:0,y:0};constructor(e={}){this.options=e,this.name=e.name??this.constructor.name,this.isEnabled=e.isEnabled??!0,this.cancelsTouchesInView=e.cancelsTouchesInView??!0,this.selectionLock=e.selectionLock??null,this.delaysTouchesBegan=e.delaysTouchesBegan??!1,this.delaysTouchesEnded=e.delaysTouchesEnded??!0,this.allowedPointerTypes=e.allowedPointerTypes==null?null:new Set(e.allowedPointerTypes),this.allowedScrollTypes=new Set(e.allowedScrollTypes??this.defaultScrollTypes),this.requiresExclusiveTouchType=e.requiresExclusiveTouchType??!0}get isDiscrete(){return!1}get claimsTouches(){return this.options.claimsTouches??!0}get state(){return this.stateValue}get nativeTouchBehavior(){return Gb}get acceptsTouchInput(){return this.allowedPointerTypes==null||this.allowedPointerTypes.has(`touch`)}get numberOfTouches(){return this.touches.size}get trackedTouches(){return[...this.touches.values()]}location(){if(this.touches.size===0)return this.lastLocation;let e=0,t=0;for(let n of this.touches.values())e+=n.x,t+=n.y;return this.lastLocation={x:e/this.touches.size,y:t/this.touches.size},this.lastLocation}get environment(){return this.arena?.environment??zb}requireToFail(e){return this.failureRequirements.add(e),this}recognizeSimultaneouslyWith(...e){for(let t of e)this.simultaneousWith.add(t),t.simultaneousWith.add(this);return this}requiresFailureOf(e){return this.failureRequirements.has(e)||this.options.shouldRequireFailureOf?.(this,e)===!0||e.options.shouldBeRequiredToFailBy?.(e,this)===!0}allowsSimultaneous(e){return this.simultaneousWith.has(e)||this.options.shouldRecognizeSimultaneously?.(this,e)===!0&&e.options.shouldRecognizeSimultaneously?.(e,this)===!0}shouldBegin(){return this.options.shouldBegin?.(this)??!0}keepsTouch(e){return!1}canPrevent(e){return!0}canBePrevented(e){return!0}isInvolved(){return this.touches.size>0||this.pending!=null}addListener(e){let t=e;return this.listeners.add(t),()=>{this.listeners.delete(t)}}addTransitionListener(e){let t=e;return this.transitionListeners.add(t),()=>{this.transitionListeners.delete(t)}}touchesBegan(e,t){}touchesMoved(e,t){}touchesEnded(e,t){}touchesCancelled(e,t){Wb(this.state)?this.setState(`cancelled`):this.state===`possible`&&this.setState(`failed`)}touchesTakenByBrowser(e,t){return!this.claimsTouches||(this.touchesCancelled(e,t),!1)}touchBeganElsewhere(e,t){}reset(){}get defaultScrollTypes(){return[]}acceptsTouch(e){if(!this.isEnabled)return!1;if(e.scrollType!=null)return this.allowedScrollTypes.has(e.scrollType)&&(this.options.shouldReceiveTouch?.(this,e)??!0);if(this.allowedPointerTypes!=null&&!this.allowedPointerTypes.has(e.pointerType))return!1;if(this.requiresExclusiveTouchType){for(let t of this.touches.values())if(t.pointerType!==e.pointerType)return!1}return this.options.shouldReceiveTouch?.(this,e)??!0}setState(e){this.arena==null?this.applyState(e):this.arena.requestTransition(this,e)}setTimer(e,t){this.arena?.setTimer(this,e,t)}clearTimer(){this.arena?.clearTimer(this)}now(){return this.arena?.now()??0}cancelTouchesInView(){this.arena?.cancelTouchesInViewOf(this)}wantsTouch(e){return this.state!==`possible`&&!Wb(this.state)||this.pending!=null?!1:this.acceptsTouch(e)}deliverBegan(e,t){for(let t of e)this.touches.set(t.id,t),this.seenTouchIds.add(t.id);this.location(),this.touchesBegan(e,t)}deliverBeganElsewhere(e,t){Ub(this.state)||this.touchBeganElsewhere(e,t)}deliverMoved(e,t){let n=e.filter(e=>this.touches.has(e.id));n.length===0||Ub(this.state)||(this.location(),this.touchesMoved(n,t))}deliverEnded(e,t){let n=e.filter(e=>this.touches.has(e.id));if(n.length!==0){this.location(),Ub(this.state)||this.touchesEnded(n,t);for(let e of n)this.touches.delete(e.id)}}deliverCancelled(e,t){let n=e.filter(e=>this.touches.has(e.id));if(n.length!==0){Ub(this.state)||this.touchesCancelled(n,t);for(let e of n)this.touches.delete(e.id)}}deliverTakenByBrowser(e,t){let n=e.filter(e=>this.touches.has(e.id));if(n.length!==0&&(Ub(this.state)||!this.touchesTakenByBrowser(n,t)))for(let e of n)this.touches.delete(e.id)}onEnabledChange=null;setEnabled(e){let t=this.isEnabled!==e;this.isEnabled=e,t&&this.onEnabledChange?.(),!e&&(this.state!==`possible`||this.isInvolved())&&this.cancel()}cancel(){this.arena==null?Wb(this.state)?this.applyState(`cancelled`):this.state===`possible`&&this.isInvolved()&&this.applyState(`failed`):this.arena.stop(this)}applyState(e){let t=this.stateValue;if((t!==e||e===`changed`)&&Hb(t,e)){this.stateValue=e,e!==`possible`&&(this.pending=null);for(let n of[...this.transitionListeners])n(this,t,e);if(Bb.has(e))for(let e of[...this.listeners])e(this)}}resetToPossible(){this.clearTimer(),this.pending=null,this.touches.clear(),this.seenTouchIds.clear(),this.reset(),this.applyState(`possible`)}};function Yb(e,t){let n=0,r=0,i=0;for(let a of e)t?.has(a.id)||(n+=a.x,r+=a.y,i+=1);return i===0?{x:0,y:0}:{x:n/i,y:r/i}}function Xb(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Zb(e){return Math.hypot(e.x-e.startX,e.y-e.startY)}var Qb=class extends Jb{get kind(){return`longPress`}get family(){return`longPress`}tapsDone=0;tapStartedAt=null;tapMostTouches=0;isPressTimerArmed=!1;beganAt=null;constructor(e={}){super({...e,selectionLock:e.selectionLock===void 0?(e.minimumPressDuration??H.minimumPressDuration.value)>0?v:null:e.selectionLock}),this.minimumPressDuration=e.minimumPressDuration??H.minimumPressDuration.value,this.allowableMovement=e.allowableMovement??H.allowableMovement.value,this.numberOfTapsRequired=e.numberOfTapsRequired??0,this.numberOfTouchesRequired=e.numberOfTouchesRequired??1}isInvolved(){return super.isInvolved()||this.tapsDone>0}get nativeTouchBehavior(){return Kb}acceptsTouch(e){return!Wb(this.state)&&super.acceptsTouch(e)}touchesBegan(e,t){if(this.numberOfTouches>this.numberOfTouchesRequired)this.setState(`failed`);else if(this.tapsDone>0&&this.clearTimer(),this.tapsDone<this.numberOfTapsRequired&&(this.tapStartedAt??=t.time,this.tapMostTouches=Math.max(this.tapMostTouches,this.numberOfTouches)),this.numberOfTouches===this.numberOfTouchesRequired&&this.tapsDone>=this.numberOfTapsRequired){if(this.minimumPressDuration<=0){this.beganAt=t.time,this.setState(`began`);return}this.isPressTimerArmed=!0,this.setTimer(t.time+this.minimumPressDuration,()=>{this.isPressTimerArmed=!1,this.state===`possible`&&this.numberOfTouches===this.numberOfTouchesRequired&&(this.beganAt=this.now(),this.setState(`began`))})}}touchesMoved(e){this.state===`possible`?e.some(e=>Zb(e)>this.allowableMovement)&&this.setState(`failed`):Wb(this.state)&&this.setState(`changed`)}touchesEnded(e,t){if(Wb(this.state)){this.setState(`ended`);return}if(this.isPressTimerArmed||this.tapsDone>=this.numberOfTapsRequired){this.setState(`failed`);return}if(this.numberOfTouches-e.length>0)return;let n=t.time-(this.tapStartedAt??t.time),r=this.tapMostTouches;this.tapStartedAt=null,this.tapMostTouches=0,n>U.maximumTapDuration.value||r!==this.numberOfTouchesRequired?this.setState(`failed`):(this.tapsDone+=1,this.setTimer(t.time+U.maximumIntervalBetweenTaps.value,()=>{this.setState(`failed`)}))}reset(){this.tapsDone=0,this.tapStartedAt=null,this.tapMostTouches=0,this.isPressTimerArmed=!1,this.beganAt=null}};function $b(e){return e}var ex={now:()=>typeof performance>`u`?Date.now():performance.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},tx=class{movingIds=new Set;records=new Map;active=[];timers=new Map;realTimer=null;realTimerDeadline=1/0;currentTime=null;latestTime=-1/0;depth=0;deferDepth=0;owesResolution=!1;constructor(e={}){this.options=e,this.clock=e.clock??ex,this.environment=e.environment??zb}now(){return this.currentTime??Math.max(this.latestTime,this.clock.now())}isClaimed(e){return this.records.get(e)?.isClaimed===!0}consumerOf(e){return this.records.get(e)?.consumer??null}getTouch(e){return this.records.get(e)?.touch}participantsOf(e){return this.records.get(e)?.participants??[]}get touches(){return[...this.records.values()].map(e=>e.touch)}get involvedRecognizers(){return this.active}began(e){e.length!==0&&this.run(e[0].time,()=>{let t=new Map,n=[];for(let r of e){if(this.records.has(r.id))continue;let e=this.clampTime(r.time),i={x:r.x,y:r.y,time:e},a={id:r.id,pointerType:r.pointerType,phase:`began`,x:r.x,y:r.y,time:e,startX:r.x,startY:r.y,startTime:e,samples:[...r.history??[],i],target:r.target,scroll:r.scroll??null,takenByBrowser:!1,...r.scrollType==null?{}:{scrollType:r.scrollType}},o=[];for(let[e,n]of r.recognizers.entries()){if(!$b(n).wantsTouch(a))continue;if(o.push(n),$b(n).arena=this,!this.active.includes(n)){let t=this.active.findIndex(t=>r.recognizers.indexOf(t)>e);t===-1?this.active.push(n):this.active.splice(t,0,n)}let i=t.get(n)??[];i.push(a),t.set(n,i)}let s={touch:a,participants:o,consumer:r.consumer??null,view:`none`,isLifted:!1,isClaimed:!1,suppressClick:!1,deferredClick:!1};this.records.set(r.id,s),n.push(s)}let r=this.context();for(let e of[...this.active]){let n=t.get(e);n!=null&&$b(e).deliverBegan(n,r)}for(let e of[...this.active]){let i=t.get(e),a=n.map(e=>e.touch).filter(e=>i==null||!i.includes(e));a.length>0&&e.numberOfTouches>0&&$b(e).deliverBeganElsewhere(a,r)}for(let e of n)this.deliverViewBegan(e)})}untrackedBegan(e){this.active.some(e=>e.numberOfTouches>0)&&this.run(e.time,()=>{let t=this.clampTime(e.time),n={id:e.id,pointerType:e.pointerType,phase:`began`,x:e.x,y:e.y,time:t,startX:e.x,startY:e.y,startTime:t,samples:[{x:e.x,y:e.y,time:t}],target:e.target,scroll:e.scroll??null,takenByBrowser:!1},r=this.context();for(let e of[...this.active])e.numberOfTouches>0&&$b(e).deliverBeganElsewhere([n],r)})}moved(e){e.length!==0&&this.run(e[0].time,()=>{let t=this.update(e,`moved`);if(t.length===0)return;let n=this.context(),r=this.movingIds;this.movingIds=new Set(t.map(e=>e.id));try{for(let e of[...this.active])$b(e).deliverMoved(t,n)}finally{this.movingIds=r}for(let e of t){let t=this.records.get(e.id);t?.view===`delivered`&&t.consumer?.touchMoved(e)}})}ended(e){let t=new Map;return e.length===0||this.run(e[0].time,()=>{let n=this.update(e,`ended`),r=this.context();for(let e of[...this.active])$b(e).deliverEnded(n,r);this.reviewPending();for(let e of n){let n=this.records.get(e.id);n!=null&&(n.isLifted=!0,t.set(e.id,this.resolveEnd(n)))}}),t}cancelled(e,t){this.run(t,()=>{let t=this.liveTouches(e);for(let e of t)e.phase=`cancelled`;let n=this.context();for(let e of[...this.active])$b(e).deliverCancelled(t,n);for(let e of t){let t=this.records.get(e.id);t!=null&&(t.isLifted=!0,t.suppressClick=!0,this.cancelView(t))}})}browserTookOver(e,t){this.run(t,()=>{let t=this.liveTouches(e).filter(e=>!e.takenByBrowser);if(t.length===0)return;for(let e of t)e.takenByBrowser=!0;let n=this.context();for(let e of[...this.active])$b(e).deliverTakenByBrowser(t,n);for(let e of t){let t=this.records.get(e.id);t!=null&&(t.suppressClick=!0,this.cancelView(t))}})}advanceTime(e){this.run(e,()=>{})}requestTransition(e,t){let n=e.state;t===`failed`?this.fail(e):($b(e).pending==null||t!==`began`&&t!==`ended`)&&(n===`possible`&&(t===`began`||t===`ended`)?this.attemptRecognition(e,t):Wb(n)&&(t===`changed`||t===`ended`)?this.apply(e,t):Wb(n)&&t===`cancelled`&&this.apply(e,`cancelled`))}setTimer(e,t,n){this.timers.set(e,{deadline:t,callback:n}),this.scheduleRealTimer()}clearTimer(e){this.timers.delete(e)&&this.scheduleRealTimer()}cancelTouchesInViewOf(e){this.cancelViewTouchesOf(e)}deferResolution(e){this.deferDepth+=1;try{e()}finally{--this.deferDepth}this.deferDepth===0&&this.owesResolution&&queueMicrotask(()=>{this.owesResolution&&this.deferDepth===0&&this.run(this.lastEventTime(),()=>{})})}lastEventTime(){return Number.isFinite(this.latestTime)?this.latestTime:this.clock.now()}stop(e){let t=this.currentTime??(Number.isFinite(this.latestTime)?this.latestTime:this.clock.now());this.run(t,()=>{Wb(e.state)?this.apply(e,`cancelled`):e.state===`possible`&&e.isInvolved()&&this.fail(e)})}attemptRecognition(e,t){if(!$b(e).shouldBegin()||this.isVetoedByConsumer(e)||this.isRefusedByBrowser(e)){this.fail(e);return}let n=!1;for(let t of this.active)if(t!==e&&$b(e).requiresFailureOf(t)&&t.state!==`failed`){if(t.state!==`possible`){this.fail(e);return}t.isInvolved()&&(n=!0)}if(n)$b(e).pending=t,this.claim(e);else{for(let t of this.active)if(t!==e&&(Wb(t.state)||t.state===`ended`&&t.trackedTouches.length>0)&&this.conflicts(t,e)){this.fail(e);return}this.apply(e,t);for(let t of[...this.active])t!==e&&t.state===`possible`&&($b(t).requiresFailureOf(e)||this.conflicts(e,t))&&this.fail(t);this.claim(e),e.claimsTouches&&e.cancelsTouchesInView&&this.cancelViewTouchesOf(e)}}conflicts(e,t){return!nx(e,t)||$b(e).allowsSimultaneous(t)||!e.claimsTouches||!t.claimsTouches?!1:e.canPrevent(t)&&t.canBePrevented(e)}isRefusedByBrowser(e){let t=this.options.refusesClaim;return t==null||!e.claimsTouches?!1:e.trackedTouches.some(e=>e.phase!==`ended`&&e.phase!==`cancelled`&&t(e))}isVetoedByConsumer(e){for(let t of $b(e).seenTouchIds)if((this.records.get(t)?.consumer)?.allowsAncestorRecognizer?.(e)===!1)return!0;return!1}fail(e){Ub(e.state)||(Wb(e.state)?this.apply(e,`cancelled`):($b(e).pending=null,this.apply(e,`failed`),this.reviewPending()))}releaseClaim(e,t=new Set){let n=[];for(let r of e.trackedTouches){let i=this.records.get(r.id);i!=null&&i.isClaimed&&!t.has(r.id)&&(this.active.some(t=>t!==e&&t.claimsTouches&&(Wb(t.state)||t.state===`ended`||$b(t).pending!=null)&&t.trackedTouches.some(e=>e.id===r.id))||(i.isClaimed=!1,n.push(r.id)))}n.length>0&&this.options.onRelease?.(n)}apply(e,t){let n=e.state;$b(e).applyState(t),(e.state===t&&n!==t||t===`changed`&&n===`changed`)&&this.options.onTransition?.(e,n,t),Ub(t)&&this.clearTimer(e),t===`cancelled`?this.releaseClaim(e,this.movingIds):t===`failed`&&this.releaseClaim(e)}reviewPending(){if(this.deferDepth>0){this.owesResolution=!0;return}let e=!0;for(;e;){e=!1;for(let t of[...this.active]){let n=$b(t).pending;n!=null&&t.state===`possible`&&(this.active.some(e=>e!==t&&$b(t).requiresFailureOf(e)&&e.state===`possible`&&e.isInvolved())||($b(t).pending=null,this.attemptRecognition(t,n),e=!0))}}}claim(e){if(!e.claimsTouches)return;let t=[];for(let n of e.trackedTouches){let e=this.records.get(n.id);e==null||e.isLifted||e.isClaimed||e.touch.takenByBrowser||(e.isClaimed=!0,t.push(n.id))}t.length>0&&this.options.onClaim?.(t,e)}deliverViewBegan(e){e.consumer!=null&&e.view===`none`&&(e.suppressClick?e.view=`done`:this.beginDelayers(e)?e.view=`held`:(e.view=`delivered`,e.consumer.touchBegan(e.touch)))}resolveEnd(e){if(e.suppressClick)return`suppress`;let t=this.endDelayers(e);switch(e.view){case`delivered`:return t?(e.view=`endHeld`,e.deferredClick=!0,`defer`):(e.view=`done`,e.consumer?.touchEnded(e.touch),`allow`);case`held`:return this.beginDelayers(e)?(e.deferredClick=!0,`defer`):(e.view=`delivered`,e.consumer?.touchBegan(e.touch),this.resolveEnd(e));case`none`:case`endHeld`:case`done`:return t?(e.deferredClick=!0,`defer`):`allow`}}reviewHeld(){for(let e of this.records.values())e.view===`held`&&!this.beginDelayers(e)&&(e.suppressClick?e.view=`done`:(e.view=`delivered`,e.consumer?.touchBegan(e.touch),e.isLifted&&!this.endDelayers(e)?(e.view=`done`,e.consumer?.touchEnded(e.touch)):e.isLifted&&(e.view=`endHeld`))),e.view===`endHeld`&&!this.endDelayers(e)&&(e.view=`done`,e.suppressClick?e.consumer?.touchCancelled(e.touch):e.consumer?.touchEnded(e.touch)),e.deferredClick&&e.view!==`held`&&e.view!==`endHeld`&&!this.endDelayers(e)&&(e.deferredClick=!1,this.options.onDeferredClick?.(e.touch,!e.suppressClick))}beginDelayers(e){return e.participants.some(t=>t.delaysTouchesBegan&&t.state===`possible`&&t.isInvolved()&&$b(t).seenTouchIds.has(e.touch.id))}endDelayers(e){return e.participants.some(t=>t.delaysTouchesEnded&&t.state===`possible`&&t.isInvolved()&&$b(t).seenTouchIds.has(e.touch.id))}cancelViewTouchesOf(e){for(let t of $b(e).seenTouchIds){let e=this.records.get(t);e!=null&&(e.suppressClick=!0,this.cancelView(e))}}cancelView(e){(e.view===`delivered`||e.view===`endHeld`)&&e.consumer?.touchCancelled(e.touch),(e.view!==`none`||e.consumer!=null)&&(e.view=`done`)}context(){return{time:this.now(),allTouches:[...this.records.values()].filter(e=>!e.isLifted).map(e=>e.touch)}}liveTouches(e){let t=[];for(let n of e){let e=this.records.get(n);e!=null&&!e.isLifted&&t.push(e.touch)}return t}update(e,t){let n=[];for(let r of e){let e=this.records.get(r.id);if(e==null||e.isLifted)continue;let i=this.clampTime(r.time),a=e.touch;a.samples=[...(r.history??[]).filter(e=>e.time>a.time&&e.time<i),{x:r.x,y:r.y,time:i}],a.x=r.x,a.y=r.y,a.time=i,a.phase=t,n.push(a)}return n}clampTime(e){let t=Math.max(e,this.latestTime);return this.latestTime=t,t}run(e,t){this.depth+=1;try{this.depth===1&&this.deferDepth===0&&this.owesResolution&&(this.owesResolution=!1,this.currentTime=this.clampTime(this.lastEventTime()),this.settle()),this.flushTimers(e),this.currentTime=this.clampTime(e),t(),this.depth===1&&(this.deferDepth>0?this.owesResolution=!0:(this.owesResolution=!1,this.settle()))}finally{--this.depth,this.depth===0&&(this.currentTime=null)}}flushTimers(e){for(;;){let t=null;for(let n of this.timers)n[1].deadline<=e&&(t==null||n[1].deadline<t[1].deadline||n[1].deadline===t[1].deadline&&this.rank(n[0])<this.rank(t[0]))&&(t=n);if(t==null)break;let[n,r]=t;this.timers.delete(n),this.currentTime=this.clampTime(r.deadline),r.callback(),this.depth<=1&&this.settle()}this.scheduleRealTimer()}rank(e){let t=this.active.indexOf(e);return t===-1?1/0:t}settle(){this.reviewPending(),this.reviewHeld();let e=!1;for(let t of[...this.active]){if(!(Ub(t.state)&&t.numberOfTouches===0||t.state===`possible`&&!t.isInvolved()))continue;this.active=this.active.filter(e=>e!==t);let n=t.state;$b(t).resetToPossible(),e=!0,n!==`possible`&&this.options.onTransition?.(t,n,`possible`)}e&&this.reviewHeld();let t=!1;for(let[e,n]of this.records)n.isLifted&&n.view!==`held`&&n.view!==`endHeld`&&!n.deferredClick&&(this.records.delete(e),t=!0);t&&this.records.size===0&&this.options.onIdle?.()}scheduleRealTimer(){let e=1/0;for(let t of this.timers.values())e=Math.min(e,t.deadline);if(e===this.realTimerDeadline||(this.realTimer!=null&&(this.clock.clearTimeout(this.realTimer),this.realTimer=null),this.realTimerDeadline=e,e===1/0))return;let t=Math.max(0,e-this.clock.now()),n=t=>{this.realTimer=null,this.realTimerDeadline=1/0,t&&this.clock.now()>e?(this.realTimerDeadline=e,this.realTimer=this.clock.setTimeout(()=>n(!1),0)):this.advanceTime(e)};this.realTimer=this.clock.setTimeout(()=>n(!0),t)}};function nx(e,t){for(let n of $b(e).seenTouchIds)if($b(t).seenTouchIds.has(n))return!0;return!1}var rx=50,ix=1.5,ax=4,ox=.8,sx=1,cx=.25,lx=64,ux=.15,dx=.5,fx=16,px=1e3/60,mx=3;function hx(e){return e<=ix}var gx=class{gesture=0;phase=`finger`;last=-1/0;previous=0;sign=0;count=0;run=0;runStart=0;ratio=1;paces=[];slower=[];onPace=-1/0;paced=0;resumed=!1;joined=0;push(e,t,n,r=!1){let i=Math.abs(t),a=Math.sign(t),o=e-this.last,s=this.count>0&&hx(o),c=this.frameMs(),l=null,u=null;if(this.count===0)l=this.gesture===0?`first`:`idle`;else if(this.phase===`finger`&&o>=n)l=`idle`;else if(this.phase===`momentum`){let t=Math.round((e-this.onPace)/c),n=o>=rx,d=!s&&i>=2&&i>this.previous*1.3+.5;a!==0&&this.sign!==0&&a!==this.sign?l=`reversal`:n||d?(r&&a===this.sign&&(n||o>=1.5*c)&&(u=this.glideSteps(i,Math.max(1,t),ux)),u??(l=n?`gap`:`jump`)):r&&this.resumed&&!s&&i>sx&&i>this.paced+dx&&(l=`jump`)}if(u==null&&l==null&&s&&r){if(this.phase===`momentum`)u=this.glideSteps(i,lx);else if(this.run>0){let e=this.glideSteps(i,lx);e!=null&&e>1&&Math.abs(i-this.glideSum(e))<this.steadyOff(i)&&(u=e)}}let d=u??(l==null&&s&&this.previous>0?Math.max(1,Math.round(i/this.previous)):1),f=u!=null&&u>1,p=f?this.previous*this.ratio**d:i/d;l!=null&&(this.gesture+=1,this.phase=`finger`,this.count=0,this.run=0,this.ratio=1,this.resumed=!1,this.paces=[],this.slower=[]);let m=l===`jump`?this.joined:0,h=l==null&&u!=null&&!s;h&&(this.resumed=!0),this.joined=h?t:s&&l==null&&this.joined!==0?this.joined+t:0,s||(this.paced=i);let g=!1,_=!1;return this.phase===`finger`&&this.count>=3&&i>0&&(_=f?this.ratio<=.995:p<=this.previous*.995&&p>=this.previous*.5,_?(this.run===0&&(this.runStart=this.previous),this.run+=1):this.run=0,this.run>=ax&&p<=this.runStart*ox&&(this.phase=`momentum`,g=!0)),d===1&&this.count>0&&this.previous>0&&p>0&&(this.ratio=Math.min(1,Math.max(.5,p/this.previous))),!s&&l==null&&o<rx&&this.notePace(o,c),(l!=null||!s&&o<2*c)&&(this.onPace=e),this.count+=1,this.previous=p,a!==0&&(this.sign=a),this.last=e,{boundary:l,phase:this.phase,gesture:this.gesture,liftNow:g,decaying:_&&!g,bunched:l==null&&s,carried:m}}notePace(e,t){let n=e>=.5*t&&e<=1.5*t;this.paces.length<mx||n?(this.paces=[...this.paces.slice(-7),e],this.slower=[]):(this.slower=e>1.5*t?[...this.slower,e]:[],this.slower.length>=mx&&(this.paces=this.slower,this.slower=[]))}frameMs(){if(this.paces.length===0)return fx;let e=[...this.paces].sort((e,t)=>e-t),t=e.length>>1,n=e.length%2==1?e[t]:(e[t-1]+e[t])/2;return Math.min(n,px)}glideSum(e){let t=this.previous*this.ratio,n=0;for(let r=0;r<e;r++)n+=t,t*=this.ratio;return n}steadyOff(e){return Math.min(...[this.runStart,this.previous].filter(e=>e>0).map(t=>Math.abs(e-Math.max(1,Math.round(e/t))*t)))}glideSteps(e,t,n=cx){if(this.previous<=0||e<=0)return null;let r=this.previous*this.ratio;if(e<=r+sx)return 1;let i=r;for(let a=2;a<=Math.min(t,lx);a++)if(r*=this.ratio,i+=r,Math.abs(e-i)<=Math.max(sx,i*n))return a;return null}end(){this.count=0}};function _x(e){let t=!0,n=!0,r=!0,i=!0;for(let a of e){if(!$b(a).acceptsTouchInput||!a.claimsTouches)continue;let e=a.nativeTouchBehavior;t&&=e.panX,n&&=e.panY,r&&=e.pinchZoom,i&&=e.doubleTapZoom}return{panX:t,panY:n,pinchZoom:r,doubleTapZoom:i}}function vx(e){let t=_x(e);if(t.panX&&t.panY&&t.pinchZoom&&t.doubleTapZoom)return null;if(t.panX&&t.panY&&t.pinchZoom)return`manipulation`;let n=[];return t.panX&&n.push(`pan-x`),t.panY&&n.push(`pan-y`),t.pinchZoom&&n.push(`pinch-zoom`),n.length===0?`none`:n.join(` `)}function yx(e){let t={},n=vx(e);return n!=null&&(t.touchAction=n),t}var bx=[`pan-left`,`pan-right`,`pan-up`,`pan-down`,`pinch-zoom`];function xx(e){let t=e.trim().split(/\s+/).filter(e=>e!==``),n=new Set;t.length===0&&t.push(`auto`);for(let e of t)e===`auto`?(bx.forEach(e=>n.add(e)),n.add(`double-tap-zoom`)):e===`manipulation`?bx.forEach(e=>n.add(e)):e===`pan-x`?n.add(`pan-left`).add(`pan-right`):e===`pan-y`?n.add(`pan-up`).add(`pan-down`):bx.includes(e)&&n.add(e);return n}function Sx(e,t){let n=xx(t),r=new Set([...xx(e)].filter(e=>n.has(e)));if(bx.every(e=>r.has(e)))return r.has(`double-tap-zoom`)?`auto`:`manipulation`;let i=[];for(let[e,t,n]of[[`pan-x`,`pan-left`,`pan-right`],[`pan-y`,`pan-up`,`pan-down`]])r.has(t)&&r.has(n)?i.push(e):r.has(t)?i.push(t):r.has(n)&&i.push(n);return r.has(`pinch-zoom`)&&i.push(`pinch-zoom`),i.length===0?`none`:i.join(` `)}var Cx=`data-astryx-touch-action`,wx=`reset`,Tx=new WeakMap,Ex=new WeakMap;function Dx(e){let t=Tx.get(e);if(t==null){let n=e.nodeType===9?e:e.ownerDocument,r,i,a=n?.defaultView?.CSSStyleSheet;if(typeof a==`function`&&`replaceSync`in a.prototype&&`adoptedStyleSheets`in e){let t=new a;e.adoptedStyleSheets=[...e.adoptedStyleSheets,t],r=e=>t.replaceSync(e),i=()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==t)}}else{let t=n?.createElement(`style`),a=e.nodeType===9?n?.head??n?.documentElement:e;t!=null&&a!=null&&(a.append(t),r=e=>{t.textContent=e},i=()=>t.remove())}if(r==null||i==null)return null;t={values:new Set,marked:new Set,css:``,write:r,remove:i},Tx.set(e,t)}return t}function Ox(e,t){let n=e.getRootNode(),r=e.isConnected&&(n.nodeType===9||`host`in n)?Dx(n):null;if(r==null)return!1;r.values.has(t)||(r.values.add(t),r.css+=`:where([${Cx}="${t}"]){touch-action:${t}}`,r.write(`@layer ${wx}{${r.css}}`)),e.getAttribute(`data-astryx-touch-action`)!==t&&e.setAttribute(Cx,t);let i=Ex.get(e);return i!=null&&i!==n&&kx(e,i),r.marked.add(e),Ex.set(e,n),!0}function kx(e,t){let n=Tx.get(t);n!=null&&(n.marked.delete(e),n.marked.size===0&&(n.remove(),Tx.delete(t)))}function Ax(e){e.removeAttribute(Cx);let t=Ex.get(e);t!=null&&(Ex.delete(e),kx(e,t))}var jx={touchAction:`touch-action`,WebkitTouchCallout:`-webkit-touch-callout`,WebkitUserSelect:`-webkit-user-select`,userSelect:`user-select`};function Mx(e){return Nx.has(e.trim().toLowerCase())}var Nx=new Set([`initial`,`inherit`,`unset`,`revert`,`revert-layer`]);function Px(e,t){if(e!=null&&typeof e.requestAnimationFrame==`function`){let n=e.requestAnimationFrame(t);return()=>e.cancelAnimationFrame(n)}let n=setTimeout(t,0);return()=>clearTimeout(n)}var Fx={capture:!0,passive:!0};function Ix(e){return e.claimsTouches&&$b(e).acceptsTouchInput&&$b(e).family!==`tap`}function Lx(e){let t=e.allowedPointerTypes;return t==null||t.has(`touch`)||t.has(`pen`)}function Rx(e){return $b(e).family===`pan`}function zx(e){return e.kind===`screenEdgePan`?e:null}function Bx(e){return cS(e.changedTouches).some(e=>e.touchType===`stylus`)}var Vx=500,Hx=8;function Ux(e,t){return e.target===t.target&&Math.abs(e.x-t.x)<=1&&Math.abs(e.y-t.y)<=1}function Wx(e){return e===`touch`||e===`mouse`||e===`pen`}function Gx(e,t=e.target){return t===e.target?e.composedPath()[0]??t:t}var Kx=100,qx=180,Jx=220,Yx=40,Xx=100;function Zx(e,t,n){return e===`pinch`||t!==`continuous`?Kx:n?Jx:qx}function Qx(e,t){return Math.sign(e)*Math.max(0,Math.abs(e)-Math.abs(t)/2)}function $x(e,t,n){e.readSpan<=0||(e.speedX=eS(e.speedX,(t-e.readFromX)/e.readSpan,e.priorSpeedX),e.speedY=eS(e.speedY,(n-e.readFromY)/e.readSpan,e.priorSpeedY))}function eS(e,t,n){let r=Math.sign(t)*Math.min(Math.abs(t),Math.abs(n));return r*e>=0&&Math.abs(r)>Math.abs(e)?r:e}function tS(e,t,n){return n===0||(t-e)*Math.sign(n)>0?t:e}function nS(e,t){return e.deltaMode===1?{dx:e.deltaX*Yx,dy:e.deltaY*Yx}:e.deltaMode===2?{dx:e.deltaX*(t?.innerWidth??0),dy:e.deltaY*(t?.innerHeight??0)}:{dx:e.deltaX,dy:e.deltaY}}function rS(e){if(e.deltaMode!==0||e.shiftKey)return`discrete`;let t=e=>{let t=Math.abs(e-Math.round(e));return t>0&&t<.01};if(t(e.deltaX)||t(e.deltaY))return`discrete`;let n=e;if(typeof n.wheelDeltaY!=`number`||typeof n.wheelDeltaX!=`number`)return`discrete`;let r=(e,t)=>e===0?t===0:Math.abs(Math.abs(t)-3*Math.abs(e))<=Math.max(1.5,.05*Math.abs(e)*3);if(!r(e.deltaY,n.wheelDeltaY)||!r(e.deltaX,n.wheelDeltaX))return`discrete`;let i=(e,t)=>t!==0&&t%120==0&&e%40==0;return i(e.deltaY,n.wheelDeltaY)||i(e.deltaX,n.wheelDeltaX)?`discrete`:`continuous`}function iS(e){return e.scrollEdge===!0}function aS(e,t,n){return($b(e).classify?.({x:t,y:n})??`begin`)===`begin`}function oS(e,t){let n=e.timeStamp;return n>0xe8d4a51000&&t!=null&&t.timeOrigin>0?n-t.timeOrigin:n}function sS(e){let t=e.defaultView;return t==null||t===globalThis?ex:{...ex,now:()=>Ua(e)?.now()??ex.now()}}function cS(e){return e==null?[]:Array.from(e)}var lS=class{registry=new Map;stopWatchingMovers=null;stopBlockingForMovers=null;pendingCallerReads=new Set;isCallerReadScheduled=!1;cancelCallerRead=null;lockedBy=new Map;pressSelections=new Map;selectingContacts=new Set;dragHolds=new Set;claimHolds=new Map;retargeted=new Map;touchIds=new Map;cancelledFingers=new Set;cancelledPointers=new Map;touchTargets=new Map;watched=new Map;blockingFingers=new Set;claimingFingers=new Set;processed=new WeakSet;pointerIds=new Map;pointerKinds=new Map;layoutWatched=new Set;layoutObserver=null;lastPenLift=null;driftedPens=new Set;judgedUncancelable=new Set;fingerPointers=new Map;pendingPointers=new Map;liftStamps=new Map;claimedLifts=[];claimedLiftTimer=null;get timing(){return Ua(this.doc)}unpairedTouches=new Map;lastFed=new Map;pointerFed=new Set;lastTouch=null;ownedScrolls=new Map;ownScrollCalls=0;ownScrollFrames=new Map;lastScroll=null;touchGates=new Set;retainers=0;fingerListeners=new Set;fingerTargets=[];nextId=1;wheel=null;stopWheelLatch=null;segmenter=new gx;wheelSegment=null;wheelsSeen=new WeakSet;isInstalled=!1;isCoarse=!1;stopWatchingPointer=null;unsubscribers=[];armedElements=new Map;isArmedPress=!1;isClaimingInstalled=!1;claimingUnsubscribers=[];usesTouchEvents=!0;constructor(e,t={}){this.doc=e,this.inputMode=t.inputMode??`auto`,this.presentedHitTesting=t.presentedHitTesting??`auto`;let n={viewportSize:()=>({width:e.defaultView?.innerWidth??0,height:e.defaultView?.innerHeight??0}),isRtl:e=>y(e)&&Ea(e),viewRect:e=>{if(!y(e))return null;let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}};this.clock=t.clock??sS(e),this.arena=new tx({clock:this.clock,environment:n,onDeferredClick:(e,t)=>this.replayClick(e,t),onIdle:()=>this.releaseArmedPress(),onTransition:t.onTransition,onClaim:(e,t)=>this.lockClaimedDrags(e,t),onRelease:e=>this.releaseClaimedDrags(e),refusesClaim:e=>this.selectingContacts.has(e.id)&&(e.x!==e.startX||e.y!==e.startY)});let r=e.defaultView;this.followsPointer=t.isPrimaryPointerCoarse==null,this.isPrimaryPointerCoarse=t.isPrimaryPointerCoarse??(()=>W(r))}attach(e,t,n={}){let r=this.registrationFor(e);n.manageStyle===!1?(r.unstyled.add(t),r.recognizers.length===0&&(r.manageStyle=!1)):r.manageStyle=!0;let i=n.actionGroup===!0;i&&(r.actionGroupAsks+=1,r.actionGroup=!0),t.view=e,r.recognizers.push(t),t.onEnabledChange=()=>{this.refresh(e,r),this.syncListeners()};let a=zx(t);return a!=null&&(a.onTouchBehaviorChange=()=>{this.refresh(e,r),this.syncLayoutWatch()}),this.refresh(e,r),this.syncListeners(),()=>{t.onEnabledChange=null,i&&(--r.actionGroupAsks,r.actionGroup=r.actionGroupAsks>0),a!=null&&(a.onTouchBehaviorChange=null);let n=r.recognizers.indexOf(t);n>=0&&r.recognizers.splice(n,1),r.unstyled.delete(t),(t.state!==`possible`||t.isInvolved())&&t.cancel();let o=this.wheel;o!=null&&o.takers.includes(t)&&!this.wheelHasTaker(o)&&this.endWheel(o.last),this.refresh(e,r),this.syncListeners(),this.cleanup(e,r)}}syncLayoutWatch(){let e=new Set,t=!1;for(let[n,r]of this.registry)for(let i of r.recognizers){let r=zx(i);r!=null&&r.isEnabled&&(e.add(n),t||=r.watchesViewport)}t&&e.add(this.doc.documentElement);for(let t of[...this.layoutWatched])e.has(t)||(this.layoutObserver?.unobserve(t),this.layoutWatched.delete(t));if(e.size===0){this.layoutObserver?.disconnect(),this.layoutObserver=null;return}let n=this.doc.defaultView;if(this.layoutObserver==null&&n!=null&&typeof n.ResizeObserver==`function`){this.layoutObserver=new n.ResizeObserver(this.onLayoutChange);for(let e of this.layoutWatched)this.layoutObserver.observe(e)}for(let t of e)this.layoutWatched.has(t)||(this.layoutObserver?.observe(t),this.layoutWatched.add(t))}onLayoutChange=()=>{for(let e of this.registry.values())for(let t of e.recognizers){let e=zx(t);e!=null&&e.isEnabled&&e.layoutChanged()}};attachConsumer(e,t,n={}){let r=this.registrationFor(e);return r.consumer=t,this.refresh(e,r),this.syncListeners(),()=>{r.consumer===t&&(r.consumer=null),this.refresh(e,r),this.syncListeners(),this.cleanup(e,r)}}get document(){return this.doc}isTouchClaimed(e){let t=this.touchIds.get(e);return t!=null&&this.arena.isClaimed(t)}presentedRect(e){let t=e.getBoundingClientRect();if(!this.hitTestsLayout())return t;let{x:n,y:r}=vn(e);return n===0&&r===0?t:{left:t.left+n,top:t.top+r,right:t.right+n,bottom:t.bottom+r}}hitTestsLayout(){return this.presentedHitTesting===`always`||this.presentedHitTesting===`auto`&&ne(this.doc.defaultView)}presentedTarget(e,t,n,r){if(!this.hitTestsLayout())return e;let i=yn().filter(e=>{if(!e.isConnected||e.ownerDocument!==this.doc)return!1;let{x:t,y:n}=vn(e);return Math.abs(t)>=.5||Math.abs(n)>=.5});if(i.length===0)return e;Tn(i);let a=this.drawnAt(t,n),o=(this.doc.defaultView?.performance.now()??r)-r;if(o>0&&o<1e3){let e=e=>{let t=vn(e,r);return Math.abs(t.x)>=.5||Math.abs(t.y)>=.5?t:null},o=a,s=o==null?void 0:i.find(e=>c(e,o)),l=!1;for(let r of i){let i=e(r);if(i==null)continue;let o=this.drawnAt(t-i.x,n-i.y);if(o!=null&&c(r,o)){a=o,l=!0;break}}!l&&s!=null&&e(s)!=null&&(a=this.drawnBeneath(t,n,i))}if(a==null||a===e)return e;let s=a,l=R(e)?e:null;return i.some(e=>c(e,s)||l!=null&&c(e,l))?s:e}drawnBeneath(e,t,n){return typeof this.doc.elementsFromPoint==`function`?this.doc.elementsFromPoint(e,t).find(e=>!n.some(t=>c(t,e)))??null:null}drawnAt(e,t){let n=this.doc.elementFromPoint(e,t);for(;n?.shadowRoot!=null;){let r=n.shadowRoot.elementFromPoint(e,t);if(r==null||r===n)break;n=r}return n}browserTook(e,t){for(let t of e)this.retargeted.delete(t);this.arena.browserTookOver(e,t)}clickRetargeted(e,t,n,r){let i=this.doc.defaultView;y(e)&&e.isConnected&&i!=null&&(ae(this.doc,{takesLateMouse:r===`touch`}),I(e)&&e.matches(`input, textarea, select, [contenteditable]`)&&e.focus(),le(()=>e.dispatchEvent(new i.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:1,clientX:t,clientY:n}))))}update(e){this.followsPointer||(this.isCoarse=this.isPrimaryPointerCoarse());let t=this.registry.get(e);t!=null&&this.refresh(e,t),this.syncListeners()}pointerIdOf(e){let t=typeof e==`number`?e:e.id;for(let[e,n]of this.fingerPointers)if(n===t)return e;for(let[e,n]of this.pointerIds)if(n===t)return e;return null}isScrollBraking(e,t=se.scrollBrake.value){let n=this.lastScroll;return n!=null&&this.arena.now()-n.time<t&&c(n.scroller,e)}retain(){this.retainers+=1,this.watchPointer(),this.syncListeners();let e=!0;return()=>{e&&(e=!1,--this.retainers,this.uninstallIfIdle())}}onFingersChange(e){return this.fingerListeners.add(e),()=>{this.fingerListeners.delete(e)}}isFingerDownIn(e){return this.fingerTargets.some(t=>c(e,t))}isPenDownIn(e){return this.arena.touches.some(t=>t.pointerType===`pen`&&t.phase!==`ended`&&t.phase!==`cancelled`&&t.target instanceof Node&&c(e,t.target))}lastPenLiftIn(e){let t=this.lastPenLift;return t!=null&&t.target instanceof Node&&c(e,t.target)?t.time:-1/0}registrationFor(e){this.watchPointer();let t=this.registry.get(e);return t??(t={recognizers:[],consumer:null,hasTouchEndListener:!1,hasTouchMoveListener:!1,hasWheelListener:!1,savedStyle:new Map,authorTouchAction:null,manageStyle:!0,unstyled:new Set,actionGroup:!1,actionGroupAsks:0},this.registry.set(e,t)),t}needsInput(){return this.registry.size>0||this.retainers>0}refresh(e,t){t.manageStyle&&I(e)&&this.applyStyle(e,t),this.syncTouchMoveListener(e,t)}syncTouchMoveListener(e,t){let n=this.readsFingersFromPointerEvents()&&(this.isCoarse||this.sendsTouchEvents())&&t.recognizers.some(e=>e.isEnabled&&$b(e).acceptsTouchInput);n&&!t.hasTouchEndListener?(e.addEventListener(`touchend`,this.onClaimedTouchEnd,{passive:!1}),t.hasTouchEndListener=!0):!n&&t.hasTouchEndListener&&(e.removeEventListener(`touchend`,this.onClaimedTouchEnd),t.hasTouchEndListener=!1);let r=t.recognizers.some(e=>e.isEnabled&&Ix(e))||t.consumer?.keepsTouch!=null&&t.consumer.isEnabled?.()!==!1&&(this.isCoarse||this.isArmedPress);r&&!t.hasTouchMoveListener?(e.addEventListener(`touchmove`,this.onBlockingTouchMove,{passive:!1}),t.hasTouchMoveListener=!0):!r&&t.hasTouchMoveListener&&(e.removeEventListener(`touchmove`,this.onBlockingTouchMove),t.hasTouchMoveListener=!1);let i=t.recognizers.some(e=>e.isEnabled&&e.claimsTouches&&e.allowedScrollTypes.size>0&&($b(e).family===`pan`||$b(e).family===`pinch`));i&&!t.hasWheelListener?(e.addEventListener(`wheel`,this.onWheel,{passive:!1}),t.hasWheelListener=!0):!i&&t.hasWheelListener&&(e.removeEventListener(`wheel`,this.onWheel),t.hasWheelListener=!1)}applyStyle(e,t){let n=t.recognizers.filter(e=>e.isEnabled&&!t.unstyled.has(e)),r=n.length>0?yx(n):{};r.touchAction==null&&t.consumer?.keepsTouch!=null&&(r={...r,touchAction:`manipulation`});for(let n of Object.keys(jx)){let i=jx[n],a=r[n];if(n===`touchAction`&&(a=this.touchActionToWrite(e,t,a)),a!=null)t.savedStyle.has(i)||t.savedStyle.set(i,e.style.getPropertyValue(i)),e.style.setProperty(i,a);else if(t.savedStyle.has(i)){let n=t.savedStyle.get(i)??``;t.savedStyle.delete(i),n===``?e.style.removeProperty(i):e.style.setProperty(i,n)}}}touchActionToWrite(e,t,n){if(n==null){Ax(e),t.authorTouchAction=null;return}let r=jx.touchAction,i=t.savedStyle.has(r)?t.savedStyle.get(r)??``:e.style.getPropertyValue(r);if(i!==``&&!Mx(i))return Ax(e),Sx(n,i);if(!Ox(e,n)){this.readCallerTouchActionInNextFrame(e);return}let a=t.authorTouchAction;if(a==null||a.derived!==n){this.readCallerTouchActionInNextFrame(e);return}if(a.author==null)return;let o=Sx(n,a.author);return o===a.author?void 0:o}readCallerTouchActionInNextFrame(e){this.pendingCallerReads.add(e),this.isCallerReadScheduled||(this.isCallerReadScheduled=!0,this.cancelCallerRead=Px(this.doc.defaultView,()=>{this.isCallerReadScheduled=!1,this.cancelCallerRead=null;let e=[];for(let t of this.pendingCallerReads){let n=this.registry.get(t);n!=null&&e.push([t,n])}this.pendingCallerReads.clear();let t=this.doc.defaultView;for(let[n,r]of e){let e=n.getAttribute(Cx);if(e==null||t==null)continue;let i=t.getComputedStyle(n).touchAction||`auto`;r.authorTouchAction={derived:e,author:i===e?null:i}}for(let[t,n]of e)this.applyStyle(t,n)}))}cleanup(e,t){t.recognizers.length>0||t.consumer!=null?this.syncListeners():(t.hasTouchEndListener&&=(e.removeEventListener(`touchend`,this.onClaimedTouchEnd),!1),t.hasTouchMoveListener&&e.removeEventListener(`touchmove`,this.onBlockingTouchMove),t.hasWheelListener&&e.removeEventListener(`wheel`,this.onWheel),this.registry.delete(e),this.uninstallIfIdle())}syncListeners(){this.syncLayoutWatch(),this.syncArmed(),this.shouldListen()?(this.install(),this.syncClaimingListeners()):this.uninstall(),this.syncMoverBlocking()}syncMoverBlocking(){let e=this.isInstalled&&this.hitTestsLayout();e&&this.stopWatchingMovers==null?this.stopWatchingMovers=Dn(()=>this.syncMoverBlocking()):!e&&this.stopWatchingMovers!=null&&(this.stopWatchingMovers(),this.stopWatchingMovers=null);let t=e&&yn().some(e=>this.hasClaimingRecognizerAround(e));if(t===(this.stopBlockingForMovers!=null))return;let n=this.doc.defaultView;t&&n!=null?this.stopBlockingForMovers=K(n,`touchmove`,this.onBlockingTouchMove,{cancels:!0}):t||(this.stopBlockingForMovers?.(),this.stopBlockingForMovers=null)}hasClaimingRecognizerAround(e){if(!e.isConnected||e.ownerDocument!==this.doc)return!1;for(let[t,n]of this.registry)if((c(e,t)||c(t,e))&&n.recognizers.some(e=>e.isEnabled&&Ix(e)))return!0;return!1}syncArmed(){let e=new Set;if(!this.isCoarse)for(let[t,n]of this.registry){let r=n.consumer;(n.recognizers.some(e=>e.isEnabled&&(e.allowedPointerTypes==null||e.allowedPointerTypes.size>0))||r!=null&&r.isEnabled?.()!==!1)&&e.add(t)}for(let[t,n]of this.armedElements)e.has(t)||(n(),this.armedElements.delete(t));for(let t of e)this.armedElements.has(t)||(t.addEventListener(`pointerdown`,this.onArmedPress,Fx),this.armedElements.set(t,()=>{t.removeEventListener(`pointerdown`,this.onArmedPress,Fx)}));e.size===0&&this.isArmedPress&&(this.isArmedPress=!1,this.syncKeptPresses())}onArmedPress=e=>{let t=e;this.isInstalled||!Wx(t.pointerType)||t.pointerType!==`touch`&&!Wa(t)||(this.isArmedPress=!0,this.syncKeptPresses(),this.install(),t.pointerType!==`mouse`&&this.syncClaimingListeners(),this.onPointerDown(t))};syncKeptPresses(){for(let[e,t]of this.registry)t.consumer?.keepsTouch!=null&&this.syncTouchMoveListener(e,t)}dropCancelledLifts(e){let t=e.pointerType===`touch`&&e.isPrimary===!1;for(let[n,r]of[...this.cancelledPointers])n!==e.pointerId&&t&&r===`touch`||this.cancelledPointers.delete(n)}releaseArmedPress(){this.isArmedPress&&queueMicrotask(()=>{this.isArmedPress&&this.arena.touches.length===0&&this.cancelledPointers.size===0&&(this.isArmedPress=!1,this.syncKeptPresses(),this.syncListeners())})}uninstallIfIdle(){this.syncListeners(),this.registry.size===0&&this.retainers===0&&(this.uninstall(),this.stopWatchingPointer?.(),this.stopWatchingPointer=null,this.releaseWhenIdle())}releaseWhenIdle(){queueMicrotask(()=>{if(!(this.registry.size>0||this.retainers>0)){this.cancelledFingers.clear(),this.cancelledPointers.clear(),this.clearClaimedLifts(),this.cancelCallerRead?.(),this.cancelCallerRead=null,this.isCallerReadScheduled=!1,this.pendingCallerReads.clear();for(let e of this.ownScrollFrames.values())e();this.ownScrollFrames.clear(),this.ownedScrolls.clear();for(let e of[...this.dragHolds])e({isCancel:!0});this.pressSelections.clear(),this.selectingContacts.clear()}})}watchPointer(){if(this.stopWatchingPointer!=null)return;let e=this.doc.defaultView;this.isCoarse=this.isPrimaryPointerCoarse(),this.stopWatchingPointer=this.followsPointer?B(e,e=>this.pointerChanged(e)):()=>{}}pointerChanged(e){if(e!==this.isCoarse){this.isCoarse=e,e||this.cancelEverything(this.arena.now());for(let[e,t]of this.registry)this.refresh(e,t);this.syncListeners()}}hasClaimer(){for(let e of this.registry.values()){let t=e.consumer;if(t!=null&&t.isEnabled?.()!==!1||e.recognizers.some(e=>e.isEnabled&&e.claimsTouches&&Lx(e)))return!0}return!1}syncClaimingListeners(){if(!this.isInstalled)return;let e=this.hasClaimer();if(e===this.isClaimingInstalled)return;let t=this.doc.defaultView;for(let e of this.claimingUnsubscribers.splice(0))e();t!=null&&(this.inputMode===`auto`&&this.claimingUnsubscribers.push(K(t,`touchend`,this.onTouchEnd,{cancels:e})),e&&this.claimingUnsubscribers.push(K(t,`contextmenu`,this.onContextMenu,{cancels:!0}))),this.isClaimingInstalled=e}shouldListen(){if(!this.needsInput())return!1;if(this.isCoarse&&this.retainers>0)return!0;let e=!1;for(let t of this.registry.values()){let n=t.consumer;if(n!=null&&n.isEnabled?.()!==!1||t.recognizers.some(e=>e.isEnabled)){e=!0;break}}return e&&(this.isCoarse||this.isArmedPress)}install(){if(this.watchPointer(),!this.needsInput()||this.isInstalled)return;let e=this.doc.defaultView;this.isInstalled=!0,this.usesTouchEvents=this.inputMode===`auto`&&e!=null&&`ontouchstart`in e,e!=null&&(this.unsubscribers=[...this.inputMode===`auto`?[K(e,`touchstart`,this.onTouchStart),K(e,`touchmove`,this.onTouchMove),K(e,`touchcancel`,this.onTouchCancel)]:[],K(e,`pointerdown`,this.onPointerDown),K(e,`pointermove`,this.onPointerMove),K(e,`pointerup`,this.onPointerUp),K(e,`pointercancel`,this.onPointerCancel),K(e,`scroll`,this.onScroll),K(e,`visibilitychange`,this.onVisibilityChange),K(e,`blur`,e=>{R(e.target)||this.onBlur()})],this.isClaimingInstalled=!1,this.claimingUnsubscribers=this.inputMode===`auto`?[K(e,`touchend`,this.onTouchEnd)]:[])}uninstall(){if(this.isInstalled){this.isInstalled=!1,this.fingerTargets=[],this.isClaimingInstalled=!1;for(let e of[...this.unsubscribers.splice(0),...this.claimingUnsubscribers.splice(0)])e();this.cancelEverything(this.arena.now()),this.lastTouch=null,this.lastScroll=null}}participantsAt(e,t){let n=[],r=null,i=null;if(R(e)&&(xn(e)||[...this.touchGates].some(t=>t(e))))return{recognizers:n,consumer:r,consumerElement:i};let a=t==null;for(let o=R(e)?e:null;o!=null;o=g(o)){if(!y(o))continue;let e=this.registry.get(o);e!=null&&n.push(...e.recognizers),a||t==null||e?.consumer!=null&&(r=e.consumer,i=o,a=!0)}return{recognizers:n,consumer:r,consumerElement:i}}lockSelection(e,t,n,r,i){let a=(e,t)=>{let n=this.registry.get(e);return n?.manageStyle!==!1&&(t==null||n?.unstyled.has(t)!==!0)},o=new Map;for(let e of t){let t=e.selectionLock;if(t!=null&&y(e.view)&&a(e.view,e)){let n=o.get(t)??new Set;n.add(e.view),o.set(t,n)}}let s=r?.selectionLock;if(s!=null&&i!=null&&a(i)){let e=o.get(s)??new Set;e.add(i),o.set(s,e)}if(o.size>0){let t=[...o].map(([e,t])=>e(t,n));this.lockedBy.set(e,()=>{for(let e of t)e()})}}onWheel=e=>{let t=e;if(this.wheelsSeen.has(t))return;this.wheelsSeen.add(t);let n=oS(t,this.timing),r=t.ctrlKey?`pinch`:`pan`,i=this.wheel;if(i!=null&&(i.kind!==r||n-i.last>=i.endMs)&&(this.endWheel(n),i=null),i!=null&&i.ids.length>0&&i.follow?.lifted!==!0&&!this.wheelHasTaker(i)){this.endWheel(i.last);let e=nS(t,this.doc.defaultView);i={kind:r,scrollType:rS(t),ids:[],x:t.clientX,y:t.clientY,span:Xx,last:n,endMs:Zx(r,rS(t),Math.abs(e.dx)>Math.abs(e.dy)),timer:null,takers:[]},this.wheel=i}let{dx:a,dy:o}=nS(t,this.doc.defaultView),s=Math.abs(a)>Math.abs(o),c=null;if(r===`pan`?c=this.segmenter.push(n,s?a:o,s?Jx:qx,rS(t)===`continuous`):this.segmenter.end(),this.wheelSegment=c,c?.boundary!=null&&i!=null&&(this.endWheel(n),i=null),c!=null&&c.carried!==0&&(s?a+=c.carried:o+=c.carried),i??(i=this.beginWheel(t,r,a,o,n),this.wheel=i,i.ids.length>0&&this.latchWheel()),i.last=n,i.timer!=null&&this.clock.clearTimeout(i.timer),i.timer=this.clock.setTimeout(()=>{this.segmenter.end(),this.endWheel()},i.endMs),i.ids.length!==0){if(t.preventDefault(),i.kind===`pan`&&i.follow){let e=i.follow;if(e.lifted)return;if(this.wheelSegment?.liftNow===!0){this.followProvisionally(i,e,n),e.lifted=!0,this.arena.ended([{id:i.ids[0],x:i.x,y:i.y,time:n}]);return}if(this.wheelSegment?.decaying===!0){if(e.heldX+=a,e.heldY+=o,this.wheelSegment.bunched){let t=n-e.lastMove,r=e.speedX,i=e.speedY;$x(e,e.trueX-e.heldX,e.trueY-e.heldY),e.baseX+=(r-e.speedX)*t,e.baseY+=(i-e.speedY)*t}else e.readSpan=0;this.followProvisionally(i,e,n);return}let t=e.trueX-e.heldX,r=e.trueY-e.heldY,s=Qx(i.x-t,a),c=Qx(i.y-r,o),l=t-a,u=r-o,d=n-e.lastMove;this.wheelSegment?.bunched===!0?$x(e,l,u):d>0&&(e.priorSpeedX=e.speedX,e.priorSpeedY=e.speedY,e.readFromX=e.trueX,e.readFromY=e.trueY,e.readSpan=d,e.speedX=(l-e.trueX)/d,e.speedY=(u-e.trueY)/d),e.trueX=l,e.trueY=u,e.heldX=0,e.heldY=0,e.lastMove=n,i.x=l+s,i.y=u+c,e.baseX=i.x,e.baseY=i.y,this.arena.moved([{id:i.ids[0],x:i.x,y:i.y,time:n}])}else i.kind===`pan`?(i.x-=a,i.y-=o,this.arena.moved([{id:i.ids[0],x:i.x,y:i.y,time:n}])):(i.span*=Math.exp(-o/100),this.arena.moved(this.pinchContacts(i,n)))}};followProvisionally(e,t,n){let r=Math.max(0,n-t.lastMove),i=t.baseX+t.speedX*r,a=t.baseY+t.speedY*r;(i!==e.x||a!==e.y)&&(e.x=i,e.y=a,this.arena.moved([{id:e.ids[0],x:i,y:a,time:n}]))}beginWheel(e,t,n,r,i){let a=rS(e),o=Math.abs(n)>Math.abs(r),s={kind:t,scrollType:a,ids:[],x:e.clientX,y:e.clientY,span:Xx,last:i,endMs:Zx(t,a,o),timer:null,takers:[]};if(this.arena.touches.length>0||n===0&&r===0||e.defaultPrevented||!e.cancelable)return s;let c=Gx(e),l=Ca(c,{readsTouchAction:!1}),u=[];for(let e=R(c)?c:null;e!=null;e=g(e))if(y(e))for(let i of this.registry.get(e)?.recognizers??[])i.isEnabled&&i.claimsTouches&&i.allowedScrollTypes.has(a)&&$b(i).family===t&&(t!==`pan`||a===`continuous`)&&(t===`pan`&&(!aS(i,-n,-r)||this.scrollerTakes(c,e,n,r,o,this.keepsAxis(e,o))||iS(i)&&l.canScroll(-n,-r))||u.push(i));if(u.length===0)return s;let d={pointerType:`mouse`,target:c,scroll:l,scrollType:a,recognizers:u,consumer:null},f=t===`pan`?[this.nextId++]:[this.nextId++,this.nextId++],p={...s,ids:f,takers:u};return t===`pan`&&a===`continuous`&&(p.follow={lifted:!1,heldX:0,heldY:0,lastMove:i,trueX:s.x,trueY:s.y,baseX:s.x,baseY:s.y,speedX:0,speedY:0,readFromX:s.x,readFromY:s.y,readSpan:0,priorSpeedX:0,priorSpeedY:0}),this.arena.began(t===`pan`?[{...d,id:f[0],x:e.clientX,y:e.clientY,time:i}]:this.pinchContacts(p,i).map(e=>({...d,...e}))),f.every(e=>this.arena.participantsOf(e).length===0)?(this.arena.cancelled(f,i),s):p}scrollerTakes(e,t,n,r,i,a){for(let o=R(e)?e:null;o!=null&&!(o===t&&a);o=g(o)){if(y(o)&&wa(o,i?-n:0,i?0:-r))return!0;if(o===t)break}return!1}keepsAxis(e,t){let n=this.registry.get(e);if(n==null||!n.manageStyle)return!1;let r=n.recognizers.filter(e=>e.isEnabled&&!n.unstyled.has(e)),i=r.length>0?yx(r).touchAction:void 0;if(i==null)return!1;let a=pe(i);return t?!a.x:!a.y}pinchContacts(e,t){return[{id:e.ids[0],x:e.x-e.span/2,y:e.y,time:t},{id:e.ids[1],x:e.x+e.span/2,y:e.y,time:t}]}wheelHasTaker(e){return e.takers.some(e=>{let{state:t}=e;return e.isEnabled&&(t===`began`||t===`changed`||t===`possible`&&e.isInvolved())})}latchWheel(){let e=this.doc.defaultView;if(this.stopWheelLatch==null&&e!=null){let t=()=>{let e=this.dropDrivenWheel();e.length>0&&this.arena.cancelled(e,this.arena.now())},n=[K(e,`wheel`,this.onWheel,{cancels:!0}),K(e,`blur`,e=>{R(e.target)||t()}),K(e,`visibilitychange`,()=>{this.doc.visibilityState===`hidden`&&t()})];this.stopWheelLatch=()=>{for(let e of n)e()}}}lockClaimedDrags(e,t){for(let n of e){if(this.claimHolds.has(n))continue;let e=this.arena.touches.find(e=>e.id===n);if(e==null||e.pointerType===`touch`||e.scrollType!=null||e.phase===`ended`||e.phase===`cancelled`)continue;let r=new Set;for(let e of this.arena.participantsOf(n))(e.state===`began`||e.state===`changed`)&&e.view?.nodeType===1&&r.add(e.view);if(t.view?.nodeType===1&&r.add(t.view),r.size===0)continue;let i=p(r,this.doc.defaultView,this.pressSelections.get(n)??[],()=>{this.dragHolds.delete(i)});this.dragHolds.add(i),this.lockedBy.has(n)||this.lockedBy.set(n,i),this.claimHolds.set(n,i)}}releaseClaimedDrags(e){for(let t of e){let e=this.claimHolds.get(t);e!=null&&(this.claimHolds.delete(t),this.lockedBy.get(t)===e&&this.lockedBy.delete(t),e({isCancel:!0}))}}dropDrivenWheel(){let e=this.wheel;if(e==null||e.kind!==`pan`||e.ids.length===0||e.follow?.lifted===!0)return[];let t={...e,ids:[],takers:[]};return delete t.follow,this.wheel=t,this.stopWheelLatch?.(),this.stopWheelLatch=null,e.ids}endWheel(e){let t=this.wheel;if(this.stopWheelLatch?.(),this.stopWheelLatch=null,t==null||(this.wheel=null,t.timer!=null&&this.clock.clearTimeout(t.timer),t.ids.length===0||t.follow?.lifted))return;if(t.follow!=null){let e=t.follow,n=tS(t.x,e.trueX-e.heldX,e.speedX),r=tS(t.y,e.trueY-e.heldY,e.speedY);(n!==t.x||r!==t.y)&&(t.x=n,t.y=r,this.arena.moved([{id:t.ids[0],x:n,y:r,time:t.last}]))}let n=t.last+t.endMs,r=e==null?n:Math.max(t.last,Math.min(n,e));this.arena.ended(t.kind===`pan`?[{id:t.ids[0],x:t.x,y:t.y,time:r}]:this.pinchContacts(t,r))}noteSelectingPress(e,t,n,r){!this.lockedBy.has(e)&&xe(this.doc,t,n,r)&&this.selectingContacts.add(e)}unlockSelection(e,t=!1){let n=this.lockedBy.get(e);n?.({isCancel:t});let r=this.claimHolds.get(e);r!=null&&r!==n&&r({isCancel:t}),this.lockedBy.delete(e),this.claimHolds.delete(e),this.pressSelections.delete(e),this.selectingContacts.delete(e)}addTouchGate(e){return this.touchGates.add(e),()=>{this.touchGates.delete(e)}}keepsPressBetween(e,t){for(let n=e instanceof Node?e:null;n!=null;n=g(n)){if(!(n instanceof Element))continue;let e=this.registry.get(n)?.consumer;if(e?.keepsTouch!=null&&e.isEnabled?.()!==!1)return!0;if(n===t)break}return!1}fingersDown(){return this.fingerTargets.length}takeEvent(e){return!this.processed.has(e)&&(this.processed.add(e),!0)}onTouchStart=e=>{if(this.endWheel(oS(e,this.timing)),this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;this.fingerTargets.length>1&&this.failUnclaimedLoneFingerPans();let t=oS(e,this.timing),n=[],r=[],i=[],a=[];for(let o of cS(e.changedTouches)){if(o.touchType===`stylus`)continue;this.cancelledFingers.delete(o.identifier);let s=this.forgetFinger(o.identifier);s!=null&&i.push(s);let c=R(o.target)?Gx(e,o.target):Gx(e),l=this.presentedTarget(c,o.clientX,o.clientY,e.timeStamp),{recognizers:u,consumer:d,consumerElement:f}=this.participantsAt(l,`touch`);if(u.length===0&&d==null){r.push({id:this.nextId++,x:o.clientX,y:o.clientY,time:t,pointerType:`touch`,target:l});continue}let p=this.nextId++;this.touchIds.set(o.identifier,p),S(`touch`)&&a.push({id:p,target:l,consumerElement:f}),this.watchTarget(o.identifier,c,u.some(e=>e.isEnabled&&Ix(e))||d?.keepsTouch!=null&&d.isEnabled?.()!==!1,d!=null&&d.isEnabled?.()!==!1||u.some(e=>e.isEnabled&&e.claimsTouches)),this.lastFed.set(p,{x:o.clientX,y:o.clientY,time:t}),this.pairTouch(p,{x:o.clientX,y:o.clientY,target:c}),l!==c&&l!=null&&this.retargeted.set(p,{x:o.clientX,y:o.clientY,target:l}),n.push({id:p,x:o.clientX,y:o.clientY,time:t,pointerType:`touch`,target:l,scroll:Ca(l),recognizers:u,consumer:d})}i.length>0&&this.arena.cancelled(i,t),this.arena.began(n);for(let{id:e,target:t,consumerElement:n}of a)this.lockSelection(e,this.arena.participantsOf(e),t,this.arena.consumerOf(e)??null,n);for(let e of r)this.arena.untrackedBegan(e);this.fingerTargets.length>1&&!this.isFingerClaimed()&&this.failUnclaimedLoneFingerPans();let o=Gx(e);R(o)&&(this.lastTouch={target:o,time:t})};onTouchMove=e=>{if(this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;this.dropFingersNotDown(e);let t=oS(e,this.timing),n=[],r=[];for(let i of cS(e.changedTouches)){let e=this.touchIds.get(i.identifier);e!=null&&(n.push(e),r.push({id:e,x:i.clientX,y:i.clientY,time:t}))}if(r.length!==0){if(!e.cancelable){let e=new Map(r.map(e=>[e.id,e])),i=n.filter(t=>{let n=this.arena.getTouch(t);if(n==null||n.takenByBrowser||this.arena.isClaimed(t)||n.scroll?.allowsNativePan===!1||this.judgedUncancelable.has(t))return!1;this.judgedUncancelable.add(t);let r=e.get(t);if(r==null||n.scroll==null)return!0;let i=r.x-n.startX,a=r.y-n.startY;return Math.abs(i)>=Math.abs(a)?n.scroll.canScroll(i,0):n.scroll.canScroll(0,a)});i.length>0&&this.browserTook(i,t)}this.feedMoves(r.filter(e=>!this.pointerFed.has(e.id)))}};onBlockingTouchMove=e=>{this.cancelIfClaimed(e)};pointerFingerAt(e){let t=null,n=1/0;for(let r of this.arena.touches){if(r.pointerType!==`touch`||r.phase===`ended`||r.phase===`cancelled`||!R(r.target)||!R(e.target)||!(c(r.target,e.target)||c(e.target,r.target)))continue;let i=Math.hypot(r.x-e.clientX,r.y-e.clientY);i<n&&(t=r,n=i)}return t?.id}onClaimedTouchEnd=e=>{let t=e,n=oS(t,this.timing);for(let e=this.claimedLifts.length-1;e>=0;e--)n-this.claimedLifts[e].time>Vx&&this.claimedLifts.splice(e,1);if(t.cancelable&&!t.defaultPrevented)for(let e of cS(t.changedTouches)){let n=this.claimedLifts.findIndex(n=>Ux(n,{x:e.clientX,y:e.clientY,target:Gx(t,e.target)}));if(n>=0){this.claimedLifts.splice(n,1),this.claimedLifts.length===0&&this.clearClaimedLifts(),t.preventDefault();return}}};cancelIfClaimed(e){if(!e.cancelable||e.defaultPrevented)return;let t=cS(e.changedTouches);for(let n of t){let t=this.touchIds.get(n.identifier)??(this.usesTouchEvents?void 0:this.pointerFingerAt(n));if(t!=null&&(this.arena.isClaimed(t)||this.arena.consumerOf(t)?.keepsTouch?.(t)===!0||e.touches.length===1&&this.arena.participantsOf(t).some(e=>$b(e).keepsTouch(t)))){e.preventDefault();return}}if(Bx(e)){for(let t of this.pointerIds.values())if(this.arena.isClaimed(t)){e.preventDefault();return}}}onTouchEnd=e=>{if(this.releaseArmedPress(),this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;this.dropFingersNotDown(e);let t=oS(e,this.timing),n=[],r=[],i=!1;for(let a of cS(e.changedTouches)){if(this.cancelledFingers.delete(a.identifier)){i=!0;continue}let e=this.touchIds.get(a.identifier),o=e==null?void 0:this.retargeted.get(e),s=e==null?void 0:this.liftStamps.get(e),c=this.forgetFinger(a.identifier);c!=null&&(n.push({id:c,x:s?.x??a.clientX,y:s?.y??a.clientY,time:s?.time??t}),o!=null&&r.push({id:c,landed:o,x:a.clientX,y:a.clientY}))}n.sort((e,t)=>e.time-t.time);let a=Gx(e);R(a)&&(this.lastTouch={target:a,time:n.length>0?Math.max(...n.map(e=>e.time)):t});let o=n.length>0?this.arena.ended(n):new Map,s=i||uS(o);for(let e of r)this.clickRetargetedTap(e.landed,e,o.get(e.id),`touch`)&&(s=!0);s&&(e.cancelable&&e.preventDefault(),ae(this.doc,{takesLateMouse:!0}))};clickRetargetedTap(e,t,n,r){return e==null||n!==`allow`||Math.hypot(t.x-e.x,t.y-e.y)>U.allowableMovement.value?!1:(this.clickRetargeted(e.target,t.x,t.y,r),!0)}onTouchCancel=e=>{if(this.releaseArmedPress(),this.noteFingersDown(e),!this.usesTouchEvents||!this.takeEvent(e))return;let t=cS(e.changedTouches),n=t.length>0?t.map(e=>e.identifier):[...this.touchIds.keys()];t.length===0&&this.cancelledFingers.clear();for(let e of n)this.cancelledFingers.delete(e);let r=[];for(let e of n){let t=this.forgetFinger(e);t!=null&&r.push(t)}r.length>0&&this.arena.cancelled(r,oS(e,this.timing))};onTargetTouchMove=e=>{this.onTouchMove(e),this.cancelIfClaimed(e)};onTargetTouchMovePassive=e=>{this.onTouchMove(e)};onTargetTouchEnd=e=>{this.onTouchEnd(e)};onTargetTouchEndPassive=e=>{this.onTouchEnd(e)};onTargetTouchCancel=e=>{this.onTouchCancel(e)};dropFingersNotDown(e){if(e.touches==null||this.touchIds.size===0&&this.cancelledFingers.size===0)return;let t=new Set;for(let n of cS(e.touches))t.add(n.identifier);for(let n of cS(e.changedTouches))t.add(n.identifier);for(let e of[...this.cancelledFingers])t.has(e)||this.cancelledFingers.delete(e);let n=[...this.touchIds.keys()].filter(e=>!t.has(e)),r=[];for(let e of n){let t=this.forgetFinger(e);t!=null&&r.push(t)}r.length>0&&this.arena.cancelled(r,oS(e,this.timing))}watchTarget(e,t,n,r){if(t==null||typeof t.addEventListener!=`function`)return;this.touchTargets.set(e,t);let i=this.watched.get(t);if(i==null){this.watched.set(t,{count:1,blocking:+!!n,claiming:+!!r}),n&&this.blockingFingers.add(e),r&&this.claimingFingers.add(e),t.addEventListener(`touchmove`,n?this.onTargetTouchMove:this.onTargetTouchMovePassive,{passive:!n}),t.addEventListener(`touchend`,r?this.onTargetTouchEnd:this.onTargetTouchEndPassive,{passive:!r}),t.addEventListener(`touchcancel`,this.onTargetTouchCancel,{passive:!0});return}let a=i.blocking>0,o=i.claiming>0;i.count+=1,n&&(i.blocking+=1,this.blockingFingers.add(e)),r&&(i.claiming+=1,this.claimingFingers.add(e)),this.swapTargetTouchMove(t,a,i.blocking>0),this.swapTargetTouchEnd(t,o,i.claiming>0)}unwatchTarget(e){let t=this.touchTargets.get(e);if(t==null)return;this.touchTargets.delete(e);let n=this.watched.get(t);if(n==null)return;let r=n.blocking>0,i=n.claiming>0;--n.count,this.blockingFingers.delete(e)&&--n.blocking,this.claimingFingers.delete(e)&&--n.claiming,n.count>0?(this.swapTargetTouchMove(t,r,n.blocking>0),this.swapTargetTouchEnd(t,i,n.claiming>0)):(this.watched.delete(t),t.removeEventListener(`touchmove`,r?this.onTargetTouchMove:this.onTargetTouchMovePassive),t.removeEventListener(`touchend`,i?this.onTargetTouchEnd:this.onTargetTouchEndPassive),t.removeEventListener(`touchcancel`,this.onTargetTouchCancel))}swapTargetTouchMove(e,t,n){t!==n&&(e.removeEventListener(`touchmove`,t?this.onTargetTouchMove:this.onTargetTouchMovePassive),e.addEventListener(`touchmove`,n?this.onTargetTouchMove:this.onTargetTouchMovePassive,{passive:!n}))}swapTargetTouchEnd(e,t,n){t!==n&&(e.removeEventListener(`touchend`,t?this.onTargetTouchEnd:this.onTargetTouchEndPassive),e.addEventListener(`touchend`,n?this.onTargetTouchEnd:this.onTargetTouchEndPassive,{passive:!n}))}forgetFinger(e){let t=this.touchIds.get(e);return this.touchIds.delete(e),this.unwatchTarget(e),t!=null&&this.forgetContact(t),t}pairTouch(e,t){for(let[n,r]of this.pendingPointers)if(Ux(r,t)){this.pendingPointers.delete(n),this.fingerPointers.set(n,e),this.pointerFed.add(e);return}this.unpairedTouches.set(e,t)}pairPointer(e,t){for(let[n,r]of this.unpairedTouches)if(Ux(r,t)){this.unpairedTouches.delete(n),this.fingerPointers.set(e,n),this.pointerFed.add(n);return}this.pendingPointers.set(e,t)}feedMoves(e){let t=e.filter(e=>{let t=this.lastFed.get(e.id);return t!=null&&e.time<t.time?!1:(this.lastFed.set(e.id,{x:e.x,y:e.y,time:e.time}),!0)});t.length>0&&this.arena.moved(t)}forgetContact(e){this.unlockSelection(e),this.retargeted.delete(e),this.lastFed.delete(e),this.pointerFed.delete(e),this.liftStamps.delete(e),this.judgedUncancelable.delete(e),this.unpairedTouches.delete(e);for(let[t,n]of this.fingerPointers)n===e&&this.fingerPointers.delete(t)}onPointerDown=e=>{if(this.endMissedMouseLift(e),this.endWheel(oS(e,this.timing)),ge(this.doc),!Wx(e.pointerType))return;if(this.dropCancelledLifts(e),e.pointerType===`touch`&&this.usesTouchEvents){this.pairPointer(e.pointerId,{x:e.clientX,y:e.clientY,target:Gx(e)});return}if(e.pointerType===`touch`&&e.isPrimary===!1&&this.failUnclaimedLoneFingerPans(),e.pointerType!==`touch`&&!Wa(e))return;let t=Gx(e),n=this.presentedTarget(t,e.clientX,e.clientY,e.timeStamp),{recognizers:r,consumer:i,consumerElement:a}=this.participantsAt(n,e.pointerType);if(r.length===0&&i==null)return;let o=this.nextId++;this.pointerIds.set(e.pointerId,o),this.pointerKinds.set(e.pointerId,e.pointerType),n!==t&&n!=null&&this.retargeted.set(o,{x:e.clientX,y:e.clientY,target:n}),e.pointerType!==`touch`&&this.pressSelections.set(o,k(this.doc.defaultView)),this.arena.began([{id:o,x:e.clientX,y:e.clientY,time:oS(e,this.timing),pointerType:e.pointerType,target:n,scroll:Ca(n),recognizers:r,consumer:i}]),e.pointerType===`touch`&&e.isPrimary===!1&&!this.isFingerClaimed()&&this.failUnclaimedLoneFingerPans(),S(e.pointerType)&&this.lockSelection(o,this.arena.participantsOf(o),n,this.arena.consumerOf(o)??null,a),e.pointerType!==`touch`&&this.noteSelectingPress(o,e.clientX,e.clientY,t)};onPointerMove=e=>{if(this.endMissedMouseLift(e))return;if(e.pointerType===`touch`&&this.usesTouchEvents){let t=this.fingerPointers.get(e.pointerId);t!=null&&this.feedMoves([{id:t,x:e.clientX,y:e.clientY,time:oS(e,this.timing),history:dS(e,this.timing)}]);return}let t=this.pointerIds.get(e.pointerId);t!=null&&(e.pointerType===`pen`&&this.notePenDrift(t,e.clientX,e.clientY,oS(e,this.timing)),this.arena.moved([{id:t,x:e.clientX,y:e.clientY,time:oS(e,this.timing),history:dS(e,this.timing)}]))};endMissedMouseLift(e){if(e.pointerType!==`mouse`||e.type!==`pointerdown`&&e.buttons&1)return!1;let t=this.pointerIds.get(e.pointerId),n=t==null?void 0:this.arena.getTouch(t);return t==null||n==null?!1:(this.releaseArmedPress(),this.pointerIds.delete(e.pointerId),this.pointerKinds.delete(e.pointerId),this.unlockSelection(t),this.retargeted.delete(t),this.arena.ended([{id:t,x:n.x,y:n.y,time:oS(e,this.timing)}]),!0)}onPointerUp=e=>{if(this.releaseArmedPress(),e.pointerType===`touch`&&this.usesTouchEvents){let t=this.fingerPointers.get(e.pointerId);t!=null&&this.pointerFed.has(t)&&this.liftStamps.set(t,{x:e.clientX,y:e.clientY,time:oS(e,this.timing)}),this.fingerPointers.delete(e.pointerId),this.pendingPointers.delete(e.pointerId);return}let t=this.pointerIds.get(e.pointerId);if(t==null){this.cancelledPointers.delete(e.pointerId)&&this.refuseCancelledLift(e);return}this.pointerIds.delete(e.pointerId),this.pointerKinds.delete(e.pointerId);let n=this.claimHolds.get(t);this.unlockSelection(t);let r=this.arena.getTouch(t)?.target,i=e.pointerType===`pen`&&this.isPenHold(t,oS(e,this.timing));this.driftedPens.delete(t);let a=this.arena.ended([{id:t,x:e.clientX,y:e.clientY,time:oS(e,this.timing)}]);n?.keepLiftSelection(),i&&(this.lastPenLift={target:r,time:this.arena.now()});let o=this.retargeted.get(t);this.retargeted.delete(t);let s=this.clickRetargetedTap(o,{x:e.clientX,y:e.clientY},a.get(t),e.pointerType);!s&&uS(a)&&ae(this.doc,{takesLateMouse:e.pointerType===`touch`}),e.pointerType===`touch`&&(s||uS(a))&&this.noteClaimedLift(e)};noteClaimedLift(e){this.readsFingersFromPointerEvents()&&(this.isCoarse||this.sendsTouchEvents())&&(this.claimedLifts.push({x:e.clientX,y:e.clientY,target:Gx(e),time:oS(e,this.timing)}),this.claimedLifts.length>Hx&&this.claimedLifts.shift(),this.armClaimedLiftTimer())}armClaimedLiftTimer(){if(this.claimedLiftTimer!=null||this.claimedLifts.length===0)return;let e=this.claimedLifts[0].time+Vx;this.claimedLiftTimer=this.clock.setTimeout(()=>{this.claimedLiftTimer=null;let e=this.clock.now();for(let t=this.claimedLifts.length-1;t>=0;t--)e-this.claimedLifts[t].time>=Vx&&this.claimedLifts.splice(t,1);this.armClaimedLiftTimer()},Math.max(0,e-this.clock.now()))}clearClaimedLifts(){this.claimedLifts.length=0,this.claimedLiftTimer!=null&&(this.clock.clearTimeout(this.claimedLiftTimer),this.claimedLiftTimer=null)}onPointerCancel=e=>{if(this.releaseArmedPress(),e.pointerType===`touch`&&this.usesTouchEvents){let t=this.fingerPointers.get(e.pointerId)??this.touchForCancelledPointer(e);this.fingerPointers.delete(e.pointerId),this.pendingPointers.delete(e.pointerId),t!=null&&(this.pointerFed.delete(t),this.browserTook([t],oS(e,this.timing)));return}this.cancelledPointers.delete(e.pointerId);let t=this.pointerIds.get(e.pointerId);if(t!=null){this.pointerIds.delete(e.pointerId),this.pointerKinds.delete(e.pointerId),this.unlockSelection(t,!0),this.retargeted.delete(t);let n=this.arena.getTouch(t)?.target,r=e.pointerType===`pen`&&this.isPenHold(t,oS(e,this.timing));this.driftedPens.delete(t),this.arena.cancelled([t],oS(e,this.timing)),r&&(this.lastPenLift={target:n,time:this.arena.now()})}};isPenHold(e,t){let n=this.arena.getTouch(e);return n!=null&&!this.driftedPens.has(e)&&t-n.startTime>=H.minimumPressDuration.value}notePenDrift(e,t,n,r){let i=this.arena.getTouch(e);i!=null&&r-i.startTime<H.minimumPressDuration.value&&Math.hypot(t-i.startX,n-i.startY)>H.allowableMovement.value&&this.driftedPens.add(e)}touchForCancelledPointer(e){let t=null,n=1/0;for(let r of this.arena.touches){if(r.pointerType!==`touch`||r.phase===`ended`||r.phase===`cancelled`||r.target!==Gx(e))continue;let i=Math.hypot(r.x-e.clientX,r.y-e.clientY);i<n&&(t=r,n=i)}return t==null?this.touchIds.get(e.pointerId)??null:t.id}replayClick(e,t){if(!t)return;ge(this.doc);let n=e.target,r=this.doc.defaultView;y(n)&&n.isConnected&&r!=null&&le(()=>n.dispatchEvent(new r.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:1,clientX:e.x,clientY:e.y})))}onContextMenu=e=>{for(let t of this.arena.touches)if(this.arena.isClaimed(t.id)||this.arena.consumerOf(t.id)?.holdsContextMenu?.(t.id)===!0){e.preventDefault();return}};ownScroll(e){let t=++this.ownScrollCalls;this.ownedScrolls.set(e,t);let n=this.doc.defaultView;if(n==null)return;this.ownScrollFrames.get(e)?.();let r=0,i=n.requestAnimationFrame(()=>{r=n.requestAnimationFrame(()=>{this.ownScrollFrames.delete(e),this.ownedScrolls.get(e)===t&&this.ownedScrolls.delete(e)})});this.ownScrollFrames.set(e,()=>{n.cancelAnimationFrame(i),r!==0&&n.cancelAnimationFrame(r)})}isOwnScroll(e){return this.ownedScrolls.has(e)}onScroll=e=>{let t=oS(e,this.timing),n=e.target===this.doc?this.doc:e.target;if(!R(n)||this.ownedScrolls.has(n))return;let r=this.lastTouch;r!=null&&t-r.time<se.momentumMemory.value&&c(n,r.target)&&(this.lastScroll={scroller:n,time:t});let i=[];for(let e of this.arena.touches)e.takenByBrowser||e.phase===`ended`||e.phase===`cancelled`||e.pointerType!==`touch`||this.arena.isClaimed(e.id)||R(e.target)&&c(n,e.target)&&Math.hypot(e.x-e.startX,e.y-e.startY)>=se.slop.value&&i.push(e.id);i.length>0&&this.browserTook(i,t)};noteFingersDown(e){let t=[];for(let n of cS(e.touches))n.touchType!==`stylus`&&R(n.target)&&t.push(n.target);this.fingerTargets=t;for(let e of[...this.fingerListeners])e()}failUnclaimedLoneFingerPans(){for(let e of[...this.arena.involvedRecognizers])Rx(e)&&e.state===`possible`&&e.maximumNumberOfTouches===1&&e.trackedTouches.length>0&&e.trackedTouches.every(e=>e.pointerType===`touch`&&!this.arena.isClaimed(e.id))&&e.cancel()}isFingerClaimed(){return this.arena.touches.some(e=>e.pointerType===`touch`&&this.arena.isClaimed(e.id))}onVisibilityChange=()=>{this.doc.visibilityState===`hidden`&&(this.cancelEverything(this.arena.now()),this.releaseArmedPress())};onBlur=()=>{this.cancelEverything(this.arena.now()),this.releaseArmedPress()};sendsTouchEvents(){let e=this.doc.defaultView;return e!=null&&`ontouchstart`in e}readsFingersFromPointerEvents(){let e=this.doc.defaultView;return this.inputMode===`pointer-events`||e!=null&&!(`ontouchstart`in e)}refuseCancelledLift(e){ae(this.doc,{takesLateMouse:e.pointerType===`touch`}),e.pointerType===`touch`&&this.noteClaimedLift(e)}cancelEverything(e){for(let[e,t]of this.pointerKinds)t!==`mouse`&&this.cancelledPointers.set(e,t);let t=[...this.pointerIds.values()];for(let e of t)this.unlockSelection(e,!0);for(let e of[...this.touchIds.keys()]){this.cancelledFingers.add(e);let n=this.forgetFinger(e);n!=null&&t.push(n)}this.pointerIds.clear(),this.pointerKinds.clear(),this.driftedPens.clear(),this.retargeted.clear(),this.fingerPointers.clear(),this.pendingPointers.clear(),this.unpairedTouches.clear(),this.lastFed.clear(),this.pointerFed.clear(),this.liftStamps.clear(),t.push(...this.dropDrivenWheel()),t.length>0&&this.arena.cancelled(t,e)}};function uS(e){for(let t of e.values())if(t!==`allow`)return!0;return!1}function dS(e,t){return typeof e.getCoalescedEvents==`function`?e.getCoalescedEvents().slice(0,-1).map(e=>({x:e.clientX,y:e.clientY,time:oS(e,t)})):[]}function fS(e){let t=Oa.get(e);return t??(t=new lS(e),Oa.set(e,t)),t}var pS=D(`gestures/gesture-sync/state`,1,()=>({syncingDepth:0}));function mS(e){pS.syncingDepth+=1;try{return e()}finally{--pS.syncingDepth}}function hS(){return pS.syncingDepth>0}function gS(){let e=(0,Z.useRef)(!1);return G(()=>(e.current=!1,()=>{e.current=!0}),[]),e}function _S(e,t){let{arena:n}=$b(e);n==null?t():n.deferResolution(t)}function vS(e,t,n,r={}){let[i]=(0,Z.useState)(t),a=(0,Z.useRef)(n);G(()=>{a.current=n});let{isEnabled:o=!0,manageStyle:s=!0,perEventPointer:c=!1,actionGroup:l=!1}=r,u=gS();return(0,Z.useEffect)(()=>i.addListener(e=>{!u.current&&!hS()&&a.current?.(e)}),[i,u]),G(()=>{mS(()=>{_S(i,()=>{i.setEnabled(o)})})},[i,o]),Ja(e,e=>{if(!o)return()=>{};let t=fS(e.ownerDocument).attach(e,i,{manageStyle:s,perEventPointer:c,actionGroup:l});return()=>{mS(()=>_S(i,t))}},`${s}:${c}:${o}:${l}`),i}var yS=se,bS=[];function xS(e,t,n,r){let i=Nt(e,t,r.length===0?n:[...n,...r]);return i>=0&&i<n.length?n[i].element:null}function SS(e,{itemSelector:t,isItem:n}){if(e==null)return bS;let r=e=>e.matches(t)&&n?.(e)!==!1,i=[];for(let n of e.querySelectorAll(`${t}, ${ct}`)){let a=n.parentElement?.closest(t);if(r(n)?n.matches(`:disabled, [aria-disabled="true"]`):a==null||!e.contains(a)||!r(a)){let{left:e,top:t,right:r,bottom:a}=n.getBoundingClientRect();i.push({element:n,left:e,top:t,right:r,bottom:a})}}return i}var CS={current:null},wS=[`touch`,`pen`,`mouse`],TS=class extends Qb{acceptsTouch(e){return Wb(this.state)?(this.setState(`cancelled`),!1):super.acceptsTouch(e)}};function ES(e,t){let n=(0,Z.useRef)(t);G(()=>{n.current=t});let r=(0,Z.useRef)(`touch`),i=(0,Z.useRef)(null),a=(0,Z.useRef)(bS),[o]=(0,Z.useState)(()=>Rb(()=>({roots:()=>[e.current],itemSelector:n.current.itemSelector,isItem:n.current.isItem,highlightExpansion:r.current===`touch`?n.current.highlightExpansion:0,...DS(r.current,n.current.resolveTarget,a.current),paintsHighlight:n.current.paintsHighlight,onActivate:n.current.onActivate,swallowsNativeClick:!0}))),s=t.isEnabled??!0;return(0,Z.useEffect)(()=>()=>{let e=o.isTracking;o.cancel(),o.dispose(),e&&n.current.onPressCancel?.()},[o,s]),vS(s?e:CS,()=>new TS({name:`ActionGroupTracking`,minimumPressDuration:t.highlightOnsetMs,allowableMovement:1/0,allowedPointerTypes:t.pointerTypes??wS,delaysTouchesBegan:!0,selectionLock:v,shouldReceiveTouch:(e,t)=>{if(e.numberOfTouches===0){r.current=t.pointerType;let e=t.target;i.current=typeof e?.nodeType==`number`?e:null}return OS(e,t,n.current)}}),t=>{switch(t.state){case`began`:{let{x:s,y:c}=t.location();a.current=r.current===`touch`&&n.current.resolveTarget!=null?SS(e.current,n.current):bS,o.begin(s,c,{landed:i.current}),n.current.onPressBegin?.(s,c,o.highlighted);break}case`changed`:{let{x:e,y:r}=t.location();o.move(e,r),n.current.onPressMove?.(e,r,o.highlighted);break}case`ended`:{n.current.onPressEnd?.(o.highlighted);let t=e.current?.ownerDocument,i=t?.activeElement??null,s=o.beganOn,c=r.current===`touch`?!ne(t?.defaultView):s!=null&&i===s,l=o.highlighted;c&&l!=null&&l.isConnected&&!l.matches(`:disabled, [aria-disabled="true"]`)&&i!==l&&l.focus({preventScroll:!0,focusVisible:!1}),o.end(),a.current=bS;break}case`cancelled`:a.current=bS,o.cancel(),n.current.onPressCancel?.()}},{isEnabled:s,manageStyle:t.manageStyle??!0,actionGroup:!0})}function DS(e,t,n){return e!==`touch`||t==null?{}:{resolveTarget:(e,r,i)=>t(e,r,i,n)}}function OS(e,t,n){if(n.shouldTrack?.(t)===!1)return!1;if(e.numberOfTouches===0){let r=t.pointerType!==`mouse`&&t.scroll?.isInsideScroller===!0;e.minimumPressDuration=r?yS.contentTouchDelay.value:n.highlightOnsetMs,e.allowableMovement=r?yS.slop.value:1/0}return!0}var kS=`button, a[href]`;function AS(e){return e.right>e.left&&e.bottom>e.top}function jS(e){return Ui(e)&&!e.matches(`:disabled, [aria-disabled="true"]`)}function MS(e){return Fb([e],kS,jS).filter(AS)}var NS={growth:(e,t,n)=>pt(e,MS(n).map(t)),checkAtPress:!1};function PS(e,t){let{target:n}=t;if(e==null||n?.nodeType!==1)return!1;let r=e.getBoundingClientRect();if(r.width<=0||r.height<=0)return!1;if(n!==e){let t=n.closest(kS);return t!=null&&e.contains(t)&&jS(t)}return t.pointerType===`touch`&&xS(t.startX,t.startY,MS(e),SS(e,{itemSelector:kS,isItem:jS}))!=null}var FS=[`touch`,`pen`];function IS(e,t){return ES(e,{itemSelector:kS,isItem:e=>jS(e)&&AS(e.getBoundingClientRect()),pointerTypes:FS,highlightOnsetMs:0,highlightExpansion:0,resolveTarget:xS,shouldTrack:t=>PS(e.current,t),isEnabled:t}),{hitAreaRef:dt(t,NS)}}var LS=Bt(`ToggleButtonGroupContext`,1,null);LS.displayName=`ToggleButtonGroupContext`;function RS(){return(0,Z.use)(LS)}var zS={group:{k1xSpc:`x3nfvp2`,kwnvtZ:`x1a02dak`,kGNEyG:`x6s0dn4`,kOIVth:`xzye2dw`,ks0D6T:`x193iq5w`,$$css:!0},vertical:{kXwgrk:`xdt5ytf`,kwnvtZ:`xozqiw3`,kGNEyG:`x1qjc9v5`,$$css:!0},tracking:{kVAEAm:`x1n2onr6`,$$css:!0}};function BS(e){let{children:t,label:n,orientation:r=`horizontal`,size:i,isDisabled:a=!1,xstyle:o,className:s,style:c,"data-testid":l,type:u,value:d,onChange:f,...p}=e,m=e.type===`multiple`,h=(0,Z.useMemo)(()=>{if(m)return new Set(e.value);let t=e.value;return t==null?new Set:new Set([t])},[m,e.value]),g=(0,Z.useCallback)(t=>{if(m){let n=e.value,r=e.onChange;n.includes(t)?r(n.filter(e=>e!==t)):r([...n,t])}else{let n=e.value,r=e.onChange;r(n===t?null:t)}},[m,e.value,e.onChange]),{isTouch:_}=we(),v=!a&&_,y=(0,Z.useMemo)(()=>({selectedValues:h,toggle:g,size:i,isDisabled:a,tracksPress:v}),[h,g,i,a,v]),b=(0,Z.useRef)(null),{hitAreaRef:x}=IS(b,v),S=e.ref,C=Vt(S,b,x);return(0,Q.jsx)(LS,{value:y,children:(0,Q.jsx)(`div`,{...p,ref:C,role:`group`,"aria-label":n,"data-testid":l,...hn(ye(`toggle-button-group`),J(zS.group,v&&zS.tracking,v&&ut.layerBelowChildren,r===`vertical`&&zS.vertical,o),s,c),children:(0,Q.jsx)(ta,{value:null,children:t})})})}BS.displayName=`ToggleButtonGroup`;var VS={background:{kAXs8y:`x1kzknox`,kWkggS:`xi89dp7 x1jzqe4`,kMwMTN:`x1k5gbb1`,$$css:!0}};function HS({ref:e,label:t,isPressed:n,onPressedChange:r,pressedChangeAction:i,size:a,elevation:o=`none`,isDisabled:s=!1,isLoading:c=!1,icon:l,isIconOnly:d=!1,pressedIcon:f,children:p,tooltip:m,value:h,xstyle:g,className:_,style:v,onClick:y,...b}){let x=RS(),S=x&&h!=null?x.selectedValues.has(h):n??!1,C=a??x?.size??`md`,w=(x?.isDisabled??!1)||s,[T,E]=(0,Z.useOptimistic)(S),D=T,O=!D,k=D&&f?f:l,A=e=>{if(w)return;let t=e.defaultPrevented;y?.(e),x&&h!=null?(x.toggle(h),e.preventDefault()):(t||!e.defaultPrevented)&&r?.(O,e)},j=i&&!(x&&h!=null)?async()=>{E(O),await i(O)}:void 0,ee=p==null?d?void 0:(0,Q.jsxs)(`span`,{className:`x3nfvp2 xdt5ytf x6s0dn4 xl56j7k x193iq5w`,children:[(0,Q.jsx)(`span`,{...{0:{className:`x193iq5w x7giv3 xbs6e5j xlyipyv`},1:{className:`x193iq5w x7giv3 xbs6e5j xlyipyv x2mo6ok`}}[!!D|0],children:t}),(0,Q.jsx)(`span`,{className:`x193iq5w x1lliihq x2mo6ok xqtp20y xb3r6kr xlshs6z x47corl`,"aria-hidden":`true`,children:t})]}):(0,Q.jsxs)(`span`,{className:`x3nfvp2 xdt5ytf x6s0dn4 xl56j7k x193iq5w`,children:[(0,Q.jsx)(`span`,{...{0:{className:`x193iq5w x7giv3 xbs6e5j xlyipyv`},1:{className:`x193iq5w x7giv3 xbs6e5j xlyipyv x2mo6ok`}}[!!D|0],children:p}),(0,Q.jsx)(`span`,{className:`x193iq5w x1lliihq x2mo6ok xqtp20y xb3r6kr xlshs6z x47corl`,"aria-hidden":`true`,children:p})]}),M=(0,Z.use)(ta),N=x==null?M:x.tracksPress===!0&&h!=null?FS:null;return(0,Q.jsx)(ta,{value:N,children:(0,Q.jsx)(ea,{value:x!=null&&N!=null,children:(0,Q.jsx)(na,{ref:e,label:t,variant:`ghost`,size:C,elevation:o,isDisabled:w,isLoading:c,isInterruptible:!0,isIconOnly:d,icon:k,tooltip:m,...hn(ye(`toggle-button`,{isPressed:D?`true`:`false`,elevation:o,grouped:x==null?null:`grouped`}),_),xstyle:[D?VS.background:void 0,g],style:v,onClick:A,clickAction:j,...b,"aria-pressed":D,...u({isPressed:D?`true`:`false`,elevation:o}),children:ee})})})}HS.displayName=`ToggleButton`,ht({"@astryx.field.errorFallback":`Invalid value`,"@astryx.spinner.loading":`Loading`,"@astryx.textArea.charactersOverLimit":`{count, number} {count, plural, one {character} other {characters}} over the limit`,"@astryx.textArea.charactersRemaining":`{count, number} {count, plural, one {character} other {characters}} remaining`,"@astryx.textArea.counter":`{count, number}/{limit, number}`});var US=.8,WS={wrapper:{kY2c9j:`x1vjfegm`,k1xSpc:`x1lliihq`,k8WAf4:`xt970qd`,kg3NbH:`xnjsko4`,"--_textarea-inline-padding":`x1kdpo6e`,$$css:!0},textarea:{k1xSpc:`x1lliihq`,kzqmXN:`xh8yej3`,kB7OPa:`x9f619`,k7Eaqz:`xeuugli`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,k8WAf4:`xu0wf1k`,kg3NbH:`x1w6f3ag`,kMv6JI:`x9ynric`,kGuDYH:`xjm74w1 xf9zqsd`,kLWn49:`xw6l6zx`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w`,kI3sdo:`x1a2a7pz`,k8Qsv1:`xeyghm5`,kHenm0:`x288g5`,$$css:!0},textareaDisabled:{kkrTdU:`xt0e3qv`,$$css:!0},textareaWithStartIcon:{kZCmMZ:`x1b6te9z`,$$css:!0},textareaWithStatus:{kwRFfy:`xp2dy4z`,$$css:!0},textareaWithBusyStatus:{kwRFfy:`x1g2apga`,$$css:!0},textareaWithCounter:{kGO01o:`xekm6fs`,$$css:!0}},GS={sm:{$$css:!0},md:{$$css:!0},lg:{k8WAf4:`xce4md1`,$$css:!0}},KS=`an error status has no message, so only colour and an icon show the error. Give status.message the text that says what is wrong.`;function qS({label:e,isLabelHidden:t=!1,description:n,isOptional:r=!1,isRequired:i=!1,onChange:a,changeAction:o,isLoading:s=!1,value:c,placeholder:l,rows:u=3,isDisabled:d=!1,isReadOnly:f=!1,disabledMessage:p,status:m,statusVariant:h=`attached`,labelTooltip:g,startIcon:_,hasSpellCheck:v=!0,enterKeyHint:y,inputMode:b,autoCapitalize:x,hasAutoCorrect:S,onPaste:C,maxLength:w,htmlMaxLength:T,hasAutoFocus:E=!1,size:D,htmlName:O,onFocus:k,onBlur:A,width:j,containerXstyle:ee,containerClassName:M,containerStyle:N,controlXstyle:P,controlClassName:F,controlStyle:I,ref:L,id:R,"aria-describedby":z,"aria-labelledby":te,...B}){let{rest:ne,container:re}=ze(`TextArea`,B,{containerXstyle:ee,containerClassName:M,containerStyle:N}),ie=aa(D,`md`),V=xt(_),ae=at(),H=li({isRequired:i,isOptional:r}),U=fn(),W=(0,Z.useId)(),oe=R??W,G=(0,Z.useId)(),K=(0,Z.useId)(),se=(0,Z.useId)(),q=(0,Z.useId)(),ce=(0,Z.useRef)(null);ua(ce);let le=(0,Z.useRef)(null),ue=(0,Z.useRef)(null),[,de]=(0,Z.useTransition)(),[fe,pe]=(0,Z.useOptimistic)(c),me=s||fe!==c;pi(me,ae(`@astryx.spinner.loading`),le);let he=d&&!!p,ge=Qi(ne,d),_e=Ki({placement:`above`,focusTrigger:`always`,isEnabled:he}),{statusIcon:ve,describedBy:Y}=Be({status:m,statusVariant:h}),be=m?.type===`error`&&!m.message;ro(`TextArea`,KS,be);let xe=[n?K:null,h!==`tooltip`&&m?.message||be?se:null,Y,w==null?null:q,he?_e.describedBy:null].filter(Boolean).join(` `)||void 0,Se=(0,Z.useCallback)(e=>{if(w==null)return;let t=e>w?`over`:e>=w*US?`near`:`under`;t!==ue.current&&(ue.current=t,t===`over`?U(ae(`@astryx.textArea.charactersOverLimit`,{count:e-w}),`assertive`):t===`near`&&U(ae(`@astryx.textArea.charactersRemaining`,{count:w-e})))},[U,ae,w]),Ce=e=>{if(d||f)return;let t=e.target.value;w!=null&&Se(Mp(t)),a?.(t,e),o&&!e.defaultPrevented&&de(async()=>{pe(t),await o(t,e)})},we=(0,Z.useMemo)(()=>w==null?0:Mp(fe),[w,fe]),{onClick:Te,onMouseUp:Ee}=vi({containerRef:le,inputRef:ce,disabled:d||me});return(0,Q.jsxs)(rt,{...re,label:e,isLabelHidden:t,description:n,inputID:oe,labelID:te==null?void 0:G,descriptionID:n?K:void 0,isOptional:r,isRequired:i,isDisabled:d,status:m?{type:m.type,message:m.message,messageID:m.message?se:void 0}:void 0,statusVariant:h,labelTooltip:g,width:j,children:[(0,Q.jsxs)(`div`,{ref:e=>{le.current=e,_e.ref(e)},onClick:Te,onMouseUp:Ee,...hn(ye(`text-area`,{size:ie,status:m?.type??null,disabled:d?`disabled`:null,readonly:f?`readonly`:null}),J(Le.base,Le.textField,WS.wrapper,d&&Le.disabled,d&&Xe.ring,m&&Fe[m.type],m&&!d&&it[m.type],m&&tt[m.type],P),F,I),children:[V&&(0,Q.jsx)(`span`,{className:`x10l6tqk xctzyg x1kiyvbf x47corl x78zum5`,children:gt(_,{size:`sm`,color:`secondary`})}),(0,Q.jsx)(`textarea`,{...ge,ref:Vt(L,ce),id:oe,name:d?void 0:O,value:fe,onChange:Ce,onPaste:d?void 0:C,onFocus:k,onBlur:A,placeholder:l,rows:u,maxLength:T,...et({enterKeyHint:y,inputMode:b,autoCapitalize:x,hasAutoCorrect:S}),"aria-disabled":d?`true`:void 0,readOnly:f||d||void 0,spellCheck:v,autoFocus:E,"data-autofocus":E||void 0,"aria-labelledby":te==null?void 0:He(G,te),"aria-describedby":[z,xe].filter(Boolean).join(` `)||void 0,"aria-required":H?`true`:void 0,"aria-invalid":m?.type===`error`||w!=null&&we>w?`true`:void 0,"aria-busy":me||void 0,...hn(ye(`text-area-control`),J(WS.textarea,GS[ie],d&&WS.textareaDisabled,V&&WS.textareaWithStartIcon,(me||ve!=null)&&WS.textareaWithStatus,me&&ve!=null&&WS.textareaWithBusyStatus,w!=null&&WS.textareaWithCounter))}),(me||ve)&&(0,Q.jsxs)(`span`,{className:`x10l6tqk xctzyg x13oyzgk x47corl x78zum5 x6s0dn4 x1txdalj`,children:[me&&(0,Q.jsx)(wt,{size:`sm`,"aria-hidden":`true`}),ve]}),w!=null&&(0,Q.jsxs)(`div`,{id:q,...hn(ye(`text-area-counter`),{0:{className:`x10l6tqk x112dmjn x13oyzgk x47corl x78zum5 x6s0dn4 xzye2dw x9ynric x141an7d x1ltkj2j xv1l7n4`},1:{className:`x10l6tqk x112dmjn x13oyzgk x47corl x78zum5 x6s0dn4 xzye2dw x9ynric x141an7d x1ltkj2j x1wj83wy`}}[we>w|0]),children:[we>w&&(0,Q.jsx)(mt,{icon:`warning`,size:`sm`}),ae(`@astryx.textArea.counter`,{count:we,limit:w})]})]}),be&&(0,Q.jsx)(St,{id:se,children:ae(`@astryx.field.errorFallback`)}),he&&_e.renderTooltip(p)]})}qS.displayName=`TextArea`;var JS=`(max-width: 47.99rem)`;function YS(){let[e,t]=(0,Z.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(JS).matches);return(0,Z.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(JS),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var XS=`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`;function ZS({selectedId:e,onSelect:t}){let n=Zr(),r=(0,Z.useSyncExternalStore)(mo,lo),i=r===`unreachable`||r===`retrying`,[a,o]=(0,Z.useState)(!1),s=(0,Z.useRef)(null),c=()=>{o(!1),s.current?.focus()};return(0,Q.jsxs)(`section`,{"aria-labelledby":`workspaces-heading`,className:`flex shrink-0 flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`h2`,{id:`workspaces-heading`,className:`min-w-0 flex-1 text-xs font-medium uppercase text-muted-foreground`,children:`Workspaces`}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Add`,icon:(0,Q.jsx)(ef,{}),"aria-label":`Add workspace`,tooltip:`Add a workspace`,"aria-haspopup":`dialog`,"aria-expanded":a,onClick:e=>{s.current=e.currentTarget,o(!0)}})]}),n.isPending&&!i&&(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading workspaces...`}),(n.isError||n.isPending&&i)&&(0,Q.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-2 text-sm text-destructive`,children:[(0,Q.jsxs)(`p`,{children:[`Failed to load workspaces:`,` `,n.error?.message??(go()||`The Toodo server does not answer.`)]}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Retry now`,onClick:()=>void n.refetch()})]}),n.data?.length===0&&!a&&(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No workspaces yet.`}),n.data&&n.data.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.data.map(n=>(0,Q.jsx)(QS,{workspace:n,selected:n.id===e,onSelect:t},n.id))}),a&&(0,Q.jsx)(eC,{onCreated:e=>{c(),t(e.id)},onClose:c})]})}function QS({workspace:e,selected:t,onSelect:n}){let r=ai(),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`div`,{className:yy(`group flex items-center rounded-lg hover:bg-sidebar-accent`,t&&`bg-sidebar-accent`),children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:`flex min-w-0 flex-1 flex-col px-2.5 py-1.5 text-left`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),e.repository&&(0,Q.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.repository,children:e.repository})]}),!i&&(0,Q.jsx)(ia,{size:`sm`,variant:`ghost`,label:`Remove ${e.name}`,tooltip:`Move the workspace and its tasks to the archive`,icon:(0,Q.jsx)(Tf,{}),className:`mr-1 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,onClick:()=>{r.reset(),a(!0)}})]}),i&&(0,Q.jsxs)(`div`,{role:`group`,"aria-label":`Remove ${e.name}`,className:`flex flex-col gap-1.5 rounded-lg border p-2`,onKeyDown:e=>{e.key===`Escape`&&!r.isPending&&(e.preventDefault(),a(!1))},children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Remove `,e.name,` and its tasks from Toodo? They move to Settings > Archive, where they can be restored.`]}),r.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`destructive`,label:r.isPending?`Removing...`:`Remove`,"aria-label":`Confirm remove ${e.name}`,isDisabled:r.isPending,onClick:()=>r.mutate(e.id)}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Back`,autoFocus:!0,onClick:()=>a(!1)})]})]})]})}function $S(e,t=!1){return n=>{n.key===`Escape`&&!t&&!n.defaultPrevented&&(n.preventDefault(),e())}}function eC({onCreated:e,onClose:t}){let n=Rr(),r=YS(),[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),u=n.isPending;function d(){u||t()}function f(t){t.preventDefault();let r={name:i.trim(),description:o.trim()||null,repository:c.trim()||null};n.mutate(r,{onSuccess:e})}return(0,Q.jsxs)(Ug,{isOpen:!0,onOpenChange:e=>!e&&d(),purpose:`form`,variant:r?`fullscreen`:`standard`,width:576,maxHeight:`min(40rem, calc(100dvh - 4rem))`,children:[(0,Q.jsx)(Zg,{title:`New workspace`,onOpenChange:u?void 0:e=>!e&&d()}),(0,Q.jsxs)(`form`,{onSubmit:f,onKeyDown:$S(t,u),className:`flex min-h-0 flex-1 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto overscroll-contain py-4`,children:[(0,Q.jsx)(Ke,{label:`Name`,value:i,onChange:a,hasAutoFocus:!0}),(0,Q.jsx)(qS,{label:`Description`,description:`Optional, Markdown.`,rows:4,value:o,onChange:s}),(0,Q.jsx)(Ke,{label:`Repository`,description:`Optional, e.g. owner/repo or a URL. Toodo only shows it.`,value:c,onChange:l}),n.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs break-words text-destructive`,children:n.error.message})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-t pt-3`,children:[(0,Q.jsx)(X,{variant:`ghost`,label:`Cancel`,isDisabled:u,onClick:d}),(0,Q.jsx)(X,{type:`submit`,variant:`primary`,className:`ml-auto`,changesData:!0,label:u?`Adding...`:`Add workspace`,isDisabled:u||i.trim()===``})]})]})]})}var tC=[`planned`,`ready`,`waiting`,`paused`,`in_progress`,`in_review`,`done`,`not_adopted`];function nC(e,t){return Wy(e)?`not_adopted`:e.wait===null?qy(e)?Yy(e,t)?`ready`:`paused`:e.status===`planned`&&Gy(e,t)?`ready`:e.status:`waiting`}var rC={query:``,statuses:[],type:null,autopilot:!1},iC={...rC,statuses:tC.filter(e=>e!==`done`&&e!==`not_adopted`)};function aC(e){return e.query.trim()!==``||e.statuses.length>0||e.type!==null||e.autopilot}function oC(e,t){return tC.filter(n=>n===t!==e.includes(n))}function sC(e){let t=/^#?(\d+)$/.exec(e.trim());return t===null?null:Number(t[1])}function cC(e,t,n){if(t.statuses.length>0&&!t.statuses.includes(nC(e,n))||t.type!==null&&e.taskType!==t.type||t.autopilot&&!e.autopilot)return!1;let r=`${e.title}\n${e.description}`.toLocaleLowerCase();return t.query.toLocaleLowerCase().split(/\s+/).filter(e=>e!==``).every(e=>r.includes(e))}var lC=(0,Z.lazy)(()=>bt(()=>import(`./markdown-Bh9eEY5s.js`),__vite__mapDeps([0,1,2,3,4]))),uC=[`feat`,`fix`,`modify`,`refactor`,`docs`,`test`,`chore`,`rnd`];function dC(e,t){return e.status===`done`&&e.resolution===`completed`?`Completed`:e.wait===null?Fr[nC(e,t)]:`${Fr.waiting} ~${_r(e.wait.until)}`}var fC={planned:`neutral`,ready:`attention`,waiting:`neutral`,paused:`neutral`,in_progress:`progress`,in_review:`review`,done:`success`,not_adopted:`neutral`},pC=yy(jn.neutral,`ring-1 ring-inset ring-muted-foreground/40`);function mC(e){return e===`not_adopted`?pC:jn[fC[e]]}var hC=yy(mC(`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 gC(e,t){return mC(nC(e,t))}function _C(e,t,{byId:n,workspaceName:r}){let i=n.get(e);return i===void 0||i.workspaceId===t?`#${e}`:`${r(i.workspaceId)} #${e}`}function vC({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 yC({task:e}){let t=jy(e,Date.now()/1e3);return(0,Q.jsxs)(`span`,{"data-due-state":t??void 0,className:yy((t===`late`||t===`overdue`)&&yy(`font-medium`,In.danger)),children:[t===null||t===`upcoming`?`Due`:ky[t],` `,e.dueDate]})}function bC({task:e,onEdit:t}){let n=Ny(e),r=Py(n);return r===null?null:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Edit plan of #${e.id}: ${r.toLowerCase()}`,title:`Reviews compare estimates and due dates with what happened; add them`,"data-missing-plan":n.join(` `),className:`cursor-pointer rounded-sm underline decoration-dotted underline-offset-2 outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>t(n[0]),children:r})}function xC(){let e=(0,Z.useSyncExternalStore)(mo,lo);return e===`unreachable`||e===`retrying`}function SC({task:e,className:t}){return e.labels.length===0?null:(0,Q.jsx)(`ul`,{"aria-label":`Labels of #${e.id}`,className:yy(`flex flex-wrap gap-1`,t),children:e.labels.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(Oy,{label:e})},e))})}function CC({taskId:e,prerequisite:t,pending:n,onConfirm:r,onCancel:i}){return(0,Q.jsxs)(`div`,{role:`group`,"aria-label":`Confirm prerequisite of #${e}`,className:yy(`flex flex-wrap items-center gap-2 rounded-md px-2 py-1.5 text-xs`,Yn.attention),onKeyDown:$S(i,n),children:[(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Adding `,t,` as a prerequisite pauses #`,e,` until `,t,` is done.`]}),(0,Q.jsx)(X,{size:`sm`,variant:`destructive`,icon:(0,Q.jsx)(Kd,{}),label:n?`Pausing...`:`Pause and add`,isDisabled:n,onClick:r}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Back`,autoFocus:!0,isDisabled:n,onClick:i})]})}function wC({type:e,className:t}){return(0,Q.jsx)(Oy,{"data-task-type":e,label:e,className:yy(`shrink-0 font-mono`,t)})}function TC(e){let t=e.cloneNode(!0);for(let e of t.querySelectorAll(`[aria-hidden="true"]`))e.remove();for(let e of t.querySelectorAll(`img[alt], [aria-label]`)){let n=e.getAttribute(e.tagName===`IMG`?`alt`:`aria-label`)??``;e.replaceWith(t.ownerDocument.createTextNode(` ${n} `))}for(let e of t.querySelectorAll(`svg`)){let n=e.querySelector(`title`)?.textContent??``;e.replaceWith(t.ownerDocument.createTextNode(` ${n} `))}return(t.textContent??``).replace(/\s+/g,` `).trim()}function EC(e){if(e==null)return;let t=e.getAttribute(`aria-labelledby`);if(t!=null&&t.trim()!==``){let n=t.split(/\s+/).map(t=>e.ownerDocument.getElementById(t)).filter(e=>e!=null).map(TC).join(` `).trim();if(n!==``)return n}let n=e.getAttribute(`aria-label`)?.trim();if(n)return n;let r=(`labels`in e?Array.from(e.labels??[]):[]).map(TC).join(` `).trim();if(r!==``)return r;if(e instanceof HTMLInputElement&&[`button`,`submit`,`reset`].includes(e.getAttribute(`type`)??``)){let t=e.value.trim();if(t!==``)return t}let i=TC(e);return i===``?e.getAttribute(`title`)?.trim()||void 0:i}var DC=Bt(`DropdownMenuSurfaceContext`,1,null);DC.displayName=`DropdownMenuSurfaceContext`;var OC=Bt(`DropdownMenuRootOpenContext`,1,null);OC.displayName=`DropdownMenuRootOpenContext`;function kC(){return(0,Z.use)(OC)!==!1}var AC=Bt(`DropdownMenuContext`,1,null);AC.displayName=`DropdownMenuContext`;function jC(){return(0,Z.use)(AC)}var MC=dn(`DropdownMenuRadioGroupContext`,1,null);MC.displayName=`DropdownMenuRadioGroupContext`;function NC(e,t){if(t||e.pointerType!==`mouse`)return;let n=e.currentTarget;n!==n.ownerDocument.activeElement&&Fa(n,{preventScroll:!0})}var PC=new Set([`menuitem`,`menuitemradio`,`menuitemcheckbox`]),FC=[...PC].map(e=>`[role="${e}"]:not([aria-disabled="true"])`).join(`,`),IC=[...PC].map(e=>`[role="${e}"]`).join(`,`),LC=`[role="menu"]`;function RC(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function zC(e,t){e.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey}))}function BC(e){e.preventDefault()}var VC={root:{krdFHd:`xprhdup x13kg4je`,kfmiAY:`xexjgc1 x7vg3tk`,kVL7Gh:`xx92llm xb6b8hi`,kT0f0o:`x4b9gmp x1v34wvp`,$$css:!0}},HC={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kLWn49:`x1kq96og`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1p2z2pi x17hk9mh`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kInvED:`x1c097ug`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0},destructive:{kMwMTN:`x1wj83wy`,"--_item-label-color":`x1pa1ci1`,"--_item-description-color":`x1dj2fx0`,$$css:!0}},UC={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}};function WC({icon:e,label:t,description:n,onClick:r,href:i,target:a,rel:o,isDisabled:s=!1,endContent:c,hasCloseOnSelect:l=!0,variant:u=`default`,xstyle:d,className:f,style:p,ref:m,onPointerMove:h,onAuxClick:g,..._}){let v=jC(),y=v?.menuSize??`md`,b=Tt(),x=(0,Z.useCallback)(e=>{s?e.preventDefault():(i!=null&&RC(e)||r?.(e),l&&v?.closeMenu())},[s,i,r,l,v]),S=(0,Z.useCallback)(e=>{s?e.preventDefault():i!=null&&e.button===1&&l&&v?.closeMenu()},[s,i,l,v]),C=(0,Z.useCallback)(e=>NC(e,s),[s]),w=u===`destructive`,T=At();return(0,Q.jsx)(xi,{..._,onMouseDown:Et(_.onMouseDown,s?BC:void 0),ref:m,as:i==null?void 0:T,role:`menuitem`,tabIndex:-1,onPointerMove:Et(C,h),...b,startContent:e?gt(e,{size:`sm`,color:w?`error`:`secondary`}):void 0,label:t,description:n,endContent:c,onClick:x,onAuxClick:Et(S,g),href:i,target:a,rel:o,draggable:i==null&&void 0,isDisabled:s,xstyle:[oe.focusVisible,HC.root,VC.root,yi,UC[y],w&&HC.destructive,s&&HC.disabled,d],...hn(ye(`dropdown-menu-item`,{size:y,variant:w?`destructive`:null}),{className:f,style:p})})}WC.displayName=`DropdownMenuItem`;var GC={divider:{kqGvvJ:`xsq74q5`,$$css:!0}},KC=ye(`dropdown-menu-divider`).className;function qC({xstyle:e,className:t,style:n,ref:r,...i}){return(0,Q.jsx)(_i,{...i,ref:r,xstyle:[GC.divider,e],className:t?`${KC} ${t}`:KC,style:n})}qC.displayName=`DropdownMenuDivider`;function JC(e){return e==null?[]:Cn(e).filter(t=>t.tabIndex>=0&&!YC(t,e))}function YC(e,t){if(typeof window>`u`||!window.getComputedStyle)return!1;for(let n=e.parentElement;n!=null&&n!==t.parentElement;n=n.parentElement)if(window.getComputedStyle(n).display===`none`)return!0;return!1}function XC(e){return e.focus(),e.ownerDocument.activeElement===e}function ZC(e,t,n,r,i=!1){if(t==null)return;e.preventDefault(),e.stopPropagation();let a=document.activeElement,o=Sa([...JC(n),t,...JC(r)],a);if(o.length===1){i&&t.focus();return}let s=o.indexOf(t),c=t.contains(a)?s:o.findIndex(e=>e===a||e.contains(a));c<0&&(c=s);let l=e.shiftKey?-1:1,u=o[(c+l+o.length)%o.length];XC(u)||t.focus()}var QC=new Set([`text`,`search`,`url`,`tel`,`email`,`password`,`number`]);function $C(e,t){let n=e.parentElement?.closest(`[hidden],[inert]`);return n!=null&&n!==t&&t.contains(n)}function ew(e){if(e.isContentEditable)return e;let t=e.closest(`[contenteditable]`);return t&&t.getAttribute(`contenteditable`)!==`false`?t:null}function tw(e,t){if(!(e instanceof HTMLElement))return!1;let n=ew(e);if(n){let e=typeof window<`u`?window.getSelection():null;return e&&e.rangeCount>0&&!e.isCollapsed?!0:(n.textContent??``).length>0}let r=e.tagName===`TEXTAREA`,i=e.tagName===`INPUT`&&QC.has(e.type);if(!r&&!i)return!1;let{selectionStart:a,selectionEnd:o,value:s}=e;return a!==o||a==null?!0:t===`ArrowLeft`||t===`ArrowUp`||t===`Home`?a>0:t===`ArrowRight`||t===`ArrowDown`||t===`End`?a<s.length:!1}function nw(e={}){return iw(e)}function rw(e){return e.getAttribute(`aria-disabled`)===`true`||e.disabled===!0||e.hasAttribute(`disabled`)}function iw(e={}){let{itemSelector:t=`[role="menuitem"]`,boundarySelector:n,wrap:r=!0,onEscape:i,orientation:a=`vertical`,hasHomeEnd:o=!0,hasPaging:s=!1,hasRovingTabIndex:c=!1,tabStopOrder:l,hasCaretGuard:u=!1,focusFollowsLastInput:d=!1,reachesDisabledItems:f=!1}=e,p=(0,Z.useRef)(null),m=rw,h=(0,Z.useCallback)(()=>{let e=p.current;if(!e)return[];let r=Array.from(e.querySelectorAll(t)).filter(t=>!$C(t,e));return n?r.filter(t=>t.closest(n)===e):r},[t,n]),g=(0,Z.useCallback)(e=>{let t=p.current;if(!t||!n)return!0;let r=e.target;return!r||r.closest(n)===t},[n]),_=(0,Z.useCallback)((e,t,n,r,i=m)=>{let a=e.length;if(a===0)return-1;let o=t;for(let t=0;t<a;t++){if(o<0||o>=a){if(!r)return-1;o=(o+a)%a}let t=e[o];if(t&&!i(t))return o;o+=n}return-1},[m]),v=(0,Z.useCallback)(e=>!f&&m(e),[f,m]),y=(0,Z.useCallback)(()=>{let e=h(),t=document.activeElement;return e.findIndex(e=>e===t||e.contains(t))},[h]),b=(0,Z.useCallback)((e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&e.setAttribute(`tabindex`,String(t))},[]),x=(0,Z.useCallback)(()=>{let e=p.current;if(e!=null&&l!=null){let[t,...n]=l(e);t!=null&&b(t,0);for(let e of n)b(e,-1);return}let t=h(),n=t.filter(e=>!m(e));if(n.length===0)return;let r=n.find(e=>e.getAttribute(`tabindex`)===`0`)??n[0];for(let e of t)b(e,e===r?0:-1)},[h,m,b,l]);G(()=>{c&&x()});let S=(0,Z.useCallback)((e,t)=>{let n=e[t];if(n){if(c){let t=p.current,r=t!=null&&l!=null?[...e,...l(t)]:e;for(let e of r)b(e,e===n?0:-1)}d?Fa(n):n.focus()}},[c,b,d,l]),C=(0,Z.useCallback)(e=>{let t=h();if(t.length===0)return;let n=Math.max(0,Math.min(e,t.length-1));S(t,n)},[h,S]),w=(0,Z.useCallback)(()=>{let e=h(),t=_(e,0,1,!1);return t!==-1&&(S(e,t),!0)},[h,_,S]),T=(0,Z.useCallback)(()=>{let e=h(),t=_(e,e.length-1,-1,!1);return t!==-1&&(S(e,t),!0)},[h,_,S]),E=(0,Z.useCallback)(e=>{let t=p.current,n=h();if(!t||n.length===0)return;let r=y(),i=n.map((e,t)=>v(e)?-1:t).filter(e=>e!==-1);if(i.length===0)return;let a=()=>{let r=t.getBoundingClientRect(),a=i.filter(e=>{let t=n[e].getBoundingClientRect();return t.top>=r.top-1&&t.bottom<=r.bottom+1});return a.length===0?-1:e===1?a[a.length-1]:a[0]},o=t=>r===-1||(e===1?t>r:t<r);if(r===-1&&e===-1){w();return}let s=a();if((s===-1||!o(s))&&(t.scrollTop+=e*t.clientHeight,s=a(),s===-1||!o(s))){let a=Math.max(1,i.filter(e=>{let r=t.getBoundingClientRect(),i=n[e].getBoundingClientRect();return i.height>0&&i.top>=r.top-1&&i.bottom<=r.bottom+1}).length),o=i.indexOf(r),c=o===-1?e===1?-1:i.length:o;s=i[Math.max(0,Math.min(i.length-1,c+e*a))]}s!==-1&&s!==r&&S(n,s)},[h,y,v,S,w]),D=(0,Z.useCallback)(()=>{c&&x()},[c,x]);return{listRef:p,handleKeyDown:(0,Z.useCallback)(e=>{if(e.ctrlKey||e.metaKey||e.altKey||!g(e))return;if(e.key===`Escape`){i&&(e.preventDefault(),i());return}let t=a===`horizontal`||a===`both`,n=a===`vertical`||a===`both`,c=[],d=[];if(t){let t=e.key===`ArrowLeft`||e.key===`ArrowRight`?Ea(p.current):!1;c.push(t?`ArrowLeft`:`ArrowRight`),d.push(t?`ArrowRight`:`ArrowLeft`)}n&&(c.push(`ArrowDown`),d.push(`ArrowUp`));let f=c.includes(e.key),m=d.includes(e.key),b=o&&e.key===`Home`,x=o&&e.key===`End`,C=s&&e.key===`PageDown`,w=s&&e.key===`PageUp`;if(!f&&!m&&!b&&!x&&!C&&!w||u&&(tw(e.target,e.key)||tw(document.activeElement,e.key)))return;let T=y(),D=h(),O=T===-1?0:T+1,k=T===-1?D.length-1:T-1,A=document.activeElement;if(T===-1&&l!=null&&A!=null&&p.current?.contains(A)){let e=D.findIndex(e=>(A.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);O=e===-1?D.length:e,k=O-1}if(C)E(1);else if(w)E(-1);else{let e;e=f?_(D,O,1,r,v):m?_(D,k,-1,r,v):b?_(D,0,1,!1,v):_(D,D.length-1,-1,!1,v),e!==-1&&S(D,e)}e.preventDefault()},[y,h,r,a,o,s,u,_,v,S,E,i,g,l]),handleFocus:D,focusItem:C,focusFirst:w,focusLast:T,ownsEvent:g,getItems:h}}var aw=500,ow=300,sw=8;function cw(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}function lw(e,t,n,r){let i=cw(e,t,n),a=cw(e,n,r),o=cw(e,r,t);return!((i<0||a<0||o<0)&&(i>0||a>0||o>0))}function uw(e,t,n){let r=sw,i,a;if(t.x<=n.left)i={x:n.left,y:n.top-r},a={x:n.left,y:n.bottom+r};else if(t.x>=n.right)i={x:n.right,y:n.top-r},a={x:n.right,y:n.bottom+r};else if(t.y<=n.top)i={x:n.left-r,y:n.top},a={x:n.right+r,y:n.top};else if(t.y>=n.bottom)i={x:n.left-r,y:n.bottom},a={x:n.right+r,y:n.bottom};else return!1;return lw(e,t,i,a)}function dw(e){let{show:t,hide:n,isOpen:r,isEnabled:i,showDelay:a=150,hideDelay:o=200,clickGuardMs:s=aw,itemSelector:c,popoverId:l,ownsFocus:u=!0,flyoutRef:d}=e,f=la(`(hover: hover)`),p=(0,Z.useRef)(null),m=(0,Z.useRef)(null),h=(0,Z.useRef)(null),g=(0,Z.useRef)(null),_=(0,Z.useRef)(!1),v=(0,Z.useRef)(0),y=(0,Z.useRef)(0),b=(0,Z.useRef)(r),x=(0,Z.useCallback)(()=>{p.current&&=(clearTimeout(p.current),null),m.current&&=(clearTimeout(m.current),null),g.current?.(),g.current=null},[]);G(()=>{let e=b.current;b.current=r,e&&!r&&(x(),_.current=!1,y.current=0,v.current=Date.now())},[r,x]);let S=(0,Z.useRef)(()=>{}),{listRef:C,handleKeyDown:w,focusFirst:T}=nw({itemSelector:c,onEscape:()=>S.current()}),E=(0,Z.useCallback)(()=>{let e=C.current?.contains(document.activeElement)??!1;n();let t=h.current;e&&t!=null&&Fa(t)},[n,C]),D=(0,Z.useCallback)(e=>{e.defaultPrevented||w(e)},[w]);(0,Z.useEffect)(()=>{S.current=()=>{x(),E()}},[x,E]),(0,Z.useEffect)(()=>()=>x(),[x]),(0,Z.useEffect)(()=>{i||x()},[i,x]);let O=(0,Z.useCallback)(()=>{T()||C.current?.focus()},[T,C]),k=(0,Z.useCallback)(()=>{u?(t({skipAutoFocus:!0}),O()):t()},[u,t,O]),A=(0,Z.useCallback)(()=>s>0&&y.current>0&&Date.now()-y.current<s&&(_.current=!1,y.current=0,!0),[s]),j=(0,Z.useCallback)(e=>{l&&e?.preventDefault(),x(),e!=null&&e.detail===0?(v.current=0,_.current=!1,y.current=0,r?u&&O():k()):r?A()?u&&O():E():(v.current=0,_.current=!1,y.current=0,k())},[l,x,r,u,A,k,O,E]),ee=(0,Z.useCallback)(()=>{if(!f||v.current>0&&Date.now()-v.current<ow)return;if(r){x();return}_.current=!0,x();let e=()=>{y.current=Date.now(),t({skipAutoFocus:!0})};a>0?p.current=setTimeout(e,a):e()},[f,r,x,t,a]),M=(0,Z.useCallback)(e=>{if(v.current=0,!_.current)return;x();let t=null,i=!1,a=()=>!1,s=()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{i&&t!=null&&a(t)?s():n()},o)};s();let c=d?.current??C.current,l=e==null?null:{x:e.clientX,y:e.clientY};if(c==null||l==null||!r)return;let u=c.getBoundingClientRect();if(u.width<=0||u.height<=0)return;let f=c.ownerDocument;a=e=>uw(e,l,u),i=!0,t=l;let p=e=>{let n={x:e.clientX,y:e.clientY};t=n,a(n)?s():(i=!1,g.current?.(),g.current=null)};f.addEventListener(`pointermove`,p,!0),g.current=()=>{f.removeEventListener(`pointermove`,p,!0)}},[x,n,o,r,C,d]),N=(0,Z.useCallback)(()=>{x()},[x]),P=(0,Z.useCallback)(e=>{h.current=e},[]),F=(0,Z.useCallback)(()=>{},[]),I=(0,Z.useCallback)(e=>{},[]),L=(0,Z.useCallback)(e=>{},[]);return i?{triggerProps:{onClick:j,onMouseEnter:ee,onMouseLeave:M,...l?{popoverTarget:l}:null},contentProps:{onMouseEnter:N,onMouseLeave:M,onKeyDown:D},menuRef:C,focusFirst:T,focusMenu:O,confirmHoverOpen:A,close:E,setTriggerEl:P}:{triggerProps:{onClick:F,onMouseEnter:F,onMouseLeave:F},contentProps:{onMouseEnter:F,onMouseLeave:F,onKeyDown:L},menuRef:C,focusFirst:T,focusMenu:O,confirmHoverOpen:A,close:E,setTriggerEl:I}}var fw=new Set([`auto`,`contain`,`fit-content`,`inherit`,`initial`,`max-content`,`min-content`,`revert`,`revert-layer`,`stretch`,`unset`]);function pw(e){let t=e.trim().toLowerCase();return fw.has(t)||t.startsWith(`fit-content(`)}function mw(e,t){return`min(${typeof e==`number`?`${e}px`:e.trim()}, ${t})`}function hw(e,t){return typeof e==`string`&&pw(e)?{property:`inlineSize`,value:e.trim()}:{property:`minWidth`,value:mw(e,t)}}ht({"@astryx.dropdownMenu.back":`Back`,"@astryx.dropdownMenu.backTo":`Back to {parent}`,"@astryx.spinner.loading":`Loading`}),`${Zi.maxBlockSize}`,`${Zi.maxBlockSizeFallback}`;var gw={root:{kB7OPa:`x9f619`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xf314gf`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kLWn49:`x1kq96og`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w x1p2z2pi`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kInvED:`x1c097ug`,$$css:!0},open:{kWkggS:`x1lmrjuc`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},_w={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},vw={kzqmXN:`x1uyokj7`,$$css:!0},yw={menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,ks0D6T:`xc0b1yq`,kskxy:`x1uh1i8a`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-radius-top-left":`xe8oyoz`,"--_dropdown-menu-radius-top-right":`x1u9pls2`,"--_dropdown-menu-radius-bottom-right":`x1vzu1ru`,"--_dropdown-menu-radius-bottom-left":`x1hdoyrq`,"--_dropdown-menu-radius-start-start":`xt5si22`,"--_dropdown-menu-radius-start-end":`xqi0wir`,"--_dropdown-menu-radius-end-start":`xix9rv`,"--_dropdown-menu-radius-end-end":`xoofv4m`,"--_dropdown-menu-padding":`xgory14`,kmVPX3:`x9epnlk`,kaIpWk:`x1n97fys`,kWkggS:`x1prclbq`,kGVxlE:`x1i5ehqx`,kMzoRj:`x13rsnn2`,ksu8eU:`xx61lck`,kVAM5u:`x1w1tqly`,kSiTet:`x1hc1fzr`,k1ekBW:`x19991ni`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,$$css:!0},scrollable:{kORKVm:`x1odjw0f`,kXHlph:`x6ikm8r`,kZeWKH:`xish69e`,$$css:!0},touchPinchZoom:{kFalU9:`x1j4r261`,$$css:!0},touchPanYPinchZoom:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0},popoverViewport:{kB7OPa:`x9f619`,kskxy:`x1uh1i8a`,$$css:!0},popover:{k7Eaqz:`x1b27s9g`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:e==null?e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],popoverCustomIntrinsicWidth:e=>[vw,{"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]},bw={kskxy:`x1jols5v`,$$css:!0},xw={viewMaxHeight:e=>[bw,{"--x-maxHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(`min(${e}, ${Zi.maxBlockSize})`)}]},Sw={frame:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1uh1i8a`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-radius-top-left":`xe8oyoz`,"--_dropdown-menu-radius-top-right":`x1u9pls2`,"--_dropdown-menu-radius-bottom-right":`x1vzu1ru`,"--_dropdown-menu-radius-bottom-left":`x1hdoyrq`,"--_dropdown-menu-radius-start-start":`xt5si22`,"--_dropdown-menu-radius-start-end":`xqi0wir`,"--_dropdown-menu-radius-end-start":`xix9rv`,"--_dropdown-menu-radius-end-end":`xoofv4m`,"--_dropdown-menu-padding":`xgory14`,kaIpWk:`x1n97fys`,$$css:!0},flyoutSurface:{ks0D6T:`xc0b1yq`,kWkggS:`x1prclbq`,kGVxlE:`x1i5ehqx`,kSiTet:`x1hc1fzr`,k1ekBW:`x19991ni`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,$$css:!0},menu:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,kAzted:`x2lwn1j`,kmVPX3:`x9epnlk`,kI3sdo:`x1a2a7pz`,k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,$$css:!0},hidden:{k1xSpc:`x1s85apg`,$$css:!0}};function Cw(e){if(e==null)return;let t=e.ownerDocument,n=e.querySelectorAll(`[aria-expanded="true"][aria-controls]`);for(let e of[...n].reverse()){let n=t.getElementById(e.getAttribute(`aria-controls`)??``);if(n?.getAttribute(`data-astryx-submenu-regions`)!==`flyout`)continue;let r=n.closest(`[popover]`);if(r!=null){if(typeof r.hidePopover==`function`)r.matches(`:popover-open`)&&r.hidePopover();else if(r.style.display===`block`){r.style.display=`none`;let e=new Event(`toggle`,{bubbles:!1});Object.defineProperty(e,"newState",{value:`closed`,configurable:!0}),r.dispatchEvent(e)}}}}function ww(e){let{icon:t,label:n,description:r,isDisabled:i=!1,hasSpinner:o=!1,menuWidth:s,onOpenChange:c,presentation:l=`adaptive`,delay:u=150,hideDelay:d=200,header:f,footer:p,children:m,xstyle:h,className:g,style:_,"data-testid":v,menuDataTestId:y,ref:b,id:x,onMouseEnter:S,onMouseLeave:C,onPointerMove:w,onClick:T,onKeyDown:E,...D}=e,O=at(),k=jC(),A=(0,Z.use)(DC),j=k?.menuSize??`md`,ee=!i,M=xt(f)||xt(p),N=A!=null,P=M&&N,F=A?.host.getElement()??null;ro(`DropdownMenuSubMenu`,`header and footer show only inside a DropdownMenu; this menu has no place outside its rows for them, so they are not rendered.`,M&&!N);let I=(0,Z.useId)(),L=(0,Z.useRef)(null),R=(0,Z.useRef)(null),z=(0,Z.useRef)(null),[te,B]=(0,Z.useState)(!1),ne=(0,Z.useId)(),re=(0,Z.useId)(),ie=x??re,V=(0,Z.useRef)(null),ae=k?.drillIn,H=ae!=null&&(l===`drill-in`||l===`adaptive`&&ae.isCompactTouch)?ae:null,U=H!=null,W=(0,Z.useId)(),G=H?.viewStack.includes(W)===!0,K=G&&H?.viewStack.at(-1)===W,se=typeof n==`string`?n:void 0,q=(0,Z.useId)(),ce=se==null&&xt(n),le=ce?(0,Q.jsx)(`span`,{id:q,children:n}):n,ue=se==null?ce?q:ie:void 0,[de,fe]=(0,Z.useState)(),pe=k?.menuLabel,me=pe==null?O(`@astryx.dropdownMenu.back`):O(`@astryx.dropdownMenu.backTo`,{parent:pe}),[he,ge]=(0,Z.useState)(!1),_e=U?G:he,ve=(0,Z.useRef)(!1),Y=(0,Z.useRef)(!1),be=Vi({mode:`context`,lightDismiss:!1,onShow:(0,Z.useCallback)(()=>{Y.current=!1,ge(!0),c?.(!0)},[c]),onHide:(0,Z.useCallback)(()=>{Y.current=!1,Cw(V.current?.ownerDocument.getElementById(ne)??null),ge(!1),c?.(!1)},[c,ne])}),xe=(0,Z.useCallback)(()=>{ee&&be.show()},[ee,be]),Se=(0,Z.useCallback)(()=>{P&&ve.current?Y.current=!0:be.hide()},[be,P]),Ce=(0,Z.useCallback)(()=>{ve.current=!0},[]),we=(0,Z.useCallback)(e=>{if(ve.current=!1,!Y.current)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||setTimeout(()=>{!ve.current&&Y.current&&V.current?.isConnected===!0&&(Y.current=!1,be.hide())},0)},[be]),Te=(0,Z.useCallback)(()=>{Y.current=!1},[]),{listRef:Ee,handleKeyDown:De,focusFirst:Oe,focusItem:ke,ownsEvent:Ae,getItems:je}=iw({itemSelector:IC,reachesDisabledItems:!0,boundarySelector:LC,wrap:!0,hasPaging:!0,onEscape:()=>Ve({focusTrigger:!0})}),Me=Qe(Ee,m,_e&&(!U||P)),Ne=Ye({getItemLabels:()=>je().map(e=>e.textContent),onMatch:ke,getCurrentIndex:()=>je().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))}),Pe=kC();pi(o&&Pe,O(`@astryx.spinner.loading`),V);let{triggerProps:Fe,contentProps:Ie,confirmHoverOpen:Le}=dw({show:xe,hide:Se,isOpen:he,isEnabled:ee&&!U&&Pe,showDelay:u,hideDelay:d,flyoutRef:P?L:Ee}),Re=(0,Z.useRef)(null),ze=(0,Z.useRef)(!1),Be=(0,Z.useCallback)(e=>{if(ee){if(H!=null){if(ce){let e=V.current?.ownerDocument.getElementById(q);fe(e==null?void 0:TC(e))}Re.current=e?.focusFirst?`first`:`container`,H.push(W),c?.(!0)}else be.show(),e?.focusFirst&&(Oe()||Ee.current?.focus())}},[ee,H,W,c,be,Oe,Ee,ce,q]),Ve=(0,Z.useCallback)(e=>{H==null?(be.hide(),e?.focusTrigger!==!1&&V.current?.focus()):G&&(ze.current=e?.focusTrigger!==!1,H.pop(),c?.(!1))},[H,G,c,be]);(0,Z.useEffect)(()=>{if(!K||H?.host==null)return;let e=Re.current;if(e==null)return;Re.current=null;let t=je(),n=e===`first`?t.find((e,t)=>t>0&&e.getAttribute(`aria-disabled`)!==`true`)??t[0]:null;n==null?Ee.current?.focus({preventScroll:!0}):n.focus({preventScroll:!0})},[K,H?.host,je,Ee]),(0,Z.useEffect)(()=>{!G&&ze.current&&(ze.current=!1,V.current?.focus({preventScroll:!0}))},[G]);let He=be.ref,Ue=(0,Z.useCallback)(e=>{V.current=e,He(e)},[He]),We=Vt(Ue,b),Ge=(0,Z.useCallback)(e=>{if(i)e.preventDefault();else if(U){let t=e.detail>0||hi();Be({focusFirst:!t})}else if(he){if(Le()){Oe()||Ee.current?.focus();return}Ve({focusTrigger:!0})}else Be({focusFirst:!0})},[i,U,he,Be,Ve,Le,Oe,Ee]),Ke=(0,Z.useCallback)(e=>{Et(Ge,T)(e)},[Ge,T]),qe=(0,Z.useCallback)(e=>{if(i)return;let t=typeof window<`u`&&V.current&&window.getComputedStyle(V.current).direction===`rtl`?`ArrowLeft`:`ArrowRight`;(e.key===t||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),Be({focusFirst:!0}))},[i,Be]),Je=(0,Z.useCallback)(e=>NC(e,i),[i]),Xe=(0,Z.useCallback)(e=>{if(e.key===`Tab`){if(P){ZC(e,Ee.current,R.current,z.current,!Ae(e));return}Ve({focusTrigger:!1});return}if(!Ae(e))return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),Ve({focusTrigger:!0});return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&PC.has(t.getAttribute(`role`)??``)&&zC(t,e);return}let t=typeof window<`u`&&Ee.current&&window.getComputedStyle(Ee.current).direction===`rtl`?`ArrowRight`:`ArrowLeft`;e.key===t?(e.preventDefault(),Ve({focusTrigger:!0})):Ne.onKeyDown(e)?e.preventDefault():De(e)},[Ae,Ve,De,Ne,Ee,P]),Ze=(0,Z.useCallback)(e=>{e.key===`Tab`?ZC(e,Ee.current,R.current,z.current):e.key===`Escape`&&!e.defaultPrevented&&!nn(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),Ve({focusTrigger:!0}))},[Ee,Ve]),$e=(0,Z.useMemo)(()=>({menuSize:j,closeMenu:()=>{Ve({focusTrigger:!1}),k?.closeMenu()},drillIn:ae,menuLabel:se??de}),[j,Ve,k,ae,se,de]),et=bi({menuRef:Ee,itemSelector:FC,onDismiss:$e.closeMenu}),tt=o?(0,Q.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,Q.jsx)(wt,{size:`sm`,"aria-hidden":`true`})}):(0,Q.jsx)(`span`,{className:`x78zum5 x6s0dn4`,children:(0,Q.jsx)(mt,{icon:`chevronRight`,size:`sm`,color:`secondary`,xstyle:Ti.mirror,...ye(`dropdown-menu-indicator-icon`)})}),nt=s?hw(s,Zi.maxInlineSizeFallback):null,rt=nt?nt.property===`inlineSize`?yw.popoverCustomIntrinsicWidth(nt.value):yw.popoverCustomWidth(nt.value):yw.popover,it=(0,Q.jsx)(AC,{value:$e,children:(0,Q.jsxs)(DC,{value:A,children:[U&&(0,Q.jsx)(WC,{icon:(0,Q.jsx)(mt,{icon:`chevronLeft`,size:`sm`,color:`secondary`,xstyle:Ti.mirror}),label:me,hasCloseOnSelect:!1,onClick:()=>Ve({focusTrigger:!0})}),m]})}),ot=(0,Q.jsx)(OC,{value:Pe&&_e,children:it}),st=P&&A!=null?{[mi]:A.ownerId}:void 0,ct=(e,t,n)=>(0,Q.jsxs)(`div`,{ref:L,id:I,role:`dialog`,"aria-modal":`true`,"data-astryx-submenu-regions":n,...t,...n===`flyout`?{onFocus:Ce,onBlur:we,onPointerEnter:Te}:void 0,...n===`flyout`?hn(ye(`dropdown-menu`,{presentation:`popover`}),J(Sw.frame,Sw.flyoutSurface,Wi.end)):J(Sw.frame,A?.menuMaxHeight!=null&&xw.viewMaxHeight(A.menuMaxHeight),t.hidden===!0&&Sw.hidden),children:[xt(f)&&(0,Q.jsx)(`div`,{ref:R,onKeyDown:Ze,className:`x2lah0s x9epnlk`,children:f}),e,xt(p)&&(0,Q.jsx)(`div`,{ref:z,onKeyDown:Ze,className:`x2lah0s x9epnlk`,children:p})]}),lt=e=>P&&F!=null?(0,rh.createPortal)(e,F):e,ut=e=>{P&&e.target===e.currentTarget&&B(zt(e.currentTarget)===`keyboard`)},dt=e=>{P&&e.target===e.currentTarget&&B(!1)};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xi,{...D,onMouseDown:Et(D.onMouseDown,i?BC:void 0),ref:We,id:ie,role:`menuitem`,tabIndex:-1,"aria-haspopup":P?`dialog`:`menu`,"aria-expanded":_e,"aria-controls":_e?P?I:ne:void 0,"aria-disabled":i||void 0,"data-testid":v,onMouseEnter:Et(Fe.onMouseEnter,S),onMouseLeave:Et(Fe.onMouseLeave,C),onPointerMove:Et(Je,w),startContent:t?gt(t,{size:`sm`,color:`secondary`}):void 0,label:le,description:r,endContent:tt,onClick:Ke,onKeyDown:Et(qe,E),isDisabled:i,xstyle:[oe.focusVisible,gw.root,VC.root,yi,_w[j],_e&&gw.open,i&&gw.disabled,h],...hn(ye(`dropdown-menu-item`,{size:j}),{className:g,style:_})}),H==null?lt(be.render(P?ct((0,Q.jsx)(`div`,{ref:Ee,id:ne,role:`menu`,tabIndex:0,"aria-labelledby":ie,onKeyDown:Xe,onFocus:ut,onBlur:dt,"data-testid":y,...et.menuProps,...st,...J(Sw.menu,Me?yw.touchPanYPinchZoom:yw.touchPinchZoom,Me&&yw.scrollable,te&&oe.focusVisible),children:ot}),{"aria-labelledby":ie,onMouseEnter:Ie.onMouseEnter,onMouseLeave:Ie.onMouseLeave},`flyout`):(0,Q.jsx)(`div`,{ref:Ee,id:ne,role:`menu`,tabIndex:Me?0:-1,"aria-labelledby":ie,onKeyDown:Xe,onMouseEnter:Ie.onMouseEnter,onMouseLeave:Ie.onMouseLeave,"data-testid":y,...et.menuProps,...hn(ye(`dropdown-menu`,{presentation:`popover`}),J(yw.menu,Me?yw.touchPanYPinchZoom:yw.touchPinchZoom,Me&&yw.scrollable,Wi.end)),children:ot}),{placement:`end`,alignment:`start`,offset:a[`--spacing-1`],xstyle:[yw.popoverViewport,rt]})):G&&H.host!=null&&(P?(0,rh.createPortal)(ct((0,Q.jsx)(`div`,{ref:Ee,id:ne,role:`menu`,tabIndex:0,"aria-label":se,"aria-labelledby":ue,onKeyDown:Xe,onFocus:ut,onBlur:dt,"data-testid":y,...et.menuProps,...st,...J(Sw.menu,Me&&yw.scrollable,Me?yw.touchPanYPinchZoom:yw.touchPinchZoom,te&&oe.focusVisible),children:ot}),{"aria-label":se,"aria-labelledby":ue,hidden:!K,inert:!K},`view`),F??H.host):(0,rh.createPortal)((0,Q.jsx)(`div`,{ref:Ee,id:ne,role:`menu`,tabIndex:-1,"aria-label":se,"aria-labelledby":ue,hidden:!K,inert:!K,onKeyDown:Xe,"data-testid":y,...et.menuProps,...{0:{className:`x78zum5 xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o`},1:{className:`xdt5ytf x1lsbc85 x1a2a7pz xpdipgo x87ps6o x1s85apg`}}[!K|0],children:ot}),H.host))]})}ww.displayName=`DropdownMenuSubMenu`;function Tw(e,t){return`item-${e.id??t}`}function Ew(e,t){return`section-${e.id??t}`}function Dw(e,t){let{items:n,id:r,...i}=e;return(0,Q.jsx)(WC,{...i},Tw(e,t))}function Ow(e,t){return e.items&&e.items.length>0?(0,Q.jsx)(ww,{icon:e.icon,label:e.label,isDisabled:e.isDisabled,children:kw(e.items)},Tw(e,t)):Dw(e,t)}function kw(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];`type`in r&&r.type===`divider`?t.push((0,Q.jsx)(qC,{},`divider-${n}`)):`type`in r&&r.type===`section`?t.push((0,Q.jsxs)(`div`,{role:`group`,"aria-label":r.title,children:[r.title&&(0,Q.jsx)(`div`,{"aria-hidden":`true`,...hn(ye(`dropdown-menu-section-heading`),{className:`xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o`}),children:r.title}),r.items.map(Ow)]},Ew(r,n))):`type`in r||t.push(Ow(r,n))}return t}function Aw(e){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(e).matches}function jw(e){let t=Ne().coarsePointerQuery,[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)([]),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(e);c!==e&&(l(e),e?r(Aw(t)):i.length>0&&a([]));let u=(0,Z.useCallback)(e=>{a(t=>t.includes(e)?t:[...t,e])},[]),d=(0,Z.useCallback)(()=>{a(e=>e.length===0?e:e.slice(0,-1))},[]),f=(0,Z.useMemo)(()=>({isCompactTouch:n,viewStack:i,host:o,push:u,pop:d}),[n,i,o,u,d]),p=i.length>0;return{drillIn:f,isDrilled:p,wrapContent:(0,Z.useCallback)(e=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{hidden:p,inert:p,...{0:{className:`xjp7ctv`},1:{className:`x1s85apg`}}[!!p|0],children:e}),(0,Q.jsx)(`div`,{ref:s,className:`xjp7ctv`})]}),[p])}}var Mw={fits:{kFalU9:`x1j4r261`,$$css:!0},scrolls:{kFalU9:`xge0x1e`,kZeWKH:`xish69e`,$$css:!0}},Nw=Mt(async()=>bt(()=>import(`./MenuBottomSheetActionList-PkbkLEyi.js`),__vite__mapDeps([5,1,4,6,7,8,9,10,11,12,13,14,15,16,17]))),Pw=Nw.load;async function Fw(){try{return await Pw(),{isLoaded:!0}}catch(e){return{isLoaded:!1,error:e}}}var Iw=async()=>bt(()=>import(`./MenuBottomSheet-DTrICmho.js`),__vite__mapDeps([18,1,4])),Lw=(0,Z.lazy)(async()=>{let[e]=await Promise.all([Iw(),Pw().catch(()=>void 0)]);return{default:e.MenuBottomSheet}}),Rw=(0,Z.lazy)(async()=>Pw().then(e=>({default:e.MenuBottomSheetActionList})));function zw(e){return Qt()?null:(0,Z.createElement)(Z.Suspense,{fallback:null},(0,Z.createElement)(Lw,e))}function Bw(e){let[t]=(0,Z.useState)(()=>Nw.loaded()?.MenuBottomSheetActionList??null);return Qt()?null:(0,Z.createElement)(Z.Suspense,{fallback:null},(0,Z.createElement)(t??Rw,e))}var Vw={content:{kB7OPa:`x9f619`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,kg3NbH:`x7a5moj`,"--container-padding-inline-start":`x1cvlban`,"--container-padding-inline-end":`x2oyxnl`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},headingAlone:{k1K539:`x1p37lm5`,$$css:!0}};ht({"@astryx.dropdownMenu.back":`Back`,"@astryx.dropdownMenu.label":`Menu`}),`${Zi.maxBlockSize}`,`${Zi.maxBlockSizeFallback}`,`${l[`--color-overlay-pressed`]}${l[`--color-overlay-pressed`]}`;var Hw={kzqmXN:`x1uyokj7`,$$css:!0},Uw={triggerOpen:{kKwaWg:`xpl5ynk`,$$css:!0},triggerPressable:{k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,$$css:!0},dropdown:{kB7OPa:`x9f619`,k1xSpc:`x78zum5 x6ptruj`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kI3sdo:`x1a2a7pz`,k7VYTy:`xpdipgo`,kfSwDN:`x87ps6o`,ks0D6T:`xc0b1yq`,kskxy:`x1uh1i8a`,"--_dropdown-menu-radius":`x1fcsqxe`,"--_dropdown-menu-radius-top-left":`xe8oyoz`,"--_dropdown-menu-radius-top-right":`x1u9pls2`,"--_dropdown-menu-radius-bottom-right":`x1vzu1ru`,"--_dropdown-menu-radius-bottom-left":`x1hdoyrq`,"--_dropdown-menu-radius-start-start":`xt5si22`,"--_dropdown-menu-radius-start-end":`xqi0wir`,"--_dropdown-menu-radius-end-start":`xix9rv`,"--_dropdown-menu-radius-end-end":`xoofv4m`,"--_dropdown-menu-padding":`xgory14`,kmVPX3:`x9epnlk`,kaIpWk:`x1n97fys`,kSiTet:`x1hc1fzr`,k1ekBW:`x19991ni`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,$$css:!0},scrollable:{kORKVm:`x1odjw0f`,kXHlph:`x6ikm8r`,kZeWKH:`xish69e`,$$css:!0},regionsFrame:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1uh1i8a`,$$css:!0},menuInFrame:{kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,kAzted:`x2lwn1j`,$$css:!0},popoverViewport:{kB7OPa:`x9f619`,kskxy:`x1uh1i8a`,$$css:!0},popoverMatchTrigger:{k7Eaqz:`xviorkc`,$$css:!0},popoverCustomWidth:e=>[{k7Eaqz:e==null?e:`xkj4a21`,$$css:!0},{"--x-minWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],popoverCustomIntrinsicWidth:e=>[Hw,{"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]},Ww={kskxy:`x1jols5v`,$$css:!0},Gw={kskxy:`xbmfmqd`,$$css:!0},Kw={menuMaxHeight:e=>[Ww,{"--x-maxHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(`min(${e}, ${Zi.maxBlockSize})`)}],popoverViewportMaxBlockSize:e=>[Gw,{"--x-maxBlockSize":(e=>typeof e==`number`?e+`px`:e??void 0)(`min(${e}, ${Zi.maxBlockSize})`)}]},qw={content:{kzqmXN:`xh8yej3`,$$css:!0},rootHeading:{keTefX:`x6i7dpz`,$$css:!0},viewHeading:{kI3sdo:`x1a2a7pz`,$$css:!0}},Jw=`@astryx.dropdownMenu.label`;function Yw(e,t){if(e==null)return;let n=e.ownerDocument;e.setAttribute(`popovertarget`,t);let r=()=>{n.removeEventListener(`pointerup`,r,!0),n.removeEventListener(`pointercancel`,r,!0),n.defaultView?.setTimeout(()=>{e.removeAttribute(`popovertarget`)},0)};n.addEventListener(`pointerup`,r,!0),n.addEventListener(`pointercancel`,r,!0)}function Xw(e,t){return typeof e==`string`&&e.trim()!==``?e:t}function Zw({button:e,renderTrigger:t,isMenuOpen:n,onOpenChange:r,onClick:i,hasChevron:a=!0,items:o,presentation:s,menuWidth:c,menuMaxHeight:l,placement:u,alignment:d,header:f,footer:p,className:m,style:h,xstyle:g,"data-testid":_,...v}){let y=at(),b=e??{label:y(Jw)},x=y(`@astryx.dropdownMenu.back`),S=(0,Z.useRef)(null),C=Ft(),w=Vt(S,C.ref,b.ref),T=(0,Z.useId)(),E=(0,Z.useId)(),D=(0,Z.useRef)(null),O=(0,Z.useRef)(`pointer`),{isFocusRingSuppressed:k,onFocusReturnTargetFocus:A,prepareFocusReturn:j,resetFocusReturn:ee}=Je(C),M=(0,Z.useRef)(null),N=(0,Z.useRef)(0),[P,F]=(0,Z.useState)(!1),[I,L]=(0,Z.useState)([]),[R,z]=(0,Z.useState)([]),te=n!==void 0,B=te?n:P,[ne,re]=(0,Z.useState)(B);ne!==B&&(re(B),!B&&I.length>0&&(L([]),z([]))),(0,Z.useEffect)(()=>{Fw()},[]);let[ie,V]=(0,Z.useState)(void 0);G(()=>{t!=null&&B&&V(EC(S.current))},[t,B]);let ae=(t==null?void 0:Xw(v[`aria-label`],ie))??b.label,H=I.at(-1),U=H?.items??o,W=H?.label??ae,K=typeof W==`string`?W:R.at(-1)??ae,se=(0,Z.useCallback)(e=>{e?ee():(L([]),z([]),j()),r?.(e),te||F(e)},[te,r,j,ee]),q=(0,Z.useCallback)((e,t)=>{e.isDisabled||(e.onClick?.(t),e.hasCloseOnSelect!==!1&&se(!1))},[se]),ce=b.isIconOnly===!0,le=b.endContent??(a&&!ce?(0,Q.jsx)(mt,{icon:`chevronDown`,size:`sm`,color:`inherit`}):void 0);(0,Z.useEffect)(()=>{if(!B||O.current!==`keyboard`)return;let e=()=>D.current?.querySelector(`button:not(:disabled), a[href]`)??null,t=null,n=requestAnimationFrame(()=>{let r=e();r==null?(t=new MutationObserver(()=>{let r=e();r!=null&&(t?.disconnect(),t=null,n=requestAnimationFrame(()=>{r.focus({preventScroll:!0})}))}),t.observe(document.body,{childList:!0,subtree:!0})):r.focus({preventScroll:!0})});return()=>{cancelAnimationFrame(n),t?.disconnect()}},[H,B]),(0,Z.useEffect)(()=>{if(!B){N.current=0;return}if(I.length===N.current)return;N.current=I.length;let e=requestAnimationFrame(()=>{M.current?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(e)},[B,I.length]);let ue=()=>{O.current=`pointer`},de=e=>{(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(O.current=`keyboard`)},fe=e=>{e.currentTarget.matches(`:disabled, [aria-disabled="true"]`)||(i?.(),se(!B))},pe=(0,Q.jsx)(gi,{ref:M,level:3,tabIndex:-1,xstyle:[qw.viewHeading,I.length===0&&[qw.rootHeading,Vw.headingAlone]],children:W}),me=C.ref,he=(0,Z.useCallback)(e=>{S.current=e,me(e)},[me]);return(0,Q.jsxs)(Q.Fragment,{children:[t==null?(0,Q.jsx)(na,{...b,ref:w,xstyle:[B&&Uw.triggerOpen,b.xstyle,k&&oe.suppressed],tooltip:B?void 0:b.tooltip,endContent:le,onPointerDown:e=>{b.onPointerDown?.(e),ue()},onKeyDown:e=>{b.onKeyDown?.(e),de(e)},onFocus:e=>{b.onFocus?.(e),A()},onClick:fe,"aria-haspopup":`dialog`,"aria-expanded":B,"data-testid":_}):t({ref:he,id:T,onClick:fe,onClickCapture:()=>{},onPointerDown:ue,onContextMenu:()=>{},onKeyDown:de,onFocus:A,"aria-haspopup":`dialog`,"aria-expanded":B,"aria-controls":E}),(0,Q.jsx)(zw,{isOpen:B,onOpenChange:se,finalFocusRef:S,label:K,children:(0,Q.jsxs)(`div`,{ref:D,id:E,...v,...hn(ye(`dropdown-menu`,{presentation:`bottom-sheet`}),J(qw.content,Vw.content,g),m,h),children:[I.length>0?(0,Q.jsxs)(`div`,{className:`x78zum5 x1q0g3np x6s0dn4 xzye2dw x1p37lm5`,children:[(0,Q.jsx)(na,{label:x,variant:`ghost`,size:`sm`,icon:(0,Q.jsx)(mt,{icon:`chevronLeft`,size:`sm`,xstyle:Ti.mirror}),isIconOnly:!0,onClick:()=>{L(e=>e.slice(0,-1)),z(e=>e.slice(0,-1))}}),pe]}):pe,xt(f)&&(0,Q.jsx)(`div`,{className:`xrrkdod xce4md1`,children:f}),(0,Q.jsx)(Bw,{items:U,onSelect:q,onOpenSubmenu:(e,t)=>{L(t=>[...t,e]),z(e=>[...e,t])}}),xt(p)&&(0,Q.jsx)(`div`,{className:`xrrkdod xce4md1`,children:p})]})})]})}function Qw({button:e,renderTrigger:t,isMenuOpen:n,onOpenChange:r,menuWidth:i,menuMaxHeight:o,onClick:s,hasChevron:c=!0,placement:l=`below`,alignment:u=`start`,presentation:d,pressTouchModel:f=`uikit`,header:p,footer:m,className:h,style:g,xstyle:_,"data-testid":v,...y}){let b=at(),x=e??{label:b(Jw)},S=(`items`in y?y.items:void 0)??[],C=y.children,{items:w,children:T,...E}=y,D=(0,Z.useId)(),O=(0,Z.useId)(),k=x.size??`md`,A=(0,Z.useRef)(null),[j,ee]=(0,Z.useState)(void 0),[M,N]=(0,Z.useState)(!1),P=n!==void 0,F=P?n:M,L=(0,Z.useRef)(!1),R=(0,Z.useRef)(!1),z=(0,Z.useRef)(!1),te=(0,Z.useRef)(!1),B=(0,Z.useRef)(null),ne=Ft(),{isFocusRingSuppressed:re,onFocusReturnTargetFocus:V,prepareFocusReturn:ae,resetFocusReturn:H}=Je(ne),U=(0,Z.useRef)(null),W=(0,Z.useRef)(null),K=(0,Z.useMemo)(()=>xt(p)||xt(m),[p,m]),[se,q]=(0,Z.useState)(!1),ce=(0,Z.useRef)(()=>{}),le=(0,Z.useRef)(()=>{}),ue=(0,Z.useRef)(null),de=(0,Z.useRef)(null),fe=(0,Z.useRef)(()=>{}),pe=(0,Z.useCallback)(()=>{let e=B.current;if(!e)return;let t=[...e.querySelectorAll(`[popover]`)].reverse();for(let e of t)if(typeof e.hidePopover==`function`)e.matches(`:popover-open`)&&e.hidePopover();else if(e.style.display===`block`){e.style.display=`none`;let t=new Event(`toggle`,{bubbles:!1});Object.defineProperty(t,"newState",{value:`closed`,configurable:!0}),e.dispatchEvent(t)}},[]),me=(0,Z.useCallback)(()=>{ue.current?.(),ue.current=null,pe(),te.current?te.current=!1:(ce.current(),z.current=!1,r?.(!1),P||N(!1))},[pe,P,r]),he=(0,Z.useCallback)(e=>{e===A.current&&ae(),Ba(e)},[ae]),ge=(0,Z.useRef)(!1),_e=(0,Z.useRef)(`keyboard`),ve=(0,Z.useRef)(!1),Y=(0,Z.useRef)(!1),be=(0,Z.useCallback)(e=>{Y.current=e},[]),xe=(0,Z.useCallback)(()=>{R.current=!1,z.current=!1,_e.current=`keyboard`,ge.current=!1,ve.current=!1},[]);G(()=>{t!=null&&K&&j==null&&ee(EC(A.current))},[t,K,j]);let Se=(0,Z.useCallback)(()=>{L.current=!0,fe.current(),le.current(),H(),t!=null&&ee(EC(A.current)),R.current&&(R.current=!1,s?.()),r?.(!0),P||N(!0)},[P,s,r,t,H]),Ce=t==null?typeof x.label==`string`?x.label:void 0:Xw(E[`aria-label`],j),we=Ie({restoreFocusTo:he,onHide:me,onShow:Se,hasLightDismiss:!0,ownsOutsidePan:!0,hasCloseButton:!1,hasAutoFocus:!1,role:K?`dialog`:`none`,dialogLabel:K?Ce??b(Jw):void 0,xstyle:Wi[l],onOpenPendingChange:be}),Te=(0,Z.useCallback)(()=>{Y.current&&xe(),we.hide()},[we,xe]),{listRef:Ee,handleKeyDown:De,focusFirst:Oe,focusLast:ke,focusItem:Ae,ownsEvent:je,getItems:Me}=iw({itemSelector:IC,reachesDisabledItems:!0,boundarySelector:LC,wrap:!0,hasPaging:!0,onEscape:Te}),Ne=Ye({getItemLabels:()=>Me().map(e=>e.textContent),onMatch:Ae,getCurrentIndex:()=>Me().findIndex(e=>e===document.activeElement||e.contains(document.activeElement))}),Pe=(0,Z.useRef)(P&&n===!0);G(()=>{P&&(n?(z.current=!1,we.isOpen||(ge.current=!Pe.current,we.show())):(Pe.current=!1,we.isOpen?(te.current=z.current,z.current=!1,we.hide()):Y.current&&!z.current&&(xe(),we.hide())))},[n,P,we,xe]),(0,Z.useEffect)(()=>{we.isOpen&&ge.current&&(ge.current=!1,requestAnimationFrame(()=>{let e=ve.current?ke:Oe;ve.current=!1;let t=_e.current===`pointer`,n=Ee.current,r=n?.ownerDocument.activeElement;t&&r!=null&&r!==n&&n?.contains(r)===!0||!t&&e()||n?.focus(),_e.current=`keyboard`}))},[we.isOpen,Oe,ke,Ee]);let Fe=(0,Z.useCallback)(()=>{ue.current?.();let e=f===`uikit`?Ee.current?.closest(`[popover]`):null;ue.current=e==null?null:$h(e,{entrance:we.contentRef.current??e})},[Ee,f,we.contentRef]);ie(le,Fe),(0,Z.useEffect)(()=>()=>{ue.current?.(),ue.current=null},[]);let Le=(0,Z.useCallback)((e,t=!1)=>{ZC(e,Ee.current,U.current,W.current,t)},[Ee]),Re=(0,Z.useCallback)(e=>{if(!je(e))e.key===`Tab`&&(K?Le(e,!0):Te());else if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;let t=document.activeElement;t&&PC.has(t.getAttribute(`role`)??``)&&zC(t,e)}else if(e.key===`Tab`){if(K){Le(e);return}Te()}else Ne.onKeyDown(e)?e.preventDefault():De(e)},[De,Te,Ne,je,K,Le]),ze=(0,Z.useCallback)(e=>{e.key===`Tab`&&Le(e)},[Le]),Be=(0,Z.useCallback)((e=`keyboard`,t=!1)=>A.current?.matches(`:disabled, [aria-disabled="true"]`)===!0?(xe(),`refused`):(L.current=!1,R.current=t,z.current=P,_e.current=e,ge.current=!0,we.show(),L.current?`open`:Y.current?`pending`:(xe(),`refused`)),[P,we,xe]),Ve=P?n===!0:we.isOpen,He=(0,Z.useCallback)(()=>{let e=de.current;de.current=null,e!=null&&e.gesture===Ii()&&Ai()&&Yw(A.current,we.id)},[we.id]);ie(fe,He);let Ue=(0,Z.useCallback)(e=>{if(Ve)return e===`mouse`&&(s?.(),P?r?.(!1):we.hide()),!1;A.current!=null&&Fa(A.current,{preventScroll:!0}),de.current={gesture:Ii()};let t=Be(`pointer`,!0)===`open`,n=Ee.current?.closest(`[popover]`);return t&&e===`mouse`&&I(n)&&Di(n,{releaseTarget:A.current}),t},[Ve,P,Ee,s,r,Be,we]),We=bi({menuRef:Ee,triggerRef:A,itemSelector:FC,onTriggerPress:Ue,onDismiss:Te,longPressDelayMs:f===`pointer`?Si:void 0});ie(ce,We.cancel);let Ge=(0,Z.useCallback)(e=>{if(We.isTriggerClickFromPress())return;let t=e.detail===0?`keyboard`:`pointer`;P?n?(s?.(),r?.(!1)):Be(t,!0):we.isOpen?(s?.(),we.hide()):Be(t,!0)},[We,s,P,r,n,we,Be]),Ke=(0,Z.useCallback)(e=>{let t=e.currentTarget;t.hasAttribute(`popovertarget`)&&(e.preventDefault(),t.removeAttribute(`popovertarget`))},[]),qe=(0,Z.useCallback)(e=>{if(we.isOpen)e.key===`ArrowDown`&&(e.preventDefault(),Oe()||Ee.current?.focus());else if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===` `){if(e.preventDefault(),e.repeat)return;ve.current=e.key===`ArrowUp`,Be()}},[we.isOpen,Be,Oe,Ee]),Xe=x.isIconOnly===!0,Ze=x.endContent??(c&&!Xe?(0,Q.jsx)(mt,{icon:`chevronDown`,size:`sm`,color:`inherit`}):void 0),$e=i?hw(i,Zi.maxInlineSizeFallback):null,et=$e?$e.property===`inlineSize`?Uw.popoverCustomIntrinsicWidth($e.value):Uw.popoverCustomWidth($e.value):Uw.popoverMatchTrigger,{drillIn:tt,wrapContent:nt}=jw(F),rt=(0,Z.useRef)(null),[it,ot]=(0,Z.useState)(0),st=(0,Z.useCallback)(e=>{rt.current=e,e!=null&&ot(e=>e+1)},[]),ct=(0,Z.useMemo)(()=>({getElement:()=>it>0?rt.current:null}),[it]),lt=o==null?null:`${o}px`,ut=(0,Z.useMemo)(()=>({closeMenu:Te,menuSize:k,drillIn:tt,menuLabel:Ce}),[Te,k,tt,Ce]),dt=(0,Z.useMemo)(()=>({host:ct,ownerId:D,menuMaxHeight:lt??void 0}),[ct,D,lt]),ft=nt(y.items===void 0?C:kw(S)),pt=Qe(Ee,ft,we.isOpen),ht=(0,Q.jsx)(`div`,{ref:st,"data-astryx-submenu-host":``,className:`xjp7ctv`}),gt=e=>K?(0,Q.jsxs)(`div`,{...J(Uw.regionsFrame,lt!=null&&Kw.menuMaxHeight(lt)),children:[xt(p)&&(0,Q.jsx)(`div`,{ref:U,onKeyDown:ze,className:`x2lah0s x9epnlk x6ptruj`,children:p}),e,xt(m)&&(0,Q.jsx)(`div`,{ref:W,onKeyDown:ze,className:`x2lah0s x9epnlk x6ptruj`,children:m}),ht]}):(0,Q.jsxs)(Q.Fragment,{children:[e,ht]}),_t=we.triggerRef,vt=ne.ref,yt=(0,Z.useCallback)(e=>{A.current=e,_t(e),vt(e)},[_t,vt]),bt=x.ref,St=(0,Z.useCallback)(e=>{yt(e),typeof bt==`function`?bt(e):bt&&(bt.current=e)},[yt,bt]),Ct={ref:yt,id:O,onClick:Ge,onClickCapture:Ke,onPointerDown:We.triggerProps.onPointerDown,onContextMenu:We.triggerProps.onContextMenu,onKeyDown:qe,onFocus:()=>{},"aria-haspopup":K?`dialog`:`menu`,"aria-expanded":F,"aria-controls":K?we.id:D};return(0,Q.jsxs)(Q.Fragment,{children:[t==null?(0,Q.jsx)(na,{...x,ref:St,xstyle:[Uw.triggerPressable,F&&Uw.triggerOpen,x.xstyle,re&&oe.suppressed],tooltip:F?void 0:x.tooltip,endContent:Ze,onClick:Ge,onClickCapture:e=>{x.onClickCapture?.(e),Ke(e)},onKeyDown:qe,onPointerDown:e=>{x.onPointerDown?.(e),We.triggerProps.onPointerDown(e)},onContextMenu:e=>{x.onContextMenu?.(e),We.triggerProps.onContextMenu(e)},onFocus:e=>{x.onFocus?.(e),V()},"aria-haspopup":K?`dialog`:`menu`,"aria-expanded":F,"aria-controls":K?we.id:D,"data-testid":v}):t(Ct),we.render(gt((0,Q.jsx)(`div`,{...E,ref:e=>{Ee.current=e,B.current=e?.closest(`[popover]`)??null},id:D,role:`menu`,tabIndex:pt||K?0:-1,"aria-label":t==null?x.label:E[`aria-label`],"aria-labelledby":t!=null&&E[`aria-label`]==null?O:E[`aria-labelledby`],onKeyDown:Re,onFocus:e=>{E.onFocus?.(e),e.target===e.currentTarget&&q(zt(e.currentTarget)===`keyboard`)},...We.menuProps,...hn(ye(`dropdown-menu`,{presentation:`popover`}),J(Uw.dropdown,lt!=null&&Kw.menuMaxHeight(lt),pt?Mw.scrolls:Mw.fits,pt&&Uw.scrollable,K&&Uw.menuInFrame,K&&se&&oe.focusVisible,_),h,g),children:(0,Q.jsx)(AC,{value:ut,children:(0,Q.jsx)(DC,{value:dt,children:(0,Q.jsx)(OC,{value:F,children:ft})})})})),{placement:l,alignment:u,offset:a[`--spacing-1`],xstyle:[Uw.popoverViewport,lt!=null&&Kw.popoverViewportMaxBlockSize(lt),et]})]})}function $w(e){let{onOpenChange:t}=e;ro(`DropdownMenu`,"`button` and `renderTrigger` are mutually exclusive: the menu hangs off one control. `renderTrigger` wins; drop `button`.",e.button!=null&&e.renderTrigger!=null);let n=`items`in e?e.presentation??`popover`:`popover`,r=Ze(n),i=e.isMenuOpen!==void 0,[a,o]=(0,Z.useState)(!1),s=i?e.isMenuOpen:a,c=(0,Z.useCallback)(e=>{t?.(e),i||o(e)},[i,t]),l={...e,isMenuOpen:s,onOpenChange:c};return r===`bottom-sheet`&&`items`in e&&e.items!==void 0?(0,Q.jsx)(ta,{value:null,children:(0,Q.jsx)(Zw,{...l,presentation:`bottom-sheet`})}):(0,Q.jsx)(ta,{value:null,children:(0,Q.jsx)(Qw,{...l,presentation:`popover`,pressTouchModel:e.presentation===`popover`?`pointer`:`uikit`})})}$w.displayName=`DropdownMenu`;function eT({label:e,actions:t}){let n=(0,Z.useSyncExternalStore)(mo,lo),r=n===`unreachable`||n===`retrying`;return(0,Q.jsx)($w,{alignment:`end`,renderTrigger:t=>(0,Q.jsx)(ia,{...t,label:e,tooltip:`More actions`,size:`sm`,icon:(0,Q.jsx)(gd,{})}),children:t.map(e=>(0,Q.jsx)(WC,{"aria-label":e.ariaLabel,"aria-description":e.title,icon:e.icon,label:e.label,isDisabled:e.disabled||e.changesData&&r,variant:e.destructive?`destructive`:`default`,onClick:e.onSelect},e.key))})}var tT=/^\s*(```|~~~)/,nT=/^\s*([-*_])(\s*\1){2,}\s*$/,rT=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,iT=/^\s*(>\s*)*(#{1,6}\s+|[-*+]\s+|\d+[.)]\s+)?(\[[ xX]\]\s+)?/;function aT(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 oT=/^\s*#{1,6}(\s|$)/;function sT(e){let t=[],n=!1;for(let r of e.split(/\r?\n/))if(tT.test(r)){if(n=!n,t.length>0)break}else if(!n){if(r.trim()===``||oT.test(r)||nT.test(r)){if(t.length>0)break}else t.push(r)}return cT(t.join(`
63
- `))}function cT(e){return e.split(/\r?\n/).filter(e=>!tT.test(e)&&!nT.test(e)&&!rT.test(e)).map(e=>aT(e.replace(iT,``))).join(` `).replace(/\s+/g,` `).trim()}var lT=`input, textarea, select, [role=combobox]`;function uT(e,t,n=!1){let[r,i]=(0,Z.useState)(!1),a=(0,Z.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(lT)?t.focus():(e instanceof Element?e.closest(`form`):null)?.querySelector(`textarea, input:not([type=checkbox]), select, [role=combobox]`)?.focus(),i(!1)};return{asking:r,request:o,keep:s,discard:()=>{i(!1),t()},onKeyDown:e=>{e.key!==`Escape`||n||e.defaultPrevented||e.target instanceof Element&&e.target.closest(`[role=listbox], [aria-expanded=true]`)||(e.preventDefault(),r?s(e.target):o())}}}function dT({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)(X,{type:`button`,size:`sm`,variant:`secondary`,label:`Keep editing`,autoFocus:!0,onClick:e=>n(e.currentTarget)}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`destructive`,label:`Discard changes`,onClick:r})]})}var fT=Bt(`SegmentedControlContext`,1,null);fT.displayName=`SegmentedControlContext`;function pT(){let e=(0,Z.use)(fT);if(e==null)throw Error(`useSegmentedControlContext must be used within SegmentedControl. Wrap your SegmentedControlItem in <SegmentedControl>.`);return e}var mT=`data-astryx-segment-disabled`;function hT(e){return e?{[mT]:``}:{}}function gT(e){return e.hasAttribute(mT)}var _T={"@astryx.keyboardHint.toNavigate":`to navigate`},vT={hint:{kVAEAm:`xixxii4`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`x1prclbq`,kaIpWk:`xh6dtrn`,kGVxlE:`x1i5ehqx`,kLKAdn:`xfsso4q`,kGO01o:`xy143xn`,kZCmMZ:`x12gdq22`,kwRFfy:`x1djylfy`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,kMwMTN:`xv1l7n4`,khDVqt:`xuxw1ft`,kSiTet:`xg01cxk xofkqq2`,k1ekBW:`xsm4mo9`,kIyJzY:`xx6bhzk`,kzIqYQ:`xd00j3c`,$$css:!0},passive:{kfzvcC:`x47corl`,$$css:!0},keys:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xzye2dw`,$$css:!0},label:{keTefX:`x11g1kdw`,$$css:!0}},yT={keys:vT.keys,label:vT.label};function bT(e,t,{isInteractive:n=!1}={}){return e.render(t,{placement:`below`,alignment:`start`,xstyle:[vT.hint,!n&&vT.passive],style:{marginBlockStart:a[`--spacing-2`]}})}ht(_T);var xT=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`]),ST={horizontal:[`left`,`right`],vertical:[`up`,`down`],both:[`left`,`right`,`up`,`down`]};function CT(e={}){let{orientation:t=`horizontal`,dismissAfterMs:n,isEnabled:r=!0}=e,i=at(),a=(0,Z.useRef)(null),o=(0,Z.useRef)(!1),s=(0,Z.useRef)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(()=>{}),u=(0,Z.useCallback)(()=>{a.current&&=(clearTimeout(a.current),null)},[]),[d,f]=(0,Z.useState)(!1),p=(0,Z.useCallback)(()=>{s.current=!0},[]),m=(0,Z.useCallback)(()=>{s.current=!1,f(!1),u(),l.current(null)},[u]),h=Vi({mode:`context`,onShow:p,onHide:m});l.current=h.ref;let g=(0,Z.useCallback)(()=>{o.current=!0,u(),h.hide(),s.current=!1,l.current(null)},[u,h]),_=(0,Z.useCallback)(e=>{!o.current&&r&&(c.current=e,l.current(e),f(!0),h.show(),u(),n!=null&&(a.current=setTimeout(()=>{g()},n)))},[u,g,n,r,h]);un({isActive:d,isPresent:()=>s.current,onDismiss:g,getContainer:()=>c.current}),(0,Z.useEffect)(()=>()=>{u(),l.current(null)},[u]);let v=(0,Z.useCallback)(e=>{if(o.current||!r)return;let t=e.target;if(!t.matches(`:focus-visible`))return;let n=e.currentTarget;n.contains(t)&&(e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||_(t))},[_,r]),y=(0,Z.useCallback)(e=>{if(!s.current)return;let t=e.currentTarget;e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)?!o.current&&e.relatedTarget instanceof HTMLElement&&l.current(e.relatedTarget):g()},[g]),b=(0,Z.useCallback)(e=>{s.current&&xT.has(e.key)&&g()},[g]),x=(0,Q.jsx)(`span`,{...J(yT.keys),children:ST[t].map(e=>(0,Q.jsx)(av,{keys:e},e))});return{hintElement:bT(h,(0,Q.jsxs)(`span`,{"aria-hidden":`true`,children:[x,(0,Q.jsx)(`span`,{...J(yT.label),children:i(`@astryx.keyboardHint.toNavigate`)})]})),onFocus:v,onBlur:y,onKeyDown:b}}var wT={selectionSpring:{response:.4,dampingRatio:.85},dragOvershoot:11,liftGrowth:[24,16],lift:{response:.25,dampingRatio:1}};function TT(){o(`segmented`,wT,{roles:[`selectionSpring`,`lift`]})}var ET=`data-astryx-segment-title`,DT={[ET]:``};function OT(e){return e.querySelector(`[${ET}]`)}var kT=1e-4;function AT(e,t){return{duration:e.duration,at:n=>t(e.at(n)),velocity:n=>{let r=e.at(n);return(t(r+kT)-t(r-kT))/(2*kT)*e.velocity(n)}}}function jT(e,t,{clamp:n=!0}={}){let[r,i]=e,[a,o]=t;return e=>{let t=r===i?e<r?0:1:(e-r)/(i-r);return n&&(t=Math.min(1,Math.max(0,t))),t===0?a:t===1?o:a+(o-a)*t}}var MT={x:0,y:0},NT={left:{x:-1,y:0},right:{x:1,y:0},up:{x:0,y:-1},down:{x:0,y:1}},PT=class extends Jb{get kind(){return`pan`}get family(){return`pan`}lockedAxis=null;travelAtBegan=MT;releaseTime=void 0;origin=MT;adjust=MT;raw=MT;offset=MT;firstMove=null;constructor(e={}){super(e),this.minimumNumberOfTouches=e.minimumNumberOfTouches??1,this.maximumNumberOfTouches=e.maximumNumberOfTouches??1/0;let{hysteresis:t}=e;this.hysteresisFor=typeof t==`function`?t:null,this.hysteresis=typeof t==`number`?t:ue.hysteresis.value,this.direction=e.direction??`any`,this.axisRatio=e.axisRatio??1,this.lockAxis=e.lockAxis??!1,this.scrollEdge=e.scrollEdge??!1,this.firstMoveDecides=e.firstMoveDecides??!1,this.tracker=new Ta}translation(){return this.locked({x:this.raw.x+this.offset.x,y:this.raw.y+this.offset.y})}setDirection(e){this.direction=e}setTranslation(e){this.offset={x:e.x-this.raw.x,y:e.y-this.raw.y}}totalTranslation(){return this.raw}velocity(){return this.locked(this.tracker.velocity(this.releaseTime))}scrollVelocity(){return this.locked(this.tracker.scrollVelocity(this.releaseTime??this.tracker.lastSample?.time??0))}get nativeTouchBehavior(){if(this.scrollEdge||NT[this.direction]!=null)return Gb;let e=this.direction===`horizontal`||this.direction===`left`||this.direction===`right`;return{panX:this.direction===`vertical`||this.direction===`up`||this.direction===`down`,panY:e,pinchZoom:!0,doubleTapZoom:!1}}acceptsTouch(e){return Wb(this.state)&&this.numberOfTouches>=this.maximumNumberOfTouches?!1:super.acceptsTouch(e)}touchesBegan(e,t){if(this.numberOfTouches===e.length){let n=e[0];this.hysteresisFor!=null&&n!=null&&(this.hysteresis=this.hysteresisFor(n)),this.origin=Yb(this.touches.values()),this.adjust=MT,this.raw=MT,this.offset=MT,this.tracker.reset(),this.tracker.add(this.origin.x,this.origin.y,t.time)}else this.rebase(new Set(e.map(e=>e.id)),`added`);this.state===`possible`&&this.numberOfTouches>this.maximumNumberOfTouches&&this.setState(`failed`)}touchesMoved(e,t){if(this.track(t.time),this.state===`possible`){if(this.firstMoveDecides&&this.firstMove==null&&(this.raw.x!==0||this.raw.y!==0)&&(this.firstMove=this.classify(this.raw),this.firstMove!==`begin`)){this.setState(`failed`);return}this.tryBegin()}else Wb(this.state)&&this.setState(`changed`)}touchesEnded(e,t){let n=this.numberOfTouches-e.length;if(Wb(this.state)){if(n<this.minimumNumberOfTouches){this.releaseTime=t.time,this.setState(`ended`);return}this.rebase(new Set(e.map(e=>e.id)),`removed`)}else n===0||n<this.minimumNumberOfTouches?this.setState(`failed`):this.rebase(new Set(e.map(e=>e.id)),`removed`)}reset(){this.lockedAxis=null,this.travelAtBegan=MT,this.origin=MT,this.adjust=MT,this.raw=MT,this.offset=MT,this.releaseTime=void 0,this.firstMove=null,this.tracker.reset()}classify(e){if(this.direction===`any`)return`begin`;let t=this.direction===`horizontal`||this.direction===`left`||this.direction===`right`,n=t?e.x:e.y,r=Math.abs(t?e.y:e.x),i=Math.abs(n);if(i>this.axisRatio*r){let e=NT[this.direction],t=e==null?0:e.x+e.y;return t===0||Math.sign(n)===t?`begin`:`fail`}return r*Math.min(1,this.axisRatio)>i?`fail`:`wait`}tryBegin(){let e=this.numberOfTouches;if(e<this.minimumNumberOfTouches)return;if(e>this.maximumNumberOfTouches){this.setState(`failed`);return}let t=this.raw;if(Math.max(Math.abs(t.x),Math.abs(t.y))<this.hysteresis)return;let n=this.classify(t);n===`fail`||n===`wait`||this.scrollEdge&&this.nativeCanScroll(t.x,t.y)?this.setState(`failed`):(this.lockAxis&&this.direction===`any`&&(this.lockedAxis=Math.abs(t.x)>=Math.abs(t.y)?`x`:`y`),this.startFromHere(),this.setState(`began`))}startFromHere(){let e=this.hysteresis,t={x:Math.sign(this.raw.x)*Math.min(Math.abs(this.raw.x),e),y:Math.sign(this.raw.y)*Math.min(Math.abs(this.raw.y),e)};this.travelAtBegan=t,this.offset={x:-t.x,y:-t.y}}keepsTouch(e){let t=this.touches.get(e);if(!this.scrollEdge&&!this.firstMoveDecides||this.state!==`possible`||this.touches.size!==1||t==null||t.pointerType!==`touch`||t.takenByBrowser)return!1;if(this.firstMoveDecides)return this.firstMove===`begin`;let n=this.raw;return this.travelAlongAxis(n)>=5&&this.classify(n)===`begin`&&!this.nativeCanScroll(n.x,n.y)}travelAlongAxis(e){if(this.direction===`any`)return Math.max(Math.abs(e.x),Math.abs(e.y));let t=this.direction===`horizontal`||this.direction===`left`||this.direction===`right`;return Math.abs(t?e.x:e.y)}nativeCanScroll(e,t){for(let n of this.touches.values())if(n.scroll?.canScroll(e,t)===!0)return!0;return!1}track(e){let t=Yb(this.touches.values()),n={x:t.x+this.adjust.x,y:t.y+this.adjust.y};this.tracker.add(n.x,n.y,e),this.raw={x:n.x-this.origin.x,y:n.y-this.origin.y}}rebase(e,t){let n=Yb(this.touches.values()),r=Yb(this.touches.values(),e),[i,a]=t===`added`?[r,n]:[n,r];this.adjust={x:this.adjust.x+i.x-a.x,y:this.adjust.y+i.y-a.y}}locked(e){return this.lockedAxis===`x`?{x:e.x,y:0}:this.lockedAxis===`y`?{x:0,y:e.y}:e}},FT=se;FT.quickTapFlash.value,A.highlightOutMs,ue.hysteresis.value,A.highlightOutMs;function IT(e){if(e.kind!==`tap`)return!1;let t=e;return t.numberOfTapsRequired===1&&t.numberOfTouchesRequired===1}function LT(e){let t=!1,n=null,r=null,i=null,a=null,o=!1,s={isHighlighted:!1,isTracking:!1,isTouchInside:!1},c=e=>{if(r==null)return!0;let t=h.trackingExpansion;return e.x>=r.left-t&&e.x<=r.right+t&&e.y>=r.top-t&&e.y<=r.bottom+t},l=(t,n)=>{e.onControlEvent?.(t,n)},u=r=>{r&&n!=null&&(t=!0),s.isHighlighted!==r&&(s.isHighlighted=r,e.onHighlightChange?.(r))},d=()=>{i!=null&&(clearTimeout(i),i=null)},f=()=>{a!=null&&(clearTimeout(a),a=null)},p=()=>{t=!1,n=null,s.isTracking=!1,s.isTouchInside=!1,r=null},m=e=>{e.id===n&&(t=!1,d(),l(`touchCancel`,e),u(!1),p())},h={get isHighlighted(){return s.isHighlighted},get isTracking(){return s.isTracking},get isTouchInside(){return s.isTouchInside},trackingExpansion:e.trackingExpansion??re.trackingExpansion.value,isEnabled(){return e.isEnabled?.()!==!1},holdsContextMenu(t){return e.holdsContextMenu?.(t)===!0},touchBegan(t){if(n!=null||e.isEnabled?.()===!1||t.pointerType===`touch`&&e.isBraking?.(t)===!0)return;f(),n=t.id,r=e.getBounds(),s.isTracking=!0,s.isTouchInside=!0,o=!1,l(`touchDown`,t);let a=e.highlightDelay??`inScrollers`;if(t.pointerType===`touch`&&(a===`always`||a===`inScrollers`&&t.scroll?.isInsideScroller===!0)){let e=Math.max(0,FT.contentTouchDelay.value-Va(t.time,t.target));i=setTimeout(()=>{i=null,s.isTouchInside&&u(!0)},e)}else u(!0)},touchMoved(t){if(t.id!==n)return;let r=e.cancelTravel;if(r!=null&&Zb(t)>r){m(t);return}i!=null&&Zb(t)>FT.slop.value&&(clearTimeout(i),i=null,o=!0);let a=c(t);a!==s.isTouchInside&&(s.isTouchInside=a,l(a?`touchDragEnter`:`touchDragExit`,t),i==null&&!o&&u(a)),l(a?`touchDragInside`:`touchDragOutside`,t)},touchEnded(r){if(r.id!==n)return;t=!1;let o=c(r),s=i!=null;d(),l(o?`touchUpInside`:`touchUpOutside`,r);let f=e.quickTapFlash??FT.quickTapFlash.value;s&&o?(u(!0),f>0?a=setTimeout(()=>{a=null,u(!1)},f):u(!1)):u(!1),p()},touchCancelled:m,allowsAncestorRecognizer(t){let n=t;return n.view!=null&&n.view===e.view||!(e.vetoesAncestorRecognizer??IT)(n)},dispose(){d(),f(),u(!1),p()},get selectionLock(){return e.selectionLock}};return e.keepsTouch===!0?Object.assign(h,{keepsTouch:e=>t&&n===e}):h}function RT(e,t={}){let n=(0,Z.useRef)(t),r=(0,Z.useRef)(!1),i=(0,Z.useRef)(e);G(()=>{n.current=t,i.current=e});let a=gS(),{perEventPointer:o=!1}=t,[s]=(0,Z.useState)(()=>e=>{r.current||a.current||(hS()?queueMicrotask(()=>{a.current||e()}):e())}),[c]=(0,Z.useState)(()=>LT({getBounds:()=>{let e=i.current.current;return e==null?null:fS(e.ownerDocument).presentedRect(e)},get view(){return i.current.current},onControlEvent:(e,t)=>s(()=>n.current.onControlEvent?.(e,t)),onHighlightChange:e=>s(()=>n.current.onHighlightChange?.(e)),trackingExpansion:t.trackingExpansion,get highlightDelay(){return n.current.highlightDelay},get cancelTravel(){return n.current.cancelTravel},get quickTapFlash(){return n.current.quickTapFlash},keepsTouch:t.keepsTouch,get selectionLock(){return n.current.selectionLock},vetoesAncestorRecognizer:e=>(n.current.vetoesAncestorRecognizer??IT)(e),isEnabled:()=>n.current.isEnabled?.()??!0,holdsContextMenu:e=>n.current.holdsContextMenu?.(e)===!0,isBraking:e=>{let t=n.current.isBraking;if(t!=null)return t(e);let r=i.current.current;return r!=null&&fS(r.ownerDocument).isScrollBraking(r)}})),{trackingExpansion:l}=t;G(()=>{c.trackingExpansion=l??re.trackingExpansion.value},[c,l]);let u=(0,Z.useMemo)(()=>({tracker:c,perEventPointer:o}),[c,o]);return Ja(e,e=>{let t=fS(e.ownerDocument).attachConsumer(e,u.tracker,{perEventPointer:u.perEventPointer});return()=>{r.current=!0;try{t(),c.dispose()}finally{r.current=!1}}},u),G(()=>{let e=i.current.current;r.current=!0;try{c.isTracking&&!(n.current.isEnabled?.()??!0)&&c.dispose(),e!=null&&mS(()=>fS(e.ownerDocument).update(e))}finally{r.current=!1}}),c}var zT={current:null};function BT(e){return Array.from(e.querySelectorAll(XT),e=>{let t=e.getBoundingClientRect();return{element:e,left:t.left,right:t.right,top:t.top,bottom:t.bottom,band:{left:t.left-qT(e,`left`),top:t.top-qT(e,`top`),right:t.right+qT(e,`right`),bottom:t.bottom+qT(e,`bottom`)}}})}function VT(e){return e.every(({left:e,right:t})=>t-e<=0)}function HT(e){return e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function UT(e,t){let n=null,r=1/0;for(let i of t){let t=Math.max(i.left-e,0,e-i.right);t<r&&(r=t,n=i)}return n!=null&&!HT(n.element)?n.element:null}function WT(e,t,n,r,i={x:e,y:t}){if(!n.some(n=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom))return null;let a=e=>i.x>=e.left&&i.x<=e.right&&i.y>=e.top&&i.y<=e.bottom,o=r.find(({left:e,right:t,top:n,bottom:r})=>n!=null&&r!=null&&a({left:e,right:t,top:n,bottom:r}))??r.find(({band:e})=>e!=null&&a(e));return o==null?UT(e,r):HT(o.element)?null:o.element}var GT=[];function KT(e,t){let n=null;return{onMove:(e,t)=>{n={x:e,y:t}},resolveTarget:(r,i)=>WT(r,i,e(),t(),n??{x:r,y:i})}}function qT(e,t){let n=Number.parseFloat(e.style.getPropertyValue(ot[t]));return Number.isFinite(n)?n:0}function JT(e,t){let{left:n,top:r,right:i,bottom:a}=e.getBoundingClientRect();return[{left:n,top:r,right:i,bottom:a},...t.map(({element:e})=>{let t=e.getBoundingClientRect();return{left:t.left-qT(e,`left`),top:t.top-qT(e,`top`),right:t.right+qT(e,`right`),bottom:t.bottom+qT(e,`bottom`)}})]}function YT(e,t,n){let r=(0,Z.useRef)(!1),i=(0,Z.useRef)(!1),a=(0,Z.useRef)(!1),o=(0,Z.useRef)([]),s=(0,Z.useRef)(GT),c=(0,Z.useRef)(null),[l]=(0,Z.useState)(()=>KT(()=>s.current,()=>o.current)),u=c.current??=Rb(()=>({roots:()=>[e.current],itemSelector:XT,highlightExpansion:0,tracksAlong:`x`,paintsHighlight:e=>r.current&&!i.current&&e.getAttribute(`aria-checked`)!==`true`,onCancel:()=>{a.current=!0,p.end();for(let{element:e}of o.current)Hi(e);t.cancel()},...l,onActivated:(n,r)=>{let i=e.current,a=n.dataset.value;i!=null&&a!=null&&t.clicked(i,a,r)},swallowsNativeClick:!0})),d=(0,Z.useRef)(new Set),f=(0,Z.useRef)(!1),[p]=(0,Z.useState)(()=>({isAwaiting:()=>f.current,end:()=>{f.current=!1}}));G(()=>{let e=d.current;return()=>{u.dispose(),p.end();for(let t of[...e])t()}},[u,p]);let m=n?e:zT;return RT(m,{isEnabled:()=>n,onHighlightChange:e=>{e&&t.highlighted()},onControlEvent:(n,c)=>{let l=e.current;if(l!=null)switch(n){case`touchDown`:p.end(),r.current=!1,a.current=!1,o.current=BT(l),s.current=JT(l,o.current),u.begin(c.x,c.y),i.current=u.beganOn?.getAttribute(`aria-checked`)===`true`,t.begin(l,u.beganOn,c.pointerType===`touch`);break;case`touchUpInside`:case`touchUpOutside`:{if(a.current){ae(l.ownerDocument);break}if(VT(o.current)){u.cancel(),t.cancel();break}u.move(c.x,c.y);let e=u.highlighted,i=n===`touchUpInside`&&!r.current&&e!=null&&e===u.beganOn,s=t.release(e);if(s!=null&&i&&e!=null){u.cancel(),f.current=!0;let n=d.current,r=ji(e,{onClicked:e=>{n.delete(r),p.end(),t.clicked(l,s,e)},onNoClick:()=>{n.delete(r),t.clicked(l,s,Pi(e))}});n.add(r)}else s==null?u.cancel():u.end();break}case`touchCancel`:p.end(),u.cancel(),t.cancel()}}}),vS(m,()=>new PT({name:`segmented-control-drag`,direction:`horizontal`,cancelsTouchesInView:!1,selectionLock:v}),e=>{if(!a.current&&(e.state===`began`&&(r.current=!0),e.state===`began`||e.state===`changed`)){let{x:n,y:r}=e.location();t.drag(n),u.move(n,r)}},{isEnabled:n}),p}var XT=`[role="radio"][data-value]`,ZT=.25,QT=8,$T=`background-color.background-image.background-position.background-size.background-repeat.background-origin.background-clip.box-shadow.border-top-left-radius.border-top-right-radius.border-bottom-right-radius.border-bottom-left-radius.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.backdrop-filter.-webkit-backdrop-filter`.split(`.`),eE=[`left`,`top`,`width`,`height`,`visibility`],tE=F[`--shadow-low`];function nE(e,t){return`--_segmented-${e}-${t.replace(/^-+/,``)}`}var rE=[[`background-color`,`transparent`],[`background-image`,`none`],[`box-shadow`,`none`],[`border-top-color`,`transparent`],[`border-right-color`,`transparent`],[`border-bottom-color`,`transparent`],[`border-left-color`,`transparent`],[`backdrop-filter`,`none`],[`-webkit-backdrop-filter`,`none`]];function iE(e){let t=getComputedStyle(e);return{color:t.color,fontWeight:t.fontWeight}}var aE=new WeakMap;function oE(e){aE.has(e)||aE.set(e,rE.map(([t])=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)]));for(let[t,n]of rE)e.style.setProperty(t,n,`important`)}function sE(e){let t=aE.get(e);if(t!=null){aE.delete(e);for(let[n,r,i]of t)r===``?e.style.removeProperty(n):e.style.setProperty(n,r,i)}}function cE(e,t,n){let r=getComputedStyle(n),i=$T.map(e=>r.getPropertyValue(e));$T.forEach((n,r)=>{e.style.setProperty(nE(t,n),i[r])})}function lE(e){for(let t of $T)e.style.setProperty(nE(`after`,t),e.style.getPropertyValue(nE(`lens`,t)))}function uE(e,t,n){e.style.setProperty(nE(t,`left`),`${n.x}px`),e.style.setProperty(nE(t,`top`),`${n.y}px`),e.style.setProperty(nE(t,`width`),`${n.width}px`),e.style.setProperty(nE(t,`height`),`${n.height}px`),e.style.setProperty(nE(t,`visibility`),`visible`)}function dE(e,t){for(let n of[...eE,...$T])e.style.removeProperty(nE(t,n))}function fE(e,t){return e.offsetWidth<=0||t.width<=0||Math.abs(t.width-e.offsetWidth)<=1?1:t.width/e.offsetWidth}function pE(e){let t=e.getBoundingClientRect(),n=fE(e,t);return r=>{let i=r.getBoundingClientRect();return{x:(i.left-t.left)/n-e.clientLeft,y:(i.top-t.top)/n-e.clientTop,width:i.width/n,height:i.height/n}}}function mE(e){let t=e.getBoundingClientRect(),n=fE(e,t);return r=>(r-t.left)/n-e.clientLeft}function hE(e){return Array.from(e.querySelectorAll(XT))}function gE(e){return e.width>0&&e.height>0}function _E(e){return e.x+e.width/2}function vE(e,t){return Math.abs(e.x-t.x)<.25&&Math.abs(e.y-t.y)<.25&&Math.abs(e.width-t.width)<.25&&Math.abs(e.height-t.height)<.25}function yE(e){return!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`}var bE=OT,xE=Ji(.001,e=>e);function SE(){return typeof performance>`u`?Date.now():performance.now()}var CE=class{track=null;carried=null;abandoned=new Set;facedSegment=null;lensFrame=null;faceOverrides=new Set;running=new Set;isHeld=!1;isLifted=!1;hasLiftedEdge=!1;isPresenting=!0;stilled=new Map;thawFrame=null;touch=null;committed=null;isAwaitingValue=!1;pending=null;releasedByFinger=!0;isLeavingShown=!1;leaving=0;constructor(e=Ka(null,{pseudoElement:`::before`}),t={}){this.animator=e,Ya(),TT(),this.now=t.now??SE,this.after=t.afterAnimator??Ka(null,{pseudoElement:`::after`,initial:{opacity:0}})}attachTrack(e){e!==this.track&&this.settle(),this.track=e,this.animator.attach(e),this.after.attach(e)}get isSliding(){return this.carried!=null}get isPressed(){return this.touch!=null}present(e){this.isPresenting!==e&&(this.isPresenting=e,this.settle())}segmentFor(e,t){return hE(e).find(e=>e.dataset.value===t)??null}select(e,t,n){if(this.track!==e)return;let r=this.segmentFor(e,t),i=this.segmentFor(e,n),a=this.committed===n;if(this.clearFaces(),this.committed=null,this.isAwaitingValue=!1,a){this.pending?.destination===i&&i!=null&&this.startPending(i,pE(e)(i));let t=this.carried;t!=null&&t.segment===i&&(t.hidden!==i&&(sE(t.hidden),this.paintLens(e,i),oE(i),t.hidden=i),this.reaim(e,i));return}if(!this.slidesChanges()||i==null){this.settle();return}if(this.carried==null&&r==null)return;let o=pE(e),s=o(i);if(!gE(s)){this.settle();return}let c=this.carried==null?o(r):null;if(this.animator.reducedMotion()!==`off`){this.crossFadeTo(i,s,c,i,!1);return}let l=this.carry(i,s,c,i);this.settleLens(i,{at:l})}slidesChanges(){return this.isPresenting||this.animator.reducedMotion()===`off`}begin(e,t,n=!0){let r=hE(e),i=pE(e),a=new Map(r.map(e=>[e,i(e)])),o=mE(e),s=r.find(e=>e.getAttribute(`aria-checked`)===`true`)??null,c=t!=null&&t===s,l=s==null?null:bE(s),u=r.find(e=>e!==s&&yE(e)),d=u==null?null:bE(u),f=l!=null&&d!=null?{selected:iE(l),unselected:iE(d)}:null;this.touch={toTrackX:o,boxes:a,origin:t,carriesLens:c,isFinger:n,faces:f}}highlighted(){this.touch?.carriesLens===!0&&this.lift()}lift(){if(this.isLifted||!this.isPresenting||this.animator.reducedMotion()!==`off`)return;this.hold();let e=this.carried;if(!this.isHeld||e==null)return;let[t,n]=wT.liftGrowth,r={scaleX:(e.box.width+t)/e.box.width,scaleY:(e.box.height+n)/e.box.height};this.isLifted=!0,this.hasLiftedEdge=!0;let i={x:0};this.springLens(i,this.springFrom(i,`selection`)),this.springLens(r,this.springFrom(r,`lift`)),this.showLiftedEdge()}showLiftedEdge(){this.track?.style.setProperty(nE(`lens`,`box-shadow`),tE)}paintLens(e,t){cE(e,`lens`,t),this.hasLiftedEdge&&this.showLiftedEdge()}drag(e){let t=this.touch;t!=null&&t.carriesLens&&(this.lift(),this.hold(),this.isHeld&&(this.chase(e),this.followLens()))}hold(){let e=this.touch;if(e==null||e.origin==null||this.isHeld)return;let t=e.boxes.get(e.origin);gE(t)&&(this.carry(e.origin,t,null,e.origin),this.isHeld=!0)}followLens(){let e=this.touch,t=this.carried;if(e==null||!e.carriesLens||!this.isHeld||t==null||e.origin==null){this.lensFrame=null;return}let n=this.presented(t.box,this.now()).center,r=[...e.boxes.entries()].filter(([e])=>yE(e)).sort((e,t)=>e[1].x-t[1].x),i=this.facedSegment??e.origin,a=r.findIndex(([e])=>e===i);if(a>=0){let t=e=>(r[e][1].x+r[e][1].width+r[e+1][1].x)/2,i=a;for(;i+1<r.length&&n>t(i);)i+=1;for(;i>0&&n<t(i-1);)--i;if(i!==a){let o=t(i>a?a:a-1),s=Math.max(QT,ZT*r[i][1].width);if(Math.abs(n-o)>=s){let t=r[i][0];this.showFaceAt(t===e.origin?null:t)}}}let o=this.track?.ownerDocument.defaultView;this.lensFrame==null&&o!=null&&(this.lensFrame=o.requestAnimationFrame(()=>{this.lensFrame=null,this.followLens()}))}chase(e){let t=this.touch,n=this.carried;if(t==null||n==null)return;let r=[...t.boxes.values()].map(_E),i=wT.dragOvershoot,a=Math.min(Math.max(t.toTrackX(e),Math.min(...r)-i),Math.max(...r)+i);if(!this.isPresenting||this.animator.reducedMotion()!==`off`){this.animator.set({x:a-_E(n.box)});return}let o=this.now();this.springLens({x:a-_E(n.box)},this.springFrom({x:a-_E(n.box)},`tracking`),{at:o})}release(e){let t=this.touch;if(this.touch=null,t==null)return null;let n=[...t.boxes.keys()].find(e=>e.getAttribute(`aria-checked`)===`true`)??null,r=(e!=null&&yE(e)?e:null)??n;if(r==null)return this.clearFaces(),this.isHeld&&(this.isHeld=!1,this.settle()),null;let i=t.boxes.get(r),a=r===n?null:r.dataset.value??null;a??this.clearFaces();let o=t.carriesLens&&this.isHeld;return this.committed=a,this.isAwaitingValue=!1,this.releasedByFinger=t.isFinger,a==null?(o&&this.moveLensTo(r,i,n??r,t.isFinger),null):((o||n!=null&&this.slidesChanges())&&(this.pending={destination:r,box:i,isHeld:o,from:!o&&n!=null?t.boxes.get(n):null,touchRelease:t.isFinger}),a)}clicked(e,t,n){this.committed===t&&(n?(this.pending=null,this.decline(e,t)):(this.isAwaitingValue=!0,queueMicrotask(()=>{this.committed===t&&this.pending!=null&&this.startPending(this.selectedIn(e))})))}decline(e,t){if(this.committed!==t)return;this.committed=null,this.isAwaitingValue=!1,this.pending=null,this.clearFaces();let n=hE(e).find(e=>e.getAttribute(`aria-checked`)===`true`)??null;if(n==null||this.carried==null){this.settle();return}let r=pE(e)(n);gE(r)?this.moveLensTo(n,r,n,this.releasedByFinger):this.settle()}cancel(){let e=this.touch;if(this.touch=null,this.clearFaces(),e==null||!e.carriesLens||e.origin==null||!this.isHeld)return;let t=e.boxes.get(e.origin);this.moveLensTo(e.origin,t,e.origin,e.isFinger)}settle(){this.endLeaving(),this.isHeld=!1,this.isLifted=!1,this.hasLiftedEdge=!1,this.pending=null;let e=this.carried;if(e!=null){this.carried=null,this.running.clear(),this.animator.stop(),this.after.stop(),sE(e.hidden);for(let e of this.abandoned)sE(e);this.abandoned.clear(),this.track!=null&&(dE(this.track,`lens`),dE(this.track,`after`)),this.isLeavingShown=!1}this.thawTransitions()}resized(e){let t=this.carried;t!=null&&this.touch==null&&(Math.abs(e.offsetWidth-t.trackSize.width)<.5&&Math.abs(e.offsetHeight-t.trackSize.height)<.5||this.settle())}stop(){this.touch=null,this.lensFrame!=null&&(this.track?.ownerDocument.defaultView?.cancelAnimationFrame(this.lensFrame),this.lensFrame=null),this.committed=null,this.isAwaitingValue=!1,this.clearFaces(),this.settle(),this.cancelThaw(),this.restoreTransitions()}stillTransitions(){let e=this.track;if(e!=null){this.cancelThaw();for(let t of hE(e))this.stilled.has(t)||this.stilled.set(t,[t.style.getPropertyValue(`transition-property`),t.style.getPropertyPriority(`transition-property`)]),t.style.setProperty(`transition-property`,`none`,`important`)}}thawTransitions(){if(this.stilled.size===0||this.thawFrame!=null)return;let e=this.track?.ownerDocument.defaultView;e==null?this.restoreTransitions():this.thawFrame=e.requestAnimationFrame(()=>{this.thawFrame=e.requestAnimationFrame(()=>{this.thawFrame=null,this.restoreTransitions()})})}cancelThaw(){this.thawFrame!=null&&(this.track?.ownerDocument.defaultView?.cancelAnimationFrame(this.thawFrame),this.thawFrame=null)}restoreTransitions(){for(let[e,[t,n]]of this.stilled)t===``?e.style.removeProperty(`transition-property`):e.style.setProperty(`transition-property`,t,n);this.stilled.clear()}selectedIn(e){return hE(e).find(e=>e.getAttribute(`aria-checked`)===`true`)??null}startPending(e,t){let n=this.pending;if(this.pending=null,n==null)return;let r=t??n.box,i=this.carried?.hidden??e??n.destination;n.isHeld?this.moveLensTo(n.destination,r,i,n.touchRelease):n.from!=null&&this.slideTo(n.destination,r,n.from,i,n.touchRelease)}reaim(e,t){let n=this.carried;if(n==null)return;let r=pE(e)(t);gE(r)&&!vE(r,n.box)&&this.moveLensTo(t,r,n.hidden,this.releasedByFinger)}carry(e,t,n,r){let i=this.track;if(i==null)return;this.isPresenting||this.stillTransitions();let a=this.carried,o,s;if(this.velocity={},a!=null){s=this.now();let e=this.presented(a.box,s);o={x:e.center-_E(t),scaleX:e.width/t.width,scaleY:e.height/t.height},this.velocity={x:this.animator.getVelocity(`x`,s),scaleX:this.animator.getVelocity(`scaleX`,s)*a.box.width/t.width,scaleY:this.animator.getVelocity(`scaleY`,s)*a.box.height/t.height}}else{let e=n??t;o={x:_E(e)-_E(t),scaleX:e.width/t.width,scaleY:e.height/t.height}}return a?.hidden!==r&&(a!=null&&this.abandoned.add(a.hidden),this.abandoned.has(r)&&sE(r),this.paintLens(i,r),oE(r),this.abandoned.delete(r)),uE(i,`lens`,t),this.carried={segment:e,box:t,hidden:r,trackSize:{width:i.offsetWidth,height:i.offsetHeight}},this.animator.set({...o,opacity:1}),s}velocity={};springFrom(e,t){let n=t===`selection`?wT.selectionSpring:t===`lift`?wT.lift:Ga.fingerTracking,r={};for(let t of Object.keys(e)){let e=this.velocity[t];e!=null&&e!==0&&(r[t]=e)}return this.velocity=Object.fromEntries(Object.entries(this.velocity).filter(([t])=>!(t in e))),Object.keys(r).length>0?{spring:n,velocity:r}:{spring:n}}settleLens(e,t){let n={x:0,scaleX:1,scaleY:1};if(this.isPresenting&&this.isLifted){this.isLifted=!1;let e={x:0},n={scaleX:1,scaleY:1};this.springLens(e,this.springFrom(e,`selection`),t),this.springLens(n,this.springFrom(n,`lift`),t);return}if(this.isPresenting){this.springLens(n,this.springFrom(n,`selection`),t);return}this.velocity={};let r=Xi(e)??xE,i=t.at,a=(e,t)=>AT(r,jT([0,1],[e,t],{clamp:!1}));this.trackHandle(this.animator.play({x:a(this.animator.get(`x`,i),0),scaleX:a(this.animator.get(`scaleX`,i),1),scaleY:a(this.animator.get(`scaleY`,i),1)},t))}springLens(e,t,n){this.trackHandle(this.animator.animate(e,t,n))}presented(e,t){return{center:_E(e)+this.animator.get(`x`,t),width:e.width*this.animator.get(`scaleX`,t),height:e.height*this.animator.get(`scaleY`,t)}}moveLensTo(e,t,n,r){if(this.isHeld=!1,!gE(t)){this.settle();return}if(this.animator.reducedMotion({touchRelease:r})!==`off`){this.crossFadeTo(e,t,null,this.carried?.hidden??n,r);return}let i=this.carry(e,t,null,this.carried?.hidden??n);this.settleLens(e,{at:i})}slideTo(e,t,n,r,i){if(!gE(t)){this.settle();return}if(this.animator.reducedMotion({touchRelease:i})!==`off`){this.crossFadeTo(e,t,this.carried==null?n:null,this.carried?.hidden??r,i);return}let a=this.carry(e,t,this.carried==null?n:null,this.carried?.hidden??r);this.settleLens(e,{at:a})}crossFadeTo(e,t,n,r,i){let a=this.track;if(a==null)return;let o=null,s=1,c=this.carried;if(c!=null){let e=this.now(),t=this.presented(c.box,e);o={x:t.center-t.width/2,y:c.box.y,width:t.width,height:c.box.height},s=this.animator.get(`opacity`,e)}else n!=null&&(o=n);this.isHeld=!1,this.endLeaving(),this.after.stop(),dE(a,`after`),this.isLeavingShown=!1;let l=o!=null&&s>0&&this.animator.reducedMotion({touchRelease:i})===`crossfade`;l&&this.leave(a,c!=null,r,o,s,t);let u=this.carry(e,t,n,r);this.velocity={},this.trackHandle(this.animator.animate({x:0,scaleX:1,scaleY:1},{spring:wT.selectionSpring},{at:u,crossfadeAs:`entrance`,touchRelease:i})),l&&this.fadeLeaving(t,o,u,i)}leave(e,t,n,r,i,a){t?lE(e):cE(e,`after`,n),uE(e,`after`,{...r,y:a.y,height:a.height}),this.isLeavingShown=!0,this.after.set({x:0,scaleX:1,scaleY:1,opacity:i})}fadeLeaving(e,t,n,r){let i=++this.leaving;this.after.animate({x:_E(e)-_E(t),opacity:0},{spring:wT.selectionSpring},{at:n,touchRelease:r}).finished.then(()=>{this.leaving===i&&this.endLeaving()})}endLeaving(){this.isLeavingShown&&(this.isLeavingShown=!1,this.leaving++,this.after.stop(),this.track!=null&&dE(this.track,`after`))}trackHandle(e){this.running.add(e),e.finished.then(()=>{if(this.running.delete(e),this.running.size>0||this.isHeld||this.touch!=null)return;let t=this.committed;this.isAwaitingValue&&t!=null&&this.track!=null?this.decline(this.track,t):this.committed??this.settle()})}showFaceAt(e){let t=this.touch,n=t?.origin??null;if(e===this.facedSegment||(this.clearFaces(),t?.faces==null||n==null||e==null||e===n))return;let r=bE(e),i=bE(n);r!=null&&i!=null&&(this.wearFace(r,t.faces.selected),this.wearFace(i,t.faces.unselected),this.facedSegment=e)}wearFace(e,t){e.style.color=t.color,this.faceOverrides.add(e)}clearFaces(){for(let e of this.faceOverrides)e.style.removeProperty(`color`);this.faceOverrides.clear(),this.facedSegment=null}};function wE(e,t,n,r){let[i]=(0,Z.useState)(()=>new CE),a=(0,Z.useRef)(t),o=n||r;G(()=>{i.present(n)},[n,i]),G(()=>{let n=a.current;a.current=t;let r=e.current;o&&r!=null&&n!==t&&i.select(r,n,t)},[o,i,e,t]),(0,Z.useEffect)(()=>()=>i.stop(),[i]);let s=YT(e,i,r),c=(0,Z.useCallback)(e=>{if(e==null||!o)return;i.attachTrack(e);let t=rn(e,()=>i.resized(e));return()=>{t(),i.settle(),i.attachTrack(null)}},[o,i]),[l]=(0,Z.useState)(()=>({isPressing:()=>i.isPressed||s.isAwaiting(),keyPressed:s.end}));return{selection:l,attachTrack:c}}var TE={container:{kVAEAm:`x1n2onr6`,kHBbk8:`xc8icb0`,k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kzqmXN:`xeq5yr9`,ks0D6T:`x1x1rfll xzzx6db`,k7Eaqz:`x15x72sd xmzx3xy`,kOIVth:`x1lsbc85`,"--_segmented-control-padding":`x18jk3ff`,kmVPX3:`xpoxszi`,kWkggS:`x17x4s8c`,$$css:!0},fill:{k1xSpc:`x78zum5`,kzqmXN:`xh8yej3`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,$$css:!0},lens:{kgeoSG:`x1cpjm7i`,kEoFBp:`x1hmns74`,kxmVGU:`xy5mcqj`,k75S9Q:`x1h6x5ug`,k96MEf:`x319kzk`,kOlAkY:`xj84cd`,kgzTxl:`xlxjeq7`,kQmYQc:`xtql2tq`,kEdqc7:`x1xm9zrc`,km8f2m:`xkk1bqk`,ktHQil:`x1e91tbo`,kSdLuy:`xwrs98t`,ku0W4C:`x13rwrtk`,kLkRvE:`x1nk0e2p`,k3DiCg:`x19ph129`,kuPSpR:`xkyjh71`,k836YN:`xai7mxl`,kTP8oX:`xzr6j9d`,khXQ3S:`x1mz0nwo`,k2irxo:`xtojb3y`,ktNmms:`x19rx9s5`,kGBI9E:`x1gz1ewn`,ks091d:`xirquxt`,k9BEaU:`x1rj83xg`,kLSKZI:`x1gp8cmm`,kg8CZY:`x267z7u`,kgb78d:`xu7nluz`,kTJRYx:`xaki043`,kUmSqE:`x131tjkd`,k2L7bE:`x10hoewy`,krR4Wo:`x1rimih4`,kjBTDo:`xjmzqq9`,ktumvE:`xymdich`,kwknyK:`x1l1ofoh`,kSMQRv:`x1whvb6r`,k1cwP5:`xg5vybf`,k6d8aP:`x1j47n5p`,klC6Y0:`x11t1reg`,kFbLEI:`x1icymkt`,k5JduY:`x1s928wv`,kwXMNM:`x1j6awrg`,kDVEDD:`xi4xitw`,kH8cDV:`x1ggeerv`,k3foIR:`x3g43gi`,kkgrvl:`x1l8h5kv`,k4zj60:`x1fv2pxm`,kWgvks:`xx38sju`,k51VwD:`x8ihlwz`,kloYau:`x2q1x1w`,kMEsQN:`x1631zco`,kWkaDd:`x1y8idqa`,kU8QeM:`xwnwc82`,ks3ayO:`x1wb6yj0`,kNctxI:`x10e6nnj`,kgUb28:`x1d269y`,kakxe6:`x1pxrrzi`,kIWj2l:`x19crzk3`,kJM1pu:`x17as9s2`,kM2ZXO:`x54l34w`,kbMawA:`x1tmynux`,kgFEc0:`x13ob3d2`,kDH5la:`xbn9yse`,kBNLoZ:`x1icybqf`,kskBYc:`xk12vn8`,k9Mpue:`xsbnptc`,k6OB6z:`x1n4cxts`,kHSQhd:`x11at6vl`,kFO5lE:`x1t5rpqk`,kRcv9L:`x1ff385h`,kHi7i2:`x1tili5q`,kh0EW9:`xe87dmk`,kjCSS1:`x3sz45y`,kfzc6R:`x18pjm2d`,kc1AQg:`xa4st9h`,kvRJ0G:`x1tqw9ds`,kcGwG1:`x1pgdhoo`,kR8tOf:`xc4c6yy`,kxzRJW:`xt64kwx`,$$css:!0}},EE={sm:{"--_segmented-control-radius":`x9icjy1`,kaIpWk:`x1hapoqb`,$$css:!0},md:{"--_segmented-control-radius":`x9icjy1`,kaIpWk:`x1hapoqb`,$$css:!0},lg:{"--_segmented-control-radius":`x9icjy1`,kaIpWk:`x1hapoqb`,$$css:!0}};function DE({ref:e,value:t,onChange:n,label:r,size:i,layout:a=`hug`,isDisabled:o=!1,disabledMessage:s,children:c,xstyle:l,className:u,style:d,onKeyDown:f,onFocus:p,onBlur:m,"aria-describedby":h,...g}){let _=aa(i,`md`),v=we().isTouch,y=(0,Z.useRef)(null),{selection:b,attachTrack:x}=wE(y,t,v,!o),S=o&&!!s,C=Ki({placement:`above`,focusTrigger:`always`,isEnabled:S}),{listRef:w,handleKeyDown:T,handleFocus:E}=iw({itemSelector:`[role="radio"]:not([aria-disabled="true"])`,hasRovingTabIndex:!0,tabStopOrder:OE,wrap:!0,orientation:`horizontal`}),D=CT({orientation:`horizontal`,isEnabled:!o}),O=(0,Z.useCallback)(e=>{b.keyPressed(),f?.(e),e.defaultPrevented||(D.onKeyDown(e),T(e))},[b,f,D,T]),k=(0,Z.useCallback)(e=>{if(p?.(e),e.defaultPrevented||(D.onFocus(e),E(e),o)||!e.currentTarget.contains(e.relatedTarget)||b.isPressing())return;let r=e.target?.closest(`[role="radio"][data-value]`);if(!r||r.getAttribute(`aria-disabled`)===`true`)return;let i=r.dataset.value;i!=null&&i!==t&&n(i)},[p,D,E,o,n,b,t]),A=(0,Z.useMemo)(()=>({value:t,onChange:n,size:_,layout:a,isDisabled:o,disabledReasonID:S?C.describedBy:void 0,isTouchPresentation:v}),[t,n,_,a,o,S,C.describedBy,v]);return(0,Q.jsxs)(fT,{value:A,children:[(0,Q.jsxs)(`div`,{ref:Vt(e,w,y,x,C.ref),...g,role:`radiogroup`,"aria-label":r,"aria-disabled":o||void 0,"aria-describedby":He(h,S?C.describedBy:void 0),onKeyDown:O,onFocus:k,onBlur:Et(m,D.onBlur),...hn(ye(`segmented-control`,{size:_}),J(TE.container,EE[_],a===`fill`&&TE.fill,(v||!o)&&TE.lens,o&&TE.disabled,l),u,d),children:[c,D.hintElement]}),S&&C.renderTooltip(s)]})}DE.displayName=`SegmentedControl`;function OE(e){let t=Array.from(e.querySelectorAll(`[role="radio"]`)),n=t.find(e=>e.getAttribute(`aria-checked`)===`true`)??t.find(e=>!gT(e))??t[0];return n==null?[]:[n,...t.filter(e=>e!==n)]}var kE={base:{kVAEAm:`x1n2onr6`,k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kOIVth:`xzye2dw`,kg3NbH:`xrrkdod`,kWkggS:`xjbqb8w`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kMv6JI:`xjb2p0i`,kGuDYH:`xcr08ib`,kLWn49:`x1kq96og`,k63SB2:`x1e4wzip`,kMwMTN:`xv1l7n4`,kkrTdU:`x1ypdohk x16khyan`,khDVqt:`xuxw1ft`,k7Eaqz:`xeuugli`,k1ekBW:`x1vix5yk`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,$$css:!0},selected:{kAXs8y:`x1kzknox`,kMwMTN:`x1tgivj0 x1k5gbb1`,k63SB2:`x2mo6ok`,kWkggS:`x10xzikg x1jzqe4`,kGVxlE:`x1i5ehqx`,$$css:!0},disabled:{kkrTdU:`xt0e3qv`,kMwMTN:`xnbbluu`,$$css:!0},fill:{kUk6DE:`x98rzlu`,k7Eaqz:`xeuugli`,kjj79g:`xl56j7k`,$$css:!0},iconOnly:{kmuXW:`x2lah0s`,$$css:!0},icon:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,$$css:!0},touchPresentation:{k1ekBW:`x13b0p5u`,$$css:!0}},AE={sm:{kZKoxP:`xzj98nu`,kaIpWk:`xc910v0`,kg3NbH:`xf314gf`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,$$css:!0},md:{kZKoxP:`x184gfjb`,kaIpWk:`xc910v0`,kg3NbH:`xrrkdod`,$$css:!0},lg:{kZKoxP:`x1uiybsj`,kaIpWk:`xc910v0`,kg3NbH:`xrrkdod`,$$css:!0}},jE={sm:{kzqmXN:`x6jxa94`,kZKoxP:`x1v9usgg`,$$css:!0},md:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,$$css:!0},lg:{kzqmXN:`x1xp8n7a`,kZKoxP:`xmix8c7`,$$css:!0}};function ME({ref:e,value:t,label:n,isLabelHidden:r=!1,icon:i,isDisabled:a=!1,onClick:o,xstyle:s,"aria-describedby":c,...l}){let u=Tt(),d=pT(),f=d.value===t,p=a||d.isDisabled,m=d.size,h=d.layout===`fill`,g=Et(p?void 0:o,()=>{!p&&!f&&d.onChange(t)}),_=!p,v=Vt(e,dt(_)),y=xt(i)?(0,Q.jsx)(`span`,{...J(kE.icon,jE[m]),children:i}):null;return(0,Q.jsxs)(`button`,{ref:v,...l,type:`button`,role:`radio`,"aria-checked":f,"aria-disabled":p||void 0,"aria-label":r?n:void 0,"aria-describedby":He(c,d.disabledReasonID),"data-value":t,...hT(a),...!f&&!p?u:void 0,tabIndex:f?0:-1,onClick:g,...hn(ye(`segmented-control-item`,{size:m,selected:f?`selected`:null,disabled:p?`disabled`:null}),fe.focusVisible(kE.base,AE[m],h&&kE.fill,r&&kE.iconOnly,f&&kE.selected,!f&&!p&&kt.backgroundColor,p&&kE.disabled,_&&ut.layer,d.isTouchPresentation===!0&&kE.touchPresentation,s)),children:[y,!r&&(0,Q.jsx)(`span`,{...DT,className:`xb3r6kr xlyipyv xeuugli`,children:n})]})}ME.displayName=`SegmentedControlItem`;var NE=(0,Z.lazy)(()=>bt(()=>import(`./markdown-Bh9eEY5s.js`),__vite__mapDeps([0,1,2,3,4])));function PE({label:e,value:t,onChange:n,placeholder:r,className:i}){let[a,o]=(0,Z.useState)(!1),s=(0,Z.useId)();return(0,Q.jsxs)(`div`,{className:yy(`flex min-w-0 flex-col gap-1 max-md:gap-2`,i),children:[(0,Q.jsxs)(DE,{label:`Mode of ${e}`,size:`sm`,value:a?`preview`:`write`,onChange:e=>o(e===`preview`),children:[(0,Q.jsx)(ME,{value:`write`,label:`Write`}),(0,Q.jsx)(ME,{value:`preview`,label:`Preview`})]}),a?(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)(Z.Suspense,{fallback:(0,Q.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:t}),children:(0,Q.jsx)(NE,{source:t})}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview`})}):(0,Q.jsx)(qS,{rows:3,placeholder:r,label:e,isLabelHidden:!0,"aria-describedby":s,value:t,onChange:n}),(0,Q.jsx)(`p`,{id:s,className:`text-xs text-muted-foreground`,children:`Markdown supported`})]})}function FE(e){let{defaultEntryErrorBehavior:t}=(0,Z.use)(ui);return e??t??`complete`}function IE(e){let{columns:t,cellSelector:n=`button:not([disabled]), [tabindex]:not([tabindex="-1"])`,isCellFocusable:r,getFocusTarget:i,onNavigateBefore:a,onNavigateAfter:o,onPageUp:s,onPageDown:c,hasRovingTabIndex:l=!1}=e,u=(0,Z.useRef)(null),d=(0,Z.useCallback)(()=>u.current?Array.from(u.current.querySelectorAll(n)):[],[n]),f=(0,Z.useCallback)(e=>e?!r||r(e):!1,[r]),p=(0,Z.useCallback)(e=>e?i?i(e):e:null,[i]),m=(0,Z.useCallback)((e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&e.setAttribute(`tabindex`,String(t))},[]),h=(0,Z.useCallback)(()=>d().filter(e=>f(e)).map(e=>p(e)).filter(e=>e!==null),[d,f,p]),g=(0,Z.useCallback)(()=>{let e=h();if(e.length===0)return;let t=e.find(e=>e.getAttribute(`tabindex`)===`0`)??e[0];for(let n of e)m(n,n===t?0:-1);for(let e of d()){let t=f(e)?null:p(e);t!=null&&m(t,-1)}},[h,d,f,p,m]);G(()=>{l&&g()});let _=(0,Z.useCallback)(e=>{if(e){if(l)for(let t of h())m(t,t===e?0:-1);e.focus()}},[l,h,m]),v=(0,Z.useCallback)(e=>{let t=p(e);return t?(_(t),!0):!1},[p,_]),y=(0,Z.useCallback)(()=>{l&&g()},[l,g]),b=(0,Z.useCallback)(()=>{let e=d(),t=document.activeElement;return e.findIndex(e=>e===t||e.contains(t))},[d]),x=(0,Z.useCallback)((e,t,n)=>{let r=t;for(;r>=0&&r<e.length;){if(f(e[r]))return r;r+=n}return-1},[f]),S=(0,Z.useCallback)(e=>{let t=d();if(t.length===0)return;let n=Math.max(0,Math.min(e,t.length-1)),r=x(t,n,1);r===-1&&(r=x(t,n,-1)),r!==-1&&v(t[r])},[d,x,v]),C=(0,Z.useCallback)(()=>{let e=d(),t=x(e,0,1);t!==-1&&v(e[t])},[d,x,v]),w=(0,Z.useCallback)(()=>{let e=d(),t=x(e,e.length-1,-1);t!==-1&&v(e[t])},[d,x,v]);return{gridRef:u,handleKeyDown:(0,Z.useCallback)(e=>{let n=d();if(n.length===0)return;let r=b();if(r===-1)return;let i=Math.floor(r/t),l=r%t,f=Math.ceil(n.length/t),p=!0,m=e.key;switch((m===`ArrowLeft`||m===`ArrowRight`)&&Ea(u.current)&&(m=m===`ArrowLeft`?`ArrowRight`:`ArrowLeft`),m){case`ArrowRight`:{let e=x(n,r+1,1);e===-1?o?.((l+1)%t,1):v(n[e]);break}case`ArrowLeft`:{let e=x(n,r-1,-1);e===-1?a?.(l===0?t-1:l-1,1):v(n[e]);break}case`ArrowDown`:if(i<f-1){let e=x(n,r+t,t);e===-1?o?.(l,t):v(n[e])}else o?.(l,t);break;case`ArrowUp`:if(i>0){let e=x(n,r-t,-t);e===-1?a?.(l,t):v(n[e])}else a?.(l,t);break;case`Home`:if(e.ctrlKey||e.metaKey)C();else{let e=i*t,r=Math.min(e+t-1,n.length-1),a=x(n,e,1);a!==-1&&a<=r&&v(n[a])}break;case`End`:if(e.ctrlKey||e.metaKey)w();else{let e=i*t,r=Math.min(e+t-1,n.length-1),a=x(n,r,-1);a!==-1&&a>=e&&v(n[a])}break;case`PageUp`:s?.(e);break;case`PageDown`:c?.(e);break;default:p=!1}p&&(e.preventDefault(),e.stopPropagation())},[t,x,v,C,w,d,b,o,a,c,s]),handleFocus:y,focusCell:S,focusFirst:C,focusLast:w}}var LE=m(`hooks/scroll-owner-registry/owners`,1);function RE(e,t){LE.set(e,t)}function zE(e){LE.delete(e)}function BE(e){return LE.get(e)}var VE=new Set([`article`,`banner`,`complementary`,`contentinfo`,`definition`,`directory`,`document`,`figure`,`form`,`generic`,`group`,`heading`,`list`,`listitem`,`main`,`navigation`,`none`,`note`,`paragraph`,`presentation`,`region`,`section`,`status`,`table`,`term`]);function HE(e){if(e.tabIndex<0||e.matches(`:disabled`)||e.closest(`[inert], [hidden]`)!=null||e.getClientRects().length===0)return!1;let t=getComputedStyle(e).visibility;return t!==`hidden`&&t!==`collapse`}function UE(e,t){let n=t.querySelectorAll(Sn),r=t!==e&&t.matches(`button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child`)&&HE(t)?t:null;for(let e of n)if(!(r!=null&&e.tabIndex<=0)&&HE(e)){if(e.tabIndex>0)return null;r??=e}if(r==null||r.tabIndex!==0||!r.matches(`a[href], button`)||r.closest(`[aria-hidden="true"]`)!=null||r.matches(`[aria-disabled="true"], [aria-haspopup]:not([aria-haspopup="false"])`))return null;let i=r;for(;i!=null&&i!==e;){let e=i.getAttribute(`role`)?.trim().toLowerCase(),t=i===r&&(e===`button`&&r.localName===`button`||e===`link`&&r.localName===`a`);if(e!=null&&e!==``&&!t&&!VE.has(e)||i===r&&e!=null&&e!==``&&!t||i.hasAttribute(`aria-activedescendant`)||i.isContentEditable||i.matches(`[contenteditable]:not([contenteditable="false"])`)||BE(i)!=null)return null;let n=getComputedStyle(i);if(/^(auto|scroll|overlay)$/.test(n.overflowX)&&i.scrollWidth>i.clientWidth+1||/^(auto|scroll|overlay)$/.test(n.overflowY)&&i.scrollHeight>i.clientHeight+1)return null;i=i.parentElement}return i===e?r:null}function WE(e,t){let n=e.ownerDocument,r=n.defaultView;if(r==null)return()=>{};let i=null,a=null,o=null,s,c,l=()=>{i=null,a=null,r.clearTimeout(s),c?.(),c=void 0},u=t=>{if(l(),!(t.key!==`Tab`||t.ctrlKey||t.metaKey)){if(i=t,a=t.target,t.shiftKey&&o!=null&&n.activeElement===o&&e.contains(o)){let t=e.getAttribute(`tabindex`);e.tabIndex=-1,c=()=>{e.getAttribute(`tabindex`)===`-1`&&(t==null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t))}}s=r.setTimeout(l,0)}},d=r=>{let s=i,c=a;if(l(),r.target!==e){e.contains(r.target)||(o=null);return}if(o=null,s==null||s.shiftKey||s.defaultPrevented||s.eventPhase!==0||r.relatedTarget!=null&&r.relatedTarget!==c)return;let u=UE(e,t);u!=null&&(o=u,u.focus(),n.activeElement!==u&&(o=null))};return n.addEventListener(`keydown`,u,!0),n.addEventListener(`keyup`,l,!0),n.addEventListener(`pointerdown`,l,!0),n.addEventListener(`focusin`,d,!0),r.addEventListener(`blur`,l),()=>{l(),n.removeEventListener(`keydown`,u,!0),n.removeEventListener(`keyup`,l,!0),n.removeEventListener(`pointerdown`,l,!0),n.removeEventListener(`focusin`,d,!0),r.removeEventListener(`blur`,l)}}var GE=new WeakMap;function KE(e,t=!1,n=!1){for(let r of GE.get(e)??[])r(t||n,n)}var qE={isScrollable:!1,atStart:!0,atEnd:!0},JE={inline:qE,block:qE},YE={inline:!1,block:!1},XE={inline:`x`,block:`y`,inlineReversed:!1,blockReversed:!1},ZE=[`inline`,`block`],QE={overflow:(e,t)=>[{kXHlph:e==null?e:`xyto64x`,kORKVm:t==null?t:`x4ncuvb`,$$css:!0},{"--x-overflowX":e??void 0,"--x-overflowY":t??void 0}]},$E=[`direction`,`writing-mode`,`display`,`visibility`,`content-visibility`];function eD(e,t){if(e==null||!e.includes(t))return null;let n=RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]*)`,`i`).exec(e);return n==null?null:n[1].trim()}function tD(e,t){return e!==t&&$E.some(n=>eD(e,n)!==eD(t,n))}function nD(e,t){return e===t||e===`both`}function rD(e,t){return e.inline.isScrollable===t.inline.isScrollable&&e.inline.atStart===t.inline.atStart&&e.inline.atEnd===t.inline.atEnd&&e.block.isScrollable===t.block.isScrollable&&e.block.atStart===t.block.atStart&&e.block.atEnd===t.block.atEnd}function iD(e,t){return e.inline===t.inline&&e.block===t.block}function aD(e,t,n){e.current!==n&&(e.current=n,t(n))}function oD(e,t){return e.inline===t.inline&&e.block===t.block&&e.inlineReversed===t.inlineReversed&&e.blockReversed===t.blockReversed}function sD(e){if(e==null)return;let t={...e};return delete t.overflow,delete t.overflowX,delete t.overflowY,delete t.overflowInline,delete t.overflowBlock,t}function cD(e){let t=(0,Z.useRef)(void 0),n=(0,Z.useRef)(null);return(0,Z.useCallback)(r=>{if(n.current!=null&&Object.is(t.current,r))return n.current;let i=Pt(r,e);return t.current=r,n.current=i,i},[e])}function lD({axis:e,keyboardAccess:t,overscroll:n=`allow`,stickyContainment:r=`whenScrollable`}){let[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(JE),[u,d]=(0,Z.useState)(YE),[f,p]=(0,Z.useState)(XE),[m,h]=(0,Z.useState)(!1),g=(0,Z.useRef)(!1),_=(0,Z.useRef)(JE),v=(0,Z.useRef)(null),y=(0,Z.useCallback)(e=>{if(a(t=>t===e?t:e),e==null)return;let t=()=>{let{inline:t,block:n}=_.current;t.isScrollable||n.isScrollable||aD(g,h,e.ownerDocument.activeElement===e)};return t(),e.addEventListener(`focusin`,t),e.addEventListener(`focusout`,t),()=>{e.removeEventListener(`focusin`,t),e.removeEventListener(`focusout`,t),aD(g,h,!1),a(null)}},[]),b=(0,Z.useCallback)(e=>{s(t=>t===e?t:e)},[]),x=cD(y),S=cD(b);G(()=>{if(i==null||o==null)return;let t=null,n=!0,r=XE,a=YE,s=e=>{_.current=e,RE(i,e),l(t=>rD(t,e)?t:e)},c=!0,u=!0,f=()=>{let t=getComputedStyle(i),n=d_(t.writingMode,t.direction),o=nD(e,`inline`)?h_(i,`inline`,n):!1,l=nD(e,`block`)?h_(i,`block`,n):!1,f=nD(e,`inline`)?g_(i,`inline`,n):qE,m=nD(e,`block`)?g_(i,`block`,n):qE;if(o==null||l==null||f==null||m==null)return;!f.isScrollable&&!m.isScrollable&&aD(g,h,i.ownerDocument.activeElement===i);let _={inline:o,block:l},v={inline:f,block:m};r=n,a=_,d(e=>iD(e,_)?e:_),s(v),KE(i,c,u),c=!1,u=!1,p(e=>oD(e,n)?e:n)},m=()=>{t=null,f()},y=()=>{n&&t==null&&(t=window.requestAnimationFrame(m))},b=()=>{if(!n||t!=null)return;let o=_.current,c=o;for(let t of ZE){if(!nD(e,t))continue;let n=v_(i,t,r);if(n==null)return;if(n.overflows!==a[t]||n.contradictsMapping){y();return}let s=o[t];!s.isScrollable||s.atStart===n.atStart&&s.atEnd===n.atEnd||(c={...c,[t]:{isScrollable:!0,atStart:n.atStart,atEnd:n.atEnd}})}c!==o&&s(c),KE(i)},x=()=>{c=!0,y()},S=()=>{u=!0,x()},C=e=>{let t=e.target;return e.type===`attributes`&&e.attributeName===`style`&&t instanceof Element&&!i.contains(t)&&!o.contains(t)&&!tD(e.oldValue,t.getAttribute(`style`))},w=e=>{let t=e.filter(e=>!C(e));t.length!==0&&(t.some(e=>e.target===o||!o.contains(e.target))?S():x())};RE(i,_.current),v.current=f,m();let T=rn(i,S),E=rn(o,S);i.addEventListener(`scroll`,b,{passive:!0}),window.addEventListener(`resize`,y),window.visualViewport?.addEventListener(`resize`,y),o.addEventListener(`load`,y,!0),i.addEventListener(`transitionend`,y),i.addEventListener(`animationend`,y),o.addEventListener(`transitionend`,y),o.addEventListener(`animationend`,y);let D=typeof MutationObserver>`u`?null:new MutationObserver(w);D?.observe(i,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`]}),D?.observe(o,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`],characterData:!0,childList:!0,subtree:!0});let O=i.parentElement;for(;O!=null;)D?.observe(O,{attributes:!0,attributeFilter:[`class`,`dir`,`hidden`,`style`],attributeOldValue:!0}),O=O.parentElement;let k=document.fonts;return k?.addEventListener?.(`loadingdone`,S),k?.ready.then(S),()=>{n=!1,v.current=null,zE(i),T(),E(),D?.disconnect(),i.removeEventListener(`scroll`,b),window.removeEventListener(`resize`,y),window.visualViewport?.removeEventListener(`resize`,y),o.removeEventListener(`load`,y,!0),i.removeEventListener(`transitionend`,y),i.removeEventListener(`animationend`,y),o.removeEventListener(`transitionend`,y),o.removeEventListener(`animationend`,y),k?.removeEventListener?.(`loadingdone`,S),t!=null&&window.cancelAnimationFrame(t)}},[e,o,i]);let C=(0,Z.useRef)(YE),w=(0,Z.useRef)(XE);G(()=>{let e=C.current,t=u.inline&&!e.inline||u.block&&!e.block,n=f!==w.current;C.current=u,w.current=f,(t||n)&&v.current?.()},[u,f]);let T=(0,Z.useMemo)(()=>({inline:nD(e,`inline`)?c.inline:qE,block:nD(e,`block`)?c.block:qE}),[e,c]),E=T.inline.isScrollable||T.block.isScrollable;return G(()=>{if(t.owner===`contentOrViewport`&&E&&i!=null&&o!=null)return WE(i,o)},[o,E,t.owner,i]),{getViewportProps:(0,Z.useCallback)((i={})=>{let a=T.inline.isScrollable||T.block.isScrollable,o=nD(e,`inline`)&&f.inline===`x`||nD(e,`block`)&&f.block===`x`,s=nD(e,`inline`)&&f.inline===`y`||nD(e,`block`)&&f.block===`y`,l=u.inline&&f.inline===`x`||u.block&&f.block===`x`,d=u.inline&&f.inline===`y`||u.block&&f.block===`y`,p=l||d||r===`always`,h=r===`always`?o:l,g=r===`always`?s:d,{xstyle:_,...v}=i,y={...v,style:sD(v.style)},b=hn(y,J(_,QE.overflow(p?h?`auto`:`hidden`:`clip`,p?g?`auto`:`hidden`:`clip`))),S=m||c.inline.isScrollable||c.block.isScrollable,C={...b.style},w=n===`contain`&&T.inline.isScrollable,E=n===`contain`&&T.block.isScrollable,D=f.inline,O=f.block;nD(e,`inline`)&&(C[D===`x`?`overscrollBehaviorX`:`overscrollBehaviorY`]=w?`contain`:`auto`),nD(e,`block`)&&(C[O===`x`?`overscrollBehaviorX`:`overscrollBehaviorY`]=E?`contain`:`auto`);let k=t.owner===`content`?{}:{role:t.role??`group`,"aria-label":t.label,tabIndex:a?0:S?-1:void 0};return{...b,...k,ref:x(b.ref),style:C,"data-scroll-axis":e,"data-scrollable-inline":T.inline.isScrollable?`true`:void 0,"data-scrollable-block":T.block.isScrollable?`true`:void 0,"data-scroll-inline-start":T.inline.atStart?`true`:void 0,"data-scroll-inline-end":T.inline.atEnd?`true`:void 0,"data-scroll-block-start":T.block.atStart?`true`:void 0,"data-scroll-block-end":T.block.atEnd?`true`:void 0}},[e,x,m,t,f,c,u,n,T,r]),getContentProps:(0,Z.useCallback)((e={})=>{let{xstyle:t,...n}=e,r=hn(n,J(t));return{...r,ref:S(r.ref),"data-scroll-content":``}},[S]),state:T}}function uD(e){if(!(e>0&&e<1))throw RangeError(`decay: rate must be in (0, 1), got ${e}`);return-1e3*Math.log(e)}function dD({from:e,velocity:t,rate:n=Y.decelerationRate.normal}){let r=uD(n),i=e+t/r,a=Math.abs(t);return{from:e,initialVelocity:t,rate:n,rest:i,value:n=>e+t*-Math.expm1(-r*n)/r,velocity:e=>t*Math.exp(-r*e),settleTime:e=>{let t=a/r;return e>0?t<=e?0:Math.log(t/e)/r:1/0},timeToSpeed:e=>a<=e?0:e>0?Math.log(a/e)/r:1/0,timeToReach:n=>{if(t===0)return n===e?0:null;let i=r*(n-e)/t;return i<0||i>=1?null:-Math.log1p(-i)/r}}}var fD={af:[`So.`,`Ma.`,`Di.`,`Wo.`,`Do.`,`Vr.`,`Sa.`],ar:[`أحد`,`إثنين`,`ثلاثاء`,`أربعاء`,`خميس`,`جمعة`,`سبت`],"ar-SA":[`أحد`,`إثنين`,`ثلاثاء`,`أربعاء`,`خميس`,`جمعة`,`سبت`],ca:[`dg.`,`dl.`,`dt.`,`dc.`,`dj.`,`dv.`,`ds.`],cs:[`ne`,`po`,`út`,`st`,`čt`,`pá`,`so`],da:[`sø.`,`ma.`,`ti.`,`on.`,`to.`,`fr.`,`lø.`],de:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],el:[`Κυρ`,`Δευ`,`Τρί`,`Τετ`,`Πέμ`,`Παρ`,`Σάβ`],en:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],es:[`dom`,`lun`,`mar`,`mié`,`jue`,`vie`,`sáb`],fi:[`su`,`ma`,`ti`,`ke`,`to`,`pe`,`la`],fr:[`dim.`,`lun.`,`mar.`,`mer.`,`jeu.`,`ven.`,`sam.`],he:[`א׳`,`ב׳`,`ג׳`,`ד׳`,`ה׳`,`ו׳`,`ש׳`],hu:[`V`,`H`,`K`,`Sze`,`Cs`,`P`,`Szo`],it:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],ja:[`日`,`月`,`火`,`水`,`木`,`金`,`土`],ko:[`일`,`월`,`화`,`수`,`목`,`금`,`토`],nl:[`zo`,`ma`,`di`,`wo`,`do`,`vr`,`za`],no:[`søn.`,`man.`,`tir.`,`ons.`,`tor.`,`fre.`,`lør.`],pl:[`nie`,`pon`,`wto`,`śro`,`czw`,`pią`,`sob`],pt:[`dom.`,`seg.`,`ter.`,`qua.`,`qui.`,`sex.`,`sáb.`],"pt-PT":[`dom.`,`seg.`,`ter.`,`qua.`,`qui.`,`sex.`,`sáb.`],ro:[`dum.`,`lun.`,`mar.`,`mie.`,`joi`,`vin.`,`sâm.`],ru:[`вс`,`пн`,`вт`,`ср`,`чт`,`пт`,`сб`],sr:[`нед`,`пон`,`уто`,`сре`,`чет`,`пет`,`суб`],sv:[`sön`,`mån`,`tis`,`ons`,`tors`,`fre`,`lör`],tr:[`Paz`,`Pzt`,`Sal`,`Çar`,`Per`,`Cum`,`Cmt`],uk:[`нд`,`пн`,`вт`,`ср`,`чт`,`пт`,`сб`],vi:[`CN`,`T2`,`T3`,`T4`,`T5`,`T6`,`T7`],zh:[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],"zh-TW":[`週日`,`週一`,`週二`,`週三`,`週四`,`週五`,`週六`]},pD=fD.en;function mD(e){return e.every(e=>Mp(e)<=4)}function hD(e){let t;try{t=new Intl.Locale(e)}catch{return pD}let n=fD[t.baseName]??fD[t.language];if(n!=null)return n;let r=am(t.baseName);return r==null?pD:mD(r)?r:am(t.baseName,`narrow`)??pD}function gD(e,t=0){let n=hD(e);return Array.from({length:7},(e,r)=>{let i=(t+r)%7;return{dayOfWeek:i,name:n[i]}})}function _D(e,t=0){return gD(e,t).map(e=>e.name)}function vD(e){let{year:t,month:n,weekStartsOn:r=0,hasVariableRowCount:i=!1,calendar:a=`gregory`}=e,o=Om(a,`useCalendarDays`);return bD((0,Z.useMemo)(()=>{let e=rp(o,{year:t,month:n});return yD({first:e.start,length:e.length,weekStartsOn:r,hasVariableRowCount:i,dayNumberOf:(t,n)=>n>=0&&n<e.length?n+1:$f(o,t)})},[t,n,o,r,i]),r)}function yD(e){let{first:t,length:n,weekStartsOn:r,hasVariableRowCount:i,dayNumberOf:a}=e,o=Hp(t)-r;o<0&&(o+=7);let s=i?Math.ceil((n+o)/7):6,c=[];for(let e=0;e<s*7;e++){let r=e-o,i=Wp(t,r);c.push({date:i,iso:Lp(i),isOutside:r<0||r>=n,dayNumber:a(i,r)})}return c}function bD(e,t){let n=Am(),r=(0,Z.useMemo)(()=>_D(n,t),[n,t]);return{days:e,weeks:(0,Z.useMemo)(()=>{let t=[];for(let n=0;n<e.length;n+=7)t.push(e.slice(n,n+7));return t},[e]),dayNames:r,totalCells:e.length}}function xD(e){let{min:t,max:n,dateConstraints:r,maxRangeSpan:i,minRangeSpan:a,rangeAnchor:o}=e,s=(0,Z.useMemo)(()=>t?Ip(t):null,[t]),c=(0,Z.useMemo)(()=>n?Ip(n):null,[n]);return{isDateDisabled:(0,Z.useCallback)(e=>{if(s&&Jp(e,s)||c&&Yp(e,c))return!0;if(o){let t=Math.abs(Kp(o,e));if(i!=null&&t>i-1||a!=null&&t>0&&t<a-1)return!0}if(r){for(let t of r)if(!t(Rp(e)))return!0}return!1},[s,c,r,i,a,o]),minDate:s,maxDate:c}}var SD={calendar:{k1xSpc:`x1rg5ohu`,kmVPX3:`x1b2ylru`,k7Eaqz:`x12rczxh`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,k1K539:`x1p37lm5`,kOIVth:`x1txdalj`,$$css:!0},monthYearLabel:{kUk6DE:`x98rzlu`,k9WMMc:`x2b8uid`,k63SB2:`x2mo6ok`,kGuDYH:`xcr08ib`,kLWn49:`x1kq96og`,kMwMTN:`x1tgivj0`,$$css:!0},monthsPending:{k33iCy:`xlshs6z`,$$css:!0},monthsContainer:{k1xSpc:`x78zum5`,kwnvtZ:`x1a02dak`,kOIVth:`x18g69wz`,$$css:!0},navIcon:{k1xSpc:`x3nfvp2`,$$css:!0}},CD={monthGrid:{kUk6DE:`x1cqoux5`,$$css:!0},dayName:{k7Eaqz:`x17ydmr0`,kZKoxP:`x1u5rhrp`,kGO01o:`xy143xn`,kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,k63SB2:`x1sodnla`,kMwMTN:`xv1l7n4`,$$css:!0},weekNumberHeader:{kzqmXN:`x805d0l`,$$css:!0},daysGrid:{k1xSpc:`xrvj5dj`,kumcoG:`xfx17su`,$$css:!0},daysGridWithNumbers:{kumcoG:`x1cehzfw`,$$css:!0},weekNumber:{kzqmXN:`x805d0l`,kZKoxP:`x1ueg155`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,kMwMTN:`xv1l7n4`,$$css:!0},weekRow:{k1xSpc:`xjp7ctv`,$$css:!0}},wD={cell:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kAzted:`x1uogy3y`,kB7OPa:`x9f619`,kmVPX3:`x1i3ajwb`,kHBbk8:`xc8icb0`,$$css:!0},rangeBg:{kVAEAm:`x10l6tqk`,k87sOh:`xs7f9wi`,krVfgx:`x1c7jfne`,kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,$$css:!0},rangeBgRadiusStart:{kLqNvP:`xaoy8p5`,krdFHd:`x19415el`,kVL7Gh:`x1wc3881`,$$css:!0},rangeBgRadiusEnd:{kt4wiu:`xz03a8w`,kfmiAY:`x8agd5o`,kT0f0o:`x1dgc8on`,$$css:!0},rangeInsetStart:{kLqNvP:`xaoy8p5`,$$css:!0},rangeInsetEnd:{kt4wiu:`xz03a8w`,$$css:!0},previewBg:{kVAEAm:`x10l6tqk`,k87sOh:`xs7f9wi`,krVfgx:`x1c7jfne`,kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,$$css:!0},previewBgRadiusStart:{kLqNvP:`xaoy8p5`,krdFHd:`x19415el`,kVL7Gh:`x1wc3881`,$$css:!0},previewBgRadiusEnd:{kt4wiu:`xz03a8w`,kfmiAY:`x8agd5o`,kT0f0o:`x1dgc8on`,$$css:!0},previewStart:{kLqNvP:`xaoy8p5`,krdFHd:`x19415el`,kVL7Gh:`x1wc3881`,$$css:!0},previewEnd:{kt4wiu:`xz03a8w`,kfmiAY:`x8agd5o`,kT0f0o:`x1dgc8on`,$$css:!0},day:{k7Eaqz:`x1nkkqge`,kAzted:`x1gdqauq`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kaIpWk:`xjspbzw`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kkrTdU:`x1ypdohk x16khyan`,kMv6JI:`xjb2p0i`,kGuDYH:`xjm74w1`,kLWn49:`xw6l6zx`,kmVPX3:`x1717udv`,kVAEAm:`x1n2onr6`,kY2c9j:`x1vjfegm`,k1ekBW:`xs2xxs2 x4wkmsb`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,kgeoSG:`x1cpjm7i`,kEoFBp:`x1hmns74`,k96MEf:`x51xajf`,koaPKo:`xekda60`,k5Ofw7:`xe80sof`,kSJ0CW:`xvw6utc`,$$css:!0},dayOutside:{kSiTet:`xbyyjgo`,$$css:!0},dayToday:{$$css:!0},dayTodayInRange:{$$css:!0},daySelected:{$$css:!0},dayDisabled:{kkrTdU:`xt0e3qv`,$$css:!0}},TD={rangeBg:{kWkggS:`xgcxg3y`,$$css:!0},previewBg:{kWkggS:`x1lmrjuc`,$$css:!0},day:{kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w`,$$css:!0},dayOutside:{kMwMTN:`xv1l7n4`,$$css:!0},dayToday:{kGVxlE:`x1lp15jv`,$$css:!0},dayTodayInRange:{kGVxlE:`x1iobdd1`,$$css:!0},daySelected:{kAXs8y:`x1kzknox`,kWkggS:`x1ewilqj x1jzqe4`,kMwMTN:`x17wrial x1k5gbb1`,$$css:!0},dayDisabled:{kSiTet:`xuzhngd`,kKwaWg:`x18o3ruo x1bm8j9m`,$$css:!0}};function ED(){let e=Qt()?null:Lp(Bp());return(0,Z.useMemo)(()=>e==null?null:Ip(e),[e])}function DD(e){let{focusDate:t,value:n,min:r,max:i,numberOfMonths:a,today:o,calendar:s=`gregory`}=e;if(t)return Ip(t);let c=r?Ip(r):null,l=i?Ip(i):null;if(n)return OD(Ip(typeof n==`string`?n:n.start),c,l,a,s);if(o==null)return null;if(c&&Jp(o,c))return c;if(l&&Yp(o,l)){let e=Math.max(0,a-1),t=ip(s,ep(s,l),-e).start;return c&&Jp(t,ep(s,c).start)?c:t}return OD(o,c,l,a,s)}function OD(e,t,n,r,i){let a=Math.max(0,r-1);if(n==null||a===0)return e;let o=ep(i,e).start,s=ep(i,n),c=ip(i,s,-a).start;if(!Yp(o,c)||Yp(o,s.start))return e;if(t==null)return c;let l=ep(i,t).start;return Jp(c,l)?Yp(o,l)?t:e:c}function kD(e){let{date:t,dayIndex:n,mode:r,selectedDate:i,rangeStart:a,rangeEnd:o,previewStart:s,previewEnd:c,today:l,isDisabled:u,isOutside:d}=e;return{effectivelyDisabled:u||d,isToday:!d&&l!=null&&Xp(t,l),isSelected:!!(!d&&r===`single`&&i&&Xp(t,i)),isInRange:!!(!d&&r===`range`&&a&&o&&Zp(t,[a,o])),isRangeStart:!!(!d&&r===`range`&&a&&Xp(t,a)),isRangeEnd:!!(!d&&r===`range`&&o&&Xp(t,o)),isInPreview:!!(!d&&s&&c&&Zp(t,[s,c])),isPreviewStart:!!(!d&&s&&Xp(t,s)),isPreviewEnd:!!(!d&&c&&Xp(t,c)),isFirstColumn:n===0,isLastColumn:n===6}}function AD(e){let t=e.prevContinues!==void 0&&!e.prevContinues,n=e.nextContinues!==void 0&&!e.nextContinues;return{roundStart:e.isStart||e.isFirstColumn||t,roundEnd:e.isEnd||e.isLastColumn||n}}function jD(e,t){return AD({isStart:e.isRangeStart,isEnd:e.isRangeEnd,isFirstColumn:e.isFirstColumn,isLastColumn:e.isLastColumn,prevContinues:t?.prevInRange,nextContinues:t?.nextInRange})}function MD(e,t){return AD({isStart:e.isPreviewStart,isEnd:e.isPreviewEnd,isFirstColumn:e.isFirstColumn,isLastColumn:e.isLastColumn,prevContinues:t?.prevInPreview,nextContinues:t?.nextInPreview})}function ND(e){return e.isSelected||e.isRangeStart||e.isRangeEnd}function PD(e){let{date:t,spanStart:n,spanEnd:r,isDisabled:i,isOutside:a}=e;return!!(!a&&!i&&n&&r&&Zp(t,[n,r]))}function FD(e){return e.mode===`range`&&PD({date:e.date,spanStart:e.rangeStart,spanEnd:e.rangeEnd,isDisabled:e.isDisabled,isOutside:e.isOutside})}function ID(e){return PD({date:e.date,spanStart:e.previewStart,spanEnd:e.previewEnd,isDisabled:e.isDisabled,isOutside:e.isOutside})}function LD(e){let{week:t,dayIndex:n,mode:r,rangeStart:i,rangeEnd:a,previewStart:o,previewEnd:s,isDisabled:c}=e,l=t[n-1],u=t[n+1],d=e=>e!=null&&FD({date:e.date,mode:r,rangeStart:i,rangeEnd:a,isDisabled:c(e.date),isOutside:e.isOutside}),f=e=>e!=null&&ID({date:e.date,previewStart:o,previewEnd:s,isDisabled:c(e.date),isOutside:e.isOutside});return{prevInRange:d(l),nextInRange:d(u),prevInPreview:f(l),nextInPreview:f(u)}}var RD=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function zD(e){if(typeof e==`number`)return e;let t=RD.indexOf(e.toLowerCase());return t===-1?0:t}ht({"@astryx.calendar.dayInRange":`{date}, in range`,"@astryx.calendar.dayRangeEnd":`{date}, range end`,"@astryx.calendar.dayRangeStart":`{date}, range start`,"@astryx.calendar.dayRangeStartAndEnd":`{date}, range start and range end`,"@astryx.calendar.daySelected":`{date}, selected`,"@astryx.calendar.nextMonth":`Next month`,"@astryx.calendar.previousMonth":`Previous month`,"@astryx.calendar.rangeClearedAnnounce":`Cleared start date {date}. Select a start date.`,"@astryx.calendar.rangeCompleteAnnounce":`Selected range: {start} to {end}.`,"@astryx.calendar.rangeStartAnnounce":`Start date {date}. Select an end date.`});var BD=Ip(`1970-01-01`);function VD(e,t){for(let n=0;n<e.length;n+=1){let r=Wp(e.start,n);if(!t(r))return r}return null}function HD(e,t,n){return hp(t,e,em,n)}function UD(e){let t=e[0].date;return Wp(t,(4-Hp(t)+7)%7)}function WD({ref:e,...t}){let n=at(),r=Am(),{handleRef:i,mode:a=`single`,value:o,defaultValue:s,onChange:c,numberOfMonths:l=1,min:u,max:d,dateConstraints:f,maxRangeSpan:p,minRangeSpan:m,focusDate:h,onFocusDateChange:g,hasOutsideDays:_=!0,hasWeekNumbers:v=!1,hasVariableRowCount:y=!1,weekStartsOn:b=0,calendar:x,xstyle:S,className:C,style:w,onKeyDown:T,...E}=t,D=km(x,`Calendar`),O=zD(b),k=l===2?2:1,A=ED(),[j,ee]=(0,Z.useState)(s),[M,N]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(null),[I,L]=(0,Z.useState)(null),R=(o===void 0?j:o)??void 0,z=()=>DD({focusDate:h,value:R,min:u,max:d,numberOfMonths:k,today:A,calendar:D}),[te,B]=(0,Z.useState)(z),ne=h!==void 0&&g!==void 0,re=!ne&&te==null&&A!=null?z():null;re!=null&&B(re);let ie=ne?Ip(h):te??re,V=ie!=null,ae=ie??BD;(0,Z.useImperativeHandle)(i,()=>({navigateTo:e=>{ne?g?.(e):B(Ip(e))}}),[ne,g]);let H=Lp(ae),U=(0,Z.useMemo)(()=>ep(D,Ip(H)),[D,H]),W=(0,Z.useMemo)(()=>Array.from({length:k},(e,t)=>ip(D,U,t)),[D,U,k]),oe=W[W.length-1],G=(0,Z.useMemo)(()=>{if(I==null)return null;let e=Ip(I);return W.some(t=>sp(e,t))?I:null},[I,W]),K=(0,Z.useCallback)(e=>{let t=e.relatedTarget instanceof Element&&e.relatedTarget.getAttribute(`data-date`)===I;I!=null&&!t&&L(null)},[I]),se=(0,Z.useMemo)(()=>V?W.map(e=>lp(D,e,r)).join(` – `):``,[D,W,r,V]),q=fn(),ce=(0,Z.useRef)(!0);(0,Z.useEffect)(()=>{ce.current||se===``?ce.current=se===``:q(se)},[se,q]);let le=(0,Z.useMemo)(()=>u?Ip(u):null,[u]),ue=(0,Z.useMemo)(()=>d?Ip(d):null,[d]),de=V&&(le==null||Jp(le,U.start)),fe=V&&(ue==null||Yp(ue,oe.end)),{isDateDisabled:pe}=xD({min:u,max:d,dateConstraints:f,maxRangeSpan:p,minRangeSpan:m,rangeAnchor:(0,Z.useMemo)(()=>a===`range`&&M?Ip(M):null,[a,M])}),me=(0,Z.useCallback)((e,t,n,r=`days`)=>{if(!t){if(e<0&&!de||e>0&&!fe)return;let t=ip(D,U,e).start;g?.(Lp(t)),ne||B(t);return}let i=Ip(t),a=e=>!(le&&Jp(e,le))&&!(ue&&Yp(e,ue)),o;if(r===`months`||r===`years`){let t=r===`years`?op(D,i,e):ap(D,i,e);if(!a(t))return;if(pe(t)){let e=VD(ep(D,t),pe);if(e==null)return;o=e}else o=t}else{let t=e*(n??7),r=Wp(i,t),s=null;for(;Math.abs(Kp(i,r))<=366;){if(!a(r))return;if(!pe(r)){s=r;break}r=Wp(r,t)}if(s==null)return;o=s}let s=o;L(Lp(s));let c=Jp(s,U.start);if(!c&&!Yp(s,oe.end))return;let l=ep(D,s),u=c?l.start:ip(D,l,-(k-1)).start;g?.(Lp(u)),ne||B(u)},[U,D,fe,de,ne,pe,oe,ue,le,k,g]),he=(0,Z.useCallback)(e=>{a===`range`&&M!==null&&e.key===`Escape`&&(N(null),e.preventDefault(),e.stopPropagation())},[a,M]),ge=(0,Z.useCallback)(e=>{let t=Lp(e);if(a===`single`)ee(t),c?.(t,Rp(e));else if(M===null)N(t),q(n(`@astryx.calendar.rangeStartAnnounce`,{date:HD(e,D,r)}));else{let i=Ip(M);if(Xp(e,i)&&(m??1)>1){N(null),q(n(`@astryx.calendar.rangeClearedAnnounce`,{date:HD(e,D,r)}));return}let a,o;Jp(e,i)?(a=t,o=M):(a=M,o=t);let s={start:a,end:o};ee(s),N(null),c?.(s),q(n(`@astryx.calendar.rangeCompleteAnnounce`,{start:HD(Ip(a),D,r),end:HD(Ip(o),D,r)}))}},[a,c,M,m,q,n,r,D]);return(0,Q.jsxs)(`div`,{ref:e,...E,onBlur:Et(E.onBlur,K),...hn(ye(`calendar`,{mode:a}),J(SD.calendar,S),C,w),onKeyDown:Et(T,he),children:[(0,Q.jsxs)(`div`,{...J(SD.header),children:[(0,Q.jsx)(na,{...ye(`calendar-nav`,{nav:`prev`,disabled:de?null:`disabled`}),label:n(`@astryx.calendar.previousMonth`),variant:`ghost`,icon:(0,Q.jsx)(`span`,{...J(SD.navIcon,Ti.mirror),children:(0,Q.jsx)(mt,{icon:`chevronLeft`,size:`sm`,color:`inherit`})}),onClick:()=>me(-1),isDisabled:!de,isIconOnly:!0}),(0,Q.jsx)(`span`,{...J(SD.monthYearLabel),children:se}),(0,Q.jsx)(na,{...ye(`calendar-nav`,{nav:`next`,disabled:fe?null:`disabled`}),label:n(`@astryx.calendar.nextMonth`),variant:`ghost`,icon:(0,Q.jsx)(`span`,{...J(SD.navIcon,Ti.mirror),children:(0,Q.jsx)(mt,{icon:`chevronRight`,size:`sm`,color:`inherit`})}),onClick:()=>me(1),isDisabled:!fe,isIconOnly:!0})]}),(0,Q.jsx)(`div`,{"aria-hidden":!V||void 0,inert:!V,...J(SD.monthsContainer,!V&&SD.monthsPending),children:W.map(e=>(0,Q.jsx)(GD,{month:e,calendar:D,value:R,mode:a,rangeSelectionStart:M,hoveredDate:P,min:u,max:d,dateConstraints:f,maxRangeSpan:p,minRangeSpan:m,hasOutsideDays:_,hasWeekNumbers:v,hasVariableRowCount:y,weekStartsOn:O,onDayClick:ge,onDayHover:e=>F(e?Lp(e):null),today:A,onNavigatePrevious:(e,t,n)=>me(-1,e,t,n),onNavigateNext:(e,t,n)=>me(1,e,t,n),pendingFocus:G,onPendingFocusHandled:()=>L(null)},Lp(e.start)))})]})}WD.displayName=`Calendar`;function GD({month:e,calendar:t,value:n,mode:r,rangeSelectionStart:i,hoveredDate:a,min:o,max:s,dateConstraints:c,maxRangeSpan:l,minRangeSpan:u,hasOutsideDays:d,hasWeekNumbers:f,hasVariableRowCount:p,weekStartsOn:m,onDayClick:h,onDayHover:g,today:_,onNavigatePrevious:v,onNavigateNext:y,pendingFocus:b,onPendingFocusHandled:x}){let S=Am(),C=(0,Z.useMemo)(()=>np(t,e),[t,e]),{days:w,weeks:T}=vD({year:C.year,month:C.month,calendar:t,weekStartsOn:m,hasVariableRowCount:p}),E=(0,Z.useMemo)(()=>gD(S,m),[S,m]),{isDateDisabled:D}=xD({min:o,max:s,dateConstraints:c,maxRangeSpan:l,minRangeSpan:u,rangeAnchor:(0,Z.useMemo)(()=>r===`range`&&i?Ip(i):null,[r,i])}),O=(0,Z.useMemo)(()=>r===`single`&&n&&typeof n==`string`?Ip(n):null,[r,n]),k=(0,Z.useMemo)(()=>{if(O&&sp(O,e)&&!D(O))return Lp(O);if(_!=null&&sp(_,e)&&!D(_))return Lp(_);for(let e of w)if(!e.isOutside&&!D(e.date))return e.iso;return null},[w,_,e,D,O]),A=(0,Z.useCallback)(()=>{let e=document.activeElement;return e&&e.getAttribute(`data-date`)||null},[]),{gridRef:j,handleKeyDown:ee,handleFocus:M}=IE({columns:7,cellSelector:`[role="gridcell"]`,isCellFocusable:e=>e.querySelector(`button:not([disabled]):not([aria-disabled="true"])`)!==null,getFocusTarget:e=>e.querySelector(`button`),hasRovingTabIndex:!0,onNavigateBefore:(0,Z.useCallback)((e,t)=>{let n=A();n&&v?.(n,t)},[A,v]),onNavigateAfter:(0,Z.useCallback)((e,t)=>{let n=A();n&&y?.(n,t)},[A,y]),onPageUp:(0,Z.useCallback)(e=>{let t=A();t&&v?.(t,1,e.shiftKey?`years`:`months`)},[A,v]),onPageDown:(0,Z.useCallback)(e=>{let t=A();t&&y?.(t,1,e.shiftKey?`years`:`months`)},[A,y])});(0,Z.useEffect)(()=>{if(!b||!j.current)return;let t=Ip(b);if(!sp(t,e))return;let n=Lp(t),r=Array.from(j.current.querySelectorAll(`button[data-date]:not([disabled]):not([aria-disabled="true"])`)),i=r.find(e=>e.getAttribute(`data-date`)===n)??r[0]??j.current.querySelector(`button[data-date]:not([disabled])`)??null;if(i!=null){for(let e of j.current.querySelectorAll(`button[data-date]`))e.tabIndex=e===i?0:-1;i.focus()}x?.()},[b,j,e,x]);let N=null,P=null,F=null;if(r===`single`&&n&&typeof n==`string`)N=Ip(n);else if(r===`range`&&n&&typeof n==`object`){let e=n;P=Ip(e.start),F=Ip(e.end)}i&&(P=Ip(i),F=P);let I=null,L=null;if(r===`range`&&i&&a){let e=Ip(i),t=Ip(a);Xp(e,t)||(Jp(t,e)?(I=t,L=e):(I=e,L=t))}let R=(0,Z.useMemo)(()=>lp(t,e,S),[t,e,S]);return(0,Q.jsx)(`div`,{...J(CD.monthGrid),children:(0,Q.jsxs)(`div`,{ref:j,role:`grid`,"aria-label":R,"aria-multiselectable":r===`range`||void 0,onKeyDown:ee,onFocus:M,...J(CD.daysGrid,f&&CD.daysGridWithNumbers),children:[(0,Q.jsxs)(`div`,{role:`row`,...J(CD.weekRow),children:[f&&(0,Q.jsx)(`div`,{role:`columnheader`,...J(CD.dayName,CD.weekNumberHeader),children:(0,Q.jsx)(St,{children:mm(S)})}),E.map(({dayOfWeek:e,name:t})=>(0,Q.jsx)(`div`,{role:`columnheader`,...J(CD.dayName),children:t},e))]}),T.map(e=>{let n=e.find(e=>!e.isOutside)?.date||e[0].date,a=$p(UD(e));return(0,Q.jsxs)(`div`,{role:`row`,...J(CD.weekRow),children:[f&&(0,Q.jsx)(`div`,{role:`rowheader`,...J(CD.weekNumber),children:gm(a,S)}),e.map((n,a)=>{let o=LD({week:e,dayIndex:a,mode:r,rangeStart:P,rangeEnd:F,previewStart:I,previewEnd:L,isDisabled:D});return(0,Q.jsx)(KD,{day:n,dayIndex:a,mode:r,selectedDate:N,rangeStart:P,rangeEnd:F,previewStart:I,previewEnd:L,today:_,hasOutsideDays:d,isDisabled:D(n.date),neighbors:o,isTabbable:n.iso===k,isRangeSelectionInProgress:i!==null,calendar:t,onDayClick:h,onDayHover:g},n.iso)})]},Lp(n))})]})})}function KD({day:e,dayIndex:t,mode:n,selectedDate:r,rangeStart:i,rangeEnd:a,previewStart:o,previewEnd:s,today:c,hasOutsideDays:l,isDisabled:u,neighbors:d,isTabbable:f,isRangeSelectionInProgress:p,calendar:m,onDayClick:h,onDayHover:g}){let _=at(),v=Am(),y=Tt(),{date:b,isOutside:x,dayNumber:S}=e;if(x&&!l)return(0,Q.jsx)(`div`,{role:`gridcell`,...J(wD.cell)});let C=kD({date:b,dayIndex:t,mode:n,selectedDate:r,rangeStart:i,rangeEnd:a,previewStart:o,previewEnd:s,today:c,isDisabled:u,isOutside:x}),w=ND(C),T=C.isToday&&!C.isSelected&&!C.isInRange,E=C.isToday&&!C.isSelected&&C.isInRange,D=T?`today-only`:E?`today-in-range`:null,O=HD(b,m,v),k=C.isSelected?_(`@astryx.calendar.daySelected`,{date:O}):C.isRangeStart&&C.isRangeEnd?_(p?`@astryx.calendar.dayRangeStart`:`@astryx.calendar.dayRangeStartAndEnd`,{date:O}):C.isRangeStart?_(`@astryx.calendar.dayRangeStart`,{date:O}):C.isRangeEnd?_(`@astryx.calendar.dayRangeEnd`,{date:O}):C.isInRange?_(`@astryx.calendar.dayInRange`,{date:O}):O,A=jD(C,{prevInRange:d.prevInRange,nextInRange:d.nextInRange}),j=MD(C,{prevInPreview:d.prevInPreview,nextInPreview:d.nextInPreview});return(0,Q.jsxs)(`div`,{role:`gridcell`,"aria-selected":C.isSelected||C.isInRange||void 0,...J(wD.cell),children:[C.isInRange&&(0,Q.jsx)(`div`,{...hn(ye(`calendar-range`,{start:C.isRangeStart?`start`:null,end:C.isRangeEnd?`end`:null}),J(wD.rangeBg,TD.rangeBg,A.roundStart&&wD.rangeBgRadiusStart,A.roundEnd&&wD.rangeBgRadiusEnd,C.isRangeStart&&wD.rangeInsetStart,C.isRangeStart&&A.roundEnd&&wD.rangeInsetEnd,C.isRangeEnd&&wD.rangeInsetEnd,C.isRangeStart&&A.roundStart&&wD.rangeInsetStart))}),C.isInPreview&&(0,Q.jsx)(`div`,{...hn(ye(`calendar-range-preview`,{start:C.isPreviewStart?`start`:null,end:C.isPreviewEnd?`end`:null}),J(wD.previewBg,TD.previewBg,j.roundStart&&wD.previewBgRadiusStart,j.roundEnd&&wD.previewBgRadiusEnd,C.isPreviewStart&&wD.previewStart,C.isPreviewEnd&&wD.previewEnd))}),(0,Q.jsx)(`button`,{type:`button`,"data-date":e.iso,"aria-label":k,"aria-disabled":C.effectivelyDisabled||void 0,"aria-current":C.isToday?`date`:void 0,tabIndex:f?0:-1,onClick:()=>!C.effectivelyDisabled&&h(b),onMouseEnter:()=>!C.effectivelyDisabled&&g(b),onMouseLeave:()=>g(null),...y,...hn(ye(`calendar-day`,{selected:w?`selected`:null,today:C.isToday?`today`:null,disabled:C.effectivelyDisabled?`disabled`:null,"in-range":C.isInRange?`in-range`:null,marker:D}),fe.focusVisible(wD.day,TD.day,kt.backgroundImage,x&&wD.dayOutside,x&&TD.dayOutside,T&&wD.dayToday,T&&TD.dayToday,E&&wD.dayTodayInRange,E&&TD.dayTodayInRange,w&&wD.daySelected,w&&TD.daySelected,C.effectivelyDisabled&&wD.dayDisabled,C.effectivelyDisabled&&TD.dayDisabled)),children:gm(S,v)})]})}var qD=dn(`BottomSheetEscapeContext`,1,!0);qD.displayName=`BottomSheetEscapeContext`;var JD=`data-astryx-date-probe`,YD=100,XD=null;function ZD(e,t,n,r){return t.textContent=`[${JD}]${n}{padding-inline-start:${YD}px !important}`,e.getBoundingClientRect().width>r+YD/2}function QD(){if(XD!==null)return XD;if(typeof document>`u`||!document.body)return`unknown`;let e=document.createElement(`input`);e.setAttribute(`type`,`date`),e.setAttribute(JD,``),e.style.cssText=`position:fixed;top:-9999px;left:0;width:auto;min-width:0;max-width:none;padding:0;border:0;font-size:16px;box-sizing:content-box;`;let t=document.createElement(`style`),n=`unknown`;try{document.body.appendChild(e),document.head.appendChild(t);let r=e.getBoundingClientRect().width;ZD(e,t,`::-webkit-datetime-edit`,r)?n=`segmented`:ZD(e,t,`::-webkit-date-and-time-value`,r)&&(n=`picker-only`)}catch{}finally{e.remove(),t.remove()}return XD=n,n}function $D(e){let t=QD();return t===`unknown`?!e:t===`segmented`}var eO={"@astryx.dateInput.calendarDescription":`Dates use the {calendar}`,"@astryx.dateInput.formatHint":`e.g., {example}`,"@astryx.dateInput.invalidDate":`Invalid date`,"@astryx.dateInput.nonexistentDate":`{named, select, yes {Enter a real date ({calendar})} other {Enter a real date}}`,"@astryx.dateInput.outOfRangeDate":`{bounds, select, both {Enter a date from {min} to {max}} min {Enter a date on or after {min}} max {Enter a date on or before {max}} other {Enter an available date}}`},tO={year:`numeric`,month:`numeric`,day:`numeric`},nO=_m.date_long,rO={year:`numeric`},iO={era:`short`,year:`numeric`},aO={...nO,era:`long`},oO={long:{era:`long`,year:`numeric`},short:iO,narrow:{era:`narrow`,year:`numeric`}},sO=[{weekday:`long`},{weekday:`short`},{...nO,weekday:`long`},{...nO,weekday:`short`}],cO={...nO,weekday:`short`},lO=RegExp(`[\\p{L}\\p{M}]`,`u`),uO=RegExp(`[\\p{P}\\p{S}]`,`u`),dO=RegExp(`^[\\p{P}\\p{S}]+$`,`u`),fO=RegExp(`[\\d\\p{P}\\p{S}]+`,`gu`),pO=RegExp(`(\\p{Script=Latin})\\p{Mn}+`,`gu`),mO=RegExp(`[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}\\p{Script=Thai}\\p{Script=Lao}\\p{Script=Khmer}\\p{Script=Myanmar}]`,`u`),hO=new Set([`chinese`,`dangi`]),gO=new Set([`gregory`,`iso8601`,`chinese`,`dangi`]),_O={gregory:{ce:`2000-06-15`,bce:`-000100-06-15`},japanese:{meiji:`1900-06-15`,taisho:`1920-06-15`,showa:`1950-06-15`,heisei:`2000-06-15`,reiwa:`2026-06-15`},roc:{roc:`2026-06-15`,broc:`1900-06-15`},buddhist:{be:`2026-06-15`},ethiopic:{am:`2026-06-15`,aa:`-005600-06-15`},ethioaa:{aa:`2026-06-15`},coptic:{am:`2026-06-15`},persian:{ap:`2026-06-15`},hebrew:{am:`2026-06-15`},indian:{shaka:`2026-06-15`},"islamic-umalqura":{ah:`2026-06-15`},"islamic-civil":{ah:`2026-06-15`},"islamic-tbla":{ah:`2026-06-15`}};function vO(e){return e===`iso8601`||!qf(e)?`gregory`:e}function yO(e){return e.type}function bO(e){let t=/^(-?\d+)-(\d+)-(\d+)$/.exec(e);if(t==null)throw RangeError(`Bad sample date ${e}`);return{year:+t[1],month:+t[2],day:+t[3]}}function xO(e,t,n,r){return lm(r,{...n,calendar:t},e)}function SO(e,t){if(/^[\u0020-\u007e]*$/.test(e)){let n=e.replaceAll("`",`'`);return/[A-Z]/.test(n)?n.toLocaleLowerCase(t):n}let n=e.normalize(`NFKC`).replace(Nm,``).replace(/[\u202a-\u202e]/g,``).replace(/[\u05f3\u2018\u2019\u02bb\u02bc\u02bf`]/g,`'`).replace(/[\u05f4\u201c\u201d]/g,`"`),r=(Fm(n)??n).toLocaleLowerCase(t);return/[\u00c0-\u024f\u1e00-\u1eff]/.test(r)&&(r=r.normalize(`NFD`).replace(pO,`$1`).normalize(`NFC`)),r}var CO=new Map;function wO(e,t){let n=vO(t),r=`${e}|${n}`,i=CO.get(r);return i??(i=OO(e,n),CO.set(r,i)),i}function TO(e){if(Uf(e))return Array.from({length:12},(e,t)=>({code:`M${String(t+1).padStart(2,`0`)}`,ordinal:t+1,mid:{year:2026,month:t+1,day:15},monthsInYear:12}));let t=EO(e,{year:2026,month:6,day:15}),n=[];for(let r=t-1;r<=t+3;r++){let t=[];for(let n=1;n<=13;n++)for(let i of[``,`L`]){let a=`M${String(n).padStart(2,`0`)}${i}`,o=bp(e,{year:r,monthCode:a,day:1});o!=null&&t.push({code:a,start:o})}t.sort((e,t)=>Kp(t.start,e.start)),t.forEach(({code:r,start:i},a)=>{let o=ep(e,i);n.push({code:r,ordinal:a+1,mid:Wp(o.start,Math.floor(o.length/2)),monthsInYear:t.length})})}return n}function EO(e,t){let n=xO(`en`,e,rO,t).find(e=>yO(e)===`relatedYear`||e.type===`year`);return Number(SO(n?.value??``,`en`))}function DO(e){let t=[];for(let n of e){let e=yO(n)===`relatedYear`?`year`:n.type;e!==`year`&&e!==`month`&&e!==`day`||t.includes(e)||t.push(e)}return t}function OO(e,t){let n=e===`en`?[`en`]:[e,`en`],r=t=>SO(t,e).trim(),i=new Map,a=new Map,o=new Set,s=new Map,c=new Map,l=new Set,u=new Set,d=new Set,f=new Set,p=new Set,m=(e,t=l)=>{for(let n of r(e).replace(fO,` `).split(/\s+/))n&&t.add(n)},h=(e,{code:t,ordinal:n})=>{let o=r(e),s=/^(\D*)(\d+)(\D*)$/.exec(o),c=[n,Number(t.slice(1,3))].includes(Number(s?.[2]));if(!o||/\d/.test(o)&&(!lO.test(o)||c)){s!=null&&(s[1]||s[3])&&a.set(`${s[1]}#${s[3]}`,{pre:s[1],post:s[3],isLeap:t.endsWith(`L`)});return}let l=i.get(o);l??(l=new Set,i.set(o,l)),l.add(t)},g=TO(t),_=[nO,{year:`numeric`,month:`short`,day:`numeric`},tO,{month:`long`},{month:`short`}],v=new Map;for(let e of g)for(let i of n)_.forEach((n,a)=>{let s=xO(i,t,n,e.mid).find(e=>e.type===`month`)?.value;if(s==null)return;let c=`${i}|${a}|${e.code.slice(0,3)}`;if(e.code.endsWith(`L`)){let e=v.get(c);if(e!=null&&s.includes(e)&&!/\d/.test(e)){let t=r(s.replace(e,``));if(t){o.add(t);return}}}else v.set(c,s);h(s,e)});let y=[];for(let n of[tO,nO,_m.date,_m.date_weekday,cO])y.push(n,ek(e,t,n));let b=g.slice(0,14).map(e=>e.mid);for(let i of n){for(let n of y)for(let a of b){let o=xO(i,t,n,a);for(let[e,t]of o.entries())(t.type===`literal`||yO(t)===`yearName`)&&m(t.value),t.type===`literal`&&o[e-1]?.type===`year`&&m(t.value,d);if(i===e){let e=o.at(-1);if(e?.type===`literal`){let t=r(e.value).replace(/\s+/g,``);dO.test(t)&&u.add(t)}}}for(let e=0;e<7;e++){let n={year:2026,month:11,day:1+e};for(let e of sO){let a=xO(i,t,e,n).find(e=>e.type===`weekday`)?.value;a!=null&&(m(a),m(a,p),/\d/.test(r(a))&&l.add(r(a)))}}}let x=ek(e,t,tO);for(let n of xO(e,t,x,b[0])){let e=r(n.value).replace(/\s+/g,``);n.type===`literal`&&e&&f.add(e)}if(hO.has(t))for(let e=1996;e<2057;e++)for(let r of n)for(let n of xO(r,t,nO,{year:e,month:6,day:15}))yO(n)===`yearName`&&m(n.value);let S=new Map,C=t===`japanese`?[`long`,`short`,`narrow`]:[`long`,`short`];for(let[i,a]of Object.entries(_O[t]??{})){let o=bO(a);for(let e of n)for(let n of[...C.map(e=>oO[e]),...y]){let a=xO(e,t,n,o).find(e=>e.type===`era`)?.value;a!=null&&r(a)&&s.set(r(a),i)}let l=e=>kO(`en`,t,e).year,u=l(o),d=l({...o,year:o.year+1})>u,f=d?o.year-u:o.year+u;S.set(i,{base:f,isForward:d});let p={year:d?f+1:f-1,month:12,day:31};if(Uf(t)&&p.year>0){let n=xO(e,t,aO,p).find(e=>e.type===`year`)?.value;n!=null&&!/\d/.test(r(n))&&c.set(r(n),`1`)}}t===`japanese`&&S.set(`ce`,{base:0,isForward:!0});for(let e of o)l.delete(e);for(let e of[...i.keys(),...s.keys(),...c.keys()])l.delete(e);let w=!1,T=g.find(e=>e.ordinal!==Number(e.code.slice(1,3)));if(T!=null){let e=xO(`sv`,t,tO,T.mid).find(e=>e.type===`month`)?.value;w=Number(SO(e??``,`sv`).replace(/\D+/g,``))===T.ordinal}let E=new Set([...i.keys(),...s.keys(),...l,...o,...c.keys()]),D={year:2026,month:11,day:2};return{locale:e,calendar:t,order:DO(xO(e,t,tO,D)),nameOrder:DO(xO(e,t,nO,D)),months:i,monthTemplates:[...a.values()].sort((e,t)=>t.pre.length+t.post.length-(e.pre.length+e.post.length)),leapMarkers:o,eras:s,yearAliases:c,trailers:u,yearMarkers:d,separators:f,weekdays:p,vocabulary:[...E].sort((e,t)=>t.length-e.length),vocabularySet:E,isNumericMonthOrdinal:w,eraArithmetic:S}}function kO(e,t,n){let r=xO(e,t,iO,n);return{era:r.find(e=>e.type===`era`)?.value??``,year:Number(SO(r.find(e=>e.type===`year`||yO(e)===`relatedYear`)?.value??``,e))}}function AO(e,t,n=!0){let r=[],i=!1,a=0,o=e.trimEnd().length;for(;a<o;){let s=e[a];if(/\s/.test(s)){a++;continue}let c=jO(e,a,t);if(c!=null){r.push(c.token),a=c.end;continue}let l=n&&/\d/.test(s)&&MO(e,a,t);if(l){r.push(PO(l,t)),i=!0,a+=l.length;continue}if(/\d/.test(s)){let t=a;for(;t<e.length&&/\d/.test(e[t]);)t++;r.push({t:`num`,v:e.slice(a,t)}),a=t;continue}let u=MO(e,a,t);if(u!=null){r.push(PO(u,t)),a+=u.length;continue}if(uO.test(s)){let t=a;for(;t<o&&(uO.test(e[t])||/\s/.test(e[t]));)t++;r.push({t:`sep`,v:e.slice(a,t).replace(/\s+/g,``)}),a=t;continue}let d=a;for(;d<o&&lO.test(e[d]);)d++;let f=e.slice(a,d),p=NO(e,a,t);if(p!=null){r.push(PO(p,t)),a+=p.length;continue}let m=FO(f,t);if(m!=null)r.push({t:`month`,codes:m}),a=d;else return d>=o&&f&&t.vocabulary.some(e=>e.startsWith(f))?`incomplete`:`unreadable`}return i&&!r.some((e,t)=>{let n=r.slice(t+1).find(e=>e.t!==`sep`),i=n?.t===`word`&&n.isYearMarker===!0;return e.t===`num`&&Number(e.v)<=31&&!i})?AO(e,t,!1):r}function jO(e,t,n){for(let r of n.monthTemplates){if(!e.startsWith(r.pre,t))continue;let n=/^\d+/.exec(e.slice(t+r.pre.length));if(n==null)continue;let i=t+r.pre.length+n[0].length;if((!r.post||e.startsWith(r.post,i))&&(r.post||r.pre))return{token:{t:`monthNum`,v:n[0],isLeap:r.isLeap},end:i+r.post.length}}return null}function MO(e,t,n){for(let r of n.vocabulary){if(!e.startsWith(r,t))continue;let n=e[t+r.length]??``,i=r[r.length-1];if(!lO.test(n)||mO.test(n)||mO.test(i)||!lO.test(i))return r}return null}function NO(e,t,n){for(let r of n.vocabulary){if(!e.startsWith(r,t))continue;let i=t+r.length;if(n.vocabulary.some(t=>e.startsWith(t,i)))return r}return null}function PO(e,t){let n=t.weekdays.has(e.replace(fO,``)),r=t.months.get(e);if(r!=null)return{t:`month`,codes:r,isWeekday:n};let i=t.eras.get(e);if(i!=null)return{t:`era`,code:i,isWeekday:n};if(t.leapMarkers.has(e))return{t:`leap`};let a=t.yearAliases.get(e);return a==null?{t:`word`,isYearMarker:t.yearMarkers.has(e)}:{t:`num`,v:a,isAlias:!0}}function FO(e,t){if(e.length<3)return null;let n=null;for(let[r,i]of t.months)if(r.startsWith(e)){if(n!=null&&!LO(n,i))return null;n=i}return n}function IO(e){let t=e;for(let e of[[`month`,`monthNum`],[`era`]]){let n=t.filter(t=>e.includes(t.t)),r=n.find(e=>`isWeekday`in e&&e.isWeekday);n.length>1&&r!=null&&(t=t.map(e=>e===r?{t:`word`}:e))}return t}function LO(e,t){return e.size===t.size&&[...e].every(e=>t.has(e))}var RO={kind:`incomplete`},zO={kind:`unreadable`},BO={kind:`empty`};function VO(e,t,n={}){let r=SO(e,t.locale).trim();if(!r)return BO;let{isDateDisabled:i,isoIsGregorian:a=!1}=n;if(a){let e=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(r);if(e!=null)return HO(YO(+e[1],+e[2],+e[3]),!0,i)}let o=AO(r,t);if(o===`incomplete`||o===`unreadable`)return o===`incomplete`?RO:zO;let s=IO(o),c=s.filter(e=>e.t===`num`),l=s.filter(e=>e.t===`month`||e.t===`monthNum`),u=new Set(s.flatMap(e=>e.t===`era`?[e.code]:[])),d=s.some(e=>e.t===`leap`||e.t===`monthNum`&&e.isLeap);if(l.length>1||u.size>1)return zO;if(c.length===0&&l.length===0)return u.size>0?RO:zO;let f=u.size===1?[...u][0]:void 0,p=new Map,m,h,g=l[0];if(g!=null){if(g.t===`month`){if(g.codes.size!==1)return zO;m=[...g.codes][0]}else t.isNumericMonthOrdinal?h=Number(g.v):m=`M${g.v.padStart(2,`0`)}`;if(c.length===0||c.length>2)return c.length===0?RO:zO;let e=t.nameOrder.filter(e=>e!==`month`),n=c.filter(e=>e.v.length>=3&&!e.isAlias);c.length===1?e=n.length===1?[`year`]:[`day`]:n.length===1&&(e=c[0]===n[0]?[`year`,`day`]:[`day`,`year`]),c.forEach((t,n)=>p.set(t,e[n]))}else{if(c.length<2)return RO;if(c.length>3||!UO(s,t))return zO;let e=c.length===2?t.order.filter(e=>e!==`year`):t.order;if(c.length===3&&e[0]!==`year`&&c[0].v.length>=3&&(e=[`year`,`month`,`day`]),c.length===2&&c.some(e=>e.v.length>=3))return RO;c.forEach((t,n)=>p.set(t,e[n]))}let _=e=>c.find(t=>p.get(t)===e),v=_(`day`),y=_(`year`),b=_(`month`);if(v==null)return RO;b!=null&&(t.isNumericMonthOrdinal?h=Number(b.v):m=`M${String(Number(b.v)).padStart(2,`0`)}`),m!=null&&d&&!m.endsWith(`L`)&&(m+=`L`);let x=Number(v.v),S=h??Number(m?.slice(1,3)??0);if(x<1||x>31||S<1||S>13)return[v,b].some(e=>e?.v===`0`)?RO:zO;let C=n.today??Bp(),w={day:x};m==null?w.month=h:w.monthCode=m;let T=!1;if(y==null)JO(w,t,C);else{let e=y.isAlias?1:y.v.length,n=Number(y.v),r=WO(s)===y,{calendar:i}=t;if(f!=null)w.era=f,w.eraYear=n,T=!0;else if(i===`japanese`&&e<=2){let e=qO(t,C);if(e==null)return zO;w.era=e,w.eraYear=n,T=!r}else if(i===`japanese`&&e===4)w.era=`ce`,w.eraYear=n,T=!0;else if(i===`roc`)w.era=`roc`,w.eraYear=n,T=e>=4||!r;else if(e===2)w.year=KO(n,EO(i,C));else if(e>=4)w.year=n,T=!0;else return RO}let E=XO(t,w);return HO(E,y!=null&&T&&GO(s,t,p,E),i)}function HO(e,t,n){return e==null?{kind:`nonexistent`,isComplete:t}:n?.(e)?{kind:`outOfRange`,date:e,isComplete:t}:{kind:`value`,date:e,isComplete:t}}function UO(e,t){let n=null,r=!1,i=null;for(let a of e)if(a.t===`num`){if(r){let e=i??``;if(n!=null&&e!==n&&!(t.separators.has(e)&&t.separators.has(n)))return!1;n=e}r=!0,i=null}else a.t===`sep`?i=a.v:(i=null,r=!1,n=null);return!0}function WO(e){let t=e.filter(e=>e.t!==`sep`).at(-1);return t?.t===`num`?t:void 0}function GO(e,t,n,r){let i=e.at(-1);if(i==null)return!1;if(i.t===`sep`)return t.trailers.has(i.v);if(i.t!==`num`)return!0;let a=n.get(i);if(a===`year`||i.v.length>=2)return!0;let o=Number(i.v);if(a===`day`)return o*10>31;let s=r==null?13:xp(t.calendar,r);return o*10>s}function KO(e,t){let n=t-t%100+e;return n>t+19?n-=100:n<t-80&&(n+=100),n}function qO(e,t){let{era:n}=kO(`en`,e.calendar,t);return e.eras.get(SO(n,e.locale).trim())}function JO(e,t,n){if(t.eraArithmetic.size>0&&!gO.has(t.calendar)){let{era:r,year:i}=kO(`en`,t.calendar,n),a=t.eras.get(SO(r,t.locale).trim());if(a!=null){e.era=a,e.eraYear=i;return}}e.year=EO(t.calendar,n)}function YO(e,t,n){return e<1||e>9999||t<1||t>12||n<1||n>Vp(e,t)?null:{year:e,month:t,day:n}}function XO(e,t){let{calendar:n}=e;if(!Uf(n)){let e=bp(n,Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)));return e!=null&&e.year>=1&&e.year<=9999?e:null}if(t.monthCode?.endsWith(`L`))return null;let r=t.month??Number(t.monthCode?.slice(1,3)),i;if(t.era!=null){let n=e.eraArithmetic.get(t.era);if(n==null||t.eraYear==null||t.eraYear<1)return null;i=n.isForward?n.base+t.eraYear:n.base-t.eraYear}else{let r=n===`buddhist`?`be`:`ce`;i=(e.eraArithmetic.get(r)?.base??0)+(t.year??0)}let a=YO(i,r,t.day);if(a==null||n!==`japanese`||t.era===`ce`)return a;let o=kO(`en`,n,a);return e.eras.get(SO(o.era,e.locale).trim())===t.era&&o.year===t.eraYear?a:null}var ZO=new WeakMap,QO=new Map;function $O(e){let t=QO.get(e);if(t==null){let n=t=>kO(`en`,e,t).era;t=n({year:1900,month:1,day:1})!==n({year:2100,month:12,day:31}),QO.set(e,t)}return t}function ek(e,t,n){if(gO.has(t))return n;let r=ZO.get(n);r??(r=new Map,ZO.set(n,r));let i=`${e}|${t}`,a=r.get(i);if(a==null){let o={year:2026,month:11,day:2},s=xO(e,t,n,o);a=n;let c=DO(s).join();if(!s.some(e=>e.type===`era`)){let r=$O(t)?[`short`,`narrow`]:[`short`];for(let i of r){let r={...n,era:i};if(DO(xO(e,t,r,o)).join()===c){a=r;break}}}r.set(i,a)}return a}function tk(e,t,n,r){if(hO.has(r))return hp(r,e,t,n,{relatedYear:!0});let i=ek(n,r,t),a=cm(e,{...i,calendar:r},n),o=e=>kO(`en`,r,e).era;if(!$O(r)||o(e)===o({year:9999,month:12,day:31})||xO(n,r,i,e).some(e=>e.type===`era`))return a;let s=xO(n,r,{...t,era:`short`},e),c=s.findIndex(e=>e.type===`era`),l=s.slice(c===0?0:c-1,c===0?2:c+1).map(e=>e.value).join(``);return c===0?l+a:a+l}function nk(e,t,n,r){let i=vO(r);return t===`system_date`||i===`gregory`?vm(e,t,n):tk(e,_m[t],n,i)}function rk(e,t,n){return tk(e,tO,t,vO(n))}function ik(e,t){try{return new Intl.DisplayNames(t,{type:`calendar`}).of(e)??e}catch{return e}}ht(eO);function ak(e,t,n){return t!=null&&Jp(e,Ip(t))||n!=null&&Yp(e,Ip(n))}function ok(e,t,n){return e==null?null:(e.kind===`unreadable`||e.kind===`incomplete`)&&t?`unreadable`:(e.kind===`nonexistent`||e.kind===`outOfRange`)&&(t||e.isComplete&&n===`complete`)?e.kind:null}function sk(e){return e.kind===`value`&&e.isComplete}function ck(e,t,n,r,i,a){let o=ok(e,t,a);return o==null||e==null?null:e.kind===`incomplete`?{kind:`incomplete`,text:n}:e.kind===`outOfRange`?{kind:ak(e.date,r,i)?`outOfRange`:`unavailable`,text:n,date:Lp(e.date)}:{kind:o,text:n}}function lk({source:e,calendar:t,format:n,min:r,max:i,isDateDisabled:a}){let o=at(),s=Am(),c=km(t,e),l=km(void 0,e),u=Hf(c),d=(0,Z.useCallback)(()=>{wO(s,c)},[s,c]),f=(0,Z.useCallback)(e=>{let t=VO(e,wO(s,c),{isoIsGregorian:n===`system_date`,isDateDisabled:a});if(!u||t.kind!==`unreadable`&&t.kind!==`nonexistent`)return t;let r=Sm(e,s);return r==null?t:a(r)?{kind:`outOfRange`,date:r,isComplete:!1}:{kind:`value`,date:r,isComplete:!1}},[s,c,n,a,u]),p=(0,Z.useCallback)(e=>typeof n==`function`?n(e):nk(Ip(e),n,s,c),[n,s,c]),m=(0,Z.useCallback)(()=>{if(u)return null;let e=Qp(Bp(),{min:r==null?null:Ip(r),max:i==null?null:Ip(i),isDateDisabled:a});return o(`@astryx.dateInput.formatHint`,{example:rk(e,s,c)})},[u,o,s,c,r,i,a]),h=(0,Z.useMemo)(()=>ik(c,s),[c,s]),g=u?Hf(l):c===l,_=(0,Z.useCallback)(e=>{if(e.kind===`nonexistent`)return o(`@astryx.dateInput.nonexistentDate`,{named:g?`no`:`yes`,calendar:h});if(e.kind===`outOfRange`){let t=typeof n==`function`?`date_long`:n,a=e=>nk(Ip(e),t,s,c),l=ak(e.date,r,i)?r!=null&&i!=null?`both`:r==null?`max`:`min`:`none`;return o(`@astryx.dateInput.outOfRangeDate`,{bounds:l,min:r==null?``:a(r),max:i==null?``:a(i)})}return o(`@astryx.dateInput.invalidDate`)},[o,g,h,n,s,c,r,i]);return{calendar:c,prepare:d,parse:f,formatCommitted:p,getFormatHint:m,calendarDescription:g?null:o(`@astryx.dateInput.calendarDescription`,{calendar:h}),errorMessage:_}}function uk({value:e,shownValue:t,onChange:n,onClear:r,onTypedDate:i,isDisabled:a,status:o,isStatusAnnounced:s,onEntryErrorChange:c,hasPlaceholder:l,entryErrorBehavior:u,...d}){let f=lk(d),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(0),[y,b]=(0,Z.useState)(null),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)({date:void 0,epoch:0}),[T,E]=(0,Z.useState)(0),D=C.epoch===T?C.date:void 0,O=p!==null&&p.trim()?f.parse(p):null,k=ok(O,h,u),A=k==null&&y!==null&&O!=null&&!sk(O)?f.parse(y):null,j=a?null:k!=null&&O!=null&&p!==null?{text:p,result:O}:A!=null&&y!==null&&ok(A,!0,u)!=null?{text:y,result:A}:null,ee=j==null?null:f.errorMessage(j.result),M=j==null?null:ck(j.result,!0,j.text,d.min,d.max,u),N=j?.text??null,P=h&&O?.kind===`unreadable`,{fieldStatus:F,alertMessage:I,reportEntryError:L}=eh({entryError:M,rejectionMessage:ee,status:o,isStatusAnnounced:s,callerErrorPrecedence:`withCallback`,onEntryErrorChange:c}),R=(0,Z.useCallback)(()=>{m(null),g(!1),b(null),L(null)},[L]),z=th(e,_),[te,B]=(0,Z.useState)(e);e!==te&&(B(e),e!==D&&(E(e=>e+1),p!==null&&z&&(m(null),g(!1),b(null))));let[ne,re]=(0,Z.useState)(a);a!==ne&&(re(a),!a&&!x&&O?.kind===`value`&&Lp(O.date)===D&&(E(e=>e+1),m(null),g(!1),b(null)));let ie=(0,Z.useCallback)(t=>t===e||t===D?!1:(w({date:t,epoch:T}),n(t),!0),[e,D,T,n]),V=(0,Z.useCallback)(e=>{if(a)return;let t=f.parse(e),n=!e.trim(),r=n?null:ck(t,!1,e,d.min,d.max,u),o=r!=null||n||sk(t)?null:N;if(m(e),g(!1),b(o),L(r??(o===null?null:M)),t.kind===`value`&&t.isComplete){let e=Lp(t.date);ie(e)&&i?.(e)}},[a,f,N,M,L,d.min,d.max,u,ie,i]),ae=(0,Z.useCallback)(()=>{if(p===null||a)return;if(!p.trim()){r(),R();return}let e=f.parse(p);e.kind===`unreadable`||e.kind===`incomplete`||e.kind===`nonexistent`||e.kind===`outOfRange`?(g(!0),v(e=>e+1),b(null),L(ck(e,!0,p,d.min,d.max,u))):(e.kind===`value`&&ie(Lp(e.date)),w({date:void 0,epoch:T}),R())},[p,a,r,f,L,d.min,d.max,u,ie,R,T]),H=(0,Z.useCallback)(()=>{S(!0),f.prepare()},[f]),U=(0,Z.useCallback)(()=>{S(!1),ae()},[ae]),W=t!=null&&/^\d{4}-\d{2}-\d{2}$/.test(t)?f.formatCommitted(t):``,oe=p??W;return{typedDate:f,displayValue:oe,formatHint:!l&&x&&!oe?f.getFormatHint():null,isPending:p!==null&&!P,hiddenFormValue:P?W:null,isInvalid:j!=null,fieldStatus:F,alertMessage:I,handleChange:V,commit:ae,handleFocus:H,handleBlur:U,reset:R}}var dk={held:null,shown:null};function fk({value:e,isLocked:t,status:n,hasEntryErrorCallback:r,isStatusAnnounced:i,...a}){let o=lk({...a,calendar:`gregory`}),[s,c]=(0,Z.useState)(dk),[l,u]=(0,Z.useState)(0);th(e,l)&&s!==dk&&c(dk);let d=(0,Z.useCallback)(e=>{let t=Lp(e);c(e=>e.held===t?e:{...e,held:t})},[]),f=(0,Z.useCallback)(()=>c(dk),[]),p=(0,Z.useCallback)(()=>{t||(u(e=>e+1),c(e=>e.held===null?e:{held:null,shown:e.held}))},[t]),m=!t&&s.shown!==null?o.errorMessage({kind:`outOfRange`,date:Ip(s.shown),isComplete:!0}):null,h=r&&n?.type===`error`&&n.message?n.message:null,g=m!=null,[_,v]=(0,Z.useState)({isRejected:!1,message:null});_.isRejected===g?_.message!==null&&_.message!==h&&v({isRejected:g,message:null}):v({isRejected:g,message:g?h:null});let y=``;return m!=null&&(i?h!=null&&h===_.message&&(y=h):y=h??m),{message:m,fieldStatus:m!=null&&h==null?{type:`error`,message:m}:n,alertMessage:y,isRefused:s!==dk,refuse:d,clear:f,commit:p}}ht({"@astryx.dateInput.clear":`Clear {label}`,"@astryx.dateInput.openCalendar":`Open calendar`,"@astryx.dateInput.placeholder":`Select a date`,"@astryx.spinner.loading":`Loading`});var pk={wrapper:{kOIVth:`x1txdalj`,$$css:!0},iconButton:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk x16khyan`,kaIpWk:`xh6dtrn`,$$css:!0},iconButtonDisabled:{kkrTdU:`xt0e3qv`,$$css:!0}},mk={sm:{kZKoxP:`x6k0iem`,k7Eaqz:`xfb3i0g`,$$css:!0},md:{kZKoxP:`x1ueg155`,k7Eaqz:`xfb3i0g`,$$css:!0},lg:{kZKoxP:`xssyfek`,k7Eaqz:`xfb3i0g`,$$css:!0}},hk=/^\d{4}-\d{2}-\d{2}$/;function gk({label:e,isLabelHidden:t=!1,description:n,isOptional:r=!1,isRequired:i=!1,isDisabled:a=!1,disabledMessage:o,value:s,onChange:c,changeAction:l,isLoading:u=!1,min:d,max:f,dateConstraints:p,placeholder:m,size:h,status:g,onEntryErrorChange:_,statusVariant:v=`attached`,labelTooltip:y,hasClear:b=!1,numberOfMonths:x,weekStartsOn:S,format:C=`date_long`,width:w,containerXstyle:T,containerClassName:E,containerStyle:D,controlXstyle:O,controlClassName:k,controlStyle:A,ref:j,...ee}){let{rest:M,container:N}=ze(`DateInput`,ee,{containerXstyle:T,containerClassName:E,containerStyle:D}),{id:P,"aria-describedby":F,"aria-labelledby":I,onFocus:L,onBlur:R,onKeyDown:z,...te}=M,B=at(),ne=Am(),re=li({isRequired:i,isOptional:r}),ie=m??B(`@astryx.dateInput.placeholder`),V=aa(h,`md`),ae=la(`(pointer: coarse)`),H=(0,Z.useId)(),U=P??H,W=(0,Z.useId)(),G=(0,Z.useId)(),K=(0,Z.useId)(),se=(0,Z.useId)(),q=(0,Z.useRef)(null),ce=Vt(j,q),le=ca(),[,ue]=(0,Z.useTransition)(),[de,fe]=(0,Z.useOptimistic)(s),pe=u||de!==s;pi(pe,B(`@astryx.spinner.loading`),q);let me=a||u,he=a&&!!o,ge=Ki({placement:`above`,focusTrigger:`always`,isEnabled:he}),{isDateDisabled:_e}=xD({min:d,max:f,dateConstraints:p}),ve=fk({source:`DateInput`,format:C,min:d,max:f,isDateDisabled:_e,value:s,isLocked:me||pe,status:g,hasEntryErrorCallback:_!=null,isStatusAnnounced:!le}),{fieldStatus:Y}=ve,be=ve.message==null,{statusIcon:xe,describedBy:Se}=Be({status:Y,statusVariant:v,isInGroup:!!le}),{ariaLabelledBy:Ce,ariaDescribedBy:we}=qe(G,[n?K:null,v!==`tooltip`&&Y?.message?se:null,Se,he?ge.describedBy:null,F],le),[Te,Ee]=(0,Z.useState)(!1),[De,Oe]=(0,Z.useState)(!1),ke=(0,Z.useRef)(null),[Ae,je]=(0,Z.useState)(s),[Me,Ne]=(0,Z.useState)(0);s!==Ae&&(je(s),Ne(e=>e+1));let Pe=de&&hk.test(de)?de:``,Ie=(0,Z.useCallback)(e=>typeof C==`function`?C(e):vm(Ip(e),C,ne),[C,ne]),Re=Pe?Ie(Pe):ie,Ue=!!Re&&!(Te&&De),We=(0,Z.useCallback)(e=>{pe||(c?.(e),l&&ue(async()=>{fe(e),await l(e)}))},[pe,c,l,ue,fe]),Ge=(0,Z.useCallback)(e=>{if(me||pe)return;let t=ke.current;if(t!==null&&t.epoch===Me&&t.text===e)return;if(ke.current={text:e,epoch:Me},!e){ve.clear(),s!==void 0&&We(void 0);return}let n=Sm(e,ne);if(!n)return;if(_e(n)){ve.refuse(n);return}ve.clear();let r=Lp(n);r!==s&&We(r)},[s,Me,We,_e,me,pe,ne,ve]),Ke=(0,Z.useCallback)(e=>{Ge(e.target.value)},[Ge]),Je=(0,Z.useRef)(Ge);(0,Z.useEffect)(()=>{Je.current=Ge}),(0,Z.useEffect)(()=>{let e=q.current;if(!e)return;let t=()=>Je.current(e.value);return e.addEventListener(`input`,t),e.addEventListener(`change`,t),()=>{e.removeEventListener(`input`,t),e.removeEventListener(`change`,t)}},[]);let Ye=(0,Z.useRef)(null);Ye.current===null&&(Ye.current=Pe),(0,Z.useEffect)(()=>{if(Te)return;let e=q.current;e&&e.value!==Pe&&(e.value=Pe)},[Te,Pe]);let Ze=(0,Z.useCallback)(()=>{Oe($D(ae)),Ee(!0)},[ae]),Qe=(0,Z.useCallback)(()=>{let e=q.current?.value;Ee(!1),e!==void 0&&e!==Pe&&Ge(e),ve.commit()},[Ge,Pe,ve]),$e=(0,Z.useCallback)(e=>{e.key===`Enter`&&ve.commit()},[ve]),et=(0,Z.useCallback)(()=>{We(void 0)},[We]),nt=(0,Z.useCallback)(()=>{if(me)return;let e=q.current;if(e&&(e.focus(),typeof e.showPicker==`function`))try{e.showPicker()}catch{}},[me]),ot=(0,Q.jsxs)(`div`,{ref:e=>{ge.ref(e)},...le?$i:void 0,...hn(ye(`date-input`,{size:V,status:Y?.type??null,disabled:a?`disabled`:null}),J(Le.base,Le.textField,mk[V],pk.wrapper,a&&Le.disabled,me&&Xe.inputFocusRing,Y&&Fe[Y.type],Y&&!me&&it[Y.type],Y&&tt[Y.type],le&&sa.inGroup,O),k,A),children:[le&&(0,Q.jsx)(St,{id:G,children:e}),(0,Q.jsx)(`button`,{type:`button`,onClick:nt,"aria-disabled":me||void 0,"aria-label":B(`@astryx.dateInput.openCalendar`),tabIndex:-1,...J(oe.focusVisible,pk.iconButton,me&&pk.iconButtonDisabled),children:(0,Q.jsx)(mt,{icon:`calendar`,size:`sm`,color:`secondary`,...ye(`date-input-toggle-icon`,{state:`collapsed`})})}),(0,Q.jsxs)(`span`,{className:`x1n2onr6 x78zum5 x6s0dn4 x98rzlu xeuugli`,children:[(0,Q.jsx)(`input`,{...te,onClick:me?void 0:te.onClick,ref:ce,id:U,type:`date`,defaultValue:Ye.current??``,onChange:Ke,onFocus:fi(Ze,L),onBlur:fi(Qe,R),onKeyDown:fi($e,z),min:d,max:f,"aria-disabled":me?`true`:void 0,readOnly:me||void 0,"aria-labelledby":I==null?Ce:He(Ce??W,I),"aria-describedby":we,"aria-required":re?`true`:void 0,"aria-invalid":Y?.type===`error`||!be?`true`:void 0,"aria-busy":pe||void 0,...{0:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3`},4:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 x19co3pv xg7jpbn`},2:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 xt0e3qv`},6:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 x19co3pv xg7jpbn xt0e3qv`},1:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 xv1l7n4`},5:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 xg7jpbn xv1l7n4`},3:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 xt0e3qv xv1l7n4`},7:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz x1mutkkf x9w4715 x1lugfcp xjyslct xolhmmf x9rmy9g xpsyfx0 x1qqcexc x1x4c3m6 xkqr7wz x1f74mqm xec4aax xtbxizx xslb4at x15bqym3 xg7jpbn xt0e3qv xv1l7n4`}}[!!Ue<<2|!!me<<1|!be]}),Ue&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv xv1l7n4`},4:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv x1tgivj0`},2:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv xv1l7n4 xt0e3qv`},6:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv x1tgivj0 xt0e3qv`},1:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv xv1l7n4`},5:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv xv1l7n4`},3:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv xt0e3qv xv1l7n4`},7:{className:`x10l6tqk x1o0tod xtijo5x x10no89f x1lliihq xjm74w1 xf9zqsd xw6l6zx x47corl xb3r6kr xuxw1ft xlyipyv xt0e3qv xv1l7n4`}}[!!Pe<<2|!!me<<1|!(be||!Pe)],children:Re})]}),(0,Q.jsx)(St,{as:`div`,role:`alert`,"aria-live":`assertive`,children:ve.alertMessage}),b&&s!==void 0&&!me&&!pe&&(0,Q.jsx)(Ve,{label:B(`@astryx.dateInput.clear`,{label:e}),onClick:et}),pe&&(0,Q.jsx)(wt,{size:`sm`,"aria-hidden":`true`}),xe,he&&ge.renderTooltip(o)]});return le?ot:(0,Q.jsx)(rt,{...N,label:e,isLabelHidden:t,description:n,inputID:U,labelID:I==null?void 0:W,descriptionID:n?K:void 0,isOptional:r,isRequired:i,isDisabled:a,status:Y?{type:Y.type,message:Y.message,messageID:Y.message?se:void 0}:void 0,statusVariant:v,labelTooltip:y,width:w,children:ot})}gk.displayName=`NativeDateField`;var _k=/^(\d+(?:\.\d+)?|\.\d+)(px|%)$/i;function vk(e,t){if(typeof e==`number`)return Number.isFinite(e)&&e>0&&e<=1?e*t:null;let n=_k.exec(e.trim());if(n===null)return null;let r=Number.parseFloat(n[1]);return r>0?n[2].toLowerCase()===`%`?r/100*t:r:null}function yk(e){return vk(e,1)!==null}function bk(e,t){let n=[];for(let r of e){let e=vk(r,t);e!==null&&n.push(e)}return n}function xk(e,t,n=48){let r=[0,...t.filter(t=>t>0&&t<e).map(t=>e-t)].sort((e,t)=>e-t),i=[];for(let e of r){let t=i[i.length-1];(t===void 0||e-t>=n)&&i.push(e)}return i}function Sk(e,t){return t.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t,t[0])}var Ck=.3;function wk(e,t){if(e.length<2||t<=0)return null;let n=e[e.length-1];return t-n<=.25*t?n:null}function Tk(e,t,n,r){let i=r!==null,a=i?t[t.length-2]:t[t.length-1],o=i?r:n,s=i?Ck:0;return e<=a?1:e>=o?s:1-(1-s)*((e-a)/(o-a))}function Ek(e,t,n,r){let i=t;if(n>0){let e=t.filter(e=>e>=r);e.length>0&&(i=e)}else if(n<0){let e=t.filter(e=>e<=r);e.length>0&&(i=e)}return Sk(e,i)}var Dk={release:{fastSpeed:1008,projectionSeconds:.1,minProjectionSpeed:250,detentTolerance:1}},Ok=.998/.0020000000000000018,kk=48,Ak=.4,jk=40;function Mk(e){return e.syntheticTouch===!0}function Nk(e){return e.touchType===`stylus`?`pen`:`touch`}var Pk=.35,Fk=4,Ik=8;function Lk(){typeof navigator<`u`&&typeof navigator.vibrate==`function`&&(tA()||navigator.vibrate(8))}function Rk(e,t){let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}if(r>=jk)return e;let i=r/jk,a=1-i*i;return e+(n-e)*a}function zk(e,t,n){return Math.max(0,e-t-n)}function Bk(e,t){return`${Math.max(0,e-Math.max(0,t))}px`}function Vk(e){return e>0?`${e}px`:void 0}function Hk(e){let t=Number.parseFloat(getComputedStyle(e).paddingBlockEnd);return Number.isFinite(t)?t:0}function Uk(e){if(!e)return 0;let t=Hk(e);return Math.max(0,e.scrollHeight-e.clientHeight-t)-e.scrollTop}function Wk(e){if(e.scrollHeight-e.clientHeight<=1)return!1;let{overflowY:t}=getComputedStyle(e);return t===`auto`||t===`scroll`}function Gk(e,t){for(let n=e instanceof Element?e:null;n!=null&&n!==t;n=n.parentElement)if(n.localName===`dialog`)return!0;return!1}function Kk(e,t){let n=[];for(let r=e instanceof Element?e:null;r!=null&&r!==t;r=r.parentElement)r instanceof HTMLElement&&Wk(r)&&n.push(r);return n.push(t),n}function qk(e){return e.scrollTop<=0}function Jk(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-1}function Yk(e){return e.every(qk)}function Xk(e){return e.every(Jk)}function Zk(e){return e.some(e=>e.scrollHeight-e.clientHeight>1)}function Qk(e){let t=e.map(e=>e.style.overscrollBehaviorY);for(let t of e)t.style.overscrollBehaviorY=`none`;return()=>{e.forEach((e,n)=>{e.style.overscrollBehaviorY=t[n]})}}function $k(e){e?.releaseContentHold!=null&&(e.releaseContentHold(),e.releaseContentHold=null)}function eA(e,t,n){return Math.max(0,e-n-t)}function tA(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function nA({isOpen:e,isOpenRequested:t=e,canDismiss:n=!0,offscreenBlockEndInset:r=0,onDismiss:i,snapHeights:a,onSnap:o,onTravelStart:s,onScrimOpacity:c,hasFixedHeight:l=!1}){let[u,d]=(0,Z.useState)(0),[f,p]=(0,Z.useState)(0),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(0);g!=null&&(g.pending?t?(_(null),y(e=>e+1)):_({...g,pending:!1}):t&&_(null));let b=g!=null&&!g.pending&&!t,x=b&&g.isTouch,S=b?g.exit:null,[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(0),[D,O]=(0,Z.useState)(0),[k,A]=(0,Z.useState)(0),j=(0,Z.useRef)(0),ee=(0,Z.useRef)(0),[M,N]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(!1),I=(0,Z.useRef)(0),L=(0,Z.useRef)(null),R=(0,Z.useRef)(null),z=(0,Z.useRef)(r);z.current=Math.max(0,r);let te=(0,Z.useCallback)(e=>{let t=Math.max(0,e);j.current=t,A(t)},[]),B=(0,Z.useCallback)(e=>{let t=Math.max(0,e);Math.abs(t-I.current)>.5&&(I.current=t,O(t))},[]),ne=(0,Z.useCallback)(()=>{F(!0),L.current=null,N(null);let e=R.current;R.current=null,e!=null&&B(e)},[B]),re=(0,Z.useCallback)((e,t,n,r,i,a,o)=>{let s=zk(e,n,a);o&&Math.abs(r-t)>.5&&!tA()?(R.current=s,L.current=i,N(i)):(R.current=null,L.current=null,N(null),F(Math.abs(i-n)>.5),B(s))},[B]),ie=(0,Z.useRef)(0);m||(ie.current=f);let V=(0,Z.useRef)(e);V.current=e;let ae=ve(a),H=(0,Z.useRef)(s);H.current=s;let U=(0,Z.useRef)(i),W=(0,Z.useRef)(n),oe=(0,Z.useRef)(o),G=(0,Z.useRef)(c),K=(0,Z.useRef)(l);(0,Z.useEffect)(()=>{U.current=i,W.current=n,oe.current=o,G.current=c,K.current=l});let se=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=se.current;v!==0&&e!=null&&(se.current=null,G.current?.(e))},[v]);let q=(0,Z.useRef)(null),ce=(0,Z.useRef)(0),le=(0,Z.useRef)(null),ue=(0,Z.useRef)(null),de=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{if(!P)return;le.current?.offsetHeight;let e=requestAnimationFrame(()=>{F(!1)});return()=>cancelAnimationFrame(e)},[P]);let fe=(0,Z.useCallback)(e=>{e<=0||!V.current||ie.current>0||(ce.current=e,E(t=>t===e?t:e))},[]),J=(0,Z.useCallback)(e=>{if(de.current?.disconnect(),de.current=null,le.current=e,!e||typeof ResizeObserver>`u`){e&&fe(e.getBoundingClientRect().height);return}let t=new ResizeObserver(e=>{let t=e[0];if(t){let e=t.borderBoxSize?.[0]?.blockSize;fe(e??t.target.getBoundingClientRect().height)}});t.observe(e),de.current=t},[fe]);(0,Z.useEffect)(()=>()=>de.current?.disconnect(),[]),(0,Z.useEffect)(()=>{e&&(d(0),p(0),h(!1),w(!1),F(!1),te(0),ee.current=0,I.current=0,L.current=null,R.current=null,O(0),N(null))},[e,te]);let pe=(0,Z.useCallback)(()=>ce.current>0?ce.current:le.current?.getBoundingClientRect().height??0,[]),me=(0,Z.useCallback)(e=>{let t=eA(e,0,z.current),n=xk(t,ae.current?.()??[]);return{offsets:n,peekOffset:wk(n,t)}},[ae]),he=(0,Z.useCallback)(()=>{let e=le.current;if(!e)return ce.current;let t=e.style.height;if(t===``)return e.getBoundingClientRect().height;e.style.height=``;let n=e.getBoundingClientRect().height;return e.style.height=t,n},[]),ge=(0,Z.useCallback)(()=>{if(!V.current||q.current!=null||L.current!=null)return;let e=he();if(e<=0)return;let{offsets:t,peekOffset:n}=me(e),r=Math.min(ee.current,t.length-1),i=t[r],a=i===n?0:i,o=j.current;if(e===ce.current&&Math.abs(i-ie.current)<=.5&&Math.abs(a-o)<=.5)return;ce.current=e,E(e),ee.current=r,re(o,i,a,i,o,Uk(ue.current),!1),te(a),p(i),oe.current?.(eA(e,i,z.current));let s=t[t.length-1],c=eA(e,s,z.current);G.current?.(Tk(i,t,s+c*Ak,n))},[he,re,te,me]);(0,Z.useEffect)(()=>{if(e&&typeof window<`u`)return window.addEventListener(`resize`,ge),window.addEventListener(`orientationchange`,ge),()=>{window.removeEventListener(`resize`,ge),window.removeEventListener(`orientationchange`,ge)}},[e,ge]);let _e=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{_e.current?ge():_e.current=!0},[ge,a]);let ye=(0,Z.useCallback)((e,t)=>{let n=le.current;if(n==null)return;let r=e-t;n.style.transform=r===0?``:`translateY(${r}px)`},[]),be=(0,Z.useCallback)((e,t)=>{let n=le.current;n!=null&&e>0&&!K.current&&(n.style.height=Bk(e,t));let r=ue.current;r!=null&&(r.style.paddingBlockEnd=Vk(I.current)??``)},[]),xe=(0,Z.useCallback)(e=>{let t=q.current;if(t==null)return;q.current=null,e?.hasPointerCapture?.(t.pointerId)&&e.releasePointerCapture(t.pointerId),d(t.baseOffset),h(!1),w(!1),re(t.baseLayoutOffset,t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,!0);let{offsets:n,peekOffset:r}=me(t.height),i=n[n.length-1],a=i+eA(t.height,i,z.current)*Ak;G.current?.(Tk(t.baseOffset,n,a,r))},[re,me]);(0,Z.useEffect)(()=>{if(!e)return;let t=()=>xe(),n=()=>{document.visibilityState===`hidden`&&xe()};return window.addEventListener(`blur`,t),document.addEventListener(`visibilitychange`,n),()=>{window.removeEventListener(`blur`,t),document.removeEventListener(`visibilitychange`,n)}},[xe,e]);let Se=(0,Z.useCallback)((e,t,n,r,i,a,o,s,c,l,u)=>{let{offsets:d,peekOffset:f}=me(n),m=d[d.length-1],h=eA(n,m,z.current),g=m+h*Ak,v=i>kk?e+t*Ok:e,y=e=>{let t=e===f?0:e;re(o,e,t,s,c,l,!0),te(t),ee.current=Math.max(0,d.indexOf(e)),p(e),oe.current?.(eA(n,e,z.current)),G.current?.(Tk(e,d,g,f)),e!==a&&Lk()},b=e=>{W.current?(re(o,a,o,o,o,l,!1),se.current=Tk(a,d,g,f),_({isTouch:u,pending:!0,exit:e}),U.current()):y(m)};if(u){let{fastSpeed:r,minProjectionSpeed:o,projectionSeconds:s,detentTolerance:c}=Dk.release,l=[...d,m+h],{index:u}=ka({points:l,position:e,velocity:t*1e3,flickThreshold:i>Ik?r:1/0,tolerance:c,flickPastProjection:!0,projection:{seconds:s,minSpeed:o},start:a});u===l.length-1?b({distance:Math.max(0,n-e),velocity:t*1e3}):y(l[u])}else r>0&&v>g?b(null):y(Ek(Math.min(Math.max(v,0),m),d,r,a))},[re,te,me]),Ce=(0,Z.useCallback)((e,t,n,r=new Ta)=>{let i=e.currentTarget,a=Mk(e);a||i.setPointerCapture?.(e.pointerId);let o=n??e.clientY,s=Uk(ue.current),c=j.current;r.add(0,e.clientY,e.timeStamp),q.current={syntheticTouch:a,pointerType:e.pointerType,pointerId:e.pointerId,startCoord:o,tracker:r,height:t,reserve:z.current,baseOffset:f,baseLayoutOffset:c,renderedOffset:f,layoutOffset:c,naturalEndGap:s,hasTraveled:!1},B(zk(c,c,s)),d(f),h(!0)},[f,B]),we=(0,Z.useCallback)(e=>{e.button===0&&e.isPrimary&&(e.preventDefault(),Ce(e,pe()))},[Ce,pe]),Te=(0,Z.useCallback)(e=>{q.current!=null&&(e.preventDefault(),xe(e.currentTarget))},[xe]),Ee=(0,Z.useCallback)(e=>{q.current?.syntheticTouch||q.current?.pointerId===e.pointerId&&xe()},[xe]),De=(0,Z.useCallback)(e=>{let t=q.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!Mk(e))return;let n=e.clientY-t.startCoord;t.tracker.add(0,e.clientY,e.timeStamp);let{offsets:r,peekOffset:i}=me(t.height),a=t.baseOffset+n,o=r[r.length-1],s;s=a<0?t.pointerType===`touch`?Math.max(-t.reserve,I_(a,t.height-t.reserve,Y.rubberBand.coefficient)):Math.max(-48,a*Pk):a>o?a:Rk(a,r);let c=s<t.baseOffset?0:t.baseLayoutOffset,l=c!==t.layoutOffset;t.renderedOffset=s,t.layoutOffset=c,ie.current=s,B(zk(t.baseLayoutOffset,c,t.naturalEndGap)),ye(s,c),l&&(be(t.height,c),d(s)),!t.hasTraveled&&s!==t.baseOffset&&(t.hasTraveled=!0,w(!0),H.current?.());let u=r[r.length-1],f=u+eA(t.height,u,z.current)*Ak;G.current?.(Tk(s,r,f,i))},[me,B,be,ye]),Oe=(0,Z.useCallback)(e=>{let t=q.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!Mk(e))return;let n=e.currentTarget,r=e.clientY-t.startCoord,i=Math.max(0,t.baseOffset+r),a=r===0?0:r>0?1:-1;t.tracker.lastSample?.y!==e.clientY&&t.tracker.add(0,e.clientY,e.timeStamp);let o=t.tracker.velocity(e.timeStamp).y/1e3;q.current=null,t.syntheticTouch||n.releasePointerCapture?.(e.pointerId),h(!1),w(!1),Se(i,o,t.height||1,a,Math.abs(r),t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,t.pointerType===`touch`)},[Se]),ke=(0,Z.useRef)(null),Ae=(0,Z.useCallback)(e=>{if(e.button!==0||!e.isPrimary)return;let t=e.currentTarget;if(Gk(e.target,t)){ke.current=null;return}let n=Kk(e.target,t);if(!Yk(n)){ke.current=null;return}let r=new Ta;r.add(0,e.clientY,e.timeStamp),ke.current={pointerId:e.pointerId,startCoord:e.clientY,scrollers:n,tracker:r}},[]),je=(0,Z.useCallback)(e=>{if(q.current){De(e);return}let t=ke.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.clientY-t.startCoord;t.tracker.add(0,e.clientY,e.timeStamp),n>Ik&&Yk(t.scrollers)?(ke.current=null,Ce(e,pe(),t.startCoord,t.tracker),De(e)):n<0&&(ke.current=null)},[Ce,De,pe]),Me=(0,Z.useCallback)(e=>{ke.current=null,q.current?.syntheticTouch||q.current&&Oe(e)},[Oe]),Ne=(0,Z.useRef)(null),Pe=(0,Z.useRef)(null),Fe=(0,Z.useCallback)(e=>{$k(Ne.current),Ne.current=null,ke.current=null,xe(e)},[xe]),Ie=(0,Z.useRef)(Ce),Le=(0,Z.useRef)(xe),Re=(0,Z.useRef)(Fe),ze=(0,Z.useRef)(De),Be=(0,Z.useRef)(Oe),Ve=(0,Z.useRef)(pe);(0,Z.useEffect)(()=>{Ie.current=Ce,Le.current=xe,Re.current=Fe,ze.current=De,Be.current=Oe,Ve.current=pe});let He=(0,Z.useCallback)(e=>{let t=(e,t,n)=>({syntheticTouch:!0,pointerId:e.identifier,pointerType:Nk(e),clientY:e.clientY,timeStamp:n.timeStamp,currentTarget:t,setPointerCapture:()=>{},releasePointerCapture:()=>{}}),n=e=>{let t=e.currentTarget;if(e.touches.length>1){Re.current(t);return}ke.current=null;let n=e.changedTouches[0];if($k(Ne.current),!n||Gk(e.target,t)){Ne.current=null;return}let r=Kk(e.target,t),i=Yk(r),a=Xk(r)&&(ie.current>0||!Zk(r)),o=new Ta;o.add(0,n.clientY,e.timeStamp),Ne.current={id:n.identifier,startX:n.clientX,startY:n.clientY,scrollers:r,top:i,bottom:a,contentEndY:null,promotedAtContentEnd:!1,releaseContentHold:null,tracker:o}},r=e=>{let n=e.currentTarget;if(e.touches.length>1){Re.current(n);return}let r=Ne.current;if(q.current){let i=[...e.changedTouches].find(e=>e.identifier===q.current?.pointerId);if(!i)return;if(r?.promotedAtContentEnd&&r.contentEndY!=null){if(i.clientY>=r.contentEndY){r.contentEndY=null,r.promotedAtContentEnd=!1,$k(r),Le.current(n);return}ze.current(t(i,n,e));return}e.preventDefault(),ze.current(t(i,n,e));return}if(!r)return;let i=[...e.changedTouches].find(e=>e.identifier===r.id);if(!i)return;let a=i.clientY-r.startY;r.tracker.add(0,i.clientY,e.timeStamp);let o=r.top&&a>0&&Yk(r.scrollers),s=r.bottom&&a<0&&Xk(r.scrollers),c=Math.abs(i.clientX-r.startX),l=Math.abs(a)>c;if((o||s)&&Math.abs(a)>=5&&l&&e.cancelable&&e.preventDefault(),o&&l&&a>Ik||s&&l&&a<-8)e.cancelable&&e.preventDefault(),$k(r),Ne.current=null,Ie.current(t(i,n,e),Ve.current(),r.startY,r.tracker),ze.current(t(i,n,e));else{if(Math.max(Math.abs(a),c)>Ik&&(r.top||r.bottom)){if(!l){$k(r),Ne.current=null;return}r.top=!1,r.bottom=!1}r.top&&a<=-5&&!Xk(r.scrollers)&&(r.top=!1),r.bottom&&a>=5&&!Yk(r.scrollers)&&(r.bottom=!1),Xk(r.scrollers)?r.contentEndY==null?(r.contentEndY=i.clientY,r.releaseContentHold??=Qk(r.scrollers)):r.contentEndY-i.clientY>=Fk&&(r.promotedAtContentEnd=!0,Ie.current(t(i,n,e),Ve.current(),r.contentEndY,r.tracker),ze.current(t(i,n,e))):(r.contentEndY=null,$k(r))}},i=e=>{$k(Ne.current),Ne.current=null;let n=q.current?.pointerId;if(n==null)return;let r=[...e.changedTouches].find(e=>e.identifier===n),i=e.currentTarget;r?Be.current(t(r,i,e)):e.touches.length===0&&Le.current(i)},a=ue.current;if(a&&Pe.current){let e=Pe.current;a.removeEventListener(`touchstart`,e.start),a.removeEventListener(`touchmove`,e.move),a.removeEventListener(`touchend`,e.end),a.removeEventListener(`touchcancel`,e.end)}ue.current=e,e?(e.addEventListener(`touchstart`,n,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!1}),e.addEventListener(`touchend`,i,{passive:!0}),e.addEventListener(`touchcancel`,i,{passive:!0}),Pe.current={start:n,move:r,end:i}):Pe.current=null},[]),Ue=(0,Z.useCallback)(e=>{if(I.current<=0)return;let t=Hk(e),n=Math.max(0,e.scrollHeight-e.clientHeight-t),r=Math.max(0,e.scrollTop-n);r<I.current-.5&&B(r)},[B]),We=(0,Z.useCallback)(e=>{q.current==null&&L.current==null&&Ue(e.currentTarget)},[Ue]),Ge=(0,Z.useCallback)(e=>{e.isPrimary?we(e):Fe(e.currentTarget)},[we,Fe]),Ke=(0,Z.useCallback)(e=>{e.isPrimary?Ae(e):Fe(e.currentTarget)},[Ae,Fe]),qe=(0,Z.useCallback)(e=>{e.touches.length>1&&Fe(e.currentTarget)},[Fe]),Je=(0,Z.useCallback)(e=>{let t=q.current;t?.pointerId!==e.pointerId||t.syntheticTouch||xe(e.currentTarget)},[xe]),Ye=m?u:f;return{sheetRef:J,contentProps:(0,Z.useMemo)(()=>({style:{transform:Ye===0?void 0:`translateY(${Ye}px)`,transition:e&&(m||P)?`none`:void 0,touchAction:`pinch-zoom`,overscrollBehavior:`contain`}}),[Ye,m,e,P]),handleProps:(0,Z.useMemo)(()=>({style:{touchAction:`pinch-zoom`,cursor:`grab`},onContextMenu:Te,onLostPointerCapture:Ee,onPointerDown:Ge,onPointerMove:De,onPointerUp:Oe,onPointerCancel:Je,onTouchStart:qe,onTouchMove:qe}),[Oe,Te,Je,Ge,qe,Ee,De]),bodyProps:(0,Z.useMemo)(()=>({ref:He,onContextMenu:Te,onLostPointerCapture:Ee,onPointerDown:Ke,onPointerMove:je,onPointerUp:Me,onPointerCancel:Me,onScroll:We}),[He,Me,Ke,je,We,Te,Ee]),bodyElementRef:ue,dragOffset:u,settledOffset:f,isDragging:m,isTraveling:C,isDismissedByTouchDrag:x,dragExit:S,activeOffsetRef:ie,sheetHeight:T,scrollPreservationInset:D,settlingLayoutOffset:M,settledLayoutOffset:k,completeScrollAreaSettle:ne}}var rA={hug:`92dvh`,capped:`62dvh`,tall:`92dvh`},iA=48,aA=.4;function oA(e){return Math.max(iA,Math.ceil(e*aA))}var sA=48,cA=3,lA=50;a[`--spacing-6`];var uA=[`height`,`minHeight`,`maxHeight`,`blockSize`,`minBlockSize`,`maxBlockSize`];function dA(e){return Array.isArray(e)?e.some(dA):typeof e==`object`&&!!e}function fA(){return typeof Element<`u`&&typeof Element.prototype.animate==`function`}function pA(e,t){let n=e.ownerDocument.defaultView?.innerHeight??0,r=Math.max(0,n-e.getBoundingClientRect().top);return qa(e,Ga.sheetDismissSwipe,{from:0,to:t.distance,velocity:t.velocity,epsilon:Qa.y},Math.min(t.distance,r))}function mA(e){let t=e.closest(`dialog`),n=e.ownerDocument;if(t==null||typeof n.getAnimations!=`function`)return;let r=n.getAnimations().filter(e=>{let n=e.effect;return n?.target===t&&e.transitionProperty===`opacity`&&Number(n.getKeyframes().at(-1)?.opacity)===0}),i=r.filter(e=>e.effect.pseudoElement===`::backdrop`);return(i.length>0?i:r.filter(e=>!e.effect.pseudoElement)).at(-1)}function hA(){return typeof window>`u`?0:window.innerHeight}var gA=null,_A=new Set,vA=null;function yA(){gA=hA();for(let e of _A)e()}function bA(e){return _A.add(e),vA??(vA=K(window,`resize`,yA),gA=hA(),e()),()=>{_A.delete(e),_A.size===0&&(vA?.(),vA=null,gA=null)}}function xA(){return vA==null?hA():(gA??=hA(),gA)}function SA(){return 0}function CA(){return()=>{}}function wA(e){let t=``;for(let n of e??[])t+=`${typeof n}:${n}|`;return t}var TA={0:{"--container-padding-block-start":`x1hkkx89`,$$css:!0},1:{"--container-padding-block-start":`x1vy0k3q`,$$css:!0},2:{"--container-padding-block-start":`x1rr17ng`,$$css:!0},3:{"--container-padding-block-start":`xk3zy2s`,$$css:!0},4:{"--container-padding-block-start":`xp5lzm3`,$$css:!0},5:{"--container-padding-block-start":`xlhad5c`,$$css:!0},6:{"--container-padding-block-start":`xqk0106`,$$css:!0},8:{"--container-padding-block-start":`x1qqmacf`,$$css:!0},10:{"--container-padding-block-start":`x213oh1`,$$css:!0},"0.5":{"--container-padding-block-start":`xoq6zsc`,$$css:!0},"1.5":{"--container-padding-block-start":`xmc9d48`,$$css:!0}},EA={k4zj60:`x1ipgmjk`,$$css:!0},DA={sheet:{kfzvcC:`x67bb7w`,kB7OPa:`x9f619`,kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kAzted:`x2lwn1j`,kzqmXN:`xh8yej3`,ks0D6T:`x11gisft`,kWkggS:`x10xzikg`,kMwMTN:`x1tgivj0`,kEafiO:`x11xkdxz`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,k2ei4v:`xgbv0en`,kVhnKS:`x1t7ytsu`,kGJrpR:`x1j92z86`,ke9TFa:`xw8tdv1`,k8ry5P:`x18b5jzi`,kBCPoo:`x1gejf6u`,krdFHd:`x81l70g`,kfmiAY:`x7hs6f1`,kGVxlE:`x1kcpxr7`,kI3sdo:`x1a2a7pz`,kVQacm:`xb3r6kr`,kGO01o:`x5559hn`,k1K539:`xgwt18o`,k3aq6I:`xnn1q72 xhbqy3z xspp5ug`,kSiTet:`x1hc1fzr x1igigxu xgo67oj`,k1ekBW:`xwcsmn1`,kIyJzY:`x80gvsz xzg1mie x1qzunnh`,kAMwcw:`xlr8y92`,k6sLGO:`x1q1rmc8`,"--_sheet-scrim-opacity":`xnvc5mv`,"--_sheet-scrim-duration":`x1jx3mzq`,"--_sheet-scrim-easing":`x1pfqsku`,$$css:!0},sheetSettled:{kIyJzY:`xpvlhck`,$$css:!0},sheetClosing:{k3aq6I:`x1weeur4 x1oe9tb1`,kSiTet:`x1m67veq`,kAMwcw:`x1j6inz x1s1rlkj`,$$css:!0},sheetClosingCrossFade:{k3aq6I:`xnn1q72`,kSiTet:`xg01cxk`,kIyJzY:`x8uwg2f`,$$css:!0},sheetFading:{kSiTet:`xg01cxk`,$$css:!0},sheetInactive:{kfzvcC:`x47corl`,$$css:!0},body:{kzQI83:`x1iyjqo2`,kAzted:`x2lwn1j`,kB7OPa:`x9f619`,kFalU9:`xge0x1e`,kInvED:`x1wfwxd8 x1nw7mhf`,kWkggS:`x10xzikg`,kGO01o:`x18d9i69`,$$css:!0},clearsGrabBar:{kLKAdn:`x1bwh7i5`,$$css:!0},content:{k1xSpc:`xufnvkl`,kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kAzted:`x1lh6h5t`,$$css:!0},tallKeyboardBody:{kFlMNQ:`xrw9175`,$$css:!0},tallKeyboardContent:{k5JduY:`x1s928wv`,kc3QkE:`xhkezso`,k4zj60:`x1gmr53x`,kloYau:`x2q1x1w`,$$css:!0},keyboardInset:e=>[EA,{"--x-nsbhg8":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],budget:{kZKoxP:`x1fqcpoh`,$$css:!0},hugHeight:{kZKoxP:`xg7h5cd`,kskxy:`xkche18`,$$css:!0}};function OA(e,t){return e?t:{...t,ref:void 0}}function kA(e){return e.kind===`open`?e.entering?`entering`:null:e.kind===`retained`?e.motion===`covered`?null:e.motion:e.kind===`exiting`?`exiting`:null}function AA(e,t,n){if(e==null)return n(),()=>{};let r=!1,i=null,a=0,o=()=>{r||(r=!0,i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s),n())},s=n=>{n.target===e&&n.propertyName===t&&(n.type===`transitioncancel`&&jA(e,t)?i!=null&&(clearTimeout(i),i=setTimeout(o,a)):o())};e.addEventListener(`transitionend`,s),e.addEventListener(`transitioncancel`,s);let c=getComputedStyle(e);if(e.style.transition.trim()===`none`||c.transition.trim()===`none`)return o(),()=>{};let l=c.transitionProperty.split(`,`).map(e=>e.trim()),u=c.transitionDuration.split(`,`).map(MA),d=c.transitionDelay.split(`,`).map(MA),f=!1,p=l.reduce((e,n,r)=>{if(n!==t&&n!==`all`)return e;let i=u[r%u.length],a=d[r%d.length];return i==null||a==null?(f=!0,e):Math.max(e,i+a)},0);return f?()=>{e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s)}:p<=0?(o(),()=>{}):(a=p+lA,i=setTimeout(o,a),()=>{i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s)})}function jA(e,t){return(e.getAnimations?.()??[]).some(e=>e.transitionProperty===t&&(e.playState===`running`||e.playState===`paused`))}function MA(e){let t=e.trim();if(!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(t))return null;let n=Number.parseFloat(e);return t.endsWith(`ms`)?n:n*1e3}function NA({ref:e,state:t,isOpenRequested:n,height:r,label:i,children:a,padding:o,snapPoints:s,className:c,style:l,tabIndex:u,xstyle:d,isEntrySettled:f=!1,onEntrySettled:p,onTransitionEnd:m,isSwipeDismissAllowed:h=!0,isPageScrollLocked:g=!1,onDismiss:_,onScrimOpacity:v,onScrimFade:y,onElementChange:b,handleRef:x,onMotionStart:S,onMotionComplete:C,...w}){let T=(0,Z.useRef)(null),E=(0,Z.useRef)(null),D=ve(S),O=ve(C),k=ve(y),A=(0,Z.useRef)(null),j=(0,Z.useRef)(null),ee=t.kind===`open`&&t.entering,[M,N]=(0,Z.useState)({kind:t.kind,isEntering:ee,isReactivated:!1});(M.kind!==t.kind||M.isEntering!==ee)&&N({kind:t.kind,isEntering:ee,isReactivated:ee&&M.kind===`retained`});let P=M.isReactivated,F=t.kind===`open`,I=t.kind!==`hidden`,L=t.kind===`retained`,R=L||t.kind===`exiting`,z=t.kind===`exiting`,te=L&&t.motion===`fading`,B=la(`(prefers-reduced-motion: reduce)`),ne=L&&!B?t.alignmentOffset:0,re=wA(s),[ie,V]=(0,Z.useState)({key:re,points:s});ie.key!==re&&V({key:re,points:s});let{snapHeights:ae,ignoredSnapPointsWarning:H}=(0,Z.useMemo)(()=>{let{key:e,points:t}=ie;if(e===``)return{snapHeights:void 0,ignoredSnapPointsWarning:``};let n=(t??[]).filter(e=>!yk(e));return{snapHeights:()=>bk(t??[],hA()),ignoredSnapPointsWarning:n.length===0?``:`snapPoints ignored ${JSON.stringify(n)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`}},[ie]);ro(`BottomSheet`,H,H!==``);let U=l?.height,W=uA.some(e=>l?.[e]!=null)||dA(d)||c!=null&&c!==``,G=la(`(any-pointer: coarse)`),K=I&&G&&!W,se=(0,Z.useSyncExternalStore)(K?bA:CA,K?xA:SA,SA),q=se>0?oA(se):iA,{contentProps:ce,handleProps:le,bodyProps:ue,bodyElementRef:de,sheetRef:fe,dragOffset:pe,settledOffset:me,isDragging:he,isDismissedByTouchDrag:ge,dragExit:_e,sheetHeight:Y,scrollPreservationInset:be,settlingLayoutOffset:xe,settledLayoutOffset:Se,completeScrollAreaSettle:Ce}=nA({isOpen:F,isOpenRequested:n??F,canDismiss:h,offscreenBlockEndInset:q,onDismiss:_,snapHeights:ae,onTravelStart:()=>{E.current?.(T.current??void 0)},onScrimOpacity:v,hasFixedHeight:U!=null}),{getViewportProps:we,getContentProps:Te}=lD({axis:`both`,keyboardAccess:{owner:`contentOrViewport`,label:i},overscroll:`contain`,stickyContainment:`always`}),Ee=(0,Z.useRef)(I),De=(0,Z.useCallback)(e=>{fe(Ee.current?e:null),T.current=e,b?.(e)},[b,fe]),Oe=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{if(Ee.current===I)return;Ee.current=I,fe(I?T.current:null);let e=Oe.current;!I&&e!=null&&(Oe.current=null,eo(e).set({y:0}))},[I,fe]);let ke=ua(T,{move:`ride`,inset:!0,offset:sA,isEnabled:r===`tall`&&I,isExpanded:me===0,isOpen:F,isPageScrollLocked:g}),Ae=ke.inset;E.current=ke.dismiss,(0,Z.useImperativeHandle)(e,()=>T.current,[]);let je=kA(t),Me=la(`(prefers-reduced-motion: reduce) and (pointer: coarse)`)||B&&ge,Ne=_e!=null&&!Me&&!B&&fA()?_e:null;(0,Z.useLayoutEffect)(()=>{let e=T.current;if(Ne==null||e==null)return;let t=t=>{k.current?.(e,t)};return t(pA(e,Ne)),()=>{t(null)}},[k,Ne]),(0,Z.useLayoutEffect)(()=>{if(je==null)return;A.current!==je&&(A.current=null),j.current=null;let e=()=>{A.current===je?O.current?.(je):j.current=je};if(je===`entering`&&P){e();return}let t=T.current;if(je===`exiting`&&Ne!=null&&t!=null){Oe.current=t;let n=eo(t).animate({y:Ne.distance},{spring:Ga.sheetDismissSwipe,velocity:{y:Ne.velocity}}),r=!0,i=!1,a=null;return n.started.then(e=>{let n=i=>{if(a=null,!r)return;let o=mA(t);o==null?i>0&&(a=requestAnimationFrame(()=>n(i-1))):o.startTime=e};n(cA)}),n.finished.then(()=>{i=!0,k.current?.(t,null),r&&e()}),()=>{r=!1,a!=null&&cancelAnimationFrame(a),i||n.retarget({y:0})}}let n=Me&&je===`exiting`;return AA(T.current,je===`fading`||n?`opacity`:`transform`,e)},[je,Me,Ne,P,O,k]),(0,Z.useLayoutEffect)(()=>{if(xe!=null)return AA(T.current,`transform`,Ce)},[Ce,xe]),(0,Z.useEffect)(()=>{if(je!=null)return D.current?.(je),A.current=je,j.current===je&&(j.current=null,O.current?.(je)),()=>{A.current===je&&(A.current=null),j.current===je&&(j.current=null)}},[je,O,D]);let Pe=o==null,Fe=o??4,Ie=ga[Fe],Le=typeof r==`string`&&r in rA?rA[r]:typeof r==`number`?`${r}px`:r,Re=Y>0,ze=ce.style.transform,Be;if(Re){let e=he?pe<me?0:Se:xe??Se,t=(he?pe:me)-e;Be=e>0||he||xe!=null?Bk(Y,e):void 0,ze=t===0?void 0:`translateY(${t}px)`}let Ve=ne>0?[ze,`translateY(${ne}px)`].filter(Boolean).join(` `):ze,He=F?ze:L?Ve:void 0,Ue=l?.transform,We=F||L||z?Be:void 0,Ge=Vk(be);(0,Z.useLayoutEffect)(()=>{if(he)return;let e=T.current;e!=null&&(Ue==null&&(!I||_e==null||z&&Ne==null&&!Me)&&(e.style.transform=He??``),U??(e.style.height=We??``));let t=de.current;t!=null&&(t.style.paddingBlockEnd=Ge??``)});let Ke={transition:ce.style.transition,touchAction:ce.style.touchAction,overscrollBehavior:ce.style.overscrollBehavior,height:We};return(0,Q.jsxs)(`div`,{...w,ref:De,tabIndex:u??-1,onTransitionEnd:e=>{m?.(e),f&&e.target===e.currentTarget&&p?.()},...hn(ye(`bottom-sheet`),J(It.reset,Lt.reset,DA.sheet,pn.reset,r===`hug`?DA.hugHeight:DA.budget,z&&DA.sheetClosing,z&&Me&&DA.sheetClosingCrossFade,te&&DA.sheetFading,R&&DA.sheetInactive,f&&DA.sheetSettled,d),c,{"--_sheet-budget":Le,"--_sheet-reserve":`${q}px`,...F?Ke:L||z?{height:We}:{},...l}),children:[(0,Q.jsx)(`div`,{ref:x,...hn(ye(`bottom-sheet-handle`),{className:`x10l6tqk x13vifvy x1o0tod xtijo5x x1vjfegm x78zum5 x6s0dn4 xl56j7k xvpftlf xafqdz2 x1so62im x1j4r261 x1jm3nie x16khyan x1cpjm7i x1oke5ut x34npju xmwhqxd x1hw15nc`}),...le,"aria-hidden":`true`}),(0,Q.jsx)(`div`,{...OA(I,we({...ue,...hn(J(oe.focusVisible,DA.body,r===`tall`&&DA.tallKeyboardBody),Ge==null?{}:{style:{paddingBlockEnd:Ge}})})),children:(0,Q.jsx)(`div`,{...OA(I,Te(J(DA.content,r===`tall`&&DA.tallKeyboardContent,r===`tall`&&Ae>0&&DA.keyboardInset(Ae),...da(Pe?{useThemeDefault:`bottom-sheet`}:{paddingInnerX:Ie,paddingInnerY:Ie,paddingOuterX:Ie,paddingOuterY:Ie}),!Pe&&Fe!==4&&ha[Fe],!Pe&&Fe!==4&&fa[Fe],!Pe&&TA[Fe],!Pe&&Fe!==4&&ba[Fe],DA.clearsGrabBar))),children:(0,Q.jsx)(Ht,{children:(0,Q.jsx)(cg,{value:`bottom-sheet`,children:a})})})})]})}NA.displayName=`BottomSheetPanel`;function PA(){return(0,Q.jsx)(`div`,{className:`xixxii4 x17y0mx6 x1ey2m1c x1kpxq89 x10xzikg xhtitgo x47corl x1cb67k9 xt2iwb0`,"data-sheet-edge-tint":``,"aria-hidden":`true`})}var FA=dn(`BottomSheetHostContext`,1,null);FA.displayName=`BottomSheetHostContext`;var IA={isOpen:!0},LA={isOpen:!1},RA={isStacked:!1,isTop:!1,isCovered:!1,depth:0,ownsScrim:!1,isScrimHandoff:!1,isBlocked:!1,isScrimTakenOver:!1,replacedMotion:null,alignmentOffset:0,isReplacing:!1},zA=1,BA=8,VA=Symbol.for(`astryx.bottomSheetStack.v${BA}`),HA=BA;function UA(){return{shape:HA,entries:[],shownOrder:new WeakMap,listenedDocuments:new WeakMap,batchOpened:[],batchClosed:[],batchActor:null,batchPair:null,lastPress:new WeakMap,pendingDrops:[],pendingReplaceFocus:null,closingTogether:new Map,rankByKey:new WeakMap,currentBatch:0,nextSeq:0,isBatchDirty:!1,isSealScheduled:!1,focusToKeep:new WeakMap,deferredTopLayer:new WeakMap}}var $=s(VA,UA,e=>e?.shape===HA);function WA(){return $.isBatchDirty=!0,GA(),{batch:$.currentBatch,seq:$.nextSeq++}}function GA(){$.isSealScheduled||typeof queueMicrotask!=`function`||($.isSealScheduled=!0,queueMicrotask(()=>{$.isSealScheduled=!1,KA()}))}function KA(){Bj(),qA(),$.isBatchDirty&&=($.currentBatch+=1,!1),$.batchOpened=[],$.batchClosed=[],$.batchActor=null,$.batchPair=null}function qA(){if($.batchOpened.length>0)return;let e=$.batchClosed.filter(e=>e.isModal&&e.replace==null&&e.replacing==null);if(e.length<2)return;let t=new Map;for(let n of e){let e=t.get(n.doc)??[];e.push(n),t.set(n.doc,e)}for(let[e,n]of t){if(n.length<2)continue;let t=aj(e,!0);if(t.some(e=>e.isOpen))continue;let r=t.filter(e=>n.includes(e)),i=r[0],a={members:r,pending:new Set(r),returnTarget:i.getReturnTarget?.()??null};for(let e of r)$.closingTogether.set(e,a)}}function JA(e){let t=$.entries.find(t=>t.key===e);return t!=null&&$.closingTogether.has(t)}function YA(e){if(e.pending.size>0||e.reported)return;e.reported=!0;let t=e.returnTarget;t!=null&&t.isConnected&&Ba(t)}function XA(e){let t=$.entries.find(t=>t.key===e),n=t==null?void 0:$.closingTogether.get(t);t!=null&&n!=null&&ZA(t,n)}function ZA(e,t){$.closingTogether.delete(e),t.pending.delete(e),YA(t)}function QA(e){if($.listenedDocuments.has(e))return;let t=t=>{t.target instanceof Element&&$.lastPress.set(e,{target:new WeakRef(t.target),at:Date.now()})};e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`click`,t,!0),e.addEventListener(`keydown`,t,!0),$.listenedDocuments.set(e,()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`click`,t,!0),e.removeEventListener(`keydown`,t,!0),$.lastPress.delete(e)})}function $A(e){if($.entries.some(t=>t.doc===e))return;let t=$.listenedDocuments.get(e);t!=null&&($.listenedDocuments.delete(e),t())}var ej=1e3;function tj(e,t){let n=$.lastPress.get(e),r=n?.target.deref();return n!=null&&r!=null&&r.isConnected&&Date.now()-n.at<=ej&&!nj(r,t)?r:e.activeElement}function nj(e,t){let n=$.entries.find(n=>{let r=n.getElement();return n.doc===t.doc&&r!=null&&r.contains(e)});return n==null||n===t?!1:!n.isOpen||n.replace!=null}function rj(e,t){$.batchOpened.length===0&&$.batchClosed.length===0&&($.batchActor=tj(e.doc,e)),(t===`opened`?$.batchOpened:$.batchClosed).push(e)}function ij(e,t){if(e.rank.batch!==t.rank.batch)return e.rank.batch-t.rank.batch;let n=e.getTreeAnchor?.()??e.getElement(),r=t.getTreeAnchor?.()??t.getElement();if(n!=null&&r!=null&&n!==r){let e=n.compareDocumentPosition(r);if(e&Node.DOCUMENT_POSITION_FOLLOWING)return-1;if(e&Node.DOCUMENT_POSITION_PRECEDING)return 1}return e.rank.seq-t.rank.seq}function aj(e,t){return $.entries.filter(n=>n.doc===e&&n.isModal===t).sort(ij)}function oj(e){return aj(e.doc,e.isModal)}function sj(e,t){let n=$.shownOrder.get(e);return n==null?[]:t?n.modal:n.nonModal}function cj(e,t,n){let r=$.shownOrder.get(e)??{modal:[],nonModal:[]};t?r.modal=n:r.nonModal=n,$.shownOrder.set(e,r)}function lj(e,t){return e.isStacked===t.isStacked&&e.isTop===t.isTop&&e.isCovered===t.isCovered&&e.depth===t.depth&&e.ownsScrim===t.ownsScrim&&e.isScrimHandoff===t.isScrimHandoff&&e.isBlocked===t.isBlocked&&e.isScrimTakenOver===t.isScrimTakenOver&&e.replacedMotion===t.replacedMotion&&e.alignmentOffset===t.alignmentOffset&&e.isReplacing===t.isReplacing}function uj(e,t){let n=[];if(!t){for(let t of e){let e={...RA,replacedMotion:t.replace?.motion??null,alignmentOffset:t.replace?.alignmentOffset??0,isReplacing:t.replacing!=null};lj(t.view,e)||(t.view=e,n.push(t))}for(let e of n)e.onView(e.view);return}let r=e.filter(e=>e.isOpen),i=r[r.length-1]??null,a=e.find(e=>e.isOpen||e.replace!=null)??null;e.forEach((t,r)=>{let o=0;for(let n=r+1;n<e.length;n+=1)e[n].isOpen&&e[n]!==t.replace?.replacer&&(o+=1);let s=t.isOpen&&o>0,c=t.getElement(),l=c!=null&&e.some(e=>{let n=e.getElement();return e!==t&&n!=null&&c.contains(n)}),u=t===a,d=u&&t.isOpen&&e.slice(0,r).some(e=>!e.isOpen),f={isStacked:e.length>1,isTop:t===i,isCovered:s,depth:o,ownsScrim:u,isScrimHandoff:d,isBlocked:s&&!l,isScrimTakenOver:!t.isOpen&&a!=null&&a!==t,replacedMotion:t.replace?.motion??null,alignmentOffset:t.replace?.alignmentOffset??0,isReplacing:t.replacing!=null};lj(t.view,f)||(t.view=f,n.push(t))});for(let e of n)e.onView(e.view)}function dj(e){let t=e.ownerDocument,n=t.activeElement;if(n instanceof HTMLElement&&n!==t.body){let r=n.closest(`dialog`);r!=null&&r!==e&&!r.contains(e)&&!e.contains(r)&&hj(r)&&$.focusToKeep.set(t,n),n.blur()}e.showModal()}function fj(e){e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,`0`),dj(e),typeof getComputedStyle==`function`&&getComputedStyle(e,`::backdrop`).opacity,e.style.removeProperty(`--_sheet-scrim-duration`)}function pj(e,t,n){e!=null&&(!e.open||e.style.getPropertyValue(`--_sheet-scrim-opacity`)===t?e.style.setProperty(`--_sheet-scrim-opacity`,t):(e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,t),mj(n),n.frame=requestAnimationFrame(()=>{n.frame=requestAnimationFrame(()=>{n.frame=null,e.style.removeProperty(`--_sheet-scrim-duration`)})})))}function mj(e){e.frame!=null&&(cancelAnimationFrame(e.frame),e.frame=null)}function hj(e){if(e==null)return!1;if(e.open)return!0;try{return e.matches(`:popover-open`)}catch{return!1}}function gj(e){let t=[];for(let n of Array.from(e.ownerDocument.querySelectorAll(`dialog[open]`)))n===e||n.contains(e)||n.hasAttribute(`inert`)||n.getAttribute(`aria-hidden`)===`true`||$.entries.some(e=>!e.isOpen&&e.getElement()===n)||xj(n)&&t.push(n);return t}function _j(e,t,n){let r=e.ownerDocument,i=$.deferredTopLayer.get(r);if(i??(i={deferred:new Map,blockers:new WeakSet,removals:null,stopListeningForClose:null},$.deferredTopLayer.set(r,i)),i.stopListeningForClose==null){let e=()=>{yj(r)};r.addEventListener(`close`,e,!0),i.stopListeningForClose=()=>{r.removeEventListener(`close`,e,!0)}}i.deferred.set(e,t);for(let e of n)i.blockers.add(e);if(i.removals==null&&typeof MutationObserver==`function`){let{blockers:e}=i,t=new MutationObserver(t=>{t.some(t=>vj(t,e))&&yj(r)});t.observe(r,{childList:!0,subtree:!0}),i.removals=t}}function vj(e,t){for(let n of Array.from(e.removedNodes))if(n instanceof Element&&(n instanceof HTMLDialogElement?[n]:Array.from(n.querySelectorAll(`dialog`))).some(e=>t.has(e)))return!0;return!1}function yj(e){let t=$.deferredTopLayer.get(e);if(t==null||t.deferred.size===0)return;let{deferred:n}=t;for(let[r,i]of Array.from(n)){if(!r.isConnected||!r.open){n.delete(r);continue}let a=gj(r);if(a.length>0){for(let e of a)t.blockers.add(e);continue}n.delete(r);let o=e.activeElement;r.close(),Sj(r,i),e.activeElement!==o&&o instanceof HTMLElement&&o.isConnected&&o.focus({preventScroll:!0})}n.size===0&&bj(t)}function bj(e){e.removals?.disconnect(),e.removals=null,e.stopListeningForClose?.(),e.stopListeningForClose=null}function xj(e){return P(e)||e.getAttribute(`aria-modal`)===`true`}function Sj(e,t){if(typeof e.showPopover!=`function`){e.show();return}let n=gj(e);if(n.length>0){e.show(),_j(e,t,n);return}let r=e.ownerDocument,i=t?.hasAttribute(`autofocus`)??!1;t!=null&&!i&&t.setAttribute(`autofocus`,``);try{e.showPopover()}finally{t!=null&&!i&&t.removeAttribute(`autofocus`)}bn(),t!=null&&r.activeElement===t&&!Tj(e)&&Cj(t)?.focus({preventScroll:!0})}function Cj(e){let t=e.querySelectorAll(`a[href], area[href], button, input, select, textarea, iframe, summary, [contenteditable]:not([contenteditable="false"]), [tabindex]`);for(let n of Array.from(t))if(!(n===e||n.tabIndex<0)&&!(n.disabled===!0||n.closest(`[inert]`)!=null||n.getAttribute(`type`)===`hidden`||n.hidden||typeof n.checkVisibility==`function`&&!n.checkVisibility()))return n;return null}var wj=null;function Tj(e){if(wj!=null)return wj;let t=e.ownerDocument,n=t.activeElement,r=t.createElement(`dialog`);r.setAttribute(`aria-hidden`,`true`),r.style.cssText=`position:fixed;inset:auto;opacity:0;pointer-events:none`;let i=t.createElement(`div`);i.tabIndex=-1;let a=t.createElement(`button`);a.type=`button`,i.appendChild(a),r.appendChild(i),e.appendChild(r);try{r.show(),wj=t.activeElement===i,r.close()}catch{wj=!0}finally{r.remove(),t.activeElement!==n&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})}return wj}function Ej(e){let t=$.deferredTopLayer.get(e.ownerDocument);if(t!=null&&t.deferred.delete(e)&&t.deferred.size===0&&bj(t),e.hasAttribute(`popover`)&&typeof e.hidePopover==`function`)try{e.hidePopover()}catch{}e.open&&e.close()}function Dj(e){if(e==null||!hj(e))return;let t=e.ownerDocument,n=t.activeElement;Ej(e),t.activeElement!==n&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})}function Oj(){if($.batchOpened.length!==1||$.batchClosed.length!==1){kj();return}let[e]=$.batchOpened,[t]=$.batchClosed;if($.batchPair!=null&&$.batchPair.replaced===t||t===e||t.replaceable==null||e.replaceable==null||t.doc!==e.doc||t.isModal!==e.isModal||t.replace?.replacer===e||!e.isOpen||t.isOpen)return;let n=t.getElement(),r=e.getElement();if(n==null||r==null||n.contains(r)||r.contains(n)||oj(t).some(n=>n!==e&&n!==t&&n.isOpen&&ij(n,t)>0))return;let i=$.batchActor;(i==null||i===t.doc.body||n.contains(i))&&(t.replacing!=null&&t.replacing!==e&&jj(t.replacing),t.replace!=null&&(t.replace.replacer.replacing=null),e.replace!=null&&(e.replace=null),t.replace={replacer:e,motion:`covered`,alignmentOffset:0,isAlignmentComplete:!1,isEnteringComplete:!1},e.replacing=t,$.batchPair={replaced:t,replacer:e,replacerOpener:e.replaceable.getOpener()},$.lastPress.delete(e.doc),e.replaceable.setOpener(t.replaceable.getOpener()),$.pendingReplaceFocus=e)}function kj(){let e=$.batchPair;if(e==null)return;$.batchPair=null;let{replaced:t,replacer:n,replacerOpener:r}=e;t.replace?.replacer===n&&(t.replace=null),n.replacing===t&&(n.replacing=null),n.replaceable?.setOpener(r),$.pendingReplaceFocus===n&&($.pendingReplaceFocus=null)}function Aj(){let e=$.pendingReplaceFocus;if(e==null)return;let t=e.getElement();t!=null&&hj(t)&&($.pendingReplaceFocus=null,e.focus(`replace`))}function jj(e){let t=e.replace;if(t==null)return;let{replacer:n}=t;e.replace=null,n.replacing===e&&(n.replacing=null),e.hide(),e.replaceable?.finish()}function Mj(e){let t=e.getBoundingClientRect().top,n=e.ownerDocument.defaultView;if(n==null||typeof n.DOMMatrixReadOnly!=`function`)return t;let{transform:r}=n.getComputedStyle(e);return r===``||r===`none`?t:t-new n.DOMMatrixReadOnly(r).m42}function Nj(e,t){return e==null||t==null?0:Math.max(0,Mj(e)-t.getBoundingClientRect().top)}function Pj(e,t,n){let r=$.entries.find(t=>t.key===e);if(r==null)return;if(n===`entering`){let e=r.replacing,n=e?.replace??null;if(e==null||n==null||n.replacer!==r)return;if(t===`start`){if(n.motion!==`covered`)return;let t=Nj(r.replaceable?.getPanel()??null,e.replaceable?.getPanel()??null);if(t>zA&&(n.motion=`aligning`,n.alignmentOffset=t,n.isAlignmentComplete=!1),r.isEnteringInPlace)r.isEnteringInPlace=!1,n.isEnteringComplete=!0,n.motion!==`aligning`&&(n.motion=`fading`);else if(n.motion===`covered`)return}else{if(n.isEnteringComplete=!0,n.motion===`aligning`&&!n.isAlignmentComplete)return;n.motion=`fading`}Lj(r.doc,r.isModal);return}let i=r.replace;i!=null&&t===`complete`&&(n===`aligning`&&i.motion===`aligning`?(i.isEnteringComplete?i.motion=`fading`:i.isAlignmentComplete=!0,Lj(r.doc,r.isModal)):n===`fading`&&i.motion===`fading`&&(jj(r),Lj(r.doc,r.isModal)))}function Fj(e,t,n){let r=sj(e,t),i=n.filter(e=>{let t=e.getElement();return t!=null&&t.isConnected}),a=0,o=0;for(;a<i.length;){let e=r.indexOf(i[a],o);if(e===-1)break;o=e+1,a+=1}let s=new Set(i.slice(0,a)),c=i.slice(a),l=Ij(e,c),u=!1;for(let e=r.length-1;e>=0;--e)s.has(r[e])||r[e].hide();for(let e of c){let t=l!=null&&e.getElement()?.contains(l)?l:null,n=t?.hasAttribute(`autofocus`)??!1;t!=null&&!n&&t.setAttribute(`autofocus`,``),e.show(),t!=null&&!n&&t.removeAttribute(`autofocus`),u=!0}if(cj(e,t,i),!u)return;if(c.some(e=>r.includes(e))&&bn(),l!=null&&l.isConnected){e.activeElement!==l&&l.focus({preventScroll:!0});return}let d=i.filter(e=>e.isOpen);d[d.length-1]?.focus(`open`)}function Ij(e,t){let n=$.focusToKeep.get(e);$.focusToKeep.delete(e);let r=e.activeElement,i=n!=null&&n.isConnected?n:r instanceof HTMLElement&&r!==e.body?r:null;if(i==null)return null;for(let e of t){let t=e.getElement();if(e.isOpen&&t!=null&&t.contains(i))return i}return null}function Lj(e,t){Oj(),$.batchOpened.length>0&&$.batchClosed.length>0&&Bj();let n=aj(e,t);uj(n,t),Fj(e,t,n),$.focusToKeep.delete(e),Aj(),yj(e)}function Rj(e,t,n=!0){let{key:r}=e,i=$.rankByKey.get(r),a;i!=null&&!i.isClosed&&(i.detachedBatch==null||i.detachedBatch===$.currentBatch)?(a={batch:i.batch,seq:i.seq},i.detachedBatch=null):(a=WA(),$.rankByKey.set(r,{...a,isClosed:!t,detachedBatch:null}));let o=e.getElement()?.ownerDocument??document;QA(o);let s={...e,rank:a,isOpen:t,doc:o,isModal:n,view:RA,replace:null,replacing:null,isEnteringInPlace:!1};return $.entries.push(s),t&&a.batch===$.currentBatch&&$.isBatchDirty&&rj(s,`opened`),Lj(s.doc,s.isModal),()=>{let e=$.entries.indexOf(s);if(e===-1)return;$.entries.splice(e,1),$A(s.doc),cj(s.doc,s.isModal,sj(s.doc,s.isModal).filter(e=>e!==s)),$.batchOpened=$.batchOpened.filter(e=>e!==s),$.batchClosed=$.batchClosed.filter(e=>e!==s),$.pendingDrops=$.pendingDrops.filter(e=>e!==s),$.pendingReplaceFocus===s&&($.pendingReplaceFocus=null),($.batchPair?.replaced===s||$.batchPair?.replacer===s)&&($.batchPair=null);let t=$.closingTogether.get(s);s.replace!=null&&(s.replace.replacer.replacing=null,s.replace=null),s.replacing!=null&&(s.replacing.replace=null,s.replacing=null),s.hide(),t!=null&&ZA(s,t);let n=$.rankByKey.get(r);n!=null&&(n.detachedBatch=$.currentBatch,$.isBatchDirty=!0,GA()),s.view=RA,s.onView(s.view),Lj(s.doc,s.isModal)}}function zj(e,t){let n=$.entries.find(t=>t.key===e);if(n==null||n.isOpen===t)return;n.isOpen=t;let r=$.rankByKey.get(e);if(t){if($.closingTogether.has(n)){let e=$.closingTogether.get(n);$.closingTogether.delete(n),e?.pending.delete(n)}n.rank=WA(),$.rankByKey.set(e,{...n.rank,isClosed:!1,detachedBatch:null}),rj(n,`opened`),n.replace!=null&&(n.replace.replacer.replacing=null,n.replace=null,n.isEnteringInPlace=!0)}else r!=null&&(r.isClosed=!0),$.isBatchDirty=!0,GA(),rj(n,`closed`),n.isEnteringInPlace=!1,n.replacing!=null&&$.pendingDrops.push(n.replacing);Lj(n.doc,n.isModal)}function Bj(){if($.pendingDrops.length===0)return;let e=$.pendingDrops;$.pendingDrops=[];for(let t of e){let e=t.replace?.replacer;e!=null&&!e.isOpen&&jj(t)}}function Vj(e){let t=$.entries.find(t=>t.key===e);if(t==null)return null;let n=oj(t);for(let e=n.indexOf(t)-1;e>=0;--e){let t=n[e],r=t.getElement();if(t.isOpen&&r!=null)return{element:r,focus:()=>t.focus(`reveal`)}}return null}function Hj(e){let t=e.closest(`dialog`);for(let n of e.querySelectorAll(`[data-autofocus]`))if(!(n.closest(`dialog`)!==t||n.closest(`[inert]`)!=null||typeof n.checkVisibility==`function`&&!n.checkVisibility())&&(n.focus({preventScroll:!0}),n.ownerDocument.activeElement===n))return!0;return!1}function Uj(e,t,n){if(e==null)return;let r=e.closest(`dialog`);if(r!=null&&(r.hasAttribute(`inert`)||r.getAttribute(`aria-hidden`)===`true`))return;let i=e.ownerDocument.activeElement,a=i!=null&&e.contains(i)&&i.closest(`dialog`)===e.closest(`dialog`);a&&(t===`reveal`||t===`replace`&&i!==e)||(t===`reveal`?Fa(e):a&&i?.hasAttribute(`data-autofocus`)===!0||Hj(e)||!a&&(n||t===`replace`)&&e.focus({preventScroll:!0}))}var Wj=dn(`BottomSheetSwitcherContext`,1,null);Wj.displayName=`BottomSheetSwitcherContext`;var Gj=e({BottomSheet:()=>tM}),Kj={dialog:{kVAEAm:`xixxii4`,kpwlN0:`x10a8y8t`,kzqmXN:`x1o6l61p`,kZKoxP:`xtdtrs8`,ks0D6T:`x1x1rfll`,kskxy:`x7ab17h`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kVQacm:`x1rea2x4`,k1xSpc:`x1s85apg`,kI3sdo:`x1a2a7pz`,$$css:!0},dialogOpen:{k1xSpc:`x1lliihq`,$$css:!0},dialogPanelHost:{k1xSpc:`x78zum5`,kjj79g:`xl56j7k`,kGNEyG:`xuk3077`,$$css:!0},dialogNonModal:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItem:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItemTop:{kY2c9j:`x1vjfegm`,$$css:!0},scrim:{kGyWv1:`xnixb3f`,k5sjJv:`xni466t xxiuuzi`,kND0Po:`xc0dz0a`,k9an0g:`x10buo38`,kb4ib:`x15h3t91`,kwHxkk:`x142juwg`,k4oj2o:`x15l12jy`,$$css:!0},scrimSettled:{k9an0g:`x108qnu8`,$$css:!0},scrimClosing:{kb4ib:`x1w553ls`,$$css:!0},positioner:{kVAEAm:`x10l6tqk`,kkqhue:`x17y0mx6`,krVfgx:`x1ey2m1c`,k1xSpc:`x78zum5`,kjj79g:`xl56j7k`,kfzvcC:`x47corl`,$$css:!0},positionerHidden:{k1xSpc:`x1s85apg`,$$css:!0},positionerTop:{kY2c9j:`x1vjfegm`,$$css:!0},positionerStackMotion:{k3nNDw:`x1fpg8nb`,k1ekBW:`x11xpdln`,kIyJzY:`x80gvsz`,kAMwcw:`xlr8y92`,k6CgDc:`xzg1mie`,$$css:!0},positionerReceded1:{k3aq6I:`xfkfg1k`,$$css:!0},positionerReceded2:{k3aq6I:`xdo3dbm`,$$css:!0}};function qj(e){return[e.isStacked&&Kj.positionerStackMotion,e.depth===1&&Kj.positionerReceded1,e.depth>=2&&Kj.positionerReceded2]}function Jj(e,t){if(e.isStacked)return t?e.isTop?`top`:`covered`:e.replacedMotion==null?`exiting`:`replaced`}function Yj(e){return e.isStacked&&!e.ownsScrim?`0`:`1`}function Xj(e,t,n){if(e==null)return;let r=e.style.getPropertyValue(`--_sheet-scrim-duration`);t==null?(n.current!=null&&r===n.current&&(e.style.removeProperty(`--_sheet-scrim-duration`),e.style.removeProperty(`--_sheet-scrim-easing`)),n.current=null):r!==`0s`&&(n.current=`${t.durationMs}ms`,e.style.setProperty(`--_sheet-scrim-duration`,n.current),e.style.setProperty(`--_sheet-scrim-easing`,t.easing))}function Zj(e,t){switch(e){case`active`:return{kind:`open`,entering:!1};case`entering`:return{kind:`open`,entering:!0};case`covered`:case`aligning`:case`fading`:return{kind:`retained`,motion:e,alignmentOffset:t};case`exiting`:return{kind:`exiting`};case`hidden`:return{kind:`hidden`}}}function Qj(e,t){Uj(e,`open`,t)}function $j({ref:e,isOpen:t,onOpenChange:n,label:r,children:i,height:a=`capped`,snapPoints:o,hasScrim:s=!0,finalFocusRef:c,purpose:l=`info`,xstyle:u,...d}){let f=(0,Z.useRef)(null),p=(0,Z.useRef)(null),m=(0,Z.useRef)(null),h=(0,Z.useRef)(!1),g=ve(c),_=(0,Z.use)(FA)?.isOpen??!0,v=Qt(),y=t&&_&&!v,[b,x]=Eh(t,y,!1),S=b&&y;pa(f,y&&s);let[C,w]=(0,Z.useState)(y);y&&!C&&w(!0);let T=y||C,E=(0,Z.useRef)({}),[D,O]=(0,Z.useState)(RA),k=(0,Z.useRef)(y);(0,Z.useInsertionEffect)(()=>{k.current=y},[y]);let A=!y&&C&&D.replacedMotion!=null,[j,ee]=(0,Z.useState)(!1),[M,N]=(0,Z.useState)(y);M!==y&&(N(y),ee(!1));let P=y?{kind:`open`,entering:D.isReplacing}:A?{kind:`retained`,motion:D.replacedMotion??`covered`,alignmentOffset:D.alignmentOffset}:C?j?{kind:`exiting`}:{kind:`open`,entering:!1}:{kind:`hidden`},F=(0,Z.use)(qD),I=(0,Z.useCallback)(()=>{y&&l!==`required`&&F&&n(!1)},[F,y,n,l]),L=(0,Z.useCallback)(()=>{l===`info`&&n(!1)},[n,l]),R=(0,Z.useCallback)(e=>{p.current=e},[]),z=(0,Z.useRef)(D),te=(0,Z.useRef)({frame:null});(0,Z.useEffect)(()=>()=>mj(te.current),[]);let B=(0,Z.useCallback)(e=>pj(f.current,e,te.current),[]),ne=(0,Z.useCallback)(e=>{let t=z.current;(!t.isStacked||t.ownsScrim)&&f.current?.style.setProperty(`--_sheet-scrim-opacity`,String(e))},[]),re=(0,Z.useRef)(null),ie=(0,Z.useCallback)((e,t)=>{let n=z.current;(!n.isStacked||n.ownsScrim)&&Xj(e.closest(`dialog`),t,re)},[]);(0,Z.useLayoutEffect)(()=>{if(!T)return;let e=E.current,t=f.current,n=t==null?null:ja(t,{keepRestingFocus:!0}),r=()=>g.current?.current??m.current,i=Rj({key:e,getElement:()=>f.current,show:()=>{let e=f.current;e==null||hj(e)||(m.current??=document.activeElement,s?(e.style.setProperty(`--_sheet-scrim-opacity`,Yj(z.current)),e.showModal()):Sj(e,p.current))},hide:()=>Dj(f.current),focus:e=>Uj(p.current,e,s),getReturnTarget:r,onView:e=>{z.current=e,O(e),k.current||e.replacedMotion!=null?B(Yj(e)):e.isScrimTakenOver&&B(`0`)},replaceable:{getPanel:()=>p.current,getOpener:()=>m.current,setOpener:e=>{m.current=e},finish:()=>{m.current=null,w(!1)}}},k.current,s);return()=>{if(n!=null&&hj(t)){let t=r(),i=s?Vj(e):null;n(()=>{(i==null||i.element.isConnected)&&(i!=null&&(t==null||!i.element.contains(t))?i.focus():t!=null&&t.isConnected&&Ba(t))})}i()}},[g,s,T,B]),(0,Z.useLayoutEffect)(()=>{if(!y){let e=f.current;h.current=e!=null&&e.contains(e.ownerDocument.activeElement)}T&&zj(E.current,y),y||ee(!0)},[s,y,T]);let V=_n(f,y&&s,D.isTop,`bottom-sheet`);(0,Z.useEffect)(()=>{KA()}),(0,Z.useLayoutEffect)(()=>{let e=f.current;e!=null&&s&&(y||A?e.style.setProperty(`--_sheet-scrim-opacity`,Yj(z.current)):C&&e.style.setProperty(`--_sheet-scrim-opacity`,`0`))},[s,y,C,A]);let ae=(0,Z.useCallback)(e=>{Pj(E.current,`start`,e)},[]),H=(0,Z.useCallback)(e=>{if(Pj(E.current,`complete`,e),e!==`exiting`||y)return;if(s&&z.current.depth>0){Dj(f.current),w(!1),m.current=null;return}if(s&&JA(E.current)){Dj(f.current),w(!1),m.current=null,XA(E.current);return}let t=f.current;t!=null&&Ej(t),w(!1);let n=s?Vj(E.current):null,r=c?.current??(s||h.current?m.current:null);n!=null&&(r==null||!n.element.contains(r))?n.focus():r!=null&&Ba(r),m.current=null},[c,s,y]),{ref:U}=Ft(),W=Vt(f,U);Qh(T&&s),ro(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",y&&!r);let{shouldDismissOnCloseRequest:oe}=un({isActive:T,escapeBehavior:y&&l!==`required`&&F?`close`:`block`,onDismiss:I,getContainer:()=>f.current,isPresent:()=>hj(f.current)&&!z.current.isCovered&&z.current.replacedMotion==null}),G=(0,Z.useCallback)(e=>{e.target===e.currentTarget&&(e.preventDefault(),oe()&&I())},[I,oe]),K=(0,Z.useCallback)(e=>{s&&e.target===e.currentTarget&&L()},[L,s]),se=!y&&C,q=se&&A||D.isBlocked,ce=se&&!A&&j;return(0,Z.useLayoutEffect)(()=>{let e=f.current;if(ce&&e!=null)return wn(e,{until:new Promise(()=>{}),scope:`layer`,focus:`kept-inside`})},[ce]),(0,Q.jsxs)(`dialog`,{...J(Kj.dialog,T&&Kj.dialogOpen,T&&Kj.dialogPanelHost,...qj(D),s&&Kj.scrim,s&&S&&Kj.scrimSettled,s&&se&&Kj.scrimClosing,!s&&Kj.dialogNonModal),ref:W,popover:s?void 0:`manual`,"aria-label":r,"aria-hidden":q?`true`:void 0,"aria-modal":s&&y?`true`:void 0,role:l===`required`?`alertdialog`:void 0,inert:q?!0:void 0,"data-sheet-stack":s?Jj(D,y):void 0,"data-sheet-stack-depth":s&&D.depth>0?D.depth:void 0,onCancel:G,...Rt({onClick:K}),children:[(0,Q.jsx)(NA,{...d,ref:e,state:P,isEntrySettled:S,onEntrySettled:x,isOpenRequested:y,height:a,label:r,snapPoints:o,isSwipeDismissAllowed:l===`info`,isPageScrollLocked:T&&s,xstyle:u,onDismiss:L,onScrimOpacity:ne,onScrimFade:ie,onElementChange:R,handleRef:V,onMotionStart:ae,onMotionComplete:H,children:(0,Q.jsx)(Mg,{dialogRef:f,isOpen:y&&s,children:(0,Q.jsx)(sn,{children:(0,Q.jsx)(qD,{value:!0,children:(0,Q.jsx)(FA,{value:y?IA:LA,children:i})})})})}),T&&(0,Q.jsx)(PA,{})]})}function eM({switcher:e,ref:t,sheetId:n,label:r,children:i,height:a=`capped`,snapPoints:o,purpose:s=`info`,xstyle:c,...l}){let{activeSheet:u,hasScrim:d,onActiveSheetChange:f,getSheetPhase:p,getSheetAlignmentOffset:m,hostSheet:h,isScrimOwner:g,isFlowClosing:_,registerSheetElement:v,registerSheetDialog:y,registerSheetPurpose:b,onBeforeSheetPresent:x,onBeforeSheetShow:S,isCoveredInTopLayer:C,onSheetEnterStart:w,onSheetTransitionComplete:T,onSheetScrimOpacityChange:E,stackView:D,dialogProps:O,onDialogCancel:k,onDialogClick:A,onDialogKeyDown:j,settledSheet:ee,releaseSettledSheet:M}=e,N=typeof n==`string`&&n.length>0,P=N?p(n):`hidden`,F=Zj(P,N?m(n):0),I=P===`active`||P===`entering`,L=P===`covered`||P===`aligning`||P===`fading`||P===`exiting`,R=P!==`hidden`,z=N&&R&&ee===n,te=P===`active`||P===`entering`,B=N&&g(n),ne=L||d&&D.isBlocked,re=N&&h===n,ie=(0,Z.useRef)(null),V=(0,Z.useRef)(null),ae=(0,Z.useRef)(null),H=(0,Z.useRef)(P),U=H.current,W=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{H.current=P},[P]);let oe=(0,Z.useCallback)(()=>{s===`info`&&N&&u===n&&f(null)},[u,N,f,s,n]),G=(0,Z.useCallback)(e=>{ae.current=e,N&&v(n,e)},[N,v,n]),K=(0,Z.useCallback)(e=>{ie.current=e,N&&y(n,e)},[N,y,n]),se=(0,Z.useCallback)(e=>{e===`entering`&&N&&w(n)},[N,w,n]),q=(0,Z.useCallback)(e=>{N&&T({sheetId:n,phase:e})},[N,T,n]),ce=(0,Z.useCallback)(e=>{N&&E(n,e)},[N,E,n]),le=(0,Z.useRef)(null),ue=(0,Z.useCallback)((e,t)=>{Xj(e.closest(`dialog`),t,le)},[]);(0,Z.useLayoutEffect)(()=>{if(N)return b(n,s),()=>b(n,null)},[N,s,b,n]),(0,Z.useLayoutEffect)(()=>{let e=ie.current;if(e==null||!N)return;if(!R){e.open&&e.close(),V.current=null;return}let t=d?`modal`:`non-modal`;e.open&&V.current!==t&&e.close(),e.open&&d&&I&&C(n)&&e.close(),e.open||(d?(x(n),B?dj(e):fj(e)):(S(),e.show())),V.current=t},[d,N,C,I,R,x,S,B,n]),(0,Z.useLayoutEffect)(()=>()=>{let e=ie.current;e?.open&&e.close()},[]),(0,Z.useEffect)(()=>{if(I){let e=U===`active`||U===`entering`;W.current&&e||Qj(ae.current,d),W.current=!0}else P===`hidden`&&(W.current=!1)},[d,I,P,U]),ro(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",I&&!r);let{className:de,style:fe,xstyle:pe,"aria-label":me,"aria-labelledby":he,id:ge,"data-testid":_e,...ve}=O,Y=hn(J(Kj.dialog,R&&Kj.dialogOpen,d&&Kj.scrim,d&&z&&Kj.scrimSettled,d&&B&&_&&Kj.scrimClosing,!d&&Kj.dialogNonModalItem,!d&&te&&Kj.dialogNonModalItemTop,pe),de,fe);return(0,Q.jsxs)(`dialog`,{...ve,...Y,id:re?ge:void 0,"data-testid":re?_e:void 0,ref:K,"aria-label":me??(he==null?r:void 0),"aria-labelledby":he,"aria-modal":d&&I?`true`:void 0,"aria-hidden":ne?`true`:void 0,inert:ne?!0:void 0,"data-sheet-stack":d&&R?Jj(D,u!=null):void 0,"data-sheet-stack-depth":d&&R&&D.depth>0?D.depth:void 0,role:s===`required`?`alertdialog`:ve.role,onCancel:k,onKeyDown:j,...Rt({...ve,onClick:A}),children:[(0,Q.jsx)(`div`,{...J(Kj.positioner,!R&&Kj.positionerHidden,te&&Kj.positionerTop,...d?qj(D):[]),hidden:!R,"aria-hidden":ne?`true`:void 0,inert:ne?!0:void 0,children:(0,Q.jsx)(NA,{...l,ref:t,state:F,isEntrySettled:z,onEntrySettled:M,isOpenRequested:N&&u===n,height:a,label:r,snapPoints:o,isSwipeDismissAllowed:s===`info`,isPageScrollLocked:d,xstyle:c,onDismiss:oe,onScrimOpacity:ce,onScrimFade:ue,onElementChange:G,onMotionStart:se,onMotionComplete:q,children:(0,Q.jsx)(Wj,{value:null,children:(0,Q.jsx)(Mg,{dialogRef:ie,isOpen:R&&d,children:(0,Q.jsx)(sn,{children:(0,Q.jsx)(qD,{value:!0,children:(0,Q.jsx)(FA,{value:I?IA:LA,children:i})})})})})})}),R&&(0,Q.jsx)(PA,{})]})}function tM(e){let t=(0,Z.use)(Wj),n=e.sheetId,r=typeof n==`string`&&n.length>0;return ro(`BottomSheet`,"requires a non-empty `sheetId` when nested in BottomSheetSwitcher; standalone `isOpen` / `onOpenChange` props are ignored there.",t!=null&&!r),ro(`BottomSheet`,"`sheetId` only works inside BottomSheetSwitcher. Use `isOpen` and `onOpenChange` for a standalone sheet.",t==null&&n!=null),t==null?(0,Q.jsx)($j,{...e}):(0,Q.jsx)(eM,{...e,switcher:t})}tM.displayName=`BottomSheet`;var nM={daySize:`44px`,wheelItemSize:`28px`};nM.daySize,nM.wheelItemSize;var rM=6;function iM(e,t=`all`,n={}){let{isEnabled:r=!0,onSwipe:i,isPointerKept:a=!1}=n,o=(0,Z.useRef)(i);o.current=i,(0,Z.useEffect)(()=>{let n=e.current;if(n==null||!r)return;let i=null,s=0,c=0,l=0,u=0,d=!1,f=e=>{let r=e.touches[0];s=r?.clientX??0,c=r?.clientY??0,l=s,u=n.scrollLeft,d=!1,i=t===`all`||null,i&&e.stopPropagation()},p=e=>{if(i===!1)return;let t=e.touches[0];if(t!=null){if(i==null){let e=Math.abs(t.clientX-s),n=Math.abs(t.clientY-c);if(Math.max(e,n)<rM||(i=n<=e*2,!i))return}l=t.clientX,d||=Math.abs(n.scrollLeft-u)>=1,e.stopPropagation()}},m=()=>{i===!0&&t===`inline`&&!d&&Math.abs(l-s)>=32&&o.current?.(l<s?1:-1),i=null},h=e=>e.stopPropagation(),g=t===`all`&&a;return n.addEventListener(`touchstart`,f,{passive:!0}),n.addEventListener(`touchmove`,p,{passive:!0}),n.addEventListener(`touchend`,m,{passive:!0}),n.addEventListener(`touchcancel`,m,{passive:!0}),g&&n.addEventListener(`pointerdown`,h),()=>{n.removeEventListener(`touchstart`,f),n.removeEventListener(`touchmove`,p),n.removeEventListener(`touchend`,m),n.removeEventListener(`touchcancel`,m),g&&n.removeEventListener(`pointerdown`,h)}},[e,t,r,a])}function aM(e){let t=(0,Z.useRef)(null);return(0,Z.useMemo)(()=>({start:e=>{t.current=e},current:()=>t.current,end:()=>{t.current=null},endsOnKey:t=>e?.has(t)??!0}),[e])}function oM(e,t,n=!0,r,i){let a=(0,Z.useRef)(t);a.current=t;let o=(0,Z.useRef)(!0);return(0,Z.useEffect)(()=>{let t=e.current;if(t==null||!n){o.current=!0;return}let s,c=!1,l=!1,u=!1,d=()=>{r?.current&&(u=!0),c||l||r?.current||(c=!0,o.current=!0,clearTimeout(s),a.current(t))},f=()=>{clearTimeout(s),s=setTimeout(d,220)},p=()=>{c=!1,o.current=!1,r?.current&&(u=!0),f()},m=()=>{l=!0,c=!1,o.current=!1,clearTimeout(s)},h=()=>{l=!1,f()},g=()=>{i?.end()},_=e=>{i?.endsOnKey(e.key)===!0&&i.end()},v=()=>{u&&(u=!1,f())};return t.addEventListener(`scroll`,p,{passive:!0}),t.addEventListener(`scrollend`,d),t.addEventListener(`touchstart`,m,{passive:!0}),t.addEventListener(`touchend`,h,{passive:!0}),t.addEventListener(`touchcancel`,h,{passive:!0}),t.addEventListener(`pointerup`,v),t.addEventListener(`pointercancel`,v),t.addEventListener(`touchstart`,g,{passive:!0}),t.addEventListener(`wheel`,g,{passive:!0}),t.addEventListener(`pointerdown`,g,{passive:!0}),t.addEventListener(`keydown`,_,{passive:!0}),()=>{clearTimeout(s),i?.end(),t.removeEventListener(`scroll`,p),t.removeEventListener(`scrollend`,d),t.removeEventListener(`touchstart`,m),t.removeEventListener(`touchend`,h),t.removeEventListener(`touchcancel`,h),t.removeEventListener(`pointerup`,v),t.removeEventListener(`pointercancel`,v),t.removeEventListener(`touchstart`,g),t.removeEventListener(`wheel`,g),t.removeEventListener(`pointerdown`,g),t.removeEventListener(`keydown`,_)}},[e,n,r,i]),{isAtRestRef:o}}function sM(e,t){return e*12+(t-1)}function cM(e){return sM(e.year,e.month)}function lM(e){return{year:Math.floor(e/12),month:(e%12+12)%12+1}}function uM(e,t,n){return Math.min(Math.max(e,t),n)}function dM(e,t,n,r=!1){if(t<=0)return 0;let i=r?-e:e;return uM(Math.round(i/t),0,n-1)}function fM(e,t,n=!1){let r=e*t;return n?-r:r}function pM(e,t,n){return{start:Math.max(0,e-n),end:Math.min(t-1,e+n)}}function mM({start:e,end:t}){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}var hM=new Map;function gM(e){let t=hM.get(e);return t??(t={calendar:e,indexOf:cM,monthAt:t=>{let{year:n,month:r}=lM(t);return Cp(e,n,r)},yearMonthAt:lM,indexOfYearMonth:sM,monthsInYear:()=>12,shiftYears:(e,t)=>e+t*12},hM.set(e,t)),t}var _M={year:2e3,month:1,day:1};function vM(e){let t=ep(e,_M),n=new Map,r=r=>{let i=n.get(r);return i??(i=ip(e,t,r),n.set(r,i)),i},i=n=>Sp(e,t,ep(e,n));return{calendar:e,indexOf:i,monthAt:r,yearMonthAt:t=>np(e,r(t)),indexOfYearMonth:(t,n)=>i(Cp(e,t,n).start),monthsInYear:t=>wp(e,t),shiftYears:(t,n)=>i(op(e,r(t).start,n))}}function yM(e){return Uf(e)?gM(e):vM(e)}function bM(e,t,n,r,i){let a=ap(e.calendar,t,n-e.indexOf(t));return r!=null&&Jp(a,r)?r:i!=null&&Yp(a,i)?i:a}nM.daySize;var xM=3,SM={passive:!0},CM={spacer:{kVAEAm:`x1n2onr6`,kZKoxP:`x5yr21d`,$$css:!0},pane:{kVAEAm:`x10l6tqk`,kYYq5F:`x10no89f`,kZKoxP:`xm8gem`,k5xd4v:`x1bhewko`,k1xSpc:`xrvj5dj`,kumcoG:`x1mzazjb`,k9llMU:`xy8nx85`,$$css:!0},day:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,k7Eaqz:`x1tutbut`,kAzted:`x1dg37ty`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kMwMTN:`x1tgivj0`,kGuDYH:`xjm74w1`,kLWn49:`xw6l6zx`,k63SB2:`x1sodnla`,kkrTdU:`x1ypdohk x16khyan`,kfSwDN:`x87ps6o`,kQizK7:`x1i10hfl`,$$css:!0},dayOutside:{kMwMTN:`xv1l7n4`,kSiTet:`xbyyjgo`,$$css:!0},dayDisabled:{kSiTet:`xuzhngd`,kkrTdU:`xt0e3qv`,$$css:!0}},wM={kzqmXN:`x1uyokj7`,$$css:!0},TM={kLqNvP:`x1lxsm33`,kzqmXN:`x1uyokj7`,$$css:!0},EM={spacer:e=>[wM,{"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(`${e}px`)}],pane:(e,t)=>[TM,{"--x-insetInlineStart":(e=>typeof e==`number`?e+`px`:e??void 0)(`${e}px`),"--x-inlineSize":(e=>typeof e==`number`?e+`px`:e??void 0)(`${t}px`)}]};function DM({handleRef:e,monthModel:t,minMonthIndex:n,maxMonthIndex:r,initialMonthIndex:i,onVisibleMonthChange:a,selectedDate:o,today:s,isDateDisabled:c,weekStartsOn:l,onSelect:u}){let d=(0,Z.useRef)(null),f=r-n+1,[p,m]=(0,Z.useState)(0),h=jm()===`rtl`,[g,_]=(0,Z.useState)(i-n),v=(0,Z.useRef)(g),[y,b]=(0,Z.useState)(0),x=(0,Z.useRef)(!1),S=(0,Z.useCallback)((e,t)=>{x.current||(e.style.scrollSnapType=`none`,b(e=>e+1)),_(t)},[]);(0,Z.useLayoutEffect)(()=>{let e=d.current;if(y===0||e==null)return;let t=requestAnimationFrame(()=>{e.style.scrollSnapType=``});return()=>cancelAnimationFrame(t)},[y]);let C=(0,Z.useRef)(null),w=aM(),[T,E]=(0,Z.useState)(null),D=(0,Z.useRef)(!1),O=(0,Z.useRef)(a);O.current=a,(0,Z.useLayoutEffect)(()=>{let e=d.current;if(e==null)return;let t=()=>{let t=e.clientWidth;t>0&&m(t)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let k=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{let e=d.current;e==null||p===0||k.current||(k.current=!0,e.scrollLeft=fM(i-n,p,h))},[p,i,n,h]);let A=(0,Z.useRef)(null),j=(0,Z.useCallback)(()=>{A.current?.cancel(),A.current=null},[]);(0,Z.useEffect)(()=>j,[j]);let ee=(0,Z.useCallback)((e,t=`smooth`)=>{j();let r=d.current;if(r==null||p===0)return;let i=Math.min(f-1,Math.max(0,e-n));if(Math.abs(i-v.current)>xM){C.current=i,v.current=i,w.start(i),S(r,i);return}let a=fM(i,p,h),o=t===`smooth`?Za(r):null;if(o!=null){let e=()=>{w.end(),i===v.current?r.scrollTo({left:a,behavior:`auto`}):(C.current=i,v.current=i,_(i))};if(o.duration===0){e();return}A.current=to(r,o,()=>{A.current=null,(0,rh.flushSync)(e)})}else w.start(i),r.scrollTo({left:a,behavior:t})},[p,n,f,h,S,j,w]);(0,Z.useLayoutEffect)(()=>{let e=C.current,t=d.current;e!=null&&t!=null&&p!==0&&(C.current=null,t.scrollTo({left:fM(e,p,h),behavior:`auto`}))}),(0,Z.useImperativeHandle)(e,()=>({scrollToMonth:ee}),[ee]);let M=(0,Z.useRef)(void 0);(0,Z.useEffect)(()=>()=>{M.current!=null&&cancelAnimationFrame(M.current)},[]),oM(d,e=>{if(x.current=!1,p===0)return;let t=e.scrollLeft;M.current!=null&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{if(M.current=void 0,Math.abs(e.scrollLeft-t)>=.5)return;let n=fM(w.current()??dM(e.scrollLeft,p,f,h),p,h);Math.abs(e.scrollLeft-n)<1?w.end():e.scrollTo({left:n,behavior:`smooth`})})},!0,void 0,w),iM(d,`inline`,{onSwipe:e=>{let t=d.current;t!=null&&p!==0&&t.scrollBy({left:e*p,behavior:`smooth`})}});let N=(0,Z.useRef)(void 0);(0,Z.useEffect)(()=>{let e=d.current;if(e==null||p===0)return;let t=()=>{x.current=!0},r=()=>{N.current??=requestAnimationFrame(()=>{N.current=void 0;let t=dM(e.scrollLeft,p,f,h);if(t===v.current)return;v.current=t,S(e,t);let r=w.current();r==null?O.current(n+t):r===t&&w.end()})};return e.addEventListener(`scroll`,r,SM),e.addEventListener(`touchstart`,t,SM),()=>{e.removeEventListener(`scroll`,r,SM),e.removeEventListener(`touchstart`,t,SM),N.current!=null&&(cancelAnimationFrame(N.current),N.current=void 0)}},[p,f,n,h,S,w]);let P=(0,Z.useCallback)((e,i)=>{let a=Wp(e,i),o=t.indexOf(a);o<n||o>r||(D.current=!0,E(a),o!==t.indexOf(e)&&ee(o,`smooth`))},[t,n,r,ee]),F=(0,Z.useCallback)((e,t)=>{let n=(Hp(t)-l+7)%7,r=h?`ArrowLeft`:`ArrowRight`,i=h?`ArrowRight`:`ArrowLeft`;switch(e.key){case i:e.preventDefault(),P(t,-1);break;case r:e.preventDefault(),P(t,1);break;case`ArrowUp`:e.preventDefault(),P(t,-7);break;case`ArrowDown`:e.preventDefault(),P(t,7);break;case`Home`:e.preventDefault(),P(t,-n);break;case`End`:e.preventDefault(),P(t,6-n)}},[h,P,l]),I=T==null?null:Lp(T);(0,Z.useEffect)(()=>{if(!D.current||I==null)return;let e=d.current?.querySelector(`[data-date="${I}"]:not([data-outside])`);e!=null&&(D.current=!1,e.focus({preventScroll:!0}))},[I]);let L=pM(g,f,xM),R=(0,Z.useCallback)(e=>{E(t=>t!=null&&Xp(t,e)?t:e)},[]);return(0,Q.jsx)(`div`,{ref:d,"data-scroller":`months`,className:`x1n2onr6 xm8gem x9f619 xw2csxc x10wlt62 xhfbhpw xish69e x1rohswg x1bblx7b`,children:(0,Q.jsx)(`div`,{...J(CM.spacer,EM.spacer(f*p)),children:p>0&&mM(L).map(e=>(0,Q.jsx)(OM,{monthModel:t,monthIndex:n+e,insetInlineStart:e*p,inlineSize:p,selectedDate:o,focusedDate:T,today:s,isDateDisabled:c,weekStartsOn:l,onSelect:u,onDayKeyDown:F,onDayFocus:R},e))})})}DM.displayName=`MonthScroller`;function OM({monthModel:e,monthIndex:t,insetInlineStart:n,inlineSize:r,selectedDate:i,focusedDate:a,today:o,isDateDisabled:s,weekStartsOn:c,onSelect:l,onDayKeyDown:u,onDayFocus:d}){let f=Am(),{calendar:p}=e,m=(0,Z.useMemo)(()=>e.monthAt(t),[e,t]),{weeks:h}=vD({...np(p,m),calendar:p,weekStartsOn:c,hasVariableRowCount:!1}),g=lp(p,m,f),_=a!=null&&sp(a,m)?Lp(a):i!=null&&sp(i,m)?Lp(i):Lp(m.start);return(0,Q.jsx)(`div`,{role:`grid`,"aria-label":g,"data-month":g,...J(CM.pane,EM.pane(n,r)),children:h.map(e=>(0,Q.jsx)(`div`,{role:`row`,className:`xjp7ctv`,children:e.map(e=>{let t=e.isOutside||s(e.date),n=!e.isOutside&&i!=null&&Xp(e.date,i),r=!e.isOutside&&o!=null&&Xp(e.date,o);return(0,Q.jsx)(`div`,{role:`gridcell`,"aria-selected":n||void 0,className:`x1n2onr6 x78zum5 x6s0dn4 xl56j7k`,children:(0,Q.jsx)(`button`,{type:`button`,"data-date":e.iso,"data-outside":e.isOutside?``:void 0,tabIndex:e.iso===_?0:-1,"aria-label":hp(p,e.date,em,f),"aria-disabled":t||void 0,"aria-current":r?`date`:void 0,onClick:()=>{t||l(e.iso)},onFocus:()=>d(e.date),onKeyDown:t=>u(t,e.date),...J(CM.day,oe.focusVisible,e.isOutside&&CM.dayOutside,t&&CM.dayDisabled),children:(0,Q.jsx)(`span`,{...{0:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 x9r1u3d xjbqb8w xzo0q3i xuedmi6`},4:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 x9r1u3d xzo0q3i xuedmi6 xjbqb8w x150ydqw xoevpu5`},2:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xjbqb8w xzo0q3i xuedmi6 xvy26l8 x2mo6ok`},6:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 xjbqb8w x150ydqw xoevpu5 xvy26l8 x2mo6ok`},1:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok`},5:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok`},3:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok`},7:{className:`x78zum5 x6s0dn4 xl56j7k x1y2t9nm xw1wawg xjspbzw x1litavf x1y0btm7 xzo0q3i xuedmi6 x1ewilqj x1spg45b xad5do x17wrial x2mo6ok`}}[!t<<2|!!r<<1|!!n],children:gm(e.dayNumber,f)})})},e.iso)})},e[0].iso))})}OM.displayName=`MonthPane`;var kM=U,AM=class extends Jb{get kind(){return`tap`}get family(){return`tap`}tapCount=0;isTapInProgress=!1;maxTouchesThisTap=0;firstTapLocation=null;tapStarts=new Map;tapLifts=new Map;constructor(e={}){super(e),this.numberOfTapsRequired=e.numberOfTapsRequired??1,this.numberOfTouchesRequired=e.numberOfTouchesRequired??1,this.allowableMovement=e.allowableMovement??kM.allowableMovement.value,this.maximumIntervalBetweenTaps=e.maximumIntervalBetweenTaps??kM.maximumIntervalBetweenTaps.value,this.allowableSeparation=e.allowableSeparation??kM.allowableSeparation.value,this.maximumTapDuration=e.maximumTapDuration??kM.maximumTapDuration.value}get isDiscrete(){return!0}get nativeTouchBehavior(){return Kb}get completedTaps(){return this.tapCount}isInvolved(){return super.isInvolved()||this.tapCount>0}touchesBegan(e,t){this.isTapInProgress||(this.isTapInProgress=!0,this.tapStarts.clear(),this.tapLifts.clear(),this.maxTouchesThisTap=0,this.clearTimer(),Number.isFinite(this.maximumTapDuration)&&this.setTimer(t.time+this.maximumTapDuration,()=>{this.setState(`failed`)}));for(let t of e)this.tapStarts.set(t.id,{x:t.startX,y:t.startY});this.maxTouchesThisTap=Math.max(this.maxTouchesThisTap,this.numberOfTouches),(this.numberOfTouches>this.numberOfTouchesRequired||this.firstTapLocation!=null&&this.tapStarts.size===this.numberOfTouchesRequired&&Xb(jM(this.tapStarts.values()),this.firstTapLocation)>this.allowableSeparation)&&this.setState(`failed`)}touchesMoved(e){e.some(e=>Zb(e)>this.allowableMovement)&&this.setState(`failed`)}touchesEnded(e,t){if(e.some(e=>Zb(e)>this.allowableMovement))this.setState(`failed`);else{for(let t of e)this.tapLifts.set(t.id,{x:t.x,y:t.y});this.numberOfTouches-e.length>0||(this.isTapInProgress=!1,this.clearTimer(),this.maxTouchesThisTap===this.numberOfTouchesRequired?(this.tapCount+=1,this.firstTapLocation??=jM(this.tapLifts.values()),this.tapCount>=this.numberOfTapsRequired?this.setState(`ended`):this.setTimer(t.time+this.maximumIntervalBetweenTaps,()=>{this.setState(`failed`)})):this.setState(`failed`))}}reset(){this.tapCount=0,this.isTapInProgress=!1,this.maxTouchesThisTap=0,this.firstTapLocation=null,this.tapStarts.clear(),this.tapLifts.clear()}};function jM(e){let t=0,n=0,r=0;for(let i of e)t+=i.x,n+=i.y,r+=1;return r===0?{x:0,y:0}:{x:t/r,y:n/r}}var MM={geometry:{rowHeight:32,height:216,rubberBandDimension:291},release:{stopSpeed:.0089,minimumSpeed:.25},snapRate:.011,tapSpin:{durationMs:300},selectionTick:{minimumIntervalMs:40}};function NM(){o(`picker`,MM,{roles:[`tapSpin.durationMs`]})}NM();function PM(e,t,n){return Math.abs(e-t)*2<=n?e:Math.round(t+((FM(e,n)-FM(t,n)+n+n/2)%n-n/2))}function FM(e,t){return(e%t+t)%t}var IM=10;function LM({label:e,options:t,value:n,activeIndex:r,stepBy:i,toEnd:a,activate:o}){let s=(0,Z.useId)(),c=(0,Z.useCallback)(e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),i(1);break;case`ArrowUp`:e.preventDefault(),i(-1);break;case`PageDown`:e.preventDefault(),i(IM);break;case`PageUp`:e.preventDefault(),i(-10);break;case`Home`:e.preventDefault(),a(`first`);break;case`End`:e.preventDefault(),a(`last`)}},[i,a]);return{listboxProps:{role:`listbox`,"aria-label":e,"aria-activedescendant":`${s}-${t[r]?.value}`,tabIndex:0,onKeyDown:c},optionProps:(e,t)=>({id:`${s}-${e.value}`,role:`option`,"aria-selected":e.value===n,"aria-disabled":e.isDisabled||void 0,onClick:()=>o(t)})}}function RM(){return typeof navigator<`u`&&typeof navigator.vibrate==`function`}function zM(e){return RM()?navigator.vibrate([..._e[e].value]):!1}T(`gestures/haptics/label-id`,1);var BM=MM.geometry.rowHeight,VM=1/6;function HM(e){return e/BM}function UM({rowHeight:e,rowCount:t,looping:n}){return n?{min:-1/0,max:1/0}:{min:0,max:Math.max(0,t-1)*e}}function WM(e,t){let{min:n,max:r}=UM(t),i=MM.geometry.rubberBandDimension*HM(t.rowHeight);return e<n?n+I_(e-n,i):e>r?r+I_(e-r,i):e}function GM(e,t){let n=Math.round(e/t.rowHeight);return t.looping?n:Math.min(Math.max(n,0),Math.max(0,t.rowCount-1))}function KM(e,t,n=1){let r=e-t,i=MM.snapRate*1e3,a=VM*n;if(Math.abs(r)<=a)return{duration:0,to:t,value:()=>t,velocity:()=>0};let o=Math.log(Math.abs(r)/a)/i;return{duration:o,to:t,value:e=>e>=o?t:t+r*Math.exp(-i*e),velocity:e=>e>=o?0:-i*r*Math.exp(-i*e)}}function qM(e,t,n,r=1){let i=MM.release.stopSpeed*1e3*r,a=n-e,o=Math.abs(t);if(a===0||Math.sign(a)!==Math.sign(t)||o<=i)return KM(e,n,r);let s=Math.sign(a),c=(o-i)/Math.abs(a),l=Math.log(o/i)/c;return{duration:l,to:n,value:t=>t>=l?n:e+s*o*-Math.expm1(-c*t)/c,velocity:e=>e>=l?0:s*o*Math.exp(-c*e)}}function JM(e,t,n,r=1,i=Y.bounce){let a=$a(Xa(i),{from:e,to:n,velocity:t}),o=Math.min(30,a.settleTime(VM*r));return{duration:o,to:n,value:e=>e>=o?n:a.value(e),velocity:e=>e>=o?0:a.velocity(e)}}function YM(e,t,n,r=1,i=Y.bounce){let a=dD({from:e,velocity:t}),o=a.timeToReach(n);if(o==null)return JM(e,t,n,r,i);let s=JM(n,a.velocity(o),n,r,i),c=Math.min(30,o+s.duration);return{duration:c,to:n,value:e=>e>=c?n:e<o?a.value(e):s.value(e-o),velocity:e=>e>=c?0:e<o?a.velocity(e):s.velocity(e-o)}}function XM(e,t,n=1){let r=MM.release.stopSpeed*1e3*n,i=Math.abs(t);return i<=r?e:e+Math.sign(t)*Da(i-r)}function ZM(e,t,n,r=Y.bounce){let i=HM(n.rowHeight),{min:a,max:o}=UM(n);if(e<a||e>o){let s=e<a?a:o;return{kind:`return`,index:GM(s,n),curve:JM(e,t,s,i,r)}}let s=MM.release.minimumSpeed*1e3*i,c=Math.abs(t)<s?0:t,l=XM(e,c,i);if(l<a||l>o){let t=l<a?a:o;return{kind:`edge`,index:GM(t,n),curve:YM(e,c,t,i,r)}}let u=GM(l,n),d=u*n.rowHeight;if(c===0)return{kind:`snap`,index:u,curve:KM(e,d,i)};let f=qM(e,c,d,i);return{kind:f.duration>0?`coast`:`snap`,index:u,curve:f}}function QM(e,t,{after:n=0,until:r=e.duration,last:i=-1/0,step:a=1/240}={}){let o=MM.selectionTick.minimumIntervalMs/1e3,s=[],c=e.value(n),l=i;for(let i=n+a;i<r+a;i+=a){let n=Math.min(i,r),a=e.value(n);if($M(c,a,t)&&n-l>=o&&(s.push(n),l=n),c=a,n===r)break}return s}function $M(e,t,n){return t>e?Math.floor(t/n)>Math.floor(e/n):t<e&&Math.ceil(t/n)<Math.ceil(e/n)}function eN(){let e=typeof document<`u`?document.timeline?.currentTime:null;return typeof e==`number`?e:performance.now()}function tN(e){let t=Ka(null),n=e,r=null,i=null,a=null,o=-1/0,s=null,c=e=>-t.get(`y`,e),l=e=>{let t=GM(e,n);t!==a&&(a=t,i?.(t))},u=e=>{e-o<MM.selectionTick.minimumIntervalMs||(o=e,zM(`selection`))},d=e=>{for(let t of e.timers)clearTimeout(t);e.timers.length=0,r===e&&(r=null)},f=(e,t,{endMs:i,ticks:a,landingMs:o})=>{for(let t of e.timers)clearTimeout(t);e.timers.length=0;let s=eN()-t;if(a)for(let t of QM(e.curve,n.rowHeight))e.timers.push(setTimeout(()=>{r===e&&u(eN())},Math.max(0,t*1e3-s)));o!=null&&e.timers.push(setTimeout(()=>{r===e&&l(e.curve.to)},Math.max(0,o-s))),e.timers.push(setTimeout(()=>{r===e&&(d(e),l(e.curve.to),e.onEnd?.(`arrived`,e.curve.to))},Math.max(0,i-s)))},p=e=>{let n=r;if(n==null)return c();let i=c(e);return d(n),t.set({y:-i}),l(i),n.onEnd?.(`stopped`,i),i};return{attach(e){t.attach(e)},setLayout(e){n=e},onNearestChange(e){i=e,a=null},isMoving(){return r!=null},offset(e){return c(e)},target(){return r?.curve.to??c()},setOffset(e,{ticks:i=!1}={}){r!=null&&p(),i&&s!=null&&RM()&&$M(s,e,n.rowHeight)&&u(eN()),s=e,t.set({y:-e},{promote:i}),l(e)},resetDrag(){s=null},stop:p,play(e,{ticks:n=!1,onEnd:i,touchRelease:a=!1,momentum:o=!1}={}){p(),s=null;let c=t.element,u=o?null:Za(c,{touchRelease:a}),d=u==null?e.duration*1e3:u.duration;if(!(d>0)){t.set({y:-e.to}),l(e.to),i?.(`arrived`,e.to);return}let m={duration:e.duration,at:t=>-e.value(t),velocity:t=>-e.velocity(t)},h=o?t.decay({y:m},{touchRelease:a}):t.play({y:m},{touchRelease:a}),g={curve:e,onEnd:i,timers:[]};r=g;let _={endMs:d,ticks:n&&u==null&&RM(),landingMs:u==null?null:d/2};f(g,eN(),_),h.started.then(e=>{r===g&&f(g,e,_)})},forgetNearest(){a=null},dispose(){p(),t.dispose()}}}function nN(e,t){let n=e[t];return n!=null&&!n.isDisabled}function rN(e,t,n){let r=t=>t>=0&&t<e.length&&!e[t].isDisabled;if(r(t))return t;for(let i=1;i<e.length;i++){let e=t-i,a=t+i,o=r(e),s=r(a);if(o&&s)return n<t?e:a;if(o)return e;if(s)return a}return n}function iN(e,t,n,r){if(e(t))return 0;for(let i=1;i<=r/2;i++){let r=e(t-i),a=e(t+i);if(r&&a)return n<t?-i:i;if(r)return-i;if(a)return i}return n-t}function aN(e){let t=e.map((e,t)=>t);return e.every(e=>e.order==null)?t:t.sort((t,n)=>(e[t].order??t)-(e[n].order??n))}function oN(e,t,n){let r=e.length;if(r===0||n===0)return null;let i=aN(e),a=Math.max(0,i.indexOf(t)),o=t=>!e[i[t]].isDisabled,s=Math.sign(n),c=Math.min(r-1,Math.max(0,a+n));for(let e=c;e>=0&&e<r;e+=s)if(o(e))return e===a?null:i[e];for(let e=c;e!==a;e-=s)if(o(e))return i[e];return null}function sN(e,t,n,r){let i=Math.sign(n),a=r<2?0:Math.abs(n)%r;if(a===0)return null;let o=t+i*a,s=Math.max(a,Math.floor(r/2));for(let n=o;Math.abs(n-t)<=s;n+=i)if(e(n))return n-t;for(let n=o-i;n!==t;n-=i)if(e(n))return n-t;return null}function cN(e,t){let n=aN(e).filter(t=>!e[t].isDisabled);return(t===`first`?n[0]:n[n.length-1])??null}var lN=28,uN=lN/MM.geometry.rowHeight,dN=MM.geometry.rubberBandDimension*uN,fN=10,pN={k87sOh:`x5mnzd7`,$$css:!0},mN={column:{kVAEAm:`x1n2onr6`,kUk6DE:`x1cqoux5`,k7Eaqz:`xeuugli`,kZKoxP:`xm8gem`,kVQacm:`xb3r6kr`,kI3sdo:`x1a2a7pz`,kQizK7:`x1i10hfl`,$$css:!0},row:{kVAEAm:`x10l6tqk`,kkqhue:`x17y0mx6`,kZKoxP:`x6hpsvf`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kg3NbH:`xf314gf`,kB7OPa:`x9f619`,kGuDYH:`x18juvz8`,kLWn49:`xf74fhv`,k63SB2:`x1sodnla`,kMwMTN:`x1tgivj0`,khDVqt:`xuxw1ft`,kVQacm:`xb3r6kr`,kg5iWk:`xlyipyv`,kfSwDN:`x87ps6o`,$$css:!0},rowActive:{kMwMTN:`xjse4m1`,k63SB2:`x2mo6ok`,$$css:!0},rowDisabled:{kMwMTN:`xnbbluu`,$$css:!0},rowAt:e=>[pN,{"--x-insetBlockStart":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function hN(){te(),Ya()}function gN(e,t,n){return hN(),JM(t,0,n,uN,no(e,Ga.settle))}function _N(e,t,n){return!n.looping||n.rowCount===0?e:e+Math.floor(t/n.rowCount)*n.rowCount}function vN(e){return{from:-10,to:e-1+fN}}function yN(e,t,n){return!n.looping||n.rowCount===0?e:PM(e,t/n.rowHeight,n.rowCount)}function bN(e){return e!=null&&!e.isDisabled}function xN({label:e,options:t,value:n,onChange:r,isActive:i=!0,ref:a,isLooping:o=!1}){let s=(0,Z.useRef)(null),c=(0,Z.useRef)(null),u=t.length,d=o&&u>1,f=(0,Z.useMemo)(()=>({rowHeight:lN,rowCount:u,looping:d}),[u,d]),p=(0,Z.useRef)(null),m=(0,Z.useRef)(null),h=(0,Z.useRef)(new Map),[g]=(0,Z.useState)(()=>tN(f)),_=Math.max(0,t.findIndex(e=>e.value===n)),y=(0,Z.useRef)(_),b=(0,Z.useRef)(null),x=(0,Z.useRef)(!1),S=(0,Z.useRef)({options:t,value:n,onChange:r,layout:f});G(()=>{S.current={options:t,value:n,onChange:r,layout:f}});let C=(0,Z.useCallback)(()=>{let{options:e,layout:t}=S.current,n=e.length;return r=>t.looping&&n>0?e[FM(r,n)]:e[r]},[]),w=(0,Z.useCallback)((e,t=!1)=>{let n=p.current,r=h.current;if(m.current=e,n==null)return;let i=S.current.options.length,a=C();for(let[n,i]of r)(t||e==null||n<e.from||n>e.to)&&(i.remove(),r.delete(n));if(e!=null)for(let t=e.from;t<=e.to;t++){if(t>=0&&t<i||r.has(t))continue;let e=a(t);if(e==null)continue;let o=document.createElement(`div`);o.className={0:{className:`x10l6tqk x17y0mx6 x6hpsvf x78zum5 x6s0dn4 xl56j7k xf314gf x9f619 x18juvz8 xf74fhv x1sodnla x1tgivj0 xuxw1ft xb3r6kr xlyipyv x87ps6o`},1:{className:`x10l6tqk x17y0mx6 x6hpsvf x78zum5 x6s0dn4 xl56j7k xf314gf x9f619 x18juvz8 xf74fhv x1sodnla xuxw1ft xb3r6kr xlyipyv x87ps6o xnbbluu`}}[!!e.isDisabled|0].className??``,o.style.insetBlockStart=`${t*lN}px`,o.textContent=e.label,n.append(o),r.set(t,o)}},[C]),T=(0,Z.useCallback)((e,t)=>{let n=m.current;if(n==null)return;let r=Math.min(n.from,Math.min(e,t)-fN),i=Math.max(n.to,Math.max(e,t)+fN);(r!==n.from||i!==n.to)&&w({from:r,to:i})},[w]);G(()=>{w(d?m.current??vN(u):null,!0)},[t,d,u,w]);let E=(0,Z.useRef)(new Set),D=(0,Z.useCallback)(e=>{let t=c.current;if(t==null||t.children.length===0)return;let{options:n,value:r}=S.current,i=e=>e>=0&&e<n.length?t.children[e]??null:h.current.get(e)??null,a=e==null?null:i(e),o=E.current;for(let e of o)e.style.removeProperty(`color`),e.style.removeProperty(`font-weight`);o.clear();let s=n.findIndex(e=>e.value===r),u=s<0?null:i(s);if(u!=null&&u!==a){let e=u;e.style.color=n[s]?.isDisabled?l[`--color-text-disabled`]:l[`--color-text-primary`],e.style.fontWeight=de[`--font-weight-normal`],o.add(e)}if(a==null||e==null)return;let d=C()(e);a.style.color=d?.isDisabled?l[`--color-text-disabled`]:l[`--color-text-accent`],a.style.fontWeight=de[`--font-weight-semibold`],o.add(a)},[C]),O=(0,Z.useCallback)((e,t={})=>{D(null),g.forgetNearest(),g.play(e,t)},[g,D]),k=(0,Z.useCallback)(e=>{let t=S.current,n=t.options.length;if(!t.layout.looping||n===0)return e;let r=GM(e,t.layout),i=r-FM(r,n);return i!==0&&(g.setOffset(e-i*lN),y.current-=i),w(vN(n)),e-i*lN},[g,w]),A=(0,Z.useCallback)(e=>{let t=S.current;e!=null&&!e.isDisabled&&e.value!==t.value&&t.onChange(e.value)},[]),j=(0,Z.useCallback)(e=>{let t=S.current,n=t.options.length,r=GM(e,t.layout),i=C(),a=0;if(t.layout.looping&&n>0){let e=PM(y.current,r,n);r!==e&&(a=iN(e=>bN(i(e)),r,e,n))}else{let e=t.options.findIndex(e=>e.value===t.value);r!==e&&(a=rN(t.options,r,Math.max(0,e))-r)}if(a!==0){let t=r+a;T(r,t),O(gN(s.current,e,t*lN),{onEnd:(e,t)=>{e===`arrived`&&j(t)}});return}let o=i(r);y.current=GM(k(e),t.layout),A(o)},[O,T,k,A,C]),ee=(0,Z.useCallback)((e,t)=>{e===`arrived`&&j(t)},[j]),M=(0,Z.useCallback)(e=>(c.current=e,g.attach(e),()=>{c.current=null,g.attach(null)}),[g]);G(()=>{g.setLayout(f)},[g,f]),G(()=>(g.onNearestChange(D),()=>g.onNearestChange(null)),[g,D]),G(()=>{if(!(g.isMoving()||b.current!=null||GM(g.offset(),f)!==_)){for(let e of E.current)e.style.removeProperty(`color`),e.style.removeProperty(`font-weight`);E.current.clear()}}),(0,Z.useEffect)(()=>()=>g.dispose(),[g]);let N=(0,Z.useRef)(!1),P=(0,Z.useRef)(null);G(()=>{if(!i){N.current=!1;return}if(b.current!=null||g.isMoving()&&P.current==null)return;let e=g.isMoving()?g.stop():g.offset(),t=yN(_,e,f),n=t*lN,r=Math.abs(e-n)>.01;if(y.current=t,r&&N.current){let r={};P.current=r,T(GM(e,f),t),O(gN(s.current,e,n),{onEnd:(e,t)=>{P.current===r&&(P.current=null),e===`arrived`&&k(t)}})}else r&&(g.setOffset(_*lN),y.current=_),N.current=!0},[i,_,f,g,O,T,k]),(0,Z.useEffect)(()=>{i||(b.current=null,g.stop())},[i,g]);let F=(0,Z.useCallback)(e=>{x.current=g.isMoving(),x.current&&g.stop(e)},[g]),I=(0,Z.useRef)(F);G(()=>{I.current=F});let L=(0,Z.useCallback)(e=>{hN();let t=S.current.layout,n=ZM(g.offset(),e,t,no(s.current,Y.bounce));T(GM(g.offset(),t),n.index),O(n.curve,{ticks:!0,onEnd:ee,touchRelease:!0,momentum:n.kind===`coast`||n.kind===`edge`})},[g,O,ee,T]),R=vS(s,()=>new PT({name:`wheel-pan`,direction:`vertical`,allowedScrollTypes:[`continuous`],selectionLock:v,shouldReceiveTouch:(e,t)=>(I.current(t.time),!0)}),e=>{let{layout:t}=S.current;switch(e.state){case`began`:{let n=g.isMoving()?g.stop():g.offset();b.current={start:CN(n,t)},g.resetDrag(),g.setOffset(WM(b.current.start-e.translation().y,t),{ticks:!0});break}case`changed`:{let n=b.current;if(n==null)break;let r=WM(n.start-e.translation().y,t);if(t.looping){let e=GM(r,t);T(e,e)}g.setOffset(r,{ticks:!0});break}case`ended`:{let t=b.current;b.current=null,L(t==null?0:-e.scrollVelocity().y);break}case`cancelled`:b.current=null,L(0)}},{isEnabled:i});(0,Z.useEffect)(()=>R.addTransitionListener((e,t,n)=>{n===`failed`&&x.current&&!g.isMoving()&&L(0)}),[R,g,L]),vS(s,()=>new AM({name:`wheel-tap`}),e=>{if(e.state!==`ended`||x.current)return;let t=s.current;if(t==null)return;let n=t.getBoundingClientRect(),{y:r}=e.location(),i=g.offset(),a=S.current.layout,o=SN(r-(n.top+n.height/2),i,a);o!=null&&o!==GM(i,a)&&(T(GM(i,a),o),O(gN(s.current,i,o*lN),{onEnd:ee}))},{isEnabled:i}),iM(s,`all`,{isEnabled:i,isPointerKept:!0});let z=(0,Z.useCallback)(async e=>new Promise(t=>{if(!nN(S.current.options,e)){t(!1);return}let n=g.offset(),r=S.current.layout,i=yN(e,n,r);y.current=i,T(GM(n,r),i),O(gN(s.current,n,i*lN),{onEnd:(e,n)=>{e===`arrived`&&j(n),t(e===`arrived`)}})}),[g,O,j,T]);(0,Z.useImperativeHandle)(a,()=>({spinTo:z}),[z]);let te=(0,Z.useCallback)((e,t)=>{let n=S.current,r=n.options.length,i=C()(e),a=n.layout.looping&&r>0?e-FM(e,r):0,o=t-a*lN,c=e-a;a!==0&&g.setOffset(o),y.current=c,T(GM(o,n.layout),c),O(gN(s.current,o,c*lN)),A(i)},[g,O,T,A,C]),B=(0,Z.useCallback)(e=>{let t=S.current;if(t.options.length===0||e===0)return;if(t.layout.looping){let n=C(),r=GM(g.target(),t.layout),i=sN(e=>bN(n(e)),r,e,t.options.length);if(i==null)return;let a=g.isMoving()?g.stop():g.offset();te(r+i,a);return}let n=oN(t.options,GM(g.target(),t.layout),e);if(n==null)return;let r=g.isMoving()?g.stop():g.offset();te(n,r)},[g,te,C]);(0,Z.useEffect)(()=>{let e=s.current;if(e==null||!i)return;let t=e=>{e.defaultPrevented||e.ctrlKey||e.shiftKey||e.deltaY===0||Math.abs(e.deltaX)>Math.abs(e.deltaY)||rS(e)!==`discrete`||(e.preventDefault(),B(Math.sign(e.deltaY)))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[i,B]);let{listboxProps:ne,optionProps:re}=LM({label:e,options:t,value:n,activeIndex:_,stepBy:B,toEnd:(0,Z.useCallback)(e=>{let t=S.current,n=cN(t.options,e);if(n==null)return;let r=g.isMoving()?g.stop():g.offset();te(_N(n,y.current,t.layout),r)},[g,te]),activate:(0,Z.useCallback)(e=>{let t=_N(e,y.current,S.current.layout);if(!bN(C()(t)))return;let n=g.isMoving()?g.stop():g.offset();te(t,n)},[g,te,C])});return(0,Q.jsx)(`div`,{ref:s,...ne,"data-wheel":``,...J(mN.column,oe.focusVisible),children:(0,Q.jsxs)(`div`,{"data-wheel-fade":``,className:`x10l6tqk x10a8y8t x47corl xsshixw`,children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`x10l6tqk x17y0mx6 x7rbydg x6hpsvf xh6dtrn x17x4s8c x47corl`}),(0,Q.jsxs)(`div`,{ref:M,"data-wheel-strip":``,className:`x10l6tqk x17y0mx6 x7rbydg x47corl`,children:[t.map((e,t)=>(0,Q.jsx)(`div`,{...re(e,t),"data-wheel-row":``,"data-label":e.label,...J(mN.row,mN.rowAt(`${t*lN}px`),t===_&&mN.rowActive,e.isDisabled&&mN.rowDisabled),children:e.label},e.value)),d&&(0,Q.jsx)(`div`,{ref:p,"aria-hidden":`true`})]})]})})}xN.displayName=`PickerWheel`;function SN(e,t,n){let r=Math.round((t+e)/n.rowHeight);return!n.looping&&(r<0||r>=n.rowCount)?null:r}function CN(e,t){let{min:n,max:r}=UM(t),i=dN;return e<n?n+L_(e-n,i):e>r?r+L_(e-r,i):e}var wN=260;function TN(e,t=!0){let n=(0,Z.useRef)(!1);return(0,Z.useEffect)(()=>{let r=e.current;if(r==null||!t)return;let i=null,a=0,o=0;n.current=!1;let s=!1,c,l=()=>{window.clearTimeout(c),r.removeEventListener(`scrollend`,l),r.style.removeProperty(`scroll-snap-type`)},u=()=>{window.clearTimeout(c),r.removeEventListener(`scrollend`,l),r.style.scrollSnapType=`none`},d=e=>{e.pointerType===`mouse`&&e.button===0&&(e.stopPropagation(),i=e.pointerId,a=e.clientY,o=r.scrollTop,n.current=!1)},f=e=>{if(i!==e.pointerId)return;let t=e.clientY-a;if(!n.current){if(Math.abs(t)<4)return;n.current=!0,r.setPointerCapture(e.pointerId),u(),r.style.userSelect=`none`}r.scrollTop=o-t},p=e=>{if(i!==e.pointerId||(i=null,!n.current))return;n.current=!1,s=!0,r.style.removeProperty(`user-select`),r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId);let t=EN(r);if(t>0){let e=Math.round(r.scrollTop/t)*t,n=Za(r)==null?`smooth`:`instant`;r.scrollTo({top:e,behavior:n})}r.addEventListener(`scrollend`,l),c=window.setTimeout(l,wN)},m=e=>{s&&(s=!1,e.stopPropagation(),e.preventDefault())};return r.addEventListener(`pointerdown`,d),r.addEventListener(`pointermove`,f),r.addEventListener(`pointerup`,p),r.addEventListener(`pointercancel`,p),r.addEventListener(`click`,m,{capture:!0}),()=>{r.removeEventListener(`pointerdown`,d),r.removeEventListener(`pointermove`,f),r.removeEventListener(`pointerup`,p),r.removeEventListener(`pointercancel`,p),r.removeEventListener(`click`,m,{capture:!0}),n.current=!1,l()}},[e,t]),{isDraggingRef:n}}function EN(e){let t=e.querySelector(`[role="option"]`);return t instanceof HTMLElement?t.offsetHeight:0}nM.wheelItemSize;var DN={scroller:{kZKoxP:`xm8gem`,kB7OPa:`x9f619`,kORKVm:`x1odjw0f`,kXHlph:`x6ikm8r`,kc424l:`x168l2et`,kZeWKH:`xish69e`,k8WAf4:`x1uameg1`,kwFjlL:`x201tam`,kmaZ5I:`x1oyok0e`,k5wCbM:`x1rohswg`,kI3sdo:`x1a2a7pz`,kFalU9:`xge0x1e`,$$css:!0}};function ON(e){let{isTouch:t}=we();return t?(0,Q.jsx)(xN,{...e}):(0,Q.jsx)(jN,{...e})}ON.displayName=`Wheel`;var kN=3,AN=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]);function jN({label:e,options:t,value:n,onChange:r,isActive:i=!0,ref:a}){(0,Z.useImperativeHandle)(a,()=>({spinTo:async e=>{if(!nN(t,e))return!1;let i=t[e];return i.value!==n&&r(i.value),!0}}),[t,n,r]);let o=(0,Z.useRef)(null),s=Math.max(0,t.findIndex(e=>e.value===n)),[c,l]=(0,Z.useState)(s),{isDraggingRef:u}=TN(o,i),d=(0,Z.useCallback)(()=>{let e=o.current?.firstElementChild;return e instanceof HTMLElement&&e.offsetHeight>0?e.offsetHeight:0},[]),f=(0,Z.useRef)(null),p=aM(AN),m=(0,Z.useRef)(null),h=(0,Z.useRef)(null),g=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{h.current=null,g.current?.cancel(),g.current=null},[]);let _=(0,Z.useCallback)((e,t,{touchRelease:n=!1,isReAim:r=!1}={})=>{let i=o.current,a=d();if(i==null||a===0)return;let s=e*a;p.start(e),r||(m.current=null);let c=t===`smooth`?Za(i,{touchRelease:n}):null,l=h.current;if(c==null){h.current=null,i.scrollTo({top:s,behavior:t});return}if(c.duration===0||typeof i.animate!=`function`){h.current=null,i.scrollTo({top:s,behavior:`auto`});return}if(l!=null){l.top=s;return}let u=Number.parseFloat(getComputedStyle(i).opacity);g.current?.cancel();let f={top:s};h.current=f,g.current=to(i,c,()=>{h.current===f&&(h.current=null,i.scrollTo({top:f.top,behavior:`auto`}))},Number.isFinite(u)?u:1)},[d,p]),{isAtRestRef:v}=oM(o,e=>{let i=d();if(i===0)return;let a=p.current();if(a!=null){let t=e.scrollTop,n=m.current,r=Math.abs(t-a*i)>=1,o=n!=null&&(Math.abs(t-n.top)<1||n.count>=kN);if(r&&!o){m.current={top:t,count:(n?.count??0)+1},_(a,`smooth`,{isReAim:!0});return}p.end(),m.current=null}let o=Math.min(t.length-1,Math.max(0,Math.round(e.scrollTop/i))),c=o===s?o:rN(t,o,s);if(c!==o){_(c,`smooth`,{touchRelease:f.current===`touch`});return}let l=t[o];l!=null&&!l.isDisabled&&l.value!==n&&r(l.value)},i,u,p),y=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(!i){y.current=!1;return}if(!v.current||h.current!=null)return;let e=d(),t=o.current;t!=null&&e!==0&&(Math.round(t.scrollTop/e)!==s&&(y.current?_(s,`smooth`):t.scrollTo({top:s*e,behavior:`auto`})),y.current=!0,l(s))},[i,s,d,v,_]);let b=(0,Z.useRef)(void 0);(0,Z.useEffect)(()=>{let e=o.current;if(e==null||!i)return;let n=()=>{b.current??=requestAnimationFrame(()=>{b.current=void 0;let n=d();if(n===0)return;let r=Math.min(t.length-1,Math.max(0,Math.round(e.scrollTop/n)));l(r)})};return e.addEventListener(`scroll`,n,{passive:!0}),()=>{e.removeEventListener(`scroll`,n),b.current!=null&&(cancelAnimationFrame(b.current),b.current=void 0)}},[i,t.length,d]),iM(o,`all`,{isEnabled:i});let x=(0,Z.useCallback)(e=>{let i=e==null?void 0:t[e];e==null||i==null||i.isDisabled||(l(e),_(e,`smooth`),i.value!==n&&r(i.value))},[t,_,n,r]),{listboxProps:S,optionProps:C}=LM({label:e,options:t,value:n,activeIndex:c,stepBy:(0,Z.useCallback)(e=>x(oN(t,c,e)),[x,t,c]),toEnd:(0,Z.useCallback)(e=>x(cN(t,e)),[x,t]),activate:(0,Z.useCallback)(e=>{let i=t[e];i==null||i.isDisabled||(l(e),_(e,`smooth`),i.value!==n&&r(i.value))},[t,_,n,r])});return(0,Q.jsxs)(`div`,{className:`x1n2onr6 x1cqoux5 xeuugli`,children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`x10l6tqk x17y0mx6 x7rbydg x6hpsvf xh6dtrn x17x4s8c x47corl`}),(0,Q.jsx)(`div`,{ref:o,...S,onPointerDownCapture:e=>{f.current=e.pointerType},onWheel:()=>{f.current=`wheel`},...J(DN.scroller,oe.focusVisible),children:t.map((e,t)=>(0,Q.jsx)(`div`,{...C(e,t),...{0:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv x1sodnla x1tgivj0 xuxw1ft x1ypdohk x16khyan x87ps6o x1jbe559 xuedmi6`},4:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv x1sodnla x1tgivj0 xuxw1ft x1ypdohk x16khyan x87ps6o x1jbe559 xuedmi6 xssvwzl x190lv1 xg8s4dl x1u6ievf xwms9i0 x1esw782`},2:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv xuxw1ft x1ypdohk x16khyan x87ps6o x1jbe559 xuedmi6 xjse4m1 x2mo6ok`},6:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv xuxw1ft x1ypdohk x16khyan x87ps6o x1jbe559 xuedmi6 xssvwzl x190lv1 xg8s4dl x1u6ievf xwms9i0 x1esw782 xjse4m1 x2mo6ok`},1:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv x1sodnla xuxw1ft x87ps6o x1jbe559 xuedmi6 xnbbluu xt0e3qv`},5:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv x1sodnla xuxw1ft x87ps6o x1jbe559 xuedmi6 xssvwzl x190lv1 xg8s4dl x1u6ievf xwms9i0 x1esw782 xnbbluu xt0e3qv`},3:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv xuxw1ft x87ps6o x1jbe559 xuedmi6 x2mo6ok xnbbluu xt0e3qv`},7:{className:`x78zum5 x6s0dn4 xl56j7k x6hpsvf xf314gf x1hdbdi8 xc342km xng3xce xjbqb8w x18juvz8 xf74fhv xuxw1ft x87ps6o x1jbe559 xuedmi6 xssvwzl x190lv1 xg8s4dl x1u6ievf xwms9i0 x1esw782 x2mo6ok xnbbluu xt0e3qv`}}[!(t===c||e.isDisabled)<<2|(t===c)<<1|!!e.isDisabled],children:(0,Q.jsx)(`span`,{...{0:{className:`x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xb3r6kr xlyipyv x1trhrh1 x1pljy2o x190lv1 xg8s4dl x1u6ievf xwms9i0 x1esw782 xlp1x4z`},1:{className:`x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xb3r6kr xlyipyv x190lv1 xg8s4dl x1u6ievf xwms9i0 x1esw782 xlp1x4z x1iu2jvn xk3h8ob`}}[!!e.isDisabled|0],children:e.label})},e.value))})]})}jN.displayName=`ScrollWheel`;function MN({monthModel:e,monthIndex:t,minMonthIndex:n,maxMonthIndex:r,onChange:i,monthLabel:a,yearLabel:o,isActive:s=!0,keptDay:c=1}){let l=Am(),{calendar:u}=e,{year:d,month:f}=e.yearMonthAt(t),p=(0,Z.useMemo)(()=>Array.from({length:e.monthsInYear(d)},(t,i)=>{let a=e.indexOfYearMonth(d,i+1);return{value:i+1,label:Tp(u,e.monthAt(a),l),isDisabled:a<n||a>r}}),[e,u,d,l,n,r]),m=(0,Z.useMemo)(()=>{let t=e.yearMonthAt(n).year,i=e.yearMonthAt(r).year,a=[];for(let e=t;e<=i;e++)a.push({value:e,label:kp(u,e,l),spansEras:Op(u,e,l)});return a},[e,u,l,n,r]),h=(0,Z.useMemo)(()=>m.map(({value:e,label:t,spansEras:n})=>({value:e,label:n?kp(u,e,l,{month:f,day:c}):t})),[m,u,l,f,c]);return(0,Q.jsxs)(`div`,{className:`x78zum5 xm8gem x1txdalj`,children:[(0,Q.jsx)(ON,{label:a,options:p,value:f,isActive:s,onChange:t=>i(e.indexOfYearMonth(d,t))}),(0,Q.jsx)(ON,{label:o,options:h,value:d,isActive:s,onChange:a=>{i(uM(e.shiftYears(t,a-d),n,r))}})]})}MN.displayName=`MonthYearWheels`;var NN={"@astryx.calendar.nextMonth":`Next month`,"@astryx.calendar.previousMonth":`Previous month`,"@astryx.dateInput.chooseMonthYear":`{monthYear}, Choose month and year`,"@astryx.dateInput.clear":`Clear {label}`,"@astryx.dateInput.dialogLabel":`Choose date`,"@astryx.dateInput.doneChoosingMonth":`Done`,"@astryx.dateInput.monthWheel":`Month`,"@astryx.dateInput.openCalendar":`Open calendar`,"@astryx.dateInput.placeholder":`Select a date`,"@astryx.dateInput.resetPicking":`Reset`,"@astryx.dateInput.savePicking":`Save`,"@astryx.dateInput.yearWheel":`Year`,"@astryx.spinner.loading":`Loading`},PN=Ip(`1970-01-01`);ht(NN),nM.daySize,_[`--duration-fast`];var FN={sm:{kZKoxP:`x6k0iem`,k7Eaqz:`xfb3i0g`,$$css:!0},md:{kZKoxP:`x1ueg155`,k7Eaqz:`xfb3i0g`,$$css:!0},lg:{kZKoxP:`xssyfek`,k7Eaqz:`xfb3i0g`,$$css:!0}},IN={wrapper:{kOIVth:`x1txdalj`,$$css:!0},iconButton:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk x16khyan`,kaIpWk:`xh6dtrn`,$$css:!0},iconButtonDisabled:{kkrTdU:`xt0e3qv`,$$css:!0},monthArrowUnavailable:{k33iCy:`xlshs6z`,$$css:!0},monthArrow:{kAzted:`xygd9yz`,k7Eaqz:`xngvp7v`,$$css:!0},monthArrowIcon:{k1xSpc:`x3nfvp2`,$$css:!0},resetButton:{kAzted:`xygd9yz`,$$css:!0},title:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`xzye2dw`,kZKoxP:`x5yr21d`,kg3NbH:`xf314gf`,keTefX:`x1s1akpx`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kaIpWk:`xh6dtrn`,kWkggS:`xjbqb8w`,kMwMTN:`x1tgivj0`,kGuDYH:`x18juvz8`,kLWn49:`xf74fhv`,k63SB2:`x2mo6ok`,kkrTdU:`x1ypdohk x16khyan`,khDVqt:`xuxw1ft`,k7Eaqz:`xeuugli`,kVQacm:`xb3r6kr`,$$css:!0},titleChevron:{k1xSpc:`x3nfvp2`,kmuXW:`x2lah0s`,k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,k6CgDc:`xzg1mie`,$$css:!0},titleChevronOpen:{k3aq6I:`x19jd1h0`,$$css:!0}};function LN({label:e,isLabelHidden:t=!1,description:n,isOptional:r=!1,isRequired:i=!1,isDisabled:a=!1,disabledMessage:o,value:s,onChange:c,changeAction:l,isLoading:u=!1,min:d,max:f,dateConstraints:p,placeholder:m,size:h,status:g,statusVariant:_=`attached`,labelTooltip:v,hasClear:y=!1,numberOfMonths:b,weekStartsOn:x=0,format:S=`date_long`,calendar:C,width:w,containerXstyle:T,containerClassName:E,containerStyle:D,controlXstyle:O,controlClassName:k,controlStyle:A,ref:j,...ee}){let{rest:M,container:N}=ze(`DateInput`,ee,{containerXstyle:T,containerClassName:E,containerStyle:D}),{id:P,"aria-describedby":F,"aria-labelledby":I,onClick:L,onKeyDown:R,...z}=M,te=Tt(),B=at(),ne=Am(),re=li({isRequired:i,isOptional:r}),ie=m??B(`@astryx.dateInput.placeholder`),V=aa(h,`md`),ae=zD(x),H=km(C,`DateInput`),U=(0,Z.useMemo)(()=>yM(H),[H]),W=(0,Z.useId)(),G=P??W,K=(0,Z.useId)(),se=(0,Z.useId)(),q=(0,Z.useId)(),ce=(0,Z.useId)(),le=(0,Z.useRef)(null),ue=Vt(j,le),de=ca(),[,fe]=(0,Z.useTransition)(),[pe,me]=(0,Z.useOptimistic)(s),he=u||pe!==s,ge=a||he,_e=a&&!!o,ve=Ki({placement:`above`,focusTrigger:`always`,isEnabled:_e}),{isDateDisabled:Y}=xD({min:d,max:f,dateConstraints:p}),{statusIcon:be,describedBy:xe}=Be({status:g,statusVariant:_,isInGroup:!!de}),{ariaLabelledBy:Se,ariaDescribedBy:Ce}=qe(se,[n?q:null,_!==`tooltip`&&g?.message?ce:null,xe,_e?ve.describedBy:null,F],de),[Te,Ee]=(0,Z.useState)(!1),De=(0,Z.useRef)(null);pi(he,B(`@astryx.spinner.loading`),Te?De:le);let[Oe,ke]=(0,Z.useState)(!1),Ae=(0,Z.useRef)(null),je=(0,Z.useRef)(null),Me=(0,Z.useRef)(null),Ne=(0,Z.useRef)(null),Pe=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{Pe.current!=null&&clearTimeout(Pe.current)},[]);let Ie=ED(),Re=(0,Z.useMemo)(()=>pe!=null&&/^\d{4}-\d{2}-\d{2}$/.test(pe)?Ip(pe):null,[pe]),[Ue,We]=(0,Z.useState)(()=>{let e=s!=null&&/^\d{4}-\d{2}-\d{2}$/.test(s)?Ip(s):Ie;return e==null?null:U.indexOf(e)});Ue==null&&Ie!=null&&We(U.indexOf(Ie));let Ge=Ue??U.indexOf(Ie??PN),Ke=d==null?Ge-600:U.indexOf(Ip(d)),Je=f==null?Ge+600:U.indexOf(Ip(f)),[Ye,Ze]=(0,Z.useState)(()=>Ue==null?null:uM(Ue,Ke,Je)),Qe=Ye??uM(Ge,Ke,Je),$e=(0,Z.useMemo)(()=>gD(ne,ae),[ne,ae]),et=Re==null?1:$f(H,Re),nt=lp(H,U.monthAt(Qe),ne,et),ot=pe!=null&&/^\d{4}-\d{2}-\d{2}$/.test(pe)?typeof S==`function`?S(pe):nk(Ip(pe),S,ne,H):``,st=(0,Z.useCallback)(e=>{ge||(c?.(e),l&&fe(async()=>{me(e),await l(e)}))},[ge,c,l,fe,me]),ct=(0,Z.useCallback)(()=>{ge||(ke(!1),Ee(!0))},[ge]),lt=(0,Z.useCallback)(()=>{st(void 0);let e=le.current;e!=null&&(Pe.current=window.setTimeout(()=>{Pe.current=null,e.focus({preventScroll:!0})},0))},[st]),ut=(0,Z.useCallback)(()=>{if(a)return;st(void 0);let e=U.indexOf(Bp());e<Ke||e>Je||e!==Qe&&(Ze(e),Ae.current?.scrollToMonth(e,`smooth`))},[a,st,U,Qe,Ke,Je]),dt=(0,Z.useCallback)(e=>{st(e)},[st]),ft=Qe>Ke,pt=Qe<Je,ht=(0,Z.useCallback)(e=>{let t=uM(Qe+e,Ke,Je);t!==Qe&&(Ze(t),Ae.current?.scrollToMonth(t,`smooth`))},[Qe,Ke,Je]),gt=(0,Z.useCallback)((e,t)=>{let n=e<=Ke,r=e>=Je,i=je.current,a=Me.current,o=n?Ra(i):null,s=r?Ra(a):null,c=o??s;if(c==null){t();return}(0,rh.flushSync)(t);let l=o!=null,u=(l?r:n)?Ne.current:l?Me.current:je.current;Aa(c,u,l?i:a)},[Ke,Je]),_t=(0,Z.useCallback)(e=>{let t=uM(Qe+e,Ke,Je);gt(t,()=>ht(e))},[Qe,Ke,Je,gt,ht]),{isTouch:vt}=we(),yt=(0,Z.useCallback)(e=>{if(Ze(e),Ae.current?.scrollToMonth(e,`auto`),!vt||Re==null)return;let t=bM(U,Re,e,d==null?null:Ip(d),f==null?null:Ip(f));!Xp(t,Re)&&!Y(t)&&st(Lp(t))},[vt,Re,U,d,f,Y,st]),bt=(0,Z.useCallback)(e=>{Oe||gt(e,()=>Ze(e))},[Oe,gt]),xt=(0,Z.useRef)(Qe);xt.current=Qe,(0,Z.useEffect)(()=>{Oe||Ae.current?.scrollToMonth(xt.current,`auto`)},[Oe]);let Ct=(0,Z.useCallback)(e=>{nn(e.nativeEvent)||(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),ct())},[ct]),Et=(0,Q.jsxs)(`div`,{className:`x78zum5 xdt5ytf xh8yej3`,children:[(0,Q.jsxs)(`div`,{className:`x78zum5 x6s0dn4 x1qughib x1txdalj xssyfek`,children:[(0,Q.jsxs)(`button`,{ref:Ne,type:`button`,onClick:()=>ke(e=>!e),"aria-expanded":Oe,"aria-label":B(`@astryx.dateInput.chooseMonthYear`,{monthYear:nt}),"data-title":`month-year`,...te,...J(IN.title,kt.backgroundColor,oe.focusVisible),children:[(0,Q.jsx)(`span`,{className:`xeuugli xb3r6kr xlyipyv`,children:nt}),(0,Q.jsx)(mt,{icon:`chevronDown`,size:`sm`,color:`secondary`,xstyle:[IN.titleChevron,Oe&&IN.titleChevronOpen]})]}),(0,Q.jsxs)(`span`,{"data-arrows":`months`,inert:Oe?!0:void 0,...{0:{className:`x78zum5 x6s0dn4 x1lsbc85 xvc5jky x1jl3cmp xuedmi6 xcj1dhv xzg1mie`},1:{className:`x78zum5 x6s0dn4 x1lsbc85 xvc5jky x1jl3cmp xuedmi6 xcj1dhv xzg1mie xlshs6z xg01cxk x47corl`}}[!!Oe|0],children:[(0,Q.jsx)(oa,{variant:`ghost`,size:`sm`,xstyle:[IN.monthArrow,!ft&&IN.monthArrowUnavailable],ref:je,isDisabled:!ft,onClick:()=>_t(-1),label:B(`@astryx.calendar.previousMonth`),icon:(0,Q.jsx)(`span`,{...J(IN.monthArrowIcon,Ti.mirror),children:(0,Q.jsx)(mt,{icon:`chevronLeft`,size:`sm`,color:`inherit`})})}),(0,Q.jsx)(oa,{variant:`ghost`,size:`sm`,xstyle:[IN.monthArrow,!pt&&IN.monthArrowUnavailable],ref:Me,isDisabled:!pt,onClick:()=>_t(1),label:B(`@astryx.calendar.nextMonth`),icon:(0,Q.jsx)(`span`,{...J(IN.monthArrowIcon,Ti.mirror),children:(0,Q.jsx)(mt,{icon:`chevronRight`,size:`sm`,color:`inherit`})})})]}),(0,Q.jsx)(`span`,{"data-action":`reset`,inert:Oe?!0:void 0,...{0:{className:`x78zum5 x6s0dn4 x1jl3cmp xuedmi6 xcj1dhv xzg1mie`},1:{className:`x78zum5 x6s0dn4 x1jl3cmp xuedmi6 xcj1dhv xzg1mie xlshs6z xg01cxk x47corl`}}[!!Oe|0],children:(0,Q.jsx)(na,{variant:`ghost`,size:`sm`,xstyle:IN.resetButton,label:B(`@astryx.dateInput.resetPicking`),onClick:ut})})]}),(0,Q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`xrvj5dj x1mzazjb x6k0iem x6s0dn4 x1jl3cmp xuedmi6 xcj1dhv xzg1mie`},1:{className:`xrvj5dj x1mzazjb x6k0iem x6s0dn4 x1jl3cmp xuedmi6 xcj1dhv xzg1mie xlshs6z xg01cxk`}}[!!Oe|0],children:$e.map(({dayOfWeek:e,name:t})=>(0,Q.jsx)(`div`,{className:`x2b8uid x141an7d x1ltkj2j x1sodnla xv1l7n4`,children:t},e))}),(0,Q.jsxs)(`div`,{className:`xrvj5dj xm8gem x1n2onr6`,children:[(0,Q.jsx)(`div`,{"data-panel":`calendar`,inert:Oe?!0:void 0,...{0:{className:`x15r89dc xeuugli x74b7sa xuedmi6 xzg1mie`},1:{className:`x15r89dc xeuugli x74b7sa xuedmi6 xzg1mie xlshs6z x47corl`}}[!!Oe|0],children:(0,Q.jsx)(DM,{handleRef:Ae,monthModel:U,minMonthIndex:Ke,maxMonthIndex:Je,initialMonthIndex:Qe,onVisibleMonthChange:bt,selectedDate:Re,today:Ie,isDateDisabled:Y,weekStartsOn:ae,onSelect:dt},`${Ke}:${Je}`)}),(0,Q.jsx)(`div`,{"data-panel":`wheels`,inert:!Oe||void 0,...{0:{className:`x15r89dc xeuugli x10xzikg xc8icb0 x1jl3cmp xuedmi6 xcj1dhv xzg1mie`},1:{className:`x15r89dc xeuugli x10xzikg xc8icb0 x1jl3cmp xuedmi6 xcj1dhv xzg1mie xlshs6z xg01cxk x47corl`}}[!Oe|0],children:(0,Q.jsx)(MN,{monthModel:U,monthIndex:Qe,keptDay:et,minMonthIndex:Ke,maxMonthIndex:Je,onChange:yt,monthLabel:B(`@astryx.dateInput.monthWheel`),yearLabel:B(`@astryx.dateInput.yearWheel`),isActive:Oe})})]}),(0,Q.jsxs)(`div`,{className:`x1xye8es xrvj5dj x1y6fwsi`,children:[(0,Q.jsx)(`div`,{inert:Oe?!0:void 0,...{0:{className:`x15r89dc x78zum5 x74b7sa xuedmi6 xzg1mie`},1:{className:`x15r89dc x78zum5 x74b7sa xuedmi6 xzg1mie xlshs6z x47corl`}}[!!Oe|0],children:(0,Q.jsx)(na,{variant:`primary`,size:`md`,width:`100%`,label:B(`@astryx.dateInput.savePicking`),onClick:()=>Ee(!1)})}),(0,Q.jsx)(`div`,{inert:!Oe||void 0,...{0:{className:`x15r89dc x78zum5 x10xzikg xc8icb0 x1jl3cmp xuedmi6 xcj1dhv xzg1mie`},1:{className:`x15r89dc x78zum5 x10xzikg xc8icb0 x1jl3cmp xuedmi6 xcj1dhv xzg1mie xlshs6z xg01cxk x47corl`}}[!Oe|0],children:(0,Q.jsx)(na,{variant:`secondary`,size:`md`,width:`100%`,label:B(`@astryx.dateInput.doneChoosingMonth`),onClick:()=>ke(!1)})})]})]}),Dt=(0,Q.jsxs)(`div`,{ref:e=>{ve.ref(e)},...de?$i:void 0,...hn(ye(`date-input`,{size:V,status:g?.type??null,disabled:a?`disabled`:null}),J(Le.base,Le.textField,FN[V],IN.wrapper,a&&Le.disabled,ge&&Xe.inputFocusRing,g&&Fe[g.type],g&&!ge&&it[g.type],g&&tt[g.type],de&&sa.inGroup,O),k,A),children:[de&&(0,Q.jsx)(St,{id:se,children:e}),(0,Q.jsx)(`button`,{type:`button`,onClick:ct,"aria-disabled":ge||void 0,"aria-label":B(`@astryx.dateInput.openCalendar`),tabIndex:-1,...J(oe.focusVisible,IN.iconButton,ge&&IN.iconButtonDisabled),children:(0,Q.jsx)(mt,{icon:`calendar`,size:`sm`,color:`secondary`,...ye(`date-input-toggle-icon`,{state:Te?`expanded`:`collapsed`})})}),(0,Q.jsx)(`input`,{...z,ref:ue,id:G,type:`text`,role:`combobox`,value:ot,readOnly:!0,inputMode:`none`,onChange:()=>{},onClick:ge?void 0:fi(ct,L),onKeyDown:fi(Ct,R),placeholder:ie,"aria-disabled":ge?`true`:void 0,"aria-labelledby":I==null?Se:He(Se??K,I),"aria-describedby":Ce,"aria-required":re?`true`:void 0,"aria-invalid":g?.type===`error`?`true`:void 0,"aria-busy":he||void 0,"aria-expanded":Te,"aria-haspopup":`dialog`,"aria-autocomplete":`none`,autoComplete:`off`,...{0:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xbuiw85 x1ypdohk x16khyan x87ps6o xeyghm5`},1:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xbuiw85 x87ps6o xeyghm5 xt0e3qv`}}[!!ge|0]}),y&&s!==void 0&&!ge&&(0,Q.jsx)(Ve,{label:B(`@astryx.dateInput.clear`,{label:e}),onClick:lt}),he&&(0,Q.jsx)(wt,{size:`sm`,"aria-hidden":`true`}),be,(0,Q.jsx)(tM,{isOpen:Te,onOpenChange:Ee,label:B(`@astryx.dateInput.dialogLabel`),height:`hug`,padding:0,children:(0,Q.jsx)(`div`,{ref:De,className:`x1pzlopt xexx8yu x1awphl8`,children:Ie!=null&&Et})}),_e&&ve.renderTooltip(o)]});return de?Dt:(0,Q.jsx)(rt,{...N,label:e,isLabelHidden:t,description:n,inputID:G,labelID:I==null?void 0:K,descriptionID:n?q:void 0,isOptional:r,isRequired:i,isDisabled:a,status:g?{type:g.type,message:g.message,messageID:g.message?ce:void 0}:void 0,statusVariant:_,labelTooltip:v,width:w,children:Dt})}LN.displayName=`TouchDateField`;var RN=`adaptive-native`;function zN(e){switch(e){case`touch`:return`adaptive-native`;case`always`:return`native`;case`never`:return`adaptive-bottom-sheet`}}function BN(e,t){return e===void 0?t===void 0?RN:zN(t):e}function VN(e,t){return!t&&(e===`native`||e===`adaptive-native`)?`adaptive-bottom-sheet`:e}function HN(e,t){switch(e){case`popover`:return`desktop`;case`bottom-sheet`:return`sheet`;case`native`:return`native`;case`adaptive-bottom-sheet`:return t?`sheet`:`desktop`;case`adaptive-native`:return t?`native`:`desktop`}}function UN(e,t,n,r){let i=km(t,e),a=Hf(i),o=n===`native`&&!a;return(0,Z.useEffect)(()=>{o&&(`${e}${i}`,`${i}`)},[o,e,i]),{calendar:i,presentation:VN(BN(n,r),a)}}var WN={"@astryx.dateInput.clear":`Clear {label}`,"@astryx.dateInput.closeCalendar":`Close calendar`,"@astryx.dateInput.dialogLabel":`Choose date`,"@astryx.dateInput.openCalendar":`Open calendar`,"@astryx.dateInput.placeholder":`Select a date`,"@astryx.dateInput.toggleCalendarClose":`Close calendar`,"@astryx.spinner.loading":`Loading`},GN={iconButton:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk x16khyan`,kaIpWk:`xh6dtrn`,$$css:!0},iconButtonDisabled:{kkrTdU:`xt0e3qv`,$$css:!0}},KN={sm:{kZKoxP:`x6k0iem`,k7Eaqz:`xfb3i0g`,$$css:!0},md:{kZKoxP:`x1ueg155`,k7Eaqz:`xfb3i0g`,$$css:!0},lg:{kZKoxP:`xssyfek`,k7Eaqz:`xfb3i0g`,$$css:!0}};ht(WN);var qN=`(pointer: coarse)`;function JN(e,t){let n=e;return t!=null&&n.nodeType===1&&n.localName===`label`&&n.control===t}function YN({label:e,isLabelHidden:t=!1,description:n,isOptional:r=!1,isRequired:i=!1,isDisabled:a=!1,disabledMessage:o,value:s,onChange:c,changeAction:l,isLoading:u=!1,min:d,max:f,dateConstraints:p,placeholder:m,size:h,status:g,onEntryErrorChange:_,entryErrorBehavior:v,statusVariant:y=`attached`,labelTooltip:b,hasClear:x=!1,numberOfMonths:S=1,weekStartsOn:C,format:w=`date_long`,calendar:T,width:E,containerXstyle:D,containerClassName:O,containerStyle:k,controlXstyle:A,controlClassName:j,controlStyle:ee,ref:M,...N}){let{rest:P,container:F}=ze(`DateInput`,N,{containerXstyle:D,containerClassName:O,containerStyle:k}),{id:I,"aria-describedby":L,"aria-labelledby":R,onBlur:z,onClick:te,onFocus:B,onKeyDown:ne,...re}=P,ie=re,V=at(),ae=li({isRequired:i,isOptional:r}),H=m??V(`@astryx.dateInput.placeholder`),U=aa(h,`md`),W=(0,Z.useId)(),G=I??W,K=(0,Z.useId)(),se=(0,Z.useId)(),q=(0,Z.useId)(),ce=(0,Z.useId)(),le=(0,Z.useId)(),ue=(0,Z.useRef)(null),de=(0,Z.useRef)(null),fe=ca(),[,pe]=(0,Z.useTransition)(),[me,he]=(0,Z.useOptimistic)(s),ge=u||me!==s;pi(ge,V(`@astryx.spinner.loading`),ue);let _e=a||ge,ve=a&&!!o,Y=Ki({placement:`above`,focusTrigger:`always`,isEnabled:ve}),{isDateDisabled:be}=xD({min:d,max:f,dateConstraints:p}),xe=(0,Z.useCallback)(e=>{_e||(c?.(e),l&&pe(async()=>{he(e),await l(e)}))},[_e,c,l,pe,he]),Se=(0,Z.useCallback)(()=>{s!==void 0&&xe(void 0)},[s,xe]),Ce=(0,Z.useCallback)(e=>{de.current?.navigateTo(e)},[]),we=FE(v),{typedDate:Te,displayValue:Ee,formatHint:De,isPending:Oe,hiddenFormValue:ke,isInvalid:Ae,fieldStatus:je,alertMessage:Me,handleChange:Ne,commit:Pe,handleFocus:Ie,handleBlur:Re,reset:We}=uk({source:`DateInput`,calendar:T,format:w,min:d,max:f,isDateDisabled:be,value:s,shownValue:me,onChange:xe,onClear:Se,onTypedDate:Ce,isDisabled:_e,status:g,isStatusAnnounced:!fe,onEntryErrorChange:_,hasPlaceholder:m!=null,entryErrorBehavior:we}),{statusIcon:Ge,describedBy:Ke}=Be({status:je,statusVariant:y,isInGroup:!!fe}),{ariaLabelledBy:Je,ariaDescribedBy:Ye}=qe(se,[n?q:null,Te.calendarDescription==null?null:le,y!==`tooltip`&&je?.message?ce:null,Ke,ve?Y.describedBy:null,L],fe),Ze=(0,Z.useRef)(null),Qe=(0,Z.useRef)(!1),$e=Ni(),et=Ue({hasLightDismiss:!1,onShow:()=>{let e=Ze.current;e!=null&&$e.start(e,t=>Fi(t,e,et.id)||t.some(e=>JN(e,ue.current)),()=>et.hide())},dialogLabel:V(`@astryx.dateInput.dialogLabel`),closeButtonLabel:V(`@astryx.dateInput.closeCalendar`),onHide:()=>{$e.stop();let e=Qe.current;Qe.current=!1,!e&&Ia()&&ue.current?.focus()}}),nt=(0,Z.useCallback)(()=>{_e||(et.isOpen?et.hide():et.show())},[_e,et]),ot=(0,Z.useCallback)(()=>{!_e&&!et.isOpen&&et.show({skipAutoFocus:!0})},[_e,et]),st=(0,Z.useCallback)(e=>{xe(void 0),!e||e.detail===0?ue.current?.focus():requestAnimationFrame(()=>{ue.current?.focus({preventScroll:!0})})},[xe]),ct=(0,Z.useCallback)(e=>{a||(xe(e),We(),et.hide())},[a,xe,We,et]),lt=(0,Z.useCallback)(e=>{Ne(e.target.value)},[Ne]),ut=(0,Z.useCallback)(e=>{let t=e.relatedTarget;et.isOpen&&t!=null&&!Yi(t,Ze.current,et.id)&&(Qe.current=!0,ki(e.currentTarget.ownerDocument),et.hide())},[et]),dt=(0,Z.useCallback)(e=>{nn(e.nativeEvent)||(e.key===`Escape`&&et.isOpen?(e.preventDefault(),et.hide()):(e.key===`ArrowDown`||e.altKey&&e.key===`ArrowDown`)&&!et.isOpen?(e.preventDefault(),_e||et.show({skipAutoFocus:!0})):e.key===`Enter`&&(Oe||_e)&&(e.preventDefault(),Pe()))},[et,Pe,_e,Oe]),ft=(0,Q.jsxs)(`div`,{ref:e=>{Ze.current=e,et.triggerRef(e),Y.ref(e)},onBlur:ut,...fe?$i:void 0,...hn(ye(`date-input`,{size:U,status:je?.type??null,disabled:a?`disabled`:null}),J(Le.base,Le.textField,KN[U],a&&Le.disabled,_e&&Xe.inputFocusRing,je&&Fe[je.type],je&&!_e&&it[je.type],je&&tt[je.type],fe&&sa.inGroup,A),j,ee),children:[fe&&(0,Q.jsx)(St,{id:se,children:e}),(0,Q.jsx)(`button`,{type:`button`,onClick:nt,"aria-disabled":_e||void 0,"aria-describedby":ve?Y.describedBy:void 0,"aria-label":et.isOpen?V(`@astryx.dateInput.toggleCalendarClose`):V(`@astryx.dateInput.openCalendar`),...J(oe.focusVisible,GN.iconButton,_e&&GN.iconButtonDisabled),children:(0,Q.jsx)(mt,{icon:`calendar`,size:`sm`,color:`secondary`,...ye(`date-input-toggle-icon`,{state:et.isOpen?`expanded`:`collapsed`})})}),(0,Q.jsx)(`input`,{...re,name:ke===null?ie.name:void 0,ref:Vt(M,ue),id:G,type:`text`,role:`combobox`,value:Ee,onChange:lt,onBlur:fi(Re,z),onFocus:fi(Ie,B),onClick:_e?void 0:fi(ot,te),onKeyDown:fi(dt,ne),placeholder:De??H,"aria-disabled":_e?`true`:void 0,readOnly:_e||void 0,"aria-labelledby":R==null?Je:He(Je??K,R),"aria-describedby":Ye,"aria-required":ae?`true`:void 0,"aria-invalid":je?.type===`error`||Ae?`true`:void 0,"aria-busy":ge||void 0,"aria-expanded":et.isOpen,"aria-haspopup":`dialog`,"aria-controls":et.isOpen?et.id:void 0,"aria-autocomplete":`none`,autoComplete:`off`,...{0:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5`},2:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 xt0e3qv`},1:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xv1l7n4`},3:{className:`x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 xf9zqsd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xt0e3qv xv1l7n4`}}[!!_e<<1|!!Ae]}),ke!==null&&ie.name!=null&&(0,Q.jsx)(`input`,{type:`hidden`,name:ie.name,form:ie.form,value:ke}),(0,Q.jsx)(St,{as:`div`,role:`alert`,"aria-live":`assertive`,children:Me}),xt(Te.calendarDescription)&&(0,Q.jsx)(St,{id:le,children:Te.calendarDescription}),x&&s!==void 0&&!_e&&(0,Q.jsx)(Ve,{label:V(`@astryx.dateInput.clear`,{label:e}),onClick:st}),ge&&(0,Q.jsx)(wt,{size:`sm`,"aria-hidden":`true`}),Ge,et.render(et.isOpen?(0,Q.jsx)(WD,{handleRef:de,calendar:Te.calendar,mode:`single`,value:me??null,onChange:ct,min:d,max:f,dateConstraints:p,numberOfMonths:S,weekStartsOn:C}):null,{placement:`below`,alignment:`start`}),ve&&Y.renderTooltip(o)]});return fe?ft:(0,Q.jsx)(rt,{...F,label:e,isLabelHidden:t,description:n,inputID:G,labelID:R==null?void 0:K,descriptionID:n?q:void 0,isOptional:r,isRequired:i,isDisabled:a,status:je?{type:je.type,message:je.message,messageID:je.message?ce:void 0}:void 0,statusVariant:y,labelTooltip:b,width:E,children:ft})}YN.displayName=`PointerDateField`;function XN(e){let t=(0,Z.use)(ra),n=e.isDisabled||t.isDisabled,r=la(qN);ro(`DateInput`,"`nativePicker` is deprecated; use `presentation` instead (`touch` → `adaptive-native`, `always` → `native`, `never` → `adaptive-bottom-sheet`). `presentation` wins when both are set.",e.nativePicker!==void 0);let{calendar:i,presentation:a}=UN(`DateInput`,e.calendar,e.presentation,e.nativePicker),o=HN(a,r),{presentation:s,nativePicker:c,calendar:l,onEntryErrorChange:u,entryErrorBehavior:d,...f}=e;switch(o){case`native`:return(0,Q.jsx)(gk,{...f,isDisabled:n,onEntryErrorChange:u});case`sheet`:return(0,Q.jsx)(LN,{...f,calendar:i,isDisabled:n},i);case`desktop`:return(0,Q.jsx)(YN,{...f,calendar:i,isDisabled:n,onEntryErrorChange:u,entryErrorBehavior:d})}}XN.displayName=`DateInput`;var ZN=[`hours`,`days`,`weeks`,`months`];function QN(e){let t=By(e.estimate);return t===null?null:Number.isNaN(t)?void 0:{unit:e.estimateUnit,amount:t}}function $N({suffix:e,checked:t,onChange:n}){return(0,Q.jsx)(`span`,{className:`w-fit`,title:`An executor may take up the task on its own once it is ready`,children:(0,Q.jsx)(Rf,{size:`sm`,label:`Autopilot`,"aria-label":`Autopilot${e}`,value:t,onChange:n})})}function eP({suffix:e,plan:t,onChange:n,autoFocus:r}){let i=QN(t)===void 0,a=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{r===`dueDate`&&a.current?.focus()},[]),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,Q.jsx)(`span`,{title:`Optional: expected size, a number greater than 0`,children:(0,Q.jsx)(Ke,{size:`sm`,width:80,inputMode:`decimal`,placeholder:`Optional`,label:`Estimate`,"aria-label":`Estimate${e}`,status:i?{type:`error`}:void 0,statusVariant:`tooltip`,hasAutoFocus:r===`estimate`,value:t.estimate,onChange:e=>n({...t,estimate:e})})}),(0,Q.jsx)($e,{size:`sm`,width:96,label:`Estimate unit${e}`,isLabelHidden:!0,options:ZN,value:t.estimateUnit,onChange:e=>n({...t,estimateUnit:e})}),(0,Q.jsx)(XN,{ref:a,size:`sm`,width:160,label:`Due`,"aria-label":`Due date${e}`,hasClear:!0,format:`system_date`,value:t.dueDate||void 0,onChange:e=>n({...t,dueDate:e??``})}),(0,Q.jsx)(`span`,{className:`min-w-48 flex-1`,title:`Optional: projects or goals, separated by commas, that reviews filter by`,children:(0,Q.jsx)(Ke,{size:`sm`,placeholder:`Optional, comma-separated`,label:`Labels`,"aria-label":`Labels${e}`,value:t.labels,onChange:e=>n({...t,labels:e})})})]})}var tP={manual:`Manual`,url:`URL responds`},nP=[`manual`,`url`];function rP(e){return e===`url`}var iP=0;function aP(e){if(iP+=1,e===void 0)return{key:iP,id:null,text:``,kind:`manual`,target:``};let t=rP(e.kind)?e.target??``:``;return{key:iP,id:e.id,text:e.text,kind:e.kind,target:t}}function oP(e){return e.filter(e=>e.text.trim()!==``).map(e=>({...e.id===null?{}:{id:e.id},text:e.text.trim(),kind:e.kind,target:rP(e.kind)?e.target.trim():null}))}function sP(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`:null}function cP({criteria:e,onChange:t,taskId:n}){let[r,i]=(0,Z.useState)(null),a=n===void 0?``:` of #${n}`,o=(n,r)=>t(e.map(e=>e.key===n?{...e,...r}:e));function s(){let n=aP();i(n.key),t([...e,n])}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((n,i)=>{let s=i+1,c=sP(n);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:s}),(0,Q.jsx)(Ke,{size:`sm`,containerClassName:`flex-1 basis-48 max-md:col-span-2`,label:`Criterion ${s} text${a}`,isLabelHidden:!0,placeholder:`What has to hold, e.g. Docs updated`,value:n.text,onChange:e=>o(n.key,{text:e}),hasAutoFocus:n.key===r}),(0,Q.jsx)(`span`,{className:`max-md:col-start-2 max-md:row-start-2`,title:`How the criterion is checked`,children:(0,Q.jsx)($e,{size:`sm`,label:`Criterion ${s} kind${a}`,isLabelHidden:!0,value:n.kind,options:nP.map(e=>({value:e,label:tP[e]})),onChange:e=>o(n.key,{kind:e})})}),rP(n.kind)&&(0,Q.jsx)(`span`,{className:`flex-1 basis-40 max-md:col-span-2 max-md:col-start-2 max-md:row-start-3`,title:c??`Toodo checks that a GET of this URL succeeds`,children:(0,Q.jsx)(Ke,{size:`sm`,controlClassName:`font-mono`,label:`Criterion ${s} target${a}`,isLabelHidden:!0,status:c===null?void 0:{type:`error`,message:c},statusVariant:`tooltip`,placeholder:`https://example.com/health`,value:n.target,onChange:e=>o(n.key,{target:e})})}),(0,Q.jsx)(ia,{size:`sm`,variant:`ghost`,label:`Remove criterion ${s}${a}`,tooltip:`Remove criterion`,icon:(0,Q.jsx)(Tf,{}),className:`max-md:col-start-3 max-md:row-start-2`,onClick:()=>t(e.filter(e=>e.key!==n.key))})]},n.key)})}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,label:`Add criterion`,icon:(0,Q.jsx)(ef,{}),"aria-label":n===void 0?void 0:`Add criterion to #${n}`,onClick:s})]})}function lP({task:e,focusPlan:t,onDone:n}){let r=fr(),[i,a]=(0,Z.useState)(e.taskType),[o,s]=(0,Z.useState)(e.title),[c,l]=(0,Z.useState)(e.description),[u]=(0,Z.useState)(()=>({estimate:e.estimate===null?``:String(e.estimate.amount),estimateUnit:e.estimate?.unit??`hours`,dueDate:e.dueDate??``,labels:Hy(e.labels)})),[d,f]=(0,Z.useState)(u),[p,m]=(0,Z.useState)(e.autopilot),h=Hy(Vy(d.labels))!==Hy(e.labels),[g]=(0,Z.useState)(()=>e.criteria.map(e=>aP(e))),[_,v]=(0,Z.useState)(g),y=QN(d),b=JSON.stringify(oP(_))!==JSON.stringify(oP(g)),x=_.some(e=>sP(e)!==null),S=i!==e.taskType||o!==e.title||c!==e.description||d.estimate!==u.estimate||d.estimateUnit!==u.estimateUnit||d.dueDate!==u.dueDate||d.labels!==u.labels||p!==e.autopilot||b,C=uT(S,n,r.isPending);function w(t){t.preventDefault(),y===void 0||x||o.trim()===``||r.mutate({status:null,id:e.id,taskType:i,title:o.trim(),description:c.trim(),estimate:y,dueDate:d.dueDate||null,labels:h?Vy(d.labels):null,autopilot:p===e.autopilot?null:p,criteria:b&&e.status!==`done`?oP(_):null},{onSuccess:n})}return(0,Q.jsxs)(`form`,{onSubmit:w,"aria-label":`Edit task #${e.id}`,"data-dirty":S||void 0,className:`flex flex-col gap-1 max-md:gap-2`,onKeyDown:C.onKeyDown,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)($e,{label:`Type of #${e.id}`,isLabelHidden:!0,width:112,options:uC,value:i,onChange:e=>a(e)}),(0,Q.jsx)(Ke,{containerClassName:`flex-1`,label:`Title of #${e.id}`,isLabelHidden:!0,value:o,onChange:s,hasAutoFocus:t===void 0})]}),(0,Q.jsx)(PE,{label:`Description of #${e.id}`,placeholder:`Description (optional, Markdown)`,value:c,onChange:l}),(0,Q.jsx)(eP,{suffix:` of #${e.id}`,plan:d,onChange:f,autoFocus:t}),(0,Q.jsx)($N,{suffix:` of #${e.id}`,checked:p,onChange:m}),e.status!==`done`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`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`})}),(0,Q.jsx)(cP,{taskId:e.id,criteria:_,onChange:v})]}),C.asking?(0,Q.jsx)(dT,{label:`Discard changes to #${e.id}`,question:`Discard your changes to #${e.id}?`,onKeep:C.keep,onDiscard:C.discard}):(0,Q.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,Q.jsx)(X,{type:`submit`,size:`sm`,variant:`primary`,label:r.isPending?`Saving...`:`Save`,isDisabled:r.isPending||y===void 0||x||o.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Discard`,onClick:C.request})]}),r.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function uP({task:e,onDone:t,onShipped:n}){let r=wr(),[i,a]=(0,Z.useState)(``),o=uT(i.trim()!==``,t,r.isPending);function s(n){n.preventDefault(),r.mutate({id:e.id,note:i.trim()},{onSuccess:t})}return(0,Q.jsxs)(`form`,{onSubmit:s,"aria-label":`Conclude #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:o.onKeyDown,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Finish #`,e.id,` without completing it. It is marked not adopted. Tasks that depend on it stay blocked.`]}),(0,Q.jsx)(qS,{rows:2,label:`Conclusion of #${e.id}`,isLabelHidden:!0,placeholder:`What was tried, what was found, and why it is not adopted.`,value:i,onChange:a,hasAutoFocus:!0}),o.asking?(0,Q.jsx)(dT,{label:`Discard conclusion of #${e.id}`,question:`Discard your conclusion of #${e.id}?`,onKeep:o.keep,onDiscard:o.discard}):(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{type:`submit`,size:`sm`,variant:`destructive`,icon:(0,Q.jsx)(ud,{}),label:r.isPending?`Concluding...`:`Conclude as not adopted`,isDisabled:r.isPending||i.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`secondary`,icon:(0,Q.jsx)(wd,{}),label:`Complete as shipped by...`,"aria-label":`Complete #${e.id} as shipped by another task`,tooltip:`The work shipped through another task: complete the task instead`,isDisabled:r.isPending,onClick:n}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Back`,onClick:o.request})]}),r.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var dP={merged:`Merged`,completed:`Completed`,not_adopted:Fr.not_adopted};function fP({task:e,onDone:t}){let n=Gn(),[r,i]=(0,Z.useState)(``),a=uT(r.trim()!==``,t,n.isPending);function o(i){i.preventDefault(),n.mutate({id:e.id,reason:r.trim()},{onSuccess:t})}return(0,Q.jsxs)(`form`,{onSubmit:o,"aria-label":`Reopen #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:a.onKeyDown,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Reopen #`,e.id,`: it is paused, and Resume continues the work. Its outcome and completion note are cleared and kept, with your reason, as a progress note.`]}),(0,Q.jsx)(qS,{rows:2,label:`Reason to reopen #${e.id}`,isLabelHidden:!0,placeholder:`Why is the task not finished after all?`,value:r,onChange:i,hasAutoFocus:!0}),a.asking?(0,Q.jsx)(dT,{label:`Discard reason to reopen #${e.id}`,question:`Discard your reason to reopen #${e.id}?`,onKeep:a.keep,onDiscard:a.discard}):(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,type:`submit`,size:`sm`,variant:`primary`,icon:(0,Q.jsx)(af,{}),label:n.isPending?`Reopening...`:`Reopen`,isDisabled:n.isPending||r.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Back`,onClick:a.request})]}),n.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function pP({task:e,onDone:t}){let n=Hn(),r=Object.keys(dP).filter(t=>t!==e.resolution),[i,a]=(0,Z.useState)(r[0]),[o,s]=(0,Z.useState)(``),c=uT(o.trim()!==``,t,n.isPending);function l(r){r.preventDefault(),n.mutate({id:e.id,resolution:i,note:o.trim()},{onSuccess:t})}return(0,Q.jsxs)(`form`,{onSubmit:l,"aria-label":`Outcome of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:c.onKeyDown,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`#`,e.id,` is done as `,e.resolution===null?`done`:dP[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)($e,{label:`New outcome of #${e.id}`,isLabelHidden:!0,width:160,value:i,options:r.map(e=>({value:e,label:dP[e]})),onChange:e=>a(e)}),(0,Q.jsx)(qS,{rows:2,label:`Outcome note of #${e.id}`,isLabelHidden:!0,placeholder:`What happened, e.g. the change was reverted. This becomes the completion note.`,value:o,onChange:s,hasAutoFocus:!0}),c.asking?(0,Q.jsx)(dT,{label:`Discard outcome of #${e.id}`,question:`Discard the new outcome of #${e.id}?`,onKeep:c.keep,onDiscard:c.discard}):(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,type:`submit`,size:`sm`,variant:`primary`,icon:(0,Q.jsx)(vd,{}),label:n.isPending?`Saving...`:`Change outcome`,isDisabled:n.isPending||o.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Back`,onClick:c.request})]}),n.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function mP({task:e,tasks:t,context:n,onDone:r}){let i=wr(),a=t.filter(t=>t.id!==e.id&&t.status===`done`&&(t.resolution===`merged`||t.resolution===`completed`)).sort((e,t)=>t.id-e.id),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),u=o!==``&&c.trim()!==``,d=uT(o!==``||c.trim()!==``,r,i.isPending),f=(0,Z.useRef)(null);(0,Z.useEffect)(()=>f.current?.focus(),[]);function p(t){t.preventDefault(),i.mutate({id:e.id,note:c.trim(),shippedWith:Number(o)},{onSuccess:r})}return(0,Q.jsxs)(`form`,{onSubmit:p,"aria-label":`Complete #${e.id} as shipped by`,className:`flex flex-col gap-1`,onKeyDown:d.onKeyDown,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Complete #`,e.id,` as shipped by another done task. It becomes done, and tasks that depend on it can start.`]}),(0,Q.jsx)($e,{ref:f,label:`Task that shipped #${e.id}`,isLabelHidden:!0,placeholder:`Choose a task...`,value:o,options:a.map(t=>({value:String(t.id),label:`${_C(t.id,e.workspaceId,n)} ${t.title}`})),onChange:s}),(0,Q.jsx)(qS,{rows:2,label:`Shipped note of #${e.id}`,isLabelHidden:!0,placeholder:`How the other task shipped this work. This becomes the completion note.`,value:c,onChange:l}),d.asking?(0,Q.jsx)(dT,{label:`Discard completion of #${e.id}`,question:`Discard completing #${e.id} as shipped by another?`,onKeep:d.keep,onDiscard:d.discard}):(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,type:`submit`,size:`sm`,variant:`primary`,icon:(0,Q.jsx)(wd,{}),label:i.isPending?`Completing...`:`Complete as shipped`,isDisabled:i.isPending||!u}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Back`,onClick:d.request})]}),i.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.error.message})]})}function hP({task:e,adding:t,onAdded:n}){let r=or(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(``),c=e.completionNote??``,l=i||t;function u(){a(!1),n()}let d=uT(o.trim()!==c.trim(),()=>{s(c),u()},r.isPending);function f(){s(c),a(!0)}function p(t){t.preventDefault(),r.mutate({id:e.id,note:o},{onSuccess:u})}return l?(0,Q.jsxs)(`form`,{onSubmit:p,"aria-label":`Completion note form of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:d.onKeyDown,children:[(0,Q.jsx)(qS,{rows:2,label:`Completion note for #${e.id}`,isLabelHidden:!0,placeholder:`What did this achieve? Impact, decisions, follow-ups. Reviews include this note.`,value:o,onChange:s,hasAutoFocus:!0}),d.asking?(0,Q.jsx)(dT,{label:`Discard note of #${e.id}`,question:`Discard your note for #${e.id}?`,onKeep:d.keep,onDiscard:d.discard}):(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{type:`submit`,size:`sm`,variant:`primary`,label:r.isPending?`Saving...`:`Save note`,isDisabled:r.isPending||o.trim()===c||Wy(e)&&o.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Discard`,onClick:d.request})]}),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)(hf,{"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)(ia,{size:`sm`,variant:`ghost`,label:`Edit completion note of #${e.id}`,tooltip:`Edit note`,icon:(0,Q.jsx)(Jd,{}),onClick:f})]})}function gP({task:e}){let t=e.issue;return t===null?null:(0,Q.jsx)(vC,{label:`Issue`,children:(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs`,children:[(0,Q.jsxs)(`span`,{"aria-label":`Issue of #${e.id}`,title:t.url,className:`shrink-0 font-medium tabular-nums`,children:[`#`,t.number]}),(0,Q.jsx)(`span`,{className:`min-w-0 break-all font-mono text-muted-foreground select-all`,children:t.url})]})})}function _P(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function vP(){let e=new Date;return e.setDate(e.getDate()+1),e.setHours(9,0,0,0),e.getTime()/1e3}function yP(e){return(e===`planned`?Fr.waiting:Fr[e]).toLowerCase()}function bP(e){return e.wait===null?null:`Waiting until ${oi(e.wait.until)}, then ${yP(e.wait.status)}`}function xP({task:e,onDone:t}){let n=Cr(),[r,i]=(0,Z.useState)(_P(e.wait?.until??vP())),[a,o]=(0,Z.useState)(``),s=r===``?NaN:new Date(r).getTime()/1e3,c=Number.isFinite(s);function l(r){r.preventDefault(),c&&n.mutate({id:e.id,until:Math.floor(s),reason:a.trim()===``?null:a.trim()},{onSuccess:t})}return(0,Q.jsxs)(`form`,{onSubmit:l,"aria-label":`Wait #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:e=>e.key===`Escape`&&!n.isPending&&t(),children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.wait===null?e.status===`planned`?`#${e.id} waits until then and stays planned.`:`#${e.id} is paused until then, then returns to ${Fr[e.status].toLowerCase()} on its own.`:`Move the end of the wait; #${e.id} then returns to ${yP(e.wait.status)}.`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1 max-md:gap-2`,children:[(0,Q.jsx)(`input`,{type:`datetime-local`,className:yy(XS,`w-auto`),"aria-label":`Wait #${e.id} until`,value:r,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),(0,Q.jsx)(Ke,{containerClassName:`min-w-0 flex-1 basis-48`,label:`Reason #${e.id} waits`,isLabelHidden:!0,placeholder:`Why it waits (optional)`,value:a,onChange:o})]}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,type:`submit`,size:`sm`,variant:`primary`,icon:(0,Q.jsx)(Ru,{}),label:n.isPending?`Saving...`:e.wait===null?`Wait`:`Change wait`,isDisabled:n.isPending||!c}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Back`,onClick:t})]}),n.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}var SP=()=>bt(()=>import(`./task-details-DK77SGWd.js`),__vite__mapDeps([19,1,4,20,7,12,8,13,9,10,11,21,22,23,24,14,25,16,6,15,26,27,2,3])),CP=(0,Z.lazy)(()=>SP().then(e=>({default:e.TaskTimeline}))),wP=(0,Z.lazy)(()=>SP().then(e=>({default:e.RelatedTasks}))),TP=(0,Z.lazy)(()=>SP().then(e=>({default:e.TaskNotes}))),EP=(0,Z.lazy)(()=>SP().then(e=>({default:e.TaskPlan}))),DP=(0,Z.lazy)(()=>SP().then(e=>({default:e.TaskCriteria}))),OP=(0,Z.lazy)(()=>SP().then(e=>({default:e.AutopilotToggle}))),kP=(0,Z.lazy)(()=>SP().then(e=>({default:e.TaskWorkspace}))),AP=[`planned`,`done`];function jP({task:e,tasks:t,context:n,showWorkspace:r,detailed:i=!1,navigation:a,onShowDetails:o}){let s=Gr(),c=br(),l=qn(),u=Nn(),d=$r(),f=qr(),p=Mr(),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(void 0),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(null),A=e.status===`in_review`,j=e.status===`in_progress`||A,ee=c.isPending,M=e.status===`done`,N=e.criteria.every(e=>e.state===`met`),P=e.criteria.filter(e=>e.state!==`met`).length,F=A||e.status===`in_progress`&&N,I=qy(e),L=e.status===`planned`&&Gy(e,n.byId),R=e.status===`planned`?e.dependsOn.filter(e=>Wy(n.byId.get(e))):[],z=Uy.includes(e.status),te=Ky(e,n.byId),B=Ob(e,n.byId),ne=f.isPending||p.isPending,re=xC(),ie=s.error??c.error??l.error??u.error??d.error??f.error??p.error,V=t.filter(n=>tb(t,n.id,e.id)),ae=[...new Set([e.workspaceId,...V.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:V.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),H=e.status===`planned`?{key:`start`,changesData:!0,label:s.isPending?`Starting...`:I?`Resume`:`Start`,ariaLabel:`${I?`Resume`:`Start`} #${e.id}`,icon:(0,Q.jsx)(Xd,{}),title:L?void 0:R.length>0?`A dependency was not adopted; remove it to start`:`Waits until all its dependencies are done`,disabled:!L||s.isPending,onSelect:()=>s.mutate(e.id)}:null,U=F?{key:`complete`,changesData:!0,label:c.isPending?`Completing...`:`Complete`,ariaLabel:`Complete #${e.id}`,icon:(0,Q.jsx)(ed,{}),className:hC,title:N?void 0:`${P} of ${e.criteria.length} criteria not met yet; check the manual ones under Criteria`,disabled:ee||!N,onSelect:()=>c.mutate(e.id)}:null,W=j||e.status===`planned`?{key:`conclude`,label:`Conclude`,ariaLabel:`Conclude #${e.id} without completing`,icon:(0,Q.jsx)(ud,{}),title:`Finish without completing, e.g. research whose result is not adopted`,disabled:ee,onSelect:()=>y(!0)}:null,oe=[H,U].find(e=>e!==null)??null,G=[H,U,W].filter(e=>e!==null&&e!==oe),K=[M?null:{key:`edit`,label:`Edit`,ariaLabel:`Edit #${e.id}`,icon:(0,Q.jsx)(Jd,{}),onSelect:()=>{_(void 0),h(!0)}},j?{key:`pause`,changesData:!0,label:`Pause`,ariaLabel:`Pause #${e.id}`,icon:(0,Q.jsx)(Kd,{}),title:`Pause: stop working on the task; it can be resumed`,disabled:l.isPending,onSelect:()=>l.mutate(e.id)}:null,M?null:{key:`wait`,label:e.wait===null?`Wait until...`:`Change wait`,ariaLabel:`${e.wait===null?`Wait`:`Change wait of`} #${e.id}`,icon:(0,Q.jsx)(Ru,{}),title:`Pause the task until a time; it then returns to its status on its own`,onSelect:()=>T(!0)},e.wait===null?null:{key:`end-wait`,changesData:!0,label:`End wait`,ariaLabel:`End wait of #${e.id}`,icon:(0,Q.jsx)(Iu,{}),title:`Return the task to its status now`,disabled:u.isPending,onSelect:()=>u.mutate(e.id)},M&&Wy(e)?{key:`shipped`,label:`Complete as shipped by...`,ariaLabel:`Complete #${e.id} as shipped by another task`,icon:(0,Q.jsx)(wd,{}),title:`The work did ship, through another task: mark it done as shipped with that one`,onSelect:()=>x(`shipped`)}:null,M?{key:`outcome`,label:`Change outcome`,ariaLabel:`Change outcome of #${e.id}`,icon:(0,Q.jsx)(vd,{}),title:`Correct how the task ended, e.g. merged work that was reverted; the change is kept as a note`,onSelect:()=>x(`outcome`)}:null,M?{key:`reopen`,label:`Reopen`,ariaLabel:`Reopen #${e.id}`,icon:(0,Q.jsx)(af,{}),title:`Reopen a task completed or concluded by mistake; it is paused and can be resumed`,onSelect:()=>x(`reopen`)}:null,M&&e.completionNote===null&&!S?{key:`add-note`,label:`Add note`,ariaLabel:`Add completion note to #${e.id}`,icon:(0,Q.jsx)(hf,{}),onSelect:()=>C(!0)}:null,AP.includes(e.status)?{key:`delete`,label:`Delete`,ariaLabel:`Delete #${e.id}`,icon:(0,Q.jsx)(xf,{}),title:`Delete`,destructive:!0,onSelect:()=>D(!0)}:null].filter(e=>e!==null),se=o?{key:`details`,label:`Details`,ariaLabel:`Show details of #${e.id}`,icon:(0,Q.jsx)(Wd,{}),onSelect:o}:null,q=i?K:[...se?[se]:[],...G,...K],ce=er(e.milestones).at(-1),le=e.criteria.filter(e=>e.state===`met`).length,ue=e.criteria.filter(e=>e.state===`failed`).length,de=i?``:sT(e.description);function fe(e,t){return(0,Q.jsx)(X,{size:`sm`,variant:t,changesData:e.changesData,label:e.label,icon:e.icon,"aria-label":e.ariaLabel,tooltip:e.title,isDisabled:e.disabled,onClick:e.onSelect,className:e.className},e.key)}return(0,Q.jsxs)(`li`,{"data-task-row":i?void 0:e.id,className:yy(`flex flex-col`,i?`gap-3 p-4`:`gap-1.5 px-4 py-3 max-md:gap-2`),children:[m?(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)(NP,{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)(lP,{task:e,focusPlan:g,onDone:()=>h(!1)})]}):(0,Q.jsxs)(`div`,{className:yy(`flex min-w-0 flex-col`,i?`gap-1.5`:`gap-0.5`),children:[(0,Q.jsxs)(`div`,{className:yy(`flex min-w-0 items-center gap-2`,i?`flex-wrap`:`max-md:flex-wrap max-md:gap-y-1`),children:[(0,Q.jsx)(NP,{task:e,byId:n.byId}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),r&&!i&&(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-xs text-muted-foreground`,children:n.workspaceName(e.workspaceId)}),i&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(kP,{task:e})}),(0,Q.jsx)(wC,{type:e.taskType}),i&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(OP,{task:e})}),!i&&e.autopilot&&(0,Q.jsx)(`span`,{role:`note`,"aria-label":`#${e.id} is marked for autopilot`,title:`Marked for autopilot: an executor may take it up on its own once it is ready`,className:yy(`shrink-0 rounded-md px-1.5 text-xs font-medium`,jn.info),children:`Autopilot`}),!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,"data-task-title":!0,onClick:o,children:e.title}),B&&(0,Q.jsx)(`span`,{role:`note`,"aria-label":`Blocker on #${e.id}: ${B.body}`,title:B.body,className:yy(`shrink-0 rounded-md px-1.5 text-xs font-medium`,jn.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)(Z.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)(lC,{source:e.description})}),de&&(0,Q.jsx)(`p`,{className:`break-words-keep line-clamp-2 text-sm text-muted-foreground`,children:de}),!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:[R.length>0&&(0,Q.jsxs)(`span`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:In.attention,children:[R.map(t=>_C(t,e.workspaceId,n)).join(`, `),` not adopted`]}),te.length>0&&(0,Q.jsxs)(`span`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:In.neutral,children:[`Waiting on `,te.map(t=>_C(t,e.workspaceId,n)).join(`, `)]}),e.wait!==null&&(0,Q.jsx)(`span`,{role:`note`,"aria-label":`Wait of #${e.id}`,className:In.neutral,children:bP(e)}),e.dueDate!==null&&(0,Q.jsx)(yC,{task:e}),(0,Q.jsx)(bC,{task:e,onEdit:e=>{_(e),h(!0)}}),!M&&e.criteria.length>0&&(0,Q.jsxs)(`span`,{children:[le,`/`,e.criteria.length,` criteria met`]}),!M&&ue>0&&(0,Q.jsxs)(`span`,{className:yy(`font-medium`,In.danger),children:[ue,` failed`]}),ce&&(0,Q.jsx)(Dr,{at:ce.at,prefix:`${ce.label} `})]})]}),i&&!m&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(DP,{task:e,detailed:!0})}),O===null?i&&(e.dependsOn.length>0||z&&V.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:yy(`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`,R.includes(t)&&Kn.attention),title:R.includes(t)?`${n.byId.get(t)?.title} (not adopted)`:n.byId.get(t)?.title,children:[(0,Q.jsx)(`span`,{children:_C(t,e.workspaceId,n)}),z&&(0,Q.jsx)(ia,{size:`sm`,variant:`ghost`,label:`Remove dependency #${t} from #${e.id}`,tooltip:`Remove dependency`,icon:(0,Q.jsx)(Tf,{}),isDisabled:ne,onClick:()=>p.mutate({id:e.id,dependsOn:t})})]},t)),z&&V.length>0&&(0,Q.jsx)(`span`,{title:e.status===`in_progress`?`A prerequisite that is not done pauses this task`:void 0,children:(0,Q.jsx)($e,{label:`Add dependency to #${e.id}`,isLabelHidden:!0,size:`sm`,width:192,placeholder:`Add dependency...`,value:``,isDisabled:ne||re,options:ae.map(e=>({type:`section`,title:n.workspaceName(e.workspaceId),options:e.tasks.map(e=>({value:String(e.id),label:`#${e.id} ${e.title}`}))})),onChange:t=>{let n=Number(t);f.mutate({id:e.id,dependsOn:n,confirmPause:!1},{onSuccess:e=>e===`confirm_pause`&&k(n)})}})})]}):(0,Q.jsx)(CC,{taskId:e.id,prerequisite:_C(O,e.workspaceId,n),pending:f.isPending,onConfirm:()=>f.mutate({id:e.id,dependsOn:O,confirmPause:!0},{onSettled:()=>k(null)}),onCancel:()=>k(null)}),i&&R.length>0&&(0,Q.jsxs)(`p`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:yy(`text-xs`,In.attention),children:[R.map(t=>_C(t,e.workspaceId,n)).join(`, `),` `,R.length===1?`was`:`were`,` not adopted. Remove the dependency or change the plan to start this task.`]}),i&&te.length>0&&(0,Q.jsxs)(`p`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:yy(`text-xs`,In.neutral),children:[`Waiting on `,te.map(t=>_C(t,e.workspaceId,n)).join(`, `)]}),i&&e.wait!==null&&(0,Q.jsx)(`p`,{role:`note`,"aria-label":`Wait of #${e.id}`,className:yy(`text-xs`,In.neutral),children:bP(e)}),i&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(EP,{task:e})}),i&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(CP,{task:e,detailed:!0})}),i&&e.issue!==null&&(0,Q.jsx)(gP,{task:e}),i&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(wP,{task:e,tasks:t,context:n,navigation:a})}),i&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(TP,{task:e,detailed:!0})}),M&&!m&&(i||S)&&(0,Q.jsx)(hP,{task:e,adding:S,onAdded:()=>C(!1)}),ie&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:ie.message}),v&&!m&&(0,Q.jsx)(uP,{task:e,onDone:()=>y(!1),onShipped:()=>{y(!1),x(`shipped`)}}),b===`shipped`&&!m&&(0,Q.jsx)(mP,{task:e,tasks:t,context:n,onDone:()=>x(null)}),b===`outcome`&&!m&&(0,Q.jsx)(pP,{task:e,onDone:()=>x(null)}),b===`reopen`&&!m&&(0,Q.jsx)(fP,{task:e,onDone:()=>x(null)}),w&&!m&&(0,Q.jsx)(xP,{task:e,onDone:()=>T(!1)}),!m&&!v&&b===null&&!w&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[oe&&fe(oe,i?`primary`:`secondary`),i&&G.map(e=>fe(e,`secondary`)),(0,Q.jsx)(`div`,{role:E?`group`:void 0,"aria-label":E?`Delete #${e.id}?`:void 0,className:yy(`ml-auto flex items-center gap-1 max-md:gap-2`,E&&`basis-full flex-wrap justify-end`),onKeyDown:E?$S(()=>D(!1),d.isPending):void 0,children:E?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:[`Delete #`,e.id,`? It moves to Settings > Archive with its history, where it can be restored.`]}),(0,Q.jsx)(X,{size:`sm`,variant:`destructive`,label:d.isPending?`Deleting...`:`Confirm delete`,icon:(0,Q.jsx)(xf,{}),"aria-label":`Confirm delete #${e.id}`,isDisabled:d.isPending,onClick:()=>d.mutate(e.id,{onSettled:()=>D(!1)})}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Back`,autoFocus:!0,onClick:()=>D(!1)},`back`)]}):q.length>0&&(0,Q.jsx)(eT,{label:`More actions for #${e.id}`,actions:q})})]})]})}var MP={neutral:`neutral`,info:`info`,progress:`blue`,review:`purple`,success:`success`,attention:`warning`,danger:`error`};function NP({task:e,byId:t}){let n=nC(e,t);return(0,Q.jsx)(Oy,{variant:MP[fC[n]],label:dC(e,t),className:yy(`shrink-0`,n===`not_adopted`&&`ring-1 ring-inset ring-muted-foreground/40`)})}function PP(e){return/^https?:\/\/\S+$/.test(e)?e:/^[\w.-]+\/[\w.-]+$/.test(e)?`https://github.com/${e}`:null}function FP({workspace:e}){let t=Xn(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(e.name),[o,s]=(0,Z.useState)(e.description??``),[c,l]=(0,Z.useState)(e.repository??``),u=uT(i!==e.name||o!==(e.description??``)||c!==(e.repository??``),()=>r(!1),t.isPending);function d(n){t.reset(),a(e.name),s(e.description??``),l(e.repository??``),r(n)}function f(n){n.preventDefault(),t.mutate({...e,name:i.trim(),description:o.trim()||null,repository:c.trim()||null},{onSuccess:()=>r(!1)})}if(!n){let t=e.repository===null?null:PP(e.repository);return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-sm text-muted-foreground`,children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 max-md:flex-wrap`,children:[e.repository===null?(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Set repository`,icon:(0,Q.jsx)(bd,{}),tooltip:`Link this workspace to a repository, e.g. owner/repo or a URL`,onClick:()=>d(`repository`)}):t===null?(0,Q.jsx)(`code`,{"aria-label":`Repository`,className:`truncate text-foreground`,children:e.repository}):(0,Q.jsx)(`a`,{"aria-label":`Repository`,href:t,target:`_blank`,rel:`noreferrer`,className:`truncate font-mono text-foreground underline underline-offset-2`,children:e.repository}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Edit workspace`,icon:(0,Q.jsx)(Jd,{}),onClick:()=>d(`name`)})]}),e.description!==null&&(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.description}),children:(0,Q.jsx)(`div`,{"aria-label":`Workspace description`,className:`text-sm`,children:(0,Q.jsx)(lC,{source:e.description})})})]})}return(0,Q.jsxs)(`form`,{onSubmit:f,"aria-label":`Workspace details`,className:`flex flex-col gap-1.5`,onKeyDown:u.onKeyDown,children:[(0,Q.jsx)(Ke,{size:`sm`,label:`Name`,value:i,onChange:a,hasAutoFocus:n===`name`}),(0,Q.jsx)(qS,{size:`sm`,label:`Description (optional, Markdown)`,rows:4,value:o,onChange:s}),(0,Q.jsx)(Ke,{size:`sm`,label:`Repository (optional, e.g. owner/repo or a URL)`,hasSpellCheck:!1,hasAutoFocus:n===`repository`,value:c,onChange:l}),u.asking?(0,Q.jsx)(dT,{label:`Discard workspace changes`,question:`Discard the changes to the workspace?`,onKeep:u.keep,onDiscard:u.discard}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(X,{type:`submit`,size:`sm`,variant:`secondary`,label:`Save`,isDisabled:t.isPending||i.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:`Discard`,onClick:u.request})]}),t.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}var IP=4e3,LP={rule:`Rule`,memory:`Memory`},RP=[`rule`,`memory`].map(e=>({value:e,label:LP[e]})),zP={rule:`Rules`,memory:`Memory`},BP={rule:`Agents must follow it.`,memory:`A lesson or fact worth keeping for this workspace.`};function VP({workspace:e}){let t=ti(e.id),n=Ar(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(!1),l=(0,Z.useId)(),u=t.data??[],d=u.filter(e=>e.kind===`rule`),f=u.filter(e=>e.kind===`memory`),p=r??t.data?.length===0,m=[d.length>0&&`${d.length} ${d.length===1?`rule`:`rules`}`,f.length>0&&`${f.length} ${f.length===1?`memory`:`memories`}`].filter(Boolean).join(`, `);function h(){n.reset(),i(!0),o(!0)}function g(){o(!1),c(!0)}return(0,Q.jsxs)(`section`,{"aria-label":`Guidelines`,className:`flex flex-col gap-2`,children:[(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 text-muted-foreground`,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":p,"aria-controls":l,className:`flex items-center gap-1.5 rounded-sm text-left outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>i(!p),children:[(0,Q.jsx)(nd,{"aria-hidden":!0,className:yy(`size-4 shrink-0 transition-transform`,!p&&`-rotate-90`)}),`Guidelines `,m&&(0,Q.jsx)(`span`,{className:`font-normal tabular-nums`,children:m})]})}),!a&&(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Add guideline`,tooltip:`Add a rule or memory for agents`,icon:(0,Q.jsx)(ef,{}),autoFocus:s,onClick:h,children:`Add`})]}),t.isError&&(0,Q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-xs text-destructive`,children:[(0,Q.jsxs)(`p`,{children:[`Failed to load guidelines: `,t.error.message]}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Retry now`,onClick:()=>void t.refetch()})]}),(0,Q.jsxs)(`div`,{id:l,hidden:!p,className:`flex flex-col gap-2`,children:[t.isPending&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading guidelines...`}),t.data?.length===0&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No rules or memory yet; agents read them before working on a task in this workspace.`}),(0,Q.jsx)(HP,{kind:`rule`,entries:d}),(0,Q.jsx)(HP,{kind:`memory`,entries:f}),a&&(0,Q.jsx)(WP,{label:`Add guideline`,className:`rounded-xl border bg-card p-2.5`,pending:n.isPending,error:n.error,onSave:(t,r)=>n.mutate({workspaceId:e.id,kind:t,body:r},{onSuccess:g}),onClose:g})]})]})}function HP({kind:e,entries:t}){return t.length===0?null:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:zP[e]}),(0,Q.jsx)(`ul`,{"aria-label":zP[e],className:`flex flex-col divide-y rounded-xl border bg-card`,children:t.map((e,t)=>(0,Q.jsx)(UP,{guideline:e,position:t+1},e.id))})]})}function UP({guideline:e,position:t}){let n=cr(),r=Er(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(null),u=`${e.kind} ${t}`,d=`${LP[e.kind]} ${t}`;function f(){a(!1),l(`edit`)}function p(){s(!1),l(`delete`)}return i?(0,Q.jsx)(`li`,{"aria-label":d,className:`px-2.5 py-2`,children:(0,Q.jsx)(WP,{label:`Edit ${u}`,guideline:e,pending:n.isPending,error:n.error,onSave:(t,r)=>n.mutate({id:e.id,kind:t,body:r},{onSuccess:f}),onClose:f})}):(0,Q.jsxs)(`li`,{"aria-label":d,className:`group/guideline flex flex-col gap-1.5 px-2.5 py-1.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words-keep text-sm`,children:e.body}),children:(0,Q.jsx)(lC,{source:e.body,className:`flex-1 text-foreground`})}),!o&&(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-focus-within/guideline:opacity-100 group-hover/guideline:opacity-100 max-md:gap-2 [@media(hover:none)]:opacity-100`,children:[(0,Q.jsx)(ia,{size:`sm`,variant:`ghost`,label:`Edit ${u}`,tooltip:`Edit`,icon:(0,Q.jsx)(Jd,{}),autoFocus:c===`edit`,onClick:()=>{n.reset(),a(!0)}}),(0,Q.jsx)(ia,{size:`sm`,variant:`ghost`,label:`Delete ${u}`,tooltip:`Delete`,icon:(0,Q.jsx)(xf,{}),autoFocus:c===`delete`,onClick:()=>{r.reset(),s(!0)}})]})]}),o&&(0,Q.jsxs)(`div`,{role:`group`,"aria-label":`Delete ${u}?`,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,onKeyDown:$S(p,r.isPending),children:[(0,Q.jsxs)(`span`,{className:`mr-1`,children:[`Delete this `,e.kind,`? It cannot be restored.`]}),(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`destructive`,label:`Confirm delete ${u}`,icon:(0,Q.jsx)(xf,{}),isDisabled:r.isPending,onClick:()=>r.mutate(e.id),children:r.isPending?`Deleting...`:`Delete`}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Back`,autoFocus:!0,onClick:p})]}),r.isError&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function WP({label:e,guideline:t,className:n,pending:r,error:i,onSave:a,onClose:o}){let s=t?.kind??`rule`,c=t?.body??``,[l,u]=(0,Z.useState)(s),[d,f]=(0,Z.useState)(c),p=(0,Z.useId)(),m=uT(l!==s||d!==c,o,r);function h(e){e.preventDefault(),a(l,d.trim())}return(0,Q.jsxs)(`form`,{"aria-label":e,className:yy(`flex flex-col gap-1.5`,n),onSubmit:h,onKeyDown:m.onKeyDown,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsx)($e,{size:`sm`,label:`Kind`,isLabelHidden:!0,"aria-describedby":p,options:RP,value:l,onChange:e=>u(e)}),(0,Q.jsx)(`span`,{id:p,className:`text-xs text-muted-foreground`,children:BP[l]})]}),(0,Q.jsx)(qS,{size:`sm`,label:`Guideline`,isLabelHidden:!0,placeholder:`Write it in Markdown`,rows:4,value:d,htmlMaxLength:IP,hasAutoFocus:!0,onChange:f}),m.asking?(0,Q.jsx)(dT,{label:t?`Discard guideline changes`:`Discard new guideline`,question:t?`Discard the changes to the guideline?`:`Discard the new guideline?`,onKeep:m.keep,onDiscard:m.discard}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(X,{type:`submit`,size:`sm`,variant:`secondary`,label:t?`Save`:`Add`,isDisabled:r||d.trim()===``}),(0,Q.jsx)(X,{type:`button`,size:`sm`,variant:`ghost`,label:t?`Discard`:`Cancel`,onClick:m.request})]}),i&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.message})]})}function GP({label:e,expanded:t,onExpandedChange:n,onSubmit:r,children:i}){let a=(0,Z.useRef)(null),o=(0,Z.useRef)(!1),s=YS(),c=t&&s;(0,Z.useEffect)(()=>{if(!t)return;let e=e=>{e.target instanceof Node&&!a.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 l=()=>{o.current?o.current=!1:t||n(!0)};function u(){n(!1);let e=a.current?.querySelector(`input`);e&&e!==document.activeElement&&(o.current=!0,e.focus())}function d(e){e.key===`Escape`&&t&&!e.defaultPrevented&&(e.preventDefault(),n(!1))}return(0,Q.jsxs)(Q.Fragment,{children:[c&&(0,Q.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-black/40`}),(0,Q.jsx)(`div`,{role:c?`dialog`:void 0,"aria-modal":c||void 0,"aria-label":c?e:void 0,className:yy(c&&`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:a,"aria-label":e,"data-expanded":t||void 0,onSubmit:r,onFocus:l,onInput:l,onKeyDown:d,className:yy(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,c&&`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)(ia,{size:`sm`,variant:`ghost`,label:`Close ${e}`,tooltip:`Close (Esc)`,icon:(0,Q.jsx)(Tf,{}),onClick:u})]}),i]})})]})}var KP={taskType:`feat`,title:``,description:``,criteria:[],autopilot:!1,estimate:``,estimateUnit:`hours`,dueDate:``,labels:``};function qP({workspace:e,draft:t,onChange:n}){let r=Ur(),[i,a]=(0,Z.useState)(!1),{taskType:o,title:s,description:c}=t,l=QN(t),u=t.criteria.some(e=>sP(e)!==null),d=e=>n({...t,taskType:e}),f=e=>n({...t,title:e}),p=e=>n({...t,description:e});function m(i){i.preventDefault(),s===``||l===void 0||u||r.mutate({workspaceId:e.id,taskType:o,title:s,description:c,estimate:l,dueDate:t.dueDate||null,labels:Vy(t.labels),autopilot:t.autopilot,criteria:oP(t.criteria)},{onSuccess:()=>{n({...t,title:``,description:``,estimate:``,dueDate:``,labels:``,criteria:[],autopilot:!1}),a(!1)}})}return(0,Q.jsxs)(GP,{label:`New task`,expanded:i,onExpandedChange:a,onSubmit:m,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[i&&(0,Q.jsx)($e,{label:`Task type`,isLabelHidden:!0,width:112,containerClassName:`shrink-0 font-mono`,options:uC,value:o,onChange:e=>d(e)}),(0,Q.jsx)(Ke,{label:`Task title`,isLabelHidden:!0,containerClassName:`min-w-0 flex-1`,placeholder:i?`Task title`:`New task`,value:s,onChange:f}),(0,Q.jsx)(X,{type:`submit`,variant:`primary`,label:`Add task`,icon:(0,Q.jsx)(ef,{}),isDisabled:r.isPending||l===void 0||u})]}),i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(PE,{label:`Description`,placeholder:`Description (optional, Markdown)`,value:c,onChange:p,className:`flex-1`}),(0,Q.jsx)(eP,{suffix:``,plan:t,onChange:e=>n({...t,...e})}),(0,Q.jsx)($N,{suffix:``,checked:t.autopilot,onChange:e=>n({...t,autopilot:e})}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 border-t pt-2`,children:[(0,Q.jsx)(`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`})}),(0,Q.jsx)(cP,{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 JP={completed:`Completed`,opened_for_review:Fr.in_review,started:`Started`,worked_on:`Worked on`,planned:`Planned`},YP=Object.keys(JP),XP={week:`week`,month:`month`,quarter:`quarter`,year:`year`,custom:`period`},ZP={week:`Week review`,month:`Month review`,quarter:`Quarter review`,year:`Year review`,custom:`Review`};function QP(e){let[t,n,r]=e.split(`-`).map(Number);return[t,n-1,r]}function $P(e,t=0){let[n,r,i]=QP(e);return new Date(n,r,i+t)}function eF(e){return ei(e.getTime()/1e3)}function tF(e){let t=(e.getDay()+6)%7;return eF(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t))}function nF(e,t){return eF($P(e,t))}function rF(e){return{kind:`week`,from:e,to:nF(e,6)}}var iF={month:1,quarter:3,year:12};function aF(e,t,n){let r=iF[e];return{kind:e,from:eF(new Date(t,n,1)),to:eF(new Date(t,n+r,0))}}function oF(e,t){let[n,r]=QP(t);switch(e){case`week`:return rF(tF($P(t)));case`month`:return aF(e,n,r);case`quarter`:return aF(e,n,r-r%3);case`year`:return aF(e,n,0);case`custom`:return{kind:e,from:t,to:t}}}function sF(e,t){switch(e.kind){case`week`:return rF(nF(e.from,7*t));case`month`:case`quarter`:case`year`:{let[n,r]=QP(e.from);return aF(e.kind,n,r+iF[e.kind]*t)}case`custom`:{let n=cF(e);return{kind:`custom`,from:nF(e.from,n*t),to:nF(e.to,n*t)}}}}function cF(e){return Math.round(($P(e.to,1).getTime()-$P(e.from).getTime())/864e5)}function lF(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(e*1e3),r=e=>n.find(t=>t.type===e)?.value??``;return`${r(`year`)}-${r(`month`)}-${r(`day`)}`}function uF(e){let[t,n]=QP(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 dF(e){return YP.flatMap(t=>{let n=e.filter(e=>e.outcome===t);return n.length===0?[]:[{outcome:t,entries:n}]})}function fF(e){return e.split(`
64
- `,1)[0]}function pF(e,t){return`${e} ${e===1?t:`${t}s`}`}function mF(e){return/\/pull\/(\d+)/.exec(e)?.[1]??null}function hF(e){return`#${e.number}, +${e.additions}/-${e.deletions} in ${pF(e.changedFiles,`file`)}, ${pF(e.reviewCount,`review`)}`}function gF(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 _F(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 vF(e,t){return e.flatMap(e=>{let[n,r]=t(e);return n===null||r===null?[]:[r-n]})}function yF(e){for(let t of e.refs)if(t.startsWith(`pr:`)&&/^https?:\/\//.test(t.slice(3)))return t.slice(3);return null}function bF(e,t,n,r){let i=new Map(n.map(e=>[e.id,e.name])),a=t.filter(e=>e.outcome===`completed`),o=AF(e),s=a.flatMap(({pullRequest:e})=>e?[e]:[]);return{outcomes:dF(t).map(e=>({outcome:e.outcome,count:e.entries.length})),commits:t.reduce((e,t)=>e+t.commits.length,0),completedByType:_F(a.map(e=>e.task.taskType)).map(({key:e,count:t})=>({taskType:e,count:t})),completedByWorkspace:_F(a.map(e=>i.get(e.task.workspaceId)??`workspace ${e.task.workspaceId}`)).map(({key:e,count:t})=>({workspace:e,count:t})),leadTime:gF(vF(a,({task:e,at:t})=>[e.milestones.plannedAt,t])),cycleTime:gF(vF(a,({task:e,at:t})=>[e.milestones.startedAt,t])),activeTime:gF(a.flatMap(({task:e,at:t})=>{let n=mr(e.timeline,t);return n===null?[]:[n]})),reviewTime:gF(vF(a,({task:e,at:t})=>[e.milestones.reviewAt,t])),completedPerMonth:o.length<2?null:o.map(e=>({month:e,count:a.filter(t=>lF(t.at,r).startsWith(e)).length})),changes:s.length===0?null:s.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:a.filter(({task:e})=>e.resolution===`not_adopted`).length}}function xF(e,t,n){let r=Math.min(n,e),i=t.filter(e=>e.outcome===`completed`),a=i.flatMap(({task:e,at:t})=>{let n=zy(e.estimate),r=mr(e.timeline,t);return n===null||r===null?[]:[{estimated:n,actual:r}]}),o=i.flatMap(({task:e})=>{let t=jy(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`&&jy(e,n)===`late`?[{task:e,dueDate:e.dueDate,done:!0,secondsLate:My(e,n)}]:[];let i=Ay(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 SF(e){return`${jF(e.estimated)} estimated, ${jF(e.actual)} active (${pF(e.tasks,`task`)}, ${(e.actual/e.estimated).toFixed(2)}x)`}function CF(e){return`${e.onTime} of ${e.tasks} (${Math.round(e.onTime/e.tasks*100)}%)`}function wF({task:e,dueDate:t,done:n,secondsLate:r}){let i=e.milestones.completedAt;return`due ${t}, ${n&&i!==null?`done ${ei(i)}`:`still open`}, ${jF(r)} ${n?`late`:`overdue`}`}var TF=3,EF=3;function DF(e){let t=e.filter(e=>e.outcome===`completed`),n=t.flatMap(({task:e,pullRequest:t})=>t?[{task:e,pullRequest:t}]:[]),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=zy(e.estimate),r=mr(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,EF);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,TF),research:r,overruns:i}}function OF(e){return`${pF(e.reviews,`review`)} on ${e.reviewed} of ${pF(e.pullRequests,`pull request`)}`}function kF(e){return`+${e.additions}/-${e.deletions} in ${pF(e.changedFiles,`file`)} (${pF(e.pullRequests,`pull request`)})`}function AF(e){let[t,n]=QP(e.from),r=e.to.slice(0,7),i=[];for(let e=0;;e+=1){let a=eF(new Date(t,n+e,1)).slice(0,7);if(i.push(a),a>=r)return i}}function jF(e){let t=e/3600;return t<1?`<1h`:Math.round(t)<24?`${Math.round(t)}h`:`${(t/24).toFixed(1)}d`}var MF=[`leadTime`,`cycleTime`,`activeTime`,`reviewTime`],NF={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)`},PF={workspaceId:null,label:null};function FF(e,t){return e.filter(({task:e})=>(t.workspaceId===null||e.workspaceId===t.workspaceId)&&(t.label===null||e.labels.includes(t.label)))}function IF(e){return[...new Set(e.flatMap(({task:e})=>e.labels))].sort()}var LF={quarter:1,year:4};function RF(e){return e.reduce((e,t)=>e+(zy(t.estimate)??0),0)}function zF(e,t,n,r){let i=e.filter(e=>!Wy(e)),a=i.filter(e=>e.dueDate!==null).sort((e,t)=>e.dueDate.localeCompare(t.dueDate)||e.id-t.id),o=i.filter(e=>e.dueDate===null),s=new Map;for(let e of a){let n=oF(t,e.dueDate).from;s.set(n,[...s.get(n)??[],e])}let c=oF(t,r),l=a.length>0&&a[0].dueDate<c.from?oF(t,a[0].dueDate):c,u=a.at(-1)?.dueDate,d=u!==void 0&&u>c.to?oF(t,u):c,f=n===null?null:(zy(n)??0)*LF[t],p=[];for(let e=l;e.from<=d.from;e=sF(e,1)){let t=s.get(e.from)??[],n=RF(t);p.push({period:e,label:uF(e),tasks:t,estimated:n,done:RF(t.filter(e=>e.status===`done`)),unestimated:t.filter(e=>e.estimate===null).length,capacity:f,overloaded:f!==null&&n>f})}return{periods:p,unscheduled:o,unscheduledEstimated:RF(o)}}function BF(e,t){return Ry({unit:t,amount:e/(zy({unit:t,amount:1})??1)})}var VF=`toodo-plan-capacity`,HF=[`hours`,`days`,`weeks`,`months`];function UF(){try{let e=JSON.parse(localStorage.getItem(VF)??`null`);if(typeof e!=`object`||!e)return null;let{unit:t,amount:n}=e;return HF.includes(t)&&typeof n==`number`&&n>0&&n<=1e4?{unit:t,amount:n}:null}catch{return null}}function WF(e){e===null?localStorage.removeItem(VF):localStorage.setItem(VF,JSON.stringify(e))}var GF={quarter:`Quarter`,year:`Year`},KF={hours:`hours`,days:`days`,weeks:`weeks`,months:`months`};function qF({tasks:e,onShowTask:t}){let[n,r]=(0,Z.useState)(`quarter`),[i,a]=(0,Z.useState)(UF),[o,s]=(0,Z.useState)(i===null?``:String(i.amount)),[c,l]=(0,Z.useState)(i?.unit??`weeks`),u=By(o),d=(e,t)=>{s(e),l(t);let n=By(e);if(Number.isNaN(n))return;let r=n===null?null:{unit:t,amount:n};WF(r),a(r)},f=i?.unit??c,{periods:p,unscheduled:m,unscheduledEstimated:h}=zF(e,n,i,ei(Date.now()/1e3)),g=p.filter(e=>e.overloaded).length;return(0,Q.jsxs)(`div`,{role:`region`,"aria-label":`Plan`,className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-4 gap-y-2`,children:[(0,Q.jsx)(BS,{label:`Plan period`,size:`sm`,value:n,onChange:e=>typeof e==`string`&&r(e),children:[`quarter`,`year`].map(e=>(0,Q.jsx)(HS,{value:e,label:GF[e]},e))}),(0,Q.jsx)(Ke,{label:`Capacity per quarter`,size:`sm`,width:128,inputMode:`decimal`,status:Number.isNaN(u)?{type:`error`}:void 0,"aria-describedby":`capacity-hint`,placeholder:`None`,value:o,onChange:e=>d(e,c)}),(0,Q.jsx)($e,{label:`Capacity unit`,isLabelHidden:!0,size:`sm`,options:Object.keys(KF).map(e=>({value:e,label:KF[e]})),value:c,onChange:e=>d(o,e)})]}),(0,Q.jsx)(`p`,{id:`capacity-hint`,className:yy(`text-xs`,Number.isNaN(u)?`text-destructive`:`text-muted-foreground`),children:Number.isNaN(u)?`Enter a capacity greater than 0 and at most 10000, such as 12, or clear the field for no capacity.`:i===null?`Set a capacity per quarter to see which periods are overloaded. A year holds four quarters.`:g>0?`${g} ${g===1?`period is`:`periods are`} over capacity: move due dates or cut estimates.`:`Every period fits its capacity.`}),(0,Q.jsx)(`ol`,{"aria-label":`Periods`,className:`flex flex-col gap-3`,children:p.map(e=>(0,Q.jsx)(JF,{load:e,unit:f,onShowTask:t},e.period.from))}),m.length>0&&(0,Q.jsxs)(`section`,{"aria-label":`No due date`,className:`flex flex-col gap-2 rounded-xl border border-dashed p-3`,children:[(0,Q.jsxs)(`h3`,{className:`flex items-baseline gap-2 text-sm font-medium`,children:[`No due date`,(0,Q.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground tabular-nums`,children:[m.length,` `,m.length===1?`task`:`tasks`,`, `,BF(h,f),` `,`estimated`]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set a due date on these tasks to count them in a period.`}),(0,Q.jsx)(YF,{tasks:m,onShowTask:t})]})]})}function JF({load:e,unit:t,onShowTask:n}){let{capacity:r,estimated:i,overloaded:a}=e,o=r===null||r===0?null:i/r;return(0,Q.jsxs)(`li`,{"aria-label":e.label,"data-overloaded":a||void 0,className:yy(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,a&&`border-destructive/60 bg-destructive/5`),children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium`,children:e.label}),(0,Q.jsxs)(`span`,{className:`text-sm tabular-nums`,children:[BF(i,t),r!==null&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[` of `,BF(r,t)]}),o!==null&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[` (`,Math.round(o*100),`%)`]})]}),a&&r!==null&&(0,Q.jsxs)(`span`,{className:`text-xs font-medium text-destructive`,children:[`Over capacity by `,BF(i-r,t)]}),(0,Q.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[e.tasks.length,` `,e.tasks.length===1?`task`:`tasks`,e.done>0&&`, ${BF(e.done,t)} done`]})]}),o!==null&&(0,Q.jsx)(`div`,{"aria-hidden":!0,className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,Q.jsx)(`div`,{className:yy(`h-full rounded-full`,a?`bg-destructive`:`bg-primary`),style:{width:`${Math.min(o,1)*100}%`}})}),e.unestimated>0&&(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.unestimated,` `,e.unestimated===1?`task has`:`tasks have`,` no estimate and `,e.unestimated===1?`is`:`are`,` not counted: estimate `,e.unestimated===1?`it`:`them`,` to complete the sum.`]}),e.tasks.length>0&&(0,Q.jsx)(YF,{tasks:e.tasks,onShowTask:n})]})}function YF({tasks:e,onShowTask:t}){return(0,Q.jsx)(`ul`,{className:`flex flex-col text-sm`,children:e.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:yy(`min-w-0 truncate rounded-sm text-left outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,e.status===`done`&&`text-muted-foreground line-through`),onClick:()=>t(e.id),children:[(0,Q.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,e.id]}),` `,e.title]}),(0,Q.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.estimate===null?`No estimate`:Ry(e.estimate),e.dueDate!==null&&` · due ${e.dueDate}`]})]},e.id))})}var XF=(0,Z.lazy)(()=>bt(()=>import(`./task-graph-CZXSZ3LO.js`).then(e=>({default:e.TaskGraph})),__vite__mapDeps([28,1,4,3,7,8,17,14,12,13,16,10,9,11,23,24,25,6,15,20,21,22,26,27,29]))),ZF=(0,Z.lazy)(()=>bt(()=>import(`./task-details-DK77SGWd.js`).then(e=>({default:e.TaskDetailsSheet})),__vite__mapDeps([19,1,4,20,7,12,8,13,9,10,11,21,22,23,24,14,25,16,6,15,26,27,2,3])));function QF(e,t){let n=e=>`${e} ${e===1?`task`:`tasks`}`;return e===t?`Showing ${n(t)}.`:`Showing ${e} of ${n(t)}.`}function $F({workspace:e,timelineScale:t,onTimelineScaleChange:n,draft:r=KP,onDraftChange:i,shownTask:a=null,onTaskShown:o,view:s=`list`,onViewChange:c,selectedTask:l,onSelectTask:u}){let d=Zr(),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),g=ur([a?.id,l,sC(m?.query??``)]),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(null),x=new Map(d.data?.map(e=>[e.id,e])),S={byId:new Map(g.data?.map(e=>[e.id,e])),workspaceName:e=>x.get(e)?.name??`Workspace ${e}`},C=e===null?g.data:g.data?.filter(t=>t.workspaceId===e.id),w=e===null&&s===`timeline`,T=e===null&&s===`plan`,E=w||T,D=m??(w?iC:rC),O=[...new Set(g.data?.map(e=>e.workspaceId))].sort((e,t)=>S.workspaceName(e).localeCompare(S.workspaceName(t))),k=f!==null&&O.includes(f)?f:null,A=[E&&k!==null,D.query.trim()!==``,D.statuses.length>0,D.type!==null].filter(Boolean).length,j=sC(D.query),ee=j===null?void 0:S.byId.get(j),M=ee!==void 0&&cC(ee,{...D,query:``},S.byId)?ee:void 0,N=C?.filter(e=>e!==M&&(!E||k===null||e.workspaceId===k)&&cC(e,D,S.byId)),P=M===void 0?N??[]:[M,...N??[]],F=E?D.statuses.length===0||D.statuses.some(e=>e===`done`||e===`not_adopted`):y??aC(D);Pn(F);let I=F&&g.hasNextPage?()=>void g.fetchNextPage({cancelRefetch:!1}):void 0,L=I&&(0,Q.jsx)(tI,{loading:g.isFetchingNextPage,failed:g.isFetchNextPageError,onLoad:I}),R=a===null?void 0:S.byId.get(a.id);(0,Z.useEffect)(()=>{R!==void 0&&(p(e=>e===R.workspaceId?e:null),h(e=>cC(R,e??iC,S.byId)?e:rC))},[a,R===void 0]),(0,Z.useEffect)(()=>{if(w)return;let e=e=>{let t=e.key===`j`?1:e.key===`k`?-1:0;if(t===0||!bv(e)||document.querySelector(`form[data-dirty]`))return;let n=[...document.querySelectorAll(`[data-task-row] [data-task-title]`)],r=e=>e.closest(`[data-task-row]`),i=n.findIndex(e=>r(e).contains(document.activeElement));i===-1&&(i=n.findIndex(e=>r(e).dataset.taskRow===String(l)));let a=n[i===-1?t>0?0:n.length-1:i+t];a!==void 0&&(e.preventDefault(),a.focus(),a.scrollIntoView?.({block:`nearest`}),l!==null&&u(Number(r(a).dataset.taskRow)))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)});let z=y??aC(D),te=e=>[`done`,`not_adopted`].includes(nC(e,S.byId)),B=pb(N??[],Date.now()/1e3),ne=B.filter(te).length,re=z?B:B.filter(e=>!te(e)),ie=k===null?[]:(C??[]).filter(e=>e!==M&&e.workspaceId!==k&&P.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.jsx)(FP,{workspace:e},e.id):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground max-md:hidden`,children:`Tasks of every workspace and the dependencies between them.`})]}),e&&(0,Q.jsx)(VP,{workspace:e},e.id),e&&i&&(0,Q.jsx)(qP,{workspace:e,draft:r,onChange:i}),(0,Q.jsx)(`p`,{role:`status`,className:yy(`text-sm text-muted-foreground`,!g.isPending&&`sr-only`),children:g.isPending?`Loading tasks...`:C&&N?QF(N.length+ +!!M,C.length):``}),g.isError&&(0,Q.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load tasks: `,g.error.message]}),C?.length===0&&(0,Q.jsx)(aI,{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.`}),g.data&&C&&N&&C.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.jsxs)(BS,{label:`Task view`,type:`single`,size:`sm`,value:s,onChange:e=>typeof e==`string`&&c?.(e),children:[(0,Q.jsx)(HS,{value:`timeline`,label:`Timeline`}),(0,Q.jsx)(HS,{value:`list`,label:`List`}),(0,Q.jsx)(HS,{value:`plan`,label:`Plan`})]}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,className:`ml-auto md:hidden`,label:A>0?`Filters, ${A} active`:`Filters`,icon:(0,Q.jsx)(pf,{}),endContent:A>0?(0,Q.jsx)(Oy,{variant:`info`,label:A}):void 0,"aria-expanded":_,"aria-controls":`task-filters`,onClick:()=>v(!_),children:`Filters`}),(0,Q.jsxs)(`div`,{id:`task-filters`,className:yy(`contents`,!_&&`max-md:hidden`),children:[E&&(0,Q.jsx)($e,{label:T?`Plan workspace`:`Timeline workspace`,isLabelHidden:!0,size:`sm`,value:k===null?`all`:String(k),options:[{value:`all`,label:`All workspaces`},...O.map(e=>({value:String(e),label:S.workspaceName(e)}))],onChange:e=>p(e===`all`?null:Number(e))}),(0,Q.jsx)(rI,{filter:D,onChange:h})]})]}),N.length===0&&M===void 0?(0,Q.jsx)(aI,{icon:(0,Q.jsx)(sf,{}),title:`No tasks match the search and filters.`,hint:`Change the search text, status, or type, or clear the filters.`}):w?(0,Q.jsx)(by,{label:`the timeline`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Loading timeline...`}),children:(0,Q.jsx)(XF,{tasks:[...P,...ie],allTasks:g.data,dimmed:new Set(ie.map(e=>e.id)),workspaceLabel:e=>k===null||e.workspaceId!==k?S.workspaceName(e.workspaceId):null,statusLabel:e=>dC(e,S.byId),statusStyle:e=>gC(e,S.byId),ready:e=>nC(e,S.byId)===`ready`,scale:t,onScaleChange:n,selectedTaskId:l,onSelectedTaskChange:u,shownTaskId:a?.id??null,onTaskShown:()=>o?.(),onNearPast:g.isFetchingNextPage||g.isFetchNextPageError?void 0:I,renderDetail:(e,t)=>(0,Q.jsx)(jP,{task:e,tasks:g.data??[],context:S,showWorkspace:!0,detailed:!0,navigation:t},e.id)})})}):(0,Q.jsxs)(Q.Fragment,{children:[T?(0,Q.jsxs)(Q.Fragment,{children:[L,(0,Q.jsx)(qF,{tasks:P,onShowTask:u})]}):(0,Q.jsxs)(`div`,{role:`region`,"aria-label":`Tasks`,className:`flex flex-col gap-4`,children:[M&&(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:[`#`,M.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)(jP,{task:M,tasks:g.data,context:S,showWorkspace:e===null||M.workspaceId!==e.id,onShowDetails:()=>u(M.id)})})]}),ne>0&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`h3`,{className:`flex items-center gap-1.5 text-sm font-medium text-muted-foreground`,children:(0,Q.jsxs)(X,{size:`sm`,variant:`ghost`,label:`Done ${ne}`,icon:(0,Q.jsx)(nd,{"aria-hidden":!0,className:yy(`transition-transform`,!z&&`-rotate-90`)}),"aria-expanded":z,onClick:()=>b(!z),children:[`Done `,(0,Q.jsx)(`span`,{className:`tabular-nums font-normal`,children:ne})]})}),e&&(0,Q.jsx)(iI,{workspace:e})]}),L,re.length>0&&(0,Q.jsx)(`ul`,{"aria-label":`Task list`,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:re.map(t=>(0,Q.jsx)(jP,{task:t,tasks:g.data,context:S,showWorkspace:e===null,onShowDetails:()=>u(t.id)},t.id))})]}),l!==null&&S.byId.has(l)&&(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading details...`}),children:(0,Q.jsx)(ZF,{onClose:()=>u(null),children:(0,Q.jsx)(jP,{task:S.byId.get(l),tasks:g.data,context:S,showWorkspace:!0,detailed:!0,navigation:{open:u,canOpen:e=>S.byId.has(e)}},l)})})]})]})]})}function eI(e){for(let t=e.parentElement;t!==null;t=t.parentElement)if(/auto|scroll/.test(getComputedStyle(t).overflowY)&&t.scrollHeight>t.clientHeight)return t;return document.scrollingElement??document.documentElement}function tI({loading:e,failed:t,onLoad:n}){let r=(0,Z.useRef)(null),i=(0,Z.useRef)({loading:e,failed:t,onLoad:n});return(0,Z.useEffect)(()=>{i.current={loading:e,failed:t,onLoad:n}}),(0,Z.useEffect)(()=>{let e=r.current,t=()=>{let{top:t,bottom:n}=e.getBoundingClientRect();return n>-600&&t<window.innerHeight},n=()=>{let{loading:e,failed:n,onLoad:r}=i.current;!e&&!n&&t()&&r()},a=new WeakMap,o=eI(e);a.set(o,o.scrollTop);let s=t=>{let r=t.target===document?document.scrollingElement:t.target;if(!(r instanceof Element)||!r.contains(e))return;let i=a.get(r)??r.scrollTop;a.set(r,r.scrollTop),r.scrollTop<i&&n()},c=t=>{t.deltaY<0&&eI(e).scrollTop<=0&&n()};return document.addEventListener(`scroll`,s,{capture:!0,passive:!0}),document.addEventListener(`wheel`,c,{passive:!0}),()=>{document.removeEventListener(`scroll`,s,{capture:!0}),document.removeEventListener(`wheel`,c)}},[]),(0,Q.jsxs)(`div`,{ref:r,className:`flex min-h-8 items-center gap-2 text-sm text-muted-foreground`,children:[(0,Q.jsx)(`span`,{role:`status`,children:e?`Loading older finished tasks...`:``}),t&&!e&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{role:`alert`,children:`Could not load older finished tasks.`}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Try again`,onClick:n})]})]})}function nI(e,t,n=jn[e]){return yy(`gap-1 rounded-full border px-2`,t?yy(n,`border-transparent hover:brightness-95 dark:hover:brightness-125`):yy(Kn[e],`bg-transparent`))}function rI({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)(Ke,{type:`search`,label:`Search tasks`,isLabelHidden:!0,size:`sm`,placeholder:`Search title, description, or #number`,containerClassName:`w-56 max-md:col-span-2 max-md:w-full`,value:e.query,onChange:n=>t({...e,query:n})}),(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:tC.map(n=>(0,Q.jsx)(HS,{size:`sm`,label:Fr[n],icon:(0,Q.jsx)(`span`,{"aria-hidden":!0,className:yy(`size-1.5 rounded-full`,Nr[fC[n]])}),pressedIcon:(0,Q.jsx)(ed,{"aria-hidden":!0}),className:nI(fC[n],e.statuses.includes(n),mC(n)),isPressed:e.statuses.includes(n),onPressedChange:()=>t({...e,statuses:oC(e.statuses,n)}),children:Fr[n]},n))}),(0,Q.jsx)($e,{label:`Type filter`,isLabelHidden:!0,size:`sm`,value:e.type??`all`,options:[{value:`all`,label:`All types`},...uC],onChange:n=>t({...e,type:n===`all`?null:n})}),(0,Q.jsx)(HS,{size:`sm`,label:`Autopilot`,tooltip:`Only tasks marked for autopilot`,icon:(0,Q.jsx)(Ku,{"aria-hidden":!0}),className:nI(`info`,e.autopilot),isPressed:e.autopilot,onPressedChange:n=>t({...e,autopilot:n}),children:`Autopilot`}),aC(e)&&(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Clear filters`,icon:(0,Q.jsx)(Tf,{}),onClick:()=>t(rC)})]})}function iI({workspace:e}){let t=Or(),[n,r]=(0,Z.useState)(null),i=n!==null,[a,o]=(0,Z.useState)(!1),s=gr(e.id,i),c=n!==null&&s.isSuccess&&s.dataUpdatedAt>=n?s.data:void 0,l=c===void 0?`done tasks`:`${c} done ${c===1?`task`:`tasks`}`;function u(){r(null),o(!0)}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{role:i?`group`:void 0,"aria-label":i?`Delete ${l}?`:void 0,className:yy(`ml-auto flex items-center gap-1 max-md:gap-2`,i&&`basis-full flex-wrap justify-end`),onKeyDown:i?$S(u,t.isPending):void 0,children:i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:c===void 0?`Counting done tasks...`:c===1?`Delete ${l}? It moves to Settings > Archive with its history, where it can be restored.`:`Delete ${l}? They move to Settings > Archive with their history, where they can be restored.`}),(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`destructive`,label:t.isPending?`Deleting...`:`Confirm delete`,icon:(0,Q.jsx)(xf,{}),isDisabled:t.isPending||c===void 0||s.isFetching,onClick:()=>t.mutate(e.id,{onSuccess:u})}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Back`,autoFocus:!0,onClick:u})]}):(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Delete done`,icon:(0,Q.jsx)(xf,{}),tooltip:`Move every done task of this workspace to the archive`,autoFocus:a,onClick:()=>{t.reset(),r(Date.now())}})}),t.isError?(0,Q.jsx)(`p`,{role:`alert`,className:`basis-full text-xs text-destructive`,children:t.error.message}):i&&s.isError&&(0,Q.jsxs)(`p`,{role:`alert`,className:`basis-full text-xs text-destructive`,children:[`Could not count the done tasks: `,s.error.message,` Choose Back, then Delete done to count them again.`]})]})}function aI({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)(Ed,{})}),(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 oI(e){let t={type:`http`,url:e.url,headers:{Authorization:`Bearer ${e.token??``}`}};return JSON.stringify({mcpServers:{toodo:t}},null,2)}async function sI(e){let t={Authorization:`Bearer ${e.token??``}`,"Content-Type":`application/json`,Accept:`application/json, text/event-stream`},n=await so(`/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&&so(`/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 cI={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 lI(e){return e.split(/(?<=\/)(?!\/)/).map((e,t)=>(0,Q.jsxs)(`span`,{children:[t>0&&(0,Q.jsx)(`wbr`,{}),e]},t))}function uI(){let e=tr(),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null);async function a(e,t){try{await navigator.clipboard.writeText(e),n(`Copied ${t}.`)}catch(e){n(`Could not copy: ${String(e)}`)}}async function o(e){i(`testing`);try{i(await sI(e))}catch(e){i({ok:!1,message:`Could not reach the MCP server: ${String(e)}`})}}let s=e.data,c=s?.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.`}),s&&(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:lI(s.url)}),s.error?(0,Q.jsxs)(`p`,{role:`alert`,className:`text-destructive`,children:[`MCP server is not running: `,s.error]}):s.token&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Q.jsx)(X,{size:`sm`,variant:`primary`,label:`Copy MCP config`,onClick:()=>void a(oI(s),`the MCP config`)}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Copy MCP token for agents`,onClick:()=>void a(s.token??``,`the MCP token for agents`)}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Test connection`,isDisabled:r===`testing`,onClick:()=>void o(s)})]}),r&&r!==`testing`&&(0,Q.jsx)(`p`,{role:`status`,"aria-label":`Connection test`,className:yy(`break-words`,!r.ok&&`text-destructive`),children:r.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:s.instance}),`, which agents see in`,` `,(0,Q.jsx)(`code`,{children:`401`}),` replies and `,(0,Q.jsx)(`code`,{children:`serverInfo`}),`.`]}),c&&(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(c.at*1e3).toISOString(),title:oi(c.at),children:ii(c.at)}),`: `,cI[c.reason],c.count>1&&` (${c.count} since the server started)`,`.`]})]}),t&&(0,Q.jsx)(`p`,{role:`status`,children:t})]})}function dI(){let e=Vr(),t=zn(),n=Fn(),r=An(),i=Pr(),[a,o]=(0,Z.useState)(null),s=t.isPending||n.isPending||r.isPending||i.isPending,c=t.error??n.error??r.error??i.error??e.error,l=()=>{for(let e of[t,n,r,i])e.reset()};function u(e){let t={onSuccess:()=>o(null)};e.kind===`workspace`?r.mutate(e.id,t):i.mutate(e.id,t)}let d=e.data?.workspaces??[],f=e.data?.tasks??[];return(0,Q.jsxs)(`section`,{"aria-label":`Archive`,className:`flex flex-col gap-3 text-xs`,children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Deleted workspaces and tasks are kept here with their history and still count in reviews. Restore one to bring it back, or delete it permanently.`}),a&&(0,Q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm permanent delete`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,Q.jsxs)(`p`,{className:`break-words`,children:[`Permanently delete `,(0,Q.jsx)(`span`,{className:`font-medium`,children:a.name}),a.kind===`workspace`?` and its tasks`:``,`? Its history, commits, and links are removed and leave the reviews; this cannot be undone.`]}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`destructive`,label:r.isPending||i.isPending?`Deleting...`:`Delete permanently`,onClick:()=>u(a),isDisabled:s}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Cancel`,autoFocus:!0,onClick:()=>o(null),isDisabled:s})]})]}),c&&(0,Q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.message}),(0,Q.jsx)(fI,{label:`Archived workspaces`,empty:`No archived workspaces.`,children:d.map(e=>(0,Q.jsx)(pI,{name:e.name,detail:e.repository??``,busy:s,onRestore:()=>{l(),t.mutate(e.id)},onPurge:()=>{l(),o({kind:`workspace`,id:e.id,name:e.name})}},e.id))}),(0,Q.jsx)(fI,{label:`Archived tasks`,empty:`No archived tasks.`,children:f.map(e=>(0,Q.jsx)(pI,{name:`#${e.id} ${e.title}`,detail:e.status.replace(`_`,` `),busy:s,onRestore:()=>{l(),n.mutate(e.id)},onPurge:()=>{l(),o({kind:`task`,id:e.id,name:`#${e.id} ${e.title}`})}},e.id))})]})}function fI({label:e,empty:t,children:n}){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`h4`,{className:`font-medium`,children:e}),(0,Q.jsxs)(`ul`,{"aria-label":e,className:`flex flex-col divide-y`,children:[n.length===0&&(0,Q.jsx)(`li`,{className:`text-muted-foreground`,children:t}),n]})]})}function pI({name:e,detail:t,busy:n,onRestore:r,onPurge:i}){return(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 first:pt-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,Q.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t})]}),(0,Q.jsxs)(`span`,{className:`flex gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`secondary`,label:`Restore ${e}`,isDisabled:n,onClick:r,children:`Restore`}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Delete ${e} permanently`,isDisabled:n,onClick:i,children:`Delete permanently`})]})]})}var mI=[`connected-apps`];function hI(e){return e.split(` `).includes(`toodo.write`)?`Read and write access`:`Read access`}function gI({url:e}){let[t,n]=(0,Z.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)(X,{size:`sm`,variant:`primary`,className:`self-start`,label:`Copy MCP URL`,onClick:()=>void r(e)}),t&&(0,Q.jsx)(`p`,{role:`status`,children:t})]})}function _I({app:e}){let t=Sr(),[n,r]=(0,Z.useState)(!1),i=Bn({mutationFn:()=>zr(kr.revokeConnectedApp(e.grantId)),onSuccess:()=>t.invalidateQueries({queryKey:mI})}),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:hI(e.scopes)}),(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Q.jsx)(Dr,{at:e.createdAt,prefix:`Connected `}),` · `,e.lastUsedAt===null?`Not used yet`:(0,Q.jsx)(Dr,{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:$S(()=>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)(X,{changesData:!0,size:`sm`,variant:`destructive`,label:`Revoke`,isDisabled:i.isPending,onClick:()=>i.mutate()}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Keep`,autoFocus:!0,onClick:()=>r(!1)})]})]}):(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,className:`self-start`,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 vI(){let e=Wn({queryKey:mI,queryFn:()=>zr(kr.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)(gI,{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)(_I,{app:e},e.grantId))})]})]})}var yI={scope:`full`,expiresInDays:90},bI=[{label:`90 days`,days:90},{label:`30 days`,days:30},{label:`1 year`,days:365},{label:`Never expires`,days:null}];function xI(e,t){return JSON.stringify({label:e,scope:t.scope,expiresInDays:t.expiresInDays})}var SI=class extends Error{constructor(){super(`The server did not accept this token.`)}};async function CI(e){if(e.status===401)throw new SI;if(!e.ok)throw Error(await io(e));return e}async function wI(e,t,n=yI){return(await(await CI(await ho.fetch(`/api/devices`,{headers:co(e)}))).json()).some(e=>e.current)?e:(await(await CI(await ho.fetch(`/api/devices`,{method:`POST`,headers:{...co(e),"Content-Type":`application/json`},body:xI(t,n)}))).json()).token}async function TI(){return await(await fo(`/api/devices`)).json()}async function EI(e,t=yI){return(await(await fo(`/api/devices`,{method:`POST`,headers:{"Content-Type":`application/json`},body:xI(e,t)})).json()).token}async function DI(e){return await(await fo(`/api/devices/${e}/revoke`,{method:`POST`})).json()}function OI(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 kI=[`devices`];function AI({devices:e}){let t=Sr(),n=Bn({mutationFn:()=>EI(OI(navigator.userAgent)),onSuccess:e=>(po(e),t.invalidateQueries({queryKey:kI}))}),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)(X,{changesData:!0,size:`sm`,variant:`secondary`,className:`self-start`,label:n.isPending?`Registering...`:`Register this browser`,isDisabled:n.isPending,onClick:()=>n.mutate()})]}),n.error&&(0,Q.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:n.error.message})]})}function jI({device:e}){let t=Sr(),[n,r]=(0,Z.useState)(!1),i=Bn({mutationFn:()=>DI(e.id),onSuccess:()=>t.invalidateQueries({queryKey:kI})}),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)`}),e.scope===`read`&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`read-only`})]}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:e.revokedAt===null?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Dr,{at:e.lastSeenAt,prefix:`Last seen `}),` · `,e.expiresAt===null?`never expires`:(0,Q.jsx)(Dr,{at:e.expiresAt,prefix:e.expiresAt*1e3<=Date.now()?`expired `:`expires `})]}):(0,Q.jsx)(Dr,{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:$S(()=>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)(X,{changesData:!0,size:`sm`,variant:`destructive`,label:`Revoke`,isDisabled:i.isPending,onClick:()=>i.mutate()}),(0,Q.jsx)(X,{size:`sm`,variant:`ghost`,label:`Keep`,autoFocus:!0,onClick:()=>r(!1)})]})]}):(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,className:`self-start`,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 MI(){let e=Wn({queryKey:kI,queryFn:TI});if(!e.data)return null;let t=Date.now()/1e3,n=e.data.filter(e=>e.revokedAt===null&&(e.expiresAt===null||e.expiresAt>t));return(0,Q.jsxs)(Q.Fragment,{children:[n.length,` signed in`]})}function NI(){let e=Wn({queryKey:kI,queryFn:TI});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 until it expires. 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)(AI,{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)(jI,{device:e},e.id))})]})}var PI=[`push`],FI=[{key:`completion`,label:`Task awaiting completion`}],II={"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 LI({subscription:e,permission:t}){return e?`on`:t===`denied`?`blocked`:`off`}function RI({failure:e}){return(0,Q.jsxs)(`div`,{role:`note`,"aria-label":`Last delivery failure`,className:`flex flex-col gap-0.5 rounded-md border border-destructive/40 p-2`,children:[(0,Q.jsx)(`p`,{className:`font-medium`,children:`The last notification did not reach this device`}),(0,Q.jsxs)(`p`,{className:`break-words text-muted-foreground`,children:[(0,Q.jsx)(`time`,{dateTime:new Date(e.at*1e3).toISOString(),title:oi(e.at),children:ii(e.at)}),`: `,e.message]}),(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Send a test notification to check again. If it keeps failing, disable and enable notifications to subscribe this device anew.`})]})}function zI({state:e}){let t=Sr(),n=e=>t.setQueryData(PI,t=>t&&{...t,subscription:e}),r=()=>t.invalidateQueries({queryKey:PI}),i=Bn({mutationFn:t=>Jr(t,e.publicKey),onSuccess:n,onError:r}),a=Bn({mutationFn:Br,onSuccess:()=>n(null),onError:r}),o=Bn({mutationFn:Xr,onSuccess:n}),s=Bn({mutationFn:yr,onSettled:r}),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.`}),u.lastFailure&&(0,Q.jsx)(RI,{failure:u.lastFailure}),(0,Q.jsxs)(`fieldset`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`legend`,{className:`mb-1 text-muted-foreground`,children:`Notify about`}),FI.map(({key:e,label:t})=>(0,Q.jsx)(Rf,{label:t,value:d[e],isDisabled:o.isPending,onChange:t=>o.mutate({...d,[e]:t})},e))]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`secondary`,label:`Send test notification`,isDisabled:s.isPending,onClick:()=>s.mutate()}),(0,Q.jsx)(X,{changesData:!0,size:`sm`,variant:`ghost`,label:`Disable notifications on this device`,isDisabled: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)(X,{size:`sm`,variant:`primary`,className:`self-start`,label:`Enable notifications on this device`,isDisabled: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 BI(){let[e]=(0,Z.useState)(Hr);return{support:e,state:Wn({queryKey:PI,queryFn:jr,enabled:e===`supported`})}}function VI(){let{state:e}=BI();return e.data?(0,Q.jsx)(Q.Fragment,{children:LI(e.data)}):null}function HI(){let{support:e,state:t}=BI();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.`:II[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)(zI,{state:t.data})]})}var UI=[`#006E46`,`#63DCA9`],WI={"size:sm":{"--text-label-size":`var(--font-size-sm)`,"--text-body-size":`var(--font-size-sm)`,"--size-element-sm":`24px`}},GI=Mo({name:`toodo`,typography:{body:{family:`Geist Variable`,fallbacks:`sans-serif`}},tokens:{"--color-accent":UI,"--color-text-accent":UI,"--color-icon-accent":UI,"--focus-outline-color":UI,"--color-accent-muted":[`rgba(0, 110, 70, 0.2)`,`rgba(99, 220, 169, 0.25)`],"--color-on-accent":[`#FFFFFF`,`#003D1A`]},components:{button:WI,"text-input":WI,"text-area":WI,selector:WI,"date-input":WI,"number-input":WI,typeahead:WI,"segmented-control":WI}}),KI=[`light`,`dark`,`system`],qI=`toodo-theme`,JI=`(prefers-color-scheme: dark)`,YI=new Set,XI={light:ou(GI,{mode:`light`})[`--color-background-body`],dark:ou(GI,{mode:`dark`})[`--color-background-body`]};function ZI(e){return KI.includes(e)}function QI(){let e=localStorage.getItem(qI);return ZI(e)?e:`system`}function $I(){let e=QI();return e===`dark`||e===`system`&&window.matchMedia(JI).matches?`dark`:`light`}function eL(){let e=$I()===`dark`;document.documentElement.classList.toggle(`dark`,e),document.documentElement.style.colorScheme=e?`dark`:`light`;for(let t of document.querySelectorAll(`meta[name="theme-color"]`))t.setAttribute(`content`,e?XI.dark:XI.light)}function tL(e){localStorage.setItem(qI,e),eL(),YI.forEach(e=>e())}function nL(){eL(),window.matchMedia(JI).addEventListener(`change`,()=>{eL(),YI.forEach(e=>e())})}function rL(e){return YI.add(e),()=>YI.delete(e)}function iL(){return(0,Z.useSyncExternalStore)(rL,QI)}function aL(){return(0,Z.useSyncExternalStore)(rL,$I)}var oL=[{value:`light`,label:`Light theme`,Icon:yf},{value:`dark`,label:`Dark theme`,Icon:Hd},{value:`system`,label:`System theme`,Icon:Bd}];function sL(){let e=iL();return(0,Q.jsx)(BS,{label:`Theme`,type:`single`,size:`sm`,value:e,onChange:e=>typeof e==`string`&&tL(e),children:oL.map(({value:e,label:t,Icon:n})=>(0,Q.jsx)(HS,{value:e,label:t,icon:(0,Q.jsx)(n,{}),isIconOnly:!0},e))})}function cL(e,t){if(e===null)return;let n=[...e.querySelectorAll(`a[href], button, input, select, textarea, summary, [tabindex]`)].filter(e=>!e.matches(`:disabled, [tabindex='-1']`)&&e.getClientRects().length>0);if(n.length===0)return;let r=n[0],i=n[n.length-1],a=document.activeElement,o=a instanceof Node&&e.contains(a);(t.shiftKey?!o||a===r:!o||a===i)&&(t.preventDefault(),(t.shiftKey?i:r).focus())}var lL=[{id:`general`,label:`General`,icon:(0,Q.jsx)(pf,{})},{id:`agents`,label:`Agent access`,icon:(0,Q.jsx)(Ku,{})},{id:`apps`,label:`Connected apps`,icon:(0,Q.jsx)(Qd,{})},{id:`devices`,label:`Devices`,icon:(0,Q.jsx)(Rd,{}),status:(0,Q.jsx)(MI,{})},{id:`notifications`,label:`Notifications`,icon:(0,Q.jsx)(Wu,{}),status:(0,Q.jsx)(VI,{})},{id:`backups`,label:`Backups`,icon:(0,Q.jsx)(fd,{}),status:(0,Q.jsx)(bh,{})},{id:`archive`,label:`Archive`,icon:(0,Q.jsx)(Bu,{})}];function uL(){let e=Wn({queryKey:[`app-info`],queryFn:()=>kr.appInfo()}),t=Wn({queryKey:[`update-check`],queryFn:()=>kr.checkUpdate(),staleTime:216e5});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)(sL,{})]}),(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...`}),t.data?.newer&&(0,Q.jsxs)(`p`,{role:`status`,className:`w-full text-muted-foreground`,children:[`v`,t.data.latest,` is available on the `,t.data.channel,` channel. Update the server with`,` `,(0,Q.jsx)(`code`,{children:`toodo update`}),`.`]}),t.data?.error&&(0,Q.jsxs)(`p`,{className:`w-full text-muted-foreground`,children:[`Update check: `,t.data.error]})]})]})}var dL=e=>`settings-tab-${e}`,fL=e=>`settings-panel-${e}`;function pL({open:e,section:t,onShow:n,onClose:r,returnFocus:i}){let a=(0,Z.useRef)(null),o=(0,Z.useRef)(null),s=t??`general`,c=(0,Z.useRef)(r);c.current=r;let l=(0,Z.useRef)(i);l.current=i;let u=YS();(0,Z.useLayoutEffect)(()=>{if(e)return u&&t!==null?o.current?.focus({preventScroll:!0}):document.getElementById(dL(s))?.focus({preventScroll:!0}),()=>{let e=document.activeElement;if(e!==null&&e!==document.body&&!a.current?.contains(e))return;let t=l.current();t?.isConnected&&t.focus({preventScroll:!0})}},[e]),(0,Z.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),c.current()),e.key===`Tab`&&cL(a.current,e)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let d=e=>{n(e),u&&requestAnimationFrame(()=>o.current?.focus({preventScroll:!0}))},f=()=>{n(null),requestAnimationFrame(()=>document.getElementById(dL(s))?.focus({preventScroll:!0}))},p=e=>{let t=lL.findIndex(e=>e.id===s),r=e.key===`ArrowDown`?(t+1)%lL.length:e.key===`ArrowUp`?(t-1+lL.length)%lL.length:e.key===`Home`?0:e.key===`End`?lL.length-1:null;if(r===null)return;e.preventDefault();let i=lL[r].id;n(i),document.getElementById(dL(i))?.focus()},m=lL.find(e=>e.id===s)??lL[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:a,role:`dialog`,"aria-modal":!0,"aria-labelledby":`settings-title`,className:yy(`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:yy(`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)(ia,{variant:`ghost`,size:`sm`,className:`ml-auto md:hidden`,label:`Close settings`,icon:(0,Q.jsx)(Tf,{}),onClick:()=>r()})]}),(0,Q.jsx)(`div`,{role:`tablist`,"aria-orientation":`vertical`,"aria-label":`Settings sections`,className:`flex flex-col gap-0.5`,onKeyDown:p,children:lL.map(e=>{let t=e.id===s;return(0,Q.jsxs)(`button`,{id:dL(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":fL(e.id),tabIndex:t?0:-1,onClick:()=>d(e.id),className:yy(`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)(od,{"aria-hidden":!0,className:yy(`md:hidden`,!e.status&&`ml-auto`)})]},e.id)})})]}),(0,Q.jsxs)(`div`,{className:yy(`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)(ia,{variant:`ghost`,size:`sm`,className:`md:hidden`,label:`Back to settings`,icon:(0,Q.jsx)(id,{}),onClick:f}),(0,Q.jsx)(`h3`,{ref:o,tabIndex:-1,className:`text-base font-semibold outline-none`,children:m.label}),(0,Q.jsx)(ia,{variant:`ghost`,size:`sm`,className:`ml-auto`,label:`Close settings`,tooltip:`Close settings (Esc)`,icon:(0,Q.jsx)(Tf,{}),onClick:()=>r()})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-6`,children:lL.map(e=>(0,Q.jsx)(`div`,{id:fL(e.id),role:`tabpanel`,"aria-labelledby":dL(e.id),hidden:e.id!==s,children:(0,Q.jsx)(by,{label:`the ${e.label} settings`,children:e.id===`general`?(0,Q.jsx)(uL,{}):e.id===`agents`?(0,Q.jsx)(uI,{}):e.id===`apps`?(0,Q.jsx)(vI,{}):e.id===`devices`?(0,Q.jsx)(NI,{}):e.id===`notifications`?(0,Q.jsx)(HI,{}):e.id===`backups`?(0,Q.jsx)(Ch,{}):(0,Q.jsx)(dI,{})})},e.id))})]})]})]})}function mL(e){return e!==null&&/^\d+$/.test(e)?Number(e):null}function hL(e){let t=new URLSearchParams(e),n=t.get(`view`);if(n===`review`)return{page:`review`};let r=mL(t.get(`task`)),i=mL(t.get(`workspace`));return i===null?{page:`all`,view:n===`list`||n===`plan`?n:`timeline`,task:r}:{page:`workspace`,workspace:i,task:r}}function gL(e){let t=new URLSearchParams;e.page===`review`?t.set(`view`,`review`):e.page===`workspace`?t.set(`workspace`,String(e.workspace)):e.view!==`timeline`&&t.set(`view`,e.view),e.page!==`review`&&e.task!==null&&t.set(`task`,String(e.task));let n=t.toString();return n===``?``:`?${n}`}function _L(e){let[t,n]=(0,Z.useState)(()=>hL(location.search)),r=(0,Z.useRef)(e);return r.current=e,(0,Z.useEffect)(()=>{r.current(hL(location.search));let e=()=>{let e=hL(location.search);n(e),r.current(e)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),[t,e=>{let t=gL(e);t!==location.search&&history.pushState(null,``,`${location.pathname}${t}${location.hash}`),n(e)}]}var vL=(0,Z.lazy)(()=>bt(()=>import(`./review-2RqEEvjf.js`).then(e=>({default:e.Review})),__vite__mapDeps([30,1,4,23,7,8,9,10,11,12,13,24,14,25,16,6,15,20,21,26,27,2])));function yL(){let e=document.querySelector(`[role='search'] input[type='search']`);return e!==null&&(typeof e.checkVisibility!=`function`||e.checkVisibility())?e:null}function bL(){let e=Zr();nr();let[t,n]=(0,Z.useState)(null),[r,i]=_L(e=>{e.page===`all`&&e.view===`timeline`&&e.task!==null&&n({id:e.task})}),a=r.page===`review`,o=r.page===`workspace`?r.workspace:`all`,s=e=>{i(e),l(!1)},[c,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),f=(0,Z.useRef)(!1),p=(0,Z.useRef)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(!1),b=e=>{m||(y.current=c),_(e),h(!0),l(!1)};(0,Z.useEffect)(()=>{if(c?d.current?.focus():f.current&&!m&&u.current?.focus(),f.current=c,!c)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&l(!1),e.key===`Tab`&&cL(p.current,e)},t=()=>{window.innerWidth>=768&&l(!1)};return document.addEventListener(`keydown`,e),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`keydown`,e),window.removeEventListener(`resize`,t)}},[c]);let[x,S]=(0,Z.useState)(`week`),[C,w]=(0,Z.useState)(new Map),T=(e,t)=>w(n=>new Map(n).set(e,t)),E=e=>{s({page:`all`,view:`timeline`,task:e}),n({id:e})};(0,Z.useEffect)(()=>hr(E),[]);let[D,O]=(0,Z.useState)(!1),k=(0,Z.useRef)(null),A=o===`all`&&!a,j=e.data?.find(e=>e.id===o)??e.data?.[0],ee=ur(),[M,N]=(0,Z.useState)(!1),[P,F]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let e=e=>{if(_v(e)){if(m)return;e.preventDefault(),l(!1),F(!1),N(e=>!e)}else e.key===`?`&&bv(e)?(e.preventDefault(),F(!0)):e.key===`/`&&bv(e)&&yL()!==null&&(e.preventDefault(),yL()?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[m]);let I=e=>{r.page===`all`&&r.view===`timeline`?E(e.id):r.page===`all`?s({...r,task:e.id}):s({page:`workspace`,workspace:e.workspaceId,task:e.id})};return(0,Q.jsxs)(`div`,{className:`flex h-dvh bg-background text-foreground print:block print:h-auto`,children:[c&&(0,Q.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-black/40 md:hidden`,onClick:()=>l(!1)}),(0,Q.jsxs)(`aside`,{ref:p,inert:m,role:c?`dialog`:void 0,"aria-modal":c||void 0,"aria-label":c?`Menu`:void 0,className:yy(`flex min-h-0 w-64 shrink-0 flex-col gap-4 overflow-y-auto border-r bg-sidebar p-3 text-sidebar-foreground print:hidden`,`max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-40 max-md:shadow-lg`,!c&&`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)(Md,{className:`size-4`})}),`Toodo`]}),(0,Q.jsx)(ia,{variant:`ghost`,size:`sm`,className:`ml-auto md:hidden`,label:`Close menu`,icon:(0,Q.jsx)(Tf,{}),ref:d,onClick:()=>l(!1)})]}),(0,Q.jsx)(by,{label:`the tasks that need attention`,children:(0,Q.jsx)(Pb,{onShow:E})}),(0,Q.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(X,{variant:a?`secondary`:`ghost`,className:`justify-start`,label:`Review`,icon:(0,Q.jsx)(Xu,{}),"aria-pressed":a,onClick:()=>s({page:`review`})}),(0,Q.jsx)(X,{variant:A?`secondary`:`ghost`,className:`justify-start`,label:`All workspaces`,icon:(0,Q.jsx)(Ad,{}),"aria-pressed":A,isDisabled:!e.data?.length,onClick:()=>s({page:`all`,view:`timeline`,task:null})})]}),(0,Q.jsx)(by,{label:`the workspace list`,children:(0,Q.jsx)(ZS,{selectedId:a||A?null:j?.id??null,onSelect:e=>s({page:`workspace`,workspace:e,task:null})})}),(0,Q.jsx)(X,{variant:`ghost`,className:`mt-auto shrink-0 justify-start`,label:`Settings`,icon:(0,Q.jsx)(lf,{}),endContent:(0,Q.jsx)(`span`,{className:`ml-auto flex flex-col items-end text-xs font-normal`,children:(0,Q.jsx)(bh,{})}),"aria-haspopup":`dialog`,"aria-expanded":m,ref:v,onClick:()=>b(null)})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,inert:c||m,children:[(0,Q.jsxs)(`header`,{className:`flex items-center gap-2 border-b px-2 py-1.5 md:hidden print:hidden`,children:[(0,Q.jsx)(ia,{variant:`ghost`,size:`sm`,label:`Open menu`,icon:(0,Q.jsx)(Id,{}),ref:u,onClick:()=>l(!0)}),(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 print:block print:overflow-visible print:p-0`,children:[(0,Q.jsx)(`div`,{className:`contents print:hidden`,children:(0,Q.jsx)(Sy,{})}),(0,Q.jsx)(by,{label:`this view`,resetKey:a?`review`:A?`all`:j?.id,children:a?(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading review...`}),children:(0,Q.jsx)(vL,{onShowTask:E})}):r.page===`all`&&e.data?.length?(0,Q.jsx)($F,{workspace:null,view:r.view,onViewChange:e=>i({page:`all`,view:e,task:null}),selectedTask:r.task,onSelectTask:e=>i({...r,task:e}),timelineScale:x,onTimelineScaleChange:S,shownTask:t,onTaskShown:()=>n(null)},`all`):j?(0,Q.jsx)($F,{workspace:j,selectedTask:r.page===`workspace`?r.task:null,onSelectTask:e=>i({page:`workspace`,workspace:j.id,task:e}),timelineScale:x,onTimelineScaleChange:S,draft:C.get(j.id),onDraftChange:e=>T(j.id,e)},j.id):!e.isPending&&!e.isError&&(0,Q.jsx)(aI,{icon:(0,Q.jsx)(Sd,{}),title:`Create a workspace to start planning tasks.`,hint:`A workspace groups tasks, e.g. those of one repository or project.`,action:(0,Q.jsx)(X,{ref:k,variant:`primary`,label:`Add workspace`,icon:(0,Q.jsx)(ef,{}),"aria-haspopup":`dialog`,onClick:()=>O(!0)})})})]})]}),(0,Q.jsx)(pL,{open:m,section:g,onShow:b,onClose:()=>h(!1),returnFocus:()=>y.current?u.current:v.current}),D&&(0,Q.jsx)(eC,{onCreated:e=>{O(!1),s({page:`workspace`,workspace:e.id,task:null})},onClose:()=>{O(!1),k.current?.focus()}}),M&&(0,Q.jsx)(wv,{commands:(()=>{let t=new Map(e.data?.map(e=>[e.id,e.name])),n=yL(),r=document.querySelector(`form[aria-label='New task'] input`),i=[!!e.data?.length&&{id:`timeline`,group:`Actions`,label:`Show the timeline of all workspaces`,icon:(0,Q.jsx)(Qu,{}),run:()=>s({page:`all`,view:`timeline`,task:null})},!!e.data?.length&&{id:`list`,group:`Actions`,label:`Show the task list of all workspaces`,icon:(0,Q.jsx)(Pd,{}),run:()=>s({page:`all`,view:`list`,task:null})},!!e.data?.length&&{id:`plan`,group:`Actions`,label:`Show the quarter and year plan of all workspaces`,icon:(0,Q.jsx)(Ju,{}),run:()=>s({page:`all`,view:`plan`,task:null})},{id:`review`,group:`Actions`,label:`Show the review`,icon:(0,Q.jsx)(Xu,{}),run:()=>s({page:`review`})},r!==null&&{id:`new-task`,group:`Actions`,label:`New task in this workspace`,icon:(0,Q.jsx)(ef,{}),run:()=>r.focus()},n!==null&&{id:`search`,group:`Actions`,label:`Search tasks`,hint:`/`,icon:(0,Q.jsx)(sf,{}),run:()=>n.focus()},{id:`settings`,group:`Actions`,label:`Open settings`,icon:(0,Q.jsx)(lf,{}),run:()=>b(null)},{id:`shortcuts`,group:`Actions`,label:`Show keyboard shortcuts`,hint:`?`,icon:(0,Q.jsx)(Od,{}),run:()=>F(!0)},{id:`light`,group:`Actions`,label:`Use the light theme`,icon:(0,Q.jsx)(yf,{}),run:()=>tL(`light`)},{id:`dark`,group:`Actions`,label:`Use the dark theme`,icon:(0,Q.jsx)(Hd,{}),run:()=>tL(`dark`)},{id:`system`,group:`Actions`,label:`Use the system theme`,icon:(0,Q.jsx)(_f,{}),run:()=>tL(`system`)},...(e.data??[]).map(e=>({id:`workspace-${e.id}`,group:`Actions`,label:`Open workspace ${e.name}`,icon:(0,Q.jsx)(bd,{}),run:()=>s({page:`workspace`,workspace:e.id,task:null})}))],a=[...ee.data??[]].sort((e,t)=>Number(e.status===`done`)-Number(t.status===`done`)||t.id-e.id).map(e=>({id:`task-${e.id}`,group:`Tasks`,label:`#${e.id} ${e.title}`,keywords:t.get(e.workspaceId),hint:t.get(e.workspaceId),icon:(0,Q.jsx)(cd,{}),run:()=>I(e)}));return[...i.filter(e=>e!==!1),...a]})(),onClose:()=>N(!1)}),P&&(0,Q.jsx)(Tv,{onClose:()=>F(!1)})]})}var xL=`/version.json`,SL=`toodo-skip-waiting`,CL=5e3,wL=null,TL=null,EL=null,DL=new Set;function OL(){DL.forEach(e=>e())}function kL(){return document.querySelector(`meta[name="toodo-build"]`)?.content||null}function AL(e){return DL.add(e),()=>DL.delete(e)}function jL(){return wL!==null&&wL!==TL?wL:null}function ML(){TL=wL,OL()}function NL(e){return typeof e==`object`&&e&&`build`in e&&typeof e.build==`string`?e.build:null}function PL(){let e=kL();return e===null?Promise.resolve():(EL??=(async()=>{try{let t=await fetch(xL,{cache:`no-store`}),n=t.ok?NL(await t.json().catch(()=>null)):null;if(n===null)return;let r=n===e?null:n;r!==wL&&(wL=r,OL())}catch(e){console.warn(`toodo: could not check for a new build`,e)}finally{EL=null}})(),EL)}function FL(){PL(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&PL()}),addEventListener(`focus`,()=>void PL())}function IL(e,t){return new Promise(n=>{let r=setTimeout(n,t);e.finally(()=>{clearTimeout(r),n()})})}async function LL(){if(!(`serviceWorker`in navigator))return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;await e.update();let t=e.installing;t!==null&&await IL(new Promise(e=>{let n=()=>t.state!==`installing`&&e();t.addEventListener(`statechange`,n),n()}),CL);let n=e.waiting;if(n===null||navigator.serviceWorker.controller===null)return;let r=new Promise(e=>navigator.serviceWorker.addEventListener(`controllerchange`,()=>e(),{once:!0}));n.postMessage({type:SL}),await IL(r,CL)}async function RL(){try{await LL()}catch(e){console.warn(`toodo: could not activate the new service worker`,e)}location.reload()}function zL(){let e=(0,Z.useSyncExternalStore)(AL,jL),[t,n]=(0,Z.useState)(!1);return e===null?null:(0,Q.jsxs)(`div`,{role:`status`,"aria-label":`New version of Toodo`,className:yy(`fixed inset-x-2 top-2 z-50 mx-auto flex max-w-xl flex-wrap items-center gap-x-3 gap-y-2 rounded-lg p-3 text-sm shadow-md print:hidden`,Yn.info),children:[(0,Q.jsx)(nf,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 basis-48`,children:[(0,Q.jsx)(`p`,{className:`font-medium`,children:`A new version of Toodo is available`}),(0,Q.jsx)(`p`,{className:`text-xs`,children:`This tab still runs the earlier version. Reload to switch to the new one.`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,Q.jsx)(X,{size:`sm`,variant:`primary`,label:t?`Reloading...`:`Reload`,isDisabled:t,onClick:()=>{n(!0),RL()}}),(0,Q.jsx)(X,{size:`sm`,variant:`secondary`,label:`Later`,isDisabled:t,onClick:ML})]})]})}var BL=`1.11.0`,VL=[`workspaces`,`task-list`,`tasks`],HL=864e5,UL=1e3;function WL(e){return e.state.status===`success`&&VL.includes(String(e.queryKey[0]))}function GL(e){return typeof e==`object`&&!!e&&e.version===`1.11.0`}function KL(){Mn.setEventListener(e=>{let t=()=>e(lo()===`reachable`);t();let n=mo(t);return()=>void n()})}async function qL(e,t){for(let t of VL)e.setQueryDefaults([t],{gcTime:HL});if(uo())try{let n=await t.load();GL(n)&&Eu(e,n.state)}catch(e){console.error(`Toodo: could not restore the saved tasks`,e)}}function JL(e,t,n=UL){let r,i=()=>{if(r=void 0,!uo())return;let n=Tu(e,{shouldDehydrateQuery:WL,shouldDehydrateMutation:()=>!1});t.save({version:BL,savedAt:Date.now(),state:n}).catch(e=>{console.error(`Toodo: could not save the tasks for offline reading`,e)})},a=e.getQueryCache().subscribe(e=>{e.type===`updated`&&e.action.type===`success`&&WL(e.query)&&(r??=setTimeout(i,n))}),o=oo(()=>{uo()||(clearTimeout(r),r=void 0,t.clear().catch(e=>console.error(`Toodo: could not forget the saved tasks`,e)))});return()=>{clearTimeout(r),a(),o()}}var YL=`toodo`,XL=`query-cache`;function ZL(e,t){return new Promise((n,r)=>{let i=indexedDB.open(YL,1);i.onupgradeneeded=()=>i.result.createObjectStore(XL),i.onerror=()=>r(i.error),i.onsuccess=()=>{let a=i.result,o=e(a.transaction(XL,t).objectStore(XL));o.onsuccess=()=>{a.close(),n(o.result)},o.onerror=()=>{a.close(),r(o.error)}}})}function QL(){let e=ho.key(`queries`);return{load:()=>ZL(t=>t.get(e),`readonly`),save:t=>ZL(n=>n.put(t,e),`readwrite`).then(()=>void 0),clear:()=>ZL(t=>t.delete(e),`readwrite`)}}nL();var $L=new Au({defaultOptions:{mutations:{networkMode:`always`}}}),eR=QL(),tR=gh.createRoot(document.getElementById(`root`));function nR({children:e}){return(0,Q.jsx)(vu,{theme:GI,mode:aL(),children:e})}function rR(e){tR.render((0,Q.jsx)(Z.StrictMode,{children:(0,Q.jsx)(kn,{client:$L,children:(0,Q.jsxs)(nR,{children:[(0,Q.jsx)(zL,{}),(0,Q.jsx)(by,{label:`Toodo`,className:`m-4`,children:e})]})})}))}Wr(),ao(),KL(),FL(),Promise.all([bt(()=>import(`./server-access-dLztdn9t.js`),__vite__mapDeps([31,1,4,23,7,8,9,10,11,12,13,24,14,25,16,6,15,20,21])),bt(()=>import(`./offline-screen-DE0QwTVx.js`),__vite__mapDeps([32,1,4,26,21,27,3,20,7,12,8,13,9,10,11])),bt(()=>import(`./event-CSYkpd32.js`).then(e=>e.t),__vite__mapDeps([27,1,21])),qL($L,eR)]).then(([{ServerAccess:e},{ConnectionGate:t},{onReconnect:n}])=>{n(()=>void $L.invalidateQueries()),n(()=>void PL()),JL($L,eR),`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.error(`Toodo: could not register the service worker`,e)}),rR((0,Q.jsx)(t,{children:(0,Q.jsx)(e,{children:(0,Q.jsx)(bL,{})})}))});export{bC as $,sF as A,Oy as At,Gj as B,id as Bt,XP as C,Eb as Ct,yF as D,ky as Dt,mF as E,jy as Et,tP as F,Rf as Ft,$w as G,dT as H,rP as I,Tf as It,wC as J,RC as K,XN as L,Cf as Lt,rF as M,yy as Mt,DF as N,vv as Nt,hF as O,Ry as Ot,lP as P,bv as Pt,lC as Q,AM as R,md as Rt,uF as S,rb as St,xF as T,Tb as Tt,uT as U,PT as V,Ku as Vt,cT as W,vC as X,CC as Y,yC as Z,dF as _,Db as _t,OI as a,BS as at,JP as b,xb as bt,fF as c,Sb as ct,FF as d,Uy as dt,SC as et,kF as f,$y as ft,OF as g,Cb as gt,SF as h,wb as ht,SI as i,HS as it,bF as j,by as jt,IF as k,Ny as kt,MF as l,tb as lt,jF as m,qy as mt,yI as n,xC as nt,wI as o,vS as ot,CF as p,Wy as pt,TC as q,bI as r,XS as rt,aI as s,fS as st,iL as t,_C as tt,NF as u,eb as ut,wF as v,ib as vt,ZP as w,Ky as wt,oF as x,ob as xt,PF as y,nb as yt,tM as z,od as zt};