@learnosity/lib-qti-converter 0.16.0 → 0.16.2
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.
- package/package.json +10 -10
- package/packages/cli/dist/{batchProcessors-C7czhqX0.js → batchProcessors-BGdELwug.js} +75 -102
- package/packages/cli/dist/batchProcessors-BGdELwug.js.map +1 -0
- package/packages/cli/dist/batchWorker.js +2 -3
- package/packages/cli/dist/{configOutput-FwkFyQmk.js → configOutput-DYPwNQf7.js} +5 -9
- package/packages/cli/dist/{configOutput-FwkFyQmk.js.map → configOutput-DYPwNQf7.js.map} +1 -1
- package/packages/cli/dist/{create-prompt-dWckcotJ.js → create-prompt-C3XKo-s3.js} +95 -71
- package/packages/cli/dist/create-prompt-C3XKo-s3.js.map +1 -0
- package/packages/cli/dist/{dist-DXDR2peT.js → dist-D7b9-VIt.js} +8 -11
- package/packages/cli/dist/dist-D7b9-VIt.js.map +1 -0
- package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js → learnosityToQti-CN6KKSmF.js} +5 -6
- package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js.map → learnosityToQti-CN6KKSmF.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQtiPackage-Bwzm-uLX.js → learnosityToQtiPackage-CMOQRiCV.js} +29 -21
- package/packages/cli/dist/learnosityToQtiPackage-CMOQRiCV.js.map +1 -0
- package/packages/cli/dist/main.js +22 -29
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/{nodeFileAccess-BhCoGDOi.js → nodeFileAccess-_jRCd340.js} +6 -10
- package/packages/cli/dist/{nodeFileAccess-BhCoGDOi.js.map → nodeFileAccess-_jRCd340.js.map} +1 -1
- package/packages/cli/dist/pathUtils-I2bRHUwu.js +2922 -0
- package/packages/cli/dist/pathUtils-I2bRHUwu.js.map +1 -0
- package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js → qtiPackageToLearnosity-JRb3TTyC.js} +7 -8
- package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js.map → qtiPackageToLearnosity-JRb3TTyC.js.map} +1 -1
- package/packages/cli/dist/{qtiToLearnosity-JQYOkNbM.js → qtiToLearnosity-C-jQYKqR.js} +6 -7
- package/packages/cli/dist/{qtiToLearnosity-JQYOkNbM.js.map → qtiToLearnosity-C-jQYKqR.js.map} +1 -1
- package/packages/cli/dist/{resolveOptions-BuNN2KMA.js → resolveOptions-ikupjaRQ.js} +322 -359
- package/packages/cli/dist/resolveOptions-ikupjaRQ.js.map +1 -0
- package/packages/cli/dist/{rolldown-runtime-DktXgydw.js → rolldown-runtime-BuRBZLzk.js} +13 -12
- package/packages/cli/dist/{table-DsKq-B4-.js → table-6SiZD7aK.js} +9944 -2294
- package/packages/cli/dist/table-6SiZD7aK.js.map +1 -0
- package/packages/core/dist/index.d.ts +8 -58
- package/packages/core/dist/index.js +9923 -2267
- package/packages/core/dist/node.d.ts +10 -80
- package/packages/core/dist/node.js +9951 -2311
- package/packages/cli/dist/batchProcessors-C7czhqX0.js.map +0 -1
- package/packages/cli/dist/create-prompt-dWckcotJ.js.map +0 -1
- package/packages/cli/dist/dist-DXDR2peT.js.map +0 -1
- package/packages/cli/dist/learnosityToQtiPackage-Bwzm-uLX.js.map +0 -1
- package/packages/cli/dist/pathUtils-D_VsVde8.js +0 -2272
- package/packages/cli/dist/pathUtils-D_VsVde8.js.map +0 -1
- package/packages/cli/dist/resolveOptions-BuNN2KMA.js.map +0 -1
- package/packages/cli/dist/table-DsKq-B4-.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-prompt-C3XKo-s3.js","names":["readline","process","NO_TRUNCATION","fastStringTruncatedWidth","ESC","stringWidth","cliWidth","readline","process","stringWidth","MuteStream","onSignalExit"],"sources":["../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/key.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/errors.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/hook-engine.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-state.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-effect.js","../../../node_modules/.pnpm/@inquirer+figures@2.1.1/node_modules/@inquirer/figures/dist/index.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/theme.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/make-theme.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-prefix.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-ref.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-keypress.js","../../../node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js","../../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js","../../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js","../../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js","../../../node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/utils.js","../../../node_modules/.pnpm/@inquirer+type@4.3.1_@types+node@26.6.10/node_modules/@inquirer/type/dist/utils.js","../../../node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js","../../../node_modules/.pnpm/@inquirer+ansi@2.1.1/node_modules/@inquirer/ansi/dist/index.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/screen-manager.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/create-prompt.js"],"sourcesContent":["const keybindings = ['emacs', 'vim'];\nconst keybindingLookup = new Set(keybindings);\nfunction isKeybinding(value) {\n return keybindingLookup.has(value);\n}\nexport function getDefaultKeybindings() {\n const env = process.env['INQUIRER_KEYBINDINGS'];\n if (!env)\n return [];\n return Array.from(new Set(env\n .toLowerCase()\n .split(/[\\s,]+/)\n .filter(isKeybinding)));\n}\nexport const isUpKey = (key, keybindings = []) => \n// The up key\nkey.name === 'up' ||\n // Vim keybinding: hjkl keys map to left/down/up/right\n (keybindings.includes('vim') && key.name === 'k') ||\n // Emacs keybinding: Ctrl+P means \"previous\" in Emacs navigation conventions\n (keybindings.includes('emacs') && key.ctrl && key.name === 'p');\nexport const isDownKey = (key, keybindings = []) => \n// The down key\nkey.name === 'down' ||\n // Vim keybinding: hjkl keys map to left/down/up/right\n (keybindings.includes('vim') && key.name === 'j') ||\n // Emacs keybinding: Ctrl+N means \"next\" in Emacs navigation conventions\n (keybindings.includes('emacs') && key.ctrl && key.name === 'n');\nexport const isSpaceKey = (key) => key.name === 'space';\nexport const isBackspaceKey = (key) => key.name === 'backspace';\nexport const isTabKey = (key) => key.name === 'tab';\nexport const isNumberKey = (key) => '1234567890'.includes(key.name);\nexport const isEnterKey = (key) => key.name === 'enter' || key.name === 'return';\nexport const isShiftKey = (key) => key.shift;\n","export class AbortPromptError extends Error {\n name = 'AbortPromptError';\n message = 'Prompt was aborted';\n constructor(options) {\n super();\n this.cause = options?.cause;\n }\n}\nexport class CancelPromptError extends Error {\n name = 'CancelPromptError';\n message = 'Prompt was canceled';\n}\nexport class ExitPromptError extends Error {\n name = 'ExitPromptError';\n}\nexport class HookError extends Error {\n name = 'HookError';\n}\nexport class ValidationError extends Error {\n name = 'ValidationError';\n}\n","/* eslint @typescript-eslint/no-explicit-any: [\"off\"] */\nimport { AsyncLocalStorage, AsyncResource } from 'node:async_hooks';\nimport { HookError, ValidationError } from './errors.js';\n// Capture the real queueMicrotask at module load time so it keeps working\n// when test frameworks mock timers (vi.useFakeTimers()) — a deferred paint\n// must never be held hostage by a mocked clock.\nconst nativeQueueMicrotask = globalThis.queueMicrotask;\nconst hookStorage = new AsyncLocalStorage();\nfunction createStore(rl) {\n const store = {\n rl,\n hooks: [],\n hooksCleanup: [],\n hooksEffect: [],\n index: 0,\n handleChange() { },\n deferredPaint: null,\n };\n return store;\n}\n// Run callback in with the hook engine setup.\nexport function withHooks(rl, cb) {\n const store = createStore(rl);\n function cycle(render) {\n store.handleChange = () => {\n store.index = 0;\n render();\n };\n store.handleChange();\n }\n return hookStorage.run(store, () => cb(cycle));\n}\n// Safe getStore utility that'll return the store or throw if undefined.\nfunction getStore() {\n const store = hookStorage.getStore();\n if (!store) {\n throw new HookError('[Inquirer] Hook functions can only be called from within a prompt');\n }\n return store;\n}\nexport function readline() {\n return getStore().rl;\n}\n// Merge state updates happening within the callback function to avoid multiple renders.\nexport function withUpdates(fn) {\n const wrapped = (...args) => {\n const store = getStore();\n let shouldUpdate = false;\n const oldHandleChange = store.handleChange;\n const recordChange = () => {\n shouldUpdate = true;\n };\n store.handleChange = recordChange;\n const returnValue = fn(...args);\n if (shouldUpdate) {\n // Flush the merged render, recording any change made while it flushes\n // into a fresh flag. A `withUpdates` wrapper started by the render\n // itself (the effect runner a re-render triggers) captures the current\n // recorder as its own `oldHandleChange`, so its flush records into\n // `flushedUpdate` instead of rendering inside ours — nested renders\n // never re-enter this flush.\n let flushedUpdate = false;\n store.handleChange = () => {\n flushedUpdate = true;\n };\n oldHandleChange();\n store.handleChange = oldHandleChange;\n if (flushedUpdate) {\n // State changed while the render was flushing: effects triggered by\n // the render set state (e.g. a search prompt flipping to `loading`\n // when its term changes), and those updates were recorded after the\n // single flush above already ran — nothing painted them. The\n // canonical symptom is a spinner-less \"idle\" screen while an async\n // fetch started by the last keystroke is still pending.\n //\n // The paint cannot run here either. Restoring `handleChange` early\n // and letting the nested flush render synchronously paints\n // effect-set state before the current synchronous batch of input\n // events is done: a same-tick keypress then reads it (e.g. the\n // `loading` status right after Tab autocompletes) and behaves as if\n // the batch had been interleaved — search's tab autocomplete stops\n // submitting. Defer one paint to a microtask instead: it runs after\n // the current synchronous batch of updates (same-tick keypresses\n // keep reading their pre-paint state) but before any next input\n // event, timer or I/O. A newer render supersedes the pending paint,\n // and settlement cancels it (see `effectScheduler.clearAll`).\n scheduleDeferredPaint(store, oldHandleChange);\n }\n }\n else {\n store.handleChange = oldHandleChange;\n }\n return returnValue;\n };\n return AsyncResource.bind(wrapped);\n}\n// Schedule the single pending deferred paint of a store. Only one is ever\n// needed: the paint renders the current state, so a newer request never has\n// to queue a second one — keeping the slot filled is enough.\nfunction scheduleDeferredPaint(store, paint) {\n if (store.deferredPaint !== null)\n return;\n store.deferredPaint = AsyncResource.bind(paint);\n nativeQueueMicrotask(() => {\n const pending = store.deferredPaint;\n if (pending === null)\n return;\n store.deferredPaint = null;\n pending();\n });\n}\nexport function withPointer(cb) {\n const store = getStore();\n const { index } = store;\n const pointer = {\n get() {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return store.hooks[index];\n },\n set(value) {\n store.hooks[index] = value;\n },\n initialized: index in store.hooks,\n };\n const returnValue = cb(pointer);\n store.index++;\n return returnValue;\n}\nexport function handleChange() {\n getStore().handleChange();\n}\nexport const effectScheduler = {\n queue(cb) {\n const store = getStore();\n const { index } = store;\n store.hooksEffect.push(() => {\n store.hooksCleanup[index]?.();\n const cleanFn = cb(readline());\n if (cleanFn != null && typeof cleanFn !== 'function') {\n throw new ValidationError('useEffect return value must be a cleanup function or nothing.');\n }\n store.hooksCleanup[index] = cleanFn;\n });\n },\n run() {\n const store = getStore();\n withUpdates(() => {\n store.hooksEffect.forEach((effect) => {\n effect();\n });\n // Warning: Clean the hooks before exiting the `withUpdates` block.\n // Failure to do so means an updates would hit the same effects again.\n store.hooksEffect.length = 0;\n })();\n },\n clearAll() {\n const store = getStore();\n store.hooksCleanup.forEach((cleanFn) => {\n cleanFn?.();\n });\n store.hooksEffect.length = 0;\n store.hooksCleanup.length = 0;\n // The prompt is settling: any deferred paint scheduled by `withUpdates`\n // must not run anymore, or the settled prompt would render once more\n // after its screen was torn down.\n store.deferredPaint = null;\n },\n};\n","import { AsyncResource } from 'node:async_hooks';\nimport { withPointer, handleChange } from './hook-engine.js';\nfunction isFactory(value) {\n return typeof value === 'function';\n}\nfunction isReducer(value) {\n return typeof value === 'function';\n}\nexport function useState(defaultValue) {\n return withPointer((pointer) => {\n const setState = AsyncResource.bind(function setState(newValue) {\n const currentValue = pointer.get();\n const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;\n // Noop if the value is still the same.\n if (!Object.is(currentValue, nextValue)) {\n pointer.set(nextValue);\n // Trigger re-render\n handleChange();\n }\n });\n if (pointer.initialized) {\n return [pointer.get(), setState];\n }\n const value = isFactory(defaultValue) ? defaultValue() : defaultValue;\n pointer.set(value);\n return [value, setState];\n });\n}\n","import { withPointer, effectScheduler } from './hook-engine.js';\nexport function useEffect(cb, depArray) {\n withPointer((pointer) => {\n const oldDeps = pointer.get();\n const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));\n if (hasChanged) {\n effectScheduler.queue(cb);\n }\n pointer.set(depArray);\n });\n}\n","// process.env dot-notation access prints:\n// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111)\n/* eslint dot-notation: [\"off\"] */\nimport process from 'node:process';\n// Ported from is-unicode-supported\nfunction isUnicodeSupported() {\n if (!process.platform.startsWith('win')) {\n return process.env['TERM'] !== 'linux'; // Linux console (kernel)\n }\n return (Boolean(process.env['CI']) || // CI environments generally support unicode\n Boolean(process.env['WT_SESSION']) || // Windows Terminal\n Boolean(process.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27)\n process.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder\n process.env['TERM_PROGRAM'] === 'Terminus-Sublime' ||\n process.env['TERM_PROGRAM'] === 'vscode' ||\n process.env['TERM'] === 'xterm-256color' ||\n process.env['TERM'] === 'alacritty' ||\n process.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm');\n}\n// Ported from figures\nconst common = {\n circleQuestionMark: '(?)',\n questionMarkPrefix: '(?)',\n square: '█',\n squareDarkShade: '▓',\n squareMediumShade: '▒',\n squareLightShade: '░',\n squareTop: '▀',\n squareBottom: '▄',\n squareLeft: '▌',\n squareRight: '▐',\n squareCenter: '■',\n bullet: '●',\n dot: '․',\n ellipsis: '…',\n pointerSmall: '›',\n triangleUp: '▲',\n triangleUpSmall: '▴',\n triangleDown: '▼',\n triangleDownSmall: '▾',\n triangleLeftSmall: '◂',\n triangleRightSmall: '▸',\n home: '⌂',\n heart: '♥',\n musicNote: '♪',\n musicNoteBeamed: '♫',\n arrowUp: '↑',\n arrowDown: '↓',\n arrowLeft: '←',\n arrowRight: '→',\n arrowLeftRight: '↔',\n arrowUpDown: '↕',\n almostEqual: '≈',\n notEqual: '≠',\n lessOrEqual: '≤',\n greaterOrEqual: '≥',\n identical: '≡',\n infinity: '∞',\n subscriptZero: '₀',\n subscriptOne: '₁',\n subscriptTwo: '₂',\n subscriptThree: '₃',\n subscriptFour: '₄',\n subscriptFive: '₅',\n subscriptSix: '₆',\n subscriptSeven: '₇',\n subscriptEight: '₈',\n subscriptNine: '₉',\n oneHalf: '½',\n oneThird: '⅓',\n oneQuarter: '¼',\n oneFifth: '⅕',\n oneSixth: '⅙',\n oneEighth: '⅛',\n twoThirds: '⅔',\n twoFifths: '⅖',\n threeQuarters: '¾',\n threeFifths: '⅗',\n threeEighths: '⅜',\n fourFifths: '⅘',\n fiveSixths: '⅚',\n fiveEighths: '⅝',\n sevenEighths: '⅞',\n line: '─',\n lineBold: '━',\n lineDouble: '═',\n lineDashed0: '┄',\n lineDashed1: '┅',\n lineDashed2: '┈',\n lineDashed3: '┉',\n lineDashed4: '╌',\n lineDashed5: '╍',\n lineDashed6: '╴',\n lineDashed7: '╶',\n lineDashed8: '╸',\n lineDashed9: '╺',\n lineDashed10: '╼',\n lineDashed11: '╾',\n lineDashed12: '−',\n lineDashed13: '–',\n lineDashed14: '‐',\n lineDashed15: '⁃',\n lineVertical: '│',\n lineVerticalBold: '┃',\n lineVerticalDouble: '║',\n lineVerticalDashed0: '┆',\n lineVerticalDashed1: '┇',\n lineVerticalDashed2: '┊',\n lineVerticalDashed3: '┋',\n lineVerticalDashed4: '╎',\n lineVerticalDashed5: '╏',\n lineVerticalDashed6: '╵',\n lineVerticalDashed7: '╷',\n lineVerticalDashed8: '╹',\n lineVerticalDashed9: '╻',\n lineVerticalDashed10: '╽',\n lineVerticalDashed11: '╿',\n lineDownLeft: '┐',\n lineDownLeftArc: '╮',\n lineDownBoldLeftBold: '┓',\n lineDownBoldLeft: '┒',\n lineDownLeftBold: '┑',\n lineDownDoubleLeftDouble: '╗',\n lineDownDoubleLeft: '╖',\n lineDownLeftDouble: '╕',\n lineDownRight: '┌',\n lineDownRightArc: '╭',\n lineDownBoldRightBold: '┏',\n lineDownBoldRight: '┎',\n lineDownRightBold: '┍',\n lineDownDoubleRightDouble: '╔',\n lineDownDoubleRight: '╓',\n lineDownRightDouble: '╒',\n lineUpLeft: '┘',\n lineUpLeftArc: '╯',\n lineUpBoldLeftBold: '┛',\n lineUpBoldLeft: '┚',\n lineUpLeftBold: '┙',\n lineUpDoubleLeftDouble: '╝',\n lineUpDoubleLeft: '╜',\n lineUpLeftDouble: '╛',\n lineUpRight: '└',\n lineUpRightArc: '╰',\n lineUpBoldRightBold: '┗',\n lineUpBoldRight: '┖',\n lineUpRightBold: '┕',\n lineUpDoubleRightDouble: '╚',\n lineUpDoubleRight: '╙',\n lineUpRightDouble: '╘',\n lineUpDownLeft: '┤',\n lineUpBoldDownBoldLeftBold: '┫',\n lineUpBoldDownBoldLeft: '┨',\n lineUpDownLeftBold: '┥',\n lineUpBoldDownLeftBold: '┩',\n lineUpDownBoldLeftBold: '┪',\n lineUpDownBoldLeft: '┧',\n lineUpBoldDownLeft: '┦',\n lineUpDoubleDownDoubleLeftDouble: '╣',\n lineUpDoubleDownDoubleLeft: '╢',\n lineUpDownLeftDouble: '╡',\n lineUpDownRight: '├',\n lineUpBoldDownBoldRightBold: '┣',\n lineUpBoldDownBoldRight: '┠',\n lineUpDownRightBold: '┝',\n lineUpBoldDownRightBold: '┡',\n lineUpDownBoldRightBold: '┢',\n lineUpDownBoldRight: '┟',\n lineUpBoldDownRight: '┞',\n lineUpDoubleDownDoubleRightDouble: '╠',\n lineUpDoubleDownDoubleRight: '╟',\n lineUpDownRightDouble: '╞',\n lineDownLeftRight: '┬',\n lineDownBoldLeftBoldRightBold: '┳',\n lineDownLeftBoldRightBold: '┯',\n lineDownBoldLeftRight: '┰',\n lineDownBoldLeftBoldRight: '┱',\n lineDownBoldLeftRightBold: '┲',\n lineDownLeftRightBold: '┮',\n lineDownLeftBoldRight: '┭',\n lineDownDoubleLeftDoubleRightDouble: '╦',\n lineDownDoubleLeftRight: '╥',\n lineDownLeftDoubleRightDouble: '╤',\n lineUpLeftRight: '┴',\n lineUpBoldLeftBoldRightBold: '┻',\n lineUpLeftBoldRightBold: '┷',\n lineUpBoldLeftRight: '┸',\n lineUpBoldLeftBoldRight: '┹',\n lineUpBoldLeftRightBold: '┺',\n lineUpLeftRightBold: '┶',\n lineUpLeftBoldRight: '┵',\n lineUpDoubleLeftDoubleRightDouble: '╩',\n lineUpDoubleLeftRight: '╨',\n lineUpLeftDoubleRightDouble: '╧',\n lineUpDownLeftRight: '┼',\n lineUpBoldDownBoldLeftBoldRightBold: '╋',\n lineUpDownBoldLeftBoldRightBold: '╈',\n lineUpBoldDownLeftBoldRightBold: '╇',\n lineUpBoldDownBoldLeftRightBold: '╊',\n lineUpBoldDownBoldLeftBoldRight: '╉',\n lineUpBoldDownLeftRight: '╀',\n lineUpDownBoldLeftRight: '╁',\n lineUpDownLeftBoldRight: '┽',\n lineUpDownLeftRightBold: '┾',\n lineUpBoldDownBoldLeftRight: '╂',\n lineUpDownLeftBoldRightBold: '┿',\n lineUpBoldDownLeftBoldRight: '╃',\n lineUpBoldDownLeftRightBold: '╄',\n lineUpDownBoldLeftBoldRight: '╅',\n lineUpDownBoldLeftRightBold: '╆',\n lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',\n lineUpDoubleDownDoubleLeftRight: '╫',\n lineUpDownLeftDoubleRightDouble: '╪',\n lineCross: '╳',\n lineBackslash: '╲',\n lineSlash: '╱',\n};\nconst specialMainSymbols = {\n tick: '✔',\n info: 'ℹ',\n warning: '⚠',\n cross: '✘',\n squareSmall: '◻',\n squareSmallFilled: '◼',\n circle: '◯',\n circleFilled: '◉',\n circleDotted: '◌',\n circleDouble: '◎',\n circleCircle: 'ⓞ',\n circleCross: 'ⓧ',\n circlePipe: 'Ⓘ',\n radioOn: '◉',\n radioOff: '◯',\n checkboxOn: '☒',\n checkboxOff: '☐',\n checkboxCircleOn: 'ⓧ',\n checkboxCircleOff: 'Ⓘ',\n pointer: '❯',\n triangleUpOutline: '△',\n triangleLeft: '◀',\n triangleRight: '▶',\n lozenge: '◆',\n lozengeOutline: '◇',\n hamburger: '☰',\n smiley: '㋡',\n mustache: '෴',\n star: '★',\n play: '▶',\n nodejs: '⬢',\n oneSeventh: '⅐',\n oneNinth: '⅑',\n oneTenth: '⅒',\n};\nconst specialFallbackSymbols = {\n tick: '√',\n info: 'i',\n warning: '‼',\n cross: '×',\n squareSmall: '□',\n squareSmallFilled: '■',\n circle: '( )',\n circleFilled: '(*)',\n circleDotted: '( )',\n circleDouble: '( )',\n circleCircle: '(○)',\n circleCross: '(×)',\n circlePipe: '(│)',\n radioOn: '(*)',\n radioOff: '( )',\n checkboxOn: '[×]',\n checkboxOff: '[ ]',\n checkboxCircleOn: '(×)',\n checkboxCircleOff: '( )',\n pointer: '>',\n triangleUpOutline: '∆',\n triangleLeft: '◄',\n triangleRight: '►',\n lozenge: '♦',\n lozengeOutline: '◊',\n hamburger: '≡',\n smiley: '☺',\n mustache: '┌─┐',\n star: '✶',\n play: '►',\n nodejs: '♦',\n oneSeventh: '1/7',\n oneNinth: '1/9',\n oneTenth: '1/10',\n};\nexport const mainSymbols = {\n ...common,\n ...specialMainSymbols,\n};\nexport const fallbackSymbols = {\n ...common,\n ...specialFallbackSymbols,\n};\nconst shouldUseMain = isUnicodeSupported();\nconst figures = shouldUseMain\n ? mainSymbols\n : fallbackSymbols;\nexport default figures;\nconst replacements = Object.entries(specialMainSymbols);\n// On terminals which do not support Unicode symbols, substitute them to other symbols\nexport const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => {\n if (useFallback) {\n for (const [key, mainSymbol] of replacements) {\n const fallbackSymbol = fallbackSymbols[key];\n if (!fallbackSymbol) {\n throw new Error(`Unable to find fallback for ${key}`);\n }\n string = string.replaceAll(mainSymbol, fallbackSymbol);\n }\n }\n return string;\n};\n","import { styleText } from 'node:util';\nimport figures from '@inquirer/figures';\nimport { getDefaultKeybindings } from './key.js';\nexport const defaultTheme = {\n prefix: {\n idle: styleText('blue', '?'),\n done: styleText('green', figures.tick),\n },\n spinner: {\n interval: 80,\n frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'].map((frame) => styleText('yellow', frame)),\n },\n keybindings: [],\n style: {\n answer: (text) => styleText('cyan', text),\n message: (text) => styleText('bold', text),\n error: (text) => styleText('red', `> ${text}`),\n defaultAnswer: (text) => styleText('dim', `(${text})`),\n help: (text) => styleText('dim', text),\n highlight: (text) => styleText('cyan', text),\n key: (text) => styleText('cyan', styleText('bold', `<${text}>`)),\n },\n};\nexport function getDefaultTheme() {\n return {\n ...defaultTheme,\n keybindings: getDefaultKeybindings(),\n };\n}\n","import { getDefaultTheme } from './theme.js';\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null)\n return false;\n let proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n}\nfunction deepMerge(...objects) {\n const output = {};\n for (const obj of objects) {\n for (const [key, value] of Object.entries(obj)) {\n // A key explicitly set to `undefined` keeps the value from the previous theme.\n if (value === undefined)\n continue;\n const prevValue = output[key];\n output[key] =\n isPlainObject(prevValue) && isPlainObject(value)\n ? deepMerge(prevValue, value)\n : value;\n }\n }\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return output;\n}\nexport function makeTheme(...themes) {\n /* oxlint-disable typescript/no-unsafe-type-assertion */\n const themesToMerge = [\n getDefaultTheme(),\n ...themes.filter((theme) => theme != null),\n ];\n return deepMerge(...themesToMerge);\n /* oxlint-enable typescript/no-unsafe-type-assertion */\n}\n","import { useState } from './use-state.js';\nimport { useEffect } from './use-effect.js';\nimport { makeTheme } from './make-theme.js';\nexport function usePrefix({ status = 'idle', theme, }) {\n const [showLoader, setShowLoader] = useState(false);\n const [tick, setTick] = useState(0);\n const { prefix, spinner } = makeTheme(theme);\n useEffect(() => {\n if (status === 'loading') {\n let tickInterval;\n let inc = -1;\n // Delay displaying spinner by 300ms, to avoid flickering\n const delayTimeout = setTimeout(() => {\n setShowLoader(true);\n tickInterval = setInterval(() => {\n inc = inc + 1;\n setTick(inc % spinner.frames.length);\n }, spinner.interval);\n }, 300);\n return () => {\n clearTimeout(delayTimeout);\n clearInterval(tickInterval);\n };\n }\n else {\n setShowLoader(false);\n }\n }, [status]);\n if (showLoader) {\n return spinner.frames[tick];\n }\n // There's a delay before we show the loader. So we want to ignore `loading` here, and pass idle instead.\n const iconName = status === 'loading' ? 'idle' : status;\n return typeof prefix === 'string' ? prefix : (prefix[iconName] ?? prefix['idle']);\n}\n","import { useState } from './use-state.js';\nexport function useRef(val) {\n return useState({ current: val })[0];\n}\n","import { useRef } from './use-ref.js';\nimport { useEffect } from './use-effect.js';\nimport { withUpdates } from './hook-engine.js';\nexport function useKeypress(userHandler) {\n const signal = useRef(userHandler);\n signal.current = userHandler;\n useEffect((rl) => {\n let ignore = false;\n const handler = withUpdates((_input, event) => {\n if (ignore)\n return;\n void signal.current(event, rl);\n });\n rl.input.on('keypress', handler);\n return () => {\n ignore = true;\n rl.input.removeListener('keypress', handler);\n };\n }, []);\n}\n","'use strict';\n\nmodule.exports = cliWidth;\n\nfunction normalizeOpts(options) {\n const defaultOpts = {\n defaultWidth: 0,\n output: process.stdout,\n tty: require('tty'),\n };\n\n if (!options) {\n return defaultOpts;\n }\n\n Object.keys(defaultOpts).forEach(function (key) {\n if (!options[key]) {\n options[key] = defaultOpts[key];\n }\n });\n\n return options;\n}\n\nfunction cliWidth(options) {\n const opts = normalizeOpts(options);\n\n if (opts.output.getWindowSize) {\n return opts.output.getWindowSize()[0] || opts.defaultWidth;\n }\n\n if (opts.tty.getWindowSize) {\n return opts.tty.getWindowSize()[1] || opts.defaultWidth;\n }\n\n if (opts.output.columns) {\n return opts.output.columns;\n }\n\n if (process.env.CLI_WIDTH) {\n const width = parseInt(process.env.CLI_WIDTH, 10);\n\n if (!isNaN(width) && width !== 0) {\n return width;\n }\n }\n\n return opts.defaultWidth;\n}\n","/* MAIN */\nconst getCodePointsLength = (() => {\n const SURROGATE_PAIR_RE = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n return (input) => {\n let surrogatePairsNr = 0;\n SURROGATE_PAIR_RE.lastIndex = 0;\n while (SURROGATE_PAIR_RE.test(input)) {\n surrogatePairsNr += 1;\n }\n return input.length - surrogatePairsNr;\n };\n})();\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWideNotCJKTNotEmoji = (x) => {\n return x === 0x231B || x === 0x2329 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji };\n","/* IMPORT */\nimport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\\u001b\\]8;[^;]*;.*?(?:\\u0007|\\u001b\\u005c)/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst CJKT_WIDE_RE = /(?:(?![\\uFF61-\\uFF9F\\uFF00-\\uFFEF])[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}\\p{Script=Tangut}]){1,1000}/yu;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;\n const PARSE_BLOCKS = [\n [LATIN_RE, REGULAR_WIDTH],\n [ANSI_RE, ANSI_WIDTH],\n [CONTROL_RE, CONTROL_WIDTH],\n [TAB_RE, TAB_WIDTH],\n [EMOJI_RE, EMOJI_WIDTH],\n [CJKT_WIDE_RE, WIDE_WIDTH],\n ];\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWideNotCJKTNotEmoji(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length) {\n break outer;\n }\n /* PARSE BLOCKS */\n for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {\n const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];\n BLOCK_RE.lastIndex = index;\n if (BLOCK_RE.test(input)) {\n lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;\n widthExtra = lengthExtra * BLOCK_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = BLOCK_RE.lastIndex;\n continue outer;\n }\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last) {\n if (stringWidth(words[last - 1])) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n let rows = [''];\n let rowLength = 0;\n for (let index = 0; index < words.length; index++) {\n const word = words[index];\n if (options.trim !== false) {\n const row = rows.at(-1) ?? '';\n const trimmed = row.trimStart();\n if (row.length !== trimmed.length) {\n rows[rows.length - 1] = trimmed;\n rowLength = stringWidth(trimmed);\n }\n }\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n const wordLength = stringWidth(word);\n if (options.hard && wordLength > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n if (rowLength + wordLength > columns && rowLength && wordLength) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows.push('');\n rowLength = 0;\n }\n if (rowLength + wordLength > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows[rows.length - 1] += word;\n rowLength += wordLength;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n let inSurrogate = false;\n for (let i = 0; i < preString.length; i++) {\n const character = preString[i];\n returnValue += character;\n if (!inSurrogate) {\n inSurrogate = character >= '\\ud800' && character <= '\\udbff';\n if (inSurrogate) {\n continue;\n }\n }\n else {\n inSurrogate = false;\n }\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = i + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n if (preString[i + 1] === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && getClosingCode(escapeCode)) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n return returnValue;\n};\nconst CRLF_OR_LF = /\\r?\\n/;\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .split(CRLF_OR_LF)\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n","import cliWidth from 'cli-width';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { readline } from './hook-engine.js';\n/**\n * Force line returns at specific width. This function is ANSI code friendly and it'll\n * ignore invisible codes during width calculation.\n * @param {string} content\n * @param {number} width\n * @return {string}\n */\nexport function breakLines(content, width) {\n return wrapContent(content, width).text;\n}\n// Wraps `content` and reports the geometry of its final logical line:\n// `lastRow` is the last physical row of that line and `finalLineRows` is how\n// many rows it spans (used by the screen manager to place the cursor back on\n// the prompt line). `lastRow` is deliberately left untrimmed: readline counts\n// trailing spaces when reporting the cursor position, so trimming here would\n// make a line that ends exactly at the terminal edge look one column short.\nexport function wrapContent(content, width) {\n const wrappedLines = content\n .split('\\n')\n .map((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split('\\n'));\n const finalLine = wrappedLines.at(-1) ?? [];\n return {\n text: wrappedLines\n .flat()\n .map((line) => line.trimEnd())\n .join('\\n'),\n lastRow: finalLine.at(-1) ?? '',\n finalLineRows: finalLine.length,\n };\n}\n/**\n * Returns the width of the active readline, or 80 as default value.\n * @returns {number}\n */\nexport function readlineWidth() {\n return cliWidth({ defaultWidth: 80, output: readline().output });\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Create a promise and get access to its `resolve` and `reject` functions.\n *\n * Mirrors `Promise.withResolvers()`, available starting from Node 22.\n * TODO: Remove once Node 22 becomes the minimum supported version.\n */\nexport function withResolver() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve: resolve, reject: reject };\n}\n","const Stream = require('stream')\n\nclass MuteStream extends Stream {\n #isTTY = null\n\n constructor (opts = {}) {\n super(opts)\n this.writable = this.readable = true\n this.muted = false\n this.on('pipe', this._onpipe)\n this.replace = opts.replace\n\n // For readline-type situations\n // This much at the start of a line being redrawn after a ctrl char\n // is seen (such as backspace) won't be redrawn as the replacement\n this._prompt = opts.prompt || null\n this._hadControl = false\n }\n\n #destSrc (key, def) {\n if (this._dest) {\n return this._dest[key]\n }\n if (this._src) {\n return this._src[key]\n }\n return def\n }\n\n #proxy (method, ...args) {\n if (typeof this._dest?.[method] === 'function') {\n this._dest[method](...args)\n }\n if (typeof this._src?.[method] === 'function') {\n this._src[method](...args)\n }\n }\n\n get isTTY () {\n if (this.#isTTY !== null) {\n return this.#isTTY\n }\n return this.#destSrc('isTTY', false)\n }\n\n // basically just get replace the getter/setter with a regular value\n set isTTY (val) {\n this.#isTTY = val\n }\n\n get rows () {\n return this.#destSrc('rows')\n }\n\n get columns () {\n return this.#destSrc('columns')\n }\n\n mute () {\n this.muted = true\n }\n\n unmute () {\n this.muted = false\n }\n\n _onpipe (src) {\n this._src = src\n }\n\n pipe (dest, options) {\n this._dest = dest\n return super.pipe(dest, options)\n }\n\n pause () {\n if (this._src) {\n return this._src.pause()\n }\n }\n\n resume () {\n if (this._src) {\n return this._src.resume()\n }\n }\n\n write (c) {\n if (this.muted) {\n if (!this.replace) {\n return true\n }\n // eslint-disable-next-line no-control-regex\n if (c.match(/^\\u001b/)) {\n if (c.indexOf(this._prompt) === 0) {\n c = c.slice(this._prompt.length)\n c = c.replace(/./g, this.replace)\n c = this._prompt + c\n }\n this._hadControl = true\n return this.emit('data', c)\n } else {\n if (this._prompt && this._hadControl &&\n c.indexOf(this._prompt) === 0) {\n this._hadControl = false\n this.emit('data', this._prompt)\n c = c.slice(this._prompt.length)\n }\n c = c.toString().replace(/./g, this.replace)\n }\n }\n this.emit('data', c)\n }\n\n end (c) {\n if (this.muted) {\n if (c && this.replace) {\n c = c.toString().replace(/./g, this.replace)\n } else {\n c = null\n }\n }\n if (c) {\n this.emit('data', c)\n }\n this.emit('end')\n }\n\n destroy (...args) {\n return this.#proxy('destroy', ...args)\n }\n\n destroySoon (...args) {\n return this.#proxy('destroySoon', ...args)\n }\n\n close (...args) {\n return this.#proxy('close', ...args)\n }\n}\n\nmodule.exports = MuteStream\n","/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals = [];\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM');\nif (process.platform !== 'win32') {\n signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n );\n}\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');\n}\n//# sourceMappingURL=signals.js.map","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js';\nexport { signals };\nconst processOk = (process) => !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function';\nconst kExitEmitter = Symbol.for('signal-exit emitter');\nconst global = globalThis;\nconst ObjectDefineProperty = Object.defineProperty.bind(Object);\n// teeny special purpose ee\nclass Emitter {\n emitted = {\n afterExit: false,\n exit: false,\n };\n listeners = {\n afterExit: [],\n exit: [],\n };\n count = 0;\n id = Math.random();\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter];\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n on(ev, fn) {\n this.listeners[ev].push(fn);\n }\n removeListener(ev, fn) {\n const list = this.listeners[ev];\n const i = list.indexOf(fn);\n /* c8 ignore start */\n if (i === -1) {\n return;\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0;\n }\n else {\n list.splice(i, 1);\n }\n }\n emit(ev, code, signal) {\n if (this.emitted[ev]) {\n return false;\n }\n this.emitted[ev] = true;\n let ret = false;\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret;\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret;\n }\n return ret;\n }\n}\nclass SignalExitBase {\n}\nconst signalExitWrap = (handler) => {\n return {\n onExit(cb, opts) {\n return handler.onExit(cb, opts);\n },\n load() {\n return handler.load();\n },\n unload() {\n return handler.unload();\n },\n };\n};\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => { };\n }\n load() { }\n unload() { }\n}\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';\n /* c8 ignore stop */\n #emitter = new Emitter();\n #process;\n #originalProcessEmit;\n #originalProcessReallyExit;\n #sigListeners = {};\n #loaded = false;\n constructor(process) {\n super();\n this.#process = process;\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {};\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig);\n let { count } = this.#emitter;\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process;\n if (typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number') {\n count += p.__signal_exit_emitter__.count;\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload();\n const ret = this.#emitter.emit('exit', null, sig);\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig;\n if (!ret)\n process.kill(process.pid, s);\n /* c8 ignore stop */\n }\n };\n }\n this.#originalProcessReallyExit = process.reallyExit;\n this.#originalProcessEmit = process.emit;\n }\n onExit(cb, opts) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => { };\n }\n /* c8 ignore stop */\n if (this.#loaded === false) {\n this.load();\n }\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit';\n this.#emitter.on(ev, cb);\n return () => {\n this.#emitter.removeListener(ev, cb);\n if (this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0) {\n this.unload();\n }\n };\n }\n load() {\n if (this.#loaded) {\n return;\n }\n this.#loaded = true;\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1;\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig];\n if (fn)\n this.#process.on(sig, fn);\n }\n catch (_) { }\n }\n this.#process.emit = (ev, ...a) => {\n return this.#processEmit(ev, ...a);\n };\n this.#process.reallyExit = (code) => {\n return this.#processReallyExit(code);\n };\n }\n unload() {\n if (!this.#loaded) {\n return;\n }\n this.#loaded = false;\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig];\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig);\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener);\n /* c8 ignore start */\n }\n catch (_) { }\n /* c8 ignore stop */\n });\n this.#process.emit = this.#originalProcessEmit;\n this.#process.reallyExit = this.#originalProcessReallyExit;\n this.#emitter.count -= 1;\n }\n #processReallyExit(code) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0;\n }\n this.#process.exitCode = code || 0;\n /* c8 ignore stop */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);\n }\n #processEmit(ev, ...args) {\n const og = this.#originalProcessEmit;\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0];\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args);\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n /* c8 ignore stop */\n return ret;\n }\n else {\n return og.call(this.#process, ev, ...args);\n }\n }\n}\nconst process = globalThis.process;\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const { \n/**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\nonExit, \n/**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nload, \n/**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nunload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback());\n//# sourceMappingURL=index.js.map","const ESC = '\\u001B[';\n/** Move cursor to first column */\nexport const cursorLeft = ESC + 'G';\n/** Hide the cursor */\nexport const cursorHide = ESC + '?25l';\n/** Show the cursor */\nexport const cursorShow = ESC + '?25h';\n/** Move cursor up by count rows */\nexport const cursorUp = (rows = 1) => (rows > 0 ? `${ESC}${rows}A` : '');\n/** Move cursor down by count rows */\nexport const cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : '';\n/** Move cursor to position (x, y) */\nexport const cursorTo = (x, y) => {\n if (typeof y === 'number' && !Number.isNaN(y)) {\n return `${ESC}${y + 1};${x + 1}H`;\n }\n return `${ESC}${x + 1}G`;\n};\nconst eraseLine = ESC + '2K';\n/** Erase the specified number of lines above the cursor */\nexport const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : '';\n","import { stripVTControlCharacters } from 'node:util';\n// Measures wide characters for the right-edge check below; it is the same\n// package fast-wrap-ansi measures with internally, and both must stay on the\n// same major so a wrapped row is never judged one column off by one side.\nimport stringWidth from 'fast-string-width';\nimport { breakLines, readlineWidth, wrapContent } from './utils.js';\nimport { cursorDown, cursorLeft, cursorUp, cursorTo, cursorShow, eraseLines, } from '@inquirer/ansi';\nconst height = (content) => content.split('\\n').length;\nconst lastLine = (content) => content.split('\\n').pop() ?? '';\nexport default class ScreenManager {\n // These variables are keeping information to allow correct prompt re-rendering\n height = 0;\n extraLinesUnderPrompt = 0;\n cursorPos;\n rl;\n constructor(rl) {\n this.rl = rl;\n this.cursorPos = rl.getCursorPos();\n }\n write(content) {\n this.rl.output.unmute();\n this.rl.output.write(content);\n this.rl.output.mute();\n }\n render(content, bottomContent = '') {\n // Write message to screen and setPrompt to control backspace\n const promptLine = lastLine(content);\n const rawPromptLine = stripVTControlCharacters(promptLine);\n // Remove the rl.line from our prompt. We can't rely on the content of\n // rl.line (mainly because of the password prompt), so just rely on it's\n // length.\n let prompt = rawPromptLine;\n if (this.rl.line.length > 0) {\n prompt = prompt.slice(0, -this.rl.line.length);\n }\n this.rl.setPrompt(prompt);\n // SetPrompt will change cursor position, now we can get correct value\n this.cursorPos = this.rl.getCursorPos();\n const width = readlineWidth();\n const wrapped = wrapContent(content, width);\n content = wrapped.text;\n bottomContent = breakLines(bottomContent, width);\n const lastRowWidth = stringWidth(stripVTControlCharacters(wrapped.lastRow));\n // `>=` rather than `===` so a degenerate 1-column terminal (where every\n // row is the full width) still inserts the extra line.\n const atRightEdge = lastRowWidth >= width;\n // Manually insert an extra line if we're at the end of the line.\n // This prevent the cursor from appearing at the beginning of the\n // current line. The `rawPromptLine.length === 0` half keeps the old\n // `0 % width === 0` behavior for an empty or ANSI-only prompt line,\n // where `atRightEdge` alone would be false but a line break is still\n // needed before the bottom content.\n if (atRightEdge || rawPromptLine.length === 0) {\n content += '\\n';\n }\n let output = content + (bottomContent ? '\\n' + bottomContent : '');\n /**\n * Re-adjust the cursor at the correct position.\n */\n // We need to consider parts of the prompt under the cursor as part of the bottom\n // content in order to correctly cleanup and re-render.\n const promptLineUpDiff = wrapped.finalLineRows - 1 + Number(atRightEdge) - this.cursorPos.rows;\n const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);\n // Return cursor to the input position (on top of the bottomContent)\n if (bottomContentHeight > 0)\n output += cursorUp(bottomContentHeight);\n // Return cursor to the initial left offset.\n output += cursorTo(this.cursorPos.cols);\n /**\n * Render and store state for future re-rendering\n */\n this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);\n this.extraLinesUnderPrompt = bottomContentHeight;\n this.height = height(output);\n }\n checkCursorPos() {\n const cursorPos = this.rl.getCursorPos();\n if (cursorPos.cols !== this.cursorPos.cols) {\n this.write(cursorTo(cursorPos.cols));\n this.cursorPos = cursorPos;\n }\n }\n done({ clearContent }) {\n this.rl.setPrompt('');\n let output = cursorDown(this.extraLinesUnderPrompt);\n output += clearContent ? eraseLines(this.height) : '\\n';\n // Reset cursor to column 0. On Windows terminals, \\n moves the cursor\n // down without resetting the column when the rendered prompt+answer\n // wraps past the terminal width. Without this, all subsequent output\n // starts at the wrong horizontal offset.\n output += cursorLeft;\n output += cursorShow;\n this.write(output);\n this.rl.close();\n }\n}\n","import * as readline from 'node:readline';\nimport { AsyncResource } from 'node:async_hooks';\nimport { withResolver } from '@inquirer/type';\nimport MuteStream from 'mute-stream';\nimport { onExit as onSignalExit } from 'signal-exit';\nimport ScreenManager from './screen-manager.js';\nimport { withHooks, effectScheduler } from './hook-engine.js';\nimport { AbortPromptError, CancelPromptError, ExitPromptError } from './errors.js';\nimport path from 'node:path';\n// Capture the real setImmediate at module load time so it works even when test\n// frameworks mock timers with vi.useFakeTimers() or similar.\nconst nativeSetImmediate = globalThis.setImmediate;\nconst nativeClearImmediate = globalThis.clearImmediate;\n/**\n * Register an event listener and return its disposer, so registrations collapse\n * into a single statement: `cleanups.add(listenTo(rl, 'close', handler))`.\n */\nfunction listenTo(target, event, listener) {\n if ('on' in target) {\n target.on(event, listener);\n return () => target.removeListener(event, listener);\n }\n target.addEventListener(event, listener);\n return () => target.removeEventListener(event, listener);\n}\nfunction getCallSites() {\n // oxlint-disable-next-line typescript/unbound-method\n const savedPrepareStackTrace = Error.prepareStackTrace;\n let result = [];\n try {\n Error.prepareStackTrace = (_, callSites) => {\n const callSitesWithoutCurrent = callSites.slice(1);\n result = callSitesWithoutCurrent;\n return callSitesWithoutCurrent;\n };\n // oxlint-disable-next-line no-unused-expressions\n new Error().stack;\n }\n catch {\n // An error will occur if the Node flag --frozen-intrinsics is used.\n // https://nodejs.org/api/cli.html#--frozen-intrinsics\n return result;\n }\n Error.prepareStackTrace = savedPrepareStackTrace;\n return result;\n}\nexport function createPrompt(view) {\n const callSites = getCallSites();\n const prompt = (config, context = {}) => {\n // Default `input` to stdin\n const { input = process.stdin, signal } = context;\n const cleanups = new Set();\n // Add mute capabilities to the output\n const output = new MuteStream();\n output.pipe(context.output ?? process.stdout);\n /* oxlint-disable typescript/no-unsafe-type-assertion */\n const rl = readline.createInterface({\n terminal: true,\n input,\n output,\n });\n /* oxlint-enable typescript/no-unsafe-type-assertion */\n // Mute the output after readline has initialized so readline can perform\n // any terminal setup writes (e.g. Windows Console API initialization)\n // before suppressing output. ScreenManager will unmute/mute around each\n // render call as needed.\n output.mute();\n const screen = new ScreenManager(rl);\n const { promise, resolve, reject } = withResolver();\n return withHooks(rl, (cycle) => {\n // Clear hook effects synchronously before the prompt settles: readline\n // emits keypresses synchronously within a single data event, so a\n // microtask-deferred cleanup would let same-tick input keep driving a\n // settled prompt.\n const clearEffects = AsyncResource.bind(() => effectScheduler.clearAll());\n // The promise resolvers and effectScheduler.clearAll() are both idempotent,\n // so repeated settlement attempts are harmless no-ops. If a hook cleanup\n // throws, the cleanup error supersedes the settlement: the answer (or\n // settlement error, e.g. AbortPromptError) is dropped in favor of\n // rejecting with the cleanup error.\n const settlePrompt = (settle) => {\n try {\n clearEffects();\n settle();\n }\n catch (error) {\n reject(error);\n }\n };\n const resolvePrompt = (value) => settlePrompt(() => resolve(value));\n const rejectPrompt = (error) => settlePrompt(() => reject(error));\n const promptPromise = Object.assign(promise\n .finally(() => {\n cleanups.forEach((cleanup) => cleanup());\n screen.done({ clearContent: Boolean(context.clearPromptOnDone) });\n output.end();\n })\n .then(() => promise), { cancel: () => rejectPrompt(new CancelPromptError()) });\n if (signal) {\n const abort = () => rejectPrompt(new AbortPromptError({ cause: signal.reason }));\n if (signal.aborted) {\n abort();\n return promptPromise;\n }\n cleanups.add(listenTo(signal, 'abort', abort));\n }\n cleanups.add(onSignalExit((code, signal) => {\n rejectPrompt(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`));\n }));\n // SIGINT must be explicitly handled by the prompt so the ExitPromptError can be handled.\n // Otherwise, the prompt will stop and in some scenarios never resolve.\n // Ref issue #1741\n cleanups.add(listenTo(rl, 'SIGINT', () => rejectPrompt(new ExitPromptError(`User force closed the prompt with SIGINT`))));\n // A TTY closes its readline on Ctrl+D (EOF on an empty line) while the\n // prompt is pending: reject now, like SIGINT, so the caller can handle\n // it while the process is still alive — including while a submitted\n // answer is validating, which cancels that answer. Piped stdin closes\n // as soon as the pipe drains, possibly mid-validation too, so there\n // only clear the effect timers and let the prompt settle on its own.\n // Settlement removes this listener before screen.done() closes\n // readline.\n const isTTY = 'isTTY' in input && input.isTTY;\n const onReadlineClose = isTTY\n ? () => rejectPrompt(new ExitPromptError('User force closed the prompt with EOF'))\n : clearEffects;\n cleanups.add(listenTo(rl, 'close', onReadlineClose));\n const startCycle = () => {\n // Re-renders only happen when the state change; but the readline cursor could\n // change position and that also requires a re-render (and a manual one because\n // we mute the streams). We set the listener after the initial workLoop to avoid\n // a double render if render triggered by a state change sets the cursor to the\n // right position.\n cleanups.add(listenTo(rl.input, 'keypress', () => screen.checkCursorPos()));\n let pendingDone = null;\n cycle(() => {\n let effectsSettled = false;\n try {\n const nextView = view(config, (value) => {\n if (effectsSettled) {\n // After the cycle completes (async validation path), the \"done\"\n // render already flushed via setStatus → handleChange, so resolve\n // immediately.\n resolvePrompt(value);\n }\n else {\n pendingDone = { value };\n }\n });\n // Typescript won't allow this, but not all users rely on typescript.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (nextView === undefined) {\n let callerFilename = callSites[1]?.getFileName();\n if (callerFilename && !callerFilename.startsWith('file://')) {\n callerFilename = path.resolve(callerFilename);\n }\n throw new Error(`Prompt functions must return a string.\\n at ${callerFilename}`);\n }\n const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;\n screen.render(content, bottomContent);\n effectScheduler.run();\n }\n catch (error) {\n rejectPrompt(error);\n }\n effectsSettled = true;\n if (pendingDone !== null) {\n const { value } = pendingDone;\n pendingDone = null;\n resolvePrompt(value);\n }\n });\n };\n // Proper Readable streams (like process.stdin) may have OS-level buffered\n // data that arrives in the poll phase when readline resumes the stream.\n // Deferring the first render by one setImmediate tick (check phase, after\n // poll) lets that stale data flow through readline harmlessly—no keypress\n // handlers are registered yet and the output is muted, so the stale\n // keystrokes are silently discarded.\n // This only applies to TTY inputs, where early data is stale keystrokes\n // the user typed before the prompt started. Piped input (stdin from a\n // script or test harness) is intentional: deferring there risks dropping\n // the answer itself, since data already waiting on the pipe flows\n // through readline during the deferral tick and is then discarded,\n // leaving the prompt waiting forever (seen as intermittent 30s timeouts\n // in the Deno integration suite).\n // Old-style streams (like MuteStream) have no such buffering, so the\n // render cycle starts immediately.\n //\n // @see https://github.com/SBoudrias/Inquirer.js/issues/1303\n if ('readableFlowing' in input && isTTY) {\n const immediate = nativeSetImmediate(startCycle);\n cleanups.add(() => nativeClearImmediate(immediate));\n }\n else {\n startCycle();\n }\n return promptPromise;\n });\n };\n return prompt;\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],"mappings":";;;;;;;;;;;;;AACA,MAAM,mCAAmB,IAAI,IAAI,CADZ,SAAS,KACa,CAAC;AAC5C,SAAS,aAAa,OAAO;CACzB,OAAO,iBAAiB,IAAI,KAAK;AACrC;AACA,SAAgB,wBAAwB;CACpC,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,KACD,OAAO,CAAC;CACZ,OAAO,MAAM,KAAK,IAAI,IAAI,IACrB,YAAY,CAAC,CACb,MAAM,QAAQ,CAAC,CACf,OAAO,YAAY,CAAC,CAAC;AAC9B;AACA,MAAa,WAAW,KAAK,cAAc,CAAC,MAE5C,IAAI,SAAS,QAER,YAAY,SAAS,KAAK,KAAK,IAAI,SAAS,OAE5C,YAAY,SAAS,OAAO,KAAK,IAAI,QAAQ,IAAI,SAAS;AAC/D,MAAa,aAAa,KAAK,cAAc,CAAC,MAE9C,IAAI,SAAS,UAER,YAAY,SAAS,KAAK,KAAK,IAAI,SAAS,OAE5C,YAAY,SAAS,OAAO,KAAK,IAAI,QAAQ,IAAI,SAAS;AAC/D,MAAa,cAAc,QAAQ,IAAI,SAAS;AAChD,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AAI,MAAM,kDAAkD,gBAAgB;MACtF;MACA,MAAM,CAAC,SAAS,iBAAiB,OAAO,aAAa,WAAW,CAAC,QAAQ,IAAI;MAC7E,OAAO,OAAO,SAAS,aAAa;MACpC,gBAAgB,IAAI;KACxB,SACO,OAAO;MACV,aAAa,KAAK;KACtB;KACA,iBAAiB;KACjB,IAAI,gBAAgB,MAAM;MACtB,MAAM,EAAE,UAAU;MAClB,cAAc;MACd,cAAc,KAAK;KACvB;IACJ,CAAC;GACL;GAkBA,IAAI,qBAAqB,SAAS,OAAO;IACrC,MAAM,YAAY,mBAAmB,UAAU;IAC/C,SAAS,UAAU,qBAAqB,SAAS,CAAC;GACtD,OAEI,WAAW;GAEf,OAAO;EACX,CAAC;CACL;CACA,OAAO;AACX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as isEnterKey, a as readlineWidth, c as usePrefix, d as useEffect, f as useState, g as isDownKey, h as isBackspaceKey, i as breakLines, l as makeTheme, m as ValidationError, n as cursorHide, o as useKeypress, p as withPointer, s as useRef, t as createPrompt, u as figures, v as isNumberKey, x as isUpKey } from "./create-prompt-
|
|
1
|
+
import { _ as isEnterKey, a as readlineWidth, c as usePrefix, d as useEffect, f as useState, g as isDownKey, h as isBackspaceKey, i as breakLines, l as makeTheme, m as ValidationError, n as cursorHide, o as useKeypress, p as withPointer, s as useRef, t as createPrompt, u as figures, v as isNumberKey, x as isUpKey } from "./create-prompt-C3XKo-s3.js";
|
|
2
2
|
import { styleText } from "node:util";
|
|
3
|
-
|
|
3
|
+
// ../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
4
4
|
function useMemo(fn, dependencies) {
|
|
5
5
|
return withPointer((pointer) => {
|
|
6
6
|
const prev = pointer.get();
|
|
@@ -15,8 +15,7 @@ function useMemo(fn, dependencies) {
|
|
|
15
15
|
return prev.value;
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.4_@types+node@26.6.5/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
18
|
+
// ../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
20
19
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
21
20
|
const state = useRef({
|
|
22
21
|
lastPointer: active,
|
|
@@ -100,8 +99,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
100
99
|
}
|
|
101
100
|
return pageBuffer.filter((line) => typeof line === "string").join("\n");
|
|
102
101
|
}
|
|
103
|
-
|
|
104
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.4_@types+node@26.6.5/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
102
|
+
// ../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
105
103
|
/**
|
|
106
104
|
* Separator object
|
|
107
105
|
* Used to space/separate choices group
|
|
@@ -116,8 +114,8 @@ var Separator = class {
|
|
|
116
114
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
117
115
|
}
|
|
118
116
|
};
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
// ../../node_modules/.pnpm/@inquirer+select@5.3.1_@types+node@26.6.10/node_modules/@inquirer/select/dist/index.js
|
|
118
|
+
const numberLineRegex = /^\d+$/;
|
|
121
119
|
const selectTheme = {
|
|
122
120
|
icon: { cursor: figures.pointer },
|
|
123
121
|
style: {
|
|
@@ -205,7 +203,7 @@ var dist_default = createPrompt((config, done) => {
|
|
|
205
203
|
while (!isNavigable(items[next]));
|
|
206
204
|
setActive(next);
|
|
207
205
|
}
|
|
208
|
-
} else if (isNumberKey(key) &&
|
|
206
|
+
} else if (isNumberKey(key) && numberLineRegex.test(rl.line)) {
|
|
209
207
|
const selectedIndex = Number(rl.line) - 1;
|
|
210
208
|
let selectableIndex = -1;
|
|
211
209
|
const position = items.findIndex((item) => {
|
|
@@ -272,7 +270,6 @@ var dist_default = createPrompt((config, done) => {
|
|
|
272
270
|
helpLine
|
|
273
271
|
].filter(Boolean).join("\n").trimEnd()}${cursorHide}`;
|
|
274
272
|
});
|
|
275
|
-
//#endregion
|
|
276
273
|
export { useMemo as i, Separator as n, usePagination as r, dist_default as t };
|
|
277
274
|
|
|
278
|
-
//# sourceMappingURL=dist-
|
|
275
|
+
//# sourceMappingURL=dist-D7b9-VIt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-D7b9-VIt.js","names":[],"sources":["../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/use-memo.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js","../../../node_modules/.pnpm/@inquirer+core@12.1.1_@types+node@26.6.10/node_modules/@inquirer/core/dist/lib/Separator.js","../../../node_modules/.pnpm/@inquirer+select@5.3.1_@types+node@26.6.10/node_modules/@inquirer/select/dist/index.js"],"sourcesContent":["import { withPointer } from './hook-engine.js';\nexport function useMemo(fn, dependencies) {\n return withPointer((pointer) => {\n const prev = pointer.get();\n if (!pointer.initialized ||\n prev.dependencies.length !== dependencies.length ||\n prev.dependencies.some((dep, i) => dep !== dependencies[i])) {\n const value = fn();\n pointer.set({ value, dependencies });\n return value;\n }\n return prev.value;\n });\n}\n","import { useRef } from '../use-ref.js';\nimport { readlineWidth, breakLines } from '../utils.js';\nfunction usePointerPosition({ active, renderedItems, pageSize, loop, }) {\n const state = useRef({\n lastPointer: active,\n lastActive: undefined,\n });\n const { lastPointer, lastActive } = state.current;\n const middle = Math.floor(pageSize / 2);\n const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);\n const defaultPointerPosition = renderedItems\n .slice(0, active)\n .reduce((acc, item) => acc + item.length, 0);\n let pointer = defaultPointerPosition;\n if (renderedLength > pageSize) {\n if (loop) {\n /**\n * Creates the next position for the pointer considering an infinitely\n * looping list of items to be rendered on the page.\n *\n * The goal is to progressively move the cursor to the middle position as the user move down, and then keep\n * the cursor there. When the user move up, maintain the cursor position.\n */\n // By default, keep the cursor position as-is.\n pointer = lastPointer;\n if (\n // First render, skip this logic.\n lastActive != null &&\n // Only move the pointer down when the user moves down.\n lastActive < active &&\n // Check user didn't move up across page boundary.\n active - lastActive < pageSize) {\n pointer = Math.min(\n // Furthest allowed position for the pointer is the middle of the list\n middle, Math.abs(active - lastActive) === 1\n ? Math.min(\n // Move the pointer at most the height of the last active item.\n lastPointer + (renderedItems[lastActive]?.length ?? 0), \n // If the user moved by one item, move the pointer to the natural position of the active item as\n // long as it doesn't move the cursor up.\n Math.max(defaultPointerPosition, lastPointer))\n : // Otherwise, move the pointer down by the difference between the active and last active item.\n lastPointer + active - lastActive);\n }\n }\n else {\n /**\n * Creates the next position for the pointer considering a finite list of\n * items to be rendered on a page.\n *\n * The goal is to keep the pointer in the middle of the page whenever possible, until\n * we reach the bounds of the list (top or bottom). In which case, the cursor moves progressively\n * to the bottom or top of the list.\n */\n const spaceUnderActive = renderedItems\n .slice(active)\n .reduce((acc, item) => acc + item.length, 0);\n pointer =\n spaceUnderActive < pageSize - middle\n ? // If the active item is near the end of the list, progressively move the cursor towards the end.\n pageSize - spaceUnderActive\n : // Otherwise, progressively move the pointer to the middle of the list.\n Math.min(defaultPointerPosition, middle);\n }\n }\n // Save state for the next render\n state.current.lastPointer = pointer;\n state.current.lastActive = active;\n return pointer;\n}\nexport function usePagination({ items, active, renderItem, pageSize, loop = true, }) {\n const width = readlineWidth();\n const bound = (num) => ((num % items.length) + items.length) % items.length;\n const renderedItems = items.map((item, index) => {\n if (item == null)\n return [];\n return breakLines(renderItem({ item, index, isActive: index === active }), width).split('\\n');\n });\n const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);\n const renderItemAtIndex = (index) => renderedItems[index] ?? [];\n const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });\n // Render the active item to decide the position.\n // If the active item fits under the pointer, we render it there.\n // Otherwise, we need to render it to fit at the bottom of the page; moving the pointer up.\n const activeItem = renderItemAtIndex(active).slice(0, pageSize);\n const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;\n // Create an array of lines for the page, and add the lines of the active item into the page\n const pageBuffer = Array.from({ length: pageSize });\n pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);\n // Store to prevent rendering the same item twice\n const itemVisited = new Set([active]);\n // Fill the page under the active item\n let bufferPointer = activeItemPosition + activeItem.length;\n let itemPointer = bound(active + 1);\n while (bufferPointer < pageSize &&\n !itemVisited.has(itemPointer) &&\n (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {\n const lines = renderItemAtIndex(itemPointer);\n const linesToAdd = lines.slice(0, pageSize - bufferPointer);\n pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);\n // Move pointers for next iteration\n itemVisited.add(itemPointer);\n bufferPointer += linesToAdd.length;\n itemPointer = bound(itemPointer + 1);\n }\n // Fill the page over the active item\n bufferPointer = activeItemPosition - 1;\n itemPointer = bound(active - 1);\n while (bufferPointer >= 0 &&\n !itemVisited.has(itemPointer) &&\n (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {\n const lines = renderItemAtIndex(itemPointer);\n const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));\n pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);\n // Move pointers for next iteration\n itemVisited.add(itemPointer);\n bufferPointer -= linesToAdd.length;\n itemPointer = bound(itemPointer - 1);\n }\n return pageBuffer.filter((line) => typeof line === 'string').join('\\n');\n}\n","import { styleText } from 'node:util';\nimport figures from '@inquirer/figures';\n/**\n * Separator object\n * Used to space/separate choices group\n */\nexport class Separator {\n separator = styleText('dim', Array.from({ length: 15 }).join(figures.line));\n type = 'separator';\n constructor(separator) {\n if (separator) {\n this.separator = separator;\n }\n }\n static isSeparator(choice) {\n return Boolean(choice &&\n typeof choice === 'object' &&\n 'type' in choice &&\n choice.type === 'separator');\n }\n}\n","import { createPrompt, useState, useKeypress, usePrefix, usePagination, useRef, useMemo, useEffect, isBackspaceKey, isEnterKey, isUpKey, isDownKey, isNumberKey, Separator, ValidationError, makeTheme, } from '@inquirer/core';\nimport { cursorHide } from '@inquirer/ansi';\nimport { styleText } from 'node:util';\nimport figures from '@inquirer/figures';\n// Only treat the typed line as a numeric index when it's plain digits from\n// start to finish, so JS-numeric forms like `2e1` or `0x2` don't jump the\n// cursor to a bogus index.\nconst numberLineRegex = /^\\d+$/;\nconst selectTheme = {\n icon: { cursor: figures.pointer },\n style: {\n disabled: (text) => styleText('dim', text),\n description: (text) => styleText('cyan', text),\n keysHelpTip: (keys) => keys\n .map(([key, action]) => `${styleText('bold', key)} ${styleText('dim', action)}`)\n .join(styleText('dim', ' • ')),\n },\n i18n: { disabledError: 'This option is disabled and cannot be selected.' },\n indexMode: 'hidden',\n};\nfunction isSelectable(item) {\n return !Separator.isSeparator(item) && !item.disabled;\n}\nfunction isNavigable(item) {\n return !Separator.isSeparator(item);\n}\nfunction normalizeChoices(choices) {\n return choices.map((choice) => {\n if (Separator.isSeparator(choice))\n return choice;\n if (typeof choice !== 'object' || choice === null || !('value' in choice)) {\n // It's a raw value (string, number, etc.)\n const name = String(choice);\n return {\n value: choice,\n name,\n short: name,\n disabled: false,\n };\n }\n const name = choice.name ?? String(choice.value);\n const normalizedChoice = {\n value: choice.value,\n name,\n short: choice.short ?? name,\n disabled: choice.disabled ?? false,\n };\n if (choice.description) {\n normalizedChoice.description = choice.description;\n }\n return normalizedChoice;\n });\n}\nexport default createPrompt((config, done) => {\n const { loop = true, pageSize = 7 } = config;\n const theme = makeTheme(selectTheme, config.theme);\n const { keybindings } = theme;\n const [status, setStatus] = useState('idle');\n const prefix = usePrefix({ status, theme });\n const searchTimeoutRef = useRef();\n // Vim keybindings (j/k) conflict with typing those letters in search.\n const searchEnabled = !keybindings.includes('vim');\n const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);\n const bounds = useMemo(() => {\n const first = items.findIndex(isNavigable);\n const last = items.findLastIndex(isNavigable);\n if (first === -1) {\n throw new ValidationError('[select prompt] No selectable choices. All choices are disabled.');\n }\n return { first, last };\n }, [items]);\n const defaultItemIndex = useMemo(() => {\n if (!('default' in config))\n return -1;\n return items.findIndex((item) => isSelectable(item) && item.value === config.default);\n }, [config.default, items]);\n const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);\n const selectedChoice = items[active];\n if (selectedChoice == null || Separator.isSeparator(selectedChoice)) {\n throw new Error('Active index does not point to a choice');\n }\n const [errorMsg, setError] = useState();\n useKeypress((key, rl) => {\n clearTimeout(searchTimeoutRef.current);\n if (errorMsg) {\n setError(undefined);\n }\n if (isEnterKey(key)) {\n if (selectedChoice.disabled) {\n setError(theme.i18n.disabledError);\n }\n else {\n setStatus('done');\n done(selectedChoice.value);\n }\n }\n else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {\n rl.clearLine(0);\n if (loop ||\n (isUpKey(key, keybindings) && active !== bounds.first) ||\n (isDownKey(key, keybindings) && active !== bounds.last)) {\n const offset = isUpKey(key, keybindings) ? -1 : 1;\n let next = active;\n do {\n next = (next + offset + items.length) % items.length;\n } while (!isNavigable(items[next]));\n setActive(next);\n }\n }\n else if (isNumberKey(key) && numberLineRegex.test(rl.line)) {\n const selectedIndex = Number(rl.line) - 1;\n // Find the nth item (ignoring separators)\n let selectableIndex = -1;\n const position = items.findIndex((item) => {\n if (Separator.isSeparator(item))\n return false;\n selectableIndex++;\n return selectableIndex === selectedIndex;\n });\n const item = items[position];\n if (item != null && isSelectable(item)) {\n setActive(position);\n }\n searchTimeoutRef.current = setTimeout(() => {\n rl.clearLine(0);\n }, 700);\n }\n else if (isBackspaceKey(key)) {\n rl.clearLine(0);\n }\n else if (searchEnabled) {\n const searchTerm = rl.line.toLowerCase();\n const matchIndex = items.findIndex((item) => {\n if (Separator.isSeparator(item) || !isSelectable(item))\n return false;\n return item.name.toLowerCase().startsWith(searchTerm);\n });\n if (matchIndex !== -1) {\n setActive(matchIndex);\n }\n searchTimeoutRef.current = setTimeout(() => {\n rl.clearLine(0);\n }, 700);\n }\n });\n useEffect(() => () => {\n clearTimeout(searchTimeoutRef.current);\n }, []);\n const message = theme.style.message(config.message, status);\n const helpLine = theme.style.keysHelpTip([\n ['↑↓', 'navigate'],\n ['⏎', 'select'],\n ]);\n let separatorCount = 0;\n const page = usePagination({\n items,\n active,\n renderItem({ item, isActive, index }) {\n if (Separator.isSeparator(item)) {\n separatorCount++;\n return ` ${item.separator}`;\n }\n const cursor = isActive ? theme.icon.cursor : ' ';\n const indexLabel = theme.indexMode === 'number' ? `${index + 1 - separatorCount}. ` : '';\n if (item.disabled) {\n const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)';\n const disabledCursor = isActive ? theme.icon.cursor : '-';\n return theme.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);\n }\n const color = isActive ? theme.style.highlight : (x) => x;\n return color(`${cursor} ${indexLabel}${item.name}`);\n },\n pageSize,\n loop,\n });\n if (status === 'done') {\n return [prefix, message, theme.style.answer(selectedChoice.short)]\n .filter(Boolean)\n .join(' ');\n }\n const { description } = selectedChoice;\n const lines = [\n [prefix, message].filter(Boolean).join(' '),\n page,\n ' ',\n description ? theme.style.description(description) : '',\n errorMsg ? theme.style.error(errorMsg) : '',\n helpLine,\n ]\n .filter(Boolean)\n .join('\\n')\n .trimEnd();\n return `${lines}${cursorHide}`;\n});\nexport { Separator } from '@inquirer/core';\n"],"ignoreList":[0,1,2,3],"mappings":";;;AACA,SAAgB,QAAQ,IAAI,cAAc;CACtC,OAAO,aAAa,YAAY;EAC5B,MAAM,OAAO,QAAQ,IAAI;EACzB,IAAI,CAAC,QAAQ,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,MAAM,MAAM,OAAO,eAAe,KAAK;CAAC,CAAC,CAC7D,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEjB,MAAM,EAAE,gBAAgB;CAYxB,OAAO,GAXO;EACV,CAAC,QAAQ,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC1C;EACA;EACA,cAAc,MAAM,MAAM,YAAY,WAAW,IAAI;EACrD,WAAW,MAAM,MAAM,MAAM,QAAQ,IAAI;EACzC;CACJ,CAAC,CACI,OAAO,OAAO,CAAC,CACf,KAAK,IAAI,CAAC,CACV,QACS,IAAI;AACtB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { r as formatDiagnosticsTable, s as writeDiagnostics, t as countErrors } from "./table-DsKq-B4-.js";
|
|
3
|
-
import { a as parseJsonInput, i as writeOutput, n as ProgressTracker, o as readInput, r as showResolvedOptions, s as convertLearnosityToQti, t as resolveOptions } from "./resolveOptions-BuNN2KMA.js";
|
|
1
|
+
import { a as parseJsonInput, i as writeOutput, n as ProgressTracker, o as readInput, r as showResolvedOptions, s as convertLearnosityToQti, t as resolveOptions } from "./resolveOptions-ikupjaRQ.js";
|
|
4
2
|
import { copyFile, mkdir } from "fs/promises";
|
|
5
3
|
import { basename, dirname, join } from "path";
|
|
6
|
-
|
|
4
|
+
import { o as writeDiagnostics, r as formatDiagnosticsTable, t as countErrors } from "./table-6SiZD7aK.js";
|
|
5
|
+
import { n as loadConfig, r as showBanner } from "./pathUtils-I2bRHUwu.js";
|
|
6
|
+
// src/commands/learnosityToQti.ts
|
|
7
7
|
/**
|
|
8
8
|
* Register learnosity-to-qti command
|
|
9
9
|
*/
|
|
@@ -97,7 +97,6 @@ async function executeLearnosityToQti(cliOpts, version) {
|
|
|
97
97
|
process.exit(1);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
//#endregion
|
|
101
100
|
export { registerLearnosityToQtiCommand };
|
|
102
101
|
|
|
103
|
-
//# sourceMappingURL=learnosityToQti-
|
|
102
|
+
//# sourceMappingURL=learnosityToQti-CN6KKSmF.js.map
|
package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js.map → learnosityToQti-CN6KKSmF.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnosityToQti-D4ddrXaz.js","names":[],"sources":["../src/commands/learnosityToQti.ts"],"sourcesContent":["import type { Command } from 'commander';\nimport type { ConversionOptions, Diagnostic } from '@learnosity/converter-core';\nimport { convertLearnosityToQti } from '@learnosity/converter-core';\nimport { copyFile, mkdir } from 'fs/promises';\nimport { dirname, join, basename } from 'path';\nimport { readInput, parseJsonInput } from '../io/readInput.js';\nimport { writeOutput } from '../io/writeOutput.js';\nimport { writeDiagnostics } from '../io/writeDiagnostics.js';\nimport { showBanner } from '../ux/banner.js';\nimport { showResolvedOptions } from '../ux/resolvedOptions.js';\nimport { ProgressTracker } from '../ux/progress.js';\nimport { formatDiagnosticsTable, countErrors } from '../ux/table.js';\nimport { loadConfig } from '../options/loadConfig.js';\nimport { resolveOptions } from '../options/resolveOptions.js';\nimport type { CliOptions } from '../options/types.js';\n\n/**\n * Register learnosity-to-qti command\n */\nexport function registerLearnosityToQtiCommand(program: Command, version: string): void {\n program\n .command('learnosity-to-qti')\n .description('Convert a single Learnosity item to QTI')\n .option('--in <path>', 'Input file path or \"-\" for stdin')\n .option('--out <path>', 'Output file path or \"-\" for stdout')\n .option('--qti-version <version>', 'QTI version (2.1 or 2.2, default: 2.2)')\n .option(\n '--custom-asset-url <url>',\n 'Base URL/prefix for image/audio/video asset references, replacing everything up to the filename (default: ./assets)'\n )\n .option(\n '--output-format <format>',\n 'Output format (dir|zip|stdout, default: auto-detect from output path)'\n )\n .option(\n '--diagnostics <mode>',\n 'Diagnostics output (stderr|file|both|none, default: file for file output, stderr for stdout)'\n )\n .option('--fail-on-warn', 'Exit with error code 1 if warnings exist (default: false)')\n .option('--config <path>', 'Path to config file')\n .option('--no-config', 'Disable config file loading')\n .option('-i, --interactive', 'Enable interactive prompts (default: false)')\n .option('--verbose', 'Verbose output (default: false)')\n .option('--pretty', 'Pretty-print JSON output (default: false)')\n .option('-q, --quiet', 'Suppress non-essential output (default: false)')\n .option(\n '--include-learnosity-source',\n 'Copy input file to source/ folder alongside output (default: false)'\n )\n .action(async (opts: CliOptions) => {\n await executeLearnosityToQti(opts, version);\n });\n}\n\nasync function copySourceFile(inputPath: string, outputPath: string): Promise<void> {\n const outputDir = dirname(outputPath);\n\n // Both paths are CLI arguments the operator chose. 'source' is a literal and\n // basename() strips any directory part of inputPath, so the copy stays inside\n // the requested output directory.\n // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal, javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal\n const sourceDir = join(outputDir, 'source');\n\n await mkdir(sourceDir, { recursive: true });\n // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal, javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal\n await copyFile(inputPath, join(sourceDir, basename(inputPath)));\n}\n\n/**\n * Execute learnosity-to-qti conversion\n */\nasync function executeLearnosityToQti(cliOpts: CliOptions, version: string): Promise<void> {\n const allDiagnostics: Diagnostic[] = [];\n const quiet = cliOpts.quiet ?? false;\n\n try {\n showBanner('learnosity-to-qti', version, quiet);\n\n // Load config\n const {\n config,\n diagnostics: configDiagnostics,\n configPath,\n } = await loadConfig(cliOpts.config, cliOpts.noConfig);\n\n allDiagnostics.push(...configDiagnostics);\n\n // Check for config errors\n const configErrors = configDiagnostics.filter((d) => d.level === 'error');\n\n if (configErrors.length > 0) {\n console.log('\\n' + formatDiagnosticsTable(configDiagnostics));\n process.exit(1);\n }\n\n // Resolve options\n const {\n options: resolved,\n diagnostics: resolveDiagnostics,\n withSources,\n } = await resolveOptions(cliOpts, config, false, configPath);\n\n allDiagnostics.push(...resolveDiagnostics);\n\n // Show resolved options\n showResolvedOptions(resolved, withSources, quiet);\n\n const progress = new ProgressTracker(resolved.verbose);\n\n // Read and parse input\n progress.startStage('Reading input...');\n const inputText = await readInput(resolved.inputPath);\n const input = parseJsonInput(inputText);\n\n progress.succeedStage('Input read');\n\n // Convert\n progress.startStage('Converting Learnosity to QTI...');\n const conversionOpts: ConversionOptions = {\n qtiVersion: resolved.qtiVersion,\n outputFormat: resolved.outputFormat,\n diagnostics: resolved.diagnostics,\n verbose: resolved.verbose,\n pretty: resolved.pretty,\n customAssetUrl: resolved.customAssetUrl,\n };\n const result = await convertLearnosityToQti(input, conversionOpts);\n\n // Set diagnostics file to input filename only\n const inputFilename = resolved.inputPath.split('/').pop() ?? resolved.inputPath;\n const prefixedDiagnostics = result.diagnostics.map((d) => ({\n ...d,\n file: inputFilename,\n }));\n\n allDiagnostics.push(...prefixedDiagnostics);\n progress.succeedStage('Conversion complete');\n\n // Check for errors before writing output\n const errorCount = countErrors(allDiagnostics);\n\n if (errorCount > 0) {\n progress.failStage('Conversion failed');\n console.log('\\n' + formatDiagnosticsTable(allDiagnostics));\n process.exit(1);\n }\n\n // Write output only if no errors\n if (result.output) {\n progress.startStage('Writing output...');\n await writeOutput(resolved.outputPath, result.output, resolved.pretty);\n progress.succeedStage('Output written');\n }\n\n // Copy source file if requested\n if (\n cliOpts.includeLearnositySource &&\n resolved.inputPath !== '-' &&\n resolved.outputPath !== '-'\n ) {\n progress.startStage('Copying source file...');\n await copySourceFile(resolved.inputPath, resolved.outputPath);\n progress.succeedStage('Source file copied');\n }\n\n // Write diagnostics\n if (resolved.diagnostics !== 'none') {\n progress.startStage('Writing diagnostics...');\n const hasErrors = allDiagnostics.some((d) => d.level === 'error');\n\n await writeDiagnostics(\n allDiagnostics,\n resolved.diagnostics,\n resolved.diagnosticsPath,\n resolved.outputPath,\n resolved.verbose,\n {\n inputPath: resolved.inputPath,\n outputPath: resolved.outputPath,\n totalItemsFound: 1,\n convertedFiles: hasErrors ? [] : [inputFilename],\n failedFiles: hasErrors ? [inputFilename] : [],\n }\n );\n progress.succeedStage('Diagnostics written');\n }\n\n // Display diagnostics table only if mode is stderr or both\n if (resolved.diagnostics === 'stderr' || resolved.diagnostics === 'both') {\n console.log('\\n' + formatDiagnosticsTable(allDiagnostics));\n }\n\n // Check for warnings if fail-on-warn\n const warningCount = allDiagnostics.filter((d) => d.level === 'warning').length;\n\n if (warningCount > 0 && cliOpts.failOnWarn) {\n process.stderr.write(\n `\\n${warningCount} warning(s) found - exiting with error (--fail-on-warn)\\n`\n );\n process.exit(1);\n }\n\n process.exit(0);\n } catch (error) {\n if (error instanceof Error && error.name === 'ExitPromptError') {\n process.exit(130);\n }\n console.error('\\n' + (error instanceof Error ? error.message : 'Unknown error'));\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,+BAA+B,SAAkB,SAAuB;CACpF,QACK,QAAQ,mBAAmB,CAAC,CAC5B,YAAY,yCAAyC,CAAC,CACtD,OAAO,eAAe,oCAAkC,CAAC,CACzD,OAAO,gBAAgB,sCAAoC,CAAC,CAC5D,OAAO,2BAA2B,wCAAwC,CAAC,CAC3E,OACG,4BACA,qHACJ,CAAC,CACA,OACG,4BACA,uEACJ,CAAC,CACA,OACG,wBACA,8FACJ,CAAC,CACA,OAAO,kBAAkB,2DAA2D,CAAC,CACrF,OAAO,mBAAmB,qBAAqB,CAAC,CAChD,OAAO,eAAe,6BAA6B,CAAC,CACpD,OAAO,qBAAqB,6CAA6C,CAAC,CAC1E,OAAO,aAAa,iCAAiC,CAAC,CACtD,OAAO,YAAY,2CAA2C,CAAC,CAC/D,OAAO,eAAe,gDAAgD,CAAC,CACvE,OACG,+BACA,qEACJ,CAAC,CACA,OAAO,OAAO,SAAqB;EAChC,MAAM,uBAAuB,MAAM,OAAO;CAC9C,CAAC;AACT;AAEA,eAAe,eAAe,WAAmB,YAAmC;CAChF,MAAM,YAAY,QAAQ,UAAU;CAMpC,MAAM,YAAY,KAAK,WAAW,QAAQ;CAE1C,MAAM,MAAM,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AQ,MAAM,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,gBAAgB;EAC/E,QAAQ,KAAK,CAAC;CAClB;AACJ"}
|
|
1
|
+
{"version":3,"file":"learnosityToQti-CN6KKSmF.js","names":[],"sources":["../src/commands/learnosityToQti.ts"],"sourcesContent":["import type { Command } from 'commander';\nimport type { ConversionOptions, Diagnostic } from '@learnosity/converter-core';\nimport { convertLearnosityToQti } from '@learnosity/converter-core';\nimport { copyFile, mkdir } from 'fs/promises';\nimport { dirname, join, basename } from 'path';\nimport { readInput, parseJsonInput } from '../io/readInput.js';\nimport { writeOutput } from '../io/writeOutput.js';\nimport { writeDiagnostics } from '../io/writeDiagnostics.js';\nimport { showBanner } from '../ux/banner.js';\nimport { showResolvedOptions } from '../ux/resolvedOptions.js';\nimport { ProgressTracker } from '../ux/progress.js';\nimport { formatDiagnosticsTable, countErrors } from '../ux/table.js';\nimport { loadConfig } from '../options/loadConfig.js';\nimport { resolveOptions } from '../options/resolveOptions.js';\nimport type { CliOptions } from '../options/types.js';\n\n/**\n * Register learnosity-to-qti command\n */\nexport function registerLearnosityToQtiCommand(program: Command, version: string): void {\n program\n .command('learnosity-to-qti')\n .description('Convert a single Learnosity item to QTI')\n .option('--in <path>', 'Input file path or \"-\" for stdin')\n .option('--out <path>', 'Output file path or \"-\" for stdout')\n .option('--qti-version <version>', 'QTI version (2.1 or 2.2, default: 2.2)')\n .option(\n '--custom-asset-url <url>',\n 'Base URL/prefix for image/audio/video asset references, replacing everything up to the filename (default: ./assets)'\n )\n .option(\n '--output-format <format>',\n 'Output format (dir|zip|stdout, default: auto-detect from output path)'\n )\n .option(\n '--diagnostics <mode>',\n 'Diagnostics output (stderr|file|both|none, default: file for file output, stderr for stdout)'\n )\n .option('--fail-on-warn', 'Exit with error code 1 if warnings exist (default: false)')\n .option('--config <path>', 'Path to config file')\n .option('--no-config', 'Disable config file loading')\n .option('-i, --interactive', 'Enable interactive prompts (default: false)')\n .option('--verbose', 'Verbose output (default: false)')\n .option('--pretty', 'Pretty-print JSON output (default: false)')\n .option('-q, --quiet', 'Suppress non-essential output (default: false)')\n .option(\n '--include-learnosity-source',\n 'Copy input file to source/ folder alongside output (default: false)'\n )\n .action(async (opts: CliOptions) => {\n await executeLearnosityToQti(opts, version);\n });\n}\n\nasync function copySourceFile(inputPath: string, outputPath: string): Promise<void> {\n const outputDir = dirname(outputPath);\n\n // Both paths are CLI arguments the operator chose. 'source' is a literal and\n // basename() strips any directory part of inputPath, so the copy stays inside\n // the requested output directory.\n // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal, javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal\n const sourceDir = join(outputDir, 'source');\n\n await mkdir(sourceDir, { recursive: true });\n // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal, javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal\n await copyFile(inputPath, join(sourceDir, basename(inputPath)));\n}\n\n/**\n * Execute learnosity-to-qti conversion\n */\nasync function executeLearnosityToQti(cliOpts: CliOptions, version: string): Promise<void> {\n const allDiagnostics: Diagnostic[] = [];\n const quiet = cliOpts.quiet ?? false;\n\n try {\n showBanner('learnosity-to-qti', version, quiet);\n\n // Load config\n const {\n config,\n diagnostics: configDiagnostics,\n configPath,\n } = await loadConfig(cliOpts.config, cliOpts.noConfig);\n\n allDiagnostics.push(...configDiagnostics);\n\n // Check for config errors\n const configErrors = configDiagnostics.filter((d) => d.level === 'error');\n\n if (configErrors.length > 0) {\n console.log('\\n' + formatDiagnosticsTable(configDiagnostics));\n process.exit(1);\n }\n\n // Resolve options\n const {\n options: resolved,\n diagnostics: resolveDiagnostics,\n withSources,\n } = await resolveOptions(cliOpts, config, false, configPath);\n\n allDiagnostics.push(...resolveDiagnostics);\n\n // Show resolved options\n showResolvedOptions(resolved, withSources, quiet);\n\n const progress = new ProgressTracker(resolved.verbose);\n\n // Read and parse input\n progress.startStage('Reading input...');\n const inputText = await readInput(resolved.inputPath);\n const input = parseJsonInput(inputText);\n\n progress.succeedStage('Input read');\n\n // Convert\n progress.startStage('Converting Learnosity to QTI...');\n const conversionOpts: ConversionOptions = {\n qtiVersion: resolved.qtiVersion,\n outputFormat: resolved.outputFormat,\n diagnostics: resolved.diagnostics,\n verbose: resolved.verbose,\n pretty: resolved.pretty,\n customAssetUrl: resolved.customAssetUrl,\n };\n const result = await convertLearnosityToQti(input, conversionOpts);\n\n // Set diagnostics file to input filename only\n const inputFilename = resolved.inputPath.split('/').pop() ?? resolved.inputPath;\n const prefixedDiagnostics = result.diagnostics.map((d) => ({\n ...d,\n file: inputFilename,\n }));\n\n allDiagnostics.push(...prefixedDiagnostics);\n progress.succeedStage('Conversion complete');\n\n // Check for errors before writing output\n const errorCount = countErrors(allDiagnostics);\n\n if (errorCount > 0) {\n progress.failStage('Conversion failed');\n console.log('\\n' + formatDiagnosticsTable(allDiagnostics));\n process.exit(1);\n }\n\n // Write output only if no errors\n if (result.output) {\n progress.startStage('Writing output...');\n await writeOutput(resolved.outputPath, result.output, resolved.pretty);\n progress.succeedStage('Output written');\n }\n\n // Copy source file if requested\n if (\n cliOpts.includeLearnositySource &&\n resolved.inputPath !== '-' &&\n resolved.outputPath !== '-'\n ) {\n progress.startStage('Copying source file...');\n await copySourceFile(resolved.inputPath, resolved.outputPath);\n progress.succeedStage('Source file copied');\n }\n\n // Write diagnostics\n if (resolved.diagnostics !== 'none') {\n progress.startStage('Writing diagnostics...');\n const hasErrors = allDiagnostics.some((d) => d.level === 'error');\n\n await writeDiagnostics(\n allDiagnostics,\n resolved.diagnostics,\n resolved.diagnosticsPath,\n resolved.outputPath,\n resolved.verbose,\n {\n inputPath: resolved.inputPath,\n outputPath: resolved.outputPath,\n totalItemsFound: 1,\n convertedFiles: hasErrors ? [] : [inputFilename],\n failedFiles: hasErrors ? [inputFilename] : [],\n }\n );\n progress.succeedStage('Diagnostics written');\n }\n\n // Display diagnostics table only if mode is stderr or both\n if (resolved.diagnostics === 'stderr' || resolved.diagnostics === 'both') {\n console.log('\\n' + formatDiagnosticsTable(allDiagnostics));\n }\n\n // Check for warnings if fail-on-warn\n const warningCount = allDiagnostics.filter((d) => d.level === 'warning').length;\n\n if (warningCount > 0 && cliOpts.failOnWarn) {\n process.stderr.write(\n `\\n${warningCount} warning(s) found - exiting with error (--fail-on-warn)\\n`\n );\n process.exit(1);\n }\n\n process.exit(0);\n } catch (error) {\n if (error instanceof Error && error.name === 'ExitPromptError') {\n process.exit(130);\n }\n console.error('\\n' + (error instanceof Error ? error.message : 'Unknown error'));\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,+BAA+B,SAAkB,SAAuB;CACpF,QACK,QAAQ,mBAAmB,CAAC,CAC5B,YAAY,yCAAyC,CAAC,CACtD,OAAO,eAAe,oCAAkC,CAAC,CACzD,OAAO,gBAAgB,sCAAoC,CAAC,CAC5D,OAAO,2BAA2B,wCAAwC,CAAC,CAC3E,OACG,4BACA,qHACJ,CAAC,CACA,OACG,4BACA,uEACJ,CAAC,CACA,OACG,wBACA,8FACJ,CAAC,CACA,OAAO,kBAAkB,2DAA2D,CAAC,CACrF,OAAO,mBAAmB,qBAAqB,CAAC,CAChD,OAAO,eAAe,6BAA6B,CAAC,CACpD,OAAO,qBAAqB,6CAA6C,CAAC,CAC1E,OAAO,aAAa,iCAAiC,CAAC,CACtD,OAAO,YAAY,2CAA2C,CAAC,CAC/D,OAAO,eAAe,gDAAgD,CAAC,CACvE,OACG,+BACA,qEACJ,CAAC,CACA,OAAO,OAAO,SAAqB;EAChC,MAAM,uBAAuB,MAAM,OAAO;CAC9C,CAAC;AACT;AAEA,eAAe,eAAe,WAAmB,YAAmC;CAChF,MAAM,YAAY,QAAQ,UAAU;CAMpC,MAAM,YAAY,KAAK,WAAW,QAAQ;CAE1C,MAAM,MAAM,WAAW,EAAE,WAAW,KAAK,CAAC;CAE1C,MAAM,SAAS,WAAW,KAAK,WAAW,SAAS,SAAS,CAAC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B;AACJ"}
|
package/packages/cli/dist/{learnosityToQtiPackage-Bwzm-uLX.js → learnosityToQtiPackage-CMOQRiCV.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as useMemo, n as Separator, r as usePagination, t as dist_default$1 } from "./dist-DXDR2peT.js";
|
|
3
|
-
import { c as dist_default$2, n as loadConfig, r as showBanner, t as expandTilde } from "./pathUtils-D_VsVde8.js";
|
|
4
|
-
import { n as formatDiagnosticsSummaryTable, r as formatDiagnosticsTable, s as writeDiagnostics } from "./table-DsKq-B4-.js";
|
|
5
|
-
import { a as buildPackageFromActivity, c as saveQtiContentPackage, d as ensureUniqueFolderName, f as sanitizeFolderName, p as convertActivity, s as loadLearnosityBundle, t as processLearnosityToQtiPackage, u as mergeActivityPackage } from "./batchProcessors-C7czhqX0.js";
|
|
6
|
-
import { i as processBatchParallel, n as displayConfiguration, r as processBatch, t as configField } from "./configOutput-FwkFyQmk.js";
|
|
7
|
-
import { styleText } from "node:util";
|
|
8
|
-
import { join } from "path";
|
|
1
|
+
import { a as buildPackageFromActivity, c as saveQtiContentPackage, d as ensureUniqueFolderName, f as sanitizeFolderName, p as convertActivity, s as loadLearnosityBundle, t as processLearnosityToQtiPackage, u as mergeActivityPackage } from "./batchProcessors-BGdELwug.js";
|
|
9
2
|
import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
10
|
-
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { n as loadConfig, o as dist_default$1, r as showBanner, t as expandTilde } from "./pathUtils-I2bRHUwu.js";
|
|
5
|
+
import { i as useMemo, n as Separator, r as usePagination, t as dist_default$2 } from "./dist-D7b9-VIt.js";
|
|
6
|
+
import { _ as isEnterKey, c as usePrefix, f as useState, g as isDownKey, l as makeTheme, m as ValidationError, n as cursorHide, o as useKeypress, t as createPrompt, u as figures, v as isNumberKey, x as isUpKey, y as isSpaceKey } from "./create-prompt-C3XKo-s3.js";
|
|
7
|
+
import { styleText } from "node:util";
|
|
8
|
+
import { n as formatDiagnosticsSummaryTable, o as writeDiagnostics, r as formatDiagnosticsTable } from "./table-6SiZD7aK.js";
|
|
9
|
+
import { i as processBatchParallel, n as displayConfiguration, r as processBatch, t as configField } from "./configOutput-DYPwNQf7.js";
|
|
10
|
+
// ../../node_modules/.pnpm/@inquirer+checkbox@5.3.1_@types+node@26.6.10/node_modules/@inquirer/checkbox/dist/index.js
|
|
11
11
|
const checkboxTheme = {
|
|
12
12
|
icon: {
|
|
13
13
|
checked: styleText("green", figures.circleFilled),
|
|
@@ -101,9 +101,12 @@ var dist_default = createPrompt((config, done) => {
|
|
|
101
101
|
const [active, setActive] = useState(bounds.first);
|
|
102
102
|
const [errorMsg, setError] = useState();
|
|
103
103
|
useKeypress(async (key) => {
|
|
104
|
+
if (status !== "idle") return;
|
|
104
105
|
if (isEnterKey(key)) {
|
|
106
|
+
setStatus("loading");
|
|
105
107
|
const selection = items.filter(isChecked);
|
|
106
108
|
const isValid = await validate([...selection]);
|
|
109
|
+
setStatus("idle");
|
|
107
110
|
if (required && !selection.length) setError("At least one choice must be selected");
|
|
108
111
|
else if (isValid === true) {
|
|
109
112
|
setStatus("done");
|
|
@@ -130,9 +133,12 @@ var dist_default = createPrompt((config, done) => {
|
|
|
130
133
|
}
|
|
131
134
|
} else if (key.name === shortcuts.all) {
|
|
132
135
|
const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
|
|
136
|
+
setError(void 0);
|
|
133
137
|
setItems(items.map(check(selectAll)));
|
|
134
|
-
} else if (key.name === shortcuts.invert)
|
|
135
|
-
|
|
138
|
+
} else if (key.name === shortcuts.invert) {
|
|
139
|
+
setError(void 0);
|
|
140
|
+
setItems(items.map(toggle));
|
|
141
|
+
} else if (isNumberKey(key)) {
|
|
136
142
|
const selectedIndex = Number(key.name) - 1;
|
|
137
143
|
let selectableIndex = -1;
|
|
138
144
|
const position = items.findIndex((item) => {
|
|
@@ -141,9 +147,13 @@ var dist_default = createPrompt((config, done) => {
|
|
|
141
147
|
return selectableIndex === selectedIndex;
|
|
142
148
|
});
|
|
143
149
|
const selectedItem = items[position];
|
|
144
|
-
if (selectedItem &&
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
if (selectedItem && !Separator.isSeparator(selectedItem)) {
|
|
151
|
+
if (selectedItem.disabled) setError(theme.i18n.disabledError);
|
|
152
|
+
else {
|
|
153
|
+
setError(void 0);
|
|
154
|
+
setActive(position);
|
|
155
|
+
setItems(items.map((choice, i) => i === position ? toggle(choice) : choice));
|
|
156
|
+
}
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
159
|
});
|
|
@@ -190,8 +200,7 @@ var dist_default = createPrompt((config, done) => {
|
|
|
190
200
|
helpLine
|
|
191
201
|
].filter(Boolean).join("\n").trimEnd()}${cursorHide}`;
|
|
192
202
|
});
|
|
193
|
-
|
|
194
|
-
//#region src/commands/learnosityToQtiPackage.ts
|
|
203
|
+
// src/commands/learnosityToQtiPackage.ts
|
|
195
204
|
/**
|
|
196
205
|
* Register learnosity-to-qti-package command
|
|
197
206
|
*/
|
|
@@ -210,7 +219,7 @@ function parseDiagnosticsMode(cliValue) {
|
|
|
210
219
|
}
|
|
211
220
|
async function resolveInputPath(cliIn, interactive) {
|
|
212
221
|
let bundleDir = cliIn;
|
|
213
|
-
if (!bundleDir && interactive) bundleDir = await dist_default$
|
|
222
|
+
if (!bundleDir && interactive) bundleDir = await dist_default$1({ message: "Input bundle directory path:" });
|
|
214
223
|
if (!bundleDir) {
|
|
215
224
|
console.error("Error: --in is required. Use --in <path> or -i/--interactive.");
|
|
216
225
|
process.exit(1);
|
|
@@ -219,7 +228,7 @@ async function resolveInputPath(cliIn, interactive) {
|
|
|
219
228
|
}
|
|
220
229
|
async function resolveOutputPath(cliOut, interactive) {
|
|
221
230
|
let outputPath = cliOut;
|
|
222
|
-
if (!outputPath && interactive) outputPath = await dist_default$
|
|
231
|
+
if (!outputPath && interactive) outputPath = await dist_default$1({ message: "Output package path (.zip or directory):" });
|
|
223
232
|
if (!outputPath) {
|
|
224
233
|
console.error("Error: --out is required. Use --out <path> or -i/--interactive.");
|
|
225
234
|
process.exit(1);
|
|
@@ -228,7 +237,7 @@ async function resolveOutputPath(cliOut, interactive) {
|
|
|
228
237
|
}
|
|
229
238
|
async function resolveQtiVersion(cliVersion, interactive, configVersion) {
|
|
230
239
|
let qtiVersion = cliVersion || configVersion || "2.2";
|
|
231
|
-
if (interactive && !cliVersion && !configVersion) qtiVersion = await dist_default$
|
|
240
|
+
if (interactive && !cliVersion && !configVersion) qtiVersion = await dist_default$2({
|
|
232
241
|
message: "QTI version:",
|
|
233
242
|
choices: [{
|
|
234
243
|
value: "2.2",
|
|
@@ -630,7 +639,6 @@ async function executeBatchLearnosityToQtiPackage(opts) {
|
|
|
630
639
|
processPackage: (pkg, packageOutputPath, options) => processLearnosityToQtiPackage(pkg, packageOutputPath, options, quiet)
|
|
631
640
|
});
|
|
632
641
|
}
|
|
633
|
-
//#endregion
|
|
634
642
|
export { registerLearnosityToQtiPackageCommand };
|
|
635
643
|
|
|
636
|
-
//# sourceMappingURL=learnosityToQtiPackage-
|
|
644
|
+
//# sourceMappingURL=learnosityToQtiPackage-CMOQRiCV.js.map
|