@alepha/devtools 0.19.2 → 0.19.3

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 (121) hide show
  1. package/assets/ui/200.html +10 -0
  2. package/assets/ui/200.html.br +1 -0
  3. package/assets/ui/404.html +10 -0
  4. package/assets/ui/404.html.br +1 -0
  5. package/assets/ui/CNAME +1 -0
  6. package/assets/ui/asset.CHpVij2M.css +1 -0
  7. package/assets/ui/asset.CHpVij2M.css.br +0 -0
  8. package/assets/ui/asset.Cxu56LSy.css +1 -0
  9. package/assets/ui/asset.Cxu56LSy.css.br +0 -0
  10. package/assets/ui/chunk.9plHAFDW.js +1 -0
  11. package/assets/ui/chunk.9plHAFDW.js.br +0 -0
  12. package/assets/ui/chunk.B82rsdDI.js +1 -0
  13. package/assets/ui/chunk.B82rsdDI.js.br +0 -0
  14. package/assets/ui/chunk.B9jGefQy.js +1 -0
  15. package/assets/ui/chunk.B9jGefQy.js.br +0 -0
  16. package/assets/ui/chunk.BHYZ9sAK.js +1 -0
  17. package/assets/ui/chunk.BHYZ9sAK.js.br +0 -0
  18. package/assets/ui/chunk.Bc7_n90V.js +1 -0
  19. package/assets/ui/chunk.Bc7_n90V.js.br +0 -0
  20. package/assets/ui/chunk.CCbhJSL_.js +1 -0
  21. package/assets/ui/chunk.CCbhJSL_.js.br +0 -0
  22. package/assets/ui/chunk.CJt_09bu.js +1 -0
  23. package/assets/ui/chunk.CJt_09bu.js.br +0 -0
  24. package/assets/ui/chunk.CK6Z-I-W.js +1 -0
  25. package/assets/ui/chunk.CK6Z-I-W.js.br +1 -0
  26. package/assets/ui/chunk.Cj1opA98.js +1 -0
  27. package/assets/ui/chunk.Cj1opA98.js.br +0 -0
  28. package/assets/ui/chunk.CvCu4yZb.js +2 -0
  29. package/assets/ui/chunk.CvCu4yZb.js.br +0 -0
  30. package/assets/ui/chunk.D93ZmnLR.js +1 -0
  31. package/assets/ui/chunk.D93ZmnLR.js.br +6 -0
  32. package/assets/ui/chunk.D9MCnLj_.js +7 -0
  33. package/assets/ui/chunk.D9MCnLj_.js.br +0 -0
  34. package/assets/ui/chunk.DOwjsMaD.js +1 -0
  35. package/assets/ui/chunk.DOwjsMaD.js.br +0 -0
  36. package/assets/ui/chunk.DYIu-C82.js +1 -0
  37. package/assets/ui/chunk.DYIu-C82.js.br +0 -0
  38. package/assets/ui/chunk.D_-fkSwu.js +1 -0
  39. package/assets/ui/chunk.D_-fkSwu.js.br +0 -0
  40. package/assets/ui/chunk.Dc4PCYcb.js +1 -0
  41. package/assets/ui/chunk.Dc4PCYcb.js.br +0 -0
  42. package/assets/ui/chunk.De1vj4hM.js +1 -0
  43. package/assets/ui/chunk.De1vj4hM.js.br +0 -0
  44. package/assets/ui/chunk.DuQak1OK.js +1 -0
  45. package/assets/ui/chunk.DuQak1OK.js.br +0 -0
  46. package/assets/ui/chunk.DxnuHDOY.js +1 -0
  47. package/assets/ui/chunk.DxnuHDOY.js.br +0 -0
  48. package/assets/ui/chunk.TIounDiA.js +1 -0
  49. package/assets/ui/chunk.TIounDiA.js.br +0 -0
  50. package/assets/ui/chunk.p3hCiSrt.js +80 -0
  51. package/assets/ui/chunk.p3hCiSrt.js.br +0 -0
  52. package/assets/ui/chunk.yh4jaMrg.js +1 -0
  53. package/assets/ui/chunk.yh4jaMrg.js.br +0 -0
  54. package/assets/ui/entry.DnXws2rz.js +2 -0
  55. package/assets/ui/entry.DnXws2rz.js.br +0 -0
  56. package/assets/ui/index.html +10 -0
  57. package/assets/ui/index.html.br +1 -0
  58. package/dist/public/200.html +10 -0
  59. package/dist/public/200.html.br +1 -0
  60. package/dist/public/404.html +10 -0
  61. package/dist/public/404.html.br +1 -0
  62. package/dist/public/CNAME +1 -0
  63. package/dist/public/asset.CHpVij2M.css +1 -0
  64. package/dist/public/asset.CHpVij2M.css.br +0 -0
  65. package/dist/public/asset.Cxu56LSy.css +1 -0
  66. package/dist/public/asset.Cxu56LSy.css.br +0 -0
  67. package/dist/public/chunk.9plHAFDW.js +1 -0
  68. package/dist/public/chunk.9plHAFDW.js.br +0 -0
  69. package/dist/public/chunk.B82rsdDI.js +1 -0
  70. package/dist/public/chunk.B82rsdDI.js.br +0 -0
  71. package/dist/public/chunk.B9jGefQy.js +1 -0
  72. package/dist/public/chunk.B9jGefQy.js.br +0 -0
  73. package/dist/public/chunk.BHYZ9sAK.js +1 -0
  74. package/dist/public/chunk.BHYZ9sAK.js.br +0 -0
  75. package/dist/public/chunk.Bc7_n90V.js +1 -0
  76. package/dist/public/chunk.Bc7_n90V.js.br +0 -0
  77. package/dist/public/chunk.CCbhJSL_.js +1 -0
  78. package/dist/public/chunk.CCbhJSL_.js.br +0 -0
  79. package/dist/public/chunk.CJt_09bu.js +1 -0
  80. package/dist/public/chunk.CJt_09bu.js.br +0 -0
  81. package/dist/public/chunk.CK6Z-I-W.js +1 -0
  82. package/dist/public/chunk.CK6Z-I-W.js.br +1 -0
  83. package/dist/public/chunk.Cj1opA98.js +1 -0
  84. package/dist/public/chunk.Cj1opA98.js.br +0 -0
  85. package/dist/public/chunk.CvCu4yZb.js +2 -0
  86. package/dist/public/chunk.CvCu4yZb.js.br +0 -0
  87. package/dist/public/chunk.D93ZmnLR.js +1 -0
  88. package/dist/public/chunk.D93ZmnLR.js.br +6 -0
  89. package/dist/public/chunk.D9MCnLj_.js +7 -0
  90. package/dist/public/chunk.D9MCnLj_.js.br +0 -0
  91. package/dist/public/chunk.DOwjsMaD.js +1 -0
  92. package/dist/public/chunk.DOwjsMaD.js.br +0 -0
  93. package/dist/public/chunk.DYIu-C82.js +1 -0
  94. package/dist/public/chunk.DYIu-C82.js.br +0 -0
  95. package/dist/public/chunk.D_-fkSwu.js +1 -0
  96. package/dist/public/chunk.D_-fkSwu.js.br +0 -0
  97. package/dist/public/chunk.Dc4PCYcb.js +1 -0
  98. package/dist/public/chunk.Dc4PCYcb.js.br +0 -0
  99. package/dist/public/chunk.De1vj4hM.js +1 -0
  100. package/dist/public/chunk.De1vj4hM.js.br +0 -0
  101. package/dist/public/chunk.DuQak1OK.js +1 -0
  102. package/dist/public/chunk.DuQak1OK.js.br +0 -0
  103. package/dist/public/chunk.DxnuHDOY.js +1 -0
  104. package/dist/public/chunk.DxnuHDOY.js.br +0 -0
  105. package/dist/public/chunk.TIounDiA.js +1 -0
  106. package/dist/public/chunk.TIounDiA.js.br +0 -0
  107. package/dist/public/chunk.p3hCiSrt.js +80 -0
  108. package/dist/public/chunk.p3hCiSrt.js.br +0 -0
  109. package/dist/public/chunk.yh4jaMrg.js +1 -0
  110. package/dist/public/chunk.yh4jaMrg.js.br +0 -0
  111. package/dist/public/entry.DnXws2rz.js +2 -0
  112. package/dist/public/entry.DnXws2rz.js.br +0 -0
  113. package/dist/public/index.html +10 -0
  114. package/dist/public/index.html.br +1 -0
  115. package/package.json +10 -10
  116. package/src/ui/components/dashboard/DevDashboard.tsx +1 -1
  117. package/dist/index.browser.js +0 -224
  118. package/dist/index.browser.js.map +0 -1
  119. package/dist/index.d.ts +0 -499
  120. package/dist/index.js +0 -839
  121. package/dist/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ import{$ as e,A as t,At as n,Dt as r,F as i,G as a,I as o,J as s,K as c,L as l,Lt as u,M as d,Ot as f,Q as p,St as m,U as h,V as g,W as _,Z as v,a as y,at as b,bt as x,ct as S,et as C,ft as w,g as T,gt as E,ht as D,it as O,jt as k,k as ee,kt as A,l as j,lt as M,mt as N,nt as P,o as te,ot as F,pt as I,q as L,st as ne,tt as re,u as R,v as ie,vt as z,xt as B,y as V,yt as ae}from"./chunk.p3hCiSrt.js";import{t as H}from"./entry.DnXws2rz.js";import{t as U}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{a as oe,c as se,d as ce,i as le,l as ue,n as de,o as fe,s as pe,t as me,u as he}from"./chunk.D9MCnLj_.js";var ge={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},W=n(),_e=E((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||`light`,autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:B(t),"--alert-bg":n||r?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||r?a.border:void 0}}}),G=b(e=>{let t=M(`Alert`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,radius:c,color:l,title:u,children:d,id:f,icon:m,withCloseButton:h,onClose:g,closeButtonLabel:_,variant:v,autoContrast:y,role:b,attributes:C,...w}=t,T=S({name:`Alert`,classes:ge,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:C,vars:s,varsResolver:_e}),E=x(f),D=u&&`${E}-title`||void 0,k=`${E}-body`;return(0,W.jsx)(O,{id:E,...T(`root`,{variant:v}),variant:v,...w,role:b||`alert`,"aria-describedby":d?k:void 0,"aria-labelledby":u?D:void 0,children:(0,W.jsxs)(`div`,{...T(`wrapper`),children:[m&&(0,W.jsx)(`div`,{...T(`icon`),children:m}),(0,W.jsxs)(`div`,{...T(`body`),children:[u&&(0,W.jsx)(`div`,{...T(`title`),"data-with-close-button":h||void 0,children:(0,W.jsx)(`span`,{id:D,...T(`label`),children:u})}),d&&(0,W.jsx)(`div`,{id:k,...T(`message`),"data-variant":v,children:d})]}),h&&(0,W.jsx)(p,{...T(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:o})]})})});G.classes=ge,G.varsResolver=_e,G.displayName=`@mantine/core/Alert`;var K=u(k(),1),q=(0,K.createContext)(null),ve={hiddenInputValuesSeparator:`,`},J=F((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:o,readOnly:s,name:c,hiddenInputValuesSeparator:l,hiddenInputProps:u,maxSelectedValues:d,disabled:f,...p}=M(`CheckboxGroup`,ve,e),[m,h]=z({value:t,defaultValue:n,finalValue:[],onChange:r}),g=e=>{let t=typeof e==`string`?e:e.currentTarget.value;if(s)return;let n=m.includes(t);!n&&d&&m.length>=d||h(n?m.filter(e=>e!==t):[...m,t])},_=e=>{if(f)return!0;if(!d)return!1;let t=m.includes(e),n=m.length>=d;return!t&&n},y=m.join(l);return(0,W.jsx)(q,{value:{value:m,onChange:g,size:i,isDisabled:_},children:(0,W.jsxs)(v.Wrapper,{size:i,...a,...p,labelElement:`div`,__staticSelector:`CheckboxGroup`,children:[(0,W.jsx)(L,{role:`group`,children:o}),(0,W.jsx)(`input`,{type:`hidden`,name:c,value:y,...u})]})})}));J.classes=v.Wrapper.classes,J.displayName=`@mantine/core/CheckboxGroup`;var ye={card:`m_26775b0a`},be=(0,K.createContext)(null),xe={withBorder:!0},Se=E((e,{radius:t})=>({card:{"--card-radius":B(t)}})),Y=b(e=>{let t=M(`CheckboxCard`,xe,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,checked:c,mod:l,withBorder:u,value:d,onClick:f,defaultChecked:p,onChange:m,attributes:h,...g}=t,_=S({name:`CheckboxCard`,classes:ye,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Se,rootSelector:`card`}),v=(0,K.use)(q),[y,b]=z({value:typeof c==`boolean`?c:v?v.value.includes(d||``):void 0,defaultValue:p,finalValue:!1,onChange:m});return(0,W.jsx)(be,{value:{checked:y},children:(0,W.jsx)(re,{mod:[{"with-border":u,checked:y},l],..._(`card`),...g,role:`checkbox`,"aria-checked":y,onClick:e=>{f?.(e),v?.onChange(d||``),b(!y)}})})});Y.displayName=`@mantine/core/CheckboxCard`,Y.classes=ye,Y.varsResolver=Se;var Ce={indicator:`m_5e5256ee`,icon:`m_1b1c543a`,"indicator--outline":`m_76e20374`},we={icon:c,variant:`filled`,radius:`sm`},Te=E((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=D({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--checkbox-size":m(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:B(t),"--checkbox-color":a===`outline`?c:N(n,e),"--checkbox-icon-color":i?N(i,e):w(o,e)?I({color:n,theme:e,autoContrast:o}):void 0}}}),X=b(e=>{let t=M(`CheckboxIndicator`,we,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,icon:c,indeterminate:l,radius:u,color:d,iconColor:f,autoContrast:p,checked:m,mod:h,variant:g,disabled:_,attributes:v,...y}=t,b=S({name:`CheckboxIndicator`,classes:Ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:v,vars:s,varsResolver:Te,rootSelector:`indicator`}),x=(0,K.use)(be),C=typeof m==`boolean`||typeof l==`boolean`?m||l:x?.checked||!1;return(0,W.jsx)(O,{...b(`indicator`,{variant:g}),variant:g,mod:[{checked:C,disabled:_},h],...y,children:(0,W.jsx)(c,{indeterminate:l,...b(`icon`)})})});X.displayName=`@mantine/core/CheckboxIndicator`,X.classes=Ce,X.varsResolver=Te;var Ee={root:`m_bf2d988c`,inner:`m_26062bec`,input:`m_26063560`,icon:`m_bf295423`,"input--outline":`m_215c4542`},De={labelPosition:`right`,icon:c,withErrorStyles:!0,variant:`filled`,radius:`sm`},Oe=E((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=D({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--checkbox-size":m(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:B(t),"--checkbox-color":a===`outline`?c:N(n,e),"--checkbox-icon-color":i?N(i,e):w(o,e)?I({color:n,theme:e,autoContrast:o}):void 0}}}),Z=b(e=>{let t=M(`Checkbox`,De,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:c,label:l,id:u,size:d,radius:f,wrapperProps:p,checked:m,labelPosition:h,description:g,error:v,disabled:y,variant:b,indeterminate:C,icon:w,rootRef:T,iconColor:E,onChange:D,autoContrast:k,mod:ee,attributes:A,readOnly:j,onClick:N,withErrorStyles:P,ref:te,...F}=t,I=(0,K.useRef)(null),L=(0,K.use)(q),re=d||L?.size,R=S({name:`Checkbox`,props:t,classes:Ee,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:A,vars:s,varsResolver:Oe}),{styleProps:ie,rest:z}=ne(F),B=x(u),V={checked:L?.value.includes(z.value)??m,onChange:e=>{L?.onChange(e),D?.(e)}},H=L?.isDisabled?.(z.value)??!1,U=y||H;return(0,K.useEffect)(()=>{I.current&&(I.current.indeterminate=C||!1,C?I.current.setAttribute(`data-indeterminate`,`true`):I.current.removeAttribute(`data-indeterminate`))},[C]),(0,W.jsx)(_,{...R(`root`),__staticSelector:`Checkbox`,__stylesApiProps:t,id:B,size:re,labelPosition:h,label:l,description:g,error:v,disabled:U,classNames:n,styles:a,unstyled:o,"data-checked":V.checked||m||void 0,variant:b,ref:T,mod:ee,attributes:A,inert:z.inert,...ie,...p,children:(0,W.jsxs)(O,{...R(`inner`),mod:{"data-label-position":h},children:[(0,W.jsx)(O,{component:`input`,id:B,ref:ae(I,te),mod:{error:!!v},...R(`input`,{focusable:!0,variant:b}),...z,...V,disabled:U,inert:z.inert,type:`checkbox`,onClick:e=>{j&&e.preventDefault(),N?.(e)}}),(0,W.jsx)(w,{indeterminate:C,...R(`icon`)})]})})});Z.classes={...Ee,...a},Z.varsResolver=Oe,Z.displayName=`@mantine/core/Checkbox`,Z.Group=J,Z.Indicator=X,Z.Card=Y;var ke=t(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),Ae=t(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),je=t(`outline`,`box-multiple`,`BoxMultiple`,[[`path`,{d:`M7 5a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10`,key:`svg-0`}],[`path`,{d:`M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2`,key:`svg-1`}]]),Me=t(`outline`,`box`,`Box`,[[`path`,{d:`M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5`,key:`svg-0`}],[`path`,{d:`M12 12l8 -4.5`,key:`svg-1`}],[`path`,{d:`M12 12l0 9`,key:`svg-2`}],[`path`,{d:`M12 12l-8 -4.5`,key:`svg-3`}]]),Ne=t(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),Pe=t(`outline`,`focus-centered`,`FocusCentered`,[[`path`,{d:`M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M4 8v-2a2 2 0 0 1 2 -2h2`,key:`svg-1`}],[`path`,{d:`M4 16v2a2 2 0 0 0 2 2h2`,key:`svg-2`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v2`,key:`svg-3`}],[`path`,{d:`M16 20h2a2 2 0 0 0 2 -2v-2`,key:`svg-4`}]]),Fe=t(`outline`,`layout-distribute-horizontal`,`LayoutDistributeHorizontal`,[[`path`,{d:`M4 4l16 0`,key:`svg-0`}],[`path`,{d:`M4 20l16 0`,key:`svg-1`}],[`path`,{d:`M6 11a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -2`,key:`svg-2`}]]),Ie=t(`outline`,`layout-distribute-vertical`,`LayoutDistributeVertical`,[[`path`,{d:`M4 4l0 16`,key:`svg-0`}],[`path`,{d:`M20 4l0 16`,key:`svg-1`}],[`path`,{d:`M9 8a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -8`,key:`svg-2`}]]),Le=t(`outline`,`lock-open`,`LockOpen`,[[`path`,{d:`M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -6`,key:`svg-0`}],[`path`,{d:`M11 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 11v-5a4 4 0 0 1 8 0`,key:`svg-2`}]]),Re=t(`outline`,`lock`,`Lock`,[[`path`,{d:`M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 11v-4a4 4 0 1 1 8 0v4`,key:`svg-2`}]]),ze=t(`outline`,`minus`,`Minus`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}]]),Q={"alepha.core":`#868e96`,"alepha.server":`#228be6`,"alepha.security":`#fa5252`,"alepha.orm":`#40c057`,"alepha.cache":`#fab005`,"alepha.queue":`#fd7e14`,"alepha.topic":`#be4bdb`,"alepha.bucket":`#15aabf`,"alepha.scheduler":`#e64980`,"alepha.logger":`#74c0fc`,"alepha.devtools":`#845ef7`},Be=`#495057`,$=e=>{if(!e)return Be;if(Q[e])return Q[e];for(let[t,n]of Object.entries(Q))if(e.startsWith(t))return n;let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return`hsl(${Math.abs(t%360)}, 60%, 50%)`},Ve=({filters:e,onFiltersChange:t,layout:n,onLayoutChange:r,modules:a,nodeCount:s,edgeCount:c,onExport:u})=>{let f=e.viewMode===`modules`;return(0,W.jsxs)(y,{gap:`sm`,wrap:`wrap`,align:`center`,children:[(0,W.jsx)(y,{children:(0,W.jsx)(o,{size:`xs`,value:e.viewMode,onChange:n=>t({...e,viewMode:n}),data:[{label:(0,W.jsx)(l,{label:`Modules`,children:(0,W.jsx)(je,{size:R.sizes.icon.sm,style:{marginTop:2}})}),value:`modules`},{label:(0,W.jsx)(l,{label:`Services`,children:(0,W.jsx)(Me,{size:R.sizes.icon.sm,style:{marginTop:2}})}),value:`providers`}]})}),(0,W.jsx)(d,{placeholder:f?`Search modules...`:`Search services...`,leftSection:(0,W.jsx)(ie,{size:14}),value:e.search,onChange:n=>t({...e,search:n.currentTarget.value}),size:`xs`,style:{width:200}}),!f&&(0,W.jsx)(i,{placeholder:`Filter by module`,value:e.module,onChange:n=>t({...e,module:n||`all`}),data:[{label:`All modules`,value:`all`},...a.map(e=>({label:e,value:e}))],size:`xs`,style:{width:200},clearable:!0}),(0,W.jsx)(Z,{label:`Hide framework`,checked:e.hideFramework,onChange:n=>t({...e,hideFramework:n.currentTarget.checked}),size:`xs`}),(0,W.jsx)(o,{size:`xs`,value:n,onChange:e=>r(e),data:[{label:(0,W.jsx)(l,{label:`Hierarchical`,children:(0,W.jsx)(Ie,{size:14})}),value:`dagre`},{label:(0,W.jsx)(l,{label:`Circular`,children:(0,W.jsx)(H,{size:14})}),value:`circular`},{label:(0,W.jsx)(l,{label:`Force`,children:(0,W.jsx)(Fe,{size:14})}),value:`force`}]}),(0,W.jsxs)(y,{gap:4,children:[(0,W.jsxs)(h,{size:`xs`,variant:`light`,color:`gray`,children:[s,` `,f?`modules`:`services`]}),(0,W.jsxs)(h,{size:`xs`,variant:`light`,color:`gray`,children:[c,` edges`]})]}),(0,W.jsx)(j,{size:`sm`,variant:`subtle`,tooltip:`Export as PNG`,onClick:u,icon:(0,W.jsx)(Ne,{size:14})})]})},He=(e,t)=>{let n=new Map;for(let t of e)for(let e of t.dependencies){let r=n.get(e)||[];r.push(t.name),n.set(e,r)}let r=e.filter(e=>{if(t.hideFramework&&e.module?.startsWith(`alepha.`)||t.module&&t.module!==`all`&&e.module!==t.module)return!1;if(t.search){let n=t.search.toLowerCase();return e.name.toLowerCase().includes(n)||e.module?.toLowerCase().includes(n)}return!0}),i=new Set(r.map(e=>e.name)),a=r.map(e=>({id:e.name,type:`provider`,position:{x:0,y:0},data:{label:e.name,module:e.module,dependencies:e.dependencies,dependents:n.get(e.name)||[],aliases:e.aliases,isModule:!1}})),o=[];for(let e of r)for(let t of e.dependencies)i.has(t)&&o.push({id:`${e.name}->${t}`,source:e.name,target:t,animated:!1,style:{stroke:`#495057`,strokeWidth:1.5}});return{nodes:a,edges:o}},Ue=(e,t)=>{let n=new Map;for(let r of e){let e=r.module||`Other`;if(t.hideFramework&&e.startsWith(`alepha.`))continue;if(t.search){let n=t.search.toLowerCase();if(!e.toLowerCase().includes(n))continue}let i=n.get(e)||[];i.push(r),n.set(e,i)}let r=new Map,i=new Map;for(let[e,t]of n)r.set(e,new Set),i.set(e,new Set);for(let[t,a]of n)for(let o of a)for(let a of o.dependencies){let o=e.find(e=>e.name===a);if(o){let e=o.module||`Other`;e!==t&&n.has(e)&&(r.get(t)?.add(e),i.get(e)?.add(t))}}let a=Array.from(n.keys());t.module&&t.module!==`all`&&(a=a.filter(e=>e===t.module));let o=new Set(a),s=a.map(e=>{let t=n.get(e)||[];return{id:e,type:`provider`,position:{x:0,y:0},data:{label:e,module:e,dependencies:Array.from(r.get(e)||[]),dependents:Array.from(i.get(e)||[]),providers:t.map(e=>e.name),providerCount:t.length,isModule:!0}}}),c=[],l=new Set;for(let e of a)for(let t of r.get(e)||[])if(o.has(t)){let n=`${e}->${t}`;l.has(n)||(l.add(n),c.push({id:n,source:e,target:t,animated:!1,style:{stroke:`#495057`,strokeWidth:1.5}}))}return{nodes:s,edges:c}},We=(e,t)=>t.viewMode===`modules`?Ue(e,t):He(e,t),Ge=(e,t,n=`TB`)=>{let r=new Map,i=new Map;for(let t of e)r.set(t.id,[]),i.set(t.id,0);for(let e of t)r.get(e.source)?.push(e.target),i.set(e.target,(i.get(e.target)||0)+1);let a=new Map,o=[];for(let[e,t]of i)t===0&&(o.push(e),a.set(e,0));for(;o.length>0;){let e=o.shift(),t=a.get(e)||0;for(let n of r.get(e)||[]){let e=(i.get(n)||0)-1;i.set(n,e),e===0&&(o.push(n),a.set(n,t+1))}}let s=Math.max(...Array.from(a.values()),0);for(let t of e)a.has(t.id)||a.set(t.id,s+1);let c=new Map;for(let[e,t]of a){let n=c.get(t)||[];n.push(e),c.set(t,n)}let l=new Map(e.map(e=>[e.id,e])),u=[];for(let[e,t]of c){let r=-(t.length*230)/2;t.forEach((t,i)=>{let a=l.get(t);a&&u.push({...a,position:{x:n===`TB`?r+i*230:e*230,y:n===`TB`?e*140:r+i*140}})})}return u},Ke=e=>{let t=Math.max(200,e.length*30),n=2*Math.PI/e.length;return e.map((e,r)=>({...e,position:{x:Math.cos(r*n)*t,y:Math.sin(r*n)*t}}))},qe=(e,t=!0)=>{if(!t)return Ke(e);let n=new Map;for(let t of e){let e=t.data.module||`Other`,r=n.get(e)||[];r.push(t),n.set(e,r)}let r=Array.from(n.keys()).sort(),i=2*Math.PI/r.length,a=Math.max(300,r.length*80),o=[];return r.forEach((e,t)=>{let r=n.get(e)||[],s=t*i,c=Math.cos(s)*a,l=Math.sin(s)*a,u=Math.max(100,r.length*25),d=2*Math.PI/r.length;r.forEach((e,t)=>{let n=t*d;o.push({...e,position:{x:c+Math.cos(n)*u,y:l+Math.sin(n)*u}})})}),o},Je=(e,t,n)=>{switch(n){case`dagre`:return Ge(e,t);case`force`:return Ke(e);case`circular`:return qe(e);default:return Ge(e,t)}},Ye=(e,t,n)=>{let r=new Set([e]),i=new Map(t.map(e=>[e.id,e])),a=e=>{let t=i.get(e);if(t)for(let e of t.data.dependencies)r.has(e)||(r.add(e),a(e))},o=e=>{let t=i.get(e);if(t)for(let e of t.data.dependents)r.has(e)||(r.add(e),o(e))};return a(e),o(e),r},Xe=(e,t)=>{let n=[],r=new Set,i=new Set,a=new Map;for(let t of e)a.set(t.id,[]);for(let e of t)a.get(e.source)?.push(e.target);let o=(e,t)=>{r.add(e),i.add(e),t.push(e);for(let s of a.get(e)||[])if(!r.has(s))o(s,[...t]);else if(i.has(s)){let e=t.indexOf(s);n.push([...t.slice(e),s])}i.delete(e)};for(let t of e)r.has(t.id)||o(t.id,[]);return n},Ze=({node:e,onClose:t,onNodeClick:n})=>{if(!e)return null;let{data:r}=e,i=$(r.module),a=r.isModule;return(0,W.jsxs)(C,{p:`md`,style:{position:`absolute`,top:16,right:16,width:280,backgroundColor:R.colors.elevated,border:`1px solid ${R.colors.border}`,borderRadius:8,zIndex:10},children:[(0,W.jsxs)(y,{justify:`space-between`,align:`start`,mb:`sm`,children:[(0,W.jsxs)(y,{style:{flex:1},children:[(0,W.jsx)(s,{size:`sm`,fw:600,style:{wordBreak:`break-word`},children:r.label}),!a&&r.module&&(0,W.jsx)(h,{size:`xs`,variant:`light`,mt:4,style:{backgroundColor:`${i}20`,color:i},children:r.module}),a&&r.providerCount!==void 0&&(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,mt:4,children:[r.providerCount,` services`]})]}),(0,W.jsx)(j,{size:`sm`,variant:`subtle`,onClick:t,icon:(0,W.jsx)(T,{size:14})})]}),!a&&r.aliases&&r.aliases.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(g,{my:`xs`}),(0,W.jsx)(s,{size:`xs`,c:`dimmed`,mb:4,children:`Aliases`}),(0,W.jsx)(y,{gap:4,wrap:`wrap`,children:r.aliases.map(e=>(0,W.jsx)(h,{size:`xs`,variant:`outline`,children:e},e))})]}),a&&r.providers&&r.providers.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(g,{my:`xs`}),(0,W.jsxs)(y,{align:`center`,gap:4,mb:4,children:[(0,W.jsx)(Me,{size:12,opacity:.5}),(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Services (`,r.providers.length,`)`]})]}),(0,W.jsx)(P,{h:100,children:(0,W.jsx)(y,{direction:`column`,gap:2,children:r.providers.map(e=>(0,W.jsx)(s,{size:`xs`,children:e.split(`.`).pop()},e))})})]}),(0,W.jsx)(g,{my:`xs`}),(0,W.jsx)(P,{h:a?120:200,children:(0,W.jsxs)(y,{direction:`column`,gap:`xs`,children:[r.dependencies.length>0&&(0,W.jsxs)(y,{children:[(0,W.jsxs)(y,{align:`center`,gap:4,mb:4,children:[(0,W.jsx)(ke,{size:12,opacity:.5}),(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[a?`Depends on`:`Dependencies`,` (`,r.dependencies.length,`)`]})]}),(0,W.jsx)(y,{direction:`column`,gap:2,children:r.dependencies.map(e=>(0,W.jsx)(s,{size:`xs`,style:{cursor:`pointer`},c:`blue`,onClick:()=>n(e),children:e},e))})]}),r.dependents.length>0&&(0,W.jsxs)(y,{children:[(0,W.jsxs)(y,{align:`center`,gap:4,mb:4,children:[(0,W.jsx)(Ae,{size:12,opacity:.5}),(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`Used by (`,r.dependents.length,`)`]})]}),(0,W.jsx)(y,{direction:`column`,gap:2,children:r.dependents.map(e=>(0,W.jsx)(s,{size:`xs`,style:{cursor:`pointer`},c:`blue`,onClick:()=>n(e),children:e},e))})]}),r.dependencies.length===0&&r.dependents.length===0&&(0,W.jsx)(s,{size:`xs`,c:`dimmed`,children:`No dependencies`})]})})]})},Qe={provider:({data:e,selected:t})=>{let n=$(e.module),r=e.isFaded&&!e.isHighlighted,i=e.isModule;return(0,W.jsxs)(y,{p:`xs`,style:{borderRadius:i?12:8,border:`2px solid ${t||e.isSelected?n:R.colors.border}`,backgroundColor:R.colors.surface,minWidth:i?200:160,opacity:r?.3:1,transition:`opacity 0.2s, border-color 0.2s`,boxShadow:e.isHighlighted?`0 0 10px ${n}`:void 0},children:[(0,W.jsx)(le,{type:`target`,position:ce.Top,style:{background:n,width:8,height:8,border:`none`}}),(0,W.jsxs)(y,{direction:`column`,gap:4,children:[i?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(s,{size:`xs`,fw:600,style:{wordBreak:`break-word`},children:e.label}),(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[e.providerCount,` services`]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(s,{size:`xs`,fw:600,style:{wordBreak:`break-word`},children:e.label.split(`.`).pop()}),e.module&&(0,W.jsx)(h,{size:`xs`,variant:`light`,style:{backgroundColor:`${n}20`,color:n},children:e.module})]}),(0,W.jsxs)(y,{gap:4,children:[e.dependencies.length>0&&(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[e.dependencies.length,` deps`]}),e.dependents.length>0&&(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[e.dependents.length,` refs`]})]})]}),(0,W.jsx)(le,{type:`source`,position:ce.Bottom,style:{background:n,width:8,height:8,border:`none`}})]})}},$e=()=>{let t=A(r),[n,i,a]=ue([]),[o,c,l]=se([]),[u,d]=(0,K.useState)(null),[p,m]=(0,K.useState)(`dagre`),[g,_]=(0,K.useState)({search:``,module:`all`,hideFramework:!1,viewMode:`modules`}),{loading:v,result:b}=f({runOnInit:!0,handler:()=>t.fetch(`/__devtools/api/metadata`,{schema:{response:U}})},[]),x=b?.data.providers||[],S=(0,K.useMemo)(()=>{let e=new Set;for(let t of x)t.module&&e.add(t.module);return Array.from(e).sort()},[x]);(0,K.useEffect)(()=>{if(x.length===0)return;let{nodes:e,edges:t}=We(x,g);i(Je(e,t,p)),c(t)},[x,g,p,i,c]);let C=(0,K.useMemo)(()=>Xe(n,o),[n,o]),w=(0,K.useCallback)((e,t)=>{d({id:t.id,data:t.data});let r=Ye(t.id,n,o);i(e=>e.map(e=>({...e,data:{...e.data,isHighlighted:r.has(e.id),isSelected:e.id===t.id,isFaded:!r.has(e.id)}}))),c(e=>e.map(e=>({...e,animated:r.has(e.source)&&r.has(e.target),style:{...e.style,stroke:r.has(e.source)&&r.has(e.target)?$(n.find(t=>t.id===e.source)?.data.module):`#495057`,strokeWidth:r.has(e.source)&&r.has(e.target)?2:1,opacity:r.has(e.source)&&r.has(e.target)?1:.3}})))},[n,o,i,c]),T=(0,K.useCallback)(()=>{d(null),i(e=>e.map(e=>({...e,data:{...e.data,isHighlighted:!1,isSelected:!1,isFaded:!1}}))),c(e=>e.map(e=>({...e,animated:!1,style:{...e.style,stroke:`#495057`,strokeWidth:1.5,opacity:1}})))},[i,c]),E=(0,K.useCallback)(e=>{let t=n.find(t=>t.id===e);t&&w({},t)},[n,w]),D=te(),O=(0,K.useCallback)(()=>{if(document.querySelector(`.react-flow__viewport`))return D.alert({title:`Export`,message:`Export feature requires html2canvas library. Coming soon!`})},[]);return v?(0,W.jsx)(y,{align:`center`,justify:`center`,h:`100%`,children:(0,W.jsx)(e,{size:`sm`})}):(0,W.jsxs)(y,{p:`xl`,direction:`column`,gap:`md`,w:`100%`,h:`100%`,flex:1,mih:0,children:[(0,W.jsx)(Ve,{filters:g,onFiltersChange:_,layout:p,onLayoutChange:m,modules:S,nodeCount:n.length,edgeCount:o.length,onExport:O}),C.length>0&&(0,W.jsx)(G,{icon:(0,W.jsx)(ee,{size:16}),color:`orange`,variant:`light`,p:`xs`,children:(0,W.jsxs)(y,{align:`center`,gap:`xs`,children:[(0,W.jsx)(s,{size:`xs`,children:`Circular dependencies detected:`}),C.slice(0,3).map((e,t)=>(0,W.jsxs)(h,{size:`xs`,color:`orange`,variant:`light`,children:[e.length,` nodes`]},t)),C.length>3&&(0,W.jsxs)(s,{size:`xs`,c:`dimmed`,children:[`+`,C.length-3,` more`]})]})}),(0,W.jsx)(y,{flex:1,h:`100%`,style:{borderRadius:8,border:`1px solid ${R.colors.border}`,position:`relative`},children:(0,W.jsxs)(y,{h:`100%`,style:{position:`absolute`,top:0,left:0,right:0,bottom:0},children:[(0,W.jsx)(fe,{children:(0,W.jsxs)(pe,{nodes:n,edges:o,onNodesChange:a,onEdgesChange:l,onNodeClick:w,onPaneClick:T,nodeTypes:Qe,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[(0,W.jsx)(me,{variant:de.Dots,gap:20,size:1}),(0,W.jsx)(oe,{nodeColor:e=>$(e.data?.module),maskColor:`rgba(0, 0, 0, 0.5)`,style:{backgroundColor:R.colors.surface}}),(0,W.jsx)(et,{})]})}),(0,W.jsx)(Ze,{node:u,onClose:()=>T(),onNodeClick:E})]})})]})},et=()=>{let{zoomIn:e,zoomOut:t,fitView:n}=he(),[r,i]=(0,K.useState)(!1);return(0,W.jsxs)(y,{direction:`column`,gap:4,style:{position:`absolute`,bottom:16,left:16,zIndex:10,backgroundColor:R.colors.elevated,border:`1px solid ${R.colors.border}`,borderRadius:8,padding:4},children:[(0,W.jsx)(j,{size:`sm`,variant:`subtle`,tooltip:`Zoom in`,onClick:()=>e(),icon:(0,W.jsx)(V,{size:14})}),(0,W.jsx)(j,{size:`sm`,variant:`subtle`,tooltip:`Zoom out`,onClick:()=>t(),icon:(0,W.jsx)(ze,{size:14})}),(0,W.jsx)(j,{size:`sm`,variant:`subtle`,tooltip:`Fit view`,onClick:()=>n({padding:.2}),icon:(0,W.jsx)(Pe,{size:14})}),(0,W.jsx)(j,{size:`sm`,variant:`subtle`,tooltip:r?`Unlock`:`Lock`,onClick:()=>i(!r),icon:r?(0,W.jsx)(Re,{size:14}):(0,W.jsx)(Le,{size:14})})]})};export{$e as DevDependencyGraph,$e as default};
Binary file
@@ -0,0 +1 @@
1
+ import{$ as e,At as t,Dt as n,Et as r,J as i,Lt as a,M as o,Nt as s,Pt as c,U as l,_ as u,a as d,f,jt as p,kt as m,l as h,m as g,nt as _,r as v,tt as y,u as b,v as x,y as S}from"./chunk.p3hCiSrt.js";import{a as C}from"./entry.DnXws2rz.js";import{t as w}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{t as T}from"./chunk.yh4jaMrg.js";var E=a(p(),1),D=t(),O=c.object({}),k=e=>{if(!e)return null;try{let t=s(e);if(t?.properties)return t}catch{}return null},A=({entity:e,record:t,isNew:n,onSave:a,onDelete:o,pkColumn:s})=>{let c=(0,E.useMemo)(()=>k(n?e.insertSchema:e.updateSchema)??O,[e,n]),l=r({schema:c,handler:()=>{},initialValues:n?void 0:t},[c,t,n]);return(0,D.jsxs)(d,{direction:`column`,gap:`md`,children:[(0,D.jsxs)(d,{justify:`space-between`,children:[(0,D.jsx)(i,{fz:`sm`,fw:600,children:n?`New Record`:`Edit Record (${s}: ${t?.[s]})`}),(0,D.jsxs)(d,{gap:`xs`,children:[(0,D.jsx)(h,{size:`xs`,onClick:()=>a(l.currentValues),children:n?`Create`:`Save`}),!n&&(0,D.jsx)(h,{size:`sm`,variant:`light`,intent:`danger`,onClick:o,icon:(0,D.jsx)(u,{size:14})})]})]}),(0,D.jsx)(v,{form:l,skipSubmitButton:!0,skipFormElement:!0,columns:1})]})},j=e=>{if(!e.startsWith(`/db/editor/`))return{table:``,recordId:``};let t=e.slice(11),n=t.indexOf(`/`);return n===-1?{table:decodeURIComponent(t),recordId:``}:{table:decodeURIComponent(t.slice(0,n)),recordId:decodeURIComponent(t.slice(n+1))}},M=({entities:t})=>{let r=m(n),a=f(),s=g(),[c,u]=(0,E.useState)([]),[p,v]=(0,E.useState)(!1),[w,O]=(0,E.useState)(``),[k,M]=(0,E.useState)(null),{table:N,recordId:P}=j(s.url.pathname),F=P===`new`,I=t.find(e=>e.name===N),L=I?.columns?.find(e=>e.primaryKey)?.name??`id`,R=(0,E.useCallback)(async()=>{if(N){v(!0);try{let e=await r.fetch(`/__devtools/api/db/${N}/records?size=50`);u(e.data?.content??[]),M(e.data?.page)}catch{u([])}finally{v(!1)}}},[r,N]);(0,E.useEffect)(()=>{R()},[N,R]);let z=(0,E.useMemo)(()=>!P||F?null:c.find(e=>String(e[L])===P)??null,[c,P,F,L]),B=(0,E.useCallback)(e=>{a.push(`/db/editor/${encodeURIComponent(e)}`)},[a]),V=(0,E.useCallback)(e=>{let t=e[L];a.push(`/db/editor/${encodeURIComponent(N)}/${encodeURIComponent(String(t))}`)},[a,N,L]),H=(0,E.useCallback)(()=>{a.push(`/db/editor/${encodeURIComponent(N)}/new`)},[a,N]),U=async e=>{try{if(F)await r.fetch(`/__devtools/api/db/${N}/records`,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}),a.push(`/db/editor/${encodeURIComponent(N)}`);else if(z){let t=z[L];await r.fetch(`/__devtools/api/db/${N}/records/${t}`,{method:`PUT`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}})}await R()}catch{}},W=async()=>{if(!z)return;let e=z[L];try{await r.fetch(`/__devtools/api/db/${N}/records/${e}`,{method:`DELETE`}),a.push(`/db/editor/${encodeURIComponent(N)}`),await R()}catch{}},G=(0,E.useMemo)(()=>t.filter(e=>e.name.toLowerCase().includes(w.toLowerCase())).map(e=>({id:`entity:${e.name}`,label:e.name,icon:(0,D.jsx)(C,{size:13,color:`var(--mantine-color-blue-text)`,style:{flexShrink:0}}),badge:(0,D.jsx)(l,{size:`xs`,variant:`light`,color:`gray`,children:e.columns?.length??0})})),[t,w]),K=(0,E.useCallback)(e=>{B(e.replace(/^entity:/,``))},[B]),q=(0,E.useMemo)(()=>new Set,[]),J=N?`entity:${N}`:``;return(0,D.jsxs)(d,{style:{flex:1,overflow:`hidden`},children:[(0,D.jsxs)(d,{w:200,style:{borderRight:`1px solid ${b.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,D.jsx)(d,{p:`xs`,children:(0,D.jsx)(o,{size:`xs`,placeholder:`Filter tables...`,leftSection:(0,D.jsx)(x,{size:14}),value:w,onChange:e=>O(e.currentTarget.value)})}),(0,D.jsx)(_,{style:{flex:1},px:`xs`,children:(0,D.jsx)(T,{nodes:G,selectedId:J,openNodes:q,onSelect:K,onToggle:()=>{},showLeafCount:!1})})]}),N&&(0,D.jsxs)(d,{w:200,style:{borderRight:`1px solid ${b.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,D.jsx)(d,{px:`xs`,py:`xs`,style:{borderBottom:`1px solid ${b.colors.border}`,flexShrink:0},children:(0,D.jsxs)(d,{gap:`xs`,justify:`space-between`,children:[(0,D.jsxs)(i,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,children:[`Records`,` `,k?.totalElements!=null&&`(${k.totalElements})`]}),(0,D.jsx)(h,{size:`xs`,variant:`subtle`,color:`teal`,onClick:H,icon:(0,D.jsx)(S,{size:14})})]})}),(0,D.jsxs)(_,{style:{flex:1},px:`xs`,py:`xs`,children:[(0,D.jsx)(y,{w:`100%`,py:4,className:`devtools-tree-node`,"data-selected":F||void 0,style:{borderRadius:6,paddingLeft:8,paddingRight:8,transition:`background 100ms ease`},onClick:H,children:(0,D.jsxs)(d,{gap:8,wrap:`nowrap`,children:[(0,D.jsx)(S,{size:13,color:`var(--mantine-color-teal-text)`,style:{flexShrink:0}}),(0,D.jsx)(i,{fz:12,c:`teal`,children:`New Record`})]})}),p?(0,D.jsx)(d,{justify:`center`,py:`md`,children:(0,D.jsx)(e,{size:`xs`})}):c.map((e,t)=>{let n=e[L]??t,r=!F&&String(n)===P;return(0,D.jsx)(y,{w:`100%`,py:4,className:`devtools-tree-node`,"data-selected":r||void 0,style:{borderRadius:6,paddingLeft:8,paddingRight:8,transition:`background 100ms ease`},onClick:()=>V(e),children:(0,D.jsxs)(i,{fz:12,ff:`monospace`,truncate:!0,children:[L,`: `,String(n)]})},String(n))})]})]}),(0,D.jsxs)(d,{style:{flex:1,overflow:`auto`},p:`md`,children:[!N&&(0,D.jsx)(d,{align:`center`,justify:`center`,h:`100%`,children:(0,D.jsx)(i,{c:`dimmed`,fz:`sm`,children:`Select a table to browse records`})}),N&&!z&&!F&&(0,D.jsx)(d,{align:`center`,justify:`center`,h:`100%`,children:(0,D.jsx)(i,{c:`dimmed`,fz:`sm`,children:`Select a record or create a new one`})}),(z||F)&&I&&(0,D.jsx)(A,{entity:I,record:z,isNew:F,onSave:U,onDelete:W,pkColumn:L})]})]})},N=()=>{let e=m(n),[t,r]=(0,E.useState)([]);return(0,E.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:w}}).then(e=>r(e.data.entities??[])).catch(()=>{})},[e]),(0,D.jsx)(M,{entities:t})};export{N as default};
Binary file
@@ -0,0 +1 @@
1
+ import{A as e,At as t,Ct as n,Dt as r,Et as i,H as a,J as o,L as s,Lt as c,M as l,Nt as u,Pt as d,U as f,X as p,a as m,at as h,bt as g,ct as _,d as v,dt as y,ft as b,gt as x,it as S,jt as C,kt as w,l as ee,lt as T,mt as E,n as D,nt as O,pt as k,r as A,rt as j,tt as te,u as M,ut as ne,v as re,vt as N,wt as ie,xt as ae,z as oe}from"./chunk.p3hCiSrt.js";import{t as P}from"./chunk.D93ZmnLR.js";import{a as se,i as F,n as ce,r as I,t as L}from"./chunk.BHYZ9sAK.js";import{a as R}from"./entry.DnXws2rz.js";import{t as le}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{t as ue}from"./chunk.yh4jaMrg.js";function z(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function B(e,t){if(typeof e==`string`&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var V=c(C(),1),H=t(),de={serialize:JSON.stringify,deserialize:JSON.parse,size:`sm`,indentSpaces:2},U=h(e=>{let{value:t,defaultValue:n,onChange:r,formatOnBlur:i,validationError:a,serialize:o,deserialize:s,onFocus:c,onBlur:l,readOnly:u,error:d,indentSpaces:f,...p}=T(`JsonInput`,de,e),[m,h]=N({value:t,defaultValue:n,finalValue:``,onChange:r}),[g,_]=(0,V.useState)(B(m,s));return(0,H.jsx)(oe,{value:m,onChange:e=>h(e.currentTarget.value),onFocus:e=>{c?.(e),_(!0)},onBlur:e=>{l?.(e);let t=B(e.currentTarget.value,s);i&&!u&&t&&e.currentTarget.value.trim()!==``&&h(o(s(e.currentTarget.value),null,f)),_(t)},readOnly:u,...p,autoComplete:`off`,__staticSelector:`JsonInput`,error:g?d:a||!0,"data-monospace":!0})});U.classes=p.classes,U.displayName=`@mantine/core/JsonInput`;var[fe,W]=ie(`Tabs component was not found in the tree`),G={root:`m_89d60db1`,"list--default":`m_576c9d4`,list:`m_89d33d6d`,tab:`m_4ec4dce6`,panel:`m_b0c91715`,tabSection:`m_fc420b1f`,tabLabel:`m_42bbd1ae`,"tab--default":`m_539e827b`,"list--outline":`m_6772fbd5`,"tab--outline":`m_b59ab47c`,"tab--pills":`m_c3381914`},K=h(e=>{let t=T(`TabsList`,null,e),{children:n,className:r,grow:i,justify:a,classNames:o,styles:s,style:c,mod:l,...u}=t,d=W();return(0,H.jsx)(S,{...d.getStyles(`list`,{className:r,style:c,classNames:o,styles:s,props:t,variant:d.variant}),role:`tablist`,variant:d.variant,mod:[{grow:i,orientation:d.orientation,placement:d.orientation===`vertical`&&d.placement,inverted:d.inverted},l],"aria-orientation":d.orientation,__vars:{"--tabs-justify":a},...u,children:n})});K.classes=G,K.displayName=`@mantine/core/TabsList`;var q=h(e=>{let t=T(`TabsPanel`,null,e),{children:n,className:r,value:i,classNames:a,styles:o,style:s,mod:c,keepMounted:l,...u}=t,d=y(),f=W(),p=f.value===i,m=f.keepMounted||l,h=m&&d!==`test`?(0,H.jsx)(V.Activity,{mode:p?`visible`:`hidden`,children:n}):m||p?n:null;return(0,H.jsx)(S,{...f.getStyles(`panel`,{className:r,classNames:a,styles:o,style:[s,p?void 0:{display:`none`}],props:t}),mod:[{orientation:f.orientation},c],role:`tabpanel`,id:f.getPanelId(i),"aria-labelledby":f.getTabId(i),...u,children:h})});q.classes=G,q.displayName=`@mantine/core/TabsPanel`;var J=h(e=>{let t=T(`TabsTab`,null,e),{className:r,children:i,rightSection:a,leftSection:o,value:s,onClick:c,onKeyDown:l,disabled:u,color:d,style:f,classNames:p,styles:m,vars:h,mod:g,tabIndex:_,...v}=t,y=ne(),{dir:b}=j(),x=W(),S=s===x.value,C=e=>{x.onChange(x.allowTabDeactivation&&s===x.value?null:s),c?.(e)},w={classNames:p,styles:m,props:t};return(0,H.jsxs)(te,{...x.getStyles(`tab`,{className:r,style:f,variant:x.variant,...w}),disabled:u,unstyled:x.unstyled,variant:x.variant,mod:[{active:S,disabled:u,orientation:x.orientation,inverted:x.inverted,placement:x.orientation===`vertical`&&x.placement},g],role:`tab`,id:x.getTabId(s),"aria-selected":S,tabIndex:_===void 0?S||x.value===null?0:-1:_,"aria-controls":x.getPanelId(s),onClick:C,__vars:{"--tabs-color":d?E(d,y):void 0},onKeyDown:n({siblingSelector:`[role="tab"]`,parentSelector:`[role="tablist"]`,activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||`horizontal`,dir:b,onKeyDown:l}),...v,children:[o&&(0,H.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`left`,children:o}),i&&(0,H.jsx)(`span`,{...x.getStyles(`tabLabel`,w),children:i}),a&&(0,H.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`right`,children:a})]})});J.classes=G,J.displayName=`@mantine/core/TabsTab`;var Y=`Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value`,pe={keepMounted:!0,orientation:`horizontal`,loop:!0,activateTabWithKeyboard:!0,variant:`default`,placement:`left`},X=x((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":ae(t),"--tabs-color":E(n,e),"--tabs-text-color":b(r,e)?k({color:n,theme:e,autoContrast:r}):void 0}})),Z=h(e=>{let t=T(`Tabs`,pe,e),{defaultValue:n,value:r,onChange:i,orientation:a,children:o,loop:s,id:c,activateTabWithKeyboard:l,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,placement:h,keepMounted:v,classNames:y,styles:b,unstyled:x,className:C,style:w,vars:ee,autoContrast:E,mod:D,attributes:O,...k}=t,A=g(c),[j,te]=N({value:r,defaultValue:n,finalValue:null,onChange:i}),M=_({name:`Tabs`,props:t,classes:G,className:C,style:w,classNames:y,styles:b,unstyled:x,attributes:O,vars:ee,varsResolver:X});return(0,H.jsx)(fe,{value:{placement:h,value:j,orientation:a,id:A,loop:s,activateTabWithKeyboard:l,getTabId:z(`${A}-tab`,Y),getPanelId:z(`${A}-panel`,Y),onChange:te,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,keepMounted:v,unstyled:x,getStyles:M},children:(0,H.jsx)(S,{id:A,variant:d,mod:[{orientation:a,inverted:a===`horizontal`&&m,placement:a===`vertical`&&h},D],...M(`root`),...k,children:o})})});Z.classes=G,Z.varsResolver=X,Z.displayName=`@mantine/core/Tabs`,Z.Tab=J,Z.Panel=q,Z.List=K;var me=e(`outline`,`folder-open`,`FolderOpen`,[[`path`,{d:`M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2`,key:`svg-0`}]]),he=e(`outline`,`folder`,`Folder`,[[`path`,{d:`M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2`,key:`svg-0`}]]),ge=e(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),_e=e(`outline`,`schema`,`Schema`,[[`path`,{d:`M5 2h5v4h-5l0 -4`,key:`svg-0`}],[`path`,{d:`M15 10h5v4h-5l0 -4`,key:`svg-1`}],[`path`,{d:`M5 18h5v4h-5l0 -4`,key:`svg-2`}],[`path`,{d:`M5 10h5v4h-5l0 -4`,key:`svg-3`}],[`path`,{d:`M10 12h5`,key:`svg-4`}],[`path`,{d:`M7.5 6v4`,key:`svg-5`}],[`path`,{d:`M7.5 14v4`,key:`svg-6`}]]),ve={GET:{color:`var(--mantine-color-green-text)`,bg:`var(--mantine-color-green-light)`},POST:{color:`var(--mantine-color-blue-text)`,bg:`var(--mantine-color-blue-light)`},PUT:{color:`var(--mantine-color-orange-text)`,bg:`var(--mantine-color-orange-light)`},PATCH:{color:`var(--mantine-color-yellow-text)`,bg:`var(--mantine-color-yellow-light)`},DELETE:{color:`var(--mantine-color-red-text)`,bg:`var(--mantine-color-red-light)`}},ye={page:I,queue:L,topic:F,cache:R},be={page:`var(--mantine-color-blue-text)`,queue:`var(--mantine-color-orange-text)`,topic:`var(--mantine-color-pink-text)`,cache:`var(--mantine-color-cyan-text)`},xe={actions:{icon:se,color:`var(--mantine-color-teal-text)`},pages:{icon:I,color:`var(--mantine-color-blue-text)`},queues:{icon:L,color:`var(--mantine-color-orange-text)`},topics:{icon:F,color:`var(--mantine-color-pink-text)`},caches:{icon:R,color:`var(--mantine-color-cyan-text)`},routes:{icon:ce,color:`var(--mantine-color-violet-text)`}},Se=({method:e})=>{let t=e.toUpperCase(),n=t===`DELETE`?`DEL`:t,r=ve[t]??{color:`var(--mantine-color-dimmed)`,bg:`var(--mantine-color-default-hover)`};return(0,H.jsx)(o,{component:`span`,fz:9,fw:700,ff:`monospace`,lh:1,style:{paddingTop:5,color:r.color,background:r.bg,padding:`2px 4px`,borderRadius:3,flexShrink:0,letterSpacing:.3,width:32,textAlign:`center`,display:`inline-block`},children:n})},Ce=(e,t)=>{let n=e.type===`folder`,r=e.type===`action`,i;if(n){let n=xe[e.id];if(n){let e=n.icon;i=(0,H.jsx)(e,{size:15,color:n.color,style:{flexShrink:0}})}else i=(0,H.jsx)(t.has(e.id)?me:he,{size:15,color:`var(--mantine-color-dimmed)`,style:{flexShrink:0}})}else i=r?(0,H.jsx)(Se,{method:e.data?.method??`GET`}):(0,H.jsx)(ye[e.type]??I,{size:15,color:be[e.type]??`var(--mantine-color-dimmed)`,style:{flexShrink:0}});return{id:e.id,label:e.label,icon:i,children:e.children?.map(e=>Ce(e,t))}},we=({nodes:e,selectedId:t,openNodes:n,search:r,onSelect:i,onToggle:a})=>(0,H.jsx)(ue,{nodes:(0,V.useMemo)(()=>e.map(e=>Ce(e,n)),[e,n]),selectedId:t,openNodes:n,search:r,onSelect:i,onToggle:a}),Te={GET:`teal`,POST:`blue`,PUT:`orange`,PATCH:`yellow`,DELETE:`red`},Q=d.object({}),$=e=>{if(!e)return null;try{let t=u(e);if(t?.properties)return t}catch{}return null},Ee=e=>typeof e==`string`?e:e?.name??String(e),De=(e,t)=>{if(!t)return null;switch(e){case`$rateLimit`:if(t.max)return[{label:`max:${t.max}`,color:`red`}];break;case`$circuit`:if(t.threshold)return[{label:`threshold:${t.threshold}`,color:`red`}];break;case`$throttle`:if(t.rate)return[{label:`rate:${t.rate}`,color:`yellow`}];break;case`$retry`:if(t.max)return[{label:`max:${t.max}`,color:`blue`}];break;case`$cors`:if(t.origin)return[{label:String(t.origin),color:`blue`}];break;case`$lock`:if(t.key)return[{label:`key:${t.key}`,color:`pink`}];break}return null},Oe=({mw:e})=>{let t=e.options,n=t?.roles?.length||t?.permissions?.length||t?.issuers?.length||t?.optional,r=e.name===`$secure`?null:De(e.name,t),i=(0,H.jsx)(f,{size:`sm`,variant:`light`,color:`violet`,children:e.name});return(0,H.jsxs)(m,{gap:`xs`,wrap:`wrap`,align:`center`,children:[t&&!n&&!r&&e.name!==`$secure`?(0,H.jsx)(s,{label:JSON.stringify(t,null,2),multiline:!0,maw:400,styles:{tooltip:{fontFamily:`monospace`,fontSize:11}},children:i}):i,t?.roles?.length>0&&t.roles.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`cyan`,children:e},e)),t?.permissions?.length>0&&t.permissions.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`orange`,children:Ee(e)},Ee(e))),t?.issuers?.length>0&&t.issuers.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`green`,children:e},e)),t?.optional&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:`optional`}),r?.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:e.color,children:e.label},e.label))]})},ke=({action:e})=>{let t=w(r),[n,s]=(0,V.useState)(`{}`),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(!1),[p,h]=(0,V.useState)(0),g=`${e.method}:${e.fullPath}`,_=(0,V.useMemo)(()=>e.method===`GET`?null:$(e.body),[g]),v=(0,V.useMemo)(()=>$(e.query),[g]),y=(0,V.useMemo)(()=>$(e.params),[g]),b=i({schema:_??Q,handler:()=>{}},[_]),x=i({schema:v??Q,handler:()=>{}},[v]),S=i({schema:y??Q,handler:()=>{}},[y]),C=!!_,T=(0,V.useRef)(n);T.current=n;let E=(0,V.useCallback)(async()=>{d(!0),l(null);let n=performance.now();try{let r=e.fullPath;if(y){let e=S.currentValues;for(let[t,n]of Object.entries(e))n!=null&&(r=r.replace(`:${t}`,encodeURIComponent(String(n))))}if(v){let e=x.currentValues,t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();n&&(r+=`?${n}`)}let i;if(e.method!==`GET`)if(C)i=b.currentValues;else try{i=JSON.parse(T.current)}catch{i=void 0}let a=await t.fetch(r,{method:e.method,body:e.method===`GET`?void 0:JSON.stringify(i),headers:e.method===`GET`?void 0:{"Content-Type":`application/json`}});h(Math.round(performance.now()-n)),l({status:a.status,data:a.data})}catch(e){h(Math.round(performance.now()-n)),l({error:e.message??`Request failed`})}finally{d(!1)}},[t,e,C,b,x,S,_,v,y]);return(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(m,{gap:`sm`,mb:`xs`,children:[(0,H.jsx)(f,{size:`lg`,variant:`light`,color:Te[e.method]??`gray`,children:e.method}),(0,H.jsx)(P,{fz:`sm`,children:e.fullPath}),e.secure&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`yellow`,children:`Secure`})]}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),e.middlewares?.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Middleware`}),(0,H.jsx)(m,{direction:`column`,gap:`xs`,children:e.middlewares.map(e=>(0,H.jsx)(Oe,{mw:e},e.name))})]}),(0,H.jsxs)(Z,{defaultValue:`schema`,children:[(0,H.jsxs)(Z.List,{children:[(0,H.jsx)(Z.Tab,{value:`schema`,leftSection:(0,H.jsx)(_e,{size:14}),children:`Schema`}),(0,H.jsx)(Z.Tab,{value:`tryit`,leftSection:(0,H.jsx)(ge,{size:14}),children:`Try It`})]}),(0,H.jsx)(Z.Panel,{value:`schema`,pt:`md`,children:(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[e.body&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Request Body`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.body,defaultExpandedDepth:2,size:`xs`})})]}),e.params&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.params,defaultExpandedDepth:2,size:`xs`})})]}),e.query&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.query,defaultExpandedDepth:2,size:`xs`})})]}),e.response&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Response`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.response,defaultExpandedDepth:2,size:`xs`})})]}),!e.body&&!e.params&&!e.query&&!e.response&&(0,H.jsx)(o,{c:`dimmed`,fz:`sm`,children:`No schema defined for this action.`})]})}),(0,H.jsx)(Z.Panel,{value:`tryit`,pt:`md`,children:(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[y&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(A,{form:S,skipSubmitButton:!0,skipFormElement:!0,columns:1})]}),v&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(A,{form:x,skipSubmitButton:!0,skipFormElement:!0,columns:1})]}),e.method!==`GET`&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Request Body`}),_?(0,H.jsx)(A,{form:b,skipSubmitButton:!0,skipFormElement:!0,columns:1}):(0,H.jsx)(U,{value:n,onChange:s,formatOnBlur:!0,autosize:!0,minRows:4,maxRows:12,styles:{input:{fontFamily:`monospace`,fontSize:12}}})]}),(0,H.jsxs)(m,{children:[(0,H.jsx)(ee,{size:`xs`,loading:u,onClick:E,color:Te[e.method]??`blue`,icon:(0,H.jsx)(ge,{size:14}),children:`Send Request`}),p>0&&(0,H.jsxs)(o,{fz:`xs`,c:`dimmed`,children:[p,`ms`]})]}),c&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Response`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:c.error?(0,H.jsx)(o,{c:`red`,fz:`sm`,children:c.error}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{size:`xs`,mb:`xs`,color:c.status<400?`teal`:`red`,children:c.status}),(0,H.jsx)(D,{data:c.data,defaultExpandedDepth:3,size:`xs`})]})})]})]})})]})]})},Ae=e=>e?e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`:`No TTL`,je=({cache:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name})}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`cyan`,children:`Cache`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider}),e.disabled&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`red`,children:`Disabled`})]}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsxs)(m,{direction:`column`,gap:`xs`,children:[(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`TTL`}),(0,H.jsx)(o,{fz:`sm`,ff:`monospace`,children:Ae(e.ttl)})]}),(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`Provider`}),(0,H.jsx)(o,{fz:`sm`,ff:`monospace`,children:e.provider??`default`})]}),(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`Status`}),(0,H.jsx)(f,{size:`xs`,color:e.disabled?`red`:`green`,children:e.disabled?`Disabled`:`Active`})]})]})})]}),Me=({page:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.label||e.name}),e.path&&(0,H.jsx)(P,{fz:`sm`,mb:`xs`,children:e.path}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[e.hasLazy&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`blue`,children:`Lazy`}),e.hasParent&&(0,H.jsxs)(f,{size:`xs`,variant:`light`,color:`gray`,children:[`Parent: `,e.parentName??`?`]}),e.hasChildren&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`teal`,children:`Children`}),e.hasErrorHandler&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`red`,children:`Error Handler`}),e.hasResolve&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`violet`,children:`Loader`}),e.client&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`orange`,children:`Client Only`}),e.static&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`cyan`,children:`Static`})]}),e.params&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.params,defaultExpandedDepth:2,size:`xs`})})]}),e.query&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.query,defaultExpandedDepth:2,size:`xs`})})]})]}),Ne=({queue:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`orange`,children:`Queue`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider})]}),e.schema&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Job Schema`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.schema,defaultExpandedDepth:2,size:`xs`})})]})]}),Pe=({topic:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`pink`,children:`Topic`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider}),e.subscribers>0&&(0,H.jsxs)(f,{size:`xs`,variant:`light`,color:`gray`,children:[e.subscribers,` subscriber`,e.subscribers===1?``:`s`]})]}),e.schema&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Message Schema`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.schema,defaultExpandedDepth:2,size:`xs`})})]})]}),Fe=d.object({selected:d.optional(d.text()),open:d.optional(d.text())}),Ie=e=>{let t=[];if(e.actions?.length>0){let n={id:`actions`,label:`actions`,type:`folder`,children:[]},r=new Map;for(let t of e.actions){let e=t.group||`default`;r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let[e,t]of Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t))){let r=e.split(`:`),i=n;for(let e=0;e<r.length;e++){let t=`actions:${r.slice(0,e+1).join(`:`)}`,n=i.children?.find(e=>e.id===t);n||(n={id:t,label:r[e],type:`folder`,children:[]},i.children=i.children??[],i.children.push(n)),i=n}let a=t.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({id:`action:${e.method}:${e.fullPath}`,label:e.name,type:`action`,data:e}));i.children=i.children??[],i.children.push(...a)}t.push(n)}if(e.pages?.length>0){let n=new Map,r=[];for(let t of e.pages)n.set(t.name,{id:`page:${t.name}`,label:t.name,type:`page`,data:t,children:[]});let i=new Set;for(let t of e.pages)if(t.parentName&&n.has(t.parentName)){let e=n.get(t.parentName);e.children=e.children??[],i.has(t.name)||(e.children.push(n.get(t.name)),i.add(t.name))}for(let t of e.pages)if(t.childrenNames){let e=n.get(t.name);for(let r of t.childrenNames)n.has(r)&&!i.has(r)&&(e.children=e.children??[],e.children.push(n.get(r)),i.add(r))}for(let t of e.pages)i.has(t.name)||r.push(n.get(t.name));let a=e=>{for(let t of e)t.children?.length===0?t.children=void 0:t.children&&a(t.children)};a(r),t.push({id:`pages`,label:`pages`,type:`folder`,children:r})}return e.queues?.length>0&&t.push({id:`queues`,label:`queues`,type:`folder`,children:e.queues.map(e=>({id:`queue:${e.name}`,label:e.name,type:`queue`,data:e}))}),e.topics?.length>0&&t.push({id:`topics`,label:`topics`,type:`folder`,children:e.topics.map(e=>({id:`topic:${e.name}`,label:e.name,type:`topic`,data:e}))}),e.caches?.length>0&&t.push({id:`caches`,label:`caches`,type:`folder`,children:e.caches.map(e=>({id:`cache:${e.name}`,label:e.name,type:`cache`,data:e}))}),t},Le=()=>{let e=w(r),[t,n]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[s,c]=v(Fe,{format:`querystring`}),[u,d]=(0,V.useState)(new Set(s.open?s.open.split(`,`):[`routes`,`actions`]));(0,V.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:le}}).then(e=>n(e.data)).catch(()=>{})},[e]);let f=(0,V.useMemo)(()=>t?Ie(t):[],[t]),p=s.selected??``,h=(0,V.useMemo)(()=>{if(!p||!t)return null;let[e,...n]=p.split(`:`),r=n.join(`:`);switch(e){case`action`:{let e=r.indexOf(`:`),n=e>=0?r.slice(0,e):``,i=e>=0?r.slice(e+1):r;return{type:`action`,data:t.actions?.find(e=>e.method===n&&e.fullPath===i)}}case`page`:return{type:`page`,data:t.pages?.find(e=>e.name===r)};case`queue`:return{type:`queue`,data:t.queues?.find(e=>e.name===r)};case`topic`:return{type:`topic`,data:t.topics?.find(e=>e.name===r)};case`cache`:return{type:`cache`,data:t.caches?.find(e=>e.name===r)};default:return null}},[p,t]),g=(0,V.useCallback)(e=>{c({selected:e,open:Array.from(u).join(`,`)})},[c,u]),_=(0,V.useCallback)(e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c({selected:s.selected,open:Array.from(n).join(`,`)}),n})},[c,s.selected]);return(0,H.jsxs)(m,{style:{flex:1,overflow:`hidden`},children:[(0,H.jsxs)(m,{w:280,style:{borderRight:`1px solid ${M.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,H.jsx)(m,{p:`xs`,children:(0,H.jsx)(l,{placeholder:`Search...`,size:`xs`,leftSection:(0,H.jsx)(re,{size:14}),value:i,onChange:e=>a(e.currentTarget.value)})}),(0,H.jsx)(O,{style:{flex:1},px:`xs`,pb:`xs`,children:(0,H.jsx)(we,{nodes:f,selectedId:p,openNodes:u,search:i,onSelect:g,onToggle:_})})]}),(0,H.jsxs)(m,{style:{flex:1,overflow:`auto`},p:`lg`,children:[!h&&(0,H.jsx)(m,{align:`center`,justify:`center`,h:`100%`,children:(0,H.jsx)(o,{c:`dimmed`,fz:`sm`,children:`Select a resource from the tree`})}),h?.type===`action`&&h.data&&(0,H.jsx)(ke,{action:h.data}),h?.type===`page`&&h.data&&(0,H.jsx)(Me,{page:h.data}),h?.type===`queue`&&h.data&&(0,H.jsx)(Ne,{queue:h.data}),h?.type===`topic`&&h.data&&(0,H.jsx)(Pe,{topic:h.data}),h?.type===`cache`&&h.data&&(0,H.jsx)(je,{cache:h.data})]})]})};export{Le as DevExplorer,Le as default};
Binary file
@@ -0,0 +1 @@
1
+ import{A as e}from"./chunk.p3hCiSrt.js";var t=e(`outline`,`api`,`Api`,[[`path`,{d:`M4 13h5`,key:`svg-0`}],[`path`,{d:`M12 16v-8h3a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-3`,key:`svg-1`}],[`path`,{d:`M20 8v8`,key:`svg-2`}],[`path`,{d:`M9 16v-5.5a2.5 2.5 0 0 0 -5 0v5.5`,key:`svg-3`}]]),n=e(`outline`,`broadcast`,`Broadcast`,[[`path`,{d:`M18.364 19.364a9 9 0 1 0 -12.728 0`,key:`svg-0`}],[`path`,{d:`M15.536 16.536a5 5 0 1 0 -7.072 0`,key:`svg-1`}],[`path`,{d:`M11 13a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}]]),r=e(`outline`,`file-text`,`FileText`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}],[`path`,{d:`M9 9l1 0`,key:`svg-2`}],[`path`,{d:`M9 13l6 0`,key:`svg-3`}],[`path`,{d:`M9 17l6 0`,key:`svg-4`}]]),i=e(`outline`,`route`,`Route`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5`,key:`svg-2`}]]),a=e(`outline`,`stack-2`,`Stack2`,[[`path`,{d:`M12 4l-8 4l8 4l8 -4l-8 -4`,key:`svg-0`}],[`path`,{d:`M4 12l8 4l8 -4`,key:`svg-1`}],[`path`,{d:`M4 16l8 4l8 -4`,key:`svg-2`}]]);export{t as a,n as i,i as n,r,a as t};
Binary file
@@ -0,0 +1 @@
1
+ import{A as e}from"./chunk.p3hCiSrt.js";var t=e(`outline`,`atom`,`Atom`,[[`path`,{d:`M12 12v.01`,key:`svg-0`}],[`path`,{d:`M19.071 4.929c-1.562 -1.562 -6 .337 -9.9 4.243c-3.905 3.905 -5.804 8.337 -4.242 9.9c1.562 1.561 6 -.338 9.9 -4.244c3.905 -3.905 5.804 -8.337 4.242 -9.9`,key:`svg-1`}],[`path`,{d:`M4.929 4.929c-1.562 1.562 .337 6 4.243 9.9c3.905 3.905 8.337 5.804 9.9 4.242c1.561 -1.562 -.338 -6 -4.244 -9.9c-3.905 -3.905 -8.337 -5.804 -9.9 -4.242`,key:`svg-2`}]]),n=e(`outline`,`refresh`,`Refresh`,[[`path`,{d:`M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4`,key:`svg-0`}],[`path`,{d:`M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,key:`svg-1`}]]);export{t as n,n as t};
Binary file
@@ -0,0 +1 @@
1
+ import{A as e,At as t,B as n,Dt as r,H as i,J as a,Lt as o,P as s,T as c,Tt as l,U as u,a as d,at as f,ct as p,f as m,gt as h,it as g,jt as _,kt as v,l as y,lt as b,nt as x,u as S}from"./chunk.p3hCiSrt.js";import{a as ee,i as C,n as w,r as T,t as E}from"./chunk.BHYZ9sAK.js";import{n as D,t as O}from"./chunk.Bc7_n90V.js";import{t as k}from"./chunk.De1vj4hM.js";import{a as A,r as j}from"./entry.DnXws2rz.js";import{t as M}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";var N=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],P=[`xs`,`sm`,`md`,`lg`,`xl`];function F(e,t){let n=t===void 0?`h${e}`:t;return N.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:P.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:l(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var I={root:`m_8a5d1357`},L=t(),R={order:1},z=h((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=F(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof r==`number`?r.toString():void 0,"--title-text-wrap":i}}}),B=f(e=>{let t=b(`Title`,R,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,order:s,vars:c,size:l,variant:u,lineClamp:d,textWrap:f,mod:m,attributes:h,..._}=t,v=p({name:`Title`,props:t,classes:I,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:c,varsResolver:z});return[1,2,3,4,5,6].includes(s)?(0,L.jsx)(g,{...v(`root`),component:`h${s}`,variant:u,mod:[{order:s,"data-line-clamp":typeof d==`number`},m],size:l,..._}):null});B.classes=I,B.varsResolver=z,B.displayName=`@mantine/core/Title`;var V=e(`outline`,`brand-nodejs`,`BrandNodejs`,[[`path`,{d:`M9 9v8.044a2 2 0 0 1 -2.996 1.734l-1.568 -.9a3 3 0 0 1 -1.436 -2.561v-6.635a3 3 0 0 1 1.436 -2.56l6 -3.667a3 3 0 0 1 3.128 0l6 3.667a3 3 0 0 1 1.436 2.561v6.634a3 3 0 0 1 -1.436 2.56l-6 3.667a3 3 0 0 1 -3.128 0`,key:`svg-0`}],[`path`,{d:`M17 9h-3.5a1.5 1.5 0 0 0 0 3h2a1.5 1.5 0 0 1 0 3h-3.5`,key:`svg-1`}]]),H=e(`outline`,`cpu`,`Cpu`,[[`path`,{d:`M5 6a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1l0 -12`,key:`svg-0`}],[`path`,{d:`M9 9h6v6h-6l0 -6`,key:`svg-1`}],[`path`,{d:`M3 10h2`,key:`svg-2`}],[`path`,{d:`M3 14h2`,key:`svg-3`}],[`path`,{d:`M10 3v2`,key:`svg-4`}],[`path`,{d:`M14 3v2`,key:`svg-5`}],[`path`,{d:`M21 10h-2`,key:`svg-6`}],[`path`,{d:`M21 14h-2`,key:`svg-7`}],[`path`,{d:`M14 21v-2`,key:`svg-8`}],[`path`,{d:`M10 21v-2`,key:`svg-9`}]]),U=e(`outline`,`plug`,`Plug`,[[`path`,{d:`M9.785 6l8.215 8.215l-2.054 2.054a5.81 5.81 0 1 1 -8.215 -8.215l2.054 -2.054`,key:`svg-0`}],[`path`,{d:`M4 20l3.5 -3.5`,key:`svg-1`}],[`path`,{d:`M15 4l-3.5 3.5`,key:`svg-2`}],[`path`,{d:`M20 9l-3.5 3.5`,key:`svg-3`}]]),W=e(`outline`,`server`,`Server`,[[`path`,{d:`M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3`,key:`svg-0`}],[`path`,{d:`M3 15a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -2`,key:`svg-1`}],[`path`,{d:`M7 8l0 .01`,key:`svg-2`}],[`path`,{d:`M7 16l0 .01`,key:`svg-3`}]]),G=o(_(),1),K=e=>e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m ${Math.floor(e%60)}s`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`,q=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,J={ERROR:`red`,WARN:`yellow`,INFO:`blue`,DEBUG:`gray`,TRACE:`dimmed`},Y={http:`teal`,db:`violet`,error:`red`},X=e=>{if(!(!e||typeof e!=`object`)){if(e.status&&e.method&&e.path&&e.duration)return`http`;if(e.type===`db:query`)return`db`}},Z=e=>{let t=e.data,n=X(t);return n===`http`?`${t.method} ${t.path} → ${t.status} (${t.duration}ms)`:n===`db`?`${t.operation} (${Math.round(t.duration)}ms)`:e.message},Q=()=>{let e=v(r),t=m(),[o,l]=(0,G.useState)(null),[f,p]=(0,G.useState)([]),[h,g]=(0,G.useState)([]),[_,b]=(0,G.useState)(!1),N=(0,G.useCallback)(async()=>{if(document.visibilityState===`visible`)try{let[t,n,r]=await Promise.all([e.fetch(`/__devtools/api/metadata`,{schema:{response:M}}),e.fetch(`/__devtools/api/logs?limit=10&level=DEBUG`),e.fetch(`/__devtools/api/logs?limit=20&type=http,db`)]);l(t.data),p(n.data?.logs??[]),g(r.data?.logs??[])}catch{}},[e]),P=(0,G.useCallback)(async()=>{b(!0);try{await e.fetch(`/__devtools/api/reload`,{method:`POST`}),setTimeout(()=>{N(),b(!1)},1e3)}catch{b(!1)}},[e,N]);(0,G.useEffect)(()=>{N();let e=setInterval(N,1e4);return()=>clearInterval(e)},[N]);let F=o?.system,I=(0,G.useMemo)(()=>o?[{label:`Actions`,count:o.actions?.length??0,icon:ee,color:`teal`},{label:`Pages`,count:o.pages?.length??0,icon:T,color:`blue`},{label:`Entities`,count:o.entities?.length??0,icon:A,color:`violet`},{label:`Queues`,count:o.queues?.length??0,icon:E,color:`orange`},{label:`Topics`,count:o.topics?.length??0,icon:C,color:`pink`},{label:`Caches`,count:o.caches?.length??0,icon:w,color:`cyan`},{label:`Providers`,count:o.providers?.length??0,icon:U,color:`grape`},{label:`Atoms`,count:o.atoms?.length??0,icon:D,color:`lime`},{label:`Env Vars`,count:o.envs?.length??0,icon:k,color:`yellow`}]:[],[o]);return(0,L.jsx)(d,{p:`lg`,w:`100%`,flex:1,direction:`column`,style:{overflow:`auto`},children:(0,L.jsxs)(d,{direction:`column`,gap:`lg`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(d,{justify:`space-between`,align:`center`,mb:`sm`,children:[(0,L.jsx)(B,{order:5,c:`dimmed`,tt:`uppercase`,fz:`xs`,fw:600,lts:1,children:`System`}),(0,L.jsx)(y,{size:`xs`,variant:`subtle`,color:`gray`,loading:_,onClick:P,icon:(0,L.jsx)(O,{size:14}),children:`Reload`})]}),(0,L.jsx)(s,{cols:{base:2,sm:3,md:4,lg:6},spacing:`sm`,children:F&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($,{icon:W,label:`Runtime`,value:F.runtime===`bun`?`Bun`:`Node.js`}),(0,L.jsx)($,{icon:V,label:`Version`,value:F.nodeVersion}),(0,L.jsx)($,{icon:j,label:`Mode`,value:F.mode}),(0,L.jsx)($,{icon:w,label:`Port`,value:String(F.port)}),(0,L.jsx)($,{icon:c,label:`Uptime`,value:K(F.uptime)}),(0,L.jsx)($,{icon:H,label:`Memory`,value:q(F.memoryUsage)})]})})]}),(0,L.jsxs)(n,{gap:`lg`,children:[(0,L.jsx)(n.Col,{span:{base:12,md:7},children:(0,L.jsxs)(i,{padding:`md`,radius:`md`,style:{background:S.colors.surface,border:`1px solid ${S.colors.border}`},children:[(0,L.jsx)(B,{order:5,mb:`sm`,c:`dimmed`,tt:`uppercase`,fz:`xs`,fw:600,lts:1,children:`Recent Events`}),(0,L.jsx)(x,{h:280,children:(0,L.jsxs)(d,{direction:`column`,gap:4,children:[h.length===0&&(0,L.jsx)(a,{c:`dimmed`,fz:`sm`,ta:`center`,py:`xl`,children:`No events yet`}),h.map((e,t)=>{let n=X(e.data)??`log`;return(0,L.jsxs)(d,{gap:`xs`,px:`xs`,py:4,style:{borderRadius:4,cursor:`pointer`,transition:`background 150ms`},onMouseEnter:e=>{e.currentTarget.style.background=`${S.colors.elevated}`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,L.jsx)(a,{fz:`xs`,c:`dimmed`,ff:`monospace`,w:55,style:{flexShrink:0},children:new Date(e.timestamp).toLocaleTimeString(`en`,{hour12:!1})}),(0,L.jsx)(u,{size:`xs`,variant:`light`,color:Y[n]??`gray`,style:{flexShrink:0},children:n===`http`?`HTTP`:n===`db`?`DB`:`LOG`}),(0,L.jsx)(a,{fz:`xs`,ff:`monospace`,truncate:!0,style:{flex:1},children:Z(e)})]},`${e.timestamp}-${t}`)})]})})]})}),(0,L.jsx)(n.Col,{span:{base:12,md:5},children:(0,L.jsxs)(i,{padding:`md`,radius:`md`,style:{background:S.colors.surface,border:`1px solid ${S.colors.border}`},children:[(0,L.jsxs)(d,{justify:`space-between`,mb:`sm`,children:[(0,L.jsx)(B,{order:5,c:`dimmed`,tt:`uppercase`,fz:`xs`,fw:600,lts:1,children:`Recent Logs`}),(0,L.jsx)(a,{fz:`xs`,c:`blue`,style:{cursor:`pointer`},onClick:()=>t.push(`/logs`),children:`View all`})]}),(0,L.jsx)(x,{h:280,children:(0,L.jsxs)(d,{direction:`column`,gap:4,children:[f.length===0&&(0,L.jsx)(a,{c:`dimmed`,fz:`sm`,ta:`center`,py:`xl`,children:`No logs yet`}),f.map((e,t)=>(0,L.jsxs)(d,{gap:`xs`,px:`xs`,py:4,style:{borderRadius:4},children:[(0,L.jsx)(u,{size:`xs`,variant:`light`,color:J[e.level]??`gray`,w:50,style:{flexShrink:0},children:e.level}),(0,L.jsx)(a,{fz:`xs`,c:`dimmed`,w:80,truncate:!0,style:{flexShrink:0},children:e.module}),(0,L.jsx)(a,{fz:`xs`,ff:`monospace`,truncate:!0,style:{flex:1},children:e.message})]},`${e.timestamp}-${t}`))]})})]})})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(B,{order:5,mb:`sm`,c:`dimmed`,tt:`uppercase`,fz:`xs`,fw:600,lts:1,children:`Primitives`}),(0,L.jsx)(s,{cols:{base:2,sm:3,md:5},spacing:`sm`,children:I.map(e=>(0,L.jsx)(i,{padding:`sm`,radius:`md`,style:{background:S.colors.surface,border:`1px solid ${S.colors.border}`},children:(0,L.jsxs)(d,{gap:`sm`,children:[(0,L.jsx)(e.icon,{size:18,opacity:.5}),(0,L.jsxs)(`div`,{style:{flex:1},children:[(0,L.jsx)(a,{fz:`xs`,c:`dimmed`,children:e.label}),(0,L.jsx)(a,{fz:`lg`,fw:700,lh:1.2,children:e.count})]})]})},e.label))})]})]})})},$=({icon:e,label:t,value:n})=>(0,L.jsx)(i,{padding:`sm`,radius:`md`,style:{background:S.colors.surface,border:`1px solid ${S.colors.border}`},children:(0,L.jsxs)(d,{gap:`xs`,children:[(0,L.jsx)(e,{size:16,opacity:.4}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(a,{fz:10,c:`dimmed`,tt:`uppercase`,lts:.5,children:t}),(0,L.jsx)(a,{fz:`sm`,fw:600,ff:`monospace`,lh:1.3,children:n})]})]})});export{Q as DevDashboard,Q as default};
Binary file
@@ -0,0 +1 @@
1
+ import{At as e,C as t,Dt as n,J as r,Lt as i,S as a,U as o,Y as s,a as c,jt as l,kt as u,u as d}from"./chunk.p3hCiSrt.js";import{t as f}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{a as p,c as m,d as h,i as g,l as _,n as v,o as y,r as b,s as x,t as S}from"./chunk.D9MCnLj_.js";var C=i(l(),1),w=e(),T={entity:({data:e})=>{let n=e;return(0,w.jsxs)(`div`,{style:{background:d.colors.surface,border:`1px solid ${d.colors.border}`,borderRadius:8,minWidth:240,overflow:`hidden`},children:[(0,w.jsx)(g,{type:`target`,position:h.Top,style:{background:`var(--mantine-color-blue-6)`}}),(0,w.jsx)(`div`,{style:{padding:`8px 12px`,borderBottom:`1px solid ${d.colors.border}`,background:d.colors.elevated},children:(0,w.jsxs)(c,{gap:`xs`,children:[(0,w.jsx)(r,{fz:`sm`,fw:700,children:n.name}),(0,w.jsx)(o,{size:`xs`,variant:`light`,color:`gray`,children:n.provider})]})}),(0,w.jsx)(c,{direction:`column`,gap:0,p:0,children:(n.columns??[]).map(e=>(0,w.jsxs)(c,{gap:`xs`,px:`sm`,py:4,style:{borderBottom:`1px solid ${d.colors.border}20`},wrap:`nowrap`,children:[e.primaryKey&&(0,w.jsx)(t,{size:10,color:`var(--mantine-color-yellow-6)`}),e.ref&&(0,w.jsx)(a,{size:10,color:`var(--mantine-color-blue-6)`}),!e.primaryKey&&!e.ref&&(0,w.jsx)(`span`,{style:{width:10}}),(0,w.jsx)(r,{fz:11,ff:`monospace`,style:{flex:1},children:e.name}),(0,w.jsx)(r,{fz:10,c:`dimmed`,ff:`monospace`,children:e.type}),e.nullable&&(0,w.jsx)(r,{fz:9,c:`dimmed`,children:`?`})]},e.name))}),(0,w.jsx)(g,{type:`source`,position:h.Bottom,style:{background:`var(--mantine-color-blue-6)`}})]})}},E=e=>{let t=e.map((t,n)=>{let r=Math.ceil(Math.sqrt(e.length)),i=Math.floor(n/r),a=n%r;return{id:t.name,type:`entity`,position:{x:a*320,y:i*300},data:t}}),n=[];for(let t of e)for(let e of t.columns??[])e.ref&&n.push({id:`${t.name}.${e.name}->${e.ref.entity}`,source:t.name,target:e.ref.entity,label:`${e.name} → ${e.ref.column}`,style:{stroke:`var(--mantine-color-blue-6)`,strokeWidth:1.5},labelStyle:{fontSize:10,fill:`var(--mantine-color-dimmed)`},animated:!0});return{nodes:t,edges:n}},D=({entities:e})=>{let t=(0,C.useMemo)(()=>E(e),[e]),[n,r,i]=_(t.nodes),[a,o,s]=m(t.edges);return(0,C.useEffect)(()=>{r(t.nodes),o(t.edges)},[t,r,o]),(0,w.jsxs)(x,{nodes:n,edges:a,onNodesChange:i,onEdgesChange:s,nodeTypes:T,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:d.colors.background},children:[(0,w.jsx)(S,{variant:v.Dots,gap:20,size:1}),(0,w.jsx)(b,{}),(0,w.jsx)(p,{nodeColor:`var(--mantine-color-dark-4)`,maskColor:`rgba(0,0,0,0.6)`,style:{backgroundColor:d.colors.surface}})]})},O=({entities:e})=>(0,w.jsx)(s,{flex:1,h:`100%`,style:{position:`absolute`,top:0,left:0,right:0,bottom:0},children:(0,w.jsx)(y,{children:(0,w.jsx)(D,{entities:e})})}),k=()=>{let e=u(n),[t,r]=(0,C.useState)([]);return(0,C.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:f}}).then(e=>r(e.data.entities??[])).catch(()=>{})},[e]),(0,w.jsx)(s,{flex:1,style:{position:`relative`},children:(0,w.jsx)(O,{entities:t})})};export{k as default};
Binary file
@@ -0,0 +1 @@
1
+ import{At as e,I as t,a as n,f as r,m as i,p as a,u as o}from"./chunk.p3hCiSrt.js";var s=e(),c=()=>{let e=r(),c=i().url.pathname.startsWith(`/db/editor`)?`editor`:`erd`;return(0,s.jsxs)(n,{direction:`column`,style:{flex:1},children:[(0,s.jsx)(n,{px:`md`,py:`xs`,style:{borderBottom:`1px solid ${o.colors.border}`},children:(0,s.jsx)(t,{size:`xs`,value:c,onChange:t=>{e.push(t===`editor`?`/db/editor`:`/db/erd`)},data:[{label:`ERD`,value:`erd`},{label:`Editor`,value:`editor`}]})}),(0,s.jsx)(a,{})]})};export{c as DevDatabase,c as default};
@@ -0,0 +1 @@
1
+  dͦ�����n��#����7�?0�c5hM����,€�&�I�s#�ˇ)��ۉ�r�k>�����9H��p  ��kƾ]�5��U����W���l��2dGc!@;.����F>0��O;�_���C7o���4n����i�H�i�ъT�C+?�VnVgbB�66�u �>`g�F�[�~Of��H�N7Hu�8_<ɶH$�I�R�^=�eZ}a(���e�#j��7��xꌠ����quFn�x��$TJ�S���������&��.���_,`�H:,��bԺ������'��a
@@ -0,0 +1 @@
1
+ import{A as e,At as t,Dt as n,J as r,Lt as i,M as a,N as o,R as s,U as c,a as l,jt as u,kt as d,l as f,n as p,nt as m,u as h,v as g,z as _}from"./chunk.p3hCiSrt.js";import{n as v,t as y}from"./chunk.Bc7_n90V.js";import{t as b}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{t as x}from"./chunk.yh4jaMrg.js";var S=e(`outline`,`device-floppy`,`DeviceFloppy`,[[`path`,{d:`M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M14 4l0 4l-6 0l0 -4`,key:`svg-2`}]]),C=i(u(),1),w=t(),T=e=>{let t={key:``,label:``,children:[]};for(let n of e){let e=n.name.split(`.`),r=t;for(let t=0;t<e.length;t++){let i=e.slice(0,t+1).join(`.`),a=r.children.find(e=>e.key===i);a||(a={key:i,label:e[t],children:[]},r.children.push(a)),t===e.length-1&&(a.atom=n),r=a}}return t.children.map(E)},E=e=>{for(;!e.atom&&e.children.length===1;){let t=e.children[0];e={...t,label:`${e.label}.${t.label}`}}return{...e,children:e.children.map(E)}},D=e=>{let t=!!e.atom&&e.children.length===0;return{id:e.atom?`atom:${e.atom.name}`:`folder:${e.key}`,label:e.label,icon:t?(0,w.jsx)(v,{size:13,color:`var(--mantine-color-violet-text)`,style:{flexShrink:0}}):void 0,badge:t&&e.atom?.currentValue!==void 0?(0,w.jsx)(c,{size:`xs`,variant:`light`,color:`green`,children:`set`}):void 0,children:e.children.length>0?e.children.map(D):void 0}},O=({schema:e,value:t,onChange:n})=>{if(!e)return null;let i=e;if(e.anyOf){let t=e.anyOf.find(e=>e.type!==`null`);t&&(i=t)}let c=i.type;return c===`object`&&i.properties?(0,w.jsx)(l,{direction:`column`,gap:`sm`,children:Object.entries(i.properties).map(([e,i])=>(0,w.jsxs)(l,{children:[(0,w.jsxs)(r,{fz:`xs`,fw:500,mb:4,children:[i.title||e,i.description&&(0,w.jsx)(r,{span:!0,fz:10,c:`dimmed`,ml:`xs`,children:i.description})]}),(0,w.jsx)(O,{schema:i,value:t?.[e],onChange:r=>n({...t,[e]:r})})]},e))}):c===`boolean`?(0,w.jsx)(o,{checked:t??!1,onChange:e=>n(e.currentTarget.checked),size:`sm`}):c===`number`||c===`integer`?(0,w.jsx)(s,{size:`xs`,value:t??``,onChange:e=>n(e===``?void 0:e),allowDecimal:c===`number`}):i.enum?(0,w.jsxs)(`select`,{value:t??``,onChange:e=>n(e.target.value||void 0),style:{padding:`4px 8px`,borderRadius:4,border:`1px solid ${h.colors.border}`,backgroundColor:h.colors.surface,color:`inherit`,fontSize:12,width:`100%`},children:[(0,w.jsx)(`option`,{value:``,children:`Select...`}),i.enum.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]}):(0,w.jsx)(a,{size:`xs`,value:t??``,onChange:e=>n(e.target.value||void 0)})},k=({atom:e,onSave:t})=>{let[n,i]=(0,C.useState)(e.currentValue??e.defaultValue),[a,s]=(0,C.useState)(!1),[u,d]=(0,C.useState)(``),[g,b]=(0,C.useState)(null);(0,C.useEffect)(()=>{let t=e.currentValue??e.defaultValue;i(t),d(JSON.stringify(t,null,2)),b(null)},[e]);let x=e=>{d(e);try{i(JSON.parse(e)),b(null)}catch{b(`Invalid JSON`)}},T=e.currentValue!==void 0,E=e.schema?.type,D=!E||E===`array`;return(0,w.jsxs)(l,{direction:`column`,h:`100%`,children:[(0,w.jsxs)(l,{px:`md`,py:`sm`,style:{borderBottom:`1px solid ${h.colors.border}`,flexShrink:0},children:[(0,w.jsxs)(l,{align:`center`,gap:`sm`,children:[(0,w.jsx)(v,{size:16,opacity:.5}),(0,w.jsx)(r,{fz:`sm`,fw:600,ff:`monospace`,children:e.name}),(0,w.jsx)(c,{size:`xs`,variant:`light`,color:T?`green`:`gray`,children:T?`has value`:`default`})]}),e.description&&(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,mt:4,children:e.description})]}),(0,w.jsx)(m,{style:{flex:1},p:`md`,children:(0,w.jsxs)(l,{direction:`column`,gap:`lg`,children:[(0,w.jsxs)(l,{gap:`lg`,wrap:`wrap`,children:[(0,w.jsxs)(l,{style:{flex:1,minWidth:200},children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Current Value`}),e.currentValue===void 0?(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,fs:`italic`,children:`(using default)`}):(0,w.jsx)(p,{data:e.currentValue,maxDepth:3})]}),(0,w.jsxs)(l,{style:{flex:1,minWidth:200},children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Default Value`}),e.defaultValue===void 0?(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,fs:`italic`,children:`(no default)`}):(0,w.jsx)(p,{data:e.defaultValue,maxDepth:3})]})]}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(l,{align:`center`,justify:`space-between`,mb:`sm`,children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,children:`Edit Value`}),(0,w.jsxs)(l,{gap:`xs`,align:`center`,children:[(0,w.jsx)(o,{size:`xs`,label:`JSON`,checked:a||D,onChange:e=>s(e.currentTarget.checked),disabled:D}),(0,w.jsx)(f,{size:`sm`,variant:`light`,tooltip:`Reset to default`,onClick:()=>{let t=e.defaultValue;i(t),d(JSON.stringify(t,null,2)),b(null)},icon:(0,w.jsx)(y,{size:14})}),(0,w.jsx)(f,{size:`xs`,icon:(0,w.jsx)(S,{size:14}),onClick:()=>t(n),disabled:a&&!!g,children:`Save`})]})]}),a||D?(0,w.jsx)(_,{value:u,onChange:e=>x(e.target.value),autosize:!0,minRows:6,maxRows:20,error:g??void 0,styles:{input:{fontFamily:`monospace`,fontSize:12}}}):(0,w.jsx)(l,{p:`sm`,style:{border:`1px solid ${h.colors.border}`,borderRadius:8,background:h.colors.surface},children:(0,w.jsx)(O,{schema:e.schema,value:n,onChange:i})})]}),(0,w.jsxs)(l,{children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Schema`}),(0,w.jsx)(p,{data:e.schema,maxDepth:2})]})]})})]})},A=()=>{let e=d(n),[t,i]=(0,C.useState)([]),[o,s]=(0,C.useState)(``),[c,u]=(0,C.useState)(``),[f,p]=(0,C.useState)(new Set),_=(0,C.useCallback)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:b}}).then(e=>{i(e.data.atoms);let t=new Set;for(let n of e.data.atoms){let e=n.name.split(`.`)[0];t.add(`folder:${e}`)}p(e=>e.size>0?e:t)}).catch(()=>{})},[e]);(0,C.useEffect)(()=>{_()},[_]);let y=(0,C.useMemo)(()=>{if(!o)return t;let e=o.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,o]),S=(0,C.useMemo)(()=>T(y),[y]),E=(0,C.useMemo)(()=>S.map(D),[S]),O=(0,C.useMemo)(()=>t.find(e=>e.name===c),[t,c]),A=(0,C.useCallback)(async t=>{if(O)try{await e.fetch(`/__devtools/api/atoms`,{method:`POST`,body:JSON.stringify({name:O.name,value:t})}),_()}catch(e){console.error(`Failed to save atom:`,e)}},[e,O,_]),j=(0,C.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,C.useCallback)(e=>{u(e.replace(/^atom:/,``))},[]);if(t.length===0)return(0,w.jsx)(l,{align:`center`,justify:`center`,style:{flex:1},c:`dimmed`,children:(0,w.jsxs)(l,{direction:`column`,align:`center`,gap:`xs`,children:[(0,w.jsx)(v,{size:40,opacity:.3}),(0,w.jsx)(r,{fz:`sm`,children:`No atoms found`}),(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,children:`Use $atom primitive to define state atoms`})]})});let N=c?`atom:${c}`:``;return(0,w.jsxs)(l,{style:{flex:1,overflow:`hidden`},children:[(0,w.jsxs)(l,{w:260,style:{borderRight:`1px solid ${h.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,w.jsx)(l,{p:`xs`,style:{flexShrink:0},children:(0,w.jsx)(a,{placeholder:`Search atoms...`,leftSection:(0,w.jsx)(g,{size:14}),size:`xs`,value:o,onChange:e=>s(e.currentTarget.value)})}),(0,w.jsx)(m,{style:{flex:1},px:`xs`,pb:`xs`,children:(0,w.jsx)(x,{nodes:E,selectedId:N,openNodes:f,onSelect:M,onToggle:j})})]}),(0,w.jsx)(l,{style:{flex:1,overflow:`hidden`},children:O?(0,w.jsx)(k,{atom:O,onSave:A}):(0,w.jsx)(l,{align:`center`,justify:`center`,h:`100%`,children:(0,w.jsx)(r,{c:`dimmed`,fz:`sm`,children:`Select an atom to view its details`})})})]})},j=()=>(0,w.jsx)(A,{});export{j as default};
Binary file
@@ -0,0 +1,2 @@
1
+ import{At as e,Dt as t,J as n,L as r,Lt as i,M as a,O as o,U as s,a as c,jt as l,kt as u,lt as d,nt as f,u as p,v as m,w as h}from"./chunk.p3hCiSrt.js";import{t as g}from"./chunk.D93ZmnLR.js";import{t as _}from"./chunk.De1vj4hM.js";import{t as v}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";var y=i(l(),1);function b(e={timeout:2e3}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),s=t=>{window.clearTimeout(a),o(window.setTimeout(()=>i(!1),e.timeout)),i(t)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>s(!0)).catch(e=>n(e)):n(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{i(!1),n(null),window.clearTimeout(a)},error:t,copied:r}}var x=e(),S={timeout:1e3};function C(e){let{children:t,timeout:n,value:r,...i}=d(`CopyButton`,S,e),a=b({timeout:n});return(0,x.jsx)(x.Fragment,{children:t({copy:()=>a.copy(r),copied:a.copied,...i})})}C.displayName=`@mantine/core/CopyButton`;var w=[`secret`,`password`,`key`,`token`,`api_key`],T=e=>{let t=e.toLowerCase();return w.some(e=>t.includes(e))},E=e=>{let t=new Map;for(let n of e){let e=n.schema;if(e?.properties)for(let[r,i]of Object.entries(e.properties)){if(t.has(r))continue;let e=i,a=n.values[r],o=e.type??`unknown`,s=e.format;if(e.anyOf){let t=e.anyOf.find(e=>e.type!==`null`);t&&(o=t.type??`unknown`,s=t.format)}t.set(r,{name:r,value:a,type:o,description:e.description,format:s})}}return Array.from(t.values()).sort((e,t)=>e.name.localeCompare(t.name))},D=({variable:e})=>{let t=e.value!==void 0&&e.value!==``,i=t?String(e.value):``,a=T(e.name);return(0,x.jsxs)(c,{direction:`column`,children:[e.description?.split(`
2
+ `).map((e,t)=>(0,x.jsxs)(n,{fz:11,ff:`monospace`,c:`dimmed`,fs:`italic`,lh:1.6,children:[`# `,e]},t)),(0,x.jsxs)(c,{align:`center`,gap:0,style:{lineHeight:1.6},children:[(0,x.jsx)(n,{fz:12,ff:`monospace`,fw:600,c:`teal.5`,component:`span`,children:e.name}),(0,x.jsx)(n,{fz:12,ff:`monospace`,c:`dimmed`,component:`span`,children:`=`}),t?(0,x.jsx)(n,{fz:12,ff:`monospace`,component:`span`,style:{filter:a?`blur(4px)`:void 0,transition:`filter 150ms`,cursor:a?`pointer`:void 0},onMouseEnter:e=>{a&&(e.currentTarget.style.filter=`none`)},onMouseLeave:e=>{a&&(e.currentTarget.style.filter=`blur(4px)`)},children:i}):(0,x.jsx)(n,{fz:12,ff:`monospace`,c:`dimmed`,fs:`italic`,component:`span`,children:`(not set)`}),(0,x.jsx)(s,{size:`xs`,variant:`dot`,color:`gray`,ml:`sm`,style:{flexShrink:0},children:e.format||e.type}),t&&(0,x.jsx)(C,{value:String(e.value),children:({copied:e,copy:t})=>(0,x.jsx)(r,{label:e?`Copied!`:`Copy`,withArrow:!0,children:(0,x.jsx)(c,{ml:6,onClick:t,style:{cursor:`pointer`,flexShrink:0},c:e?`teal`:`dimmed`,children:e?(0,x.jsx)(o,{size:12}):(0,x.jsx)(h,{size:12})})})})]})]})},O=()=>{let e=u(t),[r,i]=(0,y.useState)([]),[o,l]=(0,y.useState)(``);(0,y.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:v}}).then(e=>i(e.data.envs)).catch(()=>{})},[e]);let d=(0,y.useMemo)(()=>E(r),[r]),h=(0,y.useMemo)(()=>{if(!o)return d;let e=o.toLowerCase();return d.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[d,o]);return d.length===0?(0,x.jsx)(c,{align:`center`,justify:`center`,style:{flex:1},c:`dimmed`,children:(0,x.jsxs)(c,{direction:`column`,align:`center`,gap:`xs`,children:[(0,x.jsx)(_,{size:40,opacity:.3}),(0,x.jsx)(n,{fz:`sm`,children:`No environment variables found`}),(0,x.jsx)(n,{fz:`xs`,c:`dimmed`,children:`Use $env primitive to define expected environment variables`})]})}):(0,x.jsxs)(c,{direction:`column`,style:{flex:1},children:[(0,x.jsx)(c,{p:`sm`,style:{borderBottom:`1px solid ${p.colors.border}`,flexShrink:0},children:(0,x.jsxs)(c,{gap:`sm`,align:`center`,children:[(0,x.jsx)(a,{placeholder:`Search variables...`,leftSection:(0,x.jsx)(m,{size:14}),size:`xs`,value:o,onChange:e=>l(e.currentTarget.value),style:{flex:1,maxWidth:340}}),(0,x.jsxs)(s,{variant:`light`,color:`gray`,size:`sm`,children:[h.length,` / `,d.length]})]})}),(0,x.jsx)(f,{style:{flex:1},p:`md`,children:(0,x.jsx)(g,{block:!0,style:{background:p.colors.surface,border:`1px solid ${p.colors.border}`,borderRadius:8,padding:16},children:(0,x.jsx)(c,{direction:`column`,gap:8,children:h.map(e=>(0,x.jsx)(D,{variable:e},e.name))})})})]})},k=()=>(0,x.jsx)(O,{});export{k as default};
Binary file
@@ -0,0 +1 @@
1
+ import{At as e,at as t,ct as n,gt as r,it as i,lt as a,mt as o}from"./chunk.p3hCiSrt.js";var s={root:`m_b183c0a2`},c=e(),l=r((e,{color:t})=>({root:{"--code-bg":t?o(t,e):void 0}})),u=t(e=>{let t=a(`Code`,null,e),{classNames:r,className:o,style:u,styles:d,unstyled:f,vars:p,color:m,block:h,mod:g,attributes:_,...v}=t,y=n({name:`Code`,props:t,classes:s,className:o,style:u,classNames:r,styles:d,unstyled:f,attributes:_,vars:p,varsResolver:l});return(0,c.jsx)(i,{component:h?`pre`:`code`,mod:[{block:h},g],...y(`root`),...v,dir:`ltr`})});u.classes=s,u.varsResolver=l,u.displayName=`@mantine/core/Code`;export{u as t};
@@ -0,0 +1,6 @@
1
+ d`����D�S�j-W ͥ��2�S��O������a�CL�7p.��cRPf��Di�I0鯊x��� � ��
2
+ f��
3
+ ��4q��A\�t�Bw�ʛ���
4
+ F%��?��QJ,�E���Xq���
5
+ � �-��E4��'�����(;Gzd���2[�W�em]R�VW��J?Mf�n�6�uՆ
6
+ .�ۇ5�1