@commercetools/nimbus 0.0.0-canary-20250916130207 → 0.0.0-canary-20250918091239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/chunks/icon-BHx0r3NL.cjs.js +2 -0
  2. package/dist/chunks/icon-BHx0r3NL.cjs.js.map +1 -0
  3. package/dist/chunks/icon-DHu0zrOb.es.js +14 -0
  4. package/dist/chunks/icon-DHu0zrOb.es.js.map +1 -0
  5. package/dist/chunks/icon.recipe-ClxbhW0Q.cjs.js +2 -0
  6. package/dist/chunks/icon.recipe-ClxbhW0Q.cjs.js.map +1 -0
  7. package/dist/chunks/icon.recipe-DjkjodUn.es.js +24 -0
  8. package/dist/chunks/icon.recipe-DjkjodUn.es.js.map +1 -0
  9. package/dist/chunks/inline-svg-DTleUhZq.es.js +21 -0
  10. package/dist/chunks/inline-svg-DTleUhZq.es.js.map +1 -0
  11. package/dist/chunks/inline-svg-DbvmiSw9.cjs.js +2 -0
  12. package/dist/chunks/inline-svg-DbvmiSw9.cjs.js.map +1 -0
  13. package/dist/chunks/{menu-bzi7WVh0.cjs.js → menu-CQYhHGbS.cjs.js} +2 -2
  14. package/dist/chunks/{menu-bzi7WVh0.cjs.js.map → menu-CQYhHGbS.cjs.js.map} +1 -1
  15. package/dist/chunks/{menu-DZVU5Z-r.es.js → menu-DnbrSKhK.es.js} +2 -2
  16. package/dist/chunks/{menu-DZVU5Z-r.es.js.map → menu-DnbrSKhK.es.js.map} +1 -1
  17. package/dist/chunks/rich-text-input-BbCjT_Nf.es.js +7916 -0
  18. package/dist/chunks/rich-text-input-BbCjT_Nf.es.js.map +1 -0
  19. package/dist/chunks/rich-text-input-BwrGY2EU.cjs.js +24 -0
  20. package/dist/chunks/rich-text-input-BwrGY2EU.cjs.js.map +1 -0
  21. package/dist/chunks/{split-button-BR8DktKd.es.js → split-button-ClVaxLZ7.es.js} +3 -3
  22. package/dist/chunks/{split-button-BR8DktKd.es.js.map → split-button-ClVaxLZ7.es.js.map} +1 -1
  23. package/dist/chunks/{split-button-1uPesHKO.cjs.js → split-button-D-3pT-LA.cjs.js} +2 -2
  24. package/dist/chunks/{split-button-1uPesHKO.cjs.js.map → split-button-D-3pT-LA.cjs.js.map} +1 -1
  25. package/dist/chunks/use-inline-svg-C2ko8Bcq.cjs.js +2 -0
  26. package/dist/chunks/use-inline-svg-C2ko8Bcq.cjs.js.map +1 -0
  27. package/dist/chunks/use-inline-svg-Cua0623E.es.js +47 -0
  28. package/dist/chunks/use-inline-svg-Cua0623E.es.js.map +1 -0
  29. package/dist/components/components.cjs +1 -1
  30. package/dist/components/components.es.js +79 -77
  31. package/dist/components/components.es.js.map +1 -1
  32. package/dist/components/constants.cjs +1 -1
  33. package/dist/components/constants.cjs.map +1 -1
  34. package/dist/components/constants.es.js +13 -122
  35. package/dist/components/constants.es.js.map +1 -1
  36. package/dist/components/hooks.cjs +1 -1
  37. package/dist/components/hooks.es.js +2 -5
  38. package/dist/components/icon.cjs +1 -1
  39. package/dist/components/icon.es.js +1 -1
  40. package/dist/components/inline-svg.cjs +2 -0
  41. package/dist/components/inline-svg.cjs.map +1 -0
  42. package/dist/components/inline-svg.es.js +5 -0
  43. package/dist/components/inline-svg.es.js.map +1 -0
  44. package/dist/components/rich-text-input.cjs +1 -1
  45. package/dist/components/rich-text-input.es.js +1 -1
  46. package/dist/components/split-button.cjs +1 -1
  47. package/dist/components/split-button.es.js +1 -1
  48. package/dist/components/utils.cjs +2 -1
  49. package/dist/components/utils.cjs.map +1 -1
  50. package/dist/components/utils.es.js +543 -65
  51. package/dist/components/utils.es.js.map +1 -1
  52. package/dist/components.d.ts +34 -0
  53. package/dist/constants.d.ts +4 -113
  54. package/dist/hooks.d.ts +7 -46
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.ts +41 -45
  58. package/dist/index.es.js +121 -119
  59. package/dist/index.es.js.map +1 -1
  60. package/dist/inline-svg.d.ts +139 -0
  61. package/dist/utils.d.ts +28 -148
  62. package/package.json +6 -5
  63. package/dist/chunks/icon-BoRbJStV.es.js +0 -31
  64. package/dist/chunks/icon-BoRbJStV.es.js.map +0 -1
  65. package/dist/chunks/icon-Cny8ZtnX.cjs.js +0 -2
  66. package/dist/chunks/icon-Cny8ZtnX.cjs.js.map +0 -1
  67. package/dist/chunks/rich-text-input-B3s6cy-T.cjs.js +0 -2
  68. package/dist/chunks/rich-text-input-B3s6cy-T.cjs.js.map +0 -1
  69. package/dist/chunks/rich-text-input-D4cP13Oo.es.js +0 -691
  70. package/dist/chunks/rich-text-input-D4cP13Oo.es.js.map +0 -1
  71. package/dist/chunks/slate-helpers-BwRHJO4o.es.js +0 -6919
  72. package/dist/chunks/slate-helpers-BwRHJO4o.es.js.map +0 -1
  73. package/dist/chunks/slate-helpers-CMAwCMk0.cjs.js +0 -24
  74. package/dist/chunks/slate-helpers-CMAwCMk0.cjs.js.map +0 -1
  75. package/dist/chunks/use-formatting-state-Denpy3Zo.cjs.js +0 -2
  76. package/dist/chunks/use-formatting-state-Denpy3Zo.cjs.js.map +0 -1
  77. package/dist/chunks/use-formatting-state-RJvSR-Zg.es.js +0 -247
  78. package/dist/chunks/use-formatting-state-RJvSR-Zg.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../node_modules/.pnpm/react-hotkeys-hook@4.6.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js","../../../node_modules/.pnpm/react-use@17.6.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-use/esm/useMountedState.js","../../../node_modules/.pnpm/react-use@17.6.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-use/esm/useSetState.js","../../../node_modules/.pnpm/toggle-selection@1.0.6/node_modules/toggle-selection/index.js","../../../node_modules/.pnpm/copy-to-clipboard@3.3.3/node_modules/copy-to-clipboard/index.js","../../../node_modules/.pnpm/react-use@17.6.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-use/esm/useCopyToClipboard.js","../src/hooks/use-color-scheme/use-color-scheme.ts","../src/hooks/use-color-mode/use-color-mode.ts","../src/hooks/use-color-mode-value/use-color-mode-value.ts"],"sourcesContent":["import { useContext, createContext, useState, useCallback, useRef, useLayoutEffect, useEffect } from 'react';\nimport { jsx } from 'react/jsx-runtime';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\n\nvar reservedModifierKeywords = ['shift', 'alt', 'meta', 'mod', 'ctrl'];\nvar mappedKeys = {\n esc: 'escape',\n \"return\": 'enter',\n '.': 'period',\n ',': 'comma',\n '-': 'slash',\n ' ': 'space',\n '`': 'backquote',\n '#': 'backslash',\n '+': 'bracketright',\n ShiftLeft: 'shift',\n ShiftRight: 'shift',\n AltLeft: 'alt',\n AltRight: 'alt',\n MetaLeft: 'meta',\n MetaRight: 'meta',\n OSLeft: 'meta',\n OSRight: 'meta',\n ControlLeft: 'ctrl',\n ControlRight: 'ctrl'\n};\nfunction mapKey(key) {\n return (key && mappedKeys[key] || key || '').trim().toLowerCase().replace(/key|digit|numpad|arrow/, '');\n}\nfunction isHotkeyModifier(key) {\n return reservedModifierKeywords.includes(key);\n}\nfunction parseKeysHookInput(keys, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n return keys.split(splitKey);\n}\nfunction parseHotkey(hotkey, combinationKey, description) {\n if (combinationKey === void 0) {\n combinationKey = '+';\n }\n var keys = hotkey.toLocaleLowerCase().split(combinationKey).map(function (k) {\n return mapKey(k);\n });\n var modifiers = {\n alt: keys.includes('alt'),\n ctrl: keys.includes('ctrl') || keys.includes('control'),\n shift: keys.includes('shift'),\n meta: keys.includes('meta'),\n mod: keys.includes('mod')\n };\n var singleCharKeys = keys.filter(function (k) {\n return !reservedModifierKeywords.includes(k);\n });\n return _extends({}, modifiers, {\n keys: singleCharKeys,\n description: description,\n hotkey: hotkey\n });\n}\n\n(function () {\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n document.addEventListener('keyup', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n }\n if (typeof window !== 'undefined') {\n window.addEventListener('blur', function () {\n currentlyPressedKeys.clear();\n });\n }\n})();\nvar currentlyPressedKeys = /*#__PURE__*/new Set();\n// https://github.com/microsoft/TypeScript/issues/17002\nfunction isReadonlyArray(value) {\n return Array.isArray(value);\n}\nfunction isHotkeyPressed(key, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n var hotkeyArray = isReadonlyArray(key) ? key : key.split(splitKey);\n return hotkeyArray.every(function (hotkey) {\n return currentlyPressedKeys.has(hotkey.trim().toLowerCase());\n });\n}\nfunction pushToCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (currentlyPressedKeys.has('meta')) {\n currentlyPressedKeys.forEach(function (key) {\n return !isHotkeyModifier(key) && currentlyPressedKeys[\"delete\"](key.toLowerCase());\n });\n }\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys.add(hotkey.toLowerCase());\n });\n}\nfunction removeFromCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (key === 'meta') {\n currentlyPressedKeys.clear();\n } else {\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys[\"delete\"](hotkey.toLowerCase());\n });\n }\n}\n\nfunction maybePreventDefault(e, hotkey, preventDefault) {\n if (typeof preventDefault === 'function' && preventDefault(e, hotkey) || preventDefault === true) {\n e.preventDefault();\n }\n}\nfunction isHotkeyEnabled(e, hotkey, enabled) {\n if (typeof enabled === 'function') {\n return enabled(e, hotkey);\n }\n return enabled === true || enabled === undefined;\n}\nfunction isKeyboardEventTriggeredByInput(ev) {\n return isHotkeyEnabledOnTag(ev, ['input', 'textarea', 'select']);\n}\nfunction isHotkeyEnabledOnTag(event, enabledOnTags) {\n if (enabledOnTags === void 0) {\n enabledOnTags = false;\n }\n var target = event.target,\n composed = event.composed;\n var targetTagName = null;\n if (isCustomElement(target) && composed) {\n targetTagName = event.composedPath()[0] && event.composedPath()[0].tagName;\n } else {\n targetTagName = target && target.tagName;\n }\n if (isReadonlyArray(enabledOnTags)) {\n return Boolean(targetTagName && enabledOnTags && enabledOnTags.some(function (tag) {\n var _targetTagName;\n return tag.toLowerCase() === ((_targetTagName = targetTagName) == null ? void 0 : _targetTagName.toLowerCase());\n }));\n }\n return Boolean(targetTagName && enabledOnTags && enabledOnTags);\n}\nfunction isCustomElement(element) {\n // We just do a basic check w/o any complex RegEx or validation against the list of legacy names containing a hyphen,\n // as none of them is likely to be an event target, and it won't hurt anyway if we miss.\n // see: https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname\n return !!element.tagName && !element.tagName.startsWith(\"-\") && element.tagName.includes(\"-\");\n}\nfunction isScopeActive(activeScopes, scopes) {\n if (activeScopes.length === 0 && scopes) {\n console.warn('A hotkey has the \"scopes\" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>');\n return true;\n }\n if (!scopes) {\n return true;\n }\n return activeScopes.some(function (scope) {\n return scopes.includes(scope);\n }) || activeScopes.includes('*');\n}\nvar isHotkeyMatchingKeyboardEvent = function isHotkeyMatchingKeyboardEvent(e, hotkey, ignoreModifiers) {\n if (ignoreModifiers === void 0) {\n ignoreModifiers = false;\n }\n var alt = hotkey.alt,\n meta = hotkey.meta,\n mod = hotkey.mod,\n shift = hotkey.shift,\n ctrl = hotkey.ctrl,\n keys = hotkey.keys;\n var pressedKeyUppercase = e.key,\n code = e.code,\n ctrlKey = e.ctrlKey,\n metaKey = e.metaKey,\n shiftKey = e.shiftKey,\n altKey = e.altKey;\n var keyCode = mapKey(code);\n var pressedKey = pressedKeyUppercase.toLowerCase();\n if (!(keys != null && keys.includes(keyCode)) && !(keys != null && keys.includes(pressedKey)) && !['ctrl', 'control', 'unknown', 'meta', 'alt', 'shift', 'os'].includes(keyCode)) {\n return false;\n }\n if (!ignoreModifiers) {\n // We check the pressed keys for compatibility with the keyup event. In keyup events the modifier flags are not set.\n if (alt === !altKey && pressedKey !== 'alt') {\n return false;\n }\n if (shift === !shiftKey && pressedKey !== 'shift') {\n return false;\n }\n // Mod is a special key name that is checking for meta on macOS and ctrl on other platforms\n if (mod) {\n if (!metaKey && !ctrlKey) {\n return false;\n }\n } else {\n if (meta === !metaKey && pressedKey !== 'meta' && pressedKey !== 'os') {\n return false;\n }\n if (ctrl === !ctrlKey && pressedKey !== 'ctrl' && pressedKey !== 'control') {\n return false;\n }\n }\n }\n // All modifiers are correct, now check the key\n // If the key is set, we check for the key\n if (keys && keys.length === 1 && (keys.includes(pressedKey) || keys.includes(keyCode))) {\n return true;\n } else if (keys) {\n // Check if all keys are present in pressedDownKeys set\n return isHotkeyPressed(keys);\n } else if (!keys) {\n // If the key is not set, we only listen for modifiers, that check went alright, so we return true\n return true;\n }\n // There is nothing that matches.\n return false;\n};\n\nvar BoundHotkeysProxyProvider = /*#__PURE__*/createContext(undefined);\nvar useBoundHotkeysProxy = function useBoundHotkeysProxy() {\n return useContext(BoundHotkeysProxyProvider);\n};\nfunction BoundHotkeysProxyProviderProvider(_ref) {\n var addHotkey = _ref.addHotkey,\n removeHotkey = _ref.removeHotkey,\n children = _ref.children;\n return /*#__PURE__*/jsx(BoundHotkeysProxyProvider.Provider, {\n value: {\n addHotkey: addHotkey,\n removeHotkey: removeHotkey\n },\n children: children\n });\n}\n\nfunction deepEqual(x, y) {\n //@ts-ignore\n return x && y && typeof x === 'object' && typeof y === 'object' ? Object.keys(x).length === Object.keys(y).length &&\n //@ts-ignore\n Object.keys(x).reduce(function (isEqual, key) {\n return isEqual && deepEqual(x[key], y[key]);\n }, true) : x === y;\n}\n\nvar HotkeysContext = /*#__PURE__*/createContext({\n hotkeys: [],\n enabledScopes: [],\n toggleScope: function toggleScope() {},\n enableScope: function enableScope() {},\n disableScope: function disableScope() {}\n});\nvar useHotkeysContext = function useHotkeysContext() {\n return useContext(HotkeysContext);\n};\nvar HotkeysProvider = function HotkeysProvider(_ref) {\n var _ref$initiallyActiveS = _ref.initiallyActiveScopes,\n initiallyActiveScopes = _ref$initiallyActiveS === void 0 ? ['*'] : _ref$initiallyActiveS,\n children = _ref.children;\n var _useState = useState((initiallyActiveScopes == null ? void 0 : initiallyActiveScopes.length) > 0 ? initiallyActiveScopes : ['*']),\n internalActiveScopes = _useState[0],\n setInternalActiveScopes = _useState[1];\n var _useState2 = useState([]),\n boundHotkeys = _useState2[0],\n setBoundHotkeys = _useState2[1];\n var enableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n });\n }, []);\n var disableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n });\n }, []);\n var toggleScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes(scope)) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n } else {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n }\n });\n }, []);\n var addBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return [].concat(prev, [hotkey]);\n });\n }, []);\n var removeBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return prev.filter(function (h) {\n return !deepEqual(h, hotkey);\n });\n });\n }, []);\n return /*#__PURE__*/jsx(HotkeysContext.Provider, {\n value: {\n enabledScopes: internalActiveScopes,\n hotkeys: boundHotkeys,\n enableScope: enableScope,\n disableScope: disableScope,\n toggleScope: toggleScope\n },\n children: /*#__PURE__*/jsx(BoundHotkeysProxyProviderProvider, {\n addHotkey: addBoundHotkey,\n removeHotkey: removeBoundHotkey,\n children: children\n })\n });\n};\n\nfunction useDeepEqualMemo(value) {\n var ref = useRef(undefined);\n if (!deepEqual(ref.current, value)) {\n ref.current = value;\n }\n return ref.current;\n}\n\nvar stopPropagation = function stopPropagation(e) {\n e.stopPropagation();\n e.preventDefault();\n e.stopImmediatePropagation();\n};\nvar useSafeLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\nfunction useHotkeys(keys, callback, options, dependencies) {\n var _useState = useState(null),\n ref = _useState[0],\n setRef = _useState[1];\n var hasTriggeredRef = useRef(false);\n var _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : undefined;\n var _keys = isReadonlyArray(keys) ? keys.join(_options == null ? void 0 : _options.splitKey) : keys;\n var _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : undefined;\n var memoisedCB = useCallback(callback, _deps != null ? _deps : []);\n var cbRef = useRef(memoisedCB);\n if (_deps) {\n cbRef.current = memoisedCB;\n } else {\n cbRef.current = callback;\n }\n var memoisedOptions = useDeepEqualMemo(_options);\n var _useHotkeysContext = useHotkeysContext(),\n enabledScopes = _useHotkeysContext.enabledScopes;\n var proxy = useBoundHotkeysProxy();\n useSafeLayoutEffect(function () {\n if ((memoisedOptions == null ? void 0 : memoisedOptions.enabled) === false || !isScopeActive(enabledScopes, memoisedOptions == null ? void 0 : memoisedOptions.scopes)) {\n return;\n }\n var listener = function listener(e, isKeyUp) {\n var _e$target;\n if (isKeyUp === void 0) {\n isKeyUp = false;\n }\n if (isKeyboardEventTriggeredByInput(e) && !isHotkeyEnabledOnTag(e, memoisedOptions == null ? void 0 : memoisedOptions.enableOnFormTags)) {\n return;\n }\n // TODO: SINCE THE EVENT IS NOW ATTACHED TO THE REF, THE ACTIVE ELEMENT CAN NEVER BE INSIDE THE REF. THE HOTKEY ONLY TRIGGERS IF THE\n // REF IS THE ACTIVE ELEMENT. THIS IS A PROBLEM SINCE FOCUSED SUB COMPONENTS WON'T TRIGGER THE HOTKEY.\n if (ref !== null) {\n var rootNode = ref.getRootNode();\n if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement !== ref && !ref.contains(rootNode.activeElement)) {\n stopPropagation(e);\n return;\n }\n }\n if ((_e$target = e.target) != null && _e$target.isContentEditable && !(memoisedOptions != null && memoisedOptions.enableOnContentEditable)) {\n return;\n }\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n var _hotkey$keys;\n var hotkey = parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey);\n if (isHotkeyMatchingKeyboardEvent(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.ignoreModifiers) || (_hotkey$keys = hotkey.keys) != null && _hotkey$keys.includes('*')) {\n if (memoisedOptions != null && memoisedOptions.ignoreEventWhen != null && memoisedOptions.ignoreEventWhen(e)) {\n return;\n }\n if (isKeyUp && hasTriggeredRef.current) {\n return;\n }\n maybePreventDefault(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.preventDefault);\n if (!isHotkeyEnabled(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.enabled)) {\n stopPropagation(e);\n return;\n }\n // Execute the user callback for that hotkey\n cbRef.current(e, hotkey);\n if (!isKeyUp) {\n hasTriggeredRef.current = true;\n }\n }\n });\n };\n var handleKeyDown = function handleKeyDown(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys(mapKey(event.code));\n if ((memoisedOptions == null ? void 0 : memoisedOptions.keydown) === undefined && (memoisedOptions == null ? void 0 : memoisedOptions.keyup) !== true || memoisedOptions != null && memoisedOptions.keydown) {\n listener(event);\n }\n };\n var handleKeyUp = function handleKeyUp(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys(mapKey(event.code));\n hasTriggeredRef.current = false;\n if (memoisedOptions != null && memoisedOptions.keyup) {\n listener(event, true);\n }\n };\n var domNode = ref || (_options == null ? void 0 : _options.document) || document;\n // @ts-ignore\n domNode.addEventListener('keyup', handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);\n // @ts-ignore\n domNode.addEventListener('keydown', handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n return function () {\n // @ts-ignore\n domNode.removeEventListener('keyup', handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);\n // @ts-ignore\n domNode.removeEventListener('keydown', handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n };\n }, [ref, _keys, memoisedOptions, enabledScopes]);\n return setRef;\n}\n\nfunction useRecordHotkeys() {\n var _useState = useState(new Set()),\n keys = _useState[0],\n setKeys = _useState[1];\n var _useState2 = useState(false),\n isRecording = _useState2[0],\n setIsRecording = _useState2[1];\n var handler = useCallback(function (event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setKeys(function (prev) {\n var newKeys = new Set(prev);\n newKeys.add(mapKey(event.code));\n return newKeys;\n });\n }, []);\n var stop = useCallback(function () {\n if (typeof document !== 'undefined') {\n document.removeEventListener('keydown', handler);\n setIsRecording(false);\n }\n }, [handler]);\n var start = useCallback(function () {\n setKeys(new Set());\n if (typeof document !== 'undefined') {\n stop();\n document.addEventListener('keydown', handler);\n setIsRecording(true);\n }\n }, [handler, stop]);\n var resetKeys = useCallback(function () {\n setKeys(new Set());\n }, []);\n return [keys, {\n start: start,\n stop: stop,\n resetKeys: resetKeys,\n isRecording: isRecording\n }];\n}\n\nexport { HotkeysProvider, isHotkeyPressed, useHotkeys, useHotkeysContext, useRecordHotkeys };\n//# sourceMappingURL=react-hotkeys-hook.esm.js.map\n","import { useCallback, useEffect, useRef } from 'react';\nexport default function useMountedState() {\n var mountedRef = useRef(false);\n var get = useCallback(function () { return mountedRef.current; }, []);\n useEffect(function () {\n mountedRef.current = true;\n return function () {\n mountedRef.current = false;\n };\n }, []);\n return get;\n}\n","import { useCallback, useState } from 'react';\nvar useSetState = function (initialState) {\n if (initialState === void 0) { initialState = {}; }\n var _a = useState(initialState), state = _a[0], set = _a[1];\n var setState = useCallback(function (patch) {\n set(function (prevState) {\n return Object.assign({}, prevState, patch instanceof Function ? patch(prevState) : patch);\n });\n }, []);\n return [state, setState];\n};\nexport default useSetState;\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","import writeText from 'copy-to-clipboard';\nimport { useCallback } from 'react';\nimport useMountedState from './useMountedState';\nimport useSetState from './useSetState';\nvar useCopyToClipboard = function () {\n var isMounted = useMountedState();\n var _a = useSetState({\n value: undefined,\n error: undefined,\n noUserInteraction: true,\n }), state = _a[0], setState = _a[1];\n var copyToClipboard = useCallback(function (value) {\n if (!isMounted()) {\n return;\n }\n var noUserInteraction;\n var normalizedValue;\n try {\n // only strings and numbers casted to strings can be copied to clipboard\n if (typeof value !== 'string' && typeof value !== 'number') {\n var error = new Error(\"Cannot copy typeof \" + typeof value + \" to clipboard, must be a string\");\n if (process.env.NODE_ENV === 'development')\n console.error(error);\n setState({\n value: value,\n error: error,\n noUserInteraction: true,\n });\n return;\n }\n // empty strings are also considered invalid\n else if (value === '') {\n var error = new Error(\"Cannot copy empty string to clipboard.\");\n if (process.env.NODE_ENV === 'development')\n console.error(error);\n setState({\n value: value,\n error: error,\n noUserInteraction: true,\n });\n return;\n }\n normalizedValue = value.toString();\n noUserInteraction = writeText(normalizedValue);\n setState({\n value: normalizedValue,\n error: undefined,\n noUserInteraction: noUserInteraction,\n });\n }\n catch (error) {\n setState({\n value: normalizedValue,\n error: error,\n noUserInteraction: noUserInteraction,\n });\n }\n }, []);\n return [state, copyToClipboard];\n};\nexport default useCopyToClipboard;\n","import { useEffect, useState } from \"react\";\n\n/**\n * Hook that provides access to the current color scheme value.\n *\n * @experimental This hook is experimental and may change in future versions.\n *\n * This hook monitors the color-scheme CSS property on the document's HTML element\n * and returns the current value. It automatically updates when the color scheme changes,\n * either through direct style changes or theme updates stored in localStorage.\n *\n * The hook observes mutations to the HTML element's style attribute to detect\n * color scheme changes and re-renders the component when changes occur.\n *\n * @returns The current color scheme value as a string ('light', 'dark')\n */\nexport function useColorScheme() {\n const [colorScheme, setColorScheme] = useState(getCurrentColorScheme());\n\n // Helper function to get the current color-scheme from the <html> tag\n function getCurrentColorScheme() {\n return (\n document.documentElement.style.getPropertyValue(\"color-scheme\") ||\n localStorage.getItem(\"theme\") ||\n \"light\"\n );\n }\n\n useEffect(() => {\n const htmlElement = document.documentElement;\n\n const observer = new MutationObserver(() => {\n const newColorScheme = getCurrentColorScheme();\n setColorScheme(newColorScheme);\n });\n\n // Observe changes to the 'style' attribute of the <html> element\n observer.observe(htmlElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n });\n\n return () => observer.disconnect();\n }, []);\n\n return colorScheme;\n}\n","\"use client\";\nimport { useTheme } from \"next-themes\";\n\n/**\n * Hook for managing color mode (light/dark theme) state.\n *\n * @experimental This hook is experimental and may change in future versions.\n *\n * This hook provides access to the current color mode and functions to change it.\n * It integrates with the next-themes library to handle theme persistence and system preference detection.\n *\n * @returns An object containing:\n * - `colorMode`: The current resolved theme ('light' | 'dark' | 'system' | undefined)\n * - `setColorMode`: Function to set a specific color mode\n * - `toggleColorMode`: Function to toggle between light and dark modes\n *\n * @example\n * ```tsx\n * function ThemeToggle() {\n * const { colorMode, toggleColorMode } = useColorMode();\n *\n * return (\n * <button onClick={toggleColorMode}>\n * Current mode: {colorMode}\n * </button>\n * );\n * }\n * ```\n */\n\nexport function useColorMode() {\n const { resolvedTheme, setTheme } = useTheme();\n const toggleColorMode = () => {\n setTheme(resolvedTheme === \"light\" ? \"dark\" : \"light\");\n };\n return {\n colorMode: resolvedTheme,\n setColorMode: setTheme,\n toggleColorMode,\n };\n}\n","import { useColorMode } from \"./../use-color-mode\";\n\n/**\n * Hook that returns a value based on the current color mode.\n *\n * @experimental This hook is experimental and may change in future versions.\n *\n * @param light - The value to return when the color mode is light\n * @param dark - The value to return when the color mode is dark\n * @returns The appropriate value based on the current color mode\n */\nexport function useColorModeValue<T>(light: T, dark: T) {\n const { colorMode } = useColorMode();\n return colorMode === \"light\" ? light : dark;\n}\n"],"names":["_extends","n","e","t","r","reservedModifierKeywords","mappedKeys","mapKey","key","isHotkeyModifier","parseKeysHookInput","keys","splitKey","parseHotkey","hotkey","combinationKey","description","k","modifiers","singleCharKeys","currentlyPressedKeys","isReadonlyArray","value","isHotkeyPressed","hotkeyArray","pushToCurrentlyPressedKeys","removeFromCurrentlyPressedKeys","maybePreventDefault","preventDefault","isHotkeyEnabled","enabled","isKeyboardEventTriggeredByInput","ev","isHotkeyEnabledOnTag","event","enabledOnTags","target","composed","targetTagName","isCustomElement","tag","_targetTagName","element","isScopeActive","activeScopes","scopes","scope","isHotkeyMatchingKeyboardEvent","ignoreModifiers","alt","meta","mod","shift","ctrl","pressedKeyUppercase","code","ctrlKey","metaKey","shiftKey","altKey","keyCode","pressedKey","BoundHotkeysProxyProvider","createContext","useBoundHotkeysProxy","useContext","deepEqual","x","y","isEqual","HotkeysContext","useHotkeysContext","useDeepEqualMemo","ref","useRef","stopPropagation","useSafeLayoutEffect","useLayoutEffect","useEffect","useHotkeys","callback","options","dependencies","_useState","useState","setRef","hasTriggeredRef","_options","_keys","_deps","memoisedCB","useCallback","cbRef","memoisedOptions","_useHotkeysContext","enabledScopes","proxy","listener","isKeyUp","_e$target","rootNode","_hotkey$keys","handleKeyDown","handleKeyUp","domNode","useMountedState","mountedRef","get","useSetState","initialState","_a","state","set","setState","patch","prevState","toggleSelection","selection","active","ranges","i","range","deselectCurrent","require$$0","clipboardToIE11Formatting","defaultMessage","format","message","copyKey","copy","text","debug","reselectPrevious","mark","success","successful","err","copyToClipboard","useCopyToClipboard","isMounted","noUserInteraction","normalizedValue","error","writeText","useColorScheme","colorScheme","setColorScheme","getCurrentColorScheme","htmlElement","observer","newColorScheme","useColorMode","resolvedTheme","setTheme","useTheme","useColorModeValue","light","dark","colorMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAASA,IAAW;AAClB,SAAOA,IAAW,OAAO,SAAS,OAAO,OAAO,KAAI,IAAK,SAAUC,GAAG;AACpE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACzC,UAAIC,IAAI,UAAUD,CAAC;AACnB,eAASE,KAAKD,EAAG,EAAC,CAAA,GAAI,eAAe,KAAKA,GAAGC,CAAC,MAAMH,EAAEG,CAAC,IAAID,EAAEC,CAAC;AAAA,IAChE;AACA,WAAOH;AAAA,EACT,GAAGD,EAAS,MAAM,MAAM,SAAS;AACnC;AAEA,IAAIK,IAA2B,CAAC,SAAS,OAAO,QAAQ,OAAO,MAAM,GACjEC,IAAa;AAAA,EACf,KAAK;AAAA,EACL,QAAU;AAAA,EACV,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,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;AACT;AChBO,SAASM,KAAe;AAC7B,QAAM,EAAE,eAAAC,GAAe,UAAAC,EAAA,IAAaC,EAAA;AAIpC,SAAO;AAAA,IACL,WAAWF;AAAA,IACX,cAAcC;AAAA,IACd,iBANsB,MAAM;AAC5B,MAAAA,EAASD,MAAkB,UAAU,SAAS,OAAO;AAAA,IACvD;AAAA,EAIE;AAEJ;AC7BO,SAASG,GAAqBC,GAAUC,GAAS;AACtD,QAAM,EAAE,WAAAC,EAAA,IAAcP,GAAA;AACtB,SAAOO,MAAc,UAAUF,IAAQC;AACzC;","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"index.es.js","sources":["../../../node_modules/.pnpm/react-hotkeys-hook@4.6.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js","../../../node_modules/.pnpm/react-use@17.6.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-use/esm/useMountedState.js","../../../node_modules/.pnpm/react-use@17.6.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-use/esm/useSetState.js","../../../node_modules/.pnpm/toggle-selection@1.0.6/node_modules/toggle-selection/index.js","../../../node_modules/.pnpm/copy-to-clipboard@3.3.3/node_modules/copy-to-clipboard/index.js","../../../node_modules/.pnpm/react-use@17.6.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-use/esm/useCopyToClipboard.js","../src/hooks/use-color-scheme/use-color-scheme.ts","../src/hooks/use-color-mode/use-color-mode.ts","../src/hooks/use-color-mode-value/use-color-mode-value.ts"],"sourcesContent":["import { useContext, createContext, useState, useCallback, useRef, useLayoutEffect, useEffect } from 'react';\nimport { jsx } from 'react/jsx-runtime';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\n\nvar reservedModifierKeywords = ['shift', 'alt', 'meta', 'mod', 'ctrl'];\nvar mappedKeys = {\n esc: 'escape',\n \"return\": 'enter',\n '.': 'period',\n ',': 'comma',\n '-': 'slash',\n ' ': 'space',\n '`': 'backquote',\n '#': 'backslash',\n '+': 'bracketright',\n ShiftLeft: 'shift',\n ShiftRight: 'shift',\n AltLeft: 'alt',\n AltRight: 'alt',\n MetaLeft: 'meta',\n MetaRight: 'meta',\n OSLeft: 'meta',\n OSRight: 'meta',\n ControlLeft: 'ctrl',\n ControlRight: 'ctrl'\n};\nfunction mapKey(key) {\n return (key && mappedKeys[key] || key || '').trim().toLowerCase().replace(/key|digit|numpad|arrow/, '');\n}\nfunction isHotkeyModifier(key) {\n return reservedModifierKeywords.includes(key);\n}\nfunction parseKeysHookInput(keys, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n return keys.split(splitKey);\n}\nfunction parseHotkey(hotkey, combinationKey, description) {\n if (combinationKey === void 0) {\n combinationKey = '+';\n }\n var keys = hotkey.toLocaleLowerCase().split(combinationKey).map(function (k) {\n return mapKey(k);\n });\n var modifiers = {\n alt: keys.includes('alt'),\n ctrl: keys.includes('ctrl') || keys.includes('control'),\n shift: keys.includes('shift'),\n meta: keys.includes('meta'),\n mod: keys.includes('mod')\n };\n var singleCharKeys = keys.filter(function (k) {\n return !reservedModifierKeywords.includes(k);\n });\n return _extends({}, modifiers, {\n keys: singleCharKeys,\n description: description,\n hotkey: hotkey\n });\n}\n\n(function () {\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n document.addEventListener('keyup', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n }\n if (typeof window !== 'undefined') {\n window.addEventListener('blur', function () {\n currentlyPressedKeys.clear();\n });\n }\n})();\nvar currentlyPressedKeys = /*#__PURE__*/new Set();\n// https://github.com/microsoft/TypeScript/issues/17002\nfunction isReadonlyArray(value) {\n return Array.isArray(value);\n}\nfunction isHotkeyPressed(key, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n var hotkeyArray = isReadonlyArray(key) ? key : key.split(splitKey);\n return hotkeyArray.every(function (hotkey) {\n return currentlyPressedKeys.has(hotkey.trim().toLowerCase());\n });\n}\nfunction pushToCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (currentlyPressedKeys.has('meta')) {\n currentlyPressedKeys.forEach(function (key) {\n return !isHotkeyModifier(key) && currentlyPressedKeys[\"delete\"](key.toLowerCase());\n });\n }\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys.add(hotkey.toLowerCase());\n });\n}\nfunction removeFromCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (key === 'meta') {\n currentlyPressedKeys.clear();\n } else {\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys[\"delete\"](hotkey.toLowerCase());\n });\n }\n}\n\nfunction maybePreventDefault(e, hotkey, preventDefault) {\n if (typeof preventDefault === 'function' && preventDefault(e, hotkey) || preventDefault === true) {\n e.preventDefault();\n }\n}\nfunction isHotkeyEnabled(e, hotkey, enabled) {\n if (typeof enabled === 'function') {\n return enabled(e, hotkey);\n }\n return enabled === true || enabled === undefined;\n}\nfunction isKeyboardEventTriggeredByInput(ev) {\n return isHotkeyEnabledOnTag(ev, ['input', 'textarea', 'select']);\n}\nfunction isHotkeyEnabledOnTag(event, enabledOnTags) {\n if (enabledOnTags === void 0) {\n enabledOnTags = false;\n }\n var target = event.target,\n composed = event.composed;\n var targetTagName = null;\n if (isCustomElement(target) && composed) {\n targetTagName = event.composedPath()[0] && event.composedPath()[0].tagName;\n } else {\n targetTagName = target && target.tagName;\n }\n if (isReadonlyArray(enabledOnTags)) {\n return Boolean(targetTagName && enabledOnTags && enabledOnTags.some(function (tag) {\n var _targetTagName;\n return tag.toLowerCase() === ((_targetTagName = targetTagName) == null ? void 0 : _targetTagName.toLowerCase());\n }));\n }\n return Boolean(targetTagName && enabledOnTags && enabledOnTags);\n}\nfunction isCustomElement(element) {\n // We just do a basic check w/o any complex RegEx or validation against the list of legacy names containing a hyphen,\n // as none of them is likely to be an event target, and it won't hurt anyway if we miss.\n // see: https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname\n return !!element.tagName && !element.tagName.startsWith(\"-\") && element.tagName.includes(\"-\");\n}\nfunction isScopeActive(activeScopes, scopes) {\n if (activeScopes.length === 0 && scopes) {\n console.warn('A hotkey has the \"scopes\" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>');\n return true;\n }\n if (!scopes) {\n return true;\n }\n return activeScopes.some(function (scope) {\n return scopes.includes(scope);\n }) || activeScopes.includes('*');\n}\nvar isHotkeyMatchingKeyboardEvent = function isHotkeyMatchingKeyboardEvent(e, hotkey, ignoreModifiers) {\n if (ignoreModifiers === void 0) {\n ignoreModifiers = false;\n }\n var alt = hotkey.alt,\n meta = hotkey.meta,\n mod = hotkey.mod,\n shift = hotkey.shift,\n ctrl = hotkey.ctrl,\n keys = hotkey.keys;\n var pressedKeyUppercase = e.key,\n code = e.code,\n ctrlKey = e.ctrlKey,\n metaKey = e.metaKey,\n shiftKey = e.shiftKey,\n altKey = e.altKey;\n var keyCode = mapKey(code);\n var pressedKey = pressedKeyUppercase.toLowerCase();\n if (!(keys != null && keys.includes(keyCode)) && !(keys != null && keys.includes(pressedKey)) && !['ctrl', 'control', 'unknown', 'meta', 'alt', 'shift', 'os'].includes(keyCode)) {\n return false;\n }\n if (!ignoreModifiers) {\n // We check the pressed keys for compatibility with the keyup event. In keyup events the modifier flags are not set.\n if (alt === !altKey && pressedKey !== 'alt') {\n return false;\n }\n if (shift === !shiftKey && pressedKey !== 'shift') {\n return false;\n }\n // Mod is a special key name that is checking for meta on macOS and ctrl on other platforms\n if (mod) {\n if (!metaKey && !ctrlKey) {\n return false;\n }\n } else {\n if (meta === !metaKey && pressedKey !== 'meta' && pressedKey !== 'os') {\n return false;\n }\n if (ctrl === !ctrlKey && pressedKey !== 'ctrl' && pressedKey !== 'control') {\n return false;\n }\n }\n }\n // All modifiers are correct, now check the key\n // If the key is set, we check for the key\n if (keys && keys.length === 1 && (keys.includes(pressedKey) || keys.includes(keyCode))) {\n return true;\n } else if (keys) {\n // Check if all keys are present in pressedDownKeys set\n return isHotkeyPressed(keys);\n } else if (!keys) {\n // If the key is not set, we only listen for modifiers, that check went alright, so we return true\n return true;\n }\n // There is nothing that matches.\n return false;\n};\n\nvar BoundHotkeysProxyProvider = /*#__PURE__*/createContext(undefined);\nvar useBoundHotkeysProxy = function useBoundHotkeysProxy() {\n return useContext(BoundHotkeysProxyProvider);\n};\nfunction BoundHotkeysProxyProviderProvider(_ref) {\n var addHotkey = _ref.addHotkey,\n removeHotkey = _ref.removeHotkey,\n children = _ref.children;\n return /*#__PURE__*/jsx(BoundHotkeysProxyProvider.Provider, {\n value: {\n addHotkey: addHotkey,\n removeHotkey: removeHotkey\n },\n children: children\n });\n}\n\nfunction deepEqual(x, y) {\n //@ts-ignore\n return x && y && typeof x === 'object' && typeof y === 'object' ? Object.keys(x).length === Object.keys(y).length &&\n //@ts-ignore\n Object.keys(x).reduce(function (isEqual, key) {\n return isEqual && deepEqual(x[key], y[key]);\n }, true) : x === y;\n}\n\nvar HotkeysContext = /*#__PURE__*/createContext({\n hotkeys: [],\n enabledScopes: [],\n toggleScope: function toggleScope() {},\n enableScope: function enableScope() {},\n disableScope: function disableScope() {}\n});\nvar useHotkeysContext = function useHotkeysContext() {\n return useContext(HotkeysContext);\n};\nvar HotkeysProvider = function HotkeysProvider(_ref) {\n var _ref$initiallyActiveS = _ref.initiallyActiveScopes,\n initiallyActiveScopes = _ref$initiallyActiveS === void 0 ? ['*'] : _ref$initiallyActiveS,\n children = _ref.children;\n var _useState = useState((initiallyActiveScopes == null ? void 0 : initiallyActiveScopes.length) > 0 ? initiallyActiveScopes : ['*']),\n internalActiveScopes = _useState[0],\n setInternalActiveScopes = _useState[1];\n var _useState2 = useState([]),\n boundHotkeys = _useState2[0],\n setBoundHotkeys = _useState2[1];\n var enableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n });\n }, []);\n var disableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n });\n }, []);\n var toggleScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes(scope)) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n } else {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n }\n });\n }, []);\n var addBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return [].concat(prev, [hotkey]);\n });\n }, []);\n var removeBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return prev.filter(function (h) {\n return !deepEqual(h, hotkey);\n });\n });\n }, []);\n return /*#__PURE__*/jsx(HotkeysContext.Provider, {\n value: {\n enabledScopes: internalActiveScopes,\n hotkeys: boundHotkeys,\n enableScope: enableScope,\n disableScope: disableScope,\n toggleScope: toggleScope\n },\n children: /*#__PURE__*/jsx(BoundHotkeysProxyProviderProvider, {\n addHotkey: addBoundHotkey,\n removeHotkey: removeBoundHotkey,\n children: children\n })\n });\n};\n\nfunction useDeepEqualMemo(value) {\n var ref = useRef(undefined);\n if (!deepEqual(ref.current, value)) {\n ref.current = value;\n }\n return ref.current;\n}\n\nvar stopPropagation = function stopPropagation(e) {\n e.stopPropagation();\n e.preventDefault();\n e.stopImmediatePropagation();\n};\nvar useSafeLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\nfunction useHotkeys(keys, callback, options, dependencies) {\n var _useState = useState(null),\n ref = _useState[0],\n setRef = _useState[1];\n var hasTriggeredRef = useRef(false);\n var _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : undefined;\n var _keys = isReadonlyArray(keys) ? keys.join(_options == null ? void 0 : _options.splitKey) : keys;\n var _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : undefined;\n var memoisedCB = useCallback(callback, _deps != null ? _deps : []);\n var cbRef = useRef(memoisedCB);\n if (_deps) {\n cbRef.current = memoisedCB;\n } else {\n cbRef.current = callback;\n }\n var memoisedOptions = useDeepEqualMemo(_options);\n var _useHotkeysContext = useHotkeysContext(),\n enabledScopes = _useHotkeysContext.enabledScopes;\n var proxy = useBoundHotkeysProxy();\n useSafeLayoutEffect(function () {\n if ((memoisedOptions == null ? void 0 : memoisedOptions.enabled) === false || !isScopeActive(enabledScopes, memoisedOptions == null ? void 0 : memoisedOptions.scopes)) {\n return;\n }\n var listener = function listener(e, isKeyUp) {\n var _e$target;\n if (isKeyUp === void 0) {\n isKeyUp = false;\n }\n if (isKeyboardEventTriggeredByInput(e) && !isHotkeyEnabledOnTag(e, memoisedOptions == null ? void 0 : memoisedOptions.enableOnFormTags)) {\n return;\n }\n // TODO: SINCE THE EVENT IS NOW ATTACHED TO THE REF, THE ACTIVE ELEMENT CAN NEVER BE INSIDE THE REF. THE HOTKEY ONLY TRIGGERS IF THE\n // REF IS THE ACTIVE ELEMENT. THIS IS A PROBLEM SINCE FOCUSED SUB COMPONENTS WON'T TRIGGER THE HOTKEY.\n if (ref !== null) {\n var rootNode = ref.getRootNode();\n if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement !== ref && !ref.contains(rootNode.activeElement)) {\n stopPropagation(e);\n return;\n }\n }\n if ((_e$target = e.target) != null && _e$target.isContentEditable && !(memoisedOptions != null && memoisedOptions.enableOnContentEditable)) {\n return;\n }\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n var _hotkey$keys;\n var hotkey = parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey);\n if (isHotkeyMatchingKeyboardEvent(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.ignoreModifiers) || (_hotkey$keys = hotkey.keys) != null && _hotkey$keys.includes('*')) {\n if (memoisedOptions != null && memoisedOptions.ignoreEventWhen != null && memoisedOptions.ignoreEventWhen(e)) {\n return;\n }\n if (isKeyUp && hasTriggeredRef.current) {\n return;\n }\n maybePreventDefault(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.preventDefault);\n if (!isHotkeyEnabled(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.enabled)) {\n stopPropagation(e);\n return;\n }\n // Execute the user callback for that hotkey\n cbRef.current(e, hotkey);\n if (!isKeyUp) {\n hasTriggeredRef.current = true;\n }\n }\n });\n };\n var handleKeyDown = function handleKeyDown(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys(mapKey(event.code));\n if ((memoisedOptions == null ? void 0 : memoisedOptions.keydown) === undefined && (memoisedOptions == null ? void 0 : memoisedOptions.keyup) !== true || memoisedOptions != null && memoisedOptions.keydown) {\n listener(event);\n }\n };\n var handleKeyUp = function handleKeyUp(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys(mapKey(event.code));\n hasTriggeredRef.current = false;\n if (memoisedOptions != null && memoisedOptions.keyup) {\n listener(event, true);\n }\n };\n var domNode = ref || (_options == null ? void 0 : _options.document) || document;\n // @ts-ignore\n domNode.addEventListener('keyup', handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);\n // @ts-ignore\n domNode.addEventListener('keydown', handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n return function () {\n // @ts-ignore\n domNode.removeEventListener('keyup', handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);\n // @ts-ignore\n domNode.removeEventListener('keydown', handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n };\n }, [ref, _keys, memoisedOptions, enabledScopes]);\n return setRef;\n}\n\nfunction useRecordHotkeys() {\n var _useState = useState(new Set()),\n keys = _useState[0],\n setKeys = _useState[1];\n var _useState2 = useState(false),\n isRecording = _useState2[0],\n setIsRecording = _useState2[1];\n var handler = useCallback(function (event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setKeys(function (prev) {\n var newKeys = new Set(prev);\n newKeys.add(mapKey(event.code));\n return newKeys;\n });\n }, []);\n var stop = useCallback(function () {\n if (typeof document !== 'undefined') {\n document.removeEventListener('keydown', handler);\n setIsRecording(false);\n }\n }, [handler]);\n var start = useCallback(function () {\n setKeys(new Set());\n if (typeof document !== 'undefined') {\n stop();\n document.addEventListener('keydown', handler);\n setIsRecording(true);\n }\n }, [handler, stop]);\n var resetKeys = useCallback(function () {\n setKeys(new Set());\n }, []);\n return [keys, {\n start: start,\n stop: stop,\n resetKeys: resetKeys,\n isRecording: isRecording\n }];\n}\n\nexport { HotkeysProvider, isHotkeyPressed, useHotkeys, useHotkeysContext, useRecordHotkeys };\n//# sourceMappingURL=react-hotkeys-hook.esm.js.map\n","import { useCallback, useEffect, useRef } from 'react';\nexport default function useMountedState() {\n var mountedRef = useRef(false);\n var get = useCallback(function () { return mountedRef.current; }, []);\n useEffect(function () {\n mountedRef.current = true;\n return function () {\n mountedRef.current = false;\n };\n }, []);\n return get;\n}\n","import { useCallback, useState } from 'react';\nvar useSetState = function (initialState) {\n if (initialState === void 0) { initialState = {}; }\n var _a = useState(initialState), state = _a[0], set = _a[1];\n var setState = useCallback(function (patch) {\n set(function (prevState) {\n return Object.assign({}, prevState, patch instanceof Function ? patch(prevState) : patch);\n });\n }, []);\n return [state, setState];\n};\nexport default useSetState;\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","import writeText from 'copy-to-clipboard';\nimport { useCallback } from 'react';\nimport useMountedState from './useMountedState';\nimport useSetState from './useSetState';\nvar useCopyToClipboard = function () {\n var isMounted = useMountedState();\n var _a = useSetState({\n value: undefined,\n error: undefined,\n noUserInteraction: true,\n }), state = _a[0], setState = _a[1];\n var copyToClipboard = useCallback(function (value) {\n if (!isMounted()) {\n return;\n }\n var noUserInteraction;\n var normalizedValue;\n try {\n // only strings and numbers casted to strings can be copied to clipboard\n if (typeof value !== 'string' && typeof value !== 'number') {\n var error = new Error(\"Cannot copy typeof \" + typeof value + \" to clipboard, must be a string\");\n if (process.env.NODE_ENV === 'development')\n console.error(error);\n setState({\n value: value,\n error: error,\n noUserInteraction: true,\n });\n return;\n }\n // empty strings are also considered invalid\n else if (value === '') {\n var error = new Error(\"Cannot copy empty string to clipboard.\");\n if (process.env.NODE_ENV === 'development')\n console.error(error);\n setState({\n value: value,\n error: error,\n noUserInteraction: true,\n });\n return;\n }\n normalizedValue = value.toString();\n noUserInteraction = writeText(normalizedValue);\n setState({\n value: normalizedValue,\n error: undefined,\n noUserInteraction: noUserInteraction,\n });\n }\n catch (error) {\n setState({\n value: normalizedValue,\n error: error,\n noUserInteraction: noUserInteraction,\n });\n }\n }, []);\n return [state, copyToClipboard];\n};\nexport default useCopyToClipboard;\n","import { useEffect, useState } from \"react\";\n\n/**\n * Hook that provides access to the current color scheme value.\n *\n * @experimental This hook is experimental and may change in future versions.\n *\n * This hook monitors the color-scheme CSS property on the document's HTML element\n * and returns the current value. It automatically updates when the color scheme changes,\n * either through direct style changes or theme updates stored in localStorage.\n *\n * The hook observes mutations to the HTML element's style attribute to detect\n * color scheme changes and re-renders the component when changes occur.\n *\n * @returns The current color scheme value as a string ('light', 'dark')\n */\nexport function useColorScheme() {\n const [colorScheme, setColorScheme] = useState(getCurrentColorScheme());\n\n // Helper function to get the current color-scheme from the <html> tag\n function getCurrentColorScheme() {\n return (\n document.documentElement.style.getPropertyValue(\"color-scheme\") ||\n localStorage.getItem(\"theme\") ||\n \"light\"\n );\n }\n\n useEffect(() => {\n const htmlElement = document.documentElement;\n\n const observer = new MutationObserver(() => {\n const newColorScheme = getCurrentColorScheme();\n setColorScheme(newColorScheme);\n });\n\n // Observe changes to the 'style' attribute of the <html> element\n observer.observe(htmlElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n });\n\n return () => observer.disconnect();\n }, []);\n\n return colorScheme;\n}\n","\"use client\";\nimport { useTheme } from \"next-themes\";\n\n/**\n * Hook for managing color mode (light/dark theme) state.\n *\n * @experimental This hook is experimental and may change in future versions.\n *\n * This hook provides access to the current color mode and functions to change it.\n * It integrates with the next-themes library to handle theme persistence and system preference detection.\n *\n * @returns An object containing:\n * - `colorMode`: The current resolved theme ('light' | 'dark' | 'system' | undefined)\n * - `setColorMode`: Function to set a specific color mode\n * - `toggleColorMode`: Function to toggle between light and dark modes\n *\n * @example\n * ```tsx\n * function ThemeToggle() {\n * const { colorMode, toggleColorMode } = useColorMode();\n *\n * return (\n * <button onClick={toggleColorMode}>\n * Current mode: {colorMode}\n * </button>\n * );\n * }\n * ```\n */\n\nexport function useColorMode() {\n const { resolvedTheme, setTheme } = useTheme();\n const toggleColorMode = () => {\n setTheme(resolvedTheme === \"light\" ? \"dark\" : \"light\");\n };\n return {\n colorMode: resolvedTheme,\n setColorMode: setTheme,\n toggleColorMode,\n };\n}\n","import { useColorMode } from \"./../use-color-mode\";\n\n/**\n * Hook that returns a value based on the current color mode.\n *\n * @experimental This hook is experimental and may change in future versions.\n *\n * @param light - The value to return when the color mode is light\n * @param dark - The value to return when the color mode is dark\n * @returns The appropriate value based on the current color mode\n */\nexport function useColorModeValue<T>(light: T, dark: T) {\n const { colorMode } = useColorMode();\n return colorMode === \"light\" ? light : dark;\n}\n"],"names":["_extends","n","e","t","r","reservedModifierKeywords","mappedKeys","mapKey","key","isHotkeyModifier","parseKeysHookInput","keys","splitKey","parseHotkey","hotkey","combinationKey","description","k","modifiers","singleCharKeys","currentlyPressedKeys","isReadonlyArray","value","isHotkeyPressed","hotkeyArray","pushToCurrentlyPressedKeys","removeFromCurrentlyPressedKeys","maybePreventDefault","preventDefault","isHotkeyEnabled","enabled","isKeyboardEventTriggeredByInput","ev","isHotkeyEnabledOnTag","event","enabledOnTags","target","composed","targetTagName","isCustomElement","tag","_targetTagName","element","isScopeActive","activeScopes","scopes","scope","isHotkeyMatchingKeyboardEvent","ignoreModifiers","alt","meta","mod","shift","ctrl","pressedKeyUppercase","code","ctrlKey","metaKey","shiftKey","altKey","keyCode","pressedKey","BoundHotkeysProxyProvider","createContext","useBoundHotkeysProxy","useContext","deepEqual","x","y","isEqual","HotkeysContext","useHotkeysContext","useDeepEqualMemo","ref","useRef","stopPropagation","useSafeLayoutEffect","useLayoutEffect","useEffect","useHotkeys","callback","options","dependencies","_useState","useState","setRef","hasTriggeredRef","_options","_keys","_deps","memoisedCB","useCallback","cbRef","memoisedOptions","_useHotkeysContext","enabledScopes","proxy","listener","isKeyUp","_e$target","rootNode","_hotkey$keys","handleKeyDown","handleKeyUp","domNode","useMountedState","mountedRef","get","useSetState","initialState","_a","state","set","setState","patch","prevState","toggleSelection","selection","active","ranges","i","range","deselectCurrent","require$$0","clipboardToIE11Formatting","defaultMessage","format","message","copyKey","copy","text","debug","reselectPrevious","mark","success","successful","err","copyToClipboard","useCopyToClipboard","isMounted","noUserInteraction","normalizedValue","error","writeText","useColorScheme","colorScheme","setColorScheme","getCurrentColorScheme","htmlElement","observer","newColorScheme","useColorMode","resolvedTheme","setTheme","useTheme","useColorModeValue","light","dark","colorMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAASA,IAAW;AAClB,SAAOA,IAAW,OAAO,SAAS,OAAO,OAAO,KAAI,IAAK,SAAUC,GAAG;AACpE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACzC,UAAIC,IAAI,UAAUD,CAAC;AACnB,eAASE,KAAKD,EAAG,EAAC,CAAA,GAAI,eAAe,KAAKA,GAAGC,CAAC,MAAMH,EAAEG,CAAC,IAAID,EAAEC,CAAC;AAAA,IAChE;AACA,WAAOH;AAAA,EACT,GAAGD,EAAS,MAAM,MAAM,SAAS;AACnC;AAEA,IAAIK,IAA2B,CAAC,SAAS,OAAO,QAAQ,OAAO,MAAM,GACjEC,IAAa;AAAA,EACf,KAAK;AAAA,EACL,QAAU;AAAA,EACV,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,cAAc;AAChB;AACA,SAASC,EAAOC,GAAK;AACnB,UAAQA,KAAOF,EAAWE,CAAG,KAAKA,KAAO,IAAI,KAAI,EAAG,YAAW,EAAG,QAAQ,0BAA0B,EAAE;AACxG;AACA,SAASC,EAAiBD,GAAK;AAC7B,SAAOH,EAAyB,SAASG,CAAG;AAC9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@chakra-ui/react/styled-system';
2
+ import { JSX } from 'react/jsx-runtime';
3
+ import { RecipeDefinition } from '@chakra-ui/react';
4
+ import { RecipeProps } from '@chakra-ui/react/styled-system';
5
+ import { RecipeVariantProps } from '@chakra-ui/react/styled-system';
6
+ import { Ref } from 'react';
7
+ import { UnstyledProp } from '@chakra-ui/react/styled-system';
8
+
9
+ declare interface BoxProps extends HTMLChakraProps<"div"> {
10
+ children?: React.ReactNode;
11
+ ref?: React.Ref<HTMLDivElement>;
12
+ }
13
+
14
+ /**
15
+ * Main props interface for the Icon component.
16
+ * Extends IconVariantProps to include both root props and variant props,
17
+ * while adding support for React children.
18
+ */
19
+ declare interface IconProps extends IconVariantProps {
20
+ /**
21
+ * Accepts only a single child - an icon-component or SVG html-element.
22
+ * Alternatively, as shorthand, use the `as` property.
23
+ */
24
+ children?: React.ReactNode;
25
+ /**
26
+ * Colors the icon, accepts a color token from the theme or a custom value
27
+ */
28
+ color?: BoxProps["color"];
29
+ /**
30
+ * Accepts a React component to be rendered as the icon .
31
+ */
32
+ as?: BoxProps["as"];
33
+ /**
34
+ * Ref to the icon element
35
+ */
36
+ ref?: React.Ref<SVGSVGElement>;
37
+ /**
38
+ * The slot to render the icon in.
39
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/slot
40
+ */
41
+ slot?: string | null | undefined;
42
+ }
43
+
44
+ /**
45
+ * Recipe configuration for the Icon component.
46
+ * Defines the styling variants and base styles using Chakra UI's recipe system.
47
+ */
48
+ declare const iconRecipe: RecipeDefinition< {
49
+ /**
50
+ * allows applying a predefined size to the icon
51
+ */
52
+ size: {
53
+ "2xs": {
54
+ boxSize: "600";
55
+ };
56
+ xs: {
57
+ boxSize: "800";
58
+ };
59
+ sm: {
60
+ boxSize: "900";
61
+ };
62
+ md: {
63
+ boxSize: "1000";
64
+ };
65
+ lg: {
66
+ boxSize: "1200";
67
+ };
68
+ xl: {
69
+ boxSize: "1400";
70
+ };
71
+ };
72
+ }>;
73
+
74
+ /**
75
+ * Base recipe props interface that combines Chakra UI's recipe props
76
+ * with the unstyled prop option for the svg element.
77
+ */
78
+ declare interface IconRecipeProps extends RecipeProps<"svg">, UnstyledProp {
79
+ }
80
+
81
+ /**
82
+ * Root props interface that extends Chakra's HTML props with our recipe props.
83
+ * This creates a complete set of props for the root element, combining
84
+ * HTML attributes, Chakra's styling system, and our custom recipe props.
85
+ */
86
+ declare interface IconRootSlotProps extends HTMLChakraProps<"svg", IconRecipeProps> {
87
+ }
88
+
89
+ /**
90
+ * Combines the root props with Chakra UI's recipe variant props.
91
+ * This allows the component to accept both structural props from Root
92
+ * and styling variants from the recipe.
93
+ */
94
+ declare type IconVariantProps = Omit<IconRootSlotProps, keyof React.SVGProps<SVGSVGElement> | "css" | "unstyled" | "asChild" | "recipe"> & RecipeVariantProps<typeof iconRecipe>;
95
+
96
+ /**
97
+ * # InlineSvg
98
+ *
99
+ * Renders arbitrary SVG markup as an icon with built-in XSS protection.
100
+ * The component sanitizes the provided SVG string to remove potentially
101
+ * dangerous elements and attributes before rendering.
102
+ *
103
+ * @example
104
+ * ```tsx
105
+ * <InlineSvg
106
+ * data='<svg viewBox="0 0 24 24"><path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12..."/></svg>'
107
+ * size="md"
108
+ * color="primary.9"
109
+ * />
110
+ * ```
111
+ *
112
+ * @see {@link https://nimbus-documentation.vercel.app/components/media/inline-svg}
113
+ */
114
+ export declare const InlineSvg: {
115
+ (props: InlineSvgProps): JSX.Element | null;
116
+ displayName: string;
117
+ };
118
+
119
+ export declare interface InlineSvgProps extends Omit<IconProps, "children" | "as" | "asChild"> {
120
+ /**
121
+ * SVG markup as a string to render
122
+ */
123
+ data: string;
124
+ /**
125
+ * Ref to the SVG element
126
+ */
127
+ ref?: Ref<SVGSVGElement>;
128
+ }
129
+
130
+ export { }
131
+
132
+
133
+ declare module "slate" {
134
+ interface CustomTypes {
135
+ Editor: BaseEditor & ReactEditor & HistoryEditor;
136
+ Element: CustomElement;
137
+ Text: CustomText;
138
+ }
139
+ }
package/dist/utils.d.ts CHANGED
@@ -1,156 +1,36 @@
1
- import { BaseText } from 'slate';
2
- import { Descendant } from 'slate';
3
- import { Editor } from 'slate';
4
- import { ReactElement } from 'react';
5
- import { RenderElementProps } from 'slate-react';
6
- import { RenderLeafProps } from 'slate-react';
7
-
8
- declare const BLOCK_TAGS: {
9
- readonly blockquote: "block-quote";
10
- readonly p: "paragraph";
11
- readonly pre: "code";
12
- readonly h1: "heading-one";
13
- readonly h2: "heading-two";
14
- readonly h3: "heading-three";
15
- readonly h4: "heading-four";
16
- readonly h5: "heading-five";
17
- readonly ul: "bulleted-list";
18
- readonly ol: "numbered-list";
19
- readonly li: "list-item";
20
- readonly a: "link";
21
- };
22
-
23
- declare type BlockType = (typeof blockTypes)[number] | "paragraph";
24
-
25
- /**
26
- * Available block types for text style detection
27
- *
28
- * Used by:
29
- * - hooks/useToolbarState.ts: Detects currently active block type in editor
30
- * - Excludes "paragraph" as it's the default/fallback type
31
- */
32
- declare const blockTypes: readonly ["heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "block-quote"];
33
-
34
- export declare const createEmptyValue: () => Descendant[];
35
-
36
1
  /**
37
- * Creates a block type from heading level
38
- */
39
- export declare function createHeadingBlockType(level: number): BlockType | null;
40
-
41
- export declare interface CustomElement {
42
- type: ElementFormat;
43
- children: Descendant[];
44
- align?: string;
45
- url?: string;
46
- htmlAttributes?: Record<string, string>;
47
- }
48
-
49
- export declare interface CustomText extends BaseText {
50
- bold?: boolean;
51
- code?: boolean;
52
- italic?: boolean;
53
- underline?: boolean;
54
- superscript?: boolean;
55
- subscript?: boolean;
56
- strikethrough?: boolean;
2
+ * Checks if we're in a browser environment
3
+ */
4
+ export declare function canUseDOM(): boolean;
5
+
6
+ /**
7
+ * Configuration options for SVG sanitization
8
+ */
9
+ declare interface SanitizationOptions {
10
+ /**
11
+ * Whether to allow style attributes in SVG elements
12
+ * @default false
13
+ */
14
+ allowStyles?: boolean;
15
+ /**
16
+ * Additional attributes to remove during sanitization beyond the default set
17
+ * @default []
18
+ */
19
+ forbiddenAttributes?: string[];
20
+ /**
21
+ * Additional tags to remove during sanitization beyond the default set
22
+ * @default []
23
+ */
24
+ forbiddenTags?: string[];
57
25
  }
58
26
 
59
- declare const Element_2: ({ attributes, children, element, }: RenderElementProps) => ReactElement;
60
- export { Element_2 as Element }
61
-
62
- export declare type ElementFormat = (typeof BLOCK_TAGS)[keyof typeof BLOCK_TAGS];
63
-
64
- export declare const focusEditor: (editor: Editor) => void;
65
-
66
- export declare const fromHTML: (html: string) => Descendant[];
67
-
68
- /**
69
- * Gets the heading level from a heading block type (1-6)
70
- */
71
- export declare function getHeadingLevel(blockType: string): number | null;
72
-
73
- /**
74
- * Gets a text style definition by its ID
75
- */
76
- export declare function getTextStyleById(styleId: string): TextStyleDefinition | undefined;
77
-
78
- /**
79
- * Gets all available text style IDs
80
- */
81
- export declare function getTextStyleIds(): string[];
82
-
83
- /**
84
- * Gets the display label for a text style ID
85
- */
86
- export declare function getTextStyleLabel(styleId: string): string;
87
-
88
- /**
89
- * Gets the text style properties for rendering
90
- */
91
- export declare function getTextStyleProps(styleId: string): TextStyleDefinition["props"] | null;
92
-
93
- export declare const isBlockActive: (editor: Editor, format: ElementFormat) => boolean;
94
-
95
- /**
96
- * Checks if a rich text HTML value is empty or contains no meaningful content
97
- */
98
- export declare const isEmpty: (value: string) => boolean;
99
-
100
- /**
101
- * Determines if a block type is a heading
102
- */
103
- export declare function isHeadingType(blockType: string): boolean;
104
-
105
- export declare const isMarkActive: (editor: Editor, format: string) => boolean;
106
-
107
27
  /**
108
- * Checks if a style ID is a valid text style
28
+ * Sanitizes SVG markup string to prevent XSS attacks
29
+ * @param svgString - The SVG markup as a string
30
+ * @param options - Optional sanitization configuration
31
+ * @returns Sanitized SVG string or null if invalid
109
32
  */
110
- export declare function isValidTextStyle(styleId: string): boolean;
111
-
112
- export declare const Leaf: ({ attributes, children, leaf, }: RenderLeafProps) => ReactElement;
113
-
114
- export declare const resetEditor: (editor: Editor, value: string) => void;
115
-
116
- export declare const Softbreaker: {
117
- placeholderCharacter: string;
118
- serialize: (string: string) => string;
119
- deserialize: (string: string) => string;
120
- };
121
-
122
- /**
123
- * Text style definitions for rich text editor block formatting
124
- *
125
- * Used by:
126
- * - components/rich-text-toolbar.tsx: Renders text style dropdown menu with these options
127
- * - hooks/useToolbarState.ts: Manages current text style state and selection logic
128
- * - utils/text-style-utils.ts: Helper functions for text style operations
129
- * - utils/validation-utils.ts: Validates if block types are supported
130
- *
131
- * Purpose:
132
- * - Centralizes all available text styles and their visual properties
133
- * - Maps block type IDs to user-friendly labels and Chakra UI styling props
134
- * - Ensures consistent styling across the editor and UI controls
135
- */
136
- declare interface TextStyleDefinition {
137
- id: string;
138
- label: string;
139
- props: {
140
- textStyle: string;
141
- fontWeight: string;
142
- };
143
- }
144
-
145
- export declare const toggleBlock: (editor: Editor, format: ElementFormat) => void;
146
-
147
- export declare const toggleMark: (editor: Editor, format: string) => void;
148
-
149
- export declare const toHTML: (value: Descendant[]) => string;
150
-
151
- export declare const validSlateStateAdapter: (value: unknown) => Descendant[];
152
-
153
- export declare const withLinks: (editor: Editor) => Editor;
33
+ export declare function sanitizeSvg(svgString: string, options?: SanitizationOptions): string | null;
154
34
 
155
35
  export { }
156
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools/nimbus",
3
- "version": "0.0.0-canary-20250916130207",
3
+ "version": "0.0.0-canary-20250918091239",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",
@@ -82,6 +82,7 @@
82
82
  "@vueless/storybook-dark-mode": "^9.0.8",
83
83
  "apca-w3": "^0.1.9",
84
84
  "axe-core": "^4.10.2",
85
+ "dompurify": "^3.2.6",
85
86
  "glob": "^11.0.3",
86
87
  "playwright": "^1.55.0",
87
88
  "react": "^19.0.0",
@@ -92,15 +93,15 @@
92
93
  "vite-plugin-dts": "^4.5.4",
93
94
  "vite-tsconfig-paths": "^5.1.4",
94
95
  "vitest": "^3.2.4",
95
- "@commercetools/nimbus-icons": "^0.0.0-canary-20250916130207",
96
- "@commercetools/nimbus-tokens": "^0.0.0-canary-20250916130207"
96
+ "@commercetools/nimbus-icons": "^0.0.0-canary-20250918091239",
97
+ "@commercetools/nimbus-tokens": "^0.0.0-canary-20250918091239"
97
98
  },
98
99
  "peerDependencies": {
99
100
  "@chakra-ui/react": "^3.26.0",
100
101
  "react": "^19.0.0",
101
102
  "react-intl": "^7.1.11",
102
- "@commercetools/nimbus-icons": "^0.0.0-canary-20250916130207",
103
- "@commercetools/nimbus-tokens": "^0.0.0-canary-20250916130207"
103
+ "@commercetools/nimbus-icons": "^0.0.0-canary-20250918091239",
104
+ "@commercetools/nimbus-tokens": "^0.0.0-canary-20250918091239"
104
105
  },
105
106
  "scripts": {
106
107
  "build": "pnpm run build-theme-typings && pnpm run build:lib",
@@ -1,31 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { defineRecipe as t, createRecipeContext as n } from "@chakra-ui/react/styled-system";
3
- const c = /* @__PURE__ */ t({
4
- className: "nimbus-icon",
5
- base: {
6
- display: "inline-block"
7
- },
8
- variants: {
9
- /**
10
- * allows applying a predefined size to the icon
11
- */
12
- size: {
13
- "2xs": { boxSize: "600" },
14
- xs: { boxSize: "800" },
15
- sm: { boxSize: "900" },
16
- md: { boxSize: "1000" },
17
- lg: { boxSize: "1200" },
18
- xl: { boxSize: "1400" }
19
- }
20
- }
21
- }), { withContext: r } = /* @__PURE__ */ n({ recipe: c }), x = /* @__PURE__ */ r(
22
- "svg"
23
- ), a = (o) => {
24
- const { ref: i, ...e } = o;
25
- return /* @__PURE__ */ s(x, { ref: i, asChild: !e.as, ...e });
26
- };
27
- a.displayName = "Icon";
28
- export {
29
- a as I
30
- };
31
- //# sourceMappingURL=icon-BoRbJStV.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-BoRbJStV.es.js","sources":["../../src/components/icon/icon.recipe.tsx","../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\n/**\n * Recipe configuration for the Icon component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const iconRecipe = defineRecipe({\n className: \"nimbus-icon\",\n base: {\n display: \"inline-block\",\n },\n\n variants: {\n /**\n * allows applying a predefined size to the icon\n */\n size: {\n \"2xs\": { boxSize: \"600\" },\n xs: { boxSize: \"800\" },\n sm: { boxSize: \"900\" },\n md: { boxSize: \"1000\" },\n lg: { boxSize: \"1200\" },\n xl: { boxSize: \"1400\" },\n },\n },\n});\n","import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { iconRecipe } from \"./icon.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ninterface IconRecipeProps extends RecipeProps<\"svg\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface IconRootSlotProps\n extends HTMLChakraProps<\"svg\", IconRecipeProps> {}\n\nconst { withContext } = createRecipeContext({ recipe: iconRecipe });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot = withContext<SVGSVGElement, IconRootSlotProps>(\n \"svg\"\n);\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["iconRecipe","defineRecipe","withContext","createRecipeContext","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":";;AAMO,MAAMA,IAAa,gBAAAC,EAAa;AAAA,EACrC,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,SAAS;AAAA,EAAA;AAAA,EAGX,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,MAAM;AAAA,MACJ,OAAO,EAAE,SAAS,MAAA;AAAA,MAClB,IAAI,EAAE,SAAS,MAAA;AAAA,MACf,IAAI,EAAE,SAAS,MAAA;AAAA,MACf,IAAI,EAAE,SAAS,OAAA;AAAA,MACf,IAAI,EAAE,SAAS,OAAA;AAAA,MACf,IAAI,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,EACxB;AAEJ,CAAC,GCDK,EAAE,aAAAC,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,QAAQH,GAAY,GAMrDI,IAAe,gBAAAF;AAAA,EAC1B;AACF,GCtBaG,IAAO,CAACC,MAAqB;AACxC,QAAM,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAcF;AAC9B,SAAO,gBAAAG,EAACL,KAAa,KAAAG,GAAU,SAAS,CAACC,EAAU,IAAK,GAAGA,GAAW;AACxE;AAEAH,EAAK,cAAc;"}
@@ -1,2 +0,0 @@
1
- "use strict";const n=require("react/jsx-runtime"),s=require("@chakra-ui/react/styled-system"),c=s.defineRecipe({className:"nimbus-icon",base:{display:"inline-block"},variants:{size:{"2xs":{boxSize:"600"},xs:{boxSize:"800"},sm:{boxSize:"900"},md:{boxSize:"1000"},lg:{boxSize:"1200"},xl:{boxSize:"1400"}}}}),{withContext:r}=s.createRecipeContext({recipe:c}),x=r("svg"),i=o=>{const{ref:t,...e}=o;return n.jsx(x,{ref:t,asChild:!e.as,...e})};i.displayName="Icon";exports.Icon=i;
2
- //# sourceMappingURL=icon-Cny8ZtnX.cjs.js.map