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EAAU,QACpB,IAAK,IAAI,KAAc,EAAU,QAC5B,EAAU,QAAQ,eAAe,IACpC,KAAK,WAAW,UAAU,EAAY,EAAU,QAAQ,GAI5D,EACA,cAAe,WACd,OAAO,KAAK,UACb,EACA,MAAO,WACF,KAAK,YACR,KAAK,WAAW,OAElB,EACA,aAAc,SAAsB,GACnC,KAAK,SAAS,CACb,UAAW,IAEZ,KAAK,MAAM,eAAiB,KAAK,MAAM,cAAc,EACtD,EACA,cAAe,SAAuB,GACrC,KAAK,MAAM,UAAY,KAAK,MAAM,SAAS,EAAG,gBAC/C,EACA,uBAAwB,SAAgC,EAAK,GACxD,KAAK,MAAM,UAA8B,aAAlB,EAAO,QACjC,KAAK,MAAM,SAAS,EAAI,WAE1B,EACA,OAAQ,WACP,IAAI,EAAkB,UAAU,kBAAmB,KAAK,MAAM,UAAY,2BAA6B,KAAM,KAAK,MAAM,WACxH,OAAO,MAAM,cACZ,MACA,CAAE,UAAW,GACb,MAAM,cAAc,WAAY,CAAE,IAAK,WAAY,KAAM,KAAK,MAAM,KAAM,aAAc,KAAK,MAAM,MAAO,aAAc,QAE1H,IAGD,OAAO,QAAU","file":"/npm/react-codemirror-sql@0.0.2/lib/Codemirror.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-codemirror-sql@0.0.2/lib/Codemirror.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\nvar React = require('react');\nvar ReactDOM = require('react-dom-polyfill')(React);\nvar findDOMNode = ReactDOM.findDOMNode;\nvar className = require('classnames');\nvar debounce = require('lodash.debounce');\n\nvar CodeMirror = React.createClass({\n\tdisplayName: 'CodeMirror',\n\n\tpropTypes: {\n\t\tclassName: React.PropTypes.any,\n\t\tcodeMirrorInstance: React.PropTypes.func,\n\t\tdefaultValue: React.PropTypes.string,\n\t\tonChange: React.PropTypes.func,\n\t\tonFocusChange: React.PropTypes.func,\n\t\tonScroll: React.PropTypes.func,\n\t\toptions: React.PropTypes.object,\n\t\tpath: React.PropTypes.string,\n\t\tvalue: React.PropTypes.string\n\t},\n\tgetCodeMirrorInstance: function getCodeMirrorInstance() {\n\t\treturn this.props.codeMirrorInstance || require('codemirror-sql');\n\t},\n\tgetInitialState: function getInitialState() {\n\t\treturn {\n\t\t\tisFocused: false\n\t\t};\n\t},\n\tcomponentWillMount: function componentWillMount() {\n\t\tthis.componentWillReceiveProps = debounce(this.componentWillReceiveProps, 0);\n\t},\n\tcomponentDidMount: function componentDidMount() {\n\t\tvar textareaNode = findDOMNode(this.refs.textarea);\n\t\tvar codeMirrorInstance = this.getCodeMirrorInstance();\n\t\tthis.codeMirror = codeMirrorInstance.fromTextArea(textareaNode, this.props.options);\n\t\tthis.codeMirror.on('change', this.codemirrorValueChanged);\n\t\tthis.codeMirror.on('focus', this.focusChanged.bind(this, true));\n\t\tthis.codeMirror.on('blur', this.focusChanged.bind(this, false));\n\t\tthis.codeMirror.on('scroll', this.scrollChanged);\n\t\tthis.codeMirror.setValue(this.props.defaultValue || this.props.value || '');\n\t},\n\tcomponentWillUnmount: function componentWillUnmount() {\n\t\t// is there a lighter-weight way to remove the cm instance?\n\t\tif (this.codeMirror) {\n\t\t\tthis.codeMirror.toTextArea();\n\t\t}\n\t},\n\tcomponentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n\t\tif (this.codeMirror && nextProps.value !== undefined && this.codeMirror.getValue() !== nextProps.value) {\n\t\t\tthis.codeMirror.setValue(nextProps.value);\n\t\t}\n\t\tif (typeof nextProps.options === 'object') {\n\t\t\tfor (var optionName in nextProps.options) {\n\t\t\t\tif (nextProps.options.hasOwnProperty(optionName)) {\n\t\t\t\t\tthis.codeMirror.setOption(optionName, nextProps.options[optionName]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tgetCodeMirror: function getCodeMirror() {\n\t\treturn this.codeMirror;\n\t},\n\tfocus: function focus() {\n\t\tif (this.codeMirror) {\n\t\t\tthis.codeMirror.focus();\n\t\t}\n\t},\n\tfocusChanged: function focusChanged(focused) {\n\t\tthis.setState({\n\t\t\tisFocused: focused\n\t\t});\n\t\tthis.props.onFocusChange && this.props.onFocusChange(focused);\n\t},\n\tscrollChanged: function scrollChanged(cm) {\n\t\tthis.props.onScroll && this.props.onScroll(cm.getScrollInfo());\n\t},\n\tcodemirrorValueChanged: function codemirrorValueChanged(doc, change) {\n\t\tif (this.props.onChange && change.origin !== 'setValue') {\n\t\t\tthis.props.onChange(doc.getValue());\n\t\t}\n\t},\n\trender: function render() {\n\t\tvar editorClassName = className('ReactCodeMirror', this.state.isFocused ? 'ReactCodeMirror--focused' : null, this.props.className);\n\t\treturn React.createElement(\n\t\t\t'div',\n\t\t\t{ className: editorClassName },\n\t\t\tReact.createElement('textarea', { ref: 'textarea', name: this.props.path, defaultValue: this.props.value, autoComplete: 'off' })\n\t\t);\n\t}\n});\n\nmodule.exports = CodeMirror;\n"]}