@tapflowio/relay 0.27.1 → 0.28.1

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 (250) hide show
  1. package/dist/RelayServer.d.ts +54 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +384 -37
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/SessionManager.d.ts +63 -2
  6. package/dist/SessionManager.d.ts.map +1 -1
  7. package/dist/SessionManager.js +123 -1
  8. package/dist/SessionManager.js.map +1 -1
  9. package/dist/api/apps.d.ts +2 -1
  10. package/dist/api/apps.d.ts.map +1 -1
  11. package/dist/api/apps.js +20 -7
  12. package/dist/api/apps.js.map +1 -1
  13. package/dist/api/builds.d.ts +2 -1
  14. package/dist/api/builds.d.ts.map +1 -1
  15. package/dist/api/builds.js +13 -39
  16. package/dist/api/builds.js.map +1 -1
  17. package/dist/api/profile.d.ts.map +1 -1
  18. package/dist/api/profile.js +3 -1
  19. package/dist/api/profile.js.map +1 -1
  20. package/dist/api/runVideos.d.ts +85 -0
  21. package/dist/api/runVideos.d.ts.map +1 -0
  22. package/dist/api/runVideos.js +494 -0
  23. package/dist/api/runVideos.js.map +1 -0
  24. package/dist/api/runs.d.ts +77 -0
  25. package/dist/api/runs.d.ts.map +1 -0
  26. package/dist/api/runs.js +579 -0
  27. package/dist/api/runs.js.map +1 -0
  28. package/dist/api/settings.d.ts +1 -1
  29. package/dist/api/settings.d.ts.map +1 -1
  30. package/dist/api/settings.js +43 -3
  31. package/dist/api/settings.js.map +1 -1
  32. package/dist/db.d.ts +2 -0
  33. package/dist/db.d.ts.map +1 -1
  34. package/dist/db.js +4 -0
  35. package/dist/db.js.map +1 -1
  36. package/dist/lib/buildDeletion.d.ts +21 -0
  37. package/dist/lib/buildDeletion.d.ts.map +1 -0
  38. package/dist/lib/buildDeletion.js +58 -0
  39. package/dist/lib/buildDeletion.js.map +1 -0
  40. package/dist/lib/watchActions.d.ts +10 -0
  41. package/dist/lib/watchActions.d.ts.map +1 -0
  42. package/dist/lib/watchActions.js +27 -0
  43. package/dist/lib/watchActions.js.map +1 -0
  44. package/dist/middleware/auth.d.ts +1 -0
  45. package/dist/middleware/auth.d.ts.map +1 -1
  46. package/dist/middleware/auth.js +1 -1
  47. package/dist/middleware/auth.js.map +1 -1
  48. package/dist/migrations/015_flow_runs.sql +59 -0
  49. package/dist/migrations/016_flow_run_videos.sql +51 -0
  50. package/dist/router.d.ts +5 -0
  51. package/dist/router.d.ts.map +1 -1
  52. package/dist/router.js +24 -0
  53. package/dist/router.js.map +1 -1
  54. package/package.json +9 -9
  55. package/public/assets/AISessionWatch-C2h4NZ_I.js +31 -0
  56. package/public/assets/AISessionWatch-C2h4NZ_I.js.br +0 -0
  57. package/public/assets/AISessionWatch-C2h4NZ_I.js.gz +0 -0
  58. package/public/assets/AndroidDeviceScreen-C55msKfh.js +35 -0
  59. package/public/assets/AndroidDeviceScreen-C55msKfh.js.br +0 -0
  60. package/public/assets/AndroidDeviceScreen-C55msKfh.js.gz +0 -0
  61. package/public/assets/AppCenter-S1y-8_7l.js +26 -0
  62. package/public/assets/AppCenter-S1y-8_7l.js.br +0 -0
  63. package/public/assets/AppCenter-S1y-8_7l.js.gz +0 -0
  64. package/public/assets/Default-C-l1O-g9.js +6 -0
  65. package/public/assets/Default-C-l1O-g9.js.br +0 -0
  66. package/public/assets/Default-C-l1O-g9.js.gz +0 -0
  67. package/public/assets/Invite-BCndVxaO.js +1 -0
  68. package/public/assets/Invite-BCndVxaO.js.br +0 -0
  69. package/public/assets/Invite-BCndVxaO.js.gz +0 -0
  70. package/public/assets/MacResources-41cFDgE1.js +1 -0
  71. package/public/assets/MacResources-41cFDgE1.js.br +0 -0
  72. package/public/assets/MacResources-41cFDgE1.js.gz +0 -0
  73. package/public/assets/{NotFound-wHOnT2Fl.js → NotFound-DVq_rCKc.js} +1 -1
  74. package/public/assets/NotFound-DVq_rCKc.js.br +0 -0
  75. package/public/assets/NotFound-DVq_rCKc.js.gz +0 -0
  76. package/public/assets/QASession-B67RsIPm.js +81 -0
  77. package/public/assets/QASession-B67RsIPm.js.br +0 -0
  78. package/public/assets/QASession-B67RsIPm.js.gz +0 -0
  79. package/public/assets/ResetPassword-8rj7ASt1.js +1 -0
  80. package/public/assets/ResetPassword-8rj7ASt1.js.br +0 -0
  81. package/public/assets/ResetPassword-8rj7ASt1.js.gz +0 -0
  82. package/public/assets/RunDetail-BIgq9gJ0.js +16 -0
  83. package/public/assets/RunDetail-BIgq9gJ0.js.br +0 -0
  84. package/public/assets/RunDetail-BIgq9gJ0.js.gz +0 -0
  85. package/public/assets/Runs-DpK5aoBr.js +6 -0
  86. package/public/assets/Runs-DpK5aoBr.js.br +0 -0
  87. package/public/assets/Runs-DpK5aoBr.js.gz +0 -0
  88. package/public/assets/Setup-DZrhA_7b.js +1 -0
  89. package/public/assets/Setup-DZrhA_7b.js.br +0 -0
  90. package/public/assets/Setup-DZrhA_7b.js.gz +0 -0
  91. package/public/assets/Team-CJThCjd3.js +6 -0
  92. package/public/assets/Team-CJThCjd3.js.br +0 -0
  93. package/public/assets/Team-CJThCjd3.js.gz +0 -0
  94. package/public/assets/Tokens-DGURtHWi.js +1 -0
  95. package/public/assets/Tokens-DGURtHWi.js.br +0 -0
  96. package/public/assets/Tokens-DGURtHWi.js.gz +0 -0
  97. package/public/assets/WatchedDevice-CpaKHa1x.js +1 -0
  98. package/public/assets/WatchedDevice-CpaKHa1x.js.br +0 -0
  99. package/public/assets/WatchedDevice-CpaKHa1x.js.gz +0 -0
  100. package/public/assets/aiSession-BW09Jhqz.js +26 -0
  101. package/public/assets/aiSession-BW09Jhqz.js.br +0 -0
  102. package/public/assets/aiSession-BW09Jhqz.js.gz +0 -0
  103. package/public/assets/alert-dialog-t5vlOabq.js +1 -0
  104. package/public/assets/alert-dialog-t5vlOabq.js.br +0 -0
  105. package/public/assets/alert-dialog-t5vlOabq.js.gz +0 -0
  106. package/public/assets/{badge-DNaS0Mu3.js → badge-DrDCTAQQ.js} +1 -1
  107. package/public/assets/badge-DrDCTAQQ.js.br +0 -0
  108. package/public/assets/badge-DrDCTAQQ.js.gz +0 -0
  109. package/public/assets/build-format-ofd2iIzf.js +1 -0
  110. package/public/assets/build-format-ofd2iIzf.js.br +0 -0
  111. package/public/assets/build-format-ofd2iIzf.js.gz +0 -0
  112. package/public/assets/dialog-BOFZkCES.js +1 -0
  113. package/public/assets/dialog-BOFZkCES.js.br +0 -0
  114. package/public/assets/dialog-BOFZkCES.js.gz +0 -0
  115. package/public/assets/field-hint-B9fPUgi7.js +1 -0
  116. package/public/assets/field-hint-B9fPUgi7.js.br +0 -0
  117. package/public/assets/field-hint-B9fPUgi7.js.gz +0 -0
  118. package/public/assets/index-Bixhy5MB.js +248 -0
  119. package/public/assets/index-Bixhy5MB.js.br +0 -0
  120. package/public/assets/index-Bixhy5MB.js.gz +0 -0
  121. package/public/assets/index-D17hSi50.js +1 -0
  122. package/public/assets/index-D17hSi50.js.br +0 -0
  123. package/public/assets/index-D17hSi50.js.gz +0 -0
  124. package/public/assets/index-h2hiZ2OM.css +1 -0
  125. package/public/assets/index-h2hiZ2OM.css.br +0 -0
  126. package/public/assets/index-h2hiZ2OM.css.gz +0 -0
  127. package/public/assets/list-view-BpOY1e-d.js +1 -0
  128. package/public/assets/list-view-BpOY1e-d.js.br +0 -0
  129. package/public/assets/list-view-BpOY1e-d.js.gz +0 -0
  130. package/public/assets/{pencil-BN18R4oa.js → pencil-ZlrAsWuU.js} +2 -2
  131. package/public/assets/pencil-ZlrAsWuU.js.br +0 -0
  132. package/public/assets/pencil-ZlrAsWuU.js.gz +0 -0
  133. package/public/assets/play-4CsGZdQU.js +6 -0
  134. package/public/assets/play-4CsGZdQU.js.br +0 -0
  135. package/public/assets/play-4CsGZdQU.js.gz +0 -0
  136. package/public/assets/resource-health-oWJ8hy9X.js +1 -0
  137. package/public/assets/resource-health-oWJ8hy9X.js.br +0 -0
  138. package/public/assets/resource-health-oWJ8hy9X.js.gz +0 -0
  139. package/public/assets/runs-CInQb6v1.js +1 -0
  140. package/public/assets/runs-CInQb6v1.js.br +0 -0
  141. package/public/assets/runs-CInQb6v1.js.gz +0 -0
  142. package/public/assets/search-input-G_QpBvPM.js +6 -0
  143. package/public/assets/search-input-G_QpBvPM.js.br +0 -0
  144. package/public/assets/search-input-G_QpBvPM.js.gz +0 -0
  145. package/public/assets/select-DDzv2YfY.js +11 -0
  146. package/public/assets/select-DDzv2YfY.js.br +0 -0
  147. package/public/assets/select-DDzv2YfY.js.gz +0 -0
  148. package/public/assets/slider-DE7lQdK4.js +1 -0
  149. package/public/assets/slider-DE7lQdK4.js.br +0 -0
  150. package/public/assets/slider-DE7lQdK4.js.gz +0 -0
  151. package/public/assets/tabs-Co1N3x_X.js +1 -0
  152. package/public/assets/tabs-Co1N3x_X.js.br +0 -0
  153. package/public/assets/tabs-Co1N3x_X.js.gz +0 -0
  154. package/public/assets/tech-label-BMvuJmUf.js +1 -0
  155. package/public/assets/tech-label-BMvuJmUf.js.br +0 -0
  156. package/public/assets/tech-label-BMvuJmUf.js.gz +0 -0
  157. package/public/assets/{trash-D1l1Fm-Z.js → trash-Cwj2dbgB.js} +3 -3
  158. package/public/assets/trash-Cwj2dbgB.js.br +0 -0
  159. package/public/assets/trash-Cwj2dbgB.js.gz +0 -0
  160. package/public/assets/{useFocusAfterSwap-BY3N9f9v.js → useFocusAfterSwap-BdItkQCu.js} +1 -1
  161. package/public/assets/useFocusAfterSwap-BdItkQCu.js.br +0 -0
  162. package/public/assets/useFocusAfterSwap-BdItkQCu.js.gz +0 -0
  163. package/public/assets/useRelay-CES3I1Mt.js +1 -0
  164. package/public/assets/useRelay-CES3I1Mt.js.br +0 -0
  165. package/public/assets/useRelay-CES3I1Mt.js.gz +0 -0
  166. package/public/assets/useShownAfter-By1Yxysz.js +1 -0
  167. package/public/assets/useShownAfter-By1Yxysz.js.br +0 -0
  168. package/public/assets/useShownAfter-By1Yxysz.js.gz +0 -0
  169. package/public/assets/{vendor-charts-BykzUV2D.js → vendor-charts-BE7R_8yA.js} +2 -2
  170. package/public/assets/vendor-charts-BE7R_8yA.js.br +0 -0
  171. package/public/assets/vendor-charts-BE7R_8yA.js.gz +0 -0
  172. package/public/assets/{vendor-react-BlPSzrEe.js → vendor-react-DTSdA8m-.js} +4 -4
  173. package/public/assets/vendor-react-DTSdA8m-.js.br +0 -0
  174. package/public/assets/{vendor-react-BlPSzrEe.js.gz → vendor-react-DTSdA8m-.js.gz} +0 -0
  175. package/public/assets/{vendor-router-B_lVHrKl.js → vendor-router-B1pQim9Z.js} +3 -3
  176. package/public/assets/vendor-router-B1pQim9Z.js.br +0 -0
  177. package/public/assets/vendor-router-B1pQim9Z.js.gz +0 -0
  178. package/public/assets/video-swsaHrfi.js +6 -0
  179. package/public/assets/video-swsaHrfi.js.br +0 -0
  180. package/public/assets/video-swsaHrfi.js.gz +0 -0
  181. package/public/index.html +30 -4
  182. package/public/index.html.br +0 -0
  183. package/public/index.html.gz +0 -0
  184. package/public/og-image.jpg +0 -0
  185. package/public/assets/AppCenter-CeLjUbnR.js +0 -26
  186. package/public/assets/AppCenter-CeLjUbnR.js.br +0 -0
  187. package/public/assets/AppCenter-CeLjUbnR.js.gz +0 -0
  188. package/public/assets/Default-UB0Pa3lN.js +0 -1
  189. package/public/assets/Default-UB0Pa3lN.js.br +0 -0
  190. package/public/assets/Default-UB0Pa3lN.js.gz +0 -0
  191. package/public/assets/Invite-Dv3omu3x.js +0 -1
  192. package/public/assets/Invite-Dv3omu3x.js.br +0 -0
  193. package/public/assets/Invite-Dv3omu3x.js.gz +0 -0
  194. package/public/assets/MacResources-CY4-OdGt.js +0 -1
  195. package/public/assets/MacResources-CY4-OdGt.js.br +0 -0
  196. package/public/assets/MacResources-CY4-OdGt.js.gz +0 -0
  197. package/public/assets/NotFound-wHOnT2Fl.js.br +0 -0
  198. package/public/assets/NotFound-wHOnT2Fl.js.gz +0 -0
  199. package/public/assets/QASession-H5eRSwZv.js +0 -150
  200. package/public/assets/QASession-H5eRSwZv.js.br +0 -0
  201. package/public/assets/QASession-H5eRSwZv.js.gz +0 -0
  202. package/public/assets/ResetPassword-nFTigYt2.js +0 -1
  203. package/public/assets/ResetPassword-nFTigYt2.js.br +0 -0
  204. package/public/assets/ResetPassword-nFTigYt2.js.gz +0 -0
  205. package/public/assets/Setup-UmLtF2PF.js +0 -1
  206. package/public/assets/Setup-UmLtF2PF.js.br +0 -0
  207. package/public/assets/Setup-UmLtF2PF.js.gz +0 -0
  208. package/public/assets/Team-DW40kt3H.js +0 -6
  209. package/public/assets/Team-DW40kt3H.js.br +0 -0
  210. package/public/assets/Team-DW40kt3H.js.gz +0 -0
  211. package/public/assets/Tokens-B1a4ChJK.js +0 -1
  212. package/public/assets/Tokens-B1a4ChJK.js.br +0 -0
  213. package/public/assets/Tokens-B1a4ChJK.js.gz +0 -0
  214. package/public/assets/alert-dialog-aoqYdAwx.js +0 -1
  215. package/public/assets/alert-dialog-aoqYdAwx.js.br +0 -0
  216. package/public/assets/alert-dialog-aoqYdAwx.js.gz +0 -0
  217. package/public/assets/badge-DNaS0Mu3.js.br +0 -0
  218. package/public/assets/badge-DNaS0Mu3.js.gz +0 -0
  219. package/public/assets/build-format-DF5aFcag.js +0 -11
  220. package/public/assets/build-format-DF5aFcag.js.br +0 -0
  221. package/public/assets/build-format-DF5aFcag.js.gz +0 -0
  222. package/public/assets/dialog-DE2WUMuX.js +0 -11
  223. package/public/assets/dialog-DE2WUMuX.js.br +0 -0
  224. package/public/assets/dialog-DE2WUMuX.js.gz +0 -0
  225. package/public/assets/field-hint-Csb40Gzp.js +0 -1
  226. package/public/assets/field-hint-Csb40Gzp.js.br +0 -2
  227. package/public/assets/field-hint-Csb40Gzp.js.gz +0 -0
  228. package/public/assets/index-BbCkTtjO.css +0 -1
  229. package/public/assets/index-BbCkTtjO.css.br +0 -0
  230. package/public/assets/index-BbCkTtjO.css.gz +0 -0
  231. package/public/assets/index-DSW9h8XX.js +0 -218
  232. package/public/assets/index-DSW9h8XX.js.br +0 -0
  233. package/public/assets/index-DSW9h8XX.js.gz +0 -0
  234. package/public/assets/list-view-C0w97ltJ.js +0 -1
  235. package/public/assets/list-view-C0w97ltJ.js.br +0 -0
  236. package/public/assets/list-view-C0w97ltJ.js.gz +0 -0
  237. package/public/assets/pencil-BN18R4oa.js.br +0 -0
  238. package/public/assets/pencil-BN18R4oa.js.gz +0 -0
  239. package/public/assets/resource-health-Bi20EUDs.js +0 -1
  240. package/public/assets/resource-health-Bi20EUDs.js.br +0 -0
  241. package/public/assets/resource-health-Bi20EUDs.js.gz +0 -0
  242. package/public/assets/trash-D1l1Fm-Z.js.br +0 -0
  243. package/public/assets/trash-D1l1Fm-Z.js.gz +0 -0
  244. package/public/assets/useFocusAfterSwap-BY3N9f9v.js.br +0 -0
  245. package/public/assets/useFocusAfterSwap-BY3N9f9v.js.gz +0 -0
  246. package/public/assets/vendor-charts-BykzUV2D.js.br +0 -0
  247. package/public/assets/vendor-charts-BykzUV2D.js.gz +0 -0
  248. package/public/assets/vendor-react-BlPSzrEe.js.br +0 -0
  249. package/public/assets/vendor-router-B_lVHrKl.js.br +0 -0
  250. package/public/assets/vendor-router-B_lVHrKl.js.gz +0 -0
@@ -1,4 +1,4 @@
1
- import{k as i}from"./vendor-react-BlPSzrEe.js";/**
1
+ import{r as i}from"./vendor-react-DTSdA8m-.js";/**
2
2
  * react-router v7.18.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
@@ -7,6 +7,6 @@ import{k as i}from"./vendor-react-BlPSzrEe.js";/**
7
7
  * LICENSE.md file in the root directory of this source tree.
8
8
  *
9
9
  * @license MIT
10
- */var oe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pe=/^[\\/]{2}/;function qe(e,t){return t+e.replace(/\\/g,"/")}var ve="popstate";function Re(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Ge(e={}){function t(n,a){var c;let o=(c=a.state)==null?void 0:c.masked,{pathname:l,search:u,hash:s}=o||n.location;return re("",{pathname:l,search:u,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,a){return typeof a=="string"?a:I(a)}return Qe(t,r,null,e)}function E(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function b(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xe(){return Math.random().toString(36).substring(2,10)}function we(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 re(e,t,r=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?A(t):t,state:r,key:t&&t.key||n||Xe(),mask:a}}function I({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function A(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Qe(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,u="POP",s=null,c=f();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function f(){return(l.state||{idx:null}).idx}function h(){u="POP";let p=f(),m=p==null?null:p-c;c=p,s&&s({action:u,location:g.location,delta:m})}function d(p,m){u="PUSH";let R=Re(p)?p:re(g.location,p,m);c=f()+1;let w=we(R,c),C=g.createHref(R.mask||R);try{l.pushState(w,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;a.location.assign(C)}o&&s&&s({action:u,location:g.location,delta:1})}function y(p,m){u="REPLACE";let R=Re(p)?p:re(g.location,p,m);c=f();let w=we(R,c),C=g.createHref(R.mask||R);l.replaceState(w,"",C),o&&s&&s({action:u,location:g.location,delta:0})}function v(p){return Ze(a,p)}let g={get action(){return u},get location(){return e(a,l)},listen(p){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(ve,h),s=p,()=>{a.removeEventListener(ve,h),s=null}},createHref(p){return t(a,p)},createURL:v,encodeLocation(p){let m=v(p);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:y,go(p){return l.go(p)}};return g}function Ze(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),E(n,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:I(t);return a=a.replace(/ $/,"%20"),!r&&Pe.test(a)&&(a=n+a),new URL(a,n)}function Le(e,t,r="/"){return et(e,t,r,!1)}function et(e,t,r,n,a){let o=typeof t=="string"?A(t):t,l=T(o.pathname||"/",r);if(l==null)return null;let u=tt(e),s=null,c=ht(l);for(let f=0;s==null&&f<u.length;++f)s=ft(u[f],c,n);return s}function tt(e){let t=ke(e);return rt(t),t}function ke(e,t=[],r=[],n="",a=!1){let o=(l,u,s=a,c)=>{let f={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(n)&&s)return;E(f.relativePath.startsWith(n),`Absolute route path "${f.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(n.length)}let h=P([n,f.relativePath]),d=r.concat(f);l.children&&l.children.length>0&&(E(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),ke(l.children,t,d,h,s)),!(l.path==null&&!l.index)&&t.push({path:h,score:ut(h,l.index),routesMeta:d.map((y,v)=>{let[g,p]=Ne(y.relativePath,y.caseSensitive,v===d.length-1);return{...y,matcher:g,compiledParams:p}})})};return e.forEach((l,u)=>{var s;if(l.path===""||!((s=l.path)!=null&&s.includes("?")))o(l,u);else for(let c of $e(l.path))o(l,u,!0,c)}),t}function $e(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=$e(n.join("/")),u=[];return u.push(...l.map(s=>s===""?o:[o,s].join("/"))),a&&u.push(...l),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function rt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ct(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var nt=/^:[\w-]+$/,at=3,ot=2,lt=1,it=10,st=-2,Ee=e=>e==="*";function ut(e,t){let r=e.split("/"),n=r.length;return r.some(Ee)&&(n+=st),t&&(n+=ot),r.filter(a=>!Ee(a)).reduce((a,o)=>a+(nt.test(o)?at:o===""?lt:it),n)}function ct(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ft(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let u=0;u<n.length;++u){let s=n[u],c=u===n.length-1,f=o==="/"?t:t.slice(o.length)||"/",h={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Te(h,f,s.matcher,s.compiledParams):J(h,f),y=s.route;if(!d&&c&&r&&!n[n.length-1].route.index&&(d=J({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!d)return null;Object.assign(a,d.params),l.push({params:a,pathname:P([o,d.pathname]),pathnameBase:pt(P([o,d.pathnameBase])),route:y}),d.pathnameBase!=="/"&&(o=P([o,d.pathnameBase]))}return l}function J(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ne(e.path,e.caseSensitive,e.end);return Te(e,t,r,n)}function Te(e,t,r,n){let a=t.match(r);if(!a)return null;let o=a[0],l=U(o,1),u=a.slice(1);return{params:n.reduce((c,{paramName:f,isOptional:h},d)=>{if(f==="*"){let v=u[d]||"";l=U(o.slice(0,o.length-v.length),1)}const y=u[d];return h&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function Ne(e,t=!1,r=!0){b(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,s,c,f)=>{if(n.push({paramName:u,isOptional:s!=null}),s){let h=f.charAt(c+l.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function ht(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return b(!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 T(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function dt(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?A(e):e,o;return r?(r=Fe(r),r.startsWith("/")||r.startsWith("\\")?o=xe(r.substring(1),"/"):o=xe(r,t)):o=t,{pathname:o,search:gt(n),hash:yt(a)}}function xe(e,t){let r=U(t).split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Q(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function le(e){let t=mt(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function K(e,t,r,n=!1){let a;typeof e=="string"?a=A(e):(a={...e},E(!a.pathname||!a.pathname.includes("?"),Q("?","pathname","search",a)),E(!a.pathname||!a.pathname.includes("#"),Q("#","pathname","hash",a)),E(!a.search||!a.search.includes("#"),Q("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,u;if(l==null)u=r;else{let h=t.length-1;if(!n&&l.startsWith("..")){let d=l.split("/");for(;d[0]==="..";)d.shift(),h-=1;a.pathname=d.join("/")}u=h>=0?t[h]:"/"}let s=dt(a,u),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(c||f)&&(s.pathname+="/"),s}var Fe=e=>e.replace(/[\\/]{2,}/g,"/"),P=e=>Fe(e.join("/"));function U(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var pt=e=>U(e).replace(/^\/*/,"/"),gt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vt=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Rt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wt(e){let t=e.map(r=>r.route.path).filter(Boolean);return P(t)||"/"}var Ie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function De(e,t){let r=e;if(typeof r!="string"||!oe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(Ie)try{let o=new URL(window.location.href),l=Pe.test(r)?new URL(qe(r,o.protocol)):new URL(r),u=T(l.pathname,t);l.origin===o.origin&&u!=null?r=u+l.search+l.hash:a=!0}catch{b(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ce=new URL("http://localhost");function ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Ce)}catch{return Ce}}function Z(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Et(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function se(e,t,r,n){let a=null;try{a=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),l=a!=null&&!Z(a,r),u=!Z(o,r);if(n==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!Et(e,a)||!Z(a,o)))throw new Error("External navigation is not allowed")}var Ue=["POST","PUT","PATCH","DELETE"];new Set(Ue);var xt=["GET",...Ue];new Set(xt);var Ct=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function St(e){try{return Ct.includes(new URL(e).protocol)}catch{return!1}}var O=i.createContext(null);O.displayName="DataRouter";var Y=i.createContext(null);Y.displayName="DataRouterState";var Ae=i.createContext(!1);function bt(){return i.useContext(Ae)}var Oe=i.createContext({isTransitioning:!1});Oe.displayName="ViewTransition";var Pt=i.createContext(new Map);Pt.displayName="Fetchers";var Lt=i.createContext(null);Lt.displayName="Await";var S=i.createContext(null);S.displayName="Navigation";var W=i.createContext(null);W.displayName="Location";var L=i.createContext({outlet:null,matches:[],isDataRoute:!1});L.displayName="Route";var ue=i.createContext(null);ue.displayName="RouteError";var Me="REACT_ROUTER_ERROR",kt="REDIRECT",$t="ROUTE_ERROR_RESPONSE";function Tt(e){if(e.startsWith(`${Me}:${kt}:{`))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 Nt(e){if(e.startsWith(`${Me}:${$t}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new vt(t.status,t.statusText,t.data)}catch{}}function Ft(e,{relative:t}={}){E(M(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(S),{hash:a,pathname:o,search:l}=H(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:P([r,o])),n.createHref({pathname:u,search:l,hash:a})}function M(){return i.useContext(W)!=null}function k(){return E(M(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(W).location}var _e="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Be(e){i.useContext(S).static||i.useLayoutEffect(e)}function ce(){let{isDataRoute:e}=i.useContext(L);return e?Kt():It()}function It(){E(M(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(O),{basename:t,navigator:r}=i.useContext(S),{matches:n}=i.useContext(L),{pathname:a}=k(),o=JSON.stringify(le(n)),l=i.useRef(!1);return Be(()=>{l.current=!0}),i.useCallback((s,c={})=>{if(b(l.current,_e),!l.current)return;if(typeof s=="number"){r.go(s);return}let f=K(s,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:P([t,f.pathname])),se(typeof s=="string"?s:I(s),r.createHref(f),ie(r),"reject"),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,o,a,e])}var Dt=i.createContext(null);function Ut(e){let t=i.useContext(L).outlet;return i.useMemo(()=>t&&i.createElement(Dt.Provider,{value:e},t),[t,e])}function H(e,{relative:t}={}){let{matches:r}=i.useContext(L),{pathname:n}=k(),a=JSON.stringify(le(r));return i.useMemo(()=>K(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function At(e,t){return We(e,t)}function We(e,t,r){var p;E(M(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=i.useContext(S),{matches:a}=i.useContext(L),o=a[a.length-1],l=o?o.params:{},u=o?o.pathname:"/",s=o?o.pathnameBase:"/",c=o&&o.route;{let m=c&&c.path||"";je(u,!c||m.endsWith("*")||m.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${m}">) 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.
10
+ */var oe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pe=/^[\\/]{2}/;function qe(e,t){return t+e.replace(/\\/g,"/")}var ve="popstate";function Re(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Ge(e={}){function t(n,a){var c;let o=(c=a.state)==null?void 0:c.masked,{pathname:l,search:u,hash:s}=o||n.location;return re("",{pathname:l,search:u,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,a){return typeof a=="string"?a:I(a)}return Qe(t,r,null,e)}function E(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function b(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xe(){return Math.random().toString(36).substring(2,10)}function we(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 re(e,t,r=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?A(t):t,state:r,key:t&&t.key||n||Xe(),mask:a}}function I({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function A(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Qe(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,u="POP",s=null,c=f();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function f(){return(l.state||{idx:null}).idx}function h(){u="POP";let p=f(),m=p==null?null:p-c;c=p,s&&s({action:u,location:g.location,delta:m})}function d(p,m){u="PUSH";let R=Re(p)?p:re(g.location,p,m);c=f()+1;let w=we(R,c),C=g.createHref(R.mask||R);try{l.pushState(w,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;a.location.assign(C)}o&&s&&s({action:u,location:g.location,delta:1})}function y(p,m){u="REPLACE";let R=Re(p)?p:re(g.location,p,m);c=f();let w=we(R,c),C=g.createHref(R.mask||R);l.replaceState(w,"",C),o&&s&&s({action:u,location:g.location,delta:0})}function v(p){return Ze(a,p)}let g={get action(){return u},get location(){return e(a,l)},listen(p){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(ve,h),s=p,()=>{a.removeEventListener(ve,h),s=null}},createHref(p){return t(a,p)},createURL:v,encodeLocation(p){let m=v(p);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:y,go(p){return l.go(p)}};return g}function Ze(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),E(n,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:I(t);return a=a.replace(/ $/,"%20"),!r&&Pe.test(a)&&(a=n+a),new URL(a,n)}function Le(e,t,r="/"){return et(e,t,r,!1)}function et(e,t,r,n,a){let o=typeof t=="string"?A(t):t,l=T(o.pathname||"/",r);if(l==null)return null;let u=tt(e),s=null,c=ht(l);for(let f=0;s==null&&f<u.length;++f)s=ft(u[f],c,n);return s}function tt(e){let t=ke(e);return rt(t),t}function ke(e,t=[],r=[],n="",a=!1){let o=(l,u,s=a,c)=>{let f={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(n)&&s)return;E(f.relativePath.startsWith(n),`Absolute route path "${f.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(n.length)}let h=L([n,f.relativePath]),d=r.concat(f);l.children&&l.children.length>0&&(E(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),ke(l.children,t,d,h,s)),!(l.path==null&&!l.index)&&t.push({path:h,score:ut(h,l.index),routesMeta:d.map((y,v)=>{let[g,p]=Ne(y.relativePath,y.caseSensitive,v===d.length-1);return{...y,matcher:g,compiledParams:p}})})};return e.forEach((l,u)=>{var s;if(l.path===""||!((s=l.path)!=null&&s.includes("?")))o(l,u);else for(let c of $e(l.path))o(l,u,!0,c)}),t}function $e(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=$e(n.join("/")),u=[];return u.push(...l.map(s=>s===""?o:[o,s].join("/"))),a&&u.push(...l),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function rt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ct(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var nt=/^:[\w-]+$/,at=3,ot=2,lt=1,it=10,st=-2,Ee=e=>e==="*";function ut(e,t){let r=e.split("/"),n=r.length;return r.some(Ee)&&(n+=st),t&&(n+=ot),r.filter(a=>!Ee(a)).reduce((a,o)=>a+(nt.test(o)?at:o===""?lt:it),n)}function ct(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ft(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let u=0;u<n.length;++u){let s=n[u],c=u===n.length-1,f=o==="/"?t:t.slice(o.length)||"/",h={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Te(h,f,s.matcher,s.compiledParams):J(h,f),y=s.route;if(!d&&c&&r&&!n[n.length-1].route.index&&(d=J({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!d)return null;Object.assign(a,d.params),l.push({params:a,pathname:L([o,d.pathname]),pathnameBase:pt(L([o,d.pathnameBase])),route:y}),d.pathnameBase!=="/"&&(o=L([o,d.pathnameBase]))}return l}function J(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ne(e.path,e.caseSensitive,e.end);return Te(e,t,r,n)}function Te(e,t,r,n){let a=t.match(r);if(!a)return null;let o=a[0],l=U(o,1),u=a.slice(1);return{params:n.reduce((c,{paramName:f,isOptional:h},d)=>{if(f==="*"){let v=u[d]||"";l=U(o.slice(0,o.length-v.length),1)}const y=u[d];return h&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function Ne(e,t=!1,r=!0){b(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,s,c,f)=>{if(n.push({paramName:u,isOptional:s!=null}),s){let h=f.charAt(c+l.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function ht(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return b(!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 T(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function dt(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?A(e):e,o;return r?(r=Fe(r),r.startsWith("/")||r.startsWith("\\")?o=xe(r.substring(1),"/"):o=xe(r,t)):o=t,{pathname:o,search:gt(n),hash:yt(a)}}function xe(e,t){let r=U(t).split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Q(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function le(e){let t=mt(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function K(e,t,r,n=!1){let a;typeof e=="string"?a=A(e):(a={...e},E(!a.pathname||!a.pathname.includes("?"),Q("?","pathname","search",a)),E(!a.pathname||!a.pathname.includes("#"),Q("#","pathname","hash",a)),E(!a.search||!a.search.includes("#"),Q("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,u;if(l==null)u=r;else{let h=t.length-1;if(!n&&l.startsWith("..")){let d=l.split("/");for(;d[0]==="..";)d.shift(),h-=1;a.pathname=d.join("/")}u=h>=0?t[h]:"/"}let s=dt(a,u),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(c||f)&&(s.pathname+="/"),s}var Fe=e=>e.replace(/[\\/]{2,}/g,"/"),L=e=>Fe(e.join("/"));function U(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var pt=e=>U(e).replace(/^\/*/,"/"),gt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vt=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Rt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wt(e){let t=e.map(r=>r.route.path).filter(Boolean);return L(t)||"/"}var Ie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function De(e,t){let r=e;if(typeof r!="string"||!oe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(Ie)try{let o=new URL(window.location.href),l=Pe.test(r)?new URL(qe(r,o.protocol)):new URL(r),u=T(l.pathname,t);l.origin===o.origin&&u!=null?r=u+l.search+l.hash:a=!0}catch{b(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ce=new URL("http://localhost");function ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Ce)}catch{return Ce}}function Z(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Et(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function se(e,t,r,n){let a=null;try{a=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),l=a!=null&&!Z(a,r),u=!Z(o,r);if(n==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!Et(e,a)||!Z(a,o)))throw new Error("External navigation is not allowed")}var Ue=["POST","PUT","PATCH","DELETE"];new Set(Ue);var xt=["GET",...Ue];new Set(xt);var Ct=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function St(e){try{return Ct.includes(new URL(e).protocol)}catch{return!1}}var O=i.createContext(null);O.displayName="DataRouter";var Y=i.createContext(null);Y.displayName="DataRouterState";var Ae=i.createContext(!1);function bt(){return i.useContext(Ae)}var Oe=i.createContext({isTransitioning:!1});Oe.displayName="ViewTransition";var Pt=i.createContext(new Map);Pt.displayName="Fetchers";var Lt=i.createContext(null);Lt.displayName="Await";var S=i.createContext(null);S.displayName="Navigation";var W=i.createContext(null);W.displayName="Location";var P=i.createContext({outlet:null,matches:[],isDataRoute:!1});P.displayName="Route";var ue=i.createContext(null);ue.displayName="RouteError";var Me="REACT_ROUTER_ERROR",kt="REDIRECT",$t="ROUTE_ERROR_RESPONSE";function Tt(e){if(e.startsWith(`${Me}:${kt}:{`))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 Nt(e){if(e.startsWith(`${Me}:${$t}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new vt(t.status,t.statusText,t.data)}catch{}}function Ft(e,{relative:t}={}){E(M(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(S),{hash:a,pathname:o,search:l}=H(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:L([r,o])),n.createHref({pathname:u,search:l,hash:a})}function M(){return i.useContext(W)!=null}function k(){return E(M(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(W).location}var _e="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Be(e){i.useContext(S).static||i.useLayoutEffect(e)}function ce(){let{isDataRoute:e}=i.useContext(P);return e?Kt():It()}function It(){E(M(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(O),{basename:t,navigator:r}=i.useContext(S),{matches:n}=i.useContext(P),{pathname:a}=k(),o=JSON.stringify(le(n)),l=i.useRef(!1);return Be(()=>{l.current=!0}),i.useCallback((s,c={})=>{if(b(l.current,_e),!l.current)return;if(typeof s=="number"){r.go(s);return}let f=K(s,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:L([t,f.pathname])),se(typeof s=="string"?s:I(s),r.createHref(f),ie(r),"reject"),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,o,a,e])}var Dt=i.createContext(null);function Ut(e){let t=i.useContext(P).outlet;return i.useMemo(()=>t&&i.createElement(Dt.Provider,{value:e},t),[t,e])}function Nr(){let{matches:e}=i.useContext(P),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function H(e,{relative:t}={}){let{matches:r}=i.useContext(P),{pathname:n}=k(),a=JSON.stringify(le(r));return i.useMemo(()=>K(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function At(e,t){return We(e,t)}function We(e,t,r){var p;E(M(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=i.useContext(S),{matches:a}=i.useContext(P),o=a[a.length-1],l=o?o.params:{},u=o?o.pathname:"/",s=o?o.pathnameBase:"/",c=o&&o.route;{let m=c&&c.path||"";je(u,!c||m.endsWith("*")||m.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${m}">) 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.
11
11
 
12
- Please change the parent <Route path="${m}"> to <Route path="${m==="/"?"*":`${m}/*`}">.`)}let f=k(),h;if(t){let m=typeof t=="string"?A(t):t;E(s==="/"||((p=m.pathname)==null?void 0:p.startsWith(s)),`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 "${s}" but pathname "${m.pathname}" was given in the \`location\` prop.`),h=m}else h=f;let d=h.pathname||"/",y=d;if(s!=="/"){let m=s.replace(/^\//,"").split("/");y="/"+d.replace(/^\//,"").split("/").slice(m.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(m=>Object.assign(m,{route:r.manifest[m.route.id]||m.route})):Le(e,{pathname:y});b(c||v!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),b(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 g=Wt(v&&v.map(m=>Object.assign({},m,{params:Object.assign({},l,m.params),pathname:P([s,n.encodeLocation?n.encodeLocation(m.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?s:P([s,n.encodeLocation?n.encodeLocation(m.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),a,r);return t&&g?i.createElement(W.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},g):g}function Ot(){let e=Jt(),t=Rt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,l)}var Mt=i.createElement(Ot,null),He=class extends i.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?e.error:t.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"){const r=Nt(e.digest);r&&(e=r)}let t=e!==void 0?i.createElement(L.Provider,{value:this.props.routeContext},i.createElement(ue.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement(_t,{error:e},t):t}};He.contextType=Ae;var ee=new WeakMap;function _t({children:e,error:t}){let{basename:r,navigator:n}=i.useContext(S);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Tt(t.digest);if(a){let o=ee.get(t);if(o)throw o;let l=De(a.location,r),u=l.absoluteURL||l.to;if(se(a.location,u,ie(n),"allow-explicit"),St(u))throw new Error("Invalid redirect location");if(Ie&&!ee.get(t))if(l.isExternal||a.reloadDocument)window.location.href=u;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw ee.set(t,s),s}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function Bt({routeContext:e,match:t,children:r}){let n=i.useContext(O);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(L.Provider,{value:e},r)}function Wt(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let f=a.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);E(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let l=!1,u=-1;if(r&&n){l=n.renderFallback;for(let f=0;f<a.length;f++){let h=a[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:d,errors:y}=n,v=h.route.loader&&!d.hasOwnProperty(h.route.id)&&(!y||y[h.route.id]===void 0);if(h.route.lazy||v){r.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let s=r==null?void 0:r.onError,c=n&&s?(f,h)=>{var d,y;s(f,{location:n.location,params:((y=(d=n.matches)==null?void 0:d[0])==null?void 0:y.params)??{},pattern:wt(n.matches),errorInfo:h})}:void 0;return a.reduceRight((f,h,d)=>{let y,v=!1,g=null,p=null;n&&(y=o&&h.route.id?o[h.route.id]:void 0,g=h.route.errorElement||Mt,l&&(u<0&&d===0?(je("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,p=null):u===d&&(v=!0,p=h.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,d+1)),R=()=>{let w;return y?w=g:v?w=p:h.route.Component?w=i.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=f,i.createElement(Bt,{match:h,routeContext:{outlet:f,matches:m,isDataRoute:n!=null},children:w})};return n&&(h.route.ErrorBoundary||h.route.errorElement||d===0)?i.createElement(He,{location:n.location,revalidation:n.revalidation,component:g,error:y,children:R(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:c}):R()},null)}function fe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ht(e){let t=i.useContext(O);return E(t,fe(e)),t}function jt(e){let t=i.useContext(Y);return E(t,fe(e)),t}function Vt(e){let t=i.useContext(L);return E(t,fe(e)),t}function he(e){let t=Vt(e),r=t.matches[t.matches.length-1];return E(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function zt(){return he("useRouteId")}function Jt(){var n;let e=i.useContext(ue),t=jt("useRouteError"),r=he("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Kt(){let{router:e}=Ht("useNavigate"),t=he("useNavigate"),r=i.useRef(!1);return Be(()=>{r.current=!0}),i.useCallback(async(a,o={})=>{b(r.current,_e),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var Se={};function je(e,t,r){!t&&!Se[e]&&(Se[e]=!0,b(!1,r))}i.memo(Yt);function Yt({routes:e,manifest:t,future:r,state:n,isStatic:a,onError:o}){return We(e,void 0,{manifest:t,state:n,isStatic:a,onError:o})}function Nr({to:e,replace:t,state:r,relative:n}){E(M(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:o}=i.useContext(S);b(!a,"<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:l}=i.useContext(L),{pathname:u}=k(),s=ce(),c=K(e,le(l),u,n==="path");se(typeof e=="string"?e:I(e),o.createHref(c),ie(o),"reject");let f=JSON.stringify(c);return i.useEffect(()=>{s(JSON.parse(f),{replace:t,state:r,relative:n})},[s,f,n,t,r]),null}function Fr(e){return Ut(e.context)}function qt(e){E(!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 Gt({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,useTransitions:l}){E(!M(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=i.useMemo(()=>({basename:u,navigator:a,static:o,useTransitions:l,future:{}}),[u,a,o,l]);typeof r=="string"&&(r=A(r));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:y="default",mask:v}=r,g=i.useMemo(()=>{let p=T(c,u);return p==null?null:{location:{pathname:p,search:f,hash:h,state:d,key:y,mask:v},navigationType:n}},[u,c,f,h,d,y,n,v]);return b(g!=null,`<Router basename="${u}"> is not able to match the URL "${c}${f}${h}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:i.createElement(S.Provider,{value:s},i.createElement(W.Provider,{children:t,value:g}))}function Ir({children:e,location:t}){return At(ne(e),t)}function ne(e,t=[]){let r=[];return i.Children.forEach(e,(n,a)=>{if(!i.isValidElement(n))return;let o=[...t,a];if(n.type===i.Fragment){r.push.apply(r,ne(n.props.children,o));return}E(n.type===qt,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=ne(n.props.children,o)),r.push(l)}),r}var V="get",z="application/x-www-form-urlencoded";function q(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Xt(e){return q(e)&&e.tagName.toLowerCase()==="button"}function Qt(e){return q(e)&&e.tagName.toLowerCase()==="form"}function Zt(e){return q(e)&&e.tagName.toLowerCase()==="input"}function er(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tr(e,t){return e.button===0&&(!t||t==="_self")&&!er(e)}function ae(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function rr(e,t){let r=ae(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var j=null;function nr(){if(j===null)try{new FormData(document.createElement("form"),0),j=!1}catch{j=!0}return j}var ar=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function te(e){return e!=null&&!ar.has(e)?(b(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z}"`),null):e}function or(e,t){let r,n,a,o,l;if(Qt(e)){let u=e.getAttribute("action");n=u?T(u,t):null,r=e.getAttribute("method")||V,a=te(e.getAttribute("enctype"))||z,o=new FormData(e)}else if(Xt(e)||Zt(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||u.getAttribute("action");if(n=s?T(s,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||V,a=te(e.getAttribute("formenctype"))||te(u.getAttribute("enctype"))||z,o=new FormData(u,e),!nr()){let{name:c,type:f,value:h}=e;if(f==="image"){let d=c?`${c}.`:"";o.append(`${d}x`,"0"),o.append(`${d}y`,"0")}else c&&o.append(c,h)}}else{if(q(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=V,n=null,a=z,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function de(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ve(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&T(a.pathname,t)==="/"?a.pathname=`${U(t)}/_root.${n}`:a.pathname=`${U(a.pathname)}.${n}`,a}async function lr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ir(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 sr(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await lr(o,r);return l.links?l.links():[]}return[]}));return hr(n.flat(1).filter(ir).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function be(e,t,r,n,a,o){let l=(s,c)=>r[c]?s.route.id!==r[c].route.id:!0,u=(s,c)=>{var f;return r[c].pathname!==s.pathname||((f=r[c].route.path)==null?void 0:f.endsWith("*"))&&r[c].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,c)=>l(s,c)||u(s,c)):o==="data"?t.filter((s,c)=>{var h;let f=n.routes[s.route.id];if(!f||!f.hasLoader)return!1;if(l(s,c)||u(s,c))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((h=r[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function ur(e,t,{includeHydrateFallback:r}={}){return cr(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function cr(e){return[...new Set(e)]}function fr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function hr(e,t){let r=new Set;return new Set(t),e.reduce((n,a)=>{let o=JSON.stringify(fr(a));return r.has(o)||(r.add(o),n.push({key:o,link:a})),n},[])}function me(){let e=i.useContext(O);return de(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function dr(){let e=i.useContext(Y);return de(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pe=i.createContext(void 0);pe.displayName="FrameworkContext";function G(){let e=i.useContext(pe);return de(e,"You must render this element inside a <HydratedRouter> element"),e}function mr(e,t){let r=i.useContext(pe),[n,a]=i.useState(!1),[o,l]=i.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:c,onMouseLeave:f,onTouchStart:h}=t,d=i.useRef(null);i.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let g=m=>{m.forEach(R=>{l(R.isIntersecting)})},p=new IntersectionObserver(g,{threshold:.5});return d.current&&p.observe(d.current),()=>{p.disconnect()}}},[e]),i.useEffect(()=>{if(n){let g=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(g)}}},[n]);let y=()=>{a(!0)},v=()=>{a(!1),l(!1)};return r?e!=="intent"?[o,d,{}]:[o,d,{onFocus:B(u,y),onBlur:B(s,v),onMouseEnter:B(c,y),onMouseLeave:B(f,v),onTouchStart:B(h,y)}]:[!1,d,{}]}function B(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function pr({page:e,...t}){let r=bt(),{nonce:n}=G(),{router:a}=me(),o=i.useMemo(()=>Le(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&n&&(t={...t,nonce:n}),r?i.createElement(yr,{page:e,matches:o,...t}):i.createElement(vr,{page:e,matches:o,...t})):null}function gr(e){let{manifest:t,routeModules:r}=G(),[n,a]=i.useState([]);return i.useEffect(()=>{let o=!1;return sr(e,t,r).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,r]),n}function yr({page:e,matches:t,...r}){let n=k(),{future:a}=G(),{basename:o}=me(),l=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=Ve(e,o,a.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,c=[];for(let f of t)typeof f.route.shouldRevalidate=="function"?s=!0:c.push(f.route.id);return s&&c.length>0&&u.searchParams.set("_routes",c.join(",")),[u.pathname+u.search]},[o,a.v8_trailingSlashAwareDataRequests,e,n,t]);return i.createElement(i.Fragment,null,l.map(u=>i.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...r})))}function vr({page:e,matches:t,...r}){let n=k(),{future:a,manifest:o,routeModules:l}=G(),{basename:u}=me(),{loaderData:s,matches:c}=dr(),f=i.useMemo(()=>be(e,t,c,o,n,"data"),[e,t,c,o,n]),h=i.useMemo(()=>be(e,t,c,o,n,"assets"),[e,t,c,o,n]),d=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,p=!1;if(t.forEach(R=>{var C;let w=o.routes[R.route.id];!w||!w.hasLoader||(!f.some(x=>x.route.id===R.route.id)&&R.route.id in s&&((C=l[R.route.id])!=null&&C.shouldRevalidate)||w.hasClientLoader?p=!0:g.add(R.route.id))}),g.size===0)return[];let m=Ve(e,u,a.v8_trailingSlashAwareDataRequests,"data");return p&&g.size>0&&m.searchParams.set("_routes",t.filter(R=>g.has(R.route.id)).map(R=>R.route.id).join(",")),[m.pathname+m.search]},[u,a.v8_trailingSlashAwareDataRequests,s,n,o,f,t,e,l]),y=i.useMemo(()=>ur(h,o),[h,o]),v=gr(h);return i.createElement(i.Fragment,null,d.map(g=>i.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),y.map(g=>i.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),v.map(({key:g,link:p})=>i.createElement("link",{key:g,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}function Rr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var wr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wr&&(window.__reactRouterVersion="7.18.4")}catch{}function Dr({basename:e,children:t,useTransitions:r,window:n}){let a=i.useRef();a.current==null&&(a.current=Ge({window:n,v5Compat:!0}));let o=a.current,[l,u]=i.useState({action:o.action,location:o.location}),s=i.useCallback(c=>{r===!1?u(c):i.startTransition(()=>u(c))},[r]);return i.useLayoutEffect(()=>o.listen(s),[o,s]),i.createElement(Gt,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,useTransitions:r})}var ze=i.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:l,mask:u,state:s,target:c,to:f,preventScrollReset:h,viewTransition:d,defaultShouldRevalidate:y,...v},g){let{basename:p,navigator:m,useTransitions:R}=i.useContext(S),w=typeof f=="string"&&oe.test(f),C=De(f,p);f=C.to;let x=Ft(f,{relative:a}),$=k(),N=null;if(u){let F=K(u,[],$.mask?$.mask.pathname:"/",!0);p!=="/"&&(F.pathname=F.pathname==="/"?p:P([p,F.pathname])),N=m.createHref(F)}let[D,_,X]=mr(n,v),Ke=Sr(f,{replace:l,mask:u,state:s,target:c,preventScrollReset:h,relative:a,viewTransition:d,defaultShouldRevalidate:y,useTransitions:R});function Ye(F){t&&t(F),F.defaultPrevented||Ke(F)}let ge=!(C.isExternal||o),ye=i.createElement("a",{...v,...X,href:(ge?N:void 0)||C.absoluteURL||x,onClick:ge?Ye:t,ref:Rr(g,_),target:c,"data-discover":!w&&r==="render"?"true":void 0});return D&&!w?i.createElement(i.Fragment,null,ye,i.createElement(pr,{page:x})):ye});ze.displayName="Link";var Er=i.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:u,children:s,...c},f){let h=H(l,{relative:c.relative}),d=k(),y=i.useContext(Y),{navigator:v,basename:g}=i.useContext(S),p=y!=null&&$r(h)&&u===!0,m=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,R=d.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,m=m.toLowerCase()),w&&g&&(w=T(w,g)||w);const C=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let x=R===m||!a&&R.startsWith(m)&&R.charAt(C)==="/",$=w!=null&&(w===m||!a&&w.startsWith(m)&&w.charAt(m.length)==="/"),N={isActive:x,isPending:$,isTransitioning:p},D=x?t:void 0,_;typeof n=="function"?_=n(N):_=[n,x?"active":null,$?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let X=typeof o=="function"?o(N):o;return i.createElement(ze,{...c,"aria-current":D,className:_,ref:f,style:X,to:l,viewTransition:u},typeof s=="function"?s(N):s)});Er.displayName="NavLink";var xr=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=V,action:u,onSubmit:s,relative:c,preventScrollReset:f,viewTransition:h,defaultShouldRevalidate:d,...y},v)=>{let{useTransitions:g}=i.useContext(S),p=Lr(),m=kr(u,{relative:c}),R=l.toLowerCase()==="get"?"get":"post",w=typeof u=="string"&&oe.test(u),C=x=>{if(s&&s(x),x.defaultPrevented)return;x.preventDefault();let $=x.nativeEvent.submitter,N=($==null?void 0:$.getAttribute("formmethod"))||l,D=()=>p($||x.currentTarget,{fetcherKey:t,method:N,navigate:r,replace:a,state:o,relative:c,preventScrollReset:f,viewTransition:h,defaultShouldRevalidate:d});g&&r!==!1?i.startTransition(()=>D()):D()};return i.createElement("form",{ref:v,method:R,action:m,onSubmit:n?s:C,...y,"data-discover":!w&&e==="render"?"true":void 0})});xr.displayName="Form";function Cr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Je(e){let t=i.useContext(O);return E(t,Cr(e)),t}function Sr(e,{target:t,replace:r,mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:u,defaultShouldRevalidate:s,useTransitions:c}={}){let f=ce(),h=k(),d=H(e,{relative:l});return i.useCallback(y=>{if(tr(y,t)){y.preventDefault();let v=r!==void 0?r:I(h)===I(d),g=()=>f(e,{replace:v,mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:u,defaultShouldRevalidate:s});c?i.startTransition(()=>g()):g()}},[h,f,d,r,n,a,t,e,o,l,u,s,c])}function Ur(e){b(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=i.useRef(ae(e)),r=i.useRef(!1),n=k(),a=i.useMemo(()=>rr(n.search,r.current?null:t.current),[n.search]),o=ce(),l=i.useCallback((u,s)=>{const c=ae(typeof u=="function"?u(new URLSearchParams(a)):u);r.current=!0,o("?"+c,s)},[o,a]);return[a,l]}var br=0,Pr=()=>`__${String(++br)}__`;function Lr(){let{router:e}=Je("useSubmit"),{basename:t}=i.useContext(S),r=zt(),n=e.fetch,a=e.navigate;return i.useCallback(async(o,l={})=>{let{action:u,method:s,encType:c,formData:f,body:h}=or(o,t);if(l.navigate===!1){let d=l.fetcherKey||Pr();await n(d,r,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:f,body:h,formMethod:l.method||s,formEncType:l.encType||c,flushSync:l.flushSync})}else await a(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:f,body:h,formMethod:l.method||s,formEncType:l.encType||c,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})},[n,a,t,r])}function kr(e,{relative:t}={}){let{basename:r}=i.useContext(S),n=i.useContext(L);E(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...H(e||".",{relative:t})},l=k();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),s=u.getAll("index");if(s.some(f=>f==="")){u.delete("index"),s.filter(h=>h).forEach(h=>u.append("index",h));let f=u.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:P([r,o.pathname])),I(o)}function $r(e,{relative:t}={}){let r=i.useContext(Oe);E(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Je("useViewTransitionState"),a=H(e,{relative:t});if(!r.isTransitioning)return!1;let o=T(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=T(r.nextLocation.pathname,n)||r.nextLocation.pathname;return J(a.pathname,l)!=null||J(a.pathname,o)!=null}export{Dr as B,ze as L,Nr as N,Fr as O,qt as R,Ir as a,ce as b,Ur as c,k as u};
12
+ Please change the parent <Route path="${m}"> to <Route path="${m==="/"?"*":`${m}/*`}">.`)}let f=k(),h;if(t){let m=typeof t=="string"?A(t):t;E(s==="/"||((p=m.pathname)==null?void 0:p.startsWith(s)),`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 "${s}" but pathname "${m.pathname}" was given in the \`location\` prop.`),h=m}else h=f;let d=h.pathname||"/",y=d;if(s!=="/"){let m=s.replace(/^\//,"").split("/");y="/"+d.replace(/^\//,"").split("/").slice(m.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(m=>Object.assign(m,{route:r.manifest[m.route.id]||m.route})):Le(e,{pathname:y});b(c||v!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),b(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 g=Wt(v&&v.map(m=>Object.assign({},m,{params:Object.assign({},l,m.params),pathname:L([s,n.encodeLocation?n.encodeLocation(m.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?s:L([s,n.encodeLocation?n.encodeLocation(m.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),a,r);return t&&g?i.createElement(W.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},g):g}function Ot(){let e=Jt(),t=Rt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,l)}var Mt=i.createElement(Ot,null),He=class extends i.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?e.error:t.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"){const r=Nt(e.digest);r&&(e=r)}let t=e!==void 0?i.createElement(P.Provider,{value:this.props.routeContext},i.createElement(ue.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement(_t,{error:e},t):t}};He.contextType=Ae;var ee=new WeakMap;function _t({children:e,error:t}){let{basename:r,navigator:n}=i.useContext(S);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Tt(t.digest);if(a){let o=ee.get(t);if(o)throw o;let l=De(a.location,r),u=l.absoluteURL||l.to;if(se(a.location,u,ie(n),"allow-explicit"),St(u))throw new Error("Invalid redirect location");if(Ie&&!ee.get(t))if(l.isExternal||a.reloadDocument)window.location.href=u;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw ee.set(t,s),s}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function Bt({routeContext:e,match:t,children:r}){let n=i.useContext(O);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(P.Provider,{value:e},r)}function Wt(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let f=a.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);E(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let l=!1,u=-1;if(r&&n){l=n.renderFallback;for(let f=0;f<a.length;f++){let h=a[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:d,errors:y}=n,v=h.route.loader&&!d.hasOwnProperty(h.route.id)&&(!y||y[h.route.id]===void 0);if(h.route.lazy||v){r.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let s=r==null?void 0:r.onError,c=n&&s?(f,h)=>{var d,y;s(f,{location:n.location,params:((y=(d=n.matches)==null?void 0:d[0])==null?void 0:y.params)??{},pattern:wt(n.matches),errorInfo:h})}:void 0;return a.reduceRight((f,h,d)=>{let y,v=!1,g=null,p=null;n&&(y=o&&h.route.id?o[h.route.id]:void 0,g=h.route.errorElement||Mt,l&&(u<0&&d===0?(je("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,p=null):u===d&&(v=!0,p=h.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,d+1)),R=()=>{let w;return y?w=g:v?w=p:h.route.Component?w=i.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=f,i.createElement(Bt,{match:h,routeContext:{outlet:f,matches:m,isDataRoute:n!=null},children:w})};return n&&(h.route.ErrorBoundary||h.route.errorElement||d===0)?i.createElement(He,{location:n.location,revalidation:n.revalidation,component:g,error:y,children:R(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:c}):R()},null)}function fe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ht(e){let t=i.useContext(O);return E(t,fe(e)),t}function jt(e){let t=i.useContext(Y);return E(t,fe(e)),t}function Vt(e){let t=i.useContext(P);return E(t,fe(e)),t}function he(e){let t=Vt(e),r=t.matches[t.matches.length-1];return E(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function zt(){return he("useRouteId")}function Jt(){var n;let e=i.useContext(ue),t=jt("useRouteError"),r=he("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Kt(){let{router:e}=Ht("useNavigate"),t=he("useNavigate"),r=i.useRef(!1);return Be(()=>{r.current=!0}),i.useCallback(async(a,o={})=>{b(r.current,_e),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var Se={};function je(e,t,r){!t&&!Se[e]&&(Se[e]=!0,b(!1,r))}i.memo(Yt);function Yt({routes:e,manifest:t,future:r,state:n,isStatic:a,onError:o}){return We(e,void 0,{manifest:t,state:n,isStatic:a,onError:o})}function Fr({to:e,replace:t,state:r,relative:n}){E(M(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:o}=i.useContext(S);b(!a,"<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:l}=i.useContext(P),{pathname:u}=k(),s=ce(),c=K(e,le(l),u,n==="path");se(typeof e=="string"?e:I(e),o.createHref(c),ie(o),"reject");let f=JSON.stringify(c);return i.useEffect(()=>{s(JSON.parse(f),{replace:t,state:r,relative:n})},[s,f,n,t,r]),null}function Ir(e){return Ut(e.context)}function qt(e){E(!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 Gt({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,useTransitions:l}){E(!M(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=i.useMemo(()=>({basename:u,navigator:a,static:o,useTransitions:l,future:{}}),[u,a,o,l]);typeof r=="string"&&(r=A(r));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:y="default",mask:v}=r,g=i.useMemo(()=>{let p=T(c,u);return p==null?null:{location:{pathname:p,search:f,hash:h,state:d,key:y,mask:v},navigationType:n}},[u,c,f,h,d,y,n,v]);return b(g!=null,`<Router basename="${u}"> is not able to match the URL "${c}${f}${h}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:i.createElement(S.Provider,{value:s},i.createElement(W.Provider,{children:t,value:g}))}function Dr({children:e,location:t}){return At(ne(e),t)}function ne(e,t=[]){let r=[];return i.Children.forEach(e,(n,a)=>{if(!i.isValidElement(n))return;let o=[...t,a];if(n.type===i.Fragment){r.push.apply(r,ne(n.props.children,o));return}E(n.type===qt,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=ne(n.props.children,o)),r.push(l)}),r}var V="get",z="application/x-www-form-urlencoded";function q(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Xt(e){return q(e)&&e.tagName.toLowerCase()==="button"}function Qt(e){return q(e)&&e.tagName.toLowerCase()==="form"}function Zt(e){return q(e)&&e.tagName.toLowerCase()==="input"}function er(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tr(e,t){return e.button===0&&(!t||t==="_self")&&!er(e)}function ae(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function rr(e,t){let r=ae(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var j=null;function nr(){if(j===null)try{new FormData(document.createElement("form"),0),j=!1}catch{j=!0}return j}var ar=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function te(e){return e!=null&&!ar.has(e)?(b(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z}"`),null):e}function or(e,t){let r,n,a,o,l;if(Qt(e)){let u=e.getAttribute("action");n=u?T(u,t):null,r=e.getAttribute("method")||V,a=te(e.getAttribute("enctype"))||z,o=new FormData(e)}else if(Xt(e)||Zt(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||u.getAttribute("action");if(n=s?T(s,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||V,a=te(e.getAttribute("formenctype"))||te(u.getAttribute("enctype"))||z,o=new FormData(u,e),!nr()){let{name:c,type:f,value:h}=e;if(f==="image"){let d=c?`${c}.`:"";o.append(`${d}x`,"0"),o.append(`${d}y`,"0")}else c&&o.append(c,h)}}else{if(q(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=V,n=null,a=z,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function de(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ve(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&T(a.pathname,t)==="/"?a.pathname=`${U(t)}/_root.${n}`:a.pathname=`${U(a.pathname)}.${n}`,a}async function lr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ir(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 sr(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await lr(o,r);return l.links?l.links():[]}return[]}));return hr(n.flat(1).filter(ir).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function be(e,t,r,n,a,o){let l=(s,c)=>r[c]?s.route.id!==r[c].route.id:!0,u=(s,c)=>{var f;return r[c].pathname!==s.pathname||((f=r[c].route.path)==null?void 0:f.endsWith("*"))&&r[c].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,c)=>l(s,c)||u(s,c)):o==="data"?t.filter((s,c)=>{var h;let f=n.routes[s.route.id];if(!f||!f.hasLoader)return!1;if(l(s,c)||u(s,c))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((h=r[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function ur(e,t,{includeHydrateFallback:r}={}){return cr(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function cr(e){return[...new Set(e)]}function fr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function hr(e,t){let r=new Set;return new Set(t),e.reduce((n,a)=>{let o=JSON.stringify(fr(a));return r.has(o)||(r.add(o),n.push({key:o,link:a})),n},[])}function me(){let e=i.useContext(O);return de(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function dr(){let e=i.useContext(Y);return de(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pe=i.createContext(void 0);pe.displayName="FrameworkContext";function G(){let e=i.useContext(pe);return de(e,"You must render this element inside a <HydratedRouter> element"),e}function mr(e,t){let r=i.useContext(pe),[n,a]=i.useState(!1),[o,l]=i.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:c,onMouseLeave:f,onTouchStart:h}=t,d=i.useRef(null);i.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let g=m=>{m.forEach(R=>{l(R.isIntersecting)})},p=new IntersectionObserver(g,{threshold:.5});return d.current&&p.observe(d.current),()=>{p.disconnect()}}},[e]),i.useEffect(()=>{if(n){let g=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(g)}}},[n]);let y=()=>{a(!0)},v=()=>{a(!1),l(!1)};return r?e!=="intent"?[o,d,{}]:[o,d,{onFocus:B(u,y),onBlur:B(s,v),onMouseEnter:B(c,y),onMouseLeave:B(f,v),onTouchStart:B(h,y)}]:[!1,d,{}]}function B(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function pr({page:e,...t}){let r=bt(),{nonce:n}=G(),{router:a}=me(),o=i.useMemo(()=>Le(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&n&&(t={...t,nonce:n}),r?i.createElement(yr,{page:e,matches:o,...t}):i.createElement(vr,{page:e,matches:o,...t})):null}function gr(e){let{manifest:t,routeModules:r}=G(),[n,a]=i.useState([]);return i.useEffect(()=>{let o=!1;return sr(e,t,r).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,r]),n}function yr({page:e,matches:t,...r}){let n=k(),{future:a}=G(),{basename:o}=me(),l=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=Ve(e,o,a.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,c=[];for(let f of t)typeof f.route.shouldRevalidate=="function"?s=!0:c.push(f.route.id);return s&&c.length>0&&u.searchParams.set("_routes",c.join(",")),[u.pathname+u.search]},[o,a.v8_trailingSlashAwareDataRequests,e,n,t]);return i.createElement(i.Fragment,null,l.map(u=>i.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...r})))}function vr({page:e,matches:t,...r}){let n=k(),{future:a,manifest:o,routeModules:l}=G(),{basename:u}=me(),{loaderData:s,matches:c}=dr(),f=i.useMemo(()=>be(e,t,c,o,n,"data"),[e,t,c,o,n]),h=i.useMemo(()=>be(e,t,c,o,n,"assets"),[e,t,c,o,n]),d=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,p=!1;if(t.forEach(R=>{var C;let w=o.routes[R.route.id];!w||!w.hasLoader||(!f.some(x=>x.route.id===R.route.id)&&R.route.id in s&&((C=l[R.route.id])!=null&&C.shouldRevalidate)||w.hasClientLoader?p=!0:g.add(R.route.id))}),g.size===0)return[];let m=Ve(e,u,a.v8_trailingSlashAwareDataRequests,"data");return p&&g.size>0&&m.searchParams.set("_routes",t.filter(R=>g.has(R.route.id)).map(R=>R.route.id).join(",")),[m.pathname+m.search]},[u,a.v8_trailingSlashAwareDataRequests,s,n,o,f,t,e,l]),y=i.useMemo(()=>ur(h,o),[h,o]),v=gr(h);return i.createElement(i.Fragment,null,d.map(g=>i.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),y.map(g=>i.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),v.map(({key:g,link:p})=>i.createElement("link",{key:g,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}function Rr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var wr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wr&&(window.__reactRouterVersion="7.18.4")}catch{}function Ur({basename:e,children:t,useTransitions:r,window:n}){let a=i.useRef();a.current==null&&(a.current=Ge({window:n,v5Compat:!0}));let o=a.current,[l,u]=i.useState({action:o.action,location:o.location}),s=i.useCallback(c=>{r===!1?u(c):i.startTransition(()=>u(c))},[r]);return i.useLayoutEffect(()=>o.listen(s),[o,s]),i.createElement(Gt,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,useTransitions:r})}var ze=i.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:l,mask:u,state:s,target:c,to:f,preventScrollReset:h,viewTransition:d,defaultShouldRevalidate:y,...v},g){let{basename:p,navigator:m,useTransitions:R}=i.useContext(S),w=typeof f=="string"&&oe.test(f),C=De(f,p);f=C.to;let x=Ft(f,{relative:a}),$=k(),N=null;if(u){let F=K(u,[],$.mask?$.mask.pathname:"/",!0);p!=="/"&&(F.pathname=F.pathname==="/"?p:L([p,F.pathname])),N=m.createHref(F)}let[D,_,X]=mr(n,v),Ke=Sr(f,{replace:l,mask:u,state:s,target:c,preventScrollReset:h,relative:a,viewTransition:d,defaultShouldRevalidate:y,useTransitions:R});function Ye(F){t&&t(F),F.defaultPrevented||Ke(F)}let ge=!(C.isExternal||o),ye=i.createElement("a",{...v,...X,href:(ge?N:void 0)||C.absoluteURL||x,onClick:ge?Ye:t,ref:Rr(g,_),target:c,"data-discover":!w&&r==="render"?"true":void 0});return D&&!w?i.createElement(i.Fragment,null,ye,i.createElement(pr,{page:x})):ye});ze.displayName="Link";var Er=i.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:u,children:s,...c},f){let h=H(l,{relative:c.relative}),d=k(),y=i.useContext(Y),{navigator:v,basename:g}=i.useContext(S),p=y!=null&&$r(h)&&u===!0,m=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,R=d.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,m=m.toLowerCase()),w&&g&&(w=T(w,g)||w);const C=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let x=R===m||!a&&R.startsWith(m)&&R.charAt(C)==="/",$=w!=null&&(w===m||!a&&w.startsWith(m)&&w.charAt(m.length)==="/"),N={isActive:x,isPending:$,isTransitioning:p},D=x?t:void 0,_;typeof n=="function"?_=n(N):_=[n,x?"active":null,$?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let X=typeof o=="function"?o(N):o;return i.createElement(ze,{...c,"aria-current":D,className:_,ref:f,style:X,to:l,viewTransition:u},typeof s=="function"?s(N):s)});Er.displayName="NavLink";var xr=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=V,action:u,onSubmit:s,relative:c,preventScrollReset:f,viewTransition:h,defaultShouldRevalidate:d,...y},v)=>{let{useTransitions:g}=i.useContext(S),p=Lr(),m=kr(u,{relative:c}),R=l.toLowerCase()==="get"?"get":"post",w=typeof u=="string"&&oe.test(u),C=x=>{if(s&&s(x),x.defaultPrevented)return;x.preventDefault();let $=x.nativeEvent.submitter,N=($==null?void 0:$.getAttribute("formmethod"))||l,D=()=>p($||x.currentTarget,{fetcherKey:t,method:N,navigate:r,replace:a,state:o,relative:c,preventScrollReset:f,viewTransition:h,defaultShouldRevalidate:d});g&&r!==!1?i.startTransition(()=>D()):D()};return i.createElement("form",{ref:v,method:R,action:m,onSubmit:n?s:C,...y,"data-discover":!w&&e==="render"?"true":void 0})});xr.displayName="Form";function Cr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Je(e){let t=i.useContext(O);return E(t,Cr(e)),t}function Sr(e,{target:t,replace:r,mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:u,defaultShouldRevalidate:s,useTransitions:c}={}){let f=ce(),h=k(),d=H(e,{relative:l});return i.useCallback(y=>{if(tr(y,t)){y.preventDefault();let v=r!==void 0?r:I(h)===I(d),g=()=>f(e,{replace:v,mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:u,defaultShouldRevalidate:s});c?i.startTransition(()=>g()):g()}},[h,f,d,r,n,a,t,e,o,l,u,s,c])}function Ar(e){b(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=i.useRef(ae(e)),r=i.useRef(!1),n=k(),a=i.useMemo(()=>rr(n.search,r.current?null:t.current),[n.search]),o=ce(),l=i.useCallback((u,s)=>{const c=ae(typeof u=="function"?u(new URLSearchParams(a)):u);r.current=!0,o("?"+c,s)},[o,a]);return[a,l]}var br=0,Pr=()=>`__${String(++br)}__`;function Lr(){let{router:e}=Je("useSubmit"),{basename:t}=i.useContext(S),r=zt(),n=e.fetch,a=e.navigate;return i.useCallback(async(o,l={})=>{let{action:u,method:s,encType:c,formData:f,body:h}=or(o,t);if(l.navigate===!1){let d=l.fetcherKey||Pr();await n(d,r,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:f,body:h,formMethod:l.method||s,formEncType:l.encType||c,flushSync:l.flushSync})}else await a(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:f,body:h,formMethod:l.method||s,formEncType:l.encType||c,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})},[n,a,t,r])}function kr(e,{relative:t}={}){let{basename:r}=i.useContext(S),n=i.useContext(P);E(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...H(e||".",{relative:t})},l=k();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),s=u.getAll("index");if(s.some(f=>f==="")){u.delete("index"),s.filter(h=>h).forEach(h=>u.append("index",h));let f=u.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:L([r,o.pathname])),I(o)}function $r(e,{relative:t}={}){let r=i.useContext(Oe);E(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Je("useViewTransitionState"),a=H(e,{relative:t});if(!r.isTransitioning)return!1;let o=T(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=T(r.nextLocation.pathname,n)||r.nextLocation.pathname;return J(a.pathname,l)!=null||J(a.pathname,o)!=null}export{Ur as B,ze as L,Fr as N,Ir as O,qt as R,ce as a,Dr as b,Ar as c,Nr as d,k as u};
@@ -0,0 +1,6 @@
1
+ import{G as o}from"./index-Bixhy5MB.js";/**
2
+ * @license lucide-react v1.58.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};e.node;const a=o(e);export{a as V};
package/public/index.html CHANGED
@@ -5,10 +5,36 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
7
7
  <title>tapflow</title>
8
- <script type="module" crossorigin src="/assets/index-DSW9h8XX.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-BlPSzrEe.js">
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-router-B_lVHrKl.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-BbCkTtjO.css">
8
+ <!-- Link previews, the same banner as tapflow.dev. Relative on purpose: each team serves this from its own relay,
9
+ at an address no build knows, and it should not depend on an outside site. A preview needs a relay the
10
+ chat app's crawler can reach, and a crawler that only takes absolute URLs shows none. -->
11
+ <meta property="og:type" content="website" />
12
+ <meta property="og:title" content="tapflow" />
13
+ <meta property="og:description" content="Test your team's iOS and Android builds in the browser." />
14
+ <meta property="og:image" content="/og-image.jpg" />
15
+ <meta property="og:image:width" content="1200" />
16
+ <meta property="og:image:height" content="630" />
17
+ <meta property="og:image:alt" content="The tapflow logo on a blue gradient" />
18
+ <meta name="twitter:card" content="summary_large_image" />
19
+ <meta name="twitter:image" content="/og-image.jpg" />
20
+ <script>
21
+ // Applies the theme before first paint, so a dark-mode reader does not see a light flash while the bundle loads.
22
+ // next-themes renders its own script for this, but React never runs a script it renders on the client, and this
23
+ // app has no server render. Mirrors main.tsx's ThemeProvider: `class` attribute, default `system`, next-themes'
24
+ // default `theme` storage key; it takes over on mount.
25
+ try {
26
+ var t = null
27
+ // Storage can throw (blocked site data); fall back to the system theme, as next-themes does.
28
+ try { t = localStorage.getItem('theme') } catch (e) {}
29
+ var dark = t === 'dark' || (t !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches)
30
+ document.documentElement.classList.add(dark ? 'dark' : 'light')
31
+ document.documentElement.style.colorScheme = dark ? 'dark' : 'light'
32
+ } catch (e) {}
33
+ </script>
34
+ <script type="module" crossorigin src="/assets/index-Bixhy5MB.js"></script>
35
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-DTSdA8m-.js">
36
+ <link rel="modulepreload" crossorigin href="/assets/vendor-router-B1pQim9Z.js">
37
+ <link rel="stylesheet" crossorigin href="/assets/index-h2hiZ2OM.css">
12
38
  </head>
13
39
  <body>
14
40
  <div id="root"></div>
Binary file
Binary file
Binary file
@@ -1,26 +0,0 @@
1
- var Ue=l=>{throw TypeError(l)};var Oe=(l,e,s)=>e.has(l)||Ue("Cannot "+s);var C=(l,e,s)=>(Oe(l,e,"read from private field"),s?s.call(l):e.get(l)),fe=(l,e,s)=>e.has(l)?Ue("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,s),me=(l,e,s,a)=>(Oe(l,e,"write to private field"),a?a.call(l,s):e.set(l,s),s),he=(l,e,s)=>(Oe(l,e,"access private method"),s);import{k as c,f as pe,j as t}from"./vendor-react-BlPSzrEe.js";import{J as xt,ax as gt,ap as Ve,ah as bt,at as et,aO as tt,as as jt,ay as yt,a6 as ve,aA as W,B as re,L as ye,a0 as vt,I as He,F as St,a2 as Nt,S as wt,N as Dt,T as Ct,O as kt,K as _t,f as At,aD as It,aN as Je,ao as Ot,$ as Et,aw as Rt,aC as Ft,r as Tt,av as $t,ac as Mt,ar as Pt,af as Bt}from"./index-DSW9h8XX.js";import{f as zt,d as Fe,S as Lt,P as qt,b as Kt,e as Qt}from"./build-format-DF5aFcag.js";import{f as st,d as at,e as lt,i as Ce,j as ke,g as _e,h as F,S as Ae,a as nt,D as rt,C as Ut}from"./dialog-DE2WUMuX.js";import{P as Vt,T as Ht}from"./trash-D1l1Fm-Z.js";import{B as Ee}from"./badge-DNaS0Mu3.js";import{f as Jt,g as Wt,d as Gt,b as Xt,c as Yt,e as Zt,a as es,A as ts}from"./alert-dialog-aoqYdAwx.js";import{u as ss}from"./useFocusAfterSwap-BY3N9f9v.js";import{b as as,c as ls}from"./vendor-router-B_lVHrKl.js";var le,de,M,ne,se,je,Te,Ze,ns=(Ze=class extends xt{constructor(e,s){super();fe(this,se);fe(this,le);fe(this,de);fe(this,M);fe(this,ne);me(this,le,e),this.setOptions(s),this.bindMethods(),he(this,se,je).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var a;const s=this.options;this.options=C(this,le).defaultMutationOptions(e),gt(this.options,s)||C(this,le).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,M),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ve(s.mutationKey)!==Ve(this.options.mutationKey)?this.reset():((a=C(this,M))==null?void 0:a.state.status)==="pending"&&C(this,M).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&C(this,M)&&(C(this,M).addObserver(this),he(this,se,je).call(this))}onUnsubscribe(){var e;this.hasListeners()||(e=C(this,M))==null||e.removeObserver(this)}onMutationUpdate(e){he(this,se,je).call(this),he(this,se,Te).call(this,e)}getCurrentResult(){return C(this,de)}reset(){var e;(e=C(this,M))==null||e.removeObserver(this),me(this,M,void 0),he(this,se,je).call(this),he(this,se,Te).call(this)}mutate(e,s){var a;return me(this,ne,s),(a=C(this,M))==null||a.removeObserver(this),me(this,M,C(this,le).getMutationCache().build(C(this,le),this.options)),C(this,M).addObserver(this),C(this,M).execute(e)}},le=new WeakMap,de=new WeakMap,M=new WeakMap,ne=new WeakMap,se=new WeakSet,je=function(){var s;const e=((s=C(this,M))==null?void 0:s.state)??bt();me(this,de,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},Te=function(e){et.batch(()=>{var s,a,i,u,f,j,b,m;if(C(this,ne)&&this.hasListeners()){const d=C(this,de).variables,y=C(this,de).context,p={client:C(this,le),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)==="success"){try{(a=(s=C(this,ne)).onSuccess)==null||a.call(s,e.data,d,y,p)}catch(r){Promise.reject(r)}try{(u=(i=C(this,ne)).onSettled)==null||u.call(i,e.data,null,d,y,p)}catch(r){Promise.reject(r)}}else if((e==null?void 0:e.type)==="error"){try{(j=(f=C(this,ne)).onError)==null||j.call(f,e.error,d,y,p)}catch(r){Promise.reject(r)}try{(m=(b=C(this,ne)).onSettled)==null||m.call(b,void 0,e.error,d,y,p)}catch(r){Promise.reject(r)}}}this.listeners.forEach(d=>{d(C(this,de))})})},Ze);function Re(l,e){const s=tt(),[a]=c.useState(()=>new ns(s,l));c.useEffect(()=>{a.setOptions(l)},[a,l]);const i=c.useSyncExternalStore(c.useCallback(f=>a.subscribe(et.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=c.useCallback((...f)=>{a.mutate(f[0],f[1]).catch(jt)},[a]);if(i.error&&yt(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}/**
2
- * @license lucide-react v1.48.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const it={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};it.node;const rs=ve(it);/**
7
- * @license lucide-react v1.48.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ot={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};ot.node;const is=ve(ot);/**
12
- * @license lucide-react v1.48.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const ct={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};ct.node;const os=ve(ct);/**
17
- * @license lucide-react v1.48.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const dt={name:"timer-off",size:24,node:[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]]};dt.node;const cs=ve(dt);/**
22
- * @license lucide-react v1.48.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const ut={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};ut.node;const We=ve(ut);function ds(l){const e=pe.c(37),{onSuccess:s,appId:a,canWrite:i}=l,[u,f]=c.useState(!1),[j,b]=c.useState(null),[m,d]=c.useState("none"),y=c.useRef(null);let p;e[0]!==a||e[1]!==j||e[2]!==s||e[3]!==m?(p=function(D){if(D.preventDefault(),!j)return;const E=new FormData;E.append("file",j),m!=="none"&&E.append("status",m),a&&E.append("app_id",String(a));const Z=fetch("/api/v1/builds",{method:"POST",credentials:"include",body:E}).then(async V=>{if(!V.ok){const ue=await V.json().catch(ms);throw new Error(ue.error??"Upload failed. Check the file format.")}s()});W.promise(Z,{loading:"Uploading build…",success:"Build uploaded",error:fs}),f(!1),b(null),d("none")},e[0]=a,e[1]=j,e[2]=s,e[3]=m,e[4]=p):p=e[4];const r=p;let N;e[5]===Symbol.for("react.memo_cache_sentinel")?(N=function(D){f(D),D||(b(null),d("none"))},e[5]=N):N=e[5];const v=N;if(!i){let w;return e[6]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs(re,{size:"sm",onClick:hs,children:[t.jsx(We,{className:"mr-2 h-4 w-4"}),"Upload build"]}),e[6]=w):w=e[6],w}let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(st,{asChild:!0,children:t.jsxs(re,{size:"sm",children:[t.jsx(We,{className:"mr-2 h-4 w-4"}),"Upload build"]})}),e[7]=g):g=e[7];let k;e[8]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(at,{children:t.jsx(lt,{children:"Upload build"})}),e[8]=k):k=e[8];let O;e[9]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ye,{children:"File"}),e[9]=O):O=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{var w;return(w=y.current)==null?void 0:w.click()},e[10]=x):x=e[10];let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=w=>{w.preventDefault();const D=w.dataTransfer.files[0];D&&b(D)},e[11]=_):_=e[11];const P=j?j.name:"Click or drag to upload";let T;e[12]!==P?(T=t.jsx("div",{className:"flex h-24 cursor-pointer items-center justify-center rounded-md border-2 border-dashed text-sm text-muted-foreground hover:border-primary",onClick:x,onDragOver:us,onDrop:_,children:P}),e[12]=P,e[13]=T):T=e[13];let B;e[14]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("input",{ref:y,type:"file",accept:".zip,.apk,.tgz,.tar.gz,application/gzip,application/x-gzip",className:"hidden",onChange:w=>{var D;return b(((D=w.target.files)==null?void 0:D[0])??null)}}),e[14]=B):B=e[14];let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("code",{children:".app.zip"}),e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("code",{children:".tar.gz"}),e[16]=G):G=e[16];let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("code",{children:".tgz"}),e[17]=X):X=e[17];let H;e[18]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsxs("p",{className:"text-xs text-muted-foreground",children:["iOS: ",L," or ",G," / ",X," (e.g. an EAS simulator build)  · Android: ",t.jsx("code",{children:".apk"})]}),e[18]=H):H=e[18];let q;e[19]!==T?(q=t.jsxs("div",{className:"grid gap-2",children:[O,T,B,H]}),e[19]=T,e[20]=q):q=e[20];let K;e[21]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(ye,{children:["Status ",t.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e[21]=K):K=e[21];let Y;e[22]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx(Ce,{children:t.jsx(ke,{})}),e[22]=Y):Y=e[22];let Q;e[23]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsxs(_e,{children:[t.jsx(F,{value:"none",children:"None"}),t.jsx(F,{value:"Backlog",children:"Backlog"}),t.jsx(F,{value:"In Progress",children:"In Progress"}),t.jsx(F,{value:"Done",children:"Done"}),t.jsx(F,{value:"Rejected",children:"Rejected"})]}),e[23]=Q):Q=e[23];let z;e[24]!==m?(z=t.jsxs("div",{className:"grid gap-2",children:[K,t.jsxs(Ae,{value:m,onValueChange:d,children:[Y,Q]})]}),e[24]=m,e[25]=z):z=e[25];let U;e[26]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(re,{type:"button",variant:"outline",className:"w-24",onClick:()=>f(!1),children:"Cancel"}),e[26]=U):U=e[26];const J=!j;let A;e[27]!==J?(A=t.jsxs("div",{className:"flex justify-end gap-2",children:[U,t.jsx(re,{type:"submit",className:"w-24",disabled:J,children:"Upload"})]}),e[27]=J,e[28]=A):A=e[28];let $;e[29]!==r||e[30]!==q||e[31]!==z||e[32]!==A?($=t.jsxs(nt,{className:"sm:max-w-md",children:[k,t.jsxs("form",{onSubmit:r,className:"flex flex-col gap-4 pt-2",children:[q,z,A]})]}),e[29]=r,e[30]=q,e[31]=z,e[32]=A,e[33]=$):$=e[33];let R;return e[34]!==u||e[35]!==$?(R=t.jsxs(rt,{open:u,onOpenChange:v,children:[g,$]}),e[34]=u,e[35]=$,e[36]=R):R=e[36],R}function us(l){return l.preventDefault()}function hs(){return W.error("Viewers can't upload builds. Ask an Admin for QA or Developer access.")}function fs(l){return l instanceof Error?l.message:"Failed to upload build"}function ms(){return{}}function De(l){const e=pe.c(8);let s,a;e[0]!==l?({className:s,...a}=l,e[0]=l,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let i;e[3]!==s?(i=vt("font-mono text-xs tabular-nums tracking-tight",s),e[3]=s,e[4]=i):i=e[4];let u;return e[5]!==a||e[6]!==i?(u=t.jsx("span",{className:i,...a}),e[5]=a,e[6]=i,e[7]=u):u=e[7],u}function ps({onSuccess:l,canWrite:e}){const[s,a]=c.useState(!1),[i,u]=c.useState(""),[f,j]=c.useState(""),[b,m]=c.useState("ios"),[d,y]=c.useState(""),[p,r]=c.useState(!1);async function N(g){g.preventDefault(),y(""),r(!0);try{const k=await Nt({name:i.trim(),bundle_id_key:f.trim(),platform:b});if(!k){y("Failed to create app");return}if("error"in k){y(k.error);return}a(!1),u(""),j(""),m("ios"),W.success("App created"),l()}catch{y("Failed to create app — check your network"),W.error("Failed to create app — check your network")}finally{r(!1)}}const v=g=>t.jsxs("button",{type:"button",onClick:g,className:"flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:[t.jsx(Vt,{className:"size-3.5 shrink-0"}),t.jsx("span",{children:"Add App"})]});return e?t.jsxs(rt,{open:s,onOpenChange:a,children:[t.jsx(st,{asChild:!0,children:v()}),t.jsxs(nt,{className:"sm:max-w-sm",children:[t.jsx(at,{children:t.jsx(lt,{children:"Add App"})}),t.jsxs("form",{onSubmit:N,className:"flex flex-col gap-4 pt-2",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ye,{htmlFor:"app-name",children:"Name"}),t.jsx(He,{id:"app-name",value:i,onChange:g=>u(g.target.value),placeholder:"My App",required:!0})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ye,{htmlFor:"bundle-id",children:"Bundle ID"}),t.jsx(He,{id:"bundle-id",value:f,onChange:g=>j(g.target.value),placeholder:"com.example.myapp",required:!0})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ye,{htmlFor:"platform",children:"Platform"}),t.jsxs(Ae,{value:b,onValueChange:g=>m(g),children:[t.jsx(Ce,{id:"platform",children:t.jsx(ke,{})}),t.jsxs(_e,{children:[t.jsx(F,{value:"ios",children:"iOS"}),t.jsx(F,{value:"android",children:"Android"}),t.jsx(F,{value:"both",children:"Both"})]})]})]}),t.jsx(St,{assertive:!0,id:"add-app-error",message:d||void 0}),t.jsx(re,{type:"submit",disabled:p,className:"w-full",children:p?"Creating…":"Create App"})]})]})]}):v(()=>W.error("Viewers can't add apps. Ask an Admin for QA or Developer access."))}function xs(l){const e=pe.c(17),{apps:s,selectedAppId:a,onSelect:i,onAdd:u,canWrite:f}=l;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"px-2 pb-1 font-mono text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Apps"}),e[0]=j):j=e[0];let b;e[1]!==s.length?(b=s.length===0&&t.jsx("span",{className:"px-2 text-sm text-muted-foreground",children:"No apps yet"}),e[1]=s.length,e[2]=b):b=e[2];let m;if(e[3]!==s||e[4]!==i||e[5]!==a){let p;e[7]!==i||e[8]!==a?(p=r=>t.jsxs("button",{onClick:()=>i(r.id),className:["flex flex-col gap-0.5 rounded-md px-2 py-2 text-left text-sm hover:bg-accent overflow-hidden",r.id===a?"bg-accent font-medium":""].join(" "),children:[t.jsx("span",{className:"truncate",children:r.name}),t.jsx(De,{className:"text-muted-foreground truncate",children:r.bundle_id_key})]},r.id),e[7]=i,e[8]=a,e[9]=p):p=e[9],m=s.map(p),e[3]=s,e[4]=i,e[5]=a,e[6]=m}else m=e[6];let d;e[10]!==f||e[11]!==u?(d=t.jsx("div",{className:"mt-1 border-t pt-1",children:t.jsx(ps,{onSuccess:u,canWrite:f})}),e[10]=f,e[11]=u,e[12]=d):d=e[12];let y;return e[13]!==b||e[14]!==m||e[15]!==d?(y=t.jsxs("aside",{className:"w-64 shrink-0 border-r flex flex-col gap-1 p-3 overflow-y-auto",children:[j,b,m,d]}),e[13]=b,e[14]=m,e[15]=d,e[16]=y):y=e[16],y}function gs(l){const e=pe.c(70),{build:s,isLast:a,onNavigate:i,onStatusChange:u,onScheduleDeletion:f,onCancelDeletion:j,canWrite:b,statusDescribedBy:m}=l,[d,y]=c.useState(!1),p=c.useRef(null),r=s.status_label==="Done";let N;e[0]!==s.delete_after?(N=s.delete_after?zt(s.delete_after):null,e[0]=s.delete_after,e[1]=N):N=e[1];const v=N;let g;e[2]!==s?(g=Fe(s),e[2]=s,e[3]=g):g=e[3];const k=g;let O;e[4]!==s.id||e[5]!==u?(O=function(ce){u(s.id,ce==="none"?null:ce)},e[4]=s.id,e[5]=u,e[6]=O):O=e[6];const x=O;let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=xe=>{var ce;xe.preventDefault(),(ce=p.current)==null||ce.focus()},e[7]=_):_=e[7];let P;e[8]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(Jt,{children:[t.jsx(Wt,{children:"Schedule deletion?"}),t.jsx(Gt,{children:"Build files will be deleted after 7 days. You can cancel the scheduled deletion anytime before then."})]}),e[8]=P):P=e[8];let T;e[9]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Xt,{children:"Cancel"}),e[9]=T):T=e[9];let B;e[10]!==s.id||e[11]!==f?(B=t.jsxs(Yt,{onCloseAutoFocus:_,children:[P,t.jsxs(Zt,{children:[T,t.jsx(es,{onClick:()=>{f(s.id),y(!1)},children:"Schedule deletion"})]})]}),e[10]=s.id,e[11]=f,e[12]=B):B=e[12];let L;e[13]!==d||e[14]!==B?(L=t.jsx(ts,{open:d,onOpenChange:y,children:B}),e[13]=d,e[14]=B,e[15]=L):L=e[15];const G=a?"":"border-b";let X;e[16]!==G?(X=["flex items-center gap-3 px-4 py-3",G],e[16]=G,e[17]=X):X=e[17];const H=X.join(" "),q=s.build_number??"—";let K;e[18]!==q?(K=t.jsxs("span",{className:"text-sm font-medium",children:["build ",t.jsx(De,{children:q})]}),e[18]=q,e[19]=K):K=e[19];const Y=s.platform==="ios"?"ios":"android";let Q;e[20]!==s.platform||e[21]!==Y?(Q=t.jsx(Ee,{tone:Y,className:"text-xs capitalize",children:s.platform}),e[20]=s.platform,e[21]=Y,e[22]=Q):Q=e[22];let z;e[23]!==s.status_label?(z=s.status_label&&t.jsx(Ee,{tone:Lt[s.status_label],className:"text-xs",children:s.status_label}),e[23]=s.status_label,e[24]=z):z=e[24];let U;e[25]!==v?(U=v&&t.jsx(Ee,{tone:v.urgent?"rejected":"backlog",className:"text-xs",children:v.label}),e[25]=v,e[26]=U):U=e[26];let J;e[27]!==K||e[28]!==Q||e[29]!==z||e[30]!==U?(J=t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[K,Q,z,U]}),e[27]=K,e[28]=Q,e[29]=z,e[30]=U,e[31]=J):J=e[31];let A;e[32]===Symbol.for("react.memo_cache_sentinel")?(A={display:"flex",flexDirection:"row",gap:"14px",marginTop:"0.7rem",alignItems:"center"},e[32]=A):A=e[32];let $;e[33]!==s.uploader?($=s.uploader&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:s.uploader}),t.jsx(wt,{orientation:"vertical",className:"h-3"})]}),e[33]=s.uploader,e[34]=$):$=e[34];let R;e[35]!==s.uploaded_at?(R=new Date(s.uploaded_at).toLocaleDateString(),e[35]=s.uploaded_at,e[36]=R):R=e[36];let w;e[37]!==R?(w=t.jsx(De,{children:R}),e[37]=R,e[38]=w):w=e[38];let D;e[39]!==$||e[40]!==w?(D=t.jsxs("div",{style:A,className:"text-xs text-muted-foreground",children:[$,w]}),e[39]=$,e[40]=w,e[41]=D):D=e[41];let E;e[42]!==J||e[43]!==D?(E=t.jsxs("div",{className:"flex-1 min-w-0",children:[J,D]}),e[42]=J,e[43]=D,e[44]=E):E=e[44];let Z;e[45]!==s.id||e[46]!==s.status_label||e[47]!==b||e[48]!==v||e[49]!==x||e[50]!==j||e[51]!==k||e[52]!==m?(Z=b&&t.jsxs(t.Fragment,{children:[t.jsxs(Ae,{value:s.status_label??"none",onValueChange:x,children:[t.jsx(Ce,{className:"h-9 w-32 text-xs","aria-label":`Status for ${k}`,"aria-describedby":m,"data-status-trigger":s.id,children:t.jsx(ke,{})}),t.jsxs(_e,{children:[t.jsx(F,{value:"none",children:t.jsx("span",{className:"text-muted-foreground",children:"—"})}),t.jsx(F,{value:"Backlog",children:"Backlog"}),t.jsx(F,{value:"In Progress",children:"In Progress"}),t.jsx(F,{value:"Done",children:"Done"}),t.jsx(F,{value:"Rejected",children:"Rejected"})]})]}),t.jsx(Dt,{delayDuration:400,children:t.jsxs(Ct,{children:[t.jsx(kt,{asChild:!0,children:v?t.jsx(re,{ref:p,size:"icon-sm",variant:"outline",onClick:()=>j(s.id),"aria-label":`Cancel scheduled deletion of ${k}`,children:t.jsx(cs,{className:"h-3.5 w-3.5","aria-hidden":!0})}):t.jsx(re,{ref:p,size:"icon-sm",variant:"destructive",onClick:()=>y(!0),"aria-label":`Schedule deletion of ${k}`,children:t.jsx(Ht,{className:"h-3.5 w-3.5","aria-hidden":!0})})}),t.jsx(_t,{children:v?"Cancel scheduled deletion":"Schedule deletion"})]})})]}),e[45]=s.id,e[46]=s.status_label,e[47]=b,e[48]=v,e[49]=x,e[50]=j,e[51]=k,e[52]=m,e[53]=Z):Z=e[53];let V;e[54]!==s.id||e[55]!==i?(V=()=>i(s.id),e[54]=s.id,e[55]=i,e[56]=V):V=e[56];const ue=`Start QA on ${k}`;let ie;e[57]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),e[57]=ie):ie=e[57];let oe;e[58]!==r||e[59]!==V||e[60]!==ue?(oe=t.jsxs(re,{size:"sm",onClick:V,disabled:r,"aria-label":ue,children:[ie,"Start QA"]}),e[58]=r,e[59]=V,e[60]=ue,e[61]=oe):oe=e[61];let ae;e[62]!==H||e[63]!==E||e[64]!==Z||e[65]!==oe?(ae=t.jsxs("div",{className:H,children:[E,Z,oe]}),e[62]=H,e[63]=E,e[64]=Z,e[65]=oe,e[66]=ae):ae=e[66];let te;return e[67]!==ae||e[68]!==L?(te=t.jsxs(t.Fragment,{children:[L,ae]}),e[67]=ae,e[68]=L,e[69]=te):te=e[69],te}function bs(l){const e=pe.c(29),{versionName:s,builds:a,isOpen:i,onToggle:u,onNavigate:f,onStatusChange:j,onScheduleDeletion:b,onCancelDeletion:m,canWrite:d,describedBy:y,rowNote:p}=l,r=c.useId(),N=i?r:void 0;let v;e[0]!==i?(v=i?t.jsx(Ut,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):t.jsx(At,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[0]=i,e[1]=v):v=e[1];let g;e[2]!==s?(g=t.jsx(De,{className:"font-medium text-sm text-foreground",children:s}),e[2]=s,e[3]=g):g=e[3];const k=a.length>1?"s":"";let O;e[4]!==a.length||e[5]!==k?(O=t.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",a.length," build",k,")"]}),e[4]=a.length,e[5]=k,e[6]=O):O=e[6];let x;e[7]!==y||e[8]!==i||e[9]!==u||e[10]!==N||e[11]!==v||e[12]!==g||e[13]!==O||e[14]!==s?(x=t.jsx("h2",{children:t.jsxs("button",{className:"flex w-full items-center gap-2 px-4 py-3 text-left hover:bg-accent/50 bg-card focus-visible:outline-none focus-visible:outline-offset-[-2px] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",onClick:u,"aria-expanded":i,"aria-controls":N,"aria-describedby":y,"data-release-header":s,children:[v,g,O]})}),e[7]=y,e[8]=i,e[9]=u,e[10]=N,e[11]=v,e[12]=g,e[13]=O,e[14]=s,e[15]=x):x=e[15];let _;e[16]!==a||e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==f||e[21]!==b||e[22]!==j||e[23]!==r||e[24]!==p?(_=i&&t.jsx("div",{id:r,className:"border-t bg-card",children:a.map((T,B)=>t.jsx(gs,{build:T,isLast:B===a.length-1,onNavigate:f,onStatusChange:j,onScheduleDeletion:b,onCancelDeletion:m,canWrite:d,statusDescribedBy:(p==null?void 0:p.buildId)===T.id?p.id:void 0},T.id))}),e[16]=a,e[17]=d,e[18]=i,e[19]=m,e[20]=f,e[21]=b,e[22]=j,e[23]=r,e[24]=p,e[25]=_):_=e[25];let P;return e[26]!==x||e[27]!==_?(P=t.jsxs("div",{className:"rounded-lg shadow-card-2 overflow-hidden",children:[x,_]}),e[26]=x,e[27]=_,e[28]=P):P=e[28],P}const ht="tapflow-app-center-releases:";function js(l){try{const e=JSON.parse(localStorage.getItem(ht+l)??"[]");return Array.isArray(e)?e.filter(s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="string"&&typeof s[1]=="boolean"):[]}catch{return[]}}function ys(l,e){try{localStorage.setItem(ht+l,JSON.stringify(e))}catch{}}function vs(l,e){const s=pe.c(13),[a,i]=c.useState(Ss);let u;s[0]!==l||s[1]!==a?(u=l===null?[]:a.get(l)??js(l),s[0]=l,s[1]=a,s[2]=u):u=s[2];const f=u,j=e[0];let b;s[3]!==j||s[4]!==f?(b=r=>{var N;return((N=f.find(v=>{const[g]=v;return g===r}))==null?void 0:N[1])??r===j},s[3]=j,s[4]=f,s[5]=b):b=s[5];const m=b;let d;s[6]!==l||s[7]!==m||s[8]!==f?(d=r=>{if(l===null)return;const N=[...f.filter(v=>{const[g]=v;return g!==r}),[r,!m(r)]].slice(-200);ys(l,N),i(v=>new Map(v).set(l,N))},s[6]=l,s[7]=m,s[8]=f,s[9]=d):d=s[9];const y=d;let p;return s[10]!==m||s[11]!==y?(p={isOpen:m,toggle:y},s[10]=m,s[11]=y,s[12]=p):p=s[12],p}function Ss(){return new Map}const Ne=l=>`row:${l}`,we=l=>`release:${l}`;function Ge(l){return l instanceof HTMLElement?l.dataset.statusTrigger!==void 0?Ne(Number(l.dataset.statusTrigger)):l.dataset.releaseHeader!==void 0?we(l.dataset.releaseHeader):null:null}function Xe(l,e){const s=new Set(JSON.parse(e));return l.find(a=>s.has(a))??null}function Ye(l,e){return l.map((s,a)=>({item:s,d:a>e?2*(a-e)-1:2*(e-a)})).filter(({d:s})=>s>0).sort((s,a)=>s.d-a.d).map(({item:s})=>s)}function Rs(){var Ke;const l=as(),[e,s]=ls(),a=tt(),{user:i}=It(),u=(i==null?void 0:i.role)!=="Viewer",[f,j]=c.useState(""),[b,m]=c.useState(""),[d,y]=c.useState("all");c.useEffect(()=>{const n=setTimeout(()=>m(f),250);return()=>clearTimeout(n)},[f]);const p=e.get("appId"),r=p!==null&&/^[1-9][0-9]*$/.test(p)?Number(p):null,N=Je({queryKey:["apps"],queryFn:Mt}),v=N.data??[],g=v.find(n=>n.id===r)??null,k=["builds",r,b,d],O=JSON.stringify(k),x=Je({queryKey:k,queryFn:()=>Bt({appId:r,search:b,statusFilter:d}),enabled:r!==null,placeholderData:Pt}),_=x.data??[];c.useEffect(()=>{!N.data||e.get("appId")||N.data.length===0||s({appId:String(N.data[0].id)},{replace:!0})},[N.data,e,s]);const[P,T]=c.useState(null),[B,L]=c.useState(!1);c.useEffect(()=>{x.isRefetchError&&W.error("Couldn't refresh builds — showing the last list",{id:"builds:refresh"})},[x.isRefetchError]);const G=c.useRef(null);c.useEffect(()=>{r===null||x.isPlaceholderData||!x.data||G.current!==r&&(G.current=r,T(r))},[r,x.isPlaceholderData,x.data]);function X(n){s({appId:String(n)})}function H(n,h){return{onMutate:async o=>{const S=k;await a.cancelQueries({queryKey:S});const I=a.getQueryData(S);return a.setQueryData(S,ee=>ee&&n(ee,o)),{previous:I,key:S}},onError:(o,S,I)=>{if(I!=null&&I.previous&&a.setQueryData(I.key,I.previous),o instanceof Tt){a.invalidateQueries({queryKey:$t.me}),W.error(o.message);return}W.error(h)},onSettled:()=>{a.invalidateQueries({queryKey:["builds"]})}}}const q=H((n,h)=>n.map(o=>o.id===h.buildId?{...o,status_label:h.status}:o),"Failed to update status"),K=Re({mutationFn:({buildId:n,status:h})=>Ft(n,h),...q,onError:(n,h,o)=>{var S;q.onError(n,h,o),((S=R.current)==null?void 0:S.leaving)===h.buildId&&(R.current=null,E(null))}}),Y=(n,h)=>{var S;const o=(S=a.getQueryData(n))==null?void 0:S.find(I=>I.id===h);return o?Fe(o):"the build"},Q=Re({mutationFn:n=>Rt(n),...H((n,h)=>n.map(o=>o.id===h?{...o,delete_after:new Date().toISOString()}:o),"Failed to schedule deletion"),onSuccess:(n,h,o)=>{o&&(a.setQueryData(o.key,S=>S==null?void 0:S.map(I=>I.id===h?{...I,delete_after:n}:I)),W.success(`Deletion scheduled for ${Y(o.key,h)} — it will be deleted ${Qt(n)}`))}}),z=Re({mutationFn:n=>Et(n),...H((n,h)=>n.map(o=>o.id===h?{...o,delete_after:null}:o),"Failed to cancel scheduled deletion"),onSuccess:(n,h,o)=>{W.success(`Scheduled deletion cancelled for ${o?Y(o.key,h):"the build"}`)}}),U=n=>Q.mutate(n),J=n=>z.mutate(n),A=Ot(_),$=vs(((Ke=_[0])==null?void 0:Ke.app_id)??null,A.map(n=>n.versionName)),R=c.useRef(null),w=c.useRef(null),[D,E]=c.useState(null),Z=c.useRef(null),V=c.useId();function ue(n){const h=A.findIndex(S=>S.builds.some(I=>I.id===n));if(h<0)return[];const o=A[h].builds;return[...Ye(o,o.findIndex(S=>S.id===n)).map(S=>Ne(S.id)),...Ye(A,h).map(S=>we(S.versionName))]}const ie=JSON.stringify(A.flatMap(n=>[we(n.versionName),...$.isOpen(n.versionName)?n.builds.map(h=>Ne(h.id)):[]])),oe=(n,h)=>{const o=_.find(ee=>ee.id===n),I=d!=="all"&&h!==d?ue(n):[];if(o&&I.length>0){const ee=`${Fe(o)} was set to ${h??"no status"}, so the ${d} filter no longer shows it.`,Qe={leaving:n,candidates:I,text:ee,key:O};R.current=Qe,w.current=null,E(Qe)}K.mutate({buildId:n,status:h})},ae=D!==null&&!_.some(n=>n.id===D.leaving),te=ae?Xe(D.candidates,ie):null,xe=x.data,ce=x.isRefetchError;c.useLayoutEffect(()=>{var I;const n=R.current;if(!n)return;if(n.key!==O||ce){R.current=null,E(null);return}if((xe??[]).some(ee=>ee.id===n.leaving))return;R.current=null;const h=Xe(n.candidates,ie);if(!h||document.activeElement!==null&&document.activeElement!==document.body){W.success(n.text),E(null);return}const o=((I=Z.current)==null?void 0:I.querySelectorAll("[data-status-trigger], [data-release-header]"))??[],S=Array.from(o).find(ee=>Ge(ee)===h);S instanceof HTMLElement?(w.current=h,S.focus()):(W.success(n.text),E(null))},[O,ce,xe,ie]),c.useEffect(()=>{if(!D)return;const n=h=>{const o=Ge(h.target);if(w.current!==null){o!==w.current&&E(null);return}o!==Ne(D.leaving)&&(o===null||!D.candidates.includes(o))&&E(null)};return document.addEventListener("focusin",n),()=>document.removeEventListener("focusin",n)},[D]);const ge=(g==null?void 0:g.name)??"this app",Ie=b!==""||d!=="all",$e=x.isPlaceholderData&&P!==r,ft=x.isFetchedAfterMount&&(x.isPlaceholderData||x.isLoading),be=B||ft,Se=x.isLoadingError||be?"error":x.isLoading||A.length===0&&$e?"loading":A.length===0?"empty":"list",Me=c.useRef(null),mt=ss(Se,Me),Pe=c.useId(),Be=c.useId(),ze=c.useId(),Le=c.useId(),qe=c.useId(),pt=r===null?"":x.isLoadingError?`Couldn't load builds for ${ge}`:x.isLoading||$e||be?`Loading builds for ${ge}`:A.length>0?`Showing ${_.length} build${_.length===1?"":"s"} for ${ge}`:Ie?`No builds match the current filters for ${ge}`:`No builds for ${ge}`;return t.jsxs("div",{className:"flex h-full gap-0",children:[t.jsx(xs,{apps:v,selectedAppId:r,onSelect:X,onAdd:()=>a.invalidateQueries({queryKey:["apps"]}),canWrite:u}),t.jsxs("div",{className:"flex-1 flex flex-col gap-4 p-4 overflow-y-auto min-w-0",children:[t.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[t.jsx("h1",{className:"text-xl font-semibold tracking-display-sm",children:g?g.name:"App Center"}),t.jsx(ds,{onSuccess:()=>{a.invalidateQueries({queryKey:["apps"]}),a.invalidateQueries({queryKey:["builds"]})},appId:r,canWrite:u})]}),t.jsx("p",{id:qe,role:"status",className:"sr-only",children:pt}),r===null?t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center",children:[t.jsx(is,{className:"w-8 h-8 text-muted-foreground/40"}),t.jsx("p",{className:"text-sm font-medium",children:"No app selected"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose an app from the sidebar to view its builds."})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(Kt,{ref:Me,"aria-describedby":`${Le} ${ze}`,"aria-label":"Search versions",placeholder:"Search version…",value:f,onChange:j}),t.jsxs(Ae,{value:d,onValueChange:y,children:[t.jsx(Ce,{className:"h-8 w-36","aria-label":"Filter by status",children:t.jsx(ke,{placeholder:"Status"})}),t.jsxs(_e,{children:[t.jsx(F,{value:"all",children:"All statuses"}),t.jsx(F,{value:"Backlog",children:"Backlog"}),t.jsx(F,{value:"In Progress",children:"In Progress"}),t.jsx(F,{value:"Done",children:"Done"}),t.jsx(F,{value:"Rejected",children:"Rejected"})]})]}),x.isRefetchError&&t.jsx("p",{className:"text-sm text-muted-foreground self-center",children:"Showing the last list — refresh failed."})]}),t.jsx("div",{...mt,className:"contents",children:Se==="error"?t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center",children:[t.jsx(rs,{className:"w-8 h-8 text-muted-foreground/40"}),t.jsx("p",{id:Pe,className:"text-sm font-medium",children:"Couldn't load builds"}),t.jsx("p",{id:Be,className:"text-sm text-muted-foreground",children:"Check that the relay is reachable."}),t.jsx(re,{variant:"outline",size:"sm",className:"mt-1 aria-disabled:opacity-50","aria-describedby":`${Pe} ${Be}`,"aria-disabled":be,onClick:()=>{be||(L(!0),x.refetch().finally(()=>L(!1)))},children:be?"Trying…":"Try again"})]}):Se==="loading"?t.jsx("p",{id:Le,className:"text-sm text-muted-foreground",children:"Loading…"}):Se==="empty"?t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center",children:[t.jsx(os,{className:"w-8 h-8 text-muted-foreground/40"}),t.jsx("p",{id:ze,className:"text-sm font-medium",children:Ie?"No matching builds":"No builds yet"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:Ie?"No build matches the search and status filters.":u?"Upload the first build to get started.":"Builds appear here once a teammate uploads one."})]}):t.jsxs("div",{ref:Z,className:"flex flex-col gap-2","aria-busy":x.isPlaceholderData,children:[ae&&t.jsx("p",{id:V,hidden:!0,children:D.text}),A.map(({versionName:n,builds:h},o)=>t.jsx(bs,{describedBy:[o===0&&!x.isPlaceholderData?qe:null,te===we(n)?V:null].filter(Boolean).join(" ")||void 0,rowNote:te!=null&&te.startsWith("row:")?{buildId:Number(te.slice(4)),id:V}:void 0,versionName:n,builds:h,isOpen:$.isOpen(n),onToggle:()=>$.toggle(n),onNavigate:S=>l(`/app-center/build?id=${S}`),onStatusChange:oe,onScheduleDeletion:U,onCancelDeletion:J,canWrite:u},n))]})})]})]})]})}export{Rs as AppCenter};
@@ -1 +0,0 @@
1
- import{k as m,j as e}from"./vendor-react-BlPSzrEe.js";import{aT as me,aD as ue,aO as pe,aN as G,aK as A,aB as F,aQ as fe,C as y,c as b,d as S,a as N,L as c,I as u,F as p,S as Y,h as Z,aA as i,B as h,s as k,W as he,ab as ge,P as xe,a0 as je,Z as we,av as f,au as D,Q as I,az as g,v as ve,w as ye,al as be,ac as Se}from"./index-DSW9h8XX.js";import{F as Ne}from"./field-hint-Csb40Gzp.js";import{B as Pe}from"./badge-DNaS0Mu3.js";import{A as Ce,h as Ae,c as Fe,f as ke,g as De,d as Te,e as qe,b as Ee,a as Oe}from"./alert-dialog-aoqYdAwx.js";import{P as X}from"./pencil-BN18R4oa.js";import"./vendor-router-B_lVHrKl.js";const _e=D({teamName:g().min(1,"Team name is required"),logo:I(File).nullable().optional()}),Qe=D({displayName:g().min(1,"Display name is required"),avatar:I(File).nullable().optional()}),Re=D({currentPassword:g().min(1,"Enter your current password"),newPassword:g().min(ve,ye),confirmPassword:g()}).refine(x=>x.newPassword===x.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]});function Ve(){var W,K,U,M,V,$,J;const{resolvedTheme:x}=me(),ee=x==="dark"?"/logo-dark.svg":"/logo.svg",{user:o}=ue(),T=(o==null?void 0:o.role)==="Admin",q=(o==null?void 0:o.role)==="Admin"||(o==null?void 0:o.role)==="Developer"||(o==null?void 0:o.role)==="QA",j=pe(),P=G({queryKey:f.settings,queryFn:be,enabled:T}),[re,se]=m.useState(null),ae=re??((W=P.data)==null?void 0:W.logo_url)??null,E=m.useRef(null),d=A({shouldFocusError:!1,resolver:F(_e),defaultValues:{teamName:"",logo:null},values:P.data?{teamName:P.data.team_name,logo:null}:void 0,resetOptions:{keepDirtyValues:!0}});async function te(r){const s=new FormData;s.append("team_name",r.teamName),r.logo&&s.append("logo",r.logo);try{if(!(await fetch("/api/v1/settings",{method:"PATCH",credentials:"include",body:s})).ok){i.error("Failed to update workspace");return}i.success("Workspace updated"),j.invalidateQueries({queryKey:f.settings})}catch{i.error("Failed to update workspace")}}const[oe,ie]=m.useState(null),O=oe??(o==null?void 0:o.avatarUrl)??null,_=m.useRef(null),n=A({shouldFocusError:!1,resolver:F(Qe),defaultValues:{displayName:"",avatar:null},values:o?{displayName:o.displayName??"",avatar:null}:void 0,resetOptions:{keepDirtyValues:!0}});async function ne(r){const s=new FormData;s.append("display_name",r.displayName),r.avatar&&s.append("avatar",r.avatar);try{if(!(await fetch("/api/v1/profile",{method:"PATCH",credentials:"include",body:s})).ok){i.error("Failed to update profile");return}i.success("Profile updated"),j.invalidateQueries({queryKey:f.me})}catch{i.error("Failed to update profile")}}const t=A({shouldFocusError:!1,resolver:F(Re)});async function le(r){try{const s=await fetch("/api/v1/auth/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:r.currentPassword,newPassword:r.newPassword})});if(!s.ok){const a=await s.json();t.setError("root",{message:a.error??"Failed to change password"});return}t.reset(),i.success("Password changed")}catch{t.setError("root",{message:"Network error"})}}const C=G({queryKey:f.apps,queryFn:Se,enabled:q}).data??[],[Q,R]=m.useState({}),[L,z]=m.useState({}),[B,H]=m.useState({});async function de(r){H(s=>({...s,[r]:!0}));try{if(!(await fetch(`/api/v1/apps/${r}`,{method:"DELETE",credentials:"include"})).ok){i.error("Failed to delete app");return}j.invalidateQueries({queryKey:f.apps}),i.success("App deleted")}catch{i.error("Failed to delete app")}finally{H(s=>({...s,[r]:!1}))}}async function ce(r){var s;z(a=>({...a,[r]:!0}));try{if(!(await fetch(`/api/v1/apps/${r}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Q[r]??((s=C.find(l=>l.id===r))==null?void 0:s.name)})})).ok){i.error("Failed to update app");return}i.success("App updated"),R(({[r]:l,...v})=>v),j.invalidateQueries({queryKey:f.apps})}catch{i.error("Failed to update app")}finally{z(a=>({...a,[r]:!1}))}}const w=fe({control:n.control,name:"displayName"});return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-display-sm",children:"Settings"}),T&&e.jsxs(y,{children:[e.jsx(b,{children:e.jsx(S,{children:"Workspace"})}),e.jsx(N,{children:e.jsxs("form",{onSubmit:d.handleSubmit(te),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"team-name",children:"Team name"}),e.jsx(u,{id:"team-name",placeholder:"My QA Team","aria-required":"true","aria-invalid":!!d.formState.errors.teamName,"aria-describedby":d.formState.errors.teamName?"teamName-error":void 0,...d.register("teamName")}),e.jsx(p,{id:"teamName-error",message:(K=d.formState.errors.teamName)==null?void 0:K.message})]}),e.jsx(Y,{}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(c,{children:["Logo ",e.jsx("span",{className:"text-muted-foreground text-xs",children:"(png · jpg, max 2MB)"})]}),e.jsx(Z,{name:"logo",control:d.control,render:({field:r})=>e.jsxs("div",{className:"relative w-16 h-16",children:[e.jsx("img",{src:ae??ee,alt:"Workspace logo",className:"w-16 h-16 rounded-lg object-contain"}),e.jsx("button",{type:"button","aria-label":"Change logo",onClick:()=>{var s;return(s=E.current)==null?void 0:s.click()},className:"absolute bottom-0 right-0 w-6 h-6 rounded-full bg-background border border-border shadow-sm flex items-center justify-center hover:bg-accent transition-colors",children:e.jsx(X,{className:"w-3 h-3","aria-hidden":"true"})}),e.jsx("input",{ref:E,type:"file",accept:".png,.jpg,.jpeg",className:"hidden",onChange:s=>{var l;const a=(l=s.target.files)==null?void 0:l[0];if(a&&a.size>2*1024*1024){i.error("Image must be 2MB or less");return}a&&(r.onChange(a),se(URL.createObjectURL(a)))}})]})})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{type:"submit",size:"sm",disabled:d.formState.isSubmitting,children:d.formState.isSubmitting?"Saving…":"Save changes"})}),e.jsx(k,{errors:d.formState.errors,submitCount:d.formState.submitCount})]})})]}),e.jsxs(y,{children:[e.jsx(b,{children:e.jsx(S,{children:"Profile"})}),e.jsx(N,{children:e.jsxs("form",{onSubmit:n.handleSubmit(ne),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"display-name",children:"Nickname"}),e.jsx(u,{id:"display-name",placeholder:"Your name","aria-required":"true","aria-invalid":!!n.formState.errors.displayName,"aria-describedby":n.formState.errors.displayName?"displayName-error":void 0,...n.register("displayName")}),e.jsx(p,{id:"displayName-error",message:(U=n.formState.errors.displayName)==null?void 0:U.message})]}),e.jsx(Y,{}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(c,{children:["Avatar ",e.jsx("span",{className:"text-muted-foreground text-xs",children:"(png · jpg, max 2MB)"})]}),e.jsx(Z,{name:"avatar",control:n.control,render:({field:r})=>{var s;return e.jsxs("div",{className:"relative w-14 h-14",children:[O?e.jsx("img",{src:O,alt:"Profile avatar",className:"w-14 h-14 rounded-full object-cover border"}):e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center text-lg font-medium",style:(()=>{const a=he(w||(o==null?void 0:o.email)||"");return{backgroundColor:a.bg,color:a.fg}})(),children:((s=w==null?void 0:w[0])==null?void 0:s.toUpperCase())??"?"}),e.jsx("button",{type:"button","aria-label":"Change avatar",onClick:()=>{var a;return(a=_.current)==null?void 0:a.click()},className:"absolute bottom-0 right-0 w-6 h-6 rounded-full bg-background border border-border shadow-sm flex items-center justify-center hover:bg-accent transition-colors",children:e.jsx(X,{className:"w-3 h-3","aria-hidden":"true"})}),e.jsx("input",{ref:_,type:"file",accept:".png,.jpg,.jpeg",className:"hidden",onChange:a=>{var v;const l=(v=a.target.files)==null?void 0:v[0];if(l&&l.size>2*1024*1024){i.error("Image must be 2MB or less");return}l&&(r.onChange(l),ie(URL.createObjectURL(l)))}})]})}})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{type:"submit",size:"sm",disabled:n.formState.isSubmitting,children:n.formState.isSubmitting?"Saving…":"Save changes"})}),e.jsx(k,{errors:n.formState.errors,submitCount:n.formState.submitCount})]})})]}),e.jsxs(y,{children:[e.jsx(b,{children:e.jsx(S,{children:"Password"})}),e.jsx(N,{children:e.jsxs("form",{onSubmit:t.handleSubmit(le),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"current-password",children:"Current password"}),e.jsx(u,{id:"current-password",type:"password","aria-required":"true",autoComplete:"current-password","aria-invalid":!!t.formState.errors.currentPassword,"aria-describedby":t.formState.errors.currentPassword?"currentPassword-error":void 0,...t.register("currentPassword")}),e.jsx(p,{id:"currentPassword-error",message:(M=t.formState.errors.currentPassword)==null?void 0:M.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"new-password",children:"New password"}),e.jsx(u,{id:"new-password",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!t.formState.errors.newPassword,"aria-describedby":ge("newPassword-hint","newPassword-error",!!t.formState.errors.newPassword),...t.register("newPassword")}),!t.formState.errors.newPassword&&e.jsx(Ne,{id:"newPassword-hint",children:xe}),e.jsx(p,{id:"newPassword-error",message:(V=t.formState.errors.newPassword)==null?void 0:V.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"confirm-password",children:"Confirm new password"}),e.jsx(u,{id:"confirm-password",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!t.formState.errors.confirmPassword,"aria-describedby":t.formState.errors.confirmPassword?"confirmPassword-error":void 0,...t.register("confirmPassword")}),e.jsx(p,{id:"confirmPassword-error",message:($=t.formState.errors.confirmPassword)==null?void 0:$.message})]}),e.jsx(p,{assertive:!0,id:"default-error",message:(J=t.formState.errors.root)==null?void 0:J.message}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{type:"submit",size:"sm",disabled:t.formState.isSubmitting,children:t.formState.isSubmitting?"Saving…":"Change password"})}),e.jsx(k,{errors:t.formState.errors,submitCount:t.formState.submitCount})]})})]}),q&&C.length>0&&e.jsxs(y,{children:[e.jsx(b,{children:e.jsx(S,{children:"Apps"})}),e.jsx(N,{children:e.jsx("div",{className:"flex flex-col divide-y divide-border",children:C.map(r=>e.jsxs("div",{className:"flex flex-col gap-2 py-4 first:pt-0 last:pb-0",children:[e.jsx(c,{htmlFor:`app-${r.id}`,children:"App Name"}),e.jsx(u,{id:`app-${r.id}`,value:Q[r.id]??r.name,onChange:s=>R(a=>({...a,[r.id]:s.target.value}))}),e.jsxs("div",{className:"flex flex-col gap-1.5 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:r.bundle_id_key}),e.jsx(Pe,{tone:r.platform==="ios"?"ios":r.platform==="android"?"android":void 0,variant:r.platform==="both"?"secondary":void 0,className:"capitalize",children:r.platform})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(h,{size:"sm",variant:"outline",disabled:L[r.id],onClick:()=>ce(r.id),children:L[r.id]?"Saving…":"Save"}),e.jsxs(Ce,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx(h,{size:"sm",variant:"destructive",disabled:B[r.id],children:B[r.id]?"Deleting…":"Delete"})}),e.jsxs(Fe,{children:[e.jsxs(ke,{children:[e.jsx(De,{children:"Delete app?"}),e.jsxs(Te,{children:["This will permanently delete ",e.jsx("strong",{children:r.name})," and all its builds. This action cannot be undone."]})]}),e.jsxs(qe,{children:[e.jsx(Ee,{className:"w-24",children:"Cancel"}),e.jsx(Oe,{className:je(we({variant:"destructive"}),"w-24"),onClick:()=>de(r.id),children:"Delete"})]})]})]})]})]})]},r.id))})})]})]})}export{Ve as DefaultSettings};
@@ -1 +0,0 @@
1
- import{k as F,j as e}from"./vendor-react-BlPSzrEe.js";import{aK as Q,aB as W,aQ as K,aO as M,aN as U,C as R,c as T,d as O,b as E,a as z,L as m,I as f,h as G,W as Y,F as u,S as V,ab as J,P as X,B as Z,s as $,av as I,au as ee,az as v,v as ae,w as se,Q as re,aR as te}from"./index-DSW9h8XX.js";import{F as ie}from"./field-hint-Csb40Gzp.js";import{b as ne,c as oe,L as de}from"./vendor-router-B_lVHrKl.js";import{P as le}from"./pencil-BN18R4oa.js";const ce=ee({displayName:v().optional(),avatar:re(File).nullable().optional(),password:v().min(ae,se),confirm:v()}).refine(o=>o.password===o.confirm,{message:"Passwords do not match",path:["confirm"]});function ve(){var b,N,C,S,k,P;const o=ne(),[q]=oe(),i=q.get("token")??"",[x,A]=F.useState(null),g=F.useRef(null),{register:p,handleSubmit:L,control:j,setError:d,formState:{errors:a,isSubmitting:w,submitCount:_}}=Q({shouldFocusError:!1,resolver:W(ce),defaultValues:{displayName:"",avatar:null}}),l=K({control:j,name:"displayName"})??"",B=M(),h=U({queryKey:I.inviteToken(i),queryFn:()=>te(i),enabled:i!=="",staleTime:1/0}),y=!i||h.isError?"invalid":h.isPending?"loading":"valid",D=((b=h.data)==null?void 0:b.role)??"";async function H(t){var n;try{const s=new FormData;s.append("token",i),s.append("password",t.password),(n=t.displayName)!=null&&n.trim()&&s.append("display_name",t.displayName.trim()),t.avatar&&s.append("avatar",t.avatar);const r=await fetch("/api/v1/invitations/accept",{method:"POST",body:s});if(r.status===409){d("root",{type:"already-member",message:"This email already has an account. Sign in instead, or ask your admin for a password reset link."});return}if(!r.ok){const c=await r.json().catch(()=>({}));d("root",{message:c.error??"Failed to accept invitation"});return}B.removeQueries({queryKey:I.inviteToken(i)}),o("/app-center",{replace:!0})}catch{d("root",{message:"Network error. Please try again."})}}return y==="loading"?e.jsx("div",{className:"flex min-h-svh items-center justify-center"}):y==="invalid"?e.jsx("div",{className:"bg-mesh-gradient flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsx(R,{level:4,className:"w-full max-w-sm text-center",children:e.jsxs(T,{children:[e.jsx(O,{children:"Invitation expired"}),e.jsx(E,{children:"This invite link is invalid or has expired. Ask your admin for a new one."})]})})}):e.jsx("div",{className:"bg-mesh-gradient flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsxs(R,{level:4,className:"w-full max-w-sm",children:[e.jsxs(T,{className:"text-center",children:[e.jsx(O,{children:"Set up your account"}),e.jsxs(E,{children:["You're joining as ",e.jsx("strong",{children:D})]})]}),e.jsx(z,{children:e.jsxs("form",{onSubmit:L(H),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(m,{htmlFor:"display-name",children:["Nickname ",e.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),e.jsx(f,{id:"display-name",placeholder:"Your name",...p("displayName")})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(m,{children:["Avatar ",e.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional, png · jpg, max 2MB)"})]}),e.jsx(G,{name:"avatar",control:j,render:({field:t})=>{var n;return e.jsxs("div",{className:"relative w-14 h-14",children:[x?e.jsx("img",{src:x,alt:"Avatar preview",className:"w-14 h-14 rounded-full object-cover border"}):e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center text-lg font-medium",style:(()=>{const s=Y(l);return{backgroundColor:s.bg,color:s.fg}})(),children:((n=l==null?void 0:l[0])==null?void 0:n.toUpperCase())??"?"}),e.jsx("button",{type:"button","aria-label":a.avatar?"Change avatar — the file was rejected":"Change avatar","aria-describedby":a.avatar?"avatar-error":void 0,onClick:()=>{var s;return(s=g.current)==null?void 0:s.click()},className:"absolute bottom-0 right-0 w-6 h-6 rounded-full bg-background border border-border shadow-sm flex items-center justify-center hover:bg-accent transition-colors",children:e.jsx(le,{className:"w-3 h-3","aria-hidden":"true"})}),e.jsx("input",{ref:g,type:"file",accept:"image/png,image/jpeg",className:"hidden",onChange:s=>{var c;const r=(c=s.target.files)==null?void 0:c[0];if(r){if(r.size>2*1024*1024){d("avatar",{message:"Max 2MB for avatar"});return}t.onChange(r),A(URL.createObjectURL(r))}}})]})}}),e.jsx(u,{assertive:!0,id:"avatar-error",message:(N=a.avatar)==null?void 0:N.message})]}),e.jsx(V,{}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(m,{htmlFor:"password",children:"Password"}),e.jsx(f,{id:"password",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!a.password,"aria-describedby":J("password-hint","password-error",!!a.password),...p("password")}),!a.password&&e.jsx(ie,{id:"password-hint",children:X}),e.jsx(u,{id:"password-error",message:(C=a.password)==null?void 0:C.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(m,{htmlFor:"confirm",children:"Confirm password"}),e.jsx(f,{id:"confirm",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!a.confirm,"aria-describedby":a.confirm?"confirm-error":void 0,...p("confirm")}),e.jsx(u,{id:"confirm-error",message:(S=a.confirm)==null?void 0:S.message})]}),e.jsx(u,{assertive:!0,id:"invite-error",message:(k=a.root)==null?void 0:k.message}),((P=a.root)==null?void 0:P.type)==="already-member"&&e.jsx(de,{to:"/login",className:"text-sm text-center underline underline-offset-4",children:"Go to sign in"}),e.jsx(Z,{type:"submit",disabled:w,className:"w-full",children:w?"Creating account…":"Create account"}),e.jsx($,{errors:a,submitCount:_})]})})]})})}export{ve as Invite};
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{k as N,f as Xe,j as s}from"./vendor-react-BlPSzrEe.js";import{aE as Et,aN as bt,aO as Lt,M as Tt,ai as Ot,av as Qe,ak as Rt}from"./index-DSW9h8XX.js";import{R as Ct,u as Dt,T as It,b as Pt,c as Kt}from"./resource-health-Bi20EUDs.js";import{t as Ft,i as jt,j as Ht,h as Ut,g as Bt,f as _t,l as Gt,P as qt,e as Qt,G as Wt,A as Xt,m as wt,d as Vt,a as zt,b as Yt,L as Jt,B as Zt,c as es}from"./vendor-charts-BykzUV2D.js";import"./vendor-router-B_lVHrKl.js";const ts=t=>(document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t));function ss(){return N.useSyncExternalStore(ts,ls,ns)}function ns(){return!0}function ls(){return document.visibilityState!=="hidden"}function os(t,e){const o=Xe.c(4),[m,y]=N.useState(as);let i,n;return o[0]!==e||o[1]!==t?(i=()=>{if(!e)return;y(Date.now());const h=setInterval(()=>y(Date.now()),t);return()=>clearInterval(h)},n=[t,e],o[0]=e,o[1]=t,o[2]=i,o[3]=n):(i=o[2],n=o[3]),N.useEffect(i,n),m}function as(){return Date.now()}const xt={"1h":36e5,"6h":216e5,"24h":864e5,"7d":6048e5},rs={"1h":Ht.every(10),"6h":jt,"24h":jt.every(3),"7d":Ft};function is(t,e,o){return rs[o].range(new Date(t),new Date(e+1))}function cs(t,e){const o=new Date(t);return e==="7d"?`${o.getMonth()+1}/${o.getDate()}`:`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}const ds=2e3;function us(t){return Math.min(1e4,Math.max(1e3,xt[t]/ds))}const fs={"1h":6e4,"6h":6e4,"24h":3e5,"7d":9e5},pt=t=>Math.round(t*10)/10;function ms(t,e,o){let m;for(const i of t){const n=i.agentName===e?i.resources:void 0;n&&(!m||n.reportedAt>m.reportedAt)&&(m=n)}if(!m||o-m.reportedAt>Ct)return null;const y=i=>Number.isFinite(i)?pt(i):null;return{cpu:y(m.cpuPercent),mem:y(m.memUsedMB/m.memTotalMB*100)}}const $t={cpu:{label:"CPU",color:"#60a5fa"},mem:{label:"RAM",color:"#a78bfa"}},At={"1h":"1h","6h":"6h","24h":"24h","7d":"7d"};function Es(){const t=Xe.c(65);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[o,m]=N.useState(e),[y,i]=N.useState(null),[n,h]=N.useState("24h"),R=ss();let k;t[1]!==n?(k=us(n),t[1]=n,t[2]=k):k=t[2];const x=os(k,R),{setNode:b}=Et();let p,j;t[3]!==b?(p=()=>(b(s.jsx("span",{className:"text-sm font-medium",children:"Mac Resources"})),()=>b(null)),j=[b],t[3]=b,t[4]=p,t[5]=j):(p=t[4],j=t[5]),N.useEffect(p,j);let C;t[6]===Symbol.for("react.memo_cache_sentinel")?(C=u=>{u.type==="agents:listed"&&m(u.sessions??[])},t[6]=C):C=t[6];const Q=C,{send:L,connected:T}=Dt(Q);let ie,ce;t[7]!==T||t[8]!==L?(ie=()=>{if(!T)return;L({type:"agents:list"});const u=setInterval(()=>L({type:"agents:list"}),1e4);return()=>clearInterval(u)},ce=[T,L],t[7]=T,t[8]=L,t[9]=ie,t[10]=ce):(ie=t[9],ce=t[10]),N.useEffect(ie,ce);let le;t[11]===Symbol.for("react.memo_cache_sentinel")?(le={queryKey:Qe.agents,queryFn:Ot,refetchOnWindowFocus:!1},t[11]=le):le=t[11];const W=bt(le);let c,d,F,oe;t[12]!==W.data||t[13]!==o?(F=W.data??[],d=o.map(ps).filter(Boolean),c=[...new Set([...d,...F])],oe=new Set(d),t[12]=W.data,t[13]=o,t[14]=c,t[15]=d,t[16]=F,t[17]=oe):(c=t[14],d=t[15],F=t[16],oe=t[17]);const w=oe,l=y??(W.isPending?null:F[0]??d[0]??null),H=Lt();let Z;t[18]!==n||t[19]!==l?(Z=l?Qe.resourceHistory(l,n):null,t[18]=n,t[19]=l,t[20]=Z):Z=t[20];const ee=Z;let D;t[21]!==ee||t[22]!==n?(D=ee??Qe.resourceHistory("",n),t[21]=ee,t[22]=n,t[23]=D):D=t[23];let U;t[24]!==n||t[25]!==l?(U=u=>{const{signal:E}=u;return Rt(l,n,E)},t[24]=n,t[25]=l,t[26]=U):U=t[26];let X;t[27]!==D||t[28]!==U?(X={queryKey:D,queryFn:U,enabled:!1},t[27]=D,t[28]=U,t[29]=X):X=t[29];const I=bt(X),B=I.refetch;let P,V;t[30]!==H||t[31]!==n||t[32]!==B||t[33]!==l||t[34]!==R?(P=()=>{if(!l||!R)return;const u=Qe.resourceHistory(l,n),E=fs[n],q=()=>{const ne=H.getQueryState(u);(ne==null?void 0:ne.fetchStatus)==="fetching"&&ne.data===void 0?H.cancelQueries({queryKey:u,exact:!0}).then(()=>B()):B({cancelRefetch:!0})},g=H.getQueryState(u),ae=Math.max((g==null?void 0:g.dataUpdatedAt)??0,(g==null?void 0:g.errorUpdatedAt)??0),se=(g==null?void 0:g.data)!==void 0&&ae>0?Math.max(0,E-(Date.now()-ae)):0;let de;const re=()=>{q(),de=setInterval(q,E)},Ve=se>0?setTimeout(re,se):void 0;return se===0&&re(),()=>{clearTimeout(Ve),clearInterval(de),H.cancelQueries({queryKey:u,exact:!0})}},V=[l,n,R,B,H],t[30]=H,t[31]=n,t[32]=B,t[33]=l,t[34]=R,t[35]=P,t[36]=V):(P=t[35],V=t[36]),N.useEffect(P,V);const S=I.data!==void 0||I.isError,te=ee!==null&&!S;let r;t[37]!==I.data?(r=I.data??[],t[37]=I.data,t[38]=r):r=t[38];let z;t[39]!==r?(z=r.map(xs),t[39]=r,t[40]=z):z=t[40];const G=z;let Y;t[41]!==x||t[42]!==l||t[43]!==o?(Y=l?ms(o,l,x):null,t[41]=x,t[42]=l,t[43]=o,t[44]=Y):Y=t[44];const f=Y;let _;t[45]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("h1",{className:"sr-only",children:"Mac Resources"}),t[45]=_):_=t[45];let v;t[46]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("h2",{id:"macs-heading",className:"px-2 pb-1 font-mono text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Macs"}),t[46]=v):v=t[46];let M;t[47]!==c||t[48]!==T||t[49]!==w||t[50]!==l?(M=c.length===0?s.jsx("span",{className:"px-2 text-sm text-muted-foreground",children:T?"No agents yet.":"Connecting…"}):c.map(u=>{const E=w.has(u),q=l===u;return s.jsxs("button",{onClick:()=>i(u),"aria-current":q?"true":void 0,className:["flex items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-accent transition-colors",q?"bg-accent font-medium":""].join(" "),children:[s.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full ${E?"bg-emerald-400":"bg-muted-foreground/40"}`,"aria-hidden":"true"}),s.jsx("span",{className:"truncate min-w-0",children:u}),s.jsx("span",{className:"sr-only",children:E?"Online":"Offline"})]},u)}),t[47]=c,t[48]=T,t[49]=w,t[50]=l,t[51]=M):M=t[51];let $;t[52]!==M?($=s.jsxs("aside",{"aria-labelledby":"macs-heading",className:"w-64 shrink-0 border-r flex flex-col gap-1 p-3 overflow-y-auto",children:[v,M]}),t[52]=M,t[53]=$):$=t[53];let A;t[54]!==G||t[55]!==(f==null?void 0:f.cpu)||t[56]!==(f==null?void 0:f.mem)||t[57]!==te||t[58]!==x||t[59]!==n||t[60]!==l?(A=s.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:l?s.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-base font-semibold",children:l}),s.jsx(It,{value:n,onValueChange:u=>h(u),children:s.jsx(Pt,{children:Object.keys(At).map(hs)})})]}),te?s.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading…"}):G.length===0?s.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"No data yet for this range. Data is collected every minute while the agent is connected."}):s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Nt,{title:"CPU %",color:"cpu",data:G,dataKey:"cpu",range:n,now:x,live:(f==null?void 0:f.cpu)??null}),s.jsx(Nt,{title:"RAM %",color:"mem",data:G,dataKey:"mem",range:n,now:x,live:(f==null?void 0:f.mem)??null})]})]}):s.jsxs("div",{className:"flex h-full items-center justify-center gap-2 text-muted-foreground",children:[s.jsx(Tt,{className:"h-8 w-8"}),s.jsx("p",{className:"text-sm",children:"Select a Mac to view resource history."})]})}),t[54]=G,t[55]=f==null?void 0:f.cpu,t[56]=f==null?void 0:f.mem,t[57]=te,t[58]=x,t[59]=n,t[60]=l,t[61]=A):A=t[61];let J;return t[62]!==$||t[63]!==A?(J=s.jsxs("div",{className:"flex h-full min-h-0",children:[_,$,A]}),t[62]=$,t[63]=A,t[64]=J):J=t[64],J}function hs(t){return s.jsx(Kt,{value:t,children:At[t]},t)}function xs(t){return{time:t.recorded_at,cpu:pt(t.cpu_percent),mem:pt(t.mem_percent)}}function ps(t){return t.agentName}const gt=t=>new Date(t.time).getTime(),St=t=>new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),We=t=>`${Math.round(t*10)/10}%`,gs=_t(gt).left,ys=_t(t=>t.t).left,K={top:8,right:24,bottom:24,left:40},kt=16,Mt=6,vs=20,bs=40;function Nt(t){const e=Xe.c(18),{title:o,color:m,data:y,dataKey:i,range:n,now:h,live:R}=t,k=$t[m].color;let x;e[0]!==k?(x=s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{background:k}}),e[0]=k,e[1]=x):x=e[1];let b;e[2]!==o?(b=s.jsx("h2",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=b):b=e[3];let p;e[4]!==x||e[5]!==b?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[x,b]}),e[4]=x,e[5]=b,e[6]=p):p=e[6];let j;e[7]!==y||e[8]!==i||e[9]!==k||e[10]!==R||e[11]!==h||e[12]!==n||e[13]!==o?(j=s.jsx("div",{className:"relative h-[220px] w-full",children:s.jsx(qt,{children:Q=>{const{width:L,height:T}=Q;return L>0&&T>0?s.jsx(js,{width:L,height:T,data:y,dataKey:i,hex:k,range:n,now:h,live:R,label:o}):null}})}),e[7]=y,e[8]=i,e[9]=k,e[10]=R,e[11]=h,e[12]=n,e[13]=o,e[14]=j):j=e[14];let C;return e[15]!==p||e[16]!==j?(C=s.jsxs("div",{className:"rounded-lg border p-4 flex flex-col gap-3",children:[p,j]}),e[15]=p,e[16]=j,e[17]=C):C=e[17],C}function js(t){const e=Xe.c(139),{width:o,height:m,data:y,dataKey:i,hex:n,range:h,now:R,live:k,label:x}=t,b=k===void 0?null:k,p=`chart-hint-${i}`,[j,C]=N.useState(null),[Q,L]=N.useState(!1),[T,ie]=N.useState(null),[ce,le]=N.useState(!1),W=ce?T:null,c=o-K.left-K.right,d=m-K.top-K.bottom,F=R,oe=F-xt[h],w=Ut({domain:[oe,F],range:[0,Math.max(0,c)]}),l=Bt({domain:[0,100],range:[d,kt]}),H=c>0?vs/c*xt[h]:0,Z=oe-H,ee=F+H;let D;e[0]!==h||e[1]!==Z||e[2]!==ee?(D=is(Z,ee,h),e[0]=h,e[1]=Z,e[2]=ee,e[3]=D):D=e[3];const U=D,X=c>0?Math.min(.5,bs/c):0,I=`fill-${i}`,B=`plot-${i}`,P=`axis-fade-${i}`,V=y[y.length-1],S=b!==null&&V?{t:Math.max(F,gt(V)+1),v:b,live:!0}:null;let te;e[4]!==i?(te=a=>({t:gt(a),v:a[i]}),e[4]=i,e[5]=te):te=e[5];const r=y.map(te);S&&r.push(S);const z=a=>Math.min(w(a),c),G=S?z(S.t):0,Y=S?l(S.v):0,f=Math.max(0,y.length-1),_=j===null?Math.max(0,r.length-1):j==="live"?S?r.length-1:f:Math.min(gs(y,j),f),v=Q?r[_]:void 0,M=v?z(v.t):0,$=v?l(v.v):0,A=$t[i].label;let J;e[6]!==A?(J=a=>`${A}, ${St(a.t)}, ${a.live?"latest, ":""}${We(a.v)}`,e[6]=A,e[7]=J):J=e[7];const u=J,E=a=>{const O=r[a];O&&(C(O.live?"live":O.t),L(!0),ie({now:a,text:u(O)}))};let q;e[8]===Symbol.for("react.memo_cache_sentinel")?(q=()=>L(!1),e[8]=q):q=e[8];const g=q;let ae,se;e[9]!==Q?(ae=()=>{if(!Q)return;const a=O=>{O.key==="Escape"&&L(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},se=[Q],e[9]=Q,e[10]=ae,e[11]=se):(ae=e[10],se=e[11]),N.useEffect(ae,se);const de=a=>{if(r.length===0)return;const O=_,Fe=a.key==="ArrowLeft"||a.key==="ArrowDown"?Math.max(0,O-1):a.key==="ArrowRight"||a.key==="ArrowUp"?Math.min(r.length-1,O+1):a.key==="Home"?0:a.key==="End"?r.length-1:null;Fe!==null&&(a.preventDefault(),E(Fe))},re=a=>{const O=Gt(a);if(!O)return;const Fe=O.x-K.left,yt=ys(r,w.invert(Fe).getTime()),vt=[r[yt-1],r[yt],S].reduce((mt,ht)=>ht&&(!mt||Math.abs(z(ht.t)-Fe)<=Math.abs(z(mt.t)-Fe))?ht:mt,void 0);vt&&E(r.indexOf(vt))},Ve="group",ne=S?`${x}, last ${h}. Now ${We(S.v)}.`:V?`${x}, last ${h}. Latest ${We(V[i])}.`:`${x}, last ${h}. No samples.`;let ue;e[12]!==I||e[13]!==n?(ue=s.jsx(Qt,{id:I,from:n,to:n,fromOpacity:.3,toOpacity:0,fromOffset:"5%",toOffset:"95%"}),e[12]=I,e[13]=n,e[14]=ue):ue=e[14];const ze=Math.max(0,c),Ye=Math.max(0,d);let fe;e[15]!==ze||e[16]!==Ye?(fe=s.jsx("rect",{x:0,y:0,width:ze,height:Ye}),e[15]=ze,e[16]=Ye,e[17]=fe):fe=e[17];let me;e[18]!==B||e[19]!==fe?(me=s.jsx("clipPath",{id:B,children:fe}),e[18]=B,e[19]=fe,e[20]=me):me=e[20];const Je=`${P}-grad`,Ze=Math.max(0,c);let He;e[21]===Symbol.for("react.memo_cache_sentinel")?(He=s.jsx("stop",{offset:0,stopColor:"white",stopOpacity:0}),e[21]=He):He=e[21];let he;e[22]!==X?(he=s.jsx("stop",{offset:X,stopColor:"white",stopOpacity:1}),e[22]=X,e[23]=he):he=e[23];const et=1-X;let xe;e[24]!==et?(xe=s.jsx("stop",{offset:et,stopColor:"white",stopOpacity:1}),e[24]=et,e[25]=xe):xe=e[25];let Ue;e[26]===Symbol.for("react.memo_cache_sentinel")?(Ue=s.jsx("stop",{offset:1,stopColor:"white",stopOpacity:0}),e[26]=Ue):Ue=e[26];let pe;e[27]!==Je||e[28]!==Ze||e[29]!==he||e[30]!==xe?(pe=s.jsxs("linearGradient",{id:Je,gradientUnits:"userSpaceOnUse",x1:0,y1:0,x2:Ze,y2:0,children:[He,he,xe,Ue]}),e[27]=Je,e[28]=Ze,e[29]=he,e[30]=xe,e[31]=pe):pe=e[31];const tt=Math.max(0,c),st=Math.max(0,c),nt=`url(#${P}-grad)`;let ge;e[32]!==d||e[33]!==st||e[34]!==nt?(ge=s.jsx("rect",{x:0,y:d,width:st,height:K.bottom*2,fill:nt}),e[32]=d,e[33]=st,e[34]=nt,e[35]=ge):ge=e[35];let ye;e[36]!==P||e[37]!==d||e[38]!==tt||e[39]!==ge?(ye=s.jsx("mask",{id:P,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse",x:0,y:d,width:tt,height:K.bottom*2,children:ge}),e[36]=P,e[37]=d,e[38]=tt,e[39]=ge,e[40]=ye):ye=e[40];let Be;e[41]===Symbol.for("react.memo_cache_sentinel")?(Be=[0,25,50,75,100],e[41]=Be):Be=e[41];let ve;e[42]!==c||e[43]!==l?(ve=s.jsx(Wt,{scale:l,width:c,tickValues:Be,strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),e[42]=c,e[43]=l,e[44]=ve):ve=e[44];const lt=`url(#${B})`;let be;e[45]!==w?(be=a=>w(a.t),e[45]=w,e[46]=be):be=e[46];let je;e[47]!==l?(je=a=>l(a.v),e[47]=l,e[48]=je):je=e[48];const ot=`url(#${I})`;let we;e[49]!==r||e[50]!==be||e[51]!==je||e[52]!==ot||e[53]!==l?(we=s.jsx(Xt,{data:r,x:be,y:je,yScale:l,curve:wt,fill:ot}),e[49]=r,e[50]=be,e[51]=je,e[52]=ot,e[53]=l,e[54]=we):we=e[54];let Se;e[55]!==w?(Se=a=>w(a.t),e[55]=w,e[56]=Se):Se=e[56];let ke;e[57]!==l?(ke=a=>l(a.v),e[57]=l,e[58]=ke):ke=e[58];let Me;e[59]!==n||e[60]!==r||e[61]!==Se||e[62]!==ke?(Me=s.jsx(Vt,{data:r,x:Se,y:ke,curve:wt,stroke:n,strokeWidth:1.5}),e[59]=n,e[60]=r,e[61]=Se,e[62]=ke,e[63]=Me):Me=e[63];let Ne;e[64]!==lt||e[65]!==we||e[66]!==Me?(Ne=s.jsxs("g",{clipPath:lt,children:[we,Me]}),e[64]=lt,e[65]=we,e[66]=Me,e[67]=Ne):Ne=e[67];const at=`url(#${P})`;let _e;e[68]!==h?(_e=a=>cs(+a,h),e[68]=h,e[69]=_e):_e=e[69];let $e;e[70]!==d||e[71]!==_e||e[72]!==U||e[73]!==w?($e=s.jsx(zt,{top:d,scale:w,tickValues:U,tickFormat:_e,hideAxisLine:!0,hideTicks:!0,tickLength:0,tickLabelProps:ks}),e[70]=d,e[71]=_e,e[72]=U,e[73]=w,e[74]=$e):$e=e[74];let Ae;e[75]!==at||e[76]!==$e?(Ae=s.jsx("g",{mask:at,children:$e}),e[75]=at,e[76]=$e,e[77]=Ae):Ae=e[77];let Ge;e[78]===Symbol.for("react.memo_cache_sentinel")?(Ge=[0,25,50,75,100],e[78]=Ge):Ge=e[78];let Ee;e[79]!==l?(Ee=s.jsx(Yt,{scale:l,tickValues:Ge,tickFormat:Ss,hideAxisLine:!0,hideTicks:!0,tickLabelProps:ws}),e[79]=l,e[80]=Ee):Ee=e[80];let Le;e[81]!==G||e[82]!==Y||e[83]!==n||e[84]!==S?(Le=S&&s.jsxs("g",{className:"live-head","aria-hidden":"true",pointerEvents:"none",children:[s.jsx("circle",{cx:G,cy:Y,r:Mt,fill:n,fillOpacity:.2}),s.jsx("circle",{cx:G,cy:Y,r:3,fill:n,stroke:"hsl(var(--background))",strokeWidth:1.5})]}),e[81]=G,e[82]=Y,e[83]=n,e[84]=S,e[85]=Le):Le=e[85];let Te;e[86]!==n||e[87]!==d||e[88]!==v||e[89]!==M||e[90]!==$?(Te=v&&s.jsxs("g",{style:{transition:"transform 0.25s ease-out",transform:`translateX(${M}px)`},pointerEvents:"none",children:[s.jsx(Jt,{from:{x:0,y:kt},to:{x:0,y:d},stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:0,cy:0,r:3,fill:n,stroke:"hsl(var(--background))",strokeWidth:1.5,style:{transition:"transform 0.25s ease-out",transform:`translateY(${$}px)`}})]}),e[86]=n,e[87]=d,e[88]=v,e[89]=M,e[90]=$,e[91]=Te):Te=e[91];const rt=Math.max(0,c)+Mt,it=Math.max(0,d),ct=`${x} samples`,dt=Math.max(0,r.length-1),ut=W?Math.min(W.now,Math.max(0,r.length-1)):_,ft=W?W.text:r[_]?u(r[_]):void 0;let Oe;e[92]!==_||e[93]!==E?(Oe=()=>{le(!0),E(_)},e[92]=_,e[93]=E,e[94]=Oe):Oe=e[94];let Re;e[95]!==g?(Re=()=>{g(),le(!1)},e[95]=g,e[96]=Re):Re=e[96];let Ce;e[97]!==de||e[98]!==re||e[99]!==g||e[100]!==p||e[101]!==rt||e[102]!==it||e[103]!==ct||e[104]!==dt||e[105]!==ut||e[106]!==ft||e[107]!==Oe||e[108]!==Re?(Ce=s.jsx(Zt,{x:0,y:0,width:rt,height:it,fill:"transparent",tabIndex:0,role:"slider","aria-label":ct,"aria-valuemin":0,"aria-valuemax":dt,"aria-valuenow":ut,"aria-valuetext":ft,"aria-describedby":p,className:"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",onFocus:Oe,onBlur:Re,onKeyDown:de,onMouseMove:re,onMouseLeave:g,onTouchMove:re,onTouchEnd:g,onTouchCancel:g}),e[97]=de,e[98]=re,e[99]=g,e[100]=p,e[101]=rt,e[102]=it,e[103]=ct,e[104]=dt,e[105]=ut,e[106]=ft,e[107]=Oe,e[108]=Re,e[109]=Ce):Ce=e[109];let De;e[110]!==ve||e[111]!==Ne||e[112]!==Ae||e[113]!==Ee||e[114]!==Le||e[115]!==Te||e[116]!==Ce?(De=s.jsxs(es,{left:K.left,top:K.top,children:[ve,Ne,Ae,Ee,Le,Te,Ce]}),e[110]=ve,e[111]=Ne,e[112]=Ae,e[113]=Ee,e[114]=Le,e[115]=Te,e[116]=Ce,e[117]=De):De=e[117];let Ie;e[118]!==m||e[119]!==ne||e[120]!==ue||e[121]!==me||e[122]!==pe||e[123]!==ye||e[124]!==De||e[125]!==o?(Ie=s.jsxs("svg",{width:o,height:m,role:Ve,"aria-label":ne,children:[ue,me,pe,ye,De]}),e[118]=m,e[119]=ne,e[120]=ue,e[121]=me,e[122]=pe,e[123]=ye,e[124]=De,e[125]=o,e[126]=Ie):Ie=e[126];let Pe;e[127]!==p?(Pe=s.jsx("p",{id:p,className:"sr-only",children:"Use the arrow keys to read individual samples, and End for the latest value. Escape hides the reading."}),e[127]=p,e[128]=Pe):Pe=e[128];let Ke;e[129]!==c||e[130]!==A||e[131]!==v||e[132]!==M||e[133]!==$?(Ke=v&&s.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 left-0 whitespace-nowrap rounded-lg border bg-background px-3 py-2 text-xs text-foreground shadow-md",style:{transform:`translate(${M+K.left}px, ${$+K.top}px) translate(${M>c*.6?"calc(-100% - 12px)":"12px"}, -50%)`,transition:"transform 0.25s ease-out"},children:[s.jsxs("p",{className:"mb-1",children:["Date: ",St(v.t)]}),s.jsxs("p",{children:[A,": ",We(v.v)]})]}),e[129]=c,e[130]=A,e[131]=v,e[132]=M,e[133]=$,e[134]=Ke):Ke=e[134];let qe;return e[135]!==Ie||e[136]!==Pe||e[137]!==Ke?(qe=s.jsxs(s.Fragment,{children:[Ie,Pe,Ke]}),e[135]=Ie,e[136]=Pe,e[137]=Ke,e[138]=qe):qe=e[138],qe}function ws(){return{fontSize:11,fill:"currentColor",textAnchor:"end",dx:-4,dy:3,className:"fill-muted-foreground"}}function Ss(t){return`${t}%`}function ks(){return{fontSize:11,fill:"currentColor",textAnchor:"middle",dy:6,className:"fill-muted-foreground"}}export{js as AreaChartInner,Es as MacResources};