@silvery/examples 0.5.6 → 0.17.4

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 (112) hide show
  1. package/dist/UPNG-Cy7ViL8f.mjs +5074 -0
  2. package/dist/__vite-browser-external-2447137e-BML7CYau.mjs +4 -0
  3. package/dist/_banner-DLPxCqVy.mjs +44 -0
  4. package/dist/ansi-CCE2pVS0.mjs +16397 -0
  5. package/dist/apng-HhhBjRGt.mjs +68 -0
  6. package/dist/apng-mwUQbTTF.mjs +3 -0
  7. package/dist/apps/aichat/index.mjs +1299 -0
  8. package/dist/apps/app-todo.mjs +139 -0
  9. package/dist/apps/async-data.mjs +204 -0
  10. package/dist/apps/cli-wizard.mjs +339 -0
  11. package/dist/apps/clipboard.mjs +198 -0
  12. package/dist/apps/components.mjs +864 -0
  13. package/dist/apps/data-explorer.mjs +483 -0
  14. package/dist/apps/dev-tools.mjs +397 -0
  15. package/dist/apps/explorer.mjs +698 -0
  16. package/dist/apps/gallery.mjs +766 -0
  17. package/dist/apps/inline-bench.mjs +115 -0
  18. package/dist/apps/kanban.mjs +280 -0
  19. package/dist/apps/layout-ref.mjs +187 -0
  20. package/dist/apps/outline.mjs +203 -0
  21. package/dist/apps/paste-demo.mjs +189 -0
  22. package/dist/apps/scroll.mjs +86 -0
  23. package/dist/apps/search-filter.mjs +287 -0
  24. package/dist/apps/selection.mjs +355 -0
  25. package/dist/apps/spatial-focus-demo.mjs +388 -0
  26. package/dist/apps/task-list.mjs +258 -0
  27. package/dist/apps/terminal-caps-demo.mjs +315 -0
  28. package/dist/apps/terminal.mjs +872 -0
  29. package/dist/apps/text-selection-demo.mjs +254 -0
  30. package/dist/apps/textarea.mjs +178 -0
  31. package/dist/apps/theme.mjs +661 -0
  32. package/dist/apps/transform.mjs +215 -0
  33. package/dist/apps/virtual-10k.mjs +422 -0
  34. package/dist/assets/resvgjs.darwin-arm64-BtufyGW1.node +0 -0
  35. package/dist/backends-Bahh9mKN.mjs +1179 -0
  36. package/dist/backends-CCtCDQ94.mjs +3 -0
  37. package/dist/{cli.mjs → bin/cli.mjs} +21 -25
  38. package/dist/chunk-BSw8zbkd.mjs +37 -0
  39. package/dist/components/counter.mjs +48 -0
  40. package/dist/components/hello.mjs +31 -0
  41. package/dist/components/progress-bar.mjs +59 -0
  42. package/dist/components/select-list.mjs +85 -0
  43. package/dist/components/spinner.mjs +57 -0
  44. package/dist/components/text-input.mjs +62 -0
  45. package/dist/components/virtual-list.mjs +51 -0
  46. package/dist/flexily-zero-adapter-UB-ra8fR.mjs +3374 -0
  47. package/dist/gif-BZaqPPVX.mjs +3 -0
  48. package/dist/gif-BtnXuxLF.mjs +71 -0
  49. package/dist/gifenc-CLRW41dk.mjs +728 -0
  50. package/dist/jsx-runtime-dMs_8fNu.mjs +241 -0
  51. package/dist/key-mapping-5oYQdAQE.mjs +3 -0
  52. package/dist/key-mapping-D4LR1go6.mjs +130 -0
  53. package/dist/layout/dashboard.mjs +1204 -0
  54. package/dist/layout/live-resize.mjs +303 -0
  55. package/dist/layout/overflow.mjs +70 -0
  56. package/dist/layout/text-layout.mjs +335 -0
  57. package/dist/node-NuJ94BWl.mjs +1083 -0
  58. package/dist/plugins-D1KtkT4a.mjs +3057 -0
  59. package/dist/resvg-js-C_8Wps1F.mjs +201 -0
  60. package/dist/src-BTEVGpd9.mjs +23538 -0
  61. package/dist/src-CUUOuRH6.mjs +5322 -0
  62. package/dist/src-CzfRafCQ.mjs +814 -0
  63. package/dist/usingCtx-CsEf0xO3.mjs +57 -0
  64. package/dist/yoga-adapter-BVtQ5OJR.mjs +237 -0
  65. package/package.json +19 -14
  66. package/_banner.tsx +0 -60
  67. package/apps/aichat/components.tsx +0 -469
  68. package/apps/aichat/index.tsx +0 -220
  69. package/apps/aichat/script.ts +0 -460
  70. package/apps/aichat/state.ts +0 -325
  71. package/apps/aichat/types.ts +0 -19
  72. package/apps/app-todo.tsx +0 -201
  73. package/apps/async-data.tsx +0 -196
  74. package/apps/cli-wizard.tsx +0 -332
  75. package/apps/clipboard.tsx +0 -183
  76. package/apps/components.tsx +0 -658
  77. package/apps/data-explorer.tsx +0 -490
  78. package/apps/dev-tools.tsx +0 -395
  79. package/apps/explorer.tsx +0 -731
  80. package/apps/gallery.tsx +0 -653
  81. package/apps/inline-bench.tsx +0 -138
  82. package/apps/kanban.tsx +0 -265
  83. package/apps/layout-ref.tsx +0 -173
  84. package/apps/outline.tsx +0 -160
  85. package/apps/panes/index.tsx +0 -203
  86. package/apps/paste-demo.tsx +0 -185
  87. package/apps/scroll.tsx +0 -77
  88. package/apps/search-filter.tsx +0 -240
  89. package/apps/selection.tsx +0 -342
  90. package/apps/spatial-focus-demo.tsx +0 -368
  91. package/apps/task-list.tsx +0 -271
  92. package/apps/terminal-caps-demo.tsx +0 -334
  93. package/apps/terminal.tsx +0 -800
  94. package/apps/text-selection-demo.tsx +0 -189
  95. package/apps/textarea.tsx +0 -155
  96. package/apps/theme.tsx +0 -515
  97. package/apps/transform.tsx +0 -229
  98. package/apps/virtual-10k.tsx +0 -405
  99. package/apps/vterm-demo/index.tsx +0 -216
  100. package/components/counter.tsx +0 -45
  101. package/components/hello.tsx +0 -34
  102. package/components/progress-bar.tsx +0 -48
  103. package/components/select-list.tsx +0 -50
  104. package/components/spinner.tsx +0 -40
  105. package/components/text-input.tsx +0 -57
  106. package/components/virtual-list.tsx +0 -52
  107. package/dist/cli.d.mts +0 -1
  108. package/dist/cli.mjs.map +0 -1
  109. package/layout/dashboard.tsx +0 -953
  110. package/layout/live-resize.tsx +0 -282
  111. package/layout/overflow.tsx +0 -51
  112. package/layout/text-layout.tsx +0 -283
@@ -0,0 +1,241 @@
1
+ import { i as __require, t as __commonJSMin } from "./chunk-BSw8zbkd.mjs";
2
+ //#region ../../../node_modules/.bun/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.production.js
6
+ *
7
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
13
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
14
+ function jsxProd(type, config, maybeKey) {
15
+ var key = null;
16
+ void 0 !== maybeKey && (key = "" + maybeKey);
17
+ void 0 !== config.key && (key = "" + config.key);
18
+ if ("key" in config) {
19
+ maybeKey = {};
20
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
21
+ } else maybeKey = config;
22
+ config = maybeKey.ref;
23
+ return {
24
+ $$typeof: REACT_ELEMENT_TYPE,
25
+ type,
26
+ key,
27
+ ref: void 0 !== config ? config : null,
28
+ props: maybeKey
29
+ };
30
+ }
31
+ exports.Fragment = REACT_FRAGMENT_TYPE;
32
+ exports.jsx = jsxProd;
33
+ exports.jsxs = jsxProd;
34
+ }));
35
+ //#endregion
36
+ //#region ../../../node_modules/.bun/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js
37
+ /**
38
+ * @license React
39
+ * react-jsx-runtime.development.js
40
+ *
41
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
42
+ *
43
+ * This source code is licensed under the MIT license found in the
44
+ * LICENSE file in the root directory of this source tree.
45
+ */
46
+ var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
47
+ "production" !== process.env.NODE_ENV && (function() {
48
+ function getComponentNameFromType(type) {
49
+ if (null == type) return null;
50
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
51
+ if ("string" === typeof type) return type;
52
+ switch (type) {
53
+ case REACT_FRAGMENT_TYPE: return "Fragment";
54
+ case REACT_PROFILER_TYPE: return "Profiler";
55
+ case REACT_STRICT_MODE_TYPE: return "StrictMode";
56
+ case REACT_SUSPENSE_TYPE: return "Suspense";
57
+ case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
58
+ case REACT_ACTIVITY_TYPE: return "Activity";
59
+ }
60
+ if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
61
+ case REACT_PORTAL_TYPE: return "Portal";
62
+ case REACT_CONTEXT_TYPE: return type.displayName || "Context";
63
+ case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
64
+ case REACT_FORWARD_REF_TYPE:
65
+ var innerType = type.render;
66
+ type = type.displayName;
67
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
68
+ return type;
69
+ case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
70
+ case REACT_LAZY_TYPE:
71
+ innerType = type._payload;
72
+ type = type._init;
73
+ try {
74
+ return getComponentNameFromType(type(innerType));
75
+ } catch (x) {}
76
+ }
77
+ return null;
78
+ }
79
+ function testStringCoercion(value) {
80
+ return "" + value;
81
+ }
82
+ function checkKeyStringCoercion(value) {
83
+ try {
84
+ testStringCoercion(value);
85
+ var JSCompiler_inline_result = !1;
86
+ } catch (e) {
87
+ JSCompiler_inline_result = !0;
88
+ }
89
+ if (JSCompiler_inline_result) {
90
+ JSCompiler_inline_result = console;
91
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
92
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
93
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
94
+ return testStringCoercion(value);
95
+ }
96
+ }
97
+ function getTaskName(type) {
98
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
99
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
100
+ try {
101
+ var name = getComponentNameFromType(type);
102
+ return name ? "<" + name + ">" : "<...>";
103
+ } catch (x) {
104
+ return "<...>";
105
+ }
106
+ }
107
+ function getOwner() {
108
+ var dispatcher = ReactSharedInternals.A;
109
+ return null === dispatcher ? null : dispatcher.getOwner();
110
+ }
111
+ function UnknownOwner() {
112
+ return Error("react-stack-top-frame");
113
+ }
114
+ function hasValidKey(config) {
115
+ if (hasOwnProperty.call(config, "key")) {
116
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
117
+ if (getter && getter.isReactWarning) return !1;
118
+ }
119
+ return void 0 !== config.key;
120
+ }
121
+ function defineKeyPropWarningGetter(props, displayName) {
122
+ function warnAboutAccessingKey() {
123
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
124
+ }
125
+ warnAboutAccessingKey.isReactWarning = !0;
126
+ Object.defineProperty(props, "key", {
127
+ get: warnAboutAccessingKey,
128
+ configurable: !0
129
+ });
130
+ }
131
+ function elementRefGetterWithDeprecationWarning() {
132
+ var componentName = getComponentNameFromType(this.type);
133
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
134
+ componentName = this.props.ref;
135
+ return void 0 !== componentName ? componentName : null;
136
+ }
137
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
138
+ var refProp = props.ref;
139
+ type = {
140
+ $$typeof: REACT_ELEMENT_TYPE,
141
+ type,
142
+ key,
143
+ props,
144
+ _owner: owner
145
+ };
146
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
147
+ enumerable: !1,
148
+ get: elementRefGetterWithDeprecationWarning
149
+ }) : Object.defineProperty(type, "ref", {
150
+ enumerable: !1,
151
+ value: null
152
+ });
153
+ type._store = {};
154
+ Object.defineProperty(type._store, "validated", {
155
+ configurable: !1,
156
+ enumerable: !1,
157
+ writable: !0,
158
+ value: 0
159
+ });
160
+ Object.defineProperty(type, "_debugInfo", {
161
+ configurable: !1,
162
+ enumerable: !1,
163
+ writable: !0,
164
+ value: null
165
+ });
166
+ Object.defineProperty(type, "_debugStack", {
167
+ configurable: !1,
168
+ enumerable: !1,
169
+ writable: !0,
170
+ value: debugStack
171
+ });
172
+ Object.defineProperty(type, "_debugTask", {
173
+ configurable: !1,
174
+ enumerable: !1,
175
+ writable: !0,
176
+ value: debugTask
177
+ });
178
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
179
+ return type;
180
+ }
181
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
182
+ var children = config.children;
183
+ if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
184
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
185
+ Object.freeze && Object.freeze(children);
186
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
187
+ else validateChildKeys(children);
188
+ if (hasOwnProperty.call(config, "key")) {
189
+ children = getComponentNameFromType(type);
190
+ var keys = Object.keys(config).filter(function(k) {
191
+ return "key" !== k;
192
+ });
193
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
194
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
195
+ }
196
+ children = null;
197
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
198
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
199
+ if ("key" in config) {
200
+ maybeKey = {};
201
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
202
+ } else maybeKey = config;
203
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
204
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
205
+ }
206
+ function validateChildKeys(node) {
207
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
208
+ }
209
+ function isValidElement(object) {
210
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
211
+ }
212
+ var React = __require("react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
213
+ return null;
214
+ };
215
+ React = { react_stack_bottom_frame: function(callStackForError) {
216
+ return callStackForError();
217
+ } };
218
+ var specialPropKeyWarningShown;
219
+ var didWarnAboutElementRef = {};
220
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
221
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
222
+ var didWarnAboutKeySpread = {};
223
+ exports.Fragment = REACT_FRAGMENT_TYPE;
224
+ exports.jsx = function(type, config, maybeKey) {
225
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
226
+ return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
227
+ };
228
+ exports.jsxs = function(type, config, maybeKey) {
229
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
230
+ return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
231
+ };
232
+ })();
233
+ }));
234
+ //#endregion
235
+ //#region ../../../node_modules/.bun/react@19.2.4/node_modules/react/jsx-runtime.js
236
+ var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
237
+ if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_runtime_production();
238
+ else module.exports = require_react_jsx_runtime_development();
239
+ }));
240
+ //#endregion
241
+ export { require_jsx_runtime as t };
@@ -0,0 +1,3 @@
1
+ import { n as keyToAnsi, r as parseKey, t as init_key_mapping } from "./key-mapping-D4LR1go6.mjs";
2
+ init_key_mapping();
3
+ export { keyToAnsi, parseKey };
@@ -0,0 +1,130 @@
1
+ import { n as __esmMin } from "./chunk-BSw8zbkd.mjs";
2
+ //#region ../../termless/src/key-mapping.ts
3
+ function normalizeModifier(mod) {
4
+ return MODIFIER_ALIASES[mod.toLowerCase()] ?? mod.toLowerCase();
5
+ }
6
+ /**
7
+ * Parse a key string like "Ctrl+a", "ArrowUp", "Shift+Tab" into a KeyDescriptor.
8
+ *
9
+ * Supports modifier prefixes: Ctrl, Control, Alt, Shift, Meta, Cmd, Option, Super.
10
+ * Modifiers are case-insensitive and separated by "+".
11
+ */
12
+ function parseKey(key) {
13
+ const parts = key.split("+");
14
+ const result = { key: parts.pop() };
15
+ for (const part of parts) switch (normalizeModifier(part)) {
16
+ case "ctrl":
17
+ result.ctrl = true;
18
+ break;
19
+ case "shift":
20
+ result.shift = true;
21
+ break;
22
+ case "alt":
23
+ result.alt = true;
24
+ break;
25
+ case "super":
26
+ result.super = true;
27
+ break;
28
+ }
29
+ return result;
30
+ }
31
+ /**
32
+ * Convert a key descriptor or key string to its ANSI escape sequence.
33
+ *
34
+ * Handles:
35
+ * - Single characters: returned as-is
36
+ * - Named keys (ArrowUp, Enter, Tab, etc.): mapped to standard ANSI sequences
37
+ * - Function keys (F1-F12): mapped to VT220/xterm sequences
38
+ * - Ctrl+letter: ASCII control codes 1-26
39
+ * - Ctrl+Enter: newline (\n)
40
+ * - Alt+key: ESC prefix + key
41
+ */
42
+ function keyToAnsi(key) {
43
+ const desc = typeof key === "string" ? parseKey(key) : key;
44
+ const { key: mainKey, ctrl, alt, shift } = desc;
45
+ const hasSuperOrMeta = desc.super;
46
+ if (ctrl && mainKey.length === 1) {
47
+ const code = mainKey.toLowerCase().charCodeAt(0) - 96;
48
+ if (code >= 1 && code <= 26) return String.fromCharCode(code);
49
+ }
50
+ if (ctrl && mainKey === "Enter") return "\n";
51
+ if ((alt || hasSuperOrMeta) && mainKey.length === 1) return `\x1b${mainKey}`;
52
+ const fkey = FKEY_MAP[mainKey];
53
+ if (fkey !== void 0) {
54
+ if (ctrl || alt || shift || hasSuperOrMeta) {
55
+ const mod = 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0) + (hasSuperOrMeta ? 8 : 0);
56
+ const fkeyNum = parseInt(mainKey.slice(1));
57
+ if (fkeyNum <= 4) return `\x1b[${fkeyNum + 10};${mod}~`;
58
+ const match = fkey.match(/\x1b\[(\d+)~/);
59
+ if (match) return `\x1b[${match[1]};${mod}~`;
60
+ }
61
+ return fkey;
62
+ }
63
+ const mapped = KEY_MAP[mainKey];
64
+ if (mapped !== void 0) {
65
+ if (mapped === null) return "";
66
+ if ((ctrl || alt || shift || hasSuperOrMeta) && mapped.startsWith("\x1B[")) {
67
+ const mod = 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0) + (hasSuperOrMeta ? 8 : 0);
68
+ const letterMatch = mapped.match(/\x1b\[([A-H])$/);
69
+ if (letterMatch) return `\x1b[1;${mod}${letterMatch[1]}`;
70
+ const tildeMatch = mapped.match(/\x1b\[(\d+)~$/);
71
+ if (tildeMatch) return `\x1b[${tildeMatch[1]};${mod}~`;
72
+ }
73
+ if (shift && mainKey === "Tab") return "\x1B[Z";
74
+ return mapped;
75
+ }
76
+ if (mainKey.length === 1) {
77
+ if (shift && mainKey.match(/[a-z]/)) return mainKey.toUpperCase();
78
+ return mainKey;
79
+ }
80
+ return mainKey;
81
+ }
82
+ var KEY_MAP, FKEY_MAP, MODIFIER_ALIASES;
83
+ var init_key_mapping = __esmMin((() => {
84
+ KEY_MAP = {
85
+ ArrowUp: "\x1B[A",
86
+ ArrowDown: "\x1B[B",
87
+ ArrowLeft: "\x1B[D",
88
+ ArrowRight: "\x1B[C",
89
+ Home: "\x1B[H",
90
+ End: "\x1B[F",
91
+ PageUp: "\x1B[5~",
92
+ PageDown: "\x1B[6~",
93
+ Enter: "\r",
94
+ Tab: " ",
95
+ Backspace: "",
96
+ Delete: "\x1B[3~",
97
+ Escape: "\x1B",
98
+ Space: " ",
99
+ Control: null,
100
+ Shift: null,
101
+ Alt: null,
102
+ Meta: null
103
+ };
104
+ FKEY_MAP = {
105
+ F1: "\x1BOP",
106
+ F2: "\x1BOQ",
107
+ F3: "\x1BOR",
108
+ F4: "\x1BOS",
109
+ F5: "\x1B[15~",
110
+ F6: "\x1B[17~",
111
+ F7: "\x1B[18~",
112
+ F8: "\x1B[19~",
113
+ F9: "\x1B[20~",
114
+ F10: "\x1B[21~",
115
+ F11: "\x1B[23~",
116
+ F12: "\x1B[24~"
117
+ };
118
+ MODIFIER_ALIASES = {
119
+ ctrl: "ctrl",
120
+ control: "ctrl",
121
+ shift: "shift",
122
+ alt: "alt",
123
+ meta: "super",
124
+ cmd: "super",
125
+ option: "alt",
126
+ super: "super"
127
+ };
128
+ }));
129
+ //#endregion
130
+ export { keyToAnsi as n, parseKey as r, init_key_mapping as t };