promptfoo 0.119.13 → 0.119.14

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 (131) hide show
  1. package/dist/package.json +28 -26
  2. package/dist/src/app/assets/index-eJ2lMe94.js +51 -0
  3. package/dist/src/app/assets/{source-map-support-Bnh0UQ2S.js → source-map-support-1v4oeb7P.js} +1 -1
  4. package/dist/src/app/assets/sync-CtLQRuC1.js +1 -0
  5. package/dist/src/app/assets/{vendor-charts-T60Uk0Z3.js → vendor-charts-DnVv66VV.js} +1 -1
  6. package/dist/src/app/assets/{vendor-markdown-DLig-KJh.js → vendor-markdown-DCpQIyMA.js} +1 -1
  7. package/dist/src/app/assets/{vendor-mui-core-5BLaiG3c.js → vendor-mui-core-Boqnpf9f.js} +1 -1
  8. package/dist/src/app/assets/{vendor-mui-icons-fn39Fu2e.js → vendor-mui-icons-B8MqoVbj.js} +1 -1
  9. package/dist/src/app/assets/vendor-mui-x-CGSS6QHF.js +45 -0
  10. package/dist/src/app/assets/{vendor-utils-DYBMEuwX.js → vendor-utils-DdfHIEy8.js} +1 -1
  11. package/dist/src/app/index.html +7 -7
  12. package/dist/src/assertions/guardrails.d.ts +1 -1
  13. package/dist/src/assertions/guardrails.js +18 -9
  14. package/dist/src/assertions/index.d.ts +1 -1
  15. package/dist/src/assertions/index.js +9 -3
  16. package/dist/src/assertions/searchRubric.d.ts +3 -0
  17. package/dist/src/assertions/searchRubric.js +18 -0
  18. package/dist/src/commands/eval.js +1 -1
  19. package/dist/src/commands/modelScan.d.ts +7 -1
  20. package/dist/src/commands/modelScan.js +121 -59
  21. package/dist/src/database/index.d.ts +6 -0
  22. package/dist/src/database/index.js +11 -0
  23. package/dist/src/database/tables.d.ts +46 -24
  24. package/dist/src/envars.d.ts +17 -0
  25. package/dist/src/generated/constants.js +1 -1
  26. package/dist/src/logger.d.ts +5 -0
  27. package/dist/src/logger.js +28 -0
  28. package/dist/src/main.js +17 -6
  29. package/dist/src/matchers.d.ts +1 -0
  30. package/dist/src/matchers.js +80 -0
  31. package/dist/src/models/eval.d.ts +2 -1
  32. package/dist/src/models/eval.js +44 -2
  33. package/dist/src/prompts/grading.d.ts +1 -0
  34. package/dist/src/prompts/grading.js +26 -1
  35. package/dist/src/prompts/index.d.ts +1 -0
  36. package/dist/src/prompts/index.js +4 -1
  37. package/dist/src/providers/adaline.gateway.js +2 -2
  38. package/dist/src/providers/anthropic/defaults.d.ts +1 -1
  39. package/dist/src/providers/anthropic/defaults.js +15 -0
  40. package/dist/src/providers/azure/chat.d.ts +3 -1
  41. package/dist/src/providers/azure/chat.js +16 -3
  42. package/dist/src/providers/azure/defaults.js +660 -141
  43. package/dist/src/providers/azure/responses.d.ts +5 -0
  44. package/dist/src/providers/azure/responses.js +33 -4
  45. package/dist/src/providers/azure/types.d.ts +4 -0
  46. package/dist/src/providers/bedrock/agents.d.ts +1 -1
  47. package/dist/src/providers/bedrock/agents.js +2 -2
  48. package/dist/src/providers/bedrock/base.d.ts +40 -0
  49. package/dist/src/providers/bedrock/base.js +171 -0
  50. package/dist/src/providers/bedrock/converse.d.ts +146 -0
  51. package/dist/src/providers/bedrock/converse.js +1044 -0
  52. package/dist/src/providers/bedrock/index.d.ts +1 -34
  53. package/dist/src/providers/bedrock/index.js +4 -159
  54. package/dist/src/providers/bedrock/knowledgeBase.d.ts +1 -1
  55. package/dist/src/providers/bedrock/knowledgeBase.js +2 -2
  56. package/dist/src/providers/bedrock/nova-sonic.d.ts +2 -1
  57. package/dist/src/providers/bedrock/nova-sonic.js +2 -2
  58. package/dist/src/providers/claude-agent-sdk.d.ts +58 -1
  59. package/dist/src/providers/claude-agent-sdk.js +22 -1
  60. package/dist/src/providers/defaults.js +4 -0
  61. package/dist/src/providers/github/defaults.js +6 -6
  62. package/dist/src/providers/google/types.d.ts +25 -0
  63. package/dist/src/providers/google/util.d.ts +2 -0
  64. package/dist/src/providers/google/vertex.js +78 -22
  65. package/dist/src/providers/{groq.d.ts → groq/chat.d.ts} +26 -20
  66. package/dist/src/providers/groq/chat.js +79 -0
  67. package/dist/src/providers/groq/index.d.ts +5 -0
  68. package/dist/src/providers/groq/index.js +24 -0
  69. package/dist/src/providers/groq/responses.d.ts +106 -0
  70. package/dist/src/providers/groq/responses.js +64 -0
  71. package/dist/src/providers/groq/types.d.ts +44 -0
  72. package/dist/src/providers/groq/types.js +3 -0
  73. package/dist/src/providers/groq/util.d.ts +15 -0
  74. package/dist/src/providers/groq/util.js +28 -0
  75. package/dist/src/providers/mcp/client.d.ts +8 -0
  76. package/dist/src/providers/mcp/client.js +60 -10
  77. package/dist/src/providers/mcp/types.d.ts +21 -0
  78. package/dist/src/providers/openai/chatkit-pool.d.ts +114 -0
  79. package/dist/src/providers/openai/chatkit-pool.js +548 -0
  80. package/dist/src/providers/openai/chatkit-types.d.ts +73 -0
  81. package/dist/src/providers/openai/chatkit-types.js +3 -0
  82. package/dist/src/providers/openai/chatkit.d.ts +76 -0
  83. package/dist/src/providers/openai/chatkit.js +879 -0
  84. package/dist/src/providers/openai/codex-sdk.d.ts +109 -0
  85. package/dist/src/providers/openai/codex-sdk.js +346 -0
  86. package/dist/src/providers/openai/defaults.d.ts +2 -0
  87. package/dist/src/providers/openai/defaults.js +10 -4
  88. package/dist/src/providers/registry.js +48 -9
  89. package/dist/src/providers/responses/types.d.ts +1 -1
  90. package/dist/src/providers/sagemaker.d.ts +2 -2
  91. package/dist/src/providers/webSearchUtils.d.ts +17 -0
  92. package/dist/src/providers/webSearchUtils.js +169 -0
  93. package/dist/src/providers/xai/chat.d.ts +61 -0
  94. package/dist/src/providers/xai/chat.js +68 -3
  95. package/dist/src/providers/xai/responses.d.ts +189 -0
  96. package/dist/src/providers/xai/responses.js +268 -0
  97. package/dist/src/redteam/constants/plugins.d.ts +1 -1
  98. package/dist/src/redteam/constants/plugins.js +1 -1
  99. package/dist/src/redteam/constants/strategies.d.ts +1 -1
  100. package/dist/src/redteam/constants/strategies.js +1 -0
  101. package/dist/src/redteam/plugins/vlguard.d.ts +53 -4
  102. package/dist/src/redteam/plugins/vlguard.js +362 -46
  103. package/dist/src/redteam/providers/constants.d.ts +2 -2
  104. package/dist/src/redteam/providers/constants.js +2 -2
  105. package/dist/src/redteam/providers/crescendo/index.d.ts +1 -1
  106. package/dist/src/redteam/providers/crescendo/index.js +5 -3
  107. package/dist/src/redteam/providers/hydra/index.js +1 -1
  108. package/dist/src/server/routes/modelAudit.js +4 -4
  109. package/dist/src/share.js +4 -2
  110. package/dist/src/telemetry.js +44 -8
  111. package/dist/src/types/env.d.ts +3 -0
  112. package/dist/src/types/env.js +1 -0
  113. package/dist/src/types/index.d.ts +896 -615
  114. package/dist/src/types/index.js +1 -0
  115. package/dist/src/types/providers.d.ts +1 -0
  116. package/dist/src/types/tracing.d.ts +3 -0
  117. package/dist/src/util/database.d.ts +6 -4
  118. package/dist/src/util/file.js +6 -4
  119. package/dist/src/util/modelAuditCliParser.d.ts +4 -4
  120. package/dist/src/util/xlsx.js +52 -26
  121. package/dist/src/validators/providers.d.ts +142 -122
  122. package/dist/src/validators/providers.js +4 -6
  123. package/dist/src/validators/redteam.d.ts +36 -28
  124. package/dist/src/validators/redteam.js +9 -3
  125. package/dist/tsconfig.tsbuildinfo +1 -1
  126. package/package.json +28 -26
  127. package/dist/drizzle/CLAUDE.md +0 -65
  128. package/dist/src/app/assets/index-DifT6VGT.js +0 -51
  129. package/dist/src/app/assets/sync-Oo-W_Rbj.js +0 -1
  130. package/dist/src/app/assets/vendor-mui-x-C2xF-yiO.js +0 -45
  131. package/dist/src/providers/groq.js +0 -48
@@ -0,0 +1,45 @@
1
+ import{r as e,d as t,c as n,g as r}from"./vendor-react-BuO7LJGJ.js";import{c as o,j as i,_ as s,a,u as l,b as u,l as c,d,S as p,s as h,e as f,M as g,F as m,I as b,f as v,P as w,g as y,h as x,T as C,i as S,B as M,k as R,L as I,m as P,n as k,o as E,D as T,C as D,p as F,q as A,r as O,t as H,A as $,v as z,w as L,x as j,y as N,z as G,E as _,G as V,H as B,J as W,K as U,N as K,O as q,Q as X,R as Y,U as Q,V as Z,W as J,X as ee,Y as te,Z as ne,$ as re,a0 as oe,a1 as ie,a2 as se,a3 as ae,a4 as le,a5 as ue,a6 as ce,a7 as de,a8 as pe,a9 as he,aa as fe,ab as ge,ac as me,ad as be,ae as ve,af as we}from"./vendor-mui-core-Boqnpf9f.js";const ye=parseInt(e.version,10),xe=t=>{if(ye>=19){const e=e=>t(e,e.ref??null);return e.displayName=t.displayName??t.name,e}return e.forwardRef(t)},Ce=o,Se=Ce(i.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})),Me=Ce(i.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})),Re=Ce(i.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),Ie=Ce(i.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Pe=Ce(i.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),ke=Ce(i.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"})),Ee=Ce(i.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));Ce(i.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"})),Ce(i.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}));const Te=Ce(i.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"})),De=Ce(i.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"})),Fe=Ce(i.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"})),Ae=Ce(i.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"})),Oe=Ce(i.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"})),He=Ce(i.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),$e=Ce(i.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),ze=Ce(i.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),Le=Ce(i.jsx("path",{d:"M19 13H5v-2h14v2z"})),je=Ce(i.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"})),Ne=Ce(i.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Ge=Ce(i.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),_e=Ce(i.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Ve=Ce(i.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"})),Be=Ce(i.jsx("g",{children:i.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})})),We=Ce(i.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}));Ce(i.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}));const Ue=Ce(i.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"})),Ke=Ce(i.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"})),qe=e.createContext(void 0),Xe=()=>{const t=e.useContext(qe);if(!t)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return t},Ye=["sortingOrder"],Qe=e.memo(function(e){const{sortingOrder:t}=e,n=s(e,Ye),r=Xe(),[o]=t,l="asc"===o?r.slots.columnSortedAscendingIcon:r.slots.columnSortedDescendingIcon;return l?i.jsx(l,a({},n)):null}),Ze=e.createContext(void 0);function Je(){const t=e.useContext(Ze);if(void 0===t)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return t}const et=new TextEncoder;let tt=2048,nt=new ArrayBuffer(tt),rt=new Uint8Array(nt),ot=new Int32Array(nt);const it=function(e){const t=2*e.length;t>tt&&(tt=t+(4-t%4),nt=new ArrayBuffer(tt),rt=new Uint8Array(nt),ot=new Int32Array(nt));const n=et.encodeInto(e,rt).written,r=0|n;let o=0,i=374761393+(0+r|0)|0;if(r<16)for(;(o+3|0)<r;o=o+4|0)i=Math.imul(0|st(i+Math.imul(0|ot[o],3266489917)|0,17),668265263);else{let e=606290984,t=-2048144777,n=0,s=1640531535;for(;(o+15|0)<r;o=o+16|0)e=Math.imul(0|st(e+Math.imul(0|ot[o+0|0],2246822519)|0,13),2654435761),t=Math.imul(0|st(t+Math.imul(0|ot[o+4|0],2246822519)|0,13),2654435761),n=Math.imul(0|st(n+Math.imul(0|ot[o+8|0],2246822519)|0,13),2654435761),s=Math.imul(0|st(s+Math.imul(0|ot[o+12|0],2246822519)|0,13),2654435761);for(i=(((st(e,1)|0+st(t,7)|0)+st(n,12)|0)+st(s,18)|0)+r|0;(o+3|0)<r;o=o+4|0)i=Math.imul(0|st(i+Math.imul(0|ot[o],3266489917)|0,17),668265263)}for(;o<r;o=o+1|0)i=Math.imul(0|st(i+Math.imul(0|rt[o],374761393)|0,11),2654435761);return i=Math.imul(i^i>>>15,2246822519),i=Math.imul(i^i>>>13,3266489917),((i^i>>>16)>>>0).toString()};function st(e,t){return e<<t|e>>>32-t}const at={values:{xs:0,sm:600,md:900,lg:1200,xl:1536},up:e=>{const t=at.values;return`@media (min-width:${"number"==typeof t[e]?t[e]:e}px)`}},lt={spacingUnit:"--DataGrid-t-spacing-unit",colors:{border:{base:"--DataGrid-t-color-border-base"},foreground:{base:"--DataGrid-t-color-foreground-base",muted:"--DataGrid-t-color-foreground-muted",accent:"--DataGrid-t-color-foreground-accent",disabled:"--DataGrid-t-color-foreground-disabled",error:"--DataGrid-t-color-foreground-error"},background:{base:"--DataGrid-t-color-background-base",overlay:"--DataGrid-t-color-background-overlay",backdrop:"--DataGrid-t-color-background-backdrop"},interactive:{hover:"--DataGrid-t-color-interactive-hover",hoverOpacity:"--DataGrid-t-color-interactive-hover-opacity",focus:"--DataGrid-t-color-interactive-focus",focusOpacity:"--DataGrid-t-color-interactive-focus-opacity",disabled:"--DataGrid-t-color-interactive-disabled",disabledOpacity:"--DataGrid-t-color-interactive-disabled-opacity",selected:"--DataGrid-t-color-interactive-selected",selectedOpacity:"--DataGrid-t-color-interactive-selected-opacity"}},header:{background:{base:"--DataGrid-t-header-background-base"}},cell:{background:{pinned:"--DataGrid-t-cell-background-pinned"}},radius:{base:"--DataGrid-t-radius-base"},typography:{font:{body:"--DataGrid-t-typography-font-body",small:"--DataGrid-t-typography-font-small",large:"--DataGrid-t-typography-font-large"},fontFamily:{base:"--DataGrid-t-typography-font-family-base"},fontWeight:{light:"--DataGrid-t-typography-font-weight-light",regular:"--DataGrid-t-typography-font-weight-regular",medium:"--DataGrid-t-typography-font-weight-medium",bold:"--DataGrid-t-typography-font-weight-bold"}},transitions:{easing:{easeIn:"--DataGrid-t-transition-easing-ease-in",easeOut:"--DataGrid-t-transition-easing-ease-out",easeInOut:"--DataGrid-t-transition-easing-ease-in-out"},duration:{short:"--DataGrid-t-transition-duration-short",base:"--DataGrid-t-transition-duration-base",long:"--DataGrid-t-transition-duration-long"}},shadows:{base:"--DataGrid-t-shadow-base",overlay:"--DataGrid-t-shadow-overlay"},zIndex:{panel:"--DataGrid-t-z-index-panel",menu:"--DataGrid-t-z-index-menu"}},ut=function e(t){if("string"==typeof t)return`var(${t})`;const n={};for(const r in t)Object.hasOwn(t,r)&&(n[r]=e(t[r]));return n}(lt),ct=a({breakpoints:at,spacing:function(e,t,n,r){if(void 0===e)return dt(1);if(void 0===t)return dt(e);if(void 0===n)return dt(e)+" "+dt(t);if(void 0===r)return dt(e)+" "+dt(t)+" "+dt(n);return dt(e)+" "+dt(t)+" "+dt(n)+" "+dt(r)},transition:function(e,t){const{duration:n=ct.transitions.duration.base,easing:r=ct.transitions.easing.easeInOut,delay:o=0}=t??{};return e.map(e=>`${e} ${n} ${r} ${o}ms`).join(", ")},keys:lt},ut);function dt(e){return 0===e?"0":`calc(var(--DataGrid-t-spacing-unit) * ${e})`}function pt(e){return function(e,t){return`rgba(from ${e} r g b / ${t})`}(e,1)}function ht(e){if(!e)return;const t="number"==typeof e.fontSize?`${e.fontSize}px`:e.fontSize;return`${e.fontWeight} ${t} / ${e.lineHeight} ${e.fontFamily}`}const ft=["id","label","labelId","material","disabled","slotProps","onChange","onKeyDown","onOpen","onClose","size","style","fullWidth"],gt=["onRowsPerPageChange","material","disabled"],mt=["material"],bt=["autoFocus","label","fullWidth","slotProps","className","material"],vt=["material"],wt=["material"],yt=["material"],xt=["material"],Ct=["material"],St=["material"],Mt=["material"],Rt=["material"],It=["material"],Pt=["material","label","className"],kt=["material"],Et=["inert","iconStart","iconEnd","children","material"],Tt=["slotProps","material"],Dt=["id","multiple","freeSolo","options","getOptionLabel","isOptionEqualToValue","value","onChange","label","placeholder","slotProps","material"],Ft=["key"],At=["inputProps","InputProps","InputLabelProps"],Ot=["slotProps","material"],Ht=["ref","open","children","className","clickAwayTouchEvent","clickAwayMouseEvent","flip","focusTrap","onExited","onClickAway","onDidShow","onDidHide","id","target","transition","placement","material"],$t=["native"],zt=["children","value","active"],Lt=["items","value","material"],jt=h(X)(({theme:e})=>({[`&.${Y.positionEnd} .${Q.sizeSmall}`]:{marginRight:e.spacing(-.75)}})),Nt=h(z,{shouldForwardProp:e=>"fullWidth"!==e})(({theme:e})=>({gap:e.spacing(.5),margin:0,overflow:"hidden",[`& .${L.label}`]:{fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),Gt=h(U,{shouldForwardProp:e=>"density"!==e})(({theme:e})=>({variants:[{props:{density:"compact"},style:{padding:e.spacing(.5)}}]})),_t=h(B)({[`& .${W.primary}`]:{overflowX:"clip",textOverflow:"ellipsis",maxWidth:"300px"}}),Vt=xe(function(e,t){const{id:n,label:r,labelId:o,material:l,disabled:u,slotProps:c,onChange:d,onKeyDown:p,onOpen:h,onClose:f,size:g,style:w,fullWidth:y}=e,x=s(e,ft),C={PaperProps:{onKeyDown:p}};return f&&(C.onClose=f),i.jsxs(m,{size:g,fullWidth:y,style:w,disabled:u,ref:t,children:[i.jsx(b,{id:o,htmlFor:n,shrink:!0,variant:"outlined",children:r}),i.jsx(v,a({id:n,labelId:o,label:r,displayEmpty:!0,onChange:d,variant:"outlined"},x,{notched:!0,inputProps:c?.htmlInput,onOpen:h,MenuProps:C,size:g},l))]})}),Bt=h(j)(({theme:e})=>({[`& .${N.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${N.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),Wt=xe(function(t,n){const{onRowsPerPageChange:r,material:o,disabled:l}=t,u=s(t,gt),c=e.useMemo(()=>{if(l)return{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}},[l]),d=Je(),p=Xe(),{estimatedRowCount:h}=p;return i.jsx(Bt,a({component:"div",onRowsPerPageChange:y(e=>{r?.(Number(e.target.value))}),labelRowsPerPage:d.current.getLocaleText("paginationRowsPerPage"),labelDisplayedRows:e=>d.current.getLocaleText("paginationDisplayedRows")(a({},e,{estimated:h})),getItemAriaLabel:d.current.getLocaleText("paginationItemAriaLabel")},c,u,o,{ref:n}))}),Ut=xe(function(e,t){const{material:n}=e,r=s(e,mt);return i.jsx(H,a({},r,n,{ref:t}))}),Kt=xe(function(t,n){const{autoFocus:r,label:o,fullWidth:l,slotProps:u,className:c,material:d}=t,p=s(t,bt),h=e.useRef(null),f=A(h,n),g=e.useRef(null);return e.useEffect(()=>{if(r){const e=h.current?.querySelector("input");e?.focus({preventScroll:!0})}else!1===r&&g.current&&g.current.stop({})},[r]),o?i.jsx(Nt,{className:c,control:i.jsx(Gt,a({},p,d,{inputProps:u?.htmlInput,ref:f,touchRippleRef:g})),label:o,fullWidth:l}):i.jsx(Gt,a({},p,d,{className:O(c,d?.className),inputProps:u?.htmlInput,ref:f,touchRippleRef:g}))}),qt=xe(function(e,t){const{material:n}=e,r=s(e,vt);return i.jsx(D,a({},r,n,{ref:t}))}),Xt=xe(function(e,t){const{material:n}=e,r=s(e,wt);return i.jsx(T,a({},r,n,{ref:t}))}),Yt=xe(function(e,t){const{material:n}=e,r=s(e,yt);return i.jsx(k,a({},r,n,{ref:t}))}),Qt=xe(function(e,t){const{material:n}=e,r=s(e,xt);return i.jsx(M,a({},r,n,{ref:t}))}),Zt=h(V)(({theme:e})=>({gap:e.spacing(1),border:0})),Jt=xe(function(e,t){const{material:n}=e,r=s(e,Ct);return i.jsx(Zt,a({size:"small",color:"primary"},r,n,{ref:t}))}),en=xe(function(e,t){const{material:n}=e,r=s(e,St);return i.jsx(F,a({},r,n,{ref:t}))}),tn=xe(function(e,t){const{material:n}=e,r=s(e,Mt);return i.jsx(S,a({},r,n,{ref:t}))}),nn=xe(function(e,t){const{material:n}=e,r=s(e,Rt);return i.jsx(C,a({},r,n,{ref:t}))}),rn=xe(function(e,t){const{material:n}=e,r=s(e,It);return i.jsx(f,a({},r,n,{ref:t}))}),on=xe(function(e,t){const{material:n,label:r,className:o}=e,l=s(e,Pt);return r?i.jsx(Nt,{className:o,control:i.jsx(p,a({},l,n,{ref:t})),label:r}):i.jsx(p,a({},l,n,{className:o,ref:t}))}),sn=xe(function(e,t){const{material:n}=e,r=s(e,kt);return i.jsx(P,a({},r,n,{ref:t}))});function an(e,t=!0){if(!e)return;const{slotProps:n,material:r}=e,o=s(e,Ot);t&&(o.startAdornment&&(o.startAdornment=i.jsx(jt,{position:"start",children:o.startAdornment})),o.endAdornment&&(o.endAdornment=i.jsx(jt,{position:"end",children:o.endAdornment})));for(const i in r)Object.hasOwn(r,i)&&(o[i]=r[i]);return n?.htmlInput&&(o.inputProps?o.inputProps=a({},o.inputProps,n?.htmlInput):o.inputProps=n?.htmlInput),o}const ln={"bottom-start":"top left","bottom-end":"top right"};function un(e,t){return function(e,t){if(void 0===e.focusTrap)return t;return i.jsx(K,{open:!0,disableEnforceFocus:!0,disableAutoFocus:!0,children:i.jsx("div",{tabIndex:-1,children:t})})}(e,function(e,t){if(void 0===e.onClickAway)return t;return i.jsx(q,{onClickAway:e.onClickAway,touchEvent:e.clickAwayTouchEvent,mouseEvent:e.clickAwayMouseEvent,children:t})}(e,t))}const cn=h(G,{name:"MuiDataGrid",slot:"Tabs"})(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`})),dn=h(_,{name:"MuiDataGrid",slot:"Tab"})({flex:1,minWidth:"fit-content"}),pn=h("div",{name:"MuiDataGrid",slot:"TabPanel"})({flex:1,display:"flex",flexDirection:"column",overflow:"hidden"});function hn(e){const{children:t,active:n}=e,r=s(e,zt);return i.jsx(pn,a({role:"tabpanel",style:{display:n?"flex":"none"}},r,{children:t}))}const fn={baseAutocomplete:function(e){const t=Xe(),{id:n,multiple:r,freeSolo:o,options:l,getOptionLabel:u,isOptionEqualToValue:c,value:d,onChange:p,label:h,placeholder:f,slotProps:g,material:m}=e,b=s(e,Dt);return i.jsx($,a({id:n,multiple:r,freeSolo:o,options:l,getOptionLabel:u,isOptionEqualToValue:c,value:d,onChange:p,renderTags:(e,t)=>e.map((e,n)=>{const r=t({index:n}),{key:o}=r,l=s(r,Ft);return i.jsx(F,a({variant:"outlined",size:"small",label:"string"==typeof e?e:u?.(e)},l),o)}),renderInput:e=>{const{inputProps:n,InputProps:r,InputLabelProps:o}=e,l=s(e,At);return i.jsx(R,a({},l,{label:h,placeholder:f,inputProps:n,InputProps:an(r,!1),InputLabelProps:a({shrink:!0},o)},g?.textField,t.slotProps?.baseTextField))}},b,m))},baseBadge:Ut,baseCheckbox:Kt,baseChip:en,baseCircularProgress:qt,baseDivider:Xt,baseInput:function(e){return i.jsx(E,a({},an(e)))},baseLinearProgress:Yt,baseMenuList:sn,baseMenuItem:function(t){const{inert:n,iconStart:r,iconEnd:o,children:l,material:u}=t,c=s(t,Et);return n&&(c.disableRipple=!0),e.createElement(g,a({},c,u),[r&&i.jsx(I,{children:r},"1"),i.jsx(_t,{children:l},"2"),o&&i.jsx(I,{children:o},"3")])},baseTextField:function(e){const{slotProps:t,material:n}=e,r=s(e,Tt);return i.jsx(R,a({variant:"outlined"},r,n,{inputProps:t?.htmlInput,InputProps:an(t?.input),InputLabelProps:a({shrink:!0},t?.inputLabel)}))},baseButton:Qt,baseIconButton:tn,baseToggleButton:Jt,baseTooltip:nn,baseTabs:function(t){let{items:n,value:r,material:o}=t,l=s(t,Lt);const u=x(),c=`${u}-tab-${r}`,d=`${u}-tabpanel-${r}`;return i.jsxs(e.Fragment,{children:[i.jsx(cn,a({},l,{value:r,variant:"scrollable",scrollButtons:"auto"},o,{children:n.map(e=>i.jsx(dn,{value:e.value,label:e.label,id:c,"aria-controls":d},e.value))})),n.map(e=>i.jsx(hn,{value:e.value,active:r===e.value,id:d,"aria-labelledby":c,children:e.children},e.value))]})},basePagination:Wt,basePopper:function(t){const{open:n,children:r,className:o,flip:l,onExited:u,onDidShow:c,onDidHide:d,id:p,target:h,transition:f,placement:g,material:m}=t,b=s(t,Ht),v=e.useMemo(()=>{const e=[{name:"preventOverflow",options:{padding:8}}];return l&&e.push({name:"flip",enabled:!0}),(c||d)&&e.push({name:"isPlaced",enabled:!0,phase:"main",fn:()=>{c?.()},effect:()=>()=>{d?.()}}),e},[l,c,d]);let y;if(f){const e=e=>t=>{e&&e(),u&&u(t)};y=n=>un(t,i.jsx(Z,a({},n.TransitionProps,{style:{transformOrigin:ln[n.placement]},onExited:e(n.TransitionProps?.onExited),children:i.jsx(J,{children:r})})))}else y=un(t,r);return i.jsx(w,a({id:p,className:o,open:n,anchorEl:h,transition:f,placement:g,modifiers:v},b,m,{children:y}))},baseSelect:Vt,baseSelectOption:function(e){let{native:t}=e,n=s(e,$t);return t?i.jsx("option",a({},n)):i.jsx(g,a({},n))},baseSkeleton:rn,baseSwitch:on},gn=a({},fn,{booleanCellTrueIcon:Ge,booleanCellFalseIcon:$e,columnMenuIcon:He,openFilterButtonIcon:Pe,filterPanelDeleteIcon:$e,columnFilteredIcon:ke,columnSelectorIcon:Te,columnUnsortedIcon:Qe,columnSortedAscendingIcon:Se,columnSortedDescendingIcon:Me,columnResizeIcon:De,densityCompactIcon:Fe,densityStandardIcon:Ae,densityComfortableIcon:Oe,exportIcon:Ke,moreActionsIcon:_e,treeDataCollapseIcon:Ie,treeDataExpandIcon:Re,groupingCriteriaCollapseIcon:Ie,groupingCriteriaExpandIcon:Re,detailPanelExpandIcon:ze,detailPanelCollapseIcon:Le,rowReorderIcon:Ne,quickFilterIcon:Ee,quickFilterClearIcon:We,columnMenuHideIcon:Ve,columnMenuSortAscendingIcon:Se,columnMenuSortDescendingIcon:Me,columnMenuUnsortIcon:null,columnMenuFilterIcon:ke,columnMenuManageColumnsIcon:Be,columnMenuClearIcon:We,loadIcon:je,filterPanelAddIcon:ze,filterPanelRemoveAllIcon:Ue,columnReorderIcon:Ne,menuItemCheckIcon:Ge}),mn=()=>e.useRef(null);var bn=Symbol("NOT_FOUND");var vn=e=>Array.isArray(e)?e:[e];function wn(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}var yn=(e,t)=>e===t;function xn(e,t){const n="object"==typeof t?t:{equalityCheck:t},{equalityCheck:r=yn,maxSize:o=1,resultEqualityCheck:i}=n,s=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;const{length:r}=t;for(let o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(r);let a=0;const l=o<=1?function(e){let t;return{get:n=>t&&e(t.key,n)?t.value:bn,put(e,n){t={key:e,value:n}},getEntries:()=>t?[t]:[],clear(){t=void 0}}}(s):function(e,t){let n=[];function r(e){const r=n.findIndex(n=>t(e,n.key));if(r>-1){const e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return bn}return{get:r,put:function(t,o){r(t)===bn&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(o,s);function u(){let t=l.get(arguments);if(t===bn){if(t=e.apply(null,arguments),a++,i){const e=l.getEntries().find(e=>i(e.value,t));e&&(t=e.value,0!==a&&a--)}l.put(arguments,t)}return t}return u.clearCache=()=>{l.clear(),u.resetResultsCount()},u.resultsCount=()=>a,u.resetResultsCount=()=>{a=0},u}var Cn="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function Sn(){return{s:0,v:void 0,o:null,p:null}}function Mn(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,i=0;function s(){let t=n;const{length:s}=arguments;for(let e=0,n=s;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=Sn(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=Sn(),e.set(n,t)):t=r}}const a=t;let l;if(1===t.s)l=t.v;else if(l=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,l)&&(l=e,0!==i&&i--);o="object"==typeof l&&null!==l||"function"==typeof l?new Cn(l):l}return a.s=1,a.v=l,l}return s.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function Rn(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},s=e.pop();"object"==typeof s&&(i=s,s=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);const a={...n,...i},{memoize:l,memoizeOptions:u=[],argsMemoize:c=Mn,argsMemoizeOptions:d=[]}=a,p=vn(u),h=vn(d),f=wn(e),g=l(function(){return r++,s.apply(null,arguments)},...p),m=c(function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(f,arguments);return t=g.apply(null,e),t},...h);return Object.assign(m,{resultFunc:s,memoizedResultFunc:g,dependencies:f,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:l,argsMemoize:c})};return Object.assign(r,{withTypes:()=>r}),r}var In=Rn(Mn),Pn=Object.assign((e,t=In)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Pn});const kn=Rn({memoize:xn,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),En=(e,t,n,r,o,i,s,a,...l)=>{if(l.length>0)throw new Error("Unsupported number of selectors");let u;if(e&&t&&n&&r&&o&&i&&s&&a)u=(l,u,c,d)=>{const p=e(l,u,c,d),h=t(l,u,c,d),f=n(l,u,c,d),g=r(l,u,c,d),m=o(l,u,c,d),b=i(l,u,c,d),v=s(l,u,c,d);return a(p,h,f,g,m,b,v,u,c,d)};else if(e&&t&&n&&r&&o&&i&&s)u=(a,l,u,c)=>{const d=e(a,l,u,c),p=t(a,l,u,c),h=n(a,l,u,c),f=r(a,l,u,c),g=o(a,l,u,c),m=i(a,l,u,c);return s(d,p,h,f,g,m,l,u,c)};else if(e&&t&&n&&r&&o&&i)u=(s,a,l,u)=>{const c=e(s,a,l,u),d=t(s,a,l,u),p=n(s,a,l,u),h=r(s,a,l,u),f=o(s,a,l,u);return i(c,d,p,h,f,a,l,u)};else if(e&&t&&n&&r&&o)u=(i,s,a,l)=>{const u=e(i,s,a,l),c=t(i,s,a,l),d=n(i,s,a,l),p=r(i,s,a,l);return o(u,c,d,p,s,a,l)};else if(e&&t&&n&&r)u=(o,i,s,a)=>{const l=e(o,i,s,a),u=t(o,i,s,a),c=n(o,i,s,a);return r(l,u,c,i,s,a)};else if(e&&t&&n)u=(r,o,i,s)=>{const a=e(r,o,i,s),l=t(r,o,i,s);return n(a,l,o,i,s)};else if(e&&t)u=(n,r,o,i)=>{const s=e(n,r,o,i);return t(s,r,o,i)};else{if(!e)throw new Error("Missing arguments");u=e}return u},Tn=e=>(...t)=>{const n=new WeakMap;let r=1;const o=t[t.length-1],i=t.length-1||1,s=Math.max(o.length-i,0);if(s>3)throw new Error("Unsupported number of arguments");return(i,a,l,u)=>{let c=i.__cacheKey__;c||(c={id:r},i.__cacheKey__=c,r+=1);let d=n.get(c);if(!d){const r=1===t.length?[e=>e,o]:t;let i=t;const a=[void 0,void 0,void 0];switch(s){case 0:break;case 1:i=[...r.slice(0,-1),()=>a[0],o];break;case 2:i=[...r.slice(0,-1),()=>a[0],()=>a[1],o];break;case 3:i=[...r.slice(0,-1),()=>a[0],()=>a[1],()=>a[2],o];break;default:throw new Error("Unsupported number of arguments")}e&&(i=[...i,e]),d=kn(...i),d.selectorArgs=a,n.set(c,d)}switch(s){case 3:d.selectorArgs[2]=u;case 2:d.selectorArgs[1]=l;case 1:d.selectorArgs[0]=a}switch(s){case 0:return d(i);case 1:return d(i,a);case 2:return d(i,a,l);case 3:return d(i,a,l,u);default:throw new Error("unreachable")}}},Dn=Tn();var Fn,An,On,Hn,$n={exports:{}},zn={},Ln={exports:{}},jn={};function Nn(){return An||(An=1,Ln.exports=function(){if(Fn)return jn;Fn=1;var e=t(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(o){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=r({inst:{value:n,getSnapshot:t}}),u=l[0].inst,c=l[1];return i(function(){u.value=n,u.getSnapshot=t,a(u)&&c({inst:u})},[e,n,t]),o(function(){return a(u)&&c({inst:u}),e(function(){a(u)&&c({inst:u})})},[e]),s(n),n};return jn.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,jn}()),Ln.exports}var Gn=(Hn||(Hn=1,$n.exports=function(){if(On)return zn;On=1;var e=t(),n=Nn(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return zn.useSyncExternalStoreWithSelector=function(e,t,n,u,c){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=a(function(){function e(e){if(!s){if(s=!0,o=e,e=u(e),void 0!==c&&p.hasValue){var t=p.value;if(c(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=u(e);return void 0!==c&&c(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,n,u,c]);var h=o(e,d[0],d[1]);return s(function(){p.hasValue=!0,p.value=h},[h]),l(h),h},zn}()),$n.exports);function _n(e,t,n,r,o){return Gn.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))}const Vn=()=>{};function Bn(e,t,n){const r=ee(Wn,{store:e,selector:t}).current;r.effect=n,te(r.onMount)}function Wn(e){const{store:t,selector:n}=e;let r=n(t.state);const o={effect:Vn,dispose:null,subscribe:()=>{o.dispose??=t.subscribe(e=>{const t=n(e);if(!Object.is(r,t)){const e=r;r=t,o.effect(e,t)}})},onMount:()=>(o.subscribe(),()=>{o.dispose?.(),o.dispose=null})};return o.subscribe(),o}class Un{static create(e){return new Un(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){this.state=e,this.updateTick+=1;const t=this.updateTick,n=this.listeners.values();let r;for(;r=n.next(),!r.done;){if(t!==this.updateTick)return;(0,r.value)(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t]))return void this.setState(a({},this.state,e))}set(e,t){Object.is(this.state[e],t)||this.setState(a({},this.state,{[e]:t}))}}const Kn=(...e)=>{const t=En(...e);return(e,n,r,o)=>t(Yn(e),n,r,o)},qn=(...e)=>{const t=Dn(...e);return(e,n,r,o)=>t(Yn(e),n,r,o)},Xn=e=>(t,n)=>e(Yn(t),n);function Yn(e){return"current"in e?e.current.state:e}const Qn=Xn(e=>e.dimensions),Zn=Kn(Qn,e=>e.columnsTotalWidth),Jn=Kn(Qn,e=>e.rowHeight);Kn(Qn,e=>e.contentSize.height);const er=Kn(Qn,e=>e.hasScrollX),tr=Kn(Qn,e=>e.hasScrollY),nr=Kn(Qn,e=>e.columnsTotalWidth<e.viewportOuterSize.width),rr=Kn(Qn,e=>e.headerHeight),or=Kn(Qn,e=>e.groupHeaderHeight);Kn(Qn,e=>e.headerFilterHeight);const ir=Kn(Qn,e=>e.hasScrollX?e.scrollbarSize:0),sr=Kn(Qn,e=>e.hasScrollY?e.scrollbarSize:0),ar=Kn(Qn,ir,(e,t)=>{const n=e.viewportOuterSize.height-e.minimumSize.height>0;return!(0===t&&!n)}),lr=Xn(e=>e.rowsMeta),ur=Xn(e=>e.rows),cr=Kn(ur,e=>e.totalRowCount),dr=Kn(ur,e=>e.loading),pr=Kn(ur,e=>e.totalTopLevelRowCount),hr=Kn(ur,e=>e.dataRowIdToModelLookup);Kn(hr,(e,t)=>e[t]);const fr=Kn(ur,e=>e.tree),gr=Kn(fr,(e,t)=>e[t]),mr=Kn(ur,e=>e.groupsToFetch),br=Kn(ur,e=>e.groupingName),vr=Kn(ur,e=>e.treeDepths),wr=qn(ur,e=>{const t=Object.entries(e.treeDepths);return 0===t.length?1:(t.filter(([,e])=>e>0).map(([e])=>Number(e)).sort((e,t)=>t-e)[0]??0)+1}),yr=Kn(ur,e=>e.dataRowIds),xr=qn(yr,hr,(e,t)=>e.reduce((e,n)=>t[n]?(e.push(t[n]),e):e,[])),Cr=qn(Kn(ur,e=>e?.additionalRowGroups),e=>{const t=e?.pinnedRows;return{bottom:t?.bottom?.map(e=>({id:e.id,model:e.model??{}}))??[],top:t?.top?.map(e=>({id:e.id,model:e.model??{}}))??[]}}),Sr=Kn(Cr,e=>(e?.top?.length||0)+(e?.bottom?.length||0)),Mr="auto-generated-group-node-root",Rr=Symbol("mui.id_autogenerated");const Ir=(e,t,n)=>{const r=t?t(e):e.id;return function(e,t,n="A row was provided without id in the rows prop:"){if(null==e)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join("\n"))}(r,e,n),r},Pr=(e,t,n)=>{const r=t.field;if(!t||!t.valueGetter)return e[r];const o=e[t.field];return t.valueGetter(o,e,t,n)},kr=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={};for(let s=0;s<e.length;s+=1){const n=e[s],r=Ir(n,t);i[r]=n,o.rows.push(r)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToModelLookup:i}},Er=({tree:e,rowCountProp:t=0})=>{const n=e[Mr];return Math.max(t,n.children.length+(null==n.footerId?0:1))},Tr=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:i})=>{const s=e.current.caches.rows,{tree:l,treeDepths:u,dataRowIds:c,groupingName:d,groupsToFetch:p=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:s.updates,dataRowIdToModelLookup:s.dataRowIdToModelLookup,previousGroupsToFetch:i}),h=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:l,treeDepths:u,dataRowIds:c,dataRowIdToModelLookup:s.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},a({},h,{totalRowCount:Math.max(t,h.dataRowIds.length),totalTopLevelRowCount:Er({tree:h.tree,rowCountProp:t}),groupingName:d,loading:n,groupsToFetch:p})},Dr=e=>Rr in e,Fr=e=>"skeletonRow"===e.type||"footer"===e.type||"group"===e.type&&e.isAutoGenerated||"pinnedRow"===e.type&&e.isAutoGenerated,Ar=(e,t,n,r)=>{const o=e[t];if("group"!==o.type)return[];const i=[];for(let s=0;s<o.children.length;s+=1){const t=o.children[s];if(n&&Fr(e[t])||i.push(t),r)continue;const a=Ar(e,t,n,r);for(let e=0;e<a.length;e+=1)i.push(a[e])}return n||null==o.footerId||i.push(o.footerId),i},Or=({previousCache:e,getRowId:t,updates:n,groupKeys:r})=>{if("full"===e.updates.type)throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(e=>{const n=Ir(e,t,"A row was provided without id when calling updateRows():");o.has(n)?o.set(n,a({},o.get(n),e)):o.set(n,e)});const i={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:a({},e.updates.idToActionLookup),groupKeys:r},s=a({},e.dataRowIdToModelLookup),l={insert:{},modify:{},remove:{}};o.forEach((e,t)=>{const n=i.idToActionLookup[t];if("delete"===e._action){if("remove"===n||!s[t])return;return null!=n&&(l[n][t]=!0),i.actions.remove.push(t),void delete s[t]}const r=s[t];if(r)return"remove"===n?(l.remove[t]=!0,i.actions.modify.push(t)):null==n&&i.actions.modify.push(t),void(s[t]=a({},r,e));"remove"===n?(l.remove[t]=!0,i.actions.insert.push(t)):null==n&&i.actions.insert.push(t),s[t]=e});const u=Object.keys(l);for(let a=0;a<u.length;a+=1){const e=u[a],t=l[e];Object.keys(t).length>0&&(i.actions[e]=i.actions[e].filter(e=>!t[e]))}return{dataRowIdToModelLookup:s,updates:i,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},Hr="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function $r(e,t,n){const r=[];return t.forEach(t=>{const o=Ir(t,n,"A row was provided without id when calling updateRows():"),i=gr(e,o);if("pinnedRow"===i?.type){const n=e.current.caches.pinnedRows,r=n.idLookup[o];r&&(n.idLookup[o]=a({},r,t))}else r.push(t)}),r}const zr=(e,t,n)=>"number"==typeof e&&e>0?e:t,Lr=Object.is;function jr(e,t){if(e===t)return!0;if(!(e instanceof Object&&t instanceof Object))return!1;let n=0,r=0;for(const o in e){if(n+=1,!Lr(e[o],t[o]))return!1;if(!(o in t))return!1}for(const o in t)r+=1;return n===r}function Nr(t){return e.memo(t,jr)}const Gr={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",noColumnsOverlayLabel:"No columns",noColumnsOverlayManageColumns:"Manage columns",emptyPivotOverlayLabel:"Add fields to rows, columns, and values to create a pivot table",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",toolbarPivot:"Pivot",toolbarCharts:"Charts",toolbarAssistant:"AI Assistant",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",headerFilterClear:"Clear filter",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnMenuManagePivot:"Manage pivot",columnMenuManageCharts:"Manage charts",columnHeaderFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>1!==e?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",paginationRowsPerPage:"Rows per page:",paginationDisplayedRows:({from:e,to:t,count:n,estimated:r})=>{if(!r)return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`;return`${e}–${t} of ${-1!==n?n:r&&r>t?`around ${r}`:`more than ${t}`}`},paginationItemAriaLabel:e=>"first"===e?"Go to first page":"last"===e?"Go to last page":"next"===e?"Go to next page":"Go to previous page",rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelNone:"none",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size",pivotToggleLabel:"Pivot",pivotRows:"Rows",pivotColumns:"Columns",pivotValues:"Values",pivotCloseButton:"Close pivot settings",pivotSearchButton:"Search fields",pivotSearchControlPlaceholder:"Search fields",pivotSearchControlLabel:"Search fields",pivotSearchControlClear:"Clear search",pivotNoFields:"No fields",pivotMenuMoveUp:"Move up",pivotMenuMoveDown:"Move down",pivotMenuMoveToTop:"Move to top",pivotMenuMoveToBottom:"Move to bottom",pivotMenuRows:"Rows",pivotMenuColumns:"Columns",pivotMenuValues:"Values",pivotMenuOptions:"Field options",pivotMenuAddToRows:"Add to Rows",pivotMenuAddToColumns:"Add to Columns",pivotMenuAddToValues:"Add to Values",pivotMenuRemove:"Remove",pivotDragToRows:"Drag here to create rows",pivotDragToColumns:"Drag here to create columns",pivotDragToValues:"Drag here to create values",pivotYearColumnHeaderName:"(Year)",pivotQuarterColumnHeaderName:"(Quarter)",chartsNoCharts:"There are no charts available",chartsChartNotSelected:"Select a chart type to configure its options",chartsTabChart:"Chart",chartsTabFields:"Fields",chartsTabCustomize:"Customize",chartsCloseButton:"Close charts configuration",chartsSyncButtonLabel:"Sync chart",chartsSearchPlaceholder:"Search fields",chartsSearchLabel:"Search fields",chartsSearchClear:"Clear search",chartsNoFields:"No fields",chartsFieldBlocked:"This field cannot be added to any section",chartsCategories:"Categories",chartsSeries:"Series",chartsMenuAddToDimensions:e=>`Add to ${e}`,chartsMenuAddToValues:e=>`Add to ${e}`,chartsMenuMoveUp:"Move up",chartsMenuMoveDown:"Move down",chartsMenuMoveToTop:"Move to top",chartsMenuMoveToBottom:"Move to bottom",chartsMenuOptions:"Field options",chartsMenuRemove:"Remove",chartsDragToDimensions:e=>`Drag here to use column as ${e}`,chartsDragToValues:e=>`Drag here to use column as ${e}`,aiAssistantPanelTitle:"AI Assistant",aiAssistantPanelClose:"Close AI Assistant",aiAssistantPanelNewConversation:"New conversation",aiAssistantPanelConversationHistory:"Conversation history",aiAssistantPanelEmptyConversation:"No prompt history",aiAssistantSuggestions:"Suggestions",promptFieldLabel:"Prompt",promptFieldPlaceholder:"Type a prompt…",promptFieldPlaceholderWithRecording:"Type or record a prompt…",promptFieldPlaceholderListening:"Listening for prompt…",promptFieldSpeechRecognitionNotSupported:"Speech recognition is not supported in this browser",promptFieldSend:"Send",promptFieldRecord:"Record",promptFieldStopRecording:"Stop recording",promptRerun:"Run again",promptProcessing:"Processing…",promptAppliedChanges:"Applied changes",promptChangeGroupDescription:e=>`Group by ${e}`,promptChangeAggregationLabel:(e,t)=>`${e} (${t})`,promptChangeAggregationDescription:(e,t)=>`Aggregate ${e} (${t})`,promptChangeFilterLabel:(e,t,n)=>"is any of"===t?`${e} is any of: ${n}`:`${e} ${t} ${n}`,promptChangeFilterDescription:(e,t,n)=>"is any of"===t?`Filter where ${e} is any of: ${n}`:`Filter where ${e} ${t} ${n}`,promptChangeSortDescription:(e,t)=>`Sort by ${e} (${t})`,promptChangePivotEnableLabel:"Pivot",promptChangePivotEnableDescription:"Enable pivot",promptChangePivotColumnsLabel:e=>`Columns (${e})`,promptChangePivotColumnsDescription:(e,t)=>`${e}${t?` (${t})`:""}`,promptChangePivotRowsLabel:e=>`Rows (${e})`,promptChangePivotValuesLabel:e=>`Values (${e})`,promptChangePivotValuesDescription:(e,t)=>`${e} (${t})`,promptChangeChartsLabel:(e,t)=>`Dimensions (${e}), Values (${t})`};function _r(e){return ne("MuiDataGrid",e)}const Vr=re("MuiDataGrid",["aiAssistantPanel","aiAssistantPanelHeader","aiAssistantPanelTitleContainer","aiAssistantPanelTitle","aiAssistantPanelBody","aiAssistantPanelEmptyText","aiAssistantPanelFooter","aiAssistantPanelConversation","aiAssistantPanelConversationList","aiAssistantPanelConversationTitle","aiAssistantPanelSuggestions","aiAssistantPanelSuggestionsList","aiAssistantPanelSuggestionsItem","aiAssistantPanelSuggestionsLabel","actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","aggregationRowOverlayWrapper","autoHeight","autosizing","mainContent","withSidePanel","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","collapsible","collapsibleTrigger","collapsibleIcon","collapsiblePanel","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--siblingFocused","columnHeader--filter","columnHeaderFilterInput","columnHeaderFilterOperatorLabel","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","columnsManagementScrollArea","columnsManagementEmptyText","container--top","container--bottom","detailPanel","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hiddenContent","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--beingDragged","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowReorderIcon","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--pinnedRight","scrollShadow","scrollShadow--vertical","scrollShadow--horizontal","selectedRowCount","sortButton","sortIcon","shadowScrollArea","sidebar","sidebarHeader","toolbarContainer","toolbar","toolbarLabel","toolbarDivider","toolbarFilterList","toolbarQuickFilter","toolbarQuickFilterTrigger","toolbarQuickFilterControl","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pivotPanelAvailableFields","pivotPanelField","pivotPanelField--sorted","pivotPanelFieldActionContainer","pivotPanelFieldCheckbox","pivotPanelFieldDragIcon","pivotPanelFieldList","pivotPanelFieldName","pivotPanelHeader","pivotPanelPlaceholder","pivotPanelScrollArea","pivotPanelSearchContainer","pivotPanelSection","pivotPanelSectionTitle","pivotPanelSections","pivotPanelSwitch","pivotPanelSwitchLabel","prompt","promptContent","promptText","promptFeedback","promptChangeList","promptChangesToggle","promptChangesToggleIcon","promptIcon","promptIconContainer","promptError","promptAction"]);let Br=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e}({});class Wr{timeouts=(()=>new Map)();cleanupTimeout=(()=>1e3)();constructor(e=1e3){this.cleanupTimeout=e}register(e,t,n){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{"function"==typeof t&&t(),this.timeouts.delete(n.cleanupToken)},this.cleanupTimeout);this.timeouts.set(n.cleanupToken,r)}unregister(e){const t=this.timeouts.get(e.cleanupToken);t&&(this.timeouts.delete(e.cleanupToken),clearTimeout(t))}reset(){this.timeouts&&(this.timeouts.forEach((e,t)=>{this.unregister({cleanupToken:t})}),this.timeouts=void 0)}}class Ur{registry=(()=>new FinalizationRegistry(e=>{"function"==typeof e&&e()}))();register(e,t,n){this.registry.register(e,t,n)}unregister(e){this.registry.unregister(e)}reset(){}}class Kr{static create(){return new Kr}}const qr={current:"undefined"!=typeof FinalizationRegistry?new Ur:new Wr};let Xr=0;function Yr(t,n,r,o){const i=e.useState(Kr.create)[0],s=e.useRef(null),a=e.useRef(null);a.current=r;const l=e.useRef(null);if(!s.current&&a.current){const e=(e,t,n)=>{t&&!t.defaultMuiPrevented&&a.current?.(e,t,n)};s.current=t.current.subscribeEvent(n,e,o),Xr+=1,l.current={cleanupToken:Xr},qr.current.register(i,()=>{s.current?.(),s.current=null,l.current=null},l.current)}else!a.current&&s.current&&(s.current(),s.current=null,l.current&&(qr.current.unregister(l.current),l.current=null));e.useEffect(()=>{if(!s.current&&a.current){const e=(e,t,n)=>{t&&!t.defaultMuiPrevented&&a.current?.(e,t,n)};s.current=t.current.subscribeEvent(n,e,o)}return l.current&&qr.current&&(qr.current.unregister(l.current),l.current=null),()=>{s.current?.(),s.current=null}},[t,n,o])}const Qr={isFirst:!0};function Zr(e,t,n){Yr(e,t,n,Qr)}var Jr=Nn();const eo=Object.is,to=jr,no=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),ro=()=>({state:null,equals:null,selector:null,args:void 0}),oo=[],io=()=>null;function so(t,n,r=void 0,o=eo){t.current.state;const i=ee(ro),s=null!==i.current.selector,[a,l]=e.useState(s?null:n(t,r));i.current.state=a,i.current.equals=o,i.current.selector=n;const u=i.current.args;if(i.current.args=r,s&&!((e,t)=>{let n=Object.is;return t instanceof Array?n=no:t instanceof Object&&(n=to),n(e,t)})(u,r)){const e=i.current.selector(t,i.current.args);i.current.equals(i.current.state,e)||(i.current.state=e,l(e))}const c=e.useCallback(()=>(i.current.subscription||(i.current.subscription=t.current.store.subscribe(()=>{const e=i.current.selector(t,i.current.args);i.current.equals(i.current.state,e)||(i.current.state=e,l(e))})),null),oo),d=e.useCallback(()=>(i.current.subscription||c(),()=>{i.current.subscription&&(i.current.subscription(),i.current.subscription=void 0)}),oo);return Jr.useSyncExternalStore(d,c,io),a}const ao={compact:.7,comfortable:1.3,standard:1},lo=Xn(e=>e.density),uo=Kn(lo,e=>ao[e]);function co(e){throw new Error("Failed assertion: should not be rendered")}const po=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange","slotProps"],ho=h(co,{name:"MuiDataGrid",slot:"EditInputCell"})({font:ct.typography.font.body,padding:"1px 0","& input":{padding:"0 16px",height:"100%"}}),fo=xe((t,n)=>{const r=Xe(),{id:o,value:l,field:u,colDef:c,hasFocus:d,debounceMs:p=200,isProcessingProps:h,onValueChange:f,slotProps:g}=t,m=s(t,po),b=Je(),v=e.useRef(null),[w,y]=e.useState(l),x=(e=>{const{classes:t}=e;return ie({root:["editInputCell"]},_r,t)})(r),C=e.useCallback(async e=>{const t=e.target.value,n=b.current.getColumn(u);let r=t;n.valueParser&&(r=n.valueParser(t,b.current.getRow(o),n,b)),y(r),b.current.setEditCellValue({id:o,field:u,value:r,debounceMs:p,unstable_skipValueParser:!0},e),f&&await f(e,t)},[b,p,u,o,f]),S=b.current.unstable_getEditCellMeta(o,u);return e.useEffect(()=>{"debouncedSetEditCellValue"!==S?.changeReason&&y(l)},[S,l]),oe(()=>{d&&v.current.focus()},[d]),i.jsx(ho,a({as:r.slots.baseInput,inputRef:v,className:x.root,ownerState:r,fullWidth:!0,type:"number"===c.type?c.type:"text",value:w??"",onChange:C,endAdornment:h?i.jsx(r.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},m,g?.root,{ref:n}))}),go=(e,t)=>t&&e.length>1?[e[0]]:e,mo=(e,t)=>n=>a({},n,{sorting:a({},n.sorting,{sortModel:go(e,t)})}),bo=(e,t)=>{const n=e.map(e=>((e,t)=>{const n=t.current.getColumn(e.field);if(!n||null===e.sort)return null;let r;return r=n.getSortComparator?n.getSortComparator(e.sort):"desc"===e.sort?(...e)=>-1*n.sortComparator(...e):n.sortComparator,r?{getSortCellParams:e=>({id:e,field:n.field,rowNode:gr(t,e),value:t.current.getCellValue(e,n.field),api:t.current}),comparator:r}:null})(e,t)).filter(e=>!!e);return 0===n.length?null:e=>e.map(e=>({node:e,params:n.map(t=>t.getSortCellParams(e.id))})).sort((e,t)=>{return r=e,o=t,n.reduce((e,t,n)=>{if(0!==e)return e;const i=r.params[n],s=o.params[n];return t.comparator(i.value,s.value,i,s)},0);var r,o}).map(e=>e.node.id)},vo=(e,t)=>{const n=e.indexOf(t);return t&&-1!==n&&n+1!==e.length?e[n+1]:e[0]},wo=(e,t)=>null==e&&null!=t?-1:null==t&&null!=e?1:null==e&&null==t?0:null,yo=new Intl.Collator,xo=(e,t)=>{const n=wo(e,t);return null!==n?n:Number(e)-Number(t)},Co=(e,t)=>{const n=wo(e,t);return null!==n?n:e>t?1:e<t?-1:0},So=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","slotProps","clearButton","headerFilterMenu"];function Mo(t){const{item:n,applyValue:r,type:o,apiRef:l,focusElementRef:u,tabIndex:c,disabled:d,slotProps:p,clearButton:h,headerFilterMenu:f}=t,g=s(t,So),m=p?.root,b=se(),[v,w]=e.useState(Ro(n.value)),[y,C]=e.useState(!1),S=x(),M=Xe(),R=e.useCallback(e=>{const t=Ro(e.target.value);w(t),C(!0),b.start(M.filterDebounceMs,()=>{const e=a({},n,{value:"number"!==o||Number.isNaN(Number(t))?t:Number(t),fromInput:S});r(e),C(!1)})},[b,M.filterDebounceMs,n,o,S,r]);return e.useEffect(()=>{n.fromInput===S&&null!=n.value||w(Ro(n.value))},[S,n]),i.jsxs(e.Fragment,{children:[i.jsx(M.slots.baseTextField,a({id:S,label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),value:v??"",onChange:R,type:o||"text",disabled:d,slotProps:a({},m?.slotProps,{input:a({endAdornment:y?i.jsx(M.slots.loadIcon,{fontSize:"small",color:"action"}):null},m?.slotProps?.input),htmlInput:a({tabIndex:c},m?.slotProps?.htmlInput)}),inputRef:u},M.slotProps?.baseTextField,g,m)),f,h]})}function Ro(e){if(null!=e&&""!==e)return String(e)}function Io(e){return"object"==typeof e&&null!==e}function Po(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const ko=(e,t,n)=>Math.max(t,Math.min(n,e));function Eo(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}const To=(e,t)=>n=>{e&&t(n)};function Do(t){const{item:n,applyValue:r,type:o,apiRef:s,focusElementRef:l,slotProps:u}=t,c=x(),[d,p]=e.useState([]),[h,f]=e.useState(n.value||[]),g=Xe();e.useEffect(()=>{const e=n.value??[];f(e.map(String))},[n.value]);const m=e.useCallback((e,t)=>{f(t.map(String)),r(a({},n,{value:[...t.map(e=>"number"===o?Number(e):e)]}))},[r,n,o]),b=e.useCallback((e,t)=>{p(""===t?[]:[t])},[p]),v=g.slots.baseAutocomplete;return i.jsx(v,a({multiple:!0,freeSolo:!0,options:d,id:c,value:h,onChange:m,onInputChange:b,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:o||"text",inputRef:l}}},u?.root))}var Fo=function(e){return e.Cell="cell",e.Row="row",e}(Fo||{}),Ao=function(e){return e.Edit="edit",e.View="view",e}(Ao||{}),Oo=function(e){return e.Edit="edit",e.View="view",e}(Oo||{}),Ho=function(e){return e.And="and",e.Or="or",e}(Ho||{});class $o{constructor(e){this.data=e.ids}has(e){return this.data.has(e)}select(e){this.data.add(e)}unselect(e){this.data.delete(e)}}class zo{constructor(e){this.data=e.ids}has(e){return!this.data.has(e)}select(e){this.data.delete(e)}unselect(e){this.data.add(e)}}const Lo=e=>"include"===e.type?new $o(e):new zo(e);var jo=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e}(jo||{}),No=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(No||{}),Go=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(Go||{}),_o=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(_o||{});function Vo(e){return void 0!==e.field}const Bo={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},Wo=()=>({items:[],logicOperator:Ho.And,quickFilterValues:[],quickFilterLogicOperator:Ho.And});function Uo(e){return{current:e.current.getPublicApi()}}let Ko=function(e){return e.LEFT="left",e.RIGHT="right",e}({});const qo={left:[],right:[]},Xo=Xn(e=>e.isRtl),Yo=Xn(e=>e.props.listView??!1),Qo=Xn(e=>e.listViewColumn),Zo=Xn(e=>e.columns),Jo=Kn(Zo,e=>e.orderedFields),ei=Kn(Zo,e=>e.lookup),ti=qn(Jo,ei,(e,t)=>e.map(e=>t[e])),ni=Kn(Zo,e=>e.columnVisibilityModel),ri=Kn(Zo,e=>e.initialColumnVisibilityModel),oi=qn(ti,ni,Yo,Qo,(e,t,n,r)=>n&&r?[r]:e.filter(e=>!1!==t[e.field])),ii=qn(oi,e=>e.map(e=>e.field)),si=Xn(e=>e.pinnedColumns);qn(si,Jo,Xo,(e,t,n)=>li(e,t,n));const ai=qn(Zo,si,ii,Xo,Yo,(e,t,n,r,o)=>{if(o)return qo;const i=li(t,n,r);return{left:i.left.map(t=>e.lookup[t]),right:i.right.map(t=>e.lookup[t])}});function li(e,t,n){if(!Array.isArray(e.left)&&!Array.isArray(e.right))return qo;if(0===e.left?.length&&0===e.right?.length)return qo;const r=(e,t)=>Array.isArray(e)?e.filter(e=>t.includes(e)):[],o=r(e.left,t),i=t.filter(e=>!o.includes(e)),s=r(e.right,i);return n?{left:s,right:o}:{left:o,right:s}}const ui=qn(oi,e=>{const t=[];let n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),ci=qn(ti,e=>e.filter(e=>e.filterable)),di=qn(ti,e=>e.reduce((e,t)=>(t.filterable&&(e[t.field]=t),e),{})),pi=qn(ti,e=>e.some(e=>void 0!==e.colSpan));let hi;const fi=(e,t)=>{const n=a({},e);if(null==n.id&&(n.id=Math.round(1e5*Math.random())),null==n.operator){const e=ei(t)[n.field];n.operator=e&&e.filterOperators[0].value}return n},gi=(e,t,n)=>{const r=e.items.length>1;let o;o=r&&t?[e.items[0]]:e.items;const i=r&&o.some(e=>null==e.id);return o.some(e=>null==e.operator)||i?a({},e,{items:o.map(e=>fi(e,n))}):e.items!==o?a({},e,{items:o}):e},mi=(e,t,n)=>r=>a({},r,{filterModel:gi(e,t,n)}),bi=e=>"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,vi=(e,t,n)=>{if(!e.field||!e.operator)return null;const r=n.current.getColumn(e.field);if(!r)return null;let o;if(r.valueParser){const t=r.valueParser;o=Array.isArray(e.value)?e.value?.map(e=>t(e,void 0,r,n)):t(e.value,void 0,r,n)}else o=e.value;const{ignoreDiacritics:i}=n.current.rootProps;i&&(o=bi(o));const s=a({},e,{value:o}),l=r.filterOperators;if(!l?.length)throw new Error(`MUI X: No filter operators found for column '${r.field}'.`);const u=l.find(e=>e.value===s.operator);if(!u)throw new Error(`MUI X: No filter operator found for column '${r.field}' and operator value '${s.operator}'.`);const c=Uo(n),d=u.getApplyFilterFn(s,r);return"function"!=typeof d?null:{item:s,fn:e=>{let n=t(e,r);return i&&(n=bi(n)),d(n,e,r,c)}}};let wi=1;const yi=(e,t,n,r)=>{const{items:o}=e,i=o.map(e=>vi(e,t,n)).filter(e=>!!e);if(0===i.length)return null;if(r||!function(){if(void 0!==hi)return hi;try{hi=new Function("return true")()}catch(e){hi=!1}return hi}())return(e,t)=>{const n={};for(let r=0;r<i.length;r+=1){const o=i[r];t&&!t(o.item.field)||(n[o.item.id]=o.fn(e))}return n};const s=new Function("appliers","row","shouldApplyFilter",`"use strict";\n${i.map((e,t)=>`const shouldApply${t} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(e.item.field)});`).join("\n")}\n\nconst result$$ = {\n${i.map((e,t)=>` ${JSON.stringify(String(e.item.id))}: !shouldApply${t} ? false : appliers[${t}].fn(row),`).join("\n")}\n};\n\nreturn result$$;`.replaceAll("$$",String(wi)));wi+=1;return(e,t)=>s(i,e,t)},xi=e=>e.quickFilterExcludeHiddenColumns??!0,Ci=(e,t,n,r)=>{const o=yi(e,t,n,r),i=((e,t,n)=>{const r=e.quickFilterValues?.filter(Boolean)??[];if(0===r.length)return null;const o=Jo(n),i=ni(n);let s;s=xi(e)?o.filter(e=>!1!==i[e]):o;const a=[],{ignoreDiacritics:l}=n.current.rootProps,u=Uo(n);return s.forEach(e=>{const t=n.current.getColumn(e),o=t?.getApplyQuickFilterFn;o&&a.push({column:t,appliers:r.map(e=>{const n=l?bi(e):e;return{fn:o(n,t,u)}})})}),function(e,n){const o={};e:for(let i=0;i<r.length;i+=1){const s=r[i];for(let r=0;r<a.length;r+=1){const{column:c,appliers:d}=a[r],{field:p}=c;if(n&&!n(p))continue;const h=d[i];let f=t(e,c);if(null!==h.fn&&(l&&(f=bi(f)),h.fn(f,e,c,u))){o[s]=!0;continue e}}o[s]=!1}return o}})(e,t,n);return function(e,t,n){n.passingFilterItems=o?.(e,t)??null,n.passingQuickFilterValues=i?.(e,t)??null}},Si=e=>null!=e,Mi=(e,t,n,r,o,i)=>{const s=((e,t,n,r)=>(e.cleanedFilterItems||(e.cleanedFilterItems=r.filter(e=>null!==vi(e,t,n))),e.cleanedFilterItems))(i,r,o,n.items),a=e.filter(Si),l=t.filter(Si);if(a.length>0){const e=e=>a.some(t=>t[e.id]);if((n.logicOperator??Wo().logicOperator)===Ho.And){if(!s.every(e))return!1}else{if(!s.some(e))return!1}}if(l.length>0&&null!=n.quickFilterValues){const e=e=>l.some(t=>t[e]);if((n.quickFilterLogicOperator??Wo().quickFilterLogicOperator)===Ho.And){if(!n.quickFilterValues.every(e))return!1}else{if(!n.quickFilterValues.some(e))return!1}}return!0},Ri=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new RegExp(Po(r),"i");return e=>{if(null==e)return t;const n=o.test(String(e));return t?!n:n}},Ii=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>{if(null==e)return t;const n=0===o.compare(r,e.toString());return t?!n:n}},Pi=e=>()=>t=>{const n=""===t||null==t;return e?!n:n},ki={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,chartable:!0,editable:!1,sortComparator:(e,t)=>{const n=wo(e,t);return null!==n?n:"string"==typeof e?yo.compare(e.toString(),t.toString()):e-t},type:"string",align:"left",filterOperators:((e=!1)=>[{value:"contains",getApplyFilterFn:Ri(e,!1),InputComponent:Mo},{value:"doesNotContain",getApplyFilterFn:Ri(e,!0),InputComponent:Mo},{value:"equals",getApplyFilterFn:Ii(e,!1),InputComponent:Mo},{value:"doesNotEqual",getApplyFilterFn:Ii(e,!0),InputComponent:Mo},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${Po(n)}.*$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:Mo},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${Po(n)}$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:Mo},{value:"isEmpty",getApplyFilterFn:Pi(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:Pi(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||0===t.value.length)return null;const n=e?t.value:t.value.map(e=>e.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>null!=e&&n.some(t=>0===r.compare(t,e.toString()||""))},InputComponent:Do}])(),renderEditCell:e=>i.jsx(fo,a({},e)),getApplyQuickFilterFn:e=>{if(!e)return null;const t=new RegExp(Po(e),"i");return(e,n,r,o)=>{let i=o.current.getRowFormattedValue(n,r);return o.current.ignoreDiacritics&&(i=bi(i)),null!=i&&t.test(i.toString())}}};function Ei(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}const Ti=e=>0===e.indexOf("Arrow")||0===e.indexOf("Page")||" "===e||"Home"===e||"End"===e,Di=e=>"Tab"===e||"Escape"===e;function Fi(e){return(e.ctrlKey||e.metaKey)&&"V"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}const Ai=e.createContext(void 0),Oi=()=>{const t=e.useContext(Ai);if(void 0===t)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return t},Hi=e.createContext({className:"unset",tag:i.jsx("style",{href:"/unset"})});function $i(){return e.useContext(Hi).className}function zi(t){const n=Oi(),r=Xe(),o=n.hooks.useCSSVariables(),s=e.useMemo(()=>{const e=`MuiDataGridVariables-${o.id}`,t=`.${e}{${function(e){let t="";for(const n in e)Object.hasOwn(e,n)&&void 0!==e[n]&&(t+=`${n}:${e[n]};`);return t}(o.variables)}}`;return{className:e,tag:i.jsx("style",{href:`/${e}`,nonce:r.nonce,children:t})}},[r.nonce,o]);return i.jsx(Hi.Provider,{value:s,children:t.children})}const Li=["open","target","onClose","children","position","className","onExited"],ji=h(co,{name:"MuiDataGrid",slot:"Menu"})({zIndex:ct.zIndex.menu,[`& .${Vr.menuList}`]:{outline:0}});function Ni(t){const{open:n,target:r,onClose:o,children:l,position:u,className:c,onExited:d}=t,p=s(t,Li),h=Je(),f=Xe(),g=(e=>{const{classes:t}=e;return ie({root:["menu"]},_r,t)})(f),m=$i(),b=e.useRef(null);oe(()=>{n?b.current=document.activeElement instanceof HTMLElement?document.activeElement:null:(b.current?.focus?.(),b.current=null)},[n]),e.useEffect(()=>{const e=n?"menuOpen":"menuClose";h.current.publishEvent(e,{target:r})},[h,n,r]);return i.jsx(ji,a({as:f.slots.basePopper,className:O(g.root,c,m),ownerState:f,open:n,target:r,transition:!0,placement:u,onClickAway:e=>{e.target&&(r===e.target||r?.contains(e.target))||o(e)},onExited:d,clickAwayMouseEvent:"onMouseDown",onKeyDown:e=>{Di(e.key)&&o(e)}},p,f.slotProps?.basePopper,{children:l}))}const Gi=["label","icon","showInMenu","onClick"],_i=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],Vi=xe((t,n)=>{const r=Xe();if(!t.showInMenu){const{label:o,icon:l,onClick:u}=t,c=s(t,Gi),d=e=>{u?.(e)};return i.jsx(r.slots.baseIconButton,a({size:"small",role:"menuitem","aria-label":o},c,{onClick:d},r.slotProps?.baseIconButton,{ref:n,children:e.cloneElement(l,{fontSize:"small"})}))}const{label:o,icon:l,onClick:u,closeMenuOnClick:c=!0,closeMenu:d}=t,p=s(t,_i);return i.jsx(r.slots.baseMenuItem,a({ref:n},p,{onClick:e=>{u?.(e),c&&d?.()},iconStart:l,children:o}))}),Bi=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","children","suppressChildrenValidation"];function Wi(t){const{hasFocus:n,tabIndex:r,position:o="bottom-end",children:l,suppressChildrenValidation:u}=t,c=s(t,Bi),[d,p]=e.useState(-1),[h,f]=e.useState(!1),g=Je(),m=e.useRef(null),b=e.useRef(null),v=e.useRef(!1),w=e.useRef({}),y=ae(),C=x(),S=x(),M=Xe(),R=[];e.Children.forEach(l,t=>{e.isValidElement(t)&&(t.type===e.Fragment?e.Children.forEach(t.props.children,t=>{e.isValidElement(t)&&R.push(t)}):t.type===Vi||u?R.push(t):"function"==typeof t.type?t.type.name:t.type)});const I=R.filter(e=>!e.props.showInMenu),P=R.filter(e=>e.props.showInMenu),k=I.length+(P.length?1:0);e.useLayoutEffect(()=>{n||Object.entries(w.current).forEach(([e,t])=>{t?.stop({},()=>{delete w.current[e]})})},[n]),e.useEffect(()=>{if(d<0||!m.current)return;if(d>=m.current.children.length)return;m.current.children[d].focus({preventScroll:!0})},[d]);const E=R.findIndex(e=>!e.props.disabled);e.useEffect(()=>{n&&-1===d&&p(E),n||(p(-1),v.current=!1)},[n,d,E]),e.useEffect(()=>{d>=k&&p(k-1)},[d,k]);const T=()=>{f(!1)},D=e=>t=>{w.current[e]=t},F=(e,t)=>n=>{p(e),v.current=!0,t&&t(n)},A=k>0?{role:"menu",onKeyDown:e=>{if(k<=1)return;const t=(e,n)=>{if(e<0||e>R.length)return e;const r=("left"===n?-1:1)*(y?-1:1);return R[e+r]?.props.disabled?t(e+r,n):e+r};let n=d;"ArrowRight"===e.key?n=t(d,"right"):"ArrowLeft"===e.key&&(n=t(d,"left")),n<0||n>=k||n!==d&&(e.preventDefault(),e.stopPropagation(),p(n))}}:void 0;return i.jsxs("div",a({ref:m,tabIndex:-1,className:Vr.actionsCell},A,c,{children:[I.map((t,n)=>e.cloneElement(t,{key:n,touchRippleRef:D(n),onClick:F(n,t.props.onClick),tabIndex:d===n?r:-1})),P.length>0&&S&&i.jsx(M.slots.baseIconButton,a({ref:b,id:S,"aria-label":g.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?C:void 0,role:"menuitem",size:"small",onClick:e=>{e.stopPropagation(),e.preventDefault(),h?T():(f(!0),p(k-1),v.current=!0)},touchRippleRef:D(S),tabIndex:d===I.length?r:-1},M.slotProps?.baseIconButton,{children:i.jsx(M.slots.moreActionsIcon,{fontSize:"small"})})),P.length>0&&i.jsx(Ni,{open:h,target:b.current,position:o,onClose:T,children:i.jsx(M.slots.baseMenuList,{id:C,className:Vr.menuList,"aria-labelledby":S,autoFocusItem:!0,children:P.map((t,n)=>e.cloneElement(t,{key:n,closeMenu:T}))})})]}))}function Ui(e){const{colDef:t,id:n}=e,r=Je();if(!(e=>"function"==typeof e.getActions)(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const o=t.getActions(r.current.getRowParams(n));return i.jsx(Wi,a({suppressChildrenValidation:!0},e,{children:o}))}const Ki="actions",qi=a({},ki,{sortable:!1,filterable:!1,aggregable:!1,chartable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:e=>i.jsx(Ui,a({},e)),getApplyQuickFilterFn:()=>null}),Xi="__row_group_by_columns_group__",Yi="__detail_panel_toggle__";let Qi=function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e}({});const Zi=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"];function Ji(t){const{value:n,rowNode:r}=t,o=s(t,Zi),l=Je(),u=Xe(),c=(e=>{const{classes:t}=e;return ie({root:["booleanCell"]},_r,t)})({classes:u.classes}),d=so(l,wr)>0&&"group"===r.type&&!1===u.treeData,p=e.useMemo(()=>n?u.slots.booleanCellTrueIcon:u.slots.booleanCellFalseIcon,[u.slots.booleanCellFalseIcon,u.slots.booleanCellTrueIcon,n]);return d&&void 0===n?null:i.jsx(p,a({fontSize:"small",className:c.root,titleAccess:l.current.getLocaleText(n?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":Boolean(n)},o))}const es=e.memo(Ji),ts=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"];function ns(t){const{id:n,value:r,field:o,className:l,hasFocus:u,onValueChange:c}=t,d=s(t,ts),p=Je(),h=e.useRef(null),f=x(),[g,m]=e.useState(r),b=Xe(),v=(e=>{const{classes:t}=e;return ie({root:["editBooleanCell"]},_r,t)})({classes:b.classes}),w=e.useCallback(async e=>{const t=e.target.checked;c&&await c(e,t),m(t),await p.current.setEditCellValue({id:n,field:o,value:t},e)},[p,o,n,c]);return e.useEffect(()=>{m(r)},[r]),oe(()=>{u&&h.current.focus()},[u]),i.jsx("label",a({htmlFor:f,className:O(v.root,l)},d,{children:i.jsx(b.slots.baseCheckbox,a({id:f,inputRef:h,checked:Boolean(g),onChange:w,size:"small"},b.slotProps?.baseCheckbox))}))}const rs=["item","applyValue","apiRef","focusElementRef","isFilterActive","headerFilterMenu","clearButton","tabIndex","slotProps"];function os(t){const{item:n,applyValue:r,apiRef:o,focusElementRef:l,headerFilterMenu:u,clearButton:c,tabIndex:d,slotProps:p}=t,h=s(t,rs),[f,g]=e.useState(is(n.value)),m=Xe(),b=x(),v=x(),w=m.slotProps?.baseSelect||{},y=w.native??!1,C=m.slotProps?.baseSelectOption||{},S=e.useCallback(e=>{const t=is(e.target.value);g(t),r(a({},n,{value:t}))},[r,n]);e.useEffect(()=>{g(is(n.value))},[n.value]);const M=p?.root.label??o.current.getLocaleText("filterPanelInputLabel"),R=p?.root.slotProps;return i.jsxs(e.Fragment,{children:[i.jsxs(m.slots.baseSelect,a({fullWidth:!0,labelId:b,id:v,label:M,value:void 0===f?"":String(f),onChange:S,native:y,slotProps:{htmlInput:a({ref:l,tabIndex:d},R?.htmlInput)}},w,h,p?.root,{children:[i.jsx(m.slots.baseSelectOption,a({},C,{native:y,value:"",children:o.current.getLocaleText("filterValueAny")})),i.jsx(m.slots.baseSelectOption,a({},C,{native:y,value:"true",children:o.current.getLocaleText("filterValueTrue")})),i.jsx(m.slots.baseSelectOption,a({},C,{native:y,value:"false",children:o.current.getLocaleText("filterValueFalse")}))]})),u,c]})}function is(e){return"true"===String(e).toLowerCase()||"false"!==String(e).toLowerCase()&&void 0}const ss=a({},ki,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:e=>e.field!==Xi&&Fr(e.rowNode)?"":i.jsx(es,a({},e)),renderEditCell:e=>i.jsx(ns,a({},e)),sortComparator:xo,valueFormatter:(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),filterOperators:[{value:"is",getApplyFilterFn:e=>{const t=is(e.value);return void 0===t?null:e=>Boolean(e)===t},InputComponent:os}],getApplyQuickFilterFn:()=>null,aggregable:!1,chartable:!1,pastedValueParser:e=>(e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}})(e)});function as(e){for(const t in e)return!1;return!0}const ls=Xn(e=>e.sorting),us=Kn(ls,e=>e.sortedRows),cs=qn(us,hr,fr,(e,t,n)=>e.reduce((e,r)=>{const o=t[r];if(o)e.push({id:r,model:o});else{const t=n[r];t&&Fr(t)&&e.push({id:r,model:{[Rr]:r}})}return e},[])),ds=Kn(ls,e=>e.sortModel),ps=qn(ds,e=>e.reduce((t,n,r)=>(t[n.field]={sortDirection:n.sort,sortIndex:e.length>1?r+1:void 0},t),{}));qn(us,e=>e.reduce((e,t,n)=>(e[t]=n,e),Object.create(null)));const hs=Xn(e=>e.filter),fs=Kn(hs,e=>e.filterModel),gs=Kn(fs,e=>e.quickFilterValues),ms=Xn(e=>e.visibleRowsLookup),bs=Kn(hs,e=>e.filteredRowsLookup);Kn(hs,e=>e.filteredChildrenCountLookup),Kn(hs,e=>e.filteredDescendantCountLookup);const vs=qn(ms,cs,(e,t)=>as(e)?t:t.filter(t=>!1!==e[t.id])),ws=qn(vs,e=>e.map(e=>e.id)),ys=qn(bs,cs,(e,t)=>as(e)?t:t.filter(t=>!1!==e[t.id])),xs=qn(ys,e=>e.map(e=>e.id));qn(ws,fr,(e,t)=>{const n={};let r=0;return e.reduce((e,o)=>{const i=t[o];return n[i.depth]||(n[i.depth]=0),i.depth>r&&(n[i.depth]=0),r=i.depth,n[i.depth]+=1,e[o]=n[i.depth],e},{})});const Cs=Kn(qn(ys,fr,wr,(e,t,n)=>n<2?[e]:e.reduce((e,n)=>{const r=t[n.id]?.depth;return void 0===r||(e[r]||(e[r]=[]),e[r].push(n)),e},[[]])),e=>e[0]??[]),Ss=Kn(vs,e=>e.length),Ms=Kn(Cs,e=>e.length),Rs=Kn(ys,e=>e.length);Kn(Rs,Ms,(e,t)=>e-t);const Is=qn(fs,ei,(e,t)=>e.items?.filter(e=>{if(!e.field)return!1;const n=t[e.field];if(!n?.filterOperators||0===n?.filterOperators?.length)return!1;const r=n.filterOperators.find(t=>t.value===e.operator);return!!r&&(!r.InputComponent||null!=e.value&&""!==e.value?.toString())})),Ps=qn(Is,e=>e.reduce((e,t)=>(e[t.field]?e[t.field].push(t):e[t.field]=[t],e),{})),ks=qn(ws,e=>e.reduce((e,t,n)=>(e[t]=n,e),Object.create(null))),Es=Xn(e=>e.rowSelection),Ts=qn(Es,Lo),Ds=Kn(Es,Rs,(e,t)=>"include"===e.type?e.ids.size:t-e.ids.size),Fs=qn(Es,hr,yr,(e,t,n)=>{const r=new Map;if("include"===e.type)for(const o of e.ids)r.set(o,t[o]);else for(let o=0;o<n.length;o+=1){const i=n[o];e.ids.has(i)||r.set(i,t[i])}return r}),As=Xn((e,t)=>Rr in t?t[Rr]:e.props.getRowId?e.props.getRowId(t):t.id),Os=Xn(e=>e.props.isRowSelectable);function Hs(e,t){const n=fr(e),r=us(e),o=bs(e),i=n[t];if(!i||"group"!==i.type)return[];const s=[];for(let a=r.findIndex(e=>e===t)+1;a<r.length&&n[r[a]]?.depth>i.depth;a+=1){const t=r[a];!1!==o[t]&&e.current.isRowSelectable(t)&&s.push(t)}return s}const $s=Kn(ti,fr,bs,Ts,hr,Os,(e,t,n,r,o,i,{groupId:s,autoSelectParents:a})=>{const l=t[s],u={id:s,row:o[s],columns:e};let c=!0;if("function"==typeof i&&(c=i(u)),!l||"group"!==l.type||r.has(s))return{isIndeterminate:!1,isChecked:r.has(s),isSelectable:c};let d=!1,p=!1;const h=e=>{if(!1===n[e]||d&&p)return;const o=t[e];"group"===o?.type&&o.children.forEach(h),r.has(e)?d=!0:p=!0};return h(s),{isIndeterminate:d&&p,isChecked:!!a&&(d&&!p),isSelectable:c}});function zs(e){return e.signature===Br.DataGrid?e.checkboxSelection&&!0!==e.disableMultipleRowSelection:!e.disableMultipleRowSelection}const Ls=(e,t,n,r,o,i,s=Ts(e))=>{const a=bs(e),l=new Set([]);if((r||o)&&!1!==a[n]){if(r){const r=t[n];if("group"===r?.type){Hs(e,n).forEach(e=>{i(e),l.add(e)})}}if(o){const r=e=>{if(!s.has(e)&&!l.has(e))return!1;const n=t[e];return!!n&&("group"!==n.type||n.children.every(r))},o=n=>{const s=((e,t,n)=>{const r=e[n];if(!r)return[];const o=r.parent;return null==o?[]:e[o].children.filter(e=>e!==n&&!1!==t[e])})(t,a,n);if(0===s.length||s.every(r)){const r=t[n],s=r?.parent;null!=s&&s!==Mr&&e.current.isRowSelectable(s)&&(i(s),l.add(s),o(s))}},u=t[n];if(!u||u.parent===Mr)return;o(n)}}},js=(e,t,n,r,o,i)=>{const s=Ts(e);if(o||r){if(o){const e=((e,t)=>{const n=[];let r=t;for(;null!=r&&r!==Mr;){const t=e[r];if(!t)return n;n.push(r),r=t.parent}return n})(t,n);e.forEach(e=>{s.has(e)&&i(e)})}if(r){const r=t[n];if("group"===r?.type){Hs(e,n).forEach(e=>{i(e)})}}}},Ns=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],Gs=xe(function(t,n){const{field:r,id:o,rowNode:l,tabIndex:u}=t,c=s(t,Ns),d=Je(),p=Xe(),h=(e=>{const{classes:t}=e;return ie({root:["checkboxInput"]},_r,t)})({classes:p.classes}),{isIndeterminate:f,isChecked:g,isSelectable:m}=so(d,$s,{groupId:o,autoSelectParents:p.rowSelectionPropagation?.parents??!1}),b=!m;e.useLayoutEffect(()=>{if(0===u){const e=d.current.getCellElement(o,r);e&&(e.tabIndex=-1)}},[d,u,o,r]);const v=y(e=>{" "===e.key&&e.stopPropagation()}),w=y(e=>{b&&e.preventDefault()}),x=y(()=>{});if("footer"===l.type||"pinnedRow"===l.type)return null;const C=d.current.getLocaleText(g&&!f?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return i.jsx(p.slots.baseCheckbox,a({tabIndex:u,checked:g&&!f,onChange:e=>{if(b)return;const t={value:e.target.checked,id:o};d.current.publishEvent("rowSelectionCheckboxChange",t,e)},onClick:w,onMouseDown:x,className:O(h.root,b&&"Mui-disabled"),material:{disableRipple:b},slotProps:{htmlInput:{"aria-disabled":b||void 0,"aria-label":C,name:"select_row"}},onKeyDown:v,indeterminate:f},p.slotProps?.baseCheckbox,c,{ref:n}))}),_s=Xn(e=>e.focus),Vs=Kn(_s,e=>e.cell),Bs=Kn(_s,e=>e.columnHeader);Kn(_s,e=>e.columnHeaderFilter);const Ws=Kn(_s,e=>e.columnGroupHeader),Us=Xn(e=>e.tabIndex),Ks=Kn(Us,e=>e.cell),qs=Kn(Us,e=>e.columnHeader);Kn(Us,e=>e.columnHeaderFilter);const Xs=Kn(Us,e=>e.columnGroupHeader),Ys=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):-1===e?n+2:0,Qs=e=>({page:0,pageSize:e?0:100}),Zs=(e,t)=>{if(t===Br.DataGrid&&e>100)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"))},Js=Xn(e=>e.pagination),ea=Kn(Js,e=>e.enabled&&"client"===e.paginationMode),ta=Kn(Js,e=>e.paginationModel),na=Kn(Js,e=>e.rowCount),ra=Kn(Js,e=>e.meta),oa=Kn(ta,e=>e.page),ia=Kn(ta,e=>e.pageSize),sa=Kn(ta,na,(e,t)=>Ys(t,e.pageSize,e.page)),aa=qn(ea,ta,fr,wr,vs,Cs,(e,t,n,r,o,i)=>{if(!e)return null;const s=i.length,a=Math.min(t.pageSize*t.page,s-1),l=-1===t.pageSize?s-1:Math.min(a+t.pageSize-1,s-1);if(-1===a||-1===l)return null;if(r<2)return{firstRowIndex:a,lastRowIndex:l};const u=i[a],c=l-a+1,d=o.findIndex(e=>e.id===u.id);let p=d,h=0;for(;p<o.length&&h<=c;){const e=o[p],t=n[e.id]?.depth;void 0===t?p+=1:((h<c||t>0)&&(p+=1),0===t&&(h+=1))}return{firstRowIndex:d,lastRowIndex:p-1}}),la=qn(vs,aa,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),ua=qn(ws,aa,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),ca=qn(ea,aa,la,vs,(e,t,n,r)=>e?{rows:n,range:t,rowIdToIndexMap:n.reduce((e,t,n)=>(e.set(t.id,n),e),new Map)}:{rows:r,range:0===r.length?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowIdToIndexMap:r.reduce((e,t,n)=>(e.set(t.id,n),e),new Map)}),da=["field","colDef"],pa=xe(function(t,n){const r=s(t,da),[,o]=e.useState(!1),l=Je(),u=Xe(),c=(e=>{const{classes:t}=e;return ie({root:["checkboxInput"]},_r,t)})({classes:u.classes}),d=so(l,qs),p=so(l,Es),h=so(l,ws),f=so(l,ua),g=e.useMemo(()=>{const e=u.isRowSelectable;if("function"!=typeof e)return p;if("exclude"===p.type)return p;const t={type:"include",ids:new Set};for(const n of p.ids)u.keepNonExistentRowsSelected&&t.ids.add(n),l.current.getRow(n)&&e(l.current.getRowParams(n))&&t.ids.add(n);return t},[l,u.isRowSelectable,u.keepNonExistentRowsSelected,p]),m=e.useMemo(()=>{const e=u.pagination&&u.checkboxSelectionVisibleOnly&&"server"!==u.paginationMode?f:h,t=new Set;for(let n=0;n<e.length;n+=1){const r=e[n];l.current.getRow(r)&&(l.current.isRowSelectable(r)&&t.add(r))}return t},[l,u.pagination,u.paginationMode,u.checkboxSelectionVisibleOnly,f,h]),b=e.useMemo(()=>{const e=Lo(g);let t=0;for(const n of m)e.has(n)&&(t+=1);return t},[g,m]),v=e.useMemo(()=>{if(0===b)return!1;const e=Lo(g);for(const t of m)if(!e.has(t))return!0;return!1},[b,g,m]),w=b>0,y=null!==d&&d.field===t.field?0:-1;e.useLayoutEffect(()=>{const e=l.current.getColumnHeaderElement(t.field);0===y&&e&&(e.tabIndex=-1)},[y,l,t.field]);const x=e.useCallback(e=>{" "===e.key&&l.current.publishEvent("headerSelectionCheckboxChange",{value:!w})},[l,w]),C=e.useCallback(()=>{o(e=>!e)},[]);e.useEffect(()=>l.current.subscribeEvent("rowSelectionChange",C),[l,C]);const S=l.current.getLocaleText(w&&!v?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return i.jsx(u.slots.baseCheckbox,a({indeterminate:v,checked:w&&!v,onChange:e=>{const t={value:e.target.checked};l.current.publishEvent("headerSelectionCheckboxChange",t)},className:c.root,slotProps:{htmlInput:{"aria-label":S,name:"select_all_rows"}},tabIndex:y,onKeyDown:x,disabled:!zs(u)},u.slotProps?.baseCheckbox,r,{ref:n}))}),ha="__check__",fa=a({},ss,{type:"custom",field:ha,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,chartable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:()=>null,display:"flex",valueGetter:(e,t,n,r)=>{const o=As(r,t);return r.current.isRowSelected(o)},rowSpanValueGetter:(e,t,n,r)=>As(r,t),renderHeader:e=>i.jsx(pa,a({},e)),renderCell:e=>i.jsx(Gs,a({},e))}),ga=["item","applyValue","type","apiRef","focusElementRef","slotProps","isFilterActive","headerFilterMenu","clearButton","tabIndex","disabled"];function ma(e,t){if(null==e)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":"date"===t?n.toISOString().substring(0,10):"datetime-local"===t?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function ba(t){const{item:n,applyValue:r,type:o,apiRef:l,focusElementRef:u,slotProps:c,headerFilterMenu:d,clearButton:p,tabIndex:h,disabled:f}=t,g=s(t,ga),m=c?.root.slotProps,b=se(),[v,w]=e.useState(()=>ma(n.value,o)),[y,C]=e.useState(!1),S=x(),M=Xe(),R=e.useCallback(e=>{b.clear();const t=e.target.value;w(t),C(!0),b.start(M.filterDebounceMs,()=>{const e=new Date(t);r(a({},n,{value:Number.isNaN(e.getTime())?void 0:e})),C(!1)})},[r,n,M.filterDebounceMs,b]);return e.useEffect(()=>{const e=ma(n.value,o);w(e)},[n.value,o]),i.jsxs(e.Fragment,{children:[i.jsx(M.slots.baseTextField,a({fullWidth:!0,id:S,label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),value:v,onChange:R,type:o||"text",disabled:f,inputRef:u,slotProps:a({},m,{input:a({endAdornment:y?i.jsx(M.slots.loadIcon,{fontSize:"small",color:"action"}):null},m?.input),htmlInput:a({max:"datetime-local"===o?"9999-12-31T23:59":"9999-12-31",tabIndex:h},m?.htmlInput)})},M.slotProps?.baseTextField,g,c?.root)),d,p]})}function va(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const i=o.getTime();return e=>{if(!e)return!1;if(r)return t(e.getTime(),i);const o=new Date(e);return n?o.setSeconds(0,0):o.setHours(0,0,0,0),t(o.getTime(),i)}}const wa=e=>[{value:"is",getApplyFilterFn:t=>va(t,(e,t)=>e===t,e),InputComponent:ba,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>va(t,(e,t)=>e!==t,e),InputComponent:ba,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>va(t,(e,t)=>e>t,e),InputComponent:ba,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>va(t,(e,t)=>e>=t,e),InputComponent:ba,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>va(t,(e,t)=>e<t,e,!e),InputComponent:ba,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>va(t,(e,t)=>e<=t,e),InputComponent:ba,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1}],ya=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange","slotProps"],xa=h(co)({fontSize:"inherit"});function Ca(t){const{id:n,value:r,field:o,colDef:l,hasFocus:u,onValueChange:c,slotProps:d}=t,p=s(t,ya),h="dateTime"===l.type,f=Je(),g=e.useRef(null),m=e.useMemo(()=>{let e,t;if(e=null==r?null:r instanceof Date?r:new Date((r??"").toString()),null==e||Number.isNaN(e.getTime()))t="";else{t=new Date(e.getTime()-60*e.getTimezoneOffset()*1e3).toISOString().substr(0,h?16:10)}return{parsed:e,formatted:t}},[r,h]),[b,v]=e.useState(m),w=Xe(),y=(e=>{const{classes:t}=e;return ie({root:["editInputCell"]},_r,t)})({classes:w.classes}),x=e.useCallback(e=>{if(""===e)return null;const[t,n]=e.split("T"),[r,o,i]=t.split("-"),s=new Date;if(s.setFullYear(Number(r),Number(o)-1,Number(i)),s.setHours(0,0,0,0),n){const[e,t]=n.split(":");s.setHours(Number(e),Number(t),0,0)}return s},[]),C=e.useCallback(async e=>{const t=e.target.value,r=x(t);c&&await c(e,r),v({parsed:r,formatted:t}),f.current.setEditCellValue({id:n,field:o,value:r},e)},[f,o,n,c,x]);return e.useEffect(()=>{v(e=>m.parsed!==e.parsed&&m.parsed?.getTime()!==e.parsed?.getTime()?m:e)},[m]),oe(()=>{u&&g.current.focus()},[u]),i.jsx(xa,a({as:w.slots.baseInput,inputRef:g,fullWidth:!0,className:y.root,type:h?"datetime-local":"date",value:b.formatted,onChange:C},p,d?.root,{slotProps:{htmlInput:a({max:h?"9999-12-31T23:59":"9999-12-31"},d?.root?.slotProps?.htmlInput)}}))}const Sa=e=>i.jsx(Ca,a({},e));function Ma({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join("\n"))}const Ra=a({},ki,{type:"date",sortComparator:Co,valueFormatter:(e,t,n,r)=>{if(!e)return"";const o=As(r,t);return!Dr(t)||e instanceof Date?(Ma({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString()):e},filterOperators:wa(),renderEditCell:Sa,pastedValueParser:e=>new Date(e)}),Ia=a({},ki,{type:"dateTime",sortComparator:Co,valueFormatter:(e,t,n,r)=>{if(!e)return"";const o=As(r,t);return!Dr(t)||e instanceof Date?(Ma({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString()):e},filterOperators:wa(!0),renderEditCell:Sa,pastedValueParser:e=>new Date(e)}),Pa=e=>null==e?null:Number(e),ka=a({},ki,{type:"number",align:"right",headerAlign:"right",sortComparator:xo,valueParser:e=>""===e?null:Number(e),valueFormatter:e=>function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)?e.toLocaleString():e||"",filterOperators:[{value:"=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>Pa(t)===e.value,InputComponent:Mo,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>Pa(t)!==e.value,InputComponent:Mo,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&Pa(t)>e.value,InputComponent:Mo,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&Pa(t)>=e.value,InputComponent:Mo,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&Pa(t)<e.value,InputComponent:Mo,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&Pa(t)<=e.value,InputComponent:Mo,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>null!=e,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>Array.isArray(e.value)&&0!==e.value.length?t=>null!=t&&e.value.includes(Number(t)):null,InputComponent:Do,InputComponentProps:{type:"number"}}],getApplyQuickFilterFn:e=>null==e||Number.isNaN(e)||""===e?null:t=>Pa(t)===Pa(e)});function Ea(e){return"singleSelect"===e?.type}function Ta(e,t){if(e)return"function"==typeof e.valueOptions?e.valueOptions(a({field:e.field},t)):e.valueOptions}function Da(e,t,n){if(void 0===t)return;const r=t.find(t=>{const r=n(t);return String(r)===String(e)});return n(r)}const Fa=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","slotProps"];function Aa(t){const n=Xe(),{id:r,value:o,field:l,row:u,colDef:c,hasFocus:d,error:p,onValueChange:h,initialOpen:f=n.editMode===Fo.Cell,slotProps:g}=t,m=s(t,Fa),b=Je(),v=e.useRef(null),w=e.useRef(null),[y,x]=e.useState(f),C=(n.slotProps?.baseSelect||{}).native??!1;if(oe(()=>{d&&w.current?.focus()},[d]),!Ea(c))return null;const S=Ta(c,{id:r,row:u});if(!S)return null;const M=c.getOptionValue,R=c.getOptionLabel;return S&&c?i.jsx(n.slots.baseSelect,a({ref:v,value:o,onChange:async e=>{if(!Ea(c)||!S)return;x(!1);const t=Da(e.target.value,S,M);h&&await h(e,t),await b.current.setEditCellValue({id:r,field:l,value:t},e)},open:y,onOpen:e=>{(function(e){return"key"in e&&!!e.key})(e)&&"Enter"===e.key||x(!0)},onClose:(e,t)=>{if(n.editMode!==Fo.Row){if("backdropClick"===t||"Escape"===e.key){const t=b.current.getCellParams(r,l);b.current.publishEvent("cellEditStop",a({},t,{reason:"Escape"===e.key?No.escapeKeyDown:No.cellFocusOut}))}}else x(!1)},error:p,native:C,fullWidth:!0,slotProps:{htmlInput:{ref:w}}},m,g?.root,n.slotProps?.baseSelect,{children:S.map(t=>{const r=M(t);return e.createElement(n.slots.baseSelectOption,a({},n.slotProps?.baseSelectOption||{},{native:C,key:r,value:r}),R(t))})})):null}const Oa=["item","applyValue","type","apiRef","focusElementRef","tabIndex","isFilterActive","clearButton","headerFilterMenu","slotProps"],Ha=({column:t,OptionComponent:n,getOptionLabel:r,getOptionValue:o,isSelectNative:i,baseSelectOptionProps:s})=>["",...Ta(t)||[]].map(t=>{const l=o(t);let u=r(t);return""===u&&(u=" "),e.createElement(n,a({},s,{native:i,key:l,value:l}),u)});function $a(t){const{item:n,applyValue:r,type:o,apiRef:l,focusElementRef:u,tabIndex:c,clearButton:d,headerFilterMenu:p,slotProps:h}=t,f=s(t,Oa),g=n.value??"",m=x(),b=x(),v=Xe(),w=v.slotProps?.baseSelect?.native??!1,y=l.current.getColumn(n.field),C=y.getOptionValue,S=y.getOptionLabel,M=e.useMemo(()=>Ta(y),[y]),R=e.useCallback(e=>{let t=e.target.value;t=Da(t,M,C),r(a({},n,{value:t}))},[M,C,r,n]);if(!y||!Ea(y))return null;const I=h?.root.label??l.current.getLocaleText("filterPanelInputLabel");return i.jsxs(e.Fragment,{children:[i.jsx(v.slots.baseSelect,a({fullWidth:!0,id:m,label:I,labelId:b,value:g,onChange:R,slotProps:{htmlInput:a({tabIndex:c,ref:u,type:o||"text",placeholder:h?.root.placeholder??l.current.getLocaleText("filterPanelInputPlaceholder")},h?.root.slotProps?.htmlInput)},native:w},v.slotProps?.baseSelect,f,h?.root,{children:Ha({column:y,OptionComponent:v.slots.baseSelectOption,getOptionLabel:S,getOptionValue:C,isSelectNative:w,baseSelectOptionProps:v.slotProps?.baseSelectOption})})),p,d]})}const za=["item","applyValue","type","apiRef","focusElementRef","slotProps"];function La(t){const{item:n,applyValue:r,type:o,apiRef:l,focusElementRef:u,slotProps:c}=t,d=s(t,za),p=x(),h=Xe(),f=l.current.getColumn(n.field),g=f.getOptionValue,m=f.getOptionLabel,b=e.useCallback((e,t)=>g(e)===g(t),[g]),v=e.useMemo(()=>Ta(f)||[],[f]),w=e.useMemo(()=>Array.isArray(n.value)?n.value.reduce((e,t)=>{const n=v.find(e=>g(e)===t);return null!=n&&e.push(n),e},[]):[],[g,n.value,v]),y=e.useCallback((e,t)=>{r(a({},n,{value:t.map(g)}))},[r,n,g]);if(!f||!Ea(f))return null;const C=h.slots.baseAutocomplete;return i.jsx(C,a({multiple:!0,options:v,isOptionEqualToValue:b,id:p,value:w,onChange:y,getOptionLabel:m,label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:o||"text",inputRef:u}}},d,c?.root))}const ja=e=>null!=e&&Io(e)?e.value:e,Na=a({},ki,{type:"singleSelect",getOptionLabel:e=>Io(e)?e.label:String(e),getOptionValue:e=>Io(e)?e.value:e,valueFormatter(e,t,n,r){const o=As(r,t);if(!Ea(n))return"";const i=Ta(n,{id:o,row:t});if(null==e)return"";if(!i)return e;if("object"!=typeof i[0])return n.getOptionLabel(e);const s=i.find(t=>n.getOptionValue(t)===e);return s?n.getOptionLabel(s):""},renderEditCell:e=>i.jsx(Aa,a({},e)),filterOperators:[{value:"is",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>ja(t)===ja(e.value),InputComponent:$a},{value:"not",getApplyFilterFn:e=>null==e.value||""===e.value?null:t=>ja(t)!==ja(e.value),InputComponent:$a},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||0===e.value.length)return null;const t=e.value.map(ja);return e=>t.includes(ja(e))},InputComponent:La}],pastedValueParser:(e,t,n)=>{const r=n,o=Ta(r)||[],i=r.getOptionValue;if(o.find(t=>i(t)===e))return e}}),Ga=Xn(e=>e.headerFiltering),_a=Kn(Ga,e=>e?.enabled??!1),Va=Kn(Ga,e=>e.editing),Ba=Kn(Ga,e=>e.menuOpen),Wa=Xn(e=>e.columnGrouping),Ua=qn(Wa,e=>e?.unwrappedGroupingModel??{}),Ka=qn(Wa,e=>e?.lookup??{}),qa=qn(Wa,e=>e?.headerStructure??[]),Xa=Kn(Wa,e=>e?.maxDepth??0),Ya=["maxWidth","minWidth","width","flex"],Qa={string:ki,number:ka,date:Ra,dateTime:Ia,boolean:ss,singleSelect:Na,[Ki]:qi,custom:ki};const Za=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(t=>{let s=e.lookup[t],l=0,u=!1;!1!==e.columnVisibilityModel[t]&&(s.flex&&s.flex>0?(r+=s.flex,u=!0):l=ko(s.width||ki.width,s.minWidth||ki.minWidth,s.maxWidth||ki.maxWidth),o+=l),s.computedWidth!==l&&(s=a({},s,{computedWidth:l})),u&&i.push(s),n[t]=s});const s=void 0===t?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),l=Math.max(s-o,0);if(r>0&&s>0){const e=function({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(e=>e.field)),o={all:{},frozenFields:[],freeze:e=>{const t=o.all[e];t&&!0!==t.frozen&&(o.all[e].frozen=!0,o.frozenFields.push(e))}};return function i(){if(o.frozenFields.length===r.size)return;const s={min:{},max:{}};let a=e,l=t,u=0;o.frozenFields.forEach(e=>{a-=o.all[e].computedWidth,l-=o.all[e].flex});for(let e=0;e<n.length;e+=1){const t=n[e];if(o.all[t.field]&&!0===o.all[t.field].frozen)continue;let r=a/l*t.flex;r<t.minWidth?(u+=t.minWidth-r,r=t.minWidth,s.min[t.field]=!0):r>t.maxWidth&&(u+=t.maxWidth-r,r=t.maxWidth,s.max[t.field]=!0),o.all[t.field]={frozen:!1,computedWidth:r,flex:t.flex}}u<0?Object.keys(s.max).forEach(e=>{o.freeze(e)}):u>0?Object.keys(s.min).forEach(e=>{o.freeze(e)}):n.forEach(({field:e})=>{o.freeze(e)}),i()}(),o.all}({initialFreeSpace:l,totalFlexUnits:r,flexColumns:i});Object.keys(e).forEach(t=>{n[t]=a({},n[t],{computedWidth:e[t].computedWidth})})}return a({},e,{lookup:n})};function Ja(e){let t=Qa.string;return e&&Qa[e]&&(t=Qa[e]),t}const el=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=ni(e),keepOnlyColumnsToUpsert:o=!1,updateInitialVisibilityModel:i=!1})=>{const s=!e.current.state.columns;let l;if(s)l={orderedFields:[],lookup:{},columnVisibilityModel:r,initialColumnVisibilityModel:r};else{const t=Zo(e);l={orderedFields:o?[]:[...t.orderedFields],lookup:a({},t.lookup),columnVisibilityModel:r,initialColumnVisibilityModel:i?r:t.initialColumnVisibilityModel}}const u={};if(o&&!s)for(const a in l.lookup)Object.prototype.hasOwnProperty.call(l.lookup,a)&&(u[a]=!1);t.forEach(e=>{const{field:t}=e;u[t]=!0;let n=l.lookup[t];null==n?(n=a({},Ja(e.type),{field:t,hasBeenResized:!1}),l.orderedFields.push(t)):o&&l.orderedFields.push(t),n&&n.type!==e.type&&(n=a({},Ja(e.type),{field:t}));let r=n.hasBeenResized;Ya.forEach(t=>{void 0!==e[t]&&(r=!0,-1===e[t]&&(e[t]=1/0))}),l.lookup[t]=le(n,a({},Ja(e.type),e,{hasBeenResized:r}))}),o&&!s&&Object.keys(l.lookup).forEach(e=>{u[e]||delete l.lookup[e]});const c=((e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(0===o.length&&0===n.length)return e;const i={},s=[];for(let a=0;a<n.length;a+=1){const t=n[a];e.lookup[t]&&(i[t]=!0,s.push(t))}const l=0===s.length?e.orderedFields:[...s,...e.orderedFields.filter(e=>!i[e])],u=a({},e.lookup);for(let c=0;c<o.length;c+=1){const e=o[c],t=a({},u[e],{hasBeenResized:!0});Object.entries(r[e]).forEach(([e,n])=>{t[e]=-1===n?1/0:n}),u[e]=t}return a({},e,{orderedFields:l,lookup:u})})(e.current.unstable_applyPipeProcessors("hydrateColumns",l),n);return Za(c,e.current.getRootDimensions?.()??void 0)};function tl(e,t){if(t.listView)return 0;const n=uo(e),r=Xa(e),o=_a(e);return Math.floor(t.columnHeaderHeight*n)+Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n)*r+(o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0)}const nl=ue("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${Vr["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${Vr["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${Vr["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${Vr["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${Vr["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${Vr["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${Vr["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${Vr["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),rl=Kn(Qn,(e,t)=>"left"===t?e.leftPinnedWidth:"right"===t?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function ol(t){const{scrollDirection:n,scrollPosition:r}=t,o=e.useRef(null),s=Je(),l=se(),u=so(s,uo),c=so(s,Zn),d=so(s,rl,n),p=Xe(),h=tl(s,p),f=Math.floor(p.columnHeaderHeight*u),g=a({height:f,top:h-f},"left"===n?{left:d}:{},"right"===n?{right:d}:{}),m=y(e=>{let t;if(e.preventDefault(),"left"===n)t=e.clientX-o.current.getBoundingClientRect().right;else{if("right"!==n)throw new Error("MUI X: Wrong drag direction");t=Math.max(1,e.clientX-o.current.getBoundingClientRect().left)}t=1.5*(t-1)+1,l.start(0,()=>{s.current.scroll({left:r.current.left+t,top:r.current.top})})});return i.jsx(sl,a({},t,{ref:o,getCanScrollMore:()=>{const e=Qn(s);if("left"===n)return r.current.left>0;if("right"===n){const t=c-e.viewportInnerSize.width;return r.current.left<t}return!1},style:g,handleDragOver:m}))}function il(t){const{scrollDirection:n,scrollPosition:r}=t,o=e.useRef(null),s=Je(),l=se(),u=so(s,lr),c=Xe(),d=tl(s,c),p={top:"up"===n?d:void 0,bottom:"down"===n?0:void 0},h=y(e=>{let t;if(e.preventDefault(),"up"===n)t=e.clientY-o.current.getBoundingClientRect().bottom;else{if("down"!==n)throw new Error("MUI X: Wrong drag direction");t=Math.max(1,e.clientY-o.current.getBoundingClientRect().top)}t=1.5*(t-1)+1,l.start(0,()=>{s.current.scroll({left:r.current.left,top:r.current.top+t})})});return i.jsx(sl,a({},t,{ref:o,getCanScrollMore:()=>{const e=Qn(s);if("up"===n)return r.current.top>0;if("down"===n){const t=(u.currentPageTotalHeight||0)-e.viewportInnerSize.height-(e.hasScrollX?e.scrollbarSize:0);return r.current.top<t}return!1},style:p,handleDragOver:h}))}const sl=xe(function(t,n){const{scrollDirection:r,getCanScrollMore:o,style:s,handleDragOver:l}=t,u=Je(),[c,d]=e.useState(o),p=Xe(),h=a({},p,{scrollDirection:r}),f=(e=>{const{scrollDirection:t,classes:n}=e;return ie({root:["scrollArea",`scrollArea--${t}`]},_r,n)})(h);return Yr(u,"scrollPositionChange",()=>{d(o)}),c?i.jsx(nl,{ref:n,className:f.root,ownerState:h,onDragOver:l,style:s}):null}),al=Nr(function(t){const n=Je(),[r,o]=e.useState("none");return Yr(n,"columnHeaderDragStart",()=>o("horizontal")),Yr(n,"columnHeaderDragEnd",()=>o("none")),Yr(n,"rowDragStart",()=>o("vertical")),Yr(n,"rowDragEnd",()=>o("none")),"none"===r?null:"horizontal"===r?i.jsx(ol,a({},t)):i.jsx(il,a({},t))}),ll=e.createContext(void 0);function ul(){const t=e.useContext(ll);if(void 0===t)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join("\n"));return t}const cl=()=>{};function dl(t,n,r){const o=e.useRef(!0);oe(()=>{o.current=!1,t.current.register(r,n)},[t,r,n]),o.current&&t.current.register(r,n)}function pl(t,n){const r=e.useRef(null);if(r.current)return r.current;const o=t.current.getLogger(n);return r.current=o,o}const hl=(e,t,n,r,o)=>{const i=pl(e,"useNativeEventListener");Zr(e,"rootMount",()=>{const e=t();if(e&&n)return i.debug(`Binding native ${n} event`),e.addEventListener(n,r,o),()=>{i.debug(`Clearing native ${n} event`),e.removeEventListener(n,r,o)}})};function fl(t){const n=e.useRef(!0);n.current&&(n.current=!1,t())}const gl=Xn(e=>e.pivoting),ml=Kn(gl,e=>e?.active),bl=new Map,vl=Kn(gl,e=>e?.initialColumns||bl),wl=(e,t)=>{const n=so(e,cr),r=so(e,Ss),o=so(e,Sr),i=so(e,oi),s=0===n&&0===o,a=so(e,dr),l=so(e,ml),u=!a&&s,c=!a&&n>0&&0===r;let d=null,p=null;return u&&(d="noRowsOverlay"),!a&&0===i.length&&(d="noColumnsOverlay"),u&&l&&(d="emptyPivotOverlay"),c&&(d="noResultsOverlay"),a&&(d="loadingOverlay",p=t.slotProps?.loadingOverlay?.[s?"noRowsVariant":"variant"]??(s?"skeleton":"linear-progress")),{overlayType:d,loadingOverlayVariant:p}},yl=Xn(e=>e.columnMenu);const xl=Nr(function(){const e=ul(),t=Xe(),n=so(e,oi),r=so(e,Ps),o=so(e,ps),s=so(e,qs),l=so(e,()=>null===Ks(e)),u=so(e,Xs),c=so(e,Bs),d=so(e,Ws),p=so(e,Xa),h=so(e,yl),f=so(e,ni),g=so(e,qa),m=!(null===u&&null===s&&l),b=e.current.columnHeadersContainerRef;return i.jsx(t.slots.columnHeaders,a({ref:b,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:u,columnHeaderFocus:c,columnGroupHeaderFocus:d,headerGroupingMaxDepth:p,columnMenuState:h,columnVisibility:f,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:m},t.slotProps?.columnHeaders))}),Cl=ue("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),Sl=ue("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n,loadingOverlayVariant:r,overlayType:o}=e,i="skeleton"===r||"noColumnsOverlay"===o;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],i&&t["main--hiddenContent"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),Ml=xe((e,t)=>{const{ownerState:n}=e,r=Xe(),o=Oi().hooks.useGridAriaAttributes();return i.jsxs(Sl,a({ownerState:n,className:e.className,tabIndex:-1},o,r.slotProps?.main,{ref:t,children:[i.jsx(Cl,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),Rl=ue("div")({position:"sticky",zIndex:40,top:0});function Il(e){const t=ie({root:["topContainer"]},_r,{});return i.jsx(Rl,a({},e,{className:O(t.root,Vr["container--top"]),role:"presentation"}))}const Pl=ue("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),kl=xe(function(e,t){const n=Xe(),r=!n.autoHeight&&"auto"===e.style?.minHeight,o=((e,t)=>{const{classes:n}=e;return ie({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},_r,n)})(n,r),s={classes:n.classes,overflowedContent:r};return i.jsx(Pl,a({},e,{ownerState:s,className:O(o.root,e.className),ref:t}))}),El=ue("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),Tl=ue("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:ct.cell.background.pinned}),Dl=ue(Tl)({left:0}),Fl=ue(Tl)({right:0}),Al=ue("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});const Ol=Nr(function({rowsLength:e}){const t=Je(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:s,scrollbarSize:a,leftPinnedWidth:l,rightPinnedWidth:u}=so(t,Qn),c=o?a:0,d=n.height-r.height>0;return 0!==c||d?i.jsxs(El,{className:Vr.filler,role:"presentation",style:{height:c,"--rowBorderColor":0===e?"transparent":"var(--DataGrid-rowBorderColor)"},children:[l>0&&i.jsx(Dl,{className:Vr["filler--pinnedLeft"],style:{width:l}}),i.jsx(Al,{}),u>0&&i.jsx(Fl,{className:Vr["filler--pinnedRight"],style:{width:u+(s?a:0)}})]}):null}),Hl=["className"],$l=ue("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone"})({position:"absolute",display:"flex",flexDirection:"column"}),zl=xe(function(e,t){const{className:n}=e,r=s(e,Hl),o=ul(),l=Xe(),u=(e=>{const{classes:t}=e;return ie({root:["virtualScrollerRenderZone"]},_r,t)})(l),c=o.current.virtualizer.api.getters.getOffsetTop();return i.jsx($l,a({className:O(u.root,n),ownerState:l,style:{transform:`translate3d(0, ${c}px, 0)`}},r,{ref:t}))}),Ll={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},jl=Xn(e=>e.editRows),Nl=Kn(jl,(e,{rowId:t,editMode:n})=>n===Fo.Row&&Boolean(e[t])),Gl=Kn(jl,(e,{rowId:t,field:n})=>e[t]?.[n]??null),_l=Xn(e=>e.preferencePanel),Vl=Kn(_l,(e,t)=>!(!e.open||e.labelId!==t));var Bl=function(e){return e.filters="filters",e.columns="columns",e.aiAssistant="aiAssistant",e}(Bl||{});const Wl={initialize:function(e){return{colspanMap:new Map}},use:function(e,t,n){const r=t.colspan?.getColspan,o=y(r?(t,n,o,i)=>{for(let s=n;s<o;s+=1){const a=Ul(e.state.colspanMap,s,t,n,o,i,r);a.colSpan>1&&(s+=a.colSpan-1)}}:()=>{});return n.calculateColSpan=o,{resetColSpan:()=>{e.state.colspanMap=new Map},getCellColSpanInfo:(t,n)=>e.state.colspanMap.get(t)?.[n],calculateColSpan:o}},selectors:{}};function Ul(e,t,n,r,o,i,s){const a=i.length,l=i[t],u=s(n,l,t);if(!u||1===u)return Kl(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:1,width:l.computedWidth}}),{colSpan:1};let c=l.computedWidth;for(let d=1;d<u;d+=1){const s=t+d;if(s>=r&&s<o){c+=i[s].computedWidth,Kl(e,n,t+d,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(t+u,a-1),leftVisibleCellIndex:t})}Kl(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:u,width:c}})}return{colSpan:u}}function Kl(e,t,n,r){let o=e.get(t);o||(o={},e.set(t,o)),o[n]=r}function ql(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(!ql(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;for(let e=0;e<n.length;e+=1){const r=n[e];if(!ql(r[1],t.get(r[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let e=0;e<r;e+=1)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let o=0;o<r;o+=1){const r=n[o];if(!ql(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Xl(e,t){return Math.round(e*10**t)/10**t}const Yl={EMPTY:{width:0,height:0},equals:(e,t)=>e.width===t.width&&e.height===t.height},Ql={EMPTY:{top:[],bottom:[]}},Zl={EMPTY:{left:[],right:[]}};let Jl=function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e}({});(Jl||(Jl={})).forDelta=function(e,t){return 0===e&&0===t?Jl.NONE:Math.abs(t)>=Math.abs(e)?t>0?Jl.DOWN:Jl.UP:e>0?Jl.RIGHT:Jl.LEFT};const eu={isReady:!1,root:Yl.EMPTY,viewportOuterSize:Yl.EMPTY,viewportInnerSize:Yl.EMPTY,contentSize:Yl.EMPTY,minimumSize:Yl.EMPTY,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topContainerHeight:0,bottomContainerHeight:0},tu={rootSize:e=>e.rootSize,dimensions:e=>e.dimensions,rowHeight:e=>e.dimensions.rowHeight,contentHeight:e=>e.dimensions.contentSize.height,rowsMeta:e=>e.rowsMeta,columnPositions:Dn((e,t)=>{const n=[];let r=0;for(let o=0;o<t.length;o+=1)n.push(r),r+=t[o].computedWidth;return n}),needsHorizontalScrollbar:e=>e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width},nu={initialize:function(e){const t=a({},eu,e.dimensions),{rowCount:n}=e,{rowHeight:r}=t,o={currentPageTotalHeight:n*r,positions:Array.from({length:n},(e,t)=>t*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0};return{rootSize:Yl.EMPTY,dimensions:t,rowsMeta:o,rowHeights:new Map}},use:function(t,n,r){const o=e.useRef(!0),{refs:i,dimensions:{rowHeight:s,columnsTotalWidth:a,leftPinnedWidth:l,rightPinnedWidth:u,topPinnedHeight:c,bottomPinnedHeight:d},onResize:p}=n,h=e.useCallback(e=>{if(e&&(o.current=!1),o.current)return;const r=i.container.current,h=tu.rootSize(t.state),f=tu.rowsMeta(t.state),g=function(e,t){if(void 0!==t)return t;if(null===e)return 0;const n=ru.get(e);if(void 0!==n)return n;const r=ce(e).createElement("div");r.style.width="99px",r.style.height="99px",r.style.position="absolute",r.style.overflow="scroll",r.className="scrollDiv",e.appendChild(r);const o=r.offsetWidth-r.clientWidth;return e.removeChild(r),ru.set(e,o),o}(r,n.dimensions.scrollbarSize),m=c+f.pinnedTopRowsTotalHeight,b=d+f.pinnedBottomRowsTotalHeight,v={width:a,height:Xl(f.currentPageTotalHeight,1)};let w,y,x=!1,C=!1;if(n.autoHeight)C=!1,x=Math.round(a)>Math.round(h.width),w={width:h.width,height:m+b+v.height},y={width:Math.max(0,w.width-(C?g:0)),height:Math.max(0,w.height-(x?g:0))};else{w={width:h.width,height:h.height},y={width:Math.max(0,w.width),height:Math.max(0,w.height-m-b)};const e=v,t=y,n=e.width>t.width,r=e.height>t.height;(n||r)&&(C=r,x=e.width+(C?g:0)>t.width,x&&(C=e.height+g>t.height)),C&&(y.width-=g),x&&(y.height-=g)}n.disableHorizontalScroll&&(x=!1),n.disableVerticalScroll&&(C=!1);const S=Math.max(w.width,a+(C?g:0)),M={isReady:!0,root:h,viewportOuterSize:w,viewportInnerSize:y,contentSize:v,minimumSize:{width:a,height:m+v.height+b},hasScrollX:x,hasScrollY:C,scrollbarSize:g,rowWidth:S,rowHeight:s,columnsTotalWidth:a,leftPinnedWidth:l,rightPinnedWidth:u,topContainerHeight:m,bottomContainerHeight:b};ql(t.state.dimensions,M)||(t.update({dimensions:M}),p?.(M.root))},[t,i.container,n.dimensions.scrollbarSize,n.autoHeight,n.disableHorizontalScroll,n.disableVerticalScroll,p,s,a,l,u,c,d]),{resizeThrottleMs:f}=n,g=y(h),m=e.useMemo(()=>f>0?function(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function i(...e){r=e,void 0===n&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}(g,f):void 0,[f,g]);e.useEffect(()=>m?.clear,[m]),oe(h,[h]);const b=function(t,n,r){const o=t.state.rowHeights,{rows:i,getRowHeight:s,getRowSpacing:a,getEstimatedRowHeight:l}=n,u=e.useRef(-1),c=e.useRef(!1),d=e.useRef(!1),p=n.pinnedRows,h=_n(t,tu.rowHeight),f=y(e=>{let n=o.get(e);return void 0===n&&(n={content:t.state.dimensions.rowHeight,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},o.set(e,n)),n}),{applyRowHeight:g}=n,m=e.useCallback(e=>{const n=tu.dimensions(t.state),r=n.rowHeight,o=f(e.id);if(s){const t=s(e);if("auto"===t){if(o.needsFirstMeasurement){const t=l?l(e):r;o.content=t??r}c.current=!0,o.autoHeight=!0}else o.content=t??n.rowHeight,o.needsFirstMeasurement=!1,o.autoHeight=!1}else o.content=r,o.needsFirstMeasurement=!1;if(a){const t=a(e);o.spacingTop=t.top??0,o.spacingBottom=t.bottom??0}else o.spacingTop=0,o.spacingBottom=0;return g?.(o,e),o},[t,s,f,l,h,a,g]),b=e.useCallback(()=>{c.current=!1;const e=p?.top.reduce((e,t)=>{const n=m(t);return e+n.content+n.spacingTop+n.spacingBottom+n.detail},0)??0,n=p?.bottom.reduce((e,t)=>{const n=m(t);return e+n.content+n.spacingTop+n.spacingBottom+n.detail},0)??0,o=[],s=i.reduce((e,t)=>{o.push(e);const n=m(t);return e+(n.content+n.spacingTop+n.spacingBottom+n.detail)},0);c.current||(u.current=1/0);const a=e!==t.state.rowsMeta.pinnedTopRowsTotalHeight||n!==t.state.rowsMeta.pinnedBottomRowsTotalHeight||s!==t.state.rowsMeta.currentPageTotalHeight,l={currentPageTotalHeight:s,positions:o,pinnedTopRowsTotalHeight:e,pinnedBottomRowsTotalHeight:n};t.set("rowsMeta",l),a&&r(),d.current=!0},[t,p,i,m,r]),v=y(b),w=e=>o.get(e)?.content??tu.rowHeight(t.state),x=(e,t)=>{const n=f(e),r=n.content!==t;n.needsFirstMeasurement=!1,n.content=t,d.current&&=!r},C=e=>o.get(e)?.autoHeight??!1,S=()=>u.current,M=e=>{c.current&&e>u.current&&(u.current=e)},R=()=>{o.clear(),b()},I=ee(()=>"undefined"==typeof ResizeObserver?void 0:new ResizeObserver(e=>{for(let t=0;t<e.length;t+=1){const r=e[t],o=r.borderBoxSize&&r.borderBoxSize.length>0?r.borderBoxSize[0].blockSize:r.contentRect.height,i=r.target.__mui_id,s=n.focusedVirtualCell?.()?.id;if(s===i&&0===o)return;x(i,o)}d.current||requestAnimationFrame(()=>{v()})})).current,P=(e,t)=>(e.__mui_id=t,I?.observe(e),()=>I?.unobserve(e));return oe(()=>{b()},[b]),{getRowHeight:w,setLastMeasuredRowIndex:M,storeRowHeightMeasurement:x,hydrateRowsMeta:b,observeRowHeight:P,rowHasAutoHeight:C,getRowHeightEntry:f,getLastMeasuredRowIndex:S,resetRowHeights:R}}(t,n,h);return{updateDimensions:h,debouncedUpdateDimensions:m,rowsMeta:b}},selectors:tu};const ru=new WeakMap;const ou=("undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"empty").includes("firefox"),iu="undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent),su=(e,t,n)=>Math.max(t,Math.min(n,e)),au={top:0,left:0},lu=Object.freeze(new Map),uu={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},cu={store:En(e=>e.virtualization),renderContext:En(e=>e.virtualization.renderContext),enabledForRows:En(e=>e.virtualization.enabledForRows),enabledForColumns:En(e=>e.virtualization.enabledForColumns)},du={initialize:function(e){return{virtualization:a({enabled:!iu,enabledForRows:!iu,enabledForColumns:!iu,renderContext:uu},e.initialState?.virtualization),getters:null}},use:function(t,r,o){const{refs:i,dimensions:{rowHeight:s,columnsTotalWidth:l},virtualization:{isRtl:u=!1,rowBufferPx:c=150,columnBufferPx:d=150},colspan:p,initialState:h,rows:f,range:g,columns:m,pinnedRows:b=Ql.EMPTY,pinnedColumns:v=Zl.EMPTY,minimalContentHeight:w,autoHeight:x,onWheel:C,onTouchMove:S,onRenderContextChange:M,onScrollChange:R,scrollReset:I,renderRow:P,renderInfiniteLoadingTrigger:k}=r,E=_n(t,nu.selectors.needsHorizontalScrollbar),T=b.bottom.length>0,[D,F]=e.useState(lu),A=e.useRef(!1),O=e.useRef(!1),H=_n(t,cu.renderContext),$=_n(t,cu.enabledForRows),z=_n(t,cu.enabledForColumns),L=_n(t,nu.selectors.rowsMeta),j=_n(t,nu.selectors.contentHeight),N=e.useRef(h?.scroll??au),G=e.useRef(!1),_=e.useRef(au),V=e.useRef(uu),B=se(),W=e.useRef(void 0),U=ee(()=>function(e,t,n,r,o){return{direction:Jl.NONE,buffer:wu(e,Jl.NONE,t,n,r,o)}}(u,c,d,15*s,300)).current,K=e.useCallback(e=>{bu(e,t.state.virtualization.renderContext)||t.set("virtualization",a({},t.state.virtualization,{renderContext:e}));const n=nu.selectors.dimensions(t.state).isReady,r=e.firstRowIndex!==V.current.firstRowIndex||e.lastRowIndex!==V.current.lastRowIndex;n&&r&&(V.current=e,M?.(e)),_.current=N.current},[t,M]),q=y(()=>{const e=i.scroller.current;if(!e)return;const a=nu.selectors.dimensions(t.state),l=Math.ceil(a.contentSize.height-a.viewportInnerSize.height),p=Math.ceil(a.contentSize.width-a.viewportInnerSize.width),h={top:su(e.scrollTop,0,l),left:u?su(e.scrollLeft,-Math.abs(p),0):su(e.scrollLeft,0,p)},f=h.left-N.current.left,g=h.top-N.current.top,m=0!==f||0!==g;N.current=h;const b=m?Jl.forDelta(f,g):Jl.NONE,v=Math.abs(N.current.top-_.current.top),w=Math.abs(N.current.left-_.current.left),y=v>=s||w>=50,x=U.direction!==b;if(!(y||x))return H;if(x)switch(b){case Jl.NONE:case Jl.LEFT:case Jl.RIGHT:W.current=void 0;break;default:W.current=H}U.direction=b,U.buffer=wu(u,b,c,d,15*s,300);const C=hu(pu(t,r,o,$,z),N.current,U);return bu(C,H)||(n.flushSync(()=>{K(C)}),B.start(1e3,q)),C}),X=()=>{if(!nu.selectors.dimensions(t.state).isReady&&($||z))return;const e=hu(pu(t,r,o,$,z),N.current,U);W.current=void 0,K(e)},Y=y(X);Bn(t,nu.selectors.dimensions,(e,t)=>{t.isReady&&X()}),oe(()=>{A.current&&(X(),A.current=!1)});const Q=y(()=>{if(G.current)return void(G.current=!1);const e=q();e&&R?.(N.current,e)}),Z=e.useMemo(()=>({overflowX:E?void 0:"hidden",overflowY:x?"hidden":void 0}),[E,x]),J=e.useMemo(()=>{const e={width:E?l:"auto",flexBasis:j,flexShrink:0};return 0===e.flexBasis&&(e.flexBasis=w),e},[l,j,E,w]),te=e.useRef(null),ne=e.useCallback(e=>{e&&te.current?.(l,j)},[l,j]);oe(()=>{O.current&&Y()},[z,$,Y]),oe(()=>{i.scroller.current&&(i.scroller.current.scrollLeft=0)},[i.scroller,I]),((t,n)=>{const r=e.useRef(!1);oe(()=>r.current||!t?cl:(r.current=!0,n()),[r.current||t])})(H!==uu,()=>{if(R?.(N.current,H),O.current=!0,h?.scroll&&i.scroller.current){const e=i.scroller.current,{top:t,left:n}=h.scroll,r={top:!(t>0),left:!(n>0)};!r.left&&l&&(e.scrollLeft=n,r.left=!0,G.current=!0),!r.top&&j&&(e.scrollTop=t,G.current=!0),r.top&&r.left||(te.current=(o,i)=>{!r.left&&o&&(e.scrollLeft=n,r.left=!0,G.current=!0),!r.top&&i&&(e.scrollTop=t,r.top=!0,G.current=!0),r.left&&r.top&&(te.current=null)})}}),Bn(t,nu.selectors.dimensions,X);const re=e=>t=>{t&&i[e].current!==t&&(i[e].current=t)},ie=e.useRef(!0),ae=e.useRef(void 0),le=y(e=>{if(!e)return void ae.current?.();i.container.current=e;const n=function(e,t,n){if(!e)return;const r=e.getBoundingClientRect(),o={width:Xl(r.width,1),height:Xl(r.height,1)};if(t.state.rootSize!==Yl.EMPTY&&Yl.equals(o,t.state.rootSize)||n(o),"undefined"==typeof ResizeObserver)return;const i=new ResizeObserver(([e])=>{if(!e)return;const r={width:Xl(e.contentRect.width,1),height:Xl(e.contentRect.height,1)};Yl.equals(r,t.state.rootSize)||n(r)});return i.observe(e),()=>{i.disconnect()}}(e,t,e=>{0===e.width&&0===e.height&&0!==t.state.rootSize.height&&0!==t.state.rootSize.width||(t.state.rootSize=e,ie.current||!o.debouncedUpdateDimensions?(o.updateDimensions(ie.current),ie.current=!1):o.debouncedUpdateDimensions())});return ae.current=()=>{n?.(),i.container.current=null},ye>=19?ae.current:void 0}),ue=e.useRef(void 0),ce=y(e=>{if(!e)return void ue.current?.();ue.current?.(),i.scroller.current=e;const t={passive:!0};return e.addEventListener("scroll",Q,t),e.addEventListener("wheel",C,t),e.addEventListener("touchmove",S,t),ue.current=()=>{e.removeEventListener("scroll",Q,t),e.removeEventListener("wheel",C,t),e.removeEventListener("touchmove",S,t),i.scroller.current=null},ye>=19?ue.current:void 0}),de=y(re("scrollbarVertical")),pe=y(re("scrollbarHorizontal")),he={setPanels:F,getOffsetTop:()=>L.positions[H.firstRowIndex]??0,getRows:(e={},n)=>{if(!e.rows&&!g)return[];let i=H;e.renderContext&&(i=e.renderContext,i.firstColumnIndex=H.firstColumnIndex,i.lastColumnIndex=H.lastColumnIndex);const s=!T&&void 0===e.position||T&&"bottom"===e.position,a=void 0!==e.position;let u;switch(e.position){case"top":u=0;break;case"bottom":u=b.top.length+f.length;break;default:u=b.top.length}const c=e.rows??f,d=i.firstRowIndex,h=Math.min(i.lastRowIndex,c.length),w=e.rows?yu(0,e.rows.length):yu(d,h);let y=-1;const x=r.focusedVirtualCell?.();!a&&x&&(x.rowIndex<d&&(w.unshift(x.rowIndex),y=x.rowIndex),x.rowIndex>h&&(w.push(x.rowIndex),y=x.rowIndex));const C=[],S=nu.selectors.columnPositions(t.state,m);return w.forEach(t=>{const{id:r,model:d}=c[t];if(n&&!n[r])return;const h=(g?.firstRowIndex||0)+u+t;if(p?.enabled){const e=v.left.length,t=m.length-v.right.length;o.calculateColSpan(r,e,t,m),v.left.length>0&&o.calculateColSpan(r,0,v.left.length,m),v.right.length>0&&o.calculateColSpan(r,m.length-v.right.length,m.length,m)}const b=o.rowsMeta.rowHasAutoHeight(r)?"auto":o.rowsMeta.getRowHeight(r);let w=!1;void 0===e.position&&(w=0===t);let M=!1;const R=t===c.length-1;s&&(a?M=R:t===f.length-1&&(M=!0));let I=i;W.current&&t>=W.current.firstRowIndex&&t<W.current.lastRowIndex&&(I=W.current);const E=t===y,T=x?.rowIndex===h,F=vu(S,I,v.left.length),A=R&&"top"===e.position,O=I.firstColumnIndex,H=I.lastColumnIndex;if(C.push(P({id:r,model:d,rowIndex:h,offsetLeft:F,columnsTotalWidth:l,baseRowHeight:b,firstColumnIndex:O,lastColumnIndex:H,focusedColumnIndex:T?x.columnIndex:void 0,isFirstVisible:w,isLastVisible:M,isVirtualFocusRow:E,showBottomBorder:A})),E)return;const $=D.get(r);$&&C.push($),void 0===e.position&&R&&C.push(k(r))}),C},rows:r.rows,getContainerProps:()=>({ref:le}),getScrollerProps:()=>({ref:ce,style:Z,role:"presentation",tabIndex:ou?-1:void 0}),getContentProps:()=>({ref:ne,style:J,role:"presentation"}),getScrollbarVerticalProps:()=>({ref:de,scrollPosition:N}),getScrollbarHorizontalProps:()=>({ref:pe,scrollPosition:N}),getScrollAreaProps:()=>({scrollPosition:N})};return{getters:he,useVirtualization:()=>_n(t,e=>e),setPanels:F,forceUpdateRenderContext:X,scheduleUpdateRenderContext:()=>{A.current=!0},getCellColSpanInfo:()=>{throw new Error("Unimplemented: colspan feature is required")},calculateColSpan:()=>{throw new Error("Unimplemented: colspan feature is required")},getHiddenCellsOrigin:()=>{throw new Error("Unimplemented: rowspan feature is required")}}},selectors:cu};function pu(e,t,n,r,o){const i=nu.selectors.dimensions(e.state),s=t.rows,a=t.range,l=t.columns,u=n.getHiddenCellsOrigin(),c=t.rows.at(-1)?.id,d=l.at(-1);return{api:n,enabledForRows:r,enabledForColumns:o,autoHeight:t.autoHeight,rowBufferPx:t.virtualization.rowBufferPx,columnBufferPx:t.virtualization.columnBufferPx,leftPinnedWidth:i.leftPinnedWidth,columnsTotalWidth:i.columnsTotalWidth,viewportInnerWidth:i.viewportInnerSize.width,viewportInnerHeight:i.viewportInnerSize.height,lastRowHeight:void 0!==c?n.rowsMeta.getRowHeight(c):0,lastColumnWidth:d?.computedWidth??0,rowsMeta:nu.selectors.rowsMeta(e.state),columnPositions:nu.selectors.columnPositions(e.state,t.columns),rows:s,range:a,pinnedColumns:t.pinnedColumns,columns:l,hiddenCellsOriginMap:u,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function hu(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.columns.length},{top:o,left:i}=t,s=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let t=Math.min(fu(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const n=e.hiddenCellsOriginMap[t];if(n){const e=Math.min(...Object.values(n));t=Math.min(t,e)}const i=e.autoHeight?t+e.rows.length:fu(e,o+e.viewportInnerHeight);r.firstRowIndex=t,r.lastRowIndex=i}if(e.enabledForColumns){let t=0,o=e.columnPositions.length,i=!1;const[a,l]=mu({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let n=a;n<l&&!i;n+=1){const t=e.rows[n];i=e.api.rowsMeta.rowHasAutoHeight(t.id)}i&&!e.virtualizeColumnsWithAutoRowHeight||(t=gu(s,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),o=gu(s+e.viewportInnerWidth,e.columnPositions)),r.firstColumnIndex=t,r.lastColumnIndex=o}const a=function(e,t,n){const[r,o]=mu({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,s]=mu({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns?.left.length??0,maxLastIndex:e.columns.length-(e.pinnedColumns?.right.length??0),bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),a=function({api:e,firstColumnToRender:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=t,s=!1;for(;!s&&i>=0;){s=!0;for(let t=n;t<r;t+=1){if(o[t]){const n=o[t].id,r=e.getCellColSpanInfo(n,i);if(r&&r.spannedByColSpan&&r.leftVisibleCellIndex<i){i=r.leftVisibleCellIndex,s=!1;break}}}}return i}({api:e.api,firstColumnToRender:i,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:a,lastColumnIndex:s}}(e,r,n);return a}function fu(e,t,n){const r=e.api.rowsMeta.getLastMeasuredRowIndex();let o=r===1/0;e.range?.lastRowIndex&&!o&&(o=r>=e.range.lastRowIndex);const i=su(r-(e.range?.firstRowIndex||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?gu(t,e.rowsMeta.positions,n):function(e,t,n,r){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return gu(e,t,r,Math.floor(n/2),Math.min(n,t.length))}(t,e.rowsMeta.positions,i,n)}function gu(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),s=t[i];let a;if(n?.atStart){a=e-((i===t.length-1?n.lastPosition:t[i+1])-s)<s}else a=e<=s;return a?gu(e,t,n,r,i):gu(e,t,n,i+1,o)}function mu({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:r,minFirstIndex:o,maxLastIndex:i,positions:s,lastSize:a}){const l=s[e]-n,u=s[t]+r,c=gu(l,s,{atStart:!0,lastPosition:s[s.length-1]+a}),d=gu(u,s);return[su(c,o,i),su(d,o,i)]}function bu(e,t){return e===t||e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function vu(e,t,n){const r=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(r)}function wu(e,t,n,r,o,i){if(e)switch(t){case Jl.LEFT:t=Jl.RIGHT;break;case Jl.RIGHT:t=Jl.LEFT}switch(t){case Jl.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case Jl.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:i};case Jl.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:i,columnBefore:0};case Jl.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case Jl.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}function yu(e,t){return Array.from({length:t-e}).map((t,n)=>e+n)}const xu={initialize:function(e){return{}},use:function(e,t,n){return{getViewportPageSize:()=>{const n=nu.selectors.dimensions(e.state);if(!n.isReady)return 0;if(t.getRowHeight){const n=du.selectors.renderContext(e.state),r=n.lastRowIndex-n.firstRowIndex;return Math.min(r-1,t.rows.length)}const r=Math.floor(n.viewportInnerSize.height/n.rowHeight);return Math.min(r,t.rows.length)}}},selectors:{}};const Cu={firstRowIndex:0,lastRowIndex:0},Su={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},Mu={state:e=>e.rowSpanning,hiddenCells:e=>e.rowSpanning.caches.hiddenCells,spannedCells:e=>e.rowSpanning.caches.spannedCells,hiddenCellsOriginMap:e=>e.rowSpanning.caches.hiddenCellOriginMap},Ru={initialize:function(e){return{rowSpanning:e.initialState?.rowSpanning??{caches:Su,processedRange:Cu}}},use:function(e,t,n){return{getHiddenCellsOrigin:()=>Mu.hiddenCellsOriginMap(e.state)}},selectors:Mu};const Iu=[nu,du,Wl,Ru,xu],Pu=!("undefined"!=typeof window&&/jsdom|HappyDOM/.test(window.navigator.userAgent)),ku=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return a({},e,{virtualization:{enabled:!n&&Pu,enabledForColumns:!n&&Pu,enabledForRows:!n&&!r&&Pu,renderContext:uu}})};const Eu=Xn(e=>e.virtualization);Kn(Eu,e=>e.enabled);const Tu=Kn(Eu,e=>e.enabledForColumns);Kn(Eu,e=>e.enabledForRows);const Du=Kn(Eu,e=>e.renderContext),Fu=qn(Xn(e=>e.virtualization.renderContext.firstColumnIndex),Xn(e=>e.virtualization.renderContext.lastColumnIndex),(e,t)=>({firstColumnIndex:e,lastColumnIndex:t}));function Au(e){return JSON.stringify([e.filterModel,e.sortModel,e.start,e.end])}class Ou{constructor({ttl:e=3e5,getKey:t=Au}){this.cache={},this.ttl=e,this.getKey=t}set(e,t){const n=this.getKey(e),r=Date.now()+this.ttl;this.cache[n]={value:t,expiry:r}}get(e){const t=this.getKey(e),n=this.cache[t];if(n){if(!(Date.now()>n.expiry))return n.value;delete this.cache[t]}}clear(){this.cache={}}}class Hu extends Error{constructor(e){super(e.message),this.name="GridGetRowsError",this.params=e.params,this.cause=e.cause}}class $u extends Error{constructor(e){super(e.message),this.name="GridUpdateRowError",this.params=e.params,this.cause=e.cause}}const zu="calc(max(var(--DataGrid-scrollbarSize), 14px))",Lu=ue("div")({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":zu}),ju=ue(Lu)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-headersTotalHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-headersTotalHeight)",right:0}),Nu=ue(Lu)({width:"calc(var(--DataGrid-hasScrollX) * (100% - var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:0}),Gu=ue(Lu)({width:"var(--size)",height:"var(--size)",right:0,bottom:0,overflow:"scroll","@media print":{display:"none"}}),_u=xe(function(t,n){const r=ul(),o=Xe(),s=e.useRef(!1),a=e.useRef(0),l=e.useRef(null),u=((e,t)=>{const{classes:n}=e;return ie({root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]},_r,n)})(o,t.position),c=so(r,Qn),d="vertical"===t.position?"height":"width",p="vertical"===t.position?"scrollTop":"scrollLeft",h="vertical"===t.position?"top":"left",f="horizontal"===t.position?c.minimumSize.width:c.minimumSize.height-c.headersTotalHeight,g=y(()=>{const e=l.current,n=t.scrollPosition.current;e&&n[h]!==a.current&&(a.current=n[h],s.current?s.current=!1:(s.current=!0,e[p]=t.scrollPosition.current[h]))}),m=y(()=>{const e=r.current.virtualScrollerRef.current,t=l.current;t&&(s.current?s.current=!1:(s.current=!0,e[p]=t[p]))});te(()=>{const e=r.current.virtualScrollerRef.current,t=l.current,n={passive:!0};return e.addEventListener("scroll",g,n),t.addEventListener("scroll",m,n),()=>{e.removeEventListener("scroll",g,n),t.removeEventListener("scroll",m,n)}});const b="vertical"===t.position?ju:Nu,v=e.useMemo(()=>({[d]:`${f}px`}),[d,f]);return i.jsx(b,{ref:A(n,l),className:u.root,tabIndex:-1,"aria-hidden":"true",onFocus:e=>{e.target.blur()},children:i.jsx("div",{className:u.content,style:v})})}),Vu=ue("div",{name:"MuiDataGrid",slot:"ScrollShadow",overridesResolver:(e,t)=>[t.root,t[e.position]]})(({theme:e})=>({position:"absolute",inset:0,pointerEvents:"none",transition:ct.transition(["box-shadow"],{duration:ct.transitions.duration.short}),"--length":"dark"===e.palette.mode?"8px":"6px","--length-inverse":"calc(var(--length) * -1)","--opacity":"dark"===e.palette.mode?"0.7":"0.18","--blur":"var(--length)","--spread":"calc(var(--length) * -1)","--color":"0, 0, 0","--color-start":"rgba(var(--color), calc(var(--hasScrollStart) * var(--opacity)))","--color-end":"rgba(var(--color), calc(var(--hasScrollEnd) * var(--opacity)))",variants:[{props:{position:"vertical"},style:{top:"var(--DataGrid-topContainerHeight)",bottom:"calc(var(--DataGrid-bottomContainerHeight) + var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))",boxShadow:"inset 0 var(--length) var(--blur) var(--spread) var(--color-start), inset 0 var(--length-inverse) var(--blur) var(--spread) var(--color-end)"}},{props:{position:"horizontal"},style:{left:"var(--DataGrid-leftPinnedWidth)",right:"calc(var(--DataGrid-rightPinnedWidth) + var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",boxShadow:"inset var(--length) 0 var(--blur) var(--spread) var(--color-start), inset var(--length-inverse) 0 var(--blur) var(--spread) var(--color-end)"}}]}));function Bu(t){const{position:n}=t,r={classes:Xe().classes,position:n},o=(e=>{const{classes:t,position:n}=e;return ie({root:["scrollShadow",`scrollShadow--${n}`]},_r,t)})(r),s=e.useRef(null),a=ul(),l=so(a,er),u=so(a,tr),c=so(a,Cr),d=so(a,si),p="vertical"===n?u&&c?.bottom?.length>0:l&&void 0!==d?.right?.length&&d?.right?.length>0,h=ae(),f=e.useCallback(e=>{if(!s.current)return;const t=Math.abs(Math.round(e)),r=Qn(a),o=Math.round(r.contentSize["vertical"===n?"height":"width"]-r.viewportInnerSize["vertical"===n?"height":"width"]),i="vertical"===n?c?.top?.length>0:void 0!==d?.left?.length&&d?.left?.length>0,l="vertical"===n?c?.bottom?.length>0:void 0!==d?.right?.length&&d?.right?.length>0,u=h?t<o:t>0,p=h?t>0:t<o;s.current.style.setProperty("--hasScrollStart",i&&u?"1":"0"),s.current.style.setProperty("--hasScrollEnd",l&&p?"1":"0")},[c,d,h,n,a]);return Yr(a,"scrollPositionChange",e=>{f(e["vertical"===n?"top":"left"])}),Yr(a,"columnResizeStop",()=>{"horizontal"===n&&f(a.current.virtualScrollerRef?.current?.scrollLeft||0)}),e.useEffect(()=>{f(("horizontal"===n?a.current.virtualScrollerRef?.current?.scrollLeft:a.current.virtualScrollerRef?.current?.scrollTop)??0)},[f,a,n]),i.jsx(Vu,{className:o.root,ownerState:r,ref:s,style:{"--hasScrollStart":0,"--hasScrollEnd":p?"1":"0"}})}const Wu=ue("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e&&"right"!==e})(({overlayType:e,loadingOverlayVariant:t,right:n})=>"skeleton"!==t?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,right:`${n}px`,width:0,height:0,zIndex:"loadingOverlay"===e?5:4}:{}),Uu=ue("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>"overlayType"!==e&&"loadingOverlayVariant"!==e})({});function Ku(e){const t=Je(),n=Xe(),r=so(t,Qn);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);0===o&&(o=Hr);const s=(e=>{const{classes:t}=e;return ie({root:["overlayWrapper"],inner:["overlayWrapperInner"]},_r,t)})(a({},e,{classes:n.classes}));return i.jsx(Wu,a({className:s.root},e,{right:r.columnsTotalWidth-r.viewportOuterSize.width,children:i.jsx(Uu,a({className:s.inner,style:{height:o,width:r.viewportOuterSize.width}},e))}))}const qu=(e,t)=>ca(e),Xu=(e,t)=>so(e,ca),Yu=qn(Kn(Vs,Du,ca,oi,(e,t,n,r)=>{if(!e)return!1;const o=n.rowIdToIndexMap.get(e.id),i=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(t=>t.field===e.field);return!(void 0!==o&&-1!==i&&o>=t.firstRowIndex&&o<=t.lastRowIndex)}),oi,ca,Vs,(e,t,n,r)=>{if(!e)return null;const o=n.rowIdToIndexMap.get(r.id);if(void 0===o)return null;const i=t.findIndex(e=>e.field===r.field);return-1===i?null:a({},r,{rowIndex:o,columnIndex:i})}),Qu={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:"\t",columnBufferPx:150,columnFilterDebounceMs:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableRowSelectionExcludeModel:!1,disableVirtualization:!1,editMode:Fo.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rows:[],rowSelection:!0,rowSpacingType:"margin",rowSpanning:!1,showCellVerticalBorder:!1,showColumnVerticalBorder:!1,showToolbar:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,virtualizeColumnsWithAutoRowHeight:!1,tabNavigation:"none"};function Zu(e){return(Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ju(e){var t=function(e,t){if("object"!=Zu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Zu(t)?t:t+""}const ec=(t,n,r,o=!0)=>{const i=e.useRef(null),s=e.useRef(`mui-${Math.round(1e9*Math.random())}`),a=e.useCallback(()=>{i.current=t.current.registerPipeProcessor(n,s.current,r)},[t,r,n]);fl(()=>{o&&a()});const l=e.useRef(!0);e.useEffect(()=>(l.current?l.current=!1:o&&a(),()=>{i.current&&(i.current(),i.current=null)}),[a,o])},tc=(t,n,r)=>{const o=e.useRef(null),i=e.useRef(`mui-${Math.round(1e9*Math.random())}`),s=e.useCallback(()=>{o.current=t.current.registerPipeApplier(n,i.current,r)},[t,r,n]);fl(()=>{s()});const a=e.useRef(!0);e.useEffect(()=>(a.current?a.current=!1:s(),()=>{o.current&&(o.current(),o.current=null)}),[s])},nc=(e,t,n)=>{const r=Jn(n),o=cr(n),i=Js(n),s=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return a({},e,{rowsMeta:{currentPageTotalHeight:s*r,positions:Array.from({length:s},(e,t)=>t*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},rc=Kn(oi,ui,(e,t)=>{const n=e.length;return 0===n?0:Xl(t[n-1]+e[n-1].computedWidth,1)}),oc=()=>xn((e,t,n,r,o)=>a({},e,{headerHeight:t,groupHeaderHeight:n,headerFilterHeight:r,headersTotalHeight:o}),{maxSize:1});function ic(){const t=ae(),n=Xe(),r=ul(),{listView:o}=n,s=so(r,oi),l=so(r,Cr),u=ai(r),c=so(r,Ts),d=e.useCallback(e=>c.has(e)&&r.current.isRowSelectable(e),[c,r]),p=Xu(r),h=so(r,pi),f=so(r,sr),g=so(r,nr),{autoHeight:m}=n,b=o,v=so(r,uo),w=zr(n.rowHeight,Qu.rowHeight),x=Math.floor(w*v),C=Math.floor(n.columnHeaderHeight*v),S=Math.floor((n.columnGroupHeaderHeight??n.columnHeaderHeight)*v),M=Math.floor((n.headerFilterHeight??n.columnHeaderHeight)*v),R=so(r,rc),I=tl(r,n),P=u.left.reduce((e,t)=>e+t.computedWidth,0),k=u.right.reduce((e,t)=>e+t.computedWidth,0),E=wl(r,n),T={rowHeight:x,headerHeight:C,columnsTotalWidth:R,leftPinnedWidth:P,rightPinnedWidth:k,topPinnedHeight:I,bottomPinnedHeight:0,scrollbarSize:n.scrollbarSize},D=ee(oc).current,F=so(r,cr),A=so(r,Js),O=Math.min(A.enabled?A.paginationModel.pageSize:F,F),{getRowHeight:H,getEstimatedRowHeight:$,getRowSpacing:z}=n,L=n.slots.row,j=n.slotProps?.row;so(r,Yu);const N=(e=>{const t=ee(()=>new Un(Iu.map(t=>t.initialize(e)).reduce((e,t)=>Object.assign(e,t),{}))).current,n={};for(const r of Iu)Object.assign(n,r.use(t,e,n));return{store:t,api:n}})({refs:{container:r.current.mainElementRef,scroller:r.current.virtualScrollerRef,scrollbarVertical:r.current.virtualScrollbarVerticalRef,scrollbarHorizontal:r.current.virtualScrollbarHorizontalRef},dimensions:T,virtualization:{isRtl:t,rowBufferPx:n.rowBufferPx,columnBufferPx:n.columnBufferPx},colspan:{enabled:h,getColspan:e.useCallback((e,t)=>{if("function"==typeof t.colSpan){const n=r.current.getRow(e),o=r.current.getRowValue(n,t);return t.colSpan(o,n,t,r)??0}return t.colSpan??1},[r])},initialState:{scroll:n.initialState?.scroll,rowSpanning:r.current.state.rowSpanning,virtualization:r.current.state.virtualization},rows:p.rows,range:p.range,rowCount:O,columns:s,pinnedRows:l,pinnedColumns:u,autoHeight:m,disableHorizontalScroll:o,disableVerticalScroll:"noColumnsOverlay"===E.overlayType||"skeleton"===E.loadingOverlayVariant,minimalContentHeight:Hr,getRowHeight:e.useMemo(()=>{if(H)return e=>H(a({},e,{densityFactor:v}))},[H,v]),getEstimatedRowHeight:e.useMemo(()=>$?e=>$(a({},e,{densityFactor:v})):void 0,[$,v]),getRowSpacing:e.useMemo(()=>z?e=>{const t=p.rowIdToIndexMap.get(e.id)??-1,n={isFirstVisible:0===t,isLastVisible:t===p.rows.length-1,indexRelativeToCurrentPage:t};return z(a({},e,n,{indexRelativeToCurrentPage:r.current.getRowIndexRelativeToVisibleRows(e.id)}))}:void 0,[r,z,p.rows,p.rowIdToIndexMap]),applyRowHeight:y((e,t)=>r.current.unstable_applyPipeProcessors("rowHeight",e,t)),virtualizeColumnsWithAutoRowHeight:n.virtualizeColumnsWithAutoRowHeight,focusedVirtualCell:y(()=>Yu(r)),resizeThrottleMs:n.resizeThrottleMs,onResize:y(e=>r.current.publishEvent("resize",e)),onWheel:y(e=>{r.current.publishEvent("virtualScrollerWheel",{},e)}),onTouchMove:y(e=>{r.current.publishEvent("virtualScrollerTouchMove",{},e)}),onRenderContextChange:y(e=>{r.current.publishEvent("renderedRowsIntervalChange",e)}),onScrollChange:e.useCallback((e,t)=>{r.current.publishEvent("scrollPositionChange",{top:e.top,left:e.left,renderContext:t})},[r]),scrollReset:b,renderRow:e.useCallback(e=>i.jsx(L,a({row:e.model,rowId:e.id,index:e.rowIndex,selected:d(e.id),offsetLeft:e.offsetLeft,columnsTotalWidth:R,rowHeight:e.baseRowHeight,pinnedColumns:u,visibleColumns:s,firstColumnIndex:e.firstColumnIndex,lastColumnIndex:e.lastColumnIndex,focusedColumnIndex:e.focusedColumnIndex,isFirstVisible:e.isFirstVisible,isLastVisible:e.isLastVisible,isNotVisible:e.isVirtualFocusRow,showBottomBorder:e.showBottomBorder,scrollbarWidth:f,gridHasFiller:g},j),e.id),[R,g,d,u,L,j,f,s]),renderInfiniteLoadingTrigger:e.useCallback(e=>r.current.getInfiniteLoadingTriggerElement?.({lastRowId:e}),[r])});return fl(()=>{r.current.store.state.dimensions=D(N.store.state.dimensions,C,S,M,I),r.current.store.state.rowsMeta=N.store.state.rowsMeta,r.current.store.state.virtualization=N.store.state.virtualization}),Bn(N.store,nu.selectors.dimensions,(e,t)=>{t.isReady&&r.current.setState(e=>a({},e,{dimensions:D(t,C,S,M,I)}))}),Bn(N.store,nu.selectors.rowsMeta,(e,t)=>{t!==r.current.state.rowsMeta&&r.current.setState(e=>a({},e,{rowsMeta:t}))}),Bn(N.store,du.selectors.store,(e,t)=>{t.renderContext!==uu&&t!==r.current.state.virtualization&&r.current.setState(e=>a({},e,{virtualization:t}))}),r.current.register("private",{virtualizer:N}),(e=>{const t=e.current.virtualizer,{getRowHeight:n,setLastMeasuredRowIndex:r,storeRowHeightMeasurement:o,resetRowHeights:i,hydrateRowsMeta:s,observeRowHeight:a,rowHasAutoHeight:l,getRowHeightEntry:u,getLastMeasuredRowIndex:c}=t.api.rowsMeta;tc(e,"rowHeight",s);const d={hydrateRowsMeta:s,observeRowHeight:a,rowHasAutoHeight:l,getRowHeightEntry:u,getLastMeasuredRowIndex:c};dl(e,{unstable_getRowHeight:n,unstable_setLastMeasuredRowIndex:r,unstable_storeRowHeightMeasurement:o,resetRowHeights:i},"public"),dl(e,d,"private")})(r),N}const sc=ue("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),ac=e=>e.current.state.dimensions.rightPinnedWidth>0;function lc(t){const n=ul(),r=Xe(),o=so(n,tr),s=so(n,er),l=so(n,ac),u=so(n,ar),{overlayType:c,loadingOverlayVariant:d}=wl(n,r),p=r.slots?.[c],h={classes:r.classes,hasScrollX:s,hasPinnedRight:l,overlayType:c,loadingOverlayVariant:d},f=(e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:o,overlayType:i}=e;return ie({root:["main",r&&"main--hasPinnedRight",("skeleton"===o||"noColumnsOverlay"===i)&&"main--hiddenContent"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},_r,t)})(h),g=ic().api.getters,{getContainerProps:m,getScrollerProps:b,getContentProps:v,getScrollbarVerticalProps:w,getScrollbarHorizontalProps:y,getRows:x,getScrollAreaProps:C}=g,S=x(void 0,fr(n));return i.jsxs(Ml,a({className:f.root},m(),{ownerState:h,children:[i.jsx(al,a({scrollDirection:"left"},C())),i.jsx(al,a({scrollDirection:"right"},C())),i.jsx(al,a({scrollDirection:"up"},C())),i.jsx(al,a({scrollDirection:"down"},C())),i.jsxs(sc,a({className:f.scroller},b(),{ownerState:h,children:[i.jsxs(Il,{children:[!r.listView&&i.jsx(xl,{}),i.jsx(r.slots.pinnedRows,{position:"top",virtualScroller:g})]}),c&&i.jsx(Ku,{overlayType:c,loadingOverlayVariant:d,children:i.jsx(p,a({},r.slotProps?.[c]))}),i.jsx(kl,a({},v(),{children:i.jsxs(zl,{role:"rowgroup",children:[S,i.jsx(r.slots.detailPanels,{virtualScroller:g})]})})),u&&i.jsx(Ol,{rowsLength:S.length}),i.jsx(r.slots.bottomContainer,{children:i.jsx(r.slots.pinnedRows,{position:"bottom",virtualScroller:g})})]})),s&&i.jsxs(e.Fragment,{children:[r.pinnedColumnsSectionSeparator?.endsWith("shadow")&&i.jsx(Bu,{position:"horizontal"}),i.jsx(_u,a({position:"horizontal"},y()))]}),o&&i.jsxs(e.Fragment,{children:[r.pinnedRowsSectionSeparator?.endsWith("shadow")&&i.jsx(Bu,{position:"vertical"}),i.jsx(_u,a({position:"vertical"},w()))]}),s&&o&&i.jsx(Gu,{"aria-hidden":"true"}),t.children]}))}function uc(){const e=Xe();return e.hideFooter?null:i.jsx(e.slots.footer,a({},e.slotProps?.footer))}let cc;function dc(){return void 0===cc&&document.createElement("div").focus({get preventScroll(){return cc=!0,!1}}),cc}const pc=(e,t)=>{if(e)if(t){if(e===Qi.LEFT)return"right";if(e===Qi.RIGHT)return"left"}else{if(e===Qi.LEFT)return"left";if(e===Qi.RIGHT)return"right"}};function hc(e,t,n,r){const o=pc(n,t);return o&&void 0!==r?(e[o]=r,e):e}const fc=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],gc=["changeReason","unstable_updateValueOnRender"];Qi.LEFT,Ko.LEFT,Qi.RIGHT,Ko.RIGHT,Qi.NONE,Qi.VIRTUAL;const mc=Nr(xe(function(t,n){const{column:r,row:o,rowId:l,rowNode:u,align:c,colIndex:d,width:p,className:h,style:f,colSpan:g,disableDragEvents:m,isNotVisible:b,pinnedOffset:v,pinnedPosition:w,showRightBorder:y,showLeftBorder:x,onClick:C,onDoubleClick:S,onMouseDown:M,onMouseUp:R,onMouseOver:I,onKeyDown:P,onKeyUp:k,onDragEnter:E,onDragOver:T}=t,D=s(t,fc),F=ul(),H=Xe(),$=ae(),z=r.field,L=so(F,Gl,{rowId:l,field:z}),j=Oi().hooks.useCellAggregationResult(l,z),N=L?Ao.Edit:Ao.View,{value:G,formattedValue:_}=j||{},V=F.current.getCellParamsForRow(l,z,o,{colDef:r,cellMode:N,rowNode:u,tabIndex:so(F,()=>{const e=Ks(F);return e&&e.field===z&&e.id===l?0:-1}),hasFocus:so(F,()=>{const e=Vs(F);return e?.id===l&&e.field===z}),value:G,formattedValue:_});V.api=F.current,so(F,()=>F.current.isCellEditable(V));const B=so(F,()=>F.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:l,field:z})),W=F.current.virtualizer.store,U=_n(W,Ru.selectors.hiddenCells),K=_n(W,Ru.selectors.spannedCells),{hasFocus:q,isEditable:X=!1,value:Y}=V,Q="view"!==N&&X||"actions"===r.type?-1:V.tabIndex,{classes:Z,getCellClassName:J}=H,ee=[so(F,()=>F.current.unstable_applyPipeProcessors("cellClassName",[],{id:l,field:z}).filter(Boolean).join(" "))];r.cellClassName&&ee.push("function"==typeof r.cellClassName?r.cellClassName(V):r.cellClassName),"flex"===r.display&&ee.push(Vr["cell--flex"]),J&&ee.push(J(V));const te=V.formattedValue??Y,ne=e.useRef(null),re=A(n,ne),se=H.cellSelection??!1,le=(e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:i,isSelected:s,isSelectionMode:a,classes:l}=e,u={root:["cell",`cell--text${de(t)}`,s&&"selected",i&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===Qi.LEFT&&"cell--pinnedLeft",o===Qi.RIGHT&&"cell--pinnedRight",a&&!i&&"cell--selectionMode"]};return ie(u,_r,l)})({align:c,showLeftBorder:x,showRightBorder:y,isEditable:X,classes:H.classes,pinnedPosition:w,isSelected:B,isSelectionMode:se}),ue=e.useCallback(e=>t=>{const n=F.current.getCellParams(l,z||"");F.current.publishEvent(e,n,t),R&&R(t)},[F,z,R,l]),pe=e.useCallback(e=>t=>{const n=F.current.getCellParams(l,z||"");F.current.publishEvent(e,n,t),M&&M(t)},[F,z,M,l]),he=e.useCallback((e,t)=>n=>{if(!F.current.getRow(l))return;const r=F.current.getCellParams(l,z||"");F.current.publishEvent(e,r,n),t&&t(n)},[F,z,l]),fe=U[l]?.[d]??!1,ge=K[l]?.[d]??1,me=e.useMemo(()=>{if(b)return{padding:0,opacity:0,width:0,height:0,border:0};const e=hc(a({"--width":`${p}px`},f),$,w,v),t=w===Qi.LEFT,n=w===Qi.RIGHT;return ge>1&&(e.height=`calc(var(--height) * ${ge})`,e.zIndex=10,(t||n)&&(e.zIndex=40)),e},[p,b,f,v,w,$,ge]);if(oe(()=>{if(!q||N===Ao.Edit)return;const e=ce(F.current.rootElementRef.current);if(ne.current&&!ne.current.contains(e.activeElement)){const e=ne.current.querySelector('[tabindex="0"]')||ne.current;if(dc())e.focus({preventScroll:!0});else{const t=F.current.getScrollPosition();e.focus(),F.current.scroll(t)}}},[q,N,F]),fe)return i.jsx("div",{"data-colindex":d,role:"presentation",style:a({width:"var(--width)"},me)});let be,ve,we=D.onFocus;if(null===L&&r.renderCell&&(be=r.renderCell(V)),null!==L&&r.renderEditCell){const e=F.current.getRowWithUpdatedValues(l,r.field),t=s(L,gc),n=r.valueFormatter?r.valueFormatter(L.value,e,r,F):V.formattedValue,o=a({},V,{row:e,formattedValue:n},t);be=r.renderEditCell(o),ee.push(Vr["cell--editing"]),ee.push(Z?.["cell--editing"])}if(void 0===be){const e=te?.toString();be=e,ve=e}const ye=m?null:{onDragEnter:he("cellDragEnter",E),onDragOver:he("cellDragOver",T)};return i.jsx("div",a({className:O(le.root,ee,h),role:"gridcell","data-field":z,"data-colindex":d,"aria-colindex":d+1,"aria-colspan":g,"aria-rowspan":ge,style:me,title:ve,tabIndex:Q,onClick:he("cellClick",C),onDoubleClick:he("cellDoubleClick",S),onMouseOver:he("cellMouseOver",I),onMouseDown:pe("cellMouseDown"),onMouseUp:ue("cellMouseUp"),onKeyDown:he("cellKeyDown",P),onKeyUp:he("cellKeyUp",k)},ye,D,{onFocus:we,ref:re,children:be}))})),bc=["field","type","align","width","height","empty","style","className"],vc="1.3em",wc=[40,80],yc={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},xc=function(e){const t=(n=e,()=>{let e=n+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296});var n;return(e,n)=>e+(n-e)*t()}(12345);const Cc=Nr(function(t){const{field:n,type:r,align:o,width:l,height:u,empty:c=!1,style:d,className:p}=t,h=s(t,bc),f=Xe(),g=(e=>{const{align:t,classes:n,empty:r}=e,o={root:["cell","cellSkeleton",`cell--text${t?de(t):"Left"}`,r&&"cellEmpty"]};return ie(o,_r,n)})({classes:f.classes,align:o,empty:c}),m=e.useMemo(()=>{if("boolean"===r||"actions"===r)return{variant:"circular",width:vc,height:vc};const[e,t]=r?yc[r]??wc:wc;return{variant:"text",width:`${Math.round(xc(e,t))}%`,height:"1.2em"}},[r]);return i.jsx("div",a({"data-field":n,className:O(g.root,p),style:a({height:u,maxWidth:l,minWidth:l},d)},h,{children:!c&&i.jsx(f.slots.baseSkeleton,a({},m))}))}),Sc={width:3,rx:1.5,x:10.5},Mc=e=>e.current.state.dimensions.isReady?e.current.state.dimensions.hasScrollX&&(!e.current.state.dimensions.hasScrollY||0===e.current.state.dimensions.scrollbarSize):0===e.current.state.dimensions.scrollbarSize,Rc=h("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Vr.autoHeight}`]:t.autoHeight},{[`&.${Vr.autosizing}`]:t.autosizing},{[`&.${Vr["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${Vr["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${Vr["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${Vr["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${Vr["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${Vr.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${Vr.actionsCell}`]:t.actionsCell},{[`& .${Vr.booleanCell}`]:t.booleanCell},{[`& .${Vr.cell}`]:t.cell},{[`& .${Vr["cell--editable"]}`]:t["cell--editable"]},{[`& .${Vr["cell--editing"]}`]:t["cell--editing"]},{[`& .${Vr["cell--flex"]}`]:t["cell--flex"]},{[`& .${Vr["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${Vr["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${Vr["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${Vr["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${Vr["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${Vr["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${Vr["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${Vr["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${Vr["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${Vr["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${Vr["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${Vr["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${Vr.cellCheckbox}`]:t.cellCheckbox},{[`& .${Vr.cellEmpty}`]:t.cellEmpty},{[`& .${Vr.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${Vr.cellSkeleton}`]:t.cellSkeleton},{[`& .${Vr.checkboxInput}`]:t.checkboxInput},{[`& .${Vr.columnHeader}`]:t.columnHeader},{[`& .${Vr["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${Vr["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${Vr["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${Vr["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${Vr["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${Vr["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${Vr["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${Vr["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${Vr["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${Vr["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${Vr["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${Vr["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${Vr["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${Vr["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${Vr["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${Vr["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${Vr["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${Vr.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${Vr.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${Vr.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${Vr.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${Vr.columnSeparator}`]:t.columnSeparator},{[`& .${Vr["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${Vr["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${Vr["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${Vr["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${Vr["container--bottom"]}`]:t["container--bottom"]},{[`& .${Vr["container--top"]}`]:t["container--top"]},{[`& .${Vr.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${Vr["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${Vr.editBooleanCell}`]:t.editBooleanCell},{[`& .${Vr.filterIcon}`]:t.filterIcon},{[`& .${Vr["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${Vr["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${Vr["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${Vr.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${Vr.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${Vr.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${Vr.headerFilterRow}`]:t.headerFilterRow},{[`& .${Vr.iconSeparator}`]:t.iconSeparator},{[`& .${Vr.menuIcon}`]:t.menuIcon},{[`& .${Vr.menuIconButton}`]:t.menuIconButton},{[`& .${Vr.menuList}`]:t.menuList},{[`& .${Vr.menuOpen}`]:t.menuOpen},{[`& .${Vr.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${Vr.pinnedRows}`]:t.pinnedRows},{[`& .${Vr["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${Vr["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${Vr.row}`]:t.row},{[`& .${Vr["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${Vr["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${Vr["row--dragging"]}`]:t["row--dragging"]},{[`& .${Vr["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${Vr["row--editable"]}`]:t["row--editable"]},{[`& .${Vr["row--editing"]}`]:t["row--editing"]},{[`& .${Vr["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${Vr["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${Vr.rowReorderCell}`]:t.rowReorderCell},{[`& .${Vr["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${Vr.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${Vr.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${Vr.rowSkeleton}`]:t.rowSkeleton},{[`& .${Vr.scrollbar}`]:t.scrollbar},{[`& .${Vr["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${Vr["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${Vr.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${Vr["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${Vr.sortIcon}`]:t.sortIcon},{[`& .${Vr.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${Vr.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${Vr.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${Vr.withBorderColor}`]:t.withBorderColor},{[`& .${Vr["row--beingDragged"]}`]:t["row--beingDragged"]}]})(()=>{const e=so(ul(),Mc),t=ct.colors.background.base,n=ct.header.background.base,r=ct.cell.background.pinned,o=Ic(ct.colors.interactive.hover,1);const i=ct.colors.interactive.hoverOpacity,s=ct.colors.interactive.selected,a=ct.colors.interactive.selectedOpacity,l=s,u=`calc(${a} + ${i})`,c=Pc(t,o,i),d=Pc(t,s,a),p=Pc(t,l,u),h=Pc(r,o,i),f=Pc(r,s,a),g=Pc(r,l,u),m=e=>({[`& .${Vr["cell--pinnedLeft"]}, & .${Vr["cell--pinnedRight"]}`]:{backgroundColor:e,"&.Mui-selected":{backgroundColor:Pc(e,d,a),"&:hover":{backgroundColor:Pc(e,p,u)}}}}),b=m(h),v=m(f),w=m(g),y={backgroundColor:d,"&:hover":{backgroundColor:p,"@media (hover: none)":{backgroundColor:d}}};return{"--unstable_DataGrid-radius":ct.radius.base,"--unstable_DataGrid-headWeight":ct.typography.fontWeight.medium,"--DataGrid-rowBorderColor":ct.colors.border.base,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:ct.colors.border.base,borderRadius:"var(--unstable_DataGrid-radius)",backgroundColor:ct.colors.background.base,color:ct.colors.foreground.base,font:ct.typography.font.body,outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${Vr.main} > *:first-child/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${Vr.autoHeight}`]:{height:"auto"},[`&.${Vr.autosizing}`]:{[`& .${Vr.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${Vr.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${Vr.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${Vr.groupingCriteriaCell}`]:{width:"unset"},[`& .${Vr.treeDataGroupingCell}`]:{width:"unset"}},[`&.${Vr.withSidePanel}`]:{flexDirection:"row"},[`& .${Vr.mainContent}`]:{display:"flex",flexDirection:"column",overflow:"hidden",flex:1},[`& .${Vr.columnHeader}, & .${Vr.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${Vr.columnHeader}:focus-within, & .${Vr.cell}:focus-within`]:{outline:`solid ${Ic(ct.colors.interactive.focus,.5)} 1px`,outlineOffset:-1},[`& .${Vr.columnHeader}:focus, & .${Vr.cell}:focus`]:{outline:`solid ${ct.colors.interactive.focus} 1px`,outlineOffset:-1},[`& .${Vr.columnHeader}:focus,\n & .${Vr["columnHeader--withLeftBorder"]},\n & .${Vr["columnHeader--withRightBorder"]},\n & .${Vr["columnHeader--siblingFocused"]}\n `]:{[`& .${Vr.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${Vr["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${Vr["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${Vr["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${Vr["root--noToolbar"]} [aria-rowindex="1"] .${Vr["columnHeader--last"]}`]:{borderTopRightRadius:e?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${Vr.columnHeaderCheckbox}, & .${Vr.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${Vr.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center",backgroundColor:n},[`& .${Vr.columnHeader} .${Vr.sortButton}`]:{backgroundColor:ct.header.background.base},[`& .${Vr["columnHeader--filter"]}`]:{paddingTop:8,paddingBottom:8,paddingRight:5,minHeight:"min-content",overflow:"hidden"},[`& .${Vr["virtualScroller--hasScrollX"]} .${Vr["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${Vr["pivotPanelField--sorted"]} .${Vr.iconButtonContainer},\n & .${Vr["columnHeader--sorted"]} .${Vr.iconButtonContainer},\n & .${Vr["columnHeader--filtered"]} .${Vr.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Vr.pivotPanelField}:not(.${Vr["pivotPanelField--sorted"]}) .${Vr.sortButton},\n & .${Vr.columnHeader}:not(.${Vr["columnHeader--sorted"]}) .${Vr.sortButton}`]:{opacity:0,transition:ct.transition(["opacity"],{duration:ct.transitions.duration.short})},[`& .${Vr.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:ct.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${Vr.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${Vr["columnHeader--filledGroup"]} .${Vr.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${Vr.sortIcon}, & .${Vr.filterIcon}`]:{fontSize:"inherit"},[`& .${Vr["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${Vr["columnHeader--alignCenter"]} .${Vr.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${Vr["columnHeader--alignRight"]} .${Vr.columnHeaderDraggableContainer}, & .${Vr["columnHeader--alignRight"]} .${Vr.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${Vr["columnHeader--alignCenter"]} .${Vr.menuIcon}`]:{marginLeft:"auto"},[`& .${Vr["columnHeader--alignRight"]} .${Vr.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${Vr["columnHeader--moving"]}`]:{backgroundColor:c},[`& .${Vr["columnHeader--pinnedLeft"]}, & .${Vr["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:ct.header.background.base},[`& .${Vr.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:10,color:ct.colors.border.base},[`& .${Vr.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)",backgroundColor:n},"@media (hover: hover)":{[`& .${Vr.columnHeader}:hover`]:{[`& .${Vr.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${Vr.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${Vr.columnHeader}:not(.${Vr["columnHeader--sorted"]}):hover .${Vr.sortButton},\n & .${Vr.pivotPanelField}:not(.${Vr["pivotPanelField--sorted"]}):hover .${Vr.sortButton},\n & .${Vr.pivotPanelField}:not(.${Vr["pivotPanelField--sorted"]}) .${Vr.sortButton}:focus-visible`]:{opacity:1},[`& .${Vr.columnHeader}:not(.${Vr["columnHeader--sorted"]}):hover .${Vr.sortButton} > *,\n & .${Vr.pivotPanelField}:not(.${Vr["pivotPanelField--sorted"]}):hover .${Vr.sortButton} > *,\n & .${Vr.pivotPanelField}:not(.${Vr["pivotPanelField--sorted"]}) .${Vr.sortButton}:focus-visible > *`]:{opacity:.78},[`& .${Vr.pivotPanelFieldActionContainer} button:hover`]:{backgroundColor:ct.colors.background.base}},"@media (hover: none)":{[`& .${Vr.columnHeader} .${Vr.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${Vr.columnHeader}:focus,\n & .${Vr["columnHeader--siblingFocused"]}`]:{[`.${Vr["columnSeparator--resizable"]}`]:{color:ct.colors.foreground.accent}},[`& .${Vr.pivotPanelField}:not(.${Vr["pivotPanelField--sorted"]}) .${Vr.sortButton}`]:{opacity:.78}},[`& .${Vr["columnHeader--withLeftBorder"]} .${Vr["columnSeparator--sideLeft"]}:not(.${Vr["columnSeparator--resizable"]}), & .${Vr["columnHeader--withRightBorder"]} .${Vr["columnSeparator--sideRight"]}:not(.${Vr["columnSeparator--resizable"]})`]:{display:"none"},[`& .${Vr["columnSeparator--sideLeft"]}`]:{left:-5},[`& .${Vr["columnSeparator--sideRight"]}`]:{right:-5},[`& .${Vr["columnHeader--withRightBorder"]} .${Vr["columnSeparator--sideLeft"]}`]:{left:-5.5},[`& .${Vr["columnHeader--withRightBorder"]} .${Vr["columnSeparator--sideRight"]}`]:{right:-5.5},[`& .${Vr["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${Vr["columnSeparator--resizing"]}`]:{color:ct.colors.foreground.accent},"@media (hover: none)":{[`& .${Vr.iconSeparator} rect`]:Sc},"@media (hover: hover)":{"&:hover":{color:ct.colors.foreground.accent,[`& .${Vr.iconSeparator} rect`]:Sc}},"& svg":{pointerEvents:"none"}},[`& .${Vr.iconSeparator}`]:{color:"inherit",transition:ct.transition(["color","width"],{duration:ct.transitions.duration.short})},[`& .${Vr.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${Vr.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${Vr.headerFilterRow}`]:{[`& .${Vr.columnHeader}, & .${Vr.scrollbarFiller}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${Vr["row--borderBottom"]} .${Vr.columnHeader},\n & .${Vr["row--borderBottom"]} .${Vr.filler},\n & .${Vr["row--borderBottom"]} .${Vr.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${Vr["row--borderBottom"]} .${Vr.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${Vr.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${Vr["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:c,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vr.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":y,position:"relative"},[`& .${Vr.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":y},[`& .${Vr["virtualScrollerContent--overflowed"]} .${Vr["row--lastVisible"]} .${Vr.cell}`]:{borderTopColor:"transparent"},[`& .${Vr.pinnedRows} .${Vr.row}, .${Vr.aggregationRowOverlayWrapper} .${Vr.row}`]:{backgroundColor:r,"&:hover":{backgroundColor:h}},[`& .${Vr["pinnedRows--top"]} :first-of-type`]:{[`& .${Vr.cell}, .${Vr.scrollbarFiller}`]:{borderTop:"none"}},[`&.${Vr["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${Vr["row--dynamicHeight"]} > .${Vr.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${Vr.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${Vr.cell}.${Vr["cell--selectionMode"]}`]:{cursor:"default"},[`& .${Vr.cell}.${Vr["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:ct.shadows.base,backgroundColor:ct.colors.background.overlay,"&:focus-within":{outline:`1px solid ${ct.colors.interactive.focus}`,outlineOffset:-1}},[`& .${Vr["cell--editing"]}`]:{"& .MuiInputBase-root":{height:"100%"}},[`& .${Vr["row--editing"]}`]:{boxShadow:ct.shadows.base},[`& .${Vr["row--editing"]} .${Vr.cell}`]:{boxShadow:"none",backgroundColor:ct.colors.background.overlay},[`& .${Vr.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${Vr.booleanCell}[data-value="true"]`]:{color:ct.colors.foreground.muted},[`& .${Vr.booleanCell}[data-value="false"]`]:{color:ct.colors.foreground.disabled},[`& .${Vr.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:ct.spacing(1)},[`& .${Vr.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:ct.colors.interactive.disabledOpacity},[`& .${Vr["rowReorderCell--draggable"]}`]:{cursor:"grab",opacity:1},[`& .${Vr.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${Vr.withBorderColor}`]:{borderColor:ct.colors.border.base},[`& .${Vr["cell--withLeftBorder"]}, & .${Vr["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${Vr["cell--withRightBorder"]}, & .${Vr["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${Vr["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${Vr["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${Vr["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${Vr["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${Vr["cell--pinnedLeft"]}, & .${Vr["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:ct.cell.background.pinned,"&.Mui-selected":{backgroundColor:f}},[`& .${Vr.row}`]:{"&:hover":b,"&.Mui-selected":v,"&.Mui-selected:hover":w},[`& .${Vr.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${Vr.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${Vr.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${Vr.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${Vr["columnHeader--dragging"]}`]:{background:ct.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:ct.colors.interactive.disabledOpacity},[`& .${Vr["row--dragging"]}`]:{background:ct.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",border:"1px solid var(--DataGrid-rowBorderColor)",color:ct.colors.foreground.base,transform:"translateZ(0)",[`& .${Vr.rowReorderCellPlaceholder}`]:{padding:"0 6px",display:"flex"}},[`& .${Vr.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Vr.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:ct.spacing(2)},[`& .${Vr.treeDataGroupingCellLoadingContainer}, .${Vr.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${Vr.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Vr.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:ct.spacing(2)},[`& .${Vr.columnHeaders} .${Vr.scrollbarFiller}`]:{backgroundColor:n},[`.${Vr.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",backgroundColor:n,[`&.${Vr["scrollbarFiller--pinnedRight"]}`]:{position:"sticky",zIndex:40,right:0}},[`& .${Vr.filler}`]:{flex:"1 0 auto"},[`& .${Vr["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${Vr.columnHeaders} .${Vr.filler}`]:{backgroundColor:n},[`& .${Vr["main--hiddenContent"]}`]:{[`& .${Vr.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${Vr.pinnedRows}`]:{display:"none"}},[`& .${Vr["row--beingDragged"]}`]:{color:ct.colors.foreground.disabled,"&:hover":{backgroundColor:"transparent"}}}});function Ic(e,t){return`rgba(from ${e} r g b / ${t})`}function Pc(e,t,n){return`color-mix(in srgb,${e}, ${t} calc(${n} * 100%))`}const kc=()=>()=>{},Ec=()=>!1,Tc=()=>!0,Dc=e.createContext(void 0);function Fc(){const t=e.useContext(Dc);if(void 0===t)throw new Error("MUI X: Missing context.");return t}function Ac({children:t}){const n=e.useRef(null),r=e.useRef(null),o=e.useRef(null),s=e.useMemo(()=>({columnsPanelTriggerRef:n,filterPanelTriggerRef:r,aiAssistantPanelTriggerRef:o}),[]);return i.jsx(Dc.Provider,{value:s,children:t})}function Oc(){const e=Je(),t=so(e,ti),n=Xe(),r=so(e,_l),{columnsPanelTriggerRef:o,filterPanelTriggerRef:s,aiAssistantPanelTriggerRef:l}=Fc(),u=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??Bl.filters);let c=null;switch(r.openedPanelValue){case Bl.filters:c=s.current;break;case Bl.columns:c=o.current;break;case Bl.aiAssistant:c=l.current}return i.jsx(n.slots.panel,a({id:r.panelId,open:t.length>0&&r.open,"aria-labelledby":r.labelId,target:c,onClose:()=>e.current.hidePreferences()},n.slotProps?.panel,{children:u}))}function Hc(){const t=Xe();return i.jsxs(e.Fragment,{children:[i.jsx(Oc,{}),t.showToolbar&&i.jsx(t.slots.toolbar,a({},t.slotProps?.toolbar))]})}const $c=["className","children","sidePanel"],zc=Nr(xe(function(t,n){const r=Xe(),{className:o,children:l,sidePanel:u}=t,c=s(t,$c),d=ul(),p=so(d,lo),h=d.current.rootElementRef,f=e.useCallback(e=>{null!==e&&d.current.publishEvent("rootMount",e)},[d]),g=A(h,n,f),m=r,b=((e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:o}=e,i={root:["root",n&&"autoHeight",`root--density${de(t)}`,null===e.slots.toolbar&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]};return ie(i,_r,r)})(m,p),v=e.useContext(Hi);return Jr.useSyncExternalStore(kc,Ec,Tc)?null:i.jsxs(Rc,a({className:O(b.root,o,v.className,u&&Vr.withSidePanel),ownerState:m},c,{ref:g,children:[i.jsxs("div",{className:Vr.mainContent,role:"presentation",children:[i.jsx(Hc,{}),i.jsx(lc,{children:l}),i.jsx(uc,{})]}),u,v.tag]}))})),Lc=["className"],jc=ue("div",{name:"MuiDataGrid",slot:"FooterContainer"})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),Nc=xe(function(e,t){const{className:n}=e,r=s(e,Lc),o=Xe(),l=(e=>{const{classes:t}=e;return ie({root:["footerContainer","withBorderColor"]},_r,t)})(o);return i.jsx(jc,a({className:O(l.root,n),ownerState:o},r,{ref:t}))}),Gc=["className"],_c=ue("div",{name:"MuiDataGrid",slot:"Overlay"})({width:"100%",height:"100%",display:"flex",gap:ct.spacing(1),flexDirection:"column",alignSelf:"center",alignItems:"center",justifyContent:"center",textAlign:"center",textWrap:"balance",backgroundColor:ct.colors.background.backdrop}),Vc=xe(function(e,t){const{className:n}=e,r=s(e,Gc),o=Xe(),l=(e=>{const{classes:t}=e;return ie({root:["overlay"]},_r,t)})(o);return i.jsx(_c,a({className:O(l.root,n),ownerState:o},r,{ref:t}))});function Bc(t,n,r,o={}){return"function"==typeof n?n(r,o):n?(n.props.className&&(r.className=function(e,t){if(!e||!t)return e||t;return`${e} ${t}`}(n.props.className,r.className)),(n.props.style||r.style)&&(r.style=a({},r.style,n.props.style)),e.cloneElement(n,r)):e.createElement(t,r)}const Wc=e.createContext(void 0);function Uc(e,t){if(!e.ref.current||!t.ref.current)return 0;const n=e.ref.current.compareDocumentPosition(t.ref.current);return n?n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0:0}const Kc=["render","className"],qc=ue("div",{name:"MuiDataGrid",slot:"Toolbar"})({flex:"0 1 1px",display:"flex",alignItems:"center",justifyContent:"end",gap:ct.spacing(.25),padding:ct.spacing(.75),minHeight:52,boxSizing:"border-box",borderBottom:`1px solid ${ct.colors.border.base}`}),Xc=xe(function(t,n){const{render:r,className:o}=t,l=s(t,Kc),u=Xe(),c=(e=>{const{classes:t}=e;return ie({root:["toolbar"]},_r,t)})(u),[d,p]=e.useState(null),[h,f]=e.useState([]),g=e.useCallback(()=>h.sort(Uc),[h]),m=e.useCallback((e,t,n=!0)=>{let r=e;const o=g(),i=o.length;for(let s=0;s<i;s+=1){if(r+=t,r>=i){if(!n)return-1;r=0}else if(r<0){if(!n)return-1;r=i-1}if(!o[r].ref.current?.disabled&&"true"!==o[r].ref.current?.ariaDisabled)return r}return-1},[g]),b=e.useCallback((e,t)=>{f(n=>[...n,{id:e,ref:t}])},[]),v=e.useCallback(e=>{f(t=>t.filter(t=>t.id!==e))},[]),w=e.useCallback(e=>{if(!d)return;const t=g(),n=t.findIndex(e=>e.id===d);let r=-1;if("ArrowRight"===e.key?(e.preventDefault(),r=m(n,1)):"ArrowLeft"===e.key?(e.preventDefault(),r=m(n,-1)):"Home"===e.key?(e.preventDefault(),r=m(-1,1,!1)):"End"===e.key&&(e.preventDefault(),r=m(t.length,-1,!1)),r>=0&&r<t.length){const e=t[r];p(e.id),e.ref.current?.focus()}},[g,d,m]),y=e.useCallback(e=>{d!==e&&p(e)},[d,p]),x=e.useCallback(e=>{const t=g(),n=t.findIndex(t=>t.id===e),r=m(n,1);if(r>=0&&r<t.length){const e=t[r];p(e.id),e.ref.current?.focus()}},[g,m]);e.useEffect(()=>{const e=g();if(e.length>0){if(!d)return void p(e[0].id);const t=e.findIndex(e=>e.id===d);if(e[t]){if(-1===t){const n=e[t];n&&(p(n.id),n.ref.current?.focus())}}else{const t=e[e.length-1];t&&(p(t.id),t.ref.current?.focus())}}},[g,m]);const C=e.useMemo(()=>({focusableItemId:d,registerItem:b,unregisterItem:v,onItemKeyDown:w,onItemFocus:y,onItemDisabled:x}),[d,b,v,w,y,x]),S=Bc(qc,r,a({role:"toolbar","aria-orientation":"horizontal","aria-label":u.label||void 0,className:O(c.root,o)},l,{ref:n}));return i.jsx(Wc.Provider,{value:C,children:S})}),Yc=["render","onKeyDown","onFocus","disabled","aria-disabled"],Qc=xe(function(t,n){const{render:r,onKeyDown:o,onFocus:l,disabled:u,"aria-disabled":c}=t,d=s(t,Yc),p=x(),h=Xe(),f=e.useRef(null),g=A(f,n),{focusableItemId:m,registerItem:b,unregisterItem:v,onItemKeyDown:w,onItemFocus:y,onItemDisabled:C}=function(){const t=e.useContext(Wc);if(void 0===t)throw new Error("MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.");return t}();e.useEffect(()=>(b(p,f),()=>v(p)),[]);const S=e.useRef(u);e.useEffect(()=>{S.current!==u&&!0===u&&C(p,u),S.current=u},[u,p,C]);const M=e.useRef(c);e.useEffect(()=>{M.current!==c&&!0===c&&C(p,!0),M.current=c},[c,p,C]);const R=Bc(h.slots.baseIconButton,r,a({},h.slotProps?.baseIconButton,{tabIndex:m===p?0:-1},d,{disabled:u,"aria-disabled":c,onKeyDown:e=>{w(e),o?.(e)},onFocus:e=>{y(p),l?.(e)},ref:g}));return i.jsx(e.Fragment,{children:R})}),Zc=["className","children"],Jc=ue(Xc,{name:"MuiDataGrid",slot:"ToolbarContainer",shouldForwardProp:e=>"ownerState"!==e})({display:"flex",alignItems:"center",flexWrap:"wrap",gap:ct.spacing(1),padding:ct.spacing(.5),minHeight:"auto"}),ed=xe(function(e,t){const{className:n,children:r}=e,o=s(e,Zc),l=Xe(),u=(e=>{const{classes:t}=e;return ie({root:["toolbarContainer"]},_r,t)})(l);return r?i.jsx(Jc,a({className:O(u.root,n),ownerState:l},o,{ref:t,children:r})):null}),td=e.memo(t=>{const{colDef:n,open:r,columnMenuId:o,columnMenuButtonId:s,iconButtonRef:l}=t,u=Je(),c=Xe(),d=(e=>{const{classes:t,open:n}=e;return ie({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},_r,t)})(a({},t,{classes:c.classes})),p=e.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u.current.toggleColumnMenu(n.field)},[u,n.field]),h=n.headerName??n.field;return i.jsx("div",{className:d.root,children:i.jsx(c.slots.baseTooltip,a({title:u.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},c.slotProps?.baseTooltip,{children:i.jsx(c.slots.baseIconButton,a({ref:l,tabIndex:-1,className:d.button,"aria-label":u.current.getLocaleText("columnMenuAriaLabel")(h),size:"small",onClick:p,"aria-haspopup":"menu","aria-expanded":r,"aria-controls":r?o:void 0,id:s},c.slotProps?.baseIconButton,{children:i.jsx(c.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function nd({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:s,target:l,onExited:u}){const c=Je(),d=c.current.getColumn(o),p=y(e=>{e&&(e.stopPropagation(),l?.contains(e.target))||c.current.hideColumnMenu()});return l&&d?i.jsx(Ni,{position:"bottom-"+("right"===d.align?"start":"end"),open:s,target:l,onClose:p,onExited:u,children:i.jsx(n,a({colDef:d,hideMenu:p,open:s,id:e,labelledby:t},r))}):null}function rd(e,t){return e.closest(`.${t}`)}function od(e){return e.replace(/["\\]/g,"\\$&")}function id(e){return`.${Vr.row}[data-id="${od(String(e))}"]`}function sd(e){return 1===e.target.nodeType&&!e.currentTarget.contains(e.target)}function ad(e,t){return e.rootElementRef.current.querySelector(`.${Vr[t]}`)}const ld=({api:e,colIndex:t,position:n,filterFn:r})=>{if(null===t)return[];const o=[];return cd(e).forEach(e=>{e.getAttribute("data-id")&&e.querySelectorAll(`.${Vr["left"===n?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(e=>{const t=dd(e);null!==t&&r(t)&&o.push(e)})}),o};const ud=({api:e,colIndex:t,position:n,filterFn:r})=>{if(!e.columnHeadersContainerRef?.current)return[];if(null===t)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${Vr["left"===n?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(e=>{const t=dd(e);null!==t&&r(t,e)&&o.push(e)}),o};function cd(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${Vr.row}`)}function dd(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const pd=["className","aria-label"],hd=ue("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle"})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),fd=xe(function(e,t){const{className:n}=e,r=s(e,pd),o=Xe(),l=(e=>{const{classes:t}=e;return ie({root:["columnHeaderTitle"]},_r,t)})(o);return i.jsx(hd,a({className:O(l.root,n),ownerState:o},r,{ref:t}))});function gd(t){const{label:n,description:r}=t,o=Xe(),s=e.useRef(null),[l,u]=e.useState(""),c=e.useCallback(()=>{if(!r&&s?.current){const t=(e=s.current).scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;u(t?n:"")}var e},[r,n]);return i.jsx(o.slots.baseTooltip,a({title:r||l},o.slotProps?.baseTooltip,{children:i.jsx(fd,{onMouseOver:c,ref:s,children:n})}))}const md=["resizable","resizing","height","side"];var bd=function(e){return e.Left="left",e.Right="right",e}(bd||{});function vd(t){const{height:n,side:r=bd.Right}=t,o=s(t,md),l=Xe(),u=(e=>{const{resizable:t,resizing:n,classes:r,side:o}=e,i={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${de(o)}`],icon:["iconSeparator"]};return ie(i,_r,r)})(a({},t,{side:r,classes:l.classes})),c=e.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]);return i.jsx("div",a({className:u.root,style:{minHeight:n}},o,{onClick:c,children:i.jsx(l.slots.columnResizeIcon,{className:u.icon})}))}const wd=e.memo(vd),yd=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],xd=xe(function(t,n){const{classes:r,colIndex:o,height:l,isResizing:u,sortDirection:c,tabIndex:d,separatorSide:p,isDraggable:h,headerComponent:f,description:g,width:m,columnMenuIconButton:b=null,columnMenu:v=null,columnTitleIconButtons:w=null,headerClassName:y,label:x,resizable:C,draggableContainerProps:S,columnHeaderSeparatorProps:M,style:R}=t,I=s(t,yd),P=Xe(),k=e.useRef(null),E=A(k,n);let T="none";return null!=c&&(T="asc"===c?"ascending":"descending"),i.jsxs("div",a({className:O(r.root,y),style:a({},R,{width:m}),role:"columnheader",tabIndex:d,"aria-colindex":o+1,"aria-sort":T},I,{ref:E,children:[i.jsxs("div",a({className:r.draggableContainer,draggable:h,role:"presentation"},S,{children:[i.jsxs("div",{className:r.titleContainer,role:"presentation",children:[i.jsx("div",{className:r.titleContainerContent,children:void 0!==f?f:i.jsx(gd,{label:x,description:g,columnWidth:m})}),w]}),b]})),i.jsx(wd,a({resizable:!P.disableColumnResize&&!!C,resizing:u,height:l,side:p},M)),v]}))});const Cd=Nr(function(t){const{colDef:n,columnMenuOpen:r,colIndex:o,headerHeight:s,isResizing:l,isLast:u,sortDirection:c,sortIndex:d,filterItemsCounter:p,hasFocus:h,tabIndex:f,disableReorder:g,separatorSide:m,showLeftBorder:b,showRightBorder:v,pinnedPosition:w,pinnedOffset:y}=t,C=ul(),S=Xe(),M=ae(),R=e.useRef(null),I=x(),P=x(),k=e.useRef(null),[E,T]=e.useState(r),D=!S.disableColumnReorder&&!g&&!n.disableReorder;let F;n.renderHeader&&(F=n.renderHeader(C.current.getColumnHeaderParams(n.field)));const A=(e=>{const{disableColumnSorting:t}=Xe(),{colDef:n,classes:r,isDragging:o,sortDirection:i,showRightBorder:s,showLeftBorder:a,filterItemsCounter:l,pinnedPosition:u,isSiblingFocused:c}=e,d=n.sortable&&!t,p=null!=i,h=null!=l&&l>0,f="number"===n.type,g={root:["columnHeader","left"===n.headerAlign&&"columnHeader--alignLeft","center"===n.headerAlign&&"columnHeader--alignCenter","right"===n.headerAlign&&"columnHeader--alignRight",d&&"columnHeader--sortable",o&&"columnHeader--moving",p&&"columnHeader--sorted",h&&"columnHeader--filtered",f&&"columnHeader--numeric","withBorderColor",s&&"columnHeader--withRightBorder",a&&"columnHeader--withLeftBorder",u===Qi.LEFT&&"columnHeader--pinnedLeft",u===Qi.RIGHT&&"columnHeader--pinnedRight",c&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return ie(g,_r,r)})(a({},t,{classes:S.classes,showRightBorder:v,showLeftBorder:b})),H=e.useCallback(e=>t=>{sd(t)||C.current.publishEvent(e,C.current.getColumnHeaderParams(n.field),t)},[C,n.field]),$=e.useMemo(()=>({onClick:H("columnHeaderClick"),onContextMenu:H("columnHeaderContextMenu"),onDoubleClick:H("columnHeaderDoubleClick"),onMouseOver:H("columnHeaderOver"),onMouseOut:H("columnHeaderOut"),onMouseEnter:H("columnHeaderEnter"),onMouseLeave:H("columnHeaderLeave"),onKeyDown:H("columnHeaderKeyDown"),onFocus:H("columnHeaderFocus"),onBlur:H("columnHeaderBlur")}),[H]),z=e.useMemo(()=>D?{onDragStart:H("columnHeaderDragStart"),onDragEnter:H("columnHeaderDragEnter"),onDragOver:H("columnHeaderDragOver"),onDragEndCapture:H("columnHeaderDragEnd")}:{},[D,H]),L=e.useMemo(()=>({onMouseDown:H("columnSeparatorMouseDown"),onDoubleClick:H("columnSeparatorDoubleClick")}),[H]);e.useEffect(()=>{!E&&r&&T(r)},[E,r]);const j=e.useCallback(()=>{T(!1)},[]),N=!S.disableColumnMenu&&!n.disableColumnMenu&&i.jsx(td,{colDef:n,columnMenuId:I,columnMenuButtonId:P,open:E,iconButtonRef:k}),G=i.jsx(nd,{columnMenuId:I,columnMenuButtonId:P,field:n.field,open:r,target:k.current,ContentComponent:S.slots.columnMenu,contentComponentProps:S.slotProps?.columnMenu,onExited:j}),_=n.sortingOrder??S.sortingOrder,V=(n.sortable||null!=c)&&!n.hideSortIcons&&!S.disableColumnSorting,B=i.jsxs(e.Fragment,{children:[!S.disableColumnFilter&&i.jsx(S.slots.columnHeaderFilterIconButton,a({field:n.field,counter:p},S.slotProps?.columnHeaderFilterIconButton)),V&&i.jsx(S.slots.columnHeaderSortIcon,a({field:n.field,direction:c,index:d,sortingOrder:_,disabled:!n.sortable},S.slotProps?.columnHeaderSortIcon))]});e.useLayoutEffect(()=>{const e=C.current.state.columnMenu;if(h&&!e.open){const e=R.current.querySelector('[tabindex="0"]')||R.current;if(!e)return;if(dc())e.focus({preventScroll:!0});else{const t=C.current.getScrollPosition();e.focus(),C.current.scroll(t)}}},[C,h]);const W="function"==typeof n.headerClassName?n.headerClassName({field:n.field,colDef:n}):n.headerClassName,U=n.headerName??n.field,K=e.useMemo(()=>hc(a({},t.style),M,w,y),[w,y,t.style,M]);return i.jsx(xd,a({ref:R,classes:A,columnMenuOpen:r,colIndex:o,height:s,isResizing:l,sortDirection:c,hasFocus:h,tabIndex:f,separatorSide:m,isDraggable:D,headerComponent:F,description:n.description,elementId:n.field,width:n.computedWidth,columnMenuIconButton:N,columnTitleIconButtons:B,headerClassName:O(W,u&&Vr["columnHeader--last"]),label:U,resizable:!S.disableColumnResize&&!!n.resizable,"data-field":n.field,columnMenu:G,draggableContainerProps:z,columnHeaderSeparatorProps:L,style:K},$))}),Sd=["className"],Md=ue("div",{name:"MuiDataGrid",slot:"IconButtonContainer"})(()=>({display:"flex",visibility:"hidden",width:0})),Rd=xe(function(e,t){const{className:n}=e,r=s(e,Sd),o=Xe(),l=(e=>{const{classes:t}=e;return ie({root:["iconButtonContainer"]},_r,t)})(o);return i.jsx(Md,a({className:O(l.root,n),ownerState:o},r,{ref:t}))}),Id=["direction","index","sortingOrder","disabled","className"],Pd=ue(co,{name:"MuiDataGrid",slot:"SortButton"})({transition:ct.transition(["opacity"],{duration:ct.transitions.duration.short,easing:ct.transitions.easing.easeInOut})});function kd(t){const{direction:n,index:r,sortingOrder:o,disabled:l,className:u}=t,c=s(t,Id),d=Je(),p=Xe(),h=a({},t,{classes:p.classes}),f=(e=>{const{classes:t}=e;return ie({root:["sortButton"],icon:["sortIcon"]},_r,t)})(h),g=function(e,t,n,r){let o;const s={};return"asc"===t?o=e.columnSortedAscendingIcon:"desc"===t?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,s.sortingOrder=r),o?i.jsx(o,a({fontSize:"small",className:n},s)):null}(p.slots,n,f.icon,o);if(!g)return null;const m=i.jsx(Pd,a({as:p.slots.baseIconButton,ownerState:h,"aria-label":d.current.getLocaleText("columnHeaderSortIconLabel"),title:d.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:l,className:O(f.root,u)},p.slotProps?.baseIconButton,c,{children:g}));return i.jsxs(e.Fragment,{children:[null!=r&&i.jsx(p.slots.baseBadge,{badgeContent:r,color:"default",overlap:"circular",children:m}),null==r&&m]})}function Ed(e){return i.jsx(Rd,{children:i.jsx(kd,a({},e,{tabIndex:-1}))})}const Td=e.memo(Ed);function Dd(t){const{counter:n,field:r,onClick:o}=t,s=Je(),l=Xe(),u=(e=>{const{classes:t}=e;return ie({icon:["filterIcon"]},_r,t)})(a({},t,{classes:l.classes})),c=x(),d=so(s,Vl,c),p=x(),h=e.useCallback(e=>{e.preventDefault(),e.stopPropagation();const{open:t,openedPanelValue:n}=_l(s);t&&n===Bl.filters?s.current.hideFilterPanel():s.current.showFilterPanel(void 0,p,c),o&&o(s.current.getColumnHeaderParams(r),e)},[s,r,o,p,c]);if(!n)return null;const f=i.jsx(l.slots.baseIconButton,a({id:c,onClick:h,"aria-label":s.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?p:void 0},l.slotProps?.baseIconButton,{children:i.jsx(l.slots.columnFilteredIcon,{className:u.icon,fontSize:"small"})}));return i.jsx(l.slots.baseTooltip,a({title:s.current.getLocaleText("columnHeaderFiltersTooltipActive")(n),enterDelay:1e3},l.slotProps?.baseTooltip,{children:i.jsxs(Rd,{children:[n>1&&i.jsx(l.slots.baseBadge,{badgeContent:n,color:"default",children:f}),1===n&&f]})}))}const Fd=["hideMenu","colDef","id","labelledby","className","children","open"],Ad=h(co)(()=>({minWidth:248}));function Od(e){e.currentTarget.contains(e.target)&&e.stopPropagation()}const Hd=xe(function(t,n){const{hideMenu:r,id:o,labelledby:l,className:u,children:c,open:d}=t,p=s(t,Fd),h=Xe(),f=e.useCallback(e=>{"Tab"===e.key&&e.preventDefault(),Di(e.key)&&r(e)},[r]);return i.jsx(Ad,a({as:h.slots.baseMenuList,id:o,className:O(Vr.menuList,u),"aria-labelledby":l,onKeyDown:f,onWheel:Od,onTouchMove:Od,autoFocus:d},p,{ref:n,children:c}))}),$d=["displayOrder"];function zd(t){const{colDef:n,onClick:r}=t,o=Je(),s=Xe(),a=1===oi(o).filter(e=>!0!==e.disableColumnMenu).length,l=e.useCallback(e=>{a||(o.current.setColumnVisibility(n.field,!1),r(e))},[o,n.field,r,a]);return s.disableColumnSelector||!1===n.hideable?null:i.jsx(s.slots.baseMenuItem,{onClick:l,disabled:a,iconStart:i.jsx(s.slots.columnMenuHideIcon,{fontSize:"small"}),children:o.current.getLocaleText("columnMenuHideColumn")})}function Ld(t){const{onClick:n}=t,r=Je(),o=Xe(),s=e.useCallback(e=>{n(e),r.current.showPreferences(Bl.columns)},[r,n]);return o.disableColumnSelector?null:i.jsx(o.slots.baseMenuItem,{onClick:s,iconStart:i.jsx(o.slots.columnMenuManageColumnsIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuManageColumns")})}const jd=["defaultSlots","defaultSlotProps","slots","slotProps"],Nd={columnMenuSortItem:function(t){const{colDef:n,onClick:r}=t,o=Je(),s=so(o,ds),a=Xe(),l=e.useMemo(()=>{if(!n)return null;const e=s.find(e=>e.field===n.field);return e?.sort},[n,s]),u=n.sortingOrder??a.sortingOrder,c=e.useCallback(e=>{r(e);const t=e.currentTarget.getAttribute("data-value")||null,i="always"===a.multipleColumnsSortingMode;o.current.sortColumn(n.field,t===l?null:t,i)},[o,n,r,l,a.multipleColumnsSortingMode]);if(a.disableColumnSorting||!n||!n.sortable||!u.some(e=>!!e))return null;const d=e=>{const t=o.current.getLocaleText(e);return"function"==typeof t?t(n):t};return i.jsxs(e.Fragment,{children:[u.includes("asc")&&"asc"!==l?i.jsx(a.slots.baseMenuItem,{onClick:c,"data-value":"asc",iconStart:i.jsx(a.slots.columnMenuSortAscendingIcon,{fontSize:"small"}),children:d("columnMenuSortAsc")}):null,u.includes("desc")&&"desc"!==l?i.jsx(a.slots.baseMenuItem,{onClick:c,"data-value":"desc",iconStart:i.jsx(a.slots.columnMenuSortDescendingIcon,{fontSize:"small"}),children:d("columnMenuSortDesc")}):null,u.includes(null)&&null!=l?i.jsx(a.slots.baseMenuItem,{onClick:c,iconStart:a.slots.columnMenuUnsortIcon?i.jsx(a.slots.columnMenuUnsortIcon,{fontSize:"small"}):i.jsx("span",{}),children:o.current.getLocaleText("columnMenuUnsort")}):null]})},columnMenuFilterItem:function(t){const{colDef:n,onClick:r}=t,o=Je(),s=Xe(),a=e.useCallback(e=>{r(e),o.current.showFilterPanel(n.field)},[o,n.field,r]);return s.disableColumnFilter||!n.filterable?null:i.jsx(s.slots.baseMenuItem,{onClick:a,iconStart:i.jsx(s.slots.columnMenuFilterIcon,{fontSize:"small"}),children:o.current.getLocaleText("columnMenuFilter")})},columnMenuColumnsItem:function(t){return i.jsxs(e.Fragment,{children:[i.jsx(zd,a({},t)),i.jsx(Ld,a({},t))]})}},Gd={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},_d=xe(function(t,n){const{defaultSlots:r,defaultSlotProps:o,slots:l,slotProps:u}=t,c=s(t,jd),d=(t=>{const n=ul(),r=Xe(),{defaultSlots:o,defaultSlotProps:i,slots:l={},slotProps:u={},hideMenu:c,colDef:d,addDividers:p=!0}=t,h=e.useMemo(()=>a({},o,l),[o,l]),f=e.useMemo(()=>{if(!u||0===Object.keys(u).length)return i;const e=a({},u);return Object.entries(i).forEach(([t,n])=>{e[t]=a({},n,u[t]||{})}),e},[i,u]),g=n.current.unstable_applyPipeProcessors("columnMenu",[],t.colDef),m=e.useMemo(()=>{const e=Object.keys(o);return Object.keys(l).filter(t=>!e.includes(t))},[l,o]);return e.useMemo(()=>{const e=Array.from(new Set([...g,...m])).filter(e=>null!=h[e]).sort((e,t)=>{const n=f[e],r=f[t];return(Number.isFinite(n?.displayOrder)?n.displayOrder:100)-(Number.isFinite(r?.displayOrder)?r.displayOrder:100)});return e.reduce((t,n,o)=>{let i={colDef:d,onClick:c};const l=f[n];if(l){const e=s(l,$d);i=a({},i,e)}return p&&o!==e.length-1?[...t,[h[n],i],[r.slots.baseDivider,{}]]:[...t,[h[n],i]]},[])},[p,d,g,c,h,f,m,r.slots.baseDivider])})(a({},c,{defaultSlots:r,defaultSlotProps:o,slots:l,slotProps:u}));return i.jsx(Hd,a({},c,{ref:n,children:d.map(([e,t],n)=>i.jsx(e,a({},t),n))}))}),Vd=xe(function(e,t){return i.jsx(_d,a({},e,{ref:t,defaultSlots:Nd,defaultSlotProps:Gd}))}),Bd=["className"],Wd=h("div",{name:"MuiDataGrid",slot:"PanelWrapper"})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),Ud=xe(function(e,t){const{className:n}=e,r=s(e,Bd),o=Xe(),l=(e=>{const{classes:t}=e;return ie({root:["panelWrapper"]},_r,t)})(o);return i.jsx(Wd,a({tabIndex:-1,className:O(l.root,n),ownerState:o},r,{ref:t}))});const Kd=["children","className","classes","onClose"],qd=re("MuiDataGrid",["panel","paper"]),Xd=h(co,{name:"MuiDataGrid",slot:"panel"})({zIndex:ct.zIndex.panel}),Yd=h("div",{name:"MuiDataGrid",slot:"panelContent"})({backgroundColor:ct.colors.background.overlay,borderRadius:ct.radius.base,boxShadow:ct.shadows.overlay,display:"flex",maxWidth:`calc(100vw - ${ct.spacing(2)})`,overflow:"auto"}),Qd=xe((t,n)=>{const{children:r,className:o,onClose:l}=t,u=s(t,Kd),c=Je(),d=Xe(),p=qd,[h,f]=e.useState(!1),g=$i(),m=y(()=>f(!0)),b=y(()=>f(!1)),v=y(()=>{l?.()}),w=y(e=>{"Escape"===e.key&&l?.()}),[x,C]=e.useState(null);return e.useEffect(()=>{const e=c.current.rootElementRef?.current?.querySelector('[data-id="gridPanelAnchor"]');e&&C(e)},[c]),x?i.jsx(Xd,a({as:d.slots.basePopper,ownerState:d,placement:"bottom-end",className:O(p.panel,o,g),flip:!0,onDidShow:m,onDidHide:b,onClickAway:v,clickAwayMouseEvent:"onPointerUp",clickAwayTouchEvent:!1,focusTrap:!0},u,d.slotProps?.basePopper,{target:t.target??x,ref:n,children:i.jsx(Yd,{className:p.paper,ownerState:d,onKeyDown:w,children:h&&r})})):null}),Zd=["className"],Jd=ue("div",{name:"MuiDataGrid",slot:"PanelContent"})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,padding:ct.spacing(2.5,1.5,2,1),gap:ct.spacing(2.5)});function ep(e){const{className:t}=e,n=s(e,Zd),r=Xe(),o=(e=>{const{classes:t}=e;return ie({root:["panelContent"]},_r,t)})(r);return i.jsx(Jd,a({className:O(o.root,t),ownerState:r},n))}const tp=["className"],np=h("div",{name:"MuiDataGrid",slot:"PanelFooter"})({padding:ct.spacing(1),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${ct.colors.border.base}`});function rp(e){const{className:t}=e,n=s(e,tp),r=Xe(),o=(e=>{const{classes:t}=e;return ie({root:["panelFooter"]},_r,t)})(r);return i.jsx(np,a({className:O(o.root,t),ownerState:r},n))}const op=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],ip=["InputComponentProps"],sp=h("div",{name:"MuiDataGrid",slot:"FilterForm"})({display:"flex",gap:ct.spacing(1.5)}),ap=h("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon"})({flexShrink:0,display:"flex",justifyContent:"center",alignItems:"center"}),lp=h("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput"})({minWidth:75,justifyContent:"end"}),up=h("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput"})({width:150}),cp=h("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput"})({width:150}),dp=h("div",{name:"MuiDataGrid",slot:"FilterFormValueInput"})({width:190}),pp=e=>e.headerName||e.field,hp=new Intl.Collator,fp=xe(function(t,n){const{item:r,hasMultipleFilters:o,deleteFilter:l,applyFilterChanges:u,showMultiFilterOperators:c,disableMultiFilterOperator:d,applyMultiFilterOperatorChanges:p,focusElementRef:h,logicOperators:f=[Ho.And,Ho.Or],columnsSort:g,filterColumns:m,deleteIconProps:b={},logicOperatorInputProps:v={},operatorInputProps:w={},columnInputProps:y={},valueInputProps:C={},readOnly:S}=t,M=s(t,op),R=Je(),I=so(R,ei),P=so(R,ci),k=so(R,fs),E=x(),T=x(),D=x(),F=x(),A=Xe(),H=(e=>{const{classes:t}=e;return ie({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},_r,t)})(A),$=e.useRef(null),z=e.useRef(null),L=k.logicOperator??Ho.And,j=o&&f.length>0,N=(A.slotProps?.baseSelect||{}).native??!1,G=A.slotProps?.baseSelectOption||{},{InputComponentProps:_}=C,V=s(C,ip),B=so(R,ml),W=so(R,vl),{filteredColumns:U,selectedField:K}=e.useMemo(()=>{let e=r.field;const t=!1===I[r.field].filterable?I[r.field]:null;if(t)return{filteredColumns:[t],selectedField:e};if(B)return{filteredColumns:P.filter(e=>void 0!==W.get(e.field)),selectedField:e};if(void 0===m||"function"!=typeof m)return{filteredColumns:P,selectedField:e};const n=m({field:r.field,columns:P,currentFilters:k?.items||[]});return{filteredColumns:P.filter(t=>{const o=n.includes(t.field);return t.field!==r.field||o||(e=void 0),o}),selectedField:e}},[r.field,I,B,m,P,k?.items,W]),q=e.useMemo(()=>{switch(g){case"asc":return U.sort((e,t)=>hp.compare(pp(e),pp(t)));case"desc":return U.sort((e,t)=>-hp.compare(pp(e),pp(t)));default:return U}},[U,g]),X=r.field?R.current.getColumn(r.field):null,Y=e.useMemo(()=>r.operator&&X?X.filterOperators?.find(e=>e.value===r.operator):null,[r,X]),Q=e.useCallback(e=>{const t=e.target.value,n=R.current.getColumn(t);if(n.field===X.field)return;const o=n.filterOperators.find(e=>e.value===r.operator)||n.filterOperators[0];let i=!o.InputComponent||o.InputComponent!==Y?.InputComponent||n.type!==X.type?void 0:r.value;if("singleSelect"===n.type&&void 0!==i){const e=n,t=Ta(e);Array.isArray(i)?i=i.filter(n=>void 0!==Da(n,t,e?.getOptionValue)):void 0===Da(r.value,t,e?.getOptionValue)&&(i=void 0)}u(a({},r,{field:t,operator:o.value,value:i}))},[R,u,r,X,Y]),Z=e.useCallback(e=>{const t=e.target.value,n=X?.filterOperators.find(e=>e.value===t);u(a({},r,{operator:t,value:!n?.InputComponent||n?.InputComponent!==Y?.InputComponent?void 0:r.value}))},[u,r,X,Y]),J=e.useCallback(e=>{const t=e.target.value===Ho.And.toString()?Ho.And:Ho.Or;p(t)},[p]);return e.useImperativeHandle(h,()=>({focus:()=>{Y?.InputComponent?$?.current?.focus():z.current.focus()}}),[Y]),i.jsxs(sp,a({className:H.root,"data-id":r.id,ownerState:A},M,{ref:n,children:[i.jsx(ap,a({},b,{className:O(H.deleteIcon,b.className),ownerState:A,children:i.jsx(A.slots.baseIconButton,a({"aria-label":R.current.getLocaleText("filterPanelDeleteIconLabel"),title:R.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:()=>{l(r)},size:"small",disabled:S},A.slotProps?.baseIconButton,{children:i.jsx(A.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),i.jsx(lp,a({as:A.slots.baseSelect,sx:[j?{display:"flex"}:{display:"none"},c?{visibility:"visible"}:{visibility:"hidden"},v.sx],className:O(H.logicOperatorInput,v.className),ownerState:A},v,{size:"small",slotProps:{htmlInput:{"aria-label":R.current.getLocaleText("filterPanelLogicOperator")}},value:L??"",onChange:J,disabled:!!d||1===f.length,native:N},A.slotProps?.baseSelect,{children:f.map(t=>e.createElement(A.slots.baseSelectOption,a({},G,{native:N,key:t.toString(),value:t.toString()}),R.current.getLocaleText((e=>{switch(e){case Ho.And:return"filterPanelOperatorAnd";case Ho.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}})(t))))})),i.jsx(up,a({as:A.slots.baseSelect},y,{className:O(H.columnInput,y.className),ownerState:A,size:"small",labelId:T,id:E,label:R.current.getLocaleText("filterPanelColumns"),value:K??"",onChange:Q,native:N,disabled:S},A.slotProps?.baseSelect,{children:q.map(t=>e.createElement(A.slots.baseSelectOption,a({},G,{native:N,key:t.field,value:t.field}),pp(t)))})),i.jsx(cp,a({as:A.slots.baseSelect,size:"small"},w,{className:O(H.operatorInput,w.className),ownerState:A,labelId:F,label:R.current.getLocaleText("filterPanelOperator"),id:D,value:r.operator,onChange:Z,native:N,inputRef:z,disabled:S},A.slotProps?.baseSelect,{children:X?.filterOperators?.map(t=>e.createElement(A.slots.baseSelectOption,a({},G,{native:N,key:t.value,value:t.value}),t.label||R.current.getLocaleText(`filterOperator${de(t.value)}`)))})),i.jsx(dp,a({},V,{className:O(H.valueInput,V.className),ownerState:A,children:Y?.InputComponent?i.jsx(Y.InputComponent,a({apiRef:R,item:r,applyValue:u,focusElementRef:$,disabled:S,slotProps:{root:{size:"small"}}},Y.InputComponentProps,_),r.field):null}))]}))}),gp=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],mp=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(1e5*Math.random())}),bp=xe(function(t,n){const r=Je(),o=Xe(),l=so(r,fs),u=so(r,ci),c=so(r,di),d=e.useRef(null),p=e.useRef(null),{logicOperators:h=[Ho.And,Ho.Or],columnsSort:f,filterFormProps:g,getColumnForNewFilter:m,disableAddFilterButton:b=!1,disableRemoveAllButton:v=!1}=t,w=s(t,gp),y=r.current.upsertFilterItem,x=e.useCallback(e=>{r.current.setFilterLogicOperator(e)},[r]),C=e.useCallback(()=>{let e;if(m&&"function"==typeof m){const t=m({currentFilters:l?.items||[],columns:u});if(null===t)return null;e=u.find(({field:e})=>e===t)}else e=u.find(e=>e.filterOperators?.length);return e?mp(e):null},[l?.items,u,m]),S=e.useCallback(()=>{if(void 0===m||"function"!=typeof m)return C();const e=l.items.length?l.items:[C()].filter(Boolean),t=m({currentFilters:e,columns:u});if(null===t)return null;const n=u.find(({field:e})=>e===t);return n?mp(n):null},[l.items,u,m,C]),M=e.useMemo(()=>l.items.length?l.items:(p.current||(p.current=C()),p.current?[p.current]:[]),[l.items,C]),R=M.length>1,{readOnlyFilters:I,validFilters:P}=e.useMemo(()=>M.reduce((e,t)=>(c[t.field]?e.validFilters.push(t):e.readOnlyFilters.push(t),e),{readOnlyFilters:[],validFilters:[]}),[M,c]),k=e.useCallback(()=>{const e=S();e&&r.current.upsertFilterItems([...M,e])},[r,S,M]),E=e.useCallback(e=>{const t=1===P.length;r.current.deleteFilterItem(e),t&&r.current.hideFilterPanel()},[r,P.length]),T=e.useCallback(()=>1===P.length&&void 0===P[0].value?(r.current.deleteFilterItem(P[0]),r.current.hideFilterPanel()):r.current.setFilterModel(a({},l,{items:I}),"removeAllFilterItems"),[r,I,l,P]);return e.useEffect(()=>{h.length>0&&l.logicOperator&&!h.includes(l.logicOperator)&&x(h[0])},[h,x,l.logicOperator]),e.useEffect(()=>{P.length>0&&d.current.focus()},[P.length]),i.jsxs(Ud,a({},w,{ref:n,children:[i.jsxs(ep,{children:[I.map((e,t)=>i.jsx(fp,a({item:e,applyFilterChanges:y,deleteFilter:E,hasMultipleFilters:R,showMultiFilterOperators:t>0,disableMultiFilterOperator:1!==t,applyMultiFilterOperatorChanges:x,focusElementRef:null,readOnly:!0,logicOperators:h,columnsSort:f},g),null==e.id?t:e.id)),P.map((e,t)=>i.jsx(fp,a({item:e,applyFilterChanges:y,deleteFilter:E,hasMultipleFilters:R,showMultiFilterOperators:I.length+t>0,disableMultiFilterOperator:I.length+t!==1,applyMultiFilterOperatorChanges:x,focusElementRef:t===P.length-1?d:null,logicOperators:h,columnsSort:f},g),null==e.id?t+I.length:e.id))]}),o.disableMultipleColumnsFiltering||b&&v?null:i.jsxs(rp,{children:[b?i.jsx("span",{}):i.jsx(o.slots.baseButton,a({onClick:k,startIcon:i.jsx(o.slots.filterPanelAddIcon,{})},o.slotProps?.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")})),!v&&P.length>0?i.jsx(o.slots.baseButton,a({onClick:T,startIcon:i.jsx(o.slots.filterPanelRemoveAllIcon,{})},o.slotProps?.baseButton,{children:r.current.getLocaleText("filterPanelRemoveAll")})):null]})]}))}),vp=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,wp=["children"],yp=pe({from:{opacity:0},to:{opacity:1}}),xp=pe({"from, to":{"--scrollable":'" "'}}),Cp=ue("div",{name:"MuiDataGrid",slot:"ShadowScrollArea"})`
2
+ flex: 1;
3
+ display: flex;
4
+ flex-direction: column;
5
+ animation: ${xp};
6
+ animation-timeline: --scroll-timeline;
7
+ animation-fill-mode: none;
8
+ box-sizing: border-box;
9
+ overflow: auto;
10
+ scrollbar-width: thin;
11
+ scroll-timeline: --scroll-timeline block;
12
+
13
+ &::before,
14
+ &::after {
15
+ content: '';
16
+ flex-shrink: 0;
17
+ display: block;
18
+ position: sticky;
19
+ left: 0;
20
+ width: 100%;
21
+ height: 4px;
22
+ animation: ${yp} linear both;
23
+ animation-timeline: --scroll-timeline;
24
+
25
+ // Custom property toggle trick:
26
+ // - Detects if the element is scrollable
27
+ // - https://css-tricks.com/the-css-custom-property-toggle-trick/
28
+ --visibility-scrollable: var(--scrollable) visible;
29
+ --visibility-not-scrollable: hidden;
30
+ visibility: var(--visibility-scrollable, var(--visibility-not-scrollable));
31
+ }
32
+
33
+ &::before {
34
+ top: 0;
35
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0, transparent 100%);
36
+ animation-range: 0 4px;
37
+ }
38
+
39
+ &::after {
40
+ bottom: 0;
41
+ background: linear-gradient(to top, rgba(0, 0, 0, 0.05) 0, transparent 100%);
42
+ animation-direction: reverse;
43
+ animation-range: calc(100% - 4px) 100%;
44
+ }
45
+ `,Sp=xe(function(e,t){const{children:n}=e,r=s(e,wp);return i.jsx(Cp,a({},r,{ref:t,children:n}))}),Mp=new Intl.Collator;const Rp=h("div",{name:"MuiDataGrid",slot:"ColumnsManagement"})({display:"flex",flexDirection:"column",padding:ct.spacing(.5,1.5)}),Ip=h(Sp,{name:"MuiDataGrid",slot:"ColumnsManagementScrollArea"})({maxHeight:300}),Pp=h("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader"})({padding:ct.spacing(1.5,2),borderBottom:`1px solid ${ct.colors.border.base}`}),kp=h(co,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput"})({[`& .${fe.input}::-webkit-search-decoration,\n & .${fe.input}::-webkit-search-cancel-button,\n & .${fe.input}::-webkit-search-results-button,\n & .${fe.input}::-webkit-search-results-decoration`]:{display:"none"}}),Ep=h("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter"})({padding:ct.spacing(1,1,1,1.5),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${ct.colors.border.base}`}),Tp=h("div",{name:"MuiDataGrid",slot:"ColumnsManagementEmptyText"})({padding:ct.spacing(1,0),alignSelf:"center",font:ct.typography.font.body}),Dp=h(co,{name:"MuiDataGrid",slot:"ColumnsManagementRow"})({}),Fp=xe(function(e,t){const{slotProps:n={}}=e,r=n.button||{},o=n.tooltip||{},s=x(),l=x(),u=Je(),c=Xe(),{columnsPanelTriggerRef:d}=Fc(),p=so(u,_l),h=A(t,d);if(c.disableColumnSelector)return null;const f=p.open&&p.panelId===l;return i.jsx(c.slots.baseTooltip,a({title:u.current.getLocaleText("toolbarColumnsLabel"),enterDelay:1e3},c.slotProps?.baseTooltip,o,{children:i.jsx(c.slots.baseButton,a({id:s,size:"small","aria-label":u.current.getLocaleText("toolbarColumnsLabel"),"aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?l:void 0,startIcon:i.jsx(c.slots.columnSelectorIcon,{})},c.slotProps?.baseButton,r,{onPointerUp:e=>{p.open&&e.stopPropagation(),r.onPointerUp?.(e)},onClick:e=>{p.open&&p.openedPanelValue===Bl.columns?u.current.hidePreferences():u.current.showPreferences(Bl.columns,l,s),r.onClick?.(e)},ref:h,children:u.current.getLocaleText("toolbarColumns")}))}))}),Ap=xe(function(t,n){const{slotProps:r={}}=t,o=r.button||{},s=r.tooltip||{},l=Je(),u=Xe(),c=so(l,lo),d=x(),p=x(),[h,f]=e.useState(!1),g=e.useRef(null),m=A(n,g),b=[{icon:i.jsx(u.slots.densityCompactIcon,{}),label:l.current.getLocaleText("toolbarDensityCompact"),value:"compact"},{icon:i.jsx(u.slots.densityStandardIcon,{}),label:l.current.getLocaleText("toolbarDensityStandard"),value:"standard"},{icon:i.jsx(u.slots.densityComfortableIcon,{}),label:l.current.getLocaleText("toolbarDensityComfortable"),value:"comfortable"}],v=e.useMemo(()=>{switch(c){case"compact":return i.jsx(u.slots.densityCompactIcon,{});case"comfortable":return i.jsx(u.slots.densityComfortableIcon,{});default:return i.jsx(u.slots.densityStandardIcon,{})}},[c,u]);if(u.disableDensitySelector)return null;const w=b.map((e,t)=>i.jsx(u.slots.baseMenuItem,{onClick:()=>{return t=e.value,l.current.setDensity(t),void f(!1);var t},selected:e.value===c,iconStart:e.icon,children:e.label},t));return i.jsxs(e.Fragment,{children:[i.jsx(u.slots.baseTooltip,a({title:l.current.getLocaleText("toolbarDensityLabel"),enterDelay:1e3},u.slotProps?.baseTooltip,s,{children:i.jsx(u.slots.baseButton,a({size:"small",startIcon:v,"aria-label":l.current.getLocaleText("toolbarDensityLabel"),"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?p:void 0,id:d},u.slotProps?.baseButton,o,{onClick:e=>{f(e=>!e),o.onClick?.(e)},ref:m,children:l.current.getLocaleText("toolbarDensity")}))})),i.jsx(Ni,{open:h,target:g.current,onClose:()=>{f(!1)},position:"bottom-end",children:i.jsx(u.slots.baseMenuList,{id:p,className:Vr.menuList,"aria-labelledby":d,autoFocusItem:h,children:w})})]})}),Op=h("ul",{name:"MuiDataGrid",slot:"ToolbarFilterList"})({margin:ct.spacing(1,1,.5),padding:ct.spacing(0,1)}),Hp=xe(function(t,n){const{slotProps:r={}}=t,o=r.button||{},s=r.tooltip||{},l=r.badge||{},u=Je(),c=Xe(),d=so(u,Is),p=so(u,ei),h=so(u,_l),f=(e=>{const{classes:t}=e;return ie({root:["toolbarFilterList"]},_r,t)})(c),g=x(),m=x(),{filterPanelTriggerRef:b}=Fc(),v=A(n,b),w=e.useMemo(()=>{if(h.open)return u.current.getLocaleText("toolbarFiltersTooltipHide");if(0===d.length)return u.current.getLocaleText("toolbarFiltersTooltipShow");const e=e=>p[e.field].filterOperators.find(t=>t.value===e.operator).label||u.current.getLocaleText(`filterOperator${de(e.operator)}`).toString(),t=e=>{const{getValueAsString:t}=p[e.field].filterOperators.find(t=>t.value===e.operator);return t?t(e.value):e.value};return i.jsxs("div",{children:[u.current.getLocaleText("toolbarFiltersTooltipActive")(d.length),i.jsx(Op,{className:f.root,ownerState:c,children:d.map((n,r)=>a({},p[n.field]&&i.jsx("li",{children:`${p[n.field].headerName||n.field}\n ${e(n)}\n ${null!=n.value?t(n):""}`},r)))})]})},[u,c,h.open,d,p,f]);if(c.disableColumnFilter)return null;const y=h.open&&h.panelId===m;return i.jsx(c.slots.baseTooltip,a({title:w,enterDelay:1e3},c.slotProps?.baseTooltip,s,{children:i.jsx(c.slots.baseButton,a({id:g,size:"small","aria-label":u.current.getLocaleText("toolbarFiltersLabel"),"aria-controls":y?m:void 0,"aria-expanded":y,"aria-haspopup":!0,startIcon:i.jsx(c.slots.baseBadge,a({badgeContent:d.length,color:"primary"},c.slotProps?.baseBadge,l,{children:i.jsx(c.slots.openFilterButtonIcon,{})}))},c.slotProps?.baseButton,o,{onClick:e=>{const{open:t,openedPanelValue:n}=h;t&&n===Bl.filters?u.current.hidePreferences():u.current.showPreferences(Bl.filters,m,g),o.onClick?.(e)},onPointerUp:e=>{h.open&&e.stopPropagation(),o.onPointerUp?.(e)},ref:v,children:u.current.getLocaleText("toolbarFilters")}))}))}),$p=xe(function(t,n){const{children:r,slotProps:o={}}=t,s=o.button||{},l=o.tooltip||{},u=Je(),c=Xe(),d=x(),p=x(),[h,f]=e.useState(!1),g=e.useRef(null),m=A(n,g),b=()=>f(!1);return null==r?null:i.jsxs(e.Fragment,{children:[i.jsx(c.slots.baseTooltip,a({title:u.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},c.slotProps?.baseTooltip,l,{children:i.jsx(c.slots.baseButton,a({size:"small",startIcon:i.jsx(c.slots.exportIcon,{}),"aria-expanded":h,"aria-label":u.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":h?p:void 0,id:d},c.slotProps?.baseButton,s,{onClick:e=>{f(e=>!e),s.onClick?.(e)},ref:m,children:u.current.getLocaleText("toolbarExport")}))})),i.jsx(Ni,{open:h,target:g.current,onClose:b,position:"bottom-end",children:i.jsx(c.slots.baseMenuList,{id:p,className:Vr.menuList,"aria-labelledby":d,autoFocusItem:h,children:e.Children.map(r,t=>e.isValidElement(t)?e.cloneElement(t,{hideMenu:b}):t)})})]})}),zp=["hideMenu","options"],Lp=["hideMenu","options"],jp=["csvOptions","printOptions","excelOptions"];function Np(e){const t=Je(),n=Xe(),{hideMenu:r,options:o}=e,l=s(e,zp);return i.jsx(n.slots.baseMenuItem,a({onClick:()=>{t.current.exportDataAsCsv(o),r?.()}},l,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Gp(e){const t=Je(),n=Xe(),{hideMenu:r,options:o}=e,l=s(e,Lp);return i.jsx(n.slots.baseMenuItem,a({onClick:()=>{t.current.exportDataAsPrint(o),r?.()}},l,{children:t.current.getLocaleText("toolbarExportPrint")}))}const _p=xe(function(t,n){const r=t,{csvOptions:o={},printOptions:l={},excelOptions:u}=r,c=s(r,jp),d=Je().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:u,csvOptions:o,printOptions:l}).sort((e,t)=>e.componentName>t.componentName?1:-1);return 0===d.length?null:i.jsx($p,a({},c,{ref:n,children:d.map((t,n)=>e.cloneElement(t.component,{key:n}))}))}),Vp=e.createContext(void 0);function Bp(){const t=e.useContext(Vp);if(void 0===t)throw new Error("MUI X: Missing context. Quick Filter subcomponents must be placed within a <QuickFilter /> component.");return t}const Wp=["render","className","parser","formatter","debounceMs","defaultExpanded","expanded","onExpandedChange"],Up=e=>e.split(" ").filter(e=>""!==e),Kp=e=>e.join(" ");function qp(t){const n=Xe(),{render:r,className:o,parser:l=Up,formatter:u=Kp,debounceMs:c=n.filterDebounceMs,defaultExpanded:d,expanded:p,onExpandedChange:h}=t,f=s(t,Wp),g=Je(),m=e.useRef(null),b=e.useRef(null),v=so(g,gs),[w,y]=e.useState(u(v??[])),[C,S]=e.useState(d??w.length>0),M=p??C,R=e.useMemo(()=>({value:w,expanded:M}),[w,M]),I="function"==typeof o?o(R):o,P=e.useRef(null),k=x(),E=e.useCallback(e=>{h&&h(e),void 0===p&&S(e)},[h,p]),T=e.useRef(v);e.useEffect(()=>{ql(T.current,v)||(T.current=v,y(e=>ql(l(e),v)?e:u(v??[])))},[v,u,l]);const D=e.useRef(!0),F=e.useRef(M);e.useEffect(()=>{D.current?D.current=!1:F.current!==M&&(M?requestAnimationFrame(()=>{m.current?.focus({preventScroll:!0})}):b.current?.focus({preventScroll:!0}),F.current=M)},[M]);const A=e.useMemo(()=>he(e=>{const t=l(e);T.current=t,g.current.setQuickFilterValues(t)},c),[g,c,l]);e.useEffect(()=>A.clear,[A]);const O=e.useCallback(e=>{const t=e.target.value;y(t),A(t)},[A]),H=e.useCallback(()=>{y(""),g.current.setQuickFilterValues([]),m.current?.focus()},[g,m]),$=e.useMemo(()=>({controlRef:m,triggerRef:b,state:R,controlId:k,clearValue:H,onValueChange:O,onExpandedChange:E}),[k,R,O,H,E]);oe(()=>{P.current&&b.current&&P.current.style.setProperty("--trigger-width",`${b.current?.offsetWidth}px`)},[]);const z=Bc("div",r,a({className:I},f,{ref:P}),R);return i.jsx(Vp.Provider,{value:$,children:z})}const Xp=["render","className","slotProps","onKeyDown","onChange"],Yp=xe(function(t,n){const{render:r,className:o,slotProps:l,onKeyDown:u,onChange:c}=t,d=s(t,Xp),p=Xe(),{state:h,controlId:f,controlRef:g,onValueChange:m,onExpandedChange:b,clearValue:v}=Bp(),w="function"==typeof o?o(h):o,y=A(g,n),x=Bc(p.slots.baseTextField,r,a({},p.slotProps?.baseTextField,{slotProps:a({htmlInput:a({role:"searchbox",id:f,tabIndex:h.expanded?void 0:-1},l?.htmlInput,{onBlur:e=>{""===h.value&&b(!1),l?.htmlInput?.onBlur?.(e)}})},l),value:h.value,className:w},d,{onChange:e=>{h.expanded||b(!0),m(e),c?.(e)},onKeyDown:e=>{"Escape"===e.key&&(""===h.value?b(!1):v()),u?.(e)},ref:y}),h);return i.jsx(e.Fragment,{children:x})}),Qp=["render","className","onClick"],Zp=xe(function(t,n){const{render:r,className:o,onClick:l}=t,u=s(t,Qp),c=Xe(),{state:d,clearValue:p}=Bp(),h="function"==typeof o?o(d):o,f=Bc(c.slots.baseIconButton,r,a({},c.slotProps?.baseIconButton,{className:h,tabIndex:-1},u,{onClick:e=>{p(),l?.(e)},ref:n}),d);return i.jsx(e.Fragment,{children:f})}),Jp=["render","className","onClick"],eh=xe(function(t,n){const{render:r,className:o,onClick:l}=t,u=s(t,Jp),c=Xe(),{state:d,controlId:p,onExpandedChange:h,triggerRef:f}=Bp(),g="function"==typeof o?o(d):o,m=A(f,n),b=Bc(c.slots.baseButton,r,a({},c.slotProps?.baseButton,{className:g,"aria-controls":p,"aria-expanded":d.expanded},u,{onClick:e=>{h(!d.expanded),l?.(e)},ref:m}),d);return i.jsx(e.Fragment,{children:b})}),th=["quickFilterParser","quickFilterFormatter","debounceMs","className","slotProps"],nh=["ref","slotProps"],rh=ue("div",{name:"MuiDataGrid",slot:"ToolbarQuickFilter"})({display:"grid",alignItems:"center"}),oh=ue(Qc,{name:"MuiDataGrid",slot:"ToolbarQuickFilterTrigger"})(({ownerState:e})=>({gridArea:"1 / 1",width:"min-content",height:"min-content",zIndex:1,opacity:e.expanded?0:1,pointerEvents:e.expanded?"none":"auto",transition:ct.transition(["opacity"])})),ih=ue(e=>{throw new Error("Failed assertion: should not be rendered")},{name:"MuiDataGrid",slot:"ToolbarQuickFilterControl"})(({ownerState:e})=>({gridArea:"1 / 1",overflowX:"clip",width:e.expanded?260:"var(--trigger-width)",opacity:e.expanded?1:0,transition:ct.transition(["width","opacity"])}));function sh(e){const t=Je(),n=Xe(),r={classes:n.classes,expanded:!1},o=(e=>{const{classes:t}=e;return ie({root:["toolbarQuickFilter"],trigger:["toolbarQuickFilterTrigger"],control:["toolbarQuickFilterControl"]},_r,t)})(r),{quickFilterParser:l,quickFilterFormatter:u,debounceMs:c,className:d,slotProps:p}=e,h=s(e,th);return i.jsx(qp,{parser:l,formatter:u,debounceMs:c,render:(e,l)=>{const u=a({},r,{expanded:l.expanded});return i.jsxs(rh,a({},e,{className:O(o.root,d),children:[i.jsx(eh,{render:e=>i.jsx(n.slots.baseTooltip,{title:t.current.getLocaleText("toolbarQuickFilterLabel"),enterDelay:0,children:i.jsx(oh,a({className:o.trigger},e,{ownerState:u,color:"default","aria-disabled":l.expanded,children:i.jsx(n.slots.quickFilterIcon,{fontSize:"small"})}))})}),i.jsx(Yp,{render:e=>{let{ref:r,slotProps:l}=e,c=s(e,nh);return i.jsx(ih,a({as:n.slots.baseTextField,className:o.control,ownerState:u,inputRef:r,"aria-label":t.current.getLocaleText("toolbarQuickFilterLabel"),placeholder:t.current.getLocaleText("toolbarQuickFilterPlaceholder"),size:"small",slotProps:a({input:a({startAdornment:i.jsx(n.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:c.value?i.jsx(Zp,{render:i.jsx(n.slots.baseIconButton,{size:"small",edge:"end","aria-label":t.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),children:i.jsx(n.slots.quickFilterClearIcon,{fontSize:"small"})})}):null},l?.input)},l)},n.slotProps?.baseTextField,c,p?.root,h))}})]}))}})}const ah=["render","className","onClick","onPointerUp"],lh=xe(function(t,n){const{render:r,className:o,onClick:l,onPointerUp:u}=t,c=s(t,ah),d=Xe(),p=x(),h=x(),f=Je(),g=so(f,_l),m=g.open&&g.openedPanelValue===Bl.filters,b=so(f,Is).length,v={open:m,filterCount:b},w="function"==typeof o?o(v):o,{filterPanelTriggerRef:y}=Fc(),C=A(n,y),S=Bc(d.slots.baseButton,r,a({},d.slotProps?.baseButton,{id:p,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?h:void 0,onClick:e=>{m?f.current.hidePreferences():f.current.showPreferences(Bl.filters,h,p),l?.(e)},onPointerUp:e=>{m&&e.stopPropagation(),u?.(e)},className:w},c,{ref:C}),v);return i.jsx(e.Fragment,{children:S})}),uh=["render","className","onClick","onPointerUp"],ch=xe(function(t,n){const{render:r,className:o,onClick:l,onPointerUp:u}=t,c=s(t,uh),d=Xe(),p=x(),h=x(),f=Je(),g=so(f,_l),m=g.open&&g.openedPanelValue===Bl.columns,b={open:m},v="function"==typeof o?o(b):o,{columnsPanelTriggerRef:w}=Fc(),y=A(n,w),C=Bc(d.slots.baseButton,r,a({},d.slotProps?.baseButton,{id:p,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?h:void 0,className:v},c,{onPointerUp:e=>{m&&e.stopPropagation(),u?.(e)},onClick:e=>{m?f.current.hidePreferences():f.current.showPreferences(Bl.columns,h,p),l?.(e)},ref:y}),b);return i.jsx(e.Fragment,{children:C})}),dh=["render","options","onClick"],ph=xe(function(t,n){const{render:r,options:o,onClick:l}=t,u=s(t,dh),c=Xe(),d=Je(),p=Bc(c.slots.baseButton,r,a({},c.slotProps?.baseButton,{onClick:e=>{d.current.exportDataAsCsv(o),l?.(e)}},u,{ref:n}));return i.jsx(e.Fragment,{children:p})}),hh=["render","options","onClick"],fh=xe(function(t,n){const{render:r,options:o,onClick:l}=t,u=s(t,hh),c=Xe(),d=Je(),p=Bc(c.slots.baseButton,r,a({},c.slotProps?.baseButton,{onClick:e=>{d.current.exportDataAsPrint(o),l?.(e)}},u,{ref:n}));return i.jsx(e.Fragment,{children:p})}),gh=["className"],mh=["className"],bh=["showQuickFilter","quickFilterProps","csvOptions","printOptions","additionalItems","additionalExportMenuItems"],vh=e=>{const{classes:t}=e;return ie({divider:["toolbarDivider"],label:["toolbarLabel"]},_r,t)},wh=ue(co,{name:"MuiDataGrid",slot:"ToolbarDivider"})({height:"50%",margin:ct.spacing(0,.5)}),yh=ue("span",{name:"MuiDataGrid",slot:"ToolbarLabel"})({flex:1,font:ct.typography.font.large,fontWeight:ct.typography.fontWeight.medium,margin:ct.spacing(0,.5),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"});function xh(e){const t=s(e,gh),n=Xe(),r=vh(n);return i.jsx(wh,a({as:n.slots.baseDivider,orientation:"vertical",className:r.divider},t))}function Ch(e){const t=s(e,mh),n=Xe(),r=vh(n);return i.jsx(yh,a({className:r.label},t))}const Sh=["className","selectedRowCount"],Mh=ue("div",{name:"MuiDataGrid",slot:"SelectedRowCount"})({alignItems:"center",display:"flex",margin:ct.spacing(0,2),visibility:"hidden",width:0,height:0,[ct.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}}),Rh=xe(function(e,t){const{className:n,selectedRowCount:r}=e,o=s(e,Sh),l=Je(),u=Xe(),c=(e=>{const{classes:t}=e;return ie({root:["selectedRowCount"]},_r,t)})(u),d=l.current.getLocaleText("footerRowSelected")(r);return i.jsx(Mh,a({className:O(c.root,n),ownerState:u},o,{ref:t,children:d}))}),Ih=xe(function(e,t){const n=Je(),r=Xe(),o=so(n,pr),s=so(n,Ds),l=so(n,Ms),u=!r.hideFooterSelectedRowCount&&s>0?i.jsx(Rh,{selectedRowCount:s}):i.jsx("div",{}),c=r.hideFooterRowCount||r.pagination?null:i.jsx(r.slots.footerRowCount,a({},r.slotProps?.footerRowCount,{rowCount:o,visibleRowCount:l})),d=r.pagination&&!r.hideFooterPagination&&r.slots.pagination&&i.jsx(r.slots.pagination,a({},r.slotProps?.pagination));return i.jsxs(Nc,a({},e,{ref:t,children:[u,c,d]}))}),Ph=(e,t,n,r,o,i)=>{let s;switch(e){case Qi.LEFT:s=r[n];break;case Qi.RIGHT:s=o-r[n]-t+i;break;default:s=void 0}return Number.isNaN(s)&&(s=void 0),s},kh=(e,t,n,r,o,i)=>{const s=t===n-1;return!(!i?.startsWith("border")||e!==Qi.LEFT||!s)||!!r&&(e===Qi.LEFT||(e===Qi.RIGHT?!s:!s||o))},Eh=(e,t,n,r)=>r?.startsWith("border")?e===Qi.RIGHT&&0===t:n&&e===Qi.RIGHT&&0===t,Th=["skeletonRowsCount","visibleColumns","showFirstRowBorder"],Dh=ue("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay"})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),Fh=e=>parseInt(e.getAttribute("data-colindex"),10),Ah=xe(function(t,n){const r=Xe(),{slots:o}=r,l=ae(),u=(e=>{const{classes:t}=e;return ie({root:["skeletonLoadingOverlay"]},_r,t)})({classes:r.classes}),c=e.useRef(null),d=A(c,n),p=Je(),h=so(p,Qn),f=so(p,Zn),g=so(p,ui),m=e.useMemo(()=>g.filter(e=>e<=f).length,[f,g]),{skeletonRowsCount:b,visibleColumns:v,showFirstRowBorder:w}=t,y=s(t,Th),x=so(p,oi),C=e.useMemo(()=>x.slice(0,m),[x,m]),S=so(p,ai),M=e.useCallback(e=>-1!==S.left.findIndex(t=>t.field===e)?Qi.LEFT:-1!==S.right.findIndex(t=>t.field===e)?Qi.RIGHT:void 0,[S.left,S.right]),R=e.useMemo(()=>{const e=[];for(let t=0;t<b;t+=1){const n=[];for(let e=0;e<C.length;e+=1){const s=C[e],u=M(s.field),c=u===Qi.LEFT,d=u===Qi.RIGHT,p=pc(u,l),f=p?S[p].length:C.length-S.left.length-S.right.length,m=p?S[p].findIndex(e=>e.field===s.field):e-S.left.length,b=h.hasScrollY?h.scrollbarSize:0,w=hc({},l,u,Ph(u,s.computedWidth,e,g,h.columnsTotalWidth,b)),y=h.columnsTotalWidth<h.viewportOuterSize.width,x=kh(u,m,f,r.showCellVerticalBorder,y,r.pinnedColumnsSectionSeparator),R=Eh(u,m,r.showCellVerticalBorder,r.pinnedColumnsSectionSeparator),I=d&&0===m,P=I&&y,k=e===C.length-1&&!I&&y,E=h.viewportOuterSize.width-h.columnsTotalWidth,T=Math.max(0,E),D=i.jsx(o.skeletonCell,{width:T,empty:!0},`skeleton-filler-column-${t}`);P&&n.push(D),n.push(i.jsx(o.skeletonCell,{field:s.field,type:s.type,align:s.align,width:"var(--width)",height:h.rowHeight,"data-colindex":e,empty:v&&!v.has(s.field),className:O(c&&Vr["cell--pinnedLeft"],d&&Vr["cell--pinnedRight"],x&&Vr["cell--withRightBorder"],R&&Vr["cell--withLeftBorder"]),style:a({"--width":`${s.computedWidth}px`},w)},`skeleton-column-${t}-${s.field}`)),k&&n.push(D)}e.push(i.jsx("div",{className:O(Vr.row,Vr.rowSkeleton,0===t&&!w&&Vr["row--firstVisible"]),children:n},`skeleton-row-${t}`))}return e},[b,C,M,l,S,h.hasScrollY,h.scrollbarSize,h.columnsTotalWidth,h.viewportOuterSize.width,h.rowHeight,g,r.showCellVerticalBorder,r.pinnedColumnsSectionSeparator,o,v,w]);return Yr(p,"columnResize",e=>{const{colDef:t,width:n}=e,r=c.current?.querySelectorAll(`[data-field="${od(t.field)}"]`);if(!r)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const o=C.findIndex(e=>e.field===t.field),i=M(t.field),s=i===Qi.LEFT,a=i===Qi.RIGHT,l=getComputedStyle(r[0]).getPropertyValue("--width"),u=parseInt(l,10)-n;if(r&&r.forEach(e=>{e.style.setProperty("--width",`${n}px`)}),s){const e=c.current?.querySelectorAll(`.${Vr["cell--pinnedLeft"]}`);e?.forEach(e=>{Fh(e)>o&&(e.style.left=parseInt(getComputedStyle(e).left,10)-u+"px")})}if(a){const e=c.current?.querySelectorAll(`.${Vr["cell--pinnedRight"]}`);e?.forEach(e=>{Fh(e)<o&&(e.style.right=`${parseInt(getComputedStyle(e).right,10)+u}px`)})}}),i.jsx(Dh,a({className:u.root},y,{ref:d,children:R}))}),Oh=xe(function(e,t){const n=so(Je(),Qn),r=n?.viewportInnerSize.height??0,o=Math.ceil(r/n.rowHeight);return i.jsx(Ah,a({},e,{skeletonRowsCount:o,ref:t}))}),Hh=["variant","noRowsVariant","style"],$h={"circular-progress":{component:e=>e.slots.baseCircularProgress,style:{}},"linear-progress":{component:e=>e.slots.baseLinearProgress,style:{display:"block"}},skeleton:{component:()=>Oh,style:{display:"block"}}},zh=xe(function(e,t){const{variant:n="linear-progress",noRowsVariant:r="skeleton",style:o}=e,l=s(e,Hh),u=Je(),c=Xe(),d=so(u,cr),p=$h[0===d?r:n],h=p.component(c);return i.jsx(Vc,a({style:a({},p.style,o)},l,{ref:t,children:i.jsx(h,{})}))}),Lh=xe(function(e,t){const n=Je().current.getLocaleText("noRowsLabel");return i.jsx(Vc,a({},e,{ref:t,children:n}))}),jh=xe(function(e,t){const n=Xe(),r=Je(),o=so(r,Jo),s=!n.disableColumnSelector&&o.length>0;return i.jsxs(Vc,a({},e,{ref:t,children:[r.current.getLocaleText("noColumnsOverlayLabel"),s&&i.jsx(n.slots.baseButton,a({size:"small"},n.slotProps?.baseButton,{onClick:()=>{r.current.showPreferences(Bl.columns)},children:r.current.getLocaleText("noColumnsOverlayManageColumns")}))]}))}),Nh=h(co)({maxHeight:"calc(100% + 1px)",flexGrow:1});const Gh=["className","rowCount","visibleRowCount"],_h=ue("div",{name:"MuiDataGrid",slot:"RowCount"})({alignItems:"center",display:"flex",margin:ct.spacing(0,2)}),Vh=xe(function(e,t){const{className:n,rowCount:r,visibleRowCount:o}=e,l=s(e,Gh),u=Je(),c=Xe(),d=(e=>{const{classes:t}=e;return ie({root:["rowCount"]},_r,t)})(c);if(0===r)return null;const p=o<r?u.current.getLocaleText("footerTotalVisibleRows")(o,r):r.toLocaleString();return i.jsxs(_h,a({className:O(d.root,n),ownerState:c},l,{ref:t,children:[u.current.getLocaleText("footerTotalRows")," ",p]}))});const Bh=Xn(e=>e.rowReorder),Wh=Kn(Bh,e=>e?.isActive??!1),Uh=Kn(Bh,e=>e?.dropTarget??{rowId:null,position:null});Kn(Uh,e=>e.rowId??null);const Kh=Kn(Uh,(e,t)=>e.rowId===t?e.position:null);Kn(Bh,e=>e?.draggedRowId??null);const qh=h("div",{name:"MuiDataGrid",slot:"RowDragOverlay",shouldForwardProp:e=>ge(e)&&"action"!==e})(({theme:e,action:t})=>a({position:"absolute",left:0,right:0,top:0,bottom:0,pointerEvents:"none",zIndex:1},"above"===t&&{"&::before":{pointerEvents:"none",content:'""',position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},"below"===t&&{"&::after":{pointerEvents:"none",content:'""',position:"absolute",bottom:"-2px",left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},"inside"===t&&{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.1)`:u(e.palette.primary.main,.1)})),Xh=e.memo(function(e){const{rowId:t,className:n}=e,r=so(ul(),Kh,t);return r?i.jsx(qh,{action:r,className:n}):null}),Yh=["selected","rowId","row","index","style","rowHeight","className","visibleColumns","pinnedColumns","offsetLeft","columnsTotalWidth","firstColumnIndex","lastColumnIndex","focusedColumnIndex","isFirstVisible","isLastVisible","isNotVisible","showBottomBorder","scrollbarWidth","gridHasFiller","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],Qh=Kn(jl,(e,{rowReordering:t,treeData:n})=>{if(!t||n)return!1;return!!as(e)}),Zh=Nr(xe(function(t,n){const{selected:r,rowId:o,row:l,index:u,style:c,rowHeight:d,className:p,visibleColumns:h,pinnedColumns:f,offsetLeft:g,columnsTotalWidth:m,firstColumnIndex:b,lastColumnIndex:v,focusedColumnIndex:w,isFirstVisible:y,isLastVisible:x,isNotVisible:C,showBottomBorder:S,scrollbarWidth:M,gridHasFiller:R,onClick:I,onDoubleClick:P,onMouseEnter:k,onMouseLeave:E,onMouseOut:T,onMouseOver:D}=t,F=s(t,Yh),H=ul(),$=Oi(),z=e.useRef(null),L=Xe(),j=Xu(H),N=so(H,ds),G=so(H,ui),_=L.rowReordering,V=L.treeData,B=so(H,Qh,{rowReordering:_,treeData:V}),W=so(H,Wh),U=A(z,n),K=gr(H,o),q=so(H,Nl,{rowId:o,editMode:L.editMode}),X=L.editMode===Fo.Row,Y=void 0!==w,Q=Y&&w>=f.left.length&&w<b,Z=Y&&w<h.length-f.right.length&&w>=v,J=function(e,t){return ie(t,_r,e)}(L.classes,{root:["row",r&&"selected",X&&"row--editable",q&&"row--editing",y&&"row--firstVisible",x&&"row--lastVisible",S&&"row--borderBottom","auto"===d&&"row--dynamicHeight"]}),ee=$.hooks.useGridRowAriaAttributes();e.useLayoutEffect(()=>{if(j.range){const e=H.current.getRowIndexRelativeToVisibleRows(o);void 0!==e&&H.current.unstable_setLastMeasuredRowIndex(e)}if(z.current&&"auto"===d)return H.current.observeRowHeight(z.current,o)},[H,j.range,d,o]);const te=e.useCallback((e,t)=>n=>{sd(n)||H.current.getRow(o)&&(H.current.publishEvent(e,H.current.getRowParams(o),n),t&&t(n))},[H,o]),ne=e.useCallback(e=>{const t=rd(e.target,Vr.cell),n=t?.getAttribute("data-field");if(n){if(n===fa.field)return;if(n===Yi)return;if("__reorder__"===n)return;if(H.current.getCellMode(o,n)===Ao.Edit)return;const e=H.current.getColumn(n);if(e?.type===Ki)return}te("rowClick",I)(e)},[H,I,te,o]),{slots:re,slotProps:oe,disableColumnReorder:se}=L,ae=so(H,()=>a({},H.current.getRowHeightEntry(o)),void 0,to),le=e.useMemo(()=>{if(C)return{opacity:0,width:0,height:0};const e=a({},c,{maxHeight:"auto"===d?"none":d,minHeight:d,"--height":"number"==typeof d?`${d}px`:d});if(ae.spacingTop){e["border"===L.rowSpacingType?"borderTopWidth":"marginTop"]=ae.spacingTop}if(ae.spacingBottom){const t="border"===L.rowSpacingType?"borderBottomWidth":"marginBottom";let n=e[t];"number"!=typeof n&&(n=parseInt(n||"0",10)),n+=ae.spacingBottom,e[t]=n}return e},[C,d,c,ae.spacingTop,ae.spacingBottom,L.rowSpacingType]);if(!K)return null;const ue=H.current.unstable_applyPipeProcessors("rowClassName",[],o),ce=ee(K,u);if("function"==typeof L.getRowClassName){const e=u-(j.range?.firstRowIndex||0),t=a({},H.current.getRowParams(o),{isFirstVisible:0===e,isLastVisible:e===j.rows.length-1,indexRelativeToCurrentPage:e});ue.push(L.getRowClassName(t))}const de=(e,t,n,r,s=Qi.NONE)=>{const u=H.current.unstable_getCellColSpanInfo(o,n);if(u?.spannedByColSpan)return null;const c=u?.cellProps.width??e.computedWidth,p=u?.cellProps.colSpan??1,h=Ph(s,e.computedWidth,n,G,m,M);if("skeletonRow"===K.type)return i.jsx(re.skeletonCell,{type:e.type,width:c,height:d,field:e.field,align:e.align},e.field);const f="__reorder__"===e.field,g=!(se||e.disableReorder),b=B&&!N.length,v=!(g||f&&b||W),w=s===Qi.VIRTUAL,y=Eh(s,t,L.showCellVerticalBorder,L.pinnedColumnsSectionSeparator),x=kh(s,t,r,L.showCellVerticalBorder,R,L.pinnedColumnsSectionSeparator);return i.jsx(re.cell,a({column:e,width:c,rowId:o,align:e.align||"left",colIndex:n,colSpan:p,disableDragEvents:v,isNotVisible:w,pinnedOffset:h,pinnedPosition:s,showLeftBorder:y,showRightBorder:x,row:l,rowNode:K},oe?.cell),e.field)},pe=f.left.map((e,t)=>de(e,t,t,f.left.length,Qi.LEFT)),he=f.right.map((e,t)=>{const n=h.length-f.right.length+t;return de(e,t,n,f.right.length,Qi.RIGHT)}),fe=h.length-f.left.length-f.right.length,ge=[];Q&&ge.push(de(h[w],w-f.left.length,w,fe,Qi.VIRTUAL));for(let e=b;e<v;e+=1){const t=h[e],n=e-f.left.length;t&&ge.push(de(t,n,e,fe))}Z&&ge.push(de(h[w],w-f.left.length,w,fe,Qi.VIRTUAL));const me=l?{onClick:ne,onDoubleClick:te("rowDoubleClick",P),onMouseEnter:te("rowMouseEnter",k),onMouseLeave:te("rowMouseLeave",E),onMouseOut:te("rowMouseOut",T),onMouseOver:te("rowMouseOver",D)}:null;return i.jsxs("div",a({"data-id":o,"data-rowindex":u,role:"row",className:O(...ue,J.root,p),style:le},ce,me,F,{ref:U,children:[pe,i.jsx("div",{role:"presentation",className:Vr.cellOffsetLeft,style:{width:g}}),ge,i.jsx("div",{role:"presentation",className:O(Vr.cell,Vr.cellEmpty)}),he,i.jsx(Xh,{rowId:o})]}))}));function Jh({privateApiRef:t,configuration:n,props:r,children:o}){const s=e.useRef(t.current.getPublicApi());return i.jsx(Ai.Provider,{value:n,children:i.jsx(qe.Provider,{value:r,children:i.jsx(ll.Provider,{value:t,children:i.jsx(Ze.Provider,{value:s,children:i.jsx(Ac,{children:i.jsx(zi,{children:o})})})})})})}const ef=function(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}()&&null!=window.localStorage.getItem("DEBUG"),tf=()=>{},nf={debug:tf,info:tf,warn:tf,error:tf},rf=["debug","info","warn","error"];function of(e,t,n=console){const r=rf.indexOf(t);if(-1===r)throw new Error(`MUI X: Log level ${t} not recognized.`);return rf.reduce((t,o,i)=>(t[o]=i>=r?(...t)=>{const[r,...i]=t;n[o](`MUI X: ${e} - ${r}`,...i)}:tf,t),{})}let sf=function(e){return e.DataSource="dataSource",e.RowTree="rowTree",e}({});const af=(t,n,r,o)=>{const i=e.useCallback(()=>{t.current.registerStrategyProcessor(n,r,o)},[t,o,r,n]);fl(()=>{i()});const s=e.useRef(!0);e.useEffect(()=>{s.current?s.current=!1:i()},[i])},lf="none",uf={dataSourceRowsUpdate:sf.DataSource,rowTreeCreation:sf.RowTree,filtering:sf.RowTree,sorting:sf.RowTree,visibleRowsLookupCreation:sf.RowTree},cf=(e,t)=>a({},e,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable}}),df=(t,n)=>{(t=>{const n=e.useRef(null),r=e.useRef(null),o=e.useRef(null),i=e.useRef(null),s=e.useRef(null),a=e.useRef(null);t.current.register("public",{rootElementRef:n}),t.current.register("private",{mainElementRef:r,virtualScrollerRef:o,virtualScrollbarVerticalRef:i,virtualScrollbarHorizontalRef:s,columnHeadersContainerRef:a})})(t),((t,n)=>{const r=e.useRef(!0);e.useEffect(()=>{r.current?r.current=!1:t.current.setState(e=>a({},e,{props:{listView:n.listView,getRowId:n.getRowId,isCellEditable:n.isCellEditable,isRowSelectable:n.isRowSelectable}}))},[t,n.listView,n.getRowId,n.isCellEditable,n.isRowSelectable])})(t,n),(t=>{const n=ae();void 0===t.current.state.isRtl&&(t.current.state.isRtl=n);const r=e.useRef(!0);e.useEffect(()=>{r.current?r.current=!1:t.current.setState(e=>a({},e,{isRtl:n}))},[t,n])})(t),((t,n)=>{dl(t,{getLogger:e.useCallback(e=>ef?of(e,"debug",n.logger):n.logLevel?of(e,n.logLevel.toString(),n.logger):nf,[n.logLevel,n.logger])},"private")})(t,n),(t=>{const n=e.useRef({}),r=e.useCallback(e=>{n.current[e.stateId]=e},[]),o=e.useCallback((e,r)=>{let o;if(o="function"==typeof e?e(t.current.state):e,t.current.state===o)return!1;const i={current:{state:o}};let s=!1;const a=[];if(Object.keys(n.current).forEach(e=>{const r=n.current[e],o=r.stateSelector(t),l=r.stateSelector(i);l!==o&&(a.push({stateId:r.stateId,hasPropChanged:l!==r.propModel}),void 0!==r.propModel&&l!==r.propModel&&(s=!0))}),a.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${a[0].stateId}, therefore, you're not allowed to update ${a.map(e=>e.stateId).join(", ")} in the same transaction.`);if(s||(t.current.state=o,t.current.publishEvent("stateChange",o),t.current.store.update(o)),1===a.length){const{stateId:e,hasPropChanged:o}=a[0],l=n.current[e],u=l.stateSelector(i);l.propOnChange&&o&&l.propOnChange(u,{reason:r,api:t.current}),s||t.current.publishEvent(l.changeEvent,u,{reason:r})}return!s},[t]),i={updateControlState:e.useCallback((e,n,r)=>t.current.setState(t=>a({},t,{[e]:n(t[e])}),r),[t]),registerControlState:r};dl(t,{setState:o},"public"),dl(t,i,"private")})(t),(t=>{const n=e.useRef({}),r=e.useRef(!1),o=e.useCallback(e=>{!r.current&&e&&(r.current=!0,Object.values(e.appliers).forEach(e=>{e()}),r.current=!1)},[]),i=e.useCallback((e,t,r)=>{n.current[e]||(n.current[e]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1});const o=n.current[e];return o.processors.get(t)!==r&&(o.processors.set(t,r),o.processorsAsArray=Array.from(n.current[e].processors.values()).filter(e=>null!==e),o.processorsUpdated=!0),()=>{n.current[e].processors.set(t,null),n.current[e].processorsAsArray=Array.from(n.current[e].processors.values()).filter(e=>null!==e)}},[]),a=e.useCallback((e,t,r)=>(n.current[e]||(n.current[e]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1}),n.current[e].appliers[t]=r,()=>{const r=n.current[e].appliers,o=s(r,[t].map(Ju));n.current[e].appliers=o}),[]),l=e.useCallback(e=>{o(n.current[e])},[o]),u=e.useCallback(()=>{for(const e in n.current){if(!Object.prototype.hasOwnProperty.call(n.current,e))continue;const t=n.current[e];t.processorsUpdated&&(t.processorsUpdated=!1,o(t))}},[o]),c={unstable_applyPipeProcessors:e.useCallback((...e)=>{const[t,r,o]=e;if(!n.current[t])return r;const i=n.current[t].processorsAsArray;let s=r;for(let n=0;n<i.length;n+=1)s=i[n](s,o);return s},[])};dl(t,{registerPipeProcessor:i,registerPipeApplier:a,requestPipeProcessorsApplication:l,runAppliersForPendingProcessors:u},"private"),dl(t,c,"public")})(t),(t=>{const n=e.useRef(new Map),r=e.useRef({}),o=e.useCallback((e,n,o)=>{const i=()=>{const t=r.current[n],o=s(t,[e].map(Ju));r.current[n]=o};r.current[n]||(r.current[n]={});const a=r.current[n],l=a[e];return a[e]=o,l&&l!==o?(e===t.current.getActiveStrategy(uf[n])&&t.current.publishEvent("activeStrategyProcessorChange",n),i):i},[t]),i=e.useCallback((e,n)=>{const o=t.current.getActiveStrategy(uf[e]);if(null==o)throw new Error("Can't apply a strategy processor before defining an active strategy");const i=r.current[e];if(!i||!i[o])throw new Error(`No processor found for processor "${e}" on strategy "${o}"`);return(0,i[o])(n)},[t]),a=e.useCallback(e=>{const t=Array.from(n.current.entries()).find(([,t])=>t.group===e&&t.isAvailable());return t?.[0]??lf},[]),l=e.useCallback((e,r,o)=>{n.current.set(r,{group:e,isAvailable:o}),t.current.publishEvent("strategyAvailabilityChange")},[t]);dl(t,{registerStrategyProcessor:o,applyStrategyProcessor:i,getActiveStrategy:a,setStrategyAvailability:l},"private")})(t),((t,n)=>{const r=e.useCallback(e=>{if(null==n.localeText[e])throw new Error(`Missing translation for key ${e}.`);return n.localeText[e]},[n.localeText]);t.current.register("public",{getLocaleText:r})})(t,n),t.current.register("private",{rootProps:n})},pf=(t,n,r,o)=>{const i=e.useRef(o),s=e.useRef(!1);o!==i.current&&(s.current=!1,i.current=o),s.current||(n.current.state=t(n.current.state,r,n),s.current=!0)};function hf(e,t){if(null==e)return"";const n="string"==typeof e?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const e=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@","\t","\r"].includes(e[0])?`"'${e}"`:[t.delimiter,"\n","\r",'"'].some(e=>n.includes(e))?`"${e}"`:e}return n}const ff=(e,t)=>{const{csvOptions:n,ignoreValueFormatter:r}=t;let o;if(r){const t=e.colDef.type;o="number"===t?String(e.value):"date"===t||"dateTime"===t?e.value?.toISOString():"function"==typeof e.value?.toString?e.value.toString():e.value}else o=e.formattedValue;return hf(o,n)};class gf{rowString="";isEmpty=!0;constructor(e){this.options=e}addValue(e){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),"function"==typeof this.options.sanitizeCellValue?this.rowString+=this.options.sanitizeCellValue(e,this.options.csvOptions):this.rowString+=e,this.isEmpty=!1}getRowString(){return this.rowString}}function mf(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:o,apiRef:i}=e,s=n.reduce((e,n)=>`${e}${(({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:o})=>{const i=new gf({csvOptions:r});return t.forEach(t=>{const s=n(e,t.field);String(s.formattedValue),i.addValue(ff(s,{ignoreValueFormatter:o,csvOptions:r}))}),i.getRowString()})({id:n,columns:t,getCellParams:i.current.getCellParams,ignoreValueFormatter:o,csvOptions:r})}\r\n`,"").trim();if(!r.includeHeaders)return s;const a=t.filter(e=>e.field!==fa.field),l=[];if(r.includeColumnGroupsHeaders){const e=i.current.getAllGroupDetails();let t=0;const n=a.reduce((e,n)=>{const r=i.current.getColumnGroupPath(n.field);return e[n.field]=r,t=Math.max(t,r.length),e},{});for(let o=0;o<t;o+=1){const t=new gf({csvOptions:r,sanitizeCellValue:hf});l.push(t),a.forEach(r=>{const i=(n[r.field]||[])[o],s=e[i];t.addValue(s?s.headerName||s.groupId:"")})}}const u=new gf({csvOptions:r,sanitizeCellValue:hf});a.forEach(e=>{u.addValue(e.headerName||e.field)}),l.push(u);return`${`${l.map(e=>e.getRowString()).join("\r\n")}\r\n`}${s}`.trim()}function bf(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const vf=(t,n)=>{const r=n.ignoreValueFormatterDuringExport,o=("object"==typeof r?r?.clipboardExport:r)||!1,i=n.clipboardCopyCellDelimiter,s=e.useCallback(e=>{if(!function(e){return(e.ctrlKey||e.metaKey)&&"C"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey}(e))return;if(n=e.target,window.getSelection()?.toString()||n&&(n.selectionEnd||0)-(n.selectionStart||0)>0)return;var n;let r="";if(Ds(t)>0)r=t.current.getDataAsCsv({includeHeaders:!1,delimiter:i,shouldAppendQuotes:!1,escapeFormulas:!1});else{const e=Vs(t);if(e){const n=t.current.getCellParams(e.id,e.field);r=ff(n,{csvOptions:{delimiter:i,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:o})}}var s;r=t.current.unstable_applyPipeProcessors("clipboardCopy",r),r&&(s=r,navigator.clipboard?navigator.clipboard.writeText(s).catch(()=>{bf(s)}):bf(s),t.current.publishEvent("clipboardCopy",r))},[t,o,i]);hl(t,()=>t.current.rootElementRef.current,"keydown",s),Zr(t,"clipboardCopy",n.onClipboardCopy)},wf=e=>a({},e,{columnMenu:{open:!1}}),yf=(e,t,n)=>{n.current.caches.columns={lastColumnsProp:t.columns};const r=el({apiRef:n,columnsToUpsert:t.columns,initialState:t.initialState?.columns,columnVisibilityModel:t.columnVisibilityModel??t.initialState?.columns?.columnVisibilityModel??{},keepOnlyColumnsToUpsert:!0});return a({},e,{columns:r,pinnedColumns:e.pinnedColumns??qo})};function xf(t,n){const r=pl(t,"useGridColumns");t.current.registerControlState({stateId:"visibleColumns",propModel:n.columnVisibilityModel,propOnChange:n.onColumnVisibilityModelChange,stateSelector:ni,changeEvent:"columnVisibilityModelChange"});const o=e.useCallback(e=>{r.debug("Updating columns state."),t.current.setState(function(e){return t=>a({},t,{columns:e})}(e)),t.current.publishEvent("columnsChange",e.orderedFields)},[r,t]),s=e.useCallback(e=>ei(t)[e],[t]),l=e.useCallback(()=>ti(t),[t]),u=e.useCallback(()=>oi(t),[t]),c=e.useCallback((e,n=!0)=>(n?oi(t):ti(t)).findIndex(t=>t.field===e),[t]),d=e.useCallback(e=>{const n=c(e);return ui(t)[n]},[t,c]),p=e.useCallback(e=>{ni(t)!==e&&(t.current.setState(n=>a({},n,{columns:el({apiRef:t,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:e,keepOnlyColumnsToUpsert:!1})})),t.current.updateRenderContext?.())},[t]),h=e.useCallback(e=>{let n=e;if(ml(t)){const r=[],o=[],i=vl(t);if(e.forEach(e=>{i.has(e.field)?r.push(e):o.push(e)}),r.length>0&&t.current.updateNonPivotColumns(r),0===o.length)return;n=o}const r=el({apiRef:t,columnsToUpsert:n,initialState:void 0,keepOnlyColumnsToUpsert:!1,updateInitialVisibilityModel:!0});o(r)},[t,o]),f=e.useCallback((e,n)=>{const r=ni(t);if(n!==(r[e]??!0)){const o=a({},r,{[e]:n});t.current.setColumnVisibilityModel(o)}},[t]),g=e.useCallback(e=>Jo(t).findIndex(t=>t===e),[t]),m=e.useCallback((e,n)=>{const i=Jo(t),s=g(e);if(s===n)return;r.debug(`Moving column ${e} to index ${n}`);const l=[...i],u=l.splice(s,1)[0];l.splice(n,0,u),o(a({},Zo(t),{orderedFields:l}));const c={column:t.current.getColumn(e),targetIndex:t.current.getColumnIndexRelativeToVisibleColumns(e),oldIndex:s};t.current.publishEvent("columnIndexChange",c)},[t,r,o,g]),b=e.useCallback((e,n)=>{r.debug(`Updating column ${e} width to ${n}`);const i=Zo(t),s=i.lookup[e],l=a({},s,{width:n,hasBeenResized:!0});o(Za(a({},i,{lookup:a({},i.lookup,{[e]:l})}),t.current.getRootDimensions())),t.current.publishEvent("columnWidthChange",{element:t.current.getColumnHeaderElement(e),colDef:l,width:n})},[t,r,o]),v={setColumnIndex:m};dl(t,{getColumn:s,getAllColumns:l,getColumnIndex:c,getColumnPosition:d,getVisibleColumns:u,getColumnIndexRelativeToVisibleColumns:g,updateColumns:h,setColumnVisibilityModel:p,setColumnVisibility:f,setColumnWidth:b},"public"),dl(t,v,n.signature===Br.DataGrid?"private":"public");const w=e.useCallback((e,r)=>{const o={},i=ni(t);(!r.exportOnlyDirtyModels||null!=n.columnVisibilityModel||Object.keys(n.initialState?.columns?.columnVisibilityModel??{}).length>0||Object.keys(i).length>0)&&(o.columnVisibilityModel=i),o.orderedFields=Jo(t);const s=ti(t),l={};return s.forEach(e=>{if(e.hasBeenResized){const t={};Ya.forEach(n=>{let r=e[n];r===1/0&&(r=-1),t[n]=r}),l[e.field]=t}}),Object.keys(l).length>0&&(o.dimensions=l),a({},e,{columns:o})},[t,n.columnVisibilityModel,n.initialState?.columns]),y=e.useCallback((e,n)=>{const r=n.stateToRestore.columns,o=r?.columnVisibilityModel;if(null==r)return e;const i=el({apiRef:t,columnsToUpsert:[],initialState:r,columnVisibilityModel:o,keepOnlyColumnsToUpsert:!1});return null!=r&&t.current.setState(e=>a({},e,{columns:a({},e.columns,{lookup:i.lookup,orderedFields:i.orderedFields,initialColumnVisibilityModel:i.initialColumnVisibilityModel})})),null!=o&&t.current.setState(e=>a({},e,{columns:a({},e.columns,{columnVisibilityModel:o})})),null!=r&&t.current.publishEvent("columnsChange",i.orderedFields),e},[t]),x=e.useCallback((e,t)=>{if(t===Bl.columns){const e=n.slots.columnsPanel;return i.jsx(e,a({},n.slotProps?.columnsPanel))}return e},[n.slots.columnsPanel,n.slotProps?.columnsPanel]),C=e.useCallback(e=>{const r=ml(t);return n.disableColumnSelector||r?e:[...e,"columnMenuColumnsItem"]},[n.disableColumnSelector,t]);ec(t,"columnMenu",C),ec(t,"exportState",w),ec(t,"restoreState",y),ec(t,"preferencePanel",x);const S=e.useRef(null);Yr(t,"viewportInnerSizeChange",e=>{if(S.current!==e.width){S.current=e.width;if(!oi(t).some(e=>e.flex&&e.flex>0))return;o(Za(Zo(t),t.current.getRootDimensions()))}});const M=e.useCallback(()=>{r.info("Columns pipe processing have changed, regenerating the columns");const e=el({apiRef:t,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});o(e)},[t,r,o]);tc(t,"hydrateColumns",M),e.useEffect(()=>{if(t.current.caches.columns.lastColumnsProp===n.columns)return;t.current.caches.columns.lastColumnsProp=n.columns,r.info(`GridColumns have changed, new length ${n.columns.length}`);const e=el({apiRef:t,initialState:void 0,columnsToUpsert:n.columns,keepOnlyColumnsToUpsert:!0,updateInitialVisibilityModel:!0,columnVisibilityModel:n.columnVisibilityModel});o(e)},[r,t,o,n.columns,n.columnVisibilityModel]),e.useEffect(()=>{void 0!==n.columnVisibilityModel&&t.current.setColumnVisibilityModel(n.columnVisibilityModel)},[t,r,n.columnVisibilityModel])}const Cf=(e,t)=>a({},e,{density:t.initialState?.density??t.density??"standard"});const Sf=({apiRef:e,options:t})=>{const n=ti(e);if(t.fields)return t.fields.reduce((e,t)=>{const r=n.find(e=>e.field===t);return r&&e.push(r),e},[]);return(t.allColumns?n:oi(e)).filter(e=>!0!==e.disableExport)},Mf=({apiRef:e})=>{const t=xs(e),n=fr(e),r=Ds(e),o=t.filter(e=>"footer"!==n[e].type),i=Cr(e),s=i?.top?.map(e=>e.id)||[],a=i?.bottom?.map(e=>e.id)||[];if(o.unshift(...s),o.push(...a),r>0){const t=Fs(e);return o.filter(e=>t.has(e))}return o},Rf=(t,n)=>{const r=pl(t,"useGridCsvExport"),o=n.ignoreValueFormatterDuringExport,s=("object"==typeof o?o?.csvExport:o)||!1,a=e.useCallback((e={})=>{r.debug("Get data as CSV");return mf({columns:Sf({apiRef:t,options:e}),rowIds:(e.getRowsToExport??Mf)({apiRef:t}),csvOptions:{delimiter:e.delimiter||",",shouldAppendQuotes:e.shouldAppendQuotes??!0,includeHeaders:e.includeHeaders??!0,includeColumnGroupsHeaders:e.includeColumnGroupsHeaders??!0,escapeFormulas:e.escapeFormulas??!0},ignoreValueFormatter:s,apiRef:t})},[r,t,s]),l=e.useCallback(e=>{r.debug("Export data as CSV");const t=a(e);!function(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const t=URL.createObjectURL(e),n=document.createElement("a");return n.href=t,n.download=r,n.click(),void setTimeout(()=>{URL.revokeObjectURL(t)})}throw new Error("MUI X: exportAs not supported.")}(new Blob([e?.utf8WithBom?new Uint8Array([239,187,191]):"",t],{type:"text/csv"}),"csv",e?.fileName)},[r,a]);dl(t,{getDataAsCsv:a,exportDataAsCsv:l},"public");const u=e.useCallback((e,t)=>t.csvOptions?.disableToolbarButton?e:[...e,{component:i.jsx(Np,{options:t.csvOptions}),componentName:"csvExport"}],[]);ec(t,"exportMenu",u)};const If=(e,t,n)=>{let r=e.paginationModel;const o=e.rowCount,i=n?.pageSize??r.pageSize,s=n?.page??r.page,l=Ys(o,i,s);!n||n?.page===r.page&&n?.pageSize===r.pageSize||(r=n);const u=-1===i?0:((e,t=0)=>0===t?e:Math.max(Math.min(e,t-1),0))(r.page,l);return u!==r.page&&(r=a({},r,{page:u})),Zs(r.pageSize,t),r};const Pf=(t,n)=>{const r=null!==t.current.rootElementRef.current,o=pl(t,"useGridPrintExport"),s=e.useRef(null),l=e.useRef(null),u=e.useRef({}),c=e.useRef([]),d=e.useRef(null);e.useEffect(()=>{s.current=ce(t.current.rootElementRef.current)},[t,r]);const p=e.useCallback((e,n,r)=>new Promise(o=>{const i=Sf({apiRef:t,options:{fields:e,allColumns:n}}).map(e=>e.field),s=ti(t),a={};s.forEach(e=>{a[e.field]=i.includes(e.field)}),r&&(a[fa.field]=!0),t.current.setColumnVisibilityModel(a),o()}),[t]),h=e.useCallback(e=>{const n=e({apiRef:t}).reduce((e,n)=>{const r=t.current.getRow(n);return r[Rr]||e.push(r),e},[]);t.current.setRows(n)},[t]),f=e.useCallback((e,n)=>{const r=a({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},n),o=e.contentDocument;if(!o)return;const i=t.current.rootElementRef.current,l=i.cloneNode(!0),u=l.querySelector(`.${Vr.virtualScrollerContent}`);if(l.querySelector(`.${Vr.main}`).style.overflow="visible",l.querySelector(`.${Vr.virtualScrollerRenderZone}`).style.position="static",u.style.flexBasis="auto",l.querySelector(`.${Vr["scrollbar--vertical"]}`)?.remove(),!(u.nextSibling instanceof HTMLElement&&u.nextSibling.classList.contains(Vr.filler))){const e=document.createElement("div");e.style.height=zu,u.insertAdjacentElement("afterend",e)}const c=l.querySelector(`.${Vr.footerContainer}`);r.hideToolbar&&l.querySelector(`.${Vr.toolbar}`)?.remove(),r.hideFooter&&c&&c.remove(),l.style.height="auto",l.style.boxSizing="content-box",!r.hideFooter&&c&&(c.style.width="100%");const d=document.createElement("div");d.appendChild(l),o.body.style.marginTop="0px",o.body.innerHTML=d.innerHTML;const p="function"==typeof r.pageStyle?r.pageStyle():r.pageStyle;if("string"==typeof p){const e=o.createElement("style");e.appendChild(o.createTextNode(p)),o.head.appendChild(e)}r.bodyClassName&&o.body.classList.add(...r.bodyClassName.split(" "));let h=[];if(r.copyStyles){const e=i.getRootNode();h=function(e,t){const n=[],r=t.querySelectorAll("style, link[rel='stylesheet']");for(let o=0;o<r.length;o+=1){const t=r[o],i=e.createElement(t.tagName);if("STYLE"===t.tagName){const n=t.sheet;if(n){let t="";for(let e=0;e<n.cssRules.length;e+=1)"string"==typeof n.cssRules[e].cssText&&(t+=`${n.cssRules[e].cssText}\r\n`);i.appendChild(e.createTextNode(t))}}else if(t.getAttribute("href")){for(let e=0;e<t.attributes.length;e+=1){const n=t.attributes[e];n&&i.setAttribute(n.nodeName,n.nodeValue||"")}n.push(new Promise(e=>{i.addEventListener("load",()=>e())}))}e.head.appendChild(i)}return n}(o,"ShadowRoot"===e.constructor.name?e:s.current)}Promise.all(h).then(()=>{e.contentWindow.print()})},[t,s]),g=e.useCallback(e=>{s.current.body.removeChild(e),t.current.restoreState(l.current||{}),l.current?.columns?.columnVisibilityModel||t.current.setColumnVisibilityModel(u.current),t.current.setState(e=>a({},e,{virtualization:d.current})),t.current.setRows(c.current),l.current=null,u.current={},c.current=[]},[t]),m=e.useCallback(async e=>{if(o.debug("Export data as Print"),!t.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(l.current=t.current.exportState(),u.current=ni(t),c.current=t.current.getSortedRows().filter(e=>!e[Rr]),n.pagination){const e={page:0,pageSize:Ss(t)};t.current.setState(t=>a({},t,{pagination:a({},t.pagination,{paginationModel:If(t.pagination,"DataGridPro",e)})}))}d.current=t.current.state.virtualization,t.current.unstable_setVirtualization(!1),await p(e?.fields,e?.allColumns,e?.includeCheckboxes),h(e?.getRowsToExport??Mf),await new Promise(e=>{requestAnimationFrame(()=>{e()})});const r=function(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}(e?.fileName);r.onload=()=>{f(r,e);r.contentWindow.matchMedia("print").addEventListener("change",e=>{!1===e.matches&&g(r)})},s.current.body.appendChild(r)},[n,o,t,f,g,p,h]);dl(t,{exportDataAsPrint:m},"public");const b=e.useCallback((e,t)=>t.printOptions?.disableToolbarButton?e:[...e,{component:i.jsx(Gp,{options:t.printOptions}),componentName:"printExport"}],[]);ec(t,"exportMenu",b)},kf=(e,t,n)=>{const r=t.filterModel??t.initialState?.filter?.filterModel??Wo();return a({},e,{filter:a({filterModel:gi(r,t.disableMultipleColumnsFiltering,n)},Bo),visibleRowsLookup:{}})},Ef=e=>e.filteredRowsLookup;function Tf(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function Df(){return xn(Object.values)}const Ff=e=>a({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),Af=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e<n)return e+1}else if(!r&&e>t)return e-1;return null},Of=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e<n)return e+1;return null};const Hf=qn(ca,Cr,(e,t)=>(t.top||[]).concat(e.rows,t.bottom||[])),$f=(t,n)=>{const r=pl(t,"useGridKeyboardNavigation"),o=ae(),i=e.useCallback(()=>Hf(t),[t]),s="DataGrid"!==n.signature&&n.headerFilters,a=e.useCallback((e,n,o="left",i="up")=>{const s=vs(t),a=t.current.unstable_getCellColSpanInfo(n,e);a&&a.spannedByColSpan&&("left"===o?e=a.leftVisibleCellIndex:"right"===o&&(e=a.rightVisibleCellIndex));const l=ii(t)[e],u=function(e,t,n,r){const o=Ru.selectors.hiddenCells(e.current.virtualizer.store.state);if(!o[t]?.[n])return t;const i=xs(e);let s=i.indexOf(t)+("down"===r?1:-1);for(;s>=0&&s<i.length;){const e=i[s];if(!o[e]?.[n])return e;s+="down"===r?1:-1}return t}(t,n,e,i),c=s.findIndex(e=>e.id===u);r.debug(`Navigating to cell row ${c}, col ${e}`),t.current.scrollToIndexes({colIndex:e,rowIndex:c}),t.current.setCellFocus(u,l)},[t,r]),l=e.useCallback((e,n)=>{r.debug(`Navigating to header col ${e}`),t.current.scrollToIndexes({colIndex:e});const o=t.current.getVisibleColumns()[e].field;t.current.setColumnHeaderFocus(o,n)},[t,r]),u=e.useCallback((e,n)=>{r.debug(`Navigating to header filter col ${e}`),t.current.scrollToIndexes({colIndex:e});const o=t.current.getVisibleColumns()[e].field;t.current.setColumnHeaderFilterFocus(o,n)},[t,r]),c=e.useCallback((e,n,o)=>{r.debug(`Navigating to header col ${e}`),t.current.scrollToIndexes({colIndex:e});const{field:i}=t.current.getVisibleColumns()[e];t.current.setColumnGroupHeaderFocus(i,n,o)},[t,r]),d=e.useCallback(e=>i()[e]?.id,[i]),p=e.useCallback((e,r)=>{const p=r.currentTarget.querySelector(`.${Vr.columnHeaderTitleContainerContent}`);if(!!p&&p.contains(r.target)&&e.field!==fa.field)return;if(!Ti(r.key)&&"Tab"!==r.key)return;if("Tab"===r.key&&("none"===n.tabNavigation||"content"===n.tabNavigation&&r.shiftKey))return;const h=i(),f=t.current.getViewportPageSize(),g=e.field?t.current.getColumnIndex(e.field):0,m=h.length>0?0:null,b=h.length>0?h.length-1:null,v=Math.max(0,oi(t).length-1),w=Xa(t);let y=!0;if("Tab"!==r.key||"content"!==n.tabNavigation||r.shiftKey){switch(r.key){case"ArrowDown":s?u(g,r):null!==m&&a(g,d(m));break;case"ArrowRight":{const e=Of({currentColIndex:g,firstColIndex:0,lastColIndex:v,isRtl:o});null!==e&&l(e,r);break}case"ArrowLeft":{const e=Af({currentColIndex:g,firstColIndex:0,lastColIndex:v,isRtl:o});null!==e&&l(e,r);break}case"ArrowUp":w>0&&c(g,w-1,r);break;case"PageDown":null!==m&&null!==b&&a(g,d(Math.min(m+f,b)));break;case"Home":l(0,r);break;case"End":l(v,r);break;case"Enter":(r.ctrlKey||r.metaKey)&&t.current.toggleColumnMenu(e.field);break;case"Tab":r.shiftKey?0===g?w>0?c(v,w-1,r):y=!1:l(g-1,r):g===v?s?u(0,r):"all"===n.tabNavigation&&null!==m?a(0,d(m)):y=!1:l(g+1,r);break;case" ":break;default:y=!1}y&&r.preventDefault()}else null!==m&&(a(0,d(m)),r.preventDefault())},[t,n.tabNavigation,i,s,u,a,d,o,l,c]),h=e.useCallback((e,r)=>{const s=Va(t)===e.field;if(Ba(t)===e.field||s&&"Tab"!==r.key)return;if(!Ti(r.key)&&"Tab"!==r.key)return;if("Tab"===r.key&&("none"===n.tabNavigation||"content"===n.tabNavigation&&r.shiftKey))return;const c=i(),p=t.current.getViewportPageSize(),h=e.field?t.current.getColumnIndex(e.field):0,f=c.length>0?0:null,g=c.length>0?c.length-1:null,m=Math.max(0,oi(t).length-1);let b=!0;if("Tab"!==r.key||"content"!==n.tabNavigation||r.shiftKey){switch(r.key){case"ArrowDown":null!==f&&a(h,d(f));break;case"ArrowRight":{const e=Of({currentColIndex:h,firstColIndex:0,lastColIndex:m,isRtl:o});null!==e&&u(e,r);break}case"ArrowLeft":{const n=Af({currentColIndex:h,firstColIndex:0,lastColIndex:m,isRtl:o});null!==n?u(n,r):t.current.setColumnHeaderFilterFocus(e.field,r);break}case"ArrowUp":l(h,r);break;case"PageDown":null!==f&&null!==g&&a(h,d(Math.min(f+p,g)));break;case"Home":u(0,r);break;case"End":u(m,r);break;case"Tab":r.shiftKey?0===h?l(m,r):u(h-1,r):h===m?"all"===n.tabNavigation&&null!==f?a(0,d(f)):b=!1:u(h+1,r);break;case" ":break;default:b=!1}b&&r.preventDefault()}else null!==f&&(a(0,d(f)),r.preventDefault())},[t,n.tabNavigation,i,u,o,l,a,d]),f=e.useCallback((e,r)=>{const o=Ws(t);if(null===o)return;const{field:s,depth:u}=o,{fields:p,depth:h,maxDepth:f}=e;if(!Ti(r.key)&&"Tab"!==r.key)return;if("Tab"===r.key&&("none"===n.tabNavigation||"content"===n.tabNavigation&&r.shiftKey))return;const g=i(),m=t.current.getViewportPageSize(),b=t.current.getColumnIndex(s),v=s?t.current.getColumnIndex(s):0,w=g.length>0?0:null,y=g.length>0?g.length-1:null,x=Math.max(0,oi(t).length-1);let C=!0;if("Tab"!==r.key||"content"!==n.tabNavigation||r.shiftKey){switch(r.key){case"ArrowDown":h===f-1?l(b,r):c(b,u+1,r);break;case"ArrowUp":h>0&&c(b,u-1,r);break;case"ArrowRight":{const e=p.length-p.indexOf(s)-1;b+e+1<=x&&c(b+e+1,u,r);break}case"ArrowLeft":{const e=p.indexOf(s);b-e-1>=0&&c(b-e-1,u,r);break}case"PageDown":null!==w&&null!==y&&a(v,d(Math.min(w+m,y)));break;case"Home":c(0,u,r);break;case"End":c(x,u,r);break;case"Tab":if(r.shiftKey){const e=b-p.indexOf(s)-1;e<0?0===h?C=!1:c(x,u-1,r):c(e,u,r)}else{const e=b+(p.length-p.indexOf(s)-1)+1;e>x&&h===f-1?l(0,r):e>x?c(0,u+1,r):c(e,u,r)}break;case" ":break;default:C=!1}C&&r.preventDefault()}else null!==w&&(a(0,d(w)),r.preventDefault())},[t,n.tabNavigation,i,l,c,a,d]),g=e.useCallback((e,r)=>{if(sd(r))return;const c=t.current.getCellParams(e.id,e.field);if(c.cellMode===Ao.Edit||!Ti(r.key)&&"Tab"!==r.key)return;if("Tab"===r.key&&("none"===n.tabNavigation||"header"===n.tabNavigation&&!r.shiftKey))return;if(!t.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:r,cell:c}))return;const p=i();if(0===p.length)return;const h=s?u:l,f=t.current.getViewportPageSize(),g=e.field?t.current.getColumnIndex(e.field):0,m=p.findIndex(t=>t.id===e.id),b=p.length-1,v=Math.max(0,oi(t).length-1);let w=!0;if("Tab"===r.key&&"header"===n.tabNavigation&&r.shiftKey)return h(v,r),void r.preventDefault();switch(r.key){case"ArrowDown":m<b&&a(g,d(m+1),o?"right":"left","down");break;case"ArrowUp":m>0?a(g,d(m-1)):h(g,r);break;case"ArrowRight":{const e=Of({currentColIndex:g,firstColIndex:0,lastColIndex:v,isRtl:o});null!==e&&a(e,d(m),o?"left":"right");break}case"ArrowLeft":{const e=Af({currentColIndex:g,firstColIndex:0,lastColIndex:v,isRtl:o});null!==e&&a(e,d(m),o?"right":"left");break}case"Tab":r.shiftKey?0===g&&0===m?"all"===n.tabNavigation?h(v,r):w=!1:0===g?a(v,d(m-1)):a(g-1,d(m),"left"):g===v?m!==b?a(0,d(m+1)):w=!1:a(g+1,d(m),"right");break;case" ":{if(e.field===Yi)break;const t=e.colDef;if(t&&("__tree_data_group__"===t.field||(e=>e===Xi||null!==(e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null})(e))(t.field)))break;!r.shiftKey&&m<b&&a(g,d(Math.min(m+f,b)));break}case"PageDown":m<b&&a(g,d(Math.min(m+f,b)));break;case"PageUp":{const e=Math.max(m-f,0);e!==m&&e>=0?a(g,d(e)):l(g,r);break}case"Home":r.ctrlKey||r.metaKey||r.shiftKey?a(0,d(0)):a(0,d(m));break;case"End":r.ctrlKey||r.metaKey||r.shiftKey?a(v,d(b)):a(v,d(m));break;default:w=!1}w&&r.preventDefault()},[t,n.tabNavigation,i,o,a,d,s,u,l]),m=e.useCallback((e,{event:t})=>" "!==t.key&&e,[]);ec(t,"canStartEditing",m),Yr(t,"columnHeaderKeyDown",p),Yr(t,"headerFilterKeyDown",h),Yr(t,"columnGroupHeaderKeyDown",f),Yr(t,"cellKeyDown",g)},zf=(e,t)=>{const n=a({},Qs(t.autoPageSize),t.paginationModel??t.initialState?.pagination?.paginationModel);Zs(n.pageSize,t.signature);const r=t.rowCount??t.initialState?.pagination?.rowCount??("client"===t.paginationMode?e.rows?.totalRowCount:void 0),o=t.paginationMeta??t.initialState?.pagination?.meta??{};return a({},e,{pagination:a({},e.pagination,{paginationModel:n,rowCount:r,meta:o,enabled:!0===t.pagination,paginationMode:t.paginationMode})})},Lf=(t,n)=>{((t,n)=>{const r=pl(t,"useGridPaginationMeta");t.current.registerControlState({stateId:"paginationMeta",propModel:n.paginationMeta,propOnChange:n.onPaginationMetaChange,stateSelector:ra,changeEvent:"paginationMetaChange"});const o=e.useCallback(e=>{ra(t)!==e&&(r.debug("Setting 'paginationMeta' to",e),t.current.setState(t=>a({},t,{pagination:a({},t.pagination,{meta:e})})))},[t,r]);dl(t,{setPaginationMeta:o},"public");const i=e.useCallback((e,r)=>{const o=ra(t);return r.exportOnlyDirtyModels&&null==n.paginationMeta&&null==n.initialState?.pagination?.meta?e:a({},e,{pagination:a({},e.pagination,{meta:o})})},[t,n.paginationMeta,n.initialState?.pagination?.meta]),s=e.useCallback((e,n)=>{const r=n.stateToRestore.pagination?.meta?n.stateToRestore.pagination.meta:ra(t);return t.current.setState(e=>a({},e,{pagination:a({},e.pagination,{meta:r})})),e},[t]);ec(t,"exportState",i),ec(t,"restoreState",s),e.useEffect(()=>{n.paginationMeta&&t.current.setPaginationMeta(n.paginationMeta)},[t,n.paginationMeta])})(t,n),((t,n)=>{const r=pl(t,"useGridPaginationModel"),o=so(t,uo),i=e.useRef(fs(t)),s=Math.floor(n.rowHeight*o);t.current.registerControlState({stateId:"paginationModel",propModel:n.paginationModel,propOnChange:n.onPaginationModelChange,stateSelector:ta,changeEvent:"paginationModelChange"});const l=e.useCallback(e=>{const n=ta(t);e!==n.page&&(r.debug(`Setting page to ${e}`),t.current.setPaginationModel({page:e,pageSize:n.pageSize}))},[t,r]),u=e.useMemo(()=>he(l,0),[l]),c=e.useCallback(e=>{const n=ta(t);e!==n.pageSize&&(r.debug(`Setting page size to ${e}`),t.current.setPaginationModel({pageSize:e,page:n.page}))},[t,r]),d=e.useCallback(e=>{const o=ta(t);e!==o&&(r.debug("Setting 'paginationModel' to",e),t.current.setState(t=>a({},t,{pagination:a({},t.pagination,{paginationModel:If(t.pagination,n.signature,e)})}),"setPaginationModel"))},[t,r,n.signature]);dl(t,{setPage:l,setPageSize:c,setPaginationModel:d},"public");const p=e.useCallback((e,r)=>{const o=ta(t);return!r.exportOnlyDirtyModels||null!=n.paginationModel||null!=n.initialState?.pagination?.paginationModel||0!==o.page&&o.pageSize!==(n.autoPageSize?0:100)?a({},e,{pagination:a({},e.pagination,{paginationModel:o})}):e},[t,n.paginationModel,n.initialState?.pagination?.paginationModel,n.autoPageSize]),h=e.useCallback((e,r)=>{const o=r.stateToRestore.pagination?.paginationModel?a({},Qs(n.autoPageSize),r.stateToRestore.pagination?.paginationModel):ta(t);return t.current.setState(e=>a({},e,{pagination:a({},e.pagination,{paginationModel:If(e.pagination,n.signature,o)})}),"stateRestorePreProcessing"),e},[t,n.autoPageSize,n.signature]);ec(t,"exportState",p),ec(t,"restoreState",h);const f=e.useCallback(()=>{if(!n.autoPageSize)return;const e=t.current.getRootDimensions(),r=Math.max(1,Math.floor(e.viewportInnerSize.height/s));t.current.setPageSize(r)},[t,n.autoPageSize,s]),g=e.useCallback(e=>{if(null==e)return;const n=ta(t);if(0===n.page)return;const r=sa(t);n.page>r-1&&queueMicrotask(()=>{u(Math.max(0,r-1))})},[t,u]),m=e.useCallback(()=>{0!==ta(t).page&&u(0),0!==t.current.getScrollPosition().top&&t.current.scroll({top:0})},[t,u]),b=e.useMemo(()=>he(m,0),[m]),v=e.useCallback(e=>{const n=a({},e,{items:Is(t)});ql(n,i.current)||(i.current=n,b())},[t,b]);Yr(t,"viewportInnerSizeChange",f),Yr(t,"paginationModelChange",()=>{const e=ta(t);t.current.virtualScrollerRef?.current&&t.current.scrollToIndexes({rowIndex:e.page*e.pageSize})}),Yr(t,"rowCountChange",g),Yr(t,"sortModelChange",b),Yr(t,"filterModelChange",v);const w=e.useRef(!0);e.useEffect(()=>{w.current?w.current=!1:n.pagination&&t.current.setState(e=>a({},e,{pagination:a({},e.pagination,{paginationModel:If(e.pagination,n.signature,n.paginationModel)})}))},[t,n.paginationModel,n.signature,n.pagination]),e.useEffect(()=>{t.current.setState(e=>{const t=!0===n.pagination;return e.pagination.paginationMode===n.paginationMode&&e.pagination.enabled===t?e:a({},e,{pagination:a({},e.pagination,{paginationMode:n.paginationMode,enabled:t})})})},[t,n.paginationMode,n.pagination]),e.useEffect(f,[f])})(t,n),((t,n)=>{const r=pl(t,"useGridRowCount"),o=ee(()=>ta(t).pageSize);t.current.registerControlState({stateId:"paginationRowCount",propModel:n.rowCount,propOnChange:n.onRowCountChange,stateSelector:na,changeEvent:"rowCountChange"});const i=e.useCallback(e=>{na(t)!==e&&(r.debug("Setting 'rowCount' to",e),t.current.setState(t=>a({},t,{pagination:a({},t.pagination,{rowCount:e})})))},[t,r]);dl(t,{setRowCount:i},"public");const s=e.useCallback((e,r)=>{const o=na(t);return r.exportOnlyDirtyModels&&null==n.rowCount&&null==n.initialState?.pagination?.rowCount?e:a({},e,{pagination:a({},e.pagination,{rowCount:o})})},[t,n.rowCount,n.initialState?.pagination?.rowCount]),l=e.useCallback((e,n)=>{const r=n.stateToRestore.pagination?.rowCount?n.stateToRestore.pagination.rowCount:na(t);return t.current.setState(e=>a({},e,{pagination:a({},e.pagination,{rowCount:r})})),e},[t]);ec(t,"exportState",s),ec(t,"restoreState",l);const u=e.useCallback(e=>{"client"!==n.paginationMode&&o.current&&e.pageSize!==o.current&&(o.current=e.pageSize,-1===na(t)&&t.current.setPage(0))},[n.paginationMode,o,t]);Yr(t,"paginationModelChange",u),e.useEffect(()=>{"server"===n.paginationMode&&null!=n.rowCount&&t.current.setRowCount(n.rowCount)},[t,n.paginationMode,n.rowCount]),Bn(t.current.store,()=>!(!1!==ra(t).hasNextPage)||("client"===n.paginationMode?Ms(t):void 0),(e,n)=>{if(!0===n&&-1!==na(t)){const e=Ms(t),n=ta(t);t.current.setRowCount(n.pageSize*n.page+e)}else"number"==typeof n&&t.current.setRowCount(n)}),e.useEffect(()=>{"client"===n.paginationMode&&t.current.setRowCount(Ms(t))},[t,n.paginationMode])})(t,n)},jf=(e,t)=>a({},e,{preferencePanel:t.initialState?.preferencePanel??{open:!1}}),Nf=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;default:return""}},Gf=["id","field"],_f=["id","field"],Vf=["id"],Bf=["id"],Wf=e=>a({},e,{editRows:{}}),Uf=(t,n,r)=>{((t,n)=>{const[r,o]=e.useState({}),i=e.useRef(r),l=e.useRef({}),{processRowUpdate:u,onProcessRowUpdateError:c,cellModesModel:d,onCellModesModelChange:p}=n,h=e=>(...t)=>{n.editMode===Fo.Cell&&e(...t)},f=e.useCallback((e,n)=>{const r=t.current.getCellParams(e,n);if(!t.current.isCellEditable(r))throw new Error(`MUI X: The cell with id=${e} and field=${n} is not editable.`)},[t]),g=e.useCallback((e,n,r)=>{if(t.current.getCellMode(e,n)!==r)throw new Error(`MUI X: The cell with id=${e} and field=${n} is not in ${r} mode.`)},[t]),m=e.useCallback((e,n)=>{if(!e.isEditable)return;if(e.cellMode===Ao.Edit)return;const r=a({},e,{reason:jo.cellDoubleClick});t.current.publishEvent("cellEditStart",r,n)},[t]),b=e.useCallback((e,n)=>{if(e.cellMode===Ao.View)return;if(t.current.getCellMode(e.id,e.field)===Ao.View)return;const r=a({},e,{reason:No.cellFocusOut});t.current.publishEvent("cellEditStop",r,n)},[t]),v=e.useCallback((e,n)=>{if(e.cellMode===Ao.Edit){if(229===n.which)return;let r;if("Escape"===n.key?r=No.escapeKeyDown:"Enter"===n.key?r=No.enterKeyDown:"Tab"===n.key&&(r=n.shiftKey?No.shiftTabKeyDown:No.tabKeyDown,n.preventDefault()),r){const o=a({},e,{reason:r});t.current.publishEvent("cellEditStop",o,n)}}else if(e.isEditable){let r;if(!t.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:e,editMode:"cell"}))return;if(Ei(n)?r=jo.printableKeyDown:Fi(n)?r=jo.pasteKeyDown:"Enter"===n.key?r=jo.enterKeyDown:"Backspace"!==n.key&&"Delete"!==n.key||(r=jo.deleteKeyDown),r){const o=a({},e,{reason:r,key:n.key});t.current.publishEvent("cellEditStart",o,n)}}},[t]),w=e.useCallback(e=>{const{id:n,field:r,reason:o}=e,i={id:n,field:r};o!==jo.printableKeyDown&&o!==jo.deleteKeyDown&&o!==jo.pasteKeyDown||(i.deleteValue=!0),t.current.startCellEditMode(i)},[t]),x=e.useCallback(e=>{const{id:n,field:r,reason:o}=e;let i;t.current.runPendingEditCellValueMutation(n,r),o===No.enterKeyDown?i="below":o===No.tabKeyDown?i="right":o===No.shiftTabKeyDown&&(i="left");const s="escapeKeyDown"===o;t.current.stopCellEditMode({id:n,field:r,ignoreModifications:s,cellToFocusAfter:i})},[t]);var C;Yr(t,"cellDoubleClick",h(m)),Yr(t,"cellFocusOut",h(b)),Yr(t,"cellKeyDown",h(v)),Yr(t,"cellEditStart",h(w)),Yr(t,"cellEditStop",h(x)),Zr(t,"cellEditStart",n.onCellEditStart),Zr(t,"cellEditStop",(C=n.onCellEditStop,async(...e)=>{if(C){const{id:n,field:r}=e[0],o=t.current.state.editRows,i=o[n][r]?.error;i||C(...e)}}));const S=e.useCallback((e,n)=>{const r=jl(t);return r[e]&&r[e][n]?Ao.Edit:Ao.View},[t]),M=y(e=>{const r=e!==n.cellModesModel;p&&r&&p(e,{api:t.current}),n.cellModesModel&&r||(o(e),i.current=e,t.current.publishEvent("cellModesModelChange",e))}),R=e.useCallback((e,t,n)=>{const r=a({},i.current);if(null!==n)r[e]=a({},r[e],{[t]:a({},n)});else{const n=r[e],o=s(n,[t].map(Ju));r[e]=o,0===Object.keys(r[e]).length&&delete r[e]}M(r)},[M]),I=e.useCallback((e,n,r)=>{t.current.setState(t=>{const o=a({},t.editRows);return null!==r?o[e]=a({},o[e],{[n]:a({},r)}):(delete o[e][n],0===Object.keys(o[e]).length&&delete o[e]),a({},t,{editRows:o})})},[t]),P=e.useCallback(e=>{const{id:t,field:n}=e,r=s(e,Gf);f(t,n),g(t,n,Ao.View),R(t,n,a({mode:Ao.Edit},r))},[f,g,R]),k=y(async e=>{const{id:n,field:r,deleteValue:o,initialValue:i}=e,s=t.current.getCellValue(n,r);let l=s;o?l=Nf(t.current.getColumn(r)):i&&(l=i);const u=t.current.getColumn(r),c=!!u.preProcessEditCellProps&&o;let d={value:l,error:!1,isProcessingProps:c};if(I(n,r,d),t.current.setCellFocus(n,r),c&&(d=await Promise.resolve(u.preProcessEditCellProps({id:n,row:t.current.getRow(n),props:d,hasChanged:l!==s})),t.current.getCellMode(n,r)===Ao.Edit)){const e=jl(t);I(n,r,a({},d,{value:e[n][r].value,isProcessingProps:!1}))}}),E=e.useCallback(e=>{const{id:t,field:n}=e,r=s(e,_f);g(t,n,Ao.Edit),R(t,n,a({mode:Ao.View},r))},[g,R]),T=y(async e=>{const{id:r,field:o,ignoreModifications:i,cellToFocusAfter:s="none"}=e;g(r,o,Ao.Edit),t.current.runPendingEditCellValueMutation(r,o);const a=()=>{I(r,o,null),R(r,o,null),"none"!==s&&t.current.moveFocusToRelativeCell(r,o,s)};if(i)return void a();const d=jl(t),{error:p,isProcessingProps:h}=d[r][o],f=t.current.getRow(r);if(p||h)return l.current[r][o].mode=Ao.Edit,void R(r,o,{mode:Ao.Edit});const m=t.current.getRowWithUpdatedValuesFromCellEditing(r,o);if(n.dataSource?.updateRow){if(ql(f,m))return void a();const e=()=>{l.current[r][o].mode=Ao.Edit,R(r,o,{mode:Ao.Edit})},n={rowId:r,updatedRow:m,previousRow:f};try{await t.current.dataSource.editRow(n),a()}catch{e()}}else if(u){const e=e=>{l.current[r][o].mode=Ao.Edit,R(r,o,{mode:Ao.Edit}),c&&c(e)};try{Promise.resolve(u(m,f,{rowId:r})).then(e=>{t.current.updateRows([e]),a()}).catch(e)}catch(b){e(b)}}else t.current.updateRows([m]),a()}),D={setCellEditingEditCellValue:e.useCallback(async e=>{const{id:n,field:r,value:o,debounceMs:i,unstable_skipValueParser:s}=e;f(n,r),g(n,r,Ao.Edit);const l=t.current.getColumn(r),u=t.current.getRow(n);let c=o;l.valueParser&&!s&&(c=l.valueParser(o,u,l,t));let d=jl(t),p=a({},d[n][r],{value:c,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});if(l.preProcessEditCellProps){const e=o!==d[n][r].value;p=a({},p,{isProcessingProps:!0}),I(n,r,p),p=await Promise.resolve(l.preProcessEditCellProps({id:n,row:u,props:p,hasChanged:e}))}return t.current.getCellMode(n,r)!==Ao.View&&(d=jl(t),p=a({},p,{isProcessingProps:!1}),p.value=l.preProcessEditCellProps?d[n][r].value:c,I(n,r,p),d=jl(t),!d[n]?.[r]?.error)},[t,f,g,I]),getRowWithUpdatedValuesFromCellEditing:e.useCallback((e,n)=>{const r=t.current.getColumn(n),o=jl(t),i=t.current.getRow(e);if(!o[e]||!o[e][n])return t.current.getRow(e);const{value:s}=o[e][n];return r.valueSetter?r.valueSetter(s,i,r,t):a({},i,{[n]:s})},[t])};dl(t,{getCellMode:S,startCellEditMode:P,stopCellEditMode:E},"public"),dl(t,D,"private"),e.useEffect(()=>{d&&M(d)},[d,M]),oe(()=>{const e=hr(t),n=l.current;l.current=Eo(r),Object.entries(r).forEach(([r,o])=>{Object.entries(o).forEach(([o,i])=>{const s=n[r]?.[o]?.mode||Ao.View,l=e[r]?t.current.getRowId(e[r]):r;i.mode===Ao.Edit&&s===Ao.View?k(a({id:l,field:o},i)):i.mode===Ao.View&&s===Ao.Edit&&T(a({id:l,field:o},i))})})},[t,r,k,T])})(t,n),((t,n)=>{const[r,o]=e.useState({}),i=e.useRef(r),l=e.useRef({}),u=e.useRef({}),c=e.useRef(void 0),d=e.useRef(null),{processRowUpdate:p,onProcessRowUpdateError:h,rowModesModel:f,onRowModesModelChange:g}=n,m=e=>(...t)=>{n.editMode===Fo.Row&&e(...t)},b=e.useCallback((e,n)=>{const r=t.current.getCellParams(e,n);if(!t.current.isCellEditable(r))throw new Error(`MUI X: The cell with id=${e} and field=${n} is not editable.`)},[t]),v=e.useCallback((e,n)=>{if(t.current.getRowMode(e)!==n)throw new Error(`MUI X: The row with id=${e} is not in ${n} mode.`)},[t]),w=e.useCallback(e=>{const n=jl(t);return Object.values(n[e]).some(e=>e.error)},[t]),x=e.useCallback((e,n)=>{if(!e.isEditable)return;if(t.current.getRowMode(e.id)===Oo.Edit)return;const r=t.current.getRowParams(e.id),o=a({},r,{field:e.field,reason:Go.cellDoubleClick});t.current.publishEvent("rowEditStart",o,n)},[t]),C=e.useCallback(e=>{d.current=e},[]),S=e.useCallback((e,n)=>{e.isEditable&&t.current.getRowMode(e.id)!==Oo.View&&(d.current=null,c.current=setTimeout(()=>{if(d.current?.id!==e.id){if(!t.current.getRow(e.id))return;if(t.current.getRowMode(e.id)===Oo.View)return;if(w(e.id))return;const r=t.current.getRowParams(e.id),o=a({},r,{field:e.field,reason:_o.rowFocusOut});t.current.publishEvent("rowEditStop",o,n)}}))},[t,w]);e.useEffect(()=>()=>{clearTimeout(c.current)},[]);const M=e.useCallback((e,n)=>{if(e.cellMode===Oo.Edit){if(229===n.which)return;let r;if("Escape"===n.key)r=_o.escapeKeyDown;else if("Enter"===n.key)r=_o.enterKeyDown;else if("Tab"===n.key){const o=ii(t).filter(n=>t.current.getColumn(n).type===Ki||t.current.isCellEditable(t.current.getCellParams(e.id,n)));if(n.shiftKey?e.field===o[0]&&(r=_o.shiftTabKeyDown):e.field===o[o.length-1]&&(r=_o.tabKeyDown),n.preventDefault(),!r){const r=o.findIndex(t=>t===e.field),i=o[n.shiftKey?r-1:r+1];t.current.setCellFocus(e.id,i)}}if(r){if(r!==_o.escapeKeyDown&&w(e.id))return;const o=a({},t.current.getRowParams(e.id),{reason:r,field:e.field});t.current.publishEvent("rowEditStop",o,n)}}else if(e.isEditable){let r;if(!t.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:e,editMode:"row"}))return;if(Ei(n)||Fi(n)?r=Go.printableKeyDown:"Enter"===n.key?r=Go.enterKeyDown:"Backspace"!==n.key&&"Delete"!==n.key||(r=Go.deleteKeyDown),r){const o=t.current.getRowParams(e.id),i=a({},o,{field:e.field,reason:r});t.current.publishEvent("rowEditStart",i,n)}}},[t,w]),R=e.useCallback(e=>{const{id:n,field:r,reason:o}=e,i={id:n,fieldToFocus:r};o!==Go.printableKeyDown&&o!==Go.deleteKeyDown||(i.deleteValue=!!r),t.current.startRowEditMode(i)},[t]),I=e.useCallback(e=>{const{id:n,reason:r,field:o}=e;let i;t.current.runPendingEditCellValueMutation(n),r===_o.enterKeyDown?i="below":r===_o.tabKeyDown?i="right":r===_o.shiftTabKeyDown&&(i="left");const s="escapeKeyDown"===r;t.current.stopRowEditMode({id:n,ignoreModifications:s,field:o,cellToFocusAfter:i})},[t]);Yr(t,"cellDoubleClick",m(x)),Yr(t,"cellFocusIn",m(C)),Yr(t,"cellFocusOut",m(S)),Yr(t,"cellKeyDown",m(M)),Yr(t,"rowEditStart",m(R)),Yr(t,"rowEditStop",m(I)),Zr(t,"rowEditStart",n.onRowEditStart),Zr(t,"rowEditStop",n.onRowEditStop);const P=e.useCallback(e=>Nl(t,{rowId:e,editMode:n.editMode})?Oo.Edit:Oo.View,[t,n.editMode]),k=y(e=>{const r=e!==n.rowModesModel;g&&r&&g(e,{api:t.current}),n.rowModesModel&&r||(o(e),i.current=e,t.current.publishEvent("rowModesModelChange",e))}),E=e.useCallback((e,t)=>{const n=a({},i.current);null!==t?n[e]=a({},t):delete n[e],k(n)},[k]),T=e.useCallback((e,n)=>{t.current.setState(t=>{const r=a({},t.editRows);return null!==n?r[e]=n:delete r[e],a({},t,{editRows:r})})},[t]),D=e.useCallback((e,n,r)=>{t.current.setState(t=>{const o=a({},t.editRows);return null!==r?o[e]=a({},o[e],{[n]:a({},r)}):(delete o[e][n],0===Object.keys(o[e]).length&&delete o[e]),a({},t,{editRows:o})})},[t]),F=e.useCallback(e=>{const{id:t}=e,n=s(e,Vf);v(t,Oo.View),E(t,a({mode:Oo.Edit},n))},[v,E]),A=y(e=>{const{id:n,fieldToFocus:r,deleteValue:o,initialValue:i}=e,s=t.current.getRow(n),l=ti(t),c=l.reduce((e,s)=>{const a=s.field;if(!t.current.getCellParams(n,a).isEditable)return e;const l=t.current.getColumn(a);let u=t.current.getCellValue(n,a);return r===a&&(o||i)&&(o?u=Nf(l):i&&(u=i)),e[a]={value:u,error:!1,isProcessingProps:l.editable&&!!l.preProcessEditCellProps&&o},e},{});u.current[n]=s,T(n,c),r&&t.current.setCellFocus(n,r),l.filter(e=>t.current.getCellParams(n,e.field).isEditable&&e.editable&&!!e.preProcessEditCellProps&&o).forEach(e=>{const r=e.field,l=t.current.getCellValue(n,r),u=o?Nf(e):i??l;Promise.resolve(e.preProcessEditCellProps({id:n,row:s,props:c[r],hasChanged:u!==l})).then(e=>{if(t.current.getRowMode(n)===Oo.Edit){const o=jl(t);D(n,r,a({},e,{value:o[n][r].value,isProcessingProps:!1}))}})})}),O=e.useCallback(e=>{const{id:t}=e,n=s(e,Bf);v(t,Oo.Edit),E(t,a({mode:Oo.View},n))},[v,E]),H=y(async e=>{const{id:r,ignoreModifications:o,field:i,cellToFocusAfter:s="none"}=e;t.current.runPendingEditCellValueMutation(r);const a=()=>{"none"!==s&&i&&t.current.moveFocusToRelativeCell(r,i,s),T(r,null),E(r,null),delete u.current[r]};if(o)return void a();const c=jl(t),d=u.current[r];if(Object.values(c[r]).some(e=>e.isProcessingProps))return void(l.current[r].mode=Oo.Edit);if(w(r))return l.current[r].mode=Oo.Edit,void E(r,{mode:Oo.Edit});const f=t.current.getRowWithUpdatedValuesFromRowEditing(r);if(n.dataSource?.updateRow){if(ql(d,f))return void a();const e=()=>{l.current[r].mode=Oo.Edit,E(r,{mode:Oo.Edit})},n={rowId:r,updatedRow:f,previousRow:d};try{await t.current.dataSource.editRow(n),a()}catch{e()}}else if(p){const e=e=>{l.current[r]&&(l.current[r].mode=Oo.Edit,E(r,{mode:Oo.Edit})),h&&h(e)};try{Promise.resolve(p(f,d,{rowId:r})).then(e=>{t.current.updateRows([e]),a()}).catch(e)}catch(g){e(g)}}else t.current.updateRows([f]),a()}),$={setRowEditingEditCellValue:e.useCallback(e=>{const{id:n,field:r,value:o,debounceMs:i,unstable_skipValueParser:l}=e;b(n,r);const u=t.current.getColumn(r),c=t.current.getRow(n);let d=o;u.valueParser&&!l&&(d=u.valueParser(o,c,u,t));let p=jl(t),h=a({},p[n][r],{value:d,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});return u.preProcessEditCellProps||D(n,r,h),new Promise(e=>{const o=[];if(u.preProcessEditCellProps){const i=h.value!==p[n][r].value;h=a({},h,{isProcessingProps:!0}),D(n,r,h);const l=p[n],f=s(l,[r].map(Ju)),g=Promise.resolve(u.preProcessEditCellProps({id:n,row:c,props:h,hasChanged:i,otherFieldsProps:f})).then(o=>{t.current.getRowMode(n)!==Oo.View?(p=jl(t),(o=a({},o,{isProcessingProps:!1})).value=u.preProcessEditCellProps?p[n][r].value:d,D(n,r,o)):e(!1)});o.push(g)}Object.entries(p[n]).forEach(([i,l])=>{if(i===r)return;const u=t.current.getColumn(i);if(!u.preProcessEditCellProps)return;l=a({},l,{isProcessingProps:!0}),D(n,i,l),p=jl(t);const d=p[n],h=s(d,[i].map(Ju)),f=Promise.resolve(u.preProcessEditCellProps({id:n,row:c,props:l,hasChanged:!1,otherFieldsProps:h})).then(r=>{t.current.getRowMode(n)!==Oo.View?(r=a({},r,{isProcessingProps:!1}),D(n,i,r)):e(!1)});o.push(f)}),Promise.all(o).then(()=>{t.current.getRowMode(n)===Oo.Edit?(p=jl(t),e(!p[n][r].error)):e(!1)})})},[t,b,D]),getRowWithUpdatedValuesFromRowEditing:e.useCallback(e=>{const n=jl(t),r=t.current.getRow(e);if(!n[e])return t.current.getRow(e);let o=a({},u.current[e],r);return Object.entries(n[e]).forEach(([e,n])=>{const r=t.current.getColumn(e);r?.valueSetter?o=r.valueSetter(n.value,o,r,t):o[e]=n.value}),o},[t])};dl(t,{getRowMode:P,startRowEditMode:F,stopRowEditMode:O},"public"),dl(t,$,"private"),e.useEffect(()=>{f&&k(f)},[f,k]),oe(()=>{const e=hr(t),n=l.current;l.current=Eo(r);const o=new Set([...Object.keys(r),...Object.keys(n)]);Array.from(o).forEach(o=>{const i=r[o]??{mode:Oo.View},s=n[o]?.mode||Oo.View,l=e[o]?t.current.getRowId(e[o]):o;i.mode===Oo.Edit&&s===Oo.View?A(a({id:l},i)):i.mode===Oo.View&&s===Oo.Edit&&H(a({id:l},i))})},[t,r,A,H])})(t,n);const o=e.useRef({}),{isCellEditable:i}=n,l=r.hooks.useIsCellEditable(t,n),u=e.useCallback(e=>!!l(e)&&(!!e.colDef.editable&&(!!e.colDef.renderEditCell&&(!i||i(e)))),[i,l]);e.useEffect(()=>{const e=o.current;return()=>{Object.entries(e).forEach(([t,n])=>{Object.keys(n).forEach(n=>{const[r]=e[t][n];clearTimeout(r),delete e[t][n]})})}},[]);const c=e.useCallback((e,t)=>{if(o.current[e])if(t){if(o.current[e][t]){const[,n]=o.current[e][t];n()}}else Object.keys(o.current[e]).forEach(t=>{const[,n]=o.current[e][t];n()})},[]),d=e.useCallback(e=>{const{id:r,field:i,debounceMs:s}=e;return new Promise(a=>{((e,t,n,r)=>{if(!n)return void r();if(o.current[e]||(o.current[e]={}),o.current[e][t]){const[n]=o.current[e][t];clearTimeout(n)}const i=setTimeout(()=>{r(),delete o.current[e][t]},n);o.current[e][t]=[i,()=>{const[n]=o.current[e][t];clearTimeout(n),r(),delete o.current[e][t]}]})(r,i,s,async()=>{const o=n.editMode===Fo.Row?t.current.setRowEditingEditCellValue:t.current.setCellEditingEditCellValue;if(t.current.getCellMode(r,i)===Ao.Edit){const t=await o(e);a(t)}})})},[t,n.editMode]),p=e.useCallback((e,r)=>n.editMode===Fo.Cell?t.current.getRowWithUpdatedValuesFromCellEditing(e,r):t.current.getRowWithUpdatedValuesFromRowEditing(e),[t,n.editMode]),h=e.useCallback((e,n)=>{const r=jl(t);return r[e]?.[n]??null},[t]),f={runPendingEditCellValueMutation:c};dl(t,{isCellEditable:u,setEditCellValue:d,getRowWithUpdatedValues:p,unstable_getEditCellMeta:h},"public"),dl(t,f,"private")},Kf=(e,t,n)=>{const r=!!t.dataSource;return n.current.caches.rows=kr({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),a({},e,{rows:Tr({apiRef:n,rowCountProp:t.rowCount,loadingProp:!!r||t.loading,previousTree:null,previousTreeDepths:null})})},qf=e=>"full"===e.updates.type?(e=>{const t={[Mr]:a({},{type:"group",id:Mr,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null},{children:e})};for(let n=0;n<e.length;n+=1){const r=e[n];t[r]={id:r,depth:0,parent:Mr,type:"leaf",groupingKey:null}}return{groupingName:lf,tree:t,treeDepths:{0:e.length},dataRowIds:e}})(e.updates.rows):(({previousTree:e,actions:t})=>{const n=a({},e),r={};for(let s=0;s<t.remove.length;s+=1){const e=t.remove[s];r[e]=!0,delete n[e]}for(let s=0;s<t.insert.length;s+=1){const e=t.insert[s];n[e]={id:e,depth:0,parent:Mr,type:"leaf",groupingKey:null}}const o=n[Mr];let i=[...o.children,...t.insert];return Object.values(r).length&&(i=i.filter(e=>!r[e])),n[Mr]=a({},o,{children:i}),{groupingName:lf,tree:n,treeDepths:{0:i.length},dataRowIds:i}})({previousTree:e.previousTree,actions:e.updates.actions});class Xf extends Error{}function Yf(t,n,r){const o=e.useCallback(e=>({field:e,colDef:t.current.getColumn(e)}),[t]),i=e.useCallback(e=>{const n=t.current.getRow(e);if(!n)throw new Xf(`No row with id #${e} found`);return{id:e,columns:t.current.getAllColumns(),row:n}},[t]),s=e.useCallback((e,n,r,{cellMode:o,colDef:i,hasFocus:s,rowNode:a,tabIndex:l,value:u,formattedValue:c})=>{const d={id:e,field:n,row:r,rowNode:a,colDef:i,cellMode:o,hasFocus:s,tabIndex:l,value:void 0!==u?u:t.current.getRowValue(r,i),formattedValue:void 0!==c?c:t.current.getRowFormattedValue(r,i),isEditable:!1,api:t.current};return d.isEditable=i&&t.current.isCellEditable(d),d},[t]),a=e.useCallback((e,r)=>{const o=t.current.getRow(e),i=gr(t,e);if(!o||!i)throw new Xf(`No row with id #${e} found`);const s=Vs(t),a=Ks(t),l=t.current.getCellMode(e,r);return t.current.getCellParamsForRow(e,r,o,{colDef:n.listView&&n.listViewColumn?.field===r?Qo(t):t.current.getColumn(r),rowNode:i,hasFocus:null!==s&&s.field===r&&s.id===e,tabIndex:a&&a.field===r&&a.id===e?0:-1,cellMode:l})},[t,n.listView,n.listViewColumn?.field]),l=e.useCallback(e=>t.current.rootElementRef.current?function(e,t){return e.querySelector(`[role="columnheader"][data-field="${od(t)}"]`)}(t.current.rootElementRef.current,e):null,[t]),u=e.useCallback(e=>t.current.rootElementRef.current?function(e,t){return e.querySelector(id(t))}(t.current.rootElementRef.current,e):null,[t]),c=e.useCallback((e,n)=>t.current.rootElementRef.current?function(e,{id:t,field:n}){const r=`${id(t)} .${Vr.cell}[data-field="${od(n)}"]`;return e.querySelector(r)}(t.current.rootElementRef.current,{id:e,field:n}):null,[t]),d=r.hooks.useGridParamsOverridableMethods(t),p={getCellValue:d.getCellValue,getCellParams:a,getCellElement:c,getRowValue:d.getRowValue,getRowFormattedValue:d.getRowFormattedValue,getRowParams:i,getRowElement:u,getColumnHeaderParams:o,getColumnHeaderElement:l},h={getCellParamsForRow:s};dl(t,p,"public"),dl(t,h,"private")}const Qf={type:"include",ids:new Set},Zf=(e,t)=>a({},e,{rowSelection:t.rowSelection?t.rowSelectionModel??Qf:Qf}),Jf=(t,n)=>{const r=(t=>{const{classes:n}=t;return e.useMemo(()=>ie({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},_r,n),[n])})({classes:n.classes}),o=e.useCallback(e=>{const o=a({},fa,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:t.current.getLocaleText("checkboxSelectionHeaderName")}),i=n.checkboxSelection,s=null!=e.lookup[ha];return i&&!s?(e.lookup[ha]=o,e.orderedFields=[ha,...e.orderedFields]):!i&&s?(delete e.lookup[ha],e.orderedFields=e.orderedFields.filter(e=>e!==ha)):i&&s&&(e.lookup[ha]=a({},o,e.lookup[ha]),n.columns.some(e=>e.field===ha)||(e.orderedFields=[ha,...e.orderedFields.filter(e=>e!==ha)])),e},[t,r,n.columns,n.checkboxSelection]);ec(t,"hydrateColumns",o)},eg=(e,t)=>{const n=t.sortModel??t.initialState?.sorting?.sortModel??[];return a({},e,{sorting:{sortModel:go(n,t.disableMultipleColumnsSorting),sortedRows:[]}})};function tg(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;return r>t?o:i-t>n?i-t:o<n?o:void 0}const ng={width:0,height:0},rg={isReady:!1,root:ng,viewportOuterSize:ng,viewportInnerSize:ng,contentSize:ng,minimumSize:ng,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},og=(e,t,n)=>{const r=rg,o=uo(n),i=a({},r,function(e,t,n,r){const o=zr(e.rowHeight,Qu.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:ig(t),headersTotalHeight:tl(t,e),leftPinnedWidth:r.left.reduce((e,t)=>e+t.computedWidth,0),rightPinnedWidth:r.right.reduce((e,t)=>e+t.computedWidth,0)}}(t,n,o,ai(n)));return n.current.store.state.dimensions=i,a({},e,{dimensions:i})},ig=Kn(oi,ui,(e,t)=>{const n=e.length;return 0===n?0:Xl(t[n-1]+e[n-1].computedWidth,1)});function sg(e,t){const n=(t,n)=>e.style.setProperty(t,n);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}const ag=["groupId","children"],lg=e=>{const t={};for(let n=0;n<e.length;n+=1){const r=e[n];if(Vo(r))continue;const{groupId:o,children:i}=r,l=s(r,ag);if(!o)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const u=a({},l,{groupId:o}),c=lg(i);if(void 0!==c[o]||void 0!==t[o])throw new Error(`MUI X: The groupId ${o} is used multiple times in the columnGroupingModel.`);Object.assign(t,c),t[o]=u}return t},ug=(e,t,n)=>{if(Vo(e)){if(void 0!==n[e.field])throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join("\n"));return void(n[e.field]=t)}const{groupId:r,children:o}=e;o.forEach(e=>{ug(e,[...t,r],n)})},cg=e=>{if(!e)return{};const t={};return e.forEach(e=>{ug(e,[],t)}),t},dg=(e,t,n)=>{const r=e=>t[e]??[],o=[],i=Math.max(0,...e.map(e=>r(e).length)),s=(e,t,n)=>{const o=r(e),i=r(t);for(let r=0;r<=n;r+=1)if(o[r]!==i[r])return!1;return!0},a=(e,t)=>{const r=n?.left,o=n?.right,i=!!r?.includes(e),s=!!r?.includes(t),a=!!o?.includes(e),l=!!o?.includes(t);return i!==s||a!==l};for(let l=0;l<i;l+=1){const t=[];for(let n=0;n<e.length;n+=1){const o=e[n],i=r(o)[l]??null;if(0===t.length){t.push({columnFields:[o],groupId:i});continue}const u=t[t.length-1],c=u.columnFields[u.columnFields.length-1];u.groupId!==i||!s(c,o,l)||a(c,o)?t.push({columnFields:[o],groupId:i}):u.columnFields.push(o)}o.push(t)}return o},pg=(e,t,n)=>{if(n.current.caches.columnGrouping={lastColumnGroupingModel:t.columnGroupingModel},!t.columnGroupingModel)return a({},e,{columnGrouping:void 0});const r=Jo(n),o=ii(n),i=lg(t.columnGroupingModel??[]),s=cg(t.columnGroupingModel??[]),l=dg(r,s,n.current.state.pinnedColumns??{}),u=0===o.length?0:Math.max(...o.map(e=>s[e]?.length??0));return a({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:s,headerStructure:l,maxDepth:u}})};function hg(e,t){if(void 0!==t&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function fg(e,t,n,r){let o=e;return o+="Right"===r?t-n.left:n.right-t,Math.round(o)}function gg(e,t){return t===Ko.LEFT?e?"--DataGrid-rightPinnedWidth":"--DataGrid-leftPinnedWidth":e?"--DataGrid-leftPinnedWidth":"--DataGrid-rightPinnedWidth"}function mg(e,t,n){return n===Ko.LEFT?t?e.rightPinnedWidth:e.leftPinnedWidth:t?e.leftPinnedWidth:e.rightPinnedWidth}function bg(e){e.preventDefault(),e.stopImmediatePropagation()}function vg(t){const n=e.useRef(void 0),r=()=>Tu(t),o=so(t,r);e.useEffect(()=>{n.current&&!1===o&&(n.current.resolve(),n.current=void 0)});return()=>{if(!n.current){if(!1===r())return Promise.resolve();n.current=function(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}()}return n.current}}function wg(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(Vr.autosizing),n.forEach(n=>{const o=function(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${od(t)}"][role="gridcell"]`))}(e.current,n.field),i=o.map(e=>e.getBoundingClientRect().width??0),s=t.includeOutliers?i:function(e,t){if(e.length<4)return e;const n=e.slice();n.sort((e,t)=>e-t);const r=n[Math.floor(.25*n.length)],o=n[Math.floor(.75*n.length)-1],i=o-r,s=i<5?5:i*t;return n.filter(e=>e>r-s&&e<o+s)}(i,t.outliersFactor);if(t.includeHeaders){const t=(a=e.current,l=n.field,a.columnHeadersContainerRef.current.querySelector(`:scope > div > [data-field="${od(l)}"][role="columnheader"]`));if(t){const e=t.querySelector(`.${Vr.columnHeaderTitle}`),n=t.querySelector(`.${Vr.columnHeaderTitleContainerContent}`),r=t.querySelector(`.${Vr.iconButtonContainer}`),o=t.querySelector(`.${Vr.menuIcon}`),i=e??n,a=window.getComputedStyle(t,null),l=parseInt(a.paddingLeft,10)+parseInt(a.paddingRight,10),u=i.scrollWidth+1+l+(r?.clientWidth??0)+(o?.clientWidth??0);s.push(u)}}var a,l;const u=n.minWidth!==-1/0&&void 0!==n.minWidth,c=n.maxWidth!==1/0&&void 0!==n.maxWidth,d=u?n.minWidth:0,p=c?n.maxWidth:1/0,h=0===s.length?0:Math.max(...s);r[n.field]=ko(h,d,p)}),o.classList.remove(Vr.autosizing),r}const yg=e=>a({},e,{columnResize:{resizingColumnField:""}});function xg(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const Cg=(t,n)=>{const r=ae(),o=pl(t,"useGridColumnResize"),i=ee(xg).current,s=e.useRef(null),l=e.useRef(null),u=se(),c=e.useRef(void 0),d=e=>{o.debug(`Updating width to ${e} for col ${i.colDef.field}`);const n=i.columnHeaderElement.offsetWidth,s=e-n,a=e-i.initialColWidth;if(a>0){const e=i.initialTotalWidth+a;t.current.rootElementRef?.current?.style.setProperty("--DataGrid-rowWidth",`${e}px`)}i.colDef.computedWidth=e,i.colDef.width=e,i.colDef.flex=0,i.columnHeaderElement.style.width=`${e}px`;const l=i.headerFilterElement;l&&(l.style.width=`${e}px`),i.groupHeaderElements.forEach(t=>{const n=t;let r;r="1"===n.getAttribute("aria-colspan")?`${e}px`:`${n.offsetWidth+s}px`,n.style.width=r}),i.cellElements.forEach(t=>{const n=t;let r;r="1"===n.getAttribute("aria-colspan")?`${e}px`:`${n.offsetWidth+s}px`,n.style.setProperty("--width",r)});const u=Qn(t),c=t.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);c===Ko.LEFT&&(Sg(i.fillerLeft,"width",s),i.leftPinnedCellsAfter.forEach(e=>{Sg(e,"left",s)}),i.leftPinnedHeadersAfter.forEach(e=>{Sg(e,"left",s)}),t.current.rootElementRef?.current?.style.setProperty(gg(r,c),`${mg(u,r,c)+a}px`)),c===Ko.RIGHT&&(Sg(i.fillerRight,"width",s),i.rightPinnedCellsBefore.forEach(e=>{Sg(e,"right",s)}),i.rightPinnedHeadersBefore.forEach(e=>{Sg(e,"right",s)}),t.current.rootElementRef?.current?.style.setProperty(gg(r,c),`${mg(u,r,c)+a}px`))},p=e=>{if(w(),i.previousMouseClickEvent){const n=i.previousMouseClickEvent,r=n.timeStamp,o=n.clientX,s=n.clientY;if(e.timeStamp-r<300&&e.clientX===o&&e.clientY===s)return i.previousMouseClickEvent=void 0,void t.current.publishEvent("columnResizeStop",null,e)}if(i.colDef){t.current.setColumnWidth(i.colDef.field,i.colDef.width),o.debug(`Updating col ${i.colDef.field} with new width: ${i.colDef.width}`);const e=Zo(t);i.groupHeaderElements.forEach(t=>{const n=t,r=`${t.getAttribute("data-fields").slice(2,-2).split("-|-").reduce((t,n)=>!1!==e.columnVisibilityModel[n]?t+e.lookup[n].computedWidth:t,0)}px`;n.style.width=r})}u.start(0,()=>{t.current.publishEvent("columnResizeStop",null,e)})},h=(e,n,o)=>{const a=t.current.rootElementRef.current;var u,c;i.initialColWidth=e.computedWidth,i.initialTotalWidth=t.current.getRootDimensions().rowWidth,i.colDef=e,i.columnHeaderElement=(u=t.current.columnHeadersContainerRef.current,c=e.field,u.querySelector(`[data-field="${od(c)}"]`));const d=a.querySelector(`.${Vr.headerFilterRow} [data-field="${od(e.field)}"]`);d&&(i.headerFilterElement=d),i.groupHeaderElements=function(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${od(t)}-|"]`)??[])}(t.current.columnHeadersContainerRef?.current,e.field),i.cellElements=function(e,t){if(!rd(e,Vr.root))throw new Error("MUI X: The root element is not found.");const n=e.getAttribute("aria-colindex");if(!n)return[];const r=Number(n)-1,o=[];return t.virtualScrollerRef?.current?(cd(t).forEach(e=>{const n=e.getAttribute("data-id");if(!n)return;let i=r;const s=t.unstable_getCellColSpanInfo(n,r);s&&s.spannedByColSpan&&(i=s.leftVisibleCellIndex);const a=e.querySelector(`[data-colindex="${i}"]`);a&&o.push(a)}),o):[]}(i.columnHeaderElement,t.current),i.fillerLeft=ad(t.current,r?"filler--pinnedRight":"filler--pinnedLeft"),i.fillerRight=ad(t.current,r?"filler--pinnedLeft":"filler--pinnedRight");const p=t.current.unstable_applyPipeProcessors("isColumnPinned",!1,i.colDef.field);i.leftPinnedCellsAfter=p!==Ko.LEFT?[]:function(e,t,n){const r=dd(t);return ld({api:e,colIndex:r,position:n?"right":"left",filterFn:e=>n?e<r:e>r})}(t.current,i.columnHeaderElement,r),i.rightPinnedCellsBefore=p!==Ko.RIGHT?[]:function(e,t,n){const r=dd(t);return ld({api:e,colIndex:r,position:n?"left":"right",filterFn:e=>n?e>r:e<r})}(t.current,i.columnHeaderElement,r),i.leftPinnedHeadersAfter=p!==Ko.LEFT?[]:function(e,t,n){const r=dd(t);return ud({api:e,position:n?"right":"left",colIndex:r,filterFn:e=>n?e<r:e>r})}(t.current,i.columnHeaderElement,r),i.rightPinnedHeadersBefore=p!==Ko.RIGHT?[]:function(e,t,n){const r=dd(t);return ud({api:e,position:n?"left":"right",colIndex:r,filterFn:(e,t)=>!t.classList.contains(Vr["columnHeader--last"])&&(n?e>r:e<r)})}(t.current,i.columnHeaderElement,r),l.current=function(e,t){const n=e.classList.contains(Vr["columnSeparator--sideRight"])?"Right":"Left";return t?function(e){return"Right"===e?"Left":"Right"}(n):n}(n,r),s.current=function(e,t,n){return"Left"===n?e-t.left:t.right-e}(o,i.columnHeaderElement.getBoundingClientRect(),l.current)},f=y(p),g=y(e=>{if(0===e.buttons)return void f(e);let n=fg(s.current,e.clientX,i.columnHeaderElement.getBoundingClientRect(),l.current);n=ko(n,i.colDef.minWidth,i.colDef.maxWidth),d(n);const r={element:i.columnHeaderElement,colDef:i.colDef,width:n};t.current.publishEvent("columnResize",r,e)}),m=y(e=>{hg(e,c.current)&&p(e)}),b=y(e=>{const n=hg(e,c.current);if(!n)return;if("mousemove"===e.type&&0===e.buttons)return void m(e);let r=fg(s.current,n.x,i.columnHeaderElement.getBoundingClientRect(),l.current);r=ko(r,i.colDef.minWidth,i.colDef.maxWidth),d(r);const o={element:i.columnHeaderElement,colDef:i.colDef,width:r};t.current.publishEvent("columnResize",o,e)}),v=y(e=>{const n=rd(e.target,Vr["columnSeparator--resizable"]);if(!n)return;const r=e.changedTouches[0];null!=r&&(c.current=r.identifier);const i=rd(e.target,Vr.columnHeader),s=i.getAttribute("data-field");const a=t.current.getColumn(s);o.debug(`Start Resize on col ${a.field}`),t.current.publishEvent("columnResizeStart",{field:s},e),h(a,n,r.clientX);const l=ce(e.currentTarget);l.addEventListener("touchmove",b),l.addEventListener("touchend",m)}),w=e.useCallback(()=>{const e=ce(t.current.rootElementRef.current);e.body.style.removeProperty("cursor"),e.removeEventListener("mousemove",g),e.removeEventListener("mouseup",f),e.removeEventListener("touchmove",b),e.removeEventListener("touchend",m),setTimeout(()=>{e.removeEventListener("click",bg,!0)},100),i.columnHeaderElement&&(i.columnHeaderElement.style.pointerEvents="unset")},[t,i,g,f,b,m]),x=e.useCallback(({field:e})=>{t.current.setState(t=>a({},t,{columnResize:a({},t.columnResize,{resizingColumnField:e})}))},[t]),C=e.useCallback(()=>{t.current.setState(e=>a({},e,{columnResize:a({},e.columnResize,{resizingColumnField:""})}))},[t]),S=y(({colDef:e},n)=>{if(0!==n.button)return;if(!n.currentTarget.classList.contains(Vr["columnSeparator--resizable"]))return;n.preventDefault(),o.debug(`Start Resize on col ${e.field}`),t.current.publishEvent("columnResizeStart",{field:e.field},n),h(e,n.currentTarget,n.clientX);const r=ce(t.current.rootElementRef.current);r.body.style.cursor="col-resize",i.previousMouseClickEvent=n.nativeEvent,r.addEventListener("mousemove",g),r.addEventListener("mouseup",f),r.addEventListener("click",bg,!0)}),M=y((e,r)=>{if(n.disableAutosize)return;if(0!==r.button)return;const o=t.current.state.columns.lookup[e.field];!1!==o.resizable&&t.current.autosizeColumns(a({},n.autosizeOptions,{disableColumnVirtualization:!1,columns:[o.field]}))}),R=vg(t),I=e.useRef(!1),P=e.useCallback(async e=>{const r=t.current.rootElementRef?.current;if(!r)return;if(I.current)return;I.current=!0;const o=Zo(t),i=a({},Ll,e,{columns:e?.columns??o.orderedFields});i.columns=i.columns.filter(e=>!1!==o.columnVisibilityModel[e]);const s=i.columns.map(e=>t.current.state.columns.lookup[e]);try{!n.disableVirtualization&&i.disableColumnVirtualization&&(t.current.unstable_setColumnVirtualization(!1),await R());const e=wg(t,i,s),r=s.map(t=>a({},t,{width:e[t.field],computedWidth:e[t.field],flex:0}));if(i.expand){const n=o.orderedFields.map(e=>o.lookup[e]).filter(e=>!1!==o.columnVisibilityModel[e.field]).reduce((t,n)=>t+(e[n.field]??n.computedWidth??n.width),0),i=t.current.getRootDimensions(),s=i.viewportInnerSize.width-n;if(s>0){const e=s/(r.length||1);r.forEach(t=>{t.width+=e,t.computedWidth+=e})}}t.current.updateColumns(r),r.forEach((e,n)=>{if(e.width!==s[n].width){const n=e.width;t.current.publishEvent("columnWidthChange",{element:t.current.getColumnHeaderElement(e.field),colDef:e,width:n})}})}finally{n.disableVirtualization||t.current.unstable_setColumnVirtualization(!0),I.current=!1}},[t,R,n.disableVirtualization]);e.useEffect(()=>w,[w]),te(()=>{n.autosizeOnMount&&Promise.resolve().then(()=>{t.current.autosizeColumns(n.autosizeOptions)})}),hl(t,()=>t.current.columnHeadersContainerRef?.current,"touchstart",v,{passive:!0}),dl(t,{autosizeColumns:P},"public"),Yr(t,"columnResizeStop",C),Yr(t,"columnResizeStart",x),Yr(t,"columnSeparatorMouseDown",S),Yr(t,"columnSeparatorDoubleClick",M),Zr(t,"columnResize",n.onColumnResize),Zr(t,"columnWidthChange",n.onColumnWidthChange)};function Sg(e,t,n){e&&(e.style[t]=`${Math.round(parseFloat(e.style[t]))+n}px`)}function Mg(e){return 0!==e.firstRowIndex||0!==e.lastRowIndex}const Rg=(e,t,n)=>{if(!e)return null;const r=e[t.field];return t.rowSpanValueGetter?t.rowSpanValueGetter(r,e,t,n):Pr(e,t,n)},Ig={caches:{spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},processedRange:{firstRowIndex:0,lastRowIndex:0}},Pg=e=>a({},e,{rowSpanning:Ig}),kg=(t,n)=>{const r=e.useCallback((e,n=!1)=>{const r=t.current.virtualizer.store,{range:o,rows:i}=qu(t);if(n&&r.set("rowSpanning",Ig),null===o||!Mg(e))return;const s=n?Ig:Ru.selectors.state(r.state),l=(u={firstRowIndex:e.firstRowIndex,lastRowIndex:Math.min(e.lastRowIndex,o.lastRowIndex-o.firstRowIndex+1)},c=s.processedRange,u.firstRowIndex>=c.firstRowIndex&&u.lastRowIndex<=c.lastRowIndex?null:u.firstRowIndex>=c.firstRowIndex&&u.lastRowIndex>c.lastRowIndex?{firstRowIndex:c.lastRowIndex,lastRowIndex:u.lastRowIndex}:u.firstRowIndex<c.firstRowIndex&&u.lastRowIndex<=c.lastRowIndex?{firstRowIndex:u.firstRowIndex,lastRowIndex:c.firstRowIndex-1}:u);var u,c;if(null===l)return;const d=oi(t),p=((e,t,n,r,o,i)=>{const s=e.current.virtualizer,l=i?Ig:Ru.selectors.state(s.store.state),u=a({},l.caches.spannedCells),c=a({},l.caches.hiddenCells),d=a({},l.caches.hiddenCellOriginMap),p={firstRowIndex:Math.min(l.processedRange.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.processedRange.lastRowIndex,o.lastRowIndex)};return t.forEach((t,i)=>{for(let s=o.firstRowIndex;s<o.lastRowIndex;s+=1){const a=n[s];if(c[a.id]?.[i])continue;const l=Rg(a.model,t,e);if(null==l)continue;let p=a.id,h=s,f=0;const g=[];if(s===o.firstRowIndex){let o=s-1,a=n[o];for(;o>=r.firstRowIndex&&a&&Rg(a.model,t,e)===l;){const e=n[o+1];c[e.id]?c[e.id][i]=!0:c[e.id]={[i]:!0},g.push(s),f+=1,p=a.id,h=o,o-=1,a=n[o]}}g.forEach(e=>{d[e]?d[e][i]=h:d[e]={[i]:h}});let m=s+1;for(;m<=r.lastRowIndex&&n[m]&&Rg(n[m].model,t,e)===l;){const e=n[m];c[e.id]?c[e.id][i]=!0:c[e.id]={[i]:!0},d[m]?d[m][i]=h:d[m]={[i]:h},m+=1,f+=1}f>0&&(u[p]?u[p][i]=f+1:u[p]={[i]:f+1})}}),{caches:{spannedCells:u,hiddenCells:c,hiddenCellOriginMap:d},processedRange:p}})(t,d,i,o,l,n),h=Object.keys(p.caches.spannedCells).length,f=Object.keys(p.caches.hiddenCells).length,g=Object.keys(s.caches.spannedCells).length,m=Object.keys(s.caches.hiddenCells).length;(n||h!==g||f!==m)&&!(0===h&&0===g)&&r.set("rowSpanning",p)},[t]),{schedule:o,cancel:i}=function(t){const n=e.useRef(null),r=e.useCallback((...e)=>{n.current||queueMicrotask(()=>{n.current&&n.current()}),n.current=()=>{n.current=null,t(...e)}},[t]);return e.useLayoutEffect(()=>{n.current&&n.current()}),{schedule:r,cancel:()=>!!n.current&&(n.current=null,!0)}}(r),s=e.useCallback(()=>{const e=Du(t);Mg(e)&&o(e,!0)},[t,o]);Yr(t,"renderedRowsIntervalChange",To(n.rowSpanning,e=>{const t=i();r(e,t)})),Yr(t,"sortedRowsSet",To(n.rowSpanning,s)),Yr(t,"paginationModelChange",To(n.rowSpanning,s)),Yr(t,"filteredRowsSet",To(n.rowSpanning,s)),Yr(t,"columnsChange",To(n.rowSpanning,s)),e.useEffect(()=>{const e=t.current.virtualizer?.store;e&&(n.rowSpanning?e.state.rowSpanning===Ig&&r(Du(t)):e.state.rowSpanning!==Ig&&e.set("rowSpanning",Ig))},[t,n.rowSpanning,r])},Eg=(e,t,n)=>a({},e,{listViewColumn:t.listViewColumn?a({},t.listViewColumn,{computedWidth:Tg(n)}):void 0});function Tg(e){return Qn(e).viewportInnerSize.width}const Dg=Kn(fs,ds,ta,(e,t,n)=>({groupKeys:[],paginationModel:n,sortModel:t,filterModel:e,start:n.page*n.pageSize,end:n.page*n.pageSize+n.pageSize-1}));let Fg=function(e){return e.Default="set-flat-rows",e.LazyLoading="replace-row-range",e.GroupedData="set-grouped-rows",e}({});class Ag{constructor(e){this.chunkSize=e}getCacheKeys=e=>{if(this.chunkSize<1||"number"!=typeof e.start)return[e];const t=[];for(let n=e.start;n<=e.end;n+=this.chunkSize){const r=Math.min(n+this.chunkSize-1,e.end);t.push(a({},e,{start:n,end:r}))}return t};splitResponse=(e,t)=>{const n=this.getCacheKeys(e);if(1===n.length)return new Map([[e,t]]);const r=new Map;return n.forEach(n=>{const o=n.end===e.end,i=a({},t,{pageInfo:a({},t.pageInfo,{hasNextPage:void 0!==t.pageInfo?.hasNextPage&&!o||t.pageInfo?.hasNextPage,nextCursor:void 0===t.pageInfo?.nextCursor||o?t.pageInfo?.nextCursor:t.rows[n.end+1].id}),rows:"number"!=typeof n.start||"number"!=typeof e.start?t.rows:t.rows.slice(n.start-e.start,n.end-e.start+1)});r.set(n,i)}),r};static mergeResponses=e=>1===e.length?e[0]:e.reduce((e,t)=>a({},t,{rows:[...e.rows,...t.rows]}),{rows:[],rowCount:0,pageInfo:{}})}const Og=["skipCache","keepChildrenExpanded"],Hg={clear:()=>{},get:()=>{},set:()=>{}};function $g(e,t={}){return null===e?Hg:e??new Ou(t)}const zg=(t,n)=>{const{api:r,strategyProcessor:o,events:i,setStrategyAvailability:l}=((t,n,r={})=>{const o=e.useCallback(()=>{t.current.setStrategyAvailability(sf.DataSource,Fg.Default,n.dataSource?()=>!0:()=>!1)},[t,n.dataSource]),[i,l]=e.useState(t.current.getActiveStrategy(sf.DataSource)),u=e.useMemo(()=>i===Fg.Default||i===Fg.GroupedData,[i]),c=so(t,ta),d=e.useRef(0),p=n.onDataSourceError,h=ee(()=>{if(!n.pagination)return new Ag(c.pageSize);const e=n.pageSizeOptions.map(e=>"number"==typeof e?e:e.value).sort((e,t)=>e-t),t=Math.min(c.pageSize,e[0]);return new Ag(t)}).current,[f,g]=e.useState(()=>$g(n.dataSourceCache,r.cacheOptions)),m=e.useCallback(async(e,o)=>{const i=n.dataSource?.getRows;if(!i)return;if(e&&e!==Mr&&"DataGrid"!==n.signature)return void r.fetchRowChildren?.([e]);r.clearDataSourceState?.();const l=o||{},{skipCache:c,keepChildrenExpanded:g}=l,m=s(l,Og),b=a({},Dg(t),t.current.unstable_applyPipeProcessors("getRowsParams",{}),m),v=h.getCacheKeys(b).map(e=>f.get(e));if(!c&&v.every(e=>void 0!==e))return void t.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:Ag.mergeResponses(v),fetchParams:b,options:{skipCache:c,keepChildrenExpanded:g}});(u||0===t.current.getRowsCount())&&t.current.setLoading(!0);const w=d.current+1;d.current=w;try{const e=await i(b);h.splitResponse(b,e).forEach((e,t)=>f.set(t,e)),d.current===w&&t.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:e,fetchParams:b,options:{skipCache:c,keepChildrenExpanded:g}})}catch(y){d.current===w&&(t.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:y,fetchParams:b,options:{skipCache:c,keepChildrenExpanded:g}}),"function"==typeof p&&p(new Hu({message:y?.message,params:b,cause:y})))}finally{u&&d.current===w&&t.current.setLoading(!1)}},[h,f,t,u,n.dataSource?.getRows,p,r,n.signature]),b=e.useCallback(()=>{l(t.current.getActiveStrategy(sf.DataSource))},[t]),v=e.useCallback(e=>{if("error"in e)return void t.current.setRows([]);const{response:n}=e;void 0!==n.rowCount&&t.current.setRowCount(n.rowCount),t.current.setRows(n.rows),t.current.unstable_applyPipeProcessors("processDataSourceRows",{params:e.fetchParams,response:n},!0)},[t]),w=n.dataSource?.updateRow,y=r.handleEditRow,x=e.useCallback(async e=>{if(w)try{const n=await w(e);return"function"==typeof y?(y(e,n),n):(n&&!ql(n,e.previousRow)&&t.current.dataSource.cache.clear(),t.current.updateNestedRows([n],[]),n)}catch(n){throw"function"==typeof p&&p(new $u({message:n?.message,params:e,cause:n})),n}},[t,w,p,y]),C={dataSource:{fetchRows:m,cache:f,editRow:x}},S=e.useMemo(()=>he(m,0),[m]),M=e.useRef(!0);return e.useEffect(()=>{if(M.current)return void(M.current=!1);if(void 0===n.dataSourceCache)return;const e=$g(n.dataSourceCache,r.cacheOptions);g(t=>t!==e?e:t)},[n.dataSourceCache,r.cacheOptions]),e.useEffect(()=>{if(i===Fg.Default||i===Fg.LazyLoading||i===Fg.GroupedData)return n.dataSource&&(t.current.dataSource.cache.clear(),t.current.dataSource.fetchRows()),()=>{d.current+=1}},[t,n.dataSource,i]),{api:{public:C},debouncedFetchRows:S,strategyProcessor:{strategyName:Fg.Default,group:"dataSourceRowsUpdate",processor:v},setStrategyAvailability:o,cacheChunkManager:h,cache:f,events:{strategyAvailabilityChange:b,sortModelChange:To(u,()=>S()),filterModelChange:To(u,()=>S()),paginationModelChange:To(u,()=>S())}}})(t,n);dl(t,r.public,"public"),af(t,o.strategyName,o.group,o.processor),Object.entries(i).forEach(([e,n])=>{Yr(t,e,n)}),e.useEffect(()=>{l()},[l])},Lg=(t,n,r)=>{df(t,n),Jf(t,n),(e=>{af(e,lf,"rowTreeCreation",qf)})(t),pf(cf,t,n),pf(Zf,t,n),pf(yf,t,n),pf(Kf,t,n),pf(zf,t,n),pf(Wf,t,n),pf(Ff,t,n),pf(eg,t,n),pf(jf,t,n),pf(kf,t,n),pf(Pg,t,n),pf(Cf,t,n),pf(yg,t,n),pf(wf,t,n),pf(pg,t,n),pf(ku,t,n),pf(og,t,n),pf(nc,t,n),pf(Eg,t,n),$f(t,n),((t,n)=>{const r=pl(t,"useGridSelection"),o=e.useCallback(e=>(...t)=>{n.rowSelection&&e(...t)},[n.rowSelection]),i=so(t,wr)>1,s=n.signature!==Br.DataGrid&&(n.rowSelectionPropagation?.parents||n.rowSelectionPropagation?.descendants)&&i,l=e.useMemo(()=>n.rowSelectionModel,[n.rowSelectionModel]),u=e.useRef(null);t.current.registerControlState({stateId:"rowSelection",propModel:l,propOnChange:n.onRowSelectionModelChange,stateSelector:Es,changeEvent:"rowSelectionChange"});const{checkboxSelection:c,disableRowSelectionOnClick:d,isRowSelectable:p}=n,h=zs(n),f=e.useCallback(e=>{let n=e;const r=u.current??e,o=t.current.isRowSelected(e);if(o){const e=ws(t),o=e.findIndex(e=>e===r),i=e.findIndex(e=>e===n);if(o===i)return;n=o>i?e[i+1]:e[i-1]}u.current=e,t.current.selectRowRange({startId:r,endId:n},!o)},[t]),g=y(()=>n.pagination&&n.checkboxSelectionVisibleOnly&&"client"===n.paginationMode?ua(t):ws(t)),m=e.useCallback((e,o)=>{if(n.signature===Br.DataGrid&&!h&&("include"!==e.type||e.ids.size>1))throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join("\n"));if(Es(t)!==e){if(r.debug("Setting selection model"),null!==u.current){const t=e.ids.has(u.current);("include"===e.type&&!t||"exclude"===e.type&&t)&&(u.current=null)}t.current.setState(t=>a({},t,{rowSelection:n.rowSelection?e:Qf}),o)}},[t,r,n.rowSelection,n.signature,h]),b=e.useCallback(e=>Ts(t).has(e),[t]),v=e.useCallback(e=>{if(!1===n.rowSelection)return!1;if(p&&!p(t.current.getRowParams(e)))return!1;const r=gr(t,e);return"footer"!==r?.type&&"pinnedRow"!==r?.type},[t,n.rowSelection,p]),w=e.useCallback(()=>Fs(t),[t]),x=e.useCallback((e,o=!0,i=!1)=>{if(!t.current.isRowSelectable(e))return;const a=fr(t);if(u.current=o?e:null,i){r.debug(`Setting selection for row ${e}`);const i={type:"include",ids:new Set},l=e=>{i.ids.add(e)};o&&(l(e),s&&Ls(t,a,e,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,l)),t.current.setRowSelectionModel(i,"singleRowSelection")}else{r.debug(`Toggling selection for row ${e}`);const i=Es(t),l={type:i.type,ids:new Set(i.ids)},u=Lo(l);u.unselect(e);const c=e=>{u.select(e)},d=e=>{u.unselect(e)};o?(c(e),s&&Ls(t,a,e,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,c)):s&&js(t,a,e,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,d),("include"===l.type&&l.ids.size<2||h)&&t.current.setRowSelectionModel(l,"singleRowSelection")}},[t,r,s,n.rowSelectionPropagation?.descendants,n.rowSelectionPropagation?.parents,h]),C=e.useCallback((e,o=!0,i=!1)=>{if(r.debug("Setting selection for several rows"),!1===n.rowSelection)return;const a=fr(t),l=new Set;for(let n=0;n<e.length;n+=1){const r=e[n];t.current.isRowSelectable(r)&&l.add(r)}const u=Es(t);let c;if(i){if(c={type:"include",ids:l},o){const e=Lo(c);if(s){const r=t=>{e.select(t)};for(const e of l)Ls(t,a,e,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,r)}}else c.ids=new Set;if(u.type===c.type&&c.ids.size===u.ids.size&&Array.from(c.ids).every(e=>u.ids.has(e)))return}else{c={type:u.type,ids:new Set(u.ids)};const e=Lo(c),r=t=>{e.select(t)},i=t=>{e.unselect(t)};for(const u of l)o?(e.select(u),s&&Ls(t,a,u,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,r)):(i(u),s&&js(t,a,u,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,i))}("include"===c.type&&c.ids.size<2||h)&&t.current.setRowSelectionModel(c,"multipleRowsSelection")},[r,s,h,t,n.rowSelectionPropagation?.descendants,n.rowSelectionPropagation?.parents,n.rowSelection]),S=e.useCallback(e=>{if(!i||!s||"exclude"===e.type||0===e.ids.size&&"include"===e.type)return e;const r={type:e.type,ids:new Set(e.ids)},o=fr(t),a=Lo(r),l=e=>{a.select(e)};for(const i of e.ids)Ls(t,o,i,n.rowSelectionPropagation?.descendants??!1,n.rowSelectionPropagation?.parents??!1,l,a);return r},[t,n.rowSelectionPropagation?.descendants,n.rowSelectionPropagation?.parents,i,s]),M={selectRows:C,selectRowRange:e.useCallback(({startId:e,endId:n},o=!0,i=!1)=>{if(!t.current.getRow(e)||!t.current.getRow(n))return;r.debug(`Expanding selection from row ${e} to row ${n}`);const s=ws(t),a=s.indexOf(e),l=s.indexOf(n),[u,c]=a>l?[l,a]:[a,l],d=s.slice(u,c+1);t.current.selectRows(d,o,i)},[t,r]),getPropagatedRowSelectionModel:S};dl(t,{selectRow:x,setRowSelectionModel:m,getSelectedRows:w,isRowSelected:b,isRowSelectable:v},"public"),dl(t,M,n.signature===Br.DataGrid?"private":"public");const R=e.useRef(!0),I=e.useCallback((e=!1)=>{if(R.current)return;const r=Es(t),o=hr(t),s=fr(t),a=bs(t),l=e=>"server"===n.filterMode?!o[e]:!s[e]||!1===a[e],u={type:r.type,ids:new Set(r.ids)},c=Lo(u);let d=!1;for(const t of r.ids){if(l(t)){if(n.keepNonExistentRowsSelected)continue;c.unselect(t),d=!0;continue}if(!n.rowSelectionPropagation?.parents)continue;const e=s[t];if("group"===e?.type){if(e.isAutoGenerated){c.unselect(t),d=!0;continue}e.children.every(e=>!1===a[e])||(c.unselect(t),d=!0)}}const p=i&&n.rowSelectionPropagation?.parents&&(u.ids.size>0||"exclude"===u.type);if(d||p&&!e)if(p)if("exclude"===u.type){const e=g(),r=[];for(let t=0;t<e.length;t+=1){const o=e[t];!n.keepNonExistentRowsSelected&&l(o)||!c.has(o)||r.push(o)}t.current.selectRows(r,!0,!0)}else t.current.selectRows(Array.from(u.ids),!0,!0);else t.current.setRowSelectionModel(u,"multipleRowsSelection")},[t,i,n.rowSelectionPropagation?.parents,n.keepNonExistentRowsSelected,n.filterMode,g]),P=e.useCallback((e,n)=>{const r=n.metaKey||n.ctrlKey,o=!c&&!r&&!(e=>!!e.key)(n),i=!h||o,s=t.current.isRowSelected(e),a=Ds(t)>1&&i||!s;t.current.selectRow(e,a,i)},[t,h,c]),k=e.useCallback((e,n)=>{if(d)return;const r=n.target.closest(`.${Vr.cell}`)?.getAttribute("data-field");if(r!==fa.field&&r!==Yi){if(r){const e=t.current.getColumn(r);if(e?.type===Ki)return}"pinnedRow"!==gr(t,e.id).type&&(n.shiftKey&&h?f(e.id):P(e.id,n))}},[d,h,t,f,P]),E=e.useCallback((e,t)=>{h&&t.shiftKey&&window.getSelection()?.removeAllRanges()},[h]),T=e.useCallback((e,n)=>{h&&n.nativeEvent.shiftKey?f(e.id):t.current.selectRow(e.id,e.value,!h)},[t,f,h]),D=e.useCallback(e=>{const r=fs(t),o=gs(t),s=r.items.length>0||o?.some(e=>e.length);n.isRowSelectable||n.checkboxSelectionVisibleOnly||i&&!n.rowSelectionPropagation?.descendants||s||n.disableRowSelectionExcludeModel?t.current.selectRows(g(),e):t.current.setRowSelectionModel({type:e?"exclude":"include",ids:new Set},"multipleRowsSelection")},[t,g,n.checkboxSelectionVisibleOnly,n.isRowSelectable,n.rowSelectionPropagation?.descendants,n.disableRowSelectionExcludeModel,i]),F=e.useCallback(e=>{D(e.value)},[D]),A=e.useCallback((e,n)=>{if(t.current.getCellMode(e.id,e.field)!==Ao.Edit&&!sd(n)){if(Ti(n.key)&&n.shiftKey){const r=Vs(t);if(r&&r.id!==e.id){n.preventDefault();const o=t.current.isRowSelected(r.id);if(!h)return void t.current.selectRow(r.id,!o,!0);const i=t.current.getRowIndexRelativeToVisibleRows(r.id),s=t.current.getRowIndexRelativeToVisibleRows(e.id);let a,l;i>s?o?(a=s,l=i-1):(a=s,l=i):o?(a=i+1,l=s):(a=i,l=s);const u=qu(t),c=[];for(let e=a;e<=l;e+=1)c.push(u.rows[e].id);return void t.current.selectRows(c,!o)}}if(" "===n.key&&n.shiftKey)return n.preventDefault(),void P(e.id,n);"A"===String.fromCharCode(n.keyCode)&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),h&&D(!0))}},[t,h,P,D]),O=y(()=>{if(!n.rowSelection)return void t.current.setRowSelectionModel(Qf);if(void 0===l)return;if(!s||!i||"include"===l.type&&0===l.ids.size)return void t.current.setRowSelectionModel(l);const e=t.current.getPropagatedRowSelectionModel(l);e.type===l.type&&e.ids.size===l.ids.size&&Array.from(l.ids).every(t=>e.ids.has(t))?t.current.setRowSelectionModel(l):t.current.setRowSelectionModel(e)});Yr(t,"filteredRowsSet",o(()=>I())),Yr(t,"rowClick",o(k)),Yr(t,"rowSelectionCheckboxChange",o(T)),Yr(t,"headerSelectionCheckboxChange",F),Yr(t,"cellMouseDown",o(E)),Yr(t,"cellKeyDown",o(A)),e.useEffect(()=>{O()},[t,l,n.rowSelection,O]);const H=null!=l;e.useEffect(()=>{if(H||!n.rowSelection||"function"!=typeof v)return;const e=Es(t);if("include"!==e.type)return;const r=new Set;for(const t of e.ids)v(t)&&r.add(t);r.size<e.ids.size&&t.current.setRowSelectionModel({type:e.type,ids:r})},[t,v,H,n.rowSelection]),e.useEffect(()=>{if(!n.rowSelection||H)return;const e=Es(t);!h&&("include"===e.type&&e.ids.size>1||"exclude"===e.type)&&t.current.setRowSelectionModel(Qf)},[t,h,c,H,n.rowSelection]),e.useEffect(()=>{o(I)},[I,o]),e.useEffect(()=>{R.current&&(R.current=!1)},[])})(t,n),xf(t,n),((t,n,r)=>{const o=pl(t,"useGridRows"),i=e.useRef(Date.now()),s=e.useRef(n.rowCount),l=se(),{setRowIndex:u,setRowPosition:c}=r.hooks.useGridRowsOverridableMethods(t,n),d=e.useCallback(e=>{const n=hr(t)[e];if(n)return n;const r=gr(t,e);return r&&Fr(r)?{[Rr]:e}:null},[t]),p=e.useCallback(e=>As(t,e),[t]),h=e.useCallback(({cache:e,throttle:r})=>{const o=()=>{i.current=Date.now(),t.current.setState(e=>a({},e,{rows:Tr({apiRef:t,rowCountProp:n.rowCount,loadingProp:n.loading,previousTree:fr(t),previousTreeDepths:vr(t),previousGroupsToFetch:mr(t)})})),t.current.publishEvent("rowsSet")};if(l.clear(),t.current.caches.rows=e,!r)return void o();const s=n.throttleRowsMs-(Date.now()-i.current);s>0?l.start(s,o):o()},[n.throttleRowsMs,n.rowCount,n.loading,t,l]),f=e.useCallback(e=>{if(o.debug(`Updating all rows, new length ${e.length}`),!n.dataSource&&ml(t))return void t.current.updateNonPivotRows(e,!1);const r=kr({rows:e,getRowId:n.getRowId,loading:n.loading,rowCount:n.rowCount}),i=t.current.caches.rows;r.rowsBeforePartialUpdates=i.rowsBeforePartialUpdates,h({cache:r,throttle:!0})},[o,n.getRowId,n.dataSource,n.loading,n.rowCount,h,t]),g=e.useCallback(e=>{if(n.signature===Br.DataGrid&&e.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"));if(!n.dataSource&&ml(t))return void t.current.updateNonPivotRows(e);const r=$r(t,e,n.getRowId),o=Or({updates:r,getRowId:n.getRowId,previousCache:t.current.caches.rows});h({cache:o,throttle:!0})},[n.signature,n.dataSource,n.getRowId,h,t]),m=e.useCallback((e,r)=>{const o=$r(t,e,n.getRowId),i=Or({updates:o,getRowId:n.getRowId,previousCache:t.current.caches.rows,groupKeys:r??[]});h({cache:i,throttle:!1})},[n.getRowId,h,t]),b=e.useCallback(e=>{o.debug(`Setting loading to ${e}`),t.current.setState(t=>a({},t,{rows:a({},t.rows,{loading:e})})),t.current.caches.rows.loadingPropBeforePartialUpdates=e},[t,o]),v=e.useCallback(()=>{const e=yr(t),n=hr(t);return new Map(e.map(e=>[e,n[e]??{}]))},[t]),w=e.useCallback(()=>cr(t),[t]),y=e.useCallback(()=>yr(t),[t]),x=e.useCallback(e=>{const{rowIdToIndexMap:n}=qu(t);return n.get(e)},[t]),C=e.useCallback((e,n)=>{const r=gr(t,e);if(!r)throw new Error(`MUI X: No row with id #${e} found.`);if("group"!==r.type)throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const o=a({},r,{childrenExpanded:n});t.current.setState(t=>a({},t,{rows:a({},t.rows,{tree:a({},t.rows.tree,{[e]:o})})})),t.current.publishEvent("rowExpansionChange",o)},[t]),S=e.useCallback(()=>{const e=a({},fr(t)),n=t=>{const r=e[t];"group"===r?.type&&(e[t]=a({},r,{childrenExpanded:!0}),r.children.forEach(n))};n(Mr),t.current.setState(t=>a({},t,{rows:a({},t.rows,{tree:e})})),t.current.publishEvent("rowExpansionChange",e[Mr])},[t]),M=e.useCallback(()=>{const e=a({},fr(t)),n=t=>{const r=e[t];"group"===r?.type&&(e[t]=a({},r,{childrenExpanded:!1}),r.children.forEach(n))};n(Mr),t.current.setState(t=>a({},t,{rows:a({},t.rows,{tree:e})})),t.current.publishEvent("rowExpansionChange",e[Mr])},[t]),R=e.useCallback(e=>gr(t,e)??null,[t]),I=e.useCallback(({skipAutoGeneratedRows:e=!0,groupId:n,applySorting:r,applyFiltering:o,directChildrenOnly:i=!1})=>{const s=fr(t);let a;if(r){const r=s[n];if(!r)return[];const o=us(t);a=[];for(let t=o.findIndex(e=>e===n)+1;t<o.length&&(i?s[o[t]].depth===r.depth+1:s[o[t]].depth>r.depth);t+=1){const n=o[t];e&&Fr(s[n])||a.push(n)}}else a=Ar(s,n,e,i);if(o){const e=bs(t);a=as(e)?a:a.filter(t=>!1!==e[t])}return a},[t]),P={getRow:d,setLoading:b,getRowId:p,getRowModels:v,getRowsCount:w,getAllRowIds:y,setRows:f,updateRows:g,getRowNode:R,getRowIndexRelativeToVisibleRows:x,unstable_replaceRows:e.useCallback((e,r)=>{if(n.signature===Br.DataGrid&&r.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join("\n"));if(0===r.length)return;if(wr(t)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const o=a({},fr(t)),i=a({},hr(t)),s=o[Mr],l=[...s.children],u=new Set;for(let t=0;t<r.length;t+=1){const s=r[t],a=Ir(s,n.getRowId,"A row was provided without id when calling replaceRows()."),[c]=l.splice(e+t,1,a);u.has(c)||(delete i[c],delete o[c]);const d={id:a,depth:0,parent:Mr,type:"leaf",groupingKey:null};i[a]=s,o[a]=d,u.add(a)}o[Mr]=a({},s,{children:l});const c=l.filter(e=>"leaf"===o[e]?.type);t.current.caches.rows.dataRowIdToModelLookup=i,t.current.setState(e=>a({},e,{rows:a({},e.rows,{loading:n.loading,totalRowCount:Math.max(n.rowCount||0,l.length),dataRowIdToModelLookup:i,dataRowIds:c,tree:o})})),t.current.publishEvent("rowsSet")},[t,n.signature,n.getRowId,n.loading,n.rowCount])},k={setRowIndex:u,setRowPosition:c,setRowChildrenExpansion:C,getRowGroupChildren:I,expandAllRows:S,collapseAllRows:M},E={updateNestedRows:m},T=e.useCallback(()=>{let e;o.info("Row grouping pre-processing have changed, regenerating the row tree"),e=t.current.caches.rows.rowsBeforePartialUpdates===n.rows?a({},t.current.caches.rows,{updates:{type:"full",rows:yr(t)}}):kr({rows:n.rows,getRowId:n.getRowId,loading:n.loading,rowCount:n.rowCount}),h({cache:e,throttle:!1})},[o,t,n.rows,n.getRowId,n.loading,n.rowCount,h]),D=ee(()=>n.dataSource),F=e.useCallback(e=>{n.dataSource&&n.dataSource!==D.current?D.current=n.dataSource:"rowTreeCreation"===e&&T()},[T,D,n.dataSource]),A=e.useCallback(()=>{t.current.getActiveStrategy(sf.RowTree)!==br(t)&&T()},[t,T]);Yr(t,"activeStrategyProcessorChange",F),Yr(t,"strategyAvailabilityChange",A);const O=e.useCallback(()=>{t.current.setState(e=>{const r=t.current.unstable_applyPipeProcessors("hydrateRows",{tree:fr(t),treeDepths:vr(t),dataRowIds:yr(t),dataRowIdToModelLookup:hr(t)});return a({},e,{rows:a({},e.rows,r,{totalTopLevelRowCount:Er({tree:r.tree,rowCountProp:n.rowCount})})})}),t.current.publishEvent("rowsSet")},[t,n.rowCount]);tc(t,"hydrateRows",O),dl(t,P,"public"),dl(t,k,n.signature===Br.DataGrid?"private":"public"),dl(t,E,"private");const H=e.useRef(!0);e.useEffect(()=>{if(H.current)return void(H.current=!1);let e=!1;n.rowCount!==s.current&&(e=!0,s.current=n.rowCount);const r=n.dataSource?xr(t):n.rows,i=t.current.caches.rows.rowsBeforePartialUpdates===r,l=t.current.caches.rows.loadingPropBeforePartialUpdates===n.loading,u=t.current.caches.rows.rowCountPropBeforePartialUpdates===n.rowCount;i&&(l||(t.current.setState(e=>a({},e,{rows:a({},e.rows,{loading:n.loading})})),t.current.caches.rows.loadingPropBeforePartialUpdates=n.loading),u||(t.current.setState(e=>a({},e,{rows:a({},e.rows,{totalRowCount:Math.max(n.rowCount||0,e.rows.totalRowCount),totalTopLevelRowCount:Math.max(n.rowCount||0,e.rows.totalTopLevelRowCount)})})),t.current.caches.rows.rowCountPropBeforePartialUpdates=n.rowCount),!e)||(o.debug(`Updating all rows, new length ${r?.length}`),h({cache:kr({rows:r,getRowId:n.getRowId,loading:n.loading,rowCount:n.rowCount}),throttle:!1}))},[n.rows,n.rowCount,n.getRowId,n.loading,n.dataSource,o,h,t])})(t,n,r),kg(t,n),Yf(t,n,r),(e=>{const t=()=>e.current.virtualizer.api.resetColSpan(),n={unstable_getCellColSpanInfo:(...t)=>e.current.virtualizer.api.getCellColSpanInfo(...t)},r={resetColSpan:t,calculateColSpan:(...t)=>{e.current.virtualizer.api.calculateColSpan(...t)}};dl(e,n,"public"),dl(e,r,"private"),Yr(e,"columnOrderChange",t)})(t),((t,n)=>{const r=e.useCallback(e=>Ua(t)[e]??[],[t]),o=e.useCallback(()=>Ka(t),[t]);dl(t,{getColumnGroupPath:r,getAllGroupDetails:o},"public");const i=e.useCallback(()=>{const e=cg(n.columnGroupingModel??[]);t.current.setState(t=>{const n=t.columns?.orderedFields??[],r=t.pinnedColumns??{},o=dg(n,e,r);return a({},t,{columnGrouping:a({},t.columnGrouping,{headerStructure:o})})})},[t,n.columnGroupingModel]),s=e.useCallback(e=>{if(!e&&!t.current.caches.columnGrouping.lastColumnGroupingModel)return;t.current.caches.columnGrouping.lastColumnGroupingModel=e;const n=t.current.getPinnedColumns?.()??{},r=Jo(t),o=ii(t),i=lg(e??[]),s=cg(e??[]),l=dg(r,s,n),u=0===o.length?0:Math.max(...o.map(e=>s[e]?.length??0));t.current.setState(e=>a({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:s,headerStructure:l,maxDepth:u}}))},[t]);Yr(t,"columnIndexChange",i),Yr(t,"columnsChange",()=>{s(n.columnGroupingModel)}),Yr(t,"columnVisibilityModelChange",()=>{s(n.columnGroupingModel)}),e.useEffect(()=>{n.columnGroupingModel!==t.current.caches.columnGrouping.lastColumnGroupingModel&&s(n.columnGroupingModel)},[t,s,n.columnGroupingModel])})(t,n),Uf(t,n,r),((t,n)=>{const r=pl(t,"useGridFocus"),o=e.useRef(null),i=null!==t.current.rootElementRef.current,s=e.useCallback((e,n)=>{e&&t.current.getRow(e.id)&&t.current.publishEvent("cellFocusOut",t.current.getCellParams(e.id,e.field),n)},[t]),l=e.useCallback((e,n)=>{const o=Vs(t);o?.id===e&&o?.field===n||(t.current.setState(t=>(r.debug(`Focusing on cell with id=${e} and field=${n}`),a({},t,{tabIndex:{cell:{id:e,field:n},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:e,field:n},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),t.current.getRow(e)&&(o&&s(o,{}),t.current.publishEvent("cellFocusIn",t.current.getCellParams(e,n))))},[t,r,s]),u=e.useCallback((e,n={})=>{const o=Vs(t);s(o,n),t.current.setState(t=>(r.debug(`Focusing on column header with colIndex=${e}`),a({},t,{tabIndex:{columnHeader:{field:e},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:e},columnHeaderFilter:null,cell:null,columnGroupHeader:null}})))},[t,r,s]),c=e.useCallback((e,n={})=>{const o=Vs(t);s(o,n),t.current.setState(t=>(r.debug(`Focusing on column header filter with colIndex=${e}`),a({},t,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:e},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:e},cell:null,columnGroupHeader:null}})))},[t,r,s]),d=e.useCallback((e,n,r={})=>{const o=Vs(t);o&&t.current.publishEvent("cellFocusOut",t.current.getCellParams(o.id,o.field),r),t.current.setState(t=>a({},t,{tabIndex:{columnGroupHeader:{field:e,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:e,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null}}))},[t]),p=e.useCallback(()=>Ws(t),[t]),h=e.useCallback((e,r,o)=>{let i=t.current.getColumnIndex(r);const s=oi(t),a=qu(t,(n.pagination,n.paginationMode)),l=Cr(t),u=[].concat(l.top||[],a.rows,l.bottom||[]);let c=u.findIndex(t=>t.id===e);"right"===o?i+=1:"left"===o?i-=1:c+=1,i>=s.length?(c+=1,c<u.length&&(i=0)):i<0&&(c-=1,c>=0&&(i=s.length-1)),c=ko(c,0,u.length-1);const d=u[c];if(!d)return;const p=t.current.unstable_getCellColSpanInfo(d.id,i);p&&p.spannedByColSpan&&("left"===o||"below"===o?i=p.leftVisibleCellIndex:"right"===o&&(i=p.rightVisibleCellIndex)),i=ko(i,0,s.length-1);const h=s[i];t.current.setCellFocus(d.id,h.field)},[t,n.pagination,n.paginationMode]),f=e.useCallback(({id:e,field:n})=>{t.current.setCellFocus(e,n)},[t]),g=e.useCallback((e,n)=>{"Enter"===n.key||"Tab"===n.key||"Shift"===n.key||Ti(n.key)||t.current.setCellFocus(e.id,e.field)},[t]),m=e.useCallback(({field:e},n)=>{n.target===n.currentTarget&&t.current.setColumnHeaderFocus(e,n)},[t]),b=e.useCallback(({fields:e,depth:n},r)=>{if(r.target!==r.currentTarget)return;const o=Ws(t);null!==o&&o.depth===n&&e.includes(o.field)||t.current.setColumnGroupHeaderFocus(e[0],n,r)},[t]),v=e.useCallback((e,n)=>{n.relatedTarget?.getAttribute("class")?.includes(Vr.columnHeader)||(r.debug("Clearing focus"),t.current.setState(e=>a({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[r,t]),w=e.useCallback(e=>{o.current=e},[]),x=e.useCallback(e=>{const n=o.current;o.current=null;const r=Vs(t);if(!t.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:e,cell:n}))return;if(!r)return void(n&&t.current.setCellFocus(n.id,n.field));if(n?.id===r.id&&n?.field===r.field)return;const i=t.current.getCellElement(r.id,r.field);i?.contains(e.target)||(n?t.current.setCellFocus(n.id,n.field):(t.current.setState(e=>a({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),s(r,e)))},[t,s]),C=e.useCallback(e=>{if("view"===e.cellMode)return;const n=Vs(t);n?.id===e.id&&n?.field===e.field||t.current.setCellFocus(e.id,e.field)},[t]),S=e.useCallback(()=>{const e=Vs(t);if(e&&!t.current.getRow(e.id)){const r=e.id;let o=null;if(void 0!==r){const e=t.current.getRowElement(r),i=e?.dataset.rowindex?Number(e?.dataset.rowindex):0,s=qu(t,(n.pagination,n.paginationMode)),a=s.rows[ko(i,0,s.rows.length-1)];o=a?.id??null}t.current.setState(t=>a({},t,{focus:{cell:null===o?null:{id:o,field:e.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[t,n.pagination,n.paginationMode]),M=e.useMemo(()=>he(S,0),[S]),R=y(()=>{const e=Vs(t);if(!e)return;const r=qu(t,(n.pagination,n.paginationMode));if(r.rows.find(t=>t.id===e.id)||0===r.rows.length)return;const o=oi(t);t.current.setState(e=>a({},e,{tabIndex:{cell:{id:r.rows[0].id,field:o[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),I={moveFocusToRelativeCell:h,setColumnGroupHeaderFocus:d,getColumnGroupHeaderFocus:p};dl(t,{setCellFocus:l,setColumnHeaderFocus:u,setColumnHeaderFilterFocus:c},"public"),dl(t,I,"private"),e.useEffect(()=>{const e=ce(t.current.rootElementRef.current);return e.addEventListener("mouseup",x),()=>{e.removeEventListener("mouseup",x)}},[t,i,x]),Yr(t,"columnHeaderBlur",v),Yr(t,"cellDoubleClick",f),Yr(t,"cellMouseDown",w),Yr(t,"cellKeyDown",g),Yr(t,"cellModeChange",C),Yr(t,"columnHeaderFocus",m),Yr(t,"columnGroupHeaderFocus",b),Yr(t,"rowsSet",M),Yr(t,"paginationModelChange",R)})(t,n),((t,n)=>{const r=pl(t,"useGridPreferencesPanel"),o=e.useCallback(()=>{t.current.setState(e=>{if(!e.preferencePanel.open)return e;r.debug("Hiding Preferences Panel");const n=_l(t);return t.current.publishEvent("preferencePanelClose",{openedPanelValue:n.openedPanelValue}),a({},e,{preferencePanel:{open:!1}})})},[t,r]),i=e.useCallback((e,n,o)=>{r.debug("Opening Preferences Panel"),t.current.setState(t=>a({},t,{preferencePanel:a({},t.preferencePanel,{open:!0,openedPanelValue:e,panelId:n,labelId:o})})),t.current.publishEvent("preferencePanelOpen",{openedPanelValue:e})},[r,t]);dl(t,{showPreferences:i,hidePreferences:o},"public");const s=e.useCallback((e,r)=>{const o=_l(t);return!r.exportOnlyDirtyModels||null!=n.initialState?.preferencePanel||o.open?a({},e,{preferencePanel:o}):e},[t,n.initialState?.preferencePanel]),l=e.useCallback((e,n)=>{const r=n.stateToRestore.preferencePanel;return null!=r&&t.current.setState(e=>a({},e,{preferencePanel:r})),e},[t]);ec(t,"exportState",s),ec(t,"restoreState",l)})(t,n),((t,n,r)=>{const o=pl(t,"useGridFilter");t.current.registerControlState({stateId:"filter",propModel:n.filterModel,propOnChange:n.onFilterModelChange,stateSelector:fs,changeEvent:"filterModelChange"});const s=e.useCallback(()=>{t.current.setState(e=>{const n=fs(t),r=t.current.getFilterState(n),o=a({},e,{filter:a({},e.filter,r)}),i=Tf(t,o);return a({},o,{visibleRowsLookup:i})}),t.current.publishEvent("filteredRowsSet")},[t]),l=e.useCallback((e,t)=>null==t||!1===t.filterable||n.disableColumnFilter?e:[...e,"columnMenuFilterItem"],[n.disableColumnFilter]),u=e.useCallback(e=>{const n=fs(t),r=[...n.items],o=r.findIndex(t=>t.id===e.id);-1===o?r.push(e):r[o]=e,t.current.setFilterModel(a({},n,{items:r}),"upsertFilterItem")},[t]),c=e.useCallback(e=>{const n=fs(t),r=[...n.items];e.forEach(e=>{const t=r.findIndex(t=>t.id===e.id);-1===t?r.push(e):r[t]=e}),t.current.setFilterModel(a({},n,{items:r}),"upsertFilterItems")},[t]),d=e.useCallback(e=>{const n=fs(t),r=n.items.filter(t=>t.id!==e.id);r.length!==n.items.length&&t.current.setFilterModel(a({},n,{items:r}),"deleteFilterItem")},[t]),p=e.useCallback((e,r,i)=>{if(o.debug("Displaying filter panel"),e){const r=fs(t),o=r.items.filter(e=>{if(void 0!==e.value)return!Array.isArray(e.value)||0!==e.value.length;const n=t.current.getColumn(e.field),r=n.filterOperators?.find(t=>t.value===e.operator);return!(void 0===r?.requiresFilterValue||r?.requiresFilterValue)});let i;const s=o.find(t=>t.field===e),l=t.current.getColumn(e);i=s?o:n.disableMultipleColumnsFiltering?[fi({field:e,operator:l.filterOperators[0].value},t)]:[...o,fi({field:e,operator:l.filterOperators[0].value},t)],t.current.setFilterModel(a({},r,{items:i}))}t.current.showPreferences(Bl.filters,r,i)},[t,o,n.disableMultipleColumnsFiltering]),h=e.useCallback(()=>{o.debug("Hiding filter panel"),t.current.hidePreferences()},[t,o]),f=e.useCallback(e=>{const n=fs(t);n.logicOperator!==e&&t.current.setFilterModel(a({},n,{logicOperator:e}),"changeLogicOperator")},[t]),g=e.useCallback(e=>{const n=fs(t);ql(n.quickFilterValues,e)||t.current.setFilterModel(a({},n,{quickFilterValues:[...e]}))},[t]),m=e.useCallback((e,r)=>{fs(t)!==e&&(o.debug("Setting filter model"),t.current.updateControlState("filter",mi(e,n.disableMultipleColumnsFiltering,t),r),t.current.unstable_applyFilters())},[t,o,n.disableMultipleColumnsFiltering]),b=e.useCallback(e=>{const o=gi(e,n.disableMultipleColumnsFiltering,t),i=r.hooks.useFilterValueGetter(t,n),s="client"===n.filterMode?Ci(o,i,t,n.disableEval):null,l=t.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:s,filterModel:o??Wo(),filterValueGetter:i});return a({},l,{filterModel:o})},[t,r.hooks,n]),v={setFilterLogicOperator:f,unstable_applyFilters:s,deleteFilterItem:d,upsertFilterItem:u,upsertFilterItems:c,setFilterModel:m,showFilterPanel:p,hideFilterPanel:h,setQuickFilterValues:g,ignoreDiacritics:n.ignoreDiacritics,getFilterState:b};dl(t,v,"public");const w=e.useCallback((e,r)=>{const o=fs(t);return o.items.forEach(e=>{delete e.fromInput}),r.exportOnlyDirtyModels&&null==n.filterModel&&null==n.initialState?.filter?.filterModel&&ql(o,Wo())?e:a({},e,{filter:{filterModel:o}})},[t,n.filterModel,n.initialState?.filter?.filterModel]),y=e.useCallback((e,r)=>{const o=r.stateToRestore.filter?.filterModel;return null==o?e:(t.current.updateControlState("filter",mi(o,n.disableMultipleColumnsFiltering,t),"restoreState"),a({},e,{callbacks:[...e.callbacks,t.current.unstable_applyFilters]}))},[t,n.disableMultipleColumnsFiltering]),x=e.useCallback((e,t)=>{if(t===Bl.filters){const e=n.slots.filterPanel;return i.jsx(e,a({},n.slotProps?.filterPanel))}return e},[n.slots.filterPanel,n.slotProps?.filterPanel]),{getRowId:C}=n,S=ee(Df),M=e.useCallback(e=>{if("client"!==n.filterMode||!e.isRowMatchingFilters||!e.filterModel.items.length&&!e.filterModel.quickFilterValues?.length)return Bo;const r=hr(t),o={},{isRowMatchingFilters:i}=e,s={},a={passingFilterItems:null,passingQuickFilterValues:null},l=S.current(t.current.state.rows.dataRowIdToModelLookup);for(let n=0;n<l.length;n+=1){const r=l[n],u=C?C(r):r.id;i(r,void 0,a);const c=Mi([a.passingFilterItems],[a.passingQuickFilterValues],e.filterModel,e.filterValueGetter,t,s);c||(o[u]=c)}const u="auto-generated-group-footer-root";return r[u]&&(o[u]=!0),{filteredRowsLookup:o,filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}}},[t,n.filterMode,C,S]);ec(t,"columnMenu",l),ec(t,"exportState",w),ec(t,"restoreState",y),ec(t,"preferencePanel",x),af(t,lf,"filtering",M),af(t,lf,"visibleRowsLookupCreation",Ef);const R=e.useCallback(()=>{o.debug("onColUpdated - GridColumns changed, applying filters");const e=fs(t),n=ei(t),r=e.items.filter(e=>e.field&&n[e.field]);r.length<e.items.length&&t.current.setFilterModel(a({},e,{items:r}))},[t,o]),I=e.useCallback(e=>{"filtering"===e&&t.current.unstable_applyFilters()},[t]),P=e.useCallback(()=>{t.current.setState(e=>a({},e,{visibleRowsLookup:Tf(t,e)}))},[t]);Yr(t,"rowsSet",s),Yr(t,"columnsChange",R),Yr(t,"activeStrategyProcessorChange",I),Yr(t,"rowExpansionChange",P),Yr(t,"columnVisibilityModelChange",()=>{const e=fs(t);e.quickFilterValues?.length&&xi(e)&&s()}),fl(()=>{"DataGrid"===n.signature&&s()}),oe(()=>{void 0!==n.filterModel&&t.current.setFilterModel(n.filterModel)},[t,o,n.filterModel])})(t,n,r),((t,n)=>{const r=pl(t,"useGridSorting");t.current.registerControlState({stateId:"sortModel",propModel:n.sortModel,propOnChange:n.onSortModelChange,stateSelector:ds,changeEvent:"sortModelChange"});const o=e.useCallback((e,n)=>{const r=ds(t),o=r.findIndex(t=>t.field===e);let i=[...r];return o>-1?null==n?.sort?i.splice(o,1):i.splice(o,1,n):i=[...r,n],i},[t]),i=e.useCallback((e,r)=>{const o=ds(t).find(t=>t.field===e.field);if(o){const t=void 0===r?vo(e.sortingOrder??n.sortingOrder,o.sort):r;return void 0===t?void 0:a({},o,{sort:t})}return{field:e.field,sort:void 0===r?vo(e.sortingOrder??n.sortingOrder):r}},[t,n.sortingOrder]),s=e.useCallback((e,t)=>null==t||!1===t.sortable||n.disableColumnSorting?e:(t.sortingOrder||n.sortingOrder).some(e=>!!e)?[...e,"columnMenuSortItem"]:e,[n.sortingOrder,n.disableColumnSorting]),l=e.useCallback(()=>{t.current.setState(e=>{if("server"===n.sortingMode)return r.debug("Skipping sorting rows as sortingMode = server"),a({},e,{sorting:a({},e.sorting,{sortedRows:Ar(fr(t),Mr,!1)})});const o=ds(t),i=bo(o,t),s=t.current.applyStrategyProcessor("sorting",{sortRowList:i});return a({},e,{sorting:a({},e.sorting,{sortedRows:s})})}),t.current.publishEvent("sortedRowsSet")},[t,r,n.sortingMode]),u=e.useCallback(e=>{ds(t)!==e&&(r.debug("Setting sort model"),t.current.setState(mo(e,n.disableMultipleColumnsSorting)),t.current.applySorting())},[t,r,n.disableMultipleColumnsSorting]),c=e.useCallback((e,r,s)=>{const a=t.current.getColumn(e),l=i(a,r);let u;u=!s||n.disableMultipleColumnsSorting?null==l?.sort?[]:[l]:o(a.field,l),t.current.setSortModel(u)},[t,o,i,n.disableMultipleColumnsSorting]),d=e.useCallback(()=>ds(t),[t]),p=e.useCallback(()=>cs(t).map(e=>e.model),[t]),h=e.useCallback(()=>us(t),[t]),f=e.useCallback(e=>t.current.getSortedRowIds()[e],[t]);dl(t,{getSortModel:d,getSortedRows:p,getSortedRowIds:h,getRowIdFromRowIndex:f,setSortModel:u,sortColumn:c,applySorting:l},"public");const g=e.useCallback((e,r)=>{const o=ds(t);return!r.exportOnlyDirtyModels||null!=n.sortModel||null!=n.initialState?.sorting?.sortModel||o.length>0?a({},e,{sorting:{sortModel:o}}):e},[t,n.sortModel,n.initialState?.sorting?.sortModel]),m=e.useCallback((e,r)=>{const o=r.stateToRestore.sorting?.sortModel;return null==o?e:(t.current.setState(mo(o,n.disableMultipleColumnsSorting)),a({},e,{callbacks:[...e.callbacks,t.current.applySorting]}))},[t,n.disableMultipleColumnsSorting]),b=e.useCallback(e=>{const n=fr(t),r=n[Mr],o=e.sortRowList?e.sortRowList(r.children.map(e=>n[e])):[...r.children];return null!=r.footerId&&o.push(r.footerId),o},[t]);ec(t,"exportState",g),ec(t,"restoreState",m),af(t,lf,"sorting",b);const v=e.useCallback(({field:e,colDef:t},r)=>{if(!t.sortable||n.disableColumnSorting)return;const o="always"===n.multipleColumnsSortingMode||r.shiftKey||r.metaKey||r.ctrlKey;c(e,void 0,o)},[c,n.disableColumnSorting,n.multipleColumnsSortingMode]),w=e.useCallback(({field:e,colDef:t},r)=>{t.sortable&&!n.disableColumnSorting&&("Enter"!==r.key||r.ctrlKey||r.metaKey||c(e,void 0,"always"===n.multipleColumnsSortingMode||r.shiftKey))},[c,n.disableColumnSorting,n.multipleColumnsSortingMode]),y=e.useCallback(()=>{const e=ds(t),n=ei(t);if(e.length>0){const r=e.filter(e=>n[e.field]);r.length<e.length&&t.current.setSortModel(r)}},[t]),x=e.useCallback(e=>{"sorting"===e&&t.current.applySorting()},[t]);ec(t,"columnMenu",s),Yr(t,"columnHeaderClick",v),Yr(t,"columnHeaderKeyDown",w),Yr(t,"rowsSet",t.current.applySorting),Yr(t,"columnsChange",y),Yr(t,"activeStrategyProcessorChange",x),fl(()=>{"DataGrid"===n.signature&&t.current.applySorting()}),oe(()=>{void 0!==n.sortModel&&t.current.setSortModel(n.sortModel)},[t,n.sortModel])})(t,n),((t,n)=>{const r=pl(t,"useDensity");t.current.registerControlState({stateId:"density",propModel:n.density,propOnChange:n.onDensityChange,stateSelector:lo,changeEvent:"densityChange"});const o=y(e=>{lo(t)!==e&&(r.debug(`Set grid density to ${e}`),t.current.setState(t=>a({},t,{density:e})))});dl(t,{setDensity:o},"public");const i=e.useCallback((e,r)=>{const o=lo(t);return r.exportOnlyDirtyModels&&null==n.density&&null==n.initialState?.density?e:a({},e,{density:o})},[t,n.density,n.initialState?.density]),s=e.useCallback((e,n)=>{const r=n.stateToRestore?.density?n.stateToRestore.density:lo(t);return t.current.setState(e=>a({},e,{density:r})),e},[t]);ec(t,"exportState",i),ec(t,"restoreState",s),e.useEffect(()=>{n.density&&t.current.setDensity(n.density)},[t,n.density])})(t,n),Cg(t,n),Lf(t,n),((t,n)=>{const r=ae(),o=pl(t,"useGridScroll"),i=t.current.columnHeadersContainerRef,s=t.current.virtualScrollerRef,a=e.useCallback(e=>{const r=Qn(t),i=cr(t),a=oi(t);if(null!=e.rowIndex&&0===i||0===a.length)return!1;o.debug(`Scrolling to cell at row ${e.rowIndex}, col: ${e.colIndex} `);let l={};if(void 0!==e.colIndex){const n=ui(t);let o;if(void 0!==e.rowIndex){const n=vs(t),r=n[e.rowIndex]?.id,i=t.current.unstable_getCellColSpanInfo(r,e.colIndex);i&&!i.spannedByColSpan&&(o=i.cellProps.width)}void 0===o&&(o=a[e.colIndex].computedWidth),l.left=tg({containerSize:r.viewportOuterSize.width,scrollPosition:Math.abs(s.current.scrollLeft),elementSize:o,elementOffset:n[e.colIndex]})}if(void 0!==e.rowIndex){const o=lr(t),i=oa(t),a=ia(t),u=n.pagination?e.rowIndex-i*a:e.rowIndex,c=o.positions[u+1]?o.positions[u+1]-o.positions[u]:o.currentPageTotalHeight-o.positions[u];l.top=tg({containerSize:r.viewportInnerSize.height,scrollPosition:s.current.scrollTop,elementSize:c,elementOffset:o.positions[u]})}return l=t.current.unstable_applyPipeProcessors("scrollToIndexes",l,e),(void 0!==l.left||void 0!==l.top)&&(t.current.scroll(l),!0)},[o,t,s,n.pagination]),l=e.useCallback(e=>{if(s.current&&void 0!==e.left&&i.current){const t=r?-1:1;i.current.scrollLeft=e.left,s.current.scrollLeft=t*e.left,o.debug(`Scrolling left: ${e.left}`)}s.current&&void 0!==e.top&&(s.current.scrollTop=e.top,o.debug(`Scrolling top: ${e.top}`)),o.debug("Scrolling, updating container, and viewport")},[s,r,i,o]),u=e.useCallback(()=>s?.current?{top:s.current.scrollTop,left:s.current.scrollLeft}:{top:0,left:0},[s]);dl(t,{scroll:l,scrollToIndexes:a,getScrollPosition:u},"public")})(t,n),(t=>{const n=pl(t,"useGridColumnMenu"),r=e.useRef({}),o=e.useCallback(()=>{r.current.wheel?.(),r.current.touchMove?.()},[]),i=e.useCallback(()=>{o(),r.current.wheel=t.current.subscribeEvent("virtualScrollerWheel",t.current.hideColumnMenu),r.current.touchMove=t.current.subscribeEvent("virtualScrollerTouchMove",t.current.hideColumnMenu)},[t,o]),s=e.useCallback(e=>{const r=yl(t),o=e;(!0!==r.open||o!==r.field)&&(t.current.setState(t=>t.columnMenu.open&&t.columnMenu.field===e?t:(n.debug("Opening Column Menu"),i(),a({},t,{columnMenu:{open:!0,field:e}}))),t.current.hidePreferences())},[t,n,i]),l=e.useCallback(()=>{const e=yl(t);if(e.field){const n=ei(t),r=ni(t),o=Jo(t);let i=e.field;if(n[i]||(i=o[0]),!1===r[i]){const e=o.filter(e=>e===i||!1!==r[e]),t=e.indexOf(i);i=e[t+1]||e[t-1]}t.current.setColumnHeaderFocus(i)}const r={open:!1,field:void 0};(r.open!==e.open||r.field!==e.field)&&t.current.setState(e=>(n.debug("Hiding Column Menu"),o(),a({},e,{columnMenu:r})))},[t,n,o]),u=e.useCallback(e=>{n.debug("Toggle Column Menu");const r=yl(t);r.open&&r.field===e?l():s(e)},[t,n,s,l]);dl(t,{showColumnMenu:s,hideColumnMenu:l,toggleColumnMenu:u},"public"),Yr(t,"columnResizeStart",l)})(t),Rf(t,n),Pf(t,n),vf(t,n),function(t,n){const r=e.useCallback(()=>Qn(t),[t]),o={updateDimensions:()=>t.current.virtualizer.api.updateDimensions(),getViewportPageSize:()=>t.current.virtualizer.api.getViewportPageSize()};dl(t,{getRootDimensions:r},"public"),dl(t,o,"private"),Zr(t,"rootMount",e=>{sg(e,Qn(t))}),Zr(t,"debouncedResize",n.onResize),Bn(t.current.store,e=>e.dimensions,(e,n)=>{var r,o;n.isReady&&(t.current.rootElementRef.current&&sg(t.current.rootElementRef.current,n),r=n.viewportInnerSize,o=e.viewportInnerSize,(r.width!==o.width||r.height!==o.height)&&t.current.publishEvent("viewportInnerSizeChange",n.viewportInnerSize),t.current.publishEvent("debouncedResize",n.root))})}(t,n),function(e,t){Zr(e,"columnHeaderClick",t.onColumnHeaderClick),Zr(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),Zr(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),Zr(e,"columnHeaderOver",t.onColumnHeaderOver),Zr(e,"columnHeaderOut",t.onColumnHeaderOut),Zr(e,"columnHeaderEnter",t.onColumnHeaderEnter),Zr(e,"columnHeaderLeave",t.onColumnHeaderLeave),Zr(e,"cellClick",t.onCellClick),Zr(e,"cellDoubleClick",t.onCellDoubleClick),Zr(e,"cellKeyDown",t.onCellKeyDown),Zr(e,"preferencePanelClose",t.onPreferencePanelClose),Zr(e,"preferencePanelOpen",t.onPreferencePanelOpen),Zr(e,"menuOpen",t.onMenuOpen),Zr(e,"menuClose",t.onMenuClose),Zr(e,"rowDoubleClick",t.onRowDoubleClick),Zr(e,"rowClick",t.onRowClick),Zr(e,"stateChange",t.onStateChange)}(t,n),(t=>{const n=e.useCallback((e={})=>t.current.unstable_applyPipeProcessors("exportState",{},e),[t]),r=e.useCallback(e=>{t.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:e}).callbacks.forEach(e=>{e()})},[t]);dl(t,{exportState:n,restoreState:r},"public")})(t),function(t,n){const{autoHeight:r,disableVirtualization:o}=n,i=e=>{const{virtualizer:n}=t.current;e&&=Pu;const o=n.store.getSnapshot();o.virtualization.enabled===e&&o.virtualization.enabledForRows===e&&o.virtualization.enabledForColumns===e||n.store.set("virtualization",a({},n.store.state.virtualization,{enabled:e,enabledForColumns:e,enabledForRows:e&&!r}))};dl(t,{unstable_setVirtualization:i,unstable_setColumnVirtualization:e=>{const{virtualizer:n}=t.current;e&&=Pu,n.store.getSnapshot().virtualization.enabledForColumns!==e&&n.store.set("virtualization",a({},n.store.state.virtualization,{enabledForColumns:e}))}},"public");const s=()=>{const{virtualizer:e}=t.current;e?.api.scheduleUpdateRenderContext()};t.current.register("private",{updateRenderContext:s}),Zr(t,"sortedRowsSet",s),Zr(t,"paginationModelChange",s),Zr(t,"columnsChange",s),e.useEffect(()=>{t.current.virtualizer&&i(!n.disableVirtualization)},[t,o,r])}(t,n),function(t,n){const r=()=>{t.current.setState(e=>e.listViewColumn?a({},e,{listViewColumn:a({},e.listViewColumn,{computedWidth:Tg(t)})}):e)},o=e.useRef(null);Yr(t,"viewportInnerSizeChange",e=>{o.current!==e.width&&(o.current=e.width,r())}),Yr(t,"columnVisibilityModelChange",r),oe(()=>{const e=n.listViewColumn;e&&t.current.setState(n=>a({},n,{listViewColumn:a({},e,{computedWidth:Tg(t)})}))},[t,n.listViewColumn]),e.useEffect(()=>{n.listView&&n.listViewColumn},[n.listView,n.listViewColumn])}(t,n),zg(t,n),fl(()=>{t.current.runAppliersForPendingProcessors()}),e.useEffect(()=>{t.current.runAppliersForPendingProcessors()})};function jg(t){const{groupId:n,width:r,depth:o,maxDepth:s,fields:l,height:u,colIndex:c,hasFocus:d,tabIndex:p,isLastColumn:h,pinnedPosition:f,pinnedOffset:g}=t,m=Xe(),b=ae(),v=e.useRef(null),w=Je(),y=so(w,Ka),C=n?y[n]:{},{headerName:S=n??"",description:M="",headerAlign:R}=C;let I;const P=n&&y[n]?.renderHeaderGroup,k=e.useMemo(()=>({groupId:n,headerName:S,description:M,depth:o,maxDepth:s,fields:l,colIndex:c,isLastColumn:h}),[n,S,M,o,s,l,c,h]);n&&P&&(I=P(k));const E=a({},t,{classes:m.classes,headerAlign:R,depth:o,isDragging:!1}),T=S??n,D=x(),F=null===n?`empty-group-cell-${D}`:n,A=(e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:s,groupId:a,pinnedPosition:l}=e,u={root:["columnHeader","left"===n&&"columnHeader--alignLeft","center"===n&&"columnHeader--alignCenter","right"===n&&"columnHeader--alignRight",r&&"columnHeader--moving",s&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",null===a?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===Qi.LEFT&&"columnHeader--pinnedLeft",l===Qi.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return ie(u,_r,t)})(E);e.useLayoutEffect(()=>{if(d){const e=v.current.querySelector('[tabindex="0"]')||v.current;if(!e)return;if(dc())e.focus({preventScroll:!0});else{const t=w.current.getScrollPosition();e.focus(),w.current.scroll(t)}}},[w,d]);const O=e.useCallback(e=>t=>{sd(t)||w.current.publishEvent(e,k,t)},[w,k]),H=e.useMemo(()=>({onKeyDown:O("columnGroupHeaderKeyDown"),onFocus:O("columnGroupHeaderFocus"),onBlur:O("columnGroupHeaderBlur")}),[O]),$="function"==typeof C.headerClassName?C.headerClassName(k):C.headerClassName,z=e.useMemo(()=>hc(a({},t.style),b,f,g),[f,g,t.style,b]);return i.jsx(xd,a({ref:v,classes:A,columnMenuOpen:!1,colIndex:c,height:u,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:p,isDraggable:!1,headerComponent:I,headerClassName:$,description:M,elementId:F,width:r,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:T,"aria-colspan":l.length,"data-fields":`|-${l.join("-|-")}-|`,style:z},H))}const Ng={root:Vr.scrollbarFiller,pinnedRight:Vr["scrollbarFiller--pinnedRight"]};function Gg({pinnedRight:e}){return i.jsx("div",{role:"presentation",className:O(Ng.root,e&&Ng.pinnedRight)})}const _g=h("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),Vg=["className"],Bg=ue("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),Wg=xe(function(e,t){const{className:n}=e,r=s(e,Vg),o=Xe(),l=(e=>{const{classes:t}=e;return ie({root:["columnHeaders"]},_r,t)})(o);return i.jsx(Bg,a({className:O(l.root,n),ownerState:o},r,{role:"presentation",ref:t}))}),Ug=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],Kg=Nr(xe(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:l,columnHeaderTabIndexState:u,columnGroupHeaderTabIndexState:c,columnHeaderFocus:d,columnGroupHeaderFocus:p,headerGroupingMaxDepth:h,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:b}=t,v=s(t,Ug),{getInnerProps:w,getColumnHeadersRow:y,getColumnGroupHeadersRows:x}=(t=>{const{visibleColumns:n,sortColumnLookup:r,filterColumnLookup:o,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:l,columnHeaderFocus:u,columnGroupHeaderFocus:c,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:f,hasOtherElementInTabSequence:g}=t,[m,b]=e.useState(""),[v,w]=e.useState(""),y=ul(),x=Xe(),C=so(y,Ua),S=so(y,ui),M=so(y,Fu),R=so(y,ai),I=so(y,ei),P=vu(S,M,R.left.length),k=so(y,Zn),E=so(y,nr),T=so(y,rr),D=so(y,or),F=so(y,sr),A=e.useCallback(e=>w(e.field),[]),H=e.useCallback(()=>w(""),[]),$=e.useCallback(e=>b(e.field),[]),z=e.useCallback(()=>b(""),[]),L=e.useMemo(()=>R.left.length?{firstColumnIndex:0,lastColumnIndex:R.left.length}:null,[R.left.length]),j=e.useMemo(()=>R.right.length?{firstColumnIndex:n.length-R.right.length,lastColumnIndex:n.length}:null,[R.right.length,n.length]);Yr(y,"columnResizeStart",A),Yr(y,"columnResizeStop",H),Yr(y,"columnHeaderDragStart",$),Yr(y,"columnHeaderDragEndNative",z);const N=e=>{const{renderContext:t=M}=e||{},r=t.firstColumnIndex,o=Math.min(t.lastColumnIndex,n.length);return{renderedColumns:n.slice(r,o),firstColumnToRender:r,lastColumnToRender:o}},G=(t,n,r,o=!1)=>{const s=t?.position===Qi.RIGHT,a=void 0===t?.position,l=R.right.length>0&&s||0===R.right.length&&a,u=P-r;return i.jsxs(e.Fragment,{children:[a&&i.jsx("div",{role:"presentation",style:{width:u}}),n,a&&i.jsx("div",{role:"presentation",className:O(Vr.filler,o&&Vr["filler--borderBottom"])}),l&&i.jsx(Gg,{pinnedRight:s})]})},_=(e,t={})=>{const{renderedColumns:n,firstColumnToRender:l}=N(e),c=[];for(let d=0;d<n.length;d+=1){const h=n[d],f=l+d,b=0===f,w=null!==s&&s.field===h.field||b&&!g?0:-1,y=null!==u&&u.field===h.field,C=p.open&&p.field===h.field,M=e?.position,R=Ph(M,h.computedWidth,f,S,k,F),I=M===Qi.RIGHT?n[d-1]:n[d+1],P=!!I&&null!==u&&u.field===I.field,D=d,A=n.length,O=Eh(M,D,x.showColumnVerticalBorder,x.pinnedColumnsSectionSeparator),H=kh(M,D,A,x.showColumnVerticalBorder,E,x.pinnedColumnsSectionSeparator);c.push(i.jsx(Cd,a({},r[h.field],{columnMenuOpen:C,filterItemsCounter:o[h.field]&&o[h.field].length,headerHeight:T,isDragging:h.field===m,colDef:h,colIndex:f,isResizing:v===h.field,isLast:f===S.length-1,hasFocus:y,tabIndex:w,pinnedPosition:M,pinnedOffset:R,isSiblingFocused:P,showLeftBorder:O,showRightBorder:H},t),h.field))}return G(e,c,0)},V=({depth:e,params:t})=>{const r=N(t);if(0===r.renderedColumns.length)return null;const{firstColumnToRender:o,lastColumnToRender:s}=r,u=f[e],p=n[o].field,g=C[p]?.[e]??null,m=u.findIndex(({groupId:e,columnFields:t})=>e===g&&t.includes(p)),b=n[s-1].field,v=C[b]?.[e]??null,w=u.findIndex(({groupId:e,columnFields:t})=>e===v&&t.includes(b)),y=u.slice(m,w+1).map(e=>a({},e,{columnFields:e.columnFields.filter(e=>!1!==h[e])})).filter(e=>e.columnFields.length>0),M=y[0].columnFields.indexOf(p),R=y[0].columnFields.slice(0,M).reduce((e,t)=>e+(I[t].computedWidth??0),0);let P=o;const T=y.map(({groupId:n,columnFields:r},o)=>{const s=null!==c&&c.depth===e&&r.includes(c.field),a=null!==l&&l.depth===e&&r.includes(l.field)?0:-1,u={width:r.reduce((e,t)=>e+I[t].computedWidth,0),fields:r,colIndex:P},p=t.position,h=Ph(p,u.width,P,S,k,F);P+=r.length;let f=o;return p===Qi.LEFT&&(f=P-1),i.jsx(jg,{groupId:n,width:u.width,fields:u.fields,colIndex:u.colIndex,depth:e,isLastColumn:o===y.length-1,maxDepth:d,height:D,hasFocus:s,tabIndex:a,pinnedPosition:p,pinnedOffset:h,showLeftBorder:Eh(p,f,x.showColumnVerticalBorder,x.pinnedColumnsSectionSeparator),showRightBorder:kh(p,f,y.length,x.showColumnVerticalBorder,E,x.pinnedColumnsSectionSeparator)},o)});return G(t,T,R)};return{renderContext:M,leftRenderContext:L,rightRenderContext:j,pinnedColumns:R,visibleColumns:n,columnPositions:S,getFillers:G,getColumnHeadersRow:()=>i.jsxs(_g,{role:"row","aria-rowindex":d+1,ownerState:x,className:Vr["row--borderBottom"],style:{height:T},children:[L&&_({position:Qi.LEFT,renderContext:L},{disableReorder:!0}),_({renderContext:M}),j&&_({position:Qi.RIGHT,renderContext:j},{disableReorder:!0,separatorSide:bd.Left})]}),getColumnsToRender:N,getColumnGroupHeadersRows:()=>{if(0===d)return null;const e=[];for(let t=0;t<d;t+=1)e.push(i.jsxs(_g,{role:"row","aria-rowindex":t+1,ownerState:x,style:{height:D},children:[L&&V({depth:t,params:{position:Qi.LEFT,renderContext:L,maxLastColumn:L.lastColumnIndex}}),V({depth:t,params:{renderContext:M}}),j&&V({depth:t,params:{position:Qi.RIGHT,renderContext:j,maxLastColumn:j.lastColumnIndex}})]},t));return e},getPinnedCellOffset:Ph,isDragging:!!m,getInnerProps:()=>({role:"rowgroup"})}})({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:l,columnHeaderTabIndexState:u,columnGroupHeaderTabIndexState:c,columnHeaderFocus:d,columnGroupHeaderFocus:p,headerGroupingMaxDepth:h,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:b});return i.jsxs(Wg,a({},v,w(),{ref:n,children:[x(),y()]}))}));const qg=xe(function(e,t){const n=Je().current.getLocaleText("noResultsOverlayLabel");return i.jsx(Vc,a({},e,{ref:t,children:n}))}),Xg=ue("div")({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});const Yg=a({},gn,{cell:mc,skeletonCell:Cc,columnHeaderFilterIconButton:function(e){return e.counter?i.jsx(Dd,a({},e)):null},columnHeaderSortIcon:Td,columnMenu:Vd,columnHeaders:Kg,detailPanels:function(e){return null},bottomContainer:function(e){const t=ie({root:["bottomContainer"]},_r,{});return i.jsx(Xg,a({},e,{className:O(t.root,Vr["container--bottom"]),role:"presentation"}))},footer:Ih,footerRowCount:Vh,toolbar:function(t){const{showQuickFilter:n=!0,quickFilterProps:r,csvOptions:o,printOptions:l,additionalItems:u,additionalExportMenuItems:c}=t,d=s(t,bh),p=Je(),h=Xe(),[f,g]=e.useState(!1),m=e.useRef(null),b=x(),v=x(),w=!o?.disableToolbarButton||!l?.disableToolbarButton||c,y=()=>g(!1);return i.jsxs(Xc,a({},d,{children:[h.label&&i.jsx(Ch,{children:h.label}),!h.disableColumnSelector&&i.jsx(h.slots.baseTooltip,{title:p.current.getLocaleText("toolbarColumns"),children:i.jsx(ch,{render:i.jsx(Qc,{}),children:i.jsx(h.slots.columnSelectorIcon,{fontSize:"small"})})}),!h.disableColumnFilter&&i.jsx(h.slots.baseTooltip,{title:p.current.getLocaleText("toolbarFilters"),children:i.jsx(lh,{render:(e,t)=>i.jsx(Qc,a({},e,{color:t.filterCount>0?"primary":"default",children:i.jsx(h.slots.baseBadge,{badgeContent:t.filterCount,color:"primary",variant:"dot",children:i.jsx(h.slots.openFilterButtonIcon,{fontSize:"small"})})}))})}),u,w&&(!h.disableColumnFilter||!h.disableColumnSelector)&&i.jsx(xh,{}),w&&i.jsxs(e.Fragment,{children:[i.jsx(h.slots.baseTooltip,{title:p.current.getLocaleText("toolbarExport"),disableInteractive:f,children:i.jsx(Qc,{ref:m,id:v,"aria-controls":b,"aria-haspopup":"true","aria-expanded":f?"true":void 0,onClick:()=>g(!f),children:i.jsx(h.slots.exportIcon,{fontSize:"small"})})}),i.jsx(Ni,{target:m.current,open:f,onClose:y,position:"bottom-end",children:i.jsxs(h.slots.baseMenuList,a({id:b,"aria-labelledby":v,autoFocusItem:!0},h.slotProps?.baseMenuList,{children:[!l?.disableToolbarButton&&i.jsx(fh,{render:i.jsx(h.slots.baseMenuItem,a({},h.slotProps?.baseMenuItem)),options:l,onClick:y,children:p.current.getLocaleText("toolbarExportPrint")}),!o?.disableToolbarButton&&i.jsx(ph,{render:i.jsx(h.slots.baseMenuItem,a({},h.slotProps?.baseMenuItem)),options:o,onClick:y,children:p.current.getLocaleText("toolbarExportCSV")}),c?.(y)]}))})]}),n&&i.jsxs(e.Fragment,{children:[i.jsx(xh,{}),i.jsx(sh,a({},r))]})]}))},pinnedRows:function(e){return null},loadingOverlay:zh,noResultsOverlay:qg,noRowsOverlay:Lh,noColumnsOverlay:jh,pagination:function(){const t=Je(),n=Xe(),r=so(t,ta),o=so(t,na),s=so(t,sa),{paginationMode:l,loading:u}=n,c=-1===o&&"server"===l&&u,d=e.useMemo(()=>Math.max(0,s-1),[s]),p=e.useMemo(()=>-1===o||r.page<=d?r.page:d,[d,r.page,o]),h=e.useCallback(e=>{t.current.setPageSize(e)},[t]),f=e.useCallback((e,n)=>{t.current.setPage(n)},[t]),g=(e=>{for(let t=0;t<n.pageSizeOptions.length;t+=1){const r=n.pageSizeOptions[t];if("number"==typeof r){if(r===e)return!0}else if(r.value===e)return!0}return!1})(r.pageSize)?n.pageSizeOptions:[];return i.jsx(Nh,a({as:n.slots.basePagination,count:o,page:p,rowsPerPageOptions:g,rowsPerPage:r.pageSize,onPageChange:f,onRowsPerPageChange:h,disabled:c},n.slotProps?.basePagination))},filterPanel:bp,columnsPanel:function(e){const t=Xe();return i.jsx(Ud,a({},e,{children:i.jsx(t.slots.columnsManagement,a({},t.slotProps?.columnsManagement))}))},columnsManagement:function(t){const n=Je(),r=e.useRef(null),o=so(n,ri),s=so(n,ni),l=Xe(),[u,c]=e.useState(""),d=(e=>{const{classes:t}=e;return ie({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},_r,t)})(l),p=so(n,ti),h=so(n,ml),f=so(n,vl),g=e.useMemo(()=>h?Array.from(f.values()):p,[h,f,p]),{sort:m,searchPredicate:b=vp,autoFocusSearchField:v=!0,disableShowHideToggle:w=!1,disableResetButton:y=!1,toggleAllMode:x="all",getTogglableColumns:C,searchInputProps:S,searchDebounceMs:M=l.columnFilterDebounceMs}=t,R=e.useMemo(()=>he(e=>{c(e)},M??150),[M]),I=e.useMemo(()=>((e,t)=>{const n=new Set(Object.keys(e).filter(t=>!1===e[t])),r=new Set(Object.keys(t).filter(e=>!1===t[e]));if(n.size!==r.size)return!1;let o=!0;return n.forEach(e=>{r.has(e)||(o=!1)}),o})(s,o),[s,o]),P=e.useMemo(()=>{switch(m){case"asc":return[...g].sort((e,t)=>Mp.compare(e.headerName||e.field,t.headerName||t.field));case"desc":return[...g].sort((e,t)=>-Mp.compare(e.headerName||e.field,t.headerName||t.field));default:return g}},[g,m]),k=e=>{const{name:t}=e.target;n.current.setColumnVisibility(t,!1===s[t])},E=e.useMemo(()=>{const e=C?C(P):null,t=e?P.filter(({field:t})=>e.includes(t)):P;return u?t.filter(e=>b(e,u.toLowerCase())):t},[P,u,b,C]),T=e.useCallback(e=>{const t=ni(n),r=a({},t),o=C?C(g):null;return("filteredOnly"===x?E:g).forEach(t=>{t.hideable&&(null==o||o.includes(t.field))&&(e?delete r[t.field]:r[t.field]=!1)}),n.current.setColumnVisibilityModel(r)},[n,g,C,x,E]),D=e.useCallback(e=>{R(e.target.value)},[R]),F=e.useMemo(()=>E.filter(e=>e.hideable),[E]),A=e.useMemo(()=>F.every(e=>null==s[e.field]||!1!==s[e.field]),[s,F]),O=e.useMemo(()=>F.every(e=>!1===s[e.field]),[s,F]),H=e.useRef(null);e.useEffect(()=>{v?r.current?.focus():H.current&&"function"==typeof H.current.focus&&H.current.focus()},[v]);let $=!1;const z=e=>!1===$&&!1!==e.hideable&&($=!0,!0),L=e.useCallback(()=>{c(""),r.current&&(r.current.value="",r.current.focus())},[]);return i.jsxs(e.Fragment,{children:[i.jsx(Pp,{className:d.header,ownerState:l,children:i.jsx(kp,a({as:l.slots.baseTextField,ownerState:l,placeholder:n.current.getLocaleText("columnsManagementSearchTitle"),inputRef:r,className:d.searchInput,onChange:D,size:"small",type:"search",slotProps:{input:{startAdornment:i.jsx(l.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:i.jsx(l.slots.baseIconButton,a({size:"small","aria-label":n.current.getLocaleText("columnsManagementDeleteIconLabel"),style:u?{visibility:"visible"}:{visibility:"hidden"},tabIndex:-1,onClick:L,edge:"end"},l.slotProps?.baseIconButton,{children:i.jsx(l.slots.quickFilterClearIcon,{fontSize:"small"})}))},htmlInput:{"aria-label":n.current.getLocaleText("columnsManagementSearchTitle")}},autoComplete:"off",fullWidth:!0},l.slotProps?.baseTextField,S))}),i.jsx(Ip,{ownerState:l,children:i.jsxs(Rp,{className:d.root,ownerState:l,children:[E.map(e=>i.jsx(Dp,a({as:l.slots.baseCheckbox,className:d.row,disabled:!1===e.hideable||h,checked:!1!==s[e.field],onChange:k,name:e.field,inputRef:z(e)?H:void 0,label:e.headerName||e.field,density:"compact",fullWidth:!0},l.slotProps?.baseCheckbox),e.field)),0===E.length&&i.jsx(Tp,{ownerState:l,children:n.current.getLocaleText("columnsManagementNoColumns")})]})}),w&&y?null:i.jsxs(Ep,{ownerState:l,className:d.footer,children:[w?i.jsx("span",{}):i.jsx(l.slots.baseCheckbox,a({disabled:0===F.length||h,checked:A,indeterminate:!A&&!O,onChange:()=>T(!A),name:n.current.getLocaleText("columnsManagementShowHideAllText"),label:n.current.getLocaleText("columnsManagementShowHideAllText"),density:"compact"},l.slotProps?.baseCheckbox)),y?null:i.jsx(l.slots.baseButton,a({onClick:()=>n.current.setColumnVisibilityModel(o),disabled:I||h},l.slotProps?.baseButton,{children:n.current.getLocaleText("columnsManagementReset")}))]})]})},panel:Qd,row:Zh}),Qg={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},Zg=Yg,Jg=t=>{const n=l(),r=e.useMemo(()=>me({props:t,theme:n,name:"MuiDataGrid"}),[n,t]),o=e.useMemo(()=>a({},Gr,r.localeText),[r.localeText]),i=e.useMemo(()=>function({defaultSlots:e,slots:t}){const n=t;if(!n||0===Object.keys(n).length)return e;const r=a({},e);return Object.keys(n).forEach(e=>{const t=e;void 0!==n[t]&&(r[t]=n[t])}),r}({defaultSlots:Zg,slots:r.slots}),[r.slots]),s=e.useMemo(()=>Object.keys(Qu).reduce((e,t)=>(e[t]=r[t]??Qu[t],e),{}),[r]);return e.useMemo(()=>a({},r,s,{localeText:o,slots:i},(e=>a({},Qg,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}))(r)),[r,o,i,s])};class em{maxListeners=20;warnOnce=!1;events={};on(e,t,n={}){let r=this.events[e];r||(r={highPriority:new Map,regular:new Map},this.events[e]=r),n.isFirst?r.highPriority.set(t,!0):r.regular.set(t,!0)}removeListener(e,t){this.events[e]&&(this.events[e].regular.delete(t),this.events[e].highPriority.delete(t))}removeAllListeners(){this.events={}}emit(e,...t){const n=this.events[e];if(!n)return;const r=Array.from(n.highPriority.keys()),o=Array.from(n.regular.keys());for(let i=r.length-1;i>=0;i-=1){const e=r[i];n.highPriority.has(e)&&e.apply(this,t)}for(let i=0;i<o.length;i+=1){const e=o[i];n.regular.has(e)&&e.apply(this,t)}}once(e,t){const n=this;this.on(e,function r(...o){n.removeListener(e,r),t.apply(n,o)})}}const tm=Symbol("mui.api_private");let nm=0;function rm(t,n){const r=e.useRef(null),o=e.useRef(null);o.current||(o.current=function(e){const t=e.current?.[tm];if(t)return t;const n={},r={state:n,store:Un.create(n),instanceId:{id:nm}};return nm+=1,r.getPublicApi=()=>e.current,r.register=(t,n)=>{Object.keys(n).forEach(o=>{const i=n[o],s=r[o];if(!0===s?.spying?s.target=i:r[o]=i,"public"===t){const t=e.current,n=t[o];!0===n?.spying?n.target=i:t[o]=i}})},r.register("private",{caches:{},eventManager:new em}),r}(r)),r.current||(r.current=function(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[tm]:e.current}}(o));const i=e.useCallback((...e)=>{const[t,r,i={}]=e;if(i.defaultMuiPrevented=!1,(e=>void 0!==e.isPropagationStopped)(i)&&i.isPropagationStopped())return;const s=n.signature===Br.DataGridPro||n.signature===Br.DataGridPremium?{api:o.current.getPublicApi()}:{};o.current.eventManager.emit(t,r,i,s)},[o,n.signature]),s=e.useCallback((e,t,n)=>{o.current.eventManager.on(e,t,n);const r=o.current;return()=>{r.eventManager.removeListener(e,t)}},[o]);return dl(o,{subscribeEvent:s,publishEvent:i},"public"),t&&!t.current?.state&&(t.current=r.current),e.useImperativeHandle(t,()=>r.current,[r]),e.useEffect(()=>{const e=o.current;return()=>{e.publishEvent("unmount")}},[o]),o}const om={hooks:{useCSSVariables:function(){const t=l();return e.useMemo(()=>{const n=it(function(t){const n=new WeakSet;return JSON.stringify(t,(t,r)=>{if("undefined"!=typeof window&&r===window||"undefined"!=typeof document&&r===document)return r.toString();if(null!==r&&"object"==typeof r){if(e.isValidElement(r))return null;if(n.has(r))return null;n.add(r)}return r})}(t)),r=function(e){const t=function(e){if(e.vars)return e.vars.palette.TableCell.border;if("light"===e.palette.mode)return c(u(e.palette.divider,1),.88);return d(u(e.palette.divider,1),.68)}(e),n=(e.vars||e).palette.DataGrid,r=n?.bg??("dark"===e.palette.mode?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 95%, #fff)`:(e.vars||e).palette.background.paper),o=n?.headerBg??r,i=n?.pinnedBg??r,s=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:u(e.palette.background.default,e.palette.action.disabledOpacity),a="dark"===e.palette.mode?`color-mix(in srgb, ${(e.vars||e).palette.background.paper} 90%, #fff)`:(e.vars||e).palette.background.paper,l=e.vars?`rgb(${e.vars.palette.primary.mainChannel})`:e.palette.primary.main,p=function(e){if(e.vars)return e.vars.shape.borderRadius;return"number"==typeof e.shape.borderRadius?`${e.shape.borderRadius}px`:e.shape.borderRadius}(e),h=e.vars?.font?.body2??ht(e.typography.body2),f=e.vars?.font?.caption??ht(e.typography.caption),g=e.vars?.font?.body1??ht(e.typography.body1),m=ct.keys;return{[m.spacingUnit]:e.vars?e.vars.spacing??e.spacing(1):e.spacing(1),[m.colors.border.base]:t,[m.colors.background.base]:r,[m.colors.background.overlay]:a,[m.colors.background.backdrop]:s,[m.colors.foreground.base]:(e.vars||e).palette.text.primary,[m.colors.foreground.muted]:(e.vars||e).palette.text.secondary,[m.colors.foreground.accent]:(e.vars||e).palette.primary.dark,[m.colors.foreground.disabled]:(e.vars||e).palette.text.disabled,[m.colors.foreground.error]:(e.vars||e).palette.error.dark,[m.colors.interactive.hover]:(e.vars||e).palette.action.hover,[m.colors.interactive.hoverOpacity]:(e.vars||e).palette.action.hoverOpacity,[m.colors.interactive.focus]:pt((e.vars||e).palette.primary.main),[m.colors.interactive.focusOpacity]:(e.vars||e).palette.action.focusOpacity,[m.colors.interactive.disabled]:pt((e.vars||e).palette.action.disabled),[m.colors.interactive.disabledOpacity]:(e.vars||e).palette.action.disabledOpacity,[m.colors.interactive.selected]:l,[m.colors.interactive.selectedOpacity]:(e.vars||e).palette.action.selectedOpacity,[m.header.background.base]:o,[m.cell.background.pinned]:i,[m.radius.base]:p,[m.typography.fontFamily.base]:e.typography.fontFamily,[m.typography.fontWeight.light]:e.typography.fontWeightLight,[m.typography.fontWeight.regular]:e.typography.fontWeightRegular,[m.typography.fontWeight.medium]:e.typography.fontWeightMedium,[m.typography.fontWeight.bold]:e.typography.fontWeightBold,[m.typography.font.body]:h,[m.typography.font.small]:f,[m.typography.font.large]:g,[m.transitions.easing.easeIn]:e.transitions.easing.easeIn,[m.transitions.easing.easeOut]:e.transitions.easing.easeOut,[m.transitions.easing.easeInOut]:e.transitions.easing.easeInOut,[m.transitions.duration.short]:`${e.transitions.duration.shorter}ms`,[m.transitions.duration.base]:`${e.transitions.duration.short}ms`,[m.transitions.duration.long]:`${e.transitions.duration.standard}ms`,[m.shadows.base]:(e.vars||e).shadows[2],[m.shadows.overlay]:(e.vars||e).shadows[8],[m.zIndex.panel]:(e.vars||e).zIndex.modal,[m.zIndex.menu]:(e.vars||e).zIndex.modal}}(t);return{id:n,variables:r}},[t])},useGridAriaAttributes:()=>{const e=ul(),t=Xe(),n=so(e,oi),r=so(e,Ss),o=so(e,Xa),i=so(e,Sr),s=t["aria-label"],a=t["aria-labelledby"];return{role:"grid","aria-label":!s&&!a&&t.label?t.label:s,"aria-labelledby":a,"aria-colcount":n.length,"aria-rowcount":o+1+i+r,"aria-multiselectable":zs(t)}},useGridRowAriaAttributes:()=>{const t=ul(),n=so(t,Xa);return e.useCallback((e,r)=>{const o={},i=r+n+2;return o["aria-rowindex"]=i,e&&t.current.isRowSelectable(e.id)&&(o["aria-selected"]=t.current.isRowSelected(e.id)),o},[t,n])},useGridRowsOverridableMethods:t=>{const n=e.useCallback((e,n,r)=>{const o=gr(t,e),i=gr(t,n);if(!o)throw new Error(`MUI X: No row with id #${e} found.`);if(!i)throw new Error(`MUI X: No row with id #${n} found.`);if("leaf"!==o.type)throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");if("inside"===r)throw new Error("MUI X: The 'inside' position is only supported for tree data. Use 'above' or 'below' for flat data.");const s=ks(t),l=s[n];if(void 0===l)throw new Error(`MUI X: Target row with id #${n} not found in current view.`);const u=s[e];if(void 0===u)throw new Error(`MUI X: Source row with id #${e} not found in current view.`);let c;c="up"===(l<u?"up":"down")?"above"===r?l:l+1:"above"===r?l-1:l,c!==u&&(t.current.setState(e=>{const n=fr(t)[Mr],r=[...n.children];return r.splice(c,0,r.splice(u,1)[0]),a({},e,{rows:a({},e.rows,{tree:a({},e.rows.tree,{[Mr]:a({},n,{children:r})})})})}),t.current.publishEvent("rowsSet"))},[t]);return{setRowIndex:e.useCallback((e,n)=>{const r=gr(t,e);if(!r)throw new Error(`MUI X: No row with id #${e} found.`);if("leaf"!==r.type)throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");t.current.setState(r=>{const o=fr(t)[Mr],i=o.children,s=i.findIndex(t=>t===e);if(-1===s||s===n)return r;const l=[...i];return l.splice(n,0,l.splice(s,1)[0]),a({},r,{rows:a({},r.rows,{tree:a({},r.rows.tree,{[Mr]:a({},o,{children:l})})})})}),t.current.publishEvent("rowsSet")},[t]),setRowPosition:n}},useGridParamsOverridableMethods:t=>{const n=e.useCallback((e,n)=>{const r=t.current.getColumn(n),o=t.current.getRow(e);if(!o)throw new Error(`No row with id #${e} found`);return r&&r.valueGetter?r.valueGetter(o[r.field],o,r,t):o[n]},[t]),r=e.useCallback((e,n)=>Pr(e,n,t),[t]),o=e.useCallback((e,n)=>{const o=r(e,n);return n&&n.valueFormatter?n.valueFormatter(o,e,n,t):o},[t,r]);return{getCellValue:n,getRowValue:r,getRowFormattedValue:o}},useIsCellEditable:()=>e.useCallback(e=>!Fr(e.rowNode),[]),useCellAggregationResult:()=>null,useFilterValueGetter:e=>e.current.getRowValue}},im=function(e,t){const n=Jg(e),r=rm(n.apiRef,n);return Lg(r,n,om),i.jsx(Jh,{privateApiRef:r,configuration:om,props:n,children:i.jsx(zc,a({className:n.className,style:n.style,sx:n.sx},n.slotProps?.root,{ref:t}))})},sm=e.memo(xe(im));im.propTypes={apiRef:be.shape({current:be.object}),"aria-label":be.string,"aria-labelledby":be.string,autoHeight:be.bool,autoPageSize:be.bool,autosizeOnMount:be.bool,autosizeOptions:be.shape({columns:be.arrayOf(be.string),disableColumnVirtualization:be.bool,expand:be.bool,includeHeaders:be.bool,includeOutliers:be.bool,outliersFactor:be.number}),cellModesModel:be.object,checkboxSelection:be.bool,classes:be.object,className:be.string,clipboardCopyCellDelimiter:be.string,columnBufferPx:be.number,columnFilterDebounceMs:be.number,columnGroupHeaderHeight:be.number,columnGroupingModel:be.arrayOf(be.object),columnHeaderHeight:be.number,columns:be.arrayOf(be.object).isRequired,columnVisibilityModel:be.object,dataSource:be.shape({getRows:be.func.isRequired,updateRow:be.func}),dataSourceCache:be.shape({clear:be.func.isRequired,get:be.func.isRequired,set:be.func.isRequired}),density:be.oneOf(["comfortable","compact","standard"]),disableAutosize:be.bool,disableColumnFilter:be.bool,disableColumnMenu:be.bool,disableColumnResize:be.bool,disableColumnSelector:be.bool,disableColumnSorting:be.bool,disableDensitySelector:be.bool,disableEval:be.bool,disableMultipleRowSelection:be.bool,disableRowSelectionExcludeModel:be.bool,disableRowSelectionOnClick:be.bool,disableVirtualization:be.bool,editMode:be.oneOf(["cell","row"]),estimatedRowCount:be.number,experimentalFeatures:be.shape({warnIfFocusStateIsNotSynced:be.bool}),filterDebounceMs:be.number,filterMode:be.oneOf(["client","server"]),filterModel:be.shape({items:be.arrayOf(be.shape({field:be.string.isRequired,id:be.oneOfType([be.number,be.string]),operator:be.string.isRequired,value:be.any})).isRequired,logicOperator:be.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:be.bool,quickFilterLogicOperator:be.oneOf(["and","or"]),quickFilterValues:be.array}),getCellClassName:be.func,getDetailPanelContent:be.func,getEstimatedRowHeight:be.func,getRowClassName:be.func,getRowHeight:be.func,getRowId:be.func,getRowSpacing:be.func,hideFooter:be.bool,hideFooterPagination:be.bool,hideFooterSelectedRowCount:be.bool,ignoreDiacritics:be.bool,ignoreValueFormatterDuringExport:be.oneOfType([be.shape({clipboardExport:be.bool,csvExport:be.bool}),be.bool]),initialState:be.object,isCellEditable:be.func,isRowSelectable:be.func,keepNonExistentRowsSelected:be.bool,label:be.string,loading:be.bool,localeText:be.object,logger:be.shape({debug:be.func.isRequired,error:be.func.isRequired,info:be.func.isRequired,warn:be.func.isRequired}),logLevel:be.oneOf(["debug","error","info","warn",!1]),nonce:be.string,onCellClick:be.func,onCellDoubleClick:be.func,onCellEditStart:be.func,onCellEditStop:be.func,onCellKeyDown:be.func,onCellModesModelChange:be.func,onClipboardCopy:be.func,onColumnHeaderClick:be.func,onColumnHeaderContextMenu:be.func,onColumnHeaderDoubleClick:be.func,onColumnHeaderEnter:be.func,onColumnHeaderLeave:be.func,onColumnHeaderOut:be.func,onColumnHeaderOver:be.func,onColumnOrderChange:be.func,onColumnResize:be.func,onColumnVisibilityModelChange:be.func,onColumnWidthChange:be.func,onDataSourceError:be.func,onDensityChange:be.func,onFilterModelChange:be.func,onMenuClose:be.func,onMenuOpen:be.func,onPaginationMetaChange:be.func,onPaginationModelChange:be.func,onPreferencePanelClose:be.func,onPreferencePanelOpen:be.func,onProcessRowUpdateError:be.func,onResize:be.func,onRowClick:be.func,onRowCountChange:be.func,onRowDoubleClick:be.func,onRowEditStart:be.func,onRowEditStop:be.func,onRowModesModelChange:be.func,onRowSelectionModelChange:be.func,onSortModelChange:be.func,onStateChange:be.func,pageSizeOptions:be.arrayOf(be.oneOfType([be.number,be.shape({label:be.string.isRequired,value:be.number.isRequired})]).isRequired),pagination:be.oneOf([!0]),paginationMeta:be.shape({hasNextPage:be.bool}),paginationMode:be.oneOf(["client","server"]),paginationModel:be.shape({page:be.number.isRequired,pageSize:be.number.isRequired}),processRowUpdate:be.func,resizeThrottleMs:be.number,rowBufferPx:be.number,rowCount:be.number,rowHeight:be.number,rowModesModel:be.object,rows:be.arrayOf(be.object),rowSelection:be.bool,rowSelectionModel:be.shape({ids:be.instanceOf(Set).isRequired,type:be.oneOf(["exclude","include"]).isRequired}),rowSpacingType:be.oneOf(["border","margin"]),rowSpanning:be.bool,scrollbarSize:be.number,showCellVerticalBorder:be.bool,showColumnVerticalBorder:be.bool,showToolbar:be.bool,slotProps:be.object,slots:be.object,sortingMode:be.oneOf(["client","server"]),sortingOrder:be.arrayOf(be.oneOf(["asc","desc"])),sortModel:be.arrayOf(be.shape({field:be.string.isRequired,sort:be.oneOf(["asc","desc"])})),style:be.object,sx:be.oneOfType([be.arrayOf(be.oneOfType([be.func,be.object,be.bool])),be.func,be.object]),virtualizeColumnsWithAutoRowHeight:be.bool};const am=({params:t,store:n})=>{e.useEffect(()=>{n.set("animation",a({},n.state.animation,{skip:t.skipAnimation}))},[n,t.skipAnimation]);const r=e.useCallback(()=>{let e=!1;return n.set("animation",a({},n.state.animation,{skipAnimationRequests:n.state.animation.skipAnimationRequests+1})),()=>{e||(e=!0,n.set("animation",a({},n.state.animation,{skipAnimationRequests:n.state.animation.skipAnimationRequests-1})))}},[n]);return oe(()=>{if("undefined"==typeof window||!window?.matchMedia)return;let e;const t=t=>{t.matches?e=r():e?.()},n=window.matchMedia("(prefers-reduced-motion)");return t(n),n.addEventListener("change",t),()=>{n.removeEventListener("change",t)}},[r,n]),{instance:{disableAnimation:r}}};am.params={skipAnimation:!0},am.getDefaultizedParams=({params:e})=>a({},e,{skipAnimation:e.skipAnimation??!1}),am.getInitialState=({skipAnimation:e})=>({animation:{skip:e,skipAnimationRequests:0}});const lm=En(e=>e.animation,e=>e.skip||e.skipAnimationRequests>0);const um=_n,cm={top:20,bottom:20,left:20,right:20},dm=e=>e.cartesianAxis?.x,pm=e=>e.cartesianAxis?.y,hm=En(pm,function(e){return(e??[]).reduce((e,t)=>"left"===t.position?e+(t.width||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),fm=En(pm,function(e){return(e??[]).reduce((e,t)=>"right"===t.position?e+(t.width||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),gm=En(dm,function(e){return(e??[]).reduce((e,t)=>"top"===t.position?e+(t.height||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),mm=En(dm,function(e){return(e??[]).reduce((e,t)=>"bottom"===t.position?e+(t.height||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),bm=Dn(hm,fm,gm,mm,function(e,t,n,r){return{left:e,right:t,top:n,bottom:r}}),vm=e=>e.dimensions,wm=Dn(vm,e=>e.dimensions.margin,bm,function({width:e,height:t},{top:n,right:r,bottom:o,left:i},{left:s,right:a,top:l,bottom:u}){return{width:e-i-r-s-a,left:i+s,right:r+a,height:t-n-o-l-u,top:n+l,bottom:o+u}}),ym=En(vm,e=>e.width),xm=En(vm,e=>e.height),Cm=En(vm,e=>e.propsWidth),Sm=En(vm,e=>e.propsHeight);function Mm(e,t){return"number"==typeof e?{top:e,bottom:e,left:e,right:e}:t?a({},t,e):e}const Rm=({params:t,store:n,svgRef:r})=>{const o=void 0!==t.width&&void 0!==t.height,i=e.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[s,a]=e.useState(0),[l,u]=e.useState(0),c=e.useCallback(()=>{const e=r?.current;if(!e)return{};const o=ve(e).getComputedStyle(e),i=Math.floor(parseFloat(o.height))||0,s=Math.floor(parseFloat(o.width))||0;return n.state.dimensions.width===s&&n.state.dimensions.height===i||n.set("dimensions",{margin:{top:t.margin.top,right:t.margin.right,bottom:t.margin.bottom,left:t.margin.left},width:t.width??s,height:t.height??i,propsWidth:t.width,propsHeight:t.height}),{height:i,width:s}},[n,r,t.height,t.width,t.margin.left,t.margin.right,t.margin.top,t.margin.bottom]);!function(t,n){const r=e.useRef(!0);e.useEffect(()=>{if(!r.current)return t();r.current=!1},n)}(()=>{const e=t.width??n.state.dimensions.width,r=t.height??n.state.dimensions.height;n.set("dimensions",{margin:{top:t.margin.top,right:t.margin.right,bottom:t.margin.bottom,left:t.margin.left},width:e,height:r,propsHeight:t.height,propsWidth:t.width})},[n,t.height,t.width,t.margin.left,t.margin.right,t.margin.top,t.margin.bottom]),e.useEffect(()=>{i.current.displayError=!0},[]),oe(()=>{if(o||!i.current.initialCompute||i.current.computeRun>10)return;const e=c();e.width!==s||e.height!==l?(i.current.computeRun+=1,void 0!==e.width&&a(e.width),void 0!==e.height&&u(e.height)):i.current.initialCompute&&(i.current.initialCompute=!1)},[l,s,c,o]),oe(()=>{if(o)return()=>{};c();const e=r.current;if("undefined"==typeof ResizeObserver)return()=>{};let t;const n=new ResizeObserver(()=>{t=requestAnimationFrame(()=>{c()})});return e&&n.observe(e),()=>{t&&cancelAnimationFrame(t),e&&n.unobserve(e)}},[c,o,r]);const d=um(n,wm),p=e.useCallback(e=>e>=d.left-1&&e<=d.left+d.width,[d.left,d.width]),h=e.useCallback(e=>e>=d.top-1&&e<=d.top+d.height,[d.height,d.top]);return{instance:{isPointInside:e.useCallback((e,t,n)=>!!(n&&"closest"in n&&n.closest("[data-drawing-container]"))||p(e)&&h(t),[p,h]),isXInside:p,isYInside:h}}};Rm.params={width:!0,height:!0,margin:!0},Rm.getDefaultizedParams=({params:e})=>a({},e,{margin:Mm(e.margin,cm)}),Rm.getInitialState=({width:e,height:t,margin:n})=>({dimensions:{margin:n,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});const Im=({params:e,store:t})=>(oe(()=>{t.set("experimentalFeatures",e.experimentalFeatures)},[t,e.experimentalFeatures]),{});Im.params={experimentalFeatures:!0},Im.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});const Pm=En(e=>e.experimentalFeatures,e=>Boolean(e?.preferStrictDomainInLineCharts));let km=0;const Em=({params:t,store:n})=>(e.useEffect(()=>{void 0===t.id||t.id===n.state.id.providedChartId&&void 0!==n.state.id.chartId||n.set("id",a({},n.state.id,{chartId:t.id??(km+=1,`mui-chart-${km}`)}))},[n,t.id]),{});Em.params={id:!0},Em.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});const Tm=En(e=>e.id,e=>e.chartId),Dm=["#4254FB","#FFB422","#FA4F58","#0DBEFF","#22BF75","#FA83B4","#FF7511"],Fm=["#495AFB","#FFC758","#F35865","#30C8FF","#44CE8D","#F286B3","#FF8C39"],Am=e=>"dark"===e?Fm:Dm,Om=({series:e,colors:t,seriesConfig:n})=>{const r={};return e.forEach((e,o)=>{const i=n[e.type].getSeriesWithDefaultValues(e,o,t),s=i.id;if(void 0===r[e.type]&&(r[e.type]={series:{},seriesOrder:[]}),void 0!==r[e.type]?.series[s])throw new Error(`MUI X Charts: series' id "${s}" is not unique.`);r[e.type].series[s]=i,r[e.type].seriesOrder.push(s)}),r},Hm=({params:t,store:n,seriesConfig:r})=>{const{series:o,dataset:i,theme:s,colors:l}=t,u=e.useRef(!0);return e.useEffect(()=>{u.current?u.current=!1:n.set("series",a({},n.state.series,{defaultizedSeries:Om({series:o,colors:"function"==typeof l?l(s):l,seriesConfig:r}),dataset:i}))},[l,i,o,s,r,n]),{}};Hm.params={dataset:!0,series:!0,colors:!0,theme:!0};const $m=[];Hm.getDefaultizedParams=({params:e})=>a({},e,{series:e.series?.length?e.series:$m,colors:e.colors??Am,theme:e.theme??"light"}),Hm.getInitialState=({series:e=[],colors:t,theme:n,dataset:r},o,i)=>({series:{seriesConfig:i,defaultizedSeries:Om({series:e,colors:"function"==typeof t?t(n):t,seriesConfig:i}),dataset:r}});const zm=e=>e.series,Lm=En(zm,e=>e.defaultizedSeries),jm=En(zm,e=>e.seriesConfig),Nm=En(zm,e=>e.dataset),Gm=Dn(Lm,jm,Nm,function(e,t,n){return((e,t,n)=>{const r={};return Object.keys(t).forEach(o=>{const i=e[o];void 0!==i&&(r[o]=t[o]?.seriesProcessor?.(i,n)??i)}),r})(e,t,n)}),_m={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0};class Vm{customData={};constructor(e){if(!e||!e.name)throw new Error("Gesture must be initialized with a valid name.");if(e.name in _m)throw new Error(`Gesture can't be created with a native event name. Tried to use "${e.name}". Please use a custom name instead.`);this.name=e.name,this.preventDefault=e.preventDefault??!1,this.stopPropagation=e.stopPropagation??!1,this.preventIf=e.preventIf??[],this.requiredKeys=e.requiredKeys??[],this.pointerMode=e.pointerMode??[],this.pointerOptions=e.pointerOptions??{}}init(e,t,n,r){this.element=e,this.pointerManager=t,this.gesturesRegistry=n,this.keyboardManager=r;const o=`${this.name}ChangeOptions`;this.element.addEventListener(o,this.handleOptionsChange);const i=`${this.name}ChangeState`;this.element.addEventListener(i,this.handleStateChange)}handleOptionsChange=e=>{e&&e.detail&&this.updateOptions(e.detail)};updateOptions(e){this.preventDefault=e.preventDefault??this.preventDefault,this.stopPropagation=e.stopPropagation??this.stopPropagation,this.preventIf=e.preventIf??this.preventIf,this.requiredKeys=e.requiredKeys??this.requiredKeys,this.pointerMode=e.pointerMode??this.pointerMode,this.pointerOptions=e.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(e,t){if("mouse"!==e&&"touch"!==e&&"pen"!==e)return t;const n=this.pointerOptions[e];return n?a({},t,n):t}handleStateChange=e=>{e&&e.detail&&this.updateState(e.detail)};updateState(e){Object.assign(this.state,e)}getTargetElement(e){return this.isActive||this.element===e.target||"contains"in this.element&&this.element.contains(e.target)||"getRootNode"in this.element&&this.element.getRootNode()instanceof ShadowRoot&&e.composedPath().includes(this.element)?this.element:null}set isActive(e){e?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(e,t){const n=this.getEffectiveConfig(t,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(n.requiredKeys))return!0;if(0===this.preventIf.length)return!1;const r=this.gesturesRegistry.getActiveGestures(e);return this.preventIf.some(e=>r[e])}isPointerTypeAllowed(e){return!this.pointerMode||0===this.pointerMode.length||this.pointerMode.includes(e)}destroy(){const e=`${this.name}ChangeOptions`;this.element.removeEventListener(e,this.handleOptionsChange);const t=`${this.name}ChangeState`;this.element.removeEventListener(t,this.handleStateChange)}}class Bm{activeGestures=(()=>new Map)();registerActiveGesture(e,t){this.activeGestures.has(e)||this.activeGestures.set(e,new Set);const n={gesture:t,element:e};this.activeGestures.get(e).add(n)}unregisterActiveGesture(e,t){const n=this.activeGestures.get(e);n&&(n.forEach(e=>{e.gesture===t&&n.delete(e)}),0===n.size&&this.activeGestures.delete(e))}getActiveGestures(e){const t=this.activeGestures.get(e);return t?Array.from(t).reduce((e,t)=>(e[t.gesture.name]=!0,e),{}):{}}isGestureActive(e,t){const n=this.activeGestures.get(e);return!!n&&Array.from(n).some(e=>e.gesture===t)}destroy(){this.activeGestures.clear()}unregisterElement(e){this.activeGestures.delete(e)}}class Wm{pressedKeys=(()=>new Set)();constructor(){this.initialize()}initialize(){"undefined"!=typeof window&&(window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp),window.addEventListener("blur",this.clearKeys))}handleKeyDown=e=>{this.pressedKeys.add(e.key)};handleKeyUp=e=>{this.pressedKeys.delete(e.key)};clearKeys=()=>{this.pressedKeys.clear()};areKeysPressed(e){return!e||0===e.length||e.every(e=>"ControlOrMeta"===e?navigator.platform.includes("Mac")?this.pressedKeys.has("Meta"):this.pressedKeys.has("Control"):this.pressedKeys.has(e))}destroy(){"undefined"!=typeof window&&(window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("blur",this.clearKeys)),this.clearKeys()}}class Um{preventEventInterruption=!0;pointers=(()=>new Map)();gestureHandlers=(()=>new Set)();constructor(e){this.root=e.root??document.getRootNode({composed:!0})??document.body,this.touchAction=e.touchAction||"auto",this.passive=e.passive??!1,this.preventEventInterruption=e.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(e){return this.gestureHandlers.add(e),()=>{this.gestureHandlers.delete(e)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){"auto"!==this.touchAction&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener("pointerdown",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointermove",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointerup",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("pointercancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("forceCancel",this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener("blur",this.handleInterruptEvents),this.root.addEventListener("contextmenu",this.handleInterruptEvents)}handleInterruptEvents=e=>{if(this.preventEventInterruption&&"pointerType"in e&&"touch"===e.pointerType)return void e.preventDefault();const t=new PointerEvent("forceCancel",{bubbles:!1,cancelable:!1}),n=this.pointers.values().next().value;if(this.pointers.size>0&&n){Object.defineProperties(t,{clientX:{value:n.clientX},clientY:{value:n.clientY},pointerId:{value:n.pointerId},pointerType:{value:n.pointerType}});for(const[e,t]of this.pointers.entries()){const n=a({},t,{type:"forceCancel"});this.pointers.set(e,n)}}this.notifyHandlers(t),this.pointers.clear()};handlePointerEvent=e=>{const{type:t,pointerId:n}=e;if("pointerdown"===t||"pointermove"===t)this.pointers.set(n,this.createPointerData(e));else if("pointerup"===t||"pointercancel"===t||"forceCancel"===t)return this.pointers.set(n,this.createPointerData(e)),this.notifyHandlers(e),void this.pointers.delete(n);this.notifyHandlers(e)};notifyHandlers(e){this.gestureHandlers.forEach(t=>t(this.pointers,e))}createPointerData(e){return{pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,timeStamp:e.timeStamp,type:e.type,isPrimary:e.isPrimary,pressure:e.pressure,width:e.width,height:e.height,pointerType:e.pointerType,srcEvent:e}}destroy(){this.root.removeEventListener("pointerdown",this.handlePointerEvent),this.root.removeEventListener("pointermove",this.handlePointerEvent),this.root.removeEventListener("pointerup",this.handlePointerEvent),this.root.removeEventListener("pointercancel",this.handlePointerEvent),this.root.removeEventListener("forceCancel",this.handlePointerEvent),this.root.removeEventListener("blur",this.handleInterruptEvents),this.root.removeEventListener("contextmenu",this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}}class Km{gestureTemplates=(()=>new Map)();elementGestureMap=(()=>new Map)();activeGesturesRegistry=(()=>new Bm)();keyboardManager=(()=>new Wm)();constructor(e){this.pointerManager=new Um({root:e.root,touchAction:e.touchAction,passive:e.passive}),e.gestures&&e.gestures.length>0&&e.gestures.forEach(e=>{this.addGestureTemplate(e)})}addGestureTemplate(e){this.gestureTemplates.has(e.name)&&console.warn(`Gesture template with name "${e.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(e.name,e)}setGestureOptions(e,t,n){const r=this.elementGestureMap.get(t);if(!r||!r.has(e))return void console.error(`Gesture "${e}" not found on the provided element.`);const o=new CustomEvent(`${e}ChangeOptions`,{detail:n,bubbles:!1,cancelable:!1,composed:!1});t.dispatchEvent(o)}setGestureState(e,t,n){const r=this.elementGestureMap.get(t);if(!r||!r.has(e))return void console.error(`Gesture "${e}" not found on the provided element.`);const o=new CustomEvent(`${e}ChangeState`,{detail:n,bubbles:!1,cancelable:!1,composed:!1});t.dispatchEvent(o)}registerElement(e,t,n){return Array.isArray(e)||(e=[e]),e.forEach(e=>{const r=n?.[e];this.registerSingleGesture(e,t,r)}),t}registerSingleGesture(e,t,n){const r=this.gestureTemplates.get(e);if(!r)return console.error(`Gesture template "${e}" not found.`),!1;this.elementGestureMap.has(t)||this.elementGestureMap.set(t,new Map);const o=this.elementGestureMap.get(t);o.has(e)&&(console.warn(`Element already has gesture "${e}" registered. It will be replaced.`),this.unregisterElement(e,t));const i=r.clone(n);return i.init(t,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),o.set(e,i),!0}unregisterElement(e,t){const n=this.elementGestureMap.get(t);if(!n||!n.has(e))return!1;return n.get(e).destroy(),n.delete(e),this.activeGesturesRegistry.unregisterElement(t),0===n.size&&this.elementGestureMap.delete(t),!0}unregisterAllGestures(e){const t=this.elementGestureMap.get(e);if(t){for(const[,n]of t)n.destroy(),this.activeGesturesRegistry.unregisterElement(e);this.elementGestureMap.delete(e)}}destroy(){for(const[e]of this.elementGestureMap)this.unregisterAllGestures(e);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}}class qm extends Vm{unregisterHandler=null;originalTarget=null;constructor(e){super(e),this.minPointers=e.minPointers??1,this.maxPointers=e.maxPointers??1/0}init(e,t,n,r){super.init(e,t,n,r),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(e){super.updateOptions(e),this.minPointers=e.minPointers??this.minPointers,this.maxPointers=e.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(e,t){const n=this.getEffectiveConfig(t,this.getBaseConfig());return e.length>=n.minPointers&&e.length<=n.maxPointers}getRelevantPointers(e,t){return e.filter(e=>this.isPointerTypeAllowed(e.pointerType)&&(t===e.target||e.target===this.originalTarget||t===this.originalTarget||"contains"in t&&t.contains(e.target))||"getRootNode"in t&&t.getRootNode()instanceof ShadowRoot&&e.srcEvent.composedPath().includes(t))}destroy(){this.unregisterHandler&&(this.unregisterHandler(),this.unregisterHandler=null),super.destroy()}}function Xm(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function Ym(e){if(e.length<2)return 0;let t=0,n=0;for(let r=0;r<e.length;r+=1)for(let o=r+1;o<e.length;o+=1)t+=Xm({x:e[r].clientX,y:e[r].clientY},{x:e[o].clientX,y:e[o].clientY}),n+=1;return n>0?t/n:0}function Qm(e){if(0===e.length)return{x:0,y:0};const t=e.reduce((e,t)=>(e.x+=t.clientX,e.y+=t.clientY,e),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function Zm(e,t){return`${e}${"ongoing"===t?"":t.charAt(0).toUpperCase()+t.slice(1)}`}const Jm=1e-5;function eb(e,t){const n=t.x-e.x,r=t.y-e.y,o={vertical:null,horizontal:null,mainAxis:null},i=function(e,t){const n=t.x-e.x,r=t.y-e.y,o=180*Math.atan2(r,n)/Math.PI;return o>=-44.99999&&o<=-22.49999||o>=22.50001&&o<=45.00001||o>=135.00001&&o<=157.50001||o>=-157.49999&&o<=-134.99999}(t,e),s=Math.abs(n)>Math.abs(r)?"horizontal":"vertical",a=i||"horizontal"===s?Jm:.15,l=i?Jm:"horizontal"===s?.15:Jm;return Math.abs(n)>a&&(o.horizontal=n>0?"right":"left"),Math.abs(r)>l&&(o.vertical=r>0?"down":"up"),o.mainAxis=i?"diagonal":s,o}const tb=e=>{e.cancelable&&e.preventDefault()};class nb extends qm{state={lastPosition:null};constructor(e){super(e),this.threshold=e.threshold||0}clone(e){return new nb(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}init(e,t,n,r){super.init(e,t,n,r),this.element.addEventListener("pointerenter",this.handleElementEnter),this.element.addEventListener("pointerleave",this.handleElementLeave)}destroy(){this.element.removeEventListener("pointerenter",this.handleElementEnter),this.element.removeEventListener("pointerleave",this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e)}resetState(){this.isActive=!1,this.state={lastPosition:null}}handleElementEnter=e=>{if("mouse"!==e.pointerType&&"pen"!==e.pointerType)return;const t=this.pointerManager.getPointers()||new Map,n=Array.from(t.values());if(this.isWithinPointerCount(n,e.pointerType)){this.isActive=!0;const t={x:e.clientX,y:e.clientY};this.state.lastPosition=t,this.emitMoveEvent(this.element,"start",n,e),this.emitMoveEvent(this.element,"ongoing",n,e)}};handleElementLeave=e=>{if("mouse"!==e.pointerType&&"pen"!==e.pointerType)return;if(!this.isActive)return;const t=this.pointerManager.getPointers()||new Map,n=Array.from(t.values());this.emitMoveEvent(this.element,"end",n,e),this.resetState()};handlePointerEvent=(e,t)=>{if("pointermove"!==t.type||"mouse"!==t.pointerType&&"pen"!==t.pointerType)return;this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation();const n=Array.from(e.values()),r=this.getTargetElement(t);if(!r)return;if(!this.isWithinPointerCount(n,t.pointerType))return;if(this.shouldPreventGesture(r,t.pointerType)){if(!this.isActive)return;return this.resetState(),void this.emitMoveEvent(r,"end",n,t)}const o={x:t.clientX,y:t.clientY};this.state.lastPosition=o,this.isActive||(this.isActive=!0,this.emitMoveEvent(r,"start",n,t)),this.emitMoveEvent(r,"ongoing",n,t)};emitMoveEvent(e,t,n,r){const o=this.state.lastPosition||Qm(n),i=this.gesturesRegistry.getActiveGestures(e),s={gestureName:this.name,centroid:o,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,activeGestures:i,customData:this.customData},a=Zm(this.name,t),l=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:s});e.dispatchEvent(l)}}class rb extends qm{state=(()=>({startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null}))();constructor(e){super(e),this.direction=e.direction||["up","down","left","right"],this.threshold=e.threshold||0}clone(e){return new rb(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}destroy(){this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e),this.direction=e.direction||this.direction,this.threshold=e.threshold??this.threshold}resetState(){this.isActive=!1,this.state=a({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}handlePointerEvent=(e,t)=>{const n=Array.from(e.values());if("forceCancel"===t.type)return void this.cancel(t.target,n,t);const r=this.getTargetElement(t);if(!r)return;if(this.shouldPreventGesture(r,t.pointerType))return void this.cancel(r,n,t);const o=this.getRelevantPointers(n,r);if(this.isWithinPointerCount(o,t.pointerType))switch(t.type){case"pointerdown":this.isActive||this.state.startCentroid||(o.forEach(e=>{this.state.startPointers.set(e.pointerId,e)}),this.originalTarget=r,this.state.startCentroid=Qm(o),this.state.lastCentroid=a({},this.state.startCentroid));break;case"pointermove":if(this.state.startCentroid&&this.isWithinPointerCount(n,t.pointerType)){const e=Qm(o),n=e.x-this.state.startCentroid.x,i=e.y-this.state.startCentroid.y,s=Math.sqrt(n*n+i*i),a=eb(this.state.lastCentroid??this.state.startCentroid,e),l=this.state.lastCentroid?e.x-this.state.lastCentroid.x:0,u=this.state.lastCentroid?e.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&s>=this.threshold&&function(e,t){if(!e.vertical&&!e.horizontal)return!1;if(0===t.length)return!0;const n=null===e.vertical||t.includes(e.vertical),r=null===e.horizontal||t.includes(e.horizontal);return n&&r}(a,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:l,y:u},this.state.totalDeltaX+=l,this.state.totalDeltaY+=u,this.state.activeDeltaX+=l,this.state.activeDeltaY+=u,this.emitPanEvent(r,"start",o,t,e),this.emitPanEvent(r,"ongoing",o,t,e)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:l,y:u},this.state.totalDeltaX+=l,this.state.totalDeltaY+=u,this.state.activeDeltaX+=l,this.state.activeDeltaY+=u,this.emitPanEvent(r,"ongoing",o,t,e)),this.state.lastCentroid=e,this.state.lastDirection=a}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive&&this.state.movementThresholdReached){const e=o.filter(e=>"pointerup"!==e.type&&"pointercancel"!==e.type);if(!this.isWithinPointerCount(e,t.pointerType)){const e=this.state.lastCentroid||this.state.startCentroid;"pointercancel"===t.type&&this.emitPanEvent(r,"cancel",o,t,e),this.emitPanEvent(r,"end",o,t,e),this.resetState()}}else this.resetState()}else this.cancel(r,o,t)};emitPanEvent(e,t,n,r,o){if(!this.state.startCentroid)return;const i=this.state.lastDeltas?.x??0,s=this.state.lastDeltas?.y??0,a=this.state.startPointers.values().next().value,l=a?(r.timeStamp-a.timeStamp)/1e3:0,u=l>0?i/l:0,c=l>0?s/l:0,d=Math.sqrt(u*u+c*c),p=this.gesturesRegistry.getActiveGestures(e),h={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:o,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,deltaX:i,deltaY:s,direction:this.state.lastDirection,velocityX:u,velocityY:c,velocity:d,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:p,customData:this.customData},f=Zm(this.name,t),g=new CustomEvent(f,{bubbles:!0,cancelable:!0,composed:!0,detail:h});e.dispatchEvent(g),this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation()}cancel(e,t,n){if(this.isActive){const r=e??this.element;this.emitPanEvent(r,"cancel",t,n,this.state.lastCentroid),this.emitPanEvent(r,"end",t,n,this.state.lastCentroid)}this.resetState()}}class ob extends qm{state={startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0};constructor(e){super(a({},e,{minPointers:e.minPointers??2})),this.threshold=e.threshold??0}clone(e){return new ob(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}destroy(){this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e)}resetState(){this.isActive=!1,this.state=a({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}handlePointerEvent=(e,t)=>{const n=Array.from(e.values()),r=this.getTargetElement(t);if(!r)return;if(this.shouldPreventGesture(r,t.pointerType))return void(this.isActive&&(this.emitPinchEvent(r,"cancel",n,t),this.resetState()));const o=this.getRelevantPointers(n,r);switch(t.type){case"pointerdown":if(o.length>=2&&!this.isActive){const e=Ym(o);this.state.startDistance=e,this.state.lastDistance=e,this.state.lastTime=t.timeStamp,this.originalTarget=r}break;case"pointermove":if(this.state.startDistance&&this.isWithinPointerCount(o,t.pointerType)){const e=Ym(o),n=Math.abs(e-this.state.lastDistance);if(0!==n&&n>=this.threshold){const n=this.state.startDistance?e/this.state.startDistance:1,i=n/this.state.lastScale;this.state.totalScale*=i;const s=(t.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){const t=(e-this.state.lastDistance)/s;this.state.velocity=Number.isNaN(t)?0:t}this.state.lastDistance=e,this.state.deltaScale=n-this.state.lastScale,this.state.lastScale=n,this.state.lastTime=t.timeStamp,this.isActive||(this.isActive=!0,this.emitPinchEvent(r,"start",o,t)),this.emitPinchEvent(r,"ongoing",o,t)}}break;case"pointerup":case"pointercancel":case"forceCancel":if(this.isActive){const e=o.filter(e=>"pointerup"!==e.type&&"pointercancel"!==e.type);if(this.isWithinPointerCount(e,t.pointerType)){if(e.length>=2){const t=Ym(e);this.state.startDistance=t/this.state.lastScale}}else"pointercancel"===t.type&&this.emitPinchEvent(r,"cancel",o,t),this.emitPinchEvent(r,"end",o,t),this.resetState()}}};emitPinchEvent(e,t,n,r){const o=Qm(n),i=this.state.lastDistance,s=this.state.lastScale,a=this.gesturesRegistry.getActiveGestures(e),l={gestureName:this.name,centroid:o,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,scale:s,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:i,velocity:this.state.velocity,activeGestures:a,direction:(u=this.state.velocity,u>0?1:u<-0?-1:0),customData:this.customData};var u;this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();const c=Zm(this.name,t),d=new CustomEvent(c,{bubbles:!0,cancelable:!0,composed:!0,detail:l});e.dispatchEvent(d)}}class ib extends qm{state={startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1};constructor(e){super(e),this.duration=e.duration??500,this.maxDistance=e.maxDistance??10}clone(e){return new ib(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e),this.duration=e.duration??this.duration,this.maxDistance=e.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=a({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){null!==this.state.timerId&&(clearTimeout(this.state.timerId),this.state.timerId=null)}handlePointerEvent=(e,t)=>{const n=Array.from(e.values());if("forceCancel"===t.type)return void this.cancelPress(t.target,n,t);const r=this.getTargetElement(t);if(!r)return;if(this.shouldPreventGesture(r,t.pointerType))return void(this.isActive&&this.cancelPress(r,n,t));const o=this.getRelevantPointers(n,r);if(this.isWithinPointerCount(o,t.pointerType))switch(t.type){case"pointerdown":this.isActive||this.state.startCentroid||(this.state.startCentroid=Qm(o),this.state.lastPosition=a({},this.state.startCentroid),this.state.startTime=t.timeStamp,this.isActive=!0,this.originalTarget=r,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;const e=this.state.lastPosition;this.emitPressEvent(r,"start",o,t,e),this.emitPressEvent(r,"ongoing",o,t,e)}},this.duration));break;case"pointermove":if(this.isActive&&this.state.startCentroid){const e=Qm(o);this.state.lastPosition=e;const n=e.x-this.state.startCentroid.x,i=e.y-this.state.startCentroid.y;Math.sqrt(n*n+i*i)>this.maxDistance&&this.cancelPress(r,o,t)}break;case"pointerup":if(this.isActive){if(this.state.pressThresholdReached){const e=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(r,"end",o,t,e)}this.resetState()}break;case"pointercancel":case"forceCancel":this.cancelPress(r,o,t)}else this.isActive&&this.cancelPress(r,o,t)};emitPressEvent(e,t,n,r,o){const i=this.gesturesRegistry.getActiveGestures(e),s=r.timeStamp-this.state.startTime,a={gestureName:this.name,centroid:o,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,x:o.x,y:o.y,duration:s,activeGestures:i,customData:this.customData},l=Zm(this.name,t),u=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:a});e.dispatchEvent(u),this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation()}cancelPress(e,t,n){if(this.isActive&&this.state.pressThresholdReached){const r=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(e??this.element,"cancel",t,n,r),this.emitPressEvent(e??this.element,"end",t,n,r)}this.resetState()}}class sb extends qm{state={phase:"waitingForPress",dragTimeoutId:null};constructor(e){super(e),this.pressDuration=e.pressDuration??500,this.pressMaxDistance=e.pressMaxDistance??10,this.dragTimeout=e.dragTimeout??1e3,this.dragThreshold=e.dragThreshold??0,this.dragDirection=e.dragDirection||["up","down","left","right"],this.pressGesture=new ib({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new rb({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(e){return new sb(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}init(e,t,n,r){super.init(e,t,n,r),this.pressGesture.init(e,t,n,r),this.panGesture.init(e,t,n,r),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(e){super.updateOptions(e),this.pressDuration=e.pressDuration??this.pressDuration,this.pressMaxDistance=e.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=e.dragTimeout??this.dragTimeout,this.dragThreshold=e.dragThreshold??this.dragThreshold,this.dragDirection=e.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){null!==this.state.dragTimeoutId&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForPress",dragTimeoutId:null}}handlePointerEvent(){}pressHandler=()=>{"waitingForPress"===this.state.phase&&(this.state.phase="pressDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=e=>{"pressDetected"===this.state.phase&&(null!==this.state.dragTimeoutId&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Zm(this.name,e.detail.phase),e)))};dragMoveHandler=e=>{"dragging"===this.state.phase&&this.element.dispatchEvent(new CustomEvent(Zm(this.name,e.detail.phase),e))};dragEndHandler=e=>{"dragging"===this.state.phase&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Zm(this.name,e.detail.phase),e)))};setTouchAction(){this.element.addEventListener("touchstart",tb,{passive:!1}),this.element.addEventListener("touchmove",tb,{passive:!1}),this.element.addEventListener("touchend",tb,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",tb),this.element.removeEventListener("touchmove",tb),this.element.removeEventListener("touchend",tb)}}class ab extends qm{state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null};constructor(e){super(e),this.maxDistance=e.maxDistance??10,this.taps=e.taps??1}clone(e){return new ab(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}destroy(){this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e),this.maxDistance=e.maxDistance??this.maxDistance,this.taps=e.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}handlePointerEvent=(e,t)=>{const n=Array.from(e.values()),r=this.getTargetElement(t);if(!r)return;const o=this.getRelevantPointers(n,r);if(!this.shouldPreventGesture(r,t.pointerType)&&this.isWithinPointerCount(o,t.pointerType))switch(t.type){case"pointerdown":this.isActive||(this.state.startCentroid=Qm(o),this.state.lastPosition=a({},this.state.startCentroid),this.isActive=!0,this.originalTarget=r);break;case"pointermove":if(this.isActive&&this.state.startCentroid){const e=Qm(o);this.state.lastPosition=e;const n=e.x-this.state.startCentroid.x,i=e.y-this.state.startCentroid.y;Math.sqrt(n*n+i*i)>this.maxDistance&&this.cancelTap(r,o,t)}break;case"pointerup":if(this.isActive){this.state.currentTapCount+=1;const e=this.state.lastPosition||this.state.startCentroid;if(!e)return void this.cancelTap(r,o,t);this.state.currentTapCount>=this.taps?(this.fireTapEvent(r,o,t,e),this.resetState()):(this.state.lastTapTime=t.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case"pointercancel":case"forceCancel":this.cancelTap(r,o,t)}else this.isActive&&this.cancelTap(r,o,t)};fireTapEvent(e,t,n,r){const o=this.gesturesRegistry.getActiveGestures(e),i={gestureName:this.name,centroid:r,target:n.target,srcEvent:n,phase:"end",pointers:t,timeStamp:n.timeStamp,x:r.x,y:r.y,tapCount:this.state.currentTapCount,activeGestures:o,customData:this.customData},s=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:i});e.dispatchEvent(s),this.preventDefault&&n.preventDefault(),this.stopPropagation&&n.stopPropagation()}cancelTap(e,t,n){if(this.state.startCentroid||this.state.lastPosition){const r=this.state.lastPosition||this.state.startCentroid,o=this.gesturesRegistry.getActiveGestures(e),i={gestureName:this.name,centroid:r,target:n.target,srcEvent:n,phase:"cancel",pointers:t,timeStamp:n.timeStamp,x:r.x,y:r.y,tapCount:this.state.currentTapCount,activeGestures:o,customData:this.customData},s=Zm(this.name,"cancel"),a=new CustomEvent(s,{bubbles:!0,cancelable:!0,composed:!0,detail:i});e.dispatchEvent(a)}this.resetState()}}class lb extends qm{state={phase:"waitingForTap",dragTimeoutId:null};constructor(e){super(e),this.tapMaxDistance=e.tapMaxDistance??10,this.dragTimeout=e.dragTimeout??1e3,this.dragThreshold=e.dragThreshold??0,this.dragDirection=e.dragDirection||["up","down","left","right"],this.tapGesture=new ab({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new rb({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(e){return new lb(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},e))}init(e,t,n,r){super.init(e,t,n,r),this.tapGesture.init(e,t,n,r),this.panGesture.init(e,t,n,r),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(e){super.updateOptions(e),this.tapMaxDistance=e.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=e.dragTimeout??this.dragTimeout,this.dragThreshold=e.dragThreshold??this.dragThreshold,this.dragDirection=e.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){null!==this.state.dragTimeoutId&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:"waitingForTap",dragTimeoutId:null}}handlePointerEvent(){}tapHandler=()=>{"waitingForTap"===this.state.phase&&(this.state.phase="tapDetected",this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=e=>{"tapDetected"===this.state.phase&&(null!==this.state.dragTimeoutId&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase="dragging",this.isActive=!0,this.element.dispatchEvent(new CustomEvent(Zm(this.name,e.detail.phase),e)))};dragMoveHandler=e=>{"dragging"===this.state.phase&&this.element.dispatchEvent(new CustomEvent(Zm(this.name,e.detail.phase),e))};dragEndHandler=e=>{"dragging"===this.state.phase&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(Zm(this.name,e.detail.phase),e)))};setTouchAction(){this.element.addEventListener("touchstart",tb,{passive:!1})}restoreTouchAction(){this.element.removeEventListener("touchstart",tb)}}class ub extends Vm{state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0};constructor(e){super(e),this.sensitivity=e.sensitivity??1,this.max=e.max??Number.MAX_SAFE_INTEGER,this.min=e.min??Number.MIN_SAFE_INTEGER,this.initialDelta=e.initialDelta??0,this.invert=e.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(e){return new ub(a({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},e))}init(e,t,n,r){super.init(e,t,n,r),this.element.addEventListener("wheel",this.handleWheelEvent)}destroy(){this.element.removeEventListener("wheel",this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(e){super.updateOptions(e),this.sensitivity=e.sensitivity??this.sensitivity,this.max=e.max??this.max,this.min=e.min??this.min,this.initialDelta=e.initialDelta??this.initialDelta,this.invert=e.invert??this.invert}handleWheelEvent=e=>{if(this.shouldPreventGesture(this.element,"mouse"))return;const t=this.pointerManager.getPointers()||new Map,n=Array.from(t.values());this.state.totalDeltaX+=e.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=e.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=e.deltaZ*this.sensitivity*(this.invert?-1:1),["totalDeltaX","totalDeltaY","totalDeltaZ"].forEach(e=>{this.state[e]<this.min&&(this.state[e]=this.min),this.state[e]>this.max&&(this.state[e]=this.max)}),this.emitWheelEvent(n,e)};emitWheelEvent(e,t){const n=e.length>0?Qm(e):{x:t.clientX,y:t.clientY},r=this.gesturesRegistry.getActiveGestures(this.element),o={gestureName:this.name,centroid:n,target:t.target,srcEvent:t,phase:"ongoing",pointers:e,timeStamp:t.timeStamp,deltaX:t.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:t.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:t.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:t.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:r,customData:this.customData};this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation();const i=Zm(this.name,"ongoing"),s=new CustomEvent(i,{bubbles:!0,cancelable:!0,composed:!0,detail:o});this.element.dispatchEvent(s)}}const cb=e=>e.preventDefault(),db=({svgRef:t})=>{const n=e.useRef(null);e.useEffect(()=>{const e=t.current;n.current||(n.current=new Km({gestures:[new rb({name:"pan",threshold:0,maxPointers:1}),new nb({name:"move",preventIf:["pan","zoomPinch","zoomPan"]}),new ab({name:"tap",preventIf:["pan","zoomPinch","zoomPan"]}),new ib({name:"quickPress",duration:50}),new rb({name:"brush",threshold:0,maxPointers:1}),new rb({name:"zoomPan",threshold:0,preventIf:["zoomTapAndDrag","zoomPressAndDrag"]}),new ob({name:"zoomPinch",threshold:5}),new ub({name:"zoomTurnWheel",sensitivity:.01,initialDelta:1}),new ub({name:"panTurnWheel",sensitivity:.5}),new lb({name:"zoomTapAndDrag",dragThreshold:10}),new sb({name:"zoomPressAndDrag",dragThreshold:10,preventIf:["zoomPinch"]}),new ab({name:"zoomDoubleTapReset",taps:2})]}));const r=n.current;if(e&&r)return r.registerElement(["pan","move","zoomPinch","zoomPan","zoomTurnWheel","panTurnWheel","tap","quickPress","zoomTapAndDrag","zoomPressAndDrag","zoomDoubleTapReset","brush"],e),()=>{r.unregisterAllGestures(e)}},[t,n]);const r=e.useCallback((e,n,r)=>{const o=t.current;return o?.addEventListener(e,n,r),{cleanup:()=>o?.removeEventListener(e,n)}},[t]),o=e.useCallback((e,r)=>{const o=t.current,i=n.current;i&&o&&i.setGestureOptions(e,o,r??{})},[t,n]);return e.useEffect(()=>{const e=t.current;return e?.addEventListener("gesturestart",cb),e?.addEventListener("gesturechange",cb),e?.addEventListener("gestureend",cb),()=>{e?.removeEventListener("gesturestart",cb),e?.removeEventListener("gesturechange",cb),e?.removeEventListener("gestureend",cb)}},[t]),{instance:{addInteractionListener:r,updateZoomInteractionListeners:o}}};db.params={},db.getInitialState=()=>({});const pb=[Em,Im,Rm,Hm,db,am],hb=["apiRef"];let fb=0;function gb(t,n,r){const o=x(),i=e.useMemo(()=>[...pb,...t],[t]),a=(e=>{let{plugins:t}=e,n=s(e.props,hb);const r={};t.forEach(e=>{Object.assign(r,e.params)});const o={};return Object.keys(n).forEach(e=>{const t=n[e];r[e]&&(o[e]=t)}),t.reduce((e,t)=>t.getDefaultizedParams?t.getDefaultizedParams({params:e}):e,o)})({plugins:i,props:n});a.id=a.id??o;const l=e.useRef({}).current,u=function(t){const n=e.useRef({});if(t)return function(e){null==e.current&&(e.current={});return e}(t);return n}(n.apiRef),c=e.useRef(null),d=e.useRef(null),p=e.useRef(null);if(null==p.current){fb+=1;const e={cacheKey:{id:fb}};i.forEach(t=>{t.getInitialState&&Object.assign(e,t.getInitialState(a,e,r))}),p.current=new Un(e)}i.forEach(e=>{const t=e({instance:l,params:a,plugins:i,store:p.current,svgRef:d,chartRootRef:c,seriesConfig:r});t.publicAPI&&Object.assign(u.current,t.publicAPI),t.instance&&Object.assign(l,t.instance)});return{contextValue:e.useMemo(()=>({store:p.current,publicAPI:u.current,instance:l,svgRef:d,chartRootRef:c}),[l,u])}}const mb=e.createContext(null),bb={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:"keep",reverse:!1,slider:{enabled:!1,preview:!1,size:28,showTooltip:"hover"}},vb=(e,t,n,r)=>{if(e)return!0===e?a({axisId:t,axisDirection:n},bb,{reverse:r??!1}):a({axisId:t,axisDirection:n},bb,{reverse:r??!1},e,{slider:a({},bb.slider,{size:e.slider?.preview??bb.slider.preview?48:28},e.slider)})};function wb(e,t){const n={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:"DEFAULT_X_AXIS_KEY",scaleType:"linear"}]).map((e,r)=>{const o=e.dataKey,i=0===r?"bottom":"none",s=e.position??i,l=25+(e.label?20:0),u=e.id??`defaultized-x-axis-${r}`,c=a({offset:n[s]},e,{id:u,position:s,height:e.height??l,zoom:vb(e.zoom,u,"x",e.reverse)});if("none"!==s&&(n[s]+=c.height,c.zoom?.slider.enabled&&(n[s]+=c.zoom.slider.size)),void 0===o||void 0!==e.data)return c;if(void 0===t)throw new Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return a({},c,{data:t.map(e=>e[o])})})}function yb(e,t){const n={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:"DEFAULT_Y_AXIS_KEY",scaleType:"linear"}]).map((e,r)=>{const o=e.dataKey,i=0===r?"left":"none",s=e.position??i,l=45+(e.label?20:0),u=e.id??`defaultized-y-axis-${r}`,c=a({offset:n[s]},e,{id:u,position:s,width:e.width??l,zoom:vb(e.zoom,u,"y",e.reverse)});if("none"!==s&&(n[s]+=c.width,c.zoom?.slider.enabled&&(n[s]+=c.zoom.slider.size)),void 0===o||void 0!==e.data)return c;if(void 0===t)throw new Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return a({},c,{data:t.map(e=>e[o])})})}function xb(e,t){return function(n,r){if("tick"===r.location){const t=r.scale.domain();return t[0]===t[1]?r.scale.tickFormat(1)(n):r.scale.tickFormat(e)(n)}return"zoom-slider-tooltip"===r.location?t.tickFormat(2)(n):`${n}`}}function Cb(e){return"band"===e.scaleType}function Sb(e){return"point"===e.scaleType}function Mb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Rb(e){let t=e,n=e;function r(e,t,r,o){for(null==r&&(r=0),null==o&&(o=e.length);r<o;){const i=r+o>>>1;n(e[i],t)<0?r=i+1:o=i}return r}return 1===e.length&&(t=(t,n)=>e(t)-n,n=function(e){return(t,n)=>Mb(e(t),n)}(e)),{left:r,center:function(e,n,o,i){null==o&&(o=0),null==i&&(i=e.length);const s=r(e,n,o,i-1);return s>o&&t(e[s-1],n)>-t(e[s],n)?s-1:s},right:function(e,t,r,o){for(null==r&&(r=0),null==o&&(o=e.length);r<o;){const i=r+o>>>1;n(e[i],t)>0?o=i:r=i+1}return r}}}function Ib(e){return null===e?NaN:+e}const Pb=Rb(Mb).right;Rb(Ib).center;class kb extends Map{constructor(e,t=Tb){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(Eb(this,e))}has(e){return super.has(Eb(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(n),e.delete(r));return n}(this,e))}}function Eb({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Tb(e){return null!==e&&"object"==typeof e?e.valueOf():e}var Db=Math.sqrt(50),Fb=Math.sqrt(10),Ab=Math.sqrt(2);function Ob(e,t,n){var r,o,i,s,a=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(s=Hb(e,t,n))||!isFinite(s))return[];if(s>0){let n=Math.round(e/s),r=Math.round(t/s);for(n*s<e&&++n,r*s>t&&--r,i=new Array(o=r-n+1);++a<o;)i[a]=(n+a)*s}else{s=-s;let n=Math.round(e*s),r=Math.round(t*s);for(n/s<e&&++n,r/s>t&&--r,i=new Array(o=r-n+1);++a<o;)i[a]=(n+a)/s}return r&&i.reverse(),i}function Hb(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=Db?10:i>=Fb?5:i>=Ab?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=Db?10:i>=Fb?5:i>=Ab?2:1)}function $b(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=Db?o*=10:i>=Fb?o*=5:i>=Ab&&(o*=2),t<e?-o:o}function zb(e,t){let n;for(const r of e)null!=r&&(n<r||void 0===n&&r>=r)&&(n=r);return n}function Lb(e,t){let n;for(const r of e)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);return n}function jb(e,t,n=0,r=e.length-1,o=Mb){for(;r>n;){if(r-n>600){const i=r-n+1,s=t-n+1,a=Math.log(i),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(i-l)/i)*(s-i/2<0?-1:1);jb(e,t,Math.max(n,Math.floor(t-s*l/i+u)),Math.min(r,Math.floor(t+(i-s)*l/i+u)),o)}const i=e[t];let s=n,a=r;for(Nb(e,n,t),o(e[r],i)>0&&Nb(e,n,r);s<a;){for(Nb(e,s,a),++s,--a;o(e[s],i)<0;)++s;for(;o(e[a],i)>0;)--a}0===o(e[n],i)?Nb(e,n,a):(++a,Nb(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Nb(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Gb(e,t,n){if(r=(e=Float64Array.from(function*(e){for(let t of e)null!=t&&(t=+t)>=t&&(yield t)}(e))).length){if((t=+t)<=0||r<2)return Lb(e);if(t>=1)return zb(e);var r,o=(r-1)*t,i=Math.floor(o),s=zb(jb(e,i).subarray(0,i+1));return s+(Lb(e.subarray(i+1))-s)*(o-i)}}function _b(e,t,n=Ib){if(r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),s=+n(e[i],i,e);return s+(+n(e[i+1],i+1,e)-s)*(o-i)}}function Vb(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),i=new Array(o);++r<o;)i[r]=e+r*n;return i}function Bb(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Wb(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const Ub=Symbol("implicit");function Kb(){var e=new kb,t=[],n=[],r=Ub;function o(o){let i=e.get(o);if(void 0===i){if(r!==Ub)return r;e.set(o,i=t.push(o)-1)}return n[i%n.length]}return o.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new kb;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return o},o.range=function(e){return arguments.length?(n=Array.from(e),o):n.slice()},o.unknown=function(e){return arguments.length?(r=e,o):r},o.copy=function(){return Kb(t,n).unknown(r)},Bb.apply(o,arguments),o}function qb(){var e,t,n=Kb().unknown(void 0),r=n.domain,o=n.range,i=0,s=1,a=!1,l=0,u=0,c=.5;function d(){var n=r().length,d=s<i,p=d?s:i,h=d?i:s;e=(h-p)/Math.max(1,n-l+2*u),a&&(e=Math.floor(e)),p+=(h-p-e*(n-l))*c,t=e*(1-l),a&&(p=Math.round(p),t=Math.round(t));var f=Vb(n).map(function(t){return p+e*t});return o(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([i,s]=e,i=+i,s=+s,d()):[i,s]},n.rangeRound=function(e){return[i,s]=e,i=+i,s=+s,a=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,d()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,u=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(u=+e,d()):u},n.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),d()):c},n.copy=function(){return qb(r(),[i,s]).round(a).paddingInner(l).paddingOuter(u).align(c)},Bb.apply(d(),arguments)}function Xb(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Xb(t())},e}function Yb(){return Xb(qb.apply(null,arguments).paddingInner(1))}function Qb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Zb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jb(){}var ev=.7,tv=1/ev,nv="\\s*([+-]?\\d+)\\s*",rv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ov="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iv=/^#([0-9a-f]{3,8})$/,sv=new RegExp(`^rgb\\(${nv},${nv},${nv}\\)$`),av=new RegExp(`^rgb\\(${ov},${ov},${ov}\\)$`),lv=new RegExp(`^rgba\\(${nv},${nv},${nv},${rv}\\)$`),uv=new RegExp(`^rgba\\(${ov},${ov},${ov},${rv}\\)$`),cv=new RegExp(`^hsl\\(${rv},${ov},${ov}\\)$`),dv=new RegExp(`^hsla\\(${rv},${ov},${ov},${rv}\\)$`),pv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function hv(){return this.rgb().formatHex()}function fv(){return this.rgb().formatRgb()}function gv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?mv(t):3===n?new wv(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?bv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?bv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=sv.exec(e))?new wv(t[1],t[2],t[3],1):(t=av.exec(e))?new wv(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=lv.exec(e))?bv(t[1],t[2],t[3],t[4]):(t=uv.exec(e))?bv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=cv.exec(e))?Rv(t[1],t[2]/100,t[3]/100,1):(t=dv.exec(e))?Rv(t[1],t[2]/100,t[3]/100,t[4]):pv.hasOwnProperty(e)?mv(pv[e]):"transparent"===e?new wv(NaN,NaN,NaN,0):null}function mv(e){return new wv(e>>16&255,e>>8&255,255&e,1)}function bv(e,t,n,r){return r<=0&&(e=t=n=NaN),new wv(e,t,n,r)}function vv(e,t,n,r){return 1===arguments.length?((o=e)instanceof Jb||(o=gv(o)),o?new wv((o=o.rgb()).r,o.g,o.b,o.opacity):new wv):new wv(e,t,n,null==r?1:r);var o}function wv(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function yv(){return`#${Mv(this.r)}${Mv(this.g)}${Mv(this.b)}`}function xv(){const e=Cv(this.opacity);return`${1===e?"rgb(":"rgba("}${Sv(this.r)}, ${Sv(this.g)}, ${Sv(this.b)}${1===e?")":`, ${e})`}`}function Cv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mv(e){return((e=Sv(e))<16?"0":"")+e.toString(16)}function Rv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pv(e,t,n,r)}function Iv(e){if(e instanceof Pv)return new Pv(e.h,e.s,e.l,e.opacity);if(e instanceof Jb||(e=gv(e)),!e)return new Pv;if(e instanceof Pv)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(s=t===i?(n-r)/a+6*(n<r):n===i?(r-t)/a+2:(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new Pv(s,a,l,e.opacity)}function Pv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function kv(e){return(e=(e||0)%360)<0?e+360:e}function Ev(e){return Math.max(0,Math.min(1,e||0))}function Tv(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Qb(Jb,gv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hv,formatHex:hv,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Iv(this).formatHsl()},formatRgb:fv,toString:fv}),Qb(wv,vv,Zb(Jb,{brighter(e){return e=null==e?tv:Math.pow(tv,e),new wv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?ev:Math.pow(ev,e),new wv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wv(Sv(this.r),Sv(this.g),Sv(this.b),Cv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yv,formatHex:yv,formatHex8:function(){return`#${Mv(this.r)}${Mv(this.g)}${Mv(this.b)}${Mv(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:xv,toString:xv})),Qb(Pv,function(e,t,n,r){return 1===arguments.length?Iv(e):new Pv(e,t,n,null==r?1:r)},Zb(Jb,{brighter(e){return e=null==e?tv:Math.pow(tv,e),new Pv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?ev:Math.pow(ev,e),new Pv(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new wv(Tv(e>=240?e-240:e+120,o,r),Tv(e,o,r),Tv(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Pv(kv(this.h),Ev(this.s),Ev(this.l),Cv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Cv(this.opacity);return`${1===e?"hsl(":"hsla("}${kv(this.h)}, ${100*Ev(this.s)}%, ${100*Ev(this.l)}%${1===e?")":`, ${e})`}`}}));const Dv=e=>()=>e;function Fv(e){return 1===(e=+e)?Av:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Dv(isNaN(t)?n:t)}}function Av(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Dv(isNaN(e)?t:e)}const Ov=function e(t){var n=Fv(t);function r(e,t){var r=n((e=vv(e)).r,(t=vv(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),s=Av(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function Hv(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}}function $v(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=new Array(o),s=new Array(r);for(n=0;n<o;++n)i[n]=Vv(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<o;++n)s[n]=i[n](e);return s}}function zv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Lv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function jv(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Vv(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}var Nv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gv=new RegExp(Nv.source,"g");function _v(e,t){var n,r,o,i=Nv.lastIndex=Gv.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=Nv.exec(e))&&(r=Gv.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Lv(n,r)})),i=Gv.lastIndex;return i<t.length&&(o=t.slice(i),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}function Vv(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?Dv(t):("number"===o?Lv:"string"===o?(n=gv(t))?(t=n,Ov):_v:t instanceof gv?Ov:t instanceof Date?zv:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?$v:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?jv:Lv:Hv))(e,t)}function Bv(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Wv(e){return+e}var Uv=[0,1];function Kv(e){return e}function qv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function Xv(e,t,n){var r=e[0],o=e[1],i=t[0],s=t[1];return o<r?(r=qv(o,r),i=n(s,i)):(r=qv(r,o),i=n(i,s)),function(e){return i(r(e))}}function Yv(e,t,n){var r=Math.min(e.length,t.length)-1,o=new Array(r),i=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)o[s]=qv(e[s],e[s+1]),i[s]=n(t[s],t[s+1]);return function(t){var n=Pb(e,t,1,r)-1;return i[n](o[n](t))}}function Qv(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Zv(){var e,t,n,r,o,i,s=Uv,a=Uv,l=Vv,u=Kv;function c(){var e,t,n,l=Math.min(s.length,a.length);return u!==Kv&&(e=s[0],t=s[l-1],e>t&&(n=e,e=t,t=n),u=function(n){return Math.max(e,Math.min(t,n))}),r=l>2?Yv:Xv,o=i=null,d}function d(t){return null==t||isNaN(t=+t)?n:(o||(o=r(s.map(e),a,l)))(e(u(t)))}return d.invert=function(n){return u(t((i||(i=r(a,s.map(e),Lv)))(n)))},d.domain=function(e){return arguments.length?(s=Array.from(e,Wv),c()):s.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),c()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=Bv,c()},d.clamp=function(e){return arguments.length?(u=!!e||Kv,c()):u!==Kv},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}function Jv(){return Zv()(Kv,Kv)}function ew(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function tw(e){return(e=ew(Math.abs(e)))?e[1]:NaN}var nw,rw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ow(e){if(!(t=rw.exec(e)))throw new Error("invalid format: "+e);var t;return new iw({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function iw(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function sw(e,t){var n=ew(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}ow.prototype=iw.prototype,iw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const aw={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>sw(100*e,t),r:sw,s:function(e,t){var n=ew(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(nw=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+ew(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lw(e){return e}var uw,cw,dw,pw=Array.prototype.map,hw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fw(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?lw:(t=pw.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,i=[],s=0,a=t[0],l=0;o>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),i.push(e.substring(o-=a,o+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return i.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?lw:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(pw.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=ow(e)).fill,n=e.align,d=e.sign,p=e.symbol,h=e.zero,f=e.width,g=e.comma,m=e.precision,b=e.trim,v=e.type;"n"===v?(g=!0,v="g"):aw[v]||(void 0===m&&(m=12),b=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var w="$"===p?o:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===p?i:/[%p]/.test(v)?l:"",x=aw[v],C=/[defgprs%]/.test(v);function S(e){var o,i,l,p=w,S=y;if("c"===v)S=x(e)+S,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),m),b&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),M&&0===+e&&"+"!==d&&(M=!1),p=(M?"("===d?d:u:"-"===d||"("===d?"":d)+p,S=("s"===v?hw[8+nw/3]:"")+S+(M&&"("===d?")":""),C)for(o=-1,i=e.length;++o<i;)if(48>(l=e.charCodeAt(o))||l>57){S=(46===l?s+e.slice(o+1):e.slice(o))+S,e=e.slice(0,o);break}}g&&!h&&(e=r(e,1/0));var R=p.length+e.length+S.length,I=R<f?new Array(f-R+1).join(t):"";switch(g&&h&&(e=r(I+e,I.length?f-S.length:1/0),I=""),n){case"<":e=p+e+S+I;break;case"=":e=p+I+e+S;break;case"^":e=I.slice(0,R=I.length>>1)+p+e+S+I.slice(R);break;default:e=I+p+e+S}return a(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return e+""},S}return{format:d,formatPrefix:function(e,t){var n=d(((e=ow(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(tw(t)/3))),o=Math.pow(10,-r),i=hw[8+r/3];return function(e){return n(o*e)+i}}}}function gw(e,t,n,r){var o,i=$b(e,t,n);switch((r=ow(null==r?",f":r)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tw(t)/3)))-tw(Math.abs(e)))}(i,s))||(r.precision=o),dw(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,tw(t)-tw(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-tw(Math.abs(e)))}(i))||(r.precision=o-2*("%"===r.type))}return cw(r)}function mw(e){var t=e.domain;return e.ticks=function(e){var n=t();return Ob(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return gw(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,i=t(),s=0,a=i.length-1,l=i[s],u=i[a],c=10;for(u<l&&(o=l,l=u,u=o,o=s,s=a,a=o);c-- >0;){if((o=Hb(l,u,n))===r)return i[s]=l,i[a]=u,t(i);if(o>0)l=Math.floor(l/o)*o,u=Math.ceil(u/o)*o;else{if(!(o<0))break;l=Math.ceil(l*o)/o,u=Math.floor(u*o)/o}r=o}return e},e}function bw(){var e=Jv();return e.copy=function(){return Qv(e,bw())},Bb.apply(e,arguments),mw(e)}function vw(e){var t;function n(e){return null==e||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Wv),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return vw(e).unknown(t)},e=arguments.length?Array.from(e,Wv):[0,1],mw(n)}function ww(e,t){var n,r=0,o=(e=e.slice()).length-1,i=e[r],s=e[o];return s<i&&(n=r,r=o,o=n,n=i,i=s,s=n),e[r]=t.floor(i),e[o]=t.ceil(s),e}function yw(e){return Math.log(e)}function xw(e){return Math.exp(e)}function Cw(e){return-Math.log(-e)}function Sw(e){return-Math.exp(-e)}function Mw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Rw(e){return(t,n)=>-e(-t,n)}function Iw(e){const t=e(yw,xw),n=t.domain;let r,o,i=10;function s(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(i),o=function(e){return 10===e?Mw:e===Math.E?Math.exp:t=>Math.pow(e,t)}(i),n()[0]<0?(r=Rw(r),o=Rw(o),e(Cw,Sw)):e(yw,xw),t}return t.base=function(e){return arguments.length?(i=+e,s()):i},t.domain=function(e){return arguments.length?(n(e),s()):n()},t.ticks=e=>{const t=n();let s=t[0],a=t[t.length-1];const l=a<s;l&&([s,a]=[a,s]);let u,c,d=r(s),p=r(a);const h=null==e?10:+e;let f=[];if(!(i%1)&&p-d<h){if(d=Math.floor(d),p=Math.ceil(p),s>0){for(;d<=p;++d)for(u=1;u<i;++u)if(c=d<0?u/o(-d):u*o(d),!(c<s)){if(c>a)break;f.push(c)}}else for(;d<=p;++d)for(u=i-1;u>=1;--u)if(c=d>0?u/o(-d):u*o(d),!(c<s)){if(c>a)break;f.push(c)}2*f.length<h&&(f=Ob(s,a,h))}else f=Ob(d,p,Math.min(p-d,h)).map(o);return l?f.reverse():f},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===i?"s":","),"function"!=typeof n&&(i%1||null!=(n=ow(n)).precision||(n.trim=!0),n=cw(n)),e===1/0)return n;const s=Math.max(1,i*e/t.ticks().length);return e=>{let t=e/o(Math.round(r(e)));return t*i<i-.5&&(t*=i),t<=s?n(e):""}},t.nice=()=>n(ww(n(),{floor:e=>o(Math.floor(r(e))),ceil:e=>o(Math.ceil(r(e)))})),t}function Pw(){const e=Iw(Zv()).domain([1,10]);return e.copy=()=>Qv(e,Pw()).base(e.base()),Bb.apply(e,arguments),e}function kw(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Ew(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Tw(e){var t=1,n=e(kw(t),Ew(t));return n.constant=function(n){return arguments.length?e(kw(t=+n),Ew(t)):t},mw(n)}function Dw(){var e=Tw(Zv());return e.copy=function(){return Qv(e,Dw()).constant(e.constant())},Bb.apply(e,arguments)}function Fw(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Aw(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Ow(e){return e<0?-e*e:e*e}function Hw(e){var t=e(Kv,Kv),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(Kv,Kv):.5===n?e(Aw,Ow):e(Fw(n),Fw(1/n)):n},mw(t)}function $w(){var e=Hw(Zv());return e.copy=function(){return Qv(e,$w()).exponent(e.exponent())},Bb.apply(e,arguments),e}function zw(){return $w.apply(null,arguments).exponent(.5)}function Lw(e){return Math.sign(e)*e*e}function jw(){var e,t=Jv(),n=[0,1],r=!1;function o(n){var o=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(n));return isNaN(o)?e:r?Math.round(o):o}return o.invert=function(e){return t.invert(Lw(e))},o.domain=function(e){return arguments.length?(t.domain(e),o):t.domain()},o.range=function(e){return arguments.length?(t.range((n=Array.from(e,Wv)).map(Lw)),o):n.slice()},o.rangeRound=function(e){return o.range(e).round(!0)},o.round=function(e){return arguments.length?(r=!!e,o):r},o.clamp=function(e){return arguments.length?(t.clamp(e),o):t.clamp()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return jw(t.domain(),n).round(r).clamp(t.clamp()).unknown(e)},Bb.apply(o,arguments),mw(o)}function Nw(){var e,t=[],n=[],r=[];function o(){var e=0,o=Math.max(1,n.length);for(r=new Array(o-1);++e<o;)r[e-1]=_b(t,e/o);return i}function i(t){return null==t||isNaN(t=+t)?e:n[Pb(r,t)]}return i.invertExtent=function(e){var o=n.indexOf(e);return o<0?[NaN,NaN]:[o>0?r[o-1]:t[0],o<r.length?r[o]:t[t.length-1]]},i.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let n of e)null==n||isNaN(n=+n)||t.push(n);return t.sort(Mb),o()},i.range=function(e){return arguments.length?(n=Array.from(e),o()):n.slice()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.quantiles=function(){return r.slice()},i.copy=function(){return Nw().domain(t).range(n).unknown(e)},Bb.apply(i,arguments)}function Gw(){var e,t=0,n=1,r=1,o=[.5],i=[0,1];function s(t){return null!=t&&t<=t?i[Pb(o,t,0,r)]:e}function a(){var e=-1;for(o=new Array(r);++e<r;)o[e]=((e+1)*n-(e-r)*t)/(r+1);return s}return s.domain=function(e){return arguments.length?([t,n]=e,t=+t,n=+n,a()):[t,n]},s.range=function(e){return arguments.length?(r=(i=Array.from(e)).length-1,a()):i.slice()},s.invertExtent=function(e){var s=i.indexOf(e);return s<0?[NaN,NaN]:s<1?[t,o[0]]:s>=r?[o[r-1],n]:[o[s-1],o[s]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return Gw().domain([t,n]).range(i).unknown(e)},Bb.apply(mw(s),arguments)}function _w(){var e,t=[.5],n=[0,1],r=1;function o(o){return null!=o&&o<=o?n[Pb(t,o,0,r)]:e}return o.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),o):t.slice()},o.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),o):n.slice()},o.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return _w().domain(t).range(n).unknown(e)},Bb.apply(o,arguments)}uw=fw({thousands:",",grouping:[3],currency:["$",""]}),cw=uw.format,dw=uw.formatPrefix;const Vw=new Date,Bw=new Date;function Ww(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,i)=>{const s=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return s;let a;do{s.push(a=new Date(+n)),t(n,i),e(n)}while(a<n&&n<r);return s},o.filter=n=>Ww(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(o.count=(t,r)=>(Vw.setTime(+t),Bw.setTime(+r),e(Vw),e(Bw),Math.floor(n(Vw,Bw))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?t=>r(t)%e===0:t=>o.count(0,t)%e===0):o:null)),o}const Uw=Ww(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Uw.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Ww(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Uw:null),Uw.range;const Kw=1e3,qw=6e4,Xw=36e5,Yw=864e5,Qw=6048e5,Zw=2592e6,Jw=31536e6,ey=Ww(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Kw)},(e,t)=>(t-e)/Kw,e=>e.getUTCSeconds());ey.range;const ty=Ww(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Kw)},(e,t)=>{e.setTime(+e+t*qw)},(e,t)=>(t-e)/qw,e=>e.getMinutes());ty.range;const ny=Ww(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qw)},(e,t)=>(t-e)/qw,e=>e.getUTCMinutes());ny.range;const ry=Ww(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Kw-e.getMinutes()*qw)},(e,t)=>{e.setTime(+e+t*Xw)},(e,t)=>(t-e)/Xw,e=>e.getHours());ry.range;const oy=Ww(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xw)},(e,t)=>(t-e)/Xw,e=>e.getUTCHours());oy.range;const iy=Ww(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qw)/Yw,e=>e.getDate()-1);iy.range;const sy=Ww(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Yw,e=>e.getUTCDate()-1);sy.range;const ay=Ww(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Yw,e=>Math.floor(e/Yw));function ly(e){return Ww(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qw)/Qw)}ay.range;const uy=ly(0),cy=ly(1),dy=ly(2),py=ly(3),hy=ly(4),fy=ly(5),gy=ly(6);function my(e){return Ww(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Qw)}uy.range,cy.range,dy.range,py.range,hy.range,fy.range,gy.range;const by=my(0),vy=my(1),wy=my(2),yy=my(3),xy=my(4),Cy=my(5),Sy=my(6);by.range,vy.range,wy.range,yy.range,xy.range,Cy.range,Sy.range;const My=Ww(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());My.range;const Ry=Ww(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());Ry.range;const Iy=Ww(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Iy.every=e=>isFinite(e=Math.floor(e))&&e>0?Ww(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,Iy.range;const Py=Ww(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function ky(e,t,n,r,o,i){const s=[[ey,1,Kw],[ey,5,5e3],[ey,15,15e3],[ey,30,3e4],[i,1,qw],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,Xw],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,Yw],[r,2,1728e5],[n,1,Qw],[t,1,Zw],[t,3,7776e6],[e,1,Jw]];function a(t,n,r){const o=Math.abs(n-t)/r,i=Rb(([,,e])=>e).right(s,o);if(i===s.length)return e.every($b(t/Jw,n/Jw,r));if(0===i)return Uw.every(Math.max($b(t,n,r),1));const[a,l]=s[o/s[i-1][2]<s[i][2]/o?i-1:i];return a.every(l)}return[function(e,t,n){const r=t<e;r&&([e,t]=[t,e]);const o=n&&"function"==typeof n.range?n:a(e,t,n),i=o?o.range(e,+t+1):[];return r?i.reverse():i},a]}Py.every=e=>isFinite(e=Math.floor(e))&&e>0?Ww(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,Py.range;const[Ey,Ty]=ky(Py,Ry,by,ay,oy,ny),[Dy,Fy]=ky(Iy,My,uy,iy,ry,ty);function Ay(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Oy(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Hy(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var $y,zy,Ly,jy={"-":"",_:" ",0:"0"},Ny=/^\s*\d+/,Gy=/^%/,_y=/[\\^$*+?|[\]().{}]/g;function Vy(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(t)+o:o)}function By(e){return e.replace(_y,"\\$&")}function Wy(e){return new RegExp("^(?:"+e.map(By).join("|")+")","i")}function Uy(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Ky(e,t,n){var r=Ny.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function qy(e,t,n){var r=Ny.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Xy(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Yy(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Qy(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Zy(e,t,n){var r=Ny.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Jy(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ex(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function tx(e,t,n){var r=Ny.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function nx(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function rx(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ox(e,t,n){var r=Ny.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ix(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function sx(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ax(e,t,n){var r=Ny.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function lx(e,t,n){var r=Ny.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ux(e,t,n){var r=Ny.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function cx(e,t,n){var r=Gy.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dx(e,t,n){var r=Ny.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function px(e,t,n){var r=Ny.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hx(e,t){return Vy(e.getDate(),t,2)}function fx(e,t){return Vy(e.getHours(),t,2)}function gx(e,t){return Vy(e.getHours()%12||12,t,2)}function mx(e,t){return Vy(1+iy.count(Iy(e),e),t,3)}function bx(e,t){return Vy(e.getMilliseconds(),t,3)}function vx(e,t){return bx(e,t)+"000"}function wx(e,t){return Vy(e.getMonth()+1,t,2)}function yx(e,t){return Vy(e.getMinutes(),t,2)}function xx(e,t){return Vy(e.getSeconds(),t,2)}function Cx(e){var t=e.getDay();return 0===t?7:t}function Sx(e,t){return Vy(uy.count(Iy(e)-1,e),t,2)}function Mx(e){var t=e.getDay();return t>=4||0===t?hy(e):hy.ceil(e)}function Rx(e,t){return e=Mx(e),Vy(hy.count(Iy(e),e)+(4===Iy(e).getDay()),t,2)}function Ix(e){return e.getDay()}function Px(e,t){return Vy(cy.count(Iy(e)-1,e),t,2)}function kx(e,t){return Vy(e.getFullYear()%100,t,2)}function Ex(e,t){return Vy((e=Mx(e)).getFullYear()%100,t,2)}function Tx(e,t){return Vy(e.getFullYear()%1e4,t,4)}function Dx(e,t){var n=e.getDay();return Vy((e=n>=4||0===n?hy(e):hy.ceil(e)).getFullYear()%1e4,t,4)}function Fx(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Vy(t/60|0,"0",2)+Vy(t%60,"0",2)}function Ax(e,t){return Vy(e.getUTCDate(),t,2)}function Ox(e,t){return Vy(e.getUTCHours(),t,2)}function Hx(e,t){return Vy(e.getUTCHours()%12||12,t,2)}function $x(e,t){return Vy(1+sy.count(Py(e),e),t,3)}function zx(e,t){return Vy(e.getUTCMilliseconds(),t,3)}function Lx(e,t){return zx(e,t)+"000"}function jx(e,t){return Vy(e.getUTCMonth()+1,t,2)}function Nx(e,t){return Vy(e.getUTCMinutes(),t,2)}function Gx(e,t){return Vy(e.getUTCSeconds(),t,2)}function _x(e){var t=e.getUTCDay();return 0===t?7:t}function Vx(e,t){return Vy(by.count(Py(e)-1,e),t,2)}function Bx(e){var t=e.getUTCDay();return t>=4||0===t?xy(e):xy.ceil(e)}function Wx(e,t){return e=Bx(e),Vy(xy.count(Py(e),e)+(4===Py(e).getUTCDay()),t,2)}function Ux(e){return e.getUTCDay()}function Kx(e,t){return Vy(vy.count(Py(e)-1,e),t,2)}function qx(e,t){return Vy(e.getUTCFullYear()%100,t,2)}function Xx(e,t){return Vy((e=Bx(e)).getUTCFullYear()%100,t,2)}function Yx(e,t){return Vy(e.getUTCFullYear()%1e4,t,4)}function Qx(e,t){var n=e.getUTCDay();return Vy((e=n>=4||0===n?xy(e):xy.ceil(e)).getUTCFullYear()%1e4,t,4)}function Zx(){return"+0000"}function Jx(){return"%"}function eC(e){return+e}function tC(e){return Math.floor(+e/1e3)}function nC(e){return new Date(e)}function rC(e){return e instanceof Date?+e:+new Date(+e)}function oC(e,t,n,r,o,i,s,a,l,u){var c=Jv(),d=c.invert,p=c.domain,h=u(".%L"),f=u(":%S"),g=u("%I:%M"),m=u("%I %p"),b=u("%a %d"),v=u("%b %d"),w=u("%B"),y=u("%Y");function x(e){return(l(e)<e?h:a(e)<e?f:s(e)<e?g:i(e)<e?m:r(e)<e?o(e)<e?b:v:n(e)<e?w:y)(e)}return c.invert=function(e){return new Date(d(e))},c.domain=function(e){return arguments.length?p(Array.from(e,rC)):p().map(nC)},c.ticks=function(t){var n=p();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?x:u(t)},c.nice=function(e){var n=p();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?p(ww(n,e)):c},c.copy=function(){return Qv(c,oC(e,t,n,r,o,i,s,a,l,u))},c}function iC(){return Bb.apply(oC(Dy,Fy,Iy,My,uy,iy,ry,ty,ey,zy).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function sC(){return Bb.apply(oC(Ey,Ty,Py,Ry,by,sy,oy,ny,ey,Ly).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function aC(){var e,t,n,r,o,i=0,s=1,a=Kv,l=!1;function u(t){return null==t||isNaN(t=+t)?o:a(0===n?.5:(t=(r(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,r;return arguments.length?([n,r]=t,a=e(n,r),u):[a(0),a(1)]}}return u.domain=function(o){return arguments.length?([i,s]=o,e=r(i=+i),t=r(s=+s),n=e===t?0:1/(t-e),u):[i,s]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(a=e,u):a},u.range=c(Vv),u.rangeRound=c(Bv),u.unknown=function(e){return arguments.length?(o=e,u):o},function(o){return r=o,e=o(i),t=o(s),n=e===t?0:1/(t-e),u}}function lC(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function uC(){var e=mw(aC()(Kv));return e.copy=function(){return lC(e,uC())},Wb.apply(e,arguments)}function cC(){var e=Iw(aC()).domain([1,10]);return e.copy=function(){return lC(e,cC()).base(e.base())},Wb.apply(e,arguments)}function dC(){var e=Tw(aC());return e.copy=function(){return lC(e,dC()).constant(e.constant())},Wb.apply(e,arguments)}function pC(){var e=Hw(aC());return e.copy=function(){return lC(e,pC()).exponent(e.exponent())},Wb.apply(e,arguments)}function hC(){return pC.apply(null,arguments).exponent(.5)}function fC(){var e=[],t=Kv;function n(n){if(null!=n&&!isNaN(n=+n))return t((Pb(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Mb),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>Gb(e,r/t))},n.copy=function(){return fC(t).domain(e)},Wb.apply(n,arguments)}function gC(){var e,t,n,r,o,i,s,a=0,l=.5,u=1,c=1,d=Kv,p=!1;function h(e){return isNaN(e=+e)?s:(e=.5+((e=+i(e))-t)*(c*e<c*t?r:o),d(p?Math.max(0,Math.min(1,e)):e))}function f(e){return function(t){var n,r,o;return arguments.length?([n,r,o]=t,d=function(e,t){void 0===t&&(t=e,e=Vv);for(var n=0,r=t.length-1,o=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(o,o=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return i[t](e-t)}}(e,[n,r,o]),h):[d(0),d(.5),d(1)]}}return h.domain=function(s){return arguments.length?([a,l,u]=s,e=i(a=+a),t=i(l=+l),n=i(u=+u),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),c=t<e?-1:1,h):[a,l,u]},h.clamp=function(e){return arguments.length?(p=!!e,h):p},h.interpolator=function(e){return arguments.length?(d=e,h):d},h.range=f(Vv),h.rangeRound=f(Bv),h.unknown=function(e){return arguments.length?(s=e,h):s},function(s){return i=s,e=s(a),t=s(l),n=s(u),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),c=t<e?-1:1,h}}function mC(){var e=mw(gC()(Kv));return e.copy=function(){return lC(e,mC())},Wb.apply(e,arguments)}function bC(){var e=Iw(gC()).domain([.1,1,10]);return e.copy=function(){return lC(e,bC()).base(e.base())},Wb.apply(e,arguments)}function vC(){var e=Tw(gC());return e.copy=function(){return lC(e,vC()).constant(e.constant())},Wb.apply(e,arguments)}function wC(){var e=Hw(gC());return e.copy=function(){return lC(e,wC()).exponent(e.exponent())},Wb.apply(e,arguments)}function yC(){return wC.apply(null,arguments).exponent(.5)}function xC(e){return"piecewise"===e.type?_w(e.thresholds,e.colors):uC([e.min??0,e.max??100],e.color)}function CC(e){return e.values?Kb(e.values,e.colors).unknown(e.unknownColor??null):Kb(e.colors.map((e,t)=>t),e.colors).unknown(e.unknownColor??null)}function SC(e){return"ordinal"===e.type?CC(e):xC(e)}function MC(e){return Math.floor(Math.abs(e)/50)}function RC(e){return Array.isArray(e)?JSON.stringify(e):"object"==typeof e&&null!==e?e.valueOf():e}function IC(...e){let t,n,r=new kb(void 0,RC),o=[],i=[],s=0,a=1,l=!1,u=0,c=0,d=.5;const p=e=>{const t=r.get(e);if(void 0!==t)return i[t%i.length]},h=()=>{const e=o.length,r=a<s,h=r?a:s,f=r?s:a;t=(f-h)/Math.max(1,e-u+2*c),l&&(t=Math.floor(t));const g=h+(f-h-t*(e-u))*d;n=t*(1-u);const m=l?Math.round(g):g,b=l?Math.round(n):n;n=b;const v=Vb(e).map(e=>m+t*e);return i=r?v.reverse():v,p};p.domain=function(e){if(!arguments.length)return o.slice();o=[],r=new kb(void 0,RC);for(const t of e)r.has(t)||r.set(t,o.push(t)-1);return h()},p.range=function(e){if(!arguments.length)return[s,a];const[t,n]=e;return s=+t,a=+n,h()},p.rangeRound=function(e){const[t,n]=e;return s=+t,a=+n,l=!0,h()},p.bandwidth=function(){return n},p.step=function(){return t},p.round=function(e){return arguments.length?(l=!!e,h()):l},p.padding=function(e){return arguments.length?(u=Math.min(1,c=+e),h()):u},p.paddingInner=function(e){return arguments.length?(u=Math.min(1,e),h()):u},p.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},p.align=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),h()):d},p.copy=()=>IC(o,[s,a]).round(l).paddingInner(u).paddingOuter(c).align(d);const[f,g]=e;return e.length>1?(p.domain(f),p.range(g)):f?p.range(f):h(),p}function PC(...e){const t=Dw(...e),n=t.ticks,{negativeScale:r,linearScale:o,positiveScale:i}=function(e){const t=e.constant(),n=e.domain(),r=Pw([n[0],Math.min(n[1],-t)],e.range()),o=bw([Math.max(n[0],-t),Math.min(n[1],t)],e.range()),i=Pw([Math.max(n[0],t),n[1]],e.range());return{negativeScale:r,linearScale:o,positiveScale:i}}(t);return t.ticks=e=>{const s=n(e),a=t.constant();let l=0,u=0,c=0;s.forEach(e=>{e>-a&&e<a&&(u+=1),e<=-a&&(l+=1),e>=a&&(c+=1)});const d=[];if(l>0&&d.push(...r.ticks(l)),u>0){const e=o.ticks(u);d.at(-1)===e[0]?d.push(...e.slice(1)):d.push(...e)}if(c>0){const e=i.ticks(c);d.at(-1)===e[0]?d.push(...e.slice(1)):d.push(...e)}return d},t.tickFormat=(e=10,n)=>{const s=t.constant(),[a,l]=t.domain(),u=l-a,c=r.domain(),d=c[1]-c[0],p=(0===u?0:d/u)*e,h=o.domain(),f=h[1]-h[0],g=(0===u?0:f/u)*e,m=i.domain(),b=m[1]-m[0],v=(0===u?0:b/u)*e,w=r.tickFormat(p,n),y=o.tickFormat(g,n),x=i.tickFormat(v,n);return e=>(e.valueOf()<=-s?w:e.valueOf()>=s?x:y)(e)},t.copy=()=>PC(t.domain(),t.range()).constant(t.constant()),t}function kC(e,t,n){switch(e){case"log":return Pw(t,n);case"pow":return $w(t,n);case"sqrt":return zw(t,n);case"time":return iC(t,n);case"utc":return sC(t,n);case"symlog":return PC(t,n);default:return bw(t,n)}}!function(e){$y=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,u=Wy(o),c=Uy(o),d=Wy(i),p=Uy(i),h=Wy(s),f=Uy(s),g=Wy(a),m=Uy(a),b=Wy(l),v=Uy(l),w={a:function(e){return s[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:hx,e:hx,f:vx,g:Ex,G:Dx,H:fx,I:gx,j:mx,L:bx,m:wx,M:yx,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:eC,s:tC,S:xx,u:Cx,U:Sx,V:Rx,w:Ix,W:Px,x:null,X:null,y:kx,Y:Tx,Z:Fx,"%":Jx},y={a:function(e){return s[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Ax,e:Ax,f:Lx,g:Xx,G:Qx,H:Ox,I:Hx,j:$x,L:zx,m:jx,M:Nx,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:eC,s:tC,S:Gx,u:_x,U:Vx,V:Wx,w:Ux,W:Kx,x:null,X:null,y:qx,Y:Yx,Z:Zx,"%":Jx},x={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=b.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return M(e,t,n,r)},d:rx,e:rx,f:ux,g:Jy,G:Zy,H:ix,I:ix,j:ox,L:lx,m:nx,M:sx,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:tx,Q:dx,s:px,S:ax,u:qy,U:Xy,V:Yy,w:Ky,W:Qy,x:function(e,t,r){return M(e,n,t,r)},X:function(e,t,n){return M(e,r,t,n)},y:Jy,Y:Zy,Z:ex,"%":cx};function C(e,t){return function(n){var r,o,i,s=[],a=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(o=jy[r=e.charAt(++a)])?r=e.charAt(++a):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function S(e,t){return function(n){var r,o,i=Hy(1900,void 0,1);if(M(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(r=Oy(Hy(i.y,0,1))).getUTCDay(),r=o>4||0===o?vy.ceil(r):vy(r),r=sy.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=Ay(Hy(i.y,0,1))).getDay(),r=o>4||0===o?cy.ceil(r):cy(r),r=iy.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?Oy(Hy(i.y,0,1)).getUTCDay():Ay(Hy(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,Oy(i)):Ay(i)}}function M(e,t,n,r){for(var o,i,s=0,a=t.length,l=n.length;s<a;){if(r>=l)return-1;if(37===(o=t.charCodeAt(s++))){if(o=t.charAt(s++),!(i=x[o in jy?t.charAt(s++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return w.x=C(n,w),w.X=C(r,w),w.c=C(t,w),y.x=C(n,y),y.X=C(r,y),y.c=C(t,y),{format:function(e){var t=C(e+="",w);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=C(e+="",y);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}(e),zy=$y.format,$y.parse,Ly=$y.utcFormat,$y.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});let EC,TC;const DC=new class{types=(()=>new Set)();constructor(){if(EC)throw new Error("You can only create one instance!");EC=this.types}addType(e){this.types.add(e)}getTypes(){return this.types}};DC.addType("bar"),DC.addType("line"),DC.addType("scatter");function FC(e){return DC.getTypes().has(e)}(new class{types=(()=>new Set)();constructor(){if(TC)throw new Error("You can only create one instance!");TC=this.types}addType(e){this.types.add(e)}getTypes(){return this.types}}).addType("radar");function AC(e){return void 0!==e.bandwidth}function OC({scales:e,drawingArea:t,formattedSeries:n,axis:r,seriesConfig:o,axisDirection:i,zoomMap:s,domains:l}){if(void 0===r)return{axis:{},axisIds:[]};const u=((e,t,n,r)=>{const o=new Set;return Object.keys(t).filter(FC).forEach(i=>{const s=n[i]?.series??{},a=t[i].axisTooltipGetter?.(s);void 0!==a&&a.forEach(({axisId:t,direction:n})=>{n===e&&o.add(t??r)})}),o})(i,o,n,r[0].id),c={};return r.forEach(n=>{const r=n,o=e[r.id],d=s?.get(r.id),p=d?[d.start,d.end]:[0,100],h=function(e,t,n){const r="x"===t?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?[r[1],r[0]]:r}(t,i,r.reverse??!1),f=!r.ignoreTooltip&&u.has(r.id),g=r.data??[];if(AC(o)){const e="y"===i?[h[1],h[0]]:h;if(function(e){return AC(e)&&void 0!==e.paddingOuter}(o)&&Cb(r)){const e=r.categoryGapRatio??.2,t=r.barGapRatio??.1;c[r.id]=a({offset:0,height:0,categoryGapRatio:e,barGapRatio:t,triggerTooltip:f},r,{data:g,scale:o,tickNumber:r.data.length,colorScale:r.colorMap&&("ordinal"===r.colorMap.type?CC(a({values:r.data},r.colorMap)):SC(r.colorMap))})}if(Sb(r)&&(c[r.id]=a({offset:0,height:0,triggerTooltip:f},r,{data:g,scale:o,tickNumber:r.data.length,colorScale:r.colorMap&&("ordinal"===r.colorMap.type?CC(a({values:r.data},r.colorMap)):SC(r.colorMap))})),(e=>e?.[0]instanceof Date)(r.data)){const t=function(e,t,n){const r=iC(e,t);return(e,{location:t})=>"tick"===t?r.tickFormat(n)(e):`${e.toLocaleString()}`}(r.data,e,r.tickNumber);c[r.id].valueFormatter=r.valueFormatter??t}return}if("band"===r.scaleType||"point"===r.scaleType)return;const m=l[r.id].tickNumber,b=r,v=b.scaleType??"linear",w=function(e,t){return 0===t[1]-t[0]?1:e/((t[1]-t[0])/100)}(m,p);c[r.id]=a({offset:0,height:0,triggerTooltip:f},b,{data:g,scaleType:v,scale:o,tickNumber:w,colorScale:b.colorMap&&xC(b.colorMap),valueFormatter:r.valueFormatter??xb(w,kC(v,h.map(e=>o.invert(e)),h))})}),{axis:c,axisIds:r.map(({id:e})=>e)}}function HC(e){return null!=e}function $C(e,t,n,r){const o=e?.length??0,i=Math.floor(t*o/100),s=Math.ceil(n*o/100);return function(t,n){return null==(t[r]??e?.[n])||n>=i&&n<s}}function zC(e,t,n,r,o){const i=e[0].valueOf(),s=e[1].valueOf(),a=i+t*(s-i)/100,l=i+n*(s-i)/100;return function(e,t){const n=e[r]??o?.[t];return null==n||n>=a&&n<=l}}const LC=e=>(t=[])=>t.reduce((t,n)=>{const{zoom:r,id:o,reverse:i}=n,s=vb(r,o,e,i);return s&&(t[o]=s),t},{});function jC(e,t,n){const r="x"===t?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n.reverse?[r[1],r[0]]:r}function NC(e,t){const n=[0,1];if(Cb(e)){const r=e.categoryGapRatio??.2;return IC(t,n).paddingInner(r).paddingOuter(r/2)}if(Sb(e))return function(...e){const t=IC(...e).paddingInner(1),n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{const e=n();return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=t.copy,e},t}(t,n);const r=kC(e.scaleType??"linear",t,n);return"symlog"===e.scaleType&&null!=e.constant&&r.constant(e.constant),r}const GC=(e,t)=>{const n=e[1]-e[0],r=t[1]-t[0];return[e[0]-t[0]*n/r,e[1]+(100-t[1])*n/r]},_C=(e,t,n,r,o,i,s)=>{const a="x"===n?r[e].xExtremumGetter:r[e].yExtremumGetter,l=i[e]?.series??{};return a?.({series:l,axis:t,axisIndex:o,isDefaultAxis:0===o,getFilters:s})??[1/0,-1/0]};function VC(e,t,n,r,o,i){const s=Object.keys(n).filter(FC);let a=[1/0,-1/0];for(const l of s){const[s,u]=_C(l,e,t,n,r,o,i);a=[Math.min(a[0],s),Math.max(a[1],u)]}return Number.isNaN(a[0])||Number.isNaN(a[1])?[1/0,-1/0]:a}function BC(e,t,n){return kC(e??"linear",t,[0,1]).nice(n).domain()}function WC(e,t,n,r,[o,i],s,a){const l=KC(e,t,n,r,a);let u=qC(e,o,i);if("function"==typeof l){const{min:e,max:t}=l(o.valueOf(),i.valueOf());u[0]=e,u[1]=t}const c=function(e,t,n){const{tickMaxStep:r,tickMinStep:o,tickNumber:i}=e,s=void 0===o?999:Math.floor(Math.abs(t[1]-t[0])/o),a=void 0===r?2:Math.ceil(Math.abs(t[1]-t[0])/r),l=i??n;return Math.min(s,Math.max(a,l))}(e,u,s);return"nice"===l&&(u=BC(e.scaleType,u,c)),u=["min"in e?e.min??u[0]:u[0],"max"in e?e.max??u[1]:u[1]],{domain:u,tickNumber:c}}function UC(e,t,n,r,[o,i],s,a){const l=KC(e,t,n,r,a);let u=qC(e,o,i);if("function"==typeof l){const{min:e,max:t}=l(o.valueOf(),i.valueOf());u[0]=e,u[1]=t}return"nice"===l&&(u=BC(e.scaleType,u,s)),[e.min??u[0],e.max??u[1]]}function KC(e,t,n,r,o){return o?((e,t,n,r)=>{if(void 0!==e.domainLimit)return e.domainLimit;if("x"===t)for(const o of r.line?.seriesOrder??[]){const t=r.line.series[o];if(t.xAxisId===e.id||void 0===t.xAxisId&&0===n)return"strict"}return"nice"})(e,t,n,r):e.domainLimit??"nice"}function qC(e,t,n){let r=t,o=n;return"max"in e&&null!=e.max&&e.max<t&&(r=e.max),"min"in e&&null!=e.min&&e.min>t&&(o=e.min),"min"in e||"max"in e?[e.min??r,e.max??o]:[r,o]}class XC{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(e,t){let n=this.length++;for(;n>0;){const e=n-1>>1,r=this.values[e];if(t>=r)break;this.ids[n]=this.ids[e],this.values[n]=r,n=e}this.ids[n]=e,this.values[n]=t}pop(){if(0===this.length)return;const e=this.ids,t=this.values,n=e[0],r=--this.length;if(r>0){const n=e[r],o=t[r];let i=0;const s=r>>1;for(;i<s;){const n=1+(i<<1),s=n+1,a=n+(+(s<r)&+(t[s]<t[n]));if(t[a]>=o)break;e[i]=e[a],t[i]=t[a],i=a}e[i]=n,t[i]=o}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}}const YC=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class QC{static from(e,t=0){if(t%8!=0)throw new Error("byteOffset must be 8-byte aligned.");if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[n,r]=new Uint8Array(e,t+0,2);if(251!==n)throw new Error("Data does not appear to be in a Flatbush format.");const o=r>>4;if(3!==o)throw new Error(`Got v${o} data when expected v3.`);const i=YC[15&r];if(!i)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,t+2,1),[a]=new Uint32Array(e,t+4,1);return new QC(a,s,i,void 0,e,t)}constructor(e,t=16,n=Float64Array,r=ArrayBuffer,o,i=0){if(void 0===e)throw new Error("Missing required argument: numItems.");if(isNaN(e)||e<=0)throw new Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.byteOffset=i;let s=e,a=s;this._levelBounds=[4*s];do{s=Math.ceil(s/this.nodeSize),a+=s,this._levelBounds.push(4*a)}while(1!==s);this.ArrayType=n,this.IndexArrayType=a<16384?Uint16Array:Uint32Array;const l=YC.indexOf(n),u=4*a*n.BYTES_PER_ELEMENT;if(l<0)throw new Error(`Unexpected typed array class: ${n}.`);if(o)this.data=o,this._boxes=new n(o,i+8,4*a),this._indices=new this.IndexArrayType(o,i+8+u,a),this._pos=4*a,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{const o=this.data=new r(8+u+a*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new n(o,8,4*a),this._indices=new this.IndexArrayType(o,8+u,a),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(o,0,2).set([251,48+l]),new Uint16Array(o,2,1)[0]=t,new Uint32Array(o,4,1)[0]=e}this._queue=new XC}add(e,t,n=e,r=t){const o=this._pos>>2,i=this._boxes;return this._indices[o]=o,i[this._pos++]=e,i[this._pos++]=t,i[this._pos++]=n,i[this._pos++]=r,e<this.minX&&(this.minX=e),t<this.minY&&(this.minY=t),n>this.maxX&&(this.maxX=n),r>this.maxY&&(this.maxY=r),o}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const e=this._boxes;if(this.numItems<=this.nodeSize)return e[this._pos++]=this.minX,e[this._pos++]=this.minY,e[this._pos++]=this.maxX,void(e[this._pos++]=this.maxY);const t=this.maxX-this.minX||1,n=this.maxY-this.minY||1,r=new Uint32Array(this.numItems);for(let o=0,i=0;o<this.numItems;o++){const s=e[i++],a=e[i++],l=e[i++],u=e[i++],c=Math.floor(65535*((s+l)/2-this.minX)/t),d=Math.floor(65535*((a+u)/2-this.minY)/n);r[o]=nS(c,d)}eS(r,e,this._indices,0,this.numItems-1,this.nodeSize);for(let o=0,i=0;o<this._levelBounds.length-1;o++){const t=this._levelBounds[o];for(;i<t;){const n=i;let r=e[i++],o=e[i++],s=e[i++],a=e[i++];for(let l=1;l<this.nodeSize&&i<t;l++)r=Math.min(r,e[i++]),o=Math.min(o,e[i++]),s=Math.max(s,e[i++]),a=Math.max(a,e[i++]);this._indices[this._pos>>2]=n,e[this._pos++]=r,e[this._pos++]=o,e[this._pos++]=s,e[this._pos++]=a}}}search(e,t,n,r,o){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let i=this._boxes.length-4;const s=[],a=[];for(;void 0!==i;){const l=Math.min(i+4*this.nodeSize,JC(i,this._levelBounds));for(let u=i;u<l;u+=4){if(n<this._boxes[u])continue;if(r<this._boxes[u+1])continue;if(e>this._boxes[u+2])continue;if(t>this._boxes[u+3])continue;const l=0|this._indices[u>>2];i>=4*this.numItems?s.push(l):(void 0===o||o(l))&&(a.push(l),a.push(this._boxes[u]),a.push(this._boxes[u+1]))}i=s.pop()}return a}neighbors(e,t,n=1/0,r=1/0,o,i=ZC){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let s=this._boxes.length-4;const a=this._queue,l=[];e:for(;void 0!==s;){const u=Math.min(s+4*this.nodeSize,JC(s,this._levelBounds));for(let n=s;n<u;n+=4){const l=0|this._indices[n>>2],u=this._boxes[n],c=this._boxes[n+1],d=this._boxes[n+2],p=this._boxes[n+3],h=i(e<u?u-e:e>d?e-d:0,t<c?c-t:t>p?t-p:0);h>r||(s>=4*this.numItems?a.push(l<<1,h):(void 0===o||o(l))&&a.push(1+(l<<1),h))}for(;a.length&&1&a.peek();){if(a.peekValue()>r)break e;if(l.push(a.pop()>>1),l.length===n)break e}s=a.length?a.pop()>>1:void 0}return a.clear(),l}}function ZC(e,t){return e*e+t*t}function JC(e,t){let n=0,r=t.length-1;for(;n<r;){const o=n+r>>1;t[o]>e?r=o:n=o+1}return t[n]}function eS(e,t,n,r,o,i){if(Math.floor(r/i)>=Math.floor(o/i))return;const s=e[r],a=e[r+o>>1],l=e[o];let u=l;const c=Math.max(s,a);l>c?u=c:c===s?u=Math.max(a,l):c===a&&(u=Math.max(s,l));let d=r-1,p=o+1;for(;;){do{d++}while(e[d]<u);do{p--}while(e[p]>u);if(d>=p)break;tS(e,t,n,d,p)}eS(e,t,n,r,p,i),eS(e,t,n,p+1,o,i)}function tS(e,t,n,r,o){const i=e[r];e[r]=e[o],e[o]=i;const s=4*r,a=4*o,l=t[s],u=t[s+1],c=t[s+2],d=t[s+3];t[s]=t[a],t[s+1]=t[a+1],t[s+2]=t[a+2],t[s+3]=t[a+3],t[a]=l,t[a+1]=u,t[a+2]=c,t[a+3]=d;const p=n[r];n[r]=n[o],n[o]=p}function nS(e,t){let n=e^t,r=65535^n,o=65535^(e|t),i=e&(65535^t),s=n|r>>1,a=n>>1^n,l=o>>1^r&i>>1^o,u=n&o>>1^i>>1^i;n=s,r=a,o=l,i=u,s=n&n>>2^r&r>>2,a=n&r>>2^r&(n^r)>>2,l^=n&o>>2^r&i>>2,u^=r&o>>2^(n^r)&i>>2,n=s,r=a,o=l,i=u,s=n&n>>4^r&r>>4,a=n&r>>4^r&(n^r)>>4,l^=n&o>>4^r&i>>4,u^=r&o>>4^(n^r)&i>>4,n=s,r=a,o=l,i=u,l^=n&o>>8^r&i>>8,u^=r&o>>8^(n^r)&i>>8,n=l^l>>1,r=u^u>>1;let c=e^t,d=r|65535^(c|n);return c=16711935&(c|c<<8),c=252645135&(c|c<<4),c=858993459&(c|c<<2),c=1431655765&(c|c<<1),d=16711935&(d|d<<8),d=252645135&(d|d<<4),d=858993459&(d|d<<2),d=1431655765&(d|d<<1),(d<<1|c)>>>0}const rS=e=>e.zoom,oS=En(dm,pm,(e,t)=>e?.some(e=>Boolean(e.zoom))||t?.some(e=>Boolean(e.zoom))||!1);En(rS,e=>e?.isInteracting);const iS=Dn(rS,function(e){return e?.zoomData&&(e=>{const t=new Map;return e.forEach(e=>{t.set(e.axisId,e)}),t})(e?.zoomData)});En(iS,(e,t)=>e?.get(t));const sS=Dn(dm,pm,function(e,t){return a({},LC("x")(e),LC("y")(t))});En(sS,(e,t)=>e[t]);const aS=En(wm,function(e){return MC(e.width)}),lS=En(wm,function(e){return MC(e.height)}),uS=Dn(dm,Gm,jm,Pm,aS,function(e,t,n,r,o){const i={};return e?.forEach((e,s)=>{const a=e;if(Cb(a)||Sb(a))return void(i[a.id]={domain:a.data});const l=VC(a,"x",n,s,t);i[a.id]=WC(a,"x",s,t,l,o,r)}),{axes:e,domains:i}}),cS=Dn(pm,Gm,jm,Pm,lS,function(e,t,n,r,o){const i={};return e?.forEach((e,s)=>{const a=e;if(Cb(a)||Sb(a))return void(i[a.id]={domain:a.data});const l=VC(a,"y",n,s,t);i[a.id]=WC(a,"y",s,t,l,o,r)}),{axes:e,domains:i}}),dS=Dn(iS,sS,uS,cS,function(e,t,{axes:n,domains:r},{axes:o,domains:i}){if(!e||!t)return;let s=!1;const a={},l=[...n??[],...o??[]];for(let u=0;u<l.length;u+=1){const o=l[u];if(!t[o.id]||"discard"!==t[o.id].filterMode)continue;const c=e.get(o.id);if(void 0===c||c.start<=0&&c.end>=100)continue;const d=u<(n?.length??0)?"x":"y";if("band"===o.scaleType||"point"===o.scaleType)a[o.id]=$C(o.data,c.start,c.end,d);else{const{domain:e}="x"===d?r[o.id]:i[o.id];a[o.id]=zC(e,c.start,c.end,d,o.data)}s=!0}return s?(e=>({currentAxisId:t,seriesXAxisId:n,seriesYAxisId:r,isDefaultAxis:o})=>(i,s)=>!(t===n?r:n)||o?Object.values(e??{})[0]?.(i,s)??!0:[r,n].filter(e=>e!==t).map(t=>e[t??""]).filter(HC).every(e=>e(i,s)))(a):void 0}),pS=Dn(Gm,jm,iS,sS,dS,Pm,uS,function(e,t,n,r,o,i,{axes:s,domains:a}){const l={};return s?.forEach((s,u)=>{const c=a[s.id].domain;if(Cb(s)||Sb(s))return void(l[s.id]=c);const d=n?.get(s.id),p=r?.[s.id],h=void 0!==d||p?void 0:o;if(!h)return void(l[s.id]=c);const f=a[s.id].tickNumber,g=VC(s,"x",t,u,e,h);l[s.id]=UC(s,"x",u,e,g,f,i)}),l}),hS=Dn(Gm,jm,iS,sS,dS,Pm,cS,function(e,t,n,r,o,i,{axes:s,domains:a}){const l={};return s?.forEach((s,u)=>{const c=a[s.id].domain;if(Cb(s)||Sb(s))return void(l[s.id]=c);const d=n?.get(s.id),p=r?.[s.id],h=void 0!==d||p?void 0:o;if(!h)return void(l[s.id]=c);const f=a[s.id].tickNumber,g=VC(s,"y",t,u,e,h);l[s.id]=UC(s,"y",u,e,g,f,i)}),l}),fS=Dn(dm,pS,function(e,t){const n={};return e?.forEach(e=>{const r=e,o=t[r.id];n[r.id]=NC(r,o)}),n}),gS=Dn(pm,hS,function(e,t){const n={};return e?.forEach(e=>{const r=e,o=t[r.id];n[r.id]=NC(r,o)}),n}),mS=Dn(dm,fS,wm,iS,function(e,t,n,r){const o={};return e?.forEach(e=>{const i=e,s=r?.get(i.id),a=s?[s.start,s.end]:[0,100],l=jC(n,"x",i),u=t[i.id].copy(),c=GC(l,a);u.range(c),o[i.id]=u}),o}),bS=Dn(pm,gS,wm,iS,function(e,t,n,r){const o={};return e?.forEach(e=>{const i=e,s=r?.get(i.id),a=s?[s.start,s.end]:[0,100],l=jC(n,"y",i),u=t[i.id].copy(),c=AC(u)?l.reverse():l,d=GC(c,a);u.range(d),o[i.id]=u}),o}),vS=Dn(wm,Gm,jm,iS,uS,mS,function(e,t,n,r,{axes:o,domains:i},s){return OC({scales:s,drawingArea:e,formattedSeries:t,axis:o,seriesConfig:n,axisDirection:"x",zoomMap:r,domains:i})}),wS=Dn(wm,Gm,jm,iS,cS,bS,function(e,t,n,r,{axes:o,domains:i},s){return OC({scales:s,drawingArea:e,formattedSeries:t,axis:o,seriesConfig:n,axisDirection:"y",zoomMap:r,domains:i})});En(vS,wS,(e,t,n)=>e?.axis[n]??t?.axis[n]),En(dm,pm,(e,t,n)=>{const r=e?.find(e=>e.id===n)??t?.find(e=>e.id===n)??null;if(r)return r});const yS=En(dm,e=>e[0].id),xS=En(pm,e=>e[0].id);function CS(e){return e instanceof Date?e.getTime():e}function SS(e,t){const{scale:n,data:r,reverse:o}=e;if(!AC(n)){const e=n.invert(t);if(void 0===r)return-1;const o=CS(e),i=r?.findIndex((t,n)=>{const i=CS(t);return i>o&&(0===n||Math.abs(o-i)<=Math.abs(o-CS(r[n-1])))||i<=o&&(n===r.length-1||Math.abs(CS(e)-i)<Math.abs(CS(e)-CS(r[n+1])))});return i}const i=0===n.bandwidth()?Math.floor((t-Math.min(...n.range())+n.step()/2)/n.step()):Math.floor((t-Math.min(...n.range()))/n.step());return i<0||i>=r.length?-1:o?r.length-1-i:i}function MS(e,t,n,r){if(!AC(e)){if(null===r){const t=e.invert(n);return Number.isNaN(t)?null:t}return t[r]}return null===r||r<0||r>=t.length?null:t[r]}function RS(e,t){const n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}Dn(Gm,fS,gS,yS,xS,function(e,t,n,r,o){const i=e.scatter,s=new Map;return i?(i.seriesOrder.forEach(e=>{const{data:a,xAxisId:l=r,yAxisId:u=o}=i.series[e],c=new QC(a.length),d=t[l],p=n[u];for(const t of a)c.add(d(t.x),p(t.y));c.finish(),s.set(e,c)}),s):s});const IS=({store:e})=>{const t=y(function(){e.set("interaction",a({},e.state.interaction,{pointer:null,item:null}))}),n=y(function(t){const n=e.state.interaction.item;t?null===n||Object.keys(t).some(e=>t[e]!==n[e])||e.set("interaction",a({},e.state.interaction,{item:null})):null!==n&&e.set("interaction",a({},e.state.interaction,{item:null}))});return{instance:{cleanInteraction:t,setItemInteraction:y(function(t,n){jr(e.state.interaction.item,t)||e.set("interaction",a({},e.state.interaction,{lastUpdate:n.interaction,item:t}))}),removeItemInteraction:n,setPointerCoordinate:y(function(t){e.set("interaction",a({},e.state.interaction,{pointer:t,lastUpdate:null!==t?"pointer":e.state.interaction.lastUpdate}))})}}};IS.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:"pointer"}}),IS.params={};const PS=e=>e.interaction,kS=En(PS,e=>void 0!==e),ES=En(PS,e=>e?.item??null),TS=En(PS,e=>e?.pointer??null),DS=En(TS,e=>e&&e.x),FS=En(TS,e=>e&&e.y);En(ES,e=>null!==e),En(PS,e=>e?.lastUpdate);const AS=e=>e.keyboardNavigation;En(AS,(e,t)=>null!=e?.item&&e.item.type===t.seriesType&&e.item.seriesId===t.seriesId&&e.item.dataIndex===t.dataIndex);const OS=En(AS,e=>null!=e?.item),HS=En(AS,e=>e?.item?.type),$S=En(AS,e=>e?.item?.seriesId),zS=En(AS,e=>e?.item?.dataIndex),LS=En(AS,e=>!!e?.enableKeyboardNavigation),jS=e=>(t,n,r,o,i)=>{if(void 0===t||void 0===n||void 0===r)return;const s=i[t]?.series[n];if(!s)return;let a="x"===e?"xAxisId"in s&&s.xAxisId:"yAxisId"in s&&s.yAxisId;return void 0!==a&&!1!==a||(a=o.axisIds[0]),{axisId:a,dataIndex:r}};function NS(e,t,n=t.axisIds[0]){return Array.isArray(n)?n.map(n=>SS(t.axis[n],e)):SS(t.axis[n],e)}En(HS,$S,zS,vS,Gm,jS("x")),En(HS,$S,zS,wS,Gm,jS("y")),En(AS,function(e){if(null==e?.item)return null;const{type:t,seriesId:n}=e.item;return void 0===t||void 0===n?null:e.item}),En(HS,$S,zS,function(e,t,n){return void 0!==t&&void 0!==n});const GS=(e,t,n)=>{if(null===e)return null;const r=NS(e,t,n);return-1===r?null:r},_S=En(DS,vS,GS),VS=En(FS,wS,GS),BS=En(DS,FS,vS,wS,(e,t,n,r)=>[...null===e?[]:n.axisIds.map(t=>({axisId:t,dataIndex:NS(e,n,t)})),...null===t?[]:r.axisIds.map(e=>({axisId:e,dataIndex:NS(t,r,e)}))].filter(e=>null!==e.dataIndex&&e.dataIndex>=0));function WS(e,t,n,r=t.axisIds[0]){return Array.isArray(r)?r.map((r,o)=>{const i=t.axis[r];return MS(i.scale,i.data,e,n[o])}):MS(t.axis[r].scale,t.axis[r].data,e,n)}En(DS,vS,_S,(e,t,n,r)=>null===e||0===t.axisIds.length?null:WS(e,t,n,r)),En(FS,wS,VS,(e,t,n,r)=>null===e||0===t.axisIds.length?null:WS(e,t,n,r));const US=[],KS=Tn({memoizeOptions:{resultEqualityCheck:ql}})(DS,vS,(e,t)=>null===e?US:t.axisIds.filter(e=>t.axis[e].triggerTooltip).map(n=>({axisId:n,dataIndex:SS(t.axis[n],e)})).filter(({dataIndex:e})=>e>=0)),qS=Tn({memoizeOptions:{resultEqualityCheck:ql}})(FS,wS,(e,t)=>null===e?US:t.axisIds.filter(e=>t.axis[e].triggerTooltip).map(n=>({axisId:n,dataIndex:SS(t.axis[n],e)})).filter(({dataIndex:e})=>e>=0));En(KS,qS,(e,t)=>e.length>0||t.length>0);const XS=({params:t,store:n,seriesConfig:r,svgRef:o,instance:i})=>{const{xAxis:s,yAxis:a,dataset:l,onHighlightedAxisChange:u}=t,c=um(n,wm),d=um(n,Gm),p=um(n,kS),{axis:h,axisIds:f}=um(n,vS),{axis:g,axisIds:m}=um(n,wS);t.highlightedAxis,oe(()=>{void 0!==t.highlightedAxis&&n.set("controlledCartesianAxisHighlight",t.highlightedAxis)},[n,t.highlightedAxis]);const b=e.useRef(!0);e.useEffect(()=>{b.current?b.current=!1:n.set("cartesianAxis",{x:wb(s,l),y:yb(a,l)})},[r,c,s,a,l,n]);const v=f[0],w=m[0];Bn(n,BS,(e,t)=>{u&&(Object.is(e,t)||(e.length===t.length?e?.some(({axisId:e,dataIndex:n},r)=>t[r].axisId!==e||t[r].dataIndex!==n)&&u(t):u(t)))});const y=function(e){return void 0!==e.setPointerCoordinate}(i);return e.useEffect(()=>{const e=o.current;if(!p||!y||!e||t.disableAxisListener)return()=>{};const n=i.addInteractionListener("moveEnd",e=>{e.detail.activeGestures.pan||i.cleanInteraction()}),r=i.addInteractionListener("panEnd",e=>{e.detail.activeGestures.move||i.cleanInteraction()}),s=i.addInteractionListener("quickPressEnd",e=>{e.detail.activeGestures.move||e.detail.activeGestures.pan||i.cleanInteraction()}),a=t=>{const n=t.detail.srcEvent,r=t.detail.target,o=RS(e,n);t.detail.srcEvent.buttons>=1&&r?.hasPointerCapture(t.detail.srcEvent.pointerId)&&!r?.closest("[data-charts-zoom-slider]")&&r?.releasePointerCapture(t.detail.srcEvent.pointerId),i.isPointInside(o.x,o.y,r)?i.setPointerCoordinate(o):i.cleanInteraction?.()},l=i.addInteractionListener("move",a),u=i.addInteractionListener("pan",a),c=i.addInteractionListener("quickPress",a);return()=>{l.cleanup(),n.cleanup(),u.cleanup(),r.cleanup(),c.cleanup(),s.cleanup()}},[o,n,h,v,g,w,i,t.disableAxisListener,p,y]),e.useEffect(()=>{const e=o.current,n=t.onAxisClick;if(null===e||!n)return()=>{};const r=i.addInteractionListener("tap",t=>{let r=null,o=!1;const i=RS(e,t.detail.srcEvent),s=SS(h[v],i.x);o=-1!==s,r=o?s:SS(g[w],i.y);const a=o?f[0]:m[0];if(null==r||-1===r)return;const l=(o?h:g)[a].data[r],u={};Object.keys(d).filter(e=>["bar","line"].includes(e)).forEach(e=>{d[e]?.seriesOrder.forEach(t=>{const n=d[e].series[t],i=n.xAxisId,s=n.yAxisId,l=o?i:s;void 0!==l&&l!==a||(u[t]=n.data[r])})}),n(t.detail.srcEvent,{dataIndex:r,axisValue:l,seriesValues:u})});return()=>{r.cleanup()}},[t.onAxisClick,d,o,h,f,g,m,v,w,i]),{}};function YS(e,t){return void 0!==e.id?e:a({id:t},e)}function QS(e){return e.colorMap?a({},e,{colorScale:"ordinal"===e.colorMap.type&&e.data?CC(a({values:e.data},e.colorMap)):SC("continuous"===e.colorMap.type?a({min:e.min,max:e.max},e.colorMap):e.colorMap)}):e}function ZS(e,t){if(!e||0===e.length)return{axis:{},axisIds:[]};const n={},r=[];return e.forEach((e,o)=>{const i=e.dataKey,s=e.id??`defaultized-z-axis-${o}`;if(void 0===i||void 0!==e.data)return n[s]=QS(YS(e,s)),void r.push(s);if(void 0===t)throw new Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");n[s]=QS(YS(a({},e,{data:t.map(e=>e[i])}),s)),r.push(s)}),{axis:n,axisIds:r}}XS.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0},XS.getDefaultizedParams=({params:e})=>a({},e,{colors:e.colors??Am,theme:e.theme??"light",defaultizedXAxis:wb(e.xAxis,e.dataset),defaultizedYAxis:yb(e.yAxis,e.dataset)}),XS.getInitialState=e=>a({cartesianAxis:{x:e.defaultizedXAxis,y:e.defaultizedYAxis}},void 0===e.highlightedAxis?{}:{controlledCartesianAxisHighlight:e.highlightedAxis});const JS=({params:t,store:n})=>{const{zAxis:r,dataset:o}=t,i=e.useRef(!0);return e.useEffect(()=>{i.current?i.current=!1:n.set("zAxis",ZS(r,o))},[r,o,n]),{}};JS.params={zAxis:!0,dataset:!0},JS.getInitialState=e=>({zAxis:ZS(e.zAxis,e.dataset)});const eM=En(e=>e,e=>e.zAxis),tM=({store:e,params:t})=>{t.highlightedItem,oe(()=>{e.state.highlight.item!==t.highlightedItem&&e.set("highlight",a({},e.state.highlight,{item:t.highlightedItem}))},[e,t.highlightedItem]);return{instance:{clearHighlight:y(()=>{t.onHighlightChange?.(null);const n=e.getSnapshot().highlight;null===n.item||n.isControlled||e.set("highlight",{item:null,lastUpdate:"pointer",isControlled:!1})}),setHighlight:y(n=>{const r=e.getSnapshot().highlight;r.isControlled||jr(r.item,n)||(t.onHighlightChange?.(n),e.set("highlight",{item:n,lastUpdate:"pointer",isControlled:!1}))})}}};function nM(e){let t=1/0,n=-1/0;for(const r of e??[])r<t&&(t=r),r>n&&(n=r);return[t,n]}tM.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:"pointer",isControlled:void 0!==e.highlightedItem}}),tM.params={highlightedItem:!0,onHighlightChange:!0};const rM=(e,t)=>"x"===t?{x:e,y:null}:{x:null,y:e},oM=e=>{const{axis:t,getFilters:n,isDefaultAxis:r}=e,o=n?.({currentAxisId:t.id,isDefaultAxis:r});return nM((o?t.data?.filter((e,t)=>o({x:null,y:null},t)):t.data)??[])},iM=e=>t=>{const{series:n,axis:r,getFilters:o,isDefaultAxis:i}=t;return Object.keys(n).filter(t=>{const o="x"===e?n[t].xAxisId:n[t].yAxisId;return o===r.id||i&&void 0===o}).reduce((t,s)=>{const{stackedData:a}=n[s],l=o?.({currentAxisId:r.id,isDefaultAxis:i,seriesXAxisId:n[s].xAxisId,seriesYAxisId:n[s].yAxisId}),[u,c]=a?.reduce((t,n,r)=>!l||l(rM(n[0],e),r)&&l(rM(n[1],e),r)?[Math.min(...n,t[0]),Math.max(...n,t[1])]:t,[1/0,-1/0])??[1/0,-1/0];return[Math.min(u,t[0]),Math.max(c,t[1])]},[1/0,-1/0])};function sM(e){return function(){return e}}const aM=Math.abs,lM=Math.atan2,uM=Math.cos,cM=Math.max,dM=Math.min,pM=Math.sin,hM=Math.sqrt,fM=1e-12,gM=Math.PI,mM=gM/2,bM=2*gM;function vM(e){return e>=1?mM:e<=-1?-mM:Math.asin(e)}const wM=Math.PI,yM=2*wM,xM=1e-6,CM=yM-xM;function SM(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class MM{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?SM:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return SM;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,o,i){this._append`C${+e},${+t},${+n},${+r},${this._x1=+o},${this._y1=+i}`}arcTo(e,t,n,r,o){if(e=+e,t=+t,n=+n,r=+r,(o=+o)<0)throw new Error(`negative radius: ${o}`);let i=this._x1,s=this._y1,a=n-e,l=r-t,u=i-e,c=s-t,d=u*u+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>xM)if(Math.abs(c*a-l*u)>xM&&o){let p=n-i,h=r-s,f=a*a+l*l,g=p*p+h*h,m=Math.sqrt(f),b=Math.sqrt(d),v=o*Math.tan((wM-Math.acos((f+d-g)/(2*m*b)))/2),w=v/b,y=v/m;Math.abs(w-1)>xM&&this._append`L${e+w*u},${t+w*c}`,this._append`A${o},${o},0,0,${+(c*p>u*h)},${this._x1=e+y*a},${this._y1=t+y*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,o,i){if(e=+e,t=+t,i=!!i,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),a=n*Math.sin(r),l=e+s,u=t+a,c=1^i,d=i?r-o:o-r;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>xM||Math.abs(this._y1-u)>xM)&&this._append`L${l},${u}`,n&&(d<0&&(d=d%yM+yM),d>CM?this._append`A${n},${n},0,1,${c},${e-s},${t-a}A${n},${n},0,1,${c},${this._x1=l},${this._y1=u}`:d>xM&&this._append`A${n},${n},0,${+(d>=wM)},${c},${this._x1=e+n*Math.cos(o)},${this._y1=t+n*Math.sin(o)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function RM(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new MM(t)}function IM(e){return e.innerRadius}function PM(e){return e.outerRadius}function kM(e){return e.startAngle}function EM(e){return e.endAngle}function TM(e){return e&&e.padAngle}function DM(e,t,n,r,o,i,s){var a=e-n,l=t-r,u=(s?i:-i)/hM(a*a+l*l),c=u*l,d=-u*a,p=e+c,h=t+d,f=n+c,g=r+d,m=(p+f)/2,b=(h+g)/2,v=f-p,w=g-h,y=v*v+w*w,x=o-i,C=p*g-f*h,S=(w<0?-1:1)*hM(cM(0,x*x*y-C*C)),M=(C*w-v*S)/y,R=(-C*v-w*S)/y,I=(C*w+v*S)/y,P=(-C*v+w*S)/y,k=M-m,E=R-b,T=I-m,D=P-b;return k*k+E*E>T*T+D*D&&(M=I,R=P),{cx:M,cy:R,x01:-c,y01:-d,x11:M*(o/x-1),y11:R*(o/x-1)}}function FM(){var e=IM,t=PM,n=sM(0),r=null,o=kM,i=EM,s=TM,a=null,l=RM(u);function u(){var u,c,d,p=+e.apply(this,arguments),h=+t.apply(this,arguments),f=o.apply(this,arguments)-mM,g=i.apply(this,arguments)-mM,m=aM(g-f),b=g>f;if(a||(a=u=l()),h<p&&(c=h,h=p,p=c),h>fM)if(m>bM-fM)a.moveTo(h*uM(f),h*pM(f)),a.arc(0,0,h,f,g,!b),p>fM&&(a.moveTo(p*uM(g),p*pM(g)),a.arc(0,0,p,g,f,b));else{var v,w,y=f,x=g,C=f,S=g,M=m,R=m,I=s.apply(this,arguments)/2,P=I>fM&&(r?+r.apply(this,arguments):hM(p*p+h*h)),k=dM(aM(h-p)/2,+n.apply(this,arguments)),E=k,T=k;if(P>fM){var D=vM(P/p*pM(I)),F=vM(P/h*pM(I));(M-=2*D)>fM?(C+=D*=b?1:-1,S-=D):(M=0,C=S=(f+g)/2),(R-=2*F)>fM?(y+=F*=b?1:-1,x-=F):(R=0,y=x=(f+g)/2)}var A=h*uM(y),O=h*pM(y),H=p*uM(S),$=p*pM(S);if(k>fM){var z,L=h*uM(x),j=h*pM(x),N=p*uM(C),G=p*pM(C);if(m<gM)if(z=function(e,t,n,r,o,i,s,a){var l=n-e,u=r-t,c=s-o,d=a-i,p=d*l-c*u;if(!(p*p<fM))return[e+(p=(c*(t-i)-d*(e-o))/p)*l,t+p*u]}(A,O,N,G,L,j,H,$)){var _=A-z[0],V=O-z[1],B=L-z[0],W=j-z[1],U=1/pM(((d=(_*B+V*W)/(hM(_*_+V*V)*hM(B*B+W*W)))>1?0:d<-1?gM:Math.acos(d))/2),K=hM(z[0]*z[0]+z[1]*z[1]);E=dM(k,(p-K)/(U-1)),T=dM(k,(h-K)/(U+1))}else E=T=0}R>fM?T>fM?(v=DM(N,G,A,O,h,T,b),w=DM(L,j,H,$,h,T,b),a.moveTo(v.cx+v.x01,v.cy+v.y01),T<k?a.arc(v.cx,v.cy,T,lM(v.y01,v.x01),lM(w.y01,w.x01),!b):(a.arc(v.cx,v.cy,T,lM(v.y01,v.x01),lM(v.y11,v.x11),!b),a.arc(0,0,h,lM(v.cy+v.y11,v.cx+v.x11),lM(w.cy+w.y11,w.cx+w.x11),!b),a.arc(w.cx,w.cy,T,lM(w.y11,w.x11),lM(w.y01,w.x01),!b))):(a.moveTo(A,O),a.arc(0,0,h,y,x,!b)):a.moveTo(A,O),p>fM&&M>fM?E>fM?(v=DM(H,$,L,j,p,-E,b),w=DM(A,O,N,G,p,-E,b),a.lineTo(v.cx+v.x01,v.cy+v.y01),E<k?a.arc(v.cx,v.cy,E,lM(v.y01,v.x01),lM(w.y01,w.x01),!b):(a.arc(v.cx,v.cy,E,lM(v.y01,v.x01),lM(v.y11,v.x11),!b),a.arc(0,0,p,lM(v.cy+v.y11,v.cx+v.x11),lM(w.cy+w.y11,w.cx+w.x11),b),a.arc(w.cx,w.cy,E,lM(w.y11,w.x11),lM(w.y01,w.x01),!b))):a.arc(0,0,p,S,C,b):a.lineTo(H,$)}else a.moveTo(0,0);if(a.closePath(),u)return a=null,u+""||null}return u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+o.apply(this,arguments)+ +i.apply(this,arguments))/2-gM/2;return[uM(r)*n,pM(r)*n]},u.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:sM(+t),u):e},u.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:sM(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:sM(+e),u):n},u.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:sM(+e),u):r},u.startAngle=function(e){return arguments.length?(o="function"==typeof e?e:sM(+e),u):o},u.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:sM(+e),u):i},u.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:sM(+e),u):s},u.context=function(e){return arguments.length?(a=null==e?null:e,u):a},u}function AM(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function OM(e){this._context=e}function HM(e){return new OM(e)}function $M(e){return e[0]}function zM(e){return e[1]}function LM(e,t){var n=sM(!0),r=null,o=HM,i=null,s=RM(a);function a(a){var l,u,c,d=(a=AM(a)).length,p=!1;for(null==r&&(i=o(c=s())),l=0;l<=d;++l)!(l<d&&n(u=a[l],l,a))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+e(u,l,a),+t(u,l,a));if(c)return i=null,c+""||null}return e="function"==typeof e?e:void 0===e?$M:sM(e),t="function"==typeof t?t:void 0===t?zM:sM(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:sM(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:sM(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:sM(!!e),a):n},a.curve=function(e){return arguments.length?(o=e,null!=r&&(i=o(r)),a):o},a.context=function(e){return arguments.length?(null==e?r=i=null:i=o(r=e),a):r},a}function jM(e,t,n){var r=null,o=sM(!0),i=null,s=HM,a=null,l=RM(u);function u(u){var c,d,p,h,f,g=(u=AM(u)).length,m=!1,b=new Array(g),v=new Array(g);for(null==i&&(a=s(f=l())),c=0;c<=g;++c){if(!(c<g&&o(h=u[c],c,u))===m)if(m=!m)d=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=c-1;p>=d;--p)a.point(b[p],v[p]);a.lineEnd(),a.areaEnd()}m&&(b[c]=+e(h,c,u),v[c]=+t(h,c,u),a.point(r?+r(h,c,u):b[c],n?+n(h,c,u):v[c]))}if(f)return a=null,f+""||null}function c(){return LM().defined(o).curve(s).context(i)}return e="function"==typeof e?e:void 0===e?$M:sM(+e),t="function"==typeof t?t:sM(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?zM:sM(+n),u.x=function(t){return arguments.length?(e="function"==typeof t?t:sM(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:sM(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:sM(+e),u):r},u.y=function(e){return arguments.length?(t="function"==typeof e?e:sM(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"==typeof e?e:sM(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:sM(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(e){return arguments.length?(o="function"==typeof e?e:sM(!!e),u):o},u.curve=function(e){return arguments.length?(s=e,null!=i&&(a=s(i)),u):s},u.context=function(e){return arguments.length?(null==e?i=a=null:a=s(i=e),u):i},u}function NM(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function GM(e){return e}OM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};class _M{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function VM(e){return new _M(e,!0)}function BM(e){return new _M(e,!1)}function WM(){}function UM(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function KM(e){this._context=e}function qM(e){return new KM(e)}function XM(e){this._context=e}function YM(e){return new XM(e)}function QM(e){this._context=e}function ZM(e){return new QM(e)}function JM(e){this._context=e}function eR(e){return new JM(e)}function tR(e){return e<0?-1:1}function nR(e,t,n){var r=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(r||o<0&&-0),s=(n-e._y1)/(o||r<0&&-0),a=(i*o+s*r)/(r+o);return(tR(i)+tR(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function rR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function oR(e,t,n){var r=e._x0,o=e._y0,i=e._x1,s=e._y1,a=(i-r)/3;e._context.bezierCurveTo(r+a,o+a*t,i-a,s-a*n,i,s)}function iR(e){this._context=e}function sR(e){this._context=new aR(e)}function aR(e){this._context=e}function lR(e){return new iR(e)}function uR(e){return new sR(e)}function cR(e){this._context=e}function dR(e){var t,n,r=e.length-1,o=new Array(r),i=new Array(r),s=new Array(r);for(o[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,i[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/i[t-1],i[t]-=n,s[t]-=n*s[t-1];for(o[r-1]=s[r-1]/i[r-1],t=r-2;t>=0;--t)o[t]=(s[t]-o[t+1])/i[t];for(i[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-o[t+1];return[o,i]}function pR(e){return new cR(e)}function hR(e,t){this._context=e,this._t=t}function fR(e){return new hR(e,.5)}function gR(e){return new hR(e,0)}function mR(e){return new hR(e,1)}function bR(e,t){if((o=e.length)>1)for(var n,r,o,i=1,s=e[t[0]],a=s.length;i<o;++i)for(r=s,s=e[t[i]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function vR(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function wR(e,t){return e[t]}function yR(e){const t=[];return t.key=e,t}function xR(){var e=sM([]),t=vR,n=bR,r=wR;function o(o){var i,s,a=Array.from(e.apply(this,arguments),yR),l=a.length,u=-1;for(const e of o)for(i=0,++u;i<l;++i)(a[i][u]=[0,+r(e,a[i].key,u,o)]).data=e;for(i=0,s=AM(t(a));i<l;++i)a[s[i]].index=i;return n(a,s),a}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:sM(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"==typeof e?e:sM(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?vR:"function"==typeof e?e:sM(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?bR:e,o):n},o}function CR(e,t){if((r=e.length)>0){for(var n,r,o,i=0,s=e[0].length;i<s;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}bR(e,t)}}function SR(e,t){if((n=e.length)>0){for(var n,r=0,o=e[t[0]],i=o.length;r<i;++r){for(var s=0,a=0;s<n;++s)a+=e[s][r][1]||0;o[r][1]+=o[r][0]=-a/2}bR(e,t)}}function MR(e,t){if((o=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,o,i=0,s=1;s<r;++s){for(var a=0,l=0,u=0;a<o;++a){for(var c=e[t[a]],d=c[s][1]||0,p=(d-(c[s-1][1]||0))/2,h=0;h<a;++h){var f=e[t[h]];p+=(f[s][1]||0)-(f[s-1][1]||0)}l+=d,u+=p*d}n[s-1][1]+=n[s-1][0]=i,l&&(i-=u/l)}n[s-1][1]+=n[s-1][0]=i,bR(e,t)}}function RR(e){var t=e.map(IR);return vR(e).sort(function(e,n){return t[e]-t[n]})}function IR(e){for(var t,n=-1,r=0,o=e.length,i=-1/0;++n<o;)(t=+e[n][1])>i&&(i=t,r=n);return r}function PR(e){var t=e.map(kR);return vR(e).sort(function(e,n){return t[e]-t[n]})}function kR(e){for(var t,n=0,r=-1,o=e.length;++r<o;)(t=+e[r][1])&&(n+=t);return n}KM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:UM(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:UM(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},XM.prototype={areaStart:WM,areaEnd:WM,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:UM(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},QM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:UM(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},JM.prototype={areaStart:WM,areaEnd:WM,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},iR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:oR(this,this._t0,rR(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,oR(this,rR(this,n=nR(this,e,t)),n);break;default:oR(this,this._t0,n=nR(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(sR.prototype=Object.create(iR.prototype)).point=function(e,t){iR.prototype.point.call(this,t,e)},aR.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,i){this._context.bezierCurveTo(t,e,r,n,i,o)}},cR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=dR(e),o=dR(t),i=0,s=1;s<n;++i,++s)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],e[s],t[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},hR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const ER={appearance:RR,ascending:PR,descending:function(e){return PR(e).reverse()},insideOut:function(e){var t,n,r=e.length,o=e.map(kR),i=RR(e),s=0,a=0,l=[],u=[];for(t=0;t<r;++t)n=i[t],s<a?(s+=o[n],l.push(n)):(a+=o[n],u.push(n));return u.reverse().concat(l)},none:vR,reverse:function(e){return vR(e).reverse()}},TR={expand:CR,diverging:function(e,t){if((a=e.length)>0)for(var n,r,o,i,s,a,l=0,u=e[t[0]].length;l<u;++l)for(i=s=0,n=0;n<a;++n)(o=(r=e[t[n]][l])[1]-r[0])>0?(r[0]=i,r[1]=i+=o):o<0?(r[1]=s,r[0]=s+=o):(r[0]=0,r[1]=o)},none:bR,silhouette:SR,wiggle:MR},DR=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,o=[],i={};return n.forEach(e=>{const{stack:n,stackOrder:s,stackOffset:a}=t[e];void 0===n?o.push({ids:[e],stackingOrder:ER.none,stackingOffset:TR.none}):void 0===i[n]?(i[n]=o.length,o.push({ids:[e],stackingOrder:ER[s??r?.stackOrder??"none"],stackingOffset:TR[a??r?.stackOffset??"diverging"]})):(o[i[n]].ids.push(e),void 0!==s&&(o[i[n]].stackingOrder=ER[s]),void 0!==a&&(o[i[n]].stackingOffset=TR[a]))}),o},FR=e=>null==e?"":e.toLocaleString();function AR(e,t){return"function"==typeof e?e(t):e}function OR(e){return e.colorGetter?e.colorGetter:()=>e.color}function HR(e,t){const n={};return Object.keys(e).forEach(r=>{n[r]=a({},e[r],{valueFormatter:e[r].valueFormatter??t})}),n}const $R=(e,t)=>void 0===e?t:Math.PI*e/180;function zR(e,t){if("number"==typeof e)return e;if("100%"===e)return t;if(e.endsWith("%")){const n=Number.parseFloat(e.slice(0,e.length-1));if(!Number.isNaN(n))return n*t/100}if(e.endsWith("px")){const t=Number.parseFloat(e.slice(0,e.length-2));if(!Number.isNaN(t))return t}throw new Error(`MUI X Charts: Received an unknown value "${e}". It should be a number, or a string with a percentage value.`)}const LR={bar:{seriesProcessor:(e,t)=>{const{seriesOrder:n,series:r}=e,o=DR(e),i=t??[];n.forEach(e=>{const n=r[e].data;if(void 0!==n)n.forEach((t,n)=>{i.length<=n?i.push({[e]:t}):i[n][e]=t});else if(void 0===t)throw new Error([`MUI X Charts: bar series with id='${e}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join("\n"))});const s={};return o.forEach(e=>{const{ids:n,stackingOffset:o,stackingOrder:l}=e,u=xR().keys(n.map(e=>{const t=r[e].dataKey;return void 0===r[e].data&&void 0!==t?t:e})).value((e,t)=>e[t]??0).order(l).offset(o)(i);n.forEach((e,n)=>{const o=r[e].dataKey;s[e]=a({layout:"vertical",labelMarkType:"square",minBarSize:0,valueFormatter:r[e].valueFormatter??FR},r[e],{data:o?t.map(e=>{const t=e[o];return"number"==typeof t?t:null}):r[e].data,stackedData:u[n].map(([e,t])=>[e,t])})})}),{seriesOrder:n,stackingGroups:o,series:s}},colorProcessor:(e,t,n)=>{const r="vertical"===e.layout,o=r?t?.colorScale:n?.colorScale,i=r?n?.colorScale:t?.colorScale,s=r?t?.data:n?.data,a=OR(e);return i?t=>{if(void 0===t)return e.color;const n=e.data[t],r=null===n?a({value:n,dataIndex:t}):i(n);return null===r?a({value:n,dataIndex:t}):r}:o&&s?t=>{if(void 0===t)return e.color;const n=s[t],r=null===n?a({value:n,dataIndex:t}):o(n);return null===r?a({value:n,dataIndex:t}):r}:t=>{if(void 0===t)return e.color;const n=e.data[t];return a({value:n,dataIndex:t})}},legendGetter:e=>{const{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>{const r=AR(n[t].label,"legend");return void 0===r||e.push({markType:n[t].labelMarkType,id:t,seriesId:t,color:n[t].color,label:r}),e},[])},tooltipGetter:e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||void 0===r.dataIndex)return null;const o=AR(t.label,"tooltip"),i=t.data[r.dataIndex];if(null==i)return null;const s=t.valueFormatter(i,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:o,value:i,formattedValue:s,markType:t.labelMarkType}},tooltipItemPositionGetter:e=>{const{series:t,identifier:n,axesConfig:r,placement:o}=e;if(!n||void 0===n.dataIndex)return null;const i=t.bar?.series[n.seriesId];if(null==t.bar||null==i)return null;if(void 0===r.x||void 0===r.y)return null;const s=function(e){const{verticalLayout:t,xAxisConfig:n,yAxisConfig:r,series:o,dataIndex:i,numberOfGroups:s,groupIndex:a}=e,l=t?n:r,u=(t?r.reverse:n.reverse)??!1,{barWidth:c,offset:d}=function({bandWidth:e,numberOfGroups:t,gapRatio:n}){if(0===n)return{barWidth:e/t,offset:0};const r=e/(t+(t-1)*n);return{barWidth:r,offset:n*r}}({bandWidth:l.scale.bandwidth(),numberOfGroups:s,gapRatio:l.barGapRatio}),p=a*(c+d),h=n.scale,f=r.scale,g=l.data[i],m=o.data[i];if(null==m)return null;const b=o.stackedData[i].map(e=>t?f(e):h(e)),v=Math.round(Math.min(...b)),w=Math.round(Math.max(...b)),y=0===m?0:Math.max(o.minBarSize,w-v),x=function(e,t,n){const r=e&&t>0||!e&&t<0;return n?!r:r}(t,m,u)?w-y:v;return{x:t?h(g)+p:x,y:t?x:f(g)+p,height:t?y:c,width:t?c:y}}({verticalLayout:"vertical"===i.layout,xAxisConfig:r.x,yAxisConfig:r.y,series:i,dataIndex:n.dataIndex,numberOfGroups:t.bar.stackingGroups.length,groupIndex:t.bar.stackingGroups.findIndex(e=>e.ids.includes(i.id))});if(null==s)return null;const{x:a,y:l,width:u,height:c}=s;switch(o){case"right":return{x:a+u,y:l+c/2};case"bottom":return{x:a+u/2,y:l+c};case"left":return{x:a,y:l+c/2};default:return{x:a+u/2,y:l}}},axisTooltipGetter:e=>Object.values(e).map(e=>"horizontal"===e.layout?{direction:"y",axisId:e.yAxisId}:{direction:"x",axisId:e.xAxisId}),xExtremumGetter:e=>Object.keys(e.series).some(t=>"horizontal"===e.series[t].layout)?iM("x")(e):oM(e),yExtremumGetter:e=>Object.keys(e.series).some(t=>"horizontal"===e.series[t].layout)?oM(e):iM("y")(e),getSeriesWithDefaultValues:(e,t,n)=>a({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})},scatter:{seriesProcessor:({series:e,seriesOrder:t},n)=>({series:Object.fromEntries(Object.entries(e).map(([e,t])=>{const r=t?.datasetKeys,o=["x","y"].filter(e=>"string"!=typeof r?.[e]);if(t?.datasetKeys&&o.length>0)throw new Error([`MUI X Charts: scatter series with id='${e}' has incomplete datasetKeys.`,`Properties ${o.map(e=>`"${e}"`).join(", ")} are missing.`].join("\n"));const i=r?n?.map(e=>({x:e[r.x]??null,y:e[r.y]??null,z:r.z&&e[r.z],id:r.id&&e[r.id]}))??[]:t.data??[];return[e,a({labelMarkType:"circle",markerSize:4},t,{preview:a({markerSize:1},t?.preview),data:i,valueFormatter:t.valueFormatter??(e=>e&&`(${e.x}, ${e.y})`)})]})),seriesOrder:t}),colorProcessor:(e,t,n,r)=>{const o=r?.colorScale,i=n?.colorScale,s=t?.colorScale,a=OR(e);return o?t=>{if(void 0===t)return e.color;if(void 0!==r?.data?.[t]){const e=o(r?.data?.[t]);if(null!==e)return e}const n=e.data[t],i=null===n?a({value:n,dataIndex:t}):o(n.z);return null===i?a({value:n,dataIndex:t}):i}:i?t=>{if(void 0===t)return e.color;const n=e.data[t],r=null===n?a({value:n,dataIndex:t}):i(n.y);return null===r?a({value:n,dataIndex:t}):r}:s?t=>{if(void 0===t)return e.color;const n=e.data[t],r=null===n?a({value:n,dataIndex:t}):s(n.x);return null===r?a({value:n,dataIndex:t}):r}:t=>{if(void 0===t)return e.color;const n=e.data[t];return a({value:n,dataIndex:t})}},legendGetter:e=>{const{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>{const r=AR(n[t].label,"legend");return void 0===r||e.push({markType:n[t].labelMarkType,id:t,seriesId:t,color:n[t].color,label:r}),e},[])},tooltipGetter:e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||void 0===r.dataIndex)return null;const o=AR(t.label,"tooltip"),i=t.data[r.dataIndex],s=t.valueFormatter(i,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:o,value:i,formattedValue:s,markType:t.labelMarkType}},tooltipItemPositionGetter:e=>{const{series:t,identifier:n,axesConfig:r}=e;if(!n||void 0===n.dataIndex)return null;const o=t.scatter?.series[n.seriesId];if(null==o)return null;if(void 0===r.x||void 0===r.y)return null;const i=o.data?.[n.dataIndex].x,s=o.data?.[n.dataIndex].y;return null==i||null==s?null:{x:r.x.scale(i),y:r.y.scale(s)}},xExtremumGetter:e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:o}=e;let i=1/0,s=-1/0;for(const a in t){if(!Object.hasOwn(t,a))continue;const e=t[a].xAxisId;if(!(e===n.id||void 0===e&&r))continue;const l=o?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),u=t[a].data??[];for(let t=0;t<u.length;t+=1){const e=u[t];l&&!l(e,t)||null!==e.x&&(e.x<i&&(i=e.x),e.x>s&&(s=e.x))}}return[i,s]},yExtremumGetter:e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:o}=e;let i=1/0,s=-1/0;for(const a in t){if(!Object.hasOwn(t,a))continue;const e=t[a].yAxisId;if(!(e===n.id||void 0===e&&r))continue;const l=o?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),u=t[a].data??[];for(let t=0;t<u.length;t+=1){const e=u[t];l&&!l(e,t)||null!==e.y&&(e.y<i&&(i=e.y),e.y>s&&(s=e.y))}}return[i,s]},getSeriesWithDefaultValues:(e,t,n)=>a({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})},line:{colorProcessor:(e,t,n)=>{const r=n?.colorScale,o=t?.colorScale,i=OR(e);return r?t=>{if(void 0===t)return e.color;const n=e.data[t],o=null===n?i({value:n,dataIndex:t}):r(n);return null===o?i({value:n,dataIndex:t}):o}:o?n=>{if(void 0===n)return e.color;const r=t.data?.[n],s=null===r?i({value:r,dataIndex:n}):o(r);return null===s?i({value:r,dataIndex:n}):s}:t=>{if(void 0===t)return e.color;const n=e.data[t];return i({value:n,dataIndex:t})}},seriesProcessor:(e,t)=>{const{seriesOrder:n,series:r}=e,o=DR(a({},e,{defaultStrategy:{stackOffset:"none"}})),i=t??[];n.forEach(e=>{const t=r[e].data;void 0!==t&&t.forEach((t,n)=>{i.length<=n?i.push({[e]:t}):i[n][e]=t})});const s={};return o.forEach(e=>{const{ids:n,stackingOrder:o,stackingOffset:l}=e,u=xR().keys(n.map(e=>{const t=r[e].dataKey;return void 0===r[e].data&&void 0!==t?t:e})).value((e,t)=>e[t]??0).order(o).offset(l)(i);n.forEach((e,n)=>{const o=r[e].dataKey;s[e]=a({labelMarkType:"line"},r[e],{data:o?t.map(e=>{const t=e[o];return"number"==typeof t?t:null}):r[e].data,stackedData:u[n].map(([e,t])=>[e,t])})})}),{seriesOrder:n,stackingGroups:o,series:HR(s,e=>null==e?"":e.toLocaleString())}},legendGetter:e=>{const{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>{const r=AR(n[t].label,"legend");return void 0===r||e.push({markType:n[t].labelMarkType,id:t,seriesId:t,color:n[t].color,label:r}),e},[])},tooltipGetter:e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||void 0===r.dataIndex)return null;const o=AR(t.label,"tooltip"),i=t.data[r.dataIndex],s=t.valueFormatter(i,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:o,value:i,formattedValue:s,markType:t.labelMarkType}},tooltipItemPositionGetter:e=>{const{series:t,identifier:n,axesConfig:r}=e;if(!n||void 0===n.dataIndex)return null;const o=t.line?.series[n.seriesId];if(null==o)return null;if(void 0===r.x||void 0===r.y)return null;const i=r.x.data?.[n.dataIndex],s=o.data[n.dataIndex];return null==i||null==s?null:{x:r.x.scale(i),y:r.y.scale(s)}},axisTooltipGetter:e=>Object.values(e).map(e=>({direction:"x",axisId:e.xAxisId})),xExtremumGetter:e=>{const{axis:t}=e;return nM(t.data??[])},yExtremumGetter:e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:o}=e;return Object.keys(t).filter(e=>{const o=t[e].yAxisId;return o===n.id||r&&void 0===o}).reduce((e,i)=>{const{area:s,stackedData:a,data:l}=t[i],u=void 0!==s,c=o?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[i].xAxisId,seriesYAxisId:t[i].yAxisId}),d=function(e,t,n,r){return n.reduce((n,o,i)=>{if(null===t[i])return n;const[s,a]=e(o);return!r||r({y:s,x:null},i)&&r({y:a,x:null},i)?[Math.min(s,a,n[0]),Math.max(s,a,n[1])]:n},[1/0,-1/0])}(u&&"log"!==n.scaleType&&"string"!=typeof t[i].baseline?e=>e:e=>[e[1],e[1]],l,a,c),[p,h]=d;return[Math.min(p,e[0]),Math.max(h,e[1])]},[1/0,-1/0])},getSeriesWithDefaultValues:(e,t,n)=>a({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})},pie:{colorProcessor:e=>t=>e.data[t].color,seriesProcessor:e=>{const{seriesOrder:t,series:n}=e,r={};return t.forEach(e=>{const t=function(){var e=GM,t=NM,n=null,r=sM(0),o=sM(bM),i=sM(0);function s(s){var a,l,u,c,d,p=(s=AM(s)).length,h=0,f=new Array(p),g=new Array(p),m=+r.apply(this,arguments),b=Math.min(bM,Math.max(-bM,o.apply(this,arguments)-m)),v=Math.min(Math.abs(b)/p,i.apply(this,arguments)),w=v*(b<0?-1:1);for(a=0;a<p;++a)(d=g[f[a]=a]=+e(s[a],a,s))>0&&(h+=d);for(null!=t?f.sort(function(e,n){return t(g[e],g[n])}):null!=n&&f.sort(function(e,t){return n(s[e],s[t])}),a=0,u=h?(b-p*w)/h:0;a<p;++a,m=c)l=f[a],c=m+((d=g[l])>0?d*u:0)+w,g[l]={data:s[l],index:a,value:d,startAngle:m,endAngle:c,padAngle:v};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:sM(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:sM(+e),s):r},s.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:sM(+e),s):o},s.padAngle=function(e){return arguments.length?(i="function"==typeof e?e:sM(+e),s):i},s}().startAngle($R(n[e].startAngle??0)).endAngle($R(n[e].endAngle??360)).padAngle($R(n[e].paddingAngle??0)).sortValues(((e="none")=>{if("function"==typeof e)return e;switch(e){case"none":default:return null;case"desc":return(e,t)=>t-e;case"asc":return(e,t)=>e-t}})(n[e].sortingValues??"none"))(n[e].data.map(e=>e.value));r[e]=a({labelMarkType:"circle",valueFormatter:e=>e.value.toLocaleString()},n[e],{data:n[e].data.map((n,r)=>a({},n,{id:n.id??`auto-generated-pie-id-${e}-${r}`},t[r])).map((t,r)=>a({labelMarkType:"circle"},t,{formattedValue:n[e].valueFormatter?.(a({},t,{label:AR(t.label,"arc")}),{dataIndex:r})??t.value.toLocaleString()}))})}),{seriesOrder:t,series:r}},legendGetter:e=>{const{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>(n[t].data.forEach((r,o)=>{const i=AR(r.label,"legend");void 0!==i&&e.push({markType:r.labelMarkType??n[t].labelMarkType,id:r.id??o,seriesId:t,color:r.color,label:i,itemId:r.id??o})}),e),[])},tooltipGetter:e=>{const{series:t,getColor:n,identifier:r}=e;if(!r||void 0===r.dataIndex)return null;const o=t.data[r.dataIndex];if(null==o)return null;const i=AR(o.label,"tooltip"),s=a({},o,{label:i}),l=t.valueFormatter(s,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:s,formattedValue:l,markType:o.labelMarkType??t.labelMarkType}},tooltipItemPositionGetter:e=>{const{series:t,drawingArea:n,identifier:r,placement:o}=e;if(!r||void 0===r.dataIndex)return null;const i=t.pie?.series[r.seriesId];if(null==i)return null;const{cx:s,cy:a,availableRadius:l}=function(e,t){const{height:n,width:r}=t,{cx:o,cy:i}=e,s=Math.min(r,n)/2;return{cx:zR(o??"50%",r),cy:zR(i??"50%",n),availableRadius:s}}({cx:i.cx,cy:i.cy},n),{data:u,innerRadius:c=0,outerRadius:d}=i,p=Math.max(0,zR(c??0,l)),h=Math.max(0,zR(d??l,l)),f=u[r.dataIndex];if(!f)return null;const g=[[p,f.startAngle],[p,f.endAngle],[h,f.startAngle],[h,f.endAngle]].map(([e,t])=>({x:s+e*Math.sin(t),y:a-e*Math.cos(t)})),[m,b]=nM(g.map(e=>e.x)),[v,w]=nM(g.map(e=>e.y));switch(o){case"bottom":return{x:(b+m)/2,y:w};case"left":return{x:m,y:(w+v)/2};case"right":return{x:b,y:(w+v)/2};default:return{x:(b+m)/2,y:v}}},getSeriesWithDefaultValues:(e,t,n)=>a({},e,{id:e.id??`auto-generated-id-${t}`,data:e.data.map((e,t)=>a({},e,{color:e.color??n[t%n.length]}))})}},jR=[JS,IS,XS,tM];function NR(e){const{children:t,plugins:n=jR,pluginParams:r={},seriesConfig:o=LR}=e,{contextValue:s}=gb(n,r,o);return i.jsx(mb.Provider,{value:s,children:t})}const GR=()=>{const t=e.useContext(mb);if(null==t)throw new Error(["MUI X Charts: Could not find the Chart context.","It looks like you rendered your component outside of a ChartDataProvider.","This can also happen if you are bundling multiple versions of the library."].join("\n"));return t};function _R(){const e=GR();if(!e)throw new Error(["MUI X Charts: Could not find the charts context.","It looks like you rendered your component outside of a ChartContainer parent component."].join("\n"));return e.store}function VR(){const e=_R();return um(e,wm)}function BR(){const e=_R();return um(e,Tm)}var WR,UR;var KR=function(){if(UR)return WR;UR=1;var e=.1,t="function"==typeof Float32Array;function n(e,t){return 1-3*t+3*e}function r(e,t){return 3*t-6*e}function o(e){return 3*e}function i(e,t,i){return((n(t,i)*e+r(t,i))*e+o(t))*e}function s(e,t,i){return 3*n(t,i)*e*e+2*r(t,i)*e+o(t)}function a(e){return e}return WR=function(n,r,o,l){if(!(0<=n&&n<=1&&0<=o&&o<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===r&&o===l)return a;for(var u=t?new Float32Array(11):new Array(11),c=0;c<11;++c)u[c]=i(c*e,n,o);function d(t){for(var r=0,a=1;10!==a&&u[a]<=t;++a)r+=e;--a;var l=r+(t-u[a])/(u[a+1]-u[a])*e,c=s(l,n,o);return c>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var a=s(t,n,r);if(0===a)return t;t-=(i(t,n,r)-e)/a}return t}(t,l,n,o):0===c?l:function(e,t,n,r,o){var s,a,l=0;do{(s=i(a=t+(n-t)/2,r,o)-e)>0?n=a:t=a}while(Math.abs(s)>1e-7&&++l<10);return a}(t,r,r+e,n,o)}return function(e){return 0===e?0:1===e?1:i(d(e),r,l)}}}();const qR=r(KR)(.66,0,.34,1);var XR,YR,QR=0,ZR=0,JR=0,eI=0,tI=0,nI=0,rI="object"==typeof performance&&performance.now?performance:Date,oI="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function iI(){return tI||(oI(sI),tI=rI.now()+nI)}function sI(){tI=0}function aI(){this._call=this._time=this._next=null}function lI(e,t,n){var r=new aI;return r.restart(e,t,n),r}function uI(){tI=(eI=rI.now())+nI,QR=ZR=0;try{!function(){iI(),++QR;for(var e,t=XR;t;)(e=tI-t._time)>=0&&t._call.call(void 0,e),t=t._next;--QR}()}finally{QR=0,function(){var e,t,n=XR,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:XR=t);YR=e,dI(r)}(),tI=0}}function cI(){var e=rI.now(),t=e-eI;t>1e3&&(nI-=t,eI=e)}function dI(e){QR||(ZR&&(ZR=clearTimeout(ZR)),e-tI>24?(e<1/0&&(ZR=setTimeout(uI,e-rI.now()-nI)),JR&&(JR=clearInterval(JR))):(JR||(eI=rI.now(),JR=setInterval(cI,1e3)),QR=1,oI(uI)))}aI.prototype=lI.prototype={constructor:aI,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?iI():+n)+(null==t?0:+t),this._next||YR===this||(YR?YR._next=this:XR=this,YR=this),this._call=e,this._time=n,dI()},stop:function(){this._call&&(this._call=null,this._time=1/0,dI())}};class pI{elapsed=0;timer=null;constructor(e,t,n){this.duration=e,this.easingFn=t,this.onTickCallback=n,this.resume()}get running(){return null!==this.timer}timerCallback(e){this.elapsed=Math.min(e,this.duration);const t=0===this.duration?1:this.elapsed/this.duration,n=this.easingFn(t);this.onTickCallback(n),this.elapsed>=this.duration&&this.stop()}resume(){if(this.running||this.elapsed>=this.duration)return this;const e=iI()-this.elapsed;return this.timer=lI(e=>this.timerCallback(e),0,e),this}stop(){return this.running?(this.timer&&(this.timer.stop(),this.timer=null),this):this}finish(){var e,t,n,r;return this.stop(),e=()=>this.timerCallback(this.duration),r=new aI,t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),this}}function hI(t,{createInterpolator:n,applyProps:r,skip:o,initialProps:i=t}){const s=e.useRef(i),a=e.useRef(null),l=e.useRef(null),u=e.useRef(t);oe(()=>{u.current=t},[t]),oe(()=>{o&&(a.current?.finish(),a.current=null,l.current=null,s.current=t)},[t,o]);const c=e.useCallback(e=>{const o=s.current,i=n(o,t);a.current=new pI(300,qR,t=>{const n=i(t);s.current=n,r(e,n)})},[r,n,t]);return[e.useCallback(e=>{if(null===e)return void a.current?.stop();const n=l.current;if(n===e){if(function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){const r=n[o];if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1}return!0}(u.current,t))return void a.current?.resume();a.current?.stop()}n&&a.current?.stop(),l.current=e,!a.current&&o||c(e)},[c,t,o]),s.current]}function fI(t){const{isReversed:n,gradientId:r,size:o,direction:s,scale:a,colorMap:l}=t;return o<=0?null:i.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${s}${n?1:2}`]:`${o}px`,gradientUnits:"userSpaceOnUse",children:l.thresholds.map((t,r)=>{const s=a(t);if(void 0===s)return null;const u=n?1-s/o:s/o;return Number.isNaN(u)?null:i.jsxs(e.Fragment,{children:[i.jsx("stop",{offset:u,stopColor:l.colors[r],stopOpacity:1}),i.jsx("stop",{offset:u,stopColor:l.colors[r+1],stopOpacity:1})]},t.toString()+r)})})}function gI(e){const{gradientUnits:t,isReversed:n,gradientId:r,size:o,direction:s,scale:a,colorScale:l,colorMap:u}=e,c=[u.min??0,u.max??100],d=c.map(a).filter(e=>void 0!==e);if(2!==d.length)return null;const p="number"==typeof c[0]?Lv(c[0],c[1]):zv(c[0],c[1]),h=Math.round((Math.max(...d)-Math.min(...d))/10),f=`${c[0]}-${c[1]}-`;return i.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${s}${n?1:2}`]:"objectBoundingBox"===t?1:`${o}px`,gradientUnits:t??"userSpaceOnUse",children:Array.from({length:h+1},(e,t)=>{const r=p(t/h);if(void 0===r)return null;const s=a(r);if(void 0===s)return null;const u=n?1-s/o:s/o,c=l(r);return null===c?null:i.jsx("stop",{offset:u,stopColor:c,stopOpacity:1},f+t)})})}function mI(e){const{isReversed:t,gradientId:n,colorScale:r,colorMap:o}=e,s=[o.min??0,o.max??100],l="number"==typeof s[0]?Lv(s[0],s[1]):zv(s[0],s[1]),u=`${s[0]}-${s[1]}-`;return i.jsx("linearGradient",a({id:n},(e=>e?{x1:"1",x2:"0",y1:"0",y2:"0"}:{x1:"0",x2:"1",y1:"0",y2:"0"})(t),{gradientUnits:"objectBoundingBox",children:Array.from({length:11},(e,t)=>{const n=t/10,o=l(n);if(void 0===o)return null;const s=r(o);return null===s?null:i.jsx("stop",{offset:n,stopColor:s,stopOpacity:1},u+t)})}))}function bI(){const{top:t,height:n,bottom:r,left:o,width:s,right:a}=VR(),l=t+n+r,u=o+s+a,c=function(){const t=BR();return e.useCallback(e=>`${t}-gradient-${e}`,[t])}(),d=function(){const t=BR();return e.useCallback(e=>`${t}-gradient-${e}-object-bound`,[t])}(),{xAxis:p,xAxisIds:h}=function(){const e=_R(),{axis:t,axisIds:n}=um(e,vS);return{xAxis:t,xAxisIds:n}}(),{yAxis:f,yAxisIds:g}=function(){const e=_R(),{axis:t,axisIds:n}=um(e,wS);return{yAxis:t,yAxisIds:n}}(),{zAxis:m,zAxisIds:b}=function(){const e=_R(),{axis:t,axisIds:n}=um(e,eM)??{axis:{},axisIds:[]};return{zAxis:t,zAxisIds:n}}(),v=g.filter(e=>void 0!==f[e].colorMap),w=h.filter(e=>void 0!==p[e].colorMap),y=b.filter(e=>void 0!==m[e].colorMap);return 0===v.length&&0===w.length&&0===y.length?null:i.jsxs("defs",{children:[v.map(t=>{const n=c(t),r=d(t),{colorMap:o,scale:s,colorScale:a,reverse:u}=f[t];return"piecewise"===o?.type?i.jsx(fI,{isReversed:!u,scale:s,colorMap:o,size:l,gradientId:n,direction:"y"},n):"continuous"===o?.type?i.jsxs(e.Fragment,{children:[i.jsx(gI,{isReversed:!u,scale:s,colorScale:a,colorMap:o,size:l,gradientId:n,direction:"y"}),i.jsx(mI,{isReversed:u,colorScale:a,colorMap:o,gradientId:r})]},n):null}),w.map(t=>{const n=c(t),r=d(t),{colorMap:o,scale:s,reverse:a,colorScale:l}=p[t];return"piecewise"===o?.type?i.jsx(fI,{isReversed:a,scale:s,colorMap:o,size:u,gradientId:n,direction:"x"},n):"continuous"===o?.type?i.jsxs(e.Fragment,{children:[i.jsx(gI,{isReversed:a,scale:s,colorScale:l,colorMap:o,size:u,gradientId:n,direction:"x"}),i.jsx(mI,{isReversed:a,colorScale:l,colorMap:o,gradientId:r})]},n):null}),y.map(e=>{const t=d(e),{colorMap:n,colorScale:r}=m[e];return"continuous"===n?.type?i.jsx(mI,{colorScale:r,colorMap:n,gradientId:t},t):null})]})}function vI(e){return ne("MuiChartsSurface",e)}re("MuiChartsSurface",["root"]);const wI=["children","className","title","desc"],yI=h("svg",{name:"MuiChartsSurface",slot:"Root"})(({ownerState:e,theme:t})=>({width:e.width??"100%",height:e.height??"100%",display:"flex",position:"relative",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden",touchAction:e.hasZoom?"pan-y":void 0,userSelect:"none",gridArea:"chart","&:focus":{outline:"none"},"&:focus-visible":{outline:`${(t.vars??t).palette.text.primary} solid 2px`,"&[data-has-focused-item=true]":{outline:"none"}},"& [data-focused=true]":{outline:`${(t.vars??t).palette.text.primary} solid 2px`}})),xI=e.forwardRef(function(e,t){const n=_R(),r=um(n,ym),o=um(n,xm),l=um(n,Cm),u=um(n,Sm),c=um(n,LS),d=um(n,OS),p=um(n,oS),h=function(){const e=GR();if(!e)throw new Error(["MUI X Charts: Could not find the svg ref context.","It looks like you rendered your component outside of a ChartContainer parent component."].join("\n"));return e.svgRef}(),f=A(h,t),g=we({props:e,name:"MuiChartsSurface"}),{children:m,className:b,title:v,desc:w}=g,y=s(g,wI),x=ie({root:["root"]},vI),C=o>0&&r>0;return i.jsxs(yI,a({ownerState:{width:l,height:u,hasZoom:p},viewBox:`0 0 ${r} ${o}`,className:O(x.root,b),tabIndex:c?0:void 0,"data-has-focused-item":d||void 0},y,{ref:f,children:[v&&i.jsx("title",{children:v}),w&&i.jsx("desc",{children:w}),i.jsx(bI,{}),C&&m]}))});function CI(e){const t=$R(e);return[Math.sin(t),-Math.cos(t)]}const SI=e.createContext({value:null,valueMin:0,valueMax:0,startAngle:0,endAngle:0,innerRadius:0,outerRadius:0,cornerRadius:0,cx:0,cy:0,maxRadius:0,valueAngle:null});function MI(t){const{value:n=null,valueMin:r=0,valueMax:o=100,startAngle:s=0,endAngle:a=360,outerRadius:l,innerRadius:u,cornerRadius:c,cx:d,cy:p,children:h}=t,{left:f,top:g,width:m,height:b}=VR(),v=function(e,t){const n=[[0,0],CI(e),CI(t)],r=Math.min(e,t),o=Math.max(e,t),i=90*Math.floor(r/90);for(let c=1;c<=4;c+=1){const e=i+90*c;e<o&&n.push(CI(e))}const s=Math.min(...n.map(([e])=>e)),a=Math.max(...n.map(([e])=>e)),l=Math.min(...n.map(([,e])=>e)),u=Math.max(...n.map(([,e])=>e));return{cx:-s/(a-s),cy:-l/(u-l),minX:s,maxX:a,minY:l,maxY:u}}(s,a),w=d?zR(d,m):v.cx*m,y=p?zR(p,b):v.cy*b;let x=f+w,C=g+y;const S=function(e,t,n,r,{minX:o,maxX:i,minY:s,maxY:a}){return Math.min(...[{ratio:Math.abs(o),space:e},{ratio:Math.abs(i),space:n-e},{ratio:Math.abs(s),space:t},{ratio:Math.abs(a),space:r-t}].map(({ratio:e,space:t})=>e<1e-5?1/0:t/e))}(w,y,m,b,v);if(void 0===d){const e=S*(v.maxX-v.minX);x=f+(m-e)/2+v.cx*e}if(void 0===p){const e=S*(v.maxY-v.minY);C=g+(b-e)/2+v.cy*e}const M=zR(l??S,S),R=zR(u??"80%",S),I=zR(c??0,M-R),P=e.useMemo(()=>{const e=$R(s),t=$R(a);return{value:n,valueMin:r,valueMax:o,startAngle:e,endAngle:t,outerRadius:M,innerRadius:R,cornerRadius:I,cx:x,cy:C,maxRadius:S,valueAngle:null===n?null:e+(t-e)*(n-r)/(o-r)}},[n,r,o,s,a,M,R,I,x,C,S]);return i.jsx(SI.Provider,{value:P,children:h})}function RI(){return e.useContext(SI)}const II=["width","height","margin","title","desc","value","valueMin","valueMax","startAngle","endAngle","outerRadius","innerRadius","cornerRadius","cx","cy","children"],PI=h("g")(({theme:e})=>({"& text":{fill:(e.vars||e).palette.text.primary}})),kI=e.forwardRef(function(e,t){const{width:n,height:r,margin:o,title:l,desc:u,value:c,valueMin:d=0,valueMax:p=100,startAngle:h,endAngle:f,outerRadius:g,innerRadius:m,cornerRadius:b,cx:v,cy:w,children:y}=e,x=s(e,II);return i.jsx(NR,{pluginParams:{width:n,height:r,margin:Mm(o,{left:10,right:10,top:10,bottom:10})},plugins:[],children:i.jsx(MI,{value:c,valueMin:d,valueMax:p,startAngle:h,endAngle:f,outerRadius:g,innerRadius:m,cornerRadius:b,cx:v,cy:w,children:i.jsx(xI,a({title:l,desc:u,role:"meter","aria-valuenow":null===c?void 0:c,"aria-valuemin":d,"aria-valuemax":p},x,{ref:t,children:i.jsx(PI,{"aria-hidden":"true",children:y})}))})})});function EI(e,t){const n=Lv(e.startAngle,t.startAngle),r=Lv(e.endAngle,t.endAngle),o=Lv(e.innerRadius,t.innerRadius),i=Lv(e.outerRadius,t.outerRadius),s=Lv(e.cornerRadius,t.cornerRadius);return e=>({startAngle:n(e),endAngle:r(e),innerRadius:o(e),outerRadius:i(e),cornerRadius:s(e)})}function TI(e){return function(e,{createInterpolator:t,transformProps:n,applyProps:r,skip:o,initialProps:i=e,ref:s}){const l=n??(e=>e),[u,c]=hI(e,{initialProps:i,createInterpolator:t,applyProps:(e,t)=>r(e,l(t)),skip:o}),d=n(o?e:c);return a({},d,{ref:A(u,s)})}({startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},{createInterpolator:EI,transformProps:e=>({d:FM().cornerRadius(e.cornerRadius)({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle})}),applyProps(e,t){e.setAttribute("d",t.d)},initialProps:{startAngle:e.startAngle,endAngle:e.startAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},skip:e.skipAnimation,ref:e.ref})}function DI(e){return ne("MuiGauge",e)}const FI=re("MuiGauge",["root","valueArc","referenceArc","valueText"]),AI=["className"],OI=["cx","cy","startAngle","endAngle","cornerRadius","innerRadius","outerRadius","skipAnimation"],HI=h("path",{name:"MuiGauge",slot:"ValueArc"})(({theme:e})=>({fill:(e.vars||e).palette.primary.main}));function $I(e){let{className:t}=e,n=s(e,AI);const{value:r,valueMin:o,valueMax:l,startAngle:u,endAngle:c,outerRadius:d,innerRadius:p,cornerRadius:h,cx:f,cy:g}=RI();if(null===r)return null;const m=u+(r-o)/(l-o)*(c-u);return i.jsx(zI,a({},n,{className:O(FI.valueArc,t),cx:f,cy:g,startAngle:u,endAngle:m,cornerRadius:h,innerRadius:p,outerRadius:d}))}function zI(e){let{cx:t,cy:n,startAngle:r,endAngle:o,cornerRadius:l,innerRadius:u,outerRadius:c,skipAnimation:d}=e,p=s(e,OI);const h=TI({startAngle:r,endAngle:o,cornerRadius:l,innerRadius:u,outerRadius:c,skipAnimation:function(e){const t=_R(),n=um(t,lm);return e||n}(d)});return i.jsx(HI,a({},h,{transform:`translate(${t}, ${n})`},p))}const LI=["className"],jI=h("path",{name:"MuiGauge",slot:"ReferenceArc"})(({theme:e})=>({fill:(e.vars||e).palette.divider}));function NI(e){let{className:t}=e,n=s(e,LI);const{startAngle:r,endAngle:o,outerRadius:l,innerRadius:u,cornerRadius:c,cx:d,cy:p}=RI();return i.jsx(jI,a({className:O(FI.referenceArc,t),transform:`translate(${d}, ${p})`,d:FM().cornerRadius(c)({startAngle:r,endAngle:o,innerRadius:u,outerRadius:l})},n))}const GI=new Map,_I=new Set(["minWidth","maxWidth","width","minHeight","maxHeight","height","top","left","fontSize","padding","margin","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"]);function VI(e,t){return _I.has(e)&&t===+t?`${t}px`:t}const BI=/([A-Z])/g;function WI(e){return String(e).replace(BI,e=>`-${e.toLowerCase()}`)}const UI=(e,t={})=>{if(null==e||"undefined"==typeof window)return{width:0,height:0};const n=String(e),r=function(e){let t="";for(const n in e)if(Object.hasOwn(e,n)){const r=n,o=e[r];if(void 0===o)continue;t+=`${WI(r)}:${VI(r,o)};`}return t}(t),o=`${n}-${r}`,i=GI.get(o);if(i)return i;try{const e=function(){null===KI&&(KI=document.createElementNS("http://www.w3.org/2000/svg","svg"),KI.setAttribute("aria-hidden","true"),KI.style.position="absolute",KI.style.top="-20000px",KI.style.left="0",KI.style.padding="0",KI.style.margin="0",KI.style.border="none",KI.style.pointerEvents="none",KI.style.visibility="hidden",KI.style.contain="strict",document.body.appendChild(KI));return KI}(),r=document.createElementNS("http://www.w3.org/2000/svg","text");Object.keys(t).map(e=>(r.style[WI(e)]=VI(e,t[e]),e)),r.textContent=n,e.replaceChildren(r);const i=function(e){try{const t=e.getBBox();return{width:t.width,height:t.height}}catch{const t=e.getBoundingClientRect();return{width:t.width,height:t.height}}}(r);return GI.set(o,i),GI.size+1>2e3&&GI.clear(),i}catch{return{width:0,height:0}}};let KI=null;const qI=["x","y","style","text","ownerState"],XI=["angle","textAnchor","dominantBaseline"];function YI(t){const{x:n,y:r,style:o,text:l}=t,u=s(t,qI),c=o??{},{angle:d,textAnchor:p,dominantBaseline:h}=c,f=s(c,XI),g=function(){const[t,n]=e.useState("undefined"!=typeof window||!1);return e.useEffect(()=>{n(!0)},[]),t}(),m=e.useMemo(()=>function({style:e,needsComputation:t,text:n}){return n.split("\n").map(n=>a({text:n},t?UI(n,e):{width:0,height:0}))}({style:f,needsComputation:g&&l.includes("\n"),text:l}),[f,l,g]);let b;switch(h){case"hanging":case"text-before-edge":b=0;break;case"central":b=(m.length-1)/2*-m[0].height;break;default:b=(m.length-1)*-m[0].height}return i.jsx("text",a({},u,{transform:d?`rotate(${d}, ${n}, ${r})`:void 0,x:n,y:r,textAnchor:p,dominantBaseline:h,style:f,children:m.map((e,t)=>i.jsx("tspan",{x:n,dy:`${0===t?b:m[0].height}px`,dominantBaseline:h,children:e.text},t))}))}const QI=["text","className"];function ZI({value:e}){return null===e?null:e.toLocaleString()}function JI(e){const{text:t=ZI,className:n}=e,r=s(e,QI),{value:o,valueMin:l,valueMax:u,cx:c,cy:d}=RI(),p="function"==typeof t?t({value:o,valueMin:l,valueMax:u}):t;return null===p?null:i.jsx("g",{className:O(FI.valueText,n),children:i.jsx(YI,a({x:c,y:d,text:p,style:{textAnchor:"middle",dominantBaseline:"central"}},r))})}const eP=["text","children","classes","className","skipAnimation"],tP=e.forwardRef(function(e,t){const{text:n,children:r,className:o,skipAnimation:l}=e,u=s(e,eP),c=(e=>{const{classes:t}=e;return ie({root:["root"]},DI,t)})(e);return i.jsxs(kI,a({},u,{className:O(c.root,o),ref:t,children:[i.jsx(NI,{}),i.jsx($I,{skipAnimation:l}),i.jsx(JI,{text:n}),r]}))});export{Fp as $,wC as A,yC as B,vC as C,vw as D,Ub as E,bw as F,Pw as G,Kb as H,Yb as I,$w as J,Nw as K,Gw as L,jw as M,uC as N,cC as O,pC as P,fC as Q,hC as R,dC as S,zw as T,Dw as U,_w as V,iC as W,sC as X,gw as Y,sm as Z,ed as _,vR as a,Hp as a0,Ap as a1,_p as a2,sh as a3,$p as a4,Np as a5,Gp as a6,Je as a7,xs as a8,ii as a9,Ho as aa,tP as ab,FI as ac,mn as ad,MR as b,In as c,SR as d,bR as e,CR as f,jM as g,LM as h,gR as i,mR as j,fR as k,pR as l,uR as m,lR as n,HM as o,eR as p,BM as q,VM as r,xR as s,qM as t,ZM as u,YM as v,Gn as w,qb as x,mC as y,bC as z};