@qodeca/xezar 0.11.2 → 0.13.0

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 (138) hide show
  1. package/README.md +69 -18
  2. package/dist/agent-config/catalog.d.ts +10 -0
  3. package/dist/agent-config/catalog.js.map +1 -1
  4. package/dist/automations/coordinator.js +8 -0
  5. package/dist/automations/coordinator.js.map +1 -1
  6. package/dist/automations/types.d.ts +2 -0
  7. package/dist/contract/automations.d.ts +8 -0
  8. package/dist/contract/events.test.d.ts +1 -0
  9. package/dist/contract/index.js +87 -3
  10. package/dist/contract/runs.d.ts +25 -0
  11. package/dist/contract/runs.test.d.ts +1 -0
  12. package/dist/contract/skills.d.ts +1 -0
  13. package/dist/contract/workflows.d.ts +6 -0
  14. package/dist/contract/workspace.d.ts +37 -4
  15. package/dist/core/agent-env.js +8 -1
  16. package/dist/core/agent-env.js.map +1 -1
  17. package/dist/core/agent-runner.d.ts +13 -0
  18. package/dist/core/agent-runner.js +22 -0
  19. package/dist/core/agent-runner.js.map +1 -1
  20. package/dist/core/backend-detect.js +11 -1
  21. package/dist/core/backend-detect.js.map +1 -1
  22. package/dist/core/claude-cli-runner.js +8 -2
  23. package/dist/core/claude-cli-runner.js.map +1 -1
  24. package/dist/core/codex-app-server-runner.js +6 -2
  25. package/dist/core/codex-app-server-runner.js.map +1 -1
  26. package/dist/core/opencode-server-runner.d.ts +12 -0
  27. package/dist/core/opencode-server-runner.js +326 -17
  28. package/dist/core/opencode-server-runner.js.map +1 -1
  29. package/dist/core/pi-model-catalog.d.ts +52 -0
  30. package/dist/core/pi-model-catalog.js +135 -0
  31. package/dist/core/pi-model-catalog.js.map +1 -0
  32. package/dist/core/pi-runner.d.ts +3 -0
  33. package/dist/core/pi-runner.js +139 -12
  34. package/dist/core/pi-runner.js.map +1 -1
  35. package/dist/core/pi-ui-mapper.js +39 -3
  36. package/dist/core/pi-ui-mapper.js.map +1 -1
  37. package/dist/core/runner-model-catalog.js +11 -2
  38. package/dist/core/runner-model-catalog.js.map +1 -1
  39. package/dist/index.js +2 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/paths.d.ts +7 -0
  42. package/dist/paths.js +8 -0
  43. package/dist/paths.js.map +1 -1
  44. package/dist/runs/event-corrections.d.ts +12 -0
  45. package/dist/runs/event-corrections.js +141 -0
  46. package/dist/runs/event-corrections.js.map +1 -0
  47. package/dist/runs/event-history.d.ts +5 -1
  48. package/dist/runs/event-history.js +66 -5
  49. package/dist/runs/event-history.js.map +1 -1
  50. package/dist/runs/project-writer.d.ts +11 -0
  51. package/dist/runs/project-writer.js +115 -0
  52. package/dist/runs/project-writer.js.map +1 -0
  53. package/dist/runs/store.d.ts +2 -0
  54. package/dist/runs/store.js +13 -2
  55. package/dist/runs/store.js.map +1 -1
  56. package/dist/runs/task-markers.d.ts +4 -0
  57. package/dist/runs/task-markers.js +63 -5
  58. package/dist/runs/task-markers.js.map +1 -1
  59. package/dist/server/capabilities.d.ts +7 -5
  60. package/dist/server/capabilities.js +11 -7
  61. package/dist/server/capabilities.js.map +1 -1
  62. package/dist/server/project-context.js +2 -0
  63. package/dist/server/project-context.js.map +1 -1
  64. package/dist/server/server.d.ts +199 -47
  65. package/dist/server/server.js +195 -11
  66. package/dist/server/server.js.map +1 -1
  67. package/dist/workflows/run.d.ts +67 -2
  68. package/dist/workflows/run.js +190 -44
  69. package/dist/workflows/run.js.map +1 -1
  70. package/dist/workflows/types.d.ts +41 -0
  71. package/dist/workflows/types.js +72 -0
  72. package/dist/workflows/types.js.map +1 -1
  73. package/dist/workspace/config.d.ts +42 -0
  74. package/dist/workspace/config.js +132 -3
  75. package/dist/workspace/config.js.map +1 -1
  76. package/dist/workspace/semaphore.d.ts +63 -3
  77. package/dist/workspace/semaphore.js +76 -3
  78. package/dist/workspace/semaphore.js.map +1 -1
  79. package/package.json +3 -3
  80. package/web/dist/assets/{alert-dialog-CGskMvgc.js → alert-dialog-BVsVcbFy.js} +1 -1
  81. package/web/dist/assets/arrow-down-CYgAlZtW.js +1 -0
  82. package/web/dist/assets/arrow-left-BOqE0a3k.js +1 -0
  83. package/web/dist/assets/{centered-state-B_V_Ai2h.js → centered-state-Djgly6Ni.js} +1 -1
  84. package/web/dist/assets/chevron-right-Cc9BWnbN.js +1 -0
  85. package/web/dist/assets/{collapsible-B_8uYwHb.js → collapsible-DZ4D-DHG.js} +1 -1
  86. package/web/dist/assets/{commit-list-C4Dv6vUL.js → commit-list-B-z1JL9G.js} +1 -1
  87. package/web/dist/assets/{compare-variants-et0mplGi.js → compare-variants-CdS8r8E2.js} +1 -1
  88. package/web/dist/assets/{diff-CbozNUJq.js → diff-BKew9rQX.js} +2 -2
  89. package/web/dist/assets/{diff-stat-btAmKFJr.js → diff-stat-D0mc5V6Z.js} +1 -1
  90. package/web/dist/assets/{diff-view-BpFTcG3R.js → diff-view-xpIcuLIC.js} +1 -1
  91. package/web/dist/assets/{dropdown-menu-Z80KMInL.js → dropdown-menu-CEQziH7X.js} +1 -1
  92. package/web/dist/assets/editable-title-BCX3T2BY.js +1 -0
  93. package/web/dist/assets/{ellipsis-vertical-Bmi2u2TG.js → ellipsis-vertical-ByVdDc4z.js} +1 -1
  94. package/web/dist/assets/{file-DKoYWRsv.js → file-xBSB5hXO.js} +1 -1
  95. package/web/dist/assets/{folder-u01HScRT.js → folder-CldgbZ5A.js} +1 -1
  96. package/web/dist/assets/{git-toolbar-Q2kk2F7v.js → git-toolbar-BYlnf4qf.js} +1 -1
  97. package/web/dist/assets/github-CqGK62Lw.js +1 -0
  98. package/web/dist/assets/{image-preview-BR3iIIhf.js → image-preview-Cv5mZr0n.js} +1 -1
  99. package/web/dist/assets/index-3nxVmdn5.css +2 -0
  100. package/web/dist/assets/index-qX7n11FX.js +9 -0
  101. package/web/dist/assets/{markdown-5FuCZDA4.js → markdown-CgEEE2ND.js} +1 -1
  102. package/web/dist/assets/{new-task-form-BydHBbef.js → new-task-form-1r2bgsdD.js} +1 -1
  103. package/web/dist/assets/{pill-vNzaaYxj.js → pill-q-x22_ej.js} +1 -1
  104. package/web/dist/assets/{project-router-BbCzrHKs.js → project-router-VDN4jQM8.js} +1 -1
  105. package/web/dist/assets/{prompt-templates-B7Fs2b1S.js → prompt-templates-BmZtCe-L.js} +1 -1
  106. package/web/dist/assets/{refresh-cw-DGliez3E.js → refresh-cw-DcNCj2nu.js} +1 -1
  107. package/web/dist/assets/{repo-git-h1RFfly3.js → repo-git-C2On8SlI.js} +1 -1
  108. package/web/dist/assets/{run-diff-Bq9vkSNK.js → run-diff-vguEMJzh.js} +1 -1
  109. package/web/dist/assets/{run-header-Cd8mSKBG.js → run-header-DM7MiKj9.js} +1 -1
  110. package/web/dist/assets/{search-x-69n_672Y.js → search-x-QmhaAbg5.js} +1 -1
  111. package/web/dist/assets/{skill-empty-hint-CL0g7WBL.js → skill-empty-hint-BrzUwByZ.js} +1 -1
  112. package/web/dist/assets/{skills-BqAzyGS3.js → skills-Bj-uG_Hz.js} +1 -1
  113. package/web/dist/assets/{sparkles-B8agSxBZ.js → sparkles-CP8QDOgX.js} +1 -1
  114. package/web/dist/assets/{square-terminal-Cf4Og6ct.js → square-terminal-CGypshSD.js} +1 -1
  115. package/web/dist/assets/{tab-link-Cp2-CJS8.js → tab-link-D4lFzzI1.js} +1 -1
  116. package/web/dist/assets/{task-changes-DwXPFXqG.js → task-changes-6aopqAmV.js} +1 -1
  117. package/web/dist/assets/{task-commits-Bessua-c.js → task-commits-u-dwaCyw.js} +1 -1
  118. package/web/dist/assets/{task-files-DxFIhRPP.js → task-files-IMOZnIUK.js} +1 -1
  119. package/web/dist/assets/task-thread-CbMPmrWq.js +9 -0
  120. package/web/dist/assets/{textarea--cpYshee.js → textarea-CyBCyKIk.js} +1 -1
  121. package/web/dist/assets/{thread-loading-ZhJref0J.js → thread-loading-Cuq2jchC.js} +1 -1
  122. package/web/dist/assets/{trash-2--ZtrzUx3.js → trash-2-B6Dp3ZNs.js} +1 -1
  123. package/web/dist/assets/{triangle-alert-D5tJwRD2.js → triangle-alert-xBya8FUp.js} +1 -1
  124. package/web/dist/assets/{upload-SnwVxKOA.js → upload-D6MXEB9p.js} +1 -1
  125. package/web/dist/assets/{use-desktop-Sr1QlxhT.js → use-desktop-fLDKEJoB.js} +1 -1
  126. package/web/dist/assets/{use-submit-shortcut-JY8M_MPL.js → use-submit-shortcut-JTpNzU-u.js} +1 -1
  127. package/web/dist/assets/{utils-Bb8ohcr3.js → utils--z9hRtl3.js} +1 -1
  128. package/web/dist/assets/{workflows-9HC240Wx.js → workflows-BY3KTkFw.js} +3 -3
  129. package/web/dist/assets/{zoomable-image-0G3IBXWC.js → zoomable-image-GTYwLtkS.js} +1 -1
  130. package/web/dist/index.html +23 -23
  131. package/web/dist/assets/arrow-down-G8adPhbu.js +0 -1
  132. package/web/dist/assets/arrow-left-BJsIW6A0.js +0 -1
  133. package/web/dist/assets/chevron-right-CFzn-von.js +0 -1
  134. package/web/dist/assets/editable-title-wS5NWwob.js +0 -1
  135. package/web/dist/assets/github-DjEYCxwt.js +0 -1
  136. package/web/dist/assets/index-BcI5hug3.css +0 -2
  137. package/web/dist/assets/index-Cz4GSAqV.js +0 -7
  138. package/web/dist/assets/task-thread-Dhkupf1-.js +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qodeca/xezar",
3
- "version": "0.11.2",
3
+ "version": "0.13.0",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -50,8 +50,8 @@
50
50
  "zod": "^4.4.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@qodeca/xezar-api-client": "^0.11.2",
54
- "@qodeca/xezar-contract": "^0.11.2",
53
+ "@qodeca/xezar-api-client": "^0.13.0",
54
+ "@qodeca/xezar-contract": "^0.13.0",
55
55
  "@types/node": "^20.14.0",
56
56
  "@types/ws": "^8.18.1",
57
57
  "esbuild": "^0.28.1",
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,_ as i,b as a,c as o,d as s,f as c,g as l,h as u,l as d,o as f,p as ee,s as te,u as ne,w as re,x as p,y as m}from"./centered-state-B_V_Ai2h.js";import{t as h}from"./utils-Bb8ohcr3.js";var g=e(t(),1),_=n(),v=`Dialog`,[y,b]=a(v),[ie,x]=y(v),S=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=g.useRef(null),l=g.useRef(null),[d,f]=i({prop:r,defaultProp:a??!1,onChange:o,caller:v});return(0,_.jsx)(ie,{scope:t,triggerRef:c,contentRef:l,contentId:u(),titleId:u(),descriptionId:u(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};S.displayName=v;var C=`DialogTrigger`,w=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(C,n),o=r(t,a.triggerRef);return(0,_.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":B(a.open),...i,ref:o,onClick:m(e.onClick,a.onOpenToggle)})});w.displayName=C;var T=`DialogPortal`,[E,D]=y(T,{forceMount:void 0}),O=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=x(T,t);return(0,_.jsx)(E,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(l,{present:n||a.open,children:(0,_.jsx)(ne,{asChild:!0,container:i,children:e})}))})};O.displayName=T;var k=`DialogOverlay`,A=g.forwardRef((e,t)=>{let n=D(k,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(k,e.__scopeDialog);return a.modal?(0,_.jsx)(l,{present:r||a.open,children:(0,_.jsx)(oe,{...i,ref:t})}):null});A.displayName=k;var ae=re(`DialogOverlay.RemoveScroll`),oe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(k,n),s=r(t,ee());return(0,_.jsx)(o,{as:ae,allowPinchZoom:!0,shards:[a.contentRef],children:(0,_.jsx)(p.div,{"data-state":B(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),j=`DialogContent`,M=g.forwardRef((e,t)=>{let n=D(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(j,e.__scopeDialog);return(0,_.jsx)(l,{present:r||a.open,children:a.modal?(0,_.jsx)(se,{...i,ref:t}):(0,_.jsx)(ce,{...i,ref:t})})});M.displayName=j;var se=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),i=g.useRef(null),a=r(t,n.contentRef,i);return g.useEffect(()=>{let e=i.current;if(e)return te(e)},[]),(0,_.jsx)(N,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})}),ce=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=x(j,n);return d(),(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,_.jsx)(c,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":B(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),P=`DialogTitle`,F=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(P,n);return(0,_.jsx)(p.h2,{id:i.titleId,...r,ref:t})});F.displayName=P;var I=`DialogDescription`,L=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(I,n);return(0,_.jsx)(p.p,{id:i.descriptionId,...r,ref:t})});L.displayName=I;var R=`DialogClose`,z=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(R,n);return(0,_.jsx)(p.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});z.displayName=R;function B(e){return e?`open`:`closed`}var V=`AlertDialog`,[le,ue]=a(V,[b]),H=b(),U=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(S,{...r,...n,modal:!0})};U.displayName=V;var de=`AlertDialogTrigger`,fe=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(w,{...i,...r,ref:t})});fe.displayName=de;var pe=`AlertDialogPortal`,W=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(O,{...r,...n})};W.displayName=pe;var me=`AlertDialogOverlay`,G=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(A,{...i,...r,ref:t})});G.displayName=me;var K=`AlertDialogContent`,[he,ge]=le(K),q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=H(n),s=r(t,g.useRef(null)),c=g.useRef(null);return(0,_.jsx)(he,{scope:n,cancelRef:c,children:(0,_.jsx)(M,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:m(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})});q.displayName=K;var _e=`AlertDialogTitle`,J=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(F,{...i,...r,ref:t})});J.displayName=_e;var ve=`AlertDialogDescription`,Y=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(L,{...i,...r,ref:t})});Y.displayName=ve;var ye=`AlertDialogAction`,X=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(z,{...i,...r,ref:t})});X.displayName=ye;var Z=`AlertDialogCancel`,Q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...i}=e,{cancelRef:a}=ge(Z,n),o=H(n),s=r(t,a);return(0,_.jsx)(z,{...o,...i,ref:s})});Q.displayName=Z;var be=U,xe=W,Se=G,Ce=q,we=X,Te=Q,Ee=J,De=Y;function Oe({...e}){return(0,_.jsx)(be,{"data-slot":`alert-dialog`,...e})}function ke({...e}){return(0,_.jsx)(xe,{"data-slot":`alert-dialog-portal`,...e})}function $({className:e,...t}){return(0,_.jsx)(Se,{"data-slot":`alert-dialog-overlay`,className:h(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ae({className:e,...t}){return(0,_.jsxs)(ke,{children:[(0,_.jsx)($,{}),(0,_.jsx)(Ce,{"data-slot":`alert-dialog-content`,className:h(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md`,e),...t})]})}function je({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:h(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Me({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:h(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Ne({className:e,...t}){return(0,_.jsx)(Ee,{"data-slot":`alert-dialog-title`,className:h(`text-lg leading-none font-semibold`,e),...t})}function Pe({className:e,...t}){return(0,_.jsx)(De,{"data-slot":`alert-dialog-description`,className:h(`text-sm text-muted-foreground`,e),...t})}function Fe({className:e,...t}){return(0,_.jsx)(we,{"data-slot":`alert-dialog-action`,className:h(f({variant:`contrast`}),e),...t})}function Ie({className:e,...t}){return(0,_.jsx)(Te,{"data-slot":`alert-dialog-cancel`,className:h(f({variant:`outline`}),e),...t})}export{Pe as a,Ne as c,M as d,L as f,w as g,F as h,Ae as i,S as l,O as m,Fe as n,Me as o,A as p,Ie as r,je as s,Oe as t,z as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,_ as i,b as a,c as o,d as s,f as c,g as l,h as u,l as d,o as f,p as ee,s as te,u as ne,w as re,x as p,y as m}from"./centered-state-Djgly6Ni.js";import{t as h}from"./utils--z9hRtl3.js";var g=e(t(),1),_=n(),v=`Dialog`,[y,b]=a(v),[ie,x]=y(v),S=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=g.useRef(null),l=g.useRef(null),[d,f]=i({prop:r,defaultProp:a??!1,onChange:o,caller:v});return(0,_.jsx)(ie,{scope:t,triggerRef:c,contentRef:l,contentId:u(),titleId:u(),descriptionId:u(),open:d,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};S.displayName=v;var C=`DialogTrigger`,w=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(C,n),o=r(t,a.triggerRef);return(0,_.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":B(a.open),...i,ref:o,onClick:m(e.onClick,a.onOpenToggle)})});w.displayName=C;var T=`DialogPortal`,[E,D]=y(T,{forceMount:void 0}),O=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=x(T,t);return(0,_.jsx)(E,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(l,{present:n||a.open,children:(0,_.jsx)(ne,{asChild:!0,container:i,children:e})}))})};O.displayName=T;var k=`DialogOverlay`,A=g.forwardRef((e,t)=>{let n=D(k,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(k,e.__scopeDialog);return a.modal?(0,_.jsx)(l,{present:r||a.open,children:(0,_.jsx)(oe,{...i,ref:t})}):null});A.displayName=k;var ae=re(`DialogOverlay.RemoveScroll`),oe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=x(k,n),s=r(t,ee());return(0,_.jsx)(o,{as:ae,allowPinchZoom:!0,shards:[a.contentRef],children:(0,_.jsx)(p.div,{"data-state":B(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),j=`DialogContent`,M=g.forwardRef((e,t)=>{let n=D(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=x(j,e.__scopeDialog);return(0,_.jsx)(l,{present:r||a.open,children:a.modal?(0,_.jsx)(se,{...i,ref:t}):(0,_.jsx)(ce,{...i,ref:t})})});M.displayName=j;var se=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),i=g.useRef(null),a=r(t,n.contentRef,i);return g.useEffect(()=>{let e=i.current;if(e)return te(e)},[]),(0,_.jsx)(N,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})}),ce=g.forwardRef((e,t)=>{let n=x(j,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=x(j,n);return d(),(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,_.jsx)(c,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":B(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),P=`DialogTitle`,F=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(P,n);return(0,_.jsx)(p.h2,{id:i.titleId,...r,ref:t})});F.displayName=P;var I=`DialogDescription`,L=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(I,n);return(0,_.jsx)(p.p,{id:i.descriptionId,...r,ref:t})});L.displayName=I;var R=`DialogClose`,z=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(R,n);return(0,_.jsx)(p.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});z.displayName=R;function B(e){return e?`open`:`closed`}var V=`AlertDialog`,[le,ue]=a(V,[b]),H=b(),U=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(S,{...r,...n,modal:!0})};U.displayName=V;var de=`AlertDialogTrigger`,fe=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(w,{...i,...r,ref:t})});fe.displayName=de;var pe=`AlertDialogPortal`,W=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(O,{...r,...n})};W.displayName=pe;var me=`AlertDialogOverlay`,G=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(A,{...i,...r,ref:t})});G.displayName=me;var K=`AlertDialogContent`,[he,ge]=le(K),q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=H(n),s=r(t,g.useRef(null)),c=g.useRef(null);return(0,_.jsx)(he,{scope:n,cancelRef:c,children:(0,_.jsx)(M,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:m(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})});q.displayName=K;var _e=`AlertDialogTitle`,J=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(F,{...i,...r,ref:t})});J.displayName=_e;var ve=`AlertDialogDescription`,Y=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(L,{...i,...r,ref:t})});Y.displayName=ve;var ye=`AlertDialogAction`,X=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(z,{...i,...r,ref:t})});X.displayName=ye;var Z=`AlertDialogCancel`,Q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...i}=e,{cancelRef:a}=ge(Z,n),o=H(n),s=r(t,a);return(0,_.jsx)(z,{...o,...i,ref:s})});Q.displayName=Z;var be=U,xe=W,Se=G,Ce=q,we=X,Te=Q,Ee=J,De=Y;function Oe({...e}){return(0,_.jsx)(be,{"data-slot":`alert-dialog`,...e})}function ke({...e}){return(0,_.jsx)(xe,{"data-slot":`alert-dialog-portal`,...e})}function $({className:e,...t}){return(0,_.jsx)(Se,{"data-slot":`alert-dialog-overlay`,className:h(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ae({className:e,...t}){return(0,_.jsxs)(ke,{children:[(0,_.jsx)($,{}),(0,_.jsx)(Ce,{"data-slot":`alert-dialog-content`,className:h(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md`,e),...t})]})}function je({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:h(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Me({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:h(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Ne({className:e,...t}){return(0,_.jsx)(Ee,{"data-slot":`alert-dialog-title`,className:h(`text-lg leading-none font-semibold`,e),...t})}function Pe({className:e,...t}){return(0,_.jsx)(De,{"data-slot":`alert-dialog-description`,className:h(`text-sm text-muted-foreground`,e),...t})}function Fe({className:e,...t}){return(0,_.jsx)(we,{"data-slot":`alert-dialog-action`,className:h(f({variant:`contrast`}),e),...t})}function Ie({className:e,...t}){return(0,_.jsx)(Te,{"data-slot":`alert-dialog-cancel`,className:h(f({variant:`outline`}),e),...t})}export{Pe as a,Ne as c,M as d,L as f,w as g,F as h,Ae as i,S as l,O as m,Fe as n,Me as o,A as p,Ie as r,je as s,Oe as t,z as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils--z9hRtl3.js";var t=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils--z9hRtl3.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i,b as a,c as o,d as s,i as c,m as l,o as u,r as d,s as f,t as p,y as m}from"./utils-Bb8ohcr3.js";import{i as h,r as g}from"./bundle-mjs-BT31bpU6.js";var _=/^[\w!#$%&'*.^`|~+-]+$/,v=(e,t,n={})=>{if(!_.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},y=(e,t,n)=>(t=encodeURIComponent(t),v(e,t,n)),b=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),x=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},S=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},ee=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},C=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function te(e,t){if(!w(e)&&!w(t))return t;let n={...e};for(let e in t){let r=t[e];w(n[e])&&w(r)?n[e]=te(n[e],r):n[e]=r}return n}var ne=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return ne(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),re=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(y(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=C(a),a=x(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},ie=(e,t)=>ne(function n(r){let i=t?.buildSearchParams??S,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=b(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=x(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=C(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=ee(r.args[0]&&r.args[0].param?x(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new re(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=te(t,e);return l.fetch(r.args[0],a)}return l},[]);function ae(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return ie(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var oe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},se=new class extends oe{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ce={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=ce;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function le(e){setTimeout(e,0)}var ue=typeof window>`u`||`Deno`in globalThis;function E(){}function de(e,t){return typeof e==`function`?e(t):e}function fe(e){return typeof e==`number`&&e>=0&&e!==1/0}function pe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function me(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ge(o,t.options))return!1}else if(!ve(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function he(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_e(t.options.mutationKey)!==_e(a))return!1}else if(!ve(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ge(e,t){return(t?.queryKeyHashFn||_e)(e)}function _e(e){return JSON.stringify(e,(e,t)=>Ce(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ve(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ve(e[n],t[n])):!1}var ye=Object.prototype.hasOwnProperty;function be(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Se(e)&&Se(t);if(!r&&!(Ce(e)&&Ce(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ye.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=be(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function xe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Se(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ce(e){if(!we(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!we(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function we(e){return Object.prototype.toString.call(e)===`[object Object]`}function Te(e){return new Promise(t=>{T.setTimeout(t,e)})}function Ee(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:be(e,t)}function De(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ke=Symbol();function Ae(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ke?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function je(e,t){return typeof e==`function`?e(...t):!!e}function Me(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ne=(()=>{let e=()=>ue;return{isServer(){return e()},setIsServer(t){e=t}}})();function Pe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Fe=le;function Ie(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Fe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var k=Ie(),Le=new class extends oe{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Re(e){return Math.min(1e3*2**e,3e4)}function ze(e){return(e??`online`)!==`online`||Le.isOnline()}var Be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ve(e){let t=!1,n=0,r,i=Pe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Be(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>se.isFocused()&&(e.networkMode===`always`||Le.isOnline())&&e.canRun(),u=()=>ze(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ne.isServer()?0:3),o=e.retryDelay??Re,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Te(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var He=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fe(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ne.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(T.clearTimeout(this.#e),this.#e=void 0)}};function Ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Me(e,()=>t.signal,()=>n=!0)},u=Ae(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Oe:De;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ge:We,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:We(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function We(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ge(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ke(e,t){return t?We(e,t)!=null:!1}function qe(e,t){return!t||!e.getPreviousPageParam?!1:Ge(e,t)!=null}var Je=class extends He{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ze(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ze(this.options);e.data!==void 0&&(this.setState(Xe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ee(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(E).catch(E):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ke||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>D(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!pe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ae(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ve({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ye(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Xe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ye(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ze(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Xe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ze(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Qe=class extends oe{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Pe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),et(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof O(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!xe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&nt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return it(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(E)),t}#g(){this.#b();let e=D(this.options.staleTime,this.#t);if(Ne.isServer()||this.#r.isStale||!fe(e))return;let t=pe(this.#r.dataUpdatedAt,e)+1;this.#d=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Ne.isServer()||O(this.options.enabled,this.#t)===!1||!fe(this.#p)||this.#p===0)&&(this.#f=T.setInterval(()=>{(this.options.refetchIntervalInBackground||se.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(T.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(T.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&et(e,t),o=i&&nt(e,n,t,r);(a||o)&&(l={...l,...Ye(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Ee(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Ee(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:rt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:O(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Pe();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!xe(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){k.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function $e(e,t){return O(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&O(t.retryOnMount,e)===!1)}function et(e,t){return $e(e,t)||e.state.data!==void 0&&tt(e,t,t.refetchOnMount)}function tt(e,t,n){if(O(t.enabled,e)!==!1&&D(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&rt(e,t)}return!1}function nt(e,t,n,r){return(e!==t||O(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&rt(e,n)}function rt(e,t){return O(t.enabled,e)!==!1&&e.isStaleByTime(D(t.staleTime,e))}function it(e,t){return!xe(e.getCurrentResult(),t)}var at=class extends He{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ot(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ve({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),k.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ot(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var st=class extends oe{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),xe(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&_e(t.mutationKey)!==_e(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ot();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){k.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ct(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function lt(e,t,n){let r=e.slice(0);return r[t]=n,r}var ut=class extends oe{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,k.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!xe(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ct(e,n).forEach(e=>{e.destroy()}),ct(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=be(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Qe(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=lt(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&k.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},A=e(t(),1),j=r(),dt=A.createContext(void 0),M=e=>{let t=A.useContext(dt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ft=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(dt.Provider,{value:e,children:t})),pt=A.createContext(!1),mt=()=>A.useContext(pt);pt.Provider;function ht(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gt=A.createContext(ht()),_t=()=>A.useContext(gt),vt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?je(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},yt=e=>{A.useEffect(()=>{e.clearReset()},[e])},bt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||je(n,[e.error,r])),xt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},St=(e,t)=>e.isLoading&&e.isFetching&&!t,Ct=(e,t)=>e?.suspense&&t.isPending,wt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Tt({queries:e,...t},n){let r=M(n),i=mt(),a=_t(),o=A.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{xt(e);let t=r.getQueryCache().get(e.queryHash);vt(e,a,t)}),yt(a);let[s]=A.useState(()=>new ut(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;A.useSyncExternalStore(A.useCallback(e=>d?s.subscribe(k.batchCalls(e)):E,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),A.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Ct(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&Ct(n,e)?wt(n,new Qe(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&bt({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function Et(e,t,n){let r=mt(),i=_t(),a=M(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xt(o),vt(o,i,s),yt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=A.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(A.useSyncExternalStore(A.useCallback(e=>{let t=f?u.subscribe(k.batchCalls(e)):E;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),A.useEffect(()=>{u.setOptions(o)},[o,u]),Ct(o,d))throw wt(o,u,i);if(bt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Ne.isServer()&&St(d,r)&&(l?wt(o,u,i):s?.promise)?.catch(E).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function N(e,t){return Et(e,Qe,t)}function P(e,t){let n=M(t),[r]=A.useState(()=>new st(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);let i=A.useSyncExternalStore(A.useCallback(e=>r.subscribe(k.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=A.useCallback((e,t)=>{r.mutate(e,t).catch(E)},[r]);if(i.error&&je(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Dt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ot=/^[\\/]{2}/;function kt(e,t){return t+e.replace(/\\/g,`/`)}var At=`popstate`;function jt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Mt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Ft(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:It(t)}return Rt(t,n,null,e)}function F(e,t){if(e===!1||e==null)throw Error(t)}function I(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Nt(){return Math.random().toString(36).substring(2,10)}function Pt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ft(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Lt(t):t,state:n,key:t&&t.key||r||Nt(),mask:i}}function It({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Lt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Rt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=jt(e)?e:Ft(h.location,e,t);n&&n(r,e),l=u()+1;let d=Pt(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=jt(e)?e:Ft(h.location,e,t);n&&n(r,e),l=u();let i=Pt(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return zt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(At,d),c=e,()=>{i.removeEventListener(At,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function zt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),F(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:It(t);return i=i.replace(/ $/,`%20`),!n&&Ot.test(i)&&(i=r+i),new URL(i,r)}function Bt(e,t,n=`/`){return Vt(e,t,n,!1)}function Vt(e,t,n,r,i){let a=L((typeof t==`string`?Lt(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ut(e),s=null,c=sn(a);for(let e=0;s==null&&e<o.length;++e)s=nn(o[e],c,r);return s}function Ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Ut(e){let t=Wt(e);return Kt(t),t}function Wt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;F(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=R([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(F(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Wt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:en(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=on(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Gt(e.path))a(e,t,!0,n)}),t}function Gt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Gt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Kt(e){e.sort((e,t)=>e.score===t.score?tn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var qt=/^:[\w-]+$/,Jt=3,Yt=2,Xt=1,Zt=10,Qt=-2,$t=e=>e===`*`;function en(e,t){let n=e.split(`/`),r=n.length;return n.some($t)&&(r+=Qt),t&&(r+=Yt),n.filter(e=>!$t(e)).reduce((e,t)=>e+(qt.test(t)?Jt:t===``?Xt:Zt),r)}function tn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function nn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?an(u,l,s.matcher,s.compiledParams):rn(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=rn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:R([a,d.pathname]),pathnameBase:gn(R([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=R([a,d.pathnameBase]))}return o}function rn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=on(e.path,e.caseSensitive,e.end);return an(e,t,n,r)}function an(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function on(e,t=!1,n=!0){I(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function sn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return I(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function L(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function cn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Lt(e):e,a;return n?(n=mn(n),a=n.startsWith(`/`)?ln(n.substring(1),`/`):ln(n,t)):a=t,{pathname:a,search:_n(r),hash:vn(i)}}function ln(e,t){let n=hn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function un(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function dn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function fn(e){let t=dn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pn(e,t,n,r=!1){let i;typeof e==`string`?i=Lt(e):(i={...e},F(!i.pathname||!i.pathname.includes(`?`),un(`?`,`pathname`,`search`,i)),F(!i.pathname||!i.pathname.includes(`#`),un(`#`,`pathname`,`hash`,i)),F(!i.search||!i.search.includes(`#`),un(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=cn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var mn=e=>e.replace(/[\\/]{2,}/g,`/`),R=e=>mn(e.join(`/`)),hn=e=>e.replace(/\/+$/,``),gn=e=>hn(e).replace(/^\/*/,`/`),_n=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,vn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,yn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xn(e){return R(e.map(e=>e.route.path).filter(Boolean))||`/`}var Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Cn(e,t){let n=e;if(typeof n!=`string`||!Dt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Sn)try{let e=new URL(window.location.href),r=Ot.test(n)?new URL(kt(n,e.protocol)):new URL(n),a=L(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{I(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var wn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(wn);var Tn=[`GET`,...wn];new Set(Tn);var En=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Dn(e){try{return En.includes(new URL(e).protocol)}catch{return!1}}var On=A.createContext(null);On.displayName=`DataRouter`;var kn=A.createContext(null);kn.displayName=`DataRouterState`;var An=A.createContext(!1);function jn(){return A.useContext(An)}var Mn=A.createContext({isTransitioning:!1});Mn.displayName=`ViewTransition`;var Nn=A.createContext(new Map);Nn.displayName=`Fetchers`;var Pn=A.createContext(null);Pn.displayName=`Await`;var z=A.createContext(null);z.displayName=`Navigation`;var Fn=A.createContext(null);Fn.displayName=`Location`;var B=A.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName=`Route`;var In=A.createContext(null);In.displayName=`RouteError`;var Ln=`REACT_ROUTER_ERROR`,Rn=`REDIRECT`,zn=`ROUTE_ERROR_RESPONSE`;function Bn(e){if(e.startsWith(`${Ln}:${Rn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Vn(e){if(e.startsWith(`${Ln}:${zn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new yn(t.status,t.statusText,t.data)}catch{}}function Hn(e,{relative:t}={}){F(Un(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=A.useContext(z),{hash:i,pathname:a,search:o}=Zn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:R([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Un(){return A.useContext(Fn)!=null}function V(){return F(Un(),`useLocation() may be used only in the context of a <Router> component.`),A.useContext(Fn).location}var Wn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Gn(e){A.useContext(z).static||A.useLayoutEffect(e)}function Kn(){let{isDataRoute:e}=A.useContext(B);return e?gr():qn()}function qn(){F(Un(),`useNavigate() may be used only in the context of a <Router> component.`);let e=A.useContext(On),{basename:t,navigator:n}=A.useContext(z),{matches:r}=A.useContext(B),{pathname:i}=V(),a=JSON.stringify(fn(r)),o=A.useRef(!1);return Gn(()=>{o.current=!0}),A.useCallback((r,s={})=>{if(I(o.current,Wn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:R([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Jn=A.createContext(null);function Yn(e){let t=A.useContext(B).outlet;return A.useMemo(()=>t&&A.createElement(Jn.Provider,{value:e},t),[t,e])}function Xn(){let{matches:e}=A.useContext(B);return e[e.length-1]?.params??{}}function Zn(e,{relative:t}={}){let{matches:n}=A.useContext(B),{pathname:r}=V(),i=JSON.stringify(fn(n));return A.useMemo(()=>pn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qn(e,t){return $n(e,t)}function $n(e,t,n){F(Un(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=A.useContext(z),{matches:i}=A.useContext(B),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;vr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i,b as a,c as o,d as s,i as c,m as l,o as u,r as d,s as f,t as p,y as m}from"./utils--z9hRtl3.js";import{i as h,r as g}from"./bundle-mjs-BT31bpU6.js";var _=/^[\w!#$%&'*.^`|~+-]+$/,v=(e,t,n={})=>{if(!_.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},y=(e,t,n)=>(t=encodeURIComponent(t),v(e,t,n)),b=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),x=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},S=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},ee=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},C=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function te(e,t){if(!w(e)&&!w(t))return t;let n={...e};for(let e in t){let r=t[e];w(n[e])&&w(r)?n[e]=te(n[e],r):n[e]=r}return n}var ne=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return ne(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),re=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(y(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=C(a),a=x(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},ie=(e,t)=>ne(function n(r){let i=t?.buildSearchParams??S,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=b(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=x(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=C(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=ee(r.args[0]&&r.args[0].param?x(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new re(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=te(t,e);return l.fetch(r.args[0],a)}return l},[]);function ae(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return ie(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var oe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},se=new class extends oe{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ce={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=ce;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function le(e){setTimeout(e,0)}var ue=typeof window>`u`||`Deno`in globalThis;function E(){}function de(e,t){return typeof e==`function`?e(t):e}function fe(e){return typeof e==`number`&&e>=0&&e!==1/0}function pe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function me(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ge(o,t.options))return!1}else if(!ve(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function he(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_e(t.options.mutationKey)!==_e(a))return!1}else if(!ve(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ge(e,t){return(t?.queryKeyHashFn||_e)(e)}function _e(e){return JSON.stringify(e,(e,t)=>Ce(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ve(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ve(e[n],t[n])):!1}var ye=Object.prototype.hasOwnProperty;function be(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Se(e)&&Se(t);if(!r&&!(Ce(e)&&Ce(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ye.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=be(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function xe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Se(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ce(e){if(!we(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!we(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function we(e){return Object.prototype.toString.call(e)===`[object Object]`}function Te(e){return new Promise(t=>{T.setTimeout(t,e)})}function Ee(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:be(e,t)}function De(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ke=Symbol();function Ae(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ke?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function je(e,t){return typeof e==`function`?e(...t):!!e}function Me(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ne=(()=>{let e=()=>ue;return{isServer(){return e()},setIsServer(t){e=t}}})();function Pe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Fe=le;function Ie(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Fe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var k=Ie(),Le=new class extends oe{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Re(e){return Math.min(1e3*2**e,3e4)}function ze(e){return(e??`online`)!==`online`||Le.isOnline()}var Be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ve(e){let t=!1,n=0,r,i=Pe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Be(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>se.isFocused()&&(e.networkMode===`always`||Le.isOnline())&&e.canRun(),u=()=>ze(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ne.isServer()?0:3),o=e.retryDelay??Re,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Te(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var He=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fe(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ne.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(T.clearTimeout(this.#e),this.#e=void 0)}};function Ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Me(e,()=>t.signal,()=>n=!0)},u=Ae(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Oe:De;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ge:We,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:We(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function We(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ge(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ke(e,t){return t?We(e,t)!=null:!1}function qe(e,t){return!t||!e.getPreviousPageParam?!1:Ge(e,t)!=null}var Je=class extends He{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ze(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ze(this.options);e.data!==void 0&&(this.setState(Xe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ee(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(E).catch(E):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ke||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>D(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!pe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ae(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ve({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ye(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Xe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ye(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ze(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Xe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ze(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Qe=class extends oe{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Pe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),et(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof O(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!xe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&nt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||O(this.options.enabled,this.#t)!==O(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return it(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(E)),t}#g(){this.#b();let e=D(this.options.staleTime,this.#t);if(Ne.isServer()||this.#r.isStale||!fe(e))return;let t=pe(this.#r.dataUpdatedAt,e)+1;this.#d=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Ne.isServer()||O(this.options.enabled,this.#t)===!1||!fe(this.#p)||this.#p===0)&&(this.#f=T.setInterval(()=>{(this.options.refetchIntervalInBackground||se.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(T.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(T.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&et(e,t),o=i&&nt(e,n,t,r);(a||o)&&(l={...l,...Ye(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Ee(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Ee(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:rt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:O(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Pe();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!xe(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){k.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function $e(e,t){return O(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&O(t.retryOnMount,e)===!1)}function et(e,t){return $e(e,t)||e.state.data!==void 0&&tt(e,t,t.refetchOnMount)}function tt(e,t,n){if(O(t.enabled,e)!==!1&&D(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&rt(e,t)}return!1}function nt(e,t,n,r){return(e!==t||O(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&rt(e,n)}function rt(e,t){return O(t.enabled,e)!==!1&&e.isStaleByTime(D(t.staleTime,e))}function it(e,t){return!xe(e.getCurrentResult(),t)}var at=class extends He{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ot(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ve({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),k.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ot(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var st=class extends oe{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),xe(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&_e(t.mutationKey)!==_e(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ot();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){k.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ct(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function lt(e,t,n){let r=e.slice(0);return r[t]=n,r}var ut=class extends oe{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,k.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!xe(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ct(e,n).forEach(e=>{e.destroy()}),ct(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=be(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Qe(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=lt(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&k.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},A=e(t(),1),j=r(),dt=A.createContext(void 0),M=e=>{let t=A.useContext(dt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ft=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(dt.Provider,{value:e,children:t})),pt=A.createContext(!1),mt=()=>A.useContext(pt);pt.Provider;function ht(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gt=A.createContext(ht()),_t=()=>A.useContext(gt),vt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?je(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},yt=e=>{A.useEffect(()=>{e.clearReset()},[e])},bt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||je(n,[e.error,r])),xt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},St=(e,t)=>e.isLoading&&e.isFetching&&!t,Ct=(e,t)=>e?.suspense&&t.isPending,wt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Tt({queries:e,...t},n){let r=M(n),i=mt(),a=_t(),o=A.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{xt(e);let t=r.getQueryCache().get(e.queryHash);vt(e,a,t)}),yt(a);let[s]=A.useState(()=>new ut(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;A.useSyncExternalStore(A.useCallback(e=>d?s.subscribe(k.batchCalls(e)):E,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),A.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Ct(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&Ct(n,e)?wt(n,new Qe(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&bt({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function Et(e,t,n){let r=mt(),i=_t(),a=M(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xt(o),vt(o,i,s),yt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=A.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(A.useSyncExternalStore(A.useCallback(e=>{let t=f?u.subscribe(k.batchCalls(e)):E;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),A.useEffect(()=>{u.setOptions(o)},[o,u]),Ct(o,d))throw wt(o,u,i);if(bt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Ne.isServer()&&St(d,r)&&(l?wt(o,u,i):s?.promise)?.catch(E).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function N(e,t){return Et(e,Qe,t)}function P(e,t){let n=M(t),[r]=A.useState(()=>new st(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);let i=A.useSyncExternalStore(A.useCallback(e=>r.subscribe(k.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=A.useCallback((e,t)=>{r.mutate(e,t).catch(E)},[r]);if(i.error&&je(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Dt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ot=/^[\\/]{2}/;function kt(e,t){return t+e.replace(/\\/g,`/`)}var At=`popstate`;function jt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Mt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Ft(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:It(t)}return Rt(t,n,null,e)}function F(e,t){if(e===!1||e==null)throw Error(t)}function I(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Nt(){return Math.random().toString(36).substring(2,10)}function Pt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ft(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Lt(t):t,state:n,key:t&&t.key||r||Nt(),mask:i}}function It({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Lt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Rt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=jt(e)?e:Ft(h.location,e,t);n&&n(r,e),l=u()+1;let d=Pt(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=jt(e)?e:Ft(h.location,e,t);n&&n(r,e),l=u();let i=Pt(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return zt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(At,d),c=e,()=>{i.removeEventListener(At,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function zt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),F(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:It(t);return i=i.replace(/ $/,`%20`),!n&&Ot.test(i)&&(i=r+i),new URL(i,r)}function Bt(e,t,n=`/`){return Vt(e,t,n,!1)}function Vt(e,t,n,r,i){let a=L((typeof t==`string`?Lt(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ut(e),s=null,c=sn(a);for(let e=0;s==null&&e<o.length;++e)s=nn(o[e],c,r);return s}function Ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Ut(e){let t=Wt(e);return Kt(t),t}function Wt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;F(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=R([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(F(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Wt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:en(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=on(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Gt(e.path))a(e,t,!0,n)}),t}function Gt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Gt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Kt(e){e.sort((e,t)=>e.score===t.score?tn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var qt=/^:[\w-]+$/,Jt=3,Yt=2,Xt=1,Zt=10,Qt=-2,$t=e=>e===`*`;function en(e,t){let n=e.split(`/`),r=n.length;return n.some($t)&&(r+=Qt),t&&(r+=Yt),n.filter(e=>!$t(e)).reduce((e,t)=>e+(qt.test(t)?Jt:t===``?Xt:Zt),r)}function tn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function nn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?an(u,l,s.matcher,s.compiledParams):rn(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=rn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:R([a,d.pathname]),pathnameBase:gn(R([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=R([a,d.pathnameBase]))}return o}function rn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=on(e.path,e.caseSensitive,e.end);return an(e,t,n,r)}function an(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function on(e,t=!1,n=!0){I(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function sn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return I(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function L(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function cn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Lt(e):e,a;return n?(n=mn(n),a=n.startsWith(`/`)?ln(n.substring(1),`/`):ln(n,t)):a=t,{pathname:a,search:_n(r),hash:vn(i)}}function ln(e,t){let n=hn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function un(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function dn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function fn(e){let t=dn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pn(e,t,n,r=!1){let i;typeof e==`string`?i=Lt(e):(i={...e},F(!i.pathname||!i.pathname.includes(`?`),un(`?`,`pathname`,`search`,i)),F(!i.pathname||!i.pathname.includes(`#`),un(`#`,`pathname`,`hash`,i)),F(!i.search||!i.search.includes(`#`),un(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=cn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var mn=e=>e.replace(/[\\/]{2,}/g,`/`),R=e=>mn(e.join(`/`)),hn=e=>e.replace(/\/+$/,``),gn=e=>hn(e).replace(/^\/*/,`/`),_n=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,vn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,yn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xn(e){return R(e.map(e=>e.route.path).filter(Boolean))||`/`}var Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Cn(e,t){let n=e;if(typeof n!=`string`||!Dt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Sn)try{let e=new URL(window.location.href),r=Ot.test(n)?new URL(kt(n,e.protocol)):new URL(n),a=L(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{I(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var wn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(wn);var Tn=[`GET`,...wn];new Set(Tn);var En=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Dn(e){try{return En.includes(new URL(e).protocol)}catch{return!1}}var On=A.createContext(null);On.displayName=`DataRouter`;var kn=A.createContext(null);kn.displayName=`DataRouterState`;var An=A.createContext(!1);function jn(){return A.useContext(An)}var Mn=A.createContext({isTransitioning:!1});Mn.displayName=`ViewTransition`;var Nn=A.createContext(new Map);Nn.displayName=`Fetchers`;var Pn=A.createContext(null);Pn.displayName=`Await`;var z=A.createContext(null);z.displayName=`Navigation`;var Fn=A.createContext(null);Fn.displayName=`Location`;var B=A.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName=`Route`;var In=A.createContext(null);In.displayName=`RouteError`;var Ln=`REACT_ROUTER_ERROR`,Rn=`REDIRECT`,zn=`ROUTE_ERROR_RESPONSE`;function Bn(e){if(e.startsWith(`${Ln}:${Rn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Vn(e){if(e.startsWith(`${Ln}:${zn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new yn(t.status,t.statusText,t.data)}catch{}}function Hn(e,{relative:t}={}){F(Un(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=A.useContext(z),{hash:i,pathname:a,search:o}=Zn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:R([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Un(){return A.useContext(Fn)!=null}function V(){return F(Un(),`useLocation() may be used only in the context of a <Router> component.`),A.useContext(Fn).location}var Wn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Gn(e){A.useContext(z).static||A.useLayoutEffect(e)}function Kn(){let{isDataRoute:e}=A.useContext(B);return e?gr():qn()}function qn(){F(Un(),`useNavigate() may be used only in the context of a <Router> component.`);let e=A.useContext(On),{basename:t,navigator:n}=A.useContext(z),{matches:r}=A.useContext(B),{pathname:i}=V(),a=JSON.stringify(fn(r)),o=A.useRef(!1);return Gn(()=>{o.current=!0}),A.useCallback((r,s={})=>{if(I(o.current,Wn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:R([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Jn=A.createContext(null);function Yn(e){let t=A.useContext(B).outlet;return A.useMemo(()=>t&&A.createElement(Jn.Provider,{value:e},t),[t,e])}function Xn(){let{matches:e}=A.useContext(B);return e[e.length-1]?.params??{}}function Zn(e,{relative:t}={}){let{matches:n}=A.useContext(B),{pathname:r}=V(),i=JSON.stringify(fn(n));return A.useMemo(()=>pn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qn(e,t){return $n(e,t)}function $n(e,t,n){F(Un(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=A.useContext(z),{matches:i}=A.useContext(B),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;vr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
2
 
3
3
  Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=V(),d;if(t){let e=typeof t==`string`?Lt(t):t;F(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Bt(e,{pathname:p});I(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),I(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=or(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:R([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:R([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?A.createElement(Fn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function er(){let e=hr(),t=bn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=A.createElement(A.Fragment,null,A.createElement(`p`,null,`💿 Hey developer 👋`),A.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,A.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,A.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),A.createElement(A.Fragment,null,A.createElement(`h2`,null,`Unexpected Application Error!`),A.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?A.createElement(`pre`,{style:i},n):null,o)}var tr=A.createElement(er,null),nr=class extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Vn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:A.createElement(B.Provider,{value:this.props.routeContext},A.createElement(In.Provider,{value:e,children:this.props.component}));return this.context?A.createElement(ir,{error:e},t):t}};nr.contextType=An;var rr=new WeakMap;function ir({children:e,error:t}){let{basename:n}=A.useContext(z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Bn(t.digest);if(e){let r=rr.get(t);if(r)throw r;let i=Cn(e.location,n),a=i.absoluteURL||i.to;if(Dn(a))throw Error(`Invalid redirect location`);if(Sn&&!rr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw rr.set(t,n),n}return A.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function ar({routeContext:e,match:t,children:n}){let r=A.useContext(On);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),A.createElement(B.Provider,{value:e},n)}function or(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);F(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:xn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||tr,o&&(s<0&&c===0?(vr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?A.createElement(n.route.Component,null):n.route.element?n.route.element:e,A.createElement(ar,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?A.createElement(nr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function sr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cr(e){let t=A.useContext(On);return F(t,sr(e)),t}function lr(e){let t=A.useContext(kn);return F(t,sr(e)),t}function ur(e){let t=A.useContext(B);return F(t,sr(e)),t}function dr(e){let t=ur(e),n=t.matches[t.matches.length-1];return F(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function fr(){return dr(`useRouteId`)}function pr(){let e=lr(`useNavigation`);return A.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function mr(){let{matches:e,loaderData:t}=lr(`useMatches`);return A.useMemo(()=>e.map(e=>Ht(e,t)),[e,t])}function hr(){let e=A.useContext(In),t=lr(`useRouteError`),n=dr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gr(){let{router:e}=cr(`useNavigate`),t=dr(`useNavigate`),n=A.useRef(!1);return Gn(()=>{n.current=!0}),A.useCallback(async(r,i={})=>{I(n.current,Wn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _r={};function vr(e,t,n){!t&&!_r[e]&&(_r[e]=!0,I(!1,n))}A.memo(yr);function yr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return $n(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function br({to:e,replace:t,state:n,relative:r}){F(Un(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=A.useContext(z);I(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=A.useContext(B),{pathname:o}=V(),s=Kn(),c=pn(e,fn(a),o,r===`path`),l=JSON.stringify(c);return A.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function xr(e){return Yn(e.context)}function Sr(e){F(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Cr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){F(!Un(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=A.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Lt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=A.useMemo(()=>{let e=L(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return I(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:A.createElement(z.Provider,{value:c},A.createElement(Fn.Provider,{children:t,value:h}))}function wr({children:e,location:t}){return Qn(Tr(e),t)}A.Component;function Tr(e,t=[]){let n=[];return A.Children.forEach(e,(e,r)=>{if(!A.isValidElement(e))return;let i=[...t,r];if(e.type===A.Fragment){n.push.apply(n,Tr(e.props.children,i));return}F(e.type===Sr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),F(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Tr(e.props.children,i)),n.push(a)}),n}var Er=`get`,Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}function Pr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Fr(e,t){let n=Pr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ir=null;function Lr(){if(Ir===null)try{new FormData(document.createElement(`form`),0),Ir=!1}catch{Ir=!0}return Ir}var Rr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function zr(e){return e!=null&&!Rr.has(e)?(I(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Br(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?L(o,t):null,n=e.getAttribute(`method`)||Er,i=zr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?L(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Er,i=zr(e.getAttribute(`formenctype`))||zr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Lr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Er,r=null,i=Dr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Vr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Hr=/[&><\u2028\u2029]/g;function Ur(e){return e.replace(Hr,e=>Vr[e])}function Wr(e,t){if(e===!1||e==null)throw Error(t)}function Gr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&L(i.pathname,t)===`/`?i.pathname=`${hn(t)}/_root.${r}`:i.pathname=`${hn(i.pathname)}.${r}`,i}async function Kr(e,t){if(e.id in t)return t[e.id];try{let n=await h(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function qr(e){return e!=null&&typeof e.page==`string`}function Jr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Yr(e,t,n){return ei((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Kr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Jr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Xr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Zr(e,t,{includeHydrateFallback:n}={}){return Qr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Qr(e){return[...new Set(e)]}function $r(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ei(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!qr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify($r(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ti(){let e=A.useContext(On);return Wr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ni(){let e=A.useContext(kn);return Wr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ri=A.createContext(void 0);ri.displayName=`FrameworkContext`;function ii(){let e=A.useContext(ri);return Wr(e,`You must render this element inside a <HydratedRouter> element`),e}function ai(e,t){let n=A.useContext(ri),[r,i]=A.useState(!1),[a,o]=A.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=A.useRef(null);A.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),A.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:oi(s,p),onBlur:oi(c,m),onMouseEnter:oi(l,p),onMouseLeave:oi(u,m),onTouchStart:oi(d,p)}]:[a,f,{}]:[!1,f,{}]}function oi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function si({page:e,...t}){let n=jn(),{nonce:r}=ii(),{router:i}=ti(),a=A.useMemo(()=>Bt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?A.createElement(li,{page:e,matches:a,...t}):A.createElement(ui,{page:e,matches:a,...t})):null}function ci(e){let{manifest:t,routeModules:n}=ii(),[r,i]=A.useState([]);return A.useEffect(()=>{let r=!1;return Yr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function li({page:e,matches:t,...n}){let r=V(),{future:i}=ii(),{basename:a}=ti(),o=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Gr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return A.createElement(A.Fragment,null,o.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ui({page:e,matches:t,...n}){let r=V(),{future:i,manifest:a,routeModules:o}=ii(),{basename:s}=ti(),{loaderData:c,matches:l}=ni(),u=A.useMemo(()=>Xr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=A.useMemo(()=>Xr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Gr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=A.useMemo(()=>Zr(d,a),[d,a]),m=ci(d);return A.createElement(A.Fragment,null,f.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>A.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>A.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function di(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}A.Component;var fi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{fi&&(window.__reactRouterVersion=`7.18.1`)}catch{}function pi({basename:e,children:t,useTransitions:n,window:r}){let i=A.useRef();i.current??=Mt({window:r,v5Compat:!0});let a=i.current,[o,s]=A.useState({action:a.action,location:a.location}),c=A.useCallback(e=>{n===!1?s(e):A.startTransition(()=>s(e))},[n]);return A.useLayoutEffect(()=>a.listen(c),[a,c]),A.createElement(Cr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function mi({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=A.useState({action:n.action,location:n.location}),o=A.useCallback(e=>{r===!1?a(e):A.startTransition(()=>a(e))},[r]);return A.useLayoutEffect(()=>n.listen(o),[n,o]),A.createElement(Cr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}mi.displayName=`unstable_HistoryRouter`;var hi=A.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=A.useContext(z),v=typeof l==`string`&&Dt.test(l),y=Cn(l,h);l=y.to;let b=Hn(l,{relative:r}),x=V(),S=null;if(o){let e=pn(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:R([h,e.pathname])),S=g.createHref(e)}let[ee,C,w]=ai(n,p),te=Si(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let re=!(y.isExternal||i),ie=A.createElement(`a`,{...p,...w,href:(re?S:void 0)||y.absoluteURL||b,onClick:re?ne:e,ref:di(m,C),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return ee&&!v?A.createElement(A.Fragment,null,ie,A.createElement(si,{page:b})):ie});hi.displayName=`Link`;var gi=A.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Zn(a,{relative:c.relative}),d=V(),f=A.useContext(kn),{navigator:p,basename:m}=A.useContext(z),h=f!=null&&Ni(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=L(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},ee=b?e:void 0,C;C=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let w=typeof i==`function`?i(S):i;return A.createElement(hi,{...c,"aria-current":ee,className:C,ref:l,style:w,to:a,viewTransition:o},typeof s==`function`?s(S):s)});gi.displayName=`NavLink`;var _i=A.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Er,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=A.useContext(z),g=Ei(),_=Di(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Dt.test(s);return A.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?A.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});_i.displayName=`Form`;function vi({getKey:e,storageKey:t,...n}){let r=A.useContext(ri),{basename:i}=A.useContext(z),a=V(),o=mr();ji({getKey:e,storageKey:t});let s=A.useMemo(()=>{if(!r||!e)return null;let t=Ai(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),A.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ur(JSON.stringify(t||Oi))}, ${Ur(JSON.stringify(s))})`}})}vi.displayName=`ScrollRestoration`;function yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bi(e){let t=A.useContext(On);return F(t,yi(e)),t}function xi(e){let t=A.useContext(kn);return F(t,yi(e)),t}function Si(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Kn(),d=V(),f=Zn(e,{relative:o});return A.useCallback(p=>{if(Nr(p,t)){p.preventDefault();let t=n===void 0?It(d)===It(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?A.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Ci(e){I(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=A.useRef(Pr(e)),n=A.useRef(!1),r=V(),i=A.useMemo(()=>Fr(r.search,n.current?null:t.current),[r.search]),a=Kn();return[i,A.useCallback((e,t)=>{let r=Pr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var wi=0,Ti=()=>`__${String(++wi)}__`;function Ei(){let{router:e}=bi(`useSubmit`),{basename:t}=A.useContext(z),n=fr(),r=e.fetch,i=e.navigate;return A.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Br(e,t);if(a.navigate===!1){let e=a.fetcherKey||Ti();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Di(e,{relative:t}={}){let{basename:n}=A.useContext(z),r=A.useContext(B);F(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Zn(e||`.`,{relative:t})},o=V();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:R([n,a.pathname])),It(a)}var Oi=`react-router-scroll-positions`,ki={};function Ai(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:L(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ji({getKey:e,storageKey:t}={}){let{router:n}=bi(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=xi(`useScrollRestoration`),{basename:a}=A.useContext(z),o=V(),s=mr(),c=pr();A.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Mi(A.useCallback(()=>{if(c.state===`idle`){let t=Ai(o,s,a,e);ki[t]=window.scrollY}try{sessionStorage.setItem(t||Oi,JSON.stringify(ki))}catch(e){I(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(A.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Oi);e&&(ki=JSON.parse(e))}catch{}},[t]),A.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ki,()=>window.scrollY,e?(t,n)=>Ai(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),A.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{I(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Mi(e,t){let{capture:n}=t||{};A.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Ni(e,{relative:t}={}){let n=A.useContext(Mn);F(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=bi(`useViewTransitionState`),i=Zn(e,{relative:t});if(!n.isTransitioning)return!1;let a=L(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=L(n.nextLocation.pathname,r)||n.nextLocation.pathname;return rn(i.pathname,o)!=null||rn(i.pathname,a)!=null}var Pi=[`claude`,`codex`,`opencode`,`pi`],Fi=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function Ii(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Li(e,t){if(!Ii(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!Pi.includes(n)||typeof r!=`string`||!Fi.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function Ri(e){return Li(e,!1)}function zi(e,t){if(!Ii(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=Li(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function H(e){let t=zi(e,!0);if(t===null||t.length===0)return null;let n=new Map(t.map(e=>[e.provider,e]));return Pi.flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function Bi(e){let t=H(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function Vi(e,t){let n=H(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function Hi(e,t,n,r){let i=H(e),a=H(t),o=H(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:Ui(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function Ui(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}function Wi(e){let t=H(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&e.status===`connected`).map(e=>e.provider));return Pi.filter(e=>n.has(e))}function Gi(e,t){return H(e)?.find(e=>e.provider===t)}var U=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function Ki(e){try{return JSON.parse(e)}catch{return}}function qi(e){return typeof e==`string`?e:void 0}function Ji(e,t,n){let r=Ki(n),i=r&&typeof r==`object`?r:{};return new U(e,qi(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:qi(i.manual),command:qi(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}var W=ae({fetch:(e,t)=>$i(Yi(String(e)),t)});function Yi(e){let t=Zi(e.endsWith(`?`)?e.slice(0,-1):e);return t.startsWith(`/`)?`${u()}${t}`:t}var Xi=`${c}/p/default`;function Zi(e){if(f()!==null||!e.startsWith(Xi))return e;let t=e.slice(Xi.length);return t===``||t.startsWith(`/`)||t.startsWith(`?`)?`${c}${t}`:e}var G=e=>({init:{signal:e?.signal}});async function K(e,t){let n=await e.text();if(!e.ok)throw Ji(e.status,e.statusText,n);let r=Ki(n);if(r===void 0)throw new U(e.status,`the xezar server answered ${t} with a non-JSON body`);return r}async function Qi(e,t,n){let r=e.status,i=await K(e,t),a=n.safeParse(i);if(!a.success)throw new U(r,`the xezar server answered ${t} with an unexpected body`);return a.data}async function $i(e,t){try{return await fetch(e,{...t,credentials:`include`})}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new U(0,`cannot reach the xezar server (${e})`,{cause:t})}}async function ea(e,t){return $i(i(e),t)}async function ta(e,t={}){let n=new Headers(t.headers);n.set(`accept`,`text/plain`);let r=await ea(e,{...t,headers:n}),i=await r.text();if(!r.ok)throw Ji(r.status,r.statusText,i);return i}var q=(e,t=``)=>`/runs/${encodeURIComponent(e)}${t}`;async function na(e){return K(await W.api.v1.health.$get({},G(e)),`/health`)}async function ra(e,t){return K(await W.api.v1.models.$get({query:{runner:e}},G(t)),`/models`)}async function ia(e=!1,t){return Bi(await K(await W.api.v1.providers.status.$get({query:e?{refresh:`1`}:{}},G(t)),`/providers/status`))}async function aa(e){return K(await W.api.v1.p[`:projectId`][`launch-key`].$get({param:{projectId:o()}},G(e)),`/launch-key`)}async function oa(e){return K(await W.api.v1.projects.$get({},G(e)),`/projects`)}async function sa(e,t){return K(await W.api.v1.fs.browse.$get({query:{path:e===``?void 0:e,...t?.showHidden?{showHidden:`1`}:{}}},G(t)),`/fs/browse`)}async function ca(e){return K(await W.api.v1.p[`:projectId`].runs.$get({param:{projectId:o()}},G(e)),`/runs`)}async function la(e,t){return K(await W.api.v1.p[`:projectId`].runs.$get({param:{projectId:e}},G(t)),`/runs`)}async function ua(e){return K(await W.api.v1.workspace[`runs-index`].$get({},G(e)),`/workspace/runs-index`)}async function da(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:o(),id:encodeURIComponent(e)}},G(t)),q(e))}async function fa(e,t,n){return K(await W.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:e,id:encodeURIComponent(t)}},G(n)),q(t))}async function pa(e,t,n){return Qi(await W.api.v1.p[`:projectId`].runs[`:id`].history.$get({param:{projectId:o(),id:encodeURIComponent(e)},query:{...t===void 0?{}:{cursor:t}}},G(n)),`${q(e)}/history`,a)}async function ma(e,t){return Qi(await W.api.v1.p[`:projectId`].runs[`:id`][`history-context`].$get({param:{projectId:o(),id:encodeURIComponent(e)}},G(t)),`${q(e)}/history-context`,m)}async function ha(e){return K(await W.api.v1.p[`:projectId`][`ui-state`].$get({param:{projectId:o()}},G(e)),`/ui-state`)}async function ga(e){return K(await W.api.v1.p[`:projectId`].workflows.$get({param:{projectId:o()}},G(e)),`/workflows`)}async function _a(e){return K(await W.api.v1.p[`:projectId`].skills.$get({param:{projectId:o()},query:{}},G(e)),`/skills`)}async function va(e){return K(await W.api.v1.p[`:projectId`].skills.$get({param:{projectId:o()},query:{wait:`1`}},G(e)),`/skills`)}async function ya(){return K(await W.api.v1.p[`:projectId`].skills.refresh.$post({param:{projectId:o()}}),`/skills/refresh`)}async function ba(e){return K(await W.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:o()},query:{}},G(e)),`/skills/importable`)}async function xa(e){return K(await W.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:o()},query:{wait:`1`}},G(e)),`/skills/importable`)}async function Sa(e){return K(await W.api.v1.p[`:projectId`].todos.$get({param:{projectId:o()}},G(e)),`/todos`)}async function Ca(e){return K(await W.api.v1.p[`:projectId`].repo.$get({param:{projectId:o()}},G(e)),`/repo`)}async function wa(e){return K(await W.api.v1.p[`:projectId`].config.$get({param:{projectId:o()}},G(e)),`/config`)}async function Ta(e={}){return K(await W.api.v1.p[`:projectId`][`agent-config`].$get({param:{projectId:o()}},G(e)),`/agent-config`)}async function Ea(e,t={}){return K(await W.api.v1.p[`:projectId`][`agent-config`][`:id`].$get({param:{projectId:o(),id:encodeURIComponent(e)}},G(t)),`/agent-config/${encodeURIComponent(e)}`)}async function Da(e,t){return K(await W.api.v1.p[`:projectId`][`agent-config`][`:id`].$put({param:{projectId:o(),id:encodeURIComponent(e)},json:t}),`/agent-config/${encodeURIComponent(e)}`)}async function Oa(e){return K(await W.api.v1.p[`:projectId`].repo.changes.$get({param:{projectId:o()}},G(e)),`/repo/changes`)}async function ka(e,t){return K(await W.api.v1.p[`:projectId`].repo.commit[`:sha`].$get({param:{projectId:o(),sha:encodeURIComponent(e)},query:{structured:`1`}},G(t)),`/repo/commit/:sha`)}async function Aa(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`].commits.$get({param:{projectId:o(),id:encodeURIComponent(e)}},G(t)),q(e,`/commits`))}async function ja(e,t,n){return K(await W.api.v1.p[`:projectId`].runs[`:id`].commit[`:sha`].$get({param:{projectId:o(),id:encodeURIComponent(e),sha:encodeURIComponent(t)}},G(n)),q(e,`/commit/${encodeURIComponent(t)}`))}async function Ma(e={},t){return K(await W.api.v1.p[`:projectId`].github.$get({param:{projectId:o()},query:{limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0}},G(t)),`/github`)}async function Na(e,t){return K(await W.api.v1.p[`:projectId`].github.checks.$get({param:{projectId:o()},query:{prs:e.join(`,`)}},G(t)),`/github/checks`)}async function Pa(e,t,n={},r){return K(await W.api.v1.p[`:projectId`].github.search.$get({param:{projectId:o()},query:{kind:e,q:t,limit:n.limit}},G(r)),`/github/search`)}async function Fa(e,t,n){return K(await W.api.v1.p[`:projectId`].github[`ref-status`].$get({param:{projectId:e},query:{...t.prs?.length?{prs:t.prs.join(`,`)}:{},...t.issues?.length?{issues:t.issues.join(`,`)}:{}}},G(n)),`/github/ref-status`)}async function Ia(e,t,n={},r){return K(await W.api.v1.p[`:projectId`].github.comments[`:kind`][`:number`].$get({param:{projectId:o(),kind:e,number:String(t)},query:{refresh:n.refresh?`1`:void 0}},G(r)),`/github/comments/${e}/${t}`)}async function La(e,t={},n){return K(await W.api.v1.p[`:projectId`].github.prs[`:number`][`merge-state`].$get({param:{projectId:o(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},G(n)),`/github/prs/${e}/merge-state`)}async function Ra(e,t){return K(await W.api.v1.p[`:projectId`].github.prs[`:number`].merge.$post({param:{projectId:o(),number:String(e)},json:t}),`/github/prs/:number/merge`)}async function za(e,t={},n){return K(await W.api.v1.p[`:projectId`].github.prs[`:number`].changes.$get({param:{projectId:o(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},G(n)),`/github/prs/${e}/changes`)}function Ba(e,t){return ta(q(e,`/diff`),{method:`GET`,signal:t?.signal})}function Va(e,t){return ta(q(e,`/handoff`),{method:`GET`,signal:t?.signal})}async function Ha(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`].changes.$get({param:{projectId:o(),id:encodeURIComponent(e)}},G(t)),q(e,`/changes`))}async function Ua(e,t,n){return K(await W.api.v1.p[`:projectId`].runs[`:id`].files.$get({param:{projectId:o(),id:encodeURIComponent(e)},query:{path:t}},G(n)),`/runs/:id/files`)}function Wa(e,t){return i(q(e,`/files?path=${encodeURIComponent(t)}&raw=1`))}async function Ga(e,t){return K(await W.api.v1.p[`:projectId`].groups[`:groupId`].$get({param:{projectId:o(),groupId:encodeURIComponent(e)}},G(t)),`/groups/${encodeURIComponent(e)}`)}async function Ka(e,t){return K(await W.api.v1.providers.connect.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/connect`)}async function qa(e,t){return Bi(await K(await W.api.v1.providers[`:provider`].enabled.$put({param:{provider:e},json:{enabled:t}}),`/providers/${encodeURIComponent(e)}/enabled`))}async function Ja(e,t){return Bi(await K(await W.api.v1.providers[`:provider`].retry.$post({param:{provider:e},json:{authFailureId:t}}),`/providers/${encodeURIComponent(e)}/retry`))}async function Ya(e){let t=`/projects`,n=await ea(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await n.text(),i=Ki(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new U(n.status,`the xezar server answered ${t} without a project`):Ji(n.status,n.statusText,r)}async function Xa(e){return K(await W.api.v1.projects.checkout.$post({json:e}),`/projects/checkout`)}async function Za(e){return K(await W.api.v1.projects[`:projectId`].$delete({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}`)}async function Qa(e,t){return K(await W.api.v1.projects[`:projectId`].$patch({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}`)}async function $a(e){return K(await W.api.v1.p[`:projectId`].runs.$post({param:{projectId:o()},json:e}),`/runs`)}async function eo(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].cancel.$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/cancel`))}async function to(e,t=!0){return K(await W.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{archived:t}}),q(e,`/archive`))}async function no(e,t=!0){return K(await W.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{pinned:t}}),q(e,`/pin`))}async function ro(e,t,n=!0){return K(await W.api.v1.p[`:projectId`].runs[`:id`].pin.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{pinned:n}}),q(t,`/pin`))}async function io(e,t,n=!0){return K(await W.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{archived:n}}),q(t,`/archive`))}async function ao(e,t,n){let r=n?`read`:`unread`;return K(await(n?W.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:e,id:encodeURIComponent(t)}}):W.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:e,id:encodeURIComponent(t)}})),q(t,`/${r}`))}async function oo(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`auto-resume`].$delete({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/auto-resume`))}async function so(){return K(await W.api.v1.p[`:projectId`].runs[`archive-finished`].$post({param:{projectId:o()}}),`/runs/archive-finished`)}async function co(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/read`))}async function lo(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].unread.$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/unread`))}async function uo(){return K(await W.api.v1.p[`:projectId`].runs[`read-all`].$post({param:{projectId:o()}}),`/runs/read-all`)}async function fo(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].finish.$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/finish`))}async function po(e,t={}){let n={...t.text===void 0?{}:{text:t.text},...t.images===void 0?{}:{images:t.images},...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.agentProfile===void 0?{}:{agentProfile:t.agentProfile}};return K(await W.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:n}),q(e,`/continue`))}async function mo(e,t,n={}){return K(await W.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{...n.text===void 0?{}:{text:n.text},...n.images===void 0?{}:{images:n.images},...n.runner===void 0?{}:{runner:n.runner},...n.model===void 0?{}:{model:n.model},...n.agentProfile===void 0?{}:{agentProfile:n.agentProfile}}}),q(t,`/continue`))}async function ho(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].pr.$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/pr`))}async function go(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`].$patch({param:{projectId:o(),id:encodeURIComponent(e)},json:t}),q(e))}async function _o(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].$delete({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e))}async function vo(e){return K(await W.api.v1.p[`:projectId`].todos[`:id`].$delete({param:{projectId:o(),id:encodeURIComponent(e)}}),`/todos/${encodeURIComponent(e)}`)}async function yo(e,t={}){let n={...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.prompt===void 0?{}:{prompt:t.prompt}};return K(await W.api.v1.p[`:projectId`].todos[`:id`].start.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:Object.keys(n).length>0?n:void 0}),`/todos/${encodeURIComponent(e)}/start`)}async function bo(e,t){return K(await W.api.v1.p[`:projectId`].groups[`:groupId`].pick.$post({param:{projectId:o(),groupId:encodeURIComponent(e)},json:{runId:t}}),`/groups/${encodeURIComponent(e)}/pick`)}async function xo(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`open-in-cli`].$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/open-in-cli`))}async function So(e){return K(await W.api.v1.p[`:projectId`][`open-targets`].$get({param:{projectId:o()}},G(e)),`/open-targets`)}async function Co(e){return K(await W.api.v1.p[`:projectId`][`open-in`].$post({param:{projectId:o()},json:{target:e}}),`/open-in`)}async function wo(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{target:t}}),q(e,`/open-in`))}async function To(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{target:`default`,path:t}}),q(e,`/open-in`))}async function Eo(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`].git.commit.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{message:t}}),q(e,`/git/commit`))}async function Do(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`].git.push.$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/git/push`))}async function Oo(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{text:t.text??``,images:t.images??[]}}),q(e,`/messages`))}async function ko(e,t,n){return K(await W.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:e,id:encodeURIComponent(t)},json:{text:n.text??``,images:n.images??[]}}),q(t,`/messages`))}async function Ao(e,t,n){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$patch({param:{projectId:o(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)},json:n}),q(e,`/queued-messages/${encodeURIComponent(t)}`))}async function jo(e,t){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$delete({param:{projectId:o(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)}}),q(e,`/queued-messages/${encodeURIComponent(t)}`))}async function Mo(e){return K(await W.api.v1.p[`:projectId`].repo.branch.$post({param:{projectId:o()},json:e}),`/repo/branch`)}async function No(e){return K(await W.api.v1.p[`:projectId`].plan.$post({param:{projectId:o()},json:{task:e}}),`/plan`)}async function Po(e){return K(await W.api.v1.p[`:projectId`].automations.$get({param:{projectId:o()}},G(e)),`/automations`)}async function Fo(e){return K(await W.api.v1.p[`:projectId`].automations.$post({param:{projectId:o()},json:e}),`/automations`)}async function Io(e,t){return K(await W.api.v1.p[`:projectId`].automations[`:id`].$put({param:{projectId:o(),id:encodeURIComponent(e)},json:t}),`/automations/${encodeURIComponent(e)}`)}async function Lo(e,t){let n={projectId:o(),id:encodeURIComponent(e)},r=`/automations/${encodeURIComponent(e)}/${t?`enable`:`pause`}`;return K(t?await W.api.v1.p[`:projectId`].automations[`:id`].enable.$post({param:n}):await W.api.v1.p[`:projectId`].automations[`:id`].pause.$post({param:n}),r)}async function Ro(e,t){return K(await W.api.v1.p[`:projectId`].automations[`:id`].check.$post({param:{projectId:o(),id:encodeURIComponent(e)},json:{mode:t}}),`/automations/${encodeURIComponent(e)}/check`)}async function zo(e,t){return K(await W.api.v1[`automation-checks`][`:checkId`].$get({param:{checkId:encodeURIComponent(e)}},G(t)),`/automation-checks/${encodeURIComponent(e)}`)}async function Bo(e,t){return K(await W.api.v1.p[`:projectId`][`automation-log`].$get({param:{projectId:o()},query:{automationId:e}},G(t)),`/automation-log?automationId=${encodeURIComponent(e)}`)}async function Vo(e){return K(await W.api.v1.p[`:projectId`].workflows.$post({param:{projectId:o()},json:e}),`/workflows`)}async function Ho(e){return K(await W.api.v1.p[`:projectId`].workflows.parse.$post({param:{projectId:o()},json:{yaml:e}}),`/workflows/parse`)}async function Uo(e){return K(await W.api.v1.p[`:projectId`].workflows[`:name`].$delete({param:{projectId:o(),name:encodeURIComponent(e)}}),`/workflows/${encodeURIComponent(e)}`)}async function Wo(e){return K(await W.api.v1.p[`:projectId`][`ui-state`].$put({param:{projectId:o()},json:e}),`/ui-state`)}async function Go(e){return K(await W.api.v1.workspace[`ui-state`].$get({},G(e)),`/workspace/ui-state`)}async function Ko(e,t={}){return K(await W.api.v1.workspace[`ui-state`].$put({json:e},{init:{keepalive:t.keepalive}}),`/workspace/ui-state`)}async function qo(e){let t=await K(await W.api.v1.workspace.config.$get({},G(e)),`/workspace/config`);return{...t,agentDefaults:t.agentDefaults??{}}}async function Jo(e){let t=await K(await W.api.v1.workspace[`agent-profiles`].$get({},G(e)),`/workspace/agent-profiles`);return{...t,profileCapableProviders:t.profileCapableProviders??[],selections:t.selections??{},defaults:t.defaults??{},profiles:(t.profiles??[]).map(e=>({...e,files:e.files??[]}))}}async function Yo(e){return K(await W.api.v1.workspace[`agent-profiles`].$post({json:e}),`/workspace/agent-profiles`)}async function Xo(e,t){return K(await W.api.v1.workspace[`agent-profiles`][`:id`].status.$get({param:{id:encodeURIComponent(e)},query:t?.refresh?{refresh:`1`}:{}},G(t)),`/workspace/agent-profiles/${encodeURIComponent(e)}/status`)}async function Zo(e,t){return K(await W.api.v1.workspace[`agent-profiles`][`:id`].details.$get({param:{id:encodeURIComponent(e)}},G(t)),`/workspace/agent-profiles/${encodeURIComponent(e)}/details`)}async function Qo(e,t){return K(await W.api.v1.workspace[`agent-profiles`][`:id`].open.$post({param:{id:encodeURIComponent(e)},json:t}),`/workspace/agent-profiles/${encodeURIComponent(e)}/open`)}async function $o(e){return K(await W.api.v1.workspace[`agent-profiles`].selection.$put({json:e}),`/workspace/agent-profiles/selection`)}async function es(e,t){return K(await W.api.v1.workspace[`agent-profiles`][`:id`].$patch({param:{id:encodeURIComponent(e)},json:t}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function ts(e){return K(await W.api.v1.workspace[`agent-profiles`][`:id`].$delete({param:{id:encodeURIComponent(e)}}),`/workspace/agent-profiles/${encodeURIComponent(e)}`)}async function ns(e,t){return K(await W.api.v1.workspace[`skills-update`].$get({query:{projectId:e}},G(t)),`/workspace/skills-update?projectId=${encodeURIComponent(e)}`)}async function rs(e){return K(await W.api.v1.workspace[`skills-update`].check.$post({json:{projectId:e}}),`/workspace/skills-update/check`)}async function is(e){return K(await W.api.v1.workspace[`skills-update`].apply.$post({json:{projectId:e}}),`/workspace/skills-update/apply`)}async function as(e){return K(await W.api.v1.workspace.config.$put({json:e}),`/workspace/config`)}async function os(e){return K(await W.api.v1.p[`:projectId`].config.$put({param:{projectId:o()},json:e}),`/config`)}async function ss(e){return K(await W.api.v1.p[`:projectId`].worktrees.$get({param:{projectId:o()}},G(e)),`/worktrees`)}async function cs(){return K(await W.api.v1.p[`:projectId`].worktrees.reclaim.$post({param:{projectId:o()},json:{}}),`/worktrees/reclaim`)}async function ls(e){return K(await W.api.v1.p[`:projectId`].runs[`:id`][`remove-worktree`].$post({param:{projectId:o(),id:encodeURIComponent(e)}}),q(e,`/remove-worktree`))}var us={projectId:null,apiBase:c},ds=(0,A.createContext)(us);function fs(){return(0,A.useContext)(ds)}function ps({projectId:e,children:t}){f()!==e&&s(e),(0,A.useLayoutEffect)(()=>{s(e)},[e]),(0,A.useLayoutEffect)(()=>()=>s(null),[]);let n=(0,A.useMemo)(()=>e===null?us:{projectId:e,apiBase:`${c}/p/${encodeURIComponent(e)}`},[e]);return(0,j.jsx)(ds.Provider,{value:n,children:t})}var ms={draft:{label:`Draft`,hint:`the author has not marked it ready for review`,tone:`neutral`},"review-required":{label:`Waiting for review`,hint:`checks are fine, no one has reviewed it yet`,tone:`info`},"changes-requested":{label:`Changes requested`,hint:`a reviewer asked for edits before this can merge`,tone:`danger`},"checks-pending":{label:`Checks running`,hint:`CI has not finished on the latest commit`,tone:`pending`},"checks-failing":{label:`Checks failing`,hint:`CI is red on the latest commit`,tone:`danger`},ready:{label:`Ready to merge`,hint:`open, checks pass, nothing is waiting on a reviewer`,tone:`success`},merged:{label:`Merged`,hint:`this landed on its base branch`,tone:`violet`},closed:{label:`Closed`,hint:`closed without merging — the work did not land`,tone:`danger`},open:{label:`Open`,hint:`still open on the tracker`,tone:`success`},completed:{label:`Closed as completed`,hint:`the issue was resolved`,tone:`violet`},"not-planned":{label:`Closed as not planned`,hint:`the issue was declined — nothing shipped for it`,tone:`neutral`}},hs={label:`Merge conflicts`,hint:`this branch no longer merges cleanly into its base — rebase or merge the base in`,tone:`conflict`};function gs(e){return typeof e==`string`&&Object.hasOwn(ms,e)}function _s(e){return e!==void 0&&gs(e)?ms[e]:void 0}var vs=[`Pinned`,`Needs you`,`Working`,`Recent`,`Archived`],ys={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},bs=3,xs=e=>e.status===`failed`&&e.autoResumeAt!==void 0?bs:ys[e.status]??9;function Ss(e,t){return t===`archived`?`Archived`:e.pinned?`Pinned`:e.status===`waiting`||e.status===`review`?`Needs you`:e.status===`running`||e.status===`queued`||e.status===`failed`&&e.autoResumeAt?`Working`:`Recent`}function Cs(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function ws(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function Ts(e,t){return t!==void 0&&ws(e).ref===t}function Es(e){return e.title.replace(/ \([A-C]\)$/,``)}function Ds(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function Os(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=xs(e)-xs(n);if(r!==0)return r;if(xs(e)===bs&&e.autoResumeAt&&n.autoResumeAt){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function ks(e,t){let n=Ds(e),r=Os(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(Ss(e,t),{kind:`group`,groupId:e.groupId,title:Es(e),members:n});continue}}a(Ss(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return vs.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function As(e,t){let n=[],r=t;for(let t of e){if(t.label===`Pinned`){n.push({label:t.label,rows:[...t.rows]});continue}if(r<=0)continue;let e=t.rows.slice(0,r);r-=e.length,n.push({label:t.label,rows:e})}return n}function js(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,(i.status===`waiting`||i.status===`review`)&&(r+=1)}return{active:t,archived:n,waiting:r}}var Ms=new Set([`running`,`waiting`]),Ns=new Set([`done`,`failed`,`review`,`cancelled`]),Ps=new Set([`done`,`failed`,`cancelled`]);function Fs(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function Is(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function Ls(e,t=new Date){if(e.status!==`failed`||!e.autoResumeAt)return;let n=new Date(e.autoResumeAt);if(!Number.isFinite(n.getTime()))return;let r=n.toDateString()===t.toDateString(),i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n);return{label:r?i:`${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(n)} ${i}`,title:`Resumes automatically at ${new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n)}`}}function Rs(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function zs(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[Cs(e),e.branch??``,e.workflow,Rs(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function Bs(e){return e.filter(e=>!e.archived&&Ps.has(e.status)).length}function Vs(e){if(!e)return;let t=e.trim().replace(/\/+$/,``),n=/^(?:https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/.exec(t),r=n?null:/^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(t),i=n??r;if(!i)return;let[,a,o]=i;if(!o||a?.toLowerCase()!==`github.com`)return;let s=o.replace(/\.git$/i,``).split(`/`).filter(Boolean),c=s[s.length-2],l=s[s.length-1];return c&&l?`https://github.com/${c}/${l}`:void 0}function Hs(e){return Us(e)[0]}function Us(e){let t=[];return e.pullRequestUrl&&t.push(e.pullRequestUrl),!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0)&&e.referencedPullRequestUrl&&t.push(e.referencedPullRequestUrl),t}function Ws(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.markerRefs?.issue??e.issueNumber;if(!(!n||!t))return`${t}/issues/${n}`}function Gs(e,t){let n=Us(e),r=e.markerRefs?.pr,i=[...r===void 0||n.some(e=>Js(e)===String(r))?[]:[{kind:`PR`,number:r}],...n.map(e=>({kind:`PR`,url:e})),{kind:`PR`,number:e.prNumber},{kind:`Issue`,url:Ws(e,t)},{kind:`Issue`,number:e.issueNumber}],a=new Set,o=[];for(let e of i){let n=e.url?Number(Js(e.url)):e.number;if(!n||!Number.isInteger(n))continue;let r=`${e.kind}#${n}`;if(a.has(r))continue;a.add(r);let i=e.url??Ks(e.kind,n,t);o.push({kind:e.kind,number:n,...i?{url:i}:{}})}return o}function Ks(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function qs(e){return Gs(e)[0]}function Js(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function Ys(e,t){let n=Ms.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:Fs(n.rssBytes),kind:`live`}};let r=Fs(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function Xs(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>Ns.has(e.status))?[]:[{groupId:e,title:Es(n),count:t.length}]})}function Zs(e){let t=new Map;for(let n of e)for(let e of n.tags??[]){let n=e.toLowerCase();t.has(n)||t.set(n,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}function Qs(e,t,n,r=8){let i=n.trim().toLowerCase(),a=new Set(t.map(e=>e.toLowerCase())),o=e.filter(e=>{let t=e.toLowerCase();return a.has(t)?!1:i===``||t.includes(i)&&t!==i});return i===``?o.slice(0,r):o.sort((e,t)=>Number(t.toLowerCase().startsWith(i))-Number(e.toLowerCase().startsWith(i))||e.localeCompare(t,void 0,{sensitivity:`base`})).slice(0,r)}function $s(e){let t=new Map;for(let n of e){let e=n.trim();if(!e)continue;let r=e.toLowerCase();t.has(r)||t.set(r,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}var ec=`/api/v1/ws`,tc=3e3,nc=1e3,rc=7e4,ic=0,ac=1;function oc(e){let t=new Map,n=null,r,i,a,o=()=>{clearTimeout(a),a=setTimeout(()=>{a=void 0,n?.close()},rc)},s=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${ec}`,c=e=>{n?.readyState===ac&&n.send(JSON.stringify(e))},l=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||n&&(n.readyState===ic||n.readyState===ac))return;let i=new e(s());n=i,i.addEventListener(`open`,()=>{if(i===n){o();for(let e of t.keys())c({type:`subscribe`,topic:e})}}),i.addEventListener(`message`,e=>{if(i!==n)return;o();let r;try{r=JSON.parse(e.data)}catch{return}if(typeof r!=`object`||!r)return;let{type:a,topic:s,data:c}=r;if(a!==`event`||typeof s!=`string`)return;let l=t.get(s);if(l)for(let e of[...l])e(c)}),i.addEventListener(`close`,()=>{i===n&&(n=null,clearTimeout(a),a=void 0,t.size>0&&r===void 0&&(r=setTimeout(()=>{r=void 0,t.size>0&&l()},tc)))}),i.addEventListener(`error`,()=>void 0)};return{subscribe(e,o){let s=t.get(e);s||(s=new Set,t.set(e,s));let u=s.size===0;s.add(o),clearTimeout(i),i=void 0,n?u&&c({type:`subscribe`,topic:e}):(clearTimeout(r),r=void 0,l());let d=!0;return()=>{d&&(d=!1,s.delete(o),!(s.size>0)&&(t.delete(e),c({type:`unsubscribe`,topic:e}),t.size===0&&i===void 0&&(i=setTimeout(()=>{i=void 0,!(t.size>0)&&(clearTimeout(r),r=void 0,clearTimeout(a),a=void 0,n?.close(),n=null)},nc))))}}}}var sc=null;function cc(e,t){return sc??=oc(),sc.subscribe(e,t)}var J={get health(){return[o(),`health`]},runs:{get all(){return[o(),`runs`]},list:()=>[o(),`runs`,`list`],detail:e=>[o(),`runs`,`detail`,e],diff:e=>[o(),`runs`,`diff`,e],changes:e=>[o(),`runs`,`changes`,e],file:(e,t)=>[o(),`runs`,`files`,e,t],handoff:e=>[o(),`runs`,`handoff`,e],commits:e=>[o(),`runs`,`commits`,e],commit:(e,t)=>[o(),`runs`,`commit`,e,t]},groups:{detail:e=>[o(),`groups`,e]},get todos(){return[o(),`todos`]},get workflows(){return[o(),`workflows`]},get skills(){return[o(),`skills`]},get skillsReady(){return[o(),`skills`,`ready`]},get importableSkills(){return[o(),`skills`,`importable`]},get importableSkillsReady(){return[o(),`skills`,`importable`,`ready`]},get launchKey(){return[o(),`launch-key`]},get repo(){return[o(),`repo`]},get repoChanges(){return[o(),`repo`,`changes`]},repoCommit:e=>[o(),`repo`,`commit`,e],get uiState(){return[o(),`ui-state`]},get config(){return[o(),`config`]},get agentConfig(){return[o(),`agent-config`]},agentConfigFile:e=>[o(),`agent-config`,`file`,e],get worktrees(){return[o(),`worktrees`]},github:(e={})=>[o(),`github`,e.limit??null],githubChecks:e=>[o(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubSearch:(e,t)=>[o(),`github`,`search`,e,t],githubRefStatus:(e,t,n)=>[e,`github`,`ref-status`,[...t].sort((e,t)=>e-t).join(`,`),[...n].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[o(),`github`,`comments`,e,t],githubMergeState:e=>[o(),`github`,`merge-state`,e],get openTargets(){return[o(),`open-targets`]}},Y={models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],runsIndex:[`workspace`,`runs-index`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],agentProfiles:[`workspace`,`agent-profiles`],agentAccountDetails:e=>[`workspace`,`agent-profiles`,`details`,e],agentAccountStatus:e=>[`workspace`,`agent-profiles`,`status`,e],skillsUpdate:e=>[`workspace`,`skills-update`,e],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:(e,t=!1)=>[...Y.fsBrowseRoot,e,t]};function lc(e,t=!0){return N({queryKey:Y.models(e),queryFn:({signal:t})=>l(e)?ra(e,{signal:t}):Promise.reject(Error(`${e} has no host model catalog`)),staleTime:300*1e3,enabled:t&&l(e)})}function uc(e=!0){return{claude:lc(`claude`,e),codex:lc(`codex`,e),opencode:lc(`opencode`,e),pi:lc(`pi`,e)}}function dc(){let e=M();return N({queryKey:Y.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Y.providerStatus),r=await ia(!1,{signal:t});return Hi(n,e.getQueryData(Y.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function fc(){let e=M();return P({mutationFn:()=>ia(!0),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(Y.providerStatus,e=>Hi(r,e,t))})}function pc(){let e=M();return P({mutationFn:({provider:e,authFailureId:t})=>Ja(e,t),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Y.providerStatus,e=>Hi(r,e,t,n.authFailureId))}})}function mc(){return N({queryKey:Y.projects,queryFn:({signal:e})=>oa({signal:e})})}function hc(e,t=!1){return N({queryKey:Y.fsBrowse(e,t),queryFn:({signal:n})=>sa(e??void 0,{signal:n,showHidden:t}),retry:!1})}function gc(){let e=M();return P({mutationFn:e=>Ya(e),onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function _c(){let e=M();return P({mutationFn:e=>Za(e),retry:!1,onSuccess:()=>{e.invalidateQueries({queryKey:Y.projects})}})}function vc(){let e=M();return P({mutationFn:e=>{let{id:t,...n}=e;return Qa(t,n)},retry:!1,onMutate:async({id:t,...n})=>{await e.cancelQueries({queryKey:Y.projects});let r=e.getQueryData(Y.projects);return e.setQueryData(Y.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t?yc(e,n):e)}),{previous:r}},onError:(t,n,r)=>{r?.previous&&e.setQueryData(Y.projects,r.previous)},onSuccess:({project:t})=>{e.setQueryData(Y.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t.id?t:e)})},onSettled:()=>e.invalidateQueries({queryKey:Y.projects})})}function yc(e,t){let{maxParallel:n,tags:r,...i}=e,a={...i},o=`maxParallel`in t?t.maxParallel:e.maxParallel;o!=null&&(a.maxParallel=o);let s=`tags`in t&&t.tags!==void 0?t.tags:e.tags,c=s==null?[]:$s(s);return c.length>0&&(a.tags=c),a}function bc(e){let t=M();return P({mutationFn:e,retry:!1,onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:Y.agentProfiles}),t.invalidateQueries({queryKey:Y.projects})])}})}function xc(){return bc(e=>Yo(e))}function Sc(){return bc(e=>{let{id:t,...n}=e;return es(t,n)})}function Cc(){return bc(e=>ts(e))}function wc(){return bc(e=>$o(e))}function Tc(e,t){return N({queryKey:Y.agentAccountDetails(e),queryFn:({signal:t})=>Zo(e,{signal:t}),enabled:t,staleTime:0,retry:!1})}function Ec(e,t){return N({queryKey:Y.agentAccountStatus(e),queryFn:({signal:t})=>Xo(e,{signal:t}),enabled:t,staleTime:6e4,retry:!1})}function Dc(){let e=M();return P({mutationFn:({provider:e,profileId:t})=>Ka(e,t),retry:!1,onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.agentProfiles}),e.invalidateQueries({queryKey:Y.providerStatus})])}})}function Oc(){let e=M();return P({mutationFn:e=>Xo(e,{refresh:!0}),retry:!1,onSuccess:(t,n)=>{e.setQueryData(Y.agentAccountStatus(n),t),e.invalidateQueries({queryKey:Y.agentProfiles})}})}function kc(){return P({mutationFn:e=>{let{routeId:t,...n}=e;return Qo(t,n)},retry:!1})}function Ac(){let e=M();return P({mutationFn:e=>Xa(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function jc(){let e=M();(0,A.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(J.health)?.capabilities?.localHandoff===!0;n&&t===void 0?t=cc(`health`,t=>{e.setQueryData(J.health,t)}):!n&&t!==void 0&&(t(),t=void 0)};n();let r=e.getQueryCache().subscribe(n);return()=>{r(),t?.()}},[e])}function Mc(){return N({queryKey:J.health,queryFn:({signal:e})=>na({signal:e})})}function Nc(){let e=Mc().data,t=mc().data?.projects,{projectId:n}=fs(),r=n??e?.bootProject,i=r===void 0?void 0:t?.find(e=>e.id===r);return i?.repoUrl?i.repoUrl:n===null||n===e?.bootProject?Vs(e?.repo?.remote):void 0}function Pc(){return N({queryKey:J.openTargets,queryFn:({signal:e})=>So({signal:e}),staleTime:5*6e4})}function Fc(){return N({queryKey:J.runs.list(),queryFn:({signal:e})=>ca({signal:e})})}function Ic(e=!0,t){return N({queryKey:Y.runsIndex,queryFn:({signal:e})=>ua({signal:e}),enabled:e,staleTime:3e4,...t===void 0?{}:{refetchInterval:t}})}function Lc(e,t=!0,n=!1){return N({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>la(e,{signal:t}),enabled:t})}function Rc(e){return N({queryKey:J.runs.detail(e??``),queryFn:({signal:t})=>da(e,{signal:t}),enabled:!!e})}function zc(e,t,n=!0){return N({queryKey:[e??`default`,`runs`,`detail`,t??``],queryFn:({signal:n})=>fa(e,t,{signal:n}),enabled:n&&!!e&&!!t})}function Bc(e){return N({queryKey:J.runs.diff(e??``),queryFn:({signal:t})=>Ba(e,{signal:t}),enabled:!!e})}function Vc(e,t=!1){return N({queryKey:J.runs.changes(e??``),queryFn:({signal:t})=>Ha(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Hc(e,t){return N({queryKey:J.runs.file(e??``,t??``),queryFn:({signal:n})=>Ua(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Uc(e){return N({queryKey:J.groups.detail(e??``),queryFn:({signal:t})=>Ga(e,{signal:t}),enabled:!!e})}function Wc(e,t=!1){return N({queryKey:J.runs.commits(e??``),queryFn:({signal:t})=>Aa(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function Gc(e,t){return N({queryKey:J.runs.commit(e??``,t??``),queryFn:({signal:n})=>ja(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function Kc(e,t=!0){return N({queryKey:J.runs.handoff(e??``),queryFn:({signal:t})=>Va(e,{signal:t}),enabled:!!e&&t})}function qc(e=!0){return N({queryKey:J.todos,queryFn:({signal:e})=>Sa({signal:e}),enabled:e})}function Jc(){return N({queryKey:J.workflows,queryFn:({signal:e})=>ga({signal:e})})}function Yc(e=!0){let t=M(),n=J.skills,r=n[0],i=N({queryKey:n,queryFn:({signal:e})=>_a({signal:e}),enabled:e}),a=N({queryKey:J.skillsReady,queryFn:({signal:e})=>va({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,A.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Xc(e=!0){let t=M(),n=J.importableSkills,r=n[0],i=N({queryKey:n,queryFn:({signal:e})=>ba({signal:e}),enabled:e}),a=N({queryKey:J.importableSkillsReady,queryFn:({signal:e})=>xa({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,A.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Zc(){return N({queryKey:J.launchKey,queryFn:({signal:e})=>aa({signal:e}),staleTime:1/0})}function Qc(){return N({queryKey:J.repo,queryFn:({signal:e})=>Ca({signal:e})})}function $c(){return N({queryKey:J.repoChanges,queryFn:({signal:e})=>Oa({signal:e}),retry:!1})}function el(e){return N({queryKey:J.repoCommit(e??``),queryFn:({signal:t})=>ka(e,{signal:t}),enabled:!!e,retry:!1})}function tl(){return N({queryKey:J.config,queryFn:({signal:e})=>wa({signal:e})})}function nl(){return N({queryKey:J.worktrees,queryFn:({signal:e})=>ss({signal:e})})}function rl(){return N({queryKey:J.uiState,queryFn:({signal:e})=>ha({signal:e})})}function il(){return N({queryKey:J.agentConfig,queryFn:({signal:e})=>Ta({signal:e})})}function al(e){return N({queryKey:J.agentConfigFile(e??``),queryFn:({signal:t})=>Ea(e,{signal:t}),enabled:e!==null})}function ol(e){let t=M(),n=J.agentConfig,r=J.agentConfigFile(e);return P({mutationFn:t=>Da(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function sl(){return N({queryKey:Y.uiState,queryFn:({signal:e})=>Go({signal:e})})}function cl(){return N({queryKey:Y.config,queryFn:({signal:e})=>qo({signal:e})})}function ll(){return N({queryKey:Y.agentProfiles,queryFn:({signal:e})=>Jo({signal:e})})}function ul(e,t=!0){return N({queryKey:Y.skillsUpdate(e),queryFn:({signal:t})=>ns(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return t===void 0||t===`idle`||t===`checking`||t===`updating`?6e4:!1}})}function dl(e){let t=M();return P({mutationFn:t=>go(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function fl(e){e.invalidateQueries({queryKey:Y.runsIndex})}function pl(){let e=M();return P({mutationFn:e=>co(e),onMutate:async t=>{await e.cancelQueries({queryKey:J.runs.list()}),await e.cancelQueries({queryKey:J.runs.detail(t)});let n=e.getQueryData(J.runs.list()),r=e.getQueryData(J.runs.detail(t)),i=new Date().toISOString();return e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t?{...e,seenAt:i}:e)),e.setQueryData(J.runs.detail(t),e=>e&&{...e,seenAt:i}),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(J.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(J.runs.detail(n),r.prevDetail)},onSuccess:t=>{let n=e=>e.id===t.id?{...e,seenAt:t.seenAt}:e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),fl(e)}})}function ml(){let e=M();return P({mutationFn:e=>lo(e),onMutate:async t=>{await e.cancelQueries({queryKey:J.runs.list()}),await e.cancelQueries({queryKey:J.runs.detail(t)});let n=e.getQueryData(J.runs.list()),r=e.getQueryData(J.runs.detail(t));return e.setQueryData(J.runs.list(),e=>e?.map(e=>e.id===t?hl(e):e)),e.setQueryData(J.runs.detail(t),e=>e&&hl(e)),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(J.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(J.runs.detail(n),r.prevDetail)},onSuccess:t=>{let n=e=>e.id===t.id?hl(e):e;e.setQueryData(J.runs.list(),e=>e?.map(n)),e.setQueryData(J.runs.detail(t.id),e=>e?n(e):t),fl(e)}})}function hl(e){let{seenAt:t,...n}=e;return n}function gl(e,t){let n=M();return P({mutationFn:({id:t,pinned:n})=>e===void 0?no(t,n):ro(e,t,n),onSuccess:()=>n.invalidateQueries({queryKey:t===void 0?J.runs.all:[t,`runs`]})})}function _l(e,t){let n=M();return P({mutationFn:n=>t===void 0?Oo(e,n):ko(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all}),onError:e=>{e instanceof U&&e.status===409&&n.invalidateQueries({queryKey:J.runs.all})}})}function vl(e,t){let n=M();return P({mutationFn:(n={})=>t===void 0?po(e,n):mo(t,e,n),onSuccess:()=>n.invalidateQueries({queryKey:J.runs.all})})}function yl(e){let t=M();return P({mutationFn:({msgId:t,message:n})=>Ao(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function bl(e){let t=M();return P({mutationFn:t=>jo(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function xl(e={},t=!0){return N({queryKey:J.github(e),queryFn:({signal:t})=>Ma({limit:e.limit},{signal:t}),enabled:t})}function Sl(e,t=!0){return N({queryKey:J.githubChecks(e),queryFn:({signal:t})=>Na(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function Cl(e,t,n=!0){return N({queryKey:J.githubSearch(e,t),queryFn:({signal:n})=>Pa(e,t,{},{signal:n}),enabled:n&&t.trim()!==``,staleTime:6e4})}var wl=100;function Tl(e){return[...e].sort((e,t)=>t-e).slice(0,wl).sort((e,t)=>e-t)}var X=new Map(jl()),El=1e3;function Dl(e,t){if(X.get(e)!==t){for(X.delete(e),X.set(e,t);X.size>El;){let e=X.keys().next().value;if(e===void 0)break;X.delete(e)}Pl()}}var Z=new Set(Ml());function Ol(e,t){if(Z.has(e)!==t){if(t)for(Z.add(e);Z.size>El;){let e=Z.values().next().value;if(e===void 0)break;Z.delete(e)}else Z.delete(e);Pl()}}var kl=`xez.reference-statuses.v1`,Al=`xez.reference-conflicts.v1`;function jl(){try{let e=globalThis.sessionStorage?.getItem(kl);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`&&gs(e[1])):[]}catch{return[]}}function Ml(){try{let e=globalThis.sessionStorage?.getItem(Al);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}var Nl;function Pl(){Nl===void 0&&(Nl=setTimeout(()=>{Nl=void 0;try{globalThis.sessionStorage?.setItem(kl,JSON.stringify([...X])),globalThis.sessionStorage?.setItem(Al,JSON.stringify([...Z]))}catch{}},250))}function Fl(){let e=fs(),t=Mc();return e.projectId??t.data?.bootProject}function Il(e){for(let[t,n]of Object.entries(e)){for(let[e,r]of Object.entries(n.prs))Dl(zl({projectId:t,kind:`PR`,number:Number(e)}),r);for(let[e,r]of Object.entries(n.issues))Dl(zl({projectId:t,kind:`Issue`,number:Number(e)}),r)}}var Ll=5*6e4;function Rl(e){return e?e.recheckAfterMs:Ll}var zl=e=>`${e.projectId}\u0000${e.kind}#${e.number}`;function Bl(e,t=!0){let n=(0,A.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.projectId)??{prs:new Set,issues:new Set};e[n.kind===`PR`?`prs`:`issues`].add(n.number),t.set(n.projectId,e)}return[...t.entries()].map(([e,t])=>({projectId:e,prs:Tl(t.prs),issues:Tl(t.issues)}))},[e.map(zl).sort().join(`|`)]),r=Tt({queries:n.map(e=>({queryKey:J.githubRefStatus(e.projectId,e.prs,e.issues),queryFn:({signal:t})=>Fa(e.projectId,{prs:e.prs,issues:e.issues},{signal:t}),enabled:t&&e.prs.length+e.issues.length>0,staleTime:e=>Rl(e.state.data)??1/0,refetchInterval:e=>Rl(e.state.data)??!1,refetchOnWindowFocus:!0}))}),i=(0,A.useMemo)(()=>{let e=new Map;return r.forEach((t,r)=>{let i=n[r];if(!i)return;let a=[...i.prs.map(e=>({projectId:i.projectId,kind:`PR`,number:e})),...i.issues.map(e=>({projectId:i.projectId,kind:`Issue`,number:e}))],o=t.data;for(let n of a){let r=zl(n),i=X.get(r),a=Z.has(r)?!0:void 0;if(o?.available){let t=o.prs[n.number]??o.issues[n.number];if(t){let i=o.conflicts?o.conflicts.includes(n.number):void 0;Dl(r,t),i!==void 0&&Ol(r,i),e.set(r,{state:`ready`,status:t,...i??a?{conflicting:!0}:{}})}else e.set(r,{state:`unknown`,...i?{status:i}:{}})}else o?e.set(r,{state:`unavailable`,reason:o.reason,...i?{status:i}:{},...a?{conflicting:!0}:{}}):t.isError?e.set(r,{state:`unavailable`,reason:t.error instanceof Error?t.error.message:void 0,...i?{status:i}:{},...a?{conflicting:!0}:{}}):e.set(r,{state:`loading`,...i?{status:i}:{},...a?{conflicting:!0}:{}})}}),e},[n,r.map(e=>`${e.dataUpdatedAt}:${e.status}`).join(`,`)]);return(0,A.useCallback)(e=>{let t=zl(e),n=i.get(t);if(n)return n;let r=X.get(t);return{state:`idle`,...r?{status:r}:{},...Z.has(t)?{conflicting:!0}:{}}},[i])}function Vl(e,t,n=!0){return N({queryKey:J.githubComments(e,t),queryFn:({signal:n})=>Ia(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function Hl(e){return N({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>za(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}var Ul=d(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Wl=d(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Gl=e(n(),1),Kl=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ql=g,Jl=(e,t)=>n=>{if(t?.variants==null)return ql(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Kl(t)||Kl(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ql(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Yl(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Xl(...e){return t=>{let n=!1,r=e.map(e=>{let r=Yl(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Yl(e[t],null)}}}}function Zl(...e){return A.useCallback(Xl(...e),e)}function Ql(e){let t=A.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];su(r)&&typeof du==`function`&&(r=du(r._payload)),A.Children.forEach(r,e=>{if(au(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;su(n)&&typeof du==`function`&&(n=du(n._payload)),a=nu(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=A.cloneElement(a,void 0,s):!o&&A.Children.count(r)===1&&A.isValidElement(r)&&(a=r);let c=a?iu(a):void 0,l=Zl(n,c);if(!a){if(r||r===0)throw Error(o?uu(e):lu(e));return r}let u=ru(i,a.props??{});return a.type!==A.Fragment&&(u.ref=n?l:c),A.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var $l=Ql(`Slot`),eu=Symbol.for(`radix.slottable`);function tu(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=eu,t}var nu=(e,t)=>{if(`child`in e.props){let t=e.props.child;return A.isValidElement(t)?A.cloneElement(t,void 0,e.props.children(t.props.children)):null}return A.isValidElement(t)?t:null};function ru(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function iu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function au(e){return A.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===eu}var ou=Symbol.for(`react.lazy`);function su(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ou&&`_payload`in e&&cu(e._payload)}function cu(e){return typeof e==`object`&&!!e&&`then`in e}var lu=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,uu=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,du=A.use,fu=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ql(`Primitive.${t}`),r=A.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function pu(e,t){e&&Gl.flushSync(()=>e.dispatchEvent(t))}function mu(e,t=[]){let n=[];function r(t,r){let i=A.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=A.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=A.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>A.createContext(e));return function(n){let r=n?.[e]||t;return A.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,hu(i,...t)]}function hu(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function gu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var _u=globalThis?.document?A.useLayoutEffect:()=>{},vu=A.useInsertionEffect||_u;function yu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=bu({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=A.useRef(e!==void 0);A.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,A.useCallback(t=>{if(s){let n=xu(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function bu({defaultProp:e,onChange:t}){let[n,r]=A.useState(e),i=A.useRef(n),a=A.useRef(t);return vu(()=>{a.current=t},[t]),A.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function xu(e){return typeof e==`function`}function Su(e,t){return A.useReducer((e,n)=>t[e][n]??e,e)}var Cu=e=>{let{present:t,children:n}=e,r=wu(t),i=typeof n==`function`?n({present:r.isPresent}):A.Children.only(n),a=Eu(r.ref,Ou(i));return typeof n==`function`||r.isPresent?A.cloneElement(i,{ref:a}):null};Cu.displayName=`Presence`;function wu(e){let[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),a=A.useRef(`none`),o=A.useRef(void 0),[s,c]=Su(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return A.useEffect(()=>{s===`mounted`?(a.current=o.current??Du(r.current),o.current=void 0):a.current=`none`},[s]),_u(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Du(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),_u(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Du(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Du(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:A.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Du(t)}else r.current=null;n(e)},[])}}function Tu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Eu(...e){let t=A.useRef(e);return t.current=e,A.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Tu(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Tu(n[e],null)}}},[])}function Du(e){return e?.animationName||`none`}function Ou(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ku=A.useId||(()=>void 0),Au=0;function ju(e){let[t,n]=A.useState(ku());return _u(()=>{e||n(e=>e??String(Au++))},[e]),e||(t?`radix-${t}`:``)}function Mu(e){let t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Nu=`DismissableLayer`,Pu=`dismissableLayer.update`,Fu=`dismissableLayer.pointerDownOutside`,Iu=`dismissableLayer.focusOutside`,Lu,Ru=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zu=A.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=A.useContext(Ru),[d,f]=A.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=A.useState({}),h=Zl(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=A.useRef(!1),ee=Wu(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:A.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),C=Gu(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),w=d?y===g.length-1:!1,te=Mu(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return A.useEffect(()=>{if(w)return p.addEventListener(`keydown`,te,{capture:!0}),()=>p.removeEventListener(`keydown`,te,{capture:!0})},[p,w,te]),A.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Lu=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ku(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Lu))}},[d,p,n,u]),A.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ku())},[d,u]),A.useEffect(()=>{let e=()=>m({});return document.addEventListener(Pu,e),()=>document.removeEventListener(Pu,e)},[]),(0,j.jsx)(fu.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:gu(e.onFocusCapture,C.onFocusCapture),onBlurCapture:gu(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:gu(e.onPointerDownCapture,ee.onPointerDownCapture)})});zu.displayName=Nu;var Bu=`DismissableLayerBranch`,Vu=A.forwardRef((e,t)=>{let n=A.useContext(Ru),r=A.useRef(null),i=Zl(t,r);return A.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,j.jsx)(fu.div,{...e,ref:i})});Vu.displayName=Bu;function Hu(){let e=A.useContext(Ru),[t,n]=A.useState(null);return A.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var Uu=()=>!0;function Wu(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Uu}=t,s=Mu(e),c=A.useRef(!1),l=A.useRef(!1),u=A.useRef(new Map),d=A.useRef(()=>{});return A.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||qu(Fu,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function Gu(e,t=globalThis?.document){let n=Mu(e),r=A.useRef(!1);return A.useEffect(()=>{let e=e=>{e.target&&!r.current&&qu(Iu,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ku(){let e=new CustomEvent(Pu);document.dispatchEvent(e)}function qu(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?pu(i,a):i.dispatchEvent(a)}var Ju=`focusScope.autoFocusOnMount`,Yu=`focusScope.autoFocusOnUnmount`,Xu={bubbles:!1,cancelable:!0},Zu=`FocusScope`,Qu=A.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=A.useState(null),l=Mu(i),u=Mu(a),d=A.useRef(null),f=Zl(t,c),p=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Q(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),A.useEffect(()=>{if(s){ad.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Ju,Xu);s.addEventListener(Ju,l),s.dispatchEvent(t),t.defaultPrevented||($u(cd(td(s)),{select:!0}),document.activeElement===e&&Q(s))}return()=>{s.removeEventListener(Ju,l),setTimeout(()=>{let t=new CustomEvent(Yu,Xu);s.addEventListener(Yu,u),s.dispatchEvent(t),t.defaultPrevented||Q(e??document.body,{select:!0}),s.removeEventListener(Yu,u),ad.remove(p)},0)}}},[s,l,u,p]);let m=A.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ed(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(fu.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Qu.displayName=Zu;function $u(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function ed(e){let t=td(e);return[nd(t,e),nd(t.reverse(),e)]}function td(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nd(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):rd(r,{upTo:t})))return r}function rd(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function id(e){return e instanceof HTMLInputElement&&`select`in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&id(e)&&t&&e.select()}}var ad=od();function od(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=sd(e,t),e.unshift(t)},remove(t){e=sd(e,t),e[0]?.resume()}}}function sd(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cd(e){return e.filter(e=>e.tagName!==`A`)}var ld=`Portal`,ud=A.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=A.useState(!1);_u(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Gl.createPortal((0,j.jsx)(fu.div,{...r,ref:t}),o):null});ud.displayName=ld;var dd=0,fd=null;function pd(){A.useEffect(()=>{fd||={start:md(),end:md()};let{start:e,end:t}=fd;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),dd++,()=>{dd===1&&(fd?.start.remove(),fd?.end.remove(),fd=null),dd=Math.max(0,dd-1)}},[])}function md(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var $=function(){return $=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$.apply(this,arguments)};function hd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gd(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _d=`right-scroll-bar-position`,vd=`width-before-scroll-bar`,yd=`with-scroll-bars-hidden`,bd=`--removed-body-scroll-bar-size`;function xd(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Sd(e,t){var n=(0,A.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Cd=typeof window<`u`?A.useLayoutEffect:A.useEffect,wd=new WeakMap;function Td(e,t){var n=Sd(t||null,function(t){return e.forEach(function(e){return xd(e,t)})});return Cd(function(){var t=wd.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xd(e,null)}),i.forEach(function(e){r.has(e)||xd(e,a)})}wd.set(n,e)},[e]),n}function Ed(e){return e}function Dd(e,t){t===void 0&&(t=Ed);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Od(e){e===void 0&&(e={});var t=Dd(null);return t.options=$({async:!0,ssr:!1},e),t}var kd=function(e){var t=e.sideCar,n=hd(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return A.createElement(r,$({},n))};kd.isSideCarExport=!0;function Ad(e,t){return e.useMedium(t),kd}var jd=Od(),Md=function(){},Nd=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:Md,onWheelCapture:Md,onTouchMoveCapture:Md}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=hd(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Td([n,t]),ee=$($({},b),i);return A.createElement(A.Fragment,null,u&&A.createElement(x,{sideCar:jd,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?A.cloneElement(A.Children.only(s),$($({},ee),{ref:S})):A.createElement(v,$({},ee,{className:c,ref:S}),s))});Nd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Nd.classNames={fullWidth:vd,zeroRight:_d};var Pd,Fd=function(){if(Pd)return Pd;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Id(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Fd();return t&&e.setAttribute(`nonce`,t),e}function Ld(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rd(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var zd=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Id())&&(Ld(t,n),Rd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bd=function(){var e=zd();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vd=function(){var e=Bd();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Hd={left:0,top:0,right:0,gap:0},Ud=function(e){return parseInt(e||``,10)||0},Wd=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ud(n),Ud(r),Ud(i)]},Gd=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Hd;var t=Wd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Kd=Vd(),qd=`data-scroll-locked`,Jd=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4
4
  .${yd} {
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils--z9hRtl3.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,_ as i,b as a,g as o,h as s,v as c,x as l,y as u}from"./centered-state-B_V_Ai2h.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:c,...u}=e,[m,h]=i({prop:r,defaultProp:a??!1,onChange:c,caller:p});return(0,f.jsx)(g,{scope:n,disabled:o,contentId:s(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(l.div,{"data-state":w(m),"data-disabled":o?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(l.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:u(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(o,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:a,...o}=e,s=_(x,n),[u,p]=d.useState(i),m=d.useRef(null),h=r(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=s.open||u,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),c(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[s.open,i]),(0,f.jsx)(l.div,{"data-state":w(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!S,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&a})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,_ as i,b as a,g as o,h as s,v as c,x as l,y as u}from"./centered-state-Djgly6Ni.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:c,...u}=e,[m,h]=i({prop:r,defaultProp:a??!1,onChange:c,caller:p});return(0,f.jsx)(g,{scope:n,disabled:o,contentId:s(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(l.div,{"data-state":w(m),"data-disabled":o?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(l.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:u(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(o,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:a,...o}=e,s=_(x,n),[u,p]=d.useState(i),m=d.useRef(null),h=r(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=s.open||u,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),c(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[s.open,i]),(0,f.jsx)(l.div,{"data-state":w(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!S,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&a})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};