linuxdo-next

一个呼吸顺畅的 linux.do 论坛

当前为 2024-03-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name linuxdo-next
  3. // @namespace linuxdo-next
  4. // @version 0.1.0
  5. // @author delph1s
  6. // @description 一个呼吸顺畅的 linux.do 论坛
  7. // @license GPLv2
  8. // @iconURL https://cdn.linux.do/uploads/default/original/1X/3a18b4b0da3e8cf96f7eea15241c3d251f28a39b.png
  9. // @match *://linux.do/
  10. // @match *://linux.do/*
  11. // @require https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js
  12. // @require https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js
  13. // @grant GM_addStyle
  14. // @run-at document-end
  15. // ==/UserScript==
  16.  
  17. (t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const n=document.createElement("style");n.textContent=t,document.head.append(n)})(' :export{appName:"linuxdo-next";pluginContainer:linuxdo-next-container;pandoraButton:linuxdo-next-pandora-button}#linuxdo-next-container{left:0;font-size:12px}.linuxdo-next-pandora-button{position:fixed;right:1rem;bottom:1rem} ');
  18.  
  19. (function (React, ReactDOM__default) {
  20. 'use strict';
  21.  
  22. function _interopNamespaceDefault(e) {
  23. const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
  24. if (e) {
  25. for (const k in e) {
  26. if (k !== 'default') {
  27. const d = Object.getOwnPropertyDescriptor(e, k);
  28. Object.defineProperty(n, k, d.get ? d : {
  29. enumerable: true,
  30. get: () => e[k]
  31. });
  32. }
  33. }
  34. }
  35. n.default = e;
  36. return Object.freeze(n);
  37. }
  38.  
  39. const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
  40. const ReactDOM__default__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM__default);
  41.  
  42. function getAugmentedNamespace(n2) {
  43. if (n2.__esModule)
  44. return n2;
  45. var f2 = n2.default;
  46. if (typeof f2 == "function") {
  47. var a = function a2() {
  48. if (this instanceof a2) {
  49. return Reflect.construct(f2, arguments, this.constructor);
  50. }
  51. return f2.apply(this, arguments);
  52. };
  53. a.prototype = f2.prototype;
  54. } else
  55. a = {};
  56. Object.defineProperty(a, "__esModule", { value: true });
  57. Object.keys(n2).forEach(function(k2) {
  58. var d2 = Object.getOwnPropertyDescriptor(n2, k2);
  59. Object.defineProperty(a, k2, d2.get ? d2 : {
  60. enumerable: true,
  61. get: function() {
  62. return n2[k2];
  63. }
  64. });
  65. });
  66. return a;
  67. }
  68. var jsxRuntime = { exports: {} };
  69. var reactJsxRuntime_production_min = {};
  70. /**
  71. * @license React
  72. * react-jsx-runtime.production.min.js
  73. *
  74. * Copyright (c) Facebook, Inc. and its affiliates.
  75. *
  76. * This source code is licensed under the MIT license found in the
  77. * LICENSE file in the root directory of this source tree.
  78. */
  79. var f$2 = React, k$2 = Symbol.for("react.element"), l$2 = Symbol.for("react.fragment"), m$3 = Object.prototype.hasOwnProperty, n$2 = f$2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$2 = { key: true, ref: true, __self: true, __source: true };
  80. function q$2(c2, a, g2) {
  81. var b2, d2 = {}, e2 = null, h2 = null;
  82. void 0 !== g2 && (e2 = "" + g2);
  83. void 0 !== a.key && (e2 = "" + a.key);
  84. void 0 !== a.ref && (h2 = a.ref);
  85. for (b2 in a)
  86. m$3.call(a, b2) && !p$2.hasOwnProperty(b2) && (d2[b2] = a[b2]);
  87. if (c2 && c2.defaultProps)
  88. for (b2 in a = c2.defaultProps, a)
  89. void 0 === d2[b2] && (d2[b2] = a[b2]);
  90. return { $$typeof: k$2, type: c2, key: e2, ref: h2, props: d2, _owner: n$2.current };
  91. }
  92. reactJsxRuntime_production_min.Fragment = l$2;
  93. reactJsxRuntime_production_min.jsx = q$2;
  94. reactJsxRuntime_production_min.jsxs = q$2;
  95. {
  96. jsxRuntime.exports = reactJsxRuntime_production_min;
  97. }
  98. var jsxRuntimeExports = jsxRuntime.exports;
  99. const appName = '"linuxdo-next"';
  100. const pluginContainer = "linuxdo-next-container";
  101. const pandoraButton = "linuxdo-next-pandora-button";
  102. const styles$1 = {
  103. appName,
  104. pluginContainer,
  105. pandoraButton
  106. };
  107. var client = {};
  108. var m$2 = ReactDOM__default;
  109. {
  110. client.createRoot = m$2.createRoot;
  111. client.hydrateRoot = m$2.hydrateRoot;
  112. }
  113. const uiConfig = {
  114. pandoraDrawerWidth: "280px",
  115. pandoraDrawerMinHeight: "50%",
  116. pandoraDrawerMaxHeight: "70%"
  117. };
  118. const filterForwardProps = (targetProp, excludeProps) => excludeProps.indexOf(targetProp) === -1;
  119. function _objectWithoutPropertiesLoose(source, excluded) {
  120. if (source == null)
  121. return {};
  122. var target = {};
  123. var sourceKeys = Object.keys(source);
  124. var key, i;
  125. for (i = 0; i < sourceKeys.length; i++) {
  126. key = sourceKeys[i];
  127. if (excluded.indexOf(key) >= 0)
  128. continue;
  129. target[key] = source[key];
  130. }
  131. return target;
  132. }
  133. function _extends$1() {
  134. _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
  135. for (var i = 1; i < arguments.length; i++) {
  136. var source = arguments[i];
  137. for (var key in source) {
  138. if (Object.prototype.hasOwnProperty.call(source, key)) {
  139. target[key] = source[key];
  140. }
  141. }
  142. }
  143. return target;
  144. };
  145. return _extends$1.apply(this, arguments);
  146. }
  147. function r$1(e2) {
  148. var t2, f2, n2 = "";
  149. if ("string" == typeof e2 || "number" == typeof e2)
  150. n2 += e2;
  151. else if ("object" == typeof e2)
  152. if (Array.isArray(e2)) {
  153. var o = e2.length;
  154. for (t2 = 0; t2 < o; t2++)
  155. e2[t2] && (f2 = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
  156. } else
  157. for (f2 in e2)
  158. e2[f2] && (n2 && (n2 += " "), n2 += f2);
  159. return n2;
  160. }
  161. function clsx() {
  162. for (var e2, t2, f2 = 0, n2 = "", o = arguments.length; f2 < o; f2++)
  163. (e2 = arguments[f2]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2);
  164. return n2;
  165. }
  166. function resolveProps(defaultProps2, props) {
  167. const output = _extends$1({}, props);
  168. Object.keys(defaultProps2).forEach((propName) => {
  169. if (propName.toString().match(/^(components|slots)$/)) {
  170. output[propName] = _extends$1({}, defaultProps2[propName], output[propName]);
  171. } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
  172. const defaultSlotProps = defaultProps2[propName] || {};
  173. const slotProps = props[propName];
  174. output[propName] = {};
  175. if (!slotProps || !Object.keys(slotProps)) {
  176. output[propName] = defaultSlotProps;
  177. } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
  178. output[propName] = slotProps;
  179. } else {
  180. output[propName] = _extends$1({}, slotProps);
  181. Object.keys(defaultSlotProps).forEach((slotPropName) => {
  182. output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
  183. });
  184. }
  185. } else if (output[propName] === void 0) {
  186. output[propName] = defaultProps2[propName];
  187. }
  188. });
  189. return output;
  190. }
  191. function composeClasses(slots, getUtilityClass, classes = void 0) {
  192. const output = {};
  193. Object.keys(slots).forEach(
  194. // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
  195. // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
  196. (slot) => {
  197. output[slot] = slots[slot].reduce((acc, key) => {
  198. if (key) {
  199. const utilityClass = getUtilityClass(key);
  200. if (utilityClass !== "") {
  201. acc.push(utilityClass);
  202. }
  203. if (classes && classes[key]) {
  204. acc.push(classes[key]);
  205. }
  206. }
  207. return acc;
  208. }, []).join(" ");
  209. }
  210. );
  211. return output;
  212. }
  213. var colorManipulator = {};
  214. var interopRequireDefault = { exports: {} };
  215. (function(module) {
  216. function _interopRequireDefault2(obj) {
  217. return obj && obj.__esModule ? obj : {
  218. "default": obj
  219. };
  220. }
  221. module.exports = _interopRequireDefault2, module.exports.__esModule = true, module.exports["default"] = module.exports;
  222. })(interopRequireDefault);
  223. var interopRequireDefaultExports = interopRequireDefault.exports;
  224. function formatMuiErrorMessage$1(code) {
  225. let url = "https://mui.com/production-error/?code=" + code;
  226. for (let i = 1; i < arguments.length; i += 1) {
  227. url += "&args[]=" + encodeURIComponent(arguments[i]);
  228. }
  229. return "Minified MUI error #" + code + "; visit " + url + " for the full message.";
  230. }
  231. const formatMuiErrorMessage = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  232. __proto__: null,
  233. default: formatMuiErrorMessage$1
  234. }, Symbol.toStringTag, { value: "Module" }));
  235. const require$$1 = /* @__PURE__ */ getAugmentedNamespace(formatMuiErrorMessage);
  236. function clamp$1(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
  237. return Math.max(min, Math.min(val, max));
  238. }
  239. const clamp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  240. __proto__: null,
  241. default: clamp$1
  242. }, Symbol.toStringTag, { value: "Module" }));
  243. const require$$2 = /* @__PURE__ */ getAugmentedNamespace(clamp);
  244. var _interopRequireDefault$1 = interopRequireDefaultExports;
  245. Object.defineProperty(colorManipulator, "__esModule", {
  246. value: true
  247. });
  248. var alpha_1 = colorManipulator.alpha = alpha;
  249. colorManipulator.blend = blend;
  250. colorManipulator.colorChannel = void 0;
  251. var darken_1 = colorManipulator.darken = darken;
  252. colorManipulator.decomposeColor = decomposeColor;
  253. colorManipulator.emphasize = emphasize;
  254. var getContrastRatio_1 = colorManipulator.getContrastRatio = getContrastRatio;
  255. colorManipulator.getLuminance = getLuminance;
  256. colorManipulator.hexToRgb = hexToRgb;
  257. colorManipulator.hslToRgb = hslToRgb;
  258. var lighten_1 = colorManipulator.lighten = lighten;
  259. colorManipulator.private_safeAlpha = private_safeAlpha;
  260. colorManipulator.private_safeColorChannel = void 0;
  261. colorManipulator.private_safeDarken = private_safeDarken;
  262. colorManipulator.private_safeEmphasize = private_safeEmphasize;
  263. colorManipulator.private_safeLighten = private_safeLighten;
  264. colorManipulator.recomposeColor = recomposeColor;
  265. colorManipulator.rgbToHex = rgbToHex;
  266. var _formatMuiErrorMessage2 = _interopRequireDefault$1(require$$1);
  267. var _clamp = _interopRequireDefault$1(require$$2);
  268. function clampWrapper(value, min = 0, max = 1) {
  269. return (0, _clamp.default)(value, min, max);
  270. }
  271. function hexToRgb(color2) {
  272. color2 = color2.slice(1);
  273. const re = new RegExp(`.{1,${color2.length >= 6 ? 2 : 1}}`, "g");
  274. let colors = color2.match(re);
  275. if (colors && colors[0].length === 1) {
  276. colors = colors.map((n2) => n2 + n2);
  277. }
  278. return colors ? `rgb${colors.length === 4 ? "a" : ""}(${colors.map((n2, index) => {
  279. return index < 3 ? parseInt(n2, 16) : Math.round(parseInt(n2, 16) / 255 * 1e3) / 1e3;
  280. }).join(", ")})` : "";
  281. }
  282. function intToHex(int) {
  283. const hex = int.toString(16);
  284. return hex.length === 1 ? `0${hex}` : hex;
  285. }
  286. function decomposeColor(color2) {
  287. if (color2.type) {
  288. return color2;
  289. }
  290. if (color2.charAt(0) === "#") {
  291. return decomposeColor(hexToRgb(color2));
  292. }
  293. const marker = color2.indexOf("(");
  294. const type = color2.substring(0, marker);
  295. if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
  296. throw new Error((0, _formatMuiErrorMessage2.default)(9, color2));
  297. }
  298. let values2 = color2.substring(marker + 1, color2.length - 1);
  299. let colorSpace;
  300. if (type === "color") {
  301. values2 = values2.split(" ");
  302. colorSpace = values2.shift();
  303. if (values2.length === 4 && values2[3].charAt(0) === "/") {
  304. values2[3] = values2[3].slice(1);
  305. }
  306. if (["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {
  307. throw new Error((0, _formatMuiErrorMessage2.default)(10, colorSpace));
  308. }
  309. } else {
  310. values2 = values2.split(",");
  311. }
  312. values2 = values2.map((value) => parseFloat(value));
  313. return {
  314. type,
  315. values: values2,
  316. colorSpace
  317. };
  318. }
  319. const colorChannel = (color2) => {
  320. const decomposedColor = decomposeColor(color2);
  321. return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf("hsl") !== -1 && idx !== 0 ? `${val}%` : val).join(" ");
  322. };
  323. colorManipulator.colorChannel = colorChannel;
  324. const private_safeColorChannel = (color2, warning) => {
  325. try {
  326. return colorChannel(color2);
  327. } catch (error) {
  328. if (warning && false) {
  329. console.warn(warning);
  330. }
  331. return color2;
  332. }
  333. };
  334. colorManipulator.private_safeColorChannel = private_safeColorChannel;
  335. function recomposeColor(color2) {
  336. const {
  337. type,
  338. colorSpace
  339. } = color2;
  340. let {
  341. values: values2
  342. } = color2;
  343. if (type.indexOf("rgb") !== -1) {
  344. values2 = values2.map((n2, i) => i < 3 ? parseInt(n2, 10) : n2);
  345. } else if (type.indexOf("hsl") !== -1) {
  346. values2[1] = `${values2[1]}%`;
  347. values2[2] = `${values2[2]}%`;
  348. }
  349. if (type.indexOf("color") !== -1) {
  350. values2 = `${colorSpace} ${values2.join(" ")}`;
  351. } else {
  352. values2 = `${values2.join(", ")}`;
  353. }
  354. return `${type}(${values2})`;
  355. }
  356. function rgbToHex(color2) {
  357. if (color2.indexOf("#") === 0) {
  358. return color2;
  359. }
  360. const {
  361. values: values2
  362. } = decomposeColor(color2);
  363. return `#${values2.map((n2, i) => intToHex(i === 3 ? Math.round(255 * n2) : n2)).join("")}`;
  364. }
  365. function hslToRgb(color2) {
  366. color2 = decomposeColor(color2);
  367. const {
  368. values: values2
  369. } = color2;
  370. const h2 = values2[0];
  371. const s = values2[1] / 100;
  372. const l2 = values2[2] / 100;
  373. const a = s * Math.min(l2, 1 - l2);
  374. const f2 = (n2, k2 = (n2 + h2 / 30) % 12) => l2 - a * Math.max(Math.min(k2 - 3, 9 - k2, 1), -1);
  375. let type = "rgb";
  376. const rgb = [Math.round(f2(0) * 255), Math.round(f2(8) * 255), Math.round(f2(4) * 255)];
  377. if (color2.type === "hsla") {
  378. type += "a";
  379. rgb.push(values2[3]);
  380. }
  381. return recomposeColor({
  382. type,
  383. values: rgb
  384. });
  385. }
  386. function getLuminance(color2) {
  387. color2 = decomposeColor(color2);
  388. let rgb = color2.type === "hsl" || color2.type === "hsla" ? decomposeColor(hslToRgb(color2)).values : color2.values;
  389. rgb = rgb.map((val) => {
  390. if (color2.type !== "color") {
  391. val /= 255;
  392. }
  393. return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
  394. });
  395. return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
  396. }
  397. function getContrastRatio(foreground, background) {
  398. const lumA = getLuminance(foreground);
  399. const lumB = getLuminance(background);
  400. return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
  401. }
  402. function alpha(color2, value) {
  403. color2 = decomposeColor(color2);
  404. value = clampWrapper(value);
  405. if (color2.type === "rgb" || color2.type === "hsl") {
  406. color2.type += "a";
  407. }
  408. if (color2.type === "color") {
  409. color2.values[3] = `/${value}`;
  410. } else {
  411. color2.values[3] = value;
  412. }
  413. return recomposeColor(color2);
  414. }
  415. function private_safeAlpha(color2, value, warning) {
  416. try {
  417. return alpha(color2, value);
  418. } catch (error) {
  419. if (warning && false) {
  420. console.warn(warning);
  421. }
  422. return color2;
  423. }
  424. }
  425. function darken(color2, coefficient) {
  426. color2 = decomposeColor(color2);
  427. coefficient = clampWrapper(coefficient);
  428. if (color2.type.indexOf("hsl") !== -1) {
  429. color2.values[2] *= 1 - coefficient;
  430. } else if (color2.type.indexOf("rgb") !== -1 || color2.type.indexOf("color") !== -1) {
  431. for (let i = 0; i < 3; i += 1) {
  432. color2.values[i] *= 1 - coefficient;
  433. }
  434. }
  435. return recomposeColor(color2);
  436. }
  437. function private_safeDarken(color2, coefficient, warning) {
  438. try {
  439. return darken(color2, coefficient);
  440. } catch (error) {
  441. if (warning && false) {
  442. console.warn(warning);
  443. }
  444. return color2;
  445. }
  446. }
  447. function lighten(color2, coefficient) {
  448. color2 = decomposeColor(color2);
  449. coefficient = clampWrapper(coefficient);
  450. if (color2.type.indexOf("hsl") !== -1) {
  451. color2.values[2] += (100 - color2.values[2]) * coefficient;
  452. } else if (color2.type.indexOf("rgb") !== -1) {
  453. for (let i = 0; i < 3; i += 1) {
  454. color2.values[i] += (255 - color2.values[i]) * coefficient;
  455. }
  456. } else if (color2.type.indexOf("color") !== -1) {
  457. for (let i = 0; i < 3; i += 1) {
  458. color2.values[i] += (1 - color2.values[i]) * coefficient;
  459. }
  460. }
  461. return recomposeColor(color2);
  462. }
  463. function private_safeLighten(color2, coefficient, warning) {
  464. try {
  465. return lighten(color2, coefficient);
  466. } catch (error) {
  467. if (warning && false) {
  468. console.warn(warning);
  469. }
  470. return color2;
  471. }
  472. }
  473. function emphasize(color2, coefficient = 0.15) {
  474. return getLuminance(color2) > 0.5 ? darken(color2, coefficient) : lighten(color2, coefficient);
  475. }
  476. function private_safeEmphasize(color2, coefficient, warning) {
  477. try {
  478. return private_safeEmphasize(color2, coefficient);
  479. } catch (error) {
  480. if (warning && false) {
  481. console.warn(warning);
  482. }
  483. return color2;
  484. }
  485. }
  486. function blend(background, overlay, opacity, gamma = 1) {
  487. const blendChannel = (b2, o) => Math.round((b2 ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
  488. const backgroundColor2 = decomposeColor(background);
  489. const overlayColor = decomposeColor(overlay);
  490. const rgb = [blendChannel(backgroundColor2.values[0], overlayColor.values[0]), blendChannel(backgroundColor2.values[1], overlayColor.values[1]), blendChannel(backgroundColor2.values[2], overlayColor.values[2])];
  491. return recomposeColor({
  492. type: "rgb",
  493. values: rgb
  494. });
  495. }
  496. var createStyled$2 = {};
  497. var _extends = { exports: {} };
  498. var hasRequired_extends;
  499. function require_extends() {
  500. if (hasRequired_extends)
  501. return _extends.exports;
  502. hasRequired_extends = 1;
  503. (function(module) {
  504. function _extends3() {
  505. module.exports = _extends3 = Object.assign ? Object.assign.bind() : function(target) {
  506. for (var i = 1; i < arguments.length; i++) {
  507. var source = arguments[i];
  508. for (var key in source) {
  509. if (Object.prototype.hasOwnProperty.call(source, key)) {
  510. target[key] = source[key];
  511. }
  512. }
  513. }
  514. return target;
  515. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  516. return _extends3.apply(this, arguments);
  517. }
  518. module.exports = _extends3, module.exports.__esModule = true, module.exports["default"] = module.exports;
  519. })(_extends);
  520. return _extends.exports;
  521. }
  522. var objectWithoutPropertiesLoose = { exports: {} };
  523. var hasRequiredObjectWithoutPropertiesLoose;
  524. function requireObjectWithoutPropertiesLoose() {
  525. if (hasRequiredObjectWithoutPropertiesLoose)
  526. return objectWithoutPropertiesLoose.exports;
  527. hasRequiredObjectWithoutPropertiesLoose = 1;
  528. (function(module) {
  529. function _objectWithoutPropertiesLoose3(source, excluded) {
  530. if (source == null)
  531. return {};
  532. var target = {};
  533. var sourceKeys = Object.keys(source);
  534. var key, i;
  535. for (i = 0; i < sourceKeys.length; i++) {
  536. key = sourceKeys[i];
  537. if (excluded.indexOf(key) >= 0)
  538. continue;
  539. target[key] = source[key];
  540. }
  541. return target;
  542. }
  543. module.exports = _objectWithoutPropertiesLoose3, module.exports.__esModule = true, module.exports["default"] = module.exports;
  544. })(objectWithoutPropertiesLoose);
  545. return objectWithoutPropertiesLoose.exports;
  546. }
  547. function memoize$1(fn) {
  548. var cache2 = /* @__PURE__ */ Object.create(null);
  549. return function(arg) {
  550. if (cache2[arg] === void 0)
  551. cache2[arg] = fn(arg);
  552. return cache2[arg];
  553. };
  554. }
  555. var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
  556. var isPropValid = /* @__PURE__ */ memoize$1(
  557. function(prop) {
  558. return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
  559. }
  560. /* Z+1 */
  561. );
  562. function sheetForTag(tag) {
  563. if (tag.sheet) {
  564. return tag.sheet;
  565. }
  566. for (var i = 0; i < document.styleSheets.length; i++) {
  567. if (document.styleSheets[i].ownerNode === tag) {
  568. return document.styleSheets[i];
  569. }
  570. }
  571. }
  572. function createStyleElement(options) {
  573. var tag = document.createElement("style");
  574. tag.setAttribute("data-emotion", options.key);
  575. if (options.nonce !== void 0) {
  576. tag.setAttribute("nonce", options.nonce);
  577. }
  578. tag.appendChild(document.createTextNode(""));
  579. tag.setAttribute("data-s", "");
  580. return tag;
  581. }
  582. var StyleSheet = /* @__PURE__ */ function() {
  583. function StyleSheet2(options) {
  584. var _this = this;
  585. this._insertTag = function(tag) {
  586. var before;
  587. if (_this.tags.length === 0) {
  588. if (_this.insertionPoint) {
  589. before = _this.insertionPoint.nextSibling;
  590. } else if (_this.prepend) {
  591. before = _this.container.firstChild;
  592. } else {
  593. before = _this.before;
  594. }
  595. } else {
  596. before = _this.tags[_this.tags.length - 1].nextSibling;
  597. }
  598. _this.container.insertBefore(tag, before);
  599. _this.tags.push(tag);
  600. };
  601. this.isSpeedy = options.speedy === void 0 ? true : options.speedy;
  602. this.tags = [];
  603. this.ctr = 0;
  604. this.nonce = options.nonce;
  605. this.key = options.key;
  606. this.container = options.container;
  607. this.prepend = options.prepend;
  608. this.insertionPoint = options.insertionPoint;
  609. this.before = null;
  610. }
  611. var _proto = StyleSheet2.prototype;
  612. _proto.hydrate = function hydrate(nodes) {
  613. nodes.forEach(this._insertTag);
  614. };
  615. _proto.insert = function insert(rule) {
  616. if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
  617. this._insertTag(createStyleElement(this));
  618. }
  619. var tag = this.tags[this.tags.length - 1];
  620. if (this.isSpeedy) {
  621. var sheet = sheetForTag(tag);
  622. try {
  623. sheet.insertRule(rule, sheet.cssRules.length);
  624. } catch (e2) {
  625. }
  626. } else {
  627. tag.appendChild(document.createTextNode(rule));
  628. }
  629. this.ctr++;
  630. };
  631. _proto.flush = function flush() {
  632. this.tags.forEach(function(tag) {
  633. return tag.parentNode && tag.parentNode.removeChild(tag);
  634. });
  635. this.tags = [];
  636. this.ctr = 0;
  637. };
  638. return StyleSheet2;
  639. }();
  640. var MS = "-ms-";
  641. var MOZ = "-moz-";
  642. var WEBKIT = "-webkit-";
  643. var COMMENT = "comm";
  644. var RULESET = "rule";
  645. var DECLARATION = "decl";
  646. var IMPORT = "@import";
  647. var KEYFRAMES = "@keyframes";
  648. var LAYER = "@layer";
  649. var abs = Math.abs;
  650. var from = String.fromCharCode;
  651. var assign = Object.assign;
  652. function hash(value, length2) {
  653. return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
  654. }
  655. function trim(value) {
  656. return value.trim();
  657. }
  658. function match(value, pattern) {
  659. return (value = pattern.exec(value)) ? value[0] : value;
  660. }
  661. function replace(value, pattern, replacement) {
  662. return value.replace(pattern, replacement);
  663. }
  664. function indexof(value, search) {
  665. return value.indexOf(search);
  666. }
  667. function charat(value, index) {
  668. return value.charCodeAt(index) | 0;
  669. }
  670. function substr(value, begin, end) {
  671. return value.slice(begin, end);
  672. }
  673. function strlen(value) {
  674. return value.length;
  675. }
  676. function sizeof(value) {
  677. return value.length;
  678. }
  679. function append(value, array) {
  680. return array.push(value), value;
  681. }
  682. function combine(array, callback) {
  683. return array.map(callback).join("");
  684. }
  685. var line = 1;
  686. var column = 1;
  687. var length = 0;
  688. var position = 0;
  689. var character = 0;
  690. var characters = "";
  691. function node(value, root, parent, type, props, children, length2) {
  692. return { value, root, parent, type, props, children, line, column, length: length2, return: "" };
  693. }
  694. function copy(root, props) {
  695. return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
  696. }
  697. function char() {
  698. return character;
  699. }
  700. function prev() {
  701. character = position > 0 ? charat(characters, --position) : 0;
  702. if (column--, character === 10)
  703. column = 1, line--;
  704. return character;
  705. }
  706. function next() {
  707. character = position < length ? charat(characters, position++) : 0;
  708. if (column++, character === 10)
  709. column = 1, line++;
  710. return character;
  711. }
  712. function peek() {
  713. return charat(characters, position);
  714. }
  715. function caret() {
  716. return position;
  717. }
  718. function slice(begin, end) {
  719. return substr(characters, begin, end);
  720. }
  721. function token(type) {
  722. switch (type) {
  723. case 0:
  724. case 9:
  725. case 10:
  726. case 13:
  727. case 32:
  728. return 5;
  729. case 33:
  730. case 43:
  731. case 44:
  732. case 47:
  733. case 62:
  734. case 64:
  735. case 126:
  736. case 59:
  737. case 123:
  738. case 125:
  739. return 4;
  740. case 58:
  741. return 3;
  742. case 34:
  743. case 39:
  744. case 40:
  745. case 91:
  746. return 2;
  747. case 41:
  748. case 93:
  749. return 1;
  750. }
  751. return 0;
  752. }
  753. function alloc(value) {
  754. return line = column = 1, length = strlen(characters = value), position = 0, [];
  755. }
  756. function dealloc(value) {
  757. return characters = "", value;
  758. }
  759. function delimit(type) {
  760. return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
  761. }
  762. function whitespace(type) {
  763. while (character = peek())
  764. if (character < 33)
  765. next();
  766. else
  767. break;
  768. return token(type) > 2 || token(character) > 3 ? "" : " ";
  769. }
  770. function escaping(index, count) {
  771. while (--count && next())
  772. if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
  773. break;
  774. return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
  775. }
  776. function delimiter(type) {
  777. while (next())
  778. switch (character) {
  779. case type:
  780. return position;
  781. case 34:
  782. case 39:
  783. if (type !== 34 && type !== 39)
  784. delimiter(character);
  785. break;
  786. case 40:
  787. if (type === 41)
  788. delimiter(type);
  789. break;
  790. case 92:
  791. next();
  792. break;
  793. }
  794. return position;
  795. }
  796. function commenter(type, index) {
  797. while (next())
  798. if (type + character === 47 + 10)
  799. break;
  800. else if (type + character === 42 + 42 && peek() === 47)
  801. break;
  802. return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
  803. }
  804. function identifier(index) {
  805. while (!token(peek()))
  806. next();
  807. return slice(index, position);
  808. }
  809. function compile(value) {
  810. return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
  811. }
  812. function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
  813. var index = 0;
  814. var offset = 0;
  815. var length2 = pseudo;
  816. var atrule = 0;
  817. var property = 0;
  818. var previous = 0;
  819. var variable = 1;
  820. var scanning = 1;
  821. var ampersand = 1;
  822. var character2 = 0;
  823. var type = "";
  824. var props = rules;
  825. var children = rulesets;
  826. var reference = rule;
  827. var characters2 = type;
  828. while (scanning)
  829. switch (previous = character2, character2 = next()) {
  830. case 40:
  831. if (previous != 108 && charat(characters2, length2 - 1) == 58) {
  832. if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
  833. ampersand = -1;
  834. break;
  835. }
  836. case 34:
  837. case 39:
  838. case 91:
  839. characters2 += delimit(character2);
  840. break;
  841. case 9:
  842. case 10:
  843. case 13:
  844. case 32:
  845. characters2 += whitespace(previous);
  846. break;
  847. case 92:
  848. characters2 += escaping(caret() - 1, 7);
  849. continue;
  850. case 47:
  851. switch (peek()) {
  852. case 42:
  853. case 47:
  854. append(comment(commenter(next(), caret()), root, parent), declarations);
  855. break;
  856. default:
  857. characters2 += "/";
  858. }
  859. break;
  860. case 123 * variable:
  861. points[index++] = strlen(characters2) * ampersand;
  862. case 125 * variable:
  863. case 59:
  864. case 0:
  865. switch (character2) {
  866. case 0:
  867. case 125:
  868. scanning = 0;
  869. case 59 + offset:
  870. if (ampersand == -1)
  871. characters2 = replace(characters2, /\f/g, "");
  872. if (property > 0 && strlen(characters2) - length2)
  873. append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
  874. break;
  875. case 59:
  876. characters2 += ";";
  877. default:
  878. append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
  879. if (character2 === 123)
  880. if (offset === 0)
  881. parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
  882. else
  883. switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
  884. case 100:
  885. case 108:
  886. case 109:
  887. case 115:
  888. parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
  889. break;
  890. default:
  891. parse(characters2, reference, reference, reference, [""], children, 0, points, children);
  892. }
  893. }
  894. index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
  895. break;
  896. case 58:
  897. length2 = 1 + strlen(characters2), property = previous;
  898. default:
  899. if (variable < 1) {
  900. if (character2 == 123)
  901. --variable;
  902. else if (character2 == 125 && variable++ == 0 && prev() == 125)
  903. continue;
  904. }
  905. switch (characters2 += from(character2), character2 * variable) {
  906. case 38:
  907. ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
  908. break;
  909. case 44:
  910. points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
  911. break;
  912. case 64:
  913. if (peek() === 45)
  914. characters2 += delimit(next());
  915. atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
  916. break;
  917. case 45:
  918. if (previous === 45 && strlen(characters2) == 2)
  919. variable = 0;
  920. }
  921. }
  922. return rulesets;
  923. }
  924. function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2) {
  925. var post = offset - 1;
  926. var rule = offset === 0 ? rules : [""];
  927. var size = sizeof(rule);
  928. for (var i = 0, j = 0, k2 = 0; i < index; ++i)
  929. for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j = points[i])), z2 = value; x2 < size; ++x2)
  930. if (z2 = trim(j > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
  931. props[k2++] = z2;
  932. return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2);
  933. }
  934. function comment(value, root, parent) {
  935. return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
  936. }
  937. function declaration(value, root, parent, length2) {
  938. return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
  939. }
  940. function serialize(children, callback) {
  941. var output = "";
  942. var length2 = sizeof(children);
  943. for (var i = 0; i < length2; i++)
  944. output += callback(children[i], i, children, callback) || "";
  945. return output;
  946. }
  947. function stringify(element, index, children, callback) {
  948. switch (element.type) {
  949. case LAYER:
  950. if (element.children.length)
  951. break;
  952. case IMPORT:
  953. case DECLARATION:
  954. return element.return = element.return || element.value;
  955. case COMMENT:
  956. return "";
  957. case KEYFRAMES:
  958. return element.return = element.value + "{" + serialize(element.children, callback) + "}";
  959. case RULESET:
  960. element.value = element.props.join(",");
  961. }
  962. return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
  963. }
  964. function middleware(collection) {
  965. var length2 = sizeof(collection);
  966. return function(element, index, children, callback) {
  967. var output = "";
  968. for (var i = 0; i < length2; i++)
  969. output += collection[i](element, index, children, callback) || "";
  970. return output;
  971. };
  972. }
  973. function rulesheet(callback) {
  974. return function(element) {
  975. if (!element.root) {
  976. if (element = element.return)
  977. callback(element);
  978. }
  979. };
  980. }
  981. var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
  982. var previous = 0;
  983. var character2 = 0;
  984. while (true) {
  985. previous = character2;
  986. character2 = peek();
  987. if (previous === 38 && character2 === 12) {
  988. points[index] = 1;
  989. }
  990. if (token(character2)) {
  991. break;
  992. }
  993. next();
  994. }
  995. return slice(begin, position);
  996. };
  997. var toRules = function toRules2(parsed, points) {
  998. var index = -1;
  999. var character2 = 44;
  1000. do {
  1001. switch (token(character2)) {
  1002. case 0:
  1003. if (character2 === 38 && peek() === 12) {
  1004. points[index] = 1;
  1005. }
  1006. parsed[index] += identifierWithPointTracking(position - 1, points, index);
  1007. break;
  1008. case 2:
  1009. parsed[index] += delimit(character2);
  1010. break;
  1011. case 4:
  1012. if (character2 === 44) {
  1013. parsed[++index] = peek() === 58 ? "&\f" : "";
  1014. points[index] = parsed[index].length;
  1015. break;
  1016. }
  1017. default:
  1018. parsed[index] += from(character2);
  1019. }
  1020. } while (character2 = next());
  1021. return parsed;
  1022. };
  1023. var getRules = function getRules2(value, points) {
  1024. return dealloc(toRules(alloc(value), points));
  1025. };
  1026. var fixedElements = /* @__PURE__ */ new WeakMap();
  1027. var compat = function compat2(element) {
  1028. if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
  1029. // negative .length indicates that this rule has been already prefixed
  1030. element.length < 1) {
  1031. return;
  1032. }
  1033. var value = element.value, parent = element.parent;
  1034. var isImplicitRule = element.column === parent.column && element.line === parent.line;
  1035. while (parent.type !== "rule") {
  1036. parent = parent.parent;
  1037. if (!parent)
  1038. return;
  1039. }
  1040. if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
  1041. return;
  1042. }
  1043. if (isImplicitRule) {
  1044. return;
  1045. }
  1046. fixedElements.set(element, true);
  1047. var points = [];
  1048. var rules = getRules(value, points);
  1049. var parentRules = parent.props;
  1050. for (var i = 0, k2 = 0; i < rules.length; i++) {
  1051. for (var j = 0; j < parentRules.length; j++, k2++) {
  1052. element.props[k2] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
  1053. }
  1054. }
  1055. };
  1056. var removeLabel = function removeLabel2(element) {
  1057. if (element.type === "decl") {
  1058. var value = element.value;
  1059. if (
  1060. // charcode for l
  1061. value.charCodeAt(0) === 108 && // charcode for b
  1062. value.charCodeAt(2) === 98
  1063. ) {
  1064. element["return"] = "";
  1065. element.value = "";
  1066. }
  1067. }
  1068. };
  1069. function prefix(value, length2) {
  1070. switch (hash(value, length2)) {
  1071. case 5103:
  1072. return WEBKIT + "print-" + value + value;
  1073. case 5737:
  1074. case 4201:
  1075. case 3177:
  1076. case 3433:
  1077. case 1641:
  1078. case 4457:
  1079. case 2921:
  1080. case 5572:
  1081. case 6356:
  1082. case 5844:
  1083. case 3191:
  1084. case 6645:
  1085. case 3005:
  1086. case 6391:
  1087. case 5879:
  1088. case 5623:
  1089. case 6135:
  1090. case 4599:
  1091. case 4855:
  1092. case 4215:
  1093. case 6389:
  1094. case 5109:
  1095. case 5365:
  1096. case 5621:
  1097. case 3829:
  1098. return WEBKIT + value + value;
  1099. case 5349:
  1100. case 4246:
  1101. case 4810:
  1102. case 6968:
  1103. case 2756:
  1104. return WEBKIT + value + MOZ + value + MS + value + value;
  1105. case 6828:
  1106. case 4268:
  1107. return WEBKIT + value + MS + value + value;
  1108. case 6165:
  1109. return WEBKIT + value + MS + "flex-" + value + value;
  1110. case 5187:
  1111. return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
  1112. case 5443:
  1113. return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
  1114. case 4675:
  1115. return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
  1116. case 5548:
  1117. return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
  1118. case 5292:
  1119. return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
  1120. case 6060:
  1121. return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
  1122. case 4554:
  1123. return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
  1124. case 6187:
  1125. return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
  1126. case 5495:
  1127. case 3959:
  1128. return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
  1129. case 4968:
  1130. return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
  1131. case 4095:
  1132. case 3583:
  1133. case 4068:
  1134. case 2532:
  1135. return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
  1136. case 8116:
  1137. case 7059:
  1138. case 5753:
  1139. case 5535:
  1140. case 5445:
  1141. case 5701:
  1142. case 4933:
  1143. case 4677:
  1144. case 5533:
  1145. case 5789:
  1146. case 5021:
  1147. case 4765:
  1148. if (strlen(value) - 1 - length2 > 6)
  1149. switch (charat(value, length2 + 1)) {
  1150. case 109:
  1151. if (charat(value, length2 + 4) !== 45)
  1152. break;
  1153. case 102:
  1154. return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
  1155. case 115:
  1156. return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
  1157. }
  1158. break;
  1159. case 4949:
  1160. if (charat(value, length2 + 1) !== 115)
  1161. break;
  1162. case 6444:
  1163. switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
  1164. case 107:
  1165. return replace(value, ":", ":" + WEBKIT) + value;
  1166. case 101:
  1167. return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
  1168. }
  1169. break;
  1170. case 5936:
  1171. switch (charat(value, length2 + 11)) {
  1172. case 114:
  1173. return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
  1174. case 108:
  1175. return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
  1176. case 45:
  1177. return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
  1178. }
  1179. return WEBKIT + value + MS + value + value;
  1180. }
  1181. return value;
  1182. }
  1183. var prefixer = function prefixer2(element, index, children, callback) {
  1184. if (element.length > -1) {
  1185. if (!element["return"])
  1186. switch (element.type) {
  1187. case DECLARATION:
  1188. element["return"] = prefix(element.value, element.length);
  1189. break;
  1190. case KEYFRAMES:
  1191. return serialize([copy(element, {
  1192. value: replace(element.value, "@", "@" + WEBKIT)
  1193. })], callback);
  1194. case RULESET:
  1195. if (element.length)
  1196. return combine(element.props, function(value) {
  1197. switch (match(value, /(::plac\w+|:read-\w+)/)) {
  1198. case ":read-only":
  1199. case ":read-write":
  1200. return serialize([copy(element, {
  1201. props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
  1202. })], callback);
  1203. case "::placeholder":
  1204. return serialize([copy(element, {
  1205. props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
  1206. }), copy(element, {
  1207. props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
  1208. }), copy(element, {
  1209. props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
  1210. })], callback);
  1211. }
  1212. return "";
  1213. });
  1214. }
  1215. }
  1216. };
  1217. var defaultStylisPlugins = [prefixer];
  1218. var createCache = function createCache2(options) {
  1219. var key = options.key;
  1220. if (key === "css") {
  1221. var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
  1222. Array.prototype.forEach.call(ssrStyles, function(node2) {
  1223. var dataEmotionAttribute = node2.getAttribute("data-emotion");
  1224. if (dataEmotionAttribute.indexOf(" ") === -1) {
  1225. return;
  1226. }
  1227. document.head.appendChild(node2);
  1228. node2.setAttribute("data-s", "");
  1229. });
  1230. }
  1231. var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
  1232. var inserted = {};
  1233. var container;
  1234. var nodesToHydrate = [];
  1235. {
  1236. container = options.container || document.head;
  1237. Array.prototype.forEach.call(
  1238. // this means we will ignore elements which don't have a space in them which
  1239. // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
  1240. document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
  1241. function(node2) {
  1242. var attrib = node2.getAttribute("data-emotion").split(" ");
  1243. for (var i = 1; i < attrib.length; i++) {
  1244. inserted[attrib[i]] = true;
  1245. }
  1246. nodesToHydrate.push(node2);
  1247. }
  1248. );
  1249. }
  1250. var _insert;
  1251. var omnipresentPlugins = [compat, removeLabel];
  1252. {
  1253. var currentSheet;
  1254. var finalizingPlugins = [stringify, rulesheet(function(rule) {
  1255. currentSheet.insert(rule);
  1256. })];
  1257. var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
  1258. var stylis = function stylis2(styles2) {
  1259. return serialize(compile(styles2), serializer);
  1260. };
  1261. _insert = function insert(selector, serialized, sheet, shouldCache) {
  1262. currentSheet = sheet;
  1263. stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
  1264. if (shouldCache) {
  1265. cache2.inserted[serialized.name] = true;
  1266. }
  1267. };
  1268. }
  1269. var cache2 = {
  1270. key,
  1271. sheet: new StyleSheet({
  1272. key,
  1273. container,
  1274. nonce: options.nonce,
  1275. speedy: options.speedy,
  1276. prepend: options.prepend,
  1277. insertionPoint: options.insertionPoint
  1278. }),
  1279. nonce: options.nonce,
  1280. inserted,
  1281. registered: {},
  1282. insert: _insert
  1283. };
  1284. cache2.sheet.hydrate(nodesToHydrate);
  1285. return cache2;
  1286. };
  1287. var reactIs$2 = { exports: {} };
  1288. var reactIs_production_min$1 = {};
  1289. /** @license React v16.13.1
  1290. * react-is.production.min.js
  1291. *
  1292. * Copyright (c) Facebook, Inc. and its affiliates.
  1293. *
  1294. * This source code is licensed under the MIT license found in the
  1295. * LICENSE file in the root directory of this source tree.
  1296. */
  1297. var b$1 = "function" === typeof Symbol && Symbol.for, c$1 = b$1 ? Symbol.for("react.element") : 60103, d$1 = b$1 ? Symbol.for("react.portal") : 60106, e$1 = b$1 ? Symbol.for("react.fragment") : 60107, f$1 = b$1 ? Symbol.for("react.strict_mode") : 60108, g$1 = b$1 ? Symbol.for("react.profiler") : 60114, h$1 = b$1 ? Symbol.for("react.provider") : 60109, k$1 = b$1 ? Symbol.for("react.context") : 60110, l$1 = b$1 ? Symbol.for("react.async_mode") : 60111, m$1 = b$1 ? Symbol.for("react.concurrent_mode") : 60111, n$1 = b$1 ? Symbol.for("react.forward_ref") : 60112, p$1 = b$1 ? Symbol.for("react.suspense") : 60113, q$1 = b$1 ? Symbol.for("react.suspense_list") : 60120, r = b$1 ? Symbol.for("react.memo") : 60115, t$1 = b$1 ? Symbol.for("react.lazy") : 60116, v$1 = b$1 ? Symbol.for("react.block") : 60121, w = b$1 ? Symbol.for("react.fundamental") : 60117, x = b$1 ? Symbol.for("react.responder") : 60118, y = b$1 ? Symbol.for("react.scope") : 60119;
  1298. function z(a) {
  1299. if ("object" === typeof a && null !== a) {
  1300. var u2 = a.$$typeof;
  1301. switch (u2) {
  1302. case c$1:
  1303. switch (a = a.type, a) {
  1304. case l$1:
  1305. case m$1:
  1306. case e$1:
  1307. case g$1:
  1308. case f$1:
  1309. case p$1:
  1310. return a;
  1311. default:
  1312. switch (a = a && a.$$typeof, a) {
  1313. case k$1:
  1314. case n$1:
  1315. case t$1:
  1316. case r:
  1317. case h$1:
  1318. return a;
  1319. default:
  1320. return u2;
  1321. }
  1322. }
  1323. case d$1:
  1324. return u2;
  1325. }
  1326. }
  1327. }
  1328. function A(a) {
  1329. return z(a) === m$1;
  1330. }
  1331. reactIs_production_min$1.AsyncMode = l$1;
  1332. reactIs_production_min$1.ConcurrentMode = m$1;
  1333. reactIs_production_min$1.ContextConsumer = k$1;
  1334. reactIs_production_min$1.ContextProvider = h$1;
  1335. reactIs_production_min$1.Element = c$1;
  1336. reactIs_production_min$1.ForwardRef = n$1;
  1337. reactIs_production_min$1.Fragment = e$1;
  1338. reactIs_production_min$1.Lazy = t$1;
  1339. reactIs_production_min$1.Memo = r;
  1340. reactIs_production_min$1.Portal = d$1;
  1341. reactIs_production_min$1.Profiler = g$1;
  1342. reactIs_production_min$1.StrictMode = f$1;
  1343. reactIs_production_min$1.Suspense = p$1;
  1344. reactIs_production_min$1.isAsyncMode = function(a) {
  1345. return A(a) || z(a) === l$1;
  1346. };
  1347. reactIs_production_min$1.isConcurrentMode = A;
  1348. reactIs_production_min$1.isContextConsumer = function(a) {
  1349. return z(a) === k$1;
  1350. };
  1351. reactIs_production_min$1.isContextProvider = function(a) {
  1352. return z(a) === h$1;
  1353. };
  1354. reactIs_production_min$1.isElement = function(a) {
  1355. return "object" === typeof a && null !== a && a.$$typeof === c$1;
  1356. };
  1357. reactIs_production_min$1.isForwardRef = function(a) {
  1358. return z(a) === n$1;
  1359. };
  1360. reactIs_production_min$1.isFragment = function(a) {
  1361. return z(a) === e$1;
  1362. };
  1363. reactIs_production_min$1.isLazy = function(a) {
  1364. return z(a) === t$1;
  1365. };
  1366. reactIs_production_min$1.isMemo = function(a) {
  1367. return z(a) === r;
  1368. };
  1369. reactIs_production_min$1.isPortal = function(a) {
  1370. return z(a) === d$1;
  1371. };
  1372. reactIs_production_min$1.isProfiler = function(a) {
  1373. return z(a) === g$1;
  1374. };
  1375. reactIs_production_min$1.isStrictMode = function(a) {
  1376. return z(a) === f$1;
  1377. };
  1378. reactIs_production_min$1.isSuspense = function(a) {
  1379. return z(a) === p$1;
  1380. };
  1381. reactIs_production_min$1.isValidElementType = function(a) {
  1382. return "string" === typeof a || "function" === typeof a || a === e$1 || a === m$1 || a === g$1 || a === f$1 || a === p$1 || a === q$1 || "object" === typeof a && null !== a && (a.$$typeof === t$1 || a.$$typeof === r || a.$$typeof === h$1 || a.$$typeof === k$1 || a.$$typeof === n$1 || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v$1);
  1383. };
  1384. reactIs_production_min$1.typeOf = z;
  1385. {
  1386. reactIs$2.exports = reactIs_production_min$1;
  1387. }
  1388. var reactIsExports$1 = reactIs$2.exports;
  1389. var reactIs$1 = reactIsExports$1;
  1390. var FORWARD_REF_STATICS = {
  1391. "$$typeof": true,
  1392. render: true,
  1393. defaultProps: true,
  1394. displayName: true,
  1395. propTypes: true
  1396. };
  1397. var MEMO_STATICS = {
  1398. "$$typeof": true,
  1399. compare: true,
  1400. defaultProps: true,
  1401. displayName: true,
  1402. propTypes: true,
  1403. type: true
  1404. };
  1405. var TYPE_STATICS = {};
  1406. TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
  1407. TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
  1408. var isBrowser = true;
  1409. function getRegisteredStyles(registered, registeredStyles, classNames) {
  1410. var rawClassName = "";
  1411. classNames.split(" ").forEach(function(className) {
  1412. if (registered[className] !== void 0) {
  1413. registeredStyles.push(registered[className] + ";");
  1414. } else {
  1415. rawClassName += className + " ";
  1416. }
  1417. });
  1418. return rawClassName;
  1419. }
  1420. var registerStyles = function registerStyles2(cache2, serialized, isStringTag2) {
  1421. var className = cache2.key + "-" + serialized.name;
  1422. if (
  1423. // we only need to add the styles to the registered cache if the
  1424. // class name could be used further down
  1425. // the tree but if it's a string tag, we know it won't
  1426. // so we don't have to add it to registered cache.
  1427. // this improves memory usage since we can avoid storing the whole style string
  1428. (isStringTag2 === false || // we need to always store it if we're in compat mode and
  1429. // in node since emotion-server relies on whether a style is in
  1430. // the registered cache to know whether a style is global or not
  1431. // also, note that this check will be dead code eliminated in the browser
  1432. isBrowser === false) && cache2.registered[className] === void 0
  1433. ) {
  1434. cache2.registered[className] = serialized.styles;
  1435. }
  1436. };
  1437. var insertStyles = function insertStyles2(cache2, serialized, isStringTag2) {
  1438. registerStyles(cache2, serialized, isStringTag2);
  1439. var className = cache2.key + "-" + serialized.name;
  1440. if (cache2.inserted[serialized.name] === void 0) {
  1441. var current = serialized;
  1442. do {
  1443. cache2.insert(serialized === current ? "." + className : "", current, cache2.sheet, true);
  1444. current = current.next;
  1445. } while (current !== void 0);
  1446. }
  1447. };
  1448. function murmur2(str) {
  1449. var h2 = 0;
  1450. var k2, i = 0, len = str.length;
  1451. for (; len >= 4; ++i, len -= 4) {
  1452. k2 = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
  1453. k2 = /* Math.imul(k, m): */
  1454. (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
  1455. k2 ^= /* k >>> r: */
  1456. k2 >>> 24;
  1457. h2 = /* Math.imul(k, m): */
  1458. (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
  1459. (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
  1460. }
  1461. switch (len) {
  1462. case 3:
  1463. h2 ^= (str.charCodeAt(i + 2) & 255) << 16;
  1464. case 2:
  1465. h2 ^= (str.charCodeAt(i + 1) & 255) << 8;
  1466. case 1:
  1467. h2 ^= str.charCodeAt(i) & 255;
  1468. h2 = /* Math.imul(h, m): */
  1469. (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
  1470. }
  1471. h2 ^= h2 >>> 13;
  1472. h2 = /* Math.imul(h, m): */
  1473. (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
  1474. return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
  1475. }
  1476. var unitlessKeys = {
  1477. animationIterationCount: 1,
  1478. aspectRatio: 1,
  1479. borderImageOutset: 1,
  1480. borderImageSlice: 1,
  1481. borderImageWidth: 1,
  1482. boxFlex: 1,
  1483. boxFlexGroup: 1,
  1484. boxOrdinalGroup: 1,
  1485. columnCount: 1,
  1486. columns: 1,
  1487. flex: 1,
  1488. flexGrow: 1,
  1489. flexPositive: 1,
  1490. flexShrink: 1,
  1491. flexNegative: 1,
  1492. flexOrder: 1,
  1493. gridRow: 1,
  1494. gridRowEnd: 1,
  1495. gridRowSpan: 1,
  1496. gridRowStart: 1,
  1497. gridColumn: 1,
  1498. gridColumnEnd: 1,
  1499. gridColumnSpan: 1,
  1500. gridColumnStart: 1,
  1501. msGridRow: 1,
  1502. msGridRowSpan: 1,
  1503. msGridColumn: 1,
  1504. msGridColumnSpan: 1,
  1505. fontWeight: 1,
  1506. lineHeight: 1,
  1507. opacity: 1,
  1508. order: 1,
  1509. orphans: 1,
  1510. tabSize: 1,
  1511. widows: 1,
  1512. zIndex: 1,
  1513. zoom: 1,
  1514. WebkitLineClamp: 1,
  1515. // SVG-related properties
  1516. fillOpacity: 1,
  1517. floodOpacity: 1,
  1518. stopOpacity: 1,
  1519. strokeDasharray: 1,
  1520. strokeDashoffset: 1,
  1521. strokeMiterlimit: 1,
  1522. strokeOpacity: 1,
  1523. strokeWidth: 1
  1524. };
  1525. var hyphenateRegex = /[A-Z]|^ms/g;
  1526. var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
  1527. var isCustomProperty = function isCustomProperty2(property) {
  1528. return property.charCodeAt(1) === 45;
  1529. };
  1530. var isProcessableValue = function isProcessableValue2(value) {
  1531. return value != null && typeof value !== "boolean";
  1532. };
  1533. var processStyleName = /* @__PURE__ */ memoize$1(function(styleName) {
  1534. return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
  1535. });
  1536. var processStyleValue = function processStyleValue2(key, value) {
  1537. switch (key) {
  1538. case "animation":
  1539. case "animationName": {
  1540. if (typeof value === "string") {
  1541. return value.replace(animationRegex, function(match2, p1, p2) {
  1542. cursor = {
  1543. name: p1,
  1544. styles: p2,
  1545. next: cursor
  1546. };
  1547. return p1;
  1548. });
  1549. }
  1550. }
  1551. }
  1552. if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
  1553. return value + "px";
  1554. }
  1555. return value;
  1556. };
  1557. var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
  1558. function handleInterpolation(mergedProps, registered, interpolation) {
  1559. if (interpolation == null) {
  1560. return "";
  1561. }
  1562. if (interpolation.__emotion_styles !== void 0) {
  1563. return interpolation;
  1564. }
  1565. switch (typeof interpolation) {
  1566. case "boolean": {
  1567. return "";
  1568. }
  1569. case "object": {
  1570. if (interpolation.anim === 1) {
  1571. cursor = {
  1572. name: interpolation.name,
  1573. styles: interpolation.styles,
  1574. next: cursor
  1575. };
  1576. return interpolation.name;
  1577. }
  1578. if (interpolation.styles !== void 0) {
  1579. var next2 = interpolation.next;
  1580. if (next2 !== void 0) {
  1581. while (next2 !== void 0) {
  1582. cursor = {
  1583. name: next2.name,
  1584. styles: next2.styles,
  1585. next: cursor
  1586. };
  1587. next2 = next2.next;
  1588. }
  1589. }
  1590. var styles2 = interpolation.styles + ";";
  1591. return styles2;
  1592. }
  1593. return createStringFromObject(mergedProps, registered, interpolation);
  1594. }
  1595. case "function": {
  1596. if (mergedProps !== void 0) {
  1597. var previousCursor = cursor;
  1598. var result = interpolation(mergedProps);
  1599. cursor = previousCursor;
  1600. return handleInterpolation(mergedProps, registered, result);
  1601. }
  1602. break;
  1603. }
  1604. }
  1605. if (registered == null) {
  1606. return interpolation;
  1607. }
  1608. var cached = registered[interpolation];
  1609. return cached !== void 0 ? cached : interpolation;
  1610. }
  1611. function createStringFromObject(mergedProps, registered, obj) {
  1612. var string = "";
  1613. if (Array.isArray(obj)) {
  1614. for (var i = 0; i < obj.length; i++) {
  1615. string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
  1616. }
  1617. } else {
  1618. for (var _key in obj) {
  1619. var value = obj[_key];
  1620. if (typeof value !== "object") {
  1621. if (registered != null && registered[value] !== void 0) {
  1622. string += _key + "{" + registered[value] + "}";
  1623. } else if (isProcessableValue(value)) {
  1624. string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
  1625. }
  1626. } else {
  1627. if (_key === "NO_COMPONENT_SELECTOR" && false) {
  1628. throw new Error(noComponentSelectorMessage);
  1629. }
  1630. if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
  1631. for (var _i = 0; _i < value.length; _i++) {
  1632. if (isProcessableValue(value[_i])) {
  1633. string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
  1634. }
  1635. }
  1636. } else {
  1637. var interpolated = handleInterpolation(mergedProps, registered, value);
  1638. switch (_key) {
  1639. case "animation":
  1640. case "animationName": {
  1641. string += processStyleName(_key) + ":" + interpolated + ";";
  1642. break;
  1643. }
  1644. default: {
  1645. string += _key + "{" + interpolated + "}";
  1646. }
  1647. }
  1648. }
  1649. }
  1650. }
  1651. }
  1652. return string;
  1653. }
  1654. var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
  1655. var cursor;
  1656. var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
  1657. if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
  1658. return args[0];
  1659. }
  1660. var stringMode = true;
  1661. var styles2 = "";
  1662. cursor = void 0;
  1663. var strings = args[0];
  1664. if (strings == null || strings.raw === void 0) {
  1665. stringMode = false;
  1666. styles2 += handleInterpolation(mergedProps, registered, strings);
  1667. } else {
  1668. styles2 += strings[0];
  1669. }
  1670. for (var i = 1; i < args.length; i++) {
  1671. styles2 += handleInterpolation(mergedProps, registered, args[i]);
  1672. if (stringMode) {
  1673. styles2 += strings[i];
  1674. }
  1675. }
  1676. labelPattern.lastIndex = 0;
  1677. var identifierName = "";
  1678. var match2;
  1679. while ((match2 = labelPattern.exec(styles2)) !== null) {
  1680. identifierName += "-" + // $FlowFixMe we know it's not null
  1681. match2[1];
  1682. }
  1683. var name = murmur2(styles2) + identifierName;
  1684. return {
  1685. name,
  1686. styles: styles2,
  1687. next: cursor
  1688. };
  1689. };
  1690. var syncFallback = function syncFallback2(create) {
  1691. return create();
  1692. };
  1693. var useInsertionEffect = React__namespace["useInsertionEffect"] ? React__namespace["useInsertionEffect"] : false;
  1694. var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
  1695. var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect;
  1696. var EmotionCacheContext = /* @__PURE__ */ React__namespace.createContext(
  1697. // we're doing this to avoid preconstruct's dead code elimination in this one case
  1698. // because this module is primarily intended for the browser and node
  1699. // but it's also required in react native and similar environments sometimes
  1700. // and we could have a special build just for that
  1701. // but this is much easier and the native packages
  1702. // might use a different theme context in the future anyway
  1703. typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache({
  1704. key: "css"
  1705. }) : null
  1706. );
  1707. var CacheProvider = EmotionCacheContext.Provider;
  1708. var withEmotionCache = function withEmotionCache2(func) {
  1709. return /* @__PURE__ */ React.forwardRef(function(props, ref) {
  1710. var cache2 = React.useContext(EmotionCacheContext);
  1711. return func(props, cache2, ref);
  1712. });
  1713. };
  1714. var ThemeContext$2 = /* @__PURE__ */ React__namespace.createContext({});
  1715. var Global = /* @__PURE__ */ withEmotionCache(function(props, cache2) {
  1716. var styles2 = props.styles;
  1717. var serialized = serializeStyles([styles2], void 0, React__namespace.useContext(ThemeContext$2));
  1718. var sheetRef = React__namespace.useRef();
  1719. useInsertionEffectWithLayoutFallback(function() {
  1720. var key = cache2.key + "-global";
  1721. var sheet = new cache2.sheet.constructor({
  1722. key,
  1723. nonce: cache2.sheet.nonce,
  1724. container: cache2.sheet.container,
  1725. speedy: cache2.sheet.isSpeedy
  1726. });
  1727. var rehydrating = false;
  1728. var node2 = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
  1729. if (cache2.sheet.tags.length) {
  1730. sheet.before = cache2.sheet.tags[0];
  1731. }
  1732. if (node2 !== null) {
  1733. rehydrating = true;
  1734. node2.setAttribute("data-emotion", key);
  1735. sheet.hydrate([node2]);
  1736. }
  1737. sheetRef.current = [sheet, rehydrating];
  1738. return function() {
  1739. sheet.flush();
  1740. };
  1741. }, [cache2]);
  1742. useInsertionEffectWithLayoutFallback(function() {
  1743. var sheetRefCurrent = sheetRef.current;
  1744. var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
  1745. if (rehydrating) {
  1746. sheetRefCurrent[1] = false;
  1747. return;
  1748. }
  1749. if (serialized.next !== void 0) {
  1750. insertStyles(cache2, serialized.next, true);
  1751. }
  1752. if (sheet.tags.length) {
  1753. var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
  1754. sheet.before = element;
  1755. sheet.flush();
  1756. }
  1757. cache2.insert("", serialized, sheet, false);
  1758. }, [cache2, serialized.name]);
  1759. return null;
  1760. });
  1761. function css() {
  1762. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1763. args[_key] = arguments[_key];
  1764. }
  1765. return serializeStyles(args);
  1766. }
  1767. var keyframes = function keyframes2() {
  1768. var insertable = css.apply(void 0, arguments);
  1769. var name = "animation-" + insertable.name;
  1770. return {
  1771. name,
  1772. styles: "@keyframes " + name + "{" + insertable.styles + "}",
  1773. anim: 1,
  1774. toString: function toString() {
  1775. return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
  1776. }
  1777. };
  1778. };
  1779. var testOmitPropsOnStringTag = isPropValid;
  1780. var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
  1781. return key !== "theme";
  1782. };
  1783. var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
  1784. return typeof tag === "string" && // 96 is one less than the char code
  1785. // for "a" so this is checking that
  1786. // it's a lowercase character
  1787. tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
  1788. };
  1789. var composeShouldForwardProps = function composeShouldForwardProps2(tag, options, isReal) {
  1790. var shouldForwardProp2;
  1791. if (options) {
  1792. var optionsShouldForwardProp = options.shouldForwardProp;
  1793. shouldForwardProp2 = tag.__emotion_forwardProp && optionsShouldForwardProp ? function(propName) {
  1794. return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
  1795. } : optionsShouldForwardProp;
  1796. }
  1797. if (typeof shouldForwardProp2 !== "function" && isReal) {
  1798. shouldForwardProp2 = tag.__emotion_forwardProp;
  1799. }
  1800. return shouldForwardProp2;
  1801. };
  1802. var Insertion = function Insertion2(_ref) {
  1803. var cache2 = _ref.cache, serialized = _ref.serialized, isStringTag2 = _ref.isStringTag;
  1804. registerStyles(cache2, serialized, isStringTag2);
  1805. useInsertionEffectAlwaysWithSyncFallback(function() {
  1806. return insertStyles(cache2, serialized, isStringTag2);
  1807. });
  1808. return null;
  1809. };
  1810. var createStyled$1 = function createStyled2(tag, options) {
  1811. var isReal = tag.__emotion_real === tag;
  1812. var baseTag = isReal && tag.__emotion_base || tag;
  1813. var identifierName;
  1814. var targetClassName;
  1815. if (options !== void 0) {
  1816. identifierName = options.label;
  1817. targetClassName = options.target;
  1818. }
  1819. var shouldForwardProp2 = composeShouldForwardProps(tag, options, isReal);
  1820. var defaultShouldForwardProp = shouldForwardProp2 || getDefaultShouldForwardProp(baseTag);
  1821. var shouldUseAs = !defaultShouldForwardProp("as");
  1822. return function() {
  1823. var args = arguments;
  1824. var styles2 = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
  1825. if (identifierName !== void 0) {
  1826. styles2.push("label:" + identifierName + ";");
  1827. }
  1828. if (args[0] == null || args[0].raw === void 0) {
  1829. styles2.push.apply(styles2, args);
  1830. } else {
  1831. styles2.push(args[0][0]);
  1832. var len = args.length;
  1833. var i = 1;
  1834. for (; i < len; i++) {
  1835. styles2.push(args[i], args[0][i]);
  1836. }
  1837. }
  1838. var Styled = withEmotionCache(function(props, cache2, ref) {
  1839. var FinalTag = shouldUseAs && props.as || baseTag;
  1840. var className = "";
  1841. var classInterpolations = [];
  1842. var mergedProps = props;
  1843. if (props.theme == null) {
  1844. mergedProps = {};
  1845. for (var key in props) {
  1846. mergedProps[key] = props[key];
  1847. }
  1848. mergedProps.theme = React__namespace.useContext(ThemeContext$2);
  1849. }
  1850. if (typeof props.className === "string") {
  1851. className = getRegisteredStyles(cache2.registered, classInterpolations, props.className);
  1852. } else if (props.className != null) {
  1853. className = props.className + " ";
  1854. }
  1855. var serialized = serializeStyles(styles2.concat(classInterpolations), cache2.registered, mergedProps);
  1856. className += cache2.key + "-" + serialized.name;
  1857. if (targetClassName !== void 0) {
  1858. className += " " + targetClassName;
  1859. }
  1860. var finalShouldForwardProp = shouldUseAs && shouldForwardProp2 === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
  1861. var newProps = {};
  1862. for (var _key in props) {
  1863. if (shouldUseAs && _key === "as")
  1864. continue;
  1865. if (
  1866. // $FlowFixMe
  1867. finalShouldForwardProp(_key)
  1868. ) {
  1869. newProps[_key] = props[_key];
  1870. }
  1871. }
  1872. newProps.className = className;
  1873. newProps.ref = ref;
  1874. return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Insertion, {
  1875. cache: cache2,
  1876. serialized,
  1877. isStringTag: typeof FinalTag === "string"
  1878. }), /* @__PURE__ */ React__namespace.createElement(FinalTag, newProps));
  1879. });
  1880. Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
  1881. Styled.defaultProps = tag.defaultProps;
  1882. Styled.__emotion_real = Styled;
  1883. Styled.__emotion_base = baseTag;
  1884. Styled.__emotion_styles = styles2;
  1885. Styled.__emotion_forwardProp = shouldForwardProp2;
  1886. Object.defineProperty(Styled, "toString", {
  1887. value: function value() {
  1888. if (targetClassName === void 0 && false) {
  1889. return "NO_COMPONENT_SELECTOR";
  1890. }
  1891. return "." + targetClassName;
  1892. }
  1893. });
  1894. Styled.withComponent = function(nextTag, nextOptions) {
  1895. return createStyled2(nextTag, _extends$1({}, options, nextOptions, {
  1896. shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
  1897. })).apply(void 0, styles2);
  1898. };
  1899. return Styled;
  1900. };
  1901. };
  1902. var tags = [
  1903. "a",
  1904. "abbr",
  1905. "address",
  1906. "area",
  1907. "article",
  1908. "aside",
  1909. "audio",
  1910. "b",
  1911. "base",
  1912. "bdi",
  1913. "bdo",
  1914. "big",
  1915. "blockquote",
  1916. "body",
  1917. "br",
  1918. "button",
  1919. "canvas",
  1920. "caption",
  1921. "cite",
  1922. "code",
  1923. "col",
  1924. "colgroup",
  1925. "data",
  1926. "datalist",
  1927. "dd",
  1928. "del",
  1929. "details",
  1930. "dfn",
  1931. "dialog",
  1932. "div",
  1933. "dl",
  1934. "dt",
  1935. "em",
  1936. "embed",
  1937. "fieldset",
  1938. "figcaption",
  1939. "figure",
  1940. "footer",
  1941. "form",
  1942. "h1",
  1943. "h2",
  1944. "h3",
  1945. "h4",
  1946. "h5",
  1947. "h6",
  1948. "head",
  1949. "header",
  1950. "hgroup",
  1951. "hr",
  1952. "html",
  1953. "i",
  1954. "iframe",
  1955. "img",
  1956. "input",
  1957. "ins",
  1958. "kbd",
  1959. "keygen",
  1960. "label",
  1961. "legend",
  1962. "li",
  1963. "link",
  1964. "main",
  1965. "map",
  1966. "mark",
  1967. "marquee",
  1968. "menu",
  1969. "menuitem",
  1970. "meta",
  1971. "meter",
  1972. "nav",
  1973. "noscript",
  1974. "object",
  1975. "ol",
  1976. "optgroup",
  1977. "option",
  1978. "output",
  1979. "p",
  1980. "param",
  1981. "picture",
  1982. "pre",
  1983. "progress",
  1984. "q",
  1985. "rp",
  1986. "rt",
  1987. "ruby",
  1988. "s",
  1989. "samp",
  1990. "script",
  1991. "section",
  1992. "select",
  1993. "small",
  1994. "source",
  1995. "span",
  1996. "strong",
  1997. "style",
  1998. "sub",
  1999. "summary",
  2000. "sup",
  2001. "table",
  2002. "tbody",
  2003. "td",
  2004. "textarea",
  2005. "tfoot",
  2006. "th",
  2007. "thead",
  2008. "time",
  2009. "title",
  2010. "tr",
  2011. "track",
  2012. "u",
  2013. "ul",
  2014. "var",
  2015. "video",
  2016. "wbr",
  2017. // SVG
  2018. "circle",
  2019. "clipPath",
  2020. "defs",
  2021. "ellipse",
  2022. "foreignObject",
  2023. "g",
  2024. "image",
  2025. "line",
  2026. "linearGradient",
  2027. "mask",
  2028. "path",
  2029. "pattern",
  2030. "polygon",
  2031. "polyline",
  2032. "radialGradient",
  2033. "rect",
  2034. "stop",
  2035. "svg",
  2036. "text",
  2037. "tspan"
  2038. ];
  2039. var newStyled = createStyled$1.bind();
  2040. tags.forEach(function(tagName) {
  2041. newStyled[tagName] = newStyled(tagName);
  2042. });
  2043. let cache;
  2044. if (typeof document === "object") {
  2045. cache = createCache({
  2046. key: "css",
  2047. prepend: true
  2048. });
  2049. }
  2050. function StyledEngineProvider(props) {
  2051. const {
  2052. injectFirst,
  2053. children
  2054. } = props;
  2055. return injectFirst && cache ? /* @__PURE__ */ jsxRuntimeExports.jsx(CacheProvider, {
  2056. value: cache,
  2057. children
  2058. }) : children;
  2059. }
  2060. function isEmpty$1(obj) {
  2061. return obj === void 0 || obj === null || Object.keys(obj).length === 0;
  2062. }
  2063. function GlobalStyles(props) {
  2064. const {
  2065. styles: styles2,
  2066. defaultTheme: defaultTheme2 = {}
  2067. } = props;
  2068. const globalStyles = typeof styles2 === "function" ? (themeInput) => styles2(isEmpty$1(themeInput) ? defaultTheme2 : themeInput) : styles2;
  2069. return /* @__PURE__ */ jsxRuntimeExports.jsx(Global, {
  2070. styles: globalStyles
  2071. });
  2072. }
  2073. function styled$1(tag, options) {
  2074. const stylesFactory = newStyled(tag, options);
  2075. return stylesFactory;
  2076. }
  2077. const internal_processStyles = (tag, processor) => {
  2078. if (Array.isArray(tag.__emotion_styles)) {
  2079. tag.__emotion_styles = processor(tag.__emotion_styles);
  2080. }
  2081. };
  2082. const styledEngine = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2083. __proto__: null,
  2084. GlobalStyles,
  2085. StyledEngineProvider,
  2086. ThemeContext: ThemeContext$2,
  2087. css,
  2088. default: styled$1,
  2089. internal_processStyles,
  2090. keyframes
  2091. }, Symbol.toStringTag, { value: "Module" }));
  2092. const require$$3 = /* @__PURE__ */ getAugmentedNamespace(styledEngine);
  2093. function isPlainObject(item) {
  2094. if (typeof item !== "object" || item === null) {
  2095. return false;
  2096. }
  2097. const prototype = Object.getPrototypeOf(item);
  2098. return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
  2099. }
  2100. function deepClone(source) {
  2101. if (!isPlainObject(source)) {
  2102. return source;
  2103. }
  2104. const output = {};
  2105. Object.keys(source).forEach((key) => {
  2106. output[key] = deepClone(source[key]);
  2107. });
  2108. return output;
  2109. }
  2110. function deepmerge$1(target, source, options = {
  2111. clone: true
  2112. }) {
  2113. const output = options.clone ? _extends$1({}, target) : target;
  2114. if (isPlainObject(target) && isPlainObject(source)) {
  2115. Object.keys(source).forEach((key) => {
  2116. if (key === "__proto__") {
  2117. return;
  2118. }
  2119. if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
  2120. output[key] = deepmerge$1(target[key], source[key], options);
  2121. } else if (options.clone) {
  2122. output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
  2123. } else {
  2124. output[key] = source[key];
  2125. }
  2126. });
  2127. }
  2128. return output;
  2129. }
  2130. const deepmerge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2131. __proto__: null,
  2132. default: deepmerge$1,
  2133. isPlainObject
  2134. }, Symbol.toStringTag, { value: "Module" }));
  2135. const require$$4 = /* @__PURE__ */ getAugmentedNamespace(deepmerge);
  2136. function capitalize$1(string) {
  2137. if (typeof string !== "string") {
  2138. throw new Error(formatMuiErrorMessage$1(7));
  2139. }
  2140. return string.charAt(0).toUpperCase() + string.slice(1);
  2141. }
  2142. const capitalize = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2143. __proto__: null,
  2144. default: capitalize$1
  2145. }, Symbol.toStringTag, { value: "Module" }));
  2146. const require$$5 = /* @__PURE__ */ getAugmentedNamespace(capitalize);
  2147. var reactIs = { exports: {} };
  2148. var reactIs_production_min = {};
  2149. /**
  2150. * @license React
  2151. * react-is.production.min.js
  2152. *
  2153. * Copyright (c) Facebook, Inc. and its affiliates.
  2154. *
  2155. * This source code is licensed under the MIT license found in the
  2156. * LICENSE file in the root directory of this source tree.
  2157. */
  2158. var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
  2159. u = Symbol.for("react.module.reference");
  2160. function v(a) {
  2161. if ("object" === typeof a && null !== a) {
  2162. var r2 = a.$$typeof;
  2163. switch (r2) {
  2164. case b:
  2165. switch (a = a.type, a) {
  2166. case d:
  2167. case f:
  2168. case e:
  2169. case m:
  2170. case n:
  2171. return a;
  2172. default:
  2173. switch (a = a && a.$$typeof, a) {
  2174. case k:
  2175. case h:
  2176. case l:
  2177. case q:
  2178. case p:
  2179. case g:
  2180. return a;
  2181. default:
  2182. return r2;
  2183. }
  2184. }
  2185. case c:
  2186. return r2;
  2187. }
  2188. }
  2189. }
  2190. reactIs_production_min.ContextConsumer = h;
  2191. reactIs_production_min.ContextProvider = g;
  2192. reactIs_production_min.Element = b;
  2193. reactIs_production_min.ForwardRef = l;
  2194. reactIs_production_min.Fragment = d;
  2195. reactIs_production_min.Lazy = q;
  2196. reactIs_production_min.Memo = p;
  2197. reactIs_production_min.Portal = c;
  2198. reactIs_production_min.Profiler = f;
  2199. reactIs_production_min.StrictMode = e;
  2200. reactIs_production_min.Suspense = m;
  2201. reactIs_production_min.SuspenseList = n;
  2202. reactIs_production_min.isAsyncMode = function() {
  2203. return false;
  2204. };
  2205. reactIs_production_min.isConcurrentMode = function() {
  2206. return false;
  2207. };
  2208. reactIs_production_min.isContextConsumer = function(a) {
  2209. return v(a) === h;
  2210. };
  2211. reactIs_production_min.isContextProvider = function(a) {
  2212. return v(a) === g;
  2213. };
  2214. reactIs_production_min.isElement = function(a) {
  2215. return "object" === typeof a && null !== a && a.$$typeof === b;
  2216. };
  2217. reactIs_production_min.isForwardRef = function(a) {
  2218. return v(a) === l;
  2219. };
  2220. reactIs_production_min.isFragment = function(a) {
  2221. return v(a) === d;
  2222. };
  2223. reactIs_production_min.isLazy = function(a) {
  2224. return v(a) === q;
  2225. };
  2226. reactIs_production_min.isMemo = function(a) {
  2227. return v(a) === p;
  2228. };
  2229. reactIs_production_min.isPortal = function(a) {
  2230. return v(a) === c;
  2231. };
  2232. reactIs_production_min.isProfiler = function(a) {
  2233. return v(a) === f;
  2234. };
  2235. reactIs_production_min.isStrictMode = function(a) {
  2236. return v(a) === e;
  2237. };
  2238. reactIs_production_min.isSuspense = function(a) {
  2239. return v(a) === m;
  2240. };
  2241. reactIs_production_min.isSuspenseList = function(a) {
  2242. return v(a) === n;
  2243. };
  2244. reactIs_production_min.isValidElementType = function(a) {
  2245. return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
  2246. };
  2247. reactIs_production_min.typeOf = v;
  2248. {
  2249. reactIs.exports = reactIs_production_min;
  2250. }
  2251. var reactIsExports = reactIs.exports;
  2252. const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
  2253. function getFunctionName(fn) {
  2254. const match2 = `${fn}`.match(fnNameMatchRegex);
  2255. const name = match2 && match2[1];
  2256. return name || "";
  2257. }
  2258. function getFunctionComponentName(Component, fallback = "") {
  2259. return Component.displayName || Component.name || getFunctionName(Component) || fallback;
  2260. }
  2261. function getWrappedName(outerType, innerType, wrapperName) {
  2262. const functionName = getFunctionComponentName(innerType);
  2263. return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
  2264. }
  2265. function getDisplayName$1(Component) {
  2266. if (Component == null) {
  2267. return void 0;
  2268. }
  2269. if (typeof Component === "string") {
  2270. return Component;
  2271. }
  2272. if (typeof Component === "function") {
  2273. return getFunctionComponentName(Component, "Component");
  2274. }
  2275. if (typeof Component === "object") {
  2276. switch (Component.$$typeof) {
  2277. case reactIsExports.ForwardRef:
  2278. return getWrappedName(Component, Component.render, "ForwardRef");
  2279. case reactIsExports.Memo:
  2280. return getWrappedName(Component, Component.type, "memo");
  2281. default:
  2282. return void 0;
  2283. }
  2284. }
  2285. return void 0;
  2286. }
  2287. const getDisplayName = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  2288. __proto__: null,
  2289. default: getDisplayName$1,
  2290. getFunctionName
  2291. }, Symbol.toStringTag, { value: "Module" }));
  2292. const require$$6 = /* @__PURE__ */ getAugmentedNamespace(getDisplayName);
  2293. const _excluded$i = ["values", "unit", "step"];
  2294. const sortBreakpointsValues = (values2) => {
  2295. const breakpointsAsArray = Object.keys(values2).map((key) => ({
  2296. key,
  2297. val: values2[key]
  2298. })) || [];
  2299. breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
  2300. return breakpointsAsArray.reduce((acc, obj) => {
  2301. return _extends$1({}, acc, {
  2302. [obj.key]: obj.val
  2303. });
  2304. }, {});
  2305. };
  2306. function createBreakpoints(breakpoints) {
  2307. const {
  2308. // The breakpoint **start** at this value.
  2309. // For instance with the first breakpoint xs: [xs, sm).
  2310. values: values2 = {
  2311. xs: 0,
  2312. // phone
  2313. sm: 600,
  2314. // tablet
  2315. md: 900,
  2316. // small laptop
  2317. lg: 1200,
  2318. // desktop
  2319. xl: 1536
  2320. // large screen
  2321. },
  2322. unit = "px",
  2323. step = 5
  2324. } = breakpoints, other = _objectWithoutPropertiesLoose(breakpoints, _excluded$i);
  2325. const sortedValues = sortBreakpointsValues(values2);
  2326. const keys = Object.keys(sortedValues);
  2327. function up(key) {
  2328. const value = typeof values2[key] === "number" ? values2[key] : key;
  2329. return `@media (min-width:${value}${unit})`;
  2330. }
  2331. function down(key) {
  2332. const value = typeof values2[key] === "number" ? values2[key] : key;
  2333. return `@media (max-width:${value - step / 100}${unit})`;
  2334. }
  2335. function between(start, end) {
  2336. const endIndex = keys.indexOf(end);
  2337. return `@media (min-width:${typeof values2[start] === "number" ? values2[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values2[keys[endIndex]] === "number" ? values2[keys[endIndex]] : end) - step / 100}${unit})`;
  2338. }
  2339. function only(key) {
  2340. if (keys.indexOf(key) + 1 < keys.length) {
  2341. return between(key, keys[keys.indexOf(key) + 1]);
  2342. }
  2343. return up(key);
  2344. }
  2345. function not(key) {
  2346. const keyIndex = keys.indexOf(key);
  2347. if (keyIndex === 0) {
  2348. return up(keys[1]);
  2349. }
  2350. if (keyIndex === keys.length - 1) {
  2351. return down(keys[keyIndex]);
  2352. }
  2353. return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
  2354. }
  2355. return _extends$1({
  2356. keys,
  2357. values: sortedValues,
  2358. up,
  2359. down,
  2360. between,
  2361. only,
  2362. not,
  2363. unit
  2364. }, other);
  2365. }
  2366. const shape = {
  2367. borderRadius: 4
  2368. };
  2369. const shape$1 = shape;
  2370. function merge(acc, item) {
  2371. if (!item) {
  2372. return acc;
  2373. }
  2374. return deepmerge$1(acc, item, {
  2375. clone: false
  2376. // No need to clone deep, it's way faster.
  2377. });
  2378. }
  2379. const values$1 = {
  2380. xs: 0,
  2381. // phone
  2382. sm: 600,
  2383. // tablet
  2384. md: 900,
  2385. // small laptop
  2386. lg: 1200,
  2387. // desktop
  2388. xl: 1536
  2389. // large screen
  2390. };
  2391. const defaultBreakpoints = {
  2392. // Sorted ASC by size. That's important.
  2393. // It can't be configured as it's used statically for propTypes.
  2394. keys: ["xs", "sm", "md", "lg", "xl"],
  2395. up: (key) => `@media (min-width:${values$1[key]}px)`
  2396. };
  2397. function handleBreakpoints(props, propValue, styleFromPropValue) {
  2398. const theme = props.theme || {};
  2399. if (Array.isArray(propValue)) {
  2400. const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
  2401. return propValue.reduce((acc, item, index) => {
  2402. acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
  2403. return acc;
  2404. }, {});
  2405. }
  2406. if (typeof propValue === "object") {
  2407. const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
  2408. return Object.keys(propValue).reduce((acc, breakpoint) => {
  2409. if (Object.keys(themeBreakpoints.values || values$1).indexOf(breakpoint) !== -1) {
  2410. const mediaKey = themeBreakpoints.up(breakpoint);
  2411. acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
  2412. } else {
  2413. const cssKey = breakpoint;
  2414. acc[cssKey] = propValue[cssKey];
  2415. }
  2416. return acc;
  2417. }, {});
  2418. }
  2419. const output = styleFromPropValue(propValue);
  2420. return output;
  2421. }
  2422. function createEmptyBreakpointObject(breakpointsInput = {}) {
  2423. var _breakpointsInput$key;
  2424. const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
  2425. const breakpointStyleKey = breakpointsInput.up(key);
  2426. acc[breakpointStyleKey] = {};
  2427. return acc;
  2428. }, {});
  2429. return breakpointsInOrder || {};
  2430. }
  2431. function removeUnusedBreakpoints(breakpointKeys, style2) {
  2432. return breakpointKeys.reduce((acc, key) => {
  2433. const breakpointOutput = acc[key];
  2434. const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
  2435. if (isBreakpointUnused) {
  2436. delete acc[key];
  2437. }
  2438. return acc;
  2439. }, style2);
  2440. }
  2441. function getPath(obj, path, checkVars = true) {
  2442. if (!path || typeof path !== "string") {
  2443. return null;
  2444. }
  2445. if (obj && obj.vars && checkVars) {
  2446. const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
  2447. if (val != null) {
  2448. return val;
  2449. }
  2450. }
  2451. return path.split(".").reduce((acc, item) => {
  2452. if (acc && acc[item] != null) {
  2453. return acc[item];
  2454. }
  2455. return null;
  2456. }, obj);
  2457. }
  2458. function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
  2459. let value;
  2460. if (typeof themeMapping === "function") {
  2461. value = themeMapping(propValueFinal);
  2462. } else if (Array.isArray(themeMapping)) {
  2463. value = themeMapping[propValueFinal] || userValue;
  2464. } else {
  2465. value = getPath(themeMapping, propValueFinal) || userValue;
  2466. }
  2467. if (transform) {
  2468. value = transform(value, userValue, themeMapping);
  2469. }
  2470. return value;
  2471. }
  2472. function style$1(options) {
  2473. const {
  2474. prop,
  2475. cssProperty = options.prop,
  2476. themeKey,
  2477. transform
  2478. } = options;
  2479. const fn = (props) => {
  2480. if (props[prop] == null) {
  2481. return null;
  2482. }
  2483. const propValue = props[prop];
  2484. const theme = props.theme;
  2485. const themeMapping = getPath(theme, themeKey) || {};
  2486. const styleFromPropValue = (propValueFinal) => {
  2487. let value = getStyleValue(themeMapping, transform, propValueFinal);
  2488. if (propValueFinal === value && typeof propValueFinal === "string") {
  2489. value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize$1(propValueFinal)}`, propValueFinal);
  2490. }
  2491. if (cssProperty === false) {
  2492. return value;
  2493. }
  2494. return {
  2495. [cssProperty]: value
  2496. };
  2497. };
  2498. return handleBreakpoints(props, propValue, styleFromPropValue);
  2499. };
  2500. fn.propTypes = {};
  2501. fn.filterProps = [prop];
  2502. return fn;
  2503. }
  2504. function memoize(fn) {
  2505. const cache2 = {};
  2506. return (arg) => {
  2507. if (cache2[arg] === void 0) {
  2508. cache2[arg] = fn(arg);
  2509. }
  2510. return cache2[arg];
  2511. };
  2512. }
  2513. const properties = {
  2514. m: "margin",
  2515. p: "padding"
  2516. };
  2517. const directions = {
  2518. t: "Top",
  2519. r: "Right",
  2520. b: "Bottom",
  2521. l: "Left",
  2522. x: ["Left", "Right"],
  2523. y: ["Top", "Bottom"]
  2524. };
  2525. const aliases = {
  2526. marginX: "mx",
  2527. marginY: "my",
  2528. paddingX: "px",
  2529. paddingY: "py"
  2530. };
  2531. const getCssProperties = memoize((prop) => {
  2532. if (prop.length > 2) {
  2533. if (aliases[prop]) {
  2534. prop = aliases[prop];
  2535. } else {
  2536. return [prop];
  2537. }
  2538. }
  2539. const [a, b2] = prop.split("");
  2540. const property = properties[a];
  2541. const direction = directions[b2] || "";
  2542. return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
  2543. });
  2544. const marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
  2545. const paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
  2546. [...marginKeys, ...paddingKeys];
  2547. function createUnaryUnit(theme, themeKey, defaultValue, propName) {
  2548. var _getPath;
  2549. const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
  2550. if (typeof themeSpacing === "number") {
  2551. return (abs2) => {
  2552. if (typeof abs2 === "string") {
  2553. return abs2;
  2554. }
  2555. return themeSpacing * abs2;
  2556. };
  2557. }
  2558. if (Array.isArray(themeSpacing)) {
  2559. return (abs2) => {
  2560. if (typeof abs2 === "string") {
  2561. return abs2;
  2562. }
  2563. return themeSpacing[abs2];
  2564. };
  2565. }
  2566. if (typeof themeSpacing === "function") {
  2567. return themeSpacing;
  2568. }
  2569. return () => void 0;
  2570. }
  2571. function createUnarySpacing(theme) {
  2572. return createUnaryUnit(theme, "spacing", 8);
  2573. }
  2574. function getValue(transformer, propValue) {
  2575. if (typeof propValue === "string" || propValue == null) {
  2576. return propValue;
  2577. }
  2578. const abs2 = Math.abs(propValue);
  2579. const transformed = transformer(abs2);
  2580. if (propValue >= 0) {
  2581. return transformed;
  2582. }
  2583. if (typeof transformed === "number") {
  2584. return -transformed;
  2585. }
  2586. return `-${transformed}`;
  2587. }
  2588. function getStyleFromPropValue(cssProperties, transformer) {
  2589. return (propValue) => cssProperties.reduce((acc, cssProperty) => {
  2590. acc[cssProperty] = getValue(transformer, propValue);
  2591. return acc;
  2592. }, {});
  2593. }
  2594. function resolveCssProperty(props, keys, prop, transformer) {
  2595. if (keys.indexOf(prop) === -1) {
  2596. return null;
  2597. }
  2598. const cssProperties = getCssProperties(prop);
  2599. const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
  2600. const propValue = props[prop];
  2601. return handleBreakpoints(props, propValue, styleFromPropValue);
  2602. }
  2603. function style(props, keys) {
  2604. const transformer = createUnarySpacing(props.theme);
  2605. return Object.keys(props).map((prop) => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});
  2606. }
  2607. function margin(props) {
  2608. return style(props, marginKeys);
  2609. }
  2610. margin.propTypes = {};
  2611. margin.filterProps = marginKeys;
  2612. function padding(props) {
  2613. return style(props, paddingKeys);
  2614. }
  2615. padding.propTypes = {};
  2616. padding.filterProps = paddingKeys;
  2617. function createSpacing(spacingInput = 8) {
  2618. if (spacingInput.mui) {
  2619. return spacingInput;
  2620. }
  2621. const transform = createUnarySpacing({
  2622. spacing: spacingInput
  2623. });
  2624. const spacing = (...argsInput) => {
  2625. const args = argsInput.length === 0 ? [1] : argsInput;
  2626. return args.map((argument) => {
  2627. const output = transform(argument);
  2628. return typeof output === "number" ? `${output}px` : output;
  2629. }).join(" ");
  2630. };
  2631. spacing.mui = true;
  2632. return spacing;
  2633. }
  2634. function compose(...styles2) {
  2635. const handlers = styles2.reduce((acc, style2) => {
  2636. style2.filterProps.forEach((prop) => {
  2637. acc[prop] = style2;
  2638. });
  2639. return acc;
  2640. }, {});
  2641. const fn = (props) => {
  2642. return Object.keys(props).reduce((acc, prop) => {
  2643. if (handlers[prop]) {
  2644. return merge(acc, handlers[prop](props));
  2645. }
  2646. return acc;
  2647. }, {});
  2648. };
  2649. fn.propTypes = {};
  2650. fn.filterProps = styles2.reduce((acc, style2) => acc.concat(style2.filterProps), []);
  2651. return fn;
  2652. }
  2653. function borderTransform(value) {
  2654. if (typeof value !== "number") {
  2655. return value;
  2656. }
  2657. return `${value}px solid`;
  2658. }
  2659. function createBorderStyle(prop, transform) {
  2660. return style$1({
  2661. prop,
  2662. themeKey: "borders",
  2663. transform
  2664. });
  2665. }
  2666. const border = createBorderStyle("border", borderTransform);
  2667. const borderTop = createBorderStyle("borderTop", borderTransform);
  2668. const borderRight = createBorderStyle("borderRight", borderTransform);
  2669. const borderBottom = createBorderStyle("borderBottom", borderTransform);
  2670. const borderLeft = createBorderStyle("borderLeft", borderTransform);
  2671. const borderColor = createBorderStyle("borderColor");
  2672. const borderTopColor = createBorderStyle("borderTopColor");
  2673. const borderRightColor = createBorderStyle("borderRightColor");
  2674. const borderBottomColor = createBorderStyle("borderBottomColor");
  2675. const borderLeftColor = createBorderStyle("borderLeftColor");
  2676. const outline = createBorderStyle("outline", borderTransform);
  2677. const outlineColor = createBorderStyle("outlineColor");
  2678. const borderRadius = (props) => {
  2679. if (props.borderRadius !== void 0 && props.borderRadius !== null) {
  2680. const transformer = createUnaryUnit(props.theme, "shape.borderRadius", 4);
  2681. const styleFromPropValue = (propValue) => ({
  2682. borderRadius: getValue(transformer, propValue)
  2683. });
  2684. return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
  2685. }
  2686. return null;
  2687. };
  2688. borderRadius.propTypes = {};
  2689. borderRadius.filterProps = ["borderRadius"];
  2690. compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);
  2691. const gap = (props) => {
  2692. if (props.gap !== void 0 && props.gap !== null) {
  2693. const transformer = createUnaryUnit(props.theme, "spacing", 8);
  2694. const styleFromPropValue = (propValue) => ({
  2695. gap: getValue(transformer, propValue)
  2696. });
  2697. return handleBreakpoints(props, props.gap, styleFromPropValue);
  2698. }
  2699. return null;
  2700. };
  2701. gap.propTypes = {};
  2702. gap.filterProps = ["gap"];
  2703. const columnGap = (props) => {
  2704. if (props.columnGap !== void 0 && props.columnGap !== null) {
  2705. const transformer = createUnaryUnit(props.theme, "spacing", 8);
  2706. const styleFromPropValue = (propValue) => ({
  2707. columnGap: getValue(transformer, propValue)
  2708. });
  2709. return handleBreakpoints(props, props.columnGap, styleFromPropValue);
  2710. }
  2711. return null;
  2712. };
  2713. columnGap.propTypes = {};
  2714. columnGap.filterProps = ["columnGap"];
  2715. const rowGap = (props) => {
  2716. if (props.rowGap !== void 0 && props.rowGap !== null) {
  2717. const transformer = createUnaryUnit(props.theme, "spacing", 8);
  2718. const styleFromPropValue = (propValue) => ({
  2719. rowGap: getValue(transformer, propValue)
  2720. });
  2721. return handleBreakpoints(props, props.rowGap, styleFromPropValue);
  2722. }
  2723. return null;
  2724. };
  2725. rowGap.propTypes = {};
  2726. rowGap.filterProps = ["rowGap"];
  2727. const gridColumn = style$1({
  2728. prop: "gridColumn"
  2729. });
  2730. const gridRow = style$1({
  2731. prop: "gridRow"
  2732. });
  2733. const gridAutoFlow = style$1({
  2734. prop: "gridAutoFlow"
  2735. });
  2736. const gridAutoColumns = style$1({
  2737. prop: "gridAutoColumns"
  2738. });
  2739. const gridAutoRows = style$1({
  2740. prop: "gridAutoRows"
  2741. });
  2742. const gridTemplateColumns = style$1({
  2743. prop: "gridTemplateColumns"
  2744. });
  2745. const gridTemplateRows = style$1({
  2746. prop: "gridTemplateRows"
  2747. });
  2748. const gridTemplateAreas = style$1({
  2749. prop: "gridTemplateAreas"
  2750. });
  2751. const gridArea = style$1({
  2752. prop: "gridArea"
  2753. });
  2754. compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
  2755. function paletteTransform(value, userValue) {
  2756. if (userValue === "grey") {
  2757. return userValue;
  2758. }
  2759. return value;
  2760. }
  2761. const color = style$1({
  2762. prop: "color",
  2763. themeKey: "palette",
  2764. transform: paletteTransform
  2765. });
  2766. const bgcolor = style$1({
  2767. prop: "bgcolor",
  2768. cssProperty: "backgroundColor",
  2769. themeKey: "palette",
  2770. transform: paletteTransform
  2771. });
  2772. const backgroundColor = style$1({
  2773. prop: "backgroundColor",
  2774. themeKey: "palette",
  2775. transform: paletteTransform
  2776. });
  2777. compose(color, bgcolor, backgroundColor);
  2778. function sizingTransform(value) {
  2779. return value <= 1 && value !== 0 ? `${value * 100}%` : value;
  2780. }
  2781. const width = style$1({
  2782. prop: "width",
  2783. transform: sizingTransform
  2784. });
  2785. const maxWidth = (props) => {
  2786. if (props.maxWidth !== void 0 && props.maxWidth !== null) {
  2787. const styleFromPropValue = (propValue) => {
  2788. var _props$theme, _props$theme2;
  2789. const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values$1[propValue];
  2790. if (!breakpoint) {
  2791. return {
  2792. maxWidth: sizingTransform(propValue)
  2793. };
  2794. }
  2795. if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== "px") {
  2796. return {
  2797. maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
  2798. };
  2799. }
  2800. return {
  2801. maxWidth: breakpoint
  2802. };
  2803. };
  2804. return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
  2805. }
  2806. return null;
  2807. };
  2808. maxWidth.filterProps = ["maxWidth"];
  2809. const minWidth = style$1({
  2810. prop: "minWidth",
  2811. transform: sizingTransform
  2812. });
  2813. const height = style$1({
  2814. prop: "height",
  2815. transform: sizingTransform
  2816. });
  2817. const maxHeight = style$1({
  2818. prop: "maxHeight",
  2819. transform: sizingTransform
  2820. });
  2821. const minHeight = style$1({
  2822. prop: "minHeight",
  2823. transform: sizingTransform
  2824. });
  2825. style$1({
  2826. prop: "size",
  2827. cssProperty: "width",
  2828. transform: sizingTransform
  2829. });
  2830. style$1({
  2831. prop: "size",
  2832. cssProperty: "height",
  2833. transform: sizingTransform
  2834. });
  2835. const boxSizing = style$1({
  2836. prop: "boxSizing"
  2837. });
  2838. compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
  2839. const defaultSxConfig = {
  2840. // borders
  2841. border: {
  2842. themeKey: "borders",
  2843. transform: borderTransform
  2844. },
  2845. borderTop: {
  2846. themeKey: "borders",
  2847. transform: borderTransform
  2848. },
  2849. borderRight: {
  2850. themeKey: "borders",
  2851. transform: borderTransform
  2852. },
  2853. borderBottom: {
  2854. themeKey: "borders",
  2855. transform: borderTransform
  2856. },
  2857. borderLeft: {
  2858. themeKey: "borders",
  2859. transform: borderTransform
  2860. },
  2861. borderColor: {
  2862. themeKey: "palette"
  2863. },
  2864. borderTopColor: {
  2865. themeKey: "palette"
  2866. },
  2867. borderRightColor: {
  2868. themeKey: "palette"
  2869. },
  2870. borderBottomColor: {
  2871. themeKey: "palette"
  2872. },
  2873. borderLeftColor: {
  2874. themeKey: "palette"
  2875. },
  2876. outline: {
  2877. themeKey: "borders",
  2878. transform: borderTransform
  2879. },
  2880. outlineColor: {
  2881. themeKey: "palette"
  2882. },
  2883. borderRadius: {
  2884. themeKey: "shape.borderRadius",
  2885. style: borderRadius
  2886. },
  2887. // palette
  2888. color: {
  2889. themeKey: "palette",
  2890. transform: paletteTransform
  2891. },
  2892. bgcolor: {
  2893. themeKey: "palette",
  2894. cssProperty: "backgroundColor",
  2895. transform: paletteTransform
  2896. },
  2897. backgroundColor: {
  2898. themeKey: "palette",
  2899. transform: paletteTransform
  2900. },
  2901. // spacing
  2902. p: {
  2903. style: padding
  2904. },
  2905. pt: {
  2906. style: padding
  2907. },
  2908. pr: {
  2909. style: padding
  2910. },
  2911. pb: {
  2912. style: padding
  2913. },
  2914. pl: {
  2915. style: padding
  2916. },
  2917. px: {
  2918. style: padding
  2919. },
  2920. py: {
  2921. style: padding
  2922. },
  2923. padding: {
  2924. style: padding
  2925. },
  2926. paddingTop: {
  2927. style: padding
  2928. },
  2929. paddingRight: {
  2930. style: padding
  2931. },
  2932. paddingBottom: {
  2933. style: padding
  2934. },
  2935. paddingLeft: {
  2936. style: padding
  2937. },
  2938. paddingX: {
  2939. style: padding
  2940. },
  2941. paddingY: {
  2942. style: padding
  2943. },
  2944. paddingInline: {
  2945. style: padding
  2946. },
  2947. paddingInlineStart: {
  2948. style: padding
  2949. },
  2950. paddingInlineEnd: {
  2951. style: padding
  2952. },
  2953. paddingBlock: {
  2954. style: padding
  2955. },
  2956. paddingBlockStart: {
  2957. style: padding
  2958. },
  2959. paddingBlockEnd: {
  2960. style: padding
  2961. },
  2962. m: {
  2963. style: margin
  2964. },
  2965. mt: {
  2966. style: margin
  2967. },
  2968. mr: {
  2969. style: margin
  2970. },
  2971. mb: {
  2972. style: margin
  2973. },
  2974. ml: {
  2975. style: margin
  2976. },
  2977. mx: {
  2978. style: margin
  2979. },
  2980. my: {
  2981. style: margin
  2982. },
  2983. margin: {
  2984. style: margin
  2985. },
  2986. marginTop: {
  2987. style: margin
  2988. },
  2989. marginRight: {
  2990. style: margin
  2991. },
  2992. marginBottom: {
  2993. style: margin
  2994. },
  2995. marginLeft: {
  2996. style: margin
  2997. },
  2998. marginX: {
  2999. style: margin
  3000. },
  3001. marginY: {
  3002. style: margin
  3003. },
  3004. marginInline: {
  3005. style: margin
  3006. },
  3007. marginInlineStart: {
  3008. style: margin
  3009. },
  3010. marginInlineEnd: {
  3011. style: margin
  3012. },
  3013. marginBlock: {
  3014. style: margin
  3015. },
  3016. marginBlockStart: {
  3017. style: margin
  3018. },
  3019. marginBlockEnd: {
  3020. style: margin
  3021. },
  3022. // display
  3023. displayPrint: {
  3024. cssProperty: false,
  3025. transform: (value) => ({
  3026. "@media print": {
  3027. display: value
  3028. }
  3029. })
  3030. },
  3031. display: {},
  3032. overflow: {},
  3033. textOverflow: {},
  3034. visibility: {},
  3035. whiteSpace: {},
  3036. // flexbox
  3037. flexBasis: {},
  3038. flexDirection: {},
  3039. flexWrap: {},
  3040. justifyContent: {},
  3041. alignItems: {},
  3042. alignContent: {},
  3043. order: {},
  3044. flex: {},
  3045. flexGrow: {},
  3046. flexShrink: {},
  3047. alignSelf: {},
  3048. justifyItems: {},
  3049. justifySelf: {},
  3050. // grid
  3051. gap: {
  3052. style: gap
  3053. },
  3054. rowGap: {
  3055. style: rowGap
  3056. },
  3057. columnGap: {
  3058. style: columnGap
  3059. },
  3060. gridColumn: {},
  3061. gridRow: {},
  3062. gridAutoFlow: {},
  3063. gridAutoColumns: {},
  3064. gridAutoRows: {},
  3065. gridTemplateColumns: {},
  3066. gridTemplateRows: {},
  3067. gridTemplateAreas: {},
  3068. gridArea: {},
  3069. // positions
  3070. position: {},
  3071. zIndex: {
  3072. themeKey: "zIndex"
  3073. },
  3074. top: {},
  3075. right: {},
  3076. bottom: {},
  3077. left: {},
  3078. // shadows
  3079. boxShadow: {
  3080. themeKey: "shadows"
  3081. },
  3082. // sizing
  3083. width: {
  3084. transform: sizingTransform
  3085. },
  3086. maxWidth: {
  3087. style: maxWidth
  3088. },
  3089. minWidth: {
  3090. transform: sizingTransform
  3091. },
  3092. height: {
  3093. transform: sizingTransform
  3094. },
  3095. maxHeight: {
  3096. transform: sizingTransform
  3097. },
  3098. minHeight: {
  3099. transform: sizingTransform
  3100. },
  3101. boxSizing: {},
  3102. // typography
  3103. fontFamily: {
  3104. themeKey: "typography"
  3105. },
  3106. fontSize: {
  3107. themeKey: "typography"
  3108. },
  3109. fontStyle: {
  3110. themeKey: "typography"
  3111. },
  3112. fontWeight: {
  3113. themeKey: "typography"
  3114. },
  3115. letterSpacing: {},
  3116. textTransform: {},
  3117. lineHeight: {},
  3118. textAlign: {},
  3119. typography: {
  3120. cssProperty: false,
  3121. themeKey: "typography"
  3122. }
  3123. };
  3124. const defaultSxConfig$1 = defaultSxConfig;
  3125. function objectsHaveSameKeys(...objects) {
  3126. const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
  3127. const union = new Set(allKeys);
  3128. return objects.every((object) => union.size === Object.keys(object).length);
  3129. }
  3130. function callIfFn(maybeFn, arg) {
  3131. return typeof maybeFn === "function" ? maybeFn(arg) : maybeFn;
  3132. }
  3133. function unstable_createStyleFunctionSx() {
  3134. function getThemeValue(prop, val, theme, config2) {
  3135. const props = {
  3136. [prop]: val,
  3137. theme
  3138. };
  3139. const options = config2[prop];
  3140. if (!options) {
  3141. return {
  3142. [prop]: val
  3143. };
  3144. }
  3145. const {
  3146. cssProperty = prop,
  3147. themeKey,
  3148. transform,
  3149. style: style2
  3150. } = options;
  3151. if (val == null) {
  3152. return null;
  3153. }
  3154. if (themeKey === "typography" && val === "inherit") {
  3155. return {
  3156. [prop]: val
  3157. };
  3158. }
  3159. const themeMapping = getPath(theme, themeKey) || {};
  3160. if (style2) {
  3161. return style2(props);
  3162. }
  3163. const styleFromPropValue = (propValueFinal) => {
  3164. let value = getStyleValue(themeMapping, transform, propValueFinal);
  3165. if (propValueFinal === value && typeof propValueFinal === "string") {
  3166. value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize$1(propValueFinal)}`, propValueFinal);
  3167. }
  3168. if (cssProperty === false) {
  3169. return value;
  3170. }
  3171. return {
  3172. [cssProperty]: value
  3173. };
  3174. };
  3175. return handleBreakpoints(props, val, styleFromPropValue);
  3176. }
  3177. function styleFunctionSx2(props) {
  3178. var _theme$unstable_sxCon;
  3179. const {
  3180. sx,
  3181. theme = {}
  3182. } = props || {};
  3183. if (!sx) {
  3184. return null;
  3185. }
  3186. const config2 = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1;
  3187. function traverse(sxInput) {
  3188. let sxObject = sxInput;
  3189. if (typeof sxInput === "function") {
  3190. sxObject = sxInput(theme);
  3191. } else if (typeof sxInput !== "object") {
  3192. return sxInput;
  3193. }
  3194. if (!sxObject) {
  3195. return null;
  3196. }
  3197. const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
  3198. const breakpointsKeys = Object.keys(emptyBreakpoints);
  3199. let css2 = emptyBreakpoints;
  3200. Object.keys(sxObject).forEach((styleKey) => {
  3201. const value = callIfFn(sxObject[styleKey], theme);
  3202. if (value !== null && value !== void 0) {
  3203. if (typeof value === "object") {
  3204. if (config2[styleKey]) {
  3205. css2 = merge(css2, getThemeValue(styleKey, value, theme, config2));
  3206. } else {
  3207. const breakpointsValues = handleBreakpoints({
  3208. theme
  3209. }, value, (x2) => ({
  3210. [styleKey]: x2
  3211. }));
  3212. if (objectsHaveSameKeys(breakpointsValues, value)) {
  3213. css2[styleKey] = styleFunctionSx2({
  3214. sx: value,
  3215. theme
  3216. });
  3217. } else {
  3218. css2 = merge(css2, breakpointsValues);
  3219. }
  3220. }
  3221. } else {
  3222. css2 = merge(css2, getThemeValue(styleKey, value, theme, config2));
  3223. }
  3224. }
  3225. });
  3226. return removeUnusedBreakpoints(breakpointsKeys, css2);
  3227. }
  3228. return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
  3229. }
  3230. return styleFunctionSx2;
  3231. }
  3232. const styleFunctionSx$1 = unstable_createStyleFunctionSx();
  3233. styleFunctionSx$1.filterProps = ["sx"];
  3234. function applyStyles(key, styles2) {
  3235. const theme = this;
  3236. if (theme.vars && typeof theme.getColorSchemeSelector === "function") {
  3237. const selector = theme.getColorSchemeSelector(key).replace(/(\[[^\]]+\])/, "*:where($1)");
  3238. return {
  3239. [selector]: styles2
  3240. };
  3241. }
  3242. if (theme.palette.mode === key) {
  3243. return styles2;
  3244. }
  3245. return {};
  3246. }
  3247. const _excluded$h = ["breakpoints", "palette", "spacing", "shape"];
  3248. function createTheme$2(options = {}, ...args) {
  3249. const {
  3250. breakpoints: breakpointsInput = {},
  3251. palette: paletteInput = {},
  3252. spacing: spacingInput,
  3253. shape: shapeInput = {}
  3254. } = options, other = _objectWithoutPropertiesLoose(options, _excluded$h);
  3255. const breakpoints = createBreakpoints(breakpointsInput);
  3256. const spacing = createSpacing(spacingInput);
  3257. let muiTheme = deepmerge$1({
  3258. breakpoints,
  3259. direction: "ltr",
  3260. components: {},
  3261. // Inject component definitions.
  3262. palette: _extends$1({
  3263. mode: "light"
  3264. }, paletteInput),
  3265. spacing,
  3266. shape: _extends$1({}, shape$1, shapeInput)
  3267. }, other);
  3268. muiTheme.applyStyles = applyStyles;
  3269. muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
  3270. muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
  3271. muiTheme.unstable_sx = function sx(props) {
  3272. return styleFunctionSx$1({
  3273. sx: props,
  3274. theme: this
  3275. });
  3276. };
  3277. return muiTheme;
  3278. }
  3279. const createTheme$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  3280. __proto__: null,
  3281. default: createTheme$2,
  3282. private_createBreakpoints: createBreakpoints,
  3283. unstable_applyStyles: applyStyles
  3284. }, Symbol.toStringTag, { value: "Module" }));
  3285. const require$$7 = /* @__PURE__ */ getAugmentedNamespace(createTheme$1);
  3286. const _excluded$g = ["sx"];
  3287. const splitProps = (props) => {
  3288. var _props$theme$unstable, _props$theme;
  3289. const result = {
  3290. systemProps: {},
  3291. otherProps: {}
  3292. };
  3293. const config2 = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
  3294. Object.keys(props).forEach((prop) => {
  3295. if (config2[prop]) {
  3296. result.systemProps[prop] = props[prop];
  3297. } else {
  3298. result.otherProps[prop] = props[prop];
  3299. }
  3300. });
  3301. return result;
  3302. };
  3303. function extendSxProp(props) {
  3304. const {
  3305. sx: inSx
  3306. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$g);
  3307. const {
  3308. systemProps,
  3309. otherProps
  3310. } = splitProps(other);
  3311. let finalSx;
  3312. if (Array.isArray(inSx)) {
  3313. finalSx = [systemProps, ...inSx];
  3314. } else if (typeof inSx === "function") {
  3315. finalSx = (...args) => {
  3316. const result = inSx(...args);
  3317. if (!isPlainObject(result)) {
  3318. return systemProps;
  3319. }
  3320. return _extends$1({}, systemProps, result);
  3321. };
  3322. } else {
  3323. finalSx = _extends$1({}, systemProps, inSx);
  3324. }
  3325. return _extends$1({}, otherProps, {
  3326. sx: finalSx
  3327. });
  3328. }
  3329. const styleFunctionSx = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  3330. __proto__: null,
  3331. default: styleFunctionSx$1,
  3332. extendSxProp,
  3333. unstable_createStyleFunctionSx,
  3334. unstable_defaultSxConfig: defaultSxConfig$1
  3335. }, Symbol.toStringTag, { value: "Module" }));
  3336. const require$$8 = /* @__PURE__ */ getAugmentedNamespace(styleFunctionSx);
  3337. var _interopRequireDefault = interopRequireDefaultExports;
  3338. Object.defineProperty(createStyled$2, "__esModule", {
  3339. value: true
  3340. });
  3341. var _default = createStyled$2.default = createStyled;
  3342. var shouldForwardProp_1 = createStyled$2.shouldForwardProp = shouldForwardProp;
  3343. createStyled$2.systemDefaultTheme = void 0;
  3344. var _extends2 = _interopRequireDefault(require_extends());
  3345. var _objectWithoutPropertiesLoose2 = _interopRequireDefault(requireObjectWithoutPropertiesLoose());
  3346. var _styledEngine = _interopRequireWildcard(require$$3);
  3347. var _deepmerge = require$$4;
  3348. _interopRequireDefault(require$$5);
  3349. _interopRequireDefault(require$$6);
  3350. var _createTheme = _interopRequireDefault(require$$7);
  3351. var _styleFunctionSx = _interopRequireDefault(require$$8);
  3352. const _excluded$f = ["ownerState"], _excluded2$1 = ["variants"], _excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
  3353. function _getRequireWildcardCache(e2) {
  3354. if ("function" != typeof WeakMap)
  3355. return null;
  3356. var r2 = /* @__PURE__ */ new WeakMap(), t2 = /* @__PURE__ */ new WeakMap();
  3357. return (_getRequireWildcardCache = function(e22) {
  3358. return e22 ? t2 : r2;
  3359. })(e2);
  3360. }
  3361. function _interopRequireWildcard(e2, r2) {
  3362. if (!r2 && e2 && e2.__esModule)
  3363. return e2;
  3364. if (null === e2 || "object" != typeof e2 && "function" != typeof e2)
  3365. return { default: e2 };
  3366. var t2 = _getRequireWildcardCache(r2);
  3367. if (t2 && t2.has(e2))
  3368. return t2.get(e2);
  3369. var n2 = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
  3370. for (var u2 in e2)
  3371. if ("default" !== u2 && Object.prototype.hasOwnProperty.call(e2, u2)) {
  3372. var i = a ? Object.getOwnPropertyDescriptor(e2, u2) : null;
  3373. i && (i.get || i.set) ? Object.defineProperty(n2, u2, i) : n2[u2] = e2[u2];
  3374. }
  3375. return n2.default = e2, t2 && t2.set(e2, n2), n2;
  3376. }
  3377. function isEmpty(obj) {
  3378. return Object.keys(obj).length === 0;
  3379. }
  3380. function isStringTag(tag) {
  3381. return typeof tag === "string" && // 96 is one less than the char code
  3382. // for "a" so this is checking that
  3383. // it's a lowercase character
  3384. tag.charCodeAt(0) > 96;
  3385. }
  3386. function shouldForwardProp(prop) {
  3387. return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
  3388. }
  3389. const systemDefaultTheme$1 = createStyled$2.systemDefaultTheme = (0, _createTheme.default)();
  3390. const lowercaseFirstLetter = (string) => {
  3391. if (!string) {
  3392. return string;
  3393. }
  3394. return string.charAt(0).toLowerCase() + string.slice(1);
  3395. };
  3396. function resolveTheme({
  3397. defaultTheme: defaultTheme2,
  3398. theme,
  3399. themeId
  3400. }) {
  3401. return isEmpty(theme) ? defaultTheme2 : theme[themeId] || theme;
  3402. }
  3403. function defaultOverridesResolver(slot) {
  3404. if (!slot) {
  3405. return null;
  3406. }
  3407. return (props, styles2) => styles2[slot];
  3408. }
  3409. function processStyleArg(callableStyle, _ref) {
  3410. let {
  3411. ownerState
  3412. } = _ref, props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded$f);
  3413. const resolvedStylesArg = typeof callableStyle === "function" ? callableStyle((0, _extends2.default)({
  3414. ownerState
  3415. }, props)) : callableStyle;
  3416. if (Array.isArray(resolvedStylesArg)) {
  3417. return resolvedStylesArg.flatMap((resolvedStyle) => processStyleArg(resolvedStyle, (0, _extends2.default)({
  3418. ownerState
  3419. }, props)));
  3420. }
  3421. if (!!resolvedStylesArg && typeof resolvedStylesArg === "object" && Array.isArray(resolvedStylesArg.variants)) {
  3422. const {
  3423. variants = []
  3424. } = resolvedStylesArg, otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2$1);
  3425. let result = otherStyles;
  3426. variants.forEach((variant) => {
  3427. let isMatch = true;
  3428. if (typeof variant.props === "function") {
  3429. isMatch = variant.props((0, _extends2.default)({
  3430. ownerState
  3431. }, props, ownerState));
  3432. } else {
  3433. Object.keys(variant.props).forEach((key) => {
  3434. if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {
  3435. isMatch = false;
  3436. }
  3437. });
  3438. }
  3439. if (isMatch) {
  3440. if (!Array.isArray(result)) {
  3441. result = [result];
  3442. }
  3443. result.push(typeof variant.style === "function" ? variant.style((0, _extends2.default)({
  3444. ownerState
  3445. }, props, ownerState)) : variant.style);
  3446. }
  3447. });
  3448. return result;
  3449. }
  3450. return resolvedStylesArg;
  3451. }
  3452. function createStyled(input = {}) {
  3453. const {
  3454. themeId,
  3455. defaultTheme: defaultTheme2 = systemDefaultTheme$1,
  3456. rootShouldForwardProp: rootShouldForwardProp2 = shouldForwardProp,
  3457. slotShouldForwardProp = shouldForwardProp
  3458. } = input;
  3459. const systemSx = (props) => {
  3460. return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {
  3461. theme: resolveTheme((0, _extends2.default)({}, props, {
  3462. defaultTheme: defaultTheme2,
  3463. themeId
  3464. }))
  3465. }));
  3466. };
  3467. systemSx.__mui_systemSx = true;
  3468. return (tag, inputOptions = {}) => {
  3469. (0, _styledEngine.internal_processStyles)(tag, (styles2) => styles2.filter((style2) => !(style2 != null && style2.__mui_systemSx)));
  3470. const {
  3471. name: componentName,
  3472. slot: componentSlot,
  3473. skipVariantsResolver: inputSkipVariantsResolver,
  3474. skipSx: inputSkipSx,
  3475. // TODO v6: remove `lowercaseFirstLetter()` in the next major release
  3476. // For more details: https://github.com/mui/material-ui/pull/37908
  3477. overridesResolver: overridesResolver2 = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
  3478. } = inputOptions, options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);
  3479. const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
  3480. // TODO v6: remove `Root` in the next major release
  3481. // For more details: https://github.com/mui/material-ui/pull/37908
  3482. componentSlot && componentSlot !== "Root" && componentSlot !== "root" || false
  3483. );
  3484. const skipSx = inputSkipSx || false;
  3485. let label;
  3486. let shouldForwardPropOption = shouldForwardProp;
  3487. if (componentSlot === "Root" || componentSlot === "root") {
  3488. shouldForwardPropOption = rootShouldForwardProp2;
  3489. } else if (componentSlot) {
  3490. shouldForwardPropOption = slotShouldForwardProp;
  3491. } else if (isStringTag(tag)) {
  3492. shouldForwardPropOption = void 0;
  3493. }
  3494. const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({
  3495. shouldForwardProp: shouldForwardPropOption,
  3496. label
  3497. }, options));
  3498. const transformStyleArg = (stylesArg) => {
  3499. if (typeof stylesArg === "function" && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {
  3500. return (props) => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {
  3501. theme: resolveTheme({
  3502. theme: props.theme,
  3503. defaultTheme: defaultTheme2,
  3504. themeId
  3505. })
  3506. }));
  3507. }
  3508. return stylesArg;
  3509. };
  3510. const muiStyledResolver = (styleArg, ...expressions) => {
  3511. let transformedStyleArg = transformStyleArg(styleArg);
  3512. const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];
  3513. if (componentName && overridesResolver2) {
  3514. expressionsWithDefaultTheme.push((props) => {
  3515. const theme = resolveTheme((0, _extends2.default)({}, props, {
  3516. defaultTheme: defaultTheme2,
  3517. themeId
  3518. }));
  3519. if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {
  3520. return null;
  3521. }
  3522. const styleOverrides = theme.components[componentName].styleOverrides;
  3523. const resolvedStyleOverrides = {};
  3524. Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
  3525. resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {
  3526. theme
  3527. }));
  3528. });
  3529. return overridesResolver2(props, resolvedStyleOverrides);
  3530. });
  3531. }
  3532. if (componentName && !skipVariantsResolver) {
  3533. expressionsWithDefaultTheme.push((props) => {
  3534. var _theme$components;
  3535. const theme = resolveTheme((0, _extends2.default)({}, props, {
  3536. defaultTheme: defaultTheme2,
  3537. themeId
  3538. }));
  3539. const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;
  3540. return processStyleArg({
  3541. variants: themeVariants
  3542. }, (0, _extends2.default)({}, props, {
  3543. theme
  3544. }));
  3545. });
  3546. }
  3547. if (!skipSx) {
  3548. expressionsWithDefaultTheme.push(systemSx);
  3549. }
  3550. const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
  3551. if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
  3552. const placeholders = new Array(numOfCustomFnsApplied).fill("");
  3553. transformedStyleArg = [...styleArg, ...placeholders];
  3554. transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
  3555. }
  3556. const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
  3557. if (tag.muiName) {
  3558. Component.muiName = tag.muiName;
  3559. }
  3560. return Component;
  3561. };
  3562. if (defaultStyledResolver.withConfig) {
  3563. muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
  3564. }
  3565. return muiStyledResolver;
  3566. };
  3567. }
  3568. const defaultGenerator = (componentName) => componentName;
  3569. const createClassNameGenerator = () => {
  3570. let generate = defaultGenerator;
  3571. return {
  3572. configure(generator) {
  3573. generate = generator;
  3574. },
  3575. generate(componentName) {
  3576. return generate(componentName);
  3577. },
  3578. reset() {
  3579. generate = defaultGenerator;
  3580. }
  3581. };
  3582. };
  3583. const ClassNameGenerator = createClassNameGenerator();
  3584. const globalStateClasses = {
  3585. active: "active",
  3586. checked: "checked",
  3587. completed: "completed",
  3588. disabled: "disabled",
  3589. error: "error",
  3590. expanded: "expanded",
  3591. focused: "focused",
  3592. focusVisible: "focusVisible",
  3593. open: "open",
  3594. readOnly: "readOnly",
  3595. required: "required",
  3596. selected: "selected"
  3597. };
  3598. function generateUtilityClass(componentName, slot, globalStatePrefix = "Mui") {
  3599. const globalStateClass = globalStateClasses[slot];
  3600. return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
  3601. }
  3602. function createMixins(breakpoints, mixins) {
  3603. return _extends$1({
  3604. toolbar: {
  3605. minHeight: 56,
  3606. [breakpoints.up("xs")]: {
  3607. "@media (orientation: landscape)": {
  3608. minHeight: 48
  3609. }
  3610. },
  3611. [breakpoints.up("sm")]: {
  3612. minHeight: 64
  3613. }
  3614. }
  3615. }, mixins);
  3616. }
  3617. const common = {
  3618. black: "#000",
  3619. white: "#fff"
  3620. };
  3621. const common$1 = common;
  3622. const grey = {
  3623. 50: "#fafafa",
  3624. 100: "#f5f5f5",
  3625. 200: "#eeeeee",
  3626. 300: "#e0e0e0",
  3627. 400: "#bdbdbd",
  3628. 500: "#9e9e9e",
  3629. 600: "#757575",
  3630. 700: "#616161",
  3631. 800: "#424242",
  3632. 900: "#212121",
  3633. A100: "#f5f5f5",
  3634. A200: "#eeeeee",
  3635. A400: "#bdbdbd",
  3636. A700: "#616161"
  3637. };
  3638. const grey$1 = grey;
  3639. const purple = {
  3640. 50: "#f3e5f5",
  3641. 100: "#e1bee7",
  3642. 200: "#ce93d8",
  3643. 300: "#ba68c8",
  3644. 400: "#ab47bc",
  3645. 500: "#9c27b0",
  3646. 600: "#8e24aa",
  3647. 700: "#7b1fa2",
  3648. 800: "#6a1b9a",
  3649. 900: "#4a148c",
  3650. A100: "#ea80fc",
  3651. A200: "#e040fb",
  3652. A400: "#d500f9",
  3653. A700: "#aa00ff"
  3654. };
  3655. const purple$1 = purple;
  3656. const red = {
  3657. 50: "#ffebee",
  3658. 100: "#ffcdd2",
  3659. 200: "#ef9a9a",
  3660. 300: "#e57373",
  3661. 400: "#ef5350",
  3662. 500: "#f44336",
  3663. 600: "#e53935",
  3664. 700: "#d32f2f",
  3665. 800: "#c62828",
  3666. 900: "#b71c1c",
  3667. A100: "#ff8a80",
  3668. A200: "#ff5252",
  3669. A400: "#ff1744",
  3670. A700: "#d50000"
  3671. };
  3672. const red$1 = red;
  3673. const orange = {
  3674. 50: "#fff3e0",
  3675. 100: "#ffe0b2",
  3676. 200: "#ffcc80",
  3677. 300: "#ffb74d",
  3678. 400: "#ffa726",
  3679. 500: "#ff9800",
  3680. 600: "#fb8c00",
  3681. 700: "#f57c00",
  3682. 800: "#ef6c00",
  3683. 900: "#e65100",
  3684. A100: "#ffd180",
  3685. A200: "#ffab40",
  3686. A400: "#ff9100",
  3687. A700: "#ff6d00"
  3688. };
  3689. const orange$1 = orange;
  3690. const blue = {
  3691. 50: "#e3f2fd",
  3692. 100: "#bbdefb",
  3693. 200: "#90caf9",
  3694. 300: "#64b5f6",
  3695. 400: "#42a5f5",
  3696. 500: "#2196f3",
  3697. 600: "#1e88e5",
  3698. 700: "#1976d2",
  3699. 800: "#1565c0",
  3700. 900: "#0d47a1",
  3701. A100: "#82b1ff",
  3702. A200: "#448aff",
  3703. A400: "#2979ff",
  3704. A700: "#2962ff"
  3705. };
  3706. const blue$1 = blue;
  3707. const lightBlue = {
  3708. 50: "#e1f5fe",
  3709. 100: "#b3e5fc",
  3710. 200: "#81d4fa",
  3711. 300: "#4fc3f7",
  3712. 400: "#29b6f6",
  3713. 500: "#03a9f4",
  3714. 600: "#039be5",
  3715. 700: "#0288d1",
  3716. 800: "#0277bd",
  3717. 900: "#01579b",
  3718. A100: "#80d8ff",
  3719. A200: "#40c4ff",
  3720. A400: "#00b0ff",
  3721. A700: "#0091ea"
  3722. };
  3723. const lightBlue$1 = lightBlue;
  3724. const green = {
  3725. 50: "#e8f5e9",
  3726. 100: "#c8e6c9",
  3727. 200: "#a5d6a7",
  3728. 300: "#81c784",
  3729. 400: "#66bb6a",
  3730. 500: "#4caf50",
  3731. 600: "#43a047",
  3732. 700: "#388e3c",
  3733. 800: "#2e7d32",
  3734. 900: "#1b5e20",
  3735. A100: "#b9f6ca",
  3736. A200: "#69f0ae",
  3737. A400: "#00e676",
  3738. A700: "#00c853"
  3739. };
  3740. const green$1 = green;
  3741. const _excluded$e = ["mode", "contrastThreshold", "tonalOffset"];
  3742. const light = {
  3743. // The colors used to style the text.
  3744. text: {
  3745. // The most important text.
  3746. primary: "rgba(0, 0, 0, 0.87)",
  3747. // Secondary text.
  3748. secondary: "rgba(0, 0, 0, 0.6)",
  3749. // Disabled text have even lower visual prominence.
  3750. disabled: "rgba(0, 0, 0, 0.38)"
  3751. },
  3752. // The color used to divide different elements.
  3753. divider: "rgba(0, 0, 0, 0.12)",
  3754. // The background colors used to style the surfaces.
  3755. // Consistency between these values is important.
  3756. background: {
  3757. paper: common$1.white,
  3758. default: common$1.white
  3759. },
  3760. // The colors used to style the action elements.
  3761. action: {
  3762. // The color of an active action like an icon button.
  3763. active: "rgba(0, 0, 0, 0.54)",
  3764. // The color of an hovered action.
  3765. hover: "rgba(0, 0, 0, 0.04)",
  3766. hoverOpacity: 0.04,
  3767. // The color of a selected action.
  3768. selected: "rgba(0, 0, 0, 0.08)",
  3769. selectedOpacity: 0.08,
  3770. // The color of a disabled action.
  3771. disabled: "rgba(0, 0, 0, 0.26)",
  3772. // The background color of a disabled action.
  3773. disabledBackground: "rgba(0, 0, 0, 0.12)",
  3774. disabledOpacity: 0.38,
  3775. focus: "rgba(0, 0, 0, 0.12)",
  3776. focusOpacity: 0.12,
  3777. activatedOpacity: 0.12
  3778. }
  3779. };
  3780. const dark = {
  3781. text: {
  3782. primary: common$1.white,
  3783. secondary: "rgba(255, 255, 255, 0.7)",
  3784. disabled: "rgba(255, 255, 255, 0.5)",
  3785. icon: "rgba(255, 255, 255, 0.5)"
  3786. },
  3787. divider: "rgba(255, 255, 255, 0.12)",
  3788. background: {
  3789. paper: "#121212",
  3790. default: "#121212"
  3791. },
  3792. action: {
  3793. active: common$1.white,
  3794. hover: "rgba(255, 255, 255, 0.08)",
  3795. hoverOpacity: 0.08,
  3796. selected: "rgba(255, 255, 255, 0.16)",
  3797. selectedOpacity: 0.16,
  3798. disabled: "rgba(255, 255, 255, 0.3)",
  3799. disabledBackground: "rgba(255, 255, 255, 0.12)",
  3800. disabledOpacity: 0.38,
  3801. focus: "rgba(255, 255, 255, 0.12)",
  3802. focusOpacity: 0.12,
  3803. activatedOpacity: 0.24
  3804. }
  3805. };
  3806. function addLightOrDark(intent, direction, shade, tonalOffset) {
  3807. const tonalOffsetLight = tonalOffset.light || tonalOffset;
  3808. const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
  3809. if (!intent[direction]) {
  3810. if (intent.hasOwnProperty(shade)) {
  3811. intent[direction] = intent[shade];
  3812. } else if (direction === "light") {
  3813. intent.light = lighten_1(intent.main, tonalOffsetLight);
  3814. } else if (direction === "dark") {
  3815. intent.dark = darken_1(intent.main, tonalOffsetDark);
  3816. }
  3817. }
  3818. }
  3819. function getDefaultPrimary(mode = "light") {
  3820. if (mode === "dark") {
  3821. return {
  3822. main: blue$1[200],
  3823. light: blue$1[50],
  3824. dark: blue$1[400]
  3825. };
  3826. }
  3827. return {
  3828. main: blue$1[700],
  3829. light: blue$1[400],
  3830. dark: blue$1[800]
  3831. };
  3832. }
  3833. function getDefaultSecondary(mode = "light") {
  3834. if (mode === "dark") {
  3835. return {
  3836. main: purple$1[200],
  3837. light: purple$1[50],
  3838. dark: purple$1[400]
  3839. };
  3840. }
  3841. return {
  3842. main: purple$1[500],
  3843. light: purple$1[300],
  3844. dark: purple$1[700]
  3845. };
  3846. }
  3847. function getDefaultError(mode = "light") {
  3848. if (mode === "dark") {
  3849. return {
  3850. main: red$1[500],
  3851. light: red$1[300],
  3852. dark: red$1[700]
  3853. };
  3854. }
  3855. return {
  3856. main: red$1[700],
  3857. light: red$1[400],
  3858. dark: red$1[800]
  3859. };
  3860. }
  3861. function getDefaultInfo(mode = "light") {
  3862. if (mode === "dark") {
  3863. return {
  3864. main: lightBlue$1[400],
  3865. light: lightBlue$1[300],
  3866. dark: lightBlue$1[700]
  3867. };
  3868. }
  3869. return {
  3870. main: lightBlue$1[700],
  3871. light: lightBlue$1[500],
  3872. dark: lightBlue$1[900]
  3873. };
  3874. }
  3875. function getDefaultSuccess(mode = "light") {
  3876. if (mode === "dark") {
  3877. return {
  3878. main: green$1[400],
  3879. light: green$1[300],
  3880. dark: green$1[700]
  3881. };
  3882. }
  3883. return {
  3884. main: green$1[800],
  3885. light: green$1[500],
  3886. dark: green$1[900]
  3887. };
  3888. }
  3889. function getDefaultWarning(mode = "light") {
  3890. if (mode === "dark") {
  3891. return {
  3892. main: orange$1[400],
  3893. light: orange$1[300],
  3894. dark: orange$1[700]
  3895. };
  3896. }
  3897. return {
  3898. main: "#ed6c02",
  3899. // closest to orange[800] that pass 3:1.
  3900. light: orange$1[500],
  3901. dark: orange$1[900]
  3902. };
  3903. }
  3904. function createPalette(palette) {
  3905. const {
  3906. mode = "light",
  3907. contrastThreshold = 3,
  3908. tonalOffset = 0.2
  3909. } = palette, other = _objectWithoutPropertiesLoose(palette, _excluded$e);
  3910. const primary = palette.primary || getDefaultPrimary(mode);
  3911. const secondary = palette.secondary || getDefaultSecondary(mode);
  3912. const error = palette.error || getDefaultError(mode);
  3913. const info = palette.info || getDefaultInfo(mode);
  3914. const success = palette.success || getDefaultSuccess(mode);
  3915. const warning = palette.warning || getDefaultWarning(mode);
  3916. function getContrastText(background) {
  3917. const contrastText = getContrastRatio_1(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
  3918. return contrastText;
  3919. }
  3920. const augmentColor = ({
  3921. color: color2,
  3922. name,
  3923. mainShade = 500,
  3924. lightShade = 300,
  3925. darkShade = 700
  3926. }) => {
  3927. color2 = _extends$1({}, color2);
  3928. if (!color2.main && color2[mainShade]) {
  3929. color2.main = color2[mainShade];
  3930. }
  3931. if (!color2.hasOwnProperty("main")) {
  3932. throw new Error(formatMuiErrorMessage$1(11, name ? ` (${name})` : "", mainShade));
  3933. }
  3934. if (typeof color2.main !== "string") {
  3935. throw new Error(formatMuiErrorMessage$1(12, name ? ` (${name})` : "", JSON.stringify(color2.main)));
  3936. }
  3937. addLightOrDark(color2, "light", lightShade, tonalOffset);
  3938. addLightOrDark(color2, "dark", darkShade, tonalOffset);
  3939. if (!color2.contrastText) {
  3940. color2.contrastText = getContrastText(color2.main);
  3941. }
  3942. return color2;
  3943. };
  3944. const modes = {
  3945. dark,
  3946. light
  3947. };
  3948. const paletteOutput = deepmerge$1(_extends$1({
  3949. // A collection of common colors.
  3950. common: _extends$1({}, common$1),
  3951. // prevent mutable object.
  3952. // The palette mode, can be light or dark.
  3953. mode,
  3954. // The colors used to represent primary interface elements for a user.
  3955. primary: augmentColor({
  3956. color: primary,
  3957. name: "primary"
  3958. }),
  3959. // The colors used to represent secondary interface elements for a user.
  3960. secondary: augmentColor({
  3961. color: secondary,
  3962. name: "secondary",
  3963. mainShade: "A400",
  3964. lightShade: "A200",
  3965. darkShade: "A700"
  3966. }),
  3967. // The colors used to represent interface elements that the user should be made aware of.
  3968. error: augmentColor({
  3969. color: error,
  3970. name: "error"
  3971. }),
  3972. // The colors used to represent potentially dangerous actions or important messages.
  3973. warning: augmentColor({
  3974. color: warning,
  3975. name: "warning"
  3976. }),
  3977. // The colors used to present information to the user that is neutral and not necessarily important.
  3978. info: augmentColor({
  3979. color: info,
  3980. name: "info"
  3981. }),
  3982. // The colors used to indicate the successful completion of an action that user triggered.
  3983. success: augmentColor({
  3984. color: success,
  3985. name: "success"
  3986. }),
  3987. // The grey colors.
  3988. grey: grey$1,
  3989. // Used by `getContrastText()` to maximize the contrast between
  3990. // the background and the text.
  3991. contrastThreshold,
  3992. // Takes a background color and returns the text color that maximizes the contrast.
  3993. getContrastText,
  3994. // Generate a rich color object.
  3995. augmentColor,
  3996. // Used by the functions below to shift a color's luminance by approximately
  3997. // two indexes within its tonal palette.
  3998. // E.g., shift from Red 500 to Red 300 or Red 700.
  3999. tonalOffset
  4000. }, modes[mode]), other);
  4001. return paletteOutput;
  4002. }
  4003. const _excluded$d = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
  4004. function round(value) {
  4005. return Math.round(value * 1e5) / 1e5;
  4006. }
  4007. const caseAllCaps = {
  4008. textTransform: "uppercase"
  4009. };
  4010. const defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
  4011. function createTypography(palette, typography) {
  4012. const _ref = typeof typography === "function" ? typography(palette) : typography, {
  4013. fontFamily = defaultFontFamily,
  4014. // The default font size of the Material Specification.
  4015. fontSize = 14,
  4016. // px
  4017. fontWeightLight = 300,
  4018. fontWeightRegular = 400,
  4019. fontWeightMedium = 500,
  4020. fontWeightBold = 700,
  4021. // Tell MUI what's the font-size on the html element.
  4022. // 16px is the default font-size used by browsers.
  4023. htmlFontSize = 16,
  4024. // Apply the CSS properties to all the variants.
  4025. allVariants,
  4026. pxToRem: pxToRem2
  4027. } = _ref, other = _objectWithoutPropertiesLoose(_ref, _excluded$d);
  4028. const coef = fontSize / 14;
  4029. const pxToRem = pxToRem2 || ((size) => `${size / htmlFontSize * coef}rem`);
  4030. const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$1({
  4031. fontFamily,
  4032. fontWeight,
  4033. fontSize: pxToRem(size),
  4034. // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
  4035. lineHeight
  4036. }, fontFamily === defaultFontFamily ? {
  4037. letterSpacing: `${round(letterSpacing / size)}em`
  4038. } : {}, casing, allVariants);
  4039. const variants = {
  4040. h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
  4041. h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
  4042. h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
  4043. h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
  4044. h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
  4045. h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
  4046. subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
  4047. subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
  4048. body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
  4049. body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
  4050. button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
  4051. caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
  4052. overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
  4053. // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
  4054. inherit: {
  4055. fontFamily: "inherit",
  4056. fontWeight: "inherit",
  4057. fontSize: "inherit",
  4058. lineHeight: "inherit",
  4059. letterSpacing: "inherit"
  4060. }
  4061. };
  4062. return deepmerge$1(_extends$1({
  4063. htmlFontSize,
  4064. pxToRem,
  4065. fontFamily,
  4066. fontSize,
  4067. fontWeightLight,
  4068. fontWeightRegular,
  4069. fontWeightMedium,
  4070. fontWeightBold
  4071. }, variants), other, {
  4072. clone: false
  4073. // No need to clone deep
  4074. });
  4075. }
  4076. const shadowKeyUmbraOpacity = 0.2;
  4077. const shadowKeyPenumbraOpacity = 0.14;
  4078. const shadowAmbientShadowOpacity = 0.12;
  4079. function createShadow(...px) {
  4080. return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
  4081. }
  4082. const shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
  4083. const _excluded$c = ["duration", "easing", "delay"];
  4084. const easing = {
  4085. // This is the most common easing curve.
  4086. easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
  4087. // Objects enter the screen at full velocity from off-screen and
  4088. // slowly decelerate to a resting point.
  4089. easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
  4090. // Objects leave the screen at full velocity. They do not decelerate when off-screen.
  4091. easeIn: "cubic-bezier(0.4, 0, 1, 1)",
  4092. // The sharp curve is used by objects that may return to the screen at any time.
  4093. sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
  4094. };
  4095. const duration = {
  4096. shortest: 150,
  4097. shorter: 200,
  4098. short: 250,
  4099. // most basic recommended timing
  4100. standard: 300,
  4101. // this is to be used in complex animations
  4102. complex: 375,
  4103. // recommended when something is entering screen
  4104. enteringScreen: 225,
  4105. // recommended when something is leaving screen
  4106. leavingScreen: 195
  4107. };
  4108. function formatMs(milliseconds) {
  4109. return `${Math.round(milliseconds)}ms`;
  4110. }
  4111. function getAutoHeightDuration(height2) {
  4112. if (!height2) {
  4113. return 0;
  4114. }
  4115. const constant = height2 / 36;
  4116. return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
  4117. }
  4118. function createTransitions(inputTransitions) {
  4119. const mergedEasing = _extends$1({}, easing, inputTransitions.easing);
  4120. const mergedDuration = _extends$1({}, duration, inputTransitions.duration);
  4121. const create = (props = ["all"], options = {}) => {
  4122. const {
  4123. duration: durationOption = mergedDuration.standard,
  4124. easing: easingOption = mergedEasing.easeInOut,
  4125. delay = 0
  4126. } = options;
  4127. _objectWithoutPropertiesLoose(options, _excluded$c);
  4128. return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
  4129. };
  4130. return _extends$1({
  4131. getAutoHeightDuration,
  4132. create
  4133. }, inputTransitions, {
  4134. easing: mergedEasing,
  4135. duration: mergedDuration
  4136. });
  4137. }
  4138. const zIndex = {
  4139. mobileStepper: 1e3,
  4140. fab: 1050,
  4141. speedDial: 1050,
  4142. appBar: 1100,
  4143. drawer: 1200,
  4144. modal: 1300,
  4145. snackbar: 1400,
  4146. tooltip: 1500
  4147. };
  4148. const zIndex$1 = zIndex;
  4149. const _excluded$b = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
  4150. function createTheme(options = {}, ...args) {
  4151. const {
  4152. mixins: mixinsInput = {},
  4153. palette: paletteInput = {},
  4154. transitions: transitionsInput = {},
  4155. typography: typographyInput = {}
  4156. } = options, other = _objectWithoutPropertiesLoose(options, _excluded$b);
  4157. if (options.vars) {
  4158. throw new Error(formatMuiErrorMessage$1(18));
  4159. }
  4160. const palette = createPalette(paletteInput);
  4161. const systemTheme = createTheme$2(options);
  4162. let muiTheme = deepmerge$1(systemTheme, {
  4163. mixins: createMixins(systemTheme.breakpoints, mixinsInput),
  4164. palette,
  4165. // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
  4166. shadows: shadows.slice(),
  4167. typography: createTypography(palette, typographyInput),
  4168. transitions: createTransitions(transitionsInput),
  4169. zIndex: _extends$1({}, zIndex$1)
  4170. });
  4171. muiTheme = deepmerge$1(muiTheme, other);
  4172. muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
  4173. muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
  4174. muiTheme.unstable_sx = function sx(props) {
  4175. return styleFunctionSx$1({
  4176. sx: props,
  4177. theme: this
  4178. });
  4179. };
  4180. return muiTheme;
  4181. }
  4182. const defaultTheme = createTheme();
  4183. const defaultTheme$1 = defaultTheme;
  4184. const THEME_ID = "$$material";
  4185. const rootShouldForwardProp = (prop) => shouldForwardProp_1(prop) && prop !== "classes";
  4186. const styled = _default({
  4187. themeId: THEME_ID,
  4188. defaultTheme: defaultTheme$1,
  4189. rootShouldForwardProp
  4190. });
  4191. function getThemeProps(params) {
  4192. const {
  4193. theme,
  4194. name,
  4195. props
  4196. } = params;
  4197. if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
  4198. return props;
  4199. }
  4200. return resolveProps(theme.components[name].defaultProps, props);
  4201. }
  4202. function isObjectEmpty(obj) {
  4203. return Object.keys(obj).length === 0;
  4204. }
  4205. function useTheme$3(defaultTheme2 = null) {
  4206. const contextTheme = React__namespace.useContext(ThemeContext$2);
  4207. return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
  4208. }
  4209. const systemDefaultTheme = createTheme$2();
  4210. function useTheme$2(defaultTheme2 = systemDefaultTheme) {
  4211. return useTheme$3(defaultTheme2);
  4212. }
  4213. function useThemeProps$1({
  4214. props,
  4215. name,
  4216. defaultTheme: defaultTheme2,
  4217. themeId
  4218. }) {
  4219. let theme = useTheme$2(defaultTheme2);
  4220. if (themeId) {
  4221. theme = theme[themeId] || theme;
  4222. }
  4223. const mergedProps = getThemeProps({
  4224. theme,
  4225. name,
  4226. props
  4227. });
  4228. return mergedProps;
  4229. }
  4230. function useThemeProps({
  4231. props,
  4232. name
  4233. }) {
  4234. return useThemeProps$1({
  4235. props,
  4236. name,
  4237. defaultTheme: defaultTheme$1,
  4238. themeId: THEME_ID
  4239. });
  4240. }
  4241. function setRef(ref, value) {
  4242. if (typeof ref === "function") {
  4243. ref(value);
  4244. } else if (ref) {
  4245. ref.current = value;
  4246. }
  4247. }
  4248. function useForkRef(...refs) {
  4249. return React__namespace.useMemo(() => {
  4250. if (refs.every((ref) => ref == null)) {
  4251. return null;
  4252. }
  4253. return (instance) => {
  4254. refs.forEach((ref) => {
  4255. setRef(ref, instance);
  4256. });
  4257. };
  4258. }, refs);
  4259. }
  4260. const useEnhancedEffect = typeof window !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
  4261. function useEventCallback(fn) {
  4262. const ref = React__namespace.useRef(fn);
  4263. useEnhancedEffect(() => {
  4264. ref.current = fn;
  4265. });
  4266. return React__namespace.useRef((...args) => (
  4267. // @ts-expect-error hide `this`
  4268. (0, ref.current)(...args)
  4269. )).current;
  4270. }
  4271. const UNINITIALIZED = {};
  4272. function useLazyRef(init, initArg) {
  4273. const ref = React__namespace.useRef(UNINITIALIZED);
  4274. if (ref.current === UNINITIALIZED) {
  4275. ref.current = init(initArg);
  4276. }
  4277. return ref;
  4278. }
  4279. const EMPTY = [];
  4280. function useOnMount(fn) {
  4281. React__namespace.useEffect(fn, EMPTY);
  4282. }
  4283. class Timeout {
  4284. constructor() {
  4285. this.currentId = null;
  4286. this.clear = () => {
  4287. if (this.currentId !== null) {
  4288. clearTimeout(this.currentId);
  4289. this.currentId = null;
  4290. }
  4291. };
  4292. this.disposeEffect = () => {
  4293. return this.clear;
  4294. };
  4295. }
  4296. static create() {
  4297. return new Timeout();
  4298. }
  4299. /**
  4300. * Executes `fn` after `delay`, clearing any previously scheduled call.
  4301. */
  4302. start(delay, fn) {
  4303. this.clear();
  4304. this.currentId = setTimeout(() => {
  4305. this.currentId = null;
  4306. fn();
  4307. }, delay);
  4308. }
  4309. }
  4310. function useTimeout() {
  4311. const timeout = useLazyRef(Timeout.create).current;
  4312. useOnMount(timeout.disposeEffect);
  4313. return timeout;
  4314. }
  4315. let hadKeyboardEvent = true;
  4316. let hadFocusVisibleRecently = false;
  4317. const hadFocusVisibleRecentlyTimeout = new Timeout();
  4318. const inputTypesWhitelist = {
  4319. text: true,
  4320. search: true,
  4321. url: true,
  4322. tel: true,
  4323. email: true,
  4324. password: true,
  4325. number: true,
  4326. date: true,
  4327. month: true,
  4328. week: true,
  4329. time: true,
  4330. datetime: true,
  4331. "datetime-local": true
  4332. };
  4333. function focusTriggersKeyboardModality(node2) {
  4334. const {
  4335. type,
  4336. tagName
  4337. } = node2;
  4338. if (tagName === "INPUT" && inputTypesWhitelist[type] && !node2.readOnly) {
  4339. return true;
  4340. }
  4341. if (tagName === "TEXTAREA" && !node2.readOnly) {
  4342. return true;
  4343. }
  4344. if (node2.isContentEditable) {
  4345. return true;
  4346. }
  4347. return false;
  4348. }
  4349. function handleKeyDown(event) {
  4350. if (event.metaKey || event.altKey || event.ctrlKey) {
  4351. return;
  4352. }
  4353. hadKeyboardEvent = true;
  4354. }
  4355. function handlePointerDown() {
  4356. hadKeyboardEvent = false;
  4357. }
  4358. function handleVisibilityChange() {
  4359. if (this.visibilityState === "hidden") {
  4360. if (hadFocusVisibleRecently) {
  4361. hadKeyboardEvent = true;
  4362. }
  4363. }
  4364. }
  4365. function prepare(doc) {
  4366. doc.addEventListener("keydown", handleKeyDown, true);
  4367. doc.addEventListener("mousedown", handlePointerDown, true);
  4368. doc.addEventListener("pointerdown", handlePointerDown, true);
  4369. doc.addEventListener("touchstart", handlePointerDown, true);
  4370. doc.addEventListener("visibilitychange", handleVisibilityChange, true);
  4371. }
  4372. function isFocusVisible(event) {
  4373. const {
  4374. target
  4375. } = event;
  4376. try {
  4377. return target.matches(":focus-visible");
  4378. } catch (error) {
  4379. }
  4380. return hadKeyboardEvent || focusTriggersKeyboardModality(target);
  4381. }
  4382. function useIsFocusVisible() {
  4383. const ref = React__namespace.useCallback((node2) => {
  4384. if (node2 != null) {
  4385. prepare(node2.ownerDocument);
  4386. }
  4387. }, []);
  4388. const isFocusVisibleRef = React__namespace.useRef(false);
  4389. function handleBlurVisible() {
  4390. if (isFocusVisibleRef.current) {
  4391. hadFocusVisibleRecently = true;
  4392. hadFocusVisibleRecentlyTimeout.start(100, () => {
  4393. hadFocusVisibleRecently = false;
  4394. });
  4395. isFocusVisibleRef.current = false;
  4396. return true;
  4397. }
  4398. return false;
  4399. }
  4400. function handleFocusVisible(event) {
  4401. if (isFocusVisible(event)) {
  4402. isFocusVisibleRef.current = true;
  4403. return true;
  4404. }
  4405. return false;
  4406. }
  4407. return {
  4408. isFocusVisibleRef,
  4409. onFocus: handleFocusVisible,
  4410. onBlur: handleBlurVisible,
  4411. ref
  4412. };
  4413. }
  4414. function _setPrototypeOf(o, p2) {
  4415. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
  4416. o2.__proto__ = p3;
  4417. return o2;
  4418. };
  4419. return _setPrototypeOf(o, p2);
  4420. }
  4421. function _inheritsLoose(subClass, superClass) {
  4422. subClass.prototype = Object.create(superClass.prototype);
  4423. subClass.prototype.constructor = subClass;
  4424. _setPrototypeOf(subClass, superClass);
  4425. }
  4426. const config = {
  4427. disabled: false
  4428. };
  4429. const TransitionGroupContext = React.createContext(null);
  4430. var forceReflow = function forceReflow2(node2) {
  4431. return node2.scrollTop;
  4432. };
  4433. var UNMOUNTED = "unmounted";
  4434. var EXITED = "exited";
  4435. var ENTERING = "entering";
  4436. var ENTERED = "entered";
  4437. var EXITING = "exiting";
  4438. var Transition = /* @__PURE__ */ function(_React$Component) {
  4439. _inheritsLoose(Transition2, _React$Component);
  4440. function Transition2(props, context) {
  4441. var _this;
  4442. _this = _React$Component.call(this, props, context) || this;
  4443. var parentGroup = context;
  4444. var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
  4445. var initialStatus;
  4446. _this.appearStatus = null;
  4447. if (props.in) {
  4448. if (appear) {
  4449. initialStatus = EXITED;
  4450. _this.appearStatus = ENTERING;
  4451. } else {
  4452. initialStatus = ENTERED;
  4453. }
  4454. } else {
  4455. if (props.unmountOnExit || props.mountOnEnter) {
  4456. initialStatus = UNMOUNTED;
  4457. } else {
  4458. initialStatus = EXITED;
  4459. }
  4460. }
  4461. _this.state = {
  4462. status: initialStatus
  4463. };
  4464. _this.nextCallback = null;
  4465. return _this;
  4466. }
  4467. Transition2.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
  4468. var nextIn = _ref.in;
  4469. if (nextIn && prevState.status === UNMOUNTED) {
  4470. return {
  4471. status: EXITED
  4472. };
  4473. }
  4474. return null;
  4475. };
  4476. var _proto = Transition2.prototype;
  4477. _proto.componentDidMount = function componentDidMount() {
  4478. this.updateStatus(true, this.appearStatus);
  4479. };
  4480. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  4481. var nextStatus = null;
  4482. if (prevProps !== this.props) {
  4483. var status = this.state.status;
  4484. if (this.props.in) {
  4485. if (status !== ENTERING && status !== ENTERED) {
  4486. nextStatus = ENTERING;
  4487. }
  4488. } else {
  4489. if (status === ENTERING || status === ENTERED) {
  4490. nextStatus = EXITING;
  4491. }
  4492. }
  4493. }
  4494. this.updateStatus(false, nextStatus);
  4495. };
  4496. _proto.componentWillUnmount = function componentWillUnmount() {
  4497. this.cancelNextCallback();
  4498. };
  4499. _proto.getTimeouts = function getTimeouts() {
  4500. var timeout2 = this.props.timeout;
  4501. var exit, enter, appear;
  4502. exit = enter = appear = timeout2;
  4503. if (timeout2 != null && typeof timeout2 !== "number") {
  4504. exit = timeout2.exit;
  4505. enter = timeout2.enter;
  4506. appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
  4507. }
  4508. return {
  4509. exit,
  4510. enter,
  4511. appear
  4512. };
  4513. };
  4514. _proto.updateStatus = function updateStatus(mounting, nextStatus) {
  4515. if (mounting === void 0) {
  4516. mounting = false;
  4517. }
  4518. if (nextStatus !== null) {
  4519. this.cancelNextCallback();
  4520. if (nextStatus === ENTERING) {
  4521. if (this.props.unmountOnExit || this.props.mountOnEnter) {
  4522. var node2 = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
  4523. if (node2)
  4524. forceReflow(node2);
  4525. }
  4526. this.performEnter(mounting);
  4527. } else {
  4528. this.performExit();
  4529. }
  4530. } else if (this.props.unmountOnExit && this.state.status === EXITED) {
  4531. this.setState({
  4532. status: UNMOUNTED
  4533. });
  4534. }
  4535. };
  4536. _proto.performEnter = function performEnter(mounting) {
  4537. var _this2 = this;
  4538. var enter = this.props.enter;
  4539. var appearing = this.context ? this.context.isMounting : mounting;
  4540. var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
  4541. var timeouts = this.getTimeouts();
  4542. var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
  4543. if (!mounting && !enter || config.disabled) {
  4544. this.safeSetState({
  4545. status: ENTERED
  4546. }, function() {
  4547. _this2.props.onEntered(maybeNode);
  4548. });
  4549. return;
  4550. }
  4551. this.props.onEnter(maybeNode, maybeAppearing);
  4552. this.safeSetState({
  4553. status: ENTERING
  4554. }, function() {
  4555. _this2.props.onEntering(maybeNode, maybeAppearing);
  4556. _this2.onTransitionEnd(enterTimeout, function() {
  4557. _this2.safeSetState({
  4558. status: ENTERED
  4559. }, function() {
  4560. _this2.props.onEntered(maybeNode, maybeAppearing);
  4561. });
  4562. });
  4563. });
  4564. };
  4565. _proto.performExit = function performExit() {
  4566. var _this3 = this;
  4567. var exit = this.props.exit;
  4568. var timeouts = this.getTimeouts();
  4569. var maybeNode = this.props.nodeRef ? void 0 : ReactDOM__default.findDOMNode(this);
  4570. if (!exit || config.disabled) {
  4571. this.safeSetState({
  4572. status: EXITED
  4573. }, function() {
  4574. _this3.props.onExited(maybeNode);
  4575. });
  4576. return;
  4577. }
  4578. this.props.onExit(maybeNode);
  4579. this.safeSetState({
  4580. status: EXITING
  4581. }, function() {
  4582. _this3.props.onExiting(maybeNode);
  4583. _this3.onTransitionEnd(timeouts.exit, function() {
  4584. _this3.safeSetState({
  4585. status: EXITED
  4586. }, function() {
  4587. _this3.props.onExited(maybeNode);
  4588. });
  4589. });
  4590. });
  4591. };
  4592. _proto.cancelNextCallback = function cancelNextCallback() {
  4593. if (this.nextCallback !== null) {
  4594. this.nextCallback.cancel();
  4595. this.nextCallback = null;
  4596. }
  4597. };
  4598. _proto.safeSetState = function safeSetState(nextState, callback) {
  4599. callback = this.setNextCallback(callback);
  4600. this.setState(nextState, callback);
  4601. };
  4602. _proto.setNextCallback = function setNextCallback(callback) {
  4603. var _this4 = this;
  4604. var active = true;
  4605. this.nextCallback = function(event) {
  4606. if (active) {
  4607. active = false;
  4608. _this4.nextCallback = null;
  4609. callback(event);
  4610. }
  4611. };
  4612. this.nextCallback.cancel = function() {
  4613. active = false;
  4614. };
  4615. return this.nextCallback;
  4616. };
  4617. _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
  4618. this.setNextCallback(handler);
  4619. var node2 = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
  4620. var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
  4621. if (!node2 || doesNotHaveTimeoutOrListener) {
  4622. setTimeout(this.nextCallback, 0);
  4623. return;
  4624. }
  4625. if (this.props.addEndListener) {
  4626. var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node2, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1];
  4627. this.props.addEndListener(maybeNode, maybeNextCallback);
  4628. }
  4629. if (timeout2 != null) {
  4630. setTimeout(this.nextCallback, timeout2);
  4631. }
  4632. };
  4633. _proto.render = function render() {
  4634. var status = this.state.status;
  4635. if (status === UNMOUNTED) {
  4636. return null;
  4637. }
  4638. var _this$props = this.props, children = _this$props.children;
  4639. _this$props.in;
  4640. _this$props.mountOnEnter;
  4641. _this$props.unmountOnExit;
  4642. _this$props.appear;
  4643. _this$props.enter;
  4644. _this$props.exit;
  4645. _this$props.timeout;
  4646. _this$props.addEndListener;
  4647. _this$props.onEnter;
  4648. _this$props.onEntering;
  4649. _this$props.onEntered;
  4650. _this$props.onExit;
  4651. _this$props.onExiting;
  4652. _this$props.onExited;
  4653. _this$props.nodeRef;
  4654. var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
  4655. return (
  4656. // allows for nested Transitions
  4657. /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
  4658. value: null
  4659. }, typeof children === "function" ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))
  4660. );
  4661. };
  4662. return Transition2;
  4663. }(React.Component);
  4664. Transition.contextType = TransitionGroupContext;
  4665. Transition.propTypes = {};
  4666. function noop() {
  4667. }
  4668. Transition.defaultProps = {
  4669. in: false,
  4670. mountOnEnter: false,
  4671. unmountOnExit: false,
  4672. appear: false,
  4673. enter: true,
  4674. exit: true,
  4675. onEnter: noop,
  4676. onEntering: noop,
  4677. onEntered: noop,
  4678. onExit: noop,
  4679. onExiting: noop,
  4680. onExited: noop
  4681. };
  4682. Transition.UNMOUNTED = UNMOUNTED;
  4683. Transition.EXITED = EXITED;
  4684. Transition.ENTERING = ENTERING;
  4685. Transition.ENTERED = ENTERED;
  4686. Transition.EXITING = EXITING;
  4687. const Transition$1 = Transition;
  4688. function _assertThisInitialized(self) {
  4689. if (self === void 0) {
  4690. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  4691. }
  4692. return self;
  4693. }
  4694. function getChildMapping(children, mapFn) {
  4695. var mapper = function mapper2(child) {
  4696. return mapFn && React.isValidElement(child) ? mapFn(child) : child;
  4697. };
  4698. var result = /* @__PURE__ */ Object.create(null);
  4699. if (children)
  4700. React.Children.map(children, function(c2) {
  4701. return c2;
  4702. }).forEach(function(child) {
  4703. result[child.key] = mapper(child);
  4704. });
  4705. return result;
  4706. }
  4707. function mergeChildMappings(prev2, next2) {
  4708. prev2 = prev2 || {};
  4709. next2 = next2 || {};
  4710. function getValueForKey(key) {
  4711. return key in next2 ? next2[key] : prev2[key];
  4712. }
  4713. var nextKeysPending = /* @__PURE__ */ Object.create(null);
  4714. var pendingKeys = [];
  4715. for (var prevKey in prev2) {
  4716. if (prevKey in next2) {
  4717. if (pendingKeys.length) {
  4718. nextKeysPending[prevKey] = pendingKeys;
  4719. pendingKeys = [];
  4720. }
  4721. } else {
  4722. pendingKeys.push(prevKey);
  4723. }
  4724. }
  4725. var i;
  4726. var childMapping = {};
  4727. for (var nextKey in next2) {
  4728. if (nextKeysPending[nextKey]) {
  4729. for (i = 0; i < nextKeysPending[nextKey].length; i++) {
  4730. var pendingNextKey = nextKeysPending[nextKey][i];
  4731. childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
  4732. }
  4733. }
  4734. childMapping[nextKey] = getValueForKey(nextKey);
  4735. }
  4736. for (i = 0; i < pendingKeys.length; i++) {
  4737. childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
  4738. }
  4739. return childMapping;
  4740. }
  4741. function getProp(child, prop, props) {
  4742. return props[prop] != null ? props[prop] : child.props[prop];
  4743. }
  4744. function getInitialChildMapping(props, onExited) {
  4745. return getChildMapping(props.children, function(child) {
  4746. return React.cloneElement(child, {
  4747. onExited: onExited.bind(null, child),
  4748. in: true,
  4749. appear: getProp(child, "appear", props),
  4750. enter: getProp(child, "enter", props),
  4751. exit: getProp(child, "exit", props)
  4752. });
  4753. });
  4754. }
  4755. function getNextChildMapping(nextProps, prevChildMapping, onExited) {
  4756. var nextChildMapping = getChildMapping(nextProps.children);
  4757. var children = mergeChildMappings(prevChildMapping, nextChildMapping);
  4758. Object.keys(children).forEach(function(key) {
  4759. var child = children[key];
  4760. if (!React.isValidElement(child))
  4761. return;
  4762. var hasPrev = key in prevChildMapping;
  4763. var hasNext = key in nextChildMapping;
  4764. var prevChild = prevChildMapping[key];
  4765. var isLeaving = React.isValidElement(prevChild) && !prevChild.props.in;
  4766. if (hasNext && (!hasPrev || isLeaving)) {
  4767. children[key] = React.cloneElement(child, {
  4768. onExited: onExited.bind(null, child),
  4769. in: true,
  4770. exit: getProp(child, "exit", nextProps),
  4771. enter: getProp(child, "enter", nextProps)
  4772. });
  4773. } else if (!hasNext && hasPrev && !isLeaving) {
  4774. children[key] = React.cloneElement(child, {
  4775. in: false
  4776. });
  4777. } else if (hasNext && hasPrev && React.isValidElement(prevChild)) {
  4778. children[key] = React.cloneElement(child, {
  4779. onExited: onExited.bind(null, child),
  4780. in: prevChild.props.in,
  4781. exit: getProp(child, "exit", nextProps),
  4782. enter: getProp(child, "enter", nextProps)
  4783. });
  4784. }
  4785. });
  4786. return children;
  4787. }
  4788. var values = Object.values || function(obj) {
  4789. return Object.keys(obj).map(function(k2) {
  4790. return obj[k2];
  4791. });
  4792. };
  4793. var defaultProps = {
  4794. component: "div",
  4795. childFactory: function childFactory(child) {
  4796. return child;
  4797. }
  4798. };
  4799. var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
  4800. _inheritsLoose(TransitionGroup2, _React$Component);
  4801. function TransitionGroup2(props, context) {
  4802. var _this;
  4803. _this = _React$Component.call(this, props, context) || this;
  4804. var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
  4805. _this.state = {
  4806. contextValue: {
  4807. isMounting: true
  4808. },
  4809. handleExited,
  4810. firstRender: true
  4811. };
  4812. return _this;
  4813. }
  4814. var _proto = TransitionGroup2.prototype;
  4815. _proto.componentDidMount = function componentDidMount() {
  4816. this.mounted = true;
  4817. this.setState({
  4818. contextValue: {
  4819. isMounting: false
  4820. }
  4821. });
  4822. };
  4823. _proto.componentWillUnmount = function componentWillUnmount() {
  4824. this.mounted = false;
  4825. };
  4826. TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
  4827. var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
  4828. return {
  4829. children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
  4830. firstRender: false
  4831. };
  4832. };
  4833. _proto.handleExited = function handleExited(child, node2) {
  4834. var currentChildMapping = getChildMapping(this.props.children);
  4835. if (child.key in currentChildMapping)
  4836. return;
  4837. if (child.props.onExited) {
  4838. child.props.onExited(node2);
  4839. }
  4840. if (this.mounted) {
  4841. this.setState(function(state) {
  4842. var children = _extends$1({}, state.children);
  4843. delete children[child.key];
  4844. return {
  4845. children
  4846. };
  4847. });
  4848. }
  4849. };
  4850. _proto.render = function render() {
  4851. var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
  4852. var contextValue = this.state.contextValue;
  4853. var children = values(this.state.children).map(childFactory2);
  4854. delete props.appear;
  4855. delete props.enter;
  4856. delete props.exit;
  4857. if (Component === null) {
  4858. return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
  4859. value: contextValue
  4860. }, children);
  4861. }
  4862. return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
  4863. value: contextValue
  4864. }, /* @__PURE__ */ React.createElement(Component, props, children));
  4865. };
  4866. return TransitionGroup2;
  4867. }(React.Component);
  4868. TransitionGroup.propTypes = {};
  4869. TransitionGroup.defaultProps = defaultProps;
  4870. const TransitionGroup$1 = TransitionGroup;
  4871. function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
  4872. const result = {};
  4873. slots.forEach((slot) => {
  4874. result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
  4875. });
  4876. return result;
  4877. }
  4878. function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
  4879. const [match2, setMatch] = React__namespace.useState(() => {
  4880. if (noSsr && matchMedia) {
  4881. return matchMedia(query).matches;
  4882. }
  4883. if (ssrMatchMedia) {
  4884. return ssrMatchMedia(query).matches;
  4885. }
  4886. return defaultMatches;
  4887. });
  4888. useEnhancedEffect(() => {
  4889. let active = true;
  4890. if (!matchMedia) {
  4891. return void 0;
  4892. }
  4893. const queryList = matchMedia(query);
  4894. const updateMatch = () => {
  4895. if (active) {
  4896. setMatch(queryList.matches);
  4897. }
  4898. };
  4899. updateMatch();
  4900. queryList.addListener(updateMatch);
  4901. return () => {
  4902. active = false;
  4903. queryList.removeListener(updateMatch);
  4904. };
  4905. }, [query, matchMedia]);
  4906. return match2;
  4907. }
  4908. const maybeReactUseSyncExternalStore = React__namespace["useSyncExternalStore"];
  4909. function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
  4910. const getDefaultSnapshot = React__namespace.useCallback(() => defaultMatches, [defaultMatches]);
  4911. const getServerSnapshot = React__namespace.useMemo(() => {
  4912. if (noSsr && matchMedia) {
  4913. return () => matchMedia(query).matches;
  4914. }
  4915. if (ssrMatchMedia !== null) {
  4916. const {
  4917. matches
  4918. } = ssrMatchMedia(query);
  4919. return () => matches;
  4920. }
  4921. return getDefaultSnapshot;
  4922. }, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);
  4923. const [getSnapshot, subscribe] = React__namespace.useMemo(() => {
  4924. if (matchMedia === null) {
  4925. return [getDefaultSnapshot, () => () => {
  4926. }];
  4927. }
  4928. const mediaQueryList = matchMedia(query);
  4929. return [() => mediaQueryList.matches, (notify) => {
  4930. mediaQueryList.addListener(notify);
  4931. return () => {
  4932. mediaQueryList.removeListener(notify);
  4933. };
  4934. }];
  4935. }, [getDefaultSnapshot, matchMedia, query]);
  4936. const match2 = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
  4937. return match2;
  4938. }
  4939. function useMediaQuery(queryInput, options = {}) {
  4940. const theme = useTheme$3();
  4941. const supportMatchMedia = typeof window !== "undefined" && typeof window.matchMedia !== "undefined";
  4942. const {
  4943. defaultMatches = false,
  4944. matchMedia = supportMatchMedia ? window.matchMedia : null,
  4945. ssrMatchMedia = null,
  4946. noSsr = false
  4947. } = getThemeProps({
  4948. name: "MuiUseMediaQuery",
  4949. props: options,
  4950. theme
  4951. });
  4952. let query = typeof queryInput === "function" ? queryInput(theme) : queryInput;
  4953. query = query.replace(/^@media( ?)/m, "");
  4954. const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== void 0 ? useMediaQueryNew : useMediaQueryOld;
  4955. const match2 = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
  4956. return match2;
  4957. }
  4958. function createChainedFunction(...funcs) {
  4959. return funcs.reduce((acc, func) => {
  4960. if (func == null) {
  4961. return acc;
  4962. }
  4963. return function chainedFunction(...args) {
  4964. acc.apply(this, args);
  4965. func.apply(this, args);
  4966. };
  4967. }, () => {
  4968. });
  4969. }
  4970. function debounce(func, wait = 166) {
  4971. let timeout;
  4972. function debounced(...args) {
  4973. const later = () => {
  4974. func.apply(this, args);
  4975. };
  4976. clearTimeout(timeout);
  4977. timeout = setTimeout(later, wait);
  4978. }
  4979. debounced.clear = () => {
  4980. clearTimeout(timeout);
  4981. };
  4982. return debounced;
  4983. }
  4984. function ownerDocument(node2) {
  4985. return node2 && node2.ownerDocument || document;
  4986. }
  4987. function ownerWindow(node2) {
  4988. const doc = ownerDocument(node2);
  4989. return doc.defaultView || window;
  4990. }
  4991. function getScrollbarSize(doc) {
  4992. const documentWidth = doc.documentElement.clientWidth;
  4993. return Math.abs(window.innerWidth - documentWidth);
  4994. }
  4995. const ThemeContext = /* @__PURE__ */ React__namespace.createContext(null);
  4996. const ThemeContext$1 = ThemeContext;
  4997. function useTheme$1() {
  4998. const theme = React__namespace.useContext(ThemeContext$1);
  4999. return theme;
  5000. }
  5001. const hasSymbol = typeof Symbol === "function" && Symbol.for;
  5002. const nested = hasSymbol ? Symbol.for("mui.nested") : "__THEME_NESTED__";
  5003. function mergeOuterLocalTheme(outerTheme, localTheme) {
  5004. if (typeof localTheme === "function") {
  5005. const mergedTheme = localTheme(outerTheme);
  5006. return mergedTheme;
  5007. }
  5008. return _extends$1({}, outerTheme, localTheme);
  5009. }
  5010. function ThemeProvider$3(props) {
  5011. const {
  5012. children,
  5013. theme: localTheme
  5014. } = props;
  5015. const outerTheme = useTheme$1();
  5016. const theme = React__namespace.useMemo(() => {
  5017. const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
  5018. if (output != null) {
  5019. output[nested] = outerTheme !== null;
  5020. }
  5021. return output;
  5022. }, [localTheme, outerTheme]);
  5023. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
  5024. value: theme,
  5025. children
  5026. });
  5027. }
  5028. const EMPTY_THEME = {};
  5029. function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
  5030. return React__namespace.useMemo(() => {
  5031. const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
  5032. if (typeof localTheme === "function") {
  5033. const mergedTheme = localTheme(resolvedTheme);
  5034. const result = themeId ? _extends$1({}, upperTheme, {
  5035. [themeId]: mergedTheme
  5036. }) : mergedTheme;
  5037. if (isPrivate) {
  5038. return () => result;
  5039. }
  5040. return result;
  5041. }
  5042. return themeId ? _extends$1({}, upperTheme, {
  5043. [themeId]: localTheme
  5044. }) : _extends$1({}, upperTheme, localTheme);
  5045. }, [themeId, upperTheme, localTheme, isPrivate]);
  5046. }
  5047. function ThemeProvider$2(props) {
  5048. const {
  5049. children,
  5050. theme: localTheme,
  5051. themeId
  5052. } = props;
  5053. const upperTheme = useTheme$3(EMPTY_THEME);
  5054. const upperPrivateTheme = useTheme$1() || EMPTY_THEME;
  5055. const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
  5056. const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
  5057. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider$3, {
  5058. theme: privateTheme,
  5059. children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
  5060. value: engineTheme,
  5061. children
  5062. })
  5063. });
  5064. }
  5065. function Ripple(props) {
  5066. const {
  5067. className,
  5068. classes,
  5069. pulsate = false,
  5070. rippleX,
  5071. rippleY,
  5072. rippleSize,
  5073. in: inProp,
  5074. onExited,
  5075. timeout
  5076. } = props;
  5077. const [leaving, setLeaving] = React__namespace.useState(false);
  5078. const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
  5079. const rippleStyles = {
  5080. width: rippleSize,
  5081. height: rippleSize,
  5082. top: -(rippleSize / 2) + rippleY,
  5083. left: -(rippleSize / 2) + rippleX
  5084. };
  5085. const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
  5086. if (!inProp && !leaving) {
  5087. setLeaving(true);
  5088. }
  5089. React__namespace.useEffect(() => {
  5090. if (!inProp && onExited != null) {
  5091. const timeoutId = setTimeout(onExited, timeout);
  5092. return () => {
  5093. clearTimeout(timeoutId);
  5094. };
  5095. }
  5096. return void 0;
  5097. }, [onExited, inProp, timeout]);
  5098. return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
  5099. className: rippleClassName,
  5100. style: rippleStyles,
  5101. children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
  5102. className: childClassName
  5103. })
  5104. });
  5105. }
  5106. const touchRippleClasses = generateUtilityClasses("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]);
  5107. const _excluded$a = ["center", "classes", "className"];
  5108. let _ = (t2) => t2, _t, _t2, _t3, _t4;
  5109. const DURATION = 550;
  5110. const DELAY_RIPPLE = 80;
  5111. const enterKeyframe = keyframes(_t || (_t = _`
  5112. 0% {
  5113. transform: scale(0);
  5114. opacity: 0.1;
  5115. }
  5116.  
  5117. 100% {
  5118. transform: scale(1);
  5119. opacity: 0.3;
  5120. }
  5121. `));
  5122. const exitKeyframe = keyframes(_t2 || (_t2 = _`
  5123. 0% {
  5124. opacity: 1;
  5125. }
  5126.  
  5127. 100% {
  5128. opacity: 0;
  5129. }
  5130. `));
  5131. const pulsateKeyframe = keyframes(_t3 || (_t3 = _`
  5132. 0% {
  5133. transform: scale(1);
  5134. }
  5135.  
  5136. 50% {
  5137. transform: scale(0.92);
  5138. }
  5139.  
  5140. 100% {
  5141. transform: scale(1);
  5142. }
  5143. `));
  5144. const TouchRippleRoot = styled("span", {
  5145. name: "MuiTouchRipple",
  5146. slot: "Root"
  5147. })({
  5148. overflow: "hidden",
  5149. pointerEvents: "none",
  5150. position: "absolute",
  5151. zIndex: 0,
  5152. top: 0,
  5153. right: 0,
  5154. bottom: 0,
  5155. left: 0,
  5156. borderRadius: "inherit"
  5157. });
  5158. const TouchRippleRipple = styled(Ripple, {
  5159. name: "MuiTouchRipple",
  5160. slot: "Ripple"
  5161. })(_t4 || (_t4 = _`
  5162. opacity: 0;
  5163. position: absolute;
  5164.  
  5165. &.${0} {
  5166. opacity: 0.3;
  5167. transform: scale(1);
  5168. animation-name: ${0};
  5169. animation-duration: ${0}ms;
  5170. animation-timing-function: ${0};
  5171. }
  5172.  
  5173. &.${0} {
  5174. animation-duration: ${0}ms;
  5175. }
  5176.  
  5177. & .${0} {
  5178. opacity: 1;
  5179. display: block;
  5180. width: 100%;
  5181. height: 100%;
  5182. border-radius: 50%;
  5183. background-color: currentColor;
  5184. }
  5185.  
  5186. & .${0} {
  5187. opacity: 0;
  5188. animation-name: ${0};
  5189. animation-duration: ${0}ms;
  5190. animation-timing-function: ${0};
  5191. }
  5192.  
  5193. & .${0} {
  5194. position: absolute;
  5195. /* @noflip */
  5196. left: 0px;
  5197. top: 0;
  5198. animation-name: ${0};
  5199. animation-duration: 2500ms;
  5200. animation-timing-function: ${0};
  5201. animation-iteration-count: infinite;
  5202. animation-delay: 200ms;
  5203. }
  5204. `), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({
  5205. theme
  5206. }) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({
  5207. theme
  5208. }) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({
  5209. theme
  5210. }) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({
  5211. theme
  5212. }) => theme.transitions.easing.easeInOut);
  5213. const TouchRipple = /* @__PURE__ */ React__namespace.forwardRef(function TouchRipple2(inProps, ref) {
  5214. const props = useThemeProps({
  5215. props: inProps,
  5216. name: "MuiTouchRipple"
  5217. });
  5218. const {
  5219. center: centerProp = false,
  5220. classes = {},
  5221. className
  5222. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$a);
  5223. const [ripples, setRipples] = React__namespace.useState([]);
  5224. const nextKey = React__namespace.useRef(0);
  5225. const rippleCallback = React__namespace.useRef(null);
  5226. React__namespace.useEffect(() => {
  5227. if (rippleCallback.current) {
  5228. rippleCallback.current();
  5229. rippleCallback.current = null;
  5230. }
  5231. }, [ripples]);
  5232. const ignoringMouseDown = React__namespace.useRef(false);
  5233. const startTimer = useTimeout();
  5234. const startTimerCommit = React__namespace.useRef(null);
  5235. const container = React__namespace.useRef(null);
  5236. const startCommit = React__namespace.useCallback((params) => {
  5237. const {
  5238. pulsate: pulsate2,
  5239. rippleX,
  5240. rippleY,
  5241. rippleSize,
  5242. cb
  5243. } = params;
  5244. setRipples((oldRipples) => [...oldRipples, /* @__PURE__ */ jsxRuntimeExports.jsx(TouchRippleRipple, {
  5245. classes: {
  5246. ripple: clsx(classes.ripple, touchRippleClasses.ripple),
  5247. rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),
  5248. ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),
  5249. child: clsx(classes.child, touchRippleClasses.child),
  5250. childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),
  5251. childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)
  5252. },
  5253. timeout: DURATION,
  5254. pulsate: pulsate2,
  5255. rippleX,
  5256. rippleY,
  5257. rippleSize
  5258. }, nextKey.current)]);
  5259. nextKey.current += 1;
  5260. rippleCallback.current = cb;
  5261. }, [classes]);
  5262. const start = React__namespace.useCallback((event = {}, options = {}, cb = () => {
  5263. }) => {
  5264. const {
  5265. pulsate: pulsate2 = false,
  5266. center = centerProp || options.pulsate,
  5267. fakeElement = false
  5268. // For test purposes
  5269. } = options;
  5270. if ((event == null ? void 0 : event.type) === "mousedown" && ignoringMouseDown.current) {
  5271. ignoringMouseDown.current = false;
  5272. return;
  5273. }
  5274. if ((event == null ? void 0 : event.type) === "touchstart") {
  5275. ignoringMouseDown.current = true;
  5276. }
  5277. const element = fakeElement ? null : container.current;
  5278. const rect = element ? element.getBoundingClientRect() : {
  5279. width: 0,
  5280. height: 0,
  5281. left: 0,
  5282. top: 0
  5283. };
  5284. let rippleX;
  5285. let rippleY;
  5286. let rippleSize;
  5287. if (center || event === void 0 || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
  5288. rippleX = Math.round(rect.width / 2);
  5289. rippleY = Math.round(rect.height / 2);
  5290. } else {
  5291. const {
  5292. clientX,
  5293. clientY
  5294. } = event.touches && event.touches.length > 0 ? event.touches[0] : event;
  5295. rippleX = Math.round(clientX - rect.left);
  5296. rippleY = Math.round(clientY - rect.top);
  5297. }
  5298. if (center) {
  5299. rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);
  5300. if (rippleSize % 2 === 0) {
  5301. rippleSize += 1;
  5302. }
  5303. } else {
  5304. const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
  5305. const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
  5306. rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);
  5307. }
  5308. if (event != null && event.touches) {
  5309. if (startTimerCommit.current === null) {
  5310. startTimerCommit.current = () => {
  5311. startCommit({
  5312. pulsate: pulsate2,
  5313. rippleX,
  5314. rippleY,
  5315. rippleSize,
  5316. cb
  5317. });
  5318. };
  5319. startTimer.start(DELAY_RIPPLE, () => {
  5320. if (startTimerCommit.current) {
  5321. startTimerCommit.current();
  5322. startTimerCommit.current = null;
  5323. }
  5324. });
  5325. }
  5326. } else {
  5327. startCommit({
  5328. pulsate: pulsate2,
  5329. rippleX,
  5330. rippleY,
  5331. rippleSize,
  5332. cb
  5333. });
  5334. }
  5335. }, [centerProp, startCommit, startTimer]);
  5336. const pulsate = React__namespace.useCallback(() => {
  5337. start({}, {
  5338. pulsate: true
  5339. });
  5340. }, [start]);
  5341. const stop = React__namespace.useCallback((event, cb) => {
  5342. startTimer.clear();
  5343. if ((event == null ? void 0 : event.type) === "touchend" && startTimerCommit.current) {
  5344. startTimerCommit.current();
  5345. startTimerCommit.current = null;
  5346. startTimer.start(0, () => {
  5347. stop(event, cb);
  5348. });
  5349. return;
  5350. }
  5351. startTimerCommit.current = null;
  5352. setRipples((oldRipples) => {
  5353. if (oldRipples.length > 0) {
  5354. return oldRipples.slice(1);
  5355. }
  5356. return oldRipples;
  5357. });
  5358. rippleCallback.current = cb;
  5359. }, [startTimer]);
  5360. React__namespace.useImperativeHandle(ref, () => ({
  5361. pulsate,
  5362. start,
  5363. stop
  5364. }), [pulsate, start, stop]);
  5365. return /* @__PURE__ */ jsxRuntimeExports.jsx(TouchRippleRoot, _extends$1({
  5366. className: clsx(touchRippleClasses.root, classes.root, className),
  5367. ref: container
  5368. }, other, {
  5369. children: /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionGroup$1, {
  5370. component: null,
  5371. exit: true,
  5372. children: ripples
  5373. })
  5374. }));
  5375. });
  5376. const TouchRipple$1 = TouchRipple;
  5377. function getButtonBaseUtilityClass(slot) {
  5378. return generateUtilityClass("MuiButtonBase", slot);
  5379. }
  5380. const buttonBaseClasses = generateUtilityClasses("MuiButtonBase", ["root", "disabled", "focusVisible"]);
  5381. const _excluded$9 = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
  5382. const useUtilityClasses$5 = (ownerState) => {
  5383. const {
  5384. disabled,
  5385. focusVisible,
  5386. focusVisibleClassName,
  5387. classes
  5388. } = ownerState;
  5389. const slots = {
  5390. root: ["root", disabled && "disabled", focusVisible && "focusVisible"]
  5391. };
  5392. const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
  5393. if (focusVisible && focusVisibleClassName) {
  5394. composedClasses.root += ` ${focusVisibleClassName}`;
  5395. }
  5396. return composedClasses;
  5397. };
  5398. const ButtonBaseRoot = styled("button", {
  5399. name: "MuiButtonBase",
  5400. slot: "Root",
  5401. overridesResolver: (props, styles2) => styles2.root
  5402. })({
  5403. display: "inline-flex",
  5404. alignItems: "center",
  5405. justifyContent: "center",
  5406. position: "relative",
  5407. boxSizing: "border-box",
  5408. WebkitTapHighlightColor: "transparent",
  5409. backgroundColor: "transparent",
  5410. // Reset default value
  5411. // We disable the focus ring for mouse, touch and keyboard users.
  5412. outline: 0,
  5413. border: 0,
  5414. margin: 0,
  5415. // Remove the margin in Safari
  5416. borderRadius: 0,
  5417. padding: 0,
  5418. // Remove the padding in Firefox
  5419. cursor: "pointer",
  5420. userSelect: "none",
  5421. verticalAlign: "middle",
  5422. MozAppearance: "none",
  5423. // Reset
  5424. WebkitAppearance: "none",
  5425. // Reset
  5426. textDecoration: "none",
  5427. // So we take precedent over the style of a native <a /> element.
  5428. color: "inherit",
  5429. "&::-moz-focus-inner": {
  5430. borderStyle: "none"
  5431. // Remove Firefox dotted outline.
  5432. },
  5433. [`&.${buttonBaseClasses.disabled}`]: {
  5434. pointerEvents: "none",
  5435. // Disable link interactions
  5436. cursor: "default"
  5437. },
  5438. "@media print": {
  5439. colorAdjust: "exact"
  5440. }
  5441. });
  5442. const ButtonBase = /* @__PURE__ */ React__namespace.forwardRef(function ButtonBase2(inProps, ref) {
  5443. const props = useThemeProps({
  5444. props: inProps,
  5445. name: "MuiButtonBase"
  5446. });
  5447. const {
  5448. action,
  5449. centerRipple = false,
  5450. children,
  5451. className,
  5452. component = "button",
  5453. disabled = false,
  5454. disableRipple = false,
  5455. disableTouchRipple = false,
  5456. focusRipple = false,
  5457. LinkComponent = "a",
  5458. onBlur,
  5459. onClick,
  5460. onContextMenu,
  5461. onDragLeave,
  5462. onFocus,
  5463. onFocusVisible,
  5464. onKeyDown,
  5465. onKeyUp,
  5466. onMouseDown,
  5467. onMouseLeave,
  5468. onMouseUp,
  5469. onTouchEnd,
  5470. onTouchMove,
  5471. onTouchStart,
  5472. tabIndex = 0,
  5473. TouchRippleProps,
  5474. touchRippleRef,
  5475. type
  5476. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$9);
  5477. const buttonRef = React__namespace.useRef(null);
  5478. const rippleRef = React__namespace.useRef(null);
  5479. const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
  5480. const {
  5481. isFocusVisibleRef,
  5482. onFocus: handleFocusVisible,
  5483. onBlur: handleBlurVisible,
  5484. ref: focusVisibleRef
  5485. } = useIsFocusVisible();
  5486. const [focusVisible, setFocusVisible] = React__namespace.useState(false);
  5487. if (disabled && focusVisible) {
  5488. setFocusVisible(false);
  5489. }
  5490. React__namespace.useImperativeHandle(action, () => ({
  5491. focusVisible: () => {
  5492. setFocusVisible(true);
  5493. buttonRef.current.focus();
  5494. }
  5495. }), []);
  5496. const [mountedState, setMountedState] = React__namespace.useState(false);
  5497. React__namespace.useEffect(() => {
  5498. setMountedState(true);
  5499. }, []);
  5500. const enableTouchRipple = mountedState && !disableRipple && !disabled;
  5501. React__namespace.useEffect(() => {
  5502. if (focusVisible && focusRipple && !disableRipple && mountedState) {
  5503. rippleRef.current.pulsate();
  5504. }
  5505. }, [disableRipple, focusRipple, focusVisible, mountedState]);
  5506. function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
  5507. return useEventCallback((event) => {
  5508. if (eventCallback) {
  5509. eventCallback(event);
  5510. }
  5511. const ignore = skipRippleAction;
  5512. if (!ignore && rippleRef.current) {
  5513. rippleRef.current[rippleAction](event);
  5514. }
  5515. return true;
  5516. });
  5517. }
  5518. const handleMouseDown = useRippleHandler("start", onMouseDown);
  5519. const handleContextMenu = useRippleHandler("stop", onContextMenu);
  5520. const handleDragLeave = useRippleHandler("stop", onDragLeave);
  5521. const handleMouseUp = useRippleHandler("stop", onMouseUp);
  5522. const handleMouseLeave = useRippleHandler("stop", (event) => {
  5523. if (focusVisible) {
  5524. event.preventDefault();
  5525. }
  5526. if (onMouseLeave) {
  5527. onMouseLeave(event);
  5528. }
  5529. });
  5530. const handleTouchStart = useRippleHandler("start", onTouchStart);
  5531. const handleTouchEnd = useRippleHandler("stop", onTouchEnd);
  5532. const handleTouchMove = useRippleHandler("stop", onTouchMove);
  5533. const handleBlur = useRippleHandler("stop", (event) => {
  5534. handleBlurVisible(event);
  5535. if (isFocusVisibleRef.current === false) {
  5536. setFocusVisible(false);
  5537. }
  5538. if (onBlur) {
  5539. onBlur(event);
  5540. }
  5541. }, false);
  5542. const handleFocus = useEventCallback((event) => {
  5543. if (!buttonRef.current) {
  5544. buttonRef.current = event.currentTarget;
  5545. }
  5546. handleFocusVisible(event);
  5547. if (isFocusVisibleRef.current === true) {
  5548. setFocusVisible(true);
  5549. if (onFocusVisible) {
  5550. onFocusVisible(event);
  5551. }
  5552. }
  5553. if (onFocus) {
  5554. onFocus(event);
  5555. }
  5556. });
  5557. const isNonNativeButton = () => {
  5558. const button = buttonRef.current;
  5559. return component && component !== "button" && !(button.tagName === "A" && button.href);
  5560. };
  5561. const keydownRef = React__namespace.useRef(false);
  5562. const handleKeyDown2 = useEventCallback((event) => {
  5563. if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === " ") {
  5564. keydownRef.current = true;
  5565. rippleRef.current.stop(event, () => {
  5566. rippleRef.current.start(event);
  5567. });
  5568. }
  5569. if (event.target === event.currentTarget && isNonNativeButton() && event.key === " ") {
  5570. event.preventDefault();
  5571. }
  5572. if (onKeyDown) {
  5573. onKeyDown(event);
  5574. }
  5575. if (event.target === event.currentTarget && isNonNativeButton() && event.key === "Enter" && !disabled) {
  5576. event.preventDefault();
  5577. if (onClick) {
  5578. onClick(event);
  5579. }
  5580. }
  5581. });
  5582. const handleKeyUp = useEventCallback((event) => {
  5583. if (focusRipple && event.key === " " && rippleRef.current && focusVisible && !event.defaultPrevented) {
  5584. keydownRef.current = false;
  5585. rippleRef.current.stop(event, () => {
  5586. rippleRef.current.pulsate(event);
  5587. });
  5588. }
  5589. if (onKeyUp) {
  5590. onKeyUp(event);
  5591. }
  5592. if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === " " && !event.defaultPrevented) {
  5593. onClick(event);
  5594. }
  5595. });
  5596. let ComponentProp = component;
  5597. if (ComponentProp === "button" && (other.href || other.to)) {
  5598. ComponentProp = LinkComponent;
  5599. }
  5600. const buttonProps = {};
  5601. if (ComponentProp === "button") {
  5602. buttonProps.type = type === void 0 ? "button" : type;
  5603. buttonProps.disabled = disabled;
  5604. } else {
  5605. if (!other.href && !other.to) {
  5606. buttonProps.role = "button";
  5607. }
  5608. if (disabled) {
  5609. buttonProps["aria-disabled"] = disabled;
  5610. }
  5611. }
  5612. const handleRef = useForkRef(ref, focusVisibleRef, buttonRef);
  5613. const ownerState = _extends$1({}, props, {
  5614. centerRipple,
  5615. component,
  5616. disabled,
  5617. disableRipple,
  5618. disableTouchRipple,
  5619. focusRipple,
  5620. tabIndex,
  5621. focusVisible
  5622. });
  5623. const classes = useUtilityClasses$5(ownerState);
  5624. return /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonBaseRoot, _extends$1({
  5625. as: ComponentProp,
  5626. className: clsx(classes.root, className),
  5627. ownerState,
  5628. onBlur: handleBlur,
  5629. onClick,
  5630. onContextMenu: handleContextMenu,
  5631. onFocus: handleFocus,
  5632. onKeyDown: handleKeyDown2,
  5633. onKeyUp: handleKeyUp,
  5634. onMouseDown: handleMouseDown,
  5635. onMouseLeave: handleMouseLeave,
  5636. onMouseUp: handleMouseUp,
  5637. onDragLeave: handleDragLeave,
  5638. onTouchEnd: handleTouchEnd,
  5639. onTouchMove: handleTouchMove,
  5640. onTouchStart: handleTouchStart,
  5641. ref: handleRef,
  5642. tabIndex: disabled ? -1 : tabIndex,
  5643. type
  5644. }, buttonProps, other, {
  5645. children: [children, enableTouchRipple ? (
  5646. /* TouchRipple is only needed client-side, x2 boost on the server. */
  5647. /* @__PURE__ */ jsxRuntimeExports.jsx(TouchRipple$1, _extends$1({
  5648. ref: handleRippleRef,
  5649. center: centerRipple
  5650. }, TouchRippleProps))
  5651. ) : null]
  5652. }));
  5653. });
  5654. const ButtonBase$1 = ButtonBase;
  5655. function getButtonUtilityClass(slot) {
  5656. return generateUtilityClass("MuiButton", slot);
  5657. }
  5658. const buttonClasses = generateUtilityClasses("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]);
  5659. const buttonClasses$1 = buttonClasses;
  5660. const ButtonGroupContext = /* @__PURE__ */ React__namespace.createContext({});
  5661. const ButtonGroupContext$1 = ButtonGroupContext;
  5662. const ButtonGroupButtonContext = /* @__PURE__ */ React__namespace.createContext(void 0);
  5663. const ButtonGroupButtonContext$1 = ButtonGroupButtonContext;
  5664. const _excluded$8 = ["children", "color", "component", "className", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"];
  5665. const useUtilityClasses$4 = (ownerState) => {
  5666. const {
  5667. color: color2,
  5668. disableElevation,
  5669. fullWidth,
  5670. size,
  5671. variant,
  5672. classes
  5673. } = ownerState;
  5674. const slots = {
  5675. root: ["root", variant, `${variant}${capitalize$1(color2)}`, `size${capitalize$1(size)}`, `${variant}Size${capitalize$1(size)}`, `color${capitalize$1(color2)}`, disableElevation && "disableElevation", fullWidth && "fullWidth"],
  5676. label: ["label"],
  5677. startIcon: ["icon", "startIcon", `iconSize${capitalize$1(size)}`],
  5678. endIcon: ["icon", "endIcon", `iconSize${capitalize$1(size)}`]
  5679. };
  5680. const composedClasses = composeClasses(slots, getButtonUtilityClass, classes);
  5681. return _extends$1({}, classes, composedClasses);
  5682. };
  5683. const commonIconStyles = (ownerState) => _extends$1({}, ownerState.size === "small" && {
  5684. "& > *:nth-of-type(1)": {
  5685. fontSize: 18
  5686. }
  5687. }, ownerState.size === "medium" && {
  5688. "& > *:nth-of-type(1)": {
  5689. fontSize: 20
  5690. }
  5691. }, ownerState.size === "large" && {
  5692. "& > *:nth-of-type(1)": {
  5693. fontSize: 22
  5694. }
  5695. });
  5696. const ButtonRoot = styled(ButtonBase$1, {
  5697. shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
  5698. name: "MuiButton",
  5699. slot: "Root",
  5700. overridesResolver: (props, styles2) => {
  5701. const {
  5702. ownerState
  5703. } = props;
  5704. return [styles2.root, styles2[ownerState.variant], styles2[`${ownerState.variant}${capitalize$1(ownerState.color)}`], styles2[`size${capitalize$1(ownerState.size)}`], styles2[`${ownerState.variant}Size${capitalize$1(ownerState.size)}`], ownerState.color === "inherit" && styles2.colorInherit, ownerState.disableElevation && styles2.disableElevation, ownerState.fullWidth && styles2.fullWidth];
  5705. }
  5706. })(({
  5707. theme,
  5708. ownerState
  5709. }) => {
  5710. var _theme$palette$getCon, _theme$palette;
  5711. const inheritContainedBackgroundColor = theme.palette.mode === "light" ? theme.palette.grey[300] : theme.palette.grey[800];
  5712. const inheritContainedHoverBackgroundColor = theme.palette.mode === "light" ? theme.palette.grey.A100 : theme.palette.grey[700];
  5713. return _extends$1({}, theme.typography.button, {
  5714. minWidth: 64,
  5715. padding: "6px 16px",
  5716. borderRadius: (theme.vars || theme).shape.borderRadius,
  5717. transition: theme.transitions.create(["background-color", "box-shadow", "border-color", "color"], {
  5718. duration: theme.transitions.duration.short
  5719. }),
  5720. "&:hover": _extends$1({
  5721. textDecoration: "none",
  5722. backgroundColor: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha_1(theme.palette.text.primary, theme.palette.action.hoverOpacity),
  5723. // Reset on touch devices, it doesn't add specificity
  5724. "@media (hover: none)": {
  5725. backgroundColor: "transparent"
  5726. }
  5727. }, ownerState.variant === "text" && ownerState.color !== "inherit" && {
  5728. backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha_1(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
  5729. // Reset on touch devices, it doesn't add specificity
  5730. "@media (hover: none)": {
  5731. backgroundColor: "transparent"
  5732. }
  5733. }, ownerState.variant === "outlined" && ownerState.color !== "inherit" && {
  5734. border: `1px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
  5735. backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha_1(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
  5736. // Reset on touch devices, it doesn't add specificity
  5737. "@media (hover: none)": {
  5738. backgroundColor: "transparent"
  5739. }
  5740. }, ownerState.variant === "contained" && {
  5741. backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,
  5742. boxShadow: (theme.vars || theme).shadows[4],
  5743. // Reset on touch devices, it doesn't add specificity
  5744. "@media (hover: none)": {
  5745. boxShadow: (theme.vars || theme).shadows[2],
  5746. backgroundColor: (theme.vars || theme).palette.grey[300]
  5747. }
  5748. }, ownerState.variant === "contained" && ownerState.color !== "inherit" && {
  5749. backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,
  5750. // Reset on touch devices, it doesn't add specificity
  5751. "@media (hover: none)": {
  5752. backgroundColor: (theme.vars || theme).palette[ownerState.color].main
  5753. }
  5754. }),
  5755. "&:active": _extends$1({}, ownerState.variant === "contained" && {
  5756. boxShadow: (theme.vars || theme).shadows[8]
  5757. }),
  5758. [`&.${buttonClasses$1.focusVisible}`]: _extends$1({}, ownerState.variant === "contained" && {
  5759. boxShadow: (theme.vars || theme).shadows[6]
  5760. }),
  5761. [`&.${buttonClasses$1.disabled}`]: _extends$1({
  5762. color: (theme.vars || theme).palette.action.disabled
  5763. }, ownerState.variant === "outlined" && {
  5764. border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
  5765. }, ownerState.variant === "contained" && {
  5766. color: (theme.vars || theme).palette.action.disabled,
  5767. boxShadow: (theme.vars || theme).shadows[0],
  5768. backgroundColor: (theme.vars || theme).palette.action.disabledBackground
  5769. })
  5770. }, ownerState.variant === "text" && {
  5771. padding: "6px 8px"
  5772. }, ownerState.variant === "text" && ownerState.color !== "inherit" && {
  5773. color: (theme.vars || theme).palette[ownerState.color].main
  5774. }, ownerState.variant === "outlined" && {
  5775. padding: "5px 15px",
  5776. border: "1px solid currentColor"
  5777. }, ownerState.variant === "outlined" && ownerState.color !== "inherit" && {
  5778. color: (theme.vars || theme).palette[ownerState.color].main,
  5779. border: theme.vars ? `1px solid rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : `1px solid ${alpha_1(theme.palette[ownerState.color].main, 0.5)}`
  5780. }, ownerState.variant === "contained" && {
  5781. color: theme.vars ? (
  5782. // this is safe because grey does not change between default light/dark mode
  5783. theme.vars.palette.text.primary
  5784. ) : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),
  5785. backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
  5786. boxShadow: (theme.vars || theme).shadows[2]
  5787. }, ownerState.variant === "contained" && ownerState.color !== "inherit" && {
  5788. color: (theme.vars || theme).palette[ownerState.color].contrastText,
  5789. backgroundColor: (theme.vars || theme).palette[ownerState.color].main
  5790. }, ownerState.color === "inherit" && {
  5791. color: "inherit",
  5792. borderColor: "currentColor"
  5793. }, ownerState.size === "small" && ownerState.variant === "text" && {
  5794. padding: "4px 5px",
  5795. fontSize: theme.typography.pxToRem(13)
  5796. }, ownerState.size === "large" && ownerState.variant === "text" && {
  5797. padding: "8px 11px",
  5798. fontSize: theme.typography.pxToRem(15)
  5799. }, ownerState.size === "small" && ownerState.variant === "outlined" && {
  5800. padding: "3px 9px",
  5801. fontSize: theme.typography.pxToRem(13)
  5802. }, ownerState.size === "large" && ownerState.variant === "outlined" && {
  5803. padding: "7px 21px",
  5804. fontSize: theme.typography.pxToRem(15)
  5805. }, ownerState.size === "small" && ownerState.variant === "contained" && {
  5806. padding: "4px 10px",
  5807. fontSize: theme.typography.pxToRem(13)
  5808. }, ownerState.size === "large" && ownerState.variant === "contained" && {
  5809. padding: "8px 22px",
  5810. fontSize: theme.typography.pxToRem(15)
  5811. }, ownerState.fullWidth && {
  5812. width: "100%"
  5813. });
  5814. }, ({
  5815. ownerState
  5816. }) => ownerState.disableElevation && {
  5817. boxShadow: "none",
  5818. "&:hover": {
  5819. boxShadow: "none"
  5820. },
  5821. [`&.${buttonClasses$1.focusVisible}`]: {
  5822. boxShadow: "none"
  5823. },
  5824. "&:active": {
  5825. boxShadow: "none"
  5826. },
  5827. [`&.${buttonClasses$1.disabled}`]: {
  5828. boxShadow: "none"
  5829. }
  5830. });
  5831. const ButtonStartIcon = styled("span", {
  5832. name: "MuiButton",
  5833. slot: "StartIcon",
  5834. overridesResolver: (props, styles2) => {
  5835. const {
  5836. ownerState
  5837. } = props;
  5838. return [styles2.startIcon, styles2[`iconSize${capitalize$1(ownerState.size)}`]];
  5839. }
  5840. })(({
  5841. ownerState
  5842. }) => _extends$1({
  5843. display: "inherit",
  5844. marginRight: 8,
  5845. marginLeft: -4
  5846. }, ownerState.size === "small" && {
  5847. marginLeft: -2
  5848. }, commonIconStyles(ownerState)));
  5849. const ButtonEndIcon = styled("span", {
  5850. name: "MuiButton",
  5851. slot: "EndIcon",
  5852. overridesResolver: (props, styles2) => {
  5853. const {
  5854. ownerState
  5855. } = props;
  5856. return [styles2.endIcon, styles2[`iconSize${capitalize$1(ownerState.size)}`]];
  5857. }
  5858. })(({
  5859. ownerState
  5860. }) => _extends$1({
  5861. display: "inherit",
  5862. marginRight: -4,
  5863. marginLeft: 8
  5864. }, ownerState.size === "small" && {
  5865. marginRight: -2
  5866. }, commonIconStyles(ownerState)));
  5867. const Button = /* @__PURE__ */ React__namespace.forwardRef(function Button2(inProps, ref) {
  5868. const contextProps = React__namespace.useContext(ButtonGroupContext$1);
  5869. const buttonGroupButtonContextPositionClassName = React__namespace.useContext(ButtonGroupButtonContext$1);
  5870. const resolvedProps = resolveProps(contextProps, inProps);
  5871. const props = useThemeProps({
  5872. props: resolvedProps,
  5873. name: "MuiButton"
  5874. });
  5875. const {
  5876. children,
  5877. color: color2 = "primary",
  5878. component = "button",
  5879. className,
  5880. disabled = false,
  5881. disableElevation = false,
  5882. disableFocusRipple = false,
  5883. endIcon: endIconProp,
  5884. focusVisibleClassName,
  5885. fullWidth = false,
  5886. size = "medium",
  5887. startIcon: startIconProp,
  5888. type,
  5889. variant = "text"
  5890. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$8);
  5891. const ownerState = _extends$1({}, props, {
  5892. color: color2,
  5893. component,
  5894. disabled,
  5895. disableElevation,
  5896. disableFocusRipple,
  5897. fullWidth,
  5898. size,
  5899. type,
  5900. variant
  5901. });
  5902. const classes = useUtilityClasses$4(ownerState);
  5903. const startIcon = startIconProp && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonStartIcon, {
  5904. className: classes.startIcon,
  5905. ownerState,
  5906. children: startIconProp
  5907. });
  5908. const endIcon = endIconProp && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonEndIcon, {
  5909. className: classes.endIcon,
  5910. ownerState,
  5911. children: endIconProp
  5912. });
  5913. const positionClassName = buttonGroupButtonContextPositionClassName || "";
  5914. return /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonRoot, _extends$1({
  5915. ownerState,
  5916. className: clsx(contextProps.className, classes.root, className, positionClassName),
  5917. component,
  5918. disabled,
  5919. focusRipple: !disableFocusRipple,
  5920. focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
  5921. ref,
  5922. type
  5923. }, other, {
  5924. classes,
  5925. children: [startIcon, children, endIcon]
  5926. }));
  5927. });
  5928. const Button$1 = Button;
  5929. function useTheme() {
  5930. const theme = useTheme$2(defaultTheme$1);
  5931. return theme[THEME_ID] || theme;
  5932. }
  5933. const _excluded$7 = ["theme"];
  5934. function ThemeProvider$1(_ref) {
  5935. let {
  5936. theme: themeInput
  5937. } = _ref, props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
  5938. const scopedTheme = themeInput[THEME_ID];
  5939. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider$2, _extends$1({}, props, {
  5940. themeId: scopedTheme ? THEME_ID : void 0,
  5941. theme: scopedTheme || themeInput
  5942. }));
  5943. }
  5944. const getOverlayAlpha = (elevation) => {
  5945. let alphaValue;
  5946. if (elevation < 1) {
  5947. alphaValue = 5.11916 * elevation ** 2;
  5948. } else {
  5949. alphaValue = 4.5 * Math.log(elevation + 1) + 2;
  5950. }
  5951. return (alphaValue / 100).toFixed(2);
  5952. };
  5953. const StyledPandoraButton = styled(Button$1, {
  5954. shouldForwardProp: (fieldName) => filterForwardProps(fieldName, ["openPandora", "buttonPosition"])
  5955. })(
  5956. ({ buttonPosition = "right", openPandora = false, theme }) => {
  5957. const { transitions } = theme;
  5958. const baseStyle = {
  5959. position: "fixed"
  5960. };
  5961. switch (buttonPosition) {
  5962. case "top":
  5963. return {
  5964. ...baseStyle,
  5965. left: "50%",
  5966. top: openPandora ? `calc(50% - ${uiConfig.pandoraDrawerWidth})` : 0,
  5967. transform: "translateX(-50%)"
  5968. };
  5969. case "right":
  5970. return {
  5971. ...baseStyle,
  5972. top: "50%",
  5973. right: 0,
  5974. transition: transitions.create(["right"], {
  5975. easing: transitions.easing.sharp,
  5976. duration: transitions.duration.shorter
  5977. }),
  5978. ...openPandora && {
  5979. right: uiConfig.pandoraDrawerWidth,
  5980. transition: transitions.create(["right"], {
  5981. easing: transitions.easing.sharp,
  5982. duration: transitions.duration.enteringScreen
  5983. })
  5984. }
  5985. };
  5986. case "bottom":
  5987. return {
  5988. ...baseStyle,
  5989. left: "50%",
  5990. bottom: openPandora ? `calc(50% - ${uiConfig.pandoraDrawerWidth})` : 0,
  5991. transform: "translateX(-50%)"
  5992. };
  5993. case "left":
  5994. return {
  5995. ...baseStyle,
  5996. top: "50%",
  5997. left: openPandora ? `calc(50% - ${uiConfig.pandoraDrawerWidth})` : 0,
  5998. transform: "translateY(-50%)"
  5999. };
  6000. default:
  6001. return {
  6002. ...baseStyle,
  6003. top: "50%",
  6004. right: openPandora ? `calc(50% - ${uiConfig.pandoraDrawerWidth})` : 0
  6005. };
  6006. }
  6007. }
  6008. );
  6009. function PandoraButton({ openPandora = false, pandoraButtonPosition = "right", ...restProps }) {
  6010. return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledPandoraButton, { variant: "contained", openPandora, buttonPosition: pandoraButtonPosition, ...restProps, children: openPandora ? "关闭助手" : "打开助手" });
  6011. }
  6012. function isHostComponent(element) {
  6013. return typeof element === "string";
  6014. }
  6015. function appendOwnerState(elementType, otherProps, ownerState) {
  6016. if (elementType === void 0 || isHostComponent(elementType)) {
  6017. return otherProps;
  6018. }
  6019. return _extends$1({}, otherProps, {
  6020. ownerState: _extends$1({}, otherProps.ownerState, ownerState)
  6021. });
  6022. }
  6023. function extractEventHandlers(object, excludeKeys = []) {
  6024. if (object === void 0) {
  6025. return {};
  6026. }
  6027. const result = {};
  6028. Object.keys(object).filter((prop) => prop.match(/^on[A-Z]/) && typeof object[prop] === "function" && !excludeKeys.includes(prop)).forEach((prop) => {
  6029. result[prop] = object[prop];
  6030. });
  6031. return result;
  6032. }
  6033. function resolveComponentProps(componentProps, ownerState, slotState) {
  6034. if (typeof componentProps === "function") {
  6035. return componentProps(ownerState, slotState);
  6036. }
  6037. return componentProps;
  6038. }
  6039. function omitEventHandlers(object) {
  6040. if (object === void 0) {
  6041. return {};
  6042. }
  6043. const result = {};
  6044. Object.keys(object).filter((prop) => !(prop.match(/^on[A-Z]/) && typeof object[prop] === "function")).forEach((prop) => {
  6045. result[prop] = object[prop];
  6046. });
  6047. return result;
  6048. }
  6049. function mergeSlotProps(parameters) {
  6050. const {
  6051. getSlotProps,
  6052. additionalProps,
  6053. externalSlotProps,
  6054. externalForwardedProps,
  6055. className
  6056. } = parameters;
  6057. if (!getSlotProps) {
  6058. const joinedClasses2 = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
  6059. const mergedStyle2 = _extends$1({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
  6060. const props2 = _extends$1({}, additionalProps, externalForwardedProps, externalSlotProps);
  6061. if (joinedClasses2.length > 0) {
  6062. props2.className = joinedClasses2;
  6063. }
  6064. if (Object.keys(mergedStyle2).length > 0) {
  6065. props2.style = mergedStyle2;
  6066. }
  6067. return {
  6068. props: props2,
  6069. internalRef: void 0
  6070. };
  6071. }
  6072. const eventHandlers = extractEventHandlers(_extends$1({}, externalForwardedProps, externalSlotProps));
  6073. const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
  6074. const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
  6075. const internalSlotProps = getSlotProps(eventHandlers);
  6076. const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
  6077. const mergedStyle = _extends$1({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
  6078. const props = _extends$1({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);
  6079. if (joinedClasses.length > 0) {
  6080. props.className = joinedClasses;
  6081. }
  6082. if (Object.keys(mergedStyle).length > 0) {
  6083. props.style = mergedStyle;
  6084. }
  6085. return {
  6086. props,
  6087. internalRef: internalSlotProps.ref
  6088. };
  6089. }
  6090. const _excluded$6 = ["elementType", "externalSlotProps", "ownerState", "skipResolvingSlotProps"];
  6091. function useSlotProps(parameters) {
  6092. var _parameters$additiona;
  6093. const {
  6094. elementType,
  6095. externalSlotProps,
  6096. ownerState,
  6097. skipResolvingSlotProps = false
  6098. } = parameters, rest = _objectWithoutPropertiesLoose(parameters, _excluded$6);
  6099. const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
  6100. const {
  6101. props: mergedProps,
  6102. internalRef
  6103. } = mergeSlotProps(_extends$1({}, rest, {
  6104. externalSlotProps: resolvedComponentsProps
  6105. }));
  6106. const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
  6107. const props = appendOwnerState(elementType, _extends$1({}, mergedProps, {
  6108. ref
  6109. }), ownerState);
  6110. return props;
  6111. }
  6112. function isOverflowing(container) {
  6113. const doc = ownerDocument(container);
  6114. if (doc.body === container) {
  6115. return ownerWindow(container).innerWidth > doc.documentElement.clientWidth;
  6116. }
  6117. return container.scrollHeight > container.clientHeight;
  6118. }
  6119. function ariaHidden(element, show) {
  6120. if (show) {
  6121. element.setAttribute("aria-hidden", "true");
  6122. } else {
  6123. element.removeAttribute("aria-hidden");
  6124. }
  6125. }
  6126. function getPaddingRight(element) {
  6127. return parseInt(ownerWindow(element).getComputedStyle(element).paddingRight, 10) || 0;
  6128. }
  6129. function isAriaHiddenForbiddenOnElement(element) {
  6130. const forbiddenTagNames = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"];
  6131. const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;
  6132. const isInputHidden = element.tagName === "INPUT" && element.getAttribute("type") === "hidden";
  6133. return isForbiddenTagName || isInputHidden;
  6134. }
  6135. function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
  6136. const blacklist = [mountElement, currentElement, ...elementsToExclude];
  6137. [].forEach.call(container.children, (element) => {
  6138. const isNotExcludedElement = blacklist.indexOf(element) === -1;
  6139. const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
  6140. if (isNotExcludedElement && isNotForbiddenElement) {
  6141. ariaHidden(element, show);
  6142. }
  6143. });
  6144. }
  6145. function findIndexOf(items, callback) {
  6146. let idx = -1;
  6147. items.some((item, index) => {
  6148. if (callback(item)) {
  6149. idx = index;
  6150. return true;
  6151. }
  6152. return false;
  6153. });
  6154. return idx;
  6155. }
  6156. function handleContainer(containerInfo, props) {
  6157. const restoreStyle = [];
  6158. const container = containerInfo.container;
  6159. if (!props.disableScrollLock) {
  6160. if (isOverflowing(container)) {
  6161. const scrollbarSize = getScrollbarSize(ownerDocument(container));
  6162. restoreStyle.push({
  6163. value: container.style.paddingRight,
  6164. property: "padding-right",
  6165. el: container
  6166. });
  6167. container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;
  6168. const fixedElements2 = ownerDocument(container).querySelectorAll(".mui-fixed");
  6169. [].forEach.call(fixedElements2, (element) => {
  6170. restoreStyle.push({
  6171. value: element.style.paddingRight,
  6172. property: "padding-right",
  6173. el: element
  6174. });
  6175. element.style.paddingRight = `${getPaddingRight(element) + scrollbarSize}px`;
  6176. });
  6177. }
  6178. let scrollContainer;
  6179. if (container.parentNode instanceof DocumentFragment) {
  6180. scrollContainer = ownerDocument(container).body;
  6181. } else {
  6182. const parent = container.parentElement;
  6183. const containerWindow = ownerWindow(container);
  6184. scrollContainer = (parent == null ? void 0 : parent.nodeName) === "HTML" && containerWindow.getComputedStyle(parent).overflowY === "scroll" ? parent : container;
  6185. }
  6186. restoreStyle.push({
  6187. value: scrollContainer.style.overflow,
  6188. property: "overflow",
  6189. el: scrollContainer
  6190. }, {
  6191. value: scrollContainer.style.overflowX,
  6192. property: "overflow-x",
  6193. el: scrollContainer
  6194. }, {
  6195. value: scrollContainer.style.overflowY,
  6196. property: "overflow-y",
  6197. el: scrollContainer
  6198. });
  6199. scrollContainer.style.overflow = "hidden";
  6200. }
  6201. const restore = () => {
  6202. restoreStyle.forEach(({
  6203. value,
  6204. el,
  6205. property
  6206. }) => {
  6207. if (value) {
  6208. el.style.setProperty(property, value);
  6209. } else {
  6210. el.style.removeProperty(property);
  6211. }
  6212. });
  6213. };
  6214. return restore;
  6215. }
  6216. function getHiddenSiblings(container) {
  6217. const hiddenSiblings = [];
  6218. [].forEach.call(container.children, (element) => {
  6219. if (element.getAttribute("aria-hidden") === "true") {
  6220. hiddenSiblings.push(element);
  6221. }
  6222. });
  6223. return hiddenSiblings;
  6224. }
  6225. class ModalManager {
  6226. constructor() {
  6227. this.containers = void 0;
  6228. this.modals = void 0;
  6229. this.modals = [];
  6230. this.containers = [];
  6231. }
  6232. add(modal, container) {
  6233. let modalIndex = this.modals.indexOf(modal);
  6234. if (modalIndex !== -1) {
  6235. return modalIndex;
  6236. }
  6237. modalIndex = this.modals.length;
  6238. this.modals.push(modal);
  6239. if (modal.modalRef) {
  6240. ariaHidden(modal.modalRef, false);
  6241. }
  6242. const hiddenSiblings = getHiddenSiblings(container);
  6243. ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, true);
  6244. const containerIndex = findIndexOf(this.containers, (item) => item.container === container);
  6245. if (containerIndex !== -1) {
  6246. this.containers[containerIndex].modals.push(modal);
  6247. return modalIndex;
  6248. }
  6249. this.containers.push({
  6250. modals: [modal],
  6251. container,
  6252. restore: null,
  6253. hiddenSiblings
  6254. });
  6255. return modalIndex;
  6256. }
  6257. mount(modal, props) {
  6258. const containerIndex = findIndexOf(this.containers, (item) => item.modals.indexOf(modal) !== -1);
  6259. const containerInfo = this.containers[containerIndex];
  6260. if (!containerInfo.restore) {
  6261. containerInfo.restore = handleContainer(containerInfo, props);
  6262. }
  6263. }
  6264. remove(modal, ariaHiddenState = true) {
  6265. const modalIndex = this.modals.indexOf(modal);
  6266. if (modalIndex === -1) {
  6267. return modalIndex;
  6268. }
  6269. const containerIndex = findIndexOf(this.containers, (item) => item.modals.indexOf(modal) !== -1);
  6270. const containerInfo = this.containers[containerIndex];
  6271. containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
  6272. this.modals.splice(modalIndex, 1);
  6273. if (containerInfo.modals.length === 0) {
  6274. if (containerInfo.restore) {
  6275. containerInfo.restore();
  6276. }
  6277. if (modal.modalRef) {
  6278. ariaHidden(modal.modalRef, ariaHiddenState);
  6279. }
  6280. ariaHiddenSiblings(containerInfo.container, modal.mount, modal.modalRef, containerInfo.hiddenSiblings, false);
  6281. this.containers.splice(containerIndex, 1);
  6282. } else {
  6283. const nextTop = containerInfo.modals[containerInfo.modals.length - 1];
  6284. if (nextTop.modalRef) {
  6285. ariaHidden(nextTop.modalRef, false);
  6286. }
  6287. }
  6288. return modalIndex;
  6289. }
  6290. isTopModal(modal) {
  6291. return this.modals.length > 0 && this.modals[this.modals.length - 1] === modal;
  6292. }
  6293. }
  6294. function getContainer$1(container) {
  6295. return typeof container === "function" ? container() : container;
  6296. }
  6297. function getHasTransition(children) {
  6298. return children ? children.props.hasOwnProperty("in") : false;
  6299. }
  6300. const defaultManager = new ModalManager();
  6301. function useModal(parameters) {
  6302. const {
  6303. container,
  6304. disableEscapeKeyDown = false,
  6305. disableScrollLock = false,
  6306. // @ts-ignore internal logic - Base UI supports the manager as a prop too
  6307. manager = defaultManager,
  6308. closeAfterTransition = false,
  6309. onTransitionEnter,
  6310. onTransitionExited,
  6311. children,
  6312. onClose,
  6313. open,
  6314. rootRef
  6315. } = parameters;
  6316. const modal = React__namespace.useRef({});
  6317. const mountNodeRef = React__namespace.useRef(null);
  6318. const modalRef = React__namespace.useRef(null);
  6319. const handleRef = useForkRef(modalRef, rootRef);
  6320. const [exited, setExited] = React__namespace.useState(!open);
  6321. const hasTransition = getHasTransition(children);
  6322. let ariaHiddenProp = true;
  6323. if (parameters["aria-hidden"] === "false" || parameters["aria-hidden"] === false) {
  6324. ariaHiddenProp = false;
  6325. }
  6326. const getDoc = () => ownerDocument(mountNodeRef.current);
  6327. const getModal = () => {
  6328. modal.current.modalRef = modalRef.current;
  6329. modal.current.mount = mountNodeRef.current;
  6330. return modal.current;
  6331. };
  6332. const handleMounted = () => {
  6333. manager.mount(getModal(), {
  6334. disableScrollLock
  6335. });
  6336. if (modalRef.current) {
  6337. modalRef.current.scrollTop = 0;
  6338. }
  6339. };
  6340. const handleOpen = useEventCallback(() => {
  6341. const resolvedContainer = getContainer$1(container) || getDoc().body;
  6342. manager.add(getModal(), resolvedContainer);
  6343. if (modalRef.current) {
  6344. handleMounted();
  6345. }
  6346. });
  6347. const isTopModal = React__namespace.useCallback(() => manager.isTopModal(getModal()), [manager]);
  6348. const handlePortalRef = useEventCallback((node2) => {
  6349. mountNodeRef.current = node2;
  6350. if (!node2) {
  6351. return;
  6352. }
  6353. if (open && isTopModal()) {
  6354. handleMounted();
  6355. } else if (modalRef.current) {
  6356. ariaHidden(modalRef.current, ariaHiddenProp);
  6357. }
  6358. });
  6359. const handleClose = React__namespace.useCallback(() => {
  6360. manager.remove(getModal(), ariaHiddenProp);
  6361. }, [ariaHiddenProp, manager]);
  6362. React__namespace.useEffect(() => {
  6363. return () => {
  6364. handleClose();
  6365. };
  6366. }, [handleClose]);
  6367. React__namespace.useEffect(() => {
  6368. if (open) {
  6369. handleOpen();
  6370. } else if (!hasTransition || !closeAfterTransition) {
  6371. handleClose();
  6372. }
  6373. }, [open, handleClose, hasTransition, closeAfterTransition, handleOpen]);
  6374. const createHandleKeyDown = (otherHandlers) => (event) => {
  6375. var _otherHandlers$onKeyD;
  6376. (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);
  6377. if (event.key !== "Escape" || event.which === 229 || // Wait until IME is settled.
  6378. !isTopModal()) {
  6379. return;
  6380. }
  6381. if (!disableEscapeKeyDown) {
  6382. event.stopPropagation();
  6383. if (onClose) {
  6384. onClose(event, "escapeKeyDown");
  6385. }
  6386. }
  6387. };
  6388. const createHandleBackdropClick = (otherHandlers) => (event) => {
  6389. var _otherHandlers$onClic;
  6390. (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);
  6391. if (event.target !== event.currentTarget) {
  6392. return;
  6393. }
  6394. if (onClose) {
  6395. onClose(event, "backdropClick");
  6396. }
  6397. };
  6398. const getRootProps = (otherHandlers = {}) => {
  6399. const propsEventHandlers = extractEventHandlers(parameters);
  6400. delete propsEventHandlers.onTransitionEnter;
  6401. delete propsEventHandlers.onTransitionExited;
  6402. const externalEventHandlers = _extends$1({}, propsEventHandlers, otherHandlers);
  6403. return _extends$1({
  6404. role: "presentation"
  6405. }, externalEventHandlers, {
  6406. onKeyDown: createHandleKeyDown(externalEventHandlers),
  6407. ref: handleRef
  6408. });
  6409. };
  6410. const getBackdropProps = (otherHandlers = {}) => {
  6411. const externalEventHandlers = otherHandlers;
  6412. return _extends$1({
  6413. "aria-hidden": true
  6414. }, externalEventHandlers, {
  6415. onClick: createHandleBackdropClick(externalEventHandlers),
  6416. open
  6417. });
  6418. };
  6419. const getTransitionProps2 = () => {
  6420. const handleEnter = () => {
  6421. setExited(false);
  6422. if (onTransitionEnter) {
  6423. onTransitionEnter();
  6424. }
  6425. };
  6426. const handleExited = () => {
  6427. setExited(true);
  6428. if (onTransitionExited) {
  6429. onTransitionExited();
  6430. }
  6431. if (closeAfterTransition) {
  6432. handleClose();
  6433. }
  6434. };
  6435. return {
  6436. onEnter: createChainedFunction(handleEnter, children == null ? void 0 : children.props.onEnter),
  6437. onExited: createChainedFunction(handleExited, children == null ? void 0 : children.props.onExited)
  6438. };
  6439. };
  6440. return {
  6441. getRootProps,
  6442. getBackdropProps,
  6443. getTransitionProps: getTransitionProps2,
  6444. rootRef: handleRef,
  6445. portalRef: handlePortalRef,
  6446. isTopModal,
  6447. exited,
  6448. hasTransition
  6449. };
  6450. }
  6451. const candidatesSelector = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
  6452. function getTabIndex(node2) {
  6453. const tabindexAttr = parseInt(node2.getAttribute("tabindex") || "", 10);
  6454. if (!Number.isNaN(tabindexAttr)) {
  6455. return tabindexAttr;
  6456. }
  6457. if (node2.contentEditable === "true" || (node2.nodeName === "AUDIO" || node2.nodeName === "VIDEO" || node2.nodeName === "DETAILS") && node2.getAttribute("tabindex") === null) {
  6458. return 0;
  6459. }
  6460. return node2.tabIndex;
  6461. }
  6462. function isNonTabbableRadio(node2) {
  6463. if (node2.tagName !== "INPUT" || node2.type !== "radio") {
  6464. return false;
  6465. }
  6466. if (!node2.name) {
  6467. return false;
  6468. }
  6469. const getRadio = (selector) => node2.ownerDocument.querySelector(`input[type="radio"]${selector}`);
  6470. let roving = getRadio(`[name="${node2.name}"]:checked`);
  6471. if (!roving) {
  6472. roving = getRadio(`[name="${node2.name}"]`);
  6473. }
  6474. return roving !== node2;
  6475. }
  6476. function isNodeMatchingSelectorFocusable(node2) {
  6477. if (node2.disabled || node2.tagName === "INPUT" && node2.type === "hidden" || isNonTabbableRadio(node2)) {
  6478. return false;
  6479. }
  6480. return true;
  6481. }
  6482. function defaultGetTabbable(root) {
  6483. const regularTabNodes = [];
  6484. const orderedTabNodes = [];
  6485. Array.from(root.querySelectorAll(candidatesSelector)).forEach((node2, i) => {
  6486. const nodeTabIndex = getTabIndex(node2);
  6487. if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node2)) {
  6488. return;
  6489. }
  6490. if (nodeTabIndex === 0) {
  6491. regularTabNodes.push(node2);
  6492. } else {
  6493. orderedTabNodes.push({
  6494. documentOrder: i,
  6495. tabIndex: nodeTabIndex,
  6496. node: node2
  6497. });
  6498. }
  6499. });
  6500. return orderedTabNodes.sort((a, b2) => a.tabIndex === b2.tabIndex ? a.documentOrder - b2.documentOrder : a.tabIndex - b2.tabIndex).map((a) => a.node).concat(regularTabNodes);
  6501. }
  6502. function defaultIsEnabled() {
  6503. return true;
  6504. }
  6505. function FocusTrap(props) {
  6506. const {
  6507. children,
  6508. disableAutoFocus = false,
  6509. disableEnforceFocus = false,
  6510. disableRestoreFocus = false,
  6511. getTabbable = defaultGetTabbable,
  6512. isEnabled = defaultIsEnabled,
  6513. open
  6514. } = props;
  6515. const ignoreNextEnforceFocus = React__namespace.useRef(false);
  6516. const sentinelStart = React__namespace.useRef(null);
  6517. const sentinelEnd = React__namespace.useRef(null);
  6518. const nodeToRestore = React__namespace.useRef(null);
  6519. const reactFocusEventTarget = React__namespace.useRef(null);
  6520. const activated = React__namespace.useRef(false);
  6521. const rootRef = React__namespace.useRef(null);
  6522. const handleRef = useForkRef(children.ref, rootRef);
  6523. const lastKeydown = React__namespace.useRef(null);
  6524. React__namespace.useEffect(() => {
  6525. if (!open || !rootRef.current) {
  6526. return;
  6527. }
  6528. activated.current = !disableAutoFocus;
  6529. }, [disableAutoFocus, open]);
  6530. React__namespace.useEffect(() => {
  6531. if (!open || !rootRef.current) {
  6532. return;
  6533. }
  6534. const doc = ownerDocument(rootRef.current);
  6535. if (!rootRef.current.contains(doc.activeElement)) {
  6536. if (!rootRef.current.hasAttribute("tabIndex")) {
  6537. rootRef.current.setAttribute("tabIndex", "-1");
  6538. }
  6539. if (activated.current) {
  6540. rootRef.current.focus();
  6541. }
  6542. }
  6543. return () => {
  6544. if (!disableRestoreFocus) {
  6545. if (nodeToRestore.current && nodeToRestore.current.focus) {
  6546. ignoreNextEnforceFocus.current = true;
  6547. nodeToRestore.current.focus();
  6548. }
  6549. nodeToRestore.current = null;
  6550. }
  6551. };
  6552. }, [open]);
  6553. React__namespace.useEffect(() => {
  6554. if (!open || !rootRef.current) {
  6555. return;
  6556. }
  6557. const doc = ownerDocument(rootRef.current);
  6558. const loopFocus = (nativeEvent) => {
  6559. lastKeydown.current = nativeEvent;
  6560. if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== "Tab") {
  6561. return;
  6562. }
  6563. if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
  6564. ignoreNextEnforceFocus.current = true;
  6565. if (sentinelEnd.current) {
  6566. sentinelEnd.current.focus();
  6567. }
  6568. }
  6569. };
  6570. const contain = () => {
  6571. const rootElement = rootRef.current;
  6572. if (rootElement === null) {
  6573. return;
  6574. }
  6575. if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
  6576. ignoreNextEnforceFocus.current = false;
  6577. return;
  6578. }
  6579. if (rootElement.contains(doc.activeElement)) {
  6580. return;
  6581. }
  6582. if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {
  6583. return;
  6584. }
  6585. if (doc.activeElement !== reactFocusEventTarget.current) {
  6586. reactFocusEventTarget.current = null;
  6587. } else if (reactFocusEventTarget.current !== null) {
  6588. return;
  6589. }
  6590. if (!activated.current) {
  6591. return;
  6592. }
  6593. let tabbable = [];
  6594. if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
  6595. tabbable = getTabbable(rootRef.current);
  6596. }
  6597. if (tabbable.length > 0) {
  6598. var _lastKeydown$current, _lastKeydown$current2;
  6599. const isShiftTab = Boolean(((_lastKeydown$current = lastKeydown.current) == null ? void 0 : _lastKeydown$current.shiftKey) && ((_lastKeydown$current2 = lastKeydown.current) == null ? void 0 : _lastKeydown$current2.key) === "Tab");
  6600. const focusNext = tabbable[0];
  6601. const focusPrevious = tabbable[tabbable.length - 1];
  6602. if (typeof focusNext !== "string" && typeof focusPrevious !== "string") {
  6603. if (isShiftTab) {
  6604. focusPrevious.focus();
  6605. } else {
  6606. focusNext.focus();
  6607. }
  6608. }
  6609. } else {
  6610. rootElement.focus();
  6611. }
  6612. };
  6613. doc.addEventListener("focusin", contain);
  6614. doc.addEventListener("keydown", loopFocus, true);
  6615. const interval = setInterval(() => {
  6616. if (doc.activeElement && doc.activeElement.tagName === "BODY") {
  6617. contain();
  6618. }
  6619. }, 50);
  6620. return () => {
  6621. clearInterval(interval);
  6622. doc.removeEventListener("focusin", contain);
  6623. doc.removeEventListener("keydown", loopFocus, true);
  6624. };
  6625. }, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open, getTabbable]);
  6626. const onFocus = (event) => {
  6627. if (nodeToRestore.current === null) {
  6628. nodeToRestore.current = event.relatedTarget;
  6629. }
  6630. activated.current = true;
  6631. reactFocusEventTarget.current = event.target;
  6632. const childrenPropsHandler = children.props.onFocus;
  6633. if (childrenPropsHandler) {
  6634. childrenPropsHandler(event);
  6635. }
  6636. };
  6637. const handleFocusSentinel = (event) => {
  6638. if (nodeToRestore.current === null) {
  6639. nodeToRestore.current = event.relatedTarget;
  6640. }
  6641. activated.current = true;
  6642. };
  6643. return /* @__PURE__ */ jsxRuntimeExports.jsxs(React__namespace.Fragment, {
  6644. children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
  6645. tabIndex: open ? 0 : -1,
  6646. onFocus: handleFocusSentinel,
  6647. ref: sentinelStart,
  6648. "data-testid": "sentinelStart"
  6649. }), /* @__PURE__ */ React__namespace.cloneElement(children, {
  6650. ref: handleRef,
  6651. onFocus
  6652. }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
  6653. tabIndex: open ? 0 : -1,
  6654. onFocus: handleFocusSentinel,
  6655. ref: sentinelEnd,
  6656. "data-testid": "sentinelEnd"
  6657. })]
  6658. });
  6659. }
  6660. function getContainer(container) {
  6661. return typeof container === "function" ? container() : container;
  6662. }
  6663. const Portal = /* @__PURE__ */ React__namespace.forwardRef(function Portal2(props, forwardedRef) {
  6664. const {
  6665. children,
  6666. container,
  6667. disablePortal = false
  6668. } = props;
  6669. const [mountNode, setMountNode] = React__namespace.useState(null);
  6670. const handleRef = useForkRef(/* @__PURE__ */ React__namespace.isValidElement(children) ? children.ref : null, forwardedRef);
  6671. useEnhancedEffect(() => {
  6672. if (!disablePortal) {
  6673. setMountNode(getContainer(container) || document.body);
  6674. }
  6675. }, [container, disablePortal]);
  6676. useEnhancedEffect(() => {
  6677. if (mountNode && !disablePortal) {
  6678. setRef(forwardedRef, mountNode);
  6679. return () => {
  6680. setRef(forwardedRef, null);
  6681. };
  6682. }
  6683. return void 0;
  6684. }, [forwardedRef, mountNode, disablePortal]);
  6685. if (disablePortal) {
  6686. if (/* @__PURE__ */ React__namespace.isValidElement(children)) {
  6687. const newProps = {
  6688. ref: handleRef
  6689. };
  6690. return /* @__PURE__ */ React__namespace.cloneElement(children, newProps);
  6691. }
  6692. return /* @__PURE__ */ jsxRuntimeExports.jsx(React__namespace.Fragment, {
  6693. children
  6694. });
  6695. }
  6696. return /* @__PURE__ */ jsxRuntimeExports.jsx(React__namespace.Fragment, {
  6697. children: mountNode ? /* @__PURE__ */ ReactDOM__default__namespace.createPortal(children, mountNode) : mountNode
  6698. });
  6699. });
  6700. const reflow = (node2) => node2.scrollTop;
  6701. function getTransitionProps(props, options) {
  6702. var _style$transitionDura, _style$transitionTimi;
  6703. const {
  6704. timeout,
  6705. easing: easing2,
  6706. style: style2 = {}
  6707. } = props;
  6708. return {
  6709. duration: (_style$transitionDura = style2.transitionDuration) != null ? _style$transitionDura : typeof timeout === "number" ? timeout : timeout[options.mode] || 0,
  6710. easing: (_style$transitionTimi = style2.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing2 === "object" ? easing2[options.mode] : easing2,
  6711. delay: style2.transitionDelay
  6712. };
  6713. }
  6714. const _excluded$5 = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
  6715. const styles = {
  6716. entering: {
  6717. opacity: 1
  6718. },
  6719. entered: {
  6720. opacity: 1
  6721. }
  6722. };
  6723. const Fade = /* @__PURE__ */ React__namespace.forwardRef(function Fade2(props, ref) {
  6724. const theme = useTheme();
  6725. const defaultTimeout = {
  6726. enter: theme.transitions.duration.enteringScreen,
  6727. exit: theme.transitions.duration.leavingScreen
  6728. };
  6729. const {
  6730. addEndListener,
  6731. appear = true,
  6732. children,
  6733. easing: easing2,
  6734. in: inProp,
  6735. onEnter,
  6736. onEntered,
  6737. onEntering,
  6738. onExit,
  6739. onExited,
  6740. onExiting,
  6741. style: style2,
  6742. timeout = defaultTimeout,
  6743. // eslint-disable-next-line react/prop-types
  6744. TransitionComponent = Transition$1
  6745. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$5);
  6746. const nodeRef = React__namespace.useRef(null);
  6747. const handleRef = useForkRef(nodeRef, children.ref, ref);
  6748. const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
  6749. if (callback) {
  6750. const node2 = nodeRef.current;
  6751. if (maybeIsAppearing === void 0) {
  6752. callback(node2);
  6753. } else {
  6754. callback(node2, maybeIsAppearing);
  6755. }
  6756. }
  6757. };
  6758. const handleEntering = normalizedTransitionCallback(onEntering);
  6759. const handleEnter = normalizedTransitionCallback((node2, isAppearing) => {
  6760. reflow(node2);
  6761. const transitionProps = getTransitionProps({
  6762. style: style2,
  6763. timeout,
  6764. easing: easing2
  6765. }, {
  6766. mode: "enter"
  6767. });
  6768. node2.style.webkitTransition = theme.transitions.create("opacity", transitionProps);
  6769. node2.style.transition = theme.transitions.create("opacity", transitionProps);
  6770. if (onEnter) {
  6771. onEnter(node2, isAppearing);
  6772. }
  6773. });
  6774. const handleEntered = normalizedTransitionCallback(onEntered);
  6775. const handleExiting = normalizedTransitionCallback(onExiting);
  6776. const handleExit = normalizedTransitionCallback((node2) => {
  6777. const transitionProps = getTransitionProps({
  6778. style: style2,
  6779. timeout,
  6780. easing: easing2
  6781. }, {
  6782. mode: "exit"
  6783. });
  6784. node2.style.webkitTransition = theme.transitions.create("opacity", transitionProps);
  6785. node2.style.transition = theme.transitions.create("opacity", transitionProps);
  6786. if (onExit) {
  6787. onExit(node2);
  6788. }
  6789. });
  6790. const handleExited = normalizedTransitionCallback(onExited);
  6791. const handleAddEndListener = (next2) => {
  6792. if (addEndListener) {
  6793. addEndListener(nodeRef.current, next2);
  6794. }
  6795. };
  6796. return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  6797. appear,
  6798. in: inProp,
  6799. nodeRef,
  6800. onEnter: handleEnter,
  6801. onEntered: handleEntered,
  6802. onEntering: handleEntering,
  6803. onExit: handleExit,
  6804. onExited: handleExited,
  6805. onExiting: handleExiting,
  6806. addEndListener: handleAddEndListener,
  6807. timeout
  6808. }, other, {
  6809. children: (state, childProps) => {
  6810. return /* @__PURE__ */ React__namespace.cloneElement(children, _extends$1({
  6811. style: _extends$1({
  6812. opacity: 0,
  6813. visibility: state === "exited" && !inProp ? "hidden" : void 0
  6814. }, styles[state], style2, children.props.style),
  6815. ref: handleRef
  6816. }, childProps));
  6817. }
  6818. }));
  6819. });
  6820. const Fade$1 = Fade;
  6821. function getBackdropUtilityClass(slot) {
  6822. return generateUtilityClass("MuiBackdrop", slot);
  6823. }
  6824. generateUtilityClasses("MuiBackdrop", ["root", "invisible"]);
  6825. const _excluded$4 = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
  6826. const useUtilityClasses$3 = (ownerState) => {
  6827. const {
  6828. classes,
  6829. invisible
  6830. } = ownerState;
  6831. const slots = {
  6832. root: ["root", invisible && "invisible"]
  6833. };
  6834. return composeClasses(slots, getBackdropUtilityClass, classes);
  6835. };
  6836. const BackdropRoot = styled("div", {
  6837. name: "MuiBackdrop",
  6838. slot: "Root",
  6839. overridesResolver: (props, styles2) => {
  6840. const {
  6841. ownerState
  6842. } = props;
  6843. return [styles2.root, ownerState.invisible && styles2.invisible];
  6844. }
  6845. })(({
  6846. ownerState
  6847. }) => _extends$1({
  6848. position: "fixed",
  6849. display: "flex",
  6850. alignItems: "center",
  6851. justifyContent: "center",
  6852. right: 0,
  6853. bottom: 0,
  6854. top: 0,
  6855. left: 0,
  6856. backgroundColor: "rgba(0, 0, 0, 0.5)",
  6857. WebkitTapHighlightColor: "transparent"
  6858. }, ownerState.invisible && {
  6859. backgroundColor: "transparent"
  6860. }));
  6861. const Backdrop = /* @__PURE__ */ React__namespace.forwardRef(function Backdrop2(inProps, ref) {
  6862. var _slotProps$root, _ref, _slots$root;
  6863. const props = useThemeProps({
  6864. props: inProps,
  6865. name: "MuiBackdrop"
  6866. });
  6867. const {
  6868. children,
  6869. className,
  6870. component = "div",
  6871. components = {},
  6872. componentsProps = {},
  6873. invisible = false,
  6874. open,
  6875. slotProps = {},
  6876. slots = {},
  6877. TransitionComponent = Fade$1,
  6878. transitionDuration
  6879. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$4);
  6880. const ownerState = _extends$1({}, props, {
  6881. component,
  6882. invisible
  6883. });
  6884. const classes = useUtilityClasses$3(ownerState);
  6885. const rootSlotProps = (_slotProps$root = slotProps.root) != null ? _slotProps$root : componentsProps.root;
  6886. return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  6887. in: open,
  6888. timeout: transitionDuration
  6889. }, other, {
  6890. children: /* @__PURE__ */ jsxRuntimeExports.jsx(BackdropRoot, _extends$1({
  6891. "aria-hidden": true
  6892. }, rootSlotProps, {
  6893. as: (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : component,
  6894. className: clsx(classes.root, className, rootSlotProps == null ? void 0 : rootSlotProps.className),
  6895. ownerState: _extends$1({}, ownerState, rootSlotProps == null ? void 0 : rootSlotProps.ownerState),
  6896. classes,
  6897. ref,
  6898. children
  6899. }))
  6900. }));
  6901. });
  6902. const Backdrop$1 = Backdrop;
  6903. function getModalUtilityClass(slot) {
  6904. return generateUtilityClass("MuiModal", slot);
  6905. }
  6906. generateUtilityClasses("MuiModal", ["root", "hidden", "backdrop"]);
  6907. const _excluded$3 = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "onTransitionEnter", "onTransitionExited", "open", "slotProps", "slots", "theme"];
  6908. const useUtilityClasses$2 = (ownerState) => {
  6909. const {
  6910. open,
  6911. exited,
  6912. classes
  6913. } = ownerState;
  6914. const slots = {
  6915. root: ["root", !open && exited && "hidden"],
  6916. backdrop: ["backdrop"]
  6917. };
  6918. return composeClasses(slots, getModalUtilityClass, classes);
  6919. };
  6920. const ModalRoot = styled("div", {
  6921. name: "MuiModal",
  6922. slot: "Root",
  6923. overridesResolver: (props, styles2) => {
  6924. const {
  6925. ownerState
  6926. } = props;
  6927. return [styles2.root, !ownerState.open && ownerState.exited && styles2.hidden];
  6928. }
  6929. })(({
  6930. theme,
  6931. ownerState
  6932. }) => _extends$1({
  6933. position: "fixed",
  6934. zIndex: (theme.vars || theme).zIndex.modal,
  6935. right: 0,
  6936. bottom: 0,
  6937. top: 0,
  6938. left: 0
  6939. }, !ownerState.open && ownerState.exited && {
  6940. visibility: "hidden"
  6941. }));
  6942. const ModalBackdrop = styled(Backdrop$1, {
  6943. name: "MuiModal",
  6944. slot: "Backdrop",
  6945. overridesResolver: (props, styles2) => {
  6946. return styles2.backdrop;
  6947. }
  6948. })({
  6949. zIndex: -1
  6950. });
  6951. const Modal = /* @__PURE__ */ React__namespace.forwardRef(function Modal2(inProps, ref) {
  6952. var _ref, _slots$root, _ref2, _slots$backdrop, _slotProps$root, _slotProps$backdrop;
  6953. const props = useThemeProps({
  6954. name: "MuiModal",
  6955. props: inProps
  6956. });
  6957. const {
  6958. BackdropComponent = ModalBackdrop,
  6959. BackdropProps,
  6960. className,
  6961. closeAfterTransition = false,
  6962. children,
  6963. container,
  6964. component,
  6965. components = {},
  6966. componentsProps = {},
  6967. disableAutoFocus = false,
  6968. disableEnforceFocus = false,
  6969. disableEscapeKeyDown = false,
  6970. disablePortal = false,
  6971. disableRestoreFocus = false,
  6972. disableScrollLock = false,
  6973. hideBackdrop = false,
  6974. keepMounted = false,
  6975. onBackdropClick,
  6976. open,
  6977. slotProps,
  6978. slots
  6979. // eslint-disable-next-line react/prop-types
  6980. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$3);
  6981. const propsWithDefaults = _extends$1({}, props, {
  6982. closeAfterTransition,
  6983. disableAutoFocus,
  6984. disableEnforceFocus,
  6985. disableEscapeKeyDown,
  6986. disablePortal,
  6987. disableRestoreFocus,
  6988. disableScrollLock,
  6989. hideBackdrop,
  6990. keepMounted
  6991. });
  6992. const {
  6993. getRootProps,
  6994. getBackdropProps,
  6995. getTransitionProps: getTransitionProps2,
  6996. portalRef,
  6997. isTopModal,
  6998. exited,
  6999. hasTransition
  7000. } = useModal(_extends$1({}, propsWithDefaults, {
  7001. rootRef: ref
  7002. }));
  7003. const ownerState = _extends$1({}, propsWithDefaults, {
  7004. exited
  7005. });
  7006. const classes = useUtilityClasses$2(ownerState);
  7007. const childProps = {};
  7008. if (children.props.tabIndex === void 0) {
  7009. childProps.tabIndex = "-1";
  7010. }
  7011. if (hasTransition) {
  7012. const {
  7013. onEnter,
  7014. onExited
  7015. } = getTransitionProps2();
  7016. childProps.onEnter = onEnter;
  7017. childProps.onExited = onExited;
  7018. }
  7019. const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
  7020. const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
  7021. const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
  7022. const backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
  7023. const rootProps = useSlotProps({
  7024. elementType: RootSlot,
  7025. externalSlotProps: rootSlotProps,
  7026. externalForwardedProps: other,
  7027. getSlotProps: getRootProps,
  7028. additionalProps: {
  7029. ref,
  7030. as: component
  7031. },
  7032. ownerState,
  7033. className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
  7034. });
  7035. const backdropProps = useSlotProps({
  7036. elementType: BackdropSlot,
  7037. externalSlotProps: backdropSlotProps,
  7038. additionalProps: BackdropProps,
  7039. getSlotProps: (otherHandlers) => {
  7040. return getBackdropProps(_extends$1({}, otherHandlers, {
  7041. onClick: (e2) => {
  7042. if (onBackdropClick) {
  7043. onBackdropClick(e2);
  7044. }
  7045. if (otherHandlers != null && otherHandlers.onClick) {
  7046. otherHandlers.onClick(e2);
  7047. }
  7048. }
  7049. }));
  7050. },
  7051. className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop),
  7052. ownerState
  7053. });
  7054. if (!keepMounted && !open && (!hasTransition || exited)) {
  7055. return null;
  7056. }
  7057. return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, {
  7058. ref: portalRef,
  7059. container,
  7060. disablePortal,
  7061. children: /* @__PURE__ */ jsxRuntimeExports.jsxs(RootSlot, _extends$1({}, rootProps, {
  7062. children: [!hideBackdrop && BackdropComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(BackdropSlot, _extends$1({}, backdropProps)) : null, /* @__PURE__ */ jsxRuntimeExports.jsx(FocusTrap, {
  7063. disableEnforceFocus,
  7064. disableAutoFocus,
  7065. disableRestoreFocus,
  7066. isEnabled: isTopModal,
  7067. open,
  7068. children: /* @__PURE__ */ React__namespace.cloneElement(children, childProps)
  7069. })]
  7070. }))
  7071. });
  7072. });
  7073. const Modal$1 = Modal;
  7074. const _excluded$2 = ["addEndListener", "appear", "children", "container", "direction", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
  7075. function getTranslateValue(direction, node2, resolvedContainer) {
  7076. const rect = node2.getBoundingClientRect();
  7077. const containerRect = resolvedContainer && resolvedContainer.getBoundingClientRect();
  7078. const containerWindow = ownerWindow(node2);
  7079. let transform;
  7080. if (node2.fakeTransform) {
  7081. transform = node2.fakeTransform;
  7082. } else {
  7083. const computedStyle = containerWindow.getComputedStyle(node2);
  7084. transform = computedStyle.getPropertyValue("-webkit-transform") || computedStyle.getPropertyValue("transform");
  7085. }
  7086. let offsetX = 0;
  7087. let offsetY = 0;
  7088. if (transform && transform !== "none" && typeof transform === "string") {
  7089. const transformValues = transform.split("(")[1].split(")")[0].split(",");
  7090. offsetX = parseInt(transformValues[4], 10);
  7091. offsetY = parseInt(transformValues[5], 10);
  7092. }
  7093. if (direction === "left") {
  7094. if (containerRect) {
  7095. return `translateX(${containerRect.right + offsetX - rect.left}px)`;
  7096. }
  7097. return `translateX(${containerWindow.innerWidth + offsetX - rect.left}px)`;
  7098. }
  7099. if (direction === "right") {
  7100. if (containerRect) {
  7101. return `translateX(-${rect.right - containerRect.left - offsetX}px)`;
  7102. }
  7103. return `translateX(-${rect.left + rect.width - offsetX}px)`;
  7104. }
  7105. if (direction === "up") {
  7106. if (containerRect) {
  7107. return `translateY(${containerRect.bottom + offsetY - rect.top}px)`;
  7108. }
  7109. return `translateY(${containerWindow.innerHeight + offsetY - rect.top}px)`;
  7110. }
  7111. if (containerRect) {
  7112. return `translateY(-${rect.top - containerRect.top + rect.height - offsetY}px)`;
  7113. }
  7114. return `translateY(-${rect.top + rect.height - offsetY}px)`;
  7115. }
  7116. function resolveContainer(containerPropProp) {
  7117. return typeof containerPropProp === "function" ? containerPropProp() : containerPropProp;
  7118. }
  7119. function setTranslateValue(direction, node2, containerProp) {
  7120. const resolvedContainer = resolveContainer(containerProp);
  7121. const transform = getTranslateValue(direction, node2, resolvedContainer);
  7122. if (transform) {
  7123. node2.style.webkitTransform = transform;
  7124. node2.style.transform = transform;
  7125. }
  7126. }
  7127. const Slide = /* @__PURE__ */ React__namespace.forwardRef(function Slide2(props, ref) {
  7128. const theme = useTheme();
  7129. const defaultEasing = {
  7130. enter: theme.transitions.easing.easeOut,
  7131. exit: theme.transitions.easing.sharp
  7132. };
  7133. const defaultTimeout = {
  7134. enter: theme.transitions.duration.enteringScreen,
  7135. exit: theme.transitions.duration.leavingScreen
  7136. };
  7137. const {
  7138. addEndListener,
  7139. appear = true,
  7140. children,
  7141. container: containerProp,
  7142. direction = "down",
  7143. easing: easingProp = defaultEasing,
  7144. in: inProp,
  7145. onEnter,
  7146. onEntered,
  7147. onEntering,
  7148. onExit,
  7149. onExited,
  7150. onExiting,
  7151. style: style2,
  7152. timeout = defaultTimeout,
  7153. // eslint-disable-next-line react/prop-types
  7154. TransitionComponent = Transition$1
  7155. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$2);
  7156. const childrenRef = React__namespace.useRef(null);
  7157. const handleRef = useForkRef(children.ref, childrenRef, ref);
  7158. const normalizedTransitionCallback = (callback) => (isAppearing) => {
  7159. if (callback) {
  7160. if (isAppearing === void 0) {
  7161. callback(childrenRef.current);
  7162. } else {
  7163. callback(childrenRef.current, isAppearing);
  7164. }
  7165. }
  7166. };
  7167. const handleEnter = normalizedTransitionCallback((node2, isAppearing) => {
  7168. setTranslateValue(direction, node2, containerProp);
  7169. reflow(node2);
  7170. if (onEnter) {
  7171. onEnter(node2, isAppearing);
  7172. }
  7173. });
  7174. const handleEntering = normalizedTransitionCallback((node2, isAppearing) => {
  7175. const transitionProps = getTransitionProps({
  7176. timeout,
  7177. style: style2,
  7178. easing: easingProp
  7179. }, {
  7180. mode: "enter"
  7181. });
  7182. node2.style.webkitTransition = theme.transitions.create("-webkit-transform", _extends$1({}, transitionProps));
  7183. node2.style.transition = theme.transitions.create("transform", _extends$1({}, transitionProps));
  7184. node2.style.webkitTransform = "none";
  7185. node2.style.transform = "none";
  7186. if (onEntering) {
  7187. onEntering(node2, isAppearing);
  7188. }
  7189. });
  7190. const handleEntered = normalizedTransitionCallback(onEntered);
  7191. const handleExiting = normalizedTransitionCallback(onExiting);
  7192. const handleExit = normalizedTransitionCallback((node2) => {
  7193. const transitionProps = getTransitionProps({
  7194. timeout,
  7195. style: style2,
  7196. easing: easingProp
  7197. }, {
  7198. mode: "exit"
  7199. });
  7200. node2.style.webkitTransition = theme.transitions.create("-webkit-transform", transitionProps);
  7201. node2.style.transition = theme.transitions.create("transform", transitionProps);
  7202. setTranslateValue(direction, node2, containerProp);
  7203. if (onExit) {
  7204. onExit(node2);
  7205. }
  7206. });
  7207. const handleExited = normalizedTransitionCallback((node2) => {
  7208. node2.style.webkitTransition = "";
  7209. node2.style.transition = "";
  7210. if (onExited) {
  7211. onExited(node2);
  7212. }
  7213. });
  7214. const handleAddEndListener = (next2) => {
  7215. if (addEndListener) {
  7216. addEndListener(childrenRef.current, next2);
  7217. }
  7218. };
  7219. const updatePosition = React__namespace.useCallback(() => {
  7220. if (childrenRef.current) {
  7221. setTranslateValue(direction, childrenRef.current, containerProp);
  7222. }
  7223. }, [direction, containerProp]);
  7224. React__namespace.useEffect(() => {
  7225. if (inProp || direction === "down" || direction === "right") {
  7226. return void 0;
  7227. }
  7228. const handleResize = debounce(() => {
  7229. if (childrenRef.current) {
  7230. setTranslateValue(direction, childrenRef.current, containerProp);
  7231. }
  7232. });
  7233. const containerWindow = ownerWindow(childrenRef.current);
  7234. containerWindow.addEventListener("resize", handleResize);
  7235. return () => {
  7236. handleResize.clear();
  7237. containerWindow.removeEventListener("resize", handleResize);
  7238. };
  7239. }, [direction, inProp, containerProp]);
  7240. React__namespace.useEffect(() => {
  7241. if (!inProp) {
  7242. updatePosition();
  7243. }
  7244. }, [inProp, updatePosition]);
  7245. return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  7246. nodeRef: childrenRef,
  7247. onEnter: handleEnter,
  7248. onEntered: handleEntered,
  7249. onEntering: handleEntering,
  7250. onExit: handleExit,
  7251. onExited: handleExited,
  7252. onExiting: handleExiting,
  7253. addEndListener: handleAddEndListener,
  7254. appear,
  7255. in: inProp,
  7256. timeout
  7257. }, other, {
  7258. children: (state, childProps) => {
  7259. return /* @__PURE__ */ React__namespace.cloneElement(children, _extends$1({
  7260. ref: handleRef,
  7261. style: _extends$1({
  7262. visibility: state === "exited" && !inProp ? "hidden" : void 0
  7263. }, style2, children.props.style)
  7264. }, childProps));
  7265. }
  7266. }));
  7267. });
  7268. const Slide$1 = Slide;
  7269. function getPaperUtilityClass(slot) {
  7270. return generateUtilityClass("MuiPaper", slot);
  7271. }
  7272. generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
  7273. const _excluded$1 = ["className", "component", "elevation", "square", "variant"];
  7274. const useUtilityClasses$1 = (ownerState) => {
  7275. const {
  7276. square,
  7277. elevation,
  7278. variant,
  7279. classes
  7280. } = ownerState;
  7281. const slots = {
  7282. root: ["root", variant, !square && "rounded", variant === "elevation" && `elevation${elevation}`]
  7283. };
  7284. return composeClasses(slots, getPaperUtilityClass, classes);
  7285. };
  7286. const PaperRoot = styled("div", {
  7287. name: "MuiPaper",
  7288. slot: "Root",
  7289. overridesResolver: (props, styles2) => {
  7290. const {
  7291. ownerState
  7292. } = props;
  7293. return [styles2.root, styles2[ownerState.variant], !ownerState.square && styles2.rounded, ownerState.variant === "elevation" && styles2[`elevation${ownerState.elevation}`]];
  7294. }
  7295. })(({
  7296. theme,
  7297. ownerState
  7298. }) => {
  7299. var _theme$vars$overlays;
  7300. return _extends$1({
  7301. backgroundColor: (theme.vars || theme).palette.background.paper,
  7302. color: (theme.vars || theme).palette.text.primary,
  7303. transition: theme.transitions.create("box-shadow")
  7304. }, !ownerState.square && {
  7305. borderRadius: theme.shape.borderRadius
  7306. }, ownerState.variant === "outlined" && {
  7307. border: `1px solid ${(theme.vars || theme).palette.divider}`
  7308. }, ownerState.variant === "elevation" && _extends$1({
  7309. boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
  7310. }, !theme.vars && theme.palette.mode === "dark" && {
  7311. backgroundImage: `linear-gradient(${alpha_1("#fff", getOverlayAlpha(ownerState.elevation))}, ${alpha_1("#fff", getOverlayAlpha(ownerState.elevation))})`
  7312. }, theme.vars && {
  7313. backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]
  7314. }));
  7315. });
  7316. const Paper = /* @__PURE__ */ React__namespace.forwardRef(function Paper2(inProps, ref) {
  7317. const props = useThemeProps({
  7318. props: inProps,
  7319. name: "MuiPaper"
  7320. });
  7321. const {
  7322. className,
  7323. component = "div",
  7324. elevation = 1,
  7325. square = false,
  7326. variant = "elevation"
  7327. } = props, other = _objectWithoutPropertiesLoose(props, _excluded$1);
  7328. const ownerState = _extends$1({}, props, {
  7329. component,
  7330. elevation,
  7331. square,
  7332. variant
  7333. });
  7334. const classes = useUtilityClasses$1(ownerState);
  7335. return /* @__PURE__ */ jsxRuntimeExports.jsx(PaperRoot, _extends$1({
  7336. as: component,
  7337. ownerState,
  7338. className: clsx(classes.root, className),
  7339. ref
  7340. }, other));
  7341. });
  7342. const Paper$1 = Paper;
  7343. function getDrawerUtilityClass(slot) {
  7344. return generateUtilityClass("MuiDrawer", slot);
  7345. }
  7346. const drawerClasses = generateUtilityClasses("MuiDrawer", ["root", "docked", "paper", "paperAnchorLeft", "paperAnchorRight", "paperAnchorTop", "paperAnchorBottom", "paperAnchorDockedLeft", "paperAnchorDockedRight", "paperAnchorDockedTop", "paperAnchorDockedBottom", "modal"]);
  7347. const drawerClasses$1 = drawerClasses;
  7348. const _excluded = ["BackdropProps"], _excluded2 = ["anchor", "BackdropProps", "children", "className", "elevation", "hideBackdrop", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"];
  7349. const overridesResolver = (props, styles2) => {
  7350. const {
  7351. ownerState
  7352. } = props;
  7353. return [styles2.root, (ownerState.variant === "permanent" || ownerState.variant === "persistent") && styles2.docked, styles2.modal];
  7354. };
  7355. const useUtilityClasses = (ownerState) => {
  7356. const {
  7357. classes,
  7358. anchor,
  7359. variant
  7360. } = ownerState;
  7361. const slots = {
  7362. root: ["root"],
  7363. docked: [(variant === "permanent" || variant === "persistent") && "docked"],
  7364. modal: ["modal"],
  7365. paper: ["paper", `paperAnchor${capitalize$1(anchor)}`, variant !== "temporary" && `paperAnchorDocked${capitalize$1(anchor)}`]
  7366. };
  7367. return composeClasses(slots, getDrawerUtilityClass, classes);
  7368. };
  7369. const DrawerRoot = styled(Modal$1, {
  7370. name: "MuiDrawer",
  7371. slot: "Root",
  7372. overridesResolver
  7373. })(({
  7374. theme
  7375. }) => ({
  7376. zIndex: (theme.vars || theme).zIndex.drawer
  7377. }));
  7378. const DrawerDockedRoot = styled("div", {
  7379. shouldForwardProp: rootShouldForwardProp,
  7380. name: "MuiDrawer",
  7381. slot: "Docked",
  7382. skipVariantsResolver: false,
  7383. overridesResolver
  7384. })({
  7385. flex: "0 0 auto"
  7386. });
  7387. const DrawerPaper = styled(Paper$1, {
  7388. name: "MuiDrawer",
  7389. slot: "Paper",
  7390. overridesResolver: (props, styles2) => {
  7391. const {
  7392. ownerState
  7393. } = props;
  7394. return [styles2.paper, styles2[`paperAnchor${capitalize$1(ownerState.anchor)}`], ownerState.variant !== "temporary" && styles2[`paperAnchorDocked${capitalize$1(ownerState.anchor)}`]];
  7395. }
  7396. })(({
  7397. theme,
  7398. ownerState
  7399. }) => _extends$1({
  7400. overflowY: "auto",
  7401. display: "flex",
  7402. flexDirection: "column",
  7403. height: "100%",
  7404. flex: "1 0 auto",
  7405. zIndex: (theme.vars || theme).zIndex.drawer,
  7406. // Add iOS momentum scrolling for iOS < 13.0
  7407. WebkitOverflowScrolling: "touch",
  7408. // temporary style
  7409. position: "fixed",
  7410. top: 0,
  7411. // We disable the focus ring for mouse, touch and keyboard users.
  7412. // At some point, it would be better to keep it for keyboard users.
  7413. // :focus-ring CSS pseudo-class will help.
  7414. outline: 0
  7415. }, ownerState.anchor === "left" && {
  7416. left: 0
  7417. }, ownerState.anchor === "top" && {
  7418. top: 0,
  7419. left: 0,
  7420. right: 0,
  7421. height: "auto",
  7422. maxHeight: "100%"
  7423. }, ownerState.anchor === "right" && {
  7424. right: 0
  7425. }, ownerState.anchor === "bottom" && {
  7426. top: "auto",
  7427. left: 0,
  7428. bottom: 0,
  7429. right: 0,
  7430. height: "auto",
  7431. maxHeight: "100%"
  7432. }, ownerState.anchor === "left" && ownerState.variant !== "temporary" && {
  7433. borderRight: `1px solid ${(theme.vars || theme).palette.divider}`
  7434. }, ownerState.anchor === "top" && ownerState.variant !== "temporary" && {
  7435. borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
  7436. }, ownerState.anchor === "right" && ownerState.variant !== "temporary" && {
  7437. borderLeft: `1px solid ${(theme.vars || theme).palette.divider}`
  7438. }, ownerState.anchor === "bottom" && ownerState.variant !== "temporary" && {
  7439. borderTop: `1px solid ${(theme.vars || theme).palette.divider}`
  7440. }));
  7441. const oppositeDirection = {
  7442. left: "right",
  7443. right: "left",
  7444. top: "down",
  7445. bottom: "up"
  7446. };
  7447. function isHorizontal(anchor) {
  7448. return ["left", "right"].indexOf(anchor) !== -1;
  7449. }
  7450. function getAnchor(theme, anchor) {
  7451. return theme.direction === "rtl" && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
  7452. }
  7453. const Drawer = /* @__PURE__ */ React__namespace.forwardRef(function Drawer2(inProps, ref) {
  7454. const props = useThemeProps({
  7455. props: inProps,
  7456. name: "MuiDrawer"
  7457. });
  7458. const theme = useTheme();
  7459. const defaultTransitionDuration = {
  7460. enter: theme.transitions.duration.enteringScreen,
  7461. exit: theme.transitions.duration.leavingScreen
  7462. };
  7463. const {
  7464. anchor: anchorProp = "left",
  7465. BackdropProps,
  7466. children,
  7467. className,
  7468. elevation = 16,
  7469. hideBackdrop = false,
  7470. ModalProps: {
  7471. BackdropProps: BackdropPropsProp
  7472. } = {},
  7473. onClose,
  7474. open = false,
  7475. PaperProps = {},
  7476. SlideProps,
  7477. // eslint-disable-next-line react/prop-types
  7478. TransitionComponent = Slide$1,
  7479. transitionDuration = defaultTransitionDuration,
  7480. variant = "temporary"
  7481. } = props, ModalProps = _objectWithoutPropertiesLoose(props.ModalProps, _excluded), other = _objectWithoutPropertiesLoose(props, _excluded2);
  7482. const mounted = React__namespace.useRef(false);
  7483. React__namespace.useEffect(() => {
  7484. mounted.current = true;
  7485. }, []);
  7486. const anchorInvariant = getAnchor(theme, anchorProp);
  7487. const anchor = anchorProp;
  7488. const ownerState = _extends$1({}, props, {
  7489. anchor,
  7490. elevation,
  7491. open,
  7492. variant
  7493. }, other);
  7494. const classes = useUtilityClasses(ownerState);
  7495. const drawer = /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerPaper, _extends$1({
  7496. elevation: variant === "temporary" ? elevation : 0,
  7497. square: true
  7498. }, PaperProps, {
  7499. className: clsx(classes.paper, PaperProps.className),
  7500. ownerState,
  7501. children
  7502. }));
  7503. if (variant === "permanent") {
  7504. return /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerDockedRoot, _extends$1({
  7505. className: clsx(classes.root, classes.docked, className),
  7506. ownerState,
  7507. ref
  7508. }, other, {
  7509. children: drawer
  7510. }));
  7511. }
  7512. const slidingDrawer = /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, _extends$1({
  7513. in: open,
  7514. direction: oppositeDirection[anchorInvariant],
  7515. timeout: transitionDuration,
  7516. appear: mounted.current
  7517. }, SlideProps, {
  7518. children: drawer
  7519. }));
  7520. if (variant === "persistent") {
  7521. return /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerDockedRoot, _extends$1({
  7522. className: clsx(classes.root, classes.docked, className),
  7523. ownerState,
  7524. ref
  7525. }, other, {
  7526. children: slidingDrawer
  7527. }));
  7528. }
  7529. return /* @__PURE__ */ jsxRuntimeExports.jsx(DrawerRoot, _extends$1({
  7530. BackdropProps: _extends$1({}, BackdropProps, BackdropPropsProp, {
  7531. transitionDuration
  7532. }),
  7533. className: clsx(classes.root, classes.modal, className),
  7534. open,
  7535. ownerState,
  7536. onClose,
  7537. hideBackdrop,
  7538. ref
  7539. }, other, ModalProps, {
  7540. children: slidingDrawer
  7541. }));
  7542. });
  7543. const Drawer$1 = Drawer;
  7544. const StyledPandoraDrawer = styled(Drawer$1, {
  7545. shouldForwardProp: (fieldName) => filterForwardProps(fieldName, ["openPandora", "drawerPosition"])
  7546. })(
  7547. ({ drawerPosition = "right", openPandora = false, theme }) => {
  7548. const { breakpoints, transitions } = theme;
  7549. const matches = useMediaQuery(breakpoints.up("sm"));
  7550. const drawerSize = matches ? uiConfig.pandoraDrawerMaxHeight : uiConfig.pandoraDrawerMinHeight;
  7551. const drawerSizeGap = `${50 - parseInt(drawerSize.replace("%", ""), 10) / 2}%`;
  7552. switch (drawerPosition) {
  7553. case "top":
  7554. return {
  7555. [`& .${drawerClasses$1.paper}`]: {
  7556. height: uiConfig.pandoraDrawerWidth,
  7557. width: `${drawerSize}`,
  7558. left: drawerSizeGap
  7559. }
  7560. };
  7561. case "right":
  7562. return {
  7563. [`& .${drawerClasses$1.paper}`]: {
  7564. width: 0,
  7565. height: `${drawerSize}`,
  7566. top: drawerSizeGap,
  7567. transition: transitions.create(["width"], {
  7568. easing: transitions.easing.sharp,
  7569. duration: transitions.duration.shorter
  7570. }),
  7571. ...openPandora && {
  7572. width: uiConfig.pandoraDrawerWidth,
  7573. transition: transitions.create(["width"], {
  7574. easing: transitions.easing.sharp,
  7575. duration: transitions.duration.enteringScreen
  7576. })
  7577. }
  7578. }
  7579. };
  7580. case "bottom":
  7581. return {
  7582. [`& .${drawerClasses$1.paper}`]: {
  7583. height: uiConfig.pandoraDrawerWidth,
  7584. width: `${drawerSize}`,
  7585. left: drawerSizeGap
  7586. }
  7587. };
  7588. case "left":
  7589. return {
  7590. [`& .${drawerClasses$1.paper}`]: {
  7591. width: uiConfig.pandoraDrawerWidth,
  7592. height: `${drawerSize}`,
  7593. top: drawerSizeGap
  7594. }
  7595. };
  7596. default:
  7597. return {
  7598. [`& .${drawerClasses$1.paper}`]: {
  7599. width: uiConfig.pandoraDrawerWidth,
  7600. height: `${drawerSize}`,
  7601. top: drawerSizeGap
  7602. }
  7603. };
  7604. }
  7605. }
  7606. );
  7607. function PandoraDrawer({
  7608. openDrawer = false,
  7609. handleCloseDrawer = void 0,
  7610. drawerPosition = "right",
  7611. ...restProps
  7612. }) {
  7613. const theme = useTheme();
  7614. useMediaQuery(theme.breakpoints.up("sm"));
  7615. const drawerVariant = drawerPosition === "left" || drawerPosition === "right" ? "permanent" : "persistent";
  7616. console.log(openDrawer);
  7617. return /* @__PURE__ */ jsxRuntimeExports.jsx(
  7618. StyledPandoraDrawer,
  7619. {
  7620. anchor: drawerPosition,
  7621. variant: drawerVariant,
  7622. open: openDrawer,
  7623. onClose: () => handleCloseDrawer && handleCloseDrawer(),
  7624. ModalProps: {
  7625. keepMounted: true
  7626. },
  7627. openPandora: openDrawer,
  7628. drawerPosition,
  7629. children: "abcdefg"
  7630. }
  7631. );
  7632. }
  7633. function ThemeProvider({ children, ...restProps }) {
  7634. const theme = createTheme({});
  7635. return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider$1, { theme, children });
  7636. }
  7637. function App() {
  7638. const [openPandora, setOpenPandora] = React.useState(false);
  7639. const toggleOpenPandora = () => {
  7640. setOpenPandora((prevState) => !prevState);
  7641. };
  7642. const handleClosePandora = () => {
  7643. setOpenPandora(false);
  7644. };
  7645. return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.pandoraButton, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ThemeProvider, { children: [
  7646. /* @__PURE__ */ jsxRuntimeExports.jsx(PandoraButton, { openPandora, onClick: () => toggleOpenPandora() }),
  7647. /* @__PURE__ */ jsxRuntimeExports.jsx(PandoraDrawer, { openDrawer: openPandora, handleCloseDrawer: handleClosePandora })
  7648. ] }) });
  7649. }
  7650. const appendLinuxDoNext = () => {
  7651. const app = document.createElement("div");
  7652. app.setAttribute("id", styles$1.pluginContainer);
  7653. document.body.append(app);
  7654. return app;
  7655. };
  7656. client.createRoot(appendLinuxDoNext()).render(
  7657. /* @__PURE__ */ jsxRuntimeExports.jsx(React.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) })
  7658. );
  7659.  
  7660. })(React, ReactDOM);