{"version":3,"sources":["jsdelivr-header.js","/npm/ink-password-input@2.0.0/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,EAAE,EAAC,MAAE,MAAK,UAAE,WAAc,QAAQ,OAClC,UAAY,QAAQ,cACpB,QAAU,QAAQ,YAElB,KAAO,OAEb,MAAM,sBAAsB,UAC3B,WAAA,CAAY,GACX,MAAM,GAEN,KAAK,eAAiB,KAAK,eAAe,KAAK,KAChD,CAEA,MAAA,EAAO,MAAE,EAAK,KAAE,EAAI,YAAE,IACrB,MAAM,EAAW,EAAM,OAAS,EAC1B,EAAc,EAAK,OAAO,EAAM,QAEtC,OAAO,EACN,MACA,CAAE,KAAM,GACR,EAAW,EAAc,EAE3B,CAEA,iBAAA,GACC,QAAQ,MAAM,GAAG,WAAY,KAAK,eACnC,CAEA,oBAAA,GACC,QAAQ,MAAM,eAAe,WAAY,KAAK,eAC/C,CAEA,cAAA,CAAe,EAAI,GAClB,GAAI,QAAQ,EAAI,UACf,OAGD,MAAM,MAAE,EAAK,SAAE,EAAQ,SAAE,GAAa,KAAK,MAE1B,WAAb,EAAI,KAKS,cAAb,EAAI,MAKS,UAAb,EAAI,MAAoB,EAAI,WAAa,GAAM,OAAO,KAAK,KAAQ,EAAI,OAC1E,EAAS,EAAQ,GALjB,EAAS,EAAM,MAAM,GAAI,IALzB,EAAS,EAYX,EAGD,cAAc,UAAY,CACzB,MAAO,UAAU,OACjB,KAAM,UAAU,OAChB,YAAa,UAAU,OACvB,SAAU,UAAU,KACpB,SAAU,UAAU,MAGrB,cAAc,aAAe,CAC5B,MAAO,GACP,KAAM,IACN,YAAa,GACb,SAAU,KACV,SAAU,MAGX,OAAO,QAAU","file":"/npm/ink-password-input@2.0.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ink-password-input@2.0.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nconst { h, Color, Component } = require('ink');\nconst PropTypes = require('prop-types');\nconst hasAnsi = require('has-ansi');\n\nconst noop = () => {};\n\nclass PasswordInput extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.handleKeyPress = this.handleKeyPress.bind(this);\n\t}\n\n\trender({ value, mask, placeholder }) {\n\t\tconst hasValue = value.length > 0;\n\t\tconst maskedValue = mask.repeat(value.length);\n\n\t\treturn h(\n\t\t\tColor,\n\t\t\t{ dim: !hasValue },\n\t\t\thasValue ? maskedValue : placeholder\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tprocess.stdin.on('keypress', this.handleKeyPress);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tprocess.stdin.removeListener('keypress', this.handleKeyPress);\n\t}\n\n\thandleKeyPress(ch, key) {\n\t\tif (hasAnsi(key.sequence)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { value, onChange, onSubmit } = this.props;\n\n\t\tif (key.name === 'return') {\n\t\t\tonSubmit(value);\n\t\t\treturn;\n\t\t}\n\n\t\tif (key.name === 'backspace') {\n\t\t\tonChange(value.slice(0, -1));\n\t\t\treturn;\n\t\t}\n\n\t\tif (key.name === 'space' || key.sequence === ch && /^.*$/.test(ch) && !key.ctrl) {\n\t\t\tonChange(value + ch);\n\t\t}\n\t}\n}\n\nPasswordInput.propTypes = {\n\tvalue: PropTypes.string,\n\tmask: PropTypes.string,\n\tplaceholder: PropTypes.string,\n\tonChange: PropTypes.func,\n\tonSubmit: PropTypes.func\n};\n\nPasswordInput.defaultProps = {\n\tvalue: '',\n\tmask: '*',\n\tplaceholder: '',\n\tonChange: noop,\n\tonSubmit: noop\n};\n\nmodule.exports = PasswordInput;"]}