@tapflowio/relay 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/RelayServer.d.ts +6 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +48 -3
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/config.d.ts +14 -0
  10. package/dist/lib/config.d.ts.map +1 -1
  11. package/dist/lib/config.js +98 -0
  12. package/dist/lib/config.js.map +1 -1
  13. package/dist/lib/launchDefaults.d.ts +25 -0
  14. package/dist/lib/launchDefaults.d.ts.map +1 -0
  15. package/dist/lib/launchDefaults.js +41 -0
  16. package/dist/lib/launchDefaults.js.map +1 -0
  17. package/dist/server.js +2 -2
  18. package/dist/server.js.map +1 -1
  19. package/package.json +4 -4
  20. package/public/assets/{AISessionWatch-BSBkpTom.js → AISessionWatch-DMfOAt_U.js} +7 -7
  21. package/public/assets/AISessionWatch-DMfOAt_U.js.br +0 -0
  22. package/public/assets/AISessionWatch-DMfOAt_U.js.gz +0 -0
  23. package/public/assets/AndroidDeviceScreen-1RaPu10r.js +35 -0
  24. package/public/assets/AndroidDeviceScreen-1RaPu10r.js.br +0 -0
  25. package/public/assets/AndroidDeviceScreen-1RaPu10r.js.gz +0 -0
  26. package/public/assets/{AppCenter-DD_6LQx-.js → AppCenter-BWgstOJH.js} +6 -6
  27. package/public/assets/AppCenter-BWgstOJH.js.br +0 -0
  28. package/public/assets/AppCenter-BWgstOJH.js.gz +0 -0
  29. package/public/assets/{Default-CQ3Ae2mK.js → Default-Obywi6hR.js} +1 -1
  30. package/public/assets/Default-Obywi6hR.js.br +0 -0
  31. package/public/assets/Default-Obywi6hR.js.gz +0 -0
  32. package/public/assets/{Invite-D1uNMm0-.js → Invite-BVRKLYJu.js} +1 -1
  33. package/public/assets/Invite-BVRKLYJu.js.br +0 -0
  34. package/public/assets/Invite-BVRKLYJu.js.gz +0 -0
  35. package/public/assets/{MacResources-D2UeRbKL.js → MacResources-B6_Es8ye.js} +1 -1
  36. package/public/assets/MacResources-B6_Es8ye.js.br +0 -0
  37. package/public/assets/MacResources-B6_Es8ye.js.gz +0 -0
  38. package/public/assets/QASession-BuQdx-pq.js +81 -0
  39. package/public/assets/QASession-BuQdx-pq.js.br +0 -0
  40. package/public/assets/QASession-BuQdx-pq.js.gz +0 -0
  41. package/public/assets/{ResetPassword-B-4Uyfwr.js → ResetPassword-DU97TnMC.js} +1 -1
  42. package/public/assets/ResetPassword-DU97TnMC.js.br +0 -0
  43. package/public/assets/ResetPassword-DU97TnMC.js.gz +0 -0
  44. package/public/assets/{RunDetail-C50RjsuM.js → RunDetail-BspFUFg2.js} +4 -4
  45. package/public/assets/RunDetail-BspFUFg2.js.br +0 -0
  46. package/public/assets/RunDetail-BspFUFg2.js.gz +0 -0
  47. package/public/assets/{Runs-A7RcDLgO.js → Runs-BdCnN_dH.js} +2 -2
  48. package/public/assets/Runs-BdCnN_dH.js.br +0 -0
  49. package/public/assets/Runs-BdCnN_dH.js.gz +0 -0
  50. package/public/assets/{Setup-DK6TZbwh.js → Setup-D4DsciMG.js} +1 -1
  51. package/public/assets/Setup-D4DsciMG.js.br +0 -0
  52. package/public/assets/Setup-D4DsciMG.js.gz +0 -0
  53. package/public/assets/{Team-VoGput2p.js → Team-B2Txvi0a.js} +2 -2
  54. package/public/assets/Team-B2Txvi0a.js.br +0 -0
  55. package/public/assets/Team-B2Txvi0a.js.gz +0 -0
  56. package/public/assets/{Tokens-qkcJgunR.js → Tokens-D-ekP8kU.js} +1 -1
  57. package/public/assets/Tokens-D-ekP8kU.js.br +0 -0
  58. package/public/assets/Tokens-D-ekP8kU.js.gz +0 -0
  59. package/public/assets/WatchedDevice-D-SfDxp8.js +1 -0
  60. package/public/assets/WatchedDevice-D-SfDxp8.js.br +0 -0
  61. package/public/assets/WatchedDevice-D-SfDxp8.js.gz +0 -0
  62. package/public/assets/{aiSession-U7UqgdSb.js → aiSession-p7Uu2swu.js} +6 -6
  63. package/public/assets/aiSession-p7Uu2swu.js.br +0 -0
  64. package/public/assets/aiSession-p7Uu2swu.js.gz +0 -0
  65. package/public/assets/{alert-dialog-C0mRms8g.js → alert-dialog-DPNbpxqG.js} +1 -1
  66. package/public/assets/alert-dialog-DPNbpxqG.js.br +0 -0
  67. package/public/assets/alert-dialog-DPNbpxqG.js.gz +0 -0
  68. package/public/assets/{badge-BjEnOmb0.js → badge-Bjwwchrt.js} +1 -1
  69. package/public/assets/badge-Bjwwchrt.js.br +0 -0
  70. package/public/assets/badge-Bjwwchrt.js.gz +0 -0
  71. package/public/assets/{dialog-Cugbp1C4.js → dialog-CrzZQwxn.js} +1 -1
  72. package/public/assets/dialog-CrzZQwxn.js.br +0 -0
  73. package/public/assets/dialog-CrzZQwxn.js.gz +0 -0
  74. package/public/assets/{field-hint-qmBa0qqN.js → field-hint-CIJmSABE.js} +1 -1
  75. package/public/assets/field-hint-CIJmSABE.js.br +2 -0
  76. package/public/assets/field-hint-CIJmSABE.js.gz +0 -0
  77. package/public/assets/index-CiJwpDAf.js +248 -0
  78. package/public/assets/index-CiJwpDAf.js.br +0 -0
  79. package/public/assets/index-CiJwpDAf.js.gz +0 -0
  80. package/public/assets/index-DKKkUgNI.css +1 -0
  81. package/public/assets/index-DKKkUgNI.css.br +0 -0
  82. package/public/assets/index-DKKkUgNI.css.gz +0 -0
  83. package/public/assets/{list-view-CyM0QUaH.js → list-view-DpnCsTM-.js} +1 -1
  84. package/public/assets/list-view-DpnCsTM-.js.br +0 -0
  85. package/public/assets/list-view-DpnCsTM-.js.gz +0 -0
  86. package/public/assets/{pencil-DUZRZB3S.js → pencil-CE5LnE8i.js} +2 -2
  87. package/public/assets/pencil-CE5LnE8i.js.br +0 -0
  88. package/public/assets/pencil-CE5LnE8i.js.gz +0 -0
  89. package/public/assets/{play-Z1L2Eb91.js → play-BR_CdQzZ.js} +2 -2
  90. package/public/assets/play-BR_CdQzZ.js.br +0 -0
  91. package/public/assets/play-BR_CdQzZ.js.gz +0 -0
  92. package/public/assets/{search-input-B0s9mzRt.js → search-input-2MuvmbBR.js} +2 -2
  93. package/public/assets/search-input-2MuvmbBR.js.br +0 -0
  94. package/public/assets/search-input-2MuvmbBR.js.gz +0 -0
  95. package/public/assets/{select-CHbE6M4S.js → select-7EkQtxVy.js} +3 -3
  96. package/public/assets/select-7EkQtxVy.js.br +0 -0
  97. package/public/assets/select-7EkQtxVy.js.gz +0 -0
  98. package/public/assets/{slider-tyb3JvL2.js → slider-ifEFgQFt.js} +1 -1
  99. package/public/assets/slider-ifEFgQFt.js.br +0 -0
  100. package/public/assets/slider-ifEFgQFt.js.gz +0 -0
  101. package/public/assets/{tabs-Bf7ou-eS.js → tabs-SLpwFQLx.js} +1 -1
  102. package/public/assets/tabs-SLpwFQLx.js.br +0 -0
  103. package/public/assets/tabs-SLpwFQLx.js.gz +0 -0
  104. package/public/assets/{tech-label-KAwM5qZ_.js → tech-label-DpVGqU2Y.js} +1 -1
  105. package/public/assets/tech-label-DpVGqU2Y.js.br +0 -0
  106. package/public/assets/tech-label-DpVGqU2Y.js.gz +0 -0
  107. package/public/assets/{trash-HEJmY7DQ.js → trash-DFsQhdZ1.js} +3 -3
  108. package/public/assets/trash-DFsQhdZ1.js.br +0 -0
  109. package/public/assets/trash-DFsQhdZ1.js.gz +0 -0
  110. package/public/assets/{video-DdHH0Q0l.js → video-D1ajuM3p.js} +2 -2
  111. package/public/assets/video-D1ajuM3p.js.br +0 -0
  112. package/public/assets/video-D1ajuM3p.js.gz +0 -0
  113. package/public/index.html +2 -2
  114. package/public/index.html.br +0 -0
  115. package/public/index.html.gz +0 -0
  116. package/public/assets/AISessionWatch-BSBkpTom.js.br +0 -0
  117. package/public/assets/AISessionWatch-BSBkpTom.js.gz +0 -0
  118. package/public/assets/AndroidDeviceScreen-C55msKfh.js +0 -35
  119. package/public/assets/AndroidDeviceScreen-C55msKfh.js.br +0 -0
  120. package/public/assets/AndroidDeviceScreen-C55msKfh.js.gz +0 -0
  121. package/public/assets/AppCenter-DD_6LQx-.js.br +0 -0
  122. package/public/assets/AppCenter-DD_6LQx-.js.gz +0 -0
  123. package/public/assets/Default-CQ3Ae2mK.js.br +0 -0
  124. package/public/assets/Default-CQ3Ae2mK.js.gz +0 -0
  125. package/public/assets/Invite-D1uNMm0-.js.br +0 -0
  126. package/public/assets/Invite-D1uNMm0-.js.gz +0 -0
  127. package/public/assets/MacResources-D2UeRbKL.js.br +0 -0
  128. package/public/assets/MacResources-D2UeRbKL.js.gz +0 -0
  129. package/public/assets/QASession-d0eOjXXo.js +0 -81
  130. package/public/assets/QASession-d0eOjXXo.js.br +0 -0
  131. package/public/assets/QASession-d0eOjXXo.js.gz +0 -0
  132. package/public/assets/ResetPassword-B-4Uyfwr.js.br +0 -0
  133. package/public/assets/ResetPassword-B-4Uyfwr.js.gz +0 -0
  134. package/public/assets/RunDetail-C50RjsuM.js.br +0 -0
  135. package/public/assets/RunDetail-C50RjsuM.js.gz +0 -0
  136. package/public/assets/Runs-A7RcDLgO.js.br +0 -0
  137. package/public/assets/Runs-A7RcDLgO.js.gz +0 -0
  138. package/public/assets/Setup-DK6TZbwh.js.br +0 -0
  139. package/public/assets/Setup-DK6TZbwh.js.gz +0 -0
  140. package/public/assets/Team-VoGput2p.js.br +0 -0
  141. package/public/assets/Team-VoGput2p.js.gz +0 -0
  142. package/public/assets/Tokens-qkcJgunR.js.br +0 -0
  143. package/public/assets/Tokens-qkcJgunR.js.gz +0 -0
  144. package/public/assets/WatchedDevice-CpaKHa1x.js +0 -1
  145. package/public/assets/WatchedDevice-CpaKHa1x.js.br +0 -0
  146. package/public/assets/WatchedDevice-CpaKHa1x.js.gz +0 -0
  147. package/public/assets/aiSession-U7UqgdSb.js.br +0 -0
  148. package/public/assets/aiSession-U7UqgdSb.js.gz +0 -0
  149. package/public/assets/alert-dialog-C0mRms8g.js.br +0 -0
  150. package/public/assets/alert-dialog-C0mRms8g.js.gz +0 -0
  151. package/public/assets/badge-BjEnOmb0.js.br +0 -0
  152. package/public/assets/badge-BjEnOmb0.js.gz +0 -0
  153. package/public/assets/dialog-Cugbp1C4.js.br +0 -0
  154. package/public/assets/dialog-Cugbp1C4.js.gz +0 -0
  155. package/public/assets/field-hint-qmBa0qqN.js.br +0 -0
  156. package/public/assets/field-hint-qmBa0qqN.js.gz +0 -0
  157. package/public/assets/index-C_3Q51YJ.js +0 -248
  158. package/public/assets/index-C_3Q51YJ.js.br +0 -0
  159. package/public/assets/index-C_3Q51YJ.js.gz +0 -0
  160. package/public/assets/index-h2hiZ2OM.css +0 -1
  161. package/public/assets/index-h2hiZ2OM.css.br +0 -0
  162. package/public/assets/index-h2hiZ2OM.css.gz +0 -0
  163. package/public/assets/list-view-CyM0QUaH.js.br +0 -0
  164. package/public/assets/list-view-CyM0QUaH.js.gz +0 -0
  165. package/public/assets/pencil-DUZRZB3S.js.br +0 -0
  166. package/public/assets/pencil-DUZRZB3S.js.gz +0 -0
  167. package/public/assets/play-Z1L2Eb91.js.br +0 -0
  168. package/public/assets/play-Z1L2Eb91.js.gz +0 -0
  169. package/public/assets/search-input-B0s9mzRt.js.br +0 -0
  170. package/public/assets/search-input-B0s9mzRt.js.gz +0 -0
  171. package/public/assets/select-CHbE6M4S.js.br +0 -0
  172. package/public/assets/select-CHbE6M4S.js.gz +0 -0
  173. package/public/assets/slider-tyb3JvL2.js.br +0 -0
  174. package/public/assets/slider-tyb3JvL2.js.gz +0 -0
  175. package/public/assets/tabs-Bf7ou-eS.js.br +0 -0
  176. package/public/assets/tabs-Bf7ou-eS.js.gz +0 -0
  177. package/public/assets/tech-label-KAwM5qZ_.js.br +0 -0
  178. package/public/assets/tech-label-KAwM5qZ_.js.gz +0 -0
  179. package/public/assets/trash-HEJmY7DQ.js.br +0 -0
  180. package/public/assets/trash-HEJmY7DQ.js.gz +0 -0
  181. package/public/assets/video-DdHH0Q0l.js.br +0 -0
  182. package/public/assets/video-DdHH0Q0l.js.gz +0 -0
@@ -1,25 +1,25 @@
1
- var Ve=l=>{throw TypeError(l)};var Re=(l,e,s)=>e.has(l)||Ve("Cannot "+s);var A=(l,e,s)=>(Re(l,e,"read from private field"),s?s.call(l):e.get(l)),fe=(l,e,s)=>e.has(l)?Ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,s),me=(l,e,s,a)=>(Re(l,e,"write to private field"),a?a.call(l,s):e.set(l,s),s),ue=(l,e,s)=>(Re(l,e,"access private method"),s);import{r as o,c as xe,j as t}from"./vendor-react-DTSdA8m-.js";import{t as jt,w as yt,x as He,y as vt,A as tt,b as st,D as St,E as Nt,G as Ne,H as J,B as ie,L as ve,I as We,F as wt,J as Dt,S as _t,T as kt,K as Ct,M as At,N as Et,O as It,Q as pe,R as Rt,c as Je,U as Tt,V as Ft,W as Ot,X as $t,Y as Mt,q as Pt,Z as Lt,$ as Bt,a0 as zt}from"./index-C_3Q51YJ.js";import{S as qt}from"./search-input-B0s9mzRt.js";import{S as ke,a as Ce,b as Ae,c as F,d as Ee,C as Kt}from"./select-CHbE6M4S.js";import{D as lt,a as at,b as nt,c as rt,d as it}from"./dialog-Cugbp1C4.js";import{T as _e}from"./tech-label-KAwM5qZ_.js";import{P as Qt,T as Ut}from"./trash-HEJmY7DQ.js";import{B as Te}from"./badge-BjEnOmb0.js";import{A as Vt,a as Ht,b as Wt,c as Jt,d as Gt,e as Yt,f as Xt,g as Zt}from"./alert-dialog-C0mRms8g.js";import{f as es,b as Oe,P as ts,S as ss,d as ls}from"./build-format-ofd2iIzf.js";import{P as as}from"./play-Z1L2Eb91.js";import{u as ns}from"./useFocusAfterSwap-BdItkQCu.js";import{u as rs,S as is}from"./useShownAfter-By1Yxysz.js";import{a as os,c as cs}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";var re,oe,$,Se,ae,ye,$e,et,ds=(et=class extends jt{constructor(e,s){super();fe(this,ae);fe(this,re);fe(this,oe);fe(this,$);fe(this,Se);me(this,re,e),this.setOptions(s),this.bindMethods(),ue(this,ae,ye).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=A(this,re).defaultMutationOptions(e),yt(this.options,s)||A(this,re).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,$),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&He(s.mutationKey)!==He(this.options.mutationKey)?this.reset():((a=A(this,$))==null?void 0:a.state.status)==="pending"&&A(this,$).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&A(this,$)&&(A(this,$).addObserver(this),ue(this,ae,ye).call(this))}onUnsubscribe(){var e;this.hasListeners()||(e=A(this,$))==null||e.removeObserver(this)}onMutationUpdate(e){ue(this,ae,ye).call(this),ue(this,ae,$e).call(this,e)}getCurrentResult(){return A(this,oe)}reset(){var e;(e=A(this,$))==null||e.removeObserver(this),me(this,$,void 0),ue(this,ae,ye).call(this),ue(this,ae,$e).call(this)}mutate(e,s){var a;return me(this,Se,s),(a=A(this,$))==null||a.removeObserver(this),me(this,$,A(this,re).getMutationCache().build(A(this,re),this.options)),A(this,$).addObserver(this),A(this,$).execute(e)}},re=new WeakMap,oe=new WeakMap,$=new WeakMap,Se=new WeakMap,ae=new WeakSet,ye=function(){var s;const e=((s=A(this,$))==null?void 0:s.state)??vt();me(this,oe,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},$e=function(e){tt.batch(()=>{var a,c,b,f;const s=A(this,Se);if(s&&this.hasListeners()){const p=A(this,oe).variables,g=A(this,oe).context,u={client:A(this,re),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)==="success"){try{(a=s.onSuccess)==null||a.call(s,e.data,p,g,u)}catch(d){Promise.reject(d)}try{(c=s.onSettled)==null||c.call(s,e.data,null,p,g,u)}catch(d){Promise.reject(d)}}else if((e==null?void 0:e.type)==="error"){try{(b=s.onError)==null||b.call(s,e.error,p,g,u)}catch(d){Promise.reject(d)}try{(f=s.onSettled)==null||f.call(s,void 0,e.error,p,g,u)}catch(d){Promise.reject(d)}}}this.listeners.forEach(p=>{p(A(this,oe))})})},et);function Fe(l,e){const s=st(),[a]=o.useState(()=>new ds(s,l));o.useEffect(()=>{a.setOptions(l)},[a,l]);const c=o.useSyncExternalStore(o.useCallback(f=>a.subscribe(tt.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),b=o.useCallback((...f)=>{a.mutate(f[0],f[1]).catch(St)},[a]);if(c.error&&Nt(a.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:b,mutateAsync:c.mutate}}/**
2
- * @license lucide-react v1.59.0 - ISC
1
+ var Ve=l=>{throw TypeError(l)};var Re=(l,e,s)=>e.has(l)||Ve("Cannot "+s);var A=(l,e,s)=>(Re(l,e,"read from private field"),s?s.call(l):e.get(l)),fe=(l,e,s)=>e.has(l)?Ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,s),me=(l,e,s,a)=>(Re(l,e,"write to private field"),a?a.call(l,s):e.set(l,s),s),ue=(l,e,s)=>(Re(l,e,"access private method"),s);import{r as o,c as xe,j as t}from"./vendor-react-DTSdA8m-.js";import{t as jt,w as yt,x as He,y as vt,A as tt,b as st,D as St,E as Nt,G as Ne,H as J,B as ie,L as ve,I as We,F as wt,J as Dt,S as _t,T as kt,K as Ct,M as At,N as Et,O as It,Q as pe,R as Rt,c as Je,U as Tt,V as Ft,W as Ot,X as $t,Y as Mt,q as Pt,Z as Lt,$ as Bt,a0 as zt}from"./index-CiJwpDAf.js";import{S as qt}from"./search-input-2MuvmbBR.js";import{S as ke,a as Ce,b as Ae,c as F,d as Ee,C as Kt}from"./select-7EkQtxVy.js";import{D as lt,a as at,b as nt,c as rt,d as it}from"./dialog-CrzZQwxn.js";import{T as _e}from"./tech-label-DpVGqU2Y.js";import{P as Qt,T as Ut}from"./trash-DFsQhdZ1.js";import{B as Te}from"./badge-Bjwwchrt.js";import{A as Vt,a as Ht,b as Wt,c as Jt,d as Gt,e as Yt,f as Xt,g as Zt}from"./alert-dialog-DPNbpxqG.js";import{f as es,b as Oe,P as ts,S as ss,d as ls}from"./build-format-ofd2iIzf.js";import{P as as}from"./play-BR_CdQzZ.js";import{u as ns}from"./useFocusAfterSwap-BdItkQCu.js";import{u as rs,S as is}from"./useShownAfter-By1Yxysz.js";import{a as os,c as cs}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";var re,oe,$,Se,ae,ye,$e,et,ds=(et=class extends jt{constructor(e,s){super();fe(this,ae);fe(this,re);fe(this,oe);fe(this,$);fe(this,Se);me(this,re,e),this.setOptions(s),this.bindMethods(),ue(this,ae,ye).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=A(this,re).defaultMutationOptions(e),yt(this.options,s)||A(this,re).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,$),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&He(s.mutationKey)!==He(this.options.mutationKey)?this.reset():((a=A(this,$))==null?void 0:a.state.status)==="pending"&&A(this,$).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&A(this,$)&&(A(this,$).addObserver(this),ue(this,ae,ye).call(this))}onUnsubscribe(){var e;this.hasListeners()||(e=A(this,$))==null||e.removeObserver(this)}onMutationUpdate(e){ue(this,ae,ye).call(this),ue(this,ae,$e).call(this,e)}getCurrentResult(){return A(this,oe)}reset(){var e;(e=A(this,$))==null||e.removeObserver(this),me(this,$,void 0),ue(this,ae,ye).call(this),ue(this,ae,$e).call(this)}mutate(e,s){var a;return me(this,Se,s),(a=A(this,$))==null||a.removeObserver(this),me(this,$,A(this,re).getMutationCache().build(A(this,re),this.options)),A(this,$).addObserver(this),A(this,$).execute(e)}},re=new WeakMap,oe=new WeakMap,$=new WeakMap,Se=new WeakMap,ae=new WeakSet,ye=function(){var s;const e=((s=A(this,$))==null?void 0:s.state)??vt();me(this,oe,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},$e=function(e){tt.batch(()=>{var a,c,b,f;const s=A(this,Se);if(s&&this.hasListeners()){const p=A(this,oe).variables,g=A(this,oe).context,u={client:A(this,re),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)==="success"){try{(a=s.onSuccess)==null||a.call(s,e.data,p,g,u)}catch(d){Promise.reject(d)}try{(c=s.onSettled)==null||c.call(s,e.data,null,p,g,u)}catch(d){Promise.reject(d)}}else if((e==null?void 0:e.type)==="error"){try{(b=s.onError)==null||b.call(s,e.error,p,g,u)}catch(d){Promise.reject(d)}try{(f=s.onSettled)==null||f.call(s,void 0,e.error,p,g,u)}catch(d){Promise.reject(d)}}}this.listeners.forEach(p=>{p(A(this,oe))})})},et);function Fe(l,e){const s=st(),[a]=o.useState(()=>new ds(s,l));o.useEffect(()=>{a.setOptions(l)},[a,l]);const c=o.useSyncExternalStore(o.useCallback(f=>a.subscribe(tt.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),b=o.useCallback((...f)=>{a.mutate(f[0],f[1]).catch(St)},[a]);if(c.error&&Nt(a.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:b,mutateAsync:c.mutate}}/**
2
+ * @license lucide-react v1.61.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
6
  */const ot={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"}]]};ot.node;const us=Ne(ot);/**
7
- * @license lucide-react v1.59.0 - ISC
7
+ * @license lucide-react v1.61.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */const ct={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"]};ct.node;const hs=Ne(ct);/**
12
- * @license lucide-react v1.59.0 - ISC
12
+ * @license lucide-react v1.61.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */const dt={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"}]]};dt.node;const fs=Ne(dt);/**
17
- * @license lucide-react v1.59.0 - ISC
17
+ * @license lucide-react v1.61.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */const ut={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"}]]};ut.node;const ms=Ne(ut);/**
22
- * @license lucide-react v1.59.0 - ISC
22
+ * @license lucide-react v1.61.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
@@ -1,4 +1,4 @@
1
- import{r as y,j as e,c as Ve}from"./vendor-react-DTSdA8m-.js";import{a6 as ve,a8 as Ee,a2 as be,b as je,u as R,a as $,C as F,d as D,e as k,f as V,n as L,L as j,B as C,h as q,o as O,aF as ue,H as f,q as S,z as Me,R as Te,c as pe,l as Ge,I as N,F as P,S as fe,p as Re,g as $e,P as qe,aG as Le,_ as ye,s as E,i as Oe,j as Be,aH as He,Z as Ie}from"./index-C_3Q51YJ.js";import{F as z}from"./field-hint-qmBa0qqN.js";import{B as Qe}from"./badge-BjEnOmb0.js";import{P as ze}from"./build-format-ofd2iIzf.js";import{g as Ke,h as Ue,d as We,A as Xe,a as Je,b as Ye,e as Ze,c as er,f as rr}from"./alert-dialog-C0mRms8g.js";import{S as ge}from"./slider-tyb3JvL2.js";import{P as he}from"./pencil-DUZRZB3S.js";import"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";var sr=Object.defineProperty,w=(a,i)=>sr(a,"name",{value:i,configurable:!0}),we="Progress",X=100,[ar,Cr]=Ee(we),[tr,or]=ar(we),Se=y.forwardRef(w(function(i,r){const{__scopeProgress:g,value:t=null,max:n,getValueLabel:p=Ne,...x}=i;(n||n===0)&&!K(n)&&console.error(Pe(`${n}`,"Progress"));const m=K(n)?n:X;t!==null&&!U(t,m)&&console.error(Ce(`${t}`,"Progress"));const h=U(t,m)?t:null,u=M(h)?p(h,m):void 0;return e.jsx(tr,{scope:g,value:h,max:m,children:e.jsx(ve.div,{"aria-valuemax":m,"aria-valuemin":0,"aria-valuenow":M(h)?h:void 0,"aria-valuetext":u,role:"progressbar","data-state":J(h,m),"data-value":h??void 0,"data-max":m,...x,ref:r})})},"Progress")),ir="ProgressIndicator",nr=y.forwardRef(w(function(i,r){const{__scopeProgress:g,...t}=i,n=or(ir,g);return e.jsx(ve.div,{"data-state":J(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...t,ref:r})},"ProgressIndicator"));function Ne(a,i){return`${Math.round(a/i*100)}%`}w(Ne,"defaultGetValueLabel");function J(a,i){return a==null?"indeterminate":a===i?"complete":"loading"}w(J,"getProgressState");function M(a){return typeof a=="number"}w(M,"isNumber");function K(a){return M(a)&&!isNaN(a)&&a>0}w(K,"isValidMaxNumber");function U(a,i){return M(a)&&!isNaN(a)&&a<=i&&a>=0}w(U,"isValidValueNumber");function Pe(a,i){return`Invalid prop \`max\` of value \`${a}\` supplied to \`${i}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${X}\`.`}w(Pe,"getInvalidMaxError");function Ce(a,i){return`Invalid prop \`value\` of value \`${a}\` supplied to \`${i}\`. The \`value\` prop must be:
1
+ import{r as y,j as e,c as Ve}from"./vendor-react-DTSdA8m-.js";import{a6 as ve,a8 as Ee,a2 as be,b as je,u as R,a as $,C as F,d as D,e as k,f as V,n as L,L as j,B as C,h as q,o as O,aF as ue,H as f,q as S,z as Me,R as Te,c as pe,l as Ge,I as N,F as P,S as fe,p as Re,g as $e,P as qe,aG as Le,_ as ye,s as E,i as Oe,j as Be,aH as He,Z as Ie}from"./index-CiJwpDAf.js";import{F as z}from"./field-hint-CIJmSABE.js";import{B as Qe}from"./badge-Bjwwchrt.js";import{P as ze}from"./build-format-ofd2iIzf.js";import{g as Ke,h as Ue,d as We,A as Xe,a as Je,b as Ye,e as Ze,c as er,f as rr}from"./alert-dialog-DPNbpxqG.js";import{S as ge}from"./slider-ifEFgQFt.js";import{P as he}from"./pencil-CE5LnE8i.js";import"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";var sr=Object.defineProperty,w=(a,i)=>sr(a,"name",{value:i,configurable:!0}),we="Progress",X=100,[ar,Cr]=Ee(we),[tr,or]=ar(we),Se=y.forwardRef(w(function(i,r){const{__scopeProgress:g,value:t=null,max:n,getValueLabel:p=Ne,...x}=i;(n||n===0)&&!K(n)&&console.error(Pe(`${n}`,"Progress"));const m=K(n)?n:X;t!==null&&!U(t,m)&&console.error(Ce(`${t}`,"Progress"));const h=U(t,m)?t:null,u=M(h)?p(h,m):void 0;return e.jsx(tr,{scope:g,value:h,max:m,children:e.jsx(ve.div,{"aria-valuemax":m,"aria-valuemin":0,"aria-valuenow":M(h)?h:void 0,"aria-valuetext":u,role:"progressbar","data-state":J(h,m),"data-value":h??void 0,"data-max":m,...x,ref:r})})},"Progress")),ir="ProgressIndicator",nr=y.forwardRef(w(function(i,r){const{__scopeProgress:g,...t}=i,n=or(ir,g);return e.jsx(ve.div,{"data-state":J(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...t,ref:r})},"ProgressIndicator"));function Ne(a,i){return`${Math.round(a/i*100)}%`}w(Ne,"defaultGetValueLabel");function J(a,i){return a==null?"indeterminate":a===i?"complete":"loading"}w(J,"getProgressState");function M(a){return typeof a=="number"}w(M,"isNumber");function K(a){return M(a)&&!isNaN(a)&&a>0}w(K,"isValidMaxNumber");function U(a,i){return M(a)&&!isNaN(a)&&a<=i&&a>=0}w(U,"isValidValueNumber");function Pe(a,i){return`Invalid prop \`max\` of value \`${a}\` supplied to \`${i}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${X}\`.`}w(Pe,"getInvalidMaxError");function Ce(a,i){return`Invalid prop \`value\` of value \`${a}\` supplied to \`${i}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${X} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
@@ -1 +1 @@
1
- import{r as F,j as e}from"./vendor-react-DTSdA8m-.js";import{u as M,a as W,l as K,b as Q,c as U,C as T,d as R,e as q,m as E,f as G,L as m,I as h,n as Y,p as z,F as u,S as V,g as J,P as X,B as Z,h as $,q as I,o as ee,s as v,i as ae,j as se,_ as re,v as te}from"./index-C_3Q51YJ.js";import{F as ie}from"./field-hint-qmBa0qqN.js";import{a as ne,c as oe,L as le}from"./vendor-router-B1pQim9Z.js";import{P as de}from"./pencil-DUZRZB3S.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(),[O]=oe(),i=O.get("token")??"",[x,_]=F.useState(null),g=F.useRef(null),{register:p,handleSubmit:A,control:j,setError:l,formState:{errors:a,isSubmitting:y,submitCount:L}}=M({shouldFocusError:!1,resolver:W(ce),defaultValues:{displayName:"",avatar:null}}),d=K({control:j,name:"displayName"})??"",B=Q(),f=U({queryKey:I.inviteToken(i),queryFn:()=>te(i),enabled:i!=="",staleTime:1/0}),w=!i||f.isError?"invalid":f.isPending?"loading":"valid",D=((b=f.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){l("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(()=>({}));l("root",{message:c.error??"Failed to accept invitation"});return}B.removeQueries({queryKey:I.inviteToken(i)}),o("/app-center",{replace:!0})}catch{l("root",{message:"Network error. Please try again."})}}return w==="loading"?e.jsx("div",{className:"flex min-h-svh items-center justify-center"}):w==="invalid"?e.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsx(T,{level:4,className:"w-full max-w-sm text-center",children:e.jsxs(R,{children:[e.jsx(q,{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:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsxs(T,{level:4,className:"w-full max-w-sm",children:[e.jsxs(R,{className:"text-center",children:[e.jsx(q,{children:"Set up your account"}),e.jsxs(E,{children:["You're joining as ",e.jsx("strong",{children:D})]})]}),e.jsx(G,{children:e.jsxs("form",{onSubmit:A(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(h,{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(Y,{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=z(d);return{backgroundColor:s.bg,color:s.fg}})(),children:((n=d==null?void 0:d[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(de,{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){l("avatar",{message:"Max 2MB for avatar"});return}t.onChange(r),_(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(h,{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(h,{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(le,{to:"/login",className:"text-sm text-center underline underline-offset-4",children:"Go to sign in"}),e.jsx(Z,{type:"submit",disabled:y,className:"w-full",children:y?"Creating account…":"Create account"}),e.jsx($,{errors:a,submitCount:L})]})})]})})}export{ve as Invite};
1
+ import{r as F,j as e}from"./vendor-react-DTSdA8m-.js";import{u as M,a as W,l as K,b as Q,c as U,C as T,d as R,e as q,m as E,f as G,L as m,I as h,n as Y,p as z,F as u,S as V,g as J,P as X,B as Z,h as $,q as I,o as ee,s as v,i as ae,j as se,_ as re,v as te}from"./index-CiJwpDAf.js";import{F as ie}from"./field-hint-CIJmSABE.js";import{a as ne,c as oe,L as le}from"./vendor-router-B1pQim9Z.js";import{P as de}from"./pencil-CE5LnE8i.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(),[O]=oe(),i=O.get("token")??"",[x,_]=F.useState(null),g=F.useRef(null),{register:p,handleSubmit:A,control:j,setError:l,formState:{errors:a,isSubmitting:y,submitCount:L}}=M({shouldFocusError:!1,resolver:W(ce),defaultValues:{displayName:"",avatar:null}}),d=K({control:j,name:"displayName"})??"",B=Q(),f=U({queryKey:I.inviteToken(i),queryFn:()=>te(i),enabled:i!=="",staleTime:1/0}),w=!i||f.isError?"invalid":f.isPending?"loading":"valid",D=((b=f.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){l("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(()=>({}));l("root",{message:c.error??"Failed to accept invitation"});return}B.removeQueries({queryKey:I.inviteToken(i)}),o("/app-center",{replace:!0})}catch{l("root",{message:"Network error. Please try again."})}}return w==="loading"?e.jsx("div",{className:"flex min-h-svh items-center justify-center"}):w==="invalid"?e.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsx(T,{level:4,className:"w-full max-w-sm text-center",children:e.jsxs(R,{children:[e.jsx(q,{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:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsxs(T,{level:4,className:"w-full max-w-sm",children:[e.jsxs(R,{className:"text-center",children:[e.jsx(q,{children:"Set up your account"}),e.jsxs(E,{children:["You're joining as ",e.jsx("strong",{children:D})]})]}),e.jsx(G,{children:e.jsxs("form",{onSubmit:A(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(h,{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(Y,{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=z(d);return{backgroundColor:s.bg,color:s.fg}})(),children:((n=d==null?void 0:d[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(de,{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){l("avatar",{message:"Max 2MB for avatar"});return}t.onChange(r),_(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(h,{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(h,{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(le,{to:"/login",className:"text-sm text-center underline underline-offset-4",children:"Go to sign in"}),e.jsx(Z,{type:"submit",disabled:y,className:"w-full",children:y?"Creating account…":"Create account"}),e.jsx($,{errors:a,submitCount:L})]})})]})})}export{ve as Invite};
@@ -1 +1 @@
1
- import{r as M,c as He,j as s}from"./vendor-react-DTSdA8m-.js";import{ak as Tt,c as bt,b as Ot,ay as Rt,az as Ct,q as Xe,aA as Dt,Q as xt}from"./index-C_3Q51YJ.js";import{u as It}from"./useRelay-CES3I1Mt.js";import{u as Pt,S as Kt}from"./useShownAfter-By1Yxysz.js";import{c as Ft,a as Ht,T as Ut}from"./tabs-Bf7ou-eS.js";import{R as Bt}from"./resource-health-oWJ8hy9X.js";import{t as qt,a as wt,b as Gt,c as Qt,d as Wt,e as $t,l as Xt,P as Vt,L as zt,G as Yt,A as Jt,m as St,f as Zt,g as es,h as ts,i as ss,B as ns,j as ls}from"./vendor-charts-BE7R_8yA.js";import"./vendor-router-B1pQim9Z.js";const os=t=>(document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t));function as(){return M.useSyncExternalStore(os,is,rs)}function rs(){return!0}function is(){return document.visibilityState!=="hidden"}function cs(t,e){const o=He.c(4),[m,g]=M.useState(ds);let i,n;return o[0]!==e||o[1]!==t?(i=()=>{if(!e)return;g(Date.now());const h=setInterval(()=>g(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]),M.useEffect(i,n),m}function ds(){return Date.now()}const pt={"1h":36e5,"6h":216e5,"24h":864e5,"7d":6048e5},us={"1h":Gt.every(10),"6h":wt,"24h":wt.every(3),"7d":qt};function fs(t,e,o){return us[o].range(new Date(t),new Date(e+1))}function ms(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 hs=2e3;function xs(t){return Math.min(1e4,Math.max(1e3,pt[t]/hs))}const ps={"1h":6e4,"6h":6e4,"24h":3e5,"7d":9e5},gt=t=>Math.round(t*10)/10;function gs(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>Bt)return null;const g=i=>Number.isFinite(i)?gt(i):null;return{cpu:g(m.cpuPercent),mem:g(m.memUsedMB/m.memTotalMB*100)}}const Et={cpu:{label:"CPU",color:"#60a5fa"},mem:{label:"RAM",color:"#a78bfa"}},Lt={"1h":"1h","6h":"6h","24h":"24h","7d":"7d"};function Is(){const t=He.c(66);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[o,m]=M.useState(e),[g,i]=M.useState(null),[n,h]=M.useState("24h"),R=as();let S;t[1]!==n?(S=xs(n),t[1]=n,t[2]=S):S=t[2];const x=cs(S,R),{setNode:v}=Tt();let p,j;t[3]!==v?(p=()=>(v(s.jsx("span",{className:"text-sm font-medium",children:"Mac Resources"})),()=>v(null)),j=[v],t[3]=v,t[4]=p,t[5]=j):(p=t[4],j=t[5]),M.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 X=C,{send:$,connected:E}=It(X);let ce,de;t[7]!==E||t[8]!==$?(ce=()=>{if(!E)return;$({type:"agents:list"});const u=setInterval(()=>$({type:"agents:list"}),1e4);return()=>clearInterval(u)},de=[E,$],t[7]=E,t[8]=$,t[9]=ce,t[10]=de):(ce=t[9],de=t[10]),M.useEffect(ce,de);let se;t[11]===Symbol.for("react.memo_cache_sentinel")?(se={queryKey:Xe.agents,queryFn:Ct,refetchOnWindowFocus:!1},t[11]=se):se=t[11];const V=bt(se);let d,f,B,ne;t[12]!==V.data||t[13]!==o?(B=V.data??[],f=o.map(js).filter(Boolean),d=[...new Set([...f,...B])],ne=new Set(f),t[12]=V.data,t[13]=o,t[14]=d,t[15]=f,t[16]=B,t[17]=ne):(d=t[14],f=t[15],B=t[16],ne=t[17]);const b=ne,l=g??(V.isPending?null:B[0]??f[0]??null),q=Ot();let ee;t[18]!==n||t[19]!==l?(ee=l?Xe.resourceHistory(l,n):null,t[18]=n,t[19]=l,t[20]=ee):ee=t[20];const te=ee;let D;t[21]!==te||t[22]!==n?(D=te??Xe.resourceHistory("",n),t[21]=te,t[22]=n,t[23]=D):D=t[23];let G;t[24]!==n||t[25]!==l?(G=u=>{const{signal:T}=u;return Dt(l,n,T)},t[24]=n,t[25]=l,t[26]=G):G=t[26];let z;t[27]!==D||t[28]!==G?(z={queryKey:D,queryFn:G,enabled:!1},t[27]=D,t[28]=G,t[29]=z):z=t[29];const I=bt(z),Q=I.refetch;let P,Y;t[30]!==q||t[31]!==n||t[32]!==Q||t[33]!==l||t[34]!==R?(P=()=>{if(!l||!R)return;const u=Xe.resourceHistory(l,n),T=ps[n],N=()=>{const H=q.getQueryState(u);(H==null?void 0:H.fetchStatus)==="fetching"&&H.data===void 0?q.cancelQueries({queryKey:u,exact:!0}).then(()=>Q()):Q({cancelRefetch:!0})},k=q.getQueryState(u),ae=Math.max((k==null?void 0:k.dataUpdatedAt)??0,(k==null?void 0:k.errorUpdatedAt)??0),re=(k==null?void 0:k.data)!==void 0&&ae>0?Math.max(0,T-(Date.now()-ae)):0;let ie;const Ue=()=>{N(),ie=setInterval(N,T)},Fe=re>0?setTimeout(Ue,re):void 0;return re===0&&Ue(),()=>{clearTimeout(Fe),clearInterval(ie),q.cancelQueries({queryKey:u,exact:!0})}},Y=[l,n,R,Q,q],t[30]=q,t[31]=n,t[32]=Q,t[33]=l,t[34]=R,t[35]=P,t[36]=Y):(P=t[35],Y=t[36]),M.useEffect(P,Y);const w=I.data!==void 0||I.isError,J=te!==null&&!w,c=Pt(J,Kt);let K;t[37]!==I.data?(K=I.data??[],t[37]=I.data,t[38]=K):K=t[38];let Z;t[39]!==K?(Z=K.map(vs),t[39]=K,t[40]=Z):Z=t[40];const W=Z;let le;t[41]!==x||t[42]!==l||t[43]!==o?(le=l?gs(o,l,x):null,t[41]=x,t[42]=l,t[43]=o,t[44]=le):le=t[44];const r=le;let y;t[45]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("h1",{className:"sr-only",children:"Mac Resources"}),t[45]=y):y=t[45];let L;t[46]===Symbol.for("react.memo_cache_sentinel")?(L=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]=L):L=t[46];let _;t[47]!==d||t[48]!==E||t[49]!==b||t[50]!==l?(_=d.length===0?s.jsx("span",{className:"px-2 text-sm text-muted-foreground",children:E?"No agents yet.":"Connecting…"}):d.map(u=>{const T=b.has(u),N=l===u;return s.jsxs("button",{onClick:()=>i(u),"aria-current":N?"true":void 0,className:["flex items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-accent transition-colors",N?"bg-accent font-medium":""].join(" "),children:[s.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full ${T?"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:T?"Online":"Offline"})]},u)}),t[47]=d,t[48]=E,t[49]=b,t[50]=l,t[51]=_):_=t[51];let A;t[52]!==_?(A=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:[L,_]}),t[52]=_,t[53]=A):A=t[53];let F;t[54]!==W||t[55]!==(r==null?void 0:r.cpu)||t[56]!==(r==null?void 0:r.mem)||t[57]!==J||t[58]!==x||t[59]!==n||t[60]!==l||t[61]!==c?(F=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(Ft,{value:n,onValueChange:u=>h(u),children:s.jsx(Ht,{children:Object.keys(Lt).map(ys)})})]}),J?s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("p",{className:"sr-only",children:"Loading…"}),s.jsxs("div",{className:c?"flex flex-col gap-6":"flex flex-col gap-6 invisible",children:[s.jsx(_t,{}),s.jsx(_t,{})]})]}):W.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(At,{title:"CPU %",color:"cpu",data:W,dataKey:"cpu",range:n,now:x,live:(r==null?void 0:r.cpu)??null}),s.jsx(At,{title:"RAM %",color:"mem",data:W,dataKey:"mem",range:n,now:x,live:(r==null?void 0:r.mem)??null})]})]}):s.jsxs("div",{className:"flex h-full items-center justify-center gap-2 text-muted-foreground",children:[s.jsx(Rt,{className:"h-8 w-8"}),s.jsx("p",{className:"text-sm",children:"Select a Mac to view resource history."})]})}),t[54]=W,t[55]=r==null?void 0:r.cpu,t[56]=r==null?void 0:r.mem,t[57]=J,t[58]=x,t[59]=n,t[60]=l,t[61]=c,t[62]=F):F=t[62];let oe;return t[63]!==A||t[64]!==F?(oe=s.jsxs("div",{className:"flex h-full min-h-0",children:[y,A,F]}),t[63]=A,t[64]=F,t[65]=oe):oe=t[65],oe}function ys(t){return s.jsx(Ut,{value:t,children:Lt[t]},t)}function vs(t){return{time:t.recorded_at,cpu:gt(t.cpu_percent),mem:gt(t.mem_percent)}}function js(t){return t.agentName}const yt=t=>new Date(t.time).getTime(),Nt=t=>new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),Ve=t=>`${Math.round(t*10)/10}%`,bs=$t(yt).left,ws=$t(t=>t.t).left,U={top:8,right:24,bottom:24,left:40},kt=16,Mt=6,Ss=20,Ns=40;function _t(){const t=He.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"rounded-lg border p-4 flex flex-col gap-3","aria-hidden":!0,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xt,{className:"h-2.5 w-2.5 rounded-full"}),s.jsx(xt,{className:"h-5 w-12"})]}),s.jsx(xt,{className:"h-[220px] w-full"})]}),t[0]=e):e=t[0],e}function At(t){const e=He.c(18),{title:o,color:m,data:g,dataKey:i,range:n,now:h,live:R}=t,S=Et[m].color;let x;e[0]!==S?(x=s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{background:S}}),e[0]=S,e[1]=x):x=e[1];let v;e[2]!==o?(v=s.jsx("h2",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=v):v=e[3];let p;e[4]!==x||e[5]!==v?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[x,v]}),e[4]=x,e[5]=v,e[6]=p):p=e[6];let j;e[7]!==g||e[8]!==i||e[9]!==S||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(Vt,{children:X=>{const{width:$,height:E}=X;return $>0&&E>0?s.jsx(ks,{width:$,height:E,data:g,dataKey:i,hex:S,range:n,now:h,live:R,label:o}):null}})}),e[7]=g,e[8]=i,e[9]=S,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 ks(t){const e=He.c(139),{width:o,height:m,data:g,dataKey:i,hex:n,range:h,now:R,live:S,label:x}=t,v=S===void 0?null:S,p=`chart-hint-${i}`,[j,C]=M.useState(null),[X,$]=M.useState(!1),[E,ce]=M.useState(null),[de,se]=M.useState(!1),V=de?E:null,d=o-U.left-U.right,f=m-U.top-U.bottom,B=R,ne=B-pt[h],b=Qt({domain:[ne,B],range:[0,Math.max(0,d)]}),l=Wt({domain:[0,100],range:[f,kt]}),q=d>0?Ss/d*pt[h]:0,ee=ne-q,te=B+q;let D;e[0]!==h||e[1]!==ee||e[2]!==te?(D=fs(ee,te,h),e[0]=h,e[1]=ee,e[2]=te,e[3]=D):D=e[3];const G=D,z=d>0?Math.min(.5,Ns/d):0,I=`fill-${i}`,Q=`plot-${i}`,P=`axis-fade-${i}`,Y=g[g.length-1],w=v!==null&&Y?{t:Math.max(B,yt(Y)+1),v,live:!0}:null;let J;e[4]!==i?(J=a=>({t:yt(a),v:a[i]}),e[4]=i,e[5]=J):J=e[5];const c=g.map(J);w&&c.push(w);const K=a=>Math.min(b(a),d),Z=w?K(w.t):0,W=w?l(w.v):0,le=Math.max(0,g.length-1),r=j===null?Math.max(0,c.length-1):j==="live"?w?c.length-1:le:Math.min(bs(g,j),le),y=X?c[r]:void 0,L=y?K(y.t):0,_=y?l(y.v):0,A=Et[i].label;let F;e[6]!==A?(F=a=>`${A}, ${Nt(a.t)}, ${a.live?"latest, ":""}${Ve(a.v)}`,e[6]=A,e[7]=F):F=e[7];const oe=F,u=a=>{const O=c[a];O&&(C(O.live?"live":O.t),$(!0),ce({now:a,text:oe(O)}))};let T;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>$(!1),e[8]=T):T=e[8];const N=T;let k,ae;e[9]!==X?(k=()=>{if(!X)return;const a=O=>{O.key==="Escape"&&$(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},ae=[X],e[9]=X,e[10]=k,e[11]=ae):(k=e[10],ae=e[11]),M.useEffect(k,ae);const re=a=>{if(c.length===0)return;const O=r,Ke=a.key==="ArrowLeft"||a.key==="ArrowDown"?Math.max(0,O-1):a.key==="ArrowRight"||a.key==="ArrowUp"?Math.min(c.length-1,O+1):a.key==="Home"?0:a.key==="End"?c.length-1:null;Ke!==null&&(a.preventDefault(),u(Ke))},ie=a=>{const O=Xt(a);if(!O)return;const Ke=O.x-U.left,vt=ws(c,b.invert(Ke).getTime()),jt=[c[vt-1],c[vt],w].reduce((mt,ht)=>ht&&(!mt||Math.abs(K(ht.t)-Ke)<=Math.abs(K(mt.t)-Ke))?ht:mt,void 0);jt&&u(c.indexOf(jt))},Ue="group",Fe=w?`${x}, last ${h}. Now ${Ve(w.v)}.`:Y?`${x}, last ${h}. Latest ${Ve(Y[i])}.`:`${x}, last ${h}. No samples.`;let H;e[12]!==I||e[13]!==n?(H=s.jsx(zt,{id:I,from:n,to:n,fromOpacity:.3,toOpacity:0,fromOffset:"5%",toOffset:"95%"}),e[12]=I,e[13]=n,e[14]=H):H=e[14];const ze=Math.max(0,d),Ye=Math.max(0,f);let ue;e[15]!==ze||e[16]!==Ye?(ue=s.jsx("rect",{x:0,y:0,width:ze,height:Ye}),e[15]=ze,e[16]=Ye,e[17]=ue):ue=e[17];let fe;e[18]!==Q||e[19]!==ue?(fe=s.jsx("clipPath",{id:Q,children:ue}),e[18]=Q,e[19]=ue,e[20]=fe):fe=e[20];const Je=`${P}-grad`,Ze=Math.max(0,d);let Be;e[21]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsx("stop",{offset:0,stopColor:"white",stopOpacity:0}),e[21]=Be):Be=e[21];let me;e[22]!==z?(me=s.jsx("stop",{offset:z,stopColor:"white",stopOpacity:1}),e[22]=z,e[23]=me):me=e[23];const et=1-z;let he;e[24]!==et?(he=s.jsx("stop",{offset:et,stopColor:"white",stopOpacity:1}),e[24]=et,e[25]=he):he=e[25];let qe;e[26]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsx("stop",{offset:1,stopColor:"white",stopOpacity:0}),e[26]=qe):qe=e[26];let xe;e[27]!==Je||e[28]!==Ze||e[29]!==me||e[30]!==he?(xe=s.jsxs("linearGradient",{id:Je,gradientUnits:"userSpaceOnUse",x1:0,y1:0,x2:Ze,y2:0,children:[Be,me,he,qe]}),e[27]=Je,e[28]=Ze,e[29]=me,e[30]=he,e[31]=xe):xe=e[31];const tt=Math.max(0,d),st=Math.max(0,d),nt=`url(#${P}-grad)`;let pe;e[32]!==f||e[33]!==st||e[34]!==nt?(pe=s.jsx("rect",{x:0,y:f,width:st,height:U.bottom*2,fill:nt}),e[32]=f,e[33]=st,e[34]=nt,e[35]=pe):pe=e[35];let ge;e[36]!==P||e[37]!==f||e[38]!==tt||e[39]!==pe?(ge=s.jsx("mask",{id:P,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse",x:0,y:f,width:tt,height:U.bottom*2,children:pe}),e[36]=P,e[37]=f,e[38]=tt,e[39]=pe,e[40]=ge):ge=e[40];let Ge;e[41]===Symbol.for("react.memo_cache_sentinel")?(Ge=[0,25,50,75,100],e[41]=Ge):Ge=e[41];let ye;e[42]!==d||e[43]!==l?(ye=s.jsx(Yt,{scale:l,width:d,tickValues:Ge,strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),e[42]=d,e[43]=l,e[44]=ye):ye=e[44];const lt=`url(#${Q})`;let ve;e[45]!==b?(ve=a=>b(a.t),e[45]=b,e[46]=ve):ve=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 be;e[49]!==c||e[50]!==ve||e[51]!==je||e[52]!==ot||e[53]!==l?(be=s.jsx(Jt,{data:c,x:ve,y:je,yScale:l,curve:St,fill:ot}),e[49]=c,e[50]=ve,e[51]=je,e[52]=ot,e[53]=l,e[54]=be):be=e[54];let we;e[55]!==b?(we=a=>b(a.t),e[55]=b,e[56]=we):we=e[56];let Se;e[57]!==l?(Se=a=>l(a.v),e[57]=l,e[58]=Se):Se=e[58];let Ne;e[59]!==n||e[60]!==c||e[61]!==we||e[62]!==Se?(Ne=s.jsx(Zt,{data:c,x:we,y:Se,curve:St,stroke:n,strokeWidth:1.5}),e[59]=n,e[60]=c,e[61]=we,e[62]=Se,e[63]=Ne):Ne=e[63];let ke;e[64]!==lt||e[65]!==be||e[66]!==Ne?(ke=s.jsxs("g",{clipPath:lt,children:[be,Ne]}),e[64]=lt,e[65]=be,e[66]=Ne,e[67]=ke):ke=e[67];const at=`url(#${P})`;let Me;e[68]!==h?(Me=a=>ms(+a,h),e[68]=h,e[69]=Me):Me=e[69];let _e;e[70]!==f||e[71]!==Me||e[72]!==G||e[73]!==b?(_e=s.jsx(es,{top:f,scale:b,tickValues:G,tickFormat:Me,hideAxisLine:!0,hideTicks:!0,tickLength:0,tickLabelProps:As}),e[70]=f,e[71]=Me,e[72]=G,e[73]=b,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 Qe;e[78]===Symbol.for("react.memo_cache_sentinel")?(Qe=[0,25,50,75,100],e[78]=Qe):Qe=e[78];let $e;e[79]!==l?($e=s.jsx(ts,{scale:l,tickValues:Qe,tickFormat:_s,hideAxisLine:!0,hideTicks:!0,tickLabelProps:Ms}),e[79]=l,e[80]=$e):$e=e[80];let Ee;e[81]!==Z||e[82]!==W||e[83]!==n||e[84]!==w?(Ee=w&&s.jsxs("g",{className:"live-head","aria-hidden":"true",pointerEvents:"none",children:[s.jsx("circle",{cx:Z,cy:W,r:Mt,fill:n,fillOpacity:.2}),s.jsx("circle",{cx:Z,cy:W,r:3,fill:n,stroke:"hsl(var(--background))",strokeWidth:1.5})]}),e[81]=Z,e[82]=W,e[83]=n,e[84]=w,e[85]=Ee):Ee=e[85];let Le;e[86]!==n||e[87]!==f||e[88]!==y||e[89]!==L||e[90]!==_?(Le=y&&s.jsxs("g",{style:{transition:"transform 0.25s ease-out",transform:`translateX(${L}px)`},pointerEvents:"none",children:[s.jsx(ss,{from:{x:0,y:kt},to:{x:0,y:f},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]=f,e[88]=y,e[89]=L,e[90]=_,e[91]=Le):Le=e[91];const rt=Math.max(0,d)+Mt,it=Math.max(0,f),ct=`${x} samples`,dt=Math.max(0,c.length-1),ut=V?Math.min(V.now,Math.max(0,c.length-1)):r,ft=V?V.text:c[r]?oe(c[r]):void 0;let Te;e[92]!==r||e[93]!==u?(Te=()=>{se(!0),u(r)},e[92]=r,e[93]=u,e[94]=Te):Te=e[94];let Oe;e[95]!==N?(Oe=()=>{N(),se(!1)},e[95]=N,e[96]=Oe):Oe=e[96];let Re;e[97]!==re||e[98]!==ie||e[99]!==N||e[100]!==p||e[101]!==rt||e[102]!==it||e[103]!==ct||e[104]!==dt||e[105]!==ut||e[106]!==ft||e[107]!==Te||e[108]!==Oe?(Re=s.jsx(ns,{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:Te,onBlur:Oe,onKeyDown:re,onMouseMove:ie,onMouseLeave:N,onTouchMove:ie,onTouchEnd:N,onTouchCancel:N}),e[97]=re,e[98]=ie,e[99]=N,e[100]=p,e[101]=rt,e[102]=it,e[103]=ct,e[104]=dt,e[105]=ut,e[106]=ft,e[107]=Te,e[108]=Oe,e[109]=Re):Re=e[109];let Ce;e[110]!==ye||e[111]!==ke||e[112]!==Ae||e[113]!==$e||e[114]!==Ee||e[115]!==Le||e[116]!==Re?(Ce=s.jsxs(ls,{left:U.left,top:U.top,children:[ye,ke,Ae,$e,Ee,Le,Re]}),e[110]=ye,e[111]=ke,e[112]=Ae,e[113]=$e,e[114]=Ee,e[115]=Le,e[116]=Re,e[117]=Ce):Ce=e[117];let De;e[118]!==m||e[119]!==Fe||e[120]!==H||e[121]!==fe||e[122]!==xe||e[123]!==ge||e[124]!==Ce||e[125]!==o?(De=s.jsxs("svg",{width:o,height:m,role:Ue,"aria-label":Fe,children:[H,fe,xe,ge,Ce]}),e[118]=m,e[119]=Fe,e[120]=H,e[121]=fe,e[122]=xe,e[123]=ge,e[124]=Ce,e[125]=o,e[126]=De):De=e[126];let Ie;e[127]!==p?(Ie=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]=Ie):Ie=e[128];let Pe;e[129]!==d||e[130]!==A||e[131]!==y||e[132]!==L||e[133]!==_?(Pe=y&&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(${L+U.left}px, ${_+U.top}px) translate(${L>d*.6?"calc(-100% - 12px)":"12px"}, -50%)`,transition:"transform 0.25s ease-out"},children:[s.jsxs("p",{className:"mb-1",children:["Date: ",Nt(y.t)]}),s.jsxs("p",{children:[A,": ",Ve(y.v)]})]}),e[129]=d,e[130]=A,e[131]=y,e[132]=L,e[133]=_,e[134]=Pe):Pe=e[134];let We;return e[135]!==De||e[136]!==Ie||e[137]!==Pe?(We=s.jsxs(s.Fragment,{children:[De,Ie,Pe]}),e[135]=De,e[136]=Ie,e[137]=Pe,e[138]=We):We=e[138],We}function Ms(){return{fontSize:11,fill:"currentColor",textAnchor:"end",dx:-4,dy:3,className:"fill-muted-foreground"}}function _s(t){return`${t}%`}function As(){return{fontSize:11,fill:"currentColor",textAnchor:"middle",dy:6,className:"fill-muted-foreground"}}export{ks as AreaChartInner,Is as MacResources};
1
+ import{r as M,c as He,j as s}from"./vendor-react-DTSdA8m-.js";import{ak as Tt,c as bt,b as Ot,ay as Rt,az as Ct,q as Xe,aA as Dt,Q as xt}from"./index-CiJwpDAf.js";import{u as It}from"./useRelay-CES3I1Mt.js";import{u as Pt,S as Kt}from"./useShownAfter-By1Yxysz.js";import{c as Ft,a as Ht,T as Ut}from"./tabs-SLpwFQLx.js";import{R as Bt}from"./resource-health-oWJ8hy9X.js";import{t as qt,a as wt,b as Gt,c as Qt,d as Wt,e as $t,l as Xt,P as Vt,L as zt,G as Yt,A as Jt,m as St,f as Zt,g as es,h as ts,i as ss,B as ns,j as ls}from"./vendor-charts-BE7R_8yA.js";import"./vendor-router-B1pQim9Z.js";const os=t=>(document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t));function as(){return M.useSyncExternalStore(os,is,rs)}function rs(){return!0}function is(){return document.visibilityState!=="hidden"}function cs(t,e){const o=He.c(4),[m,g]=M.useState(ds);let i,n;return o[0]!==e||o[1]!==t?(i=()=>{if(!e)return;g(Date.now());const h=setInterval(()=>g(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]),M.useEffect(i,n),m}function ds(){return Date.now()}const pt={"1h":36e5,"6h":216e5,"24h":864e5,"7d":6048e5},us={"1h":Gt.every(10),"6h":wt,"24h":wt.every(3),"7d":qt};function fs(t,e,o){return us[o].range(new Date(t),new Date(e+1))}function ms(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 hs=2e3;function xs(t){return Math.min(1e4,Math.max(1e3,pt[t]/hs))}const ps={"1h":6e4,"6h":6e4,"24h":3e5,"7d":9e5},gt=t=>Math.round(t*10)/10;function gs(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>Bt)return null;const g=i=>Number.isFinite(i)?gt(i):null;return{cpu:g(m.cpuPercent),mem:g(m.memUsedMB/m.memTotalMB*100)}}const Et={cpu:{label:"CPU",color:"#60a5fa"},mem:{label:"RAM",color:"#a78bfa"}},Lt={"1h":"1h","6h":"6h","24h":"24h","7d":"7d"};function Is(){const t=He.c(66);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0];const[o,m]=M.useState(e),[g,i]=M.useState(null),[n,h]=M.useState("24h"),R=as();let S;t[1]!==n?(S=xs(n),t[1]=n,t[2]=S):S=t[2];const x=cs(S,R),{setNode:v}=Tt();let p,j;t[3]!==v?(p=()=>(v(s.jsx("span",{className:"text-sm font-medium",children:"Mac Resources"})),()=>v(null)),j=[v],t[3]=v,t[4]=p,t[5]=j):(p=t[4],j=t[5]),M.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 X=C,{send:$,connected:E}=It(X);let ce,de;t[7]!==E||t[8]!==$?(ce=()=>{if(!E)return;$({type:"agents:list"});const u=setInterval(()=>$({type:"agents:list"}),1e4);return()=>clearInterval(u)},de=[E,$],t[7]=E,t[8]=$,t[9]=ce,t[10]=de):(ce=t[9],de=t[10]),M.useEffect(ce,de);let se;t[11]===Symbol.for("react.memo_cache_sentinel")?(se={queryKey:Xe.agents,queryFn:Ct,refetchOnWindowFocus:!1},t[11]=se):se=t[11];const V=bt(se);let d,f,B,ne;t[12]!==V.data||t[13]!==o?(B=V.data??[],f=o.map(js).filter(Boolean),d=[...new Set([...f,...B])],ne=new Set(f),t[12]=V.data,t[13]=o,t[14]=d,t[15]=f,t[16]=B,t[17]=ne):(d=t[14],f=t[15],B=t[16],ne=t[17]);const b=ne,l=g??(V.isPending?null:B[0]??f[0]??null),q=Ot();let ee;t[18]!==n||t[19]!==l?(ee=l?Xe.resourceHistory(l,n):null,t[18]=n,t[19]=l,t[20]=ee):ee=t[20];const te=ee;let D;t[21]!==te||t[22]!==n?(D=te??Xe.resourceHistory("",n),t[21]=te,t[22]=n,t[23]=D):D=t[23];let G;t[24]!==n||t[25]!==l?(G=u=>{const{signal:T}=u;return Dt(l,n,T)},t[24]=n,t[25]=l,t[26]=G):G=t[26];let z;t[27]!==D||t[28]!==G?(z={queryKey:D,queryFn:G,enabled:!1},t[27]=D,t[28]=G,t[29]=z):z=t[29];const I=bt(z),Q=I.refetch;let P,Y;t[30]!==q||t[31]!==n||t[32]!==Q||t[33]!==l||t[34]!==R?(P=()=>{if(!l||!R)return;const u=Xe.resourceHistory(l,n),T=ps[n],N=()=>{const H=q.getQueryState(u);(H==null?void 0:H.fetchStatus)==="fetching"&&H.data===void 0?q.cancelQueries({queryKey:u,exact:!0}).then(()=>Q()):Q({cancelRefetch:!0})},k=q.getQueryState(u),ae=Math.max((k==null?void 0:k.dataUpdatedAt)??0,(k==null?void 0:k.errorUpdatedAt)??0),re=(k==null?void 0:k.data)!==void 0&&ae>0?Math.max(0,T-(Date.now()-ae)):0;let ie;const Ue=()=>{N(),ie=setInterval(N,T)},Fe=re>0?setTimeout(Ue,re):void 0;return re===0&&Ue(),()=>{clearTimeout(Fe),clearInterval(ie),q.cancelQueries({queryKey:u,exact:!0})}},Y=[l,n,R,Q,q],t[30]=q,t[31]=n,t[32]=Q,t[33]=l,t[34]=R,t[35]=P,t[36]=Y):(P=t[35],Y=t[36]),M.useEffect(P,Y);const w=I.data!==void 0||I.isError,J=te!==null&&!w,c=Pt(J,Kt);let K;t[37]!==I.data?(K=I.data??[],t[37]=I.data,t[38]=K):K=t[38];let Z;t[39]!==K?(Z=K.map(vs),t[39]=K,t[40]=Z):Z=t[40];const W=Z;let le;t[41]!==x||t[42]!==l||t[43]!==o?(le=l?gs(o,l,x):null,t[41]=x,t[42]=l,t[43]=o,t[44]=le):le=t[44];const r=le;let y;t[45]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("h1",{className:"sr-only",children:"Mac Resources"}),t[45]=y):y=t[45];let L;t[46]===Symbol.for("react.memo_cache_sentinel")?(L=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]=L):L=t[46];let _;t[47]!==d||t[48]!==E||t[49]!==b||t[50]!==l?(_=d.length===0?s.jsx("span",{className:"px-2 text-sm text-muted-foreground",children:E?"No agents yet.":"Connecting…"}):d.map(u=>{const T=b.has(u),N=l===u;return s.jsxs("button",{onClick:()=>i(u),"aria-current":N?"true":void 0,className:["flex items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-accent transition-colors",N?"bg-accent font-medium":""].join(" "),children:[s.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 rounded-full ${T?"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:T?"Online":"Offline"})]},u)}),t[47]=d,t[48]=E,t[49]=b,t[50]=l,t[51]=_):_=t[51];let A;t[52]!==_?(A=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:[L,_]}),t[52]=_,t[53]=A):A=t[53];let F;t[54]!==W||t[55]!==(r==null?void 0:r.cpu)||t[56]!==(r==null?void 0:r.mem)||t[57]!==J||t[58]!==x||t[59]!==n||t[60]!==l||t[61]!==c?(F=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(Ft,{value:n,onValueChange:u=>h(u),children:s.jsx(Ht,{children:Object.keys(Lt).map(ys)})})]}),J?s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("p",{className:"sr-only",children:"Loading…"}),s.jsxs("div",{className:c?"flex flex-col gap-6":"flex flex-col gap-6 invisible",children:[s.jsx(_t,{}),s.jsx(_t,{})]})]}):W.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(At,{title:"CPU %",color:"cpu",data:W,dataKey:"cpu",range:n,now:x,live:(r==null?void 0:r.cpu)??null}),s.jsx(At,{title:"RAM %",color:"mem",data:W,dataKey:"mem",range:n,now:x,live:(r==null?void 0:r.mem)??null})]})]}):s.jsxs("div",{className:"flex h-full items-center justify-center gap-2 text-muted-foreground",children:[s.jsx(Rt,{className:"h-8 w-8"}),s.jsx("p",{className:"text-sm",children:"Select a Mac to view resource history."})]})}),t[54]=W,t[55]=r==null?void 0:r.cpu,t[56]=r==null?void 0:r.mem,t[57]=J,t[58]=x,t[59]=n,t[60]=l,t[61]=c,t[62]=F):F=t[62];let oe;return t[63]!==A||t[64]!==F?(oe=s.jsxs("div",{className:"flex h-full min-h-0",children:[y,A,F]}),t[63]=A,t[64]=F,t[65]=oe):oe=t[65],oe}function ys(t){return s.jsx(Ut,{value:t,children:Lt[t]},t)}function vs(t){return{time:t.recorded_at,cpu:gt(t.cpu_percent),mem:gt(t.mem_percent)}}function js(t){return t.agentName}const yt=t=>new Date(t.time).getTime(),Nt=t=>new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),Ve=t=>`${Math.round(t*10)/10}%`,bs=$t(yt).left,ws=$t(t=>t.t).left,U={top:8,right:24,bottom:24,left:40},kt=16,Mt=6,Ss=20,Ns=40;function _t(){const t=He.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"rounded-lg border p-4 flex flex-col gap-3","aria-hidden":!0,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xt,{className:"h-2.5 w-2.5 rounded-full"}),s.jsx(xt,{className:"h-5 w-12"})]}),s.jsx(xt,{className:"h-[220px] w-full"})]}),t[0]=e):e=t[0],e}function At(t){const e=He.c(18),{title:o,color:m,data:g,dataKey:i,range:n,now:h,live:R}=t,S=Et[m].color;let x;e[0]!==S?(x=s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{background:S}}),e[0]=S,e[1]=x):x=e[1];let v;e[2]!==o?(v=s.jsx("h2",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=v):v=e[3];let p;e[4]!==x||e[5]!==v?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[x,v]}),e[4]=x,e[5]=v,e[6]=p):p=e[6];let j;e[7]!==g||e[8]!==i||e[9]!==S||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(Vt,{children:X=>{const{width:$,height:E}=X;return $>0&&E>0?s.jsx(ks,{width:$,height:E,data:g,dataKey:i,hex:S,range:n,now:h,live:R,label:o}):null}})}),e[7]=g,e[8]=i,e[9]=S,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 ks(t){const e=He.c(139),{width:o,height:m,data:g,dataKey:i,hex:n,range:h,now:R,live:S,label:x}=t,v=S===void 0?null:S,p=`chart-hint-${i}`,[j,C]=M.useState(null),[X,$]=M.useState(!1),[E,ce]=M.useState(null),[de,se]=M.useState(!1),V=de?E:null,d=o-U.left-U.right,f=m-U.top-U.bottom,B=R,ne=B-pt[h],b=Qt({domain:[ne,B],range:[0,Math.max(0,d)]}),l=Wt({domain:[0,100],range:[f,kt]}),q=d>0?Ss/d*pt[h]:0,ee=ne-q,te=B+q;let D;e[0]!==h||e[1]!==ee||e[2]!==te?(D=fs(ee,te,h),e[0]=h,e[1]=ee,e[2]=te,e[3]=D):D=e[3];const G=D,z=d>0?Math.min(.5,Ns/d):0,I=`fill-${i}`,Q=`plot-${i}`,P=`axis-fade-${i}`,Y=g[g.length-1],w=v!==null&&Y?{t:Math.max(B,yt(Y)+1),v,live:!0}:null;let J;e[4]!==i?(J=a=>({t:yt(a),v:a[i]}),e[4]=i,e[5]=J):J=e[5];const c=g.map(J);w&&c.push(w);const K=a=>Math.min(b(a),d),Z=w?K(w.t):0,W=w?l(w.v):0,le=Math.max(0,g.length-1),r=j===null?Math.max(0,c.length-1):j==="live"?w?c.length-1:le:Math.min(bs(g,j),le),y=X?c[r]:void 0,L=y?K(y.t):0,_=y?l(y.v):0,A=Et[i].label;let F;e[6]!==A?(F=a=>`${A}, ${Nt(a.t)}, ${a.live?"latest, ":""}${Ve(a.v)}`,e[6]=A,e[7]=F):F=e[7];const oe=F,u=a=>{const O=c[a];O&&(C(O.live?"live":O.t),$(!0),ce({now:a,text:oe(O)}))};let T;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>$(!1),e[8]=T):T=e[8];const N=T;let k,ae;e[9]!==X?(k=()=>{if(!X)return;const a=O=>{O.key==="Escape"&&$(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},ae=[X],e[9]=X,e[10]=k,e[11]=ae):(k=e[10],ae=e[11]),M.useEffect(k,ae);const re=a=>{if(c.length===0)return;const O=r,Ke=a.key==="ArrowLeft"||a.key==="ArrowDown"?Math.max(0,O-1):a.key==="ArrowRight"||a.key==="ArrowUp"?Math.min(c.length-1,O+1):a.key==="Home"?0:a.key==="End"?c.length-1:null;Ke!==null&&(a.preventDefault(),u(Ke))},ie=a=>{const O=Xt(a);if(!O)return;const Ke=O.x-U.left,vt=ws(c,b.invert(Ke).getTime()),jt=[c[vt-1],c[vt],w].reduce((mt,ht)=>ht&&(!mt||Math.abs(K(ht.t)-Ke)<=Math.abs(K(mt.t)-Ke))?ht:mt,void 0);jt&&u(c.indexOf(jt))},Ue="group",Fe=w?`${x}, last ${h}. Now ${Ve(w.v)}.`:Y?`${x}, last ${h}. Latest ${Ve(Y[i])}.`:`${x}, last ${h}. No samples.`;let H;e[12]!==I||e[13]!==n?(H=s.jsx(zt,{id:I,from:n,to:n,fromOpacity:.3,toOpacity:0,fromOffset:"5%",toOffset:"95%"}),e[12]=I,e[13]=n,e[14]=H):H=e[14];const ze=Math.max(0,d),Ye=Math.max(0,f);let ue;e[15]!==ze||e[16]!==Ye?(ue=s.jsx("rect",{x:0,y:0,width:ze,height:Ye}),e[15]=ze,e[16]=Ye,e[17]=ue):ue=e[17];let fe;e[18]!==Q||e[19]!==ue?(fe=s.jsx("clipPath",{id:Q,children:ue}),e[18]=Q,e[19]=ue,e[20]=fe):fe=e[20];const Je=`${P}-grad`,Ze=Math.max(0,d);let Be;e[21]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsx("stop",{offset:0,stopColor:"white",stopOpacity:0}),e[21]=Be):Be=e[21];let me;e[22]!==z?(me=s.jsx("stop",{offset:z,stopColor:"white",stopOpacity:1}),e[22]=z,e[23]=me):me=e[23];const et=1-z;let he;e[24]!==et?(he=s.jsx("stop",{offset:et,stopColor:"white",stopOpacity:1}),e[24]=et,e[25]=he):he=e[25];let qe;e[26]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsx("stop",{offset:1,stopColor:"white",stopOpacity:0}),e[26]=qe):qe=e[26];let xe;e[27]!==Je||e[28]!==Ze||e[29]!==me||e[30]!==he?(xe=s.jsxs("linearGradient",{id:Je,gradientUnits:"userSpaceOnUse",x1:0,y1:0,x2:Ze,y2:0,children:[Be,me,he,qe]}),e[27]=Je,e[28]=Ze,e[29]=me,e[30]=he,e[31]=xe):xe=e[31];const tt=Math.max(0,d),st=Math.max(0,d),nt=`url(#${P}-grad)`;let pe;e[32]!==f||e[33]!==st||e[34]!==nt?(pe=s.jsx("rect",{x:0,y:f,width:st,height:U.bottom*2,fill:nt}),e[32]=f,e[33]=st,e[34]=nt,e[35]=pe):pe=e[35];let ge;e[36]!==P||e[37]!==f||e[38]!==tt||e[39]!==pe?(ge=s.jsx("mask",{id:P,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse",x:0,y:f,width:tt,height:U.bottom*2,children:pe}),e[36]=P,e[37]=f,e[38]=tt,e[39]=pe,e[40]=ge):ge=e[40];let Ge;e[41]===Symbol.for("react.memo_cache_sentinel")?(Ge=[0,25,50,75,100],e[41]=Ge):Ge=e[41];let ye;e[42]!==d||e[43]!==l?(ye=s.jsx(Yt,{scale:l,width:d,tickValues:Ge,strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),e[42]=d,e[43]=l,e[44]=ye):ye=e[44];const lt=`url(#${Q})`;let ve;e[45]!==b?(ve=a=>b(a.t),e[45]=b,e[46]=ve):ve=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 be;e[49]!==c||e[50]!==ve||e[51]!==je||e[52]!==ot||e[53]!==l?(be=s.jsx(Jt,{data:c,x:ve,y:je,yScale:l,curve:St,fill:ot}),e[49]=c,e[50]=ve,e[51]=je,e[52]=ot,e[53]=l,e[54]=be):be=e[54];let we;e[55]!==b?(we=a=>b(a.t),e[55]=b,e[56]=we):we=e[56];let Se;e[57]!==l?(Se=a=>l(a.v),e[57]=l,e[58]=Se):Se=e[58];let Ne;e[59]!==n||e[60]!==c||e[61]!==we||e[62]!==Se?(Ne=s.jsx(Zt,{data:c,x:we,y:Se,curve:St,stroke:n,strokeWidth:1.5}),e[59]=n,e[60]=c,e[61]=we,e[62]=Se,e[63]=Ne):Ne=e[63];let ke;e[64]!==lt||e[65]!==be||e[66]!==Ne?(ke=s.jsxs("g",{clipPath:lt,children:[be,Ne]}),e[64]=lt,e[65]=be,e[66]=Ne,e[67]=ke):ke=e[67];const at=`url(#${P})`;let Me;e[68]!==h?(Me=a=>ms(+a,h),e[68]=h,e[69]=Me):Me=e[69];let _e;e[70]!==f||e[71]!==Me||e[72]!==G||e[73]!==b?(_e=s.jsx(es,{top:f,scale:b,tickValues:G,tickFormat:Me,hideAxisLine:!0,hideTicks:!0,tickLength:0,tickLabelProps:As}),e[70]=f,e[71]=Me,e[72]=G,e[73]=b,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 Qe;e[78]===Symbol.for("react.memo_cache_sentinel")?(Qe=[0,25,50,75,100],e[78]=Qe):Qe=e[78];let $e;e[79]!==l?($e=s.jsx(ts,{scale:l,tickValues:Qe,tickFormat:_s,hideAxisLine:!0,hideTicks:!0,tickLabelProps:Ms}),e[79]=l,e[80]=$e):$e=e[80];let Ee;e[81]!==Z||e[82]!==W||e[83]!==n||e[84]!==w?(Ee=w&&s.jsxs("g",{className:"live-head","aria-hidden":"true",pointerEvents:"none",children:[s.jsx("circle",{cx:Z,cy:W,r:Mt,fill:n,fillOpacity:.2}),s.jsx("circle",{cx:Z,cy:W,r:3,fill:n,stroke:"hsl(var(--background))",strokeWidth:1.5})]}),e[81]=Z,e[82]=W,e[83]=n,e[84]=w,e[85]=Ee):Ee=e[85];let Le;e[86]!==n||e[87]!==f||e[88]!==y||e[89]!==L||e[90]!==_?(Le=y&&s.jsxs("g",{style:{transition:"transform 0.25s ease-out",transform:`translateX(${L}px)`},pointerEvents:"none",children:[s.jsx(ss,{from:{x:0,y:kt},to:{x:0,y:f},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]=f,e[88]=y,e[89]=L,e[90]=_,e[91]=Le):Le=e[91];const rt=Math.max(0,d)+Mt,it=Math.max(0,f),ct=`${x} samples`,dt=Math.max(0,c.length-1),ut=V?Math.min(V.now,Math.max(0,c.length-1)):r,ft=V?V.text:c[r]?oe(c[r]):void 0;let Te;e[92]!==r||e[93]!==u?(Te=()=>{se(!0),u(r)},e[92]=r,e[93]=u,e[94]=Te):Te=e[94];let Oe;e[95]!==N?(Oe=()=>{N(),se(!1)},e[95]=N,e[96]=Oe):Oe=e[96];let Re;e[97]!==re||e[98]!==ie||e[99]!==N||e[100]!==p||e[101]!==rt||e[102]!==it||e[103]!==ct||e[104]!==dt||e[105]!==ut||e[106]!==ft||e[107]!==Te||e[108]!==Oe?(Re=s.jsx(ns,{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:Te,onBlur:Oe,onKeyDown:re,onMouseMove:ie,onMouseLeave:N,onTouchMove:ie,onTouchEnd:N,onTouchCancel:N}),e[97]=re,e[98]=ie,e[99]=N,e[100]=p,e[101]=rt,e[102]=it,e[103]=ct,e[104]=dt,e[105]=ut,e[106]=ft,e[107]=Te,e[108]=Oe,e[109]=Re):Re=e[109];let Ce;e[110]!==ye||e[111]!==ke||e[112]!==Ae||e[113]!==$e||e[114]!==Ee||e[115]!==Le||e[116]!==Re?(Ce=s.jsxs(ls,{left:U.left,top:U.top,children:[ye,ke,Ae,$e,Ee,Le,Re]}),e[110]=ye,e[111]=ke,e[112]=Ae,e[113]=$e,e[114]=Ee,e[115]=Le,e[116]=Re,e[117]=Ce):Ce=e[117];let De;e[118]!==m||e[119]!==Fe||e[120]!==H||e[121]!==fe||e[122]!==xe||e[123]!==ge||e[124]!==Ce||e[125]!==o?(De=s.jsxs("svg",{width:o,height:m,role:Ue,"aria-label":Fe,children:[H,fe,xe,ge,Ce]}),e[118]=m,e[119]=Fe,e[120]=H,e[121]=fe,e[122]=xe,e[123]=ge,e[124]=Ce,e[125]=o,e[126]=De):De=e[126];let Ie;e[127]!==p?(Ie=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]=Ie):Ie=e[128];let Pe;e[129]!==d||e[130]!==A||e[131]!==y||e[132]!==L||e[133]!==_?(Pe=y&&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(${L+U.left}px, ${_+U.top}px) translate(${L>d*.6?"calc(-100% - 12px)":"12px"}, -50%)`,transition:"transform 0.25s ease-out"},children:[s.jsxs("p",{className:"mb-1",children:["Date: ",Nt(y.t)]}),s.jsxs("p",{children:[A,": ",Ve(y.v)]})]}),e[129]=d,e[130]=A,e[131]=y,e[132]=L,e[133]=_,e[134]=Pe):Pe=e[134];let We;return e[135]!==De||e[136]!==Ie||e[137]!==Pe?(We=s.jsxs(s.Fragment,{children:[De,Ie,Pe]}),e[135]=De,e[136]=Ie,e[137]=Pe,e[138]=We):We=e[138],We}function Ms(){return{fontSize:11,fill:"currentColor",textAnchor:"end",dx:-4,dy:3,className:"fill-muted-foreground"}}function _s(t){return`${t}%`}function As(){return{fontSize:11,fill:"currentColor",textAnchor:"middle",dy:6,className:"fill-muted-foreground"}}export{ks as AreaChartInner,Is as MacResources};