everest-npm-features 0.0.22 → 0.0.24

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 (246) hide show
  1. package/dist/{Alert-C1UNQHPD.js → Alert-CbQZ8Nii.js} +142 -116
  2. package/dist/{ArrowBack-Clp4i3dA.js → ArrowBack-BoYSBb8u.js} +1 -1
  3. package/dist/{ArrowDropDown-CoJNyIet.js → ArrowDropDown-BC_iEASy.js} +1 -1
  4. package/dist/{ArrowRight-DXtbS-1g.js → ArrowRight-rYkfGJuF.js} +1 -1
  5. package/dist/{Backdrop-DD6Ysl5O.js → Backdrop-CJBRZv_z.js} +106 -107
  6. package/dist/{Box-Be0E_-eR.js → Box-B12x52NC.js} +17 -16
  7. package/dist/Button-C57IMamW.js +660 -0
  8. package/dist/{ButtonBase-CE33gcZ6.js → ButtonBase-DugIO1pR.js} +194 -194
  9. package/dist/{Cancel-DEk2meuc.js → Cancel-D1JNu4Hj.js} +1 -1
  10. package/dist/{CardContent-B5tGyfc5.js → CardContent-CbObWW6t.js} +44 -45
  11. package/dist/{CheckCircle-BIckgNlV.js → CheckCircle-CyxKX1TY.js} +1 -1
  12. package/dist/{CircularProgress-fePUtoaj.js → CircularProgress-t8uGhLMo.js} +17 -17
  13. package/dist/{Close-D20PIPiF.js → Close-VV7zb3cu.js} +1 -1
  14. package/dist/{Close-Bj6AaxRi.js → Close-jnEgOCZv.js} +1 -1
  15. package/dist/{Container-CTfl6Vy4.js → Container-B3Af6Sc3.js} +20 -20
  16. package/dist/{ContentCopy-DzhD9ue3.js → ContentCopy-Ufwoeeov.js} +1 -1
  17. package/dist/DefaultPropsProvider-B2njZVNv.js +242 -0
  18. package/dist/DefaultPropsProvider-CZh8M2jM.js +351 -0
  19. package/dist/{Delete-BqqmGzYe.js → Delete-TCARcVtU.js} +1 -1
  20. package/dist/{DialogContent-D8jGp88c.js → DialogContent-DzidtXui.js} +202 -140
  21. package/dist/{DialogTitle-CxbjAJOw.js → DialogTitle-Bg61Hr7M.js} +23 -23
  22. package/dist/{Divider-D3PIEE97.js → Divider-Dy5hKfey.js} +31 -30
  23. package/dist/{ErrorOutline-CnwdlXPx.js → ErrorOutline-CI_ys3Zo.js} +1 -1
  24. package/dist/{FileDownload-BX69Jvdx.js → FileDownload-BcYF17B0.js} +1 -1
  25. package/dist/{FilledInput-n9W_V8GV.js → FilledInput-DrGeWgue.js} +352 -335
  26. package/dist/{FormControl-Cc-02KHW.js → FormControl-DeeQCuu5.js} +98 -81
  27. package/dist/{FormControlLabel-BEN9P8rJ.js → FormControlLabel-DVnrJkC8.js} +194 -165
  28. package/dist/GlobalStyles-DhHHc9O0.js +59 -0
  29. package/dist/Grid-BXyV_lM8.js +410 -0
  30. package/dist/Grow-B2p7O_1C.js +196 -0
  31. package/dist/{ownerDocument-C0GI-r2b.js → HTMLElementType-BrQSV2FE.js} +6 -6
  32. package/dist/IconButton-eWRhV6Q9.js +295 -0
  33. package/dist/{Info-83BXSu73.js → Info-D2UkGxyK.js} +1 -1
  34. package/dist/{InputAdornment-Ck_-Z38v.js → InputAdornment-BKuUMfPj.js} +14 -12
  35. package/dist/{Link-BqusVoz5.js → Link-Cm4BkRHO.js} +50 -49
  36. package/dist/{ListItemIcon-DIz-ZmJ0.js → ListItemIcon-GKRFb1Gr.js} +14 -13
  37. package/dist/{MenuItem-BkJ_C9Xs.js → MenuItem-CeCt0bfa.js} +46 -39
  38. package/dist/{Modal-CQcBtr07.js → Modal-csf3Y8d2.js} +265 -269
  39. package/dist/{Paper-B5pcGZbI.js → Paper-CnStNE24.js} +39 -38
  40. package/dist/{PlayArrow-1Y66tCVx.js → PlayArrow-DRCGjsrx.js} +1 -1
  41. package/dist/{Popper-CYsd-3n5.js → Popper-pPBEFLi4.js} +15 -15
  42. package/dist/{Portal-Bw0-5YJ9.js → Portal-CLa9CbMv.js} +36 -37
  43. package/dist/{RadioGroup-DtQqYrwU.js → RadioGroup-KiyYjXaT.js} +29 -28
  44. package/dist/{Select-DpKw-a6h.js → Select-Chubcks_.js} +1248 -933
  45. package/dist/{Slide-CdNJY-CT.js → Slide-DHG0r2gy.js} +68 -66
  46. package/dist/{Stack-C4POCZZb.js → Stack-CcR5RCg8.js} +41 -43
  47. package/dist/SwitchBase-CHO5ZceN.js +317 -0
  48. package/dist/{TextField-Cm9apaOp.js → TextField-q_SeLeNd.js} +144 -135
  49. package/dist/TransitionGroupContext-CYRQkQ6k.js +49 -0
  50. package/dist/{Typography-Ds4fpvK8.js → Typography-DBlMiOti.js} +39 -38
  51. package/dist/{auth-CR0412E5.js → auth-Bf9zHZ-x.js} +1 -1
  52. package/dist/{bank-iFS1RXp-.js → bank-BC4YNBRb.js} +3 -3
  53. package/dist/components/RocketRamp/MinimalKyc/form.js +9 -9
  54. package/dist/components/RocketRamp/MinimalKyc/index.js +1 -1
  55. package/dist/components/RocketRamp/Player/Buy/cardPayment.js +7 -7
  56. package/dist/components/RocketRamp/Player/Buy/confirmTransaction.js +7 -7
  57. package/dist/components/RocketRamp/Player/Buy/form.js +16 -16
  58. package/dist/components/RocketRamp/Player/Buy/index.js +6 -6
  59. package/dist/components/RocketRamp/Player/Dashboard/balance.js +7 -7
  60. package/dist/components/RocketRamp/Player/Dashboard/index.js +4 -4
  61. package/dist/components/RocketRamp/Player/Dashboard/transaction.js +4 -4
  62. package/dist/components/RocketRamp/Player/Sell/confirmTransaction.js +10 -10
  63. package/dist/components/RocketRamp/Player/Sell/form.js +16 -16
  64. package/dist/components/RocketRamp/Player/Sell/index.js +7 -7
  65. package/dist/components/RocketRamp/Player/SignIn/index.js +5 -5
  66. package/dist/components/RocketRamp/Player/SignIn/loginForm.js +5 -5
  67. package/dist/components/RocketRamp/Player/SignIn/otpForm.js +5 -5
  68. package/dist/components/RocketRamp/Player/SignUp/email.js +5 -5
  69. package/dist/components/RocketRamp/Player/SignUp/index.js +6 -6
  70. package/dist/components/RocketRamp/Player/SignUp/personalInfo.js +9 -9
  71. package/dist/components/RocketRamp/Player/SignUp/summary.js +3 -3
  72. package/dist/components/RocketRamp/Player/SignUp/validateEmail.js +3 -3
  73. package/dist/components/RocketRamp/ResetPassword/index.js +5 -5
  74. package/dist/components/RocketRamp/Shared/Button/index.js +2 -2
  75. package/dist/components/RocketRamp/Shared/Input/index.js +6 -6
  76. package/dist/components/RocketRamp/Shared/backBtn.js +3 -3
  77. package/dist/components/RocketRamp/Shared/transactionItem.js +5 -5
  78. package/dist/components/RocketRamp/Store/Dashboard/balance.js +6 -6
  79. package/dist/components/RocketRamp/Store/Dashboard/index.js +2 -2
  80. package/dist/components/RocketRamp/Store/Dashboard/stats.js +6 -6
  81. package/dist/components/RocketRamp/Store/Dashboard/transaction.js +4 -4
  82. package/dist/components/RocketRamp/Store/SignUp/index.js +6 -6
  83. package/dist/components/RocketRamp/Store/SignUp/personalInfo.js +9 -9
  84. package/dist/components/RocketRamp/Store/SignUp/storeInfo.js +7 -7
  85. package/dist/components/RocketRamp/Store/SignUp/summary.js +3 -3
  86. package/dist/components/RocketRamp/Store/SignUp/validateEmail.js +3 -3
  87. package/dist/components/RocketRamp/Transactions/index.js +4 -4
  88. package/dist/components/Shared/FullKyc/index.js +4 -4
  89. package/dist/components/Shared/FullKyc/pep.js +9 -9
  90. package/dist/components/Shared/FullKyc/personalDetails.js +7 -7
  91. package/dist/components/Shared/FullKyc/userInfo.js +11 -11
  92. package/dist/components/Shared/HistoryItem/index.js +7 -7
  93. package/dist/components/Shared/Incode/index.js +5 -5
  94. package/dist/components/Shared/MinimalKyc/index.js +8 -8
  95. package/dist/components/Shared/loader.js +2 -2
  96. package/dist/components/Shared/tooltip.js +2 -2
  97. package/dist/components/Shared/transition.js +1 -1
  98. package/dist/components/Wallet/Account/createIban.d.ts +1 -0
  99. package/dist/components/Wallet/Account/createIban.js +36 -35
  100. package/dist/components/Wallet/Account/iban.d.ts +1 -0
  101. package/dist/components/Wallet/Account/iban.js +16 -16
  102. package/dist/components/Wallet/Account/index.d.ts +1 -0
  103. package/dist/components/Wallet/Account/index.js +76 -70
  104. package/dist/components/Wallet/Account/sendIban.js +61 -61
  105. package/dist/components/Wallet/Buy/confirmTransaction.js +7 -7
  106. package/dist/components/Wallet/Buy/form.d.ts +2 -2
  107. package/dist/components/Wallet/Buy/form.js +17 -17
  108. package/dist/components/Wallet/Buy/index.js +6 -6
  109. package/dist/components/Wallet/Deposit/index.js +7 -7
  110. package/dist/components/Wallet/EnterpriseKyc/edd.js +7 -7
  111. package/dist/components/Wallet/EnterpriseKyc/index.js +26 -24
  112. package/dist/components/Wallet/EnterpriseKyc/individualKyc.js +5 -5
  113. package/dist/components/Wallet/EnterpriseKyc/kybIntro.js +3 -3
  114. package/dist/components/Wallet/EnterpriseKyc/kybTerms.js +2 -2
  115. package/dist/components/Wallet/EnterpriseKyc/kycType.js +5 -5
  116. package/dist/components/Wallet/EnterpriseKyc/orgDetails.js +45 -44
  117. package/dist/components/Wallet/EnterpriseKyc/orgInfo.js +3626 -100
  118. package/dist/components/Wallet/EnterpriseKyc/success.js +2 -2
  119. package/dist/components/Wallet/EnterpriseKyc/types.d.ts +0 -1
  120. package/dist/components/Wallet/EnterpriseKyc/verify.js +5 -5
  121. package/dist/components/Wallet/History/index.js +61 -62
  122. package/dist/components/Wallet/MoveToEthereumOrEverChain/index.js +14 -14
  123. package/dist/components/Wallet/Portfolio/index.js +95 -95
  124. package/dist/components/Wallet/Portfolio/tokenRow.js +6 -6
  125. package/dist/components/Wallet/Profile/documents.js +17 -17
  126. package/dist/components/Wallet/Profile/index.js +225 -206
  127. package/dist/components/Wallet/Receive/index.js +9 -9
  128. package/dist/components/Wallet/Sell/confirmTransaction.js +7 -7
  129. package/dist/components/Wallet/Sell/form.js +17 -17
  130. package/dist/components/Wallet/Sell/index.js +6 -6
  131. package/dist/components/Wallet/Send/index.js +14 -14
  132. package/dist/components/Wallet/Shared/Auth/emailForm.js +3 -3
  133. package/dist/components/Wallet/Shared/Auth/otpForm.js +217 -10451
  134. package/dist/components/Wallet/Shared/CardPayment/index.js +57 -55
  135. package/dist/components/Wallet/Shared/ConnectWallet/index.js +9 -9
  136. package/dist/components/Wallet/Shared/Container/index.js +3 -3
  137. package/dist/components/Wallet/Shared/Input/index.js +1 -1
  138. package/dist/components/Wallet/Shared/Keyboard/keyboard.js +9 -10
  139. package/dist/components/Wallet/Shared/Order/types.d.ts +23 -2
  140. package/dist/components/Wallet/Shared/TokenModal/index.js +11 -11
  141. package/dist/components/Wallet/Shared/TokenModal/tokenGrid.js +4 -4
  142. package/dist/components/Wallet/Shared/addBank.js +11 -11
  143. package/dist/components/Wallet/Shared/appButton.js +5 -5
  144. package/dist/components/Wallet/Shared/backBtn.js +8 -8
  145. package/dist/components/Wallet/Shared/button.js +1 -1
  146. package/dist/components/Wallet/Shared/connectPlaidBank.js +5 -5
  147. package/dist/components/Wallet/Shared/inputField.js +1 -1
  148. package/dist/components/Wallet/Shared/noData.js +2 -2
  149. package/dist/components/Wallet/Shared/pin.js +3 -3
  150. package/dist/components/Wallet/Shared/radioButton.js +3 -3
  151. package/dist/components/Wallet/Shared/step.js +2 -2
  152. package/dist/components/Wallet/SignIn/index.js +2 -2
  153. package/dist/components/Wallet/SignUp/index.js +2 -2
  154. package/dist/components/Wallet/SignUp/terms.js +4 -4
  155. package/dist/components/Wallet/Stake/gems/index.js +11 -11
  156. package/dist/components/Wallet/Stake/id/index.js +12 -12
  157. package/dist/components/Wallet/Stake/index.js +10 -10
  158. package/dist/components/Wallet/Swap/index.js +138 -150
  159. package/dist/components/Wallet/SwapAndUniSwap/index.js +3 -3
  160. package/dist/components/Wallet/Withdraw/bankSelect.js +10 -10
  161. package/dist/components/Wallet/Withdraw/confirmTransaction.js +7 -7
  162. package/dist/components/Wallet/Withdraw/form.d.ts +2 -2
  163. package/dist/components/Wallet/Withdraw/form.js +16 -16
  164. package/dist/components/Wallet/Withdraw/index.js +5 -5
  165. package/dist/{constants-BJByDTQY.js → constants-CsMPRK0U.js} +285 -284
  166. package/dist/{createSvgIcon-C0wzKL72.js → createSvgIcon-CH41ZVFw.js} +58 -57
  167. package/dist/createTheme-DmGCMO09.js +3825 -0
  168. package/dist/{cryptoAssets-BcVSdM1C.js → cryptoAssets-CzNDY1j6.js} +1 -1
  169. package/dist/defaultTheme-9fAph5zo.js +5 -0
  170. package/dist/{dividerClasses-Cb_Is0-O.js → dividerClasses-DnbM--4s.js} +2 -2
  171. package/dist/{documents-HjBKq9qA.js → documents-CEeV8SyW.js} +16 -16
  172. package/dist/{Transition-CYSgg85A.js → elementAcceptingRef-BbsmdE_3.js} +109 -66
  173. package/dist/{elementTypeAcceptingRef-Bc1kRXA9.js → elementTypeAcceptingRef-CdmXUhJ8.js} +1 -1
  174. package/dist/{emotion-react.browser.esm-BjxI_t8k.js → emotion-react.browser.esm-C2mxoK1z.js} +42 -42
  175. package/dist/{extendSxProp-a8ZTL0ZI.js → extendSxProp-Bwha5fon.js} +1 -1
  176. package/dist/{fiatAssets-C_F8qNzr.js → fiatAssets-DVHfFafS.js} +1 -1
  177. package/dist/hoc/withThemeProvider.js +518 -417
  178. package/dist/hooks/useDialog/index.js +4 -4
  179. package/dist/hooks/useRrDialog/index.js +4 -4
  180. package/dist/hooks/useSnackBar.js +363 -288
  181. package/dist/{iban-Dh7qBGGc.js → iban-DRT7i0vb.js} +74 -85
  182. package/dist/icons/buyIcon.js +1 -1
  183. package/dist/icons/canceledBuyIcon.js +1 -1
  184. package/dist/icons/canceledRedeemIcon.js +1 -1
  185. package/dist/icons/failedBuyIcon.js +1 -1
  186. package/dist/icons/failedRedeemIcon.js +1 -1
  187. package/dist/icons/pendingBuyIcon.js +1 -1
  188. package/dist/icons/pendingRedeemIcon.js +1 -1
  189. package/dist/icons/redeemIcon.js +1 -1
  190. package/dist/index-BB3__zW3.js +644 -0
  191. package/dist/index-C86AoaoB.js +43 -0
  192. package/dist/{index-BFIhKqqi.js → index-C9uGghB8.js} +141 -133
  193. package/dist/{index-DkMQ44xy.js → index-DZ__IpVI.js} +19 -19
  194. package/dist/{index-B2OIoTNN.js → index-DxX5Mo0o.js} +18 -18
  195. package/dist/{index-CQe8cwpc.js → index-VE9lYjq3.js} +22 -22
  196. package/dist/index-eEYiDlpX.js +723 -0
  197. package/dist/{index-CtkDfW5M.js → index-x9CniyQB.js} +1 -1
  198. package/dist/{kyc-DJpiKj5d.js → kyc-BweeW6k9.js} +1 -1
  199. package/dist/main.js +6 -6
  200. package/dist/{order-DhUA-ZNX.js → order-DmTHC7ZG.js} +7 -7
  201. package/dist/{ownerWindow-iFlVse9X.js → ownerWindow-CRgpWY6I.js} +1 -1
  202. package/dist/pep-C5Ge-kU4.js +2691 -0
  203. package/dist/{radioButton-CdYLf2fc.js → radioButton-Bgy7Kxxo.js} +172 -121
  204. package/dist/refType-CaiGhRso.js +56 -0
  205. package/dist/{stake-DWRuAE1u.js → stake-B150utJI.js} +1 -1
  206. package/dist/tokenRow-BR8f4g7G.js +198 -0
  207. package/dist/{tooltip-CwdohO6q.js → tooltip-DGtrVEzU.js} +258 -235
  208. package/dist/useControlled-nm4pBabJ.js +31 -0
  209. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  210. package/dist/useSlot-DtSnboW7.js +125 -0
  211. package/dist/useSlotProps-D62tWbb1.js +25 -0
  212. package/dist/useTheme-Bfw5Gt1b.js +17 -0
  213. package/dist/{useTheme-BzIjfC6u.js → useTheme-XTDzJ69d.js} +3 -3
  214. package/dist/useThemeProps-lRuJRcRX.js +29 -0
  215. package/dist/util/constants.d.ts +1 -3
  216. package/dist/util/constants.js +27 -29
  217. package/dist/wallet-DDW5KCHp.js +39 -0
  218. package/package.json +7 -6
  219. package/dist/Button-DCBtFwk3.js +0 -452
  220. package/dist/DefaultPropsProvider-5cxFAZuq.js +0 -647
  221. package/dist/DefaultPropsProvider-DOLtk4kZ.js +0 -88
  222. package/dist/GlobalStyles-O5U8h5ZQ.js +0 -23
  223. package/dist/Grid-BaaKMDwM.js +0 -501
  224. package/dist/Grid2-DX2sucnU.js +0 -374
  225. package/dist/Grow-CC3Va50c.js +0 -216
  226. package/dist/IconButton-8B2ygvr4.js +0 -238
  227. package/dist/SwitchBase-B9rcpVZ0.js +0 -261
  228. package/dist/TransitionGroupContext-BzyZRJGo.js +0 -37
  229. package/dist/createTheme-D_EHVLXp.js +0 -3662
  230. package/dist/defaultTheme-CGLnLLk_.js +0 -5
  231. package/dist/index-BEH1PkNC.js +0 -572
  232. package/dist/index-DSZxScyY.js +0 -704
  233. package/dist/index-DlZLKtdr.js +0 -72
  234. package/dist/pep-BsWvrgyM.js +0 -2600
  235. package/dist/resolveComponentProps-CPnCrKvI.js +0 -80
  236. package/dist/styled-CyBKg0N-.js +0 -5
  237. package/dist/tokenRow-QlGBYRKR.js +0 -206
  238. package/dist/useControlled-BYdyS7Pn.js +0 -31
  239. package/dist/useSlot-BdP6R4tz.js +0 -50
  240. package/dist/useTheme-BFI_g9FY.js +0 -9
  241. package/dist/useThemeProps-BOrAzOS4.js +0 -40
  242. package/dist/useThemeWithoutDefault-BWt80cCE.js +0 -12
  243. package/dist/useTimeout-_ag1gI7y.js +0 -56
  244. package/dist/utils-B-vKE_Dv.js +0 -50
  245. package/dist/utils-asicApOI.js +0 -21
  246. package/dist/wallet-z7NHqtCj.js +0 -35
@@ -1,18 +1,15 @@
1
- import { jsx as S, jsxs as je } from "react/jsx-runtime";
2
- import { B as Ie, P as a, D as Le, S as Ae, e as Ke, T as x, c as ve, F as Re, s as We } from "../createTheme-D_EHVLXp.js";
3
- import * as d from "react";
4
- import { R as Fe } from "../index-CtkDfW5M.js";
5
- import { u as He } from "../useThemeWithoutDefault-BWt80cCE.js";
6
- import { e as be } from "../exactProp-C1Lmtwf_.js";
7
- import { D as Ge } from "../DefaultPropsProvider-DOLtk4kZ.js";
8
- import { G as Ue } from "../GlobalStyles-O5U8h5ZQ.js";
9
- import '../assets/withThemeProvider.css';const qe = (e) => {
10
- const t = Le(e);
11
- class o extends Ae {
12
- constructor(m) {
13
- super(m), this.prepend = t.sheet.prepend;
14
- }
15
- }
1
+ import { jsx as T, jsxs as $e } from "react/jsx-runtime";
2
+ import { J as Ge, P as i, K as Ue, S as He, l as Fe, T as A, c as _e, L as Ye, s as ze } from "../createTheme-DmGCMO09.js";
3
+ import * as a from "react";
4
+ import { R as Be } from "../index-x9CniyQB.js";
5
+ import { a as De } from "../useTheme-Bfw5Gt1b.js";
6
+ import { u as Je } from "../useId-CK6Kn3Tn.js";
7
+ import { u as Oe } from "../useEnhancedEffect-CJGo-L3B.js";
8
+ import { G as Qe, a as We } from "../GlobalStyles-DhHHc9O0.js";
9
+ import { e as Pe } from "../exactProp-C1Lmtwf_.js";
10
+ import { D as Xe } from "../DefaultPropsProvider-CZh8M2jM.js";
11
+ import '../assets/withThemeProvider.css';const oe = /* @__PURE__ */ new Map(), Ze = (e, o) => {
12
+ const t = Ue(e);
16
13
  return t.sheet = new o({
17
14
  key: t.key,
18
15
  nonce: t.sheet.nonce,
@@ -22,124 +19,177 @@ import '../assets/withThemeProvider.css';const qe = (e) => {
22
19
  insertionPoint: t.sheet.insertionPoint
23
20
  }), t;
24
21
  };
25
- let Y;
26
- typeof document == "object" && (Y = qe({
27
- key: "css",
28
- prepend: !0
29
- }));
30
- function Me(e) {
22
+ let D;
23
+ if (typeof document == "object" && (D = document.querySelector('[name="emotion-insertion-point"]'), !D)) {
24
+ D = document.createElement("meta"), D.setAttribute("name", "emotion-insertion-point"), D.setAttribute("content", "");
25
+ const e = document.querySelector("head");
26
+ e && e.prepend(D);
27
+ }
28
+ function et(e, o) {
29
+ if (e || o) {
30
+ class t extends He {
31
+ insert(c, r) {
32
+ return this.key && this.key.endsWith("global") && (this.before = D), super.insert(c, r);
33
+ }
34
+ }
35
+ const n = Ze({
36
+ key: "css",
37
+ insertionPoint: e ? D : void 0
38
+ }, t);
39
+ if (o) {
40
+ const s = n.insert;
41
+ n.insert = (...c) => (c[1].styles.match(/^@layer\s+[^{]*$/) || (c[1].styles = `@layer mui {${c[1].styles}}`), s(...c));
42
+ }
43
+ return n;
44
+ }
45
+ }
46
+ function Ve(e) {
31
47
  const {
32
- injectFirst: t,
33
- children: o
34
- } = e;
35
- return t && Y ? /* @__PURE__ */ S(Ie, {
36
- value: Y,
37
- children: o
38
- }) : o;
48
+ injectFirst: o,
49
+ enableCssLayer: t,
50
+ children: n
51
+ } = e, s = a.useMemo(() => {
52
+ const c = `${o}-${t}`;
53
+ if (typeof document == "object" && oe.has(c))
54
+ return oe.get(c);
55
+ const r = et(o, t);
56
+ return oe.set(c, r), r;
57
+ }, [o, t]);
58
+ return s ? /* @__PURE__ */ T(Ge, {
59
+ value: s,
60
+ children: n
61
+ }) : n;
39
62
  }
40
- process.env.NODE_ENV !== "production" && (Me.propTypes = {
63
+ process.env.NODE_ENV !== "production" && (Ve.propTypes = {
41
64
  /**
42
65
  * Your component tree.
43
66
  */
44
- children: a.node,
67
+ children: i.node,
68
+ /**
69
+ * If `true`, the styles are wrapped in `@layer mui`.
70
+ * Learn more about [Cascade layers](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers).
71
+ */
72
+ enableCssLayer: i.bool,
45
73
  /**
46
74
  * By default, the styles are injected last in the <head> element of the page.
47
75
  * As a result, they gain more specificity than any other style sheet.
48
76
  * If you want to override MUI's styles, set this prop.
49
77
  */
50
- injectFirst: a.bool
78
+ injectFirst: i.bool
51
79
  });
52
- const B = /* @__PURE__ */ d.createContext(null);
53
- process.env.NODE_ENV !== "production" && (B.displayName = "ThemeContext");
54
- function z() {
55
- const e = d.useContext(B);
56
- return process.env.NODE_ENV !== "production" && d.useDebugValue(e), e;
80
+ const re = /* @__PURE__ */ a.createContext(null);
81
+ process.env.NODE_ENV !== "production" && (re.displayName = "ThemeContext");
82
+ function se() {
83
+ const e = a.useContext(re);
84
+ return process.env.NODE_ENV !== "production" && a.useDebugValue(e), e;
57
85
  }
58
- const Ye = typeof Symbol == "function" && Symbol.for, Be = Ye ? Symbol.for("mui.nested") : "__THEME_NESTED__";
59
- function ze(e, t) {
60
- if (typeof t == "function") {
61
- const o = t(e);
62
- return process.env.NODE_ENV !== "production" && (o || console.error(["MUI: You should return an object from your theme function, i.e.", "<ThemeProvider theme={() => ({})} />"].join(`
63
- `))), o;
86
+ const tt = typeof Symbol == "function" && Symbol.for, ot = tt ? Symbol.for("mui.nested") : "__THEME_NESTED__";
87
+ function nt(e, o) {
88
+ if (typeof o == "function") {
89
+ const t = o(e);
90
+ return process.env.NODE_ENV !== "production" && (t || console.error(["MUI: You should return an object from your theme function, i.e.", "<ThemeProvider theme={() => ({})} />"].join(`
91
+ `))), t;
64
92
  }
65
93
  return {
66
94
  ...e,
67
- ...t
95
+ ...o
68
96
  };
69
97
  }
70
- function A(e) {
98
+ function z(e) {
71
99
  const {
72
- children: t,
73
- theme: o
74
- } = e, s = z();
75
- process.env.NODE_ENV !== "production" && s === null && typeof o == "function" && console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
100
+ children: o,
101
+ theme: t
102
+ } = e, n = se();
103
+ process.env.NODE_ENV !== "production" && n === null && typeof t == "function" && console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
76
104
  `));
77
- const m = d.useMemo(() => {
78
- const h = s === null ? {
79
- ...o
80
- } : ze(s, o);
81
- return h != null && (h[Be] = s !== null), h;
82
- }, [o, s]);
83
- return /* @__PURE__ */ S(B.Provider, {
84
- value: m,
85
- children: t
105
+ const s = a.useMemo(() => {
106
+ const c = n === null ? {
107
+ ...t
108
+ } : nt(n, t);
109
+ return c != null && (c[ot] = n !== null), c;
110
+ }, [t, n]);
111
+ return /* @__PURE__ */ T(re.Provider, {
112
+ value: s,
113
+ children: o
86
114
  });
87
115
  }
88
- process.env.NODE_ENV !== "production" && (A.propTypes = {
116
+ process.env.NODE_ENV !== "production" && (z.propTypes = {
89
117
  /**
90
118
  * Your component tree.
91
119
  */
92
- children: a.node,
120
+ children: i.node,
93
121
  /**
94
122
  * A theme object. You can provide a function to extend the outer theme.
95
123
  */
96
- theme: a.oneOfType([a.object, a.func]).isRequired
124
+ theme: i.oneOfType([i.object, i.func]).isRequired
97
125
  });
98
- process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (A.propTypes = be(A.propTypes));
99
- const Ce = {};
100
- function Ee(e, t, o, s = !1) {
101
- return d.useMemo(() => {
102
- const m = e && t[e] || t;
103
- if (typeof o == "function") {
104
- const h = o(m), r = e ? {
105
- ...t,
106
- [e]: h
107
- } : h;
108
- return s ? () => r : r;
126
+ process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (z.propTypes = Pe(z.propTypes));
127
+ function rt(e) {
128
+ const o = De(), t = Je() || "", {
129
+ modularCssLayers: n
130
+ } = e;
131
+ let s = "mui.global, mui.components, mui.theme, mui.custom, mui.sx";
132
+ return !n || o !== null ? s = "" : typeof n == "string" ? s = n.replace(/mui(?!\.)/g, s) : s = `@layer ${s};`, Oe(() => {
133
+ var h, p;
134
+ const c = document.querySelector("head");
135
+ if (!c)
136
+ return;
137
+ const r = c.firstChild;
138
+ if (s) {
139
+ if (r && ((h = r.hasAttribute) != null && h.call(r, "data-mui-layer-order")) && r.getAttribute("data-mui-layer-order") === t)
140
+ return;
141
+ const C = document.createElement("style");
142
+ C.setAttribute("data-mui-layer-order", t), C.textContent = s, c.prepend(C);
143
+ } else
144
+ (p = c.querySelector(`style[data-mui-layer-order="${t}"]`)) == null || p.remove();
145
+ }, [s, t]), s ? /* @__PURE__ */ T(Qe, {
146
+ styles: s
147
+ }) : null;
148
+ }
149
+ const ke = {};
150
+ function Ne(e, o, t, n = !1) {
151
+ return a.useMemo(() => {
152
+ const s = e && o[e] || o;
153
+ if (typeof t == "function") {
154
+ const c = t(s), r = e ? {
155
+ ...o,
156
+ [e]: c
157
+ } : c;
158
+ return n ? () => r : r;
109
159
  }
110
160
  return e ? {
111
- ...t,
112
- [e]: o
161
+ ...o,
162
+ [e]: t
113
163
  } : {
114
- ...t,
115
- ...o
164
+ ...o,
165
+ ...t
116
166
  };
117
- }, [e, t, o, s]);
167
+ }, [e, o, t, n]);
118
168
  }
119
- function O(e) {
169
+ function U(e) {
120
170
  const {
121
- children: t,
122
- theme: o,
123
- themeId: s
124
- } = e, m = He(Ce), h = z() || Ce;
125
- process.env.NODE_ENV !== "production" && (m === null && typeof o == "function" || s && m && !m[s] && typeof o == "function") && console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
171
+ children: o,
172
+ theme: t,
173
+ themeId: n
174
+ } = e, s = De(ke), c = se() || ke;
175
+ process.env.NODE_ENV !== "production" && (s === null && typeof t == "function" || n && s && !s[n] && typeof t == "function") && console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join(`
126
176
  `));
127
- const r = Ee(s, m, o), E = Ee(s, h, o, !0), g = r.direction === "rtl";
128
- return /* @__PURE__ */ S(A, {
129
- theme: E,
130
- children: /* @__PURE__ */ S(Ke.Provider, {
177
+ const r = Ne(n, s, t), h = Ne(n, c, t, !0), p = (n ? r[n] : r).direction === "rtl", C = rt(r);
178
+ return /* @__PURE__ */ T(z, {
179
+ theme: h,
180
+ children: /* @__PURE__ */ T(Fe.Provider, {
131
181
  value: r,
132
- children: /* @__PURE__ */ S(Fe, {
133
- value: g,
134
- children: /* @__PURE__ */ S(Ge, {
135
- value: r == null ? void 0 : r.components,
136
- children: t
182
+ children: /* @__PURE__ */ T(Be, {
183
+ value: p,
184
+ children: /* @__PURE__ */ $e(Xe, {
185
+ value: n ? r[n].components : r.components,
186
+ children: [C, o]
137
187
  })
138
188
  })
139
189
  })
140
190
  });
141
191
  }
142
- process.env.NODE_ENV !== "production" && (O.propTypes = {
192
+ process.env.NODE_ENV !== "production" && (U.propTypes = {
143
193
  // ┌────────────────────────────── Warning ──────────────────────────────┐
144
194
  // │ These PropTypes are generated from the TypeScript type definitions. │
145
195
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -147,52 +197,53 @@ process.env.NODE_ENV !== "production" && (O.propTypes = {
147
197
  /**
148
198
  * Your component tree.
149
199
  */
150
- children: a.node,
200
+ children: i.node,
151
201
  /**
152
202
  * A theme object. You can provide a function to extend the outer theme.
153
203
  */
154
- theme: a.oneOfType([a.func, a.object]).isRequired,
204
+ theme: i.oneOfType([i.func, i.object]).isRequired,
155
205
  /**
156
206
  * The design system's unique id for getting the corresponded theme when there are multiple design systems.
157
207
  */
158
- themeId: a.string
208
+ themeId: i.string
159
209
  });
160
- process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (O.propTypes = be(O.propTypes));
161
- const Q = "mode", J = "color-scheme", Qe = "data-color-scheme";
162
- function Je(e) {
210
+ process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && (U.propTypes = Pe(U.propTypes));
211
+ const ce = "mode", ie = "color-scheme", st = "data-color-scheme";
212
+ function ct(e) {
163
213
  const {
214
+ defaultMode: o = "system",
164
215
  defaultLightColorScheme: t = "light",
165
- defaultDarkColorScheme: o = "dark",
166
- modeStorageKey: s = Q,
167
- colorSchemeStorageKey: m = J,
168
- attribute: h = Qe,
169
- colorSchemeNode: r = "document.documentElement",
170
- nonce: E
216
+ defaultDarkColorScheme: n = "dark",
217
+ modeStorageKey: s = ce,
218
+ colorSchemeStorageKey: c = ie,
219
+ attribute: r = st,
220
+ colorSchemeNode: h = "document.documentElement",
221
+ nonce: p
171
222
  } = e || {};
172
- let g = "", l = h;
173
- if (h === "class" && (l = ".%s"), h === "data" && (l = "[data-%s]"), l.startsWith(".")) {
174
- const y = l.substring(1);
175
- g += `${r}.classList.remove('${y}'.replace('%s', light), '${y}'.replace('%s', dark));
176
- ${r}.classList.add('${y}'.replace('%s', colorScheme));`;
223
+ let C = "", b = r;
224
+ if (r === "class" && (b = ".%s"), r === "data" && (b = "[data-%s]"), b.startsWith(".")) {
225
+ const S = b.substring(1);
226
+ C += `${h}.classList.remove('${S}'.replace('%s', light), '${S}'.replace('%s', dark));
227
+ ${h}.classList.add('${S}'.replace('%s', colorScheme));`;
177
228
  }
178
- const T = l.match(/\[([^\]]+)\]/);
179
- if (T) {
180
- const [y, M] = T[1].split("=");
181
- M || (g += `${r}.removeAttribute('${y}'.replace('%s', light));
182
- ${r}.removeAttribute('${y}'.replace('%s', dark));`), g += `
183
- ${r}.setAttribute('${y}'.replace('%s', colorScheme), ${M ? `${M}.replace('%s', colorScheme)` : '""'});`;
229
+ const N = b.match(/\[([^\]]+)\]/);
230
+ if (N) {
231
+ const [S, u] = N[1].split("=");
232
+ u || (C += `${h}.removeAttribute('${S}'.replace('%s', light));
233
+ ${h}.removeAttribute('${S}'.replace('%s', dark));`), C += `
234
+ ${h}.setAttribute('${S}'.replace('%s', colorScheme), ${u ? `${u}.replace('%s', colorScheme)` : '""'});`;
184
235
  } else
185
- g += `${r}.setAttribute('${l}', colorScheme);`;
186
- return /* @__PURE__ */ S("script", {
236
+ C += `${h}.setAttribute('${b}', colorScheme);`;
237
+ return /* @__PURE__ */ T("script", {
187
238
  suppressHydrationWarning: !0,
188
- nonce: typeof window > "u" ? E : "",
239
+ nonce: typeof window > "u" ? p : "",
189
240
  dangerouslySetInnerHTML: {
190
241
  __html: `(function() {
191
242
  try {
192
243
  let colorScheme = '';
193
- const mode = localStorage.getItem('${s}') || 'system';
194
- const dark = localStorage.getItem('${m}-dark') || '${o}';
195
- const light = localStorage.getItem('${m}-light') || '${t}';
244
+ const mode = localStorage.getItem('${s}') || '${o}';
245
+ const dark = localStorage.getItem('${c}-dark') || '${n}';
246
+ const light = localStorage.getItem('${c}-light') || '${t}';
196
247
  if (mode === 'system') {
197
248
  // handle system mode
198
249
  const mql = window.matchMedia('(prefers-color-scheme: dark)');
@@ -209,180 +260,189 @@ try {
209
260
  colorScheme = dark;
210
261
  }
211
262
  if (colorScheme) {
212
- ${g}
263
+ ${C}
213
264
  }
214
265
  } catch(e){}})();`
215
266
  }
216
267
  }, "mui-color-scheme-init");
217
268
  }
218
- function Te(e) {
269
+ function it() {
270
+ }
271
+ const lt = ({
272
+ key: e,
273
+ storageWindow: o
274
+ }) => (!o && typeof window < "u" && (o = window), {
275
+ get(t) {
276
+ if (typeof window > "u")
277
+ return;
278
+ if (!o)
279
+ return t;
280
+ let n;
281
+ try {
282
+ n = o.localStorage.getItem(e);
283
+ } catch {
284
+ }
285
+ return n || t;
286
+ },
287
+ set: (t) => {
288
+ if (o)
289
+ try {
290
+ o.localStorage.setItem(e, t);
291
+ } catch {
292
+ }
293
+ },
294
+ subscribe: (t) => {
295
+ if (!o)
296
+ return it;
297
+ const n = (s) => {
298
+ const c = s.newValue;
299
+ s.key === e && t(c);
300
+ };
301
+ return o.addEventListener("storage", n), () => {
302
+ o.removeEventListener("storage", n);
303
+ };
304
+ }
305
+ });
306
+ function ne() {
307
+ }
308
+ function we(e) {
219
309
  if (typeof window < "u" && typeof window.matchMedia == "function" && e === "system")
220
310
  return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
221
311
  }
222
- function Ne(e, t) {
312
+ function xe(e, o) {
223
313
  if (e.mode === "light" || e.mode === "system" && e.systemMode === "light")
224
- return t("light");
314
+ return o("light");
225
315
  if (e.mode === "dark" || e.mode === "system" && e.systemMode === "dark")
226
- return t("dark");
316
+ return o("dark");
227
317
  }
228
- function Xe(e) {
229
- return Ne(e, (t) => {
230
- if (t === "light")
318
+ function dt(e) {
319
+ return xe(e, (o) => {
320
+ if (o === "light")
231
321
  return e.lightColorScheme;
232
- if (t === "dark")
322
+ if (o === "dark")
233
323
  return e.darkColorScheme;
234
324
  });
235
325
  }
236
- function q(e, t) {
237
- if (typeof window > "u")
238
- return;
239
- let o;
240
- try {
241
- o = localStorage.getItem(e) || void 0, o || localStorage.setItem(e, t);
242
- } catch {
243
- }
244
- return o || t;
245
- }
246
- function Ze(e) {
326
+ function at(e) {
247
327
  const {
248
- defaultMode: t = "light",
249
- defaultLightColorScheme: o,
250
- defaultDarkColorScheme: s,
251
- supportedColorSchemes: m = [],
252
- modeStorageKey: h = Q,
253
- colorSchemeStorageKey: r = J,
254
- storageWindow: E = typeof window > "u" ? void 0 : window
255
- } = e, g = m.join(","), l = m.length > 1, [T, y] = d.useState(() => {
256
- const n = q(h, t), c = q(`${r}-light`, o), i = q(`${r}-dark`, s);
328
+ defaultMode: o = "light",
329
+ defaultLightColorScheme: t,
330
+ defaultDarkColorScheme: n,
331
+ supportedColorSchemes: s = [],
332
+ modeStorageKey: c = ce,
333
+ colorSchemeStorageKey: r = ie,
334
+ storageWindow: h = typeof window > "u" ? void 0 : window,
335
+ storageManager: p = lt,
336
+ noSsr: C = !1
337
+ } = e, b = s.join(","), N = s.length > 1, S = a.useMemo(() => p == null ? void 0 : p({
338
+ key: c,
339
+ storageWindow: h
340
+ }), [p, c, h]), u = a.useMemo(() => p == null ? void 0 : p({
341
+ key: `${r}-light`,
342
+ storageWindow: h
343
+ }), [p, r, h]), g = a.useMemo(() => p == null ? void 0 : p({
344
+ key: `${r}-dark`,
345
+ storageWindow: h
346
+ }), [p, r, h]), [$, x] = a.useState(() => {
347
+ const l = (S == null ? void 0 : S.get(o)) || o, d = (u == null ? void 0 : u.get(t)) || t, m = (g == null ? void 0 : g.get(n)) || n;
257
348
  return {
258
- mode: n,
259
- systemMode: Te(n),
260
- lightColorScheme: c,
261
- darkColorScheme: i
349
+ mode: l,
350
+ systemMode: we(l),
351
+ lightColorScheme: d,
352
+ darkColorScheme: m
262
353
  };
263
- }), [, M] = d.useState(!1), $ = d.useRef(!1);
264
- d.useEffect(() => {
265
- l && M(!0), $.current = !0;
266
- }, [l]);
267
- const X = Xe(T), N = d.useCallback((n) => {
268
- y((c) => {
269
- if (n === c.mode)
270
- return c;
271
- const i = n ?? t;
272
- try {
273
- localStorage.setItem(h, i);
274
- } catch {
275
- }
276
- return {
277
- ...c,
278
- mode: i,
279
- systemMode: Te(i)
354
+ }), [O, B] = a.useState(C || !N);
355
+ a.useEffect(() => {
356
+ B(!0);
357
+ }, []);
358
+ const K = dt($), R = a.useCallback((l) => {
359
+ x((d) => {
360
+ if (l === d.mode)
361
+ return d;
362
+ const m = l ?? o;
363
+ return S == null || S.set(m), {
364
+ ...d,
365
+ mode: m,
366
+ systemMode: we(m)
280
367
  };
281
368
  });
282
- }, [h, t]), _ = d.useCallback((n) => {
283
- n ? typeof n == "string" ? n && !g.includes(n) ? console.error(`\`${n}\` does not exist in \`theme.colorSchemes\`.`) : y((c) => {
284
- const i = {
285
- ...c
369
+ }, [S, o]), L = a.useCallback((l) => {
370
+ l ? typeof l == "string" ? l && !b.includes(l) ? console.error(`\`${l}\` does not exist in \`theme.colorSchemes\`.`) : x((d) => {
371
+ const m = {
372
+ ...d
286
373
  };
287
- return Ne(c, (p) => {
288
- try {
289
- localStorage.setItem(`${r}-${p}`, n);
290
- } catch {
291
- }
292
- p === "light" && (i.lightColorScheme = n), p === "dark" && (i.darkColorScheme = n);
293
- }), i;
294
- }) : y((c) => {
295
- const i = {
296
- ...c
297
- }, p = n.light === null ? o : n.light, C = n.dark === null ? s : n.dark;
298
- if (p)
299
- if (!g.includes(p))
300
- console.error(`\`${p}\` does not exist in \`theme.colorSchemes\`.`);
301
- else {
302
- i.lightColorScheme = p;
303
- try {
304
- localStorage.setItem(`${r}-light`, p);
305
- } catch {
306
- }
307
- }
308
- if (C)
309
- if (!g.includes(C))
310
- console.error(`\`${C}\` does not exist in \`theme.colorSchemes\`.`);
311
- else {
312
- i.darkColorScheme = C;
313
- try {
314
- localStorage.setItem(`${r}-dark`, C);
315
- } catch {
316
- }
317
- }
318
- return i;
319
- }) : y((c) => {
320
- try {
321
- localStorage.setItem(`${r}-light`, o), localStorage.setItem(`${r}-dark`, s);
322
- } catch {
323
- }
324
- return {
325
- ...c,
326
- lightColorScheme: o,
327
- darkColorScheme: s
328
- };
329
- });
330
- }, [g, r, o, s]), D = d.useCallback((n) => {
331
- T.mode === "system" && y((c) => {
332
- const i = n != null && n.matches ? "dark" : "light";
333
- return c.systemMode === i ? c : {
334
- ...c,
335
- systemMode: i
374
+ return xe(d, (f) => {
375
+ f === "light" && (u == null || u.set(l), m.lightColorScheme = l), f === "dark" && (g == null || g.set(l), m.darkColorScheme = l);
376
+ }), m;
377
+ }) : x((d) => {
378
+ const m = {
379
+ ...d
380
+ }, f = l.light === null ? t : l.light, P = l.dark === null ? n : l.dark;
381
+ return f && (b.includes(f) ? (m.lightColorScheme = f, u == null || u.set(f)) : console.error(`\`${f}\` does not exist in \`theme.colorSchemes\`.`)), P && (b.includes(P) ? (m.darkColorScheme = P, g == null || g.set(P)) : console.error(`\`${P}\` does not exist in \`theme.colorSchemes\`.`)), m;
382
+ }) : x((d) => (u == null || u.set(t), g == null || g.set(n), {
383
+ ...d,
384
+ lightColorScheme: t,
385
+ darkColorScheme: n
386
+ }));
387
+ }, [b, u, g, t, n]), q = a.useCallback((l) => {
388
+ $.mode === "system" && x((d) => {
389
+ const m = l != null && l.matches ? "dark" : "light";
390
+ return d.systemMode === m ? d : {
391
+ ...d,
392
+ systemMode: m
336
393
  };
337
394
  });
338
- }, [T.mode]), j = d.useRef(D);
339
- return j.current = D, d.useEffect(() => {
340
- if (typeof window.matchMedia != "function" || !l)
395
+ }, [$.mode]), H = a.useRef(q);
396
+ return H.current = q, a.useEffect(() => {
397
+ if (typeof window.matchMedia != "function" || !N)
341
398
  return;
342
- const n = (...i) => j.current(...i), c = window.matchMedia("(prefers-color-scheme: dark)");
343
- return c.addListener(n), n(c), () => {
344
- c.removeListener(n);
399
+ const l = (...m) => H.current(...m), d = window.matchMedia("(prefers-color-scheme: dark)");
400
+ return d.addListener(l), l(d), () => {
401
+ d.removeListener(l);
345
402
  };
346
- }, [l]), d.useEffect(() => {
347
- if (E && l) {
348
- const n = (c) => {
349
- const i = c.newValue;
350
- typeof c.key == "string" && c.key.startsWith(r) && (!i || g.match(i)) && (c.key.endsWith("light") && _({
351
- light: i
352
- }), c.key.endsWith("dark") && _({
353
- dark: i
354
- })), c.key === h && (!i || ["light", "dark", "system"].includes(i)) && N(i || t);
355
- };
356
- return E.addEventListener("storage", n), () => {
357
- E.removeEventListener("storage", n);
403
+ }, [N]), a.useEffect(() => {
404
+ if (N) {
405
+ const l = (S == null ? void 0 : S.subscribe((f) => {
406
+ (!f || ["light", "dark", "system"].includes(f)) && R(f || o);
407
+ })) || ne, d = (u == null ? void 0 : u.subscribe((f) => {
408
+ (!f || b.match(f)) && L({
409
+ light: f
410
+ });
411
+ })) || ne, m = (g == null ? void 0 : g.subscribe((f) => {
412
+ (!f || b.match(f)) && L({
413
+ dark: f
414
+ });
415
+ })) || ne;
416
+ return () => {
417
+ l(), d(), m();
358
418
  };
359
419
  }
360
- }, [_, N, h, r, g, t, E, l]), {
361
- ...T,
362
- mode: $.current || !l ? T.mode : void 0,
363
- systemMode: $.current || !l ? T.systemMode : void 0,
364
- colorScheme: $.current || !l ? X : void 0,
365
- setMode: N,
366
- setColorScheme: _
420
+ }, [L, R, b, o, h, N, S, u, g]), {
421
+ ...$,
422
+ mode: O ? $.mode : void 0,
423
+ systemMode: O ? $.systemMode : void 0,
424
+ colorScheme: O ? K : void 0,
425
+ setMode: R,
426
+ setColorScheme: L
367
427
  };
368
428
  }
369
- const et = "*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
370
- function tt(e) {
429
+ const mt = "*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
430
+ function ut(e) {
371
431
  const {
372
- themeId: t,
432
+ themeId: o,
373
433
  /**
374
434
  * This `theme` object needs to follow a certain structure to
375
435
  * be used correctly by the finel `CssVarsProvider`. It should have a
376
436
  * `colorSchemes` key with the light and dark (and any other) palette.
377
437
  * It should also ideally have a vars object created using `prepareCssVars`.
378
438
  */
379
- theme: o = {},
380
- modeStorageKey: s = Q,
381
- colorSchemeStorageKey: m = J,
382
- disableTransitionOnChange: h = !1,
439
+ theme: t = {},
440
+ modeStorageKey: n = ce,
441
+ colorSchemeStorageKey: s = ie,
442
+ disableTransitionOnChange: c = !1,
383
443
  defaultColorScheme: r,
384
- resolveTheme: E
385
- } = e, g = {
444
+ resolveTheme: h
445
+ } = e, p = {
386
446
  allColorSchemes: [],
387
447
  colorScheme: void 0,
388
448
  darkColorScheme: void 0,
@@ -393,243 +453,284 @@ function tt(e) {
393
453
  setMode: () => {
394
454
  },
395
455
  systemMode: void 0
396
- }, l = /* @__PURE__ */ d.createContext(void 0);
397
- process.env.NODE_ENV !== "production" && (l.displayName = "ColorSchemeContext");
398
- const T = () => d.useContext(l) || g;
399
- function y(N) {
400
- var ue, fe, pe, Se, ge;
456
+ }, C = /* @__PURE__ */ a.createContext(void 0);
457
+ process.env.NODE_ENV !== "production" && (C.displayName = "ColorSchemeContext");
458
+ const b = () => a.useContext(C) || p, N = {}, S = {};
459
+ function u(O) {
460
+ var Ee, Te, ve, Me;
401
461
  const {
402
- children: _,
403
- theme: D,
404
- modeStorageKey: j = s,
405
- colorSchemeStorageKey: n = m,
406
- disableTransitionOnChange: c = h,
407
- storageWindow: i = typeof window > "u" ? void 0 : window,
408
- documentNode: p = typeof document > "u" ? void 0 : document,
409
- colorSchemeNode: C = typeof document > "u" ? void 0 : document.documentElement,
410
- disableNestedContext: K = !1,
411
- disableStyleSheetGeneration: we = !1
412
- } = N, R = d.useRef(!1), W = z(), F = d.useContext(l), H = !!F && !K, Z = d.useMemo(() => D || (typeof o == "function" ? o() : o), [D]), ee = Z[t], {
413
- colorSchemes: w = {},
414
- components: $e = {},
415
- cssVarPrefix: te,
416
- ...b
417
- } = ee || Z, oe = Object.keys(w).filter((u) => !!w[u]).join(","), P = d.useMemo(() => oe.split(","), [oe]), re = typeof r == "string" ? r : r.light, ne = typeof r == "string" ? r : r.dark, _e = w[re] && w[ne] ? "system" : ((fe = (ue = w[b.defaultColorScheme]) == null ? void 0 : ue.palette) == null ? void 0 : fe.mode) || ((pe = b.palette) == null ? void 0 : pe.mode), {
418
- mode: De,
419
- setMode: se,
420
- systemMode: ce,
421
- lightColorScheme: ie,
422
- darkColorScheme: de,
423
- colorScheme: Pe,
424
- setColorScheme: le
425
- } = Ze({
426
- supportedColorSchemes: P,
427
- defaultLightColorScheme: re,
428
- defaultDarkColorScheme: ne,
429
- modeStorageKey: j,
430
- colorSchemeStorageKey: n,
431
- defaultMode: _e,
432
- storageWindow: i
462
+ children: B,
463
+ theme: K,
464
+ modeStorageKey: R = n,
465
+ colorSchemeStorageKey: L = s,
466
+ disableTransitionOnChange: q = c,
467
+ storageManager: H,
468
+ storageWindow: l = typeof window > "u" ? void 0 : window,
469
+ documentNode: d = typeof document > "u" ? void 0 : document,
470
+ colorSchemeNode: m = typeof document > "u" ? void 0 : document.documentElement,
471
+ disableNestedContext: f = !1,
472
+ disableStyleSheetGeneration: P = !1,
473
+ defaultMode: Le = "system",
474
+ forceThemeRerender: le = !1,
475
+ noSsr: je
476
+ } = O, J = a.useRef(!1), Q = se(), W = a.useContext(C), X = !!W && !f, de = a.useMemo(() => K || (typeof t == "function" ? t() : t), [K]), ae = de[o], v = ae || de, {
477
+ colorSchemes: _ = N,
478
+ components: me = S,
479
+ cssVarPrefix: Z
480
+ } = v, ue = Object.keys(_).filter((E) => !!_[E]).join(","), j = a.useMemo(() => ue.split(","), [ue]), he = typeof r == "string" ? r : r.light, fe = typeof r == "string" ? r : r.dark, Ie = _[he] && _[fe] ? Le : ((Te = (Ee = _[v.defaultColorScheme]) == null ? void 0 : Ee.palette) == null ? void 0 : Te.mode) || ((ve = v.palette) == null ? void 0 : ve.mode), {
481
+ mode: Ae,
482
+ setMode: ee,
483
+ systemMode: pe,
484
+ lightColorScheme: Se,
485
+ darkColorScheme: ye,
486
+ colorScheme: Ke,
487
+ setColorScheme: ge
488
+ } = at({
489
+ supportedColorSchemes: j,
490
+ defaultLightColorScheme: he,
491
+ defaultDarkColorScheme: fe,
492
+ modeStorageKey: R,
493
+ colorSchemeStorageKey: L,
494
+ defaultMode: Ie,
495
+ storageManager: H,
496
+ storageWindow: l,
497
+ noSsr: je
433
498
  });
434
- let G = De, k = Pe;
435
- H && (G = F.mode, k = F.colorScheme);
436
- const ae = k || b.defaultColorScheme, xe = ((Se = b.generateThemeVars) == null ? void 0 : Se.call(b)) || b.vars, v = {
437
- ...b,
438
- components: $e,
439
- colorSchemes: w,
440
- cssVarPrefix: te,
441
- vars: xe
442
- };
443
- if (typeof v.generateSpacing == "function" && (v.spacing = v.generateSpacing()), ae) {
444
- const u = w[ae];
445
- u && typeof u == "object" && Object.keys(u).forEach((f) => {
446
- u[f] && typeof u[f] == "object" ? v[f] = {
447
- ...v[f],
448
- ...u[f]
449
- } : v[f] = u[f];
450
- });
451
- }
452
- const V = b.colorSchemeSelector;
453
- d.useEffect(() => {
454
- if (k && C && V && V !== "media") {
455
- const u = V;
456
- let f = V;
457
- if (u === "class" && (f = ".%s"), u === "data" && (f = "[data-%s]"), u != null && u.startsWith("data-") && !u.includes("%s") && (f = `[${u}="%s"]`), f.startsWith("."))
458
- C.classList.remove(...P.map((I) => f.substring(1).replace("%s", I))), C.classList.add(f.substring(1).replace("%s", k));
499
+ let te = Ae, M = Ke;
500
+ X && (te = W.mode, M = W.colorScheme), process.env.NODE_ENV !== "production" && le && !v.vars && console.warn(["MUI: The `forceThemeRerender` prop should only be used with CSS theme variables.", "Note that it will slow down the app when changing between modes, so only do this when you cannot find a better solution."].join(`
501
+ `));
502
+ let F = M || v.defaultColorScheme;
503
+ v.vars && !le && (F = v.defaultColorScheme);
504
+ const I = a.useMemo(() => {
505
+ var V;
506
+ const E = ((V = v.generateThemeVars) == null ? void 0 : V.call(v)) || v.vars, y = {
507
+ ...v,
508
+ components: me,
509
+ colorSchemes: _,
510
+ cssVarPrefix: Z,
511
+ vars: E
512
+ };
513
+ if (typeof y.generateSpacing == "function" && (y.spacing = y.generateSpacing()), F) {
514
+ const w = _[F];
515
+ w && typeof w == "object" && Object.keys(w).forEach((k) => {
516
+ w[k] && typeof w[k] == "object" ? y[k] = {
517
+ ...y[k],
518
+ ...w[k]
519
+ } : y[k] = w[k];
520
+ });
521
+ }
522
+ return h ? h(y) : y;
523
+ }, [v, F, me, _, Z]), G = v.colorSchemeSelector;
524
+ Oe(() => {
525
+ if (M && m && G && G !== "media") {
526
+ const E = G;
527
+ let y = G;
528
+ if (E === "class" && (y = ".%s"), E === "data" && (y = "[data-%s]"), E != null && E.startsWith("data-") && !E.includes("%s") && (y = `[${E}="%s"]`), y.startsWith("."))
529
+ m.classList.remove(...j.map((V) => y.substring(1).replace("%s", V))), m.classList.add(y.substring(1).replace("%s", M));
459
530
  else {
460
- const I = f.replace("%s", k).match(/\[([^\]]+)\]/);
461
- if (I) {
462
- const [ye, U] = I[1].split("=");
463
- U || P.forEach((Oe) => {
464
- C.removeAttribute(ye.replace(k, Oe));
465
- }), C.setAttribute(ye, U ? U.replace(/"|'/g, "") : "");
531
+ const V = y.replace("%s", M).match(/\[([^\]]+)\]/);
532
+ if (V) {
533
+ const [w, k] = V[1].split("=");
534
+ k || j.forEach((qe) => {
535
+ m.removeAttribute(w.replace(M, qe));
536
+ }), m.setAttribute(w, k ? k.replace(/"|'/g, "") : "");
466
537
  } else
467
- C.setAttribute(f, k);
538
+ m.setAttribute(y, M);
468
539
  }
469
540
  }
470
- }, [k, V, C, P]), d.useEffect(() => {
471
- let u;
472
- if (c && R.current && p) {
473
- const f = p.createElement("style");
474
- f.appendChild(p.createTextNode(et)), p.head.appendChild(f), window.getComputedStyle(p.body), u = setTimeout(() => {
475
- p.head.removeChild(f);
541
+ }, [M, G, m, j]), a.useEffect(() => {
542
+ let E;
543
+ if (q && J.current && d) {
544
+ const y = d.createElement("style");
545
+ y.appendChild(d.createTextNode(mt)), d.head.appendChild(y), window.getComputedStyle(d.body), E = setTimeout(() => {
546
+ d.head.removeChild(y);
476
547
  }, 1);
477
548
  }
478
549
  return () => {
479
- clearTimeout(u);
550
+ clearTimeout(E);
480
551
  };
481
- }, [k, c, p]), d.useEffect(() => (R.current = !0, () => {
482
- R.current = !1;
552
+ }, [M, q, d]), a.useEffect(() => (J.current = !0, () => {
553
+ J.current = !1;
483
554
  }), []);
484
- const Ve = d.useMemo(() => ({
485
- allColorSchemes: P,
486
- colorScheme: k,
487
- darkColorScheme: de,
488
- lightColorScheme: ie,
489
- mode: G,
490
- setColorScheme: le,
491
- setMode: se,
492
- systemMode: ce
493
- }), [P, k, de, ie, G, le, se, ce]);
494
- let me = !0;
495
- (we || b.cssVariables === !1 || H && (W == null ? void 0 : W.cssVarPrefix) === te) && (me = !1);
496
- const he = /* @__PURE__ */ je(d.Fragment, {
497
- children: [/* @__PURE__ */ S(O, {
498
- themeId: ee ? t : void 0,
499
- theme: E ? E(v) : v,
500
- children: _
501
- }), me && /* @__PURE__ */ S(Ue, {
502
- styles: ((ge = v.generateStyleSheets) == null ? void 0 : ge.call(v)) || []
555
+ const Re = a.useMemo(() => ({
556
+ allColorSchemes: j,
557
+ colorScheme: M,
558
+ darkColorScheme: ye,
559
+ lightColorScheme: Se,
560
+ mode: te,
561
+ setColorScheme: ge,
562
+ setMode: process.env.NODE_ENV === "production" ? ee : (E) => {
563
+ I.colorSchemeSelector === "media" && console.error(["MUI: The `setMode` function has no effect if `colorSchemeSelector` is `media` (`media` is the default value).", "To toggle the mode manually, please configure `colorSchemeSelector` to use a class or data attribute.", "To learn more, visit https://mui.com/material-ui/customization/css-theme-variables/configuration/#toggling-dark-mode-manually"].join(`
564
+ `)), ee(E);
565
+ },
566
+ systemMode: pe
567
+ }), [j, M, ye, Se, te, ge, ee, pe, I.colorSchemeSelector]);
568
+ let Ce = !0;
569
+ (P || v.cssVariables === !1 || X && (Q == null ? void 0 : Q.cssVarPrefix) === Z) && (Ce = !1);
570
+ const be = /* @__PURE__ */ $e(a.Fragment, {
571
+ children: [/* @__PURE__ */ T(U, {
572
+ themeId: ae ? o : void 0,
573
+ theme: I,
574
+ children: B
575
+ }), Ce && /* @__PURE__ */ T(We, {
576
+ styles: ((Me = I.generateStyleSheets) == null ? void 0 : Me.call(I)) || []
503
577
  })]
504
578
  });
505
- return H ? he : /* @__PURE__ */ S(l.Provider, {
506
- value: Ve,
507
- children: he
579
+ return X ? be : /* @__PURE__ */ T(C.Provider, {
580
+ value: Re,
581
+ children: be
508
582
  });
509
583
  }
510
- process.env.NODE_ENV !== "production" && (y.propTypes = {
584
+ process.env.NODE_ENV !== "production" && (u.propTypes = {
511
585
  /**
512
586
  * The component tree.
513
587
  */
514
- children: a.node,
588
+ children: i.node,
515
589
  /**
516
590
  * The node used to attach the color-scheme attribute
517
591
  */
518
- colorSchemeNode: a.any,
592
+ colorSchemeNode: i.any,
519
593
  /**
520
594
  * localStorage key used to store `colorScheme`
521
595
  */
522
- colorSchemeStorageKey: a.string,
596
+ colorSchemeStorageKey: i.string,
597
+ /**
598
+ * The default mode when the storage is empty,
599
+ * require the theme to have `colorSchemes` with light and dark.
600
+ */
601
+ defaultMode: i.string,
523
602
  /**
524
603
  * If `true`, the provider creates its own context and generate stylesheet as if it is a root `CssVarsProvider`.
525
604
  */
526
- disableNestedContext: a.bool,
605
+ disableNestedContext: i.bool,
527
606
  /**
528
607
  * If `true`, the style sheet won't be generated.
529
608
  *
530
609
  * This is useful for controlling nested CssVarsProvider behavior.
531
610
  */
532
- disableStyleSheetGeneration: a.bool,
611
+ disableStyleSheetGeneration: i.bool,
533
612
  /**
534
613
  * Disable CSS transitions when switching between modes or color schemes.
535
614
  */
536
- disableTransitionOnChange: a.bool,
615
+ disableTransitionOnChange: i.bool,
537
616
  /**
538
617
  * The document to attach the attribute to.
539
618
  */
540
- documentNode: a.any,
619
+ documentNode: i.any,
620
+ /**
621
+ * If `true`, theme values are recalculated when the mode changes.
622
+ */
623
+ forceThemeRerender: i.bool,
541
624
  /**
542
625
  * The key in the local storage used to store current color scheme.
543
626
  */
544
- modeStorageKey: a.string,
627
+ modeStorageKey: i.string,
628
+ /**
629
+ * If `true`, the mode will be the same value as the storage without an extra rerendering after the hydration.
630
+ * You should use this option in conjuction with `InitColorSchemeScript` component.
631
+ */
632
+ noSsr: i.bool,
633
+ /**
634
+ * The storage manager to be used for storing the mode and color scheme
635
+ * @default using `window.localStorage`
636
+ */
637
+ storageManager: i.func,
545
638
  /**
546
639
  * The window that attaches the 'storage' event listener.
547
640
  * @default window
548
641
  */
549
- storageWindow: a.any,
642
+ storageWindow: i.any,
550
643
  /**
551
644
  * The calculated theme object that will be passed through context.
552
645
  */
553
- theme: a.object
646
+ theme: i.object
554
647
  });
555
- const M = typeof r == "string" ? r : r.light, $ = typeof r == "string" ? r : r.dark;
648
+ const g = typeof r == "string" ? r : r.light, $ = typeof r == "string" ? r : r.dark;
556
649
  return {
557
- CssVarsProvider: y,
558
- useColorScheme: T,
559
- getInitColorSchemeScript: (N) => Je({
560
- colorSchemeStorageKey: m,
561
- defaultLightColorScheme: M,
650
+ CssVarsProvider: u,
651
+ useColorScheme: b,
652
+ getInitColorSchemeScript: (O) => ct({
653
+ colorSchemeStorageKey: s,
654
+ defaultLightColorScheme: g,
562
655
  defaultDarkColorScheme: $,
563
- modeStorageKey: s,
564
- ...N
656
+ modeStorageKey: n,
657
+ ...O
565
658
  })
566
659
  };
567
660
  }
568
- function ke({
661
+ function ht({
569
662
  theme: e,
570
- ...t
663
+ ...o
571
664
  }) {
572
- const o = x in e ? e[x] : void 0;
573
- return /* @__PURE__ */ S(O, {
574
- ...t,
575
- themeId: o ? x : void 0,
576
- theme: o || e
665
+ const t = A in e ? e[A] : void 0;
666
+ return /* @__PURE__ */ T(U, {
667
+ ...o,
668
+ themeId: t ? A : void 0,
669
+ theme: t || e
577
670
  });
578
671
  }
579
- const L = {
672
+ const Y = {
580
673
  attribute: "data-mui-color-scheme",
581
674
  colorSchemeStorageKey: "mui-color-scheme",
582
675
  defaultLightColorScheme: "light",
583
676
  defaultDarkColorScheme: "dark",
584
677
  modeStorageKey: "mui-mode"
585
- }, {
586
- CssVarsProvider: ot,
587
- useColorScheme: ut,
588
- getInitColorSchemeScript: ft
589
- } = tt({
590
- themeId: x,
678
+ };
679
+ process.env.NODE_ENV !== "production" && (i.string, i.string, i.string, i.string, i.string, i.oneOf(["dark", "light", "system"]), i.string, i.string);
680
+ const {
681
+ CssVarsProvider: ft,
682
+ useColorScheme: wt,
683
+ getInitColorSchemeScript: $t
684
+ } = ut({
685
+ themeId: A,
591
686
  // @ts-ignore ignore module augmentation tests
592
- theme: () => ve({
687
+ theme: () => _e({
593
688
  cssVariables: !0
594
689
  }),
595
- colorSchemeStorageKey: L.colorSchemeStorageKey,
596
- modeStorageKey: L.modeStorageKey,
690
+ colorSchemeStorageKey: Y.colorSchemeStorageKey,
691
+ modeStorageKey: Y.modeStorageKey,
597
692
  defaultColorScheme: {
598
- light: L.defaultLightColorScheme,
599
- dark: L.defaultDarkColorScheme
693
+ light: Y.defaultLightColorScheme,
694
+ dark: Y.defaultDarkColorScheme
600
695
  },
601
696
  resolveTheme: (e) => {
602
- const t = {
697
+ const o = {
603
698
  ...e,
604
- typography: Re(e.palette, e.typography)
699
+ typography: Ye(e.palette, e.typography)
605
700
  };
606
- return t.unstable_sx = function(s) {
607
- return We({
608
- sx: s,
701
+ return o.unstable_sx = function(n) {
702
+ return ze({
703
+ sx: n,
609
704
  theme: this
610
705
  });
611
- }, t;
706
+ }, o;
612
707
  }
613
- }), rt = ot;
614
- function nt({
708
+ }), pt = ft;
709
+ function St({
615
710
  theme: e,
616
- ...t
711
+ ...o
617
712
  }) {
618
- return typeof e == "function" ? /* @__PURE__ */ S(ke, {
619
- theme: e,
620
- ...t
621
- }) : "colorSchemes" in (x in e ? e[x] : e) ? /* @__PURE__ */ S(rt, {
622
- theme: e,
623
- ...t
624
- }) : /* @__PURE__ */ S(ke, {
713
+ const t = a.useMemo(() => {
714
+ if (typeof e == "function")
715
+ return e;
716
+ const n = A in e ? e[A] : e;
717
+ return "colorSchemes" in n ? null : "vars" in n ? e : {
718
+ ...e,
719
+ vars: null
720
+ };
721
+ }, [e]);
722
+ return t ? /* @__PURE__ */ T(ht, {
723
+ theme: t,
724
+ ...o
725
+ }) : /* @__PURE__ */ T(pt, {
625
726
  theme: e,
626
- ...t
727
+ ...o
627
728
  });
628
729
  }
629
- const st = ve(), pt = (e) => ({
630
- theme: o,
631
- ...s
632
- }) => /* @__PURE__ */ S(Me, { injectFirst: !0, children: /* @__PURE__ */ S(nt, { theme: o || st, children: /* @__PURE__ */ S(e, { ...s }) }) });
730
+ const yt = _e(), _t = (e) => ({
731
+ theme: t,
732
+ ...n
733
+ }) => /* @__PURE__ */ T(Ve, { injectFirst: !0, children: /* @__PURE__ */ T(St, { theme: t || yt, children: /* @__PURE__ */ T(e, { ...n }) }) });
633
734
  export {
634
- pt as default
735
+ _t as default
635
736
  };