diff --git a/_locales/en/messages.json b/_locales/en/messages.json index f926dae..47ec5f0 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -15,9 +15,6 @@ "message": "Open Options (Alt+O)" }, "open_tranbox": { - "message": "Open Translate Popup (Alt+B)" - }, - "translate_selected": { - "message": "Translate Selected Text (Alt+S)" + "message": "Translate Popup/Selected (Alt+S)" } } diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 4ad809e..e574cf9 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -15,9 +15,6 @@ "message": "打开设置 (Alt+O)" }, "open_tranbox": { - "message": "打开翻译弹窗 (Alt+B)" - }, - "translate_selected": { - "message": "翻译选中文字 (Alt+S)" + "message": "翻译弹窗/选中文字 (Alt+S)" } } diff --git a/kiss-translator-ios-safari.user.js b/kiss-translator-ios-safari.user.js index 34f8f55..8edcdaf 100644 --- a/kiss-translator-ios-safari.user.js +++ b/kiss-translator-ios-safari.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name KISS Translator // @namespace https://github.com/fishjar/kiss-translator -// @version 1.7.13 +// @version 1.7.14 // @description A simple bilingual translation extension & Greasemonkey script (一个简约的双语对照翻译扩展 & 油猴脚本) // @author Gabe // @homepageURL https://github.com/fishjar/kiss-translator @@ -17629,6 +17629,10 @@ function asyncToGenerator_asyncToGenerator(fn) { }); }; } +// EXTERNAL MODULE: ./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js +var react = __webpack_require__(7948); +// EXTERNAL MODULE: ./node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/client.js +var client = __webpack_require__(3884); // EXTERNAL MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(689); ;// CONCATENATED MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/objectSpread2.js @@ -17654,26 +17658,1841 @@ function _objectSpread2(e) { } return e; } -// EXTERNAL MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js -var toConsumableArray = __webpack_require__(9982); // EXTERNAL MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/slicedToArray.js var slicedToArray = __webpack_require__(7358); +// EXTERNAL MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +var objectWithoutPropertiesLoose = __webpack_require__(45); +// EXTERNAL MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/extends.js +var esm_extends = __webpack_require__(8957); +// EXTERNAL MODULE: ./node_modules/.pnpm/clsx@2.0.0/node_modules/clsx/dist/clsx.mjs +var clsx = __webpack_require__(5675); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+utils@5.14.10_@types+react@18.2.22_react@18.2.0/node_modules/@mui/utils/esm/composeClasses/composeClasses.js +var composeClasses = __webpack_require__(4483); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/styles/styled.js +var styled = __webpack_require__(7219); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/styles/useThemeProps.js +var styles_useThemeProps = __webpack_require__(7658); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/utils/useForkRef.js +var useForkRef = __webpack_require__(6813); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/utils/useEventCallback.js +var useEventCallback = __webpack_require__(2019); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/utils/useIsFocusVisible.js +var useIsFocusVisible = __webpack_require__(3261); +// EXTERNAL MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +var toConsumableArray = __webpack_require__(9982); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +function _taggedTemplateLiteral(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + return Object.freeze(Object.defineProperties(strings, { + raw: { + value: Object.freeze(raw) + } + })); +} +;// CONCATENATED MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self; +} +;// CONCATENATED MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); +} +;// CONCATENATED MODULE: ./node_modules/.pnpm/@babel+runtime@7.22.15/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/.pnpm/react-transition-group@4.4.5_react-dom@18.2.0_react@18.2.0/node_modules/react-transition-group/esm/TransitionGroupContext.js + +/* harmony default export */ var TransitionGroupContext = (react.createContext(null)); +;// CONCATENATED MODULE: ./node_modules/.pnpm/react-transition-group@4.4.5_react-dom@18.2.0_react@18.2.0/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/.pnpm/react-transition-group@4.4.5_react-dom@18.2.0_react@18.2.0/node_modules/react-transition-group/esm/TransitionGroup.js + + + + + + + + +var 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 = (0,esm_extends/* default */.Z)({}, 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 = (0,objectWithoutPropertiesLoose/* default */.Z)(_this$props, ["component", "childFactory"]); + var contextValue = this.state.contextValue; + var children = 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); +// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+react@11.11.1_@types+react@18.2.22_react@18.2.0/node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js +var emotion_element_c39617d8_browser_esm = __webpack_require__(1253); +// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+utils@1.2.1/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js +var emotion_utils_browser_esm = __webpack_require__(1443); +// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+use-insertion-effect-with-fallbacks@1.0.1_react@18.2.0/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js +var emotion_use_insertion_effect_with_fallbacks_browser_esm = __webpack_require__(2919); +// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+serialize@1.1.2/node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js +var emotion_serialize_browser_esm = __webpack_require__(5525); +// EXTERNAL MODULE: ./node_modules/.pnpm/@emotion+cache@11.11.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +var emotion_cache_browser_esm = __webpack_require__(6967); +// EXTERNAL MODULE: ./node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +var hoist_non_react_statics_cjs = __webpack_require__(9761); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@emotion+react@11.11.1_@types+react@18.2.22_react@18.2.0/node_modules/@emotion/react/dist/emotion-react.browser.esm.js + + + + + + + + + + + +var pkg = { + name: "@emotion/react", + version: "11.11.1", + main: "dist/emotion-react.cjs.js", + module: "dist/emotion-react.esm.js", + browser: { + "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" + }, + exports: { + ".": { + module: { + worker: "./dist/emotion-react.worker.esm.js", + browser: "./dist/emotion-react.browser.esm.js", + "default": "./dist/emotion-react.esm.js" + }, + "import": "./dist/emotion-react.cjs.mjs", + "default": "./dist/emotion-react.cjs.js" + }, + "./jsx-runtime": { + module: { + worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js", + browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js" + }, + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" + }, + "./_isolated-hnrs": { + module: { + worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js", + browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js" + }, + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" + }, + "./jsx-dev-runtime": { + module: { + worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js", + browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js" + }, + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" + }, + "./package.json": "./package.json", + "./types/css-prop": "./types/css-prop.d.ts", + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } + }, + types: "types/index.d.ts", + files: ["src", "dist", "jsx-runtime", "jsx-dev-runtime", "_isolated-hnrs", "types/*.d.ts", "macro.*"], + sideEffects: false, + author: "Emotion Contributors", + license: "MIT", + scripts: { + "test:typescript": "dtslint types" + }, + dependencies: { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.11.0", + "@emotion/cache": "^11.11.0", + "@emotion/serialize": "^1.1.2", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "hoist-non-react-statics": "^3.3.1" + }, + peerDependencies: { + react: ">=16.8.0" + }, + peerDependenciesMeta: { + "@types/react": { + optional: true + } + }, + devDependencies: { + "@definitelytyped/dtslint": "0.0.112", + "@emotion/css": "11.11.0", + "@emotion/css-prettifier": "1.1.3", + "@emotion/server": "11.11.0", + "@emotion/styled": "11.11.0", + "html-tag-names": "^1.1.2", + react: "16.14.0", + "svg-tag-names": "^1.1.1", + typescript: "^4.5.5" + }, + repository: "https://github.com/emotion-js/emotion/tree/main/packages/react", + publishConfig: { + access: "public" + }, + "umd:main": "dist/emotion-react.umd.min.js", + preconstruct: { + entrypoints: ["./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./_isolated-hnrs.js"], + umdName: "emotionReact", + exports: { + envConditions: ["browser", "worker"], + extra: { + "./types/css-prop": "./types/css-prop.d.ts", + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } + } + } + } +}; +var jsx = function jsx(type, props) { + var args = arguments; + if (props == null || !hasOwnProperty.call(props, 'css')) { + // $FlowFixMe + return React.createElement.apply(undefined, args); + } + var argsLength = args.length; + var createElementArgArray = new Array(argsLength); + createElementArgArray[0] = Emotion; + createElementArgArray[1] = createEmotionProps(type, props); + for (var i = 2; i < argsLength; i++) { + createElementArgArray[i] = args[i]; + } // $FlowFixMe + + return React.createElement.apply(null, createElementArgArray); +}; +var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. +// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild +// initial client-side render from SSR, use place of hydrating tag + +var Global = /* #__PURE__ */(0,emotion_element_c39617d8_browser_esm.w)(function (props, cache) { + if (false) {} + var styles = props.styles; + var serialized = (0,emotion_serialize_browser_esm/* serializeStyles */.O)([styles], undefined, react.useContext(emotion_element_c39617d8_browser_esm.T)); + if (!emotion_element_c39617d8_browser_esm.i) { + var _ref; + var serializedNames = serialized.name; + var serializedStyles = serialized.styles; + var next = serialized.next; + while (next !== undefined) { + serializedNames += ' ' + next.name; + serializedStyles += next.styles; + next = next.next; + } + var shouldCache = cache.compat === true; + var rules = cache.insert("", { + name: serializedNames, + styles: serializedStyles + }, cache.sheet, shouldCache); + if (shouldCache) { + return null; + } + return /*#__PURE__*/react.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = { + __html: rules + }, _ref.nonce = cache.sheet.nonce, _ref)); + } // yes, i know these hooks are used conditionally + // but it is based on a constant that will never change at runtime + // it's effectively like having two implementations and switching them out + // so it's not actually breaking anything + + var sheetRef = react.useRef(); + (0,emotion_use_insertion_effect_with_fallbacks_browser_esm/* useInsertionEffectWithLayoutFallback */.j)(function () { + var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 + + var sheet = new cache.sheet.constructor({ + key: key, + nonce: cache.sheet.nonce, + container: cache.sheet.container, + speedy: cache.sheet.isSpeedy + }); + var rehydrating = false; // $FlowFixMe + + var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); + if (cache.sheet.tags.length) { + sheet.before = cache.sheet.tags[0]; + } + if (node !== null) { + rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s + + node.setAttribute('data-emotion', key); + sheet.hydrate([node]); + } + sheetRef.current = [sheet, rehydrating]; + return function () { + sheet.flush(); + }; + }, [cache]); + (0,emotion_use_insertion_effect_with_fallbacks_browser_esm/* useInsertionEffectWithLayoutFallback */.j)(function () { + var sheetRefCurrent = sheetRef.current; + var sheet = sheetRefCurrent[0], + rehydrating = sheetRefCurrent[1]; + if (rehydrating) { + sheetRefCurrent[1] = false; + return; + } + if (serialized.next !== undefined) { + // insert keyframes + (0,emotion_utils_browser_esm/* insertStyles */.My)(cache, serialized.next, true); + } + if (sheet.tags.length) { + // if this doesn't exist then it will be null so the style element will be appended + var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; + sheet.before = element; + sheet.flush(); + } + cache.insert("", serialized, sheet, false); + }, [cache, serialized.name]); + return null; +}); +if (false) {} +function css() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return (0,emotion_serialize_browser_esm/* serializeStyles */.O)(args); +} +var keyframes = function keyframes() { + var insertable = css.apply(void 0, arguments); + var name = "animation-" + insertable.name; // $FlowFixMe + + return { + name: name, + styles: "@keyframes " + name + "{" + insertable.styles + "}", + anim: 1, + toString: function toString() { + return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; + } + }; +}; +var classnames = function classnames(args) { + var len = args.length; + var i = 0; + var cls = ''; + for (; i < len; i++) { + var arg = args[i]; + if (arg == null) continue; + var toAdd = void 0; + switch (typeof arg) { + case 'boolean': + break; + case 'object': + { + if (Array.isArray(arg)) { + toAdd = classnames(arg); + } else { + if (false) {} + toAdd = ''; + for (var k in arg) { + if (arg[k] && k) { + toAdd && (toAdd += ' '); + toAdd += k; + } + } + } + break; + } + default: + { + toAdd = arg; + } + } + if (toAdd) { + cls && (cls += ' '); + cls += toAdd; + } + } + return cls; +}; +function merge(registered, css, className) { + var registeredStyles = []; + var rawClassName = getRegisteredStyles(registered, registeredStyles, className); + if (registeredStyles.length < 2) { + return className; + } + return rawClassName + css(registeredStyles); +} +var Insertion = function Insertion(_ref) { + var cache = _ref.cache, + serializedArr = _ref.serializedArr; + useInsertionEffectAlwaysWithSyncFallback(function () { + for (var i = 0; i < serializedArr.length; i++) { + insertStyles(cache, serializedArr[i], false); + } + }); + return null; +}; +var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) { + var hasRendered = false; + var serializedArr = []; + var css = function css() { + if (hasRendered && "production" !== 'production') {} + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var serialized = serializeStyles(args, cache.registered); + serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx` + + registerStyles(cache, serialized, false); + return cache.key + "-" + serialized.name; + }; + var cx = function cx() { + if (hasRendered && "production" !== 'production') {} + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return merge(cache.registered, css, classnames(args)); + }; + var content = { + css: css, + cx: cx, + theme: React.useContext(ThemeContext) + }; + var ele = props.children(content); + hasRendered = true; + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, { + cache: cache, + serializedArr: serializedArr + }), ele); +}))); +if (false) {} +if (false) { var globalKey, globalContext, isTestEnv, isBrowser; } + +// EXTERNAL MODULE: ./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js +var jsx_runtime = __webpack_require__(7394); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/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 = (0,slicedToArray/* default */.Z)(_React$useState, 2), + leaving = _React$useState2[0], + setLeaving = _React$useState2[1]; + var rippleClassName = (0,clsx/* default */.Z)(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate); + var rippleStyles = { + width: rippleSize, + height: rippleSize, + top: -(rippleSize / 2) + rippleY, + left: -(rippleSize / 2) + rippleX + }; + var childClassName = (0,clsx/* default */.Z)(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); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+utils@5.14.10_@types+react@18.2.22_react@18.2.0/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js +var generateUtilityClasses = __webpack_require__(8738); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/ButtonBase/touchRippleClasses.js + + +function getTouchRippleUtilityClass(slot) { + return generateUtilityClass('MuiTouchRipple', slot); +} +var touchRippleClasses = (0,generateUtilityClasses/* default */.Z)('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']); +/* harmony default export */ var ButtonBase_touchRippleClasses = (touchRippleClasses); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/ButtonBase/TouchRipple.js +'use client'; + + + + +var _templateObject, _templateObject2, _templateObject3, _templateObject4; + + +var _excluded = ["center", "classes", "className"]; +var _ = function _(t) { + return t; + }, + _t, + _t2, + _t3, + _t4; + + + + + + + + + + +var DURATION = 550; +var DELAY_RIPPLE = 80; +var enterKeyframe = keyframes(_t || (_t = _(_templateObject || (_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(_t2 || (_t2 = _(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"]))))); +var pulsateKeyframe = keyframes(_t3 || (_t3 = _(_templateObject3 || (_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 = (0,styled/* default */.ZP)('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 = (0,styled/* default */.ZP)(ButtonBase_Ripple, { + name: 'MuiTouchRipple', + slot: 'Ripple' +})(_t4 || (_t4 = _(_templateObject4 || (_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 = (0,styles_useThemeProps/* default */.Z)({ + 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 = (0,objectWithoutPropertiesLoose/* default */.Z)(props, _excluded); + var _React$useState = react.useState([]), + _React$useState2 = (0,slicedToArray/* default */.Z)(_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((0,toConsumableArray/* default */.Z)(oldRipples), [/*#__PURE__*/(0,jsx_runtime.jsx)(TouchRippleRipple, { + classes: { + ripple: (0,clsx/* default */.Z)(classes.ripple, ButtonBase_touchRippleClasses.ripple), + rippleVisible: (0,clsx/* default */.Z)(classes.rippleVisible, ButtonBase_touchRippleClasses.rippleVisible), + ripplePulsate: (0,clsx/* default */.Z)(classes.ripplePulsate, ButtonBase_touchRippleClasses.ripplePulsate), + child: (0,clsx/* default */.Z)(classes.child, ButtonBase_touchRippleClasses.child), + childLeaving: (0,clsx/* default */.Z)(classes.childLeaving, ButtonBase_touchRippleClasses.childLeaving), + childPulsate: (0,clsx/* default */.Z)(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, (0,esm_extends/* default */.Z)({ + className: (0,clsx/* default */.Z)(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); +// EXTERNAL MODULE: ./node_modules/.pnpm/@mui+utils@5.14.10_@types+react@18.2.22_react@18.2.0/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js +var generateUtilityClass_generateUtilityClass = __webpack_require__(5165); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/node_modules/@mui/material/ButtonBase/buttonBaseClasses.js + + +function getButtonBaseUtilityClass(slot) { + return (0,generateUtilityClass_generateUtilityClass/* default */.Z)('MuiButtonBase', slot); +} +var buttonBaseClasses = (0,generateUtilityClasses/* default */.Z)('MuiButtonBase', ['root', 'disabled', 'focusVisible']); +/* harmony default export */ var ButtonBase_buttonBaseClasses = (buttonBaseClasses); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@mui+material@5.14.10_@emotion+react@11.11.1_@emotion+styled@11.11.0_@types+react@18.2.22_react-dom@18.2.0_react@18.2.0/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 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 = (0,composeClasses/* default */.Z)(slots, getButtonBaseUtilityClass, classes); + if (focusVisible && focusVisibleClassName) { + composedClasses.root += " ".concat(focusVisibleClassName); + } + return composedClasses; +}; +var ButtonBaseRoot = (0,styled/* default */.ZP)('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. + } +}, (0,defineProperty/* default */.Z)(_styled, "&.".concat(ButtonBase_buttonBaseClasses.disabled), { + pointerEvents: 'none', + // Disable link interactions + cursor: 'default' +}), (0,defineProperty/* default */.Z)(_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 = (0,styles_useThemeProps/* default */.Z)({ + 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 = (0,objectWithoutPropertiesLoose/* default */.Z)(props, ButtonBase_excluded); + var buttonRef = react.useRef(null); + var rippleRef = react.useRef(null); + var handleRippleRef = (0,useForkRef/* default */.Z)(rippleRef, touchRippleRef); + var _useIsFocusVisible = (0,useIsFocusVisible/* default */.Z)(), + isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef, + handleFocusVisible = _useIsFocusVisible.onFocus, + handleBlurVisible = _useIsFocusVisible.onBlur, + focusVisibleRef = _useIsFocusVisible.ref; + var _React$useState = react.useState(false), + _React$useState2 = (0,slicedToArray/* default */.Z)(_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 = (0,slicedToArray/* default */.Z)(_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 (0,useEventCallback/* default */.Z)(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 = (0,useEventCallback/* default */.Z)(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 = (0,useEventCallback/* default */.Z)(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 = (0,useEventCallback/* default */.Z)(function (event) { + // calling preventDefault in keyUp on a