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7CvF,IAAIG,EAAsBvD,EAAoBQ,OAAEzI,EAAW,CAAC,KAAK,IAAOiI,EAAoB,QAC5FuD,EAAsBvD,EAAoBQ,EAAE+C,E","sources":["webpack://web/webpack/runtime/chunk loaded","webpack://web/webpack/runtime/create fake namespace object","webpack://web/./src/terminal/command.ts","webpack://web/./src/terminal/commands/aws/aws.s3.details.ts","webpack://web/./src/terminal/commands/aws/aws.s3.ls.ts","webpack://web/./src/terminal/commands/aws/aws.s3.ts","webpack://web/./src/terminal/commands/aws/aws.ts","webpack://web/./src/terminal/commands/clear/clear.ts","webpack://web/./src/utils/lru.ts","webpack://web/./src/utils/trie.ts","webpack://web/./src/terminal/terminal.module.scss?5098","webpack://web/./src/terminal/index.ts","webpack://web/./src/terminal/terminal.ts","webpack://web/webpack/bootstrap","webpack://web/webpack/runtime/amd options","webpack://web/webpack/runtime/compat get default export","webpack://web/webpack/runtime/define property getters","webpack://web/webpack/runtime/hasOwnProperty shorthand","webpack://web/webpack/runtime/make namespace object","webpack://web/webpack/runtime/runtimeId","webpack://web/webpack/runtime/jsonp chunk loading","webpack://web/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","import type { Terminal } from \"./terminal\";\ninterface ActionParams {\n args?: Map;\n input?: string;\n terminal?: Terminal;\n}\n\nexport type Color = 'info' | 'warning' | 'error' | 'success' | 'input';\n\nexport interface FormattedString {\n text: string;\n color?: Color;\n padding?: number;\n}\n\nexport type Output = string | FormattedString;\n\nexport type Action = (params: ActionParams) => Promise | void;\n\ninterface CommandProps {\n id: string;\n action?: Action;\n commands?: Command[];\n}\n\nexport class Command {\n private _id: string;\n private _commands: Map = new Map();\n private _action: Action;\n private _options: Map;\n\n constructor({ id, action, commands }: CommandProps) {\n this._id = id;\n this._action = action;\n\n // Add sub-commands\n commands?.forEach(command => {\n this._commands.set(command.id, command);\n });\n }\n\n get id(): string {\n return this._id;\n }\n\n get commands(): Map {\n return this._commands;\n }\n\n get action(): Action {\n return this._action;\n }\n}\n\n\n","import type { Action, FormattedString } from \"../../command\";\nimport { Command } from \"../../command\";\n\nconst action: Action = async ({ args, input: bucketName, terminal }) => {\n try {\n const verbose = args.has('-v') || args.has('--verbose');\n\n while (!bucketName?.length) {\n bucketName = await terminal.readLine('bucket name:');\n }\n\n if (verbose) {\n return [`Bucket name is ${bucketName}`];\n } else {\n return [`Bucket: ${bucketName}`];\n }\n\n } catch (error: unknown) {\n const errorMessage: FormattedString = {\n text: error as string,\n color: 'error'\n }\n\n return [errorMessage];\n }\n}\n\nexport const aws_s3_details = new Command({\n id: 'details',\n action\n});","import { Command } from \"../../command\";\n\nexport const aws_s3_ls = new Command({\n id: 'ls',\n action: async () => { return ['executed aws s3 ls command successfully!']; }\n});","import { Command } from \"../../command\";\nimport { aws_s3_details } from \"./aws.s3.details\";\nimport { aws_s3_ls } from \"./aws.s3.ls\";\n\nexport const aws_s3 = new Command({\n id: 's3',\n commands: [aws_s3_ls, aws_s3_details]\n});","import { Command } from \"../../command\";\nimport { aws_s3 } from \"./aws.s3\";\n\nexport const aws = new Command({\n id: 'aws',\n commands: [aws_s3]\n});\n","import type { Action} from \"../../command\";\nimport { Command } from \"../../command\";\n\nconst action: Action = ({ terminal }) => {\n terminal.clearHistory();\n}\n\nexport const clear = new Command({ id: 'clear', action });","export class LinkedListItem {\n value: string;\n next?: LinkedListItem;\n prev?: LinkedListItem;\n\n constructor(value: string) {\n this.value = value;\n }\n}\n\nexport class LRU {\n private _head: LinkedListItem;\n private _tail?: LinkedListItem;\n private _map: Map = new Map();\n private _size: number;\n\n constructor(size: number = 999) {\n const dummyHead = new LinkedListItem(\"\");\n\n this._head = dummyHead;\n\n this._size = size;\n }\n\n add(value: string) {\n const item = this._map.get(value);\n if (item) {\n if (item.prev) {\n item.prev.next = item.next;\n }\n\n if (item.next) {\n item.next.prev = item.prev;\n } else {\n this._tail = item.prev;\n }\n\n if (this._head.next) {\n item.next = this._head.next;\n this._head.next.prev = item;\n }\n\n item.prev = this._head;\n this._head.next = item;\n } else {\n const item = new LinkedListItem(value);\n\n if (!this._tail) {\n this._tail = item;\n }\n\n if (this._head.next) {\n this._head.next.prev = item;\n item.next = this._head.next;\n }\n\n item.prev = this._head;\n this._head.next = item;\n\n this._map.set(value, item);\n\n if (this._map.size > this._size) {\n this._map.delete(this._tail?.value);\n\n this._tail = this._tail?.prev;\n\n if (this._tail?.next) {\n this._tail.next.prev = undefined;\n }\n\n if (this._tail) {\n this._tail.next = undefined;\n }\n }\n }\n }\n\n get head() {\n return this._head;\n }\n\n get tail() {\n return this._tail;\n }\n}\n","class TrieNode {\n children: Map;\n isEndOfWord: boolean;\n\n constructor() {\n this.children = new Map();\n this.isEndOfWord = false;\n }\n}\n\nexport class Trie {\n private root: TrieNode;\n\n constructor() {\n this.root = new TrieNode();\n }\n\n insert(word: string): void {\n let node = this.root;\n for (const char of word) {\n if (!node.children.has(char)) {\n node.children.set(char, new TrieNode());\n }\n node = node.children.get(char);\n }\n node.isEndOfWord = true;\n }\n\n // Retrieve suggestions based on the given prefix\n getSuggestions(prefix: string, stopChar?: string): string[] {\n const suggestions: string[] = [];\n const node = this.traverse(prefix);\n if (node) {\n this.collectWords(node, prefix, suggestions, stopChar);\n }\n return suggestions;\n }\n\n // Helper to traverse the Trie and find the node corresponding to the prefix\n private traverse(prefix: string): TrieNode | null {\n let node = this.root;\n for (const char of prefix) {\n if (!node.children.has(char)) {\n return null;\n }\n node = node.children.get(char);\n }\n return node;\n }\n\n // Collect all words starting from the given node\n private collectWords(node: TrieNode, prefix: string, suggestions: string[], stopChar?: string): void {\n if (node.isEndOfWord) {\n suggestions.push(prefix);\n }\n\n for (const [char, childNode] of node.children) {\n if (!stopChar?.length || char !== stopChar) {\n this.collectWords(childNode, prefix + char, suggestions, stopChar);\n }\n }\n }\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"terminalApp\":\"g_dM17Ep28_UvFb_HBwr\",\"inputContainer\":\"sCCVZ5RFKok2tc56EqXc\",\"hidden\":\"fW1lmvSm6QskxTg8V1Dc\",\"prompt\":\"DGs0dIIEH0FTLrhohKW0\",\"terminalInputHint\":\"GTiIoZOE92IgtVQTtaEG\",\"terminalInput\":\"PY5rHSrPAPsnxslk4N8_\",\"error\":\"Y3GBte_U_DodjSzT2MNx\",\"info\":\"U3_oEJnfh1gaCZ3cx5zH\",\"warning\":\"ckZoGCRhM4Nhz0izjGk7\",\"input\":\"OSZLjiX5kBshvG1TFclv\",\"command\":\"ydBi3FXx088emNYVvyqc\",\"result\":\"x2zcBYqX9JoYtTyeYJcK\",\"loading\":\"Hn41m7P2fUgQb_STXREQ\",\"spin\":\"CWrCikJMV1Aqo9j6mA9Y\"};","import { aws } from './commands/aws/aws';\nimport { clear } from './commands/clear/clear';\nimport { Terminal } from './terminal';\n\nconst terminal = new Terminal('terminal-app', [aws, clear]);\nwindow.addEventListener(\"keydown\", terminal.handleKeyDown);\n\n\n","import type { LinkedListItem} from \"utils\";\nimport { LRU, Trie } from \"utils\";\nimport type { Color, Command, FormattedString, Output } from \"./command\";\nimport css from './terminal.module.scss';\n\nexport class Terminal {\n private _root: HTMLElement;\n private _history: HTMLElement;\n private _prompt: HTMLSpanElement;\n private _input: HTMLTextAreaElement;\n private _inputHint: HTMLTextAreaElement;\n\n private _commands: Map = new Map();\n private _autocomplete: Trie = new Trie();\n\n // command history\n private _commandHistory: LRU = new LRU();\n private _focusedCommand?: LinkedListItem;\n private _suggestions: string[];\n private _suggestionIndex: number;\n\n private _inputMode: boolean = false;\n private _setUserInput: (value: string) => void;\n private _cancelUserInput: (reason: string) => void;\n\n constructor(id: string, commands?: Command[]) {\n // create elements\n this._root = document.getElementById(id);\n this._root.classList.add(css.terminalApp);\n\n this._history = document.createElement('div');\n this._root.appendChild(this._history);\n\n const inputContainer = document.createElement('div');\n inputContainer.classList.add(css.inputContainer);\n this._root.appendChild(inputContainer);\n\n this._prompt = document.createElement('span');\n this._prompt.classList.add(css.prompt);\n inputContainer.appendChild(this._prompt);\n\n this._input = document.createElement('textarea');\n this._input.autofocus = true;\n this._input.setAttribute('autocapitalize', 'none');\n this._input.classList.add(css.terminalInput);\n this._input.oninput = this.onInputChange;\n inputContainer.appendChild(this._input);\n\n this._inputHint = document.createElement('textarea');\n this._inputHint.setAttribute('autocapitalize', 'none');\n this._inputHint.classList.add(css.terminalInputHint);\n inputContainer.appendChild(this._inputHint);\n\n // set commands and add to autocomplete\n commands.forEach(command => this.setCommands(command));\n\n // set prompt\n this.setPrompt('$');\n\n // trigger suggestions\n this.setInput(\"\", true);\n }\n\n private onInputChange = (event: Event) => {\n if (this._inputMode) return;\n\n const prefix = (event.target as HTMLTextAreaElement).value;\n this._suggestionIndex = -1;\n this._suggestions = null;\n\n this._suggestions = this._autocomplete.getSuggestions(prefix, \" \");\n\n // not to display suggestions if input is empty\n if (!prefix.length) {\n this._inputHint.value = \"\";\n return;\n }\n\n if (this._suggestions?.length) {\n this.setNextSuggestion();\n } else {\n this._inputHint.value = prefix;\n }\n }\n\n private setNextSuggestion() {\n this._suggestionIndex += 1;\n\n if (this._suggestionIndex > this._suggestions.length - 1) {\n this._suggestionIndex = 0;\n }\n\n this._inputHint.value = this._suggestions[this._suggestionIndex];\n }\n\n private setPrevSuggestion() {\n this._suggestionIndex -= 1;\n\n if (this._suggestionIndex < 0) {\n this._suggestionIndex = this._suggestions.length - 1;\n }\n\n this._inputHint.value = this._suggestions[this._suggestionIndex];\n }\n\n private setPrompt(value: string, color?: Color) {\n this._prompt.innerHTML = value;\n\n if (color) {\n this._prompt.className = `${css.prompt} ${css[color]}`;\n } else {\n this._prompt.className = css.prompt;\n }\n\n this._input.style.textIndent = `${value.length + 1}ch`;\n this._inputHint.style.textIndent = `${value.length + 1}ch`;\n }\n\n private appendOutput(outputs: Output[], includePrompt = false) {\n const container = document.createElement('div');\n container.classList.add(css.result);\n\n if (includePrompt) {\n container.appendChild(this._prompt.cloneNode(true));\n }\n\n const items = [];\n for (let i = 0; i < outputs.length; i++) {\n if (typeof outputs[i] === 'string') {\n const plainString = outputs[i] as string;\n items.push(this.escapeHtml(plainString));\n } else if (outputs[i] === null) {\n items.push(\" \");\n } else {\n const formattedString = outputs[i] as FormattedString;\n const attributes = [];\n const styles = [];\n if (formattedString.color) {\n attributes.push(`class=${css[formattedString.color]}`);\n }\n\n if (formattedString.padding) {\n styles.push(`padding-left: ${formattedString.padding}ch`);\n }\n\n if (styles.length) {\n const combinedStyles = styles.join(\";\");\n attributes.push(`style=\"${combinedStyles}\"`);\n }\n\n if (attributes.length) {\n const combinedAttributes = attributes.join(\" \");\n const element = `${this.escapeHtml(formattedString.text)}`;\n items.push(element);\n } else {\n items.push(this.escapeHtml(formattedString.text));\n }\n }\n }\n\n container.innerHTML += items.join(\"
\");\n this._history.appendChild(container);\n }\n\n private parseCommand(line: string): string[] {\n line = line.trim();\n if (!line.length) return [];\n\n const trimQuotes = (value: string): string => {\n if (value.startsWith('\"')) {\n value = value.slice(1);\n }\n\n if (value.endsWith('\"')) {\n value = value.slice(0, value.length - 1)\n }\n\n return value;\n }\n\n const result: string[] = [];\n let current = \"\";\n let ignoreSpace = false;\n for (let i = 0; i < line.length; i++) {\n if (!ignoreSpace && line[i] === \" \") {\n if (current.length) {\n result.push(trimQuotes(current));\n current = \"\";\n }\n\n continue;\n }\n\n // multi-line command to ignore \\ and new line\n if (line[i] === \"\\n\" && current[current.length - 1] === \"\\\\\") {\n current = current.slice(0, current.length - 1)\n continue;\n }\n\n if (line[i] === '\"') {\n if (!current.length) {\n ignoreSpace = true;\n } else if (ignoreSpace) {\n ignoreSpace = false;\n }\n }\n\n current = current + line[i];\n }\n\n if (current.length) {\n result.push(trimQuotes(current));\n }\n\n return result;\n }\n\n private async execute(line: string) {\n if (!line.trim().length) return;\n\n // add command to the history\n this._commandHistory.add(line);\n this.resetFocusedCommand();\n\n const parts = this.parseCommand(line.trim());\n\n // command not in the list of commands\n if (!this._commands.has(parts[0])) {\n this.appendOutput([{ text: `${parts[0]}: command not found`, color: 'error' }]);\n return;\n }\n\n const commandChain = [this._commands.get(parts[0])];\n const commandArgs = new Map();\n let commandInput = \"\";\n\n // find command, set options and args\n for (let i = 1; i < parts.length; i++) {\n const command = commandChain[commandChain.length - 1];\n if (command.commands?.has(parts[i])) {\n commandChain.push(command.commands.get(parts[i]));\n } else if (parts[i].startsWith('--')) {\n const indexOfEqual = parts[i].indexOf('=');\n if (indexOfEqual === -1) {\n commandArgs.set(parts[i], true);\n } else {\n commandArgs.set(parts[i].substring(0, indexOfEqual), parts[i].substring(indexOfEqual + 1));\n }\n } else if (parts[i].startsWith('-')) {\n const flags = parts[i].split('');\n for (let j = 1; j < flags.length; j++) {\n commandArgs.set(`-${flags[j]}`, true);\n }\n } else {\n commandInput = parts[i];\n }\n }\n\n // command doesn't have any action\n // you need to execute one of subcommands\n const command = commandChain[commandChain.length - 1];\n if (!command.action) {\n const fullCommand = commandChain.reduce((result, current) => result + \" \" + current.id, \"\").trim();\n const outputs: Output[] = [];\n\n outputs.push({ text: `Usage: ${fullCommand} `, color: 'info' });\n outputs.push(null);\n outputs.push({ text: 'Subcommands:', color: 'info' });\n\n for (const [key] of command.commands) {\n outputs.push({ text: key, color: 'info', padding: 2 });\n }\n\n this.appendOutput(outputs);\n return;\n }\n\n // execute command\n const outputs = await command.action({ args: commandArgs, input: commandInput, terminal: this });\n if (outputs) {\n this.appendOutput(outputs);\n }\n }\n\n private interrupt() {\n const interruptText: FormattedString = {\n text: '^C',\n color: 'error'\n };\n\n this.appendOutput([interruptText], true);\n this.setInput(\"\");\n this._cancelUserInput(\"interrupted by user!\");\n }\n\n public handleKeyDown = async (event: KeyboardEvent) => {\n const inputValue = this._input.value;\n if (event.ctrlKey && event.key === \"c\") {\n this.interrupt();\n }\n\n if (event.metaKey || event.ctrlKey || event.altKey) return;\n\n //if (terminal.isBusy()) return;\n\n if (event.key === \"ArrowUp\") {\n if (this._inputMode) return;\n\n const previousCommand = this.getPreviousCommand();\n if (previousCommand) {\n this.setInput(previousCommand, false);\n event.preventDefault();\n }\n }\n\n if (event.key === \"ArrowDown\") {\n if (this._inputMode) return;\n\n const nextCommand = this.getNextCommand();\n if (nextCommand) {\n this.setInput(nextCommand, false);\n event.preventDefault();\n }\n }\n\n if (event.key === \"ArrowRight\") {\n if (this._inputMode) return;\n\n if (this._input.value !== this._inputHint.value) {\n // if the cursor is at the end of the input\n if (this._input.selectionStart === inputValue.length) {\n this.setInput(this._inputHint.value + \" \");\n event.preventDefault();\n }\n }\n }\n\n if (event.key === \"Tab\") {\n event.preventDefault();\n\n if (this._inputMode) return;\n\n if (this._suggestions?.length) {\n if (event.shiftKey) {\n this.setPrevSuggestion();\n\n } else {\n this.setNextSuggestion();\n }\n }\n }\n\n if (event.key === \"Enter\" && !inputValue.endsWith(\"\\\\\")) {\n event.preventDefault();\n\n this.appendOutput([inputValue], true);\n\n if (this._inputMode) {\n this._setUserInput(inputValue);\n } else {\n await this.execute(inputValue);\n }\n\n this.setInput(\"\");\n }\n\n //if (terminal.shouldHideInput()) {\n // passwordInputRef.current?.focus();\n //} else {\n this._input.focus();\n //}\n };\n\n private setInput(value: string, triggerInputChange = true) {\n this._input.value = value;\n\n if (triggerInputChange) {\n const event = new Event('input', { bubbles: true });\n this._input.dispatchEvent(event);\n }\n }\n\n public clearHistory() {\n this._history.innerHTML = \"\";\n }\n\n private getPreviousCommand() {\n if (this._focusedCommand?.next) {\n this._focusedCommand = this._focusedCommand?.next;\n }\n\n return this._focusedCommand?.value;\n }\n\n private getNextCommand() {\n if (this._focusedCommand?.prev) {\n this._focusedCommand = this._focusedCommand?.prev;\n }\n\n return this._focusedCommand?.value;\n }\n\n private resetFocusedCommand() {\n this._focusedCommand = this._commandHistory.head;\n }\n\n private escapeHtml(unsafe: string) {\n return unsafe\n .replace(/&/g, \"&\")\n .replace(//g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\")\n .replace(/ /g, \" \")\n .replace(/\\\\\\n/g, \"\\\\
\")\n }\n\n private setCommands(command: Command, chain = \"\") {\n const fullCommand = chain + command.id;\n this._commands.set(fullCommand, command);\n this._autocomplete.insert(fullCommand);\n\n command.commands?.forEach(subCommand => {\n this.setCommands(subCommand, fullCommand + \" \");\n });\n }\n\n public readLine(hint: string): Promise {\n this.setPrompt(hint, 'input');\n this.setInput(\"\");\n this._inputMode = true;\n\n return new Promise((resolve, reject) => {\n this._setUserInput = (value: string) => {\n this._inputMode = false;\n this.setPrompt(\"$\");\n\n resolve(value);\n };\n\n this._cancelUserInput = (reason: string) => {\n this._inputMode = false;\n this.setPrompt(\"$\");\n\n reject(reason);\n };\n });\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.j = 547;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t547: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkweb\"] = self[\"webpackChunkweb\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [96], () => (__webpack_require__(7280)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","Command","_id","_commands","Map","_action","_options","constructor","id","action","commands","this","forEach","command","set","aws_s3_details","async","args","input","bucketName","terminal","verbose","has","length","readLine","error","text","color","aws_s3_ls","aws_s3","aws","clear","clearHistory","LinkedListItem","value","next","prev","LRU","_head","_tail","_map","_size","size","dummyHead","add","item","get","delete","undefined","head","tail","TrieNode","children","isEndOfWord","Trie","root","insert","word","node","char","getSuggestions","prefix","stopChar","suggestions","traverse","collectWords","push","childNode","_root","_history","_prompt","_input","_inputHint","_autocomplete","_commandHistory","_focusedCommand","_suggestions","_suggestionIndex","_inputMode","_setUserInput","_cancelUserInput","document","getElementById","classList","terminalApp","createElement","appendChild","inputContainer","prompt","autofocus","setAttribute","terminalInput","oninput","onInputChange","terminalInputHint","setCommands","setPrompt","setInput","event","target","setNextSuggestion","setPrevSuggestion","innerHTML","className","style","textIndent","appendOutput","outputs","includePrompt","container","result","cloneNode","items","i","plainString","escapeHtml","formattedString","attributes","styles","padding","combinedStyles","join","element","parseCommand","line","trim","trimQuotes","startsWith","slice","endsWith","current","ignoreSpace","execute","resetFocusedCommand","parts","commandChain","commandArgs","commandInput","indexOfEqual","indexOf","substring","flags","split","j","fullCommand","reduce","key","interrupt","handleKeyDown","inputValue","ctrlKey","metaKey","altKey","previousCommand","getPreviousCommand","preventDefault","nextCommand","getNextCommand","selectionStart","shiftKey","focus","triggerInputChange","Event","bubbles","dispatchEvent","unsafe","replace","chain","subCommand","hint","Promise","resolve","reject","reason","window","addEventListener","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","m","amdO","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","splice","r","n","getter","__esModule","d","a","getPrototypeOf","obj","t","mode","then","ns","create","def","getOwnPropertyNames","definition","o","defineProperty","enumerable","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","bind","__webpack_exports__"],"sourceRoot":""}