React is a JavaScript library for building user interfaces.
+
+
React is a JavaScript library for building user interfaces.
+
+
+
Shadow 1
+
+
Shadow 2
+
@@ -53,7 +104,16 @@
-
React is a JavaScript library for building user interfaces.
+
+ React Server Components (or RSC) is a new application architecture
+ designed by the React team.
+
+
@@ -86,7 +146,10 @@
-
React is a JavaScript library for building user interfaces.
+
+ We’ve first shared our research on RSC in an introductory talk and an
+ RFC.
+
@@ -119,7 +182,17 @@
-
React is a JavaScript library for building user interfaces.
+
+ To recap them, we are introducing a new kind of component—Server
+ Components—that run ahead of time and are excluded from your JavaScript
+ bundle.
+
+
@@ -153,175 +226,42 @@
-
React is a JavaScript library for building user interfaces.
-
-
- Declarative: React makes it painless to create interactive UIs.
- Design simple views for each state in your application, and React
- will efficiently update and render just the right components when
- your data changes. Declarative views make your code more
- predictable, simpler to understand, and easier to debug.
-
-
- Component-Based: Build encapsulated components that manage their own
- state, then compose them to make complex UIs. Since component logic
- is written in JavaScript instead of templates, you can easily pass
- rich data through your app and keep the state out of the DOM.
-
React is a JavaScript library for building user interfaces.
-
-
- Declarative: React makes it painless to create interactive UIs.
- Design simple views for each state in your application, and React
- will efficiently update and render just the right components when
- your data changes. Declarative views make your code more
- predictable, simpler to understand, and easier to debug.
-
-
- Component-Based: Build encapsulated components that manage their own
- state, then compose them to make complex UIs. Since component logic
- is written in JavaScript instead of templates, you can easily pass
- rich data through your app and keep the state out of the DOM.
-
React is a JavaScript library for building user interfaces.
-
-
- Declarative: React makes it painless to create interactive UIs.
- Design simple views for each state in your application, and React
- will efficiently update and render just the right components when
- your data changes. Declarative views make your code more
- predictable, simpler to understand, and easier to debug.
-
-
- Component-Based: Build encapsulated components that manage their own
- state, then compose them to make complex UIs. Since component logic
- is written in JavaScript instead of templates, you can easily pass
- rich data through your app and keep the state out of the DOM.
-
- React is a JavaScriptlibrary for
- building user interfaces.
+ Server Components can run during the build, letting you read from the
+ filesystem or fetch static content.
- Declarative: React makes it painless to create interactive UIs.
- Design simple views for each state in your application, and React
- will efficiently update and render just the right components when
- your data changes. Declarative views make your code more
- predictable, simpler to understand, and easier to debug.
-
-
- Component-Based: Build encapsulated components that manage their own
- state, then compose them to make complex UIs. Since component logic
- is written in JavaScript instead of templates, you can easily pass
- rich data through your app and keep the state out of the DOM.
-
-
- React 使创建交互式 UI
- 变得轻而易举。为你应用的每一个状态设计简洁的视图,当数据变动时 React
- 能高效更新并渲染合适的组件。
+ They can also run on the server, letting you access your data layer
+ without having to build an API. You can pass data by props from
+ Server Components to the interactive Client Components in the
+ browser.
以声明式编写 UI,可以让你的代码更加可靠,且方便调试。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
React is a JavaScript library for building user interfaces.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Since our last update, we have merged the React Server Components RFC
+ to ratify the proposal.
+
- Declarative: React makes it painless to create interactive UIs.
- Design simple views for each state in your application, and React
- will efficiently update and render just the right components when
- your data changes. Declarative views make your code more
- predictable, simpler to understand, and easier to debug.
-
-
- Component-Based: Build encapsulated components that manage their own
- state, then compose them to make complex UIs. Since component logic
- is written in JavaScript instead of templates, you can easily pass
- rich data through your app and keep the state out of the DOM.
+ RSC combines the simple “request/response” mental model of
+ server-centric Multi-Page Apps with the seamless interactivity of
+ client-centric Single-Page Apps, giving you the best of both worlds.
React 使创建交互式 UI
diff --git a/kiss-translator-rules.json b/kiss-translator-rules.json
index 00113f6..8a538a6 100644
--- a/kiss-translator-rules.json
+++ b/kiss-translator-rules.json
@@ -10,7 +10,7 @@
"bgColor": ""
},
{
- "pattern": "https://news.google.com/",
+ "pattern": "news.google.com",
"selector": "h4",
"translator": "*",
"fromLang": "*",
@@ -19,6 +19,16 @@
"transOpen": "true",
"bgColor": ""
},
+ {
+ "pattern": "www.foxnews.com",
+ "selector": "h1, h2, .title, .sidebar [data-type=\"Title\"], .article-content :is(li, p, h1, h2, h3, h4, h5, h6, dd); [data-spotim-module=\"conversation\"]>div >>> [data-spot-im-class=\"message-text\"] p, [data-spot-im-class=\"message-text\"]",
+ "translator": "*",
+ "fromLang": "*",
+ "toLang": "*",
+ "textStyle": "*",
+ "transOpen": "true",
+ "bgColor": ""
+ },
{
"pattern": "bearblog.dev, www.theverge.com, www.tampermonkey.net/documentation.php",
"selector": ":is(li, p, h1, h2, h3, h4, h5, h6, dd)",
diff --git a/kiss-translator.user.js b/kiss-translator.user.js
index 8075898..3bffea5 100644
--- a/kiss-translator.user.js
+++ b/kiss-translator.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @name KISS Translator
// @namespace https://github.com/fishjar/kiss-translator
-// @version 1.5.4
+// @version 1.5.5
// @description A minimalist bilingual translation Extension & Greasemonkey Script (一个简约的双语网页翻译扩展 & 油猴脚本)
// @author Gabe
// @homepageURL https://github.com/fishjar/kiss-translator
@@ -2821,8 +2821,8 @@ var useControlled = __webpack_require__(4951);
var useEventCallback = __webpack_require__(3236);
// EXTERNAL MODULE: ./node_modules/@mui/material/utils/useForkRef.js
var useForkRef = __webpack_require__(6983);
-// EXTERNAL MODULE: ./node_modules/@mui/material/utils/useIsFocusVisible.js + 1 modules
-var useIsFocusVisible = __webpack_require__(9127);
+// EXTERNAL MODULE: ./node_modules/@mui/material/utils/useIsFocusVisible.js
+var useIsFocusVisible = __webpack_require__(7037);
;// CONCATENATED MODULE: ./node_modules/@mui/material/utils/index.js
'use client';
@@ -2996,183 +2996,15 @@ function useControlled(_ref) {
/***/ }),
-/***/ 9127:
+/***/ 7037:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
-
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, {
- Z: function() { return /* binding */ utils_useIsFocusVisible; }
-});
-
-// EXTERNAL MODULE: ./node_modules/react/index.js
-var react = __webpack_require__(7313);
-;// CONCATENATED MODULE: ./node_modules/@mui/utils/esm/useIsFocusVisible.js
-'use client';
-
-// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
-
-var hadKeyboardEvent = true;
-var hadFocusVisibleRecently = false;
-var hadFocusVisibleRecentlyTimeout;
-var inputTypesWhitelist = {
- text: true,
- search: true,
- url: true,
- tel: true,
- email: true,
- password: true,
- number: true,
- date: true,
- month: true,
- week: true,
- time: true,
- datetime: true,
- 'datetime-local': true
-};
-
-/**
- * Computes whether the given element should automatically trigger the
- * `focus-visible` class being added, i.e. whether it should always match
- * `:focus-visible` when focused.
- * @param {Element} node
- * @returns {boolean}
- */
-function focusTriggersKeyboardModality(node) {
- var type = node.type,
- tagName = node.tagName;
- if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
- return true;
- }
- if (tagName === 'TEXTAREA' && !node.readOnly) {
- return true;
- }
- if (node.isContentEditable) {
- return true;
- }
- return false;
-}
-
-/**
- * Keep track of our keyboard modality state with `hadKeyboardEvent`.
- * If the most recent user interaction was via the keyboard;
- * and the key press did not include a meta, alt/option, or control key;
- * then the modality is keyboard. Otherwise, the modality is not keyboard.
- * @param {KeyboardEvent} event
- */
-function handleKeyDown(event) {
- if (event.metaKey || event.altKey || event.ctrlKey) {
- return;
- }
- hadKeyboardEvent = true;
-}
-
-/**
- * If at any point a user clicks with a pointing device, ensure that we change
- * the modality away from keyboard.
- * This avoids the situation where a user presses a key on an already focused
- * element, and then clicks on a different element, focusing it with a
- * pointing device, while we still think we're in keyboard modality.
- */
-function handlePointerDown() {
- hadKeyboardEvent = false;
-}
-function handleVisibilityChange() {
- if (this.visibilityState === 'hidden') {
- // If the tab becomes active again, the browser will handle calling focus
- // on the element (Safari actually calls it twice).
- // If this tab change caused a blur on an element with focus-visible,
- // re-apply the class when the user switches back to the tab.
- if (hadFocusVisibleRecently) {
- hadKeyboardEvent = true;
- }
- }
-}
-function prepare(doc) {
- doc.addEventListener('keydown', handleKeyDown, true);
- doc.addEventListener('mousedown', handlePointerDown, true);
- doc.addEventListener('pointerdown', handlePointerDown, true);
- doc.addEventListener('touchstart', handlePointerDown, true);
- doc.addEventListener('visibilitychange', handleVisibilityChange, true);
-}
-function teardown(doc) {
- doc.removeEventListener('keydown', handleKeyDown, true);
- doc.removeEventListener('mousedown', handlePointerDown, true);
- doc.removeEventListener('pointerdown', handlePointerDown, true);
- doc.removeEventListener('touchstart', handlePointerDown, true);
- doc.removeEventListener('visibilitychange', handleVisibilityChange, true);
-}
-function isFocusVisible(event) {
- var target = event.target;
- try {
- return target.matches(':focus-visible');
- } catch (error) {
- // Browsers not implementing :focus-visible will throw a SyntaxError.
- // We use our own heuristic for those browsers.
- // Rethrow might be better if it's not the expected error but do we really
- // want to crash if focus-visible malfunctioned?
- }
-
- // No need for validFocusTarget check. The user does that by attaching it to
- // focusable events only.
- return hadKeyboardEvent || focusTriggersKeyboardModality(target);
-}
-function useIsFocusVisible() {
- var ref = react.useCallback(function (node) {
- if (node != null) {
- prepare(node.ownerDocument);
- }
- }, []);
- var isFocusVisibleRef = react.useRef(false);
-
- /**
- * Should be called if a blur event is fired
- */
- function handleBlurVisible() {
- // checking against potential state variable does not suffice if we focus and blur synchronously.
- // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
- // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
- // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
- // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
- if (isFocusVisibleRef.current) {
- // To detect a tab/window switch, we look for a blur event followed
- // rapidly by a visibility change.
- // If we don't see a visibility change within 100ms, it's probably a
- // regular focus change.
- hadFocusVisibleRecently = true;
- window.clearTimeout(hadFocusVisibleRecentlyTimeout);
- hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
- hadFocusVisibleRecently = false;
- }, 100);
- isFocusVisibleRef.current = false;
- return true;
- }
- return false;
- }
-
- /**
- * Should be called if a blur event is fired
- */
- function handleFocusVisible(event) {
- if (isFocusVisible(event)) {
- isFocusVisibleRef.current = true;
- return true;
- }
- return false;
- }
- return {
- isFocusVisibleRef: isFocusVisibleRef,
- onFocus: handleFocusVisible,
- onBlur: handleBlurVisible,
- ref: ref
- };
-}
-;// CONCATENATED MODULE: ./node_modules/@mui/material/utils/useIsFocusVisible.js
+/* harmony import */ var _mui_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9578);
'use client';
-/* harmony default export */ var utils_useIsFocusVisible = (useIsFocusVisible);
+/* harmony default export */ __webpack_exports__.Z = (_mui_utils__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z);
/***/ }),
@@ -3186,12 +3018,14 @@ function useIsFocusVisible() {
/* harmony export */ });
/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3320);
/**
- * @mui/styled-engine v5.13.2
+ * @mui/styled-engine v5.14.6
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
+'use client';
+
/* eslint-disable no-underscore-dangle */
function styled(tag, options) {
@@ -5626,11 +5460,12 @@ var globalStateClassesMapping = {
checked: 'checked',
completed: 'completed',
disabled: 'disabled',
- readOnly: 'readOnly',
error: 'error',
expanded: 'expanded',
focused: 'focused',
focusVisible: 'focusVisible',
+ open: 'open',
+ readOnly: 'readOnly',
required: 'required',
selected: 'selected'
};
@@ -5903,6 +5738,177 @@ function useId(idOverride) {
/***/ }),
+/***/ 9578:
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Z: function() { return /* binding */ useIsFocusVisible; }
+/* harmony export */ });
+/* unused harmony export teardown */
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7313);
+'use client';
+
+// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
+
+var hadKeyboardEvent = true;
+var hadFocusVisibleRecently = false;
+var hadFocusVisibleRecentlyTimeout;
+var inputTypesWhitelist = {
+ text: true,
+ search: true,
+ url: true,
+ tel: true,
+ email: true,
+ password: true,
+ number: true,
+ date: true,
+ month: true,
+ week: true,
+ time: true,
+ datetime: true,
+ 'datetime-local': true
+};
+
+/**
+ * Computes whether the given element should automatically trigger the
+ * `focus-visible` class being added, i.e. whether it should always match
+ * `:focus-visible` when focused.
+ * @param {Element} node
+ * @returns {boolean}
+ */
+function focusTriggersKeyboardModality(node) {
+ var type = node.type,
+ tagName = node.tagName;
+ if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
+ return true;
+ }
+ if (tagName === 'TEXTAREA' && !node.readOnly) {
+ return true;
+ }
+ if (node.isContentEditable) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Keep track of our keyboard modality state with `hadKeyboardEvent`.
+ * If the most recent user interaction was via the keyboard;
+ * and the key press did not include a meta, alt/option, or control key;
+ * then the modality is keyboard. Otherwise, the modality is not keyboard.
+ * @param {KeyboardEvent} event
+ */
+function handleKeyDown(event) {
+ if (event.metaKey || event.altKey || event.ctrlKey) {
+ return;
+ }
+ hadKeyboardEvent = true;
+}
+
+/**
+ * If at any point a user clicks with a pointing device, ensure that we change
+ * the modality away from keyboard.
+ * This avoids the situation where a user presses a key on an already focused
+ * element, and then clicks on a different element, focusing it with a
+ * pointing device, while we still think we're in keyboard modality.
+ */
+function handlePointerDown() {
+ hadKeyboardEvent = false;
+}
+function handleVisibilityChange() {
+ if (this.visibilityState === 'hidden') {
+ // If the tab becomes active again, the browser will handle calling focus
+ // on the element (Safari actually calls it twice).
+ // If this tab change caused a blur on an element with focus-visible,
+ // re-apply the class when the user switches back to the tab.
+ if (hadFocusVisibleRecently) {
+ hadKeyboardEvent = true;
+ }
+ }
+}
+function prepare(doc) {
+ doc.addEventListener('keydown', handleKeyDown, true);
+ doc.addEventListener('mousedown', handlePointerDown, true);
+ doc.addEventListener('pointerdown', handlePointerDown, true);
+ doc.addEventListener('touchstart', handlePointerDown, true);
+ doc.addEventListener('visibilitychange', handleVisibilityChange, true);
+}
+function teardown(doc) {
+ doc.removeEventListener('keydown', handleKeyDown, true);
+ doc.removeEventListener('mousedown', handlePointerDown, true);
+ doc.removeEventListener('pointerdown', handlePointerDown, true);
+ doc.removeEventListener('touchstart', handlePointerDown, true);
+ doc.removeEventListener('visibilitychange', handleVisibilityChange, true);
+}
+function isFocusVisible(event) {
+ var target = event.target;
+ try {
+ return target.matches(':focus-visible');
+ } catch (error) {
+ // Browsers not implementing :focus-visible will throw a SyntaxError.
+ // We use our own heuristic for those browsers.
+ // Rethrow might be better if it's not the expected error but do we really
+ // want to crash if focus-visible malfunctioned?
+ }
+
+ // No need for validFocusTarget check. The user does that by attaching it to
+ // focusable events only.
+ return hadKeyboardEvent || focusTriggersKeyboardModality(target);
+}
+function useIsFocusVisible() {
+ var ref = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (node) {
+ if (node != null) {
+ prepare(node.ownerDocument);
+ }
+ }, []);
+ var isFocusVisibleRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
+
+ /**
+ * Should be called if a blur event is fired
+ */
+ function handleBlurVisible() {
+ // checking against potential state variable does not suffice if we focus and blur synchronously.
+ // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
+ // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
+ // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
+ // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
+ if (isFocusVisibleRef.current) {
+ // To detect a tab/window switch, we look for a blur event followed
+ // rapidly by a visibility change.
+ // If we don't see a visibility change within 100ms, it's probably a
+ // regular focus change.
+ hadFocusVisibleRecently = true;
+ window.clearTimeout(hadFocusVisibleRecentlyTimeout);
+ hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
+ hadFocusVisibleRecently = false;
+ }, 100);
+ isFocusVisibleRef.current = false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Should be called if a blur event is fired
+ */
+ function handleFocusVisible(event) {
+ if (isFocusVisible(event)) {
+ isFocusVisibleRef.current = true;
+ return true;
+ }
+ return false;
+ }
+ return {
+ isFocusVisibleRef: isFocusVisibleRef,
+ onFocus: handleFocusVisible,
+ onBlur: handleBlurVisible,
+ ref: ref
+ };
+}
+
+/***/ }),
+
/***/ 7861:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
@@ -15759,14 +15765,14 @@ module.exports = _toPropertyKey, module.exports.__esModule = true, module.export
/***/ 8698:
/***/ (function(module) {
-function _typeof(obj) {
+function _typeof(o) {
"@babel/helpers - typeof";
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
+ return typeof o;
+ } : function (o) {
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -15938,31 +15944,31 @@ function _iterableToArray(iter) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ _iterableToArrayLimit; }
/* harmony export */ });
-function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
- if (null != _i) {
- var _s,
- _e,
- _x,
- _r,
- _arr = [],
- _n = !0,
- _d = !1;
+function _iterableToArrayLimit(r, l) {
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
+ if (null != t) {
+ var e,
+ n,
+ i,
+ u,
+ a = [],
+ f = !0,
+ o = !1;
try {
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
- if (Object(_i) !== _i) return;
- _n = !1;
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
- } catch (err) {
- _d = !0, _e = err;
+ if (i = (t = t.call(r)).next, 0 === l) {
+ if (Object(t) !== t) return;
+ f = !1;
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
+ } catch (r) {
+ o = !0, n = r;
} finally {
try {
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
- if (_d) throw _e;
+ if (o) throw n;
}
}
- return _arr;
+ return a;
}
}
@@ -16105,14 +16111,14 @@ function _toPropertyKey(arg) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ _typeof; }
/* harmony export */ });
-function _typeof(obj) {
+function _typeof(o) {
"@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- }, _typeof(obj);
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
+ return typeof o;
+ } : function (o) {
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+ }, _typeof(o);
}
/***/ }),
@@ -17096,299 +17102,304 @@ var esm_typeof = __webpack_require__(1002);
function regeneratorRuntime_regeneratorRuntime() {
"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
regeneratorRuntime_regeneratorRuntime = function _regeneratorRuntime() {
- return exports;
+ return e;
};
- var exports = {},
- Op = Object.prototype,
- hasOwn = Op.hasOwnProperty,
- defineProperty = Object.defineProperty || function (obj, key, desc) {
- obj[key] = desc.value;
+ var t,
+ e = {},
+ r = Object.prototype,
+ n = r.hasOwnProperty,
+ o = Object.defineProperty || function (t, e, r) {
+ t[e] = r.value;
},
- $Symbol = "function" == typeof Symbol ? Symbol : {},
- iteratorSymbol = $Symbol.iterator || "@@iterator",
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
- function define(obj, key, value) {
- return Object.defineProperty(obj, key, {
- value: value,
+ i = "function" == typeof Symbol ? Symbol : {},
+ a = i.iterator || "@@iterator",
+ c = i.asyncIterator || "@@asyncIterator",
+ u = i.toStringTag || "@@toStringTag";
+ function define(t, e, r) {
+ return Object.defineProperty(t, e, {
+ value: r,
enumerable: !0,
configurable: !0,
writable: !0
- }), obj[key];
+ }), t[e];
}
try {
define({}, "");
- } catch (err) {
- define = function define(obj, key, value) {
- return obj[key] = value;
+ } catch (t) {
+ define = function define(t, e, r) {
+ return t[e] = r;
};
}
- function wrap(innerFn, outerFn, self, tryLocsList) {
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
- generator = Object.create(protoGenerator.prototype),
- context = new Context(tryLocsList || []);
- return defineProperty(generator, "_invoke", {
- value: makeInvokeMethod(innerFn, self, context)
- }), generator;
+ function wrap(t, e, r, n) {
+ var i = e && e.prototype instanceof Generator ? e : Generator,
+ a = Object.create(i.prototype),
+ c = new Context(n || []);
+ return o(a, "_invoke", {
+ value: makeInvokeMethod(t, r, c)
+ }), a;
}
- function tryCatch(fn, obj, arg) {
+ function tryCatch(t, e, r) {
try {
return {
type: "normal",
- arg: fn.call(obj, arg)
+ arg: t.call(e, r)
};
- } catch (err) {
+ } catch (t) {
return {
type: "throw",
- arg: err
+ arg: t
};
}
}
- exports.wrap = wrap;
- var ContinueSentinel = {};
+ e.wrap = wrap;
+ var h = "suspendedStart",
+ l = "suspendedYield",
+ f = "executing",
+ s = "completed",
+ y = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
- var IteratorPrototype = {};
- define(IteratorPrototype, iteratorSymbol, function () {
+ var p = {};
+ define(p, a, function () {
return this;
});
- var getProto = Object.getPrototypeOf,
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function (method) {
- define(prototype, method, function (arg) {
- return this._invoke(method, arg);
+ var d = Object.getPrototypeOf,
+ v = d && d(d(values([])));
+ v && v !== r && n.call(v, a) && (p = v);
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
+ function defineIteratorMethods(t) {
+ ["next", "throw", "return"].forEach(function (e) {
+ define(t, e, function (t) {
+ return this._invoke(e, t);
});
});
}
- function AsyncIterator(generator, PromiseImpl) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if ("throw" !== record.type) {
- var result = record.arg,
- value = result.value;
- return value && "object" == (0,esm_typeof/* default */.Z)(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
- invoke("next", value, resolve, reject);
- }, function (err) {
- invoke("throw", err, resolve, reject);
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
- result.value = unwrapped, resolve(result);
- }, function (error) {
- return invoke("throw", error, resolve, reject);
+ function AsyncIterator(t, e) {
+ function invoke(r, o, i, a) {
+ var c = tryCatch(t[r], t, o);
+ if ("throw" !== c.type) {
+ var u = c.arg,
+ h = u.value;
+ return h && "object" == (0,esm_typeof/* default */.Z)(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
+ invoke("next", t, i, a);
+ }, function (t) {
+ invoke("throw", t, i, a);
+ }) : e.resolve(h).then(function (t) {
+ u.value = t, i(u);
+ }, function (t) {
+ return invoke("throw", t, i, a);
});
}
- reject(record.arg);
+ a(c.arg);
}
- var previousPromise;
- defineProperty(this, "_invoke", {
- value: function value(method, arg) {
+ var r;
+ o(this, "_invoke", {
+ value: function value(t, n) {
function callInvokeWithMethodAndArg() {
- return new PromiseImpl(function (resolve, reject) {
- invoke(method, arg, resolve, reject);
+ return new e(function (e, r) {
+ invoke(t, n, e, r);
});
}
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
- function makeInvokeMethod(innerFn, self, context) {
- var state = "suspendedStart";
- return function (method, arg) {
- if ("executing" === state) throw new Error("Generator is already running");
- if ("completed" === state) {
- if ("throw" === method) throw arg;
+ function makeInvokeMethod(e, r, n) {
+ var o = h;
+ return function (i, a) {
+ if (o === f) throw new Error("Generator is already running");
+ if (o === s) {
+ if ("throw" === i) throw a;
return {
- value: void 0,
+ value: t,
done: !0
};
}
- for (context.method = method, context.arg = arg;;) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel) continue;
- return delegateResult;
+ for (n.method = i, n.arg = a;;) {
+ var c = n.delegate;
+ if (c) {
+ var u = maybeInvokeDelegate(c, n);
+ if (u) {
+ if (u === y) continue;
+ return u;
}
}
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
- if ("suspendedStart" === state) throw state = "completed", context.arg;
- context.dispatchException(context.arg);
- } else "return" === context.method && context.abrupt("return", context.arg);
- state = "executing";
- var record = tryCatch(innerFn, self, context);
- if ("normal" === record.type) {
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
+ if (o === h) throw o = s, n.arg;
+ n.dispatchException(n.arg);
+ } else "return" === n.method && n.abrupt("return", n.arg);
+ o = f;
+ var p = tryCatch(e, r, n);
+ if ("normal" === p.type) {
+ if (o = n.done ? s : l, p.arg === y) continue;
return {
- value: record.arg,
- done: context.done
+ value: p.arg,
+ done: n.done
};
}
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
}
};
}
- function maybeInvokeDelegate(delegate, context) {
- var methodName = context.method,
- method = delegate.iterator[methodName];
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
- var record = tryCatch(method, delegate.iterator, context.arg);
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
- var info = record.arg;
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
+ function maybeInvokeDelegate(e, r) {
+ var n = r.method,
+ o = e.iterator[n];
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
+ var i = tryCatch(o, e.iterator, r.arg);
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
+ var a = i.arg;
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
}
- function pushTryEntry(locs) {
- var entry = {
- tryLoc: locs[0]
+ function pushTryEntry(t) {
+ var e = {
+ tryLoc: t[0]
};
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
}
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal", delete record.arg, entry.completion = record;
+ function resetTryEntry(t) {
+ var e = t.completion || {};
+ e.type = "normal", delete e.arg, t.completion = e;
}
- function Context(tryLocsList) {
+ function Context(t) {
this.tryEntries = [{
tryLoc: "root"
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
}
- function values(iterable) {
- if (iterable || "" === iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) return iteratorMethod.call(iterable);
- if ("function" == typeof iterable.next) return iterable;
- if (!isNaN(iterable.length)) {
- var i = -1,
- next = function next() {
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
- return next.value = undefined, next.done = !0, next;
+ function values(e) {
+ if (e || "" === e) {
+ var r = e[a];
+ if (r) return r.call(e);
+ if ("function" == typeof e.next) return e;
+ if (!isNaN(e.length)) {
+ var o = -1,
+ i = function next() {
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
+ return next.value = t, next.done = !0, next;
};
- return next.next = next;
+ return i.next = i;
}
}
- throw new TypeError((0,esm_typeof/* default */.Z)(iterable) + " is not iterable");
+ throw new TypeError((0,esm_typeof/* default */.Z)(e) + " is not iterable");
}
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
+ }), o(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
- var ctor = "function" == typeof genFun && genFun.constructor;
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
- }, exports.mark = function (genFun) {
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
- }, exports.awrap = function (arg) {
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
+ var e = "function" == typeof t && t.constructor;
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
+ }, e.mark = function (t) {
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
+ }, e.awrap = function (t) {
return {
- __await: arg
+ __await: t
};
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
return this;
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
- void 0 === PromiseImpl && (PromiseImpl = Promise);
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
- return result.done ? result.value : iter.next();
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
+ void 0 === i && (i = Promise);
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
+ return t.done ? t.value : a.next();
});
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
return this;
- }), define(Gp, "toString", function () {
+ }), define(g, "toString", function () {
return "[object Generator]";
- }), exports.keys = function (val) {
- var object = Object(val),
- keys = [];
- for (var key in object) keys.push(key);
- return keys.reverse(), function next() {
- for (; keys.length;) {
- var key = keys.pop();
- if (key in object) return next.value = key, next.done = !1, next;
+ }), e.keys = function (t) {
+ var e = Object(t),
+ r = [];
+ for (var n in e) r.push(n);
+ return r.reverse(), function next() {
+ for (; r.length;) {
+ var t = r.pop();
+ if (t in e) return next.value = t, next.done = !1, next;
}
return next.done = !0, next;
};
- }, exports.values = values, Context.prototype = {
+ }, e.values = values, Context.prototype = {
constructor: Context,
- reset: function reset(skipTempReset) {
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
+ reset: function reset(e) {
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
},
stop: function stop() {
this.done = !0;
- var rootRecord = this.tryEntries[0].completion;
- if ("throw" === rootRecord.type) throw rootRecord.arg;
+ var t = this.tryEntries[0].completion;
+ if ("throw" === t.type) throw t.arg;
return this.rval;
},
- dispatchException: function dispatchException(exception) {
- if (this.done) throw exception;
- var context = this;
- function handle(loc, caught) {
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
+ dispatchException: function dispatchException(e) {
+ if (this.done) throw e;
+ var r = this;
+ function handle(n, o) {
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
}
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i],
- record = entry.completion;
- if ("root" === entry.tryLoc) return handle("end");
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc"),
- hasFinally = hasOwn.call(entry, "finallyLoc");
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
+ var i = this.tryEntries[o],
+ a = i.completion;
+ if ("root" === i.tryLoc) return handle("end");
+ if (i.tryLoc <= this.prev) {
+ var c = n.call(i, "catchLoc"),
+ u = n.call(i, "finallyLoc");
+ if (c && u) {
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
+ } else if (c) {
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
} else {
- if (!hasFinally) throw new Error("try statement without catch or finally");
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
+ if (!u) throw new Error("try statement without catch or finally");
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
}
}
}
},
- abrupt: function abrupt(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
+ abrupt: function abrupt(t, e) {
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
+ var o = this.tryEntries[r];
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
+ var i = o;
break;
}
}
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
- var record = finallyEntry ? finallyEntry.completion : {};
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
+ var a = i ? i.completion : {};
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
},
- complete: function complete(record, afterLoc) {
- if ("throw" === record.type) throw record.arg;
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
+ complete: function complete(t, e) {
+ if ("throw" === t.type) throw t.arg;
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
},
- finish: function finish(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
+ finish: function finish(t) {
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
+ var r = this.tryEntries[e];
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
}
},
- "catch": function _catch(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if ("throw" === record.type) {
- var thrown = record.arg;
- resetTryEntry(entry);
+ "catch": function _catch(t) {
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
+ var r = this.tryEntries[e];
+ if (r.tryLoc === t) {
+ var n = r.completion;
+ if ("throw" === n.type) {
+ var o = n.arg;
+ resetTryEntry(r);
}
- return thrown;
+ return o;
}
}
throw new Error("illegal catch attempt");
},
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
+ delegateYield: function delegateYield(e, r, n) {
return this.delegate = {
- iterator: values(iterable),
- resultName: resultName,
- nextLoc: nextLoc
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
+ iterator: values(e),
+ resultName: r,
+ nextLoc: n
+ }, "next" === this.method && (this.arg = t), y;
}
- }, exports;
+ }, e;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -17429,26 +17440,26 @@ var client = __webpack_require__(1739);
var defineProperty = __webpack_require__(4942);
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
-function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
+function ownKeys(e, r) {
+ var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
+ var o = Object.getOwnPropertySymbols(e);
+ r && (o = o.filter(function (r) {
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
+ })), t.push.apply(t, o);
}
- return keys;
+ return t;
}
-function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = null != arguments[i] ? arguments[i] : {};
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
- (0,defineProperty/* default */.Z)(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+function _objectSpread2(e) {
+ for (var r = 1; r < arguments.length; r++) {
+ var t = null != arguments[r] ? arguments[r] : {};
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
+ (0,defineProperty/* default */.Z)(e, r, t[r]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
- return target;
+ return e;
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
var slicedToArray = __webpack_require__(3324);
@@ -17705,8 +17716,8 @@ var Box = createBox({
var useForkRef = __webpack_require__(6983);
// EXTERNAL MODULE: ./node_modules/@mui/material/utils/useEventCallback.js
var useEventCallback = __webpack_require__(3236);
-// EXTERNAL MODULE: ./node_modules/@mui/material/utils/useIsFocusVisible.js + 1 modules
-var useIsFocusVisible = __webpack_require__(9127);
+// EXTERNAL MODULE: ./node_modules/@mui/material/utils/useIsFocusVisible.js
+var useIsFocusVisible = __webpack_require__(7037);
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js
function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
@@ -19330,6 +19341,8 @@ function styles_ThemeProvider_ThemeProvider(_ref) {
}
false ? 0 : void 0;
;// CONCATENATED MODULE: ./node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js
+'use client';
+
@@ -19490,9 +19503,9 @@ function CssBaseline(inProps) {
false ? 0 : void 0;
/* harmony default export */ var CssBaseline_CssBaseline = (CssBaseline);
;// CONCATENATED MODULE: ./src/config/rules.js
-var els="li, p, h1, h2, h3, h4, h5, h6, dd";var DEFAULT_SELECTOR=":is(".concat(els,")");var GLOBAL_KEY="*";var DEFAULT_RULE={pattern:"",selector:"",translator:GLOBAL_KEY,fromLang:GLOBAL_KEY,toLang:GLOBAL_KEY,textStyle:GLOBAL_KEY,transOpen:GLOBAL_KEY,bgColor:""};var RULES=[{pattern:"www.google.com/search",selector:"h3, .IsZvec, .VwiC3b"},{pattern:"https://news.google.com/",selector:"h4"},{pattern:"bearblog.dev, www.theverge.com, www.tampermonkey.net/documentation.php",selector:DEFAULT_SELECTOR},{pattern:"themessenger.com",selector:".leading-tight, .leading-tighter, .my-2 p, .font-body p, article ".concat(DEFAULT_SELECTOR)},{pattern:"www.telegraph.co.uk",selector:"article ".concat(DEFAULT_SELECTOR)},{pattern:"www.theguardian.com",selector:".show-underline, .dcr-hup5wm div, .dcr-7vl6y8 div, .dcr-12evv1c, figcaption, article ".concat(DEFAULT_SELECTOR,", [data-cy=\"mostviewed-footer\"] h4")},{pattern:"www.semafor.com",selector:"".concat(DEFAULT_SELECTOR,", .styles_intro__IYj__, [class*=\"styles_description\"]")},{pattern:"www.noemamag.com",selector:".splash__title, .single-card__title, .single-card__type, .single-card__topic, .highlighted-content__title, .single-card__author, article ".concat(DEFAULT_SELECTOR,", .quote__text, .wp-caption-text div")},{pattern:"restofworld.org",selector:"".concat(DEFAULT_SELECTOR,", .recirc-story__headline, .recirc-story__dek")},{pattern:"www.axios.com",selector:".h7, ".concat(DEFAULT_SELECTOR)},{pattern:"www.newyorker.com",selector:".summary-item__hed, .summary-item__dek, .summary-collection-grid__dek, .dqtvfu, .rubric__link, .caption, article ".concat(DEFAULT_SELECTOR,", .HEhan ").concat(DEFAULT_SELECTOR,", .ContributorBioBio-fBolsO")},{pattern:"https://time.com/",selector:"h1, h3, .summary, .video-title, #article-body ".concat(DEFAULT_SELECTOR,", .image-wrap-container .credit.body-caption, .media-heading")},{pattern:"www.dw.com",selector:".ts-teaser-title a, .news-title a, .title a, .teaser-description a, .hbudab h3, .hbudab p, figcaption ,article ".concat(DEFAULT_SELECTOR)},{pattern:"www.bbc.com",selector:"h1, h2, .media__link, .media__summary, article ".concat(DEFAULT_SELECTOR,", .ssrcss-y7krbn-Stack, .ssrcss-1mrs5ns-PromoLink, .ssrcss-18cjaf3-Headline, .gs-c-promo-heading__title, .gs-c-promo-summary, .media__content h3, .article__intro")},{pattern:"www.chinadaily.com.cn",selector:"h1, .tMain [shape=\"rect\"], .cMain [shape=\"rect\"], .photo_art [shape=\"rect\"], .mai_r [shape=\"rect\"], .lisBox li, #Content ".concat(DEFAULT_SELECTOR)},{pattern:"www.facebook.com",selector:"[role=\"main\"] [dir=\"auto\"]"},{pattern:"www.reddit.com",selector:"[slot=\"title\"], [slot=\"text-body\"] ".concat(DEFAULT_SELECTOR,", #-post-rtjson-content p")},{pattern:"www.quora.com",selector:".qu-wordBreak--break-word"},{pattern:"edition.cnn.com",selector:".container__title, .container__headline, .headline__text, .image__caption, [data-type=\"Title\"], .article__content ".concat(DEFAULT_SELECTOR)},{pattern:"www.reuters.com",selector:"#main-content [data-testid=\"Heading\"], #main-content [data-testid=\"Body\"], .article-body__content__17Yit ".concat(DEFAULT_SELECTOR)},{pattern:"www.bloomberg.com",selector:"[data-component=\"headline\"], [data-component=\"related-item-headline\"], [data-component=\"title\"], article ".concat(DEFAULT_SELECTOR)},{pattern:"deno.land, docs.github.com",selector:"main ".concat(DEFAULT_SELECTOR)},{pattern:"doc.rust-lang.org",selector:"#content ".concat(DEFAULT_SELECTOR)},{pattern:"www.indiehackers.com",selector:"h1, h3, .content ".concat(DEFAULT_SELECTOR,", .feed-item__title-link")},{pattern:"platform.openai.com/docs",selector:".docs-body ".concat(DEFAULT_SELECTOR)},{pattern:"en.wikipedia.org",selector:"h1, .mw-parser-output ".concat(DEFAULT_SELECTOR)},{pattern:"stackoverflow.com",selector:"h1, .s-prose p, .comment-body .comment-copy"},{pattern:"www.npmjs.com/package/, developer.chrome.com/docs, medium.com, developers.cloudflare.com, react.dev, create-react-app.dev, pytorch.org/",selector:"article ".concat(DEFAULT_SELECTOR)},{pattern:"news.ycombinator.com",selector:".title, .commtext"},{pattern:"https://github.com/",selector:".markdown-body ".concat(DEFAULT_SELECTOR,", .repo-description p, .Layout-sidebar .f4, .container-lg .py-4 .f5, .container-lg .my-4 .f5, .Box-row .pr-4, .Box-row article .mt-1, [itemprop='description'], .markdown-title, bdi")},{pattern:"twitter.com",selector:"[data-testid='tweetText']"},{pattern:"youtube.com",selector:"h1, #video-title, #content-text, #title, yt-attributed-string>span>span"}];var BUILTIN_RULES=RULES.map(function(item){return _objectSpread2(_objectSpread2(_objectSpread2({},DEFAULT_RULE),item),{},{transOpen:"true"});});
+var els="li, p, h1, h2, h3, h4, h5, h6, dd";var DEFAULT_SELECTOR=":is(".concat(els,")");var GLOBAL_KEY="*";var SHADOW_KEY=">>>";var DEFAULT_RULE={pattern:"",selector:"",translator:GLOBAL_KEY,fromLang:GLOBAL_KEY,toLang:GLOBAL_KEY,textStyle:GLOBAL_KEY,transOpen:GLOBAL_KEY,bgColor:""};var RULES=[{pattern:"www.google.com/search",selector:"h3, .IsZvec, .VwiC3b"},{pattern:"news.google.com",selector:"h4"},{pattern:"www.foxnews.com",selector:"h1, h2, .title, .sidebar [data-type=\"Title\"], .article-content :is(li, p, h1, h2, h3, h4, h5, h6, dd); [data-spotim-module=\"conversation\"]>div >>> [data-spot-im-class=\"message-text\"] p, [data-spot-im-class=\"message-text\"]"},{pattern:"bearblog.dev, www.theverge.com, www.tampermonkey.net/documentation.php",selector:DEFAULT_SELECTOR},{pattern:"themessenger.com",selector:".leading-tight, .leading-tighter, .my-2 p, .font-body p, article ".concat(DEFAULT_SELECTOR)},{pattern:"www.telegraph.co.uk",selector:"article ".concat(DEFAULT_SELECTOR)},{pattern:"www.theguardian.com",selector:".show-underline, .dcr-hup5wm div, .dcr-7vl6y8 div, .dcr-12evv1c, figcaption, article ".concat(DEFAULT_SELECTOR,", [data-cy=\"mostviewed-footer\"] h4")},{pattern:"www.semafor.com",selector:"".concat(DEFAULT_SELECTOR,", .styles_intro__IYj__, [class*=\"styles_description\"]")},{pattern:"www.noemamag.com",selector:".splash__title, .single-card__title, .single-card__type, .single-card__topic, .highlighted-content__title, .single-card__author, article ".concat(DEFAULT_SELECTOR,", .quote__text, .wp-caption-text div")},{pattern:"restofworld.org",selector:"".concat(DEFAULT_SELECTOR,", .recirc-story__headline, .recirc-story__dek")},{pattern:"www.axios.com",selector:".h7, ".concat(DEFAULT_SELECTOR)},{pattern:"www.newyorker.com",selector:".summary-item__hed, .summary-item__dek, .summary-collection-grid__dek, .dqtvfu, .rubric__link, .caption, article ".concat(DEFAULT_SELECTOR,", .HEhan ").concat(DEFAULT_SELECTOR,", .ContributorBioBio-fBolsO")},{pattern:"https://time.com/",selector:"h1, h3, .summary, .video-title, #article-body ".concat(DEFAULT_SELECTOR,", .image-wrap-container .credit.body-caption, .media-heading")},{pattern:"www.dw.com",selector:".ts-teaser-title a, .news-title a, .title a, .teaser-description a, .hbudab h3, .hbudab p, figcaption ,article ".concat(DEFAULT_SELECTOR)},{pattern:"www.bbc.com",selector:"h1, h2, .media__link, .media__summary, article ".concat(DEFAULT_SELECTOR,", .ssrcss-y7krbn-Stack, .ssrcss-1mrs5ns-PromoLink, .ssrcss-18cjaf3-Headline, .gs-c-promo-heading__title, .gs-c-promo-summary, .media__content h3, .article__intro")},{pattern:"www.chinadaily.com.cn",selector:"h1, .tMain [shape=\"rect\"], .cMain [shape=\"rect\"], .photo_art [shape=\"rect\"], .mai_r [shape=\"rect\"], .lisBox li, #Content ".concat(DEFAULT_SELECTOR)},{pattern:"www.facebook.com",selector:"[role=\"main\"] [dir=\"auto\"]"},{pattern:"www.reddit.com",selector:"[slot=\"title\"], [slot=\"text-body\"] ".concat(DEFAULT_SELECTOR,", #-post-rtjson-content p")},{pattern:"www.quora.com",selector:".qu-wordBreak--break-word"},{pattern:"edition.cnn.com",selector:".container__title, .container__headline, .headline__text, .image__caption, [data-type=\"Title\"], .article__content ".concat(DEFAULT_SELECTOR)},{pattern:"www.reuters.com",selector:"#main-content [data-testid=\"Heading\"], #main-content [data-testid=\"Body\"], .article-body__content__17Yit ".concat(DEFAULT_SELECTOR)},{pattern:"www.bloomberg.com",selector:"[data-component=\"headline\"], [data-component=\"related-item-headline\"], [data-component=\"title\"], article ".concat(DEFAULT_SELECTOR)},{pattern:"deno.land, docs.github.com",selector:"main ".concat(DEFAULT_SELECTOR)},{pattern:"doc.rust-lang.org",selector:"#content ".concat(DEFAULT_SELECTOR)},{pattern:"www.indiehackers.com",selector:"h1, h3, .content ".concat(DEFAULT_SELECTOR,", .feed-item__title-link")},{pattern:"platform.openai.com/docs",selector:".docs-body ".concat(DEFAULT_SELECTOR)},{pattern:"en.wikipedia.org",selector:"h1, .mw-parser-output ".concat(DEFAULT_SELECTOR)},{pattern:"stackoverflow.com",selector:"h1, .s-prose p, .comment-body .comment-copy"},{pattern:"www.npmjs.com/package/, developer.chrome.com/docs, medium.com, developers.cloudflare.com, react.dev, create-react-app.dev, pytorch.org/",selector:"article ".concat(DEFAULT_SELECTOR)},{pattern:"news.ycombinator.com",selector:".title, .commtext"},{pattern:"https://github.com/",selector:".markdown-body ".concat(DEFAULT_SELECTOR,", .repo-description p, .Layout-sidebar .f4, .container-lg .py-4 .f5, .container-lg .my-4 .f5, .Box-row .pr-4, .Box-row article .mt-1, [itemprop='description'], .markdown-title, bdi")},{pattern:"twitter.com",selector:"[data-testid='tweetText']"},{pattern:"youtube.com",selector:"h1, #video-title, #content-text, #title, yt-attributed-string>span>span"}];var BUILTIN_RULES=RULES.map(function(item){return _objectSpread2(_objectSpread2(_objectSpread2({},DEFAULT_RULE),item),{},{transOpen:"true"});});
;// CONCATENATED MODULE: ./src/config/i18n.js
-var UI_LANGS=(/* unused pure expression or super */ null && ([["en","English"],["zh","中文"]]));var I18N={app_name:{zh:"\u7B80\u7EA6\u7FFB\u8BD1",en:"KISS Translator"},translate:{zh:"\u7FFB\u8BD1",en:"Translate"},basic_setting:{zh:"\u57FA\u672C\u8BBE\u7F6E",en:"Basic Setting"},rules_setting:{zh:"\u89C4\u5219\u8BBE\u7F6E",en:"Rules Setting"},sync_setting:{zh:"\u540C\u6B65\u8BBE\u7F6E",en:"Sync Setting"},about:{zh:"\u5173\u4E8E",en:"About"},about_md:{zh:"README.md",en:"README.en.md"},about_md_local:{zh:"\u8BF7 [\u70B9\u51FB\u8FD9\u91CC](".concat("https://github.com/fishjar/kiss-translator",") \u67E5\u770B\u8BE6\u60C5\u3002"),en:"Please [click here](".concat("https://github.com/fishjar/kiss-translator",") for details.")},ui_lang:{zh:"\u754C\u9762\u8BED\u8A00",en:"Interface Language"},fetch_limit:{zh:"\u6700\u5927\u8BF7\u6C42\u6570\u91CF",en:"Maximum Number Of Request"},fetch_interval:{zh:"\u8BF7\u6C42\u95F4\u9694\u65F6\u95F4(ms)",en:"Request Interval(ms)"},translate_service:{zh:"\u7FFB\u8BD1\u670D\u52A1",en:"Translate Service"},from_lang:{zh:"\u539F\u6587\u8BED\u8A00",en:"Source Language"},to_lang:{zh:"\u76EE\u6807\u8BED\u8A00",en:"Target Language"},text_style:{zh:"\u6587\u5B57\u6837\u5F0F",en:"Text Style"},bg_color:{zh:"\u6837\u5F0F\u989C\u8272",en:"Style Color"},google_api:{zh:"\u8C37\u6B4C\u7FFB\u8BD1\u63A5\u53E3",en:"Google Translate API"},default_selector:{zh:"\u9ED8\u8BA4\u9009\u62E9\u5668",en:"Default selector"},selector_rules:{zh:"\u9009\u62E9\u5668\u89C4\u5219",en:"Selector Rules"},save:{zh:"\u4FDD\u5B58",en:"Save"},edit:{zh:"\u7F16\u8F91",en:"Edit"},cancel:{zh:"\u53D6\u6D88",en:"Cancel"},delete:{zh:"\u5220\u9664",en:"Delete"},reset:{zh:"\u91CD\u7F6E",en:"Reset"},add:{zh:"\u6DFB\u52A0",en:"Add"},inject_rules:{zh:"\u6CE8\u5165\u8BA2\u9605\u89C4\u5219",en:"Inject Subscribe Rules"},personal_rules:{zh:"\u4E2A\u4EBA\u89C4\u5219",en:"Personal Rules"},subscribe_rules:{zh:"\u8BA2\u9605\u89C4\u5219",en:"Subscribe Rules"},subscribe_url:{zh:"\u8BA2\u9605\u5730\u5740",en:"Subscribe URL"},rules_warn_1:{zh:"1\u3001\u201C\u4E2A\u4EBA\u89C4\u5219\u201D\u4E00\u76F4\u751F\u6548\uFF0C\u9009\u62E9\u201C\u6CE8\u5165\u8BA2\u9605\u89C4\u5219\u201D\u540E\uFF0C\u201C\u8BA2\u9605\u89C4\u5219\u201D\u624D\u4F1A\u751F\u6548\u3002",en:"1. The \"Personal Rules\" are always in effect. After selecting \"Inject Subscription Rules\", the \"Subscription Rules\" will take effect."},rules_warn_2:{zh:"2\u3001\u201C\u8BA2\u9605\u89C4\u5219\u201D\u7684\u6CE8\u5165\u4F4D\u7F6E\u662F\u5012\u6570\u7B2C\u4E8C\u7684\u4F4D\u7F6E\uFF0C\u56E0\u6B64\u9664\u5168\u5C40\u89C4\u5219(*)\u5916\uFF0C\u201C\u4E2A\u4EBA\u89C4\u5219\u201D\u4F18\u5148\u7EA7\u6BD4\u201C\u8BA2\u9605\u89C4\u5219\u201D\u9AD8\uFF0C\u201C\u4E2A\u4EBA\u89C4\u5219\u201D\u586B\u5199\u540C\u6837\u7684\u7F51\u5740\u4F1A\u8986\u76D6\u201D\u8BA2\u9605\u89C4\u5219\u201C\u7684\u6761\u76EE\u3002",en:"2. The injection position of \"Subscription Rules\" is the penultimate position. Therefore, except for the global rules (*), the priority of \"Personal Rules\" is higher than that of \"Subscription Rules\". Filling in the same url in \"Personal Rules\" will overwrite \"Subscription Rules\" entry."},sync_warn:{zh:"\u5982\u679C\u670D\u52A1\u5668\u5B58\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u540C\u6B65\u7684\u6570\u636E\uFF0C\u7B2C\u4E00\u6B21\u540C\u6B65\u5C06\u76F4\u63A5\u8986\u76D6\u672C\u5730\u914D\u7F6E\uFF0C\u540E\u9762\u5219\u6839\u636E\u4FEE\u6539\u65F6\u95F4\uFF0C\u65B0\u7684\u8986\u76D6\u65E7\u7684\u3002",en:"If the server has data synchronized by other clients, the first synchronization will directly overwrite the local configuration, and later, according to the modification time, the new one will overwrite the old one."},about_sync_api:{zh:"\u67E5\u770B\u5173\u4E8E\u6570\u636E\u540C\u6B65\u63A5\u53E3\u90E8\u7F72",en:"View About Data Synchronization Interface Deployment"},style_none:{zh:"\u65E0",en:"None"},under_line:{zh:"\u4E0B\u5212\u76F4\u7EBF",en:"Underline"},dot_line:{zh:"\u4E0B\u5212\u70B9\u72B6\u7EBF",en:"Dotted Underline"},dash_line:{zh:"\u4E0B\u5212\u865A\u7EBF",en:"Dashed Underline"},wavy_line:{zh:"\u4E0B\u5212\u6CE2\u6D6A\u7EBF",en:"Wavy Underline"},fuzzy:{zh:"\u6A21\u7CCA",en:"Fuzzy"},highlight:{zh:"\u9AD8\u4EAE",en:"Highlight"},setting:{zh:"\u8BBE\u7F6E",en:"Setting"},pattern:{zh:"\u5339\u914D\u7F51\u5740",en:"URL pattern"},pattern_helper:{zh:"1\u3001\u652F\u6301\u661F\u53F7(*)\u901A\u914D\u7B26\u30022\u3001\u591A\u4E2AURL\u652F\u6301\u82F1\u6587\u9017\u53F7\u201C,\u201D\u5206\u9694\u3002",en:"1. The asterisk (*) wildcard is supported. 2. Multiple URLs can be separated by English commas \",\"."},selector_helper:{zh:"1\u3001\u9075\u5FAACSS\u9009\u62E9\u5668\u89C4\u5219\u30022\u3001\u7559\u7A7A\u8868\u793A\u91C7\u7528\u5168\u5C40\u8BBE\u7F6E\u3002",en:"1. Follow CSS selector rules. 2. Leave blank to adopt the global setting."},translate_switch:{zh:"\u5F00\u542F\u7FFB\u8BD1",en:"Translate Switch"},default_enabled:{zh:"\u9ED8\u8BA4\u5F00\u542F",en:"Enabled"},default_disabled:{zh:"\u9ED8\u8BA4\u5173\u95ED",en:"Disabled"},selector:{zh:"\u9009\u62E9\u5668",en:"Selector"},import:{zh:"\u5BFC\u5165",en:"Import"},export:{zh:"\u5BFC\u51FA",en:"Export"},error_cant_be_blank:{zh:"\u4E0D\u80FD\u4E3A\u7A7A",en:"Can not be blank"},error_duplicate_values:{zh:"\u5B58\u5728\u91CD\u590D\u7684\u503C",en:"There are duplicate values"},error_wrong_file_type:{zh:"\u9519\u8BEF\u7684\u6587\u4EF6\u7C7B\u578B",en:"Wrong file type"},error_fetch_url:{zh:"\u8BF7\u68C0\u67E5url\u5730\u5740\u662F\u5426\u6B63\u786E\u6216\u7A0D\u540E\u518D\u8BD5\u3002",en:"Please check if the url address is correct or try again later."},openai_api:{zh:"OpenAI \u63A5\u53E3",en:"OpenAI API"},openai_key:{zh:"OpenAI \u5BC6\u94A5",en:"OpenAI Key"},openai_model:{zh:"OpenAI \u6A21\u578B",en:"OpenAI Model"},openai_prompt:{zh:"OpenAI \u63D0\u793A\u8BCD",en:"OpenAI Prompt"},clear_cache:{zh:"\u662F\u5426\u6E05\u9664\u7F13\u5B58",en:"Whether clear cache"},clear_cache_never:{zh:"\u4E0D\u6E05\u9664\u7F13\u5B58",en:"Never clear cache"},clear_cache_restart:{zh:"\u91CD\u542F\u6D4F\u89C8\u5668\u65F6\u6E05\u9664\u7F13\u5B58",en:"Clear cache when restarting browser"},data_sync_url:{zh:"\u6570\u636E\u540C\u6B65\u63A5\u53E3",en:"Data Sync API"},data_sync_key:{zh:"\u6570\u636E\u540C\u6B65\u5BC6\u94A5",en:"Data Sync Key"},error_got_some_wrong:{zh:"抱歉,出错了!",en:"Sorry, something went wrong!"},error_sync_setting:{zh:"您的同步设置未填写,无法在线分享。",en:"Your sync settings are missing and cannot be shared online."}};
+var UI_LANGS=(/* unused pure expression or super */ null && ([["en","English"],["zh","中文"]]));var I18N={app_name:{zh:"\u7B80\u7EA6\u7FFB\u8BD1",en:"KISS Translator"},translate:{zh:"\u7FFB\u8BD1",en:"Translate"},translate_alt:{zh:"\u7FFB\u8BD1 (Alt+Q)",en:"Translate (Alt+Q)"},basic_setting:{zh:"\u57FA\u672C\u8BBE\u7F6E",en:"Basic Setting"},rules_setting:{zh:"\u89C4\u5219\u8BBE\u7F6E",en:"Rules Setting"},sync_setting:{zh:"\u540C\u6B65\u8BBE\u7F6E",en:"Sync Setting"},about:{zh:"\u5173\u4E8E",en:"About"},about_md:{zh:"README.md",en:"README.en.md"},about_md_local:{zh:"\u8BF7 [\u70B9\u51FB\u8FD9\u91CC](".concat("https://github.com/fishjar/kiss-translator",") \u67E5\u770B\u8BE6\u60C5\u3002"),en:"Please [click here](".concat("https://github.com/fishjar/kiss-translator",") for details.")},ui_lang:{zh:"\u754C\u9762\u8BED\u8A00",en:"Interface Language"},fetch_limit:{zh:"\u6700\u5927\u8BF7\u6C42\u6570\u91CF (1-100)",en:"Maximum Number Of Request (1-100)"},fetch_interval:{zh:"\u8BF7\u6C42\u95F4\u9694\u65F6\u95F4 (0-5000ms)",en:"Request Interval (0-5000ms)"},min_translate_length:{zh:"\u6700\u5C0F\u7FFB\u8BD1\u957F\u5EA6 (1-100)",en:"Min Translate Length (1-100)"},max_translate_length:{zh:"\u6700\u5927\u7FFB\u8BD1\u957F\u5EA6 (100-10000)",en:"Max Translate Length (100-10000)"},translate_service:{zh:"\u7FFB\u8BD1\u670D\u52A1",en:"Translate Service"},from_lang:{zh:"\u539F\u6587\u8BED\u8A00",en:"Source Language"},to_lang:{zh:"\u76EE\u6807\u8BED\u8A00",en:"Target Language"},text_style:{zh:"\u6587\u5B57\u6837\u5F0F",en:"Text Style"},text_style_alt:{zh:"\u6587\u5B57\u6837\u5F0F (Alt+C)",en:"Text Style (Alt+C)"},bg_color:{zh:"\u6837\u5F0F\u989C\u8272",en:"Style Color"},google_api:{zh:"\u8C37\u6B4C\u7FFB\u8BD1\u63A5\u53E3",en:"Google Translate API"},default_selector:{zh:"\u9ED8\u8BA4\u9009\u62E9\u5668",en:"Default selector"},selector_rules:{zh:"\u9009\u62E9\u5668\u89C4\u5219",en:"Selector Rules"},save:{zh:"\u4FDD\u5B58",en:"Save"},edit:{zh:"\u7F16\u8F91",en:"Edit"},cancel:{zh:"\u53D6\u6D88",en:"Cancel"},delete:{zh:"\u5220\u9664",en:"Delete"},reset:{zh:"\u91CD\u7F6E",en:"Reset"},add:{zh:"\u6DFB\u52A0",en:"Add"},inject_rules:{zh:"\u6CE8\u5165\u8BA2\u9605\u89C4\u5219",en:"Inject Subscribe Rules"},personal_rules:{zh:"\u4E2A\u4EBA\u89C4\u5219",en:"Personal Rules"},subscribe_rules:{zh:"\u8BA2\u9605\u89C4\u5219",en:"Subscribe Rules"},subscribe_url:{zh:"\u8BA2\u9605\u5730\u5740",en:"Subscribe URL"},rules_warn_1:{zh:"1\u3001\u201C\u4E2A\u4EBA\u89C4\u5219\u201D\u4E00\u76F4\u751F\u6548\uFF0C\u9009\u62E9\u201C\u6CE8\u5165\u8BA2\u9605\u89C4\u5219\u201D\u540E\uFF0C\u201C\u8BA2\u9605\u89C4\u5219\u201D\u624D\u4F1A\u751F\u6548\u3002",en:"1. The \"Personal Rules\" are always in effect. After selecting \"Inject Subscription Rules\", the \"Subscription Rules\" will take effect."},rules_warn_2:{zh:"2\u3001\u201C\u8BA2\u9605\u89C4\u5219\u201D\u7684\u6CE8\u5165\u4F4D\u7F6E\u662F\u5012\u6570\u7B2C\u4E8C\u7684\u4F4D\u7F6E\uFF0C\u56E0\u6B64\u9664\u5168\u5C40\u89C4\u5219(*)\u5916\uFF0C\u201C\u4E2A\u4EBA\u89C4\u5219\u201D\u4F18\u5148\u7EA7\u6BD4\u201C\u8BA2\u9605\u89C4\u5219\u201D\u9AD8\uFF0C\u201C\u4E2A\u4EBA\u89C4\u5219\u201D\u586B\u5199\u540C\u6837\u7684\u7F51\u5740\u4F1A\u8986\u76D6\u201D\u8BA2\u9605\u89C4\u5219\u201C\u7684\u6761\u76EE\u3002",en:"2. The injection position of \"Subscription Rules\" is the penultimate position. Therefore, except for the global rules (*), the priority of \"Personal Rules\" is higher than that of \"Subscription Rules\". Filling in the same url in \"Personal Rules\" will overwrite \"Subscription Rules\" entry."},sync_warn:{zh:"\u5982\u679C\u670D\u52A1\u5668\u5B58\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u540C\u6B65\u7684\u6570\u636E\uFF0C\u7B2C\u4E00\u6B21\u540C\u6B65\u5C06\u76F4\u63A5\u8986\u76D6\u672C\u5730\u914D\u7F6E\uFF0C\u540E\u9762\u5219\u6839\u636E\u4FEE\u6539\u65F6\u95F4\uFF0C\u65B0\u7684\u8986\u76D6\u65E7\u7684\u3002",en:"If the server has data synchronized by other clients, the first synchronization will directly overwrite the local configuration, and later, according to the modification time, the new one will overwrite the old one."},about_sync_api:{zh:"\u67E5\u770B\u5173\u4E8E\u6570\u636E\u540C\u6B65\u63A5\u53E3\u90E8\u7F72",en:"View About Data Synchronization Interface Deployment"},style_none:{zh:"\u65E0",en:"None"},under_line:{zh:"\u4E0B\u5212\u76F4\u7EBF",en:"Underline"},dot_line:{zh:"\u4E0B\u5212\u70B9\u72B6\u7EBF",en:"Dotted Underline"},dash_line:{zh:"\u4E0B\u5212\u865A\u7EBF",en:"Dashed Underline"},wavy_line:{zh:"\u4E0B\u5212\u6CE2\u6D6A\u7EBF",en:"Wavy Underline"},fuzzy:{zh:"\u6A21\u7CCA",en:"Fuzzy"},highlight:{zh:"\u9AD8\u4EAE",en:"Highlight"},setting:{zh:"\u8BBE\u7F6E",en:"Setting"},pattern:{zh:"\u5339\u914D\u7F51\u5740",en:"URL pattern"},pattern_helper:{zh:"1\u3001\u652F\u6301\u661F\u53F7(*)\u901A\u914D\u7B26\u30022\u3001\u591A\u4E2AURL\u652F\u6301\u82F1\u6587\u9017\u53F7\u201C,\u201D\u5206\u9694\u3002",en:"1. The asterisk (*) wildcard is supported. 2. Multiple URLs can be separated by English commas \",\"."},selector_helper:{zh:"1\u3001\u9075\u5FAACSS\u9009\u62E9\u5668\u89C4\u5219\u30022\u3001\u7559\u7A7A\u8868\u793A\u91C7\u7528\u5168\u5C40\u8BBE\u7F6E\u3002",en:"1. Follow CSS selector rules. 2. Leave blank to adopt the global setting."},translate_switch:{zh:"\u5F00\u542F\u7FFB\u8BD1",en:"Translate Switch"},default_enabled:{zh:"\u9ED8\u8BA4\u5F00\u542F",en:"Enabled"},default_disabled:{zh:"\u9ED8\u8BA4\u5173\u95ED",en:"Disabled"},selector:{zh:"\u9009\u62E9\u5668",en:"Selector"},import:{zh:"\u5BFC\u5165",en:"Import"},export:{zh:"\u5BFC\u51FA",en:"Export"},error_cant_be_blank:{zh:"\u4E0D\u80FD\u4E3A\u7A7A",en:"Can not be blank"},error_duplicate_values:{zh:"\u5B58\u5728\u91CD\u590D\u7684\u503C",en:"There are duplicate values"},error_wrong_file_type:{zh:"\u9519\u8BEF\u7684\u6587\u4EF6\u7C7B\u578B",en:"Wrong file type"},error_fetch_url:{zh:"\u8BF7\u68C0\u67E5url\u5730\u5740\u662F\u5426\u6B63\u786E\u6216\u7A0D\u540E\u518D\u8BD5\u3002",en:"Please check if the url address is correct or try again later."},openai_api:{zh:"OpenAI \u63A5\u53E3",en:"OpenAI API"},openai_key:{zh:"OpenAI \u5BC6\u94A5",en:"OpenAI Key"},openai_model:{zh:"OpenAI \u6A21\u578B",en:"OpenAI Model"},openai_prompt:{zh:"OpenAI \u63D0\u793A\u8BCD",en:"OpenAI Prompt"},clear_cache:{zh:"\u662F\u5426\u6E05\u9664\u7F13\u5B58",en:"Whether clear cache"},clear_cache_never:{zh:"\u4E0D\u6E05\u9664\u7F13\u5B58",en:"Never clear cache"},clear_cache_restart:{zh:"\u91CD\u542F\u6D4F\u89C8\u5668\u65F6\u6E05\u9664\u7F13\u5B58",en:"Clear cache when restarting browser"},data_sync_url:{zh:"\u6570\u636E\u540C\u6B65\u63A5\u53E3",en:"Data Sync API"},data_sync_key:{zh:"\u6570\u636E\u540C\u6B65\u5BC6\u94A5",en:"Data Sync Key"},data_sync_test:{zh:"\u6570\u636E\u540C\u6B65\u6D4B\u8BD5",en:"Data Sync Test"},data_sync_success:{zh:"\u6570\u636E\u540C\u6B65\u6210\u529F\uFF01",en:"Data Sync Success"},data_sync_error:{zh:"\u6570\u636E\u540C\u6B65\u5931\u8D25\uFF01",en:"Data Sync Error"},error_got_some_wrong:{zh:"抱歉,出错了!",en:"Sorry, something went wrong!"},error_sync_setting:{zh:"您的同步设置未填写,无法在线分享。",en:"Your sync settings are missing and cannot be shared online."}};
;// CONCATENATED MODULE: ./src/config/index.js
var _OPT_LANGS_SPECIAL;var APP_NAME="KISS Translator".trim().split(/\s+/).join("-");var APP_LCNAME=APP_NAME.toLowerCase();var STOKEY_MSAUTH="".concat(APP_NAME,"_msauth");var config_STOKEY_SETTING="".concat(APP_NAME,"_setting");var config_STOKEY_RULES="".concat(APP_NAME,"_rules");var config_STOKEY_SYNC="".concat(APP_NAME,"_sync");var STOKEY_FAB="".concat(APP_NAME,"_fab");var STOKEY_RULESCACHE_PREFIX="".concat(APP_NAME,"_rulescache_");var CMD_TOGGLE_TRANSLATE="toggleTranslate";var CMD_TOGGLE_STYLE="toggleStyle";var CLIENT_WEB="web";var CLIENT_CHROME="chrome";var CLIENT_EDGE="edge";var CLIENT_FIREFOX="firefox";var CLIENT_USERSCRIPT="userscript";var CLIENT_EXTS=[CLIENT_CHROME,CLIENT_EDGE,CLIENT_FIREFOX];var config_KV_RULES_KEY="KT_RULES";var config_KV_RULES_SHARE_KEY="KT_RULES_SHARE";var config_KV_SETTING_KEY="KT_SETTING";var config_KV_SALT_SYNC="KISS-Translator-SYNC";var config_KV_SALT_SHARE="KISS-Translator-SHARE";var CACHE_NAME="".concat(APP_NAME,"_cache");var MSG_FETCH="fetch";var MSG_FETCH_LIMIT="fetch_limit";var MSG_FETCH_CLEAR="fetch_clear";var MSG_TRANS_TOGGLE="trans_toggle";var MSG_TRANS_TOGGLE_STYLE="trans_toggle_style";var MSG_TRANS_GETRULE="trans_getrule";var MSG_TRANS_PUTRULE="trans_putrule";var MSG_TRANS_CURRULE="trans_currule";var EVENT_KISS="kissEvent";var THEME_LIGHT="light";var THEME_DARK="dark";var URL_KISS_WORKER="https://github.com/fishjar/kiss-worker";var config_URL_RAW_PREFIX="https://raw.githubusercontent.com/fishjar/kiss-translator/master";var URL_MICROSOFT_AUTH="https://edge.microsoft.com/translate/auth";var URL_MICROSOFT_TRANS="https://api-edge.cognitive.microsofttranslator.com/translate";var OPT_TRANS_GOOGLE="Google";var OPT_TRANS_MICROSOFT="Microsoft";var OPT_TRANS_OPENAI="OpenAI";var OPT_TRANS_ALL=[OPT_TRANS_GOOGLE,OPT_TRANS_MICROSOFT,OPT_TRANS_OPENAI];var OPT_LANGS_TO=[["en","English - English"],["zh-CN","Simplified Chinese - 简体中文"],["zh-TW","Traditional Chinese - 繁體中文"],["ar","Arabic - العربية"],["bg","Bulgarian - Български"],["ca","Catalan - Català"],["hr","Croatian - Hrvatski"],["cs","Czech - Čeština"],["da","Danish - Dansk"],["nl","Dutch - Nederlands"],["fi","Finnish - Suomi"],["fr","French - Français"],["de","German - Deutsch"],["el","Greek - Ελληνικά"],["hi","Hindi - हिन्दी"],["hu","Hungarian - Magyar"],["id","Indonesian - Indonesia"],["it","Italian - Italiano"],["ja","Japanese - 日本語"],["ko","Korean - 한국어"],["ms","Malay - Melayu"],["mt","Maltese - Malti"],["nb","Norwegian - Norsk Bokmål"],["pl","Polish - Polski"],["pt","Portuguese - Português"],["ro","Romanian - Română"],["ru","Russian - Русский"],["sk","Slovak - Slovenčina"],["sl","Slovenian - Slovenščina"],["es","Spanish - Español"],["sv","Swedish - Svenska"],["ta","Tamil - தமிழ்"],["te","Telugu - తెలుగు"],["th","Thai - ไทย"],["tr","Turkish - Türkçe"],["uk","Ukrainian - Українська"],["vi","Vietnamese - Tiếng Việt"]];var OPT_LANGS_FROM=[["auto","Auto-detect"]].concat(OPT_LANGS_TO);var OPT_LANGS_SPECIAL=(_OPT_LANGS_SPECIAL={},(0,defineProperty/* default */.Z)(_OPT_LANGS_SPECIAL,OPT_TRANS_MICROSOFT,new Map([["auto",""],["zh-CN","zh-Hans"],["zh-TW","zh-Hant"]])),(0,defineProperty/* default */.Z)(_OPT_LANGS_SPECIAL,OPT_TRANS_OPENAI,new Map(OPT_LANGS_FROM.map(function(_ref){var _ref2=(0,slicedToArray/* default */.Z)(_ref,2),key=_ref2[0],val=_ref2[1];return[key,val.split(" - ")[0]];}))),_OPT_LANGS_SPECIAL);var OPT_STYLE_NONE="style_none";// 无
var OPT_STYLE_LINE="under_line";// 下划线
@@ -19508,17 +19521,17 @@ var PROMPT_PLACE_TO="{{to}}";// 占位符
var DEFAULT_COLOR="#209CEE";// 默认高亮背景色/线条颜色
// 全局规则
var GLOBLA_RULE={pattern:"*",selector:DEFAULT_SELECTOR,translator:OPT_TRANS_MICROSOFT,fromLang:"auto",toLang:"zh-CN",textStyle:OPT_STYLE_DASHLINE,transOpen:"false",bgColor:""};// 订阅列表
-var DEFAULT_SUBRULES_LIST=[{url:"https://kiss-translator.rayjar.com/kiss-translator-rules.json",selected:true},{url:"https://fishjar.github.io/kiss-translator/kiss-translator-rules.json"}];var DEFAULT_SETTING={darkMode:false,// 深色模式
+var DEFAULT_SUBRULES_LIST=[{url:"https://kiss-translator.rayjar.com/kiss-translator-rules.json",selected:true},{url:"https://fishjar.github.io/kiss-translator/kiss-translator-rules.json"}];var TRANS_MIN_LENGTH=5;// 最短翻译长度
+var TRANS_MAX_LENGTH=5000;// 最长翻译长度
+var DEFAULT_SETTING={darkMode:false,// 深色模式
uiLang:"en",// 界面语言
fetchLimit:DEFAULT_FETCH_LIMIT,// 最大任务数量
fetchInterval:DEFAULT_FETCH_INTERVAL,// 任务间隔时间
-clearCache:false,// 是否在浏览器下次启动时清除缓存
+minLength:TRANS_MIN_LENGTH,maxLength:TRANS_MAX_LENGTH,clearCache:false,// 是否在浏览器下次启动时清除缓存
injectRules:true,// 是否注入订阅规则
subrulesList:DEFAULT_SUBRULES_LIST,// 订阅列表
googleUrl:"https://translate.googleapis.com/translate_a/single",// 谷歌翻译接口
-openaiUrl:"https://api.openai.com/v1/chat/completions",openaiKey:"",openaiModel:"gpt-4",openaiPrompt:"You will be provided with a sentence in ".concat(PROMPT_PLACE_FROM,", and your task is to translate it into ").concat(PROMPT_PLACE_TO,".")};var DEFAULT_RULES=[GLOBLA_RULE];var TRANS_MIN_LENGTH=5;// 最短翻译长度
-var TRANS_MAX_LENGTH=5000;// 最长翻译长度
-var DEFAULT_SYNC={syncUrl:"",// 数据同步接口
+openaiUrl:"https://api.openai.com/v1/chat/completions",openaiKey:"",openaiModel:"gpt-4",openaiPrompt:"You will be provided with a sentence in ".concat(PROMPT_PLACE_FROM,", and your task is to translate it into ").concat(PROMPT_PLACE_TO,".")};var DEFAULT_RULES=[GLOBLA_RULE];var DEFAULT_SYNC={syncUrl:"",// 数据同步接口
syncKey:"",// 数据同步密钥
settingUpdateAt:0,settingSyncAt:0,rulesUpdateAt:0,rulesSyncAt:0,subRulesSyncAt:0// 订阅规则同步时间
};
@@ -19748,11 +19761,6 @@ if(!(now-subRulesSyncAt>interval)){_context7.next=14;break;}_context7.next=12;re
*/var loadSubRules=/*#__PURE__*/function(){var _ref7=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee8(url){var rules;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return rulesCache.get(url);case 2:rules=_context8.sent;if(!(rules!==null&&rules!==void 0&&rules.length)){_context8.next=5;break;}return _context8.abrupt("return",rules);case 5:_context8.next=7;return syncSubRules(url);case 7:return _context8.abrupt("return",_context8.sent);case 8:case"end":return _context8.stop();}},_callee8);}));return function loadSubRules(_x9){return _ref7.apply(this,arguments);};}();
;// CONCATENATED MODULE: ./src/libs/index.js
/**
- * 获取节点列表并转为数组
- * @param {*} selector
- * @param {*} el
- * @returns
- */var queryEls=function queryEls(selector){var el=arguments.length>1&&arguments[1]!==undefined?arguments[1]:document;return Array.from(el.querySelectorAll(selector));};/**
* 查询storage中的设置
* @returns
*/var libs_getSetting=/*#__PURE__*/function(){var _ref=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(){return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.t0=_objectSpread2;_context.t1=_objectSpread2({},DEFAULT_SETTING);_context.next=4;return libs_storage.getObj(config_STOKEY_SETTING);case 4:_context.t2=_context.sent;if(_context.t2){_context.next=7;break;}_context.t2={};case 7:_context.t3=_context.t2;return _context.abrupt("return",(0,_context.t0)(_context.t1,_context.t3));case 9:case"end":return _context.stop();}},_callee);}));return function getSetting(){return _ref.apply(this,arguments);};}();/**
@@ -20402,17 +20410,17 @@ function exclude(input, filter, options) {
*/var syncOpt={load:function(){var _load=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(){return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return libs_storage.getObj(config_STOKEY_SYNC);case 2:_context.t0=_context.sent;if(_context.t0){_context.next=5;break;}_context.t0=DEFAULT_SYNC;case 5:return _context.abrupt("return",_context.t0);case 6:case"end":return _context.stop();}},_callee);}));function load(){return _load.apply(this,arguments);}return load;}(),update:function(){var _update=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee2(obj){return regeneratorRuntime_regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return libs_storage.putObj(config_STOKEY_SYNC,obj);case 2:case"end":return _context2.stop();}},_callee2);}));function update(_x){return _update.apply(this,arguments);}return update;}()};/**
* 同步设置
* @returns
- */var sync_syncSetting=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var isBg,_yield$syncOpt$load,syncUrl,syncKey,settingUpdateAt,setting,res,_args3=arguments;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:isBg=_args3.length>0&&_args3[0]!==undefined?_args3[0]:false;_context3.prev=1;_context3.next=4;return syncOpt.load();case 4:_yield$syncOpt$load=_context3.sent;syncUrl=_yield$syncOpt$load.syncUrl;syncKey=_yield$syncOpt$load.syncKey;settingUpdateAt=_yield$syncOpt$load.settingUpdateAt;if(!(!syncUrl||!syncKey)){_context3.next=10;break;}return _context3.abrupt("return");case 10:_context3.next=12;return getSetting();case 12:setting=_context3.sent;_context3.next=15;return apiSyncData(syncUrl,syncKey,{key:KV_SETTING_KEY,value:setting,updateAt:settingUpdateAt},isBg);case 15:res=_context3.sent;if(!(res&&res.updateAt>settingUpdateAt)){_context3.next=23;break;}_context3.next=19;return syncOpt.update({settingUpdateAt:res.updateAt,settingSyncAt:res.updateAt});case 19:_context3.next=21;return storage.setObj(STOKEY_SETTING,res.value);case 21:_context3.next=25;break;case 23:_context3.next=25;return syncOpt.update({settingSyncAt:res.updateAt});case 25:_context3.next=30;break;case 27:_context3.prev=27;_context3.t0=_context3["catch"](1);console.log("[sync setting]",_context3.t0);case 30:case"end":return _context3.stop();}},_callee3,null,[[1,27]]);}));return function syncSetting(){return _ref.apply(this,arguments);};}()));/**
+ */var syncSetting=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var isBg,_yield$syncOpt$load,syncUrl,syncKey,settingUpdateAt,setting,res,_args3=arguments;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:isBg=_args3.length>0&&_args3[0]!==undefined?_args3[0]:false;_context3.next=3;return syncOpt.load();case 3:_yield$syncOpt$load=_context3.sent;syncUrl=_yield$syncOpt$load.syncUrl;syncKey=_yield$syncOpt$load.syncKey;settingUpdateAt=_yield$syncOpt$load.settingUpdateAt;if(!(!syncUrl||!syncKey)){_context3.next=9;break;}return _context3.abrupt("return");case 9:_context3.next=11;return getSetting();case 11:setting=_context3.sent;_context3.next=14;return apiSyncData(syncUrl,syncKey,{key:KV_SETTING_KEY,value:setting,updateAt:settingUpdateAt},isBg);case 14:res=_context3.sent;if(!(res&&res.updateAt>settingUpdateAt)){_context3.next=22;break;}_context3.next=18;return syncOpt.update({settingUpdateAt:res.updateAt,settingSyncAt:res.updateAt});case 18:_context3.next=20;return storage.setObj(STOKEY_SETTING,res.value);case 20:_context3.next=24;break;case 22:_context3.next=24;return syncOpt.update({settingSyncAt:res.updateAt});case 24:case"end":return _context3.stop();}},_callee3);}));return function syncSetting(){return _ref.apply(this,arguments);};}()));var sync_trySyncSetting=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var isBg,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:isBg=_args4.length>0&&_args4[0]!==undefined?_args4[0]:false;_context4.prev=1;_context4.next=4;return syncSetting(isBg);case 4:_context4.next=9;break;case 6:_context4.prev=6;_context4.t0=_context4["catch"](1);console.log("[sync setting]",_context4.t0);case 9:case"end":return _context4.stop();}},_callee4,null,[[1,6]]);}));return function trySyncSetting(){return _ref2.apply(this,arguments);};}()));/**
* 同步规则
* @returns
- */var syncRules=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var isBg,_yield$syncOpt$load2,syncUrl,syncKey,rulesUpdateAt,rules,res,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:isBg=_args4.length>0&&_args4[0]!==undefined?_args4[0]:false;_context4.prev=1;_context4.next=4;return syncOpt.load();case 4:_yield$syncOpt$load2=_context4.sent;syncUrl=_yield$syncOpt$load2.syncUrl;syncKey=_yield$syncOpt$load2.syncKey;rulesUpdateAt=_yield$syncOpt$load2.rulesUpdateAt;if(!(!syncUrl||!syncKey)){_context4.next=10;break;}return _context4.abrupt("return");case 10:_context4.next=12;return getRules();case 12:rules=_context4.sent;_context4.next=15;return apiSyncData(syncUrl,syncKey,{key:KV_RULES_KEY,value:rules,updateAt:rulesUpdateAt},isBg);case 15:res=_context4.sent;if(!(res&&res.updateAt>rulesUpdateAt)){_context4.next=23;break;}_context4.next=19;return syncOpt.update({rulesUpdateAt:res.updateAt,rulesSyncAt:res.updateAt});case 19:_context4.next=21;return storage.setObj(STOKEY_RULES,res.value);case 21:_context4.next=25;break;case 23:_context4.next=25;return syncOpt.update({rulesSyncAt:res.updateAt});case 25:_context4.next=30;break;case 27:_context4.prev=27;_context4.t0=_context4["catch"](1);console.log("[sync user rules]",_context4.t0);case 30:case"end":return _context4.stop();}},_callee4,null,[[1,27]]);}));return function syncRules(){return _ref2.apply(this,arguments);};}()));/**
+ */var syncRules=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var isBg,_yield$syncOpt$load2,syncUrl,syncKey,rulesUpdateAt,rules,res,_args5=arguments;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:isBg=_args5.length>0&&_args5[0]!==undefined?_args5[0]:false;_context5.next=3;return syncOpt.load();case 3:_yield$syncOpt$load2=_context5.sent;syncUrl=_yield$syncOpt$load2.syncUrl;syncKey=_yield$syncOpt$load2.syncKey;rulesUpdateAt=_yield$syncOpt$load2.rulesUpdateAt;if(!(!syncUrl||!syncKey)){_context5.next=9;break;}return _context5.abrupt("return");case 9:_context5.next=11;return getRules();case 11:rules=_context5.sent;_context5.next=14;return apiSyncData(syncUrl,syncKey,{key:KV_RULES_KEY,value:rules,updateAt:rulesUpdateAt},isBg);case 14:res=_context5.sent;if(!(res&&res.updateAt>rulesUpdateAt)){_context5.next=22;break;}_context5.next=18;return syncOpt.update({rulesUpdateAt:res.updateAt,rulesSyncAt:res.updateAt});case 18:_context5.next=20;return storage.setObj(STOKEY_RULES,res.value);case 20:_context5.next=24;break;case 22:_context5.next=24;return syncOpt.update({rulesSyncAt:res.updateAt});case 24:case"end":return _context5.stop();}},_callee5);}));return function syncRules(){return _ref3.apply(this,arguments);};}()));var trySyncRules=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var isBg,_args6=arguments;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:isBg=_args6.length>0&&_args6[0]!==undefined?_args6[0]:false;_context6.prev=1;_context6.next=4;return syncRules(isBg);case 4:_context6.next=9;break;case 6:_context6.prev=6;_context6.t0=_context6["catch"](1);console.log("[sync user rules]",_context6.t0);case 9:case"end":return _context6.stop();}},_callee6,null,[[1,6]]);}));return function trySyncRules(){return _ref4.apply(this,arguments);};}()));/**
* 同步分享规则
* @param {*} param0
* @returns
- */var syncShareRules=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref3){var rules,syncUrl,syncKey,psk,shareUrl;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:rules=_ref3.rules,syncUrl=_ref3.syncUrl,syncKey=_ref3.syncKey;_context5.next=3;return apiSyncData(syncUrl,syncKey,{key:KV_RULES_SHARE_KEY,value:rules,updateAt:Date.now()});case 3:_context5.next=5;return sha256(syncKey,KV_SALT_SHARE);case 5:psk=_context5.sent;shareUrl="".concat(syncUrl,"?psk=").concat(psk);return _context5.abrupt("return",shareUrl);case 8:case"end":return _context5.stop();}},_callee5);}));return function syncShareRules(_x2){return _ref4.apply(this,arguments);};}()));/**
+ */var syncShareRules=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref5){var rules,syncUrl,syncKey,psk,shareUrl;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:rules=_ref5.rules,syncUrl=_ref5.syncUrl,syncKey=_ref5.syncKey;_context7.next=3;return apiSyncData(syncUrl,syncKey,{key:KV_RULES_SHARE_KEY,value:rules,updateAt:Date.now()});case 3:_context7.next=5;return sha256(syncKey,KV_SALT_SHARE);case 5:psk=_context7.sent;shareUrl="".concat(syncUrl,"?psk=").concat(psk);return _context7.abrupt("return",shareUrl);case 8:case"end":return _context7.stop();}},_callee7);}));return function syncShareRules(_x2){return _ref6.apply(this,arguments);};}()));/**
* 同步个人设置和规则
* @returns
- */var syncAll=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var isBg,_args6=arguments;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:isBg=_args6.length>0&&_args6[0]!==undefined?_args6[0]:false;_context6.next=3;return sync_syncSetting(isBg);case 3:_context6.next=5;return syncRules(isBg);case 5:case"end":return _context6.stop();}},_callee6);}));return function syncAll(){return _ref5.apply(this,arguments);};}()));
+ */var syncAll=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var isBg,_args8=arguments;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:isBg=_args8.length>0&&_args8[0]!==undefined?_args8[0]:false;_context8.next=3;return syncSetting(isBg);case 3:_context8.next=5;return syncRules(isBg);case 5:case"end":return _context8.stop();}},_callee8);}));return function syncAll(){return _ref7.apply(this,arguments);};}()));var trySyncAll=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _ref8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var isBg,_args9=arguments;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:isBg=_args9.length>0&&_args9[0]!==undefined?_args9[0]:false;_context9.next=3;return sync_trySyncSetting(isBg);case 3:_context9.next=5;return trySyncRules(isBg);case 5:case"end":return _context9.stop();}},_callee9);}));return function trySyncAll(){return _ref8.apply(this,arguments);};}()));
;// CONCATENATED MODULE: ./src/hooks/Setting.js
/**
* 设置hook
@@ -20420,7 +20428,7 @@ function exclude(input, filter, options) {
*/function useSetting(){var storages=Storage_useStorages();return storages===null||storages===void 0?void 0:storages[config_STOKEY_SETTING];}/**
* 更新设置
* @returns
- */function Setting_useSettingUpdate(){var sync=useSync();return/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(obj){var _sync$opt;var updateAt;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:updateAt=(_sync$opt=sync.opt)!==null&&_sync$opt!==void 0&&_sync$opt.settingUpdateAt?Date.now():0;_context.next=3;return storage.putObj(STOKEY_SETTING,obj);case 3:_context.next=5;return sync.update({settingUpdateAt:updateAt});case 5:syncSetting();case 6:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}();}
+ */function Setting_useSettingUpdate(){var sync=useSync();return/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(obj){var _sync$opt;var updateAt;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:updateAt=(_sync$opt=sync.opt)!==null&&_sync$opt!==void 0&&_sync$opt.settingUpdateAt?Date.now():0;_context.next=3;return storage.putObj(STOKEY_SETTING,obj);case 3:_context.next=5;return sync.update({settingUpdateAt:updateAt});case 5:trySyncSetting();case 6:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}();}
;// CONCATENATED MODULE: ./src/hooks/ColorMode.js
/**
* 深色模式hook
@@ -20438,7 +20446,7 @@ function exclude(input, filter, options) {
;// CONCATENATED MODULE: ./src/libs/mobile.js
var isMobile=("ontouchstart"in document.documentElement);
;// CONCATENATED MODULE: ./src/views/Action/Draggable.js
-var getEdgePosition=function getEdgePosition(_ref,windowWidth,windowHeight,width,height){var left=_ref.x,top=_ref.y,edge=_ref.edge;var right=windowWidth-left-width;var bottom=windowHeight-top-height;var min=Math.min(left,top,right,bottom);switch(min){case right:edge="right";left=windowWidth-width;break;case left:edge="left";left=0;break;case bottom:edge="bottom";top=windowHeight-height;break;default:edge="top";top=0;}left=limitNumber(left,0,windowWidth-width);top=limitNumber(top,0,windowHeight-height);return{x:left,y:top,edge:edge,hide:false};};var getHidePosition=function getHidePosition(_ref2,windowWidth,windowHeight,width,height){var left=_ref2.x,top=_ref2.y,edge=_ref2.edge;switch(edge){case"right":left=windowWidth-width/2;break;case"left":left=-width/2;break;case"bottom":top=windowHeight-height/2;break;default:top=-height/2;}return{x:left,y:top,edge:edge,hide:true};};function Draggable(_ref3){var windowSize=_ref3.windowSize,width=_ref3.width,height=_ref3.height,left=_ref3.left,top=_ref3.top,show=_ref3.show,snapEdge=_ref3.snapEdge,onStart=_ref3.onStart,onMove=_ref3.onMove,handler=_ref3.handler,children=_ref3.children;var _useState=(0,react.useState)({x:left,y:top,px:left,py:top}),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),origin=_useState2[0],setOrigin=_useState2[1];var _useState3=(0,react.useState)({x:left,y:top,edge:null,hide:false}),_useState4=(0,slicedToArray/* default */.Z)(_useState3,2),position=_useState4[0],setPosition=_useState4[1];var _useState5=(0,react.useState)(null),_useState6=(0,slicedToArray/* default */.Z)(_useState5,2),edgeTimer=_useState6[0],setEdgeTimer=_useState6[1];var goEdge=(0,react.useCallback)(function(w,h,width,height){setPosition(function(pre){return getEdgePosition(pre,w,h,width,height);});setEdgeTimer(setTimeout(function(){setPosition(function(pre){return getHidePosition(pre,w,h,width,height);});},1500));},[]);var handlePointerDown=function handlePointerDown(e){!isMobile&&e.target.setPointerCapture(e.pointerId);onStart&&onStart();edgeTimer&&clearTimeout(edgeTimer);var _ref4=isMobile?e.targetTouches[0]:e,clientX=_ref4.clientX,clientY=_ref4.clientY;setOrigin({x:position.x,y:position.y,px:clientX,py:clientY});};var handlePointerMove=function handlePointerMove(e){onMove&&onMove();var _ref5=isMobile?e.targetTouches[0]:e,clientX=_ref5.clientX,clientY=_ref5.clientY;if(origin){var dx=clientX-origin.px;var dy=clientY-origin.py;var x=origin.x+dx;var y=origin.y+dy;var w=windowSize.w,h=windowSize.h;x=limitNumber(x,0,w-width);y=limitNumber(y,0,h-height);setPosition({x:x,y:y,edge:null,hide:false});}};var handlePointerUp=function handlePointerUp(e){e.stopPropagation();setOrigin(null);if(!snapEdge){return;}goEdge(windowSize.w,windowSize.h,width,height);};var handleClick=function handleClick(e){e.stopPropagation();};var handleMouseEnter=function handleMouseEnter(e){e.stopPropagation();if(snapEdge&&position.hide){edgeTimer&&clearTimeout(edgeTimer);goEdge(windowSize.w,windowSize.h,width,height);}};(0,react.useEffect)(function(){setOrigin(null);if(!snapEdge){return;}goEdge(windowSize.w,windowSize.h,width,height);},[snapEdge,goEdge,windowSize.w,windowSize.h,width,height]);(0,react.useEffect)(function(){if(position.hide){setFab({x:position.x,y:position.y});}},[position]);var opacity=(0,react.useMemo)(function(){if(snapEdge){return position.hide?0.1:1;}return origin?0.8:1;},[origin,snapEdge,position.hide]);var touchProps=isMobile?{onTouchStart:handlePointerDown,onTouchMove:handlePointerMove,onTouchEnd:handlePointerUp}:{onPointerDown:handlePointerDown,onPointerMove:handlePointerMove,onPointerUp:handlePointerUp};return/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{style:{opacity:opacity,position:"fixed",left:position.x,top:position.y,zIndex:2147483647,display:show?"block":"none"},onMouseEnter:handleMouseEnter,onClick:handleClick,children:[/*#__PURE__*/(0,jsx_runtime.jsx)("div",_objectSpread2(_objectSpread2({style:{touchAction:"none"}},touchProps),{},{children:handler})),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:children})]});}
+var getEdgePosition=function getEdgePosition(_ref,windowWidth,windowHeight,width,height){var left=_ref.x,top=_ref.y,edge=_ref.edge;var right=windowWidth-left-width;var bottom=windowHeight-top-height;var min=Math.min(left,top,right,bottom);switch(min){case right:edge="right";left=windowWidth-width;break;case left:edge="left";left=0;break;case bottom:edge="bottom";top=windowHeight-height;break;default:edge="top";top=0;}left=limitNumber(left,0,windowWidth-width);top=limitNumber(top,0,windowHeight-height);return{x:left,y:top,edge:edge,hide:false};};var getHidePosition=function getHidePosition(_ref2,windowWidth,windowHeight,width,height){var left=_ref2.x,top=_ref2.y,edge=_ref2.edge;switch(edge){case"right":left=windowWidth-width/2;break;case"left":left=-width/2;break;case"bottom":top=windowHeight-height/2;break;default:top=-height/2;}return{x:left,y:top,edge:edge,hide:true};};function Draggable(_ref3){var windowSize=_ref3.windowSize,width=_ref3.width,height=_ref3.height,left=_ref3.left,top=_ref3.top,show=_ref3.show,snapEdge=_ref3.snapEdge,onStart=_ref3.onStart,onMove=_ref3.onMove,handler=_ref3.handler,children=_ref3.children;var _useState=(0,react.useState)({x:left,y:top,px:left,py:top}),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),origin=_useState2[0],setOrigin=_useState2[1];var _useState3=(0,react.useState)({x:left,y:top,edge:null,hide:false}),_useState4=(0,slicedToArray/* default */.Z)(_useState3,2),position=_useState4[0],setPosition=_useState4[1];var _useState5=(0,react.useState)(null),_useState6=(0,slicedToArray/* default */.Z)(_useState5,2),edgeTimer=_useState6[0],setEdgeTimer=_useState6[1];var goEdge=(0,react.useCallback)(function(w,h,width,height){setPosition(function(pre){return getEdgePosition(pre,w,h,width,height);});setEdgeTimer(setTimeout(function(){setPosition(function(pre){return getHidePosition(pre,w,h,width,height);});},1500));},[]);var handlePointerDown=function handlePointerDown(e){!isMobile&&e.target.setPointerCapture(e.pointerId);onStart&&onStart();edgeTimer&&clearTimeout(edgeTimer);var _ref4=isMobile?e.targetTouches[0]:e,clientX=_ref4.clientX,clientY=_ref4.clientY;setOrigin({x:position.x,y:position.y,px:clientX,py:clientY});};var handlePointerMove=function handlePointerMove(e){onMove&&onMove();var _ref5=isMobile?e.targetTouches[0]:e,clientX=_ref5.clientX,clientY=_ref5.clientY;if(origin){var dx=clientX-origin.px;var dy=clientY-origin.py;var x=origin.x+dx;var y=origin.y+dy;var w=windowSize.w,h=windowSize.h;x=limitNumber(x,0,w-width);y=limitNumber(y,0,h-height);setPosition({x:x,y:y,edge:null,hide:false});}};var handlePointerUp=function handlePointerUp(e){e.stopPropagation();setOrigin(null);if(!snapEdge){return;}goEdge(windowSize.w,windowSize.h,width,height);};var handleClick=function handleClick(e){e.stopPropagation();};var handleMouseEnter=function handleMouseEnter(e){e.stopPropagation();if(snapEdge&&position.hide){edgeTimer&&clearTimeout(edgeTimer);goEdge(windowSize.w,windowSize.h,width,height);}};(0,react.useEffect)(function(){setOrigin(null);if(!snapEdge){return;}goEdge(windowSize.w,windowSize.h,width,height);},[snapEdge,goEdge,windowSize.w,windowSize.h,width,height]);(0,react.useEffect)(function(){if(position.hide){setFab({x:position.x,y:position.y});}},[position]);var opacity=(0,react.useMemo)(function(){if(snapEdge){return position.hide?0.2:1;}return origin?0.8:1;},[origin,snapEdge,position.hide]);var touchProps=isMobile?{onTouchStart:handlePointerDown,onTouchMove:handlePointerMove,onTouchEnd:handlePointerUp}:{onPointerDown:handlePointerDown,onPointerMove:handlePointerMove,onPointerUp:handlePointerUp};return/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{style:{opacity:opacity,position:"fixed",left:position.x,top:position.y,zIndex:2147483647,display:show?"block":"none"},onMouseEnter:handleMouseEnter,onClick:handleClick,children:[/*#__PURE__*/(0,jsx_runtime.jsx)("div",_objectSpread2(_objectSpread2({style:{touchAction:"none"}},touchProps),{},{children:handler})),/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:children})]});}
;// CONCATENATED MODULE: ./node_modules/@mui/material/IconButton/iconButtonClasses.js
@@ -22736,7 +22744,7 @@ var InputBase = /*#__PURE__*/react.forwardRef(function InputBase(inProps, ref) {
if (inputRef.current && event.currentTarget === event.target) {
inputRef.current.focus();
}
- if (onClick && !fcs.disabled) {
+ if (onClick) {
onClick(event);
}
};
@@ -25307,120 +25315,6 @@ var Grow = /*#__PURE__*/react.forwardRef(function Grow(props, ref) {
false ? 0 : void 0;
Grow.muiSupportAuto = true;
/* harmony default export */ var Grow_Grow = (Grow);
-;// CONCATENATED MODULE: ./node_modules/@mui/base/utils/ClassNameConfigurator.js
-'use client';
-
-
-
-var defaultContextValue = {
- disableDefaultClasses: false
-};
-var ClassNameConfiguratorContext = /*#__PURE__*/react.createContext(defaultContextValue);
-/**
- * @ignore - internal hook.
- *
- * Wraps the `generateUtilityClass` function and controls how the classes are generated.
- * Currently it only affects whether the classes are applied or not.
- *
- * @returns Function to be called with the `generateUtilityClass` function specific to a component to generate the classes.
- */
-function useClassNamesOverride(generateUtilityClass) {
- var _React$useContext = react.useContext(ClassNameConfiguratorContext),
- disableDefaultClasses = _React$useContext.disableDefaultClasses;
- return function (slot) {
- if (disableDefaultClasses) {
- return '';
- }
- return generateUtilityClass(slot);
- };
-}
-
-/**
- * Allows to configure the components within to not apply any built-in classes.
- */
-function ClassNameConfigurator(props) {
- var disableDefaultClasses = props.disableDefaultClasses,
- children = props.children;
- var contextValue = React.useMemo(function () {
- return {
- disableDefaultClasses: disableDefaultClasses != null ? disableDefaultClasses : false
- };
- }, [disableDefaultClasses]);
- return /*#__PURE__*/_jsx(ClassNameConfiguratorContext.Provider, {
- value: contextValue,
- children: children
- });
-}
-// EXTERNAL MODULE: ./node_modules/@mui/utils/esm/setRef.js
-var setRef = __webpack_require__(9265);
-;// CONCATENATED MODULE: ./node_modules/@mui/base/Portal/Portal.js
-'use client';
-
-
-
-
-
-
-
-function getContainer(container) {
- return typeof container === 'function' ? container() : container;
-}
-
-/**
- * Portals provide a first-class way to render children into a DOM node
- * that exists outside the DOM hierarchy of the parent component.
- *
- * Demos:
- *
- * - [Portal](https://mui.com/base-ui/react-portal/)
- *
- * API:
- *
- * - [Portal API](https://mui.com/base-ui/react-portal/components-api/#portal)
- */
-var Portal = /*#__PURE__*/react.forwardRef(function Portal(props, forwardedRef) {
- var children = props.children,
- container = props.container,
- _props$disablePortal = props.disablePortal,
- disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal;
- var _React$useState = react.useState(null),
- _React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
- mountNode = _React$useState2[0],
- setMountNode = _React$useState2[1];
- // @ts-expect-error TODO upstream fix
- var handleRef = (0,useForkRef_useForkRef/* default */.Z)( /*#__PURE__*/react.isValidElement(children) ? children.ref : null, forwardedRef);
- (0,useEnhancedEffect_useEnhancedEffect/* default */.Z)(function () {
- if (!disablePortal) {
- setMountNode(getContainer(container) || document.body);
- }
- }, [container, disablePortal]);
- (0,useEnhancedEffect_useEnhancedEffect/* default */.Z)(function () {
- if (mountNode && !disablePortal) {
- (0,setRef/* default */.Z)(forwardedRef, mountNode);
- return function () {
- (0,setRef/* default */.Z)(forwardedRef, null);
- };
- }
- return undefined;
- }, [forwardedRef, mountNode, disablePortal]);
- if (disablePortal) {
- if ( /*#__PURE__*/react.isValidElement(children)) {
- var newProps = {
- ref: handleRef
- };
- return /*#__PURE__*/react.cloneElement(children, newProps);
- }
- return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
- children: children
- });
- }
- return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
- children: mountNode ? /*#__PURE__*/react_dom.createPortal(children, mountNode) : mountNode
- });
-});
- false ? 0 : void 0;
-if (false) {}
-
// EXTERNAL MODULE: ./node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js
var ownerDocument_ownerDocument = __webpack_require__(2504);
// EXTERNAL MODULE: ./node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
@@ -25537,7 +25431,7 @@ function handleContainer(containerInfo, props) {
if (container.parentNode instanceof DocumentFragment) {
scrollContainer = (0,ownerDocument_ownerDocument/* default */.Z)(container).body;
} else {
- // Improve Gatsby support
+ // Support html overflow-y: auto for scroll stability between pages
// https://css-tricks.com/snippets/css/force-vertical-scrollbar/
var parent = container.parentElement;
var containerWindow = (0,ownerWindow/* default */.Z)(container);
@@ -25697,7 +25591,7 @@ var ModalManager = /*#__PURE__*/function () {
-function useModal_getContainer(container) {
+function getContainer(container) {
return typeof container === 'function' ? container() : container;
}
function getHasTransition(children) {
@@ -25767,7 +25661,7 @@ function useModal(parameters) {
}
};
var handleOpen = (0,useEventCallback_useEventCallback/* default */.Z)(function () {
- var resolvedContainer = useModal_getContainer(container) || getDoc().body;
+ var resolvedContainer = getContainer(container) || getDoc().body;
manager.add(getModal(), resolvedContainer);
// The element was already mounted.
@@ -26175,178 +26069,75 @@ function FocusTrap(props) {
false ? 0 : void 0;
if (false) {}
-;// CONCATENATED MODULE: ./node_modules/@mui/base/Modal/modalClasses.js
-
-
-function getModalUtilityClass(slot) {
- return (0,generateUtilityClass_generateUtilityClass/* default */.Z)('MuiModal', slot);
-}
-var modalClasses = (0,generateUtilityClasses/* default */.Z)('MuiModal', ['root', 'hidden', 'backdrop']);
-;// CONCATENATED MODULE: ./node_modules/@mui/base/Modal/Modal.js
+// EXTERNAL MODULE: ./node_modules/@mui/utils/esm/setRef.js
+var setRef = __webpack_require__(9265);
+;// CONCATENATED MODULE: ./node_modules/@mui/base/Portal/Portal.js
'use client';
-var Modal_excluded = ["children", "closeAfterTransition", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "onKeyDown", "open", "onTransitionEnter", "onTransitionExited", "slotProps", "slots"];
-
-
-
-
-
-
-
-
-var Modal_useUtilityClasses = function useUtilityClasses(ownerState) {
- var open = ownerState.open,
- exited = ownerState.exited;
- var slots = {
- root: ['root', !open && exited && 'hidden'],
- backdrop: ['backdrop']
- };
- return (0,composeClasses/* default */.Z)(slots, useClassNamesOverride(getModalUtilityClass));
-};
+function Portal_getContainer(container) {
+ return typeof container === 'function' ? container() : container;
+}
/**
- * Modal is a lower-level construct that is leveraged by the following components:
- *
- * * [Dialog](https://mui.com/material-ui/api/dialog/)
- * * [Drawer](https://mui.com/material-ui/api/drawer/)
- * * [Menu](https://mui.com/material-ui/api/menu/)
- * * [Popover](https://mui.com/material-ui/api/popover/)
- *
- * If you are creating a modal dialog, you probably want to use the [Dialog](https://mui.com/material-ui/api/dialog/) component
- * rather than directly using Modal.
- *
- * This component shares many concepts with [react-overlays](https://react-bootstrap.github.io/react-overlays/#modals).
+ * Portals provide a first-class way to render children into a DOM node
+ * that exists outside the DOM hierarchy of the parent component.
*
* Demos:
*
- * - [Modal](https://mui.com/base-ui/react-modal/)
+ * - [Portal](https://mui.com/base-ui/react-portal/)
*
* API:
*
- * - [Modal API](https://mui.com/base-ui/react-modal/components-api/#modal)
+ * - [Portal API](https://mui.com/base-ui/react-portal/components-api/#portal)
*/
-var Modal_Modal = /*#__PURE__*/react.forwardRef(function Modal(props, forwardedRef) {
- var _slots$root;
+var Portal = /*#__PURE__*/react.forwardRef(function Portal(props, forwardedRef) {
var children = props.children,
- _props$closeAfterTran = props.closeAfterTransition,
- closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran,
container = props.container,
- _props$disableAutoFoc = props.disableAutoFocus,
- disableAutoFocus = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,
- _props$disableEnforce = props.disableEnforceFocus,
- disableEnforceFocus = _props$disableEnforce === void 0 ? false : _props$disableEnforce,
- _props$disableEscapeK = props.disableEscapeKeyDown,
- disableEscapeKeyDown = _props$disableEscapeK === void 0 ? false : _props$disableEscapeK,
_props$disablePortal = props.disablePortal,
- disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
- _props$disableRestore = props.disableRestoreFocus,
- disableRestoreFocus = _props$disableRestore === void 0 ? false : _props$disableRestore,
- _props$disableScrollL = props.disableScrollLock,
- disableScrollLock = _props$disableScrollL === void 0 ? false : _props$disableScrollL,
- _props$hideBackdrop = props.hideBackdrop,
- hideBackdrop = _props$hideBackdrop === void 0 ? false : _props$hideBackdrop,
- _props$keepMounted = props.keepMounted,
- keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
- onBackdropClick = props.onBackdropClick,
- open = props.open,
- _props$slotProps = props.slotProps,
- slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
- _props$slots = props.slots,
- slots = _props$slots === void 0 ? {} : _props$slots,
- other = (0,objectWithoutPropertiesLoose/* default */.Z)(props, Modal_excluded);
- var propsWithDefaults = (0,esm_extends/* default */.Z)({}, props, {
- closeAfterTransition: closeAfterTransition,
- disableAutoFocus: disableAutoFocus,
- disableEnforceFocus: disableEnforceFocus,
- disableEscapeKeyDown: disableEscapeKeyDown,
- disablePortal: disablePortal,
- disableRestoreFocus: disableRestoreFocus,
- disableScrollLock: disableScrollLock,
- hideBackdrop: hideBackdrop,
- keepMounted: keepMounted
- });
- var _useModal = useModal((0,esm_extends/* default */.Z)({}, propsWithDefaults, {
- rootRef: forwardedRef
- })),
- getRootProps = _useModal.getRootProps,
- getBackdropProps = _useModal.getBackdropProps,
- getTransitionProps = _useModal.getTransitionProps,
- portalRef = _useModal.portalRef,
- isTopModal = _useModal.isTopModal,
- exited = _useModal.exited,
- hasTransition = _useModal.hasTransition;
- var ownerState = (0,esm_extends/* default */.Z)({}, propsWithDefaults, {
- exited: exited,
- hasTransition: hasTransition
- });
- var classes = Modal_useUtilityClasses(ownerState);
- var childProps = {};
- if (children.props.tabIndex === undefined) {
- childProps.tabIndex = '-1';
+ disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal;
+ var _React$useState = react.useState(null),
+ _React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
+ mountNode = _React$useState2[0],
+ setMountNode = _React$useState2[1];
+ // @ts-expect-error TODO upstream fix
+ var handleRef = (0,useForkRef_useForkRef/* default */.Z)( /*#__PURE__*/react.isValidElement(children) ? children.ref : null, forwardedRef);
+ (0,useEnhancedEffect_useEnhancedEffect/* default */.Z)(function () {
+ if (!disablePortal) {
+ setMountNode(Portal_getContainer(container) || document.body);
+ }
+ }, [container, disablePortal]);
+ (0,useEnhancedEffect_useEnhancedEffect/* default */.Z)(function () {
+ if (mountNode && !disablePortal) {
+ (0,setRef/* default */.Z)(forwardedRef, mountNode);
+ return function () {
+ (0,setRef/* default */.Z)(forwardedRef, null);
+ };
+ }
+ return undefined;
+ }, [forwardedRef, mountNode, disablePortal]);
+ if (disablePortal) {
+ if ( /*#__PURE__*/react.isValidElement(children)) {
+ var newProps = {
+ ref: handleRef
+ };
+ return /*#__PURE__*/react.cloneElement(children, newProps);
+ }
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
+ children: children
+ });
}
-
- // It's a Transition like component
- if (hasTransition) {
- var _getTransitionProps = getTransitionProps(),
- onEnter = _getTransitionProps.onEnter,
- onExited = _getTransitionProps.onExited;
- childProps.onEnter = onEnter;
- childProps.onExited = onExited;
- }
- var Root = (_slots$root = slots.root) != null ? _slots$root : 'div';
- var rootProps = useSlotProps({
- elementType: Root,
- externalSlotProps: slotProps.root,
- externalForwardedProps: other,
- getSlotProps: getRootProps,
- className: classes.root,
- ownerState: ownerState
- });
- var BackdropComponent = slots.backdrop;
- var backdropProps = useSlotProps({
- elementType: BackdropComponent,
- externalSlotProps: slotProps.backdrop,
- getSlotProps: function getSlotProps(otherHandlers) {
- return getBackdropProps((0,esm_extends/* default */.Z)({}, otherHandlers, {
- onClick: function onClick(e) {
- if (onBackdropClick) {
- onBackdropClick(e);
- }
- if (otherHandlers != null && otherHandlers.onClick) {
- otherHandlers.onClick(e);
- }
- }
- }));
- },
- className: classes.backdrop,
- ownerState: ownerState
- });
- if (!keepMounted && !open && (!hasTransition || exited)) {
- return null;
- }
- return /*#__PURE__*/(0,jsx_runtime.jsx)(Portal, {
- ref: portalRef,
- container: container,
- disablePortal: disablePortal,
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)(Root, (0,esm_extends/* default */.Z)({}, rootProps, {
- children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/(0,jsx_runtime.jsx)(BackdropComponent, (0,esm_extends/* default */.Z)({}, backdropProps)) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(FocusTrap, {
- disableEnforceFocus: disableEnforceFocus,
- disableAutoFocus: disableAutoFocus,
- disableRestoreFocus: disableRestoreFocus,
- isEnabled: isTopModal,
- open: open,
- children: /*#__PURE__*/react.cloneElement(children, childProps)
- })]
- }))
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
+ children: mountNode ? /*#__PURE__*/react_dom.createPortal(children, mountNode) : mountNode
});
});
false ? 0 : void 0;
+if (false) {}
;// CONCATENATED MODULE: ./node_modules/@mui/material/Fade/Fade.js
'use client';
@@ -26586,13 +26377,20 @@ var Backdrop = /*#__PURE__*/react.forwardRef(function Backdrop(inProps, ref) {
});
false ? 0 : void 0;
/* harmony default export */ var Backdrop_Backdrop = (Backdrop);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/Modal/modalClasses.js
+
+
+function getModalUtilityClass(slot) {
+ return (0,generateUtilityClass_generateUtilityClass/* default */.Z)('MuiModal', slot);
+}
+var modalClasses = (0,generateUtilityClasses/* default */.Z)('MuiModal', ['root', 'hidden', 'backdrop']);
+/* harmony default export */ var Modal_modalClasses = ((/* unused pure expression or super */ null && (modalClasses)));
;// CONCATENATED MODULE: ./node_modules/@mui/material/Modal/Modal.js
'use client';
-
-var Modal_Modal_excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
+var Modal_excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
@@ -26603,7 +26401,21 @@ var Modal_Modal_excluded = ["BackdropComponent", "BackdropProps", "classes", "cl
-var Modal_modalClasses = (/* unused pure expression or super */ null && (modalUnstyledClasses));
+
+
+
+
+
+var Modal_useUtilityClasses = function useUtilityClasses(ownerState) {
+ var open = ownerState.open,
+ exited = ownerState.exited,
+ classes = ownerState.classes;
+ var slots = {
+ root: ['root', !open && exited && 'hidden'],
+ backdrop: ['backdrop']
+ };
+ return (0,composeClasses/* default */.Z)(slots, getModalUtilityClass, classes);
+};
var ModalRoot = (0,styled/* default */.ZP)('div', {
name: 'MuiModal',
slot: 'Root',
@@ -26657,7 +26469,6 @@ var Modal = /*#__PURE__*/react.forwardRef(function Modal(inProps, ref) {
var _props$BackdropCompon = props.BackdropComponent,
BackdropComponent = _props$BackdropCompon === void 0 ? ModalBackdrop : _props$BackdropCompon,
BackdropProps = props.BackdropProps,
- classes = props.classes,
className = props.className,
_props$closeAfterTran = props.closeAfterTransition,
closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran,
@@ -26685,18 +26496,11 @@ var Modal = /*#__PURE__*/react.forwardRef(function Modal(inProps, ref) {
_props$keepMounted = props.keepMounted,
keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
onBackdropClick = props.onBackdropClick,
- onClose = props.onClose,
open = props.open,
slotProps = props.slotProps,
slots = props.slots,
- theme = props.theme,
- other = (0,objectWithoutPropertiesLoose/* default */.Z)(props, Modal_Modal_excluded);
- var _React$useState = react.useState(true),
- _React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
- exited = _React$useState2[0],
- setExited = _React$useState2[1];
- var commonProps = {
- container: container,
+ other = (0,objectWithoutPropertiesLoose/* default */.Z)(props, Modal_excluded);
+ var propsWithDefaults = (0,esm_extends/* default */.Z)({}, props, {
closeAfterTransition: closeAfterTransition,
disableAutoFocus: disableAutoFocus,
disableEnforceFocus: disableEnforceFocus,
@@ -26705,51 +26509,91 @@ var Modal = /*#__PURE__*/react.forwardRef(function Modal(inProps, ref) {
disableRestoreFocus: disableRestoreFocus,
disableScrollLock: disableScrollLock,
hideBackdrop: hideBackdrop,
- keepMounted: keepMounted,
- onBackdropClick: onBackdropClick,
- onClose: onClose,
- open: open
- };
- var ownerState = (0,esm_extends/* default */.Z)({}, props, commonProps, {
+ keepMounted: keepMounted
+ });
+ var _useModal = useModal((0,esm_extends/* default */.Z)({}, propsWithDefaults, {
+ rootRef: ref
+ })),
+ getRootProps = _useModal.getRootProps,
+ getBackdropProps = _useModal.getBackdropProps,
+ getTransitionProps = _useModal.getTransitionProps,
+ portalRef = _useModal.portalRef,
+ isTopModal = _useModal.isTopModal,
+ exited = _useModal.exited,
+ hasTransition = _useModal.hasTransition;
+ var ownerState = (0,esm_extends/* default */.Z)({}, propsWithDefaults, {
exited: exited
});
+ var classes = Modal_useUtilityClasses(ownerState);
+ var childProps = {};
+ if (children.props.tabIndex === undefined) {
+ childProps.tabIndex = '-1';
+ }
+
+ // It's a Transition like component
+ if (hasTransition) {
+ var _getTransitionProps = getTransitionProps(),
+ onEnter = _getTransitionProps.onEnter,
+ onExited = _getTransitionProps.onExited;
+ childProps.onEnter = onEnter;
+ childProps.onExited = onExited;
+ }
var RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
var BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
var rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
var backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
- return /*#__PURE__*/(0,jsx_runtime.jsx)(Modal_Modal, (0,esm_extends/* default */.Z)({
- slots: {
- root: RootSlot,
- backdrop: BackdropSlot
+ var rootProps = useSlotProps({
+ elementType: RootSlot,
+ externalSlotProps: rootSlotProps,
+ externalForwardedProps: other,
+ getSlotProps: getRootProps,
+ additionalProps: {
+ ref: ref,
+ as: component
},
- slotProps: {
- root: function root() {
- return (0,esm_extends/* default */.Z)({}, resolveComponentProps(rootSlotProps, ownerState), !isHostComponent(RootSlot) && {
- as: component,
- theme: theme
- }, {
- className: (0,clsx/* default */.Z)(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
- });
- },
- backdrop: function backdrop() {
- return (0,esm_extends/* default */.Z)({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
- className: (0,clsx/* default */.Z)(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop)
- });
- }
+ ownerState: ownerState,
+ className: (0,clsx/* default */.Z)(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
+ });
+ var backdropProps = useSlotProps({
+ elementType: BackdropSlot,
+ externalSlotProps: backdropSlotProps,
+ additionalProps: BackdropProps,
+ getSlotProps: function getSlotProps(otherHandlers) {
+ return getBackdropProps((0,esm_extends/* default */.Z)({}, otherHandlers, {
+ onClick: function onClick(e) {
+ if (onBackdropClick) {
+ onBackdropClick(e);
+ }
+ if (otherHandlers != null && otherHandlers.onClick) {
+ otherHandlers.onClick(e);
+ }
+ }
+ }));
},
- onTransitionEnter: function onTransitionEnter() {
- return setExited(false);
- },
- onTransitionExited: function onTransitionExited() {
- return setExited(true);
- },
- ref: ref
- }, other, commonProps, {
- children: children
- }));
+ className: (0,clsx/* default */.Z)(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop),
+ ownerState: ownerState
+ });
+ if (!keepMounted && !open && (!hasTransition || exited)) {
+ return null;
+ }
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(Portal, {
+ ref: portalRef,
+ container: container,
+ disablePortal: disablePortal,
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)(RootSlot, (0,esm_extends/* default */.Z)({}, rootProps, {
+ children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/(0,jsx_runtime.jsx)(BackdropSlot, (0,esm_extends/* default */.Z)({}, backdropProps)) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(FocusTrap, {
+ disableEnforceFocus: disableEnforceFocus,
+ disableAutoFocus: disableAutoFocus,
+ disableRestoreFocus: disableRestoreFocus,
+ isEnabled: isTopModal,
+ open: open,
+ children: /*#__PURE__*/react.cloneElement(children, childProps)
+ })]
+ }))
+ });
});
false ? 0 : void 0;
-/* harmony default export */ var material_Modal_Modal = (Modal);
+/* harmony default export */ var Modal_Modal = (Modal);
;// CONCATENATED MODULE: ./node_modules/@mui/material/Popover/popoverClasses.js
@@ -26821,7 +26665,7 @@ var Popover_useUtilityClasses = function useUtilityClasses(ownerState) {
};
return (0,composeClasses/* default */.Z)(slots, getPopoverUtilityClass, classes);
};
-var PopoverRoot = (0,styled/* default */.ZP)(material_Modal_Modal, {
+var PopoverRoot = (0,styled/* default */.ZP)(Modal_Modal, {
name: 'MuiPopover',
slot: 'Root',
overridesResolver: function overridesResolver(props, styles) {
@@ -27494,7 +27338,7 @@ var NativeSelectInput = /*#__PURE__*/react.forwardRef(function NativeSelectInput
function getSelectUtilityClasses(slot) {
return (0,generateUtilityClass_generateUtilityClass/* default */.Z)('MuiSelect', slot);
}
-var selectClasses = (0,generateUtilityClasses/* default */.Z)('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
+var selectClasses = (0,generateUtilityClasses/* default */.Z)('MuiSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
/* harmony default export */ var Select_selectClasses = (selectClasses);
;// CONCATENATED MODULE: ./node_modules/@mui/material/Select/SelectInput.js
'use client';
@@ -28019,7 +27863,8 @@ var createSvgIcon = __webpack_require__(1171);
-var Select_excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
+var Select_excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"],
+ Select_excluded2 = ["root"];
@@ -28101,6 +27946,7 @@ var Select = /*#__PURE__*/react.forwardRef(function Select(inProps, ref) {
classes: classesProp
});
var classes = Select_useUtilityClasses(ownerState);
+ var restOfClasses = (0,objectWithoutPropertiesLoose/* default */.Z)(classes, Select_excluded2);
var InputComponent = input || {
standard: /*#__PURE__*/(0,jsx_runtime.jsx)(StyledInput, {
ownerState: ownerState
@@ -28143,13 +27989,13 @@ var Select = /*#__PURE__*/react.forwardRef(function Select(inProps, ref) {
id: id
}, SelectDisplayProps)
}, inputProps, {
- classes: inputProps ? (0,deepmerge/* default */.Z)(classes, inputProps.classes) : classes
+ classes: inputProps ? (0,deepmerge/* default */.Z)(restOfClasses, inputProps.classes) : restOfClasses
}, input ? input.props.inputProps : {})
}, multiple && native && variant === 'outlined' ? {
notched: true
} : {}, {
ref: inputComponentRef,
- className: (0,clsx/* default */.Z)(InputComponent.props.className, className)
+ className: (0,clsx/* default */.Z)(InputComponent.props.className, className, classes.root)
}, !input && {
variant: variant
}, other))
@@ -28171,7 +28017,7 @@ var textFieldClasses = (0,generateUtilityClasses/* default */.Z)('MuiTextField',
-var TextField_excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
+var TextField_excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];
@@ -28275,7 +28121,6 @@ var TextField = /*#__PURE__*/react.forwardRef(function TextField(inProps, ref) {
name = props.name,
onBlur = props.onBlur,
onChange = props.onChange,
- onClick = props.onClick,
onFocus = props.onFocus,
placeholder = props.placeholder,
_props$required = props.required,
@@ -28316,14 +28161,6 @@ var TextField = /*#__PURE__*/react.forwardRef(function TextField(inProps, ref) {
}
InputMore['aria-describedby'] = undefined;
}
- var handleClick = function handleClick(event) {
- if (!disabled && onClick) {
- // The `onClick` is registered both on the root and the input elements.
- // Without stopping the propagation, the event could be triggered twice.
- event.stopPropagation();
- onClick(event);
- }
- };
var id = (0,useId/* default */.Z)(idOverride);
var helperTextId = helperText && id ? "".concat(id, "-helper-text") : undefined;
var inputLabelId = label && id ? "".concat(id, "-label") : undefined;
@@ -28346,7 +28183,6 @@ var TextField = /*#__PURE__*/react.forwardRef(function TextField(inProps, ref) {
onBlur: onBlur,
onChange: onChange,
onFocus: onFocus,
- onClick: handleClick,
placeholder: placeholder,
inputProps: inputProps
}, InputMore, InputProps));
@@ -28359,8 +28195,7 @@ var TextField = /*#__PURE__*/react.forwardRef(function TextField(inProps, ref) {
required: required,
color: color,
variant: variant,
- ownerState: ownerState,
- onClick: handleClick
+ ownerState: ownerState
}, other, {
children: [label != null && label !== '' && /*#__PURE__*/(0,jsx_runtime.jsx)(InputLabel_InputLabel, (0,esm_extends/* default */.Z)({
htmlFor: id,
@@ -28384,10 +28219,12 @@ var TextField = /*#__PURE__*/react.forwardRef(function TextField(inProps, ref) {
});
false ? 0 : void 0;
/* harmony default export */ var TextField_TextField = (TextField);
+;// CONCATENATED MODULE: ./src/libs/iframe.js
+var isIframe=window.self!==window.top;var sendIframeMsg=function sendIframeMsg(action,args){document.querySelectorAll("iframe").forEach(function(iframe){iframe.contentWindow.postMessage({action:action,args:args},"*");});};
;// CONCATENATED MODULE: ./src/views/Popup/index.js
-function Popup(_ref){var setShowPopup=_ref.setShowPopup,tran=_ref.translator;var i18n=useI18n();var _useState=(0,react.useState)(tran===null||tran===void 0?void 0:tran.rule),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),rule=_useState2[0],setRule=_useState2[1];var handleOpenSetting=function handleOpenSetting(){if(isExt){browser===null||browser===void 0?void 0:browser.runtime.openOptionsPage();}else{window.open("https://kiss-translator.rayjar.com/options","_blank");}setShowPopup&&setShowPopup(false);};var handleTransToggle=/*#__PURE__*/function(){var _ref2=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(e){return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;setRule(_objectSpread2(_objectSpread2({},rule),{},{transOpen:e.target.checked?"true":"false"}));if(!isExt){_context.next=7;break;}_context.next=5;return sendTabMsg(MSG_TRANS_TOGGLE);case 5:_context.next=8;break;case 7:tran.toggle();case 8:_context.next=13;break;case 10:_context.prev=10;_context.t0=_context["catch"](0);console.log("[toggle trans]",_context.t0);case 13:case"end":return _context.stop();}},_callee,null,[[0,10]]);}));return function handleTransToggle(_x){return _ref2.apply(this,arguments);};}();var handleChange=/*#__PURE__*/function(){var _ref3=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee2(e){var _e$target,name,value;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_e$target=e.target,name=_e$target.name,value=_e$target.value;setRule(function(pre){return _objectSpread2(_objectSpread2({},pre),{},(0,defineProperty/* default */.Z)({},name,value));});if(!isExt){_context2.next=8;break;}_context2.next=6;return sendTabMsg(MSG_TRANS_PUTRULE,(0,defineProperty/* default */.Z)({},name,value));case 6:_context2.next=9;break;case 8:tran.updateRule((0,defineProperty/* default */.Z)({},name,value));case 9:_context2.next=14;break;case 11:_context2.prev=11;_context2.t0=_context2["catch"](0);console.log("[update rule]",_context2.t0);case 14:case"end":return _context2.stop();}},_callee2,null,[[0,11]]);}));return function handleChange(_x2){return _ref3.apply(this,arguments);};}();(0,react.useEffect)(function(){if(!isExt){return;}asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee3(){var res;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=3;return sendTabMsg(MSG_TRANS_GETRULE);case 3:res=_context3.sent;if(!res.error){setRule(res.data);}_context3.next=10;break;case 7:_context3.prev=7;_context3.t0=_context3["catch"](0);console.log("[query rule]",_context3.t0);case 10:case"end":return _context3.stop();}},_callee3,null,[[0,7]]);}))();},[]);if(!rule){return/*#__PURE__*/(0,jsx_runtime.jsx)(Box_Box,{minWidth:300,sx:{p:2},children:/*#__PURE__*/(0,jsx_runtime.jsx)(Stack_Stack,{spacing:3,children:/*#__PURE__*/(0,jsx_runtime.jsx)(Button_Button,{variant:"text",onClick:handleOpenSetting,children:i18n("setting")})})});}var transOpen=rule.transOpen,translator=rule.translator,fromLang=rule.fromLang,toLang=rule.toLang,textStyle=rule.textStyle,bgColor=rule.bgColor;return/*#__PURE__*/(0,jsx_runtime.jsx)(Box_Box,{minWidth:300,sx:{p:2},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(Stack_Stack,{spacing:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(FormControlLabel_FormControlLabel,{control:/*#__PURE__*/(0,jsx_runtime.jsx)(Switch_Switch,{checked:transOpen==="true",onChange:handleTransToggle}),label:i18n("translate")}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:translator,name:"translator",label:i18n("translate_service"),onChange:handleChange,children:OPT_TRANS_ALL.map(function(item){return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:item,children:item},item);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:fromLang,name:"fromLang",label:i18n("from_lang"),onChange:handleChange,children:OPT_LANGS_FROM.map(function(_ref5){var _ref6=(0,slicedToArray/* default */.Z)(_ref5,2),lang=_ref6[0],name=_ref6[1];return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:lang,children:name},lang);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:toLang,name:"toLang",label:i18n("to_lang"),onChange:handleChange,children:OPT_LANGS_TO.map(function(_ref7){var _ref8=(0,slicedToArray/* default */.Z)(_ref7,2),lang=_ref8[0],name=_ref8[1];return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:lang,children:name},lang);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:textStyle,name:"textStyle",label:i18n("text_style"),onChange:handleChange,children:OPT_STYLE_ALL.map(function(item){return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:item,children:i18n(item)},item);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{size:"small",name:"bgColor",value:bgColor,label:i18n("bg_color"),onChange:handleChange}),/*#__PURE__*/(0,jsx_runtime.jsx)(Button_Button,{variant:"text",onClick:handleOpenSetting,children:i18n("setting")})]})});}
+function Popup(_ref){var setShowPopup=_ref.setShowPopup,tran=_ref.translator;var i18n=useI18n();var _useState=(0,react.useState)(tran===null||tran===void 0?void 0:tran.rule),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),rule=_useState2[0],setRule=_useState2[1];var handleOpenSetting=function handleOpenSetting(){if(isExt){browser===null||browser===void 0?void 0:browser.runtime.openOptionsPage();}else{window.open("https://kiss-translator.rayjar.com/options","_blank");}setShowPopup&&setShowPopup(false);};var handleTransToggle=/*#__PURE__*/function(){var _ref2=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(e){return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;setRule(_objectSpread2(_objectSpread2({},rule),{},{transOpen:e.target.checked?"true":"false"}));if(!isExt){_context.next=7;break;}_context.next=5;return sendTabMsg(MSG_TRANS_TOGGLE);case 5:_context.next=9;break;case 7:tran.toggle();sendIframeMsg(MSG_TRANS_TOGGLE);case 9:_context.next=14;break;case 11:_context.prev=11;_context.t0=_context["catch"](0);console.log("[toggle trans]",_context.t0);case 14:case"end":return _context.stop();}},_callee,null,[[0,11]]);}));return function handleTransToggle(_x){return _ref2.apply(this,arguments);};}();var handleChange=/*#__PURE__*/function(){var _ref3=asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee2(e){var _e$target,name,value;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_e$target=e.target,name=_e$target.name,value=_e$target.value;setRule(function(pre){return _objectSpread2(_objectSpread2({},pre),{},(0,defineProperty/* default */.Z)({},name,value));});if(!isExt){_context2.next=8;break;}_context2.next=6;return sendTabMsg(MSG_TRANS_PUTRULE,(0,defineProperty/* default */.Z)({},name,value));case 6:_context2.next=10;break;case 8:tran.updateRule((0,defineProperty/* default */.Z)({},name,value));sendIframeMsg(MSG_TRANS_PUTRULE,(0,defineProperty/* default */.Z)({},name,value));case 10:_context2.next=15;break;case 12:_context2.prev=12;_context2.t0=_context2["catch"](0);console.log("[update rule]",_context2.t0);case 15:case"end":return _context2.stop();}},_callee2,null,[[0,12]]);}));return function handleChange(_x2){return _ref3.apply(this,arguments);};}();(0,react.useEffect)(function(){if(!isExt){return;}asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee3(){var res;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=3;return sendTabMsg(MSG_TRANS_GETRULE);case 3:res=_context3.sent;if(!res.error){setRule(res.data);}_context3.next=10;break;case 7:_context3.prev=7;_context3.t0=_context3["catch"](0);console.log("[query rule]",_context3.t0);case 10:case"end":return _context3.stop();}},_callee3,null,[[0,7]]);}))();},[]);if(!rule){return/*#__PURE__*/(0,jsx_runtime.jsx)(Box_Box,{minWidth:300,sx:{p:2},children:/*#__PURE__*/(0,jsx_runtime.jsx)(Stack_Stack,{spacing:3,children:/*#__PURE__*/(0,jsx_runtime.jsx)(Button_Button,{variant:"text",onClick:handleOpenSetting,children:i18n("setting")})})});}var transOpen=rule.transOpen,translator=rule.translator,fromLang=rule.fromLang,toLang=rule.toLang,textStyle=rule.textStyle,bgColor=rule.bgColor;return/*#__PURE__*/(0,jsx_runtime.jsx)(Box_Box,{minWidth:300,sx:{p:2},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(Stack_Stack,{spacing:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(FormControlLabel_FormControlLabel,{control:/*#__PURE__*/(0,jsx_runtime.jsx)(Switch_Switch,{checked:transOpen==="true",onChange:handleTransToggle}),label:i18n("translate_alt")}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:translator,name:"translator",label:i18n("translate_service"),onChange:handleChange,children:OPT_TRANS_ALL.map(function(item){return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:item,children:item},item);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:fromLang,name:"fromLang",label:i18n("from_lang"),onChange:handleChange,children:OPT_LANGS_FROM.map(function(_ref5){var _ref6=(0,slicedToArray/* default */.Z)(_ref5,2),lang=_ref6[0],name=_ref6[1];return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:lang,children:name},lang);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:toLang,name:"toLang",label:i18n("to_lang"),onChange:handleChange,children:OPT_LANGS_TO.map(function(_ref7){var _ref8=(0,slicedToArray/* default */.Z)(_ref7,2),lang=_ref8[0],name=_ref8[1];return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:lang,children:name},lang);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{select:true,SelectProps:{MenuProps:{disablePortal:true}},size:"small",value:textStyle,name:"textStyle",label:i18n("text_style_alt"),onChange:handleChange,children:OPT_STYLE_ALL.map(function(item){return/*#__PURE__*/(0,jsx_runtime.jsx)(MenuItem_MenuItem,{value:item,children:i18n(item)},item);})}),/*#__PURE__*/(0,jsx_runtime.jsx)(TextField_TextField,{size:"small",name:"bgColor",value:bgColor,label:i18n("bg_color"),onChange:handleChange}),/*#__PURE__*/(0,jsx_runtime.jsx)(Button_Button,{variant:"text",onClick:handleOpenSetting,children:i18n("setting")})]})});}
;// CONCATENATED MODULE: ./src/views/Action/index.js
-function Action(_ref){var _fab$x,_fab$y;var translator=_ref.translator,fab=_ref.fab;var fabWidth=40;var _useState=(0,react.useState)(false),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),showPopup=_useState2[0],setShowPopup=_useState2[1];var _useState3=(0,react.useState)({w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}),_useState4=(0,slicedToArray/* default */.Z)(_useState3,2),windowSize=_useState4[0],setWindowSize=_useState4[1];var _useState5=(0,react.useState)(false),_useState6=(0,slicedToArray/* default */.Z)(_useState5,2),moved=_useState6[0],setMoved=_useState6[1];var handleWindowResize=(0,react.useMemo)(function(){return debounce(function(){setWindowSize({w:document.documentElement.clientWidth,h:document.documentElement.clientHeight});});},[]);var handleWindowClick=function handleWindowClick(e){setShowPopup(false);};var handleStart=(0,react.useCallback)(function(){setMoved(false);},[]);var handleMove=(0,react.useCallback)(function(){setMoved(true);},[]);(0,react.useEffect)(function(){window.addEventListener("resize",handleWindowResize);return function(){window.removeEventListener("resize",handleWindowResize);};},[handleWindowResize]);(0,react.useEffect)(function(){window.addEventListener("click",handleWindowClick);return function(){window.removeEventListener("click",handleWindowClick);};},[]);var popProps=(0,react.useMemo)(function(){var width=Math.min(windowSize.w,300);var height=Math.min(windowSize.h,442);var left=(windowSize.w-width)/2;var top=(windowSize.h-height)/2;return{windowSize:windowSize,width:width,height:height,left:left,top:top};},[windowSize]);var fabProps={windowSize:windowSize,width:fabWidth,height:fabWidth,left:(_fab$x=fab.x)!==null&&_fab$x!==void 0?_fab$x:0,top:(_fab$y=fab.y)!==null&&_fab$y!==void 0?_fab$y:windowSize.h/2};return/*#__PURE__*/(0,jsx_runtime.jsx)(StoragesProvider,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(MuiThemeProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Draggable,_objectSpread2(_objectSpread2({},popProps),{},{show:showPopup,onStart:handleStart,onMove:handleMove,handler:/*#__PURE__*/(0,jsx_runtime.jsx)(Paper_Paper,{style:{cursor:"move"},elevation:3,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(Stack_Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Box_Box,{style:{marginLeft:16},children:"".concat("KISS Translator"," v").concat("1.5.4")}),/*#__PURE__*/(0,jsx_runtime.jsx)(IconButton_IconButton,{onClick:function onClick(){setShowPopup(false);},children:/*#__PURE__*/(0,jsx_runtime.jsx)(Close/* default */.Z,{})})]})}),children:/*#__PURE__*/(0,jsx_runtime.jsx)(Paper_Paper,{children:showPopup&&/*#__PURE__*/(0,jsx_runtime.jsx)(Popup,{setShowPopup:setShowPopup,translator:translator})})}),"pop"),/*#__PURE__*/(0,jsx_runtime.jsx)(Draggable,_objectSpread2(_objectSpread2({snapEdge:true},fabProps),{},{show:!showPopup,onStart:handleStart,onMove:handleMove,handler:/*#__PURE__*/(0,jsx_runtime.jsx)(Fab_Fab,{size:"small",color:"primary",onClick:function onClick(e){if(!moved){setShowPopup(function(pre){return!pre;});}},children:/*#__PURE__*/(0,jsx_runtime.jsx)(Translate/* default */.Z,{})})}),"fab")]})});}
+function Action(_ref){var _fab$x,_fab$y;var translator=_ref.translator,fab=_ref.fab;var fabWidth=40;var _useState=(0,react.useState)(false),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),showPopup=_useState2[0],setShowPopup=_useState2[1];var _useState3=(0,react.useState)({w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}),_useState4=(0,slicedToArray/* default */.Z)(_useState3,2),windowSize=_useState4[0],setWindowSize=_useState4[1];var _useState5=(0,react.useState)(false),_useState6=(0,slicedToArray/* default */.Z)(_useState5,2),moved=_useState6[0],setMoved=_useState6[1];var handleWindowResize=(0,react.useMemo)(function(){return debounce(function(){setWindowSize({w:document.documentElement.clientWidth,h:document.documentElement.clientHeight});});},[]);var handleWindowClick=function handleWindowClick(e){setShowPopup(false);};var handleStart=(0,react.useCallback)(function(){setMoved(false);},[]);var handleMove=(0,react.useCallback)(function(){setMoved(true);},[]);(0,react.useEffect)(function(){window.addEventListener("resize",handleWindowResize);return function(){window.removeEventListener("resize",handleWindowResize);};},[handleWindowResize]);(0,react.useEffect)(function(){window.addEventListener("click",handleWindowClick);return function(){window.removeEventListener("click",handleWindowClick);};},[]);var popProps=(0,react.useMemo)(function(){var width=Math.min(windowSize.w,300);var height=Math.min(windowSize.h,442);var left=(windowSize.w-width)/2;var top=(windowSize.h-height)/2;return{windowSize:windowSize,width:width,height:height,left:left,top:top};},[windowSize]);var fabProps={windowSize:windowSize,width:fabWidth,height:fabWidth,left:(_fab$x=fab.x)!==null&&_fab$x!==void 0?_fab$x:0,top:(_fab$y=fab.y)!==null&&_fab$y!==void 0?_fab$y:windowSize.h/2};return/*#__PURE__*/(0,jsx_runtime.jsx)(StoragesProvider,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(MuiThemeProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Draggable,_objectSpread2(_objectSpread2({},popProps),{},{show:showPopup,onStart:handleStart,onMove:handleMove,handler:/*#__PURE__*/(0,jsx_runtime.jsx)(Paper_Paper,{style:{cursor:"move"},elevation:3,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(Stack_Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Box_Box,{style:{marginLeft:16},children:"".concat("KISS Translator"," v").concat("1.5.5")}),/*#__PURE__*/(0,jsx_runtime.jsx)(IconButton_IconButton,{onClick:function onClick(){setShowPopup(false);},children:/*#__PURE__*/(0,jsx_runtime.jsx)(Close/* default */.Z,{})})]})}),children:/*#__PURE__*/(0,jsx_runtime.jsx)(Paper_Paper,{children:showPopup&&/*#__PURE__*/(0,jsx_runtime.jsx)(Popup,{setShowPopup:setShowPopup,translator:translator})})}),"pop"),/*#__PURE__*/(0,jsx_runtime.jsx)(Draggable,_objectSpread2(_objectSpread2({snapEdge:true},fabProps),{},{show:!showPopup,onStart:handleStart,onMove:handleMove,handler:/*#__PURE__*/(0,jsx_runtime.jsx)(Fab_Fab,{size:"small",color:"primary",onClick:function onClick(e){if(!moved){setShowPopup(function(pre){return!pre;});}},children:/*#__PURE__*/(0,jsx_runtime.jsx)(Translate/* default */.Z,{})})}),"fab")]})});}
;// CONCATENATED MODULE: ./src/views/Content/LoadingIcon.js
function LoadingIcon(){return/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{viewBox:"0 0 100 100",style:{maxWidth:"1.2em",maxHeight:"1.2em"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)("circle",{fill:DEFAULT_COLOR,stroke:"none",cx:"6",cy:"50",r:"6",children:/*#__PURE__*/(0,jsx_runtime.jsx)("animateTransform",{attributeName:"transform",dur:"1s",type:"translate",values:"0 15 ; 0 -15; 0 15",repeatCount:"indefinite",begin:"0.1"})}),/*#__PURE__*/(0,jsx_runtime.jsx)("circle",{fill:DEFAULT_COLOR,stroke:"none",cx:"30",cy:"50",r:"6",children:/*#__PURE__*/(0,jsx_runtime.jsx)("animateTransform",{attributeName:"transform",dur:"1s",type:"translate",values:"0 10 ; 0 -10; 0 10",repeatCount:"indefinite",begin:"0.2"})}),/*#__PURE__*/(0,jsx_runtime.jsx)("circle",{fill:DEFAULT_COLOR,stroke:"none",cx:"54",cy:"50",r:"6",children:/*#__PURE__*/(0,jsx_runtime.jsx)("animateTransform",{attributeName:"transform",dur:"1s",type:"translate",values:"0 5 ; 0 -5; 0 5",repeatCount:"indefinite",begin:"0.3"})})]});}
;// CONCATENATED MODULE: ./src/hooks/Translate.js
@@ -28409,28 +28246,45 @@ return{color:"#FFF",backgroundColor:bgColor||DEFAULT_COLOR};default:return{};}},
;// CONCATENATED MODULE: ./src/libs/translator.js
/**
* 翻译类
- */var Translator=/*#__PURE__*/function(){function Translator(rule,_ref){var _this=this;var fetchInterval=_ref.fetchInterval,fetchLimit=_ref.fetchLimit;_classCallCheck(this,Translator);this._rule={};this._interseObserver=new IntersectionObserver(function(intersections){intersections.forEach(function(intersection){if(intersection.isIntersecting){_this._render(intersection.target);_this._interseObserver.unobserve(intersection.target);}});},{threshold:0.1});this._mutaObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){try{queryEls(_this.rule.selector,node).forEach(function(el){_this._interseObserver.observe(el);});}catch(err){//
-}});});});this.updateRule=function(obj){_this.rule=_objectSpread2(_objectSpread2({},_this.rule),obj);};this.toggle=function(){if(_this.rule.transOpen==="true"){_this.rule=_objectSpread2(_objectSpread2({},_this.rule),{},{transOpen:"false"});_this._unRegister();}else{_this.rule=_objectSpread2(_objectSpread2({},_this.rule),{},{transOpen:"true"});_this._register();}};this.toggleStyle=function(){var textStyle=_this.rule.textStyle===OPT_STYLE_FUZZY?OPT_STYLE_DASHLINE:OPT_STYLE_FUZZY;_this.rule=_objectSpread2(_objectSpread2({},_this.rule),{},{textStyle:textStyle});};this._register=function(){// 监听节点变化
-_this._mutaObserver.observe(document,{childList:true,subtree:true});// 监听节点显示
-queryEls(_this.rule.selector).forEach(function(el){_this._interseObserver.observe(el);});};this._unRegister=function(){// 解除节点变化监听
-_this._mutaObserver.disconnect();// 解除节点显示监听
-queryEls(_this.rule.selector).forEach(function(el){return _this._interseObserver.unobserve(el);});// 移除已插入元素
-queryEls(APP_LCNAME).forEach(function(el){return el.remove();});// 清空任务池
-fetchClear();};this._render=function(el){// 含子元素
-if(el.querySelector(_this.rule.selector)){return;}// 已翻译
-if(el.querySelector(APP_LCNAME)){return;}// 太长或太短
-var q=el.innerText.trim();if(!q||q.lengthTRANS_MAX_LENGTH){return;}// console.log("---> ", q);
-var span=document.createElement(APP_LCNAME);span.style.visibility="visible";el.appendChild(span);el.style.cssText+="-webkit-line-clamp: unset; max-height: none; height: auto;";el.parentElement.style.cssText+="-webkit-line-clamp: unset; max-height: none; height: auto;";var root=(0,client.createRoot)(span);root.render(/*#__PURE__*/(0,jsx_runtime.jsx)(Content,{q:q,translator:_this}));};fetchUpdate(fetchInterval,fetchLimit);this.rule=rule;if(rule.transOpen==="true"){this._register();}}_createClass(Translator,[{key:"rule",get:function get(){// console.log("get rule", this._rule);
+ */var Translator=/*#__PURE__*/function(){function Translator(rule,_ref){var _this2=this;var fetchInterval=_ref.fetchInterval,fetchLimit=_ref.fetchLimit,minLength=_ref.minLength,maxLength=_ref.maxLength;_classCallCheck(this,Translator);this._rule={};this._minLength=0;this._maxLength=0;this._skipNodeNames=[APP_LCNAME,"style","svg","img","audio","video","textarea","input","button","select","option","head","script","iframe"];this._rootNodes=new Set();this._tranNodes=new Map();// 显示
+this._interseObserver=new IntersectionObserver(function(intersections){intersections.forEach(function(intersection){if(intersection.isIntersecting){_this2._render(intersection.target);_this2._interseObserver.unobserve(intersection.target);}});},{threshold:0.1});// 变化
+this._mutaObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(!_this2._skipNodeNames.includes(mutation.target.localName)&&mutation.addedNodes.length>0){var nodes=Array.from(mutation.addedNodes).filter(function(node){if(_this2._skipNodeNames.includes(node.localName)||node.id===APP_LCNAME){return false;}return true;});if(nodes.length>0){// const rootNode = mutation.target.getRootNode();
+// todo
+_this2._reTranslate();}}});});// 插入 shadowroot
+this._overrideAttachShadow=function(){var _this=_this2;var _attachShadow=HTMLElement.prototype.attachShadow;HTMLElement.prototype.attachShadow=function(){_this._reTranslate();return _attachShadow.apply(this,arguments);};};this.updateRule=function(obj){_this2.rule=_objectSpread2(_objectSpread2({},_this2.rule),obj);};this.toggle=function(){if(_this2.rule.transOpen==="true"){_this2.rule=_objectSpread2(_objectSpread2({},_this2.rule),{},{transOpen:"false"});_this2._unRegister();}else{_this2.rule=_objectSpread2(_objectSpread2({},_this2.rule),{},{transOpen:"true"});_this2._register();}};this.toggleStyle=function(){var textStyle=_this2.rule.textStyle===OPT_STYLE_FUZZY?OPT_STYLE_DASHLINE:OPT_STYLE_FUZZY;_this2.rule=_objectSpread2(_objectSpread2({},_this2.rule),{},{textStyle:textStyle});};this._querySelectorAll=function(selector,node){try{return Array.from(node.querySelectorAll(selector));}catch(err){console.log("[querySelectorAll err]: ".concat(selector));}return[];};this._queryFilter=function(selector,rootNode){return _this2._querySelectorAll(selector,rootNode).filter(function(node){return _this2._queryFilter(selector,node).length===0;});};this._queryNodes=function(){var rootNode=arguments.length>0&&arguments[0]!==undefined?arguments[0]:document;// const childRoots = Array.from(rootNode.querySelectorAll("*"))
+// .map((item) => item.shadowRoot)
+// .filter(Boolean);
+// const childNodes = childRoots.map((item) => this._queryNodes(item));
+// const nodes = Array.from(rootNode.querySelectorAll(this.rule.selector));
+// return nodes.concat(childNodes).flat();
+_this2._rootNodes.add(rootNode);_this2._rule.selector.split(";").map(function(item){return item.trim();}).filter(Boolean).forEach(function(selector){if(selector.includes(SHADOW_KEY)){var _selector$split$map=selector.split(SHADOW_KEY).map(function(item){return item.trim();}),_selector$split$map2=(0,slicedToArray/* default */.Z)(_selector$split$map,2),outSelector=_selector$split$map2[0],inSelector=_selector$split$map2[1];if(outSelector&&inSelector){var outNodes=_this2._querySelectorAll(outSelector,rootNode);outNodes.forEach(function(outNode){if(outNode.shadowRoot){_this2._rootNodes.add(outNode.shadowRoot);_this2._queryFilter(inSelector,outNode.shadowRoot).forEach(function(item){if(!_this2._tranNodes.has(item)){_this2._tranNodes.set(item,"");}});}});}}else{_this2._queryFilter(selector,rootNode).forEach(function(item){if(!_this2._tranNodes.has(item)){_this2._tranNodes.set(item,"");}});}});};this._register=function(){// 搜索节点
+_this2._queryNodes();_this2._rootNodes.forEach(function(node){// 监听节点变化;
+_this2._mutaObserver.observe(node,{childList:true,subtree:true// characterData: true,
+});});_this2._tranNodes.forEach(function(_,node){// 监听节点显示
+_this2._interseObserver.observe(node);});};this._unRegister=function(){// 解除节点变化监听
+_this2._mutaObserver.disconnect();// 解除节点显示监听
+_this2._interseObserver.disconnect();// 移除已插入元素
+_this2._tranNodes.forEach(function(_,node){var _node$querySelector;(_node$querySelector=node.querySelector(APP_LCNAME))===null||_node$querySelector===void 0?void 0:_node$querySelector.remove();});// 清空节点集合
+_this2._rootNodes.clear();_this2._tranNodes.clear();// 清空任务池
+fetchClear();};this._reTranslate=debounce(function(){if(_this2._rule.transOpen==="true"){_this2._register();}},500);this._render=function(el){var traEl=el.querySelector(APP_LCNAME);// 已翻译
+if(traEl){var preText=_this2._tranNodes.get(el);var curText=el.innerText.trim();// const traText = traEl.innerText.trim();
+// todo
+// 1. traText when loading
+// 2. replace startsWith
+if(curText.startsWith(preText)){return;}traEl.remove();}var q=el.innerText.trim();_this2._tranNodes.set(el,q);// 太长或太短
+if(!q||q.length<_this2._minLength||q.length>_this2._maxLength){return;}// console.log("---> ", q);
+traEl=document.createElement(APP_LCNAME);traEl.style.visibility="visible";el.appendChild(traEl);el.style.cssText+="-webkit-line-clamp: unset; max-height: none; height: auto;";if(el.parentElement){el.parentElement.style.cssText+="-webkit-line-clamp: unset; max-height: none; height: auto;";}var root=(0,client.createRoot)(traEl);root.render(/*#__PURE__*/(0,jsx_runtime.jsx)(Content,{q:q,translator:_this2}));};fetchUpdate(fetchInterval,fetchLimit);this._overrideAttachShadow();this._minLength=minLength!==null&&minLength!==void 0?minLength:TRANS_MIN_LENGTH;this._maxLength=maxLength!==null&&maxLength!==void 0?maxLength:TRANS_MAX_LENGTH;this.rule=rule;if(rule.transOpen==="true"){this._register();}}_createClass(Translator,[{key:"rule",get:function get(){// console.log("get rule", this._rule);
return this._rule;},set:function set(rule){// console.log("set rule", rule);
this._rule=rule;// 广播消息
window.dispatchEvent(new CustomEvent(EVENT_KISS,{detail:{action:MSG_TRANS_CURRULE,args:rule}}));}}]);return Translator;}();
;// CONCATENATED MODULE: ./src/userscript.js
/**
* 入口函数
- */asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(){var setting,rules,rule,translator,fab,$action,shadowContainer,emotionRoot,shadowRootElement,cache;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(document.location.href.includes("http://localhost:3000/options.html")||document.location.href.includes("https://kiss-translator.rayjar.com/options")||document.location.href.includes("https://fishjar.github.io/kiss-translator/options.html"))){_context.next=4;break;}unsafeWindow.GM=GM;unsafeWindow.APP_NAME="KISS Translator";return _context.abrupt("return");case 4:if(!(window.self!==window.top)){_context.next=6;break;}return _context.abrupt("return");case 6:_context.next=8;return libs_getSetting();case 8:setting=_context.sent;_context.next=11;return libs_getRules();case 11:rules=_context.sent;_context.next=14;return matchRule(rules,document.location.href,setting);case 14:rule=_context.sent;translator=new Translator(rule,setting);// 浮球按钮
-_context.next=18;return getFab();case 18:fab=_context.sent;$action=document.createElement("div");$action.setAttribute("id","kiss-translator");document.body.parentElement.appendChild($action);shadowContainer=$action.attachShadow({mode:"open"});emotionRoot=document.createElement("style");shadowRootElement=document.createElement("div");shadowContainer.appendChild(emotionRoot);shadowContainer.appendChild(shadowRootElement);cache=(0,emotion_cache_browser_esm/* default */.Z)({key:"css",prepend:true,container:emotionRoot});client.createRoot(shadowRootElement).render(/*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(emotion_element_c39617d8_browser_esm.C,{value:cache,children:/*#__PURE__*/(0,jsx_runtime.jsx)(Action,{translator:translator,fab:fab})})}));// 注册菜单
-GM.registerMenuCommand("Toggle Translate",function(event){translator.toggle();},"Q");GM.registerMenuCommand("Toggle Style",function(event){translator.toggleStyle();},"C");// 同步订阅规则
-trySyncAllSubRules(setting);case 32:case"end":return _context.stop();}},_callee);}))();
+ */asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(){var href,setting,rules,rule,translator,fab,$action,shadowContainer,emotionRoot,shadowRootElement,cache;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(document.location.href.includes("http://localhost:3000/options.html")||document.location.href.includes("https://kiss-translator.rayjar.com/options")||document.location.href.includes("https://fishjar.github.io/kiss-translator/options.html"))){_context.next=4;break;}unsafeWindow.GM=GM;unsafeWindow.APP_NAME="KISS Translator";return _context.abrupt("return");case 4:// 翻译页面
+href=isIframe?document.referrer:document.location.href;_context.next=7;return libs_getSetting();case 7:setting=_context.sent;_context.next=10;return libs_getRules();case 10:rules=_context.sent;_context.next=13;return matchRule(rules,href,setting);case 13:rule=_context.sent;translator=new Translator(rule,setting);if(!isIframe){_context.next=18;break;}// iframe
+window.addEventListener("message",function(e){var _e$data;var action=e===null||e===void 0?void 0:(_e$data=e.data)===null||_e$data===void 0?void 0:_e$data.action;switch(action){case MSG_TRANS_TOGGLE:translator.toggle();break;case MSG_TRANS_PUTRULE:translator.updateRule(e.data.args||{});break;default:}});return _context.abrupt("return");case 18:_context.next=20;return getFab();case 20:fab=_context.sent;$action=document.createElement("div");$action.setAttribute("id","kiss-translator");document.body.parentElement.appendChild($action);shadowContainer=$action.attachShadow({mode:"closed"});emotionRoot=document.createElement("style");shadowRootElement=document.createElement("div");shadowContainer.appendChild(emotionRoot);shadowContainer.appendChild(shadowRootElement);cache=(0,emotion_cache_browser_esm/* default */.Z)({key:"css",prepend:true,container:emotionRoot});client.createRoot(shadowRootElement).render(/*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(emotion_element_c39617d8_browser_esm.C,{value:cache,children:/*#__PURE__*/(0,jsx_runtime.jsx)(Action,{translator:translator,fab:fab})})}));// 注册菜单
+if(isGm){GM.registerMenuCommand("Toggle Translate",function(event){translator.toggle();},"Q");GM.registerMenuCommand("Toggle Style",function(event){translator.toggleStyle();},"C");}// 同步订阅规则
+trySyncAllSubRules(setting);case 33:case"end":return _context.stop();}},_callee);}))();
}();
/******/ })()
;
\ No newline at end of file
diff --git a/main.js b/main.js
index 3b1524b..b375cdb 100644
--- a/main.js
+++ b/main.js
@@ -8924,31 +8924,31 @@ function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
-function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
- if (null != _i) {
- var _s,
- _e,
- _x,
- _r,
- _arr = [],
- _n = !0,
- _d = !1;
+function _iterableToArrayLimit(r, l) {
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
+ if (null != t) {
+ var e,
+ n,
+ i,
+ u,
+ a = [],
+ f = !0,
+ o = !1;
try {
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
- if (Object(_i) !== _i) return;
- _n = !1;
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
- } catch (err) {
- _d = !0, _e = err;
+ if (i = (t = t.call(r)).next, 0 === l) {
+ if (Object(t) !== t) return;
+ f = !1;
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
+ } catch (r) {
+ o = !0, n = r;
} finally {
try {
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
- if (_d) throw _e;
+ if (o) throw n;
}
}
- return _arr;
+ return a;
}
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
@@ -11147,7 +11147,7 @@ function deepClone(source) {
});
return output;
}
-function deepmerge_deepmerge(target, source) {
+function deepmerge(target, source) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
clone: true
};
@@ -11160,7 +11160,7 @@ function deepmerge_deepmerge(target, source) {
}
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
- output[key] = deepmerge_deepmerge(target[key], source[key], options);
+ output[key] = deepmerge(target[key], source[key], options);
} else if (options.clone) {
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
} else {
@@ -11171,14 +11171,14 @@ function deepmerge_deepmerge(target, source) {
return output;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
-function _typeof(obj) {
+function _typeof(o) {
"@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- }, _typeof(obj);
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
+ return typeof o;
+ } : function (o) {
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+ }, _typeof(o);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
@@ -11544,7 +11544,7 @@ function merge_merge(acc, item) {
if (!item) {
return acc;
}
- return deepmerge_deepmerge(acc, item, {
+ return deepmerge(acc, item, {
clone: false // No need to clone deep, it's way faster.
});
}
@@ -12445,7 +12445,7 @@ function createTheme() {
other = _objectWithoutPropertiesLoose(options, createTheme_excluded);
var breakpoints = createBreakpoints(breakpointsInput);
var spacing = createSpacing(spacingInput);
- var muiTheme = deepmerge_deepmerge({
+ var muiTheme = deepmerge({
breakpoints: breakpoints,
direction: 'ltr',
components: {},
@@ -12460,7 +12460,7 @@ function createTheme() {
args[_key - 1] = arguments[_key];
}
muiTheme = args.reduce(function (acc, argument) {
- return deepmerge_deepmerge(acc, argument);
+ return deepmerge(acc, argument);
}, muiTheme);
muiTheme.unstable_sxConfig = extends_extends({}, styleFunctionSx_defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
muiTheme.unstable_sx = function sx(props) {
@@ -13423,7 +13423,7 @@ function createPalette(palette) {
light: light
};
if (false) {}
- var paletteOutput = deepmerge_deepmerge(extends_extends({
+ var paletteOutput = deepmerge(extends_extends({
// A collection of common colors.
common: extends_extends({}, colors_common),
// prevent mutable object.
@@ -13553,7 +13553,7 @@ function createTypography(palette, typography) {
letterSpacing: 'inherit'
}
};
- return deepmerge_deepmerge(extends_extends({
+ return deepmerge(extends_extends({
htmlFontSize: htmlFontSize,
pxToRem: pxToRem,
fontFamily: fontFamily,
@@ -13693,7 +13693,7 @@ function styles_createTheme_createTheme() {
}
var palette = createPalette(paletteInput);
var systemTheme = createTheme_createTheme(options);
- var muiTheme = deepmerge_deepmerge(systemTheme, {
+ var muiTheme = deepmerge(systemTheme, {
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
palette: palette,
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
@@ -13702,12 +13702,12 @@ function styles_createTheme_createTheme() {
transitions: createTransitions(transitionsInput),
zIndex: extends_extends({}, styles_zIndex)
});
- muiTheme = deepmerge_deepmerge(muiTheme, other);
+ muiTheme = deepmerge(muiTheme, other);
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
muiTheme = args.reduce(function (acc, argument) {
- return deepmerge_deepmerge(acc, argument);
+ return deepmerge(acc, argument);
}, muiTheme);
if (false) { var traverse, stateClasses; }
muiTheme.unstable_sxConfig = extends_extends({}, styleFunctionSx_defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
@@ -13981,12 +13981,14 @@ tags.forEach(function (tagName) {
;// CONCATENATED MODULE: ./node_modules/@mui/styled-engine/index.js
/**
- * @mui/styled-engine v5.13.2
+ * @mui/styled-engine v5.14.6
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
+'use client';
+
/* eslint-disable no-underscore-dangle */
function styled(tag, options) {
@@ -14312,15 +14314,16 @@ var globalStateClassesMapping = {
checked: 'checked',
completed: 'completed',
disabled: 'disabled',
- readOnly: 'readOnly',
error: 'error',
expanded: 'expanded',
focused: 'focused',
focusVisible: 'focusVisible',
+ open: 'open',
+ readOnly: 'readOnly',
required: 'required',
selected: 'selected'
};
-function generateUtilityClass(componentName, slot) {
+function generateUtilityClass_generateUtilityClass(componentName, slot) {
var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui';
var globalStateClass = globalStateClassesMapping[slot];
return globalStateClass ? "".concat(globalStatePrefix, "-").concat(globalStateClass) : "".concat(ClassNameGenerator_ClassNameGenerator.generate(componentName), "-").concat(slot);
@@ -14331,7 +14334,7 @@ function generateUtilityClasses(componentName, slots) {
var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui';
var result = {};
slots.forEach(function (slot) {
- result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
+ result[slot] = generateUtilityClass_generateUtilityClass(componentName, slot, globalStatePrefix);
});
return result;
}
@@ -14339,7 +14342,7 @@ function generateUtilityClasses(componentName, slots) {
function getCircularProgressUtilityClass(slot) {
- return generateUtilityClass('MuiCircularProgress', slot);
+ return generateUtilityClass_generateUtilityClass('MuiCircularProgress', slot);
}
var circularProgressClasses = generateUtilityClasses('MuiCircularProgress', ['root', 'determinate', 'indeterminate', 'colorPrimary', 'colorSecondary', 'svg', 'circle', 'circleDeterminate', 'circleIndeterminate', 'circleDisableShrink']);
/* harmony default export */ var CircularProgress_circularProgressClasses = ((/* unused pure expression or super */ null && (circularProgressClasses)));
@@ -14520,7 +14523,7 @@ var CircularProgress = /*#__PURE__*/react.forwardRef(function CircularProgress(i
function getDividerUtilityClass(slot) {
- return generateUtilityClass('MuiDivider', slot);
+ return generateUtilityClass_generateUtilityClass('MuiDivider', slot);
}
var dividerClasses = generateUtilityClasses('MuiDivider', ['root', 'absolute', 'fullWidth', 'inset', 'middle', 'flexItem', 'light', 'vertical', 'withChildren', 'withChildrenVertical', 'textAlignRight', 'textAlignLeft', 'wrapper', 'wrapperVertical']);
/* harmony default export */ var Divider_dividerClasses = ((/* unused pure expression or super */ null && (dividerClasses)));
@@ -14722,26 +14725,26 @@ Divider.muiSkipListHighlight = true;
/* harmony default export */ var Divider_Divider = (Divider);
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
-function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
+function ownKeys(e, r) {
+ var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- enumerableOnly && (symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- })), keys.push.apply(keys, symbols);
+ var o = Object.getOwnPropertySymbols(e);
+ r && (o = o.filter(function (r) {
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
+ })), t.push.apply(t, o);
}
- return keys;
+ return t;
}
-function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = null != arguments[i] ? arguments[i] : {};
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
- _defineProperty(target, key, source[key]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+function _objectSpread2(e) {
+ for (var r = 1; r < arguments.length; r++) {
+ var t = null != arguments[r] ? arguments[r] : {};
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
+ _defineProperty(e, r, t[r]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
- return target;
+ return e;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
function _classCallCheck(instance, Constructor) {
@@ -31700,7 +31703,7 @@ var getOverlayAlpha = function getOverlayAlpha(elevation) {
function getPaperUtilityClass(slot) {
- return generateUtilityClass('MuiPaper', slot);
+ return generateUtilityClass_generateUtilityClass('MuiPaper', slot);
}
var paperClasses = 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']);
/* harmony default export */ var Paper_paperClasses = ((/* unused pure expression or super */ null && (paperClasses)));
@@ -31791,304 +31794,2038 @@ var Paper = /*#__PURE__*/react.forwardRef(function Paper(inProps, ref) {
});
false ? 0 : void 0;
/* harmony default export */ var Paper_Paper = (Paper);
+;// CONCATENATED MODULE: ./node_modules/@mui/system/esm/styled.js
+
+var esm_styled_styled = createStyled_createStyled();
+/* harmony default export */ var esm_styled = (esm_styled_styled);
+;// CONCATENATED MODULE: ./node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js
+
+
+
+var extendSxProp_excluded = ["sx"];
+
+
+var splitProps = function splitProps(props) {
+ var _props$theme$unstable, _props$theme;
+ var result = {
+ systemProps: {},
+ otherProps: {}
+ };
+ var config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : styleFunctionSx_defaultSxConfig;
+ Object.keys(props).forEach(function (prop) {
+ if (config[prop]) {
+ result.systemProps[prop] = props[prop];
+ } else {
+ result.otherProps[prop] = props[prop];
+ }
+ });
+ return result;
+};
+function extendSxProp(props) {
+ var inSx = props.sx,
+ other = _objectWithoutPropertiesLoose(props, extendSxProp_excluded);
+ var _splitProps = splitProps(other),
+ systemProps = _splitProps.systemProps,
+ otherProps = _splitProps.otherProps;
+ var finalSx;
+ if (Array.isArray(inSx)) {
+ finalSx = [systemProps].concat(toConsumableArray_toConsumableArray(inSx));
+ } else if (typeof inSx === 'function') {
+ finalSx = function finalSx() {
+ var result = inSx.apply(void 0, arguments);
+ if (!isPlainObject(result)) {
+ return systemProps;
+ }
+ return extends_extends({}, systemProps, result);
+ };
+ } else {
+ finalSx = extends_extends({}, systemProps, inSx);
+ }
+ return extends_extends({}, otherProps, {
+ sx: finalSx
+ });
+}
+;// CONCATENATED MODULE: ./node_modules/@mui/system/esm/Stack/createStack.js
+
+
+
+var createStack_excluded = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"];
+
+
+
+
+
+
+
+
+
+
+
+var createStack_defaultTheme = createTheme_createTheme();
+// widening Theme to any so that the consumer can own the theme structure.
+var defaultCreateStyledComponent = esm_styled('div', {
+ name: 'MuiStack',
+ slot: 'Root',
+ overridesResolver: function overridesResolver(props, styles) {
+ return styles.root;
+ }
+});
+function useThemePropsDefault(props) {
+ return useThemeProps({
+ props: props,
+ name: 'MuiStack',
+ defaultTheme: createStack_defaultTheme
+ });
+}
+
+/**
+ * Return an array with the separator React element interspersed between
+ * each React node of the input children.
+ *
+ * > joinChildren([1,2,3], 0)
+ * [1,0,2,0,3]
+ */
+function joinChildren(children, separator) {
+ var childrenArray = react.Children.toArray(children).filter(Boolean);
+ return childrenArray.reduce(function (output, child, index) {
+ output.push(child);
+ if (index < childrenArray.length - 1) {
+ output.push( /*#__PURE__*/react.cloneElement(separator, {
+ key: "separator-".concat(index)
+ }));
+ }
+ return output;
+ }, []);
+}
+var getSideFromDirection = function getSideFromDirection(direction) {
+ return {
+ row: 'Left',
+ 'row-reverse': 'Right',
+ column: 'Top',
+ 'column-reverse': 'Bottom'
+ }[direction];
+};
+var createStack_style = function style(_ref) {
+ var ownerState = _ref.ownerState,
+ theme = _ref.theme;
+ var styles = extends_extends({
+ display: 'flex',
+ flexDirection: 'column'
+ }, handleBreakpoints({
+ theme: theme
+ }, resolveBreakpointValues({
+ values: ownerState.direction,
+ breakpoints: theme.breakpoints.values
+ }), function (propValue) {
+ return {
+ flexDirection: propValue
+ };
+ }));
+ if (ownerState.spacing) {
+ var transformer = createUnarySpacing(theme);
+ var base = Object.keys(theme.breakpoints.values).reduce(function (acc, breakpoint) {
+ if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
+ acc[breakpoint] = true;
+ }
+ return acc;
+ }, {});
+ var directionValues = resolveBreakpointValues({
+ values: ownerState.direction,
+ base: base
+ });
+ var spacingValues = resolveBreakpointValues({
+ values: ownerState.spacing,
+ base: base
+ });
+ if (typeof directionValues === 'object') {
+ Object.keys(directionValues).forEach(function (breakpoint, index, breakpoints) {
+ var directionValue = directionValues[breakpoint];
+ if (!directionValue) {
+ var previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
+ directionValues[breakpoint] = previousDirectionValue;
+ }
+ });
+ }
+ var styleFromPropValue = function styleFromPropValue(propValue, breakpoint) {
+ if (ownerState.useFlexGap) {
+ return {
+ gap: getValue(transformer, propValue)
+ };
+ }
+ return {
+ // The useFlexGap={false} implement relies on each child to give up control of the margin.
+ // We need to reset the margin to avoid double spacing.
+ '& > :not(style):not(style)': {
+ margin: 0
+ },
+ '& > :not(style) ~ :not(style)': _defineProperty({}, "margin".concat(getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)), getValue(transformer, propValue))
+ };
+ };
+ styles = deepmerge(styles, handleBreakpoints({
+ theme: theme
+ }, spacingValues, styleFromPropValue));
+ }
+ styles = mergeBreakpointsInOrder(theme.breakpoints, styles);
+ return styles;
+};
+function createStack() {
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ var _options$createStyled = options.createStyledComponent,
+ createStyledComponent = _options$createStyled === void 0 ? defaultCreateStyledComponent : _options$createStyled,
+ _options$useThemeProp = options.useThemeProps,
+ useThemeProps = _options$useThemeProp === void 0 ? useThemePropsDefault : _options$useThemeProp,
+ _options$componentNam = options.componentName,
+ componentName = _options$componentNam === void 0 ? 'MuiStack' : _options$componentNam;
+ var useUtilityClasses = function useUtilityClasses() {
+ var slots = {
+ root: ['root']
+ };
+ return composeClasses(slots, function (slot) {
+ return generateUtilityClass_generateUtilityClass(componentName, slot);
+ }, {});
+ };
+ var StackRoot = createStyledComponent(createStack_style);
+ var Stack = /*#__PURE__*/react.forwardRef(function Grid(inProps, ref) {
+ var themeProps = useThemeProps(inProps);
+ var props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
+ var _props$component = props.component,
+ component = _props$component === void 0 ? 'div' : _props$component,
+ _props$direction = props.direction,
+ direction = _props$direction === void 0 ? 'column' : _props$direction,
+ _props$spacing = props.spacing,
+ spacing = _props$spacing === void 0 ? 0 : _props$spacing,
+ divider = props.divider,
+ children = props.children,
+ className = props.className,
+ _props$useFlexGap = props.useFlexGap,
+ useFlexGap = _props$useFlexGap === void 0 ? false : _props$useFlexGap,
+ other = _objectWithoutPropertiesLoose(props, createStack_excluded);
+ var ownerState = {
+ direction: direction,
+ spacing: spacing,
+ useFlexGap: useFlexGap
+ };
+ var classes = useUtilityClasses();
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(StackRoot, extends_extends({
+ as: component,
+ ownerState: ownerState,
+ ref: ref,
+ className: dist_clsx(classes.root, className)
+ }, other, {
+ children: divider ? joinChildren(children, divider) : children
+ }));
+ });
+ false ? 0 : void 0;
+ return Stack;
+}
+;// CONCATENATED MODULE: ./node_modules/@mui/material/Stack/Stack.js
+'use client';
+
+
+
+
+
+var Stack = createStack({
+ createStyledComponent: styles_styled('div', {
+ name: 'MuiStack',
+ slot: 'Root',
+ overridesResolver: function overridesResolver(props, styles) {
+ return styles.root;
+ }
+ }),
+ useThemeProps: function useThemeProps(inProps) {
+ return useThemeProps_useThemeProps({
+ props: inProps,
+ name: 'MuiStack'
+ });
+ }
+});
+ false ? 0 : void 0;
+/* harmony default export */ var Stack_Stack = (Stack);
+;// CONCATENATED MODULE: ./node_modules/@mui/utils/esm/setRef.js
+/**
+ * TODO v5: consider making it private
+ *
+ * passes {value} to {ref}
+ *
+ * WARNING: Be sure to only call this inside a callback that is passed as a ref.
+ * Otherwise, make sure to cleanup the previous {ref} if it changes. See
+ * https://github.com/mui/material-ui/issues/13539
+ *
+ * Useful if you want to expose the ref of an inner component to the public API
+ * while still using it inside the component.
+ * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
+ */
+function setRef(ref, value) {
+ if (typeof ref === 'function') {
+ ref(value);
+ } else if (ref) {
+ ref.current = value;
+ }
+}
+;// CONCATENATED MODULE: ./node_modules/@mui/utils/esm/useForkRef/useForkRef.js
+'use client';
+
+
+
+function useForkRef() {
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
+ refs[_key] = arguments[_key];
+ }
+ /**
+ * This will create a new function if the refs passed to this hook change and are all defined.
+ * This means react will call the old forkRef with `null` and the new forkRef
+ * with the ref. Cleanup naturally emerges from this behavior.
+ */
+ return react.useMemo(function () {
+ if (refs.every(function (ref) {
+ return ref == null;
+ })) {
+ return null;
+ }
+ return function (instance) {
+ refs.forEach(function (ref) {
+ setRef(ref, instance);
+ });
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, refs);
+}
+;// CONCATENATED MODULE: ./node_modules/@mui/material/utils/useForkRef.js
+'use client';
+
+
+/* harmony default export */ var utils_useForkRef = (useForkRef);
+;// CONCATENATED MODULE: ./node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
+'use client';
+
+
+var useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
+/* harmony default export */ var useEnhancedEffect_useEnhancedEffect = (useEnhancedEffect);
+;// CONCATENATED MODULE: ./node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
+'use client';
+
+
+
+
+/**
+ * https://github.com/facebook/react/issues/14099#issuecomment-440013892
+ */
+
+function useEventCallback(fn) {
+ var ref = react.useRef(fn);
+ useEnhancedEffect_useEnhancedEffect(function () {
+ ref.current = fn;
+ });
+ return react.useCallback(function () {
+ return (
+ // @ts-expect-error hide `this`
+ // tslint:disable-next-line:ban-comma-operator
+ (0, ref.current).apply(void 0, arguments)
+ );
+ }, []);
+}
+/* harmony default export */ var useEventCallback_useEventCallback = (useEventCallback);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/utils/useEventCallback.js
+'use client';
+
+
+/* harmony default export */ var utils_useEventCallback = (useEventCallback_useEventCallback);
+;// CONCATENATED MODULE: ./node_modules/@mui/utils/esm/useIsFocusVisible.js
+'use client';
+
+// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
+
+var hadKeyboardEvent = true;
+var hadFocusVisibleRecently = false;
+var hadFocusVisibleRecentlyTimeout;
+var inputTypesWhitelist = {
+ text: true,
+ search: true,
+ url: true,
+ tel: true,
+ email: true,
+ password: true,
+ number: true,
+ date: true,
+ month: true,
+ week: true,
+ time: true,
+ datetime: true,
+ 'datetime-local': true
+};
+
+/**
+ * Computes whether the given element should automatically trigger the
+ * `focus-visible` class being added, i.e. whether it should always match
+ * `:focus-visible` when focused.
+ * @param {Element} node
+ * @returns {boolean}
+ */
+function focusTriggersKeyboardModality(node) {
+ var type = node.type,
+ tagName = node.tagName;
+ if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
+ return true;
+ }
+ if (tagName === 'TEXTAREA' && !node.readOnly) {
+ return true;
+ }
+ if (node.isContentEditable) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Keep track of our keyboard modality state with `hadKeyboardEvent`.
+ * If the most recent user interaction was via the keyboard;
+ * and the key press did not include a meta, alt/option, or control key;
+ * then the modality is keyboard. Otherwise, the modality is not keyboard.
+ * @param {KeyboardEvent} event
+ */
+function handleKeyDown(event) {
+ if (event.metaKey || event.altKey || event.ctrlKey) {
+ return;
+ }
+ hadKeyboardEvent = true;
+}
+
+/**
+ * If at any point a user clicks with a pointing device, ensure that we change
+ * the modality away from keyboard.
+ * This avoids the situation where a user presses a key on an already focused
+ * element, and then clicks on a different element, focusing it with a
+ * pointing device, while we still think we're in keyboard modality.
+ */
+function handlePointerDown() {
+ hadKeyboardEvent = false;
+}
+function handleVisibilityChange() {
+ if (this.visibilityState === 'hidden') {
+ // If the tab becomes active again, the browser will handle calling focus
+ // on the element (Safari actually calls it twice).
+ // If this tab change caused a blur on an element with focus-visible,
+ // re-apply the class when the user switches back to the tab.
+ if (hadFocusVisibleRecently) {
+ hadKeyboardEvent = true;
+ }
+ }
+}
+function prepare(doc) {
+ doc.addEventListener('keydown', handleKeyDown, true);
+ doc.addEventListener('mousedown', handlePointerDown, true);
+ doc.addEventListener('pointerdown', handlePointerDown, true);
+ doc.addEventListener('touchstart', handlePointerDown, true);
+ doc.addEventListener('visibilitychange', handleVisibilityChange, true);
+}
+function teardown(doc) {
+ doc.removeEventListener('keydown', handleKeyDown, true);
+ doc.removeEventListener('mousedown', handlePointerDown, true);
+ doc.removeEventListener('pointerdown', handlePointerDown, true);
+ doc.removeEventListener('touchstart', handlePointerDown, true);
+ doc.removeEventListener('visibilitychange', handleVisibilityChange, true);
+}
+function isFocusVisible(event) {
+ var target = event.target;
+ try {
+ return target.matches(':focus-visible');
+ } catch (error) {
+ // Browsers not implementing :focus-visible will throw a SyntaxError.
+ // We use our own heuristic for those browsers.
+ // Rethrow might be better if it's not the expected error but do we really
+ // want to crash if focus-visible malfunctioned?
+ }
+
+ // No need for validFocusTarget check. The user does that by attaching it to
+ // focusable events only.
+ return hadKeyboardEvent || focusTriggersKeyboardModality(target);
+}
+function useIsFocusVisible() {
+ var ref = react.useCallback(function (node) {
+ if (node != null) {
+ prepare(node.ownerDocument);
+ }
+ }, []);
+ var isFocusVisibleRef = react.useRef(false);
+
+ /**
+ * Should be called if a blur event is fired
+ */
+ function handleBlurVisible() {
+ // checking against potential state variable does not suffice if we focus and blur synchronously.
+ // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
+ // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
+ // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
+ // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
+ if (isFocusVisibleRef.current) {
+ // To detect a tab/window switch, we look for a blur event followed
+ // rapidly by a visibility change.
+ // If we don't see a visibility change within 100ms, it's probably a
+ // regular focus change.
+ hadFocusVisibleRecently = true;
+ window.clearTimeout(hadFocusVisibleRecentlyTimeout);
+ hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
+ hadFocusVisibleRecently = false;
+ }, 100);
+ isFocusVisibleRef.current = false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Should be called if a blur event is fired
+ */
+ function handleFocusVisible(event) {
+ if (isFocusVisible(event)) {
+ isFocusVisibleRef.current = true;
+ return true;
+ }
+ return false;
+ }
+ return {
+ isFocusVisibleRef: isFocusVisibleRef,
+ onFocus: handleFocusVisible,
+ onBlur: handleBlurVisible,
+ ref: ref
+ };
+}
+;// CONCATENATED MODULE: ./node_modules/@mui/material/utils/useIsFocusVisible.js
+'use client';
+
+
+/* harmony default export */ var utils_useIsFocusVisible = (useIsFocusVisible);
+;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
+
+function _inheritsLoose(subClass, superClass) {
+ subClass.prototype = Object.create(superClass.prototype);
+ subClass.prototype.constructor = subClass;
+ _setPrototypeOf(subClass, superClass);
+}
+;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/TransitionGroupContext.js
+
+/* harmony default export */ var TransitionGroupContext = (react.createContext(null));
+;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/utils/ChildMapping.js
+
+/**
+ * Given `this.props.children`, return an object mapping key to child.
+ *
+ * @param {*} children `this.props.children`
+ * @return {object} Mapping of key to child
+ */
+
+function getChildMapping(children, mapFn) {
+ var mapper = function mapper(child) {
+ return mapFn && (0,react.isValidElement)(child) ? mapFn(child) : child;
+ };
+ var result = Object.create(null);
+ if (children) react.Children.map(children, function (c) {
+ return c;
+ }).forEach(function (child) {
+ // run the map function here instead so that the key is the computed one
+ result[child.key] = mapper(child);
+ });
+ return result;
+}
+/**
+ * When you're adding or removing children some may be added or removed in the
+ * same render pass. We want to show *both* since we want to simultaneously
+ * animate elements in and out. This function takes a previous set of keys
+ * and a new set of keys and merges them with its best guess of the correct
+ * ordering. In the future we may expose some of the utilities in
+ * ReactMultiChild to make this easy, but for now React itself does not
+ * directly have this concept of the union of prevChildren and nextChildren
+ * so we implement it here.
+ *
+ * @param {object} prev prev children as returned from
+ * `ReactTransitionChildMapping.getChildMapping()`.
+ * @param {object} next next children as returned from
+ * `ReactTransitionChildMapping.getChildMapping()`.
+ * @return {object} a key set that contains all keys in `prev` and all keys
+ * in `next` in a reasonable order.
+ */
+
+function mergeChildMappings(prev, next) {
+ prev = prev || {};
+ next = next || {};
+ function getValueForKey(key) {
+ return key in next ? next[key] : prev[key];
+ } // For each key of `next`, the list of keys to insert before that key in
+ // the combined list
+
+ var nextKeysPending = Object.create(null);
+ var pendingKeys = [];
+ for (var prevKey in prev) {
+ if (prevKey in next) {
+ if (pendingKeys.length) {
+ nextKeysPending[prevKey] = pendingKeys;
+ pendingKeys = [];
+ }
+ } else {
+ pendingKeys.push(prevKey);
+ }
+ }
+ var i;
+ var childMapping = {};
+ for (var nextKey in next) {
+ if (nextKeysPending[nextKey]) {
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
+ var pendingNextKey = nextKeysPending[nextKey][i];
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
+ }
+ }
+ childMapping[nextKey] = getValueForKey(nextKey);
+ } // Finally, add the keys which didn't appear before any key in `next`
+
+ for (i = 0; i < pendingKeys.length; i++) {
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
+ }
+ return childMapping;
+}
+function getProp(child, prop, props) {
+ return props[prop] != null ? props[prop] : child.props[prop];
+}
+function getInitialChildMapping(props, onExited) {
+ return getChildMapping(props.children, function (child) {
+ return (0,react.cloneElement)(child, {
+ onExited: onExited.bind(null, child),
+ in: true,
+ appear: getProp(child, 'appear', props),
+ enter: getProp(child, 'enter', props),
+ exit: getProp(child, 'exit', props)
+ });
+ });
+}
+function getNextChildMapping(nextProps, prevChildMapping, onExited) {
+ var nextChildMapping = getChildMapping(nextProps.children);
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
+ Object.keys(children).forEach(function (key) {
+ var child = children[key];
+ if (!(0,react.isValidElement)(child)) return;
+ var hasPrev = (key in prevChildMapping);
+ var hasNext = (key in nextChildMapping);
+ var prevChild = prevChildMapping[key];
+ var isLeaving = (0,react.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)
+
+ if (hasNext && (!hasPrev || isLeaving)) {
+ // console.log('entering', key)
+ children[key] = (0,react.cloneElement)(child, {
+ onExited: onExited.bind(null, child),
+ in: true,
+ exit: getProp(child, 'exit', nextProps),
+ enter: getProp(child, 'enter', nextProps)
+ });
+ } else if (!hasNext && hasPrev && !isLeaving) {
+ // item is old (exiting)
+ // console.log('leaving', key)
+ children[key] = (0,react.cloneElement)(child, {
+ in: false
+ });
+ } else if (hasNext && hasPrev && (0,react.isValidElement)(prevChild)) {
+ // item hasn't changed transition states
+ // copy over the last transition props;
+ // console.log('unchanged', key)
+ children[key] = (0,react.cloneElement)(child, {
+ onExited: onExited.bind(null, child),
+ in: prevChild.props.in,
+ exit: getProp(child, 'exit', nextProps),
+ enter: getProp(child, 'enter', nextProps)
+ });
+ }
+ });
+ return children;
+}
+;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/TransitionGroup.js
+
+
+
+
+
+
+
+
+var TransitionGroup_values = Object.values || function (obj) {
+ return Object.keys(obj).map(function (k) {
+ return obj[k];
+ });
+};
+var defaultProps = {
+ component: 'div',
+ childFactory: function childFactory(child) {
+ return child;
+ }
+};
+/**
+ * The `` component manages a set of transition components
+ * (`` and ``) in a list. Like with the transition
+ * components, `` is a state machine for managing the mounting
+ * and unmounting of components over time.
+ *
+ * Consider the example below. As items are removed or added to the TodoList the
+ * `in` prop is toggled automatically by the ``.
+ *
+ * Note that `` does not define any animation behavior!
+ * Exactly _how_ a list item animates is up to the individual transition
+ * component. This means you can mix and match animations across different list
+ * items.
+ */
+
+var TransitionGroup = /*#__PURE__*/function (_React$Component) {
+ _inheritsLoose(TransitionGroup, _React$Component);
+ function TransitionGroup(props, context) {
+ var _this;
+ _this = _React$Component.call(this, props, context) || this;
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
+
+ _this.state = {
+ contextValue: {
+ isMounting: true
+ },
+ handleExited: handleExited,
+ firstRender: true
+ };
+ return _this;
+ }
+ var _proto = TransitionGroup.prototype;
+ _proto.componentDidMount = function componentDidMount() {
+ this.mounted = true;
+ this.setState({
+ contextValue: {
+ isMounting: false
+ }
+ });
+ };
+ _proto.componentWillUnmount = function componentWillUnmount() {
+ this.mounted = false;
+ };
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
+ var prevChildMapping = _ref.children,
+ handleExited = _ref.handleExited,
+ firstRender = _ref.firstRender;
+ return {
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
+ firstRender: false
+ };
+ } // node is `undefined` when user provided `nodeRef` prop
+ ;
+
+ _proto.handleExited = function handleExited(child, node) {
+ var currentChildMapping = getChildMapping(this.props.children);
+ if (child.key in currentChildMapping) return;
+ if (child.props.onExited) {
+ child.props.onExited(node);
+ }
+ if (this.mounted) {
+ this.setState(function (state) {
+ var children = extends_extends({}, state.children);
+ delete children[child.key];
+ return {
+ children: children
+ };
+ });
+ }
+ };
+ _proto.render = function render() {
+ var _this$props = this.props,
+ Component = _this$props.component,
+ childFactory = _this$props.childFactory,
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
+ var contextValue = this.state.contextValue;
+ var children = TransitionGroup_values(this.state.children).map(childFactory);
+ delete props.appear;
+ delete props.enter;
+ delete props.exit;
+ if (Component === null) {
+ return /*#__PURE__*/react.createElement(TransitionGroupContext.Provider, {
+ value: contextValue
+ }, children);
+ }
+ return /*#__PURE__*/react.createElement(TransitionGroupContext.Provider, {
+ value: contextValue
+ }, /*#__PURE__*/react.createElement(Component, props, children));
+ };
+ return TransitionGroup;
+}(react.Component);
+TransitionGroup.propTypes = false ? 0 : {};
+TransitionGroup.defaultProps = defaultProps;
+/* harmony default export */ var esm_TransitionGroup = (TransitionGroup);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/ButtonBase/Ripple.js
+'use client';
+
+
+
+
+
+
+/**
+ * @ignore - internal component.
+ */
+
+function Ripple(props) {
+ var className = props.className,
+ classes = props.classes,
+ _props$pulsate = props.pulsate,
+ pulsate = _props$pulsate === void 0 ? false : _props$pulsate,
+ rippleX = props.rippleX,
+ rippleY = props.rippleY,
+ rippleSize = props.rippleSize,
+ inProp = props.in,
+ onExited = props.onExited,
+ timeout = props.timeout;
+ var _React$useState = react.useState(false),
+ _React$useState2 = _slicedToArray(_React$useState, 2),
+ leaving = _React$useState2[0],
+ setLeaving = _React$useState2[1];
+ var rippleClassName = dist_clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
+ var rippleStyles = {
+ width: rippleSize,
+ height: rippleSize,
+ top: -(rippleSize / 2) + rippleY,
+ left: -(rippleSize / 2) + rippleX
+ };
+ var childClassName = dist_clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
+ if (!inProp && !leaving) {
+ setLeaving(true);
+ }
+ react.useEffect(function () {
+ if (!inProp && onExited != null) {
+ // react-transition-group#onExited
+ var timeoutId = setTimeout(onExited, timeout);
+ return function () {
+ clearTimeout(timeoutId);
+ };
+ }
+ return undefined;
+ }, [onExited, inProp, timeout]);
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ className: rippleClassName,
+ style: rippleStyles,
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
+ className: childClassName
+ })
+ });
+}
+ false ? 0 : void 0;
+/* harmony default export */ var ButtonBase_Ripple = (Ripple);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/ButtonBase/touchRippleClasses.js
+
+
+function getTouchRippleUtilityClass(slot) {
+ return generateUtilityClass('MuiTouchRipple', slot);
+}
+var touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
+/* harmony default export */ var ButtonBase_touchRippleClasses = (touchRippleClasses);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/ButtonBase/TouchRipple.js
+'use client';
+
+
+
+
+var TouchRipple_templateObject, TouchRipple_templateObject2, TouchRipple_templateObject3, TouchRipple_templateObject4;
+
+
+var TouchRipple_excluded = ["center", "classes", "className"];
+var TouchRipple_ = function _(t) {
+ return t;
+ },
+ TouchRipple_t,
+ TouchRipple_t2,
+ TouchRipple_t3,
+ TouchRipple_t4;
+
+
+
+
+
+
+
+
+
+
+var DURATION = 550;
+var DELAY_RIPPLE = 80;
+var enterKeyframe = keyframes(TouchRipple_t || (TouchRipple_t = TouchRipple_(TouchRipple_templateObject || (TouchRipple_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"])))));
+var exitKeyframe = keyframes(TouchRipple_t2 || (TouchRipple_t2 = TouchRipple_(TouchRipple_templateObject2 || (TouchRipple_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"])))));
+var pulsateKeyframe = keyframes(TouchRipple_t3 || (TouchRipple_t3 = TouchRipple_(TouchRipple_templateObject3 || (TouchRipple_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])))));
+var TouchRippleRoot = styles_styled('span', {
+ name: 'MuiTouchRipple',
+ slot: 'Root'
+})({
+ overflow: 'hidden',
+ pointerEvents: 'none',
+ position: 'absolute',
+ zIndex: 0,
+ top: 0,
+ right: 0,
+ bottom: 0,
+ left: 0,
+ borderRadius: 'inherit'
+});
+
+// This `styled()` function invokes keyframes. `styled-components` only supports keyframes
+// in string templates. Do not convert these styles in JS object as it will break.
+var TouchRippleRipple = styles_styled(ButtonBase_Ripple, {
+ name: 'MuiTouchRipple',
+ slot: 'Ripple'
+})(TouchRipple_t4 || (TouchRipple_t4 = TouchRipple_(TouchRipple_templateObject4 || (TouchRipple_templateObject4 = _taggedTemplateLiteral(["\n opacity: 0;\n position: absolute;\n\n &.", " {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ", ";\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n }\n\n &.", " {\n animation-duration: ", "ms;\n }\n\n & .", " {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .", " {\n opacity: 0;\n animation-name: ", ";\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n }\n\n & .", " {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ", ";\n animation-duration: 2500ms;\n animation-timing-function: ", ";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"])), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), ButtonBase_touchRippleClasses.rippleVisible, enterKeyframe, DURATION, function (_ref) {
+ var theme = _ref.theme;
+ return theme.transitions.easing.easeInOut;
+}, ButtonBase_touchRippleClasses.ripplePulsate, function (_ref2) {
+ var theme = _ref2.theme;
+ return theme.transitions.duration.shorter;
+}, ButtonBase_touchRippleClasses.child, ButtonBase_touchRippleClasses.childLeaving, exitKeyframe, DURATION, function (_ref3) {
+ var theme = _ref3.theme;
+ return theme.transitions.easing.easeInOut;
+}, ButtonBase_touchRippleClasses.childPulsate, pulsateKeyframe, function (_ref4) {
+ var theme = _ref4.theme;
+ return theme.transitions.easing.easeInOut;
+});
+
+/**
+ * @ignore - internal component.
+ *
+ * TODO v5: Make private
+ */
+var TouchRipple = /*#__PURE__*/react.forwardRef(function TouchRipple(inProps, ref) {
+ var props = useThemeProps_useThemeProps({
+ props: inProps,
+ name: 'MuiTouchRipple'
+ });
+ var _props$center = props.center,
+ centerProp = _props$center === void 0 ? false : _props$center,
+ _props$classes = props.classes,
+ classes = _props$classes === void 0 ? {} : _props$classes,
+ className = props.className,
+ other = _objectWithoutPropertiesLoose(props, TouchRipple_excluded);
+ var _React$useState = react.useState([]),
+ _React$useState2 = _slicedToArray(_React$useState, 2),
+ ripples = _React$useState2[0],
+ setRipples = _React$useState2[1];
+ var nextKey = react.useRef(0);
+ var rippleCallback = react.useRef(null);
+ react.useEffect(function () {
+ if (rippleCallback.current) {
+ rippleCallback.current();
+ rippleCallback.current = null;
+ }
+ }, [ripples]);
+
+ // Used to filter out mouse emulated events on mobile.
+ var ignoringMouseDown = react.useRef(false);
+ // We use a timer in order to only show the ripples for touch "click" like events.
+ // We don't want to display the ripple for touch scroll events.
+ var startTimer = react.useRef(0);
+
+ // This is the hook called once the previous timeout is ready.
+ var startTimerCommit = react.useRef(null);
+ var container = react.useRef(null);
+ react.useEffect(function () {
+ return function () {
+ if (startTimer.current) {
+ clearTimeout(startTimer.current);
+ }
+ };
+ }, []);
+ var startCommit = react.useCallback(function (params) {
+ var pulsate = params.pulsate,
+ rippleX = params.rippleX,
+ rippleY = params.rippleY,
+ rippleSize = params.rippleSize,
+ cb = params.cb;
+ setRipples(function (oldRipples) {
+ return [].concat(toConsumableArray_toConsumableArray(oldRipples), [/*#__PURE__*/(0,jsx_runtime.jsx)(TouchRippleRipple, {
+ classes: {
+ ripple: dist_clsx(classes.ripple, ButtonBase_touchRippleClasses.ripple),
+ rippleVisible: dist_clsx(classes.rippleVisible, ButtonBase_touchRippleClasses.rippleVisible),
+ ripplePulsate: dist_clsx(classes.ripplePulsate, ButtonBase_touchRippleClasses.ripplePulsate),
+ child: dist_clsx(classes.child, ButtonBase_touchRippleClasses.child),
+ childLeaving: dist_clsx(classes.childLeaving, ButtonBase_touchRippleClasses.childLeaving),
+ childPulsate: dist_clsx(classes.childPulsate, ButtonBase_touchRippleClasses.childPulsate)
+ },
+ timeout: DURATION,
+ pulsate: pulsate,
+ rippleX: rippleX,
+ rippleY: rippleY,
+ rippleSize: rippleSize
+ }, nextKey.current)]);
+ });
+ nextKey.current += 1;
+ rippleCallback.current = cb;
+ }, [classes]);
+ var start = react.useCallback(function () {
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
+ var _options$pulsate = options.pulsate,
+ pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
+ _options$center = options.center,
+ center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,
+ _options$fakeElement = options.fakeElement,
+ fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;
+ if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {
+ ignoringMouseDown.current = false;
+ return;
+ }
+ if ((event == null ? void 0 : event.type) === 'touchstart') {
+ ignoringMouseDown.current = true;
+ }
+ var element = fakeElement ? null : container.current;
+ var rect = element ? element.getBoundingClientRect() : {
+ width: 0,
+ height: 0,
+ left: 0,
+ top: 0
+ };
+
+ // Get the size of the ripple
+ var rippleX;
+ var rippleY;
+ var rippleSize;
+ if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
+ rippleX = Math.round(rect.width / 2);
+ rippleY = Math.round(rect.height / 2);
+ } else {
+ var _ref5 = event.touches && event.touches.length > 0 ? event.touches[0] : event,
+ clientX = _ref5.clientX,
+ clientY = _ref5.clientY;
+ rippleX = Math.round(clientX - rect.left);
+ rippleY = Math.round(clientY - rect.top);
+ }
+ if (center) {
+ rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3);
+
+ // For some reason the animation is broken on Mobile Chrome if the size is even.
+ if (rippleSize % 2 === 0) {
+ rippleSize += 1;
+ }
+ } else {
+ var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
+ var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
+ rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
+ }
+
+ // Touche devices
+ if (event != null && event.touches) {
+ // check that this isn't another touchstart due to multitouch
+ // otherwise we will only clear a single timer when unmounting while two
+ // are running
+ if (startTimerCommit.current === null) {
+ // Prepare the ripple effect.
+ startTimerCommit.current = function () {
+ startCommit({
+ pulsate: pulsate,
+ rippleX: rippleX,
+ rippleY: rippleY,
+ rippleSize: rippleSize,
+ cb: cb
+ });
+ };
+ // Delay the execution of the ripple effect.
+ startTimer.current = setTimeout(function () {
+ if (startTimerCommit.current) {
+ startTimerCommit.current();
+ startTimerCommit.current = null;
+ }
+ }, DELAY_RIPPLE); // We have to make a tradeoff with this value.
+ }
+ } else {
+ startCommit({
+ pulsate: pulsate,
+ rippleX: rippleX,
+ rippleY: rippleY,
+ rippleSize: rippleSize,
+ cb: cb
+ });
+ }
+ }, [centerProp, startCommit]);
+ var pulsate = react.useCallback(function () {
+ start({}, {
+ pulsate: true
+ });
+ }, [start]);
+ var stop = react.useCallback(function (event, cb) {
+ clearTimeout(startTimer.current);
+
+ // The touch interaction occurs too quickly.
+ // We still want to show ripple effect.
+ if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {
+ startTimerCommit.current();
+ startTimerCommit.current = null;
+ startTimer.current = setTimeout(function () {
+ stop(event, cb);
+ });
+ return;
+ }
+ startTimerCommit.current = null;
+ setRipples(function (oldRipples) {
+ if (oldRipples.length > 0) {
+ return oldRipples.slice(1);
+ }
+ return oldRipples;
+ });
+ rippleCallback.current = cb;
+ }, []);
+ react.useImperativeHandle(ref, function () {
+ return {
+ pulsate: pulsate,
+ start: start,
+ stop: stop
+ };
+ }, [pulsate, start, stop]);
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(TouchRippleRoot, extends_extends({
+ className: dist_clsx(ButtonBase_touchRippleClasses.root, classes.root, className),
+ ref: container
+ }, other, {
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(esm_TransitionGroup, {
+ component: null,
+ exit: true,
+ children: ripples
+ })
+ }));
+});
+ false ? 0 : void 0;
+/* harmony default export */ var ButtonBase_TouchRipple = (TouchRipple);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/ButtonBase/buttonBaseClasses.js
+
+
+function getButtonBaseUtilityClass(slot) {
+ return generateUtilityClass_generateUtilityClass('MuiButtonBase', slot);
+}
+var buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
+/* harmony default export */ var ButtonBase_buttonBaseClasses = (buttonBaseClasses);
+;// CONCATENATED MODULE: ./node_modules/@mui/material/ButtonBase/ButtonBase.js
+'use client';
+
+
+
+var _styled;
+
+
+var ButtonBase_excluded = ["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"];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var ButtonBase_useUtilityClasses = function useUtilityClasses(ownerState) {
+ var disabled = ownerState.disabled,
+ focusVisible = ownerState.focusVisible,
+ focusVisibleClassName = ownerState.focusVisibleClassName,
+ classes = ownerState.classes;
+ var slots = {
+ root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']
+ };
+ var composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
+ if (focusVisible && focusVisibleClassName) {
+ composedClasses.root += " ".concat(focusVisibleClassName);
+ }
+ return composedClasses;
+};
+var ButtonBaseRoot = styles_styled('button', {
+ name: 'MuiButtonBase',
+ slot: 'Root',
+ overridesResolver: function overridesResolver(props, styles) {
+ return styles.root;
+ }
+})((_styled = {
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ position: 'relative',
+ boxSizing: 'border-box',
+ WebkitTapHighlightColor: 'transparent',
+ backgroundColor: 'transparent',
+ // Reset default value
+ // We disable the focus ring for mouse, touch and keyboard users.
+ outline: 0,
+ border: 0,
+ margin: 0,
+ // Remove the margin in Safari
+ borderRadius: 0,
+ padding: 0,
+ // Remove the padding in Firefox
+ cursor: 'pointer',
+ userSelect: 'none',
+ verticalAlign: 'middle',
+ MozAppearance: 'none',
+ // Reset
+ WebkitAppearance: 'none',
+ // Reset
+ textDecoration: 'none',
+ // So we take precedent over the style of a native element.
+ color: 'inherit',
+ '&::-moz-focus-inner': {
+ borderStyle: 'none' // Remove Firefox dotted outline.
+ }
+}, _defineProperty(_styled, "&.".concat(ButtonBase_buttonBaseClasses.disabled), {
+ pointerEvents: 'none',
+ // Disable link interactions
+ cursor: 'default'
+}), _defineProperty(_styled, '@media print', {
+ colorAdjust: 'exact'
+}), _styled));
+
+/**
+ * `ButtonBase` contains as few styles as possible.
+ * It aims to be a simple building block for creating a button.
+ * It contains a load of style reset and some focus/ripple logic.
+ */
+var ButtonBase = /*#__PURE__*/react.forwardRef(function ButtonBase(inProps, ref) {
+ var props = useThemeProps_useThemeProps({
+ props: inProps,
+ name: 'MuiButtonBase'
+ });
+ var action = props.action,
+ _props$centerRipple = props.centerRipple,
+ centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,
+ children = props.children,
+ className = props.className,
+ _props$component = props.component,
+ component = _props$component === void 0 ? 'button' : _props$component,
+ _props$disabled = props.disabled,
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
+ _props$disableRipple = props.disableRipple,
+ disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,
+ _props$disableTouchRi = props.disableTouchRipple,
+ disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,
+ _props$focusRipple = props.focusRipple,
+ focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,
+ _props$LinkComponent = props.LinkComponent,
+ LinkComponent = _props$LinkComponent === void 0 ? 'a' : _props$LinkComponent,
+ onBlur = props.onBlur,
+ onClick = props.onClick,
+ onContextMenu = props.onContextMenu,
+ onDragLeave = props.onDragLeave,
+ onFocus = props.onFocus,
+ onFocusVisible = props.onFocusVisible,
+ onKeyDown = props.onKeyDown,
+ onKeyUp = props.onKeyUp,
+ onMouseDown = props.onMouseDown,
+ onMouseLeave = props.onMouseLeave,
+ onMouseUp = props.onMouseUp,
+ onTouchEnd = props.onTouchEnd,
+ onTouchMove = props.onTouchMove,
+ onTouchStart = props.onTouchStart,
+ _props$tabIndex = props.tabIndex,
+ tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
+ TouchRippleProps = props.TouchRippleProps,
+ touchRippleRef = props.touchRippleRef,
+ type = props.type,
+ other = _objectWithoutPropertiesLoose(props, ButtonBase_excluded);
+ var buttonRef = react.useRef(null);
+ var rippleRef = react.useRef(null);
+ var handleRippleRef = utils_useForkRef(rippleRef, touchRippleRef);
+ var _useIsFocusVisible = utils_useIsFocusVisible(),
+ isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef,
+ handleFocusVisible = _useIsFocusVisible.onFocus,
+ handleBlurVisible = _useIsFocusVisible.onBlur,
+ focusVisibleRef = _useIsFocusVisible.ref;
+ var _React$useState = react.useState(false),
+ _React$useState2 = _slicedToArray(_React$useState, 2),
+ focusVisible = _React$useState2[0],
+ setFocusVisible = _React$useState2[1];
+ if (disabled && focusVisible) {
+ setFocusVisible(false);
+ }
+ react.useImperativeHandle(action, function () {
+ return {
+ focusVisible: function focusVisible() {
+ setFocusVisible(true);
+ buttonRef.current.focus();
+ }
+ };
+ }, []);
+ var _React$useState3 = react.useState(false),
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
+ mountedState = _React$useState4[0],
+ setMountedState = _React$useState4[1];
+ react.useEffect(function () {
+ setMountedState(true);
+ }, []);
+ var enableTouchRipple = mountedState && !disableRipple && !disabled;
+ react.useEffect(function () {
+ if (focusVisible && focusRipple && !disableRipple && mountedState) {
+ rippleRef.current.pulsate();
+ }
+ }, [disableRipple, focusRipple, focusVisible, mountedState]);
+ function useRippleHandler(rippleAction, eventCallback) {
+ var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;
+ return utils_useEventCallback(function (event) {
+ if (eventCallback) {
+ eventCallback(event);
+ }
+ var ignore = skipRippleAction;
+ if (!ignore && rippleRef.current) {
+ rippleRef.current[rippleAction](event);
+ }
+ return true;
+ });
+ }
+ var handleMouseDown = useRippleHandler('start', onMouseDown);
+ var handleContextMenu = useRippleHandler('stop', onContextMenu);
+ var handleDragLeave = useRippleHandler('stop', onDragLeave);
+ var handleMouseUp = useRippleHandler('stop', onMouseUp);
+ var handleMouseLeave = useRippleHandler('stop', function (event) {
+ if (focusVisible) {
+ event.preventDefault();
+ }
+ if (onMouseLeave) {
+ onMouseLeave(event);
+ }
+ });
+ var handleTouchStart = useRippleHandler('start', onTouchStart);
+ var handleTouchEnd = useRippleHandler('stop', onTouchEnd);
+ var handleTouchMove = useRippleHandler('stop', onTouchMove);
+ var handleBlur = useRippleHandler('stop', function (event) {
+ handleBlurVisible(event);
+ if (isFocusVisibleRef.current === false) {
+ setFocusVisible(false);
+ }
+ if (onBlur) {
+ onBlur(event);
+ }
+ }, false);
+ var handleFocus = utils_useEventCallback(function (event) {
+ // Fix for https://github.com/facebook/react/issues/7769
+ if (!buttonRef.current) {
+ buttonRef.current = event.currentTarget;
+ }
+ handleFocusVisible(event);
+ if (isFocusVisibleRef.current === true) {
+ setFocusVisible(true);
+ if (onFocusVisible) {
+ onFocusVisible(event);
+ }
+ }
+ if (onFocus) {
+ onFocus(event);
+ }
+ });
+ var isNonNativeButton = function isNonNativeButton() {
+ var button = buttonRef.current;
+ return component && component !== 'button' && !(button.tagName === 'A' && button.href);
+ };
+
+ /**
+ * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
+ */
+ var keydownRef = react.useRef(false);
+ var handleKeyDown = utils_useEventCallback(function (event) {
+ // Check if key is already down to avoid repeats being counted as multiple activations
+ if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
+ keydownRef.current = true;
+ rippleRef.current.stop(event, function () {
+ rippleRef.current.start(event);
+ });
+ }
+ if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
+ event.preventDefault();
+ }
+ if (onKeyDown) {
+ onKeyDown(event);
+ }
+
+ // Keyboard accessibility for non interactive elements
+ if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
+ event.preventDefault();
+ if (onClick) {
+ onClick(event);
+ }
+ }
+ });
+ var handleKeyUp = utils_useEventCallback(function (event) {
+ // calling preventDefault in keyUp on a