@khanacademy/perseus-editor 0.0.1 → 0.1.0
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/.babelrc.js +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/es/index.js +10 -1
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/strings.js +6 -1
- package/package.json +16 -4
- package/src/README.md +7 -0
- package/src/__stories__/editor.stories.js +33 -0
- package/src/__stories__/section-control-button.stories.jsx +27 -0
- package/src/__testdata__/input-number_testdata.js +28 -0
- package/src/__tests__/editor_test.jsx +123 -0
- package/src/__tests__/i18n_test.jsx +585 -0
- package/src/__tests__/traversal_test.jsx +378 -0
- package/src/all-editors.js +85 -0
- package/src/all-editors_test.js +17 -0
- package/src/all-widgets.js +10 -0
- package/src/article-editor.jsx +437 -0
- package/src/components/__stories__/blur-input.stories.jsx +24 -0
- package/src/components/blur-input.jsx +62 -0
- package/src/components/checkbox.jsx +194 -0
- package/src/components/device-framer.jsx +91 -0
- package/src/components/drag-target.jsx +88 -0
- package/src/components/dropdown-option.jsx +318 -0
- package/src/components/form-wrapped-text-field.jsx +248 -0
- package/src/components/graph-settings.jsx +631 -0
- package/src/components/hover-behavior.jsx +178 -0
- package/src/components/json-editor.jsx +118 -0
- package/src/components/link.jsx +173 -0
- package/src/components/simple-button.jsx +86 -0
- package/src/components/sortable.jsx +186 -0
- package/src/components/util.js +39 -0
- package/src/components/viewport-resizer.jsx +73 -0
- package/src/diffs/__stories__/perseus-diff-wrapper.jsx +8 -0
- package/src/diffs/__stories__/structured-item-diff.stories.jsx +855 -0
- package/src/diffs/__stories__/tags-diff.stories.jsx +38 -0
- package/src/diffs/__stories__/text-diff.stories.jsx +37 -0
- package/src/diffs/__tests__/split-diff_test.js +34 -0
- package/src/diffs/__tests__/string-array-diff_test.js +74 -0
- package/src/diffs/__tests__/structured-item-diff_test.js +432 -0
- package/src/diffs/__tests__/widget-diff-performer_test.js +44 -0
- package/src/diffs/article-diff.jsx +70 -0
- package/src/diffs/item-diff.jsx +77 -0
- package/src/diffs/renderer-diff.jsx +143 -0
- package/src/diffs/split-diff.jsx +30 -0
- package/src/diffs/string-array-diff.jsx +74 -0
- package/src/diffs/structured-item-diff.jsx +269 -0
- package/src/diffs/tags-diff.jsx +50 -0
- package/src/diffs/text-diff.jsx +193 -0
- package/src/diffs/widget-diff-performer.jsx +74 -0
- package/src/diffs/widget-diff.jsx +291 -0
- package/src/editor-page.jsx +351 -0
- package/src/editor.jsx +1364 -0
- package/src/hint-editor.jsx +447 -0
- package/src/i18n.jsx +139 -0
- package/src/iframe-content-renderer.jsx +201 -0
- package/src/index.js +27 -8
- package/src/item-editor.jsx +159 -0
- package/src/item-extras-editor.jsx +150 -0
- package/src/katex-error-view.jsx +87 -0
- package/src/multirenderer-editor.jsx +1073 -0
- package/src/section-control-button.jsx +53 -0
- package/src/stateful-article-editor.jsx +176 -0
- package/src/stateful-editor-page.jsx +90 -0
- package/src/styles/perseus-editor.less +1339 -0
- package/src/testing-widgets.js +12 -0
- package/src/util/register-all-widgets-and-editors-for-testing.js +15 -0
- package/src/util/register-all-widgets-and-editors-for-testing_test.js +18 -0
- package/src/widgets/__stories__/label-image-editor.stories.jsx +97 -0
- package/src/widgets/categorizer-editor.jsx +103 -0
- package/src/widgets/cs-program-editor.jsx +258 -0
- package/src/widgets/definition-editor.jsx +76 -0
- package/src/widgets/dropdown-editor.jsx +201 -0
- package/src/widgets/example-graphie-widget-editor.jsx +70 -0
- package/src/widgets/example-graphie-widget.jsx +175 -0
- package/src/widgets/example-widget-editor.jsx +60 -0
- package/src/widgets/example-widget.jsx +153 -0
- package/src/widgets/explanation-editor.jsx +89 -0
- package/src/widgets/expression-editor.jsx +559 -0
- package/src/widgets/graded-group-editor.jsx +162 -0
- package/src/widgets/graded-group-set-editor.jsx +101 -0
- package/src/widgets/grapher-editor.jsx +154 -0
- package/src/widgets/group-editor.jsx +83 -0
- package/src/widgets/iframe-editor.jsx +200 -0
- package/src/widgets/image-editor.jsx +326 -0
- package/src/widgets/input-number-editor.jsx +269 -0
- package/src/widgets/interaction/constraint-editor.jsx +147 -0
- package/src/widgets/interaction-editor.jsx +1388 -0
- package/src/widgets/interactive-graph-editor.jsx +320 -0
- package/src/widgets/label-image/__stories__/answer-choices.stories.jsx +81 -0
- package/src/widgets/label-image/__stories__/behavior.stories.jsx +32 -0
- package/src/widgets/label-image/__stories__/marker.stories.jsx +76 -0
- package/src/widgets/label-image/__stories__/question-markers.stories.jsx +106 -0
- package/src/widgets/label-image/__stories__/select-image.stories.jsx +60 -0
- package/src/widgets/label-image/answer-choices.jsx +231 -0
- package/src/widgets/label-image/behavior.jsx +92 -0
- package/src/widgets/label-image/marker.jsx +292 -0
- package/src/widgets/label-image/question-markers.jsx +181 -0
- package/src/widgets/label-image/select-image.jsx +86 -0
- package/src/widgets/label-image-editor.jsx +256 -0
- package/src/widgets/lights-puzzle-editor.jsx +267 -0
- package/src/widgets/matcher-editor.jsx +147 -0
- package/src/widgets/matrix-editor.jsx +155 -0
- package/src/widgets/measurer-editor.jsx +245 -0
- package/src/widgets/molecule-editor.jsx +63 -0
- package/src/widgets/number-line-editor.jsx +498 -0
- package/src/widgets/numeric-input-editor.jsx +554 -0
- package/src/widgets/orderer-editor.jsx +166 -0
- package/src/widgets/passage-editor.jsx +115 -0
- package/src/widgets/passage-ref-editor.jsx +77 -0
- package/src/widgets/passage-ref-target-editor.jsx +47 -0
- package/src/widgets/plotter-editor.jsx +537 -0
- package/src/widgets/radio/editor.jsx +399 -0
- package/src/widgets/reaction-diagram-editor.jsx +126 -0
- package/src/widgets/sequence-editor.jsx +205 -0
- package/src/widgets/simple-markdown-tester-editor.jsx +84 -0
- package/src/widgets/simple-markdown-tester.jsx +91 -0
- package/src/widgets/simulator-editor.jsx +144 -0
- package/src/widgets/sorter-editor.jsx +100 -0
- package/src/widgets/table-editor.jsx +164 -0
- package/src/widgets/transformer-editor.jsx +1006 -0
- package/src/widgets/unit-editor.jsx +293 -0
- package/src/widgets/video-editor.jsx +74 -0
- package/src/__tests__/index.test.js +0 -15
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.js"],"sourcesContent":["// @flow\nimport {foo} from \"@khanacademy/perseus\";\nimport * as i18n from \"@khanacademy/wonder-blocks-i18n\";\n\nexport const bar = (): void => {\n const msg = i18n._(\"foo() = %(foo)s\", {foo: foo()});\n // eslint-disable-next-line no-console\n console.log(msg);\n};\n"],"names":["bar","msg","i18n","_","foo","console","log"],"mappings":"6FAIO,IAAMA,EAAM,KACf,IAAMC,EAAMC,EAAKC,EAAE,kBAAmB,CAACC,IAAKA,MAE5CC,QAAQC,IAAIL"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/device-framer.jsx","../../src/components/json-editor.jsx","../../src/components/drag-target.jsx","../../src/katex-error-view.jsx","../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../node_modules/@babel/runtime/helpers/esm/extends.js","../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../../node_modules/resolve-pathname/esm/resolve-pathname.js","../../../../node_modules/tiny-warning/dist/tiny-warning.esm.js","../../../../node_modules/tiny-invariant/dist/tiny-invariant.esm.js","../../../../node_modules/history/esm/history.js","../../../../node_modules/mini-create-react-context/dist/esm/index.js","../../../../node_modules/path-to-regexp/index.js","../../../../node_modules/path-to-regexp/node_modules/isarray/index.js","../../../../node_modules/react-is/index.js","../../../../node_modules/react-is/cjs/react-is.production.min.js","../../../../node_modules/react-is/cjs/react-is.development.js","../../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../../node_modules/react-router/esm/react-router.js","../../../../node_modules/react-router-dom/esm/react-router-dom.js","../../../../node_modules/@khanacademy/wonder-blocks-core/dist/es/index.js","../../../../node_modules/@khanacademy/wonder-blocks-color/dist/es/index.js","../../../../node_modules/@khanacademy/wonder-blocks-clickable/dist/es/index.js","../../src/section-control-button.jsx","../../src/editor.jsx","../../src/iframe-content-renderer.jsx","../../src/article-editor.jsx","../../src/components/viewport-resizer.jsx","../../../../vendor/jsdiff/jsdiff.js","../../src/diffs/string-array-diff.jsx","../../src/diffs/text-diff.jsx","../../src/diffs/split-diff.jsx","../../src/diffs/widget-diff-performer.jsx","../../src/diffs/widget-diff.jsx","../../src/diffs/renderer-diff.jsx","../../src/diffs/article-diff.jsx","../../src/diffs/item-diff.jsx","../../src/diffs/tags-diff.jsx","../../src/diffs/structured-item-diff.jsx","../../src/hint-editor.jsx","../../src/item-extras-editor.jsx","../../src/item-editor.jsx","../../src/editor-page.jsx","../../src/i18n.jsx","../../../../vendor/hubble/hubble.js","../../src/components/simple-button.jsx","../../src/multirenderer-editor.jsx","../../src/stateful-article-editor.jsx","../../src/stateful-editor-page.jsx","../../src/widgets/categorizer-editor.jsx","../../src/components/blur-input.jsx","../../src/widgets/cs-program-editor.jsx","../../src/widgets/definition-editor.jsx","../../src/widgets/dropdown-editor.jsx","../../../../node_modules/kmath/number.js","../../../../node_modules/kmath/vector.js","../../../../node_modules/kmath/point.js","../../../../node_modules/kmath/line.js","../../../../node_modules/kmath/ray.js","../../../../node_modules/kmath/index.js","../../src/widgets/example-graphie-widget.jsx","../../src/widgets/example-graphie-widget-editor.jsx","../../src/widgets/example-widget-editor.jsx","../../src/widgets/explanation-editor.jsx","../../../../node_modules/kas/kas.js","../../src/components/sortable.jsx","../../src/widgets/expression-editor.jsx","../../src/widgets/graded-group-editor.jsx","../../src/widgets/graded-group-set-editor.jsx","../../src/components/graph-settings.jsx","../../src/widgets/grapher-editor.jsx","../../src/widgets/group-editor.jsx","../../src/widgets/iframe-editor.jsx","../../src/widgets/image-editor.jsx","../../src/widgets/input-number-editor.jsx","../../src/widgets/interaction/constraint-editor.jsx","../../src/widgets/interaction-editor.jsx","../../src/widgets/interactive-graph-editor.jsx","../../src/components/form-wrapped-text-field.jsx","../../src/components/link.jsx","../../src/widgets/label-image/answer-choices.jsx","../../src/components/hover-behavior.jsx","../../src/components/checkbox.jsx","../../src/widgets/label-image/behavior.jsx","../../src/components/dropdown-option.jsx","../../src/components/util.js","../../src/widgets/label-image/marker.jsx","../../src/widgets/label-image/question-markers.jsx","../../../../node_modules/@khanacademy/wonder-blocks-typography/dist/es/index.js","../../../../node_modules/@khanacademy/wonder-blocks-progress-spinner/dist/es/index.js","../../../../node_modules/@khanacademy/wonder-blocks-icon/dist/es/index.js","../../../../node_modules/@khanacademy/wonder-blocks-spacing/dist/es/index.js","../../../../node_modules/@khanacademy/wonder-blocks-button/dist/es/index.js","../../src/widgets/label-image/select-image.jsx","../../src/widgets/label-image-editor.jsx","../../src/widgets/lights-puzzle-editor.jsx","../../src/widgets/matcher-editor.jsx","../../src/widgets/matrix-editor.jsx","../../src/widgets/measurer-editor.jsx","../../src/widgets/molecule-editor.jsx","../../src/widgets/number-line-editor.jsx","../../src/widgets/numeric-input-editor.jsx","../../src/widgets/orderer-editor.jsx","../../src/widgets/passage-editor.jsx","../../src/widgets/passage-ref-editor.jsx","../../src/widgets/passage-ref-target-editor.jsx","../../src/widgets/plotter-editor.jsx","../../src/widgets/radio/editor.jsx","../../src/widgets/reaction-diagram-editor.jsx","../../src/widgets/sequence-editor.jsx","../../src/widgets/simple-markdown-tester-editor.jsx","../../src/widgets/simulator-editor.jsx","../../src/widgets/sorter-editor.jsx","../../src/widgets/table-editor.jsx","../../src/widgets/transformer-editor.jsx","../../src/widgets/unit-editor.jsx","../../src/widgets/video-editor.jsx","../../src/all-editors.js","../../src/widgets/example-widget.jsx","../../src/widgets/simple-markdown-tester.jsx","../../src/all-widgets.js","../../src/testing-widgets.js","../../src/index.js"],"sourcesContent":["// @flow\n/**\n * A component that displays its contents inside a device frame.\n */\n\nimport {constants} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nconst SCREEN_SIZES = {\n phone: {\n width: 320,\n height: 480,\n framedWidth: 320,\n },\n tablet: {\n width: 750,\n height: 920,\n framedWidth: 525,\n },\n desktop: {\n width: 688,\n height: 600,\n framedWidth: 688,\n },\n};\n\ntype Props = $FlowFixMe;\n\nclass DeviceFramer extends React.Component<Props> {\n static propTypes = {\n children: PropTypes.element.isRequired,\n deviceType: PropTypes.oneOf([\n constants.devices.PHONE,\n constants.devices.TABLET,\n constants.devices.DESKTOP,\n ]).isRequired,\n // TODO(kevinb) rename to variableHeight\n nochrome: PropTypes.bool,\n };\n\n render(): React.Node {\n const deviceType = this.props.deviceType;\n\n if (this.props.nochrome) {\n // Render content inside a variable height iframe. Used on the\n // \"edit\" table of the content editor. In this mode, PerseusFrame\n // will draw the border and reserve space on the right for\n // lint indicators.\n return (\n <div>\n <div\n key=\"screen\"\n style={{\n width:\n SCREEN_SIZES[deviceType].framedWidth +\n 2 * constants.perseusFrameBorderWidth +\n constants.lintGutterWidth,\n }}\n >\n <div>{this.props.children}</div>\n </div>\n </div>\n );\n }\n const scale =\n SCREEN_SIZES[deviceType].framedWidth /\n SCREEN_SIZES[deviceType].width;\n\n // In this mode we draw our own border and don't reserve\n // space for a lint gutter.\n const screenStyle = {\n backgroundColor: \"white\",\n color: \"black\",\n textAlign: \"left\",\n width: SCREEN_SIZES[deviceType].width,\n height: SCREEN_SIZES[deviceType].height,\n border: \"solid 1px #CCC\",\n margin: 8,\n zoom: scale,\n };\n\n return (\n <div key=\"screen\" className=\"screen\" style={screenStyle}>\n {this.props.children}\n </div>\n );\n }\n}\n\nexport default DeviceFramer;\n","/* eslint-disable @babel/no-invalid-this, react/no-unsafe, react/sort-comp */\n// @flow\nimport createReactClass from \"create-react-class\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst JsonEditor: any = createReactClass({\n displayName: \"JsonEditor\",\n\n getInitialState: function () {\n return {\n currentValue: JSON.stringify(this.props.value, null, 4),\n valid: true,\n };\n },\n\n UNSAFE_componentWillReceiveProps: function (nextProps) {\n const shouldReplaceContent =\n !this.state.valid ||\n !_.isEqual(nextProps.value, JSON.parse(this.state.currentValue));\n\n if (shouldReplaceContent) {\n this.setState(this.getInitialState());\n }\n },\n\n render: function () {\n const classes =\n \"perseus-json-editor \" + (this.state.valid ? \"valid\" : \"invalid\");\n\n return (\n <textarea\n className={classes}\n value={this.state.currentValue}\n onChange={this.handleChange}\n onKeyDown={this.handleKeyDown}\n onBlur={this.handleBlur}\n />\n );\n },\n\n handleKeyDown: function (e) {\n // This handler allows the tab character to be entered by pressing\n // tab, instead of jumping to the next (non-existant) field\n if (e.key === \"Tab\") {\n const cursorPos = e.target.selectionStart;\n const v = e.target.value;\n const textBefore = v.substring(0, cursorPos);\n const textAfter = v.substring(cursorPos, v.length);\n e.target.value = textBefore + \" \" + textAfter;\n e.target.selectionStart = textBefore.length + 4;\n e.target.selectionEnd = textBefore.length + 4;\n\n e.preventDefault();\n this.handleChange(e);\n }\n },\n\n handleChange: function (e) {\n const nextString = e.target.value;\n try {\n let json = JSON.parse(nextString);\n // Some extra handling to allow copy-pasting from /api/vi\n if (_.isString(json)) {\n json = JSON.parse(json);\n }\n // This callback unfortunately causes multiple renders,\n // but seems to be necessary to avoid componentWillReceiveProps\n // being called before setState has gone through\n this.setState(\n {\n currentValue: nextString,\n valid: true,\n },\n function () {\n this.props.onChange(json);\n },\n );\n } catch (ex) {\n this.setState({\n currentValue: nextString,\n valid: false,\n });\n }\n },\n\n // You can type whatever you want as you're typing, but if it's not valid\n // when you blur, it will revert to the last valid value.\n handleBlur: function (e) {\n const nextString = e.target.value;\n try {\n let json = JSON.parse(nextString);\n // Some extra handling to allow copy-pasting from /api/vi\n if (_.isString(json)) {\n json = JSON.parse(json);\n }\n // This callback unfortunately causes multiple renders,\n // but seems to be necessary to avoid componentWillReceiveProps\n // being called before setState has gone through\n this.setState(\n {\n currentValue: JSON.stringify(json, null, 4),\n valid: true,\n },\n function () {\n this.props.onChange(json);\n },\n );\n } catch (ex) {\n this.setState({\n currentValue: JSON.stringify(this.props.value, null, 4),\n valid: true,\n });\n }\n },\n});\n\nexport default JsonEditor;\n","// @noflow\n/* This component makes its children a drag target. Example:\n *\n * <DragTarget onDrop={this.handleDrop}>Drag to me</DragTarget>\n *\n * ...\n *\n * handleDrop: function(e) {\n * this.addImages(e.nativeEvent.dataTransfer.files);\n * }\n *\n * Now \"Drag to me\" will be a drag target - when something is dragged over it,\n * the element will become partially transparent as a visual indicator that\n * it's a target.\n */\n// TODO(joel) - indicate before the hover is over the target that it's possible\n// to drag into the target. This would (I think) require a high level handler -\n// like on Perseus itself, waiting for onDragEnter, then passing down the\n// event. Sounds like a pain. Possible workaround - create a div covering the\n// entire page...\n//\n// Other extensions:\n// * custom styles for global drag and dragOver\n// * only respond to certain types of drags (only images for instance)!\n\nimport createReactClass from \"create-react-class\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nconst DragTarget = createReactClass({\n propTypes: {\n // All props not listed here are forwarded to the root element without\n // modification.\n onDrop: PropTypes.func.isRequired,\n component: PropTypes.any, // component type\n shouldDragHighlight: PropTypes.func,\n style: PropTypes.any,\n },\n getDefaultProps: function () {\n return {\n component: \"div\",\n shouldDragHighlight: () => true,\n };\n },\n getInitialState: function () {\n return {dragHover: false};\n },\n handleDrop: function (e) {\n e.stopPropagation();\n e.preventDefault();\n this.setState({dragHover: false});\n this.props.onDrop(e);\n },\n handleDragEnd: function () {\n this.setState({dragHover: false});\n },\n handleDragOver: function (e) {\n e.preventDefault();\n },\n handleDragLeave: function () {\n this.setState({dragHover: false});\n },\n handleDragEnter: function (e) {\n this.setState({dragHover: this.props.shouldDragHighlight(e)});\n },\n render: function () {\n const opacity = this.state.dragHover ? {opacity: 0.3} : {};\n const Component = this.props.component;\n\n const forwardProps = Object.assign({}, this.props);\n delete forwardProps.component;\n delete forwardProps.shouldDragHighlight;\n\n return (\n <Component\n {...forwardProps}\n style={Object.assign({}, this.props.style, opacity)}\n onDrop={this.handleDrop}\n onDragEnd={this.handleDragEnd}\n onDragOver={this.handleDragOver}\n onDragEnter={this.handleDragEnter}\n onDragLeave={this.handleDragLeave}\n />\n );\n },\n});\n\nexport default DragTarget;\n","// @flow\n/**\n * Displays a collapsable list of KaTeX rendering errors.\n */\nimport {css, StyleSheet} from \"aphrodite\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\ntype Props = $FlowFixMe;\ntype State = $FlowFixMe;\n\nclass KatexErrorView extends React.Component<Props, State> {\n static propTypes = {\n errorList: PropTypes.arrayOf(\n PropTypes.shape({\n math: PropTypes.string.isRequired,\n message: PropTypes.string.isRequired,\n }),\n ).isRequired,\n };\n\n state: State = {\n showErrors: false,\n };\n\n handleToggleKatexErrors: (SyntheticMouseEvent<>) => void = (e) => {\n this.setState({showErrors: !this.state.showErrors});\n };\n\n render(): React.Node {\n const {errorList} = this.props;\n const {showErrors} = this.state;\n\n // TODO(riley) replace with SVG icons\n const disclosureClass = showErrors\n ? \"icon-chevron-down\"\n : \"icon-chevron-right\";\n\n return (\n <div className={css(styles.errorContainer)}>\n <div\n className={css(styles.title)}\n onClick={this.handleToggleKatexErrors}\n >\n <i className={disclosureClass} style={{fontSize: 14}} />\n KaTeX Errors ({errorList.length})\n </div>\n {showErrors && (\n <div className={css(styles.errorExplanation)}>\n These errors will cause your LaTeX to load really slowly\n for the student. Please fix them if you can. If you\n can’t because KaTeX doesn’t support the feature you\n need, please message Cam.\n </div>\n )}\n {showErrors &&\n errorList.map((e, index) => (\n <div className={css(styles.error)} key={index}>\n <div style={{color: \"red\"}}>{e.math}</div>\n <div>{e.message}</div>\n </div>\n ))}\n </div>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n title: {\n backgroundColor: \"#eee\",\n fontSize: \"1.25em\",\n padding: \"4px 10px\",\n },\n errorContainer: {\n border: \"1px solid #ddd\",\n borderTop: \"none\",\n },\n errorExplanation: {\n padding: \"4px 10px\",\n backgroundColor: \"pink\",\n },\n error: {\n padding: \"4px 10px\",\n },\n});\n\nexport default KatexErrorView;\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? prefix + \": \" + provided : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n}\nfunction stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n}\nfunction hasBasename(path, prefix) {\n return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;\n}\nfunction stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n}\nfunction stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n}\nfunction parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n var hashIndex = pathname.indexOf('#');\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n}\nfunction createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n var path = pathname || '/';\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : \"?\" + search;\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : \"#\" + hash;\n return path;\n}\n\nfunction createLocation(path, state, key, currentLocation) {\n var location;\n\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n}\nfunction locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n}\n\nfunction createTransitionManager() {\n var prompt = null;\n\n function setPrompt(nextPrompt) {\n process.env.NODE_ENV !== \"production\" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;\n prompt = nextPrompt;\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n }\n\n function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n }\n\n var listeners = [];\n\n function appendListener(fn) {\n var isActive = true;\n\n function listener() {\n if (isActive) fn.apply(void 0, arguments);\n }\n\n listeners.push(listener);\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n }\n\n function notifyListeners() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n }\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction getConfirmation(message, callback) {\n callback(window.confirm(message)); // eslint-disable-line no-alert\n}\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\n\nfunction supportsHistory() {\n var ua = window.navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n return window.history && 'pushState' in window.history;\n}\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\n\nfunction supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\n\nfunction supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\n\nfunction isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nfunction getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n}\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\n\n\nfunction createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nvar HashChangeEvent$1 = 'hashchange';\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nfunction stripHash(url) {\n var hashIndex = url.indexOf('#');\n return hashIndex === -1 ? url : url.slice(0, hashIndex);\n}\n\nfunction getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n}\n\nfunction pushHashPath(path) {\n window.location.hash = path;\n}\n\nfunction replaceHashPath(path) {\n window.location.replace(stripHash(window.location.href) + '#' + path);\n}\n\nfunction createHashHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n var _props = props,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$hashType = _props.hashType,\n hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n function getDOMLocation() {\n var path = decodePath(getHashPath());\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n var forceNextPop = false;\n var ignorePath = null;\n\n function locationsAreEqual$$1(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;\n }\n\n function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n handlePop(location);\n }\n }\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n } // Ensure the hash is encoded properly before doing anything else.\n\n\n var path = getHashPath();\n var encodedPath = encodePath(path);\n if (path !== encodedPath) replaceHashPath(encodedPath);\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)]; // Public interface\n\n function createHref(location) {\n var baseTag = document.querySelector('base');\n var href = '';\n\n if (baseTag && baseTag.getAttribute('href')) {\n href = stripHash(window.location.href);\n }\n\n return href + '#' + encodePath(basename + createPath(location));\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex + 1);\n nextPaths.push(path);\n allPaths = nextPaths;\n setState({\n action: action,\n location: location\n });\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;\n setState();\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n process.env.NODE_ENV !== \"production\" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(HashChangeEvent$1, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(HashChangeEvent$1, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n/**\n * Creates a history object that stores locations in memory.\n */\n\n\nfunction createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}\n\nexport { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };\n","import React, { Component } from 'react';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport PropTypes from 'prop-types';\nimport warning from 'tiny-warning';\n\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};\n\nfunction getUniqueId() {\n var key = '__global_unique_id__';\n return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;\n}\n\nfunction objectIs(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nfunction createEventEmitter(value) {\n var handlers = [];\n return {\n on: function on(handler) {\n handlers.push(handler);\n },\n off: function off(handler) {\n handlers = handlers.filter(function (h) {\n return h !== handler;\n });\n },\n get: function get() {\n return value;\n },\n set: function set(newValue, changedBits) {\n value = newValue;\n handlers.forEach(function (handler) {\n return handler(value, changedBits);\n });\n }\n };\n}\n\nfunction onlyChild(children) {\n return Array.isArray(children) ? children[0] : children;\n}\n\nfunction createReactContext(defaultValue, calculateChangedBits) {\n var _Provider$childContex, _Consumer$contextType;\n\n var contextProp = '__create-react-context-' + getUniqueId() + '__';\n\n var Provider = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Provider, _Component);\n\n function Provider() {\n var _this;\n\n _this = _Component.apply(this, arguments) || this;\n _this.emitter = createEventEmitter(_this.props.value);\n return _this;\n }\n\n var _proto = Provider.prototype;\n\n _proto.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[contextProp] = this.emitter, _ref;\n };\n\n _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (this.props.value !== nextProps.value) {\n var oldValue = this.props.value;\n var newValue = nextProps.value;\n var changedBits;\n\n if (objectIs(oldValue, newValue)) {\n changedBits = 0;\n } else {\n changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n\n if (process.env.NODE_ENV !== 'production') {\n warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits);\n }\n\n changedBits |= 0;\n\n if (changedBits !== 0) {\n this.emitter.set(nextProps.value, changedBits);\n }\n }\n }\n };\n\n _proto.render = function render() {\n return this.props.children;\n };\n\n return Provider;\n }(Component);\n\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);\n\n var Consumer = /*#__PURE__*/function (_Component2) {\n _inheritsLoose(Consumer, _Component2);\n\n function Consumer() {\n var _this2;\n\n _this2 = _Component2.apply(this, arguments) || this;\n _this2.state = {\n value: _this2.getValue()\n };\n\n _this2.onUpdate = function (newValue, changedBits) {\n var observedBits = _this2.observedBits | 0;\n\n if ((observedBits & changedBits) !== 0) {\n _this2.setState({\n value: _this2.getValue()\n });\n }\n };\n\n return _this2;\n }\n\n var _proto2 = Consumer.prototype;\n\n _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n var observedBits = nextProps.observedBits;\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;\n };\n\n _proto2.componentDidMount = function componentDidMount() {\n if (this.context[contextProp]) {\n this.context[contextProp].on(this.onUpdate);\n }\n\n var observedBits = this.props.observedBits;\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;\n };\n\n _proto2.componentWillUnmount = function componentWillUnmount() {\n if (this.context[contextProp]) {\n this.context[contextProp].off(this.onUpdate);\n }\n };\n\n _proto2.getValue = function getValue() {\n if (this.context[contextProp]) {\n return this.context[contextProp].get();\n } else {\n return defaultValue;\n }\n };\n\n _proto2.render = function render() {\n return onlyChild(this.props.children)(this.state.value);\n };\n\n return Consumer;\n }(Component);\n\n Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);\n return {\n Provider: Provider,\n Consumer: Consumer\n };\n}\n\nvar index = React.createContext || createReactContext;\n\nexport default index;\n","var isarray = require('isarray')\n\n/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = options && options.delimiter || '/'\n var res\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n continue\n }\n\n var next = str[index]\n var prefix = res[2]\n var name = res[3]\n var capture = res[4]\n var group = res[5]\n var modifier = res[6]\n var asterisk = res[7]\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n }\n\n var partial = prefix != null && next != null && next !== prefix\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var delimiter = res[2] || defaultDelimiter\n var pattern = capture || group\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n })\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index)\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path)\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n })\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n var strict = options.strict\n var end = options.end !== false\n var route = ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var prefix = escapeString(token.prefix)\n var capture = '(?:' + token.pattern + ')'\n\n keys.push(token)\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*'\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?'\n } else {\n capture = prefix + '(' + capture + ')?'\n }\n } else {\n capture = prefix + '(' + capture + ')'\n }\n\n route += capture\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/')\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n }\n\n if (end) {\n route += '$'\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options)\n keys = []\n }\n\n options = options || {}\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { createMemoryHistory, createLocation, locationsAreEqual, createPath } from 'history';\nimport warning from 'tiny-warning';\nimport createContext from 'mini-create-react-context';\nimport invariant from 'tiny-invariant';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport pathToRegexp from 'path-to-regexp';\nimport { isValidElementType } from 'react-is';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport hoistStatics from 'hoist-non-react-statics';\n\n// TODO: Replace with React.createContext once we can assume React 16+\n\nvar createNamedContext = function createNamedContext(name) {\n var context = createContext();\n context.displayName = name;\n return context;\n};\n\nvar historyContext = /*#__PURE__*/createNamedContext(\"Router-History\");\n\nvar context = /*#__PURE__*/createNamedContext(\"Router\");\n\n/**\n * The public API for putting history on context.\n */\n\nvar Router = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Router, _React$Component);\n\n Router.computeRootMatch = function computeRootMatch(pathname) {\n return {\n path: \"/\",\n url: \"/\",\n params: {},\n isExact: pathname === \"/\"\n };\n };\n\n function Router(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n location: props.history.location\n }; // This is a bit of a hack. We have to start listening for location\n // changes here in the constructor in case there are any <Redirect>s\n // on the initial render. If there are, they will replace/push when\n // they mount and since cDM fires in children before parents, we may\n // get a new location before the <Router> is mounted.\n\n _this._isMounted = false;\n _this._pendingLocation = null;\n\n if (!props.staticContext) {\n _this.unlisten = props.history.listen(function (location) {\n if (_this._isMounted) {\n _this.setState({\n location: location\n });\n } else {\n _this._pendingLocation = location;\n }\n });\n }\n\n return _this;\n }\n\n var _proto = Router.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n\n if (this._pendingLocation) {\n this.setState({\n location: this._pendingLocation\n });\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.unlisten) {\n this.unlisten();\n this._isMounted = false;\n this._pendingLocation = null;\n }\n };\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(context.Provider, {\n value: {\n history: this.props.history,\n location: this.state.location,\n match: Router.computeRootMatch(this.state.location.pathname),\n staticContext: this.props.staticContext\n }\n }, /*#__PURE__*/React.createElement(historyContext.Provider, {\n children: this.props.children || null,\n value: this.props.history\n }));\n };\n\n return Router;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n Router.propTypes = {\n children: PropTypes.node,\n history: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n };\n\n Router.prototype.componentDidUpdate = function (prevProps) {\n process.env.NODE_ENV !== \"production\" ? warning(prevProps.history === this.props.history, \"You cannot change <Router history>\") : void 0;\n };\n}\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\n\nvar MemoryRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(MemoryRouter, _React$Component);\n\n function MemoryRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.history = createMemoryHistory(_this.props);\n return _this;\n }\n\n var _proto = MemoryRouter.prototype;\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Router, {\n history: this.history,\n children: this.props.children\n });\n };\n\n return MemoryRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n MemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n };\n\n MemoryRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \"<MemoryRouter> ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\") : void 0;\n };\n}\n\nvar Lifecycle = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Lifecycle, _React$Component);\n\n function Lifecycle() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Lifecycle.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n };\n\n _proto.render = function render() {\n return null;\n };\n\n return Lifecycle;\n}(React.Component);\n\n/**\n * The public API for prompting the user before navigating away from a screen.\n */\n\nfunction Prompt(_ref) {\n var message = _ref.message,\n _ref$when = _ref.when,\n when = _ref$when === void 0 ? true : _ref$when;\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <Prompt> outside a <Router>\") : invariant(false) : void 0;\n if (!when || context.staticContext) return null;\n var method = context.history.block;\n return /*#__PURE__*/React.createElement(Lifecycle, {\n onMount: function onMount(self) {\n self.release = method(message);\n },\n onUpdate: function onUpdate(self, prevProps) {\n if (prevProps.message !== message) {\n self.release();\n self.release = method(message);\n }\n },\n onUnmount: function onUnmount(self) {\n self.release();\n },\n message: message\n });\n });\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);\n Prompt.propTypes = {\n when: PropTypes.bool,\n message: messageType.isRequired\n };\n}\n\nvar cache = {};\nvar cacheLimit = 10000;\nvar cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n var generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount++;\n }\n\n return generator;\n}\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\n\n\nfunction generatePath(path, params) {\n if (path === void 0) {\n path = \"/\";\n }\n\n if (params === void 0) {\n params = {};\n }\n\n return path === \"/\" ? path : compilePath(path)(params, {\n pretty: true\n });\n}\n\n/**\n * The public API for navigating programmatically with a component.\n */\n\nfunction Redirect(_ref) {\n var computedMatch = _ref.computedMatch,\n to = _ref.to,\n _ref$push = _ref.push,\n push = _ref$push === void 0 ? false : _ref$push;\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <Redirect> outside a <Router>\") : invariant(false) : void 0;\n var history = context.history,\n staticContext = context.staticContext;\n var method = push ? history.push : history.replace;\n var location = createLocation(computedMatch ? typeof to === \"string\" ? generatePath(to, computedMatch.params) : _extends({}, to, {\n pathname: generatePath(to.pathname, computedMatch.params)\n }) : to); // When rendering in a static context,\n // set the new location immediately.\n\n if (staticContext) {\n method(location);\n return null;\n }\n\n return /*#__PURE__*/React.createElement(Lifecycle, {\n onMount: function onMount() {\n method(location);\n },\n onUpdate: function onUpdate(self, prevProps) {\n var prevLocation = createLocation(prevProps.to);\n\n if (!locationsAreEqual(prevLocation, _extends({}, location, {\n key: prevLocation.key\n }))) {\n method(location);\n }\n },\n to: to\n });\n });\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n Redirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n };\n}\n\nvar cache$1 = {};\nvar cacheLimit$1 = 10000;\nvar cacheCount$1 = 0;\n\nfunction compilePath$1(path, options) {\n var cacheKey = \"\" + options.end + options.strict + options.sensitive;\n var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});\n if (pathCache[path]) return pathCache[path];\n var keys = [];\n var regexp = pathToRegexp(path, keys, options);\n var result = {\n regexp: regexp,\n keys: keys\n };\n\n if (cacheCount$1 < cacheLimit$1) {\n pathCache[path] = result;\n cacheCount$1++;\n }\n\n return result;\n}\n/**\n * Public API for matching a URL pathname to a path.\n */\n\n\nfunction matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = {\n path: options\n };\n }\n\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nfunction isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n}\n\nfunction evalChildrenDev(children, props, path) {\n var value = children(props);\n process.env.NODE_ENV !== \"production\" ? warning(value !== undefined, \"You returned `undefined` from the `children` function of \" + (\"<Route\" + (path ? \" path=\\\"\" + path + \"\\\"\" : \"\") + \">, but you \") + \"should have returned a React element or `null`\") : void 0;\n return value || null;\n}\n/**\n * The public API for matching a single path and rendering.\n */\n\n\nvar Route = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Route, _React$Component);\n\n function Route() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Route.prototype;\n\n _proto.render = function render() {\n var _this = this;\n\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context$1) {\n !context$1 ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <Route> outside a <Router>\") : invariant(false) : void 0;\n var location = _this.props.location || context$1.location;\n var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us\n : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;\n\n var props = _extends({}, context$1, {\n location: location,\n match: match\n });\n\n var _this$props = _this.props,\n children = _this$props.children,\n component = _this$props.component,\n render = _this$props.render; // Preact uses an empty array as children by\n // default, so use null if that's the case.\n\n if (Array.isArray(children) && isEmptyChildren(children)) {\n children = null;\n }\n\n return /*#__PURE__*/React.createElement(context.Provider, {\n value: props\n }, props.match ? children ? typeof children === \"function\" ? process.env.NODE_ENV !== \"production\" ? evalChildrenDev(children, props, _this.props.path) : children(props) : children : component ? /*#__PURE__*/React.createElement(component, props) : render ? render(props) : null : typeof children === \"function\" ? process.env.NODE_ENV !== \"production\" ? evalChildrenDev(children, props, _this.props.path) : children(props) : null);\n });\n };\n\n return Route;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n Route.propTypes = {\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: function component(props, propName) {\n if (props[propName] && !isValidElementType(props[propName])) {\n return new Error(\"Invalid prop 'component' supplied to 'Route': the prop is not a valid React component\");\n }\n },\n exact: PropTypes.bool,\n location: PropTypes.object,\n path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n render: PropTypes.func,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool\n };\n\n Route.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), \"You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored\") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), \"You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored\") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.component && this.props.render), \"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored\") : void 0;\n };\n\n Route.prototype.componentDidUpdate = function (prevProps) {\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.location && !prevProps.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(!this.props.location && prevProps.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.') : void 0;\n };\n}\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n}\n\nfunction addBasename(basename, location) {\n if (!basename) return location;\n return _extends({}, location, {\n pathname: addLeadingSlash(basename) + location.pathname\n });\n}\n\nfunction stripBasename(basename, location) {\n if (!basename) return location;\n var base = addLeadingSlash(basename);\n if (location.pathname.indexOf(base) !== 0) return location;\n return _extends({}, location, {\n pathname: location.pathname.substr(base.length)\n });\n}\n\nfunction createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n}\n\nfunction staticHandler(methodName) {\n return function () {\n process.env.NODE_ENV !== \"production\" ? invariant(false, \"You cannot %s with <StaticRouter>\", methodName) : invariant(false) ;\n };\n}\n\nfunction noop() {}\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\n\n\nvar StaticRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(StaticRouter, _React$Component);\n\n function StaticRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handlePush = function (location) {\n return _this.navigateTo(location, \"PUSH\");\n };\n\n _this.handleReplace = function (location) {\n return _this.navigateTo(location, \"REPLACE\");\n };\n\n _this.handleListen = function () {\n return noop;\n };\n\n _this.handleBlock = function () {\n return noop;\n };\n\n return _this;\n }\n\n var _proto = StaticRouter.prototype;\n\n _proto.navigateTo = function navigateTo(location, action) {\n var _this$props = this.props,\n _this$props$basename = _this$props.basename,\n basename = _this$props$basename === void 0 ? \"\" : _this$props$basename,\n _this$props$context = _this$props.context,\n context = _this$props$context === void 0 ? {} : _this$props$context;\n context.action = action;\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n _this$props2$basename = _this$props2.basename,\n basename = _this$props2$basename === void 0 ? \"\" : _this$props2$basename,\n _this$props2$context = _this$props2.context,\n context = _this$props2$context === void 0 ? {} : _this$props2$context,\n _this$props2$location = _this$props2.location,\n location = _this$props2$location === void 0 ? \"/\" : _this$props2$location,\n rest = _objectWithoutPropertiesLoose(_this$props2, [\"basename\", \"context\", \"location\"]);\n\n var history = {\n createHref: function createHref(path) {\n return addLeadingSlash(basename + createURL(path));\n },\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n return /*#__PURE__*/React.createElement(Router, _extends({}, rest, {\n history: history,\n staticContext: context\n }));\n };\n\n return StaticRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n StaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n };\n\n StaticRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \"<StaticRouter> ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { StaticRouter as Router }`.\") : void 0;\n };\n}\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\n\nvar Switch = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Switch, _React$Component);\n\n function Switch() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Switch.prototype;\n\n _proto.render = function render() {\n var _this = this;\n\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <Switch> outside a <Router>\") : invariant(false) : void 0;\n var location = _this.props.location || context.location;\n var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two <Route>s that render the same\n // component at different URLs.\n\n React.Children.forEach(_this.props.children, function (child) {\n if (match == null && /*#__PURE__*/React.isValidElement(child)) {\n element = child;\n var path = child.props.path || child.props.from;\n match = path ? matchPath(location.pathname, _extends({}, child.props, {\n path: path\n })) : context.match;\n }\n });\n return match ? /*#__PURE__*/React.cloneElement(element, {\n location: location,\n computedMatch: match\n }) : null;\n });\n };\n\n return Switch;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n Switch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n };\n\n Switch.prototype.componentDidUpdate = function (prevProps) {\n process.env.NODE_ENV !== \"production\" ? warning(!(this.props.location && !prevProps.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no \"location\" prop and then provided one on a subsequent render.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(!this.props.location && prevProps.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a \"location\" prop initially but omitted it on a subsequent render.') : void 0;\n };\n}\n\n/**\n * A public higher-order component to access the imperative API\n */\n\nfunction withRouter(Component) {\n var displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutPropertiesLoose(props, [\"wrappedComponentRef\"]);\n\n return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <\" + displayName + \" /> outside a <Router>\") : invariant(false) : void 0;\n return /*#__PURE__*/React.createElement(Component, _extends({}, remainingProps, context, {\n ref: wrappedComponentRef\n }));\n });\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (process.env.NODE_ENV !== \"production\") {\n C.propTypes = {\n wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])\n };\n }\n\n return hoistStatics(C, Component);\n}\n\nvar useContext = React.useContext;\nfunction useHistory() {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useHistory()\") : invariant(false) : void 0;\n }\n\n return useContext(historyContext);\n}\nfunction useLocation() {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useLocation()\") : invariant(false) : void 0;\n }\n\n return useContext(context).location;\n}\nfunction useParams() {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useParams()\") : invariant(false) : void 0;\n }\n\n var match = useContext(context).match;\n return match ? match.params : {};\n}\nfunction useRouteMatch(path) {\n if (process.env.NODE_ENV !== \"production\") {\n !(typeof useContext === \"function\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You must use React >= 16.8 in order to use useRouteMatch()\") : invariant(false) : void 0;\n }\n\n var location = useLocation();\n var match = useContext(context).match;\n return path ? matchPath(location.pathname, path) : match;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n if (typeof window !== \"undefined\") {\n var global = window;\n var key = \"__react_router_build__\";\n var buildNames = {\n cjs: \"CommonJS\",\n esm: \"ES modules\",\n umd: \"UMD\"\n };\n\n if (global[key] && global[key] !== \"esm\") {\n var initialBuildName = buildNames[global[key]];\n var secondaryBuildName = buildNames[\"esm\"]; // TODO: Add link to article that explains in detail how to avoid\n // loading 2 different builds.\n\n throw new Error(\"You are loading the \" + secondaryBuildName + \" build of React Router \" + (\"on a page that is already running the \" + initialBuildName + \" \") + \"build, so things won't work right.\");\n }\n\n global[key] = \"esm\";\n }\n}\n\nexport { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, historyContext as __HistoryContext, context as __RouterContext, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter };\n//# sourceMappingURL=react-router.js.map\n","import { Router, __RouterContext, matchPath } from 'react-router';\nexport { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter } from 'react-router';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport React from 'react';\nimport { createBrowserHistory, createHashHistory, createLocation, createPath } from 'history';\nimport PropTypes from 'prop-types';\nimport warning from 'tiny-warning';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport invariant from 'tiny-invariant';\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\n\nvar BrowserRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(BrowserRouter, _React$Component);\n\n function BrowserRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.history = createBrowserHistory(_this.props);\n return _this;\n }\n\n var _proto = BrowserRouter.prototype;\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Router, {\n history: this.history,\n children: this.props.children\n });\n };\n\n return BrowserRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n BrowserRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number\n };\n\n BrowserRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \"<BrowserRouter> ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\") : void 0;\n };\n}\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\n\nvar HashRouter = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(HashRouter, _React$Component);\n\n function HashRouter() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.history = createHashHistory(_this.props);\n return _this;\n }\n\n var _proto = HashRouter.prototype;\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Router, {\n history: this.history,\n children: this.props.children\n });\n };\n\n return HashRouter;\n}(React.Component);\n\nif (process.env.NODE_ENV !== \"production\") {\n HashRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"])\n };\n\n HashRouter.prototype.componentDidMount = function () {\n process.env.NODE_ENV !== \"production\" ? warning(!this.props.history, \"<HashRouter> ignores the history prop. To use a custom history, \" + \"use `import { Router }` instead of `import { HashRouter as Router }`.\") : void 0;\n };\n}\n\nvar resolveToLocation = function resolveToLocation(to, currentLocation) {\n return typeof to === \"function\" ? to(currentLocation) : to;\n};\nvar normalizeToLocation = function normalizeToLocation(to, currentLocation) {\n return typeof to === \"string\" ? createLocation(to, null, null, currentLocation) : to;\n};\n\nvar forwardRefShim = function forwardRefShim(C) {\n return C;\n};\n\nvar forwardRef = React.forwardRef;\n\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nvar LinkAnchor = forwardRef(function (_ref, forwardedRef) {\n var innerRef = _ref.innerRef,\n navigate = _ref.navigate,\n _onClick = _ref.onClick,\n rest = _objectWithoutPropertiesLoose(_ref, [\"innerRef\", \"navigate\", \"onClick\"]);\n\n var target = rest.target;\n\n var props = _extends({}, rest, {\n onClick: function onClick(event) {\n try {\n if (_onClick) _onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (!event.defaultPrevented && // onClick prevented default\n event.button === 0 && ( // ignore everything but left clicks\n !target || target === \"_self\") && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }\n }); // React 15 compat\n\n\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.ref = innerRef;\n }\n /* eslint-disable-next-line jsx-a11y/anchor-has-content */\n\n\n return /*#__PURE__*/React.createElement(\"a\", props);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n LinkAnchor.displayName = \"LinkAnchor\";\n}\n/**\n * The public API for rendering a history-aware <a>.\n */\n\n\nvar Link = forwardRef(function (_ref2, forwardedRef) {\n var _ref2$component = _ref2.component,\n component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,\n replace = _ref2.replace,\n to = _ref2.to,\n innerRef = _ref2.innerRef,\n rest = _objectWithoutPropertiesLoose(_ref2, [\"component\", \"replace\", \"to\", \"innerRef\"]);\n\n return /*#__PURE__*/React.createElement(__RouterContext.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <Link> outside a <Router>\") : invariant(false) : void 0;\n var history = context.history;\n var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);\n var href = location ? history.createHref(location) : \"\";\n\n var props = _extends({}, rest, {\n href: href,\n navigate: function navigate() {\n var location = resolveToLocation(to, context.location);\n var isDuplicateNavigation = createPath(context.location) === createPath(normalizeToLocation(location));\n var method = replace || isDuplicateNavigation ? history.replace : history.push;\n method(location);\n }\n }); // React 15 compat\n\n\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return /*#__PURE__*/React.createElement(component, props);\n });\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n var toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]);\n var refType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({\n current: PropTypes.any\n })]);\n Link.displayName = \"Link\";\n Link.propTypes = {\n innerRef: refType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired\n };\n}\n\nvar forwardRefShim$1 = function forwardRefShim(C) {\n return C;\n};\n\nvar forwardRef$1 = React.forwardRef;\n\nif (typeof forwardRef$1 === \"undefined\") {\n forwardRef$1 = forwardRefShim$1;\n}\n\nfunction joinClassnames() {\n for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {\n classnames[_key] = arguments[_key];\n }\n\n return classnames.filter(function (i) {\n return i;\n }).join(\" \");\n}\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\n\n\nvar NavLink = forwardRef$1(function (_ref, forwardedRef) {\n var _ref$ariaCurrent = _ref[\"aria-current\"],\n ariaCurrent = _ref$ariaCurrent === void 0 ? \"page\" : _ref$ariaCurrent,\n _ref$activeClassName = _ref.activeClassName,\n activeClassName = _ref$activeClassName === void 0 ? \"active\" : _ref$activeClassName,\n activeStyle = _ref.activeStyle,\n classNameProp = _ref.className,\n exact = _ref.exact,\n isActiveProp = _ref.isActive,\n locationProp = _ref.location,\n sensitive = _ref.sensitive,\n strict = _ref.strict,\n styleProp = _ref.style,\n to = _ref.to,\n innerRef = _ref.innerRef,\n rest = _objectWithoutPropertiesLoose(_ref, [\"aria-current\", \"activeClassName\", \"activeStyle\", \"className\", \"exact\", \"isActive\", \"location\", \"sensitive\", \"strict\", \"style\", \"to\", \"innerRef\"]);\n\n return /*#__PURE__*/React.createElement(__RouterContext.Consumer, null, function (context) {\n !context ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You should not use <NavLink> outside a <Router>\") : invariant(false) : void 0;\n var currentLocation = locationProp || context.location;\n var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);\n var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n\n var escapedPath = path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n var match = escapedPath ? matchPath(currentLocation.pathname, {\n path: escapedPath,\n exact: exact,\n sensitive: sensitive,\n strict: strict\n }) : null;\n var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);\n var className = typeof classNameProp === \"function\" ? classNameProp(isActive) : classNameProp;\n var style = typeof styleProp === \"function\" ? styleProp(isActive) : styleProp;\n\n if (isActive) {\n className = joinClassnames(className, activeClassName);\n style = _extends({}, style, activeStyle);\n }\n\n var props = _extends({\n \"aria-current\": isActive && ariaCurrent || null,\n className: className,\n style: style,\n to: toLocation\n }, rest); // React 15 compat\n\n\n if (forwardRefShim$1 !== forwardRef$1) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return /*#__PURE__*/React.createElement(Link, props);\n });\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n NavLink.displayName = \"NavLink\";\n var ariaCurrentType = PropTypes.oneOf([\"page\", \"step\", \"location\", \"date\", \"time\", \"true\", \"false\"]);\n NavLink.propTypes = _extends({}, Link.propTypes, {\n \"aria-current\": ariaCurrentType,\n activeClassName: PropTypes.string,\n activeStyle: PropTypes.object,\n className: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),\n exact: PropTypes.bool,\n isActive: PropTypes.func,\n location: PropTypes.object,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool,\n style: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n });\n}\n\nexport { BrowserRouter, HashRouter, Link, NavLink };\n//# sourceMappingURL=react-router-dom.js.map\n","import _extends from '@babel/runtime/helpers/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport * as React from 'react';\nimport { useContext as useContext$1, useRef } from 'react';\nimport { StyleSheet, css } from 'aphrodite';\n\nfunction flatten(list) {\n const result = [];\n\n if (!list) {\n return result;\n } else if (Array.isArray(list)) {\n for (const item of list) {\n result.push.apply(result, flatten(item));\n }\n } else {\n result.push(list);\n }\n\n return result;\n}\n\nfunction processStyleList(style) {\n const stylesheetStyles = [];\n const inlineStyles = [];\n\n if (!style) {\n return {\n style: {},\n className: \"\"\n };\n }\n\n const shouldInlineStyles = typeof global !== \"undefined\" && global.SNAPSHOT_INLINE_APHRODITE;\n flatten(style).forEach(child => {\n const _definition = child._definition;\n\n if (_definition != null) {\n if (shouldInlineStyles) {\n const def = {};\n\n for (const [key, value] of Object.entries(_definition)) {\n def[key.replace(/-[a-z]/g, match => match[1].toUpperCase())] = value;\n }\n\n inlineStyles.push(def);\n } else {\n stylesheetStyles.push(child);\n }\n } else {\n inlineStyles.push(child);\n }\n });\n const inlineStylesObject = Object.assign.apply(Object, [{}].concat(inlineStyles));\n\n if (inlineStyles.length > 0 && !shouldInlineStyles) {\n const inlineStylesStyleSheet = StyleSheet.create({\n inlineStyles: inlineStylesObject\n });\n stylesheetStyles.push(inlineStylesStyleSheet.inlineStyles);\n }\n\n return {\n style: shouldInlineStyles ? inlineStylesObject : {},\n className: css.apply(void 0, stylesheetStyles)\n };\n}\n\nconst _excluded$2 = [\"children\", \"style\", \"tag\", \"testId\"];\nconst isHeaderRegex = /^h[1-6]$/;\nconst styles$1 = StyleSheet.create({\n text: {\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\"\n },\n header: {\n marginTop: 0,\n marginBottom: 0\n }\n});\nclass Text extends React.Component {\n render() {\n const _this$props = this.props,\n {\n children,\n style,\n tag: Tag,\n testId\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$2);\n\n const isHeader = isHeaderRegex.test(Tag);\n const styleAttributes = processStyleList([styles$1.text, isHeader && styles$1.header, style]);\n return React.createElement(Tag, _extends({}, otherProps, {\n style: styleAttributes.style,\n className: styleAttributes.className,\n \"data-test-id\": testId\n }), children);\n }\n\n}\nText.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$1 = [\"className\", \"style\"];\nfunction addStyle(Component, defaultStyle) {\n function StyleComponent(props) {\n const {\n className,\n style\n } = props,\n tmpOtherProps = _objectWithoutPropertiesLoose(props, _excluded$1);\n\n const otherProps = tmpOtherProps;\n const reset = typeof Component === \"string\" ? overrides[Component] : null;\n const {\n className: aphroditeClassName,\n style: inlineStyles\n } = processStyleList([reset, defaultStyle, style]);\n return React.createElement(Component, _extends({}, otherProps, {\n className: [aphroditeClassName, className].filter(Boolean).join(\" \"),\n style: inlineStyles\n }));\n }\n\n return StyleComponent;\n}\nconst overrides = StyleSheet.create({\n button: {\n margin: 0,\n \"::-moz-focus-inner\": {\n border: 0\n }\n }\n});\n\nconst _excluded = [\"testId\", \"tag\"];\nconst styles = StyleSheet.create({\n default: {\n alignItems: \"stretch\",\n borderWidth: 0,\n borderStyle: \"solid\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n margin: 0,\n padding: 0,\n position: \"relative\",\n zIndex: 0,\n minHeight: 0,\n minWidth: 0\n }\n});\nconst StyledDiv = addStyle(\"div\", styles.default);\nconst StyledArticle = addStyle(\"article\", styles.default);\nconst StyledAside = addStyle(\"aside\", styles.default);\nconst StyledNav = addStyle(\"nav\", styles.default);\nconst StyledSection = addStyle(\"section\", styles.default);\nclass View extends React.Component {\n render() {\n const _this$props = this.props,\n {\n testId,\n tag\n } = _this$props,\n restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);\n\n const props = _extends({}, restProps, {\n \"data-test-id\": testId\n });\n\n switch (tag) {\n case \"article\":\n return React.createElement(StyledArticle, props);\n\n case \"aside\":\n return React.createElement(StyledAside, props);\n\n case \"nav\":\n return React.createElement(StyledNav, props);\n\n case \"section\":\n return React.createElement(StyledSection, props);\n\n case \"div\":\n return React.createElement(StyledDiv, props);\n\n default:\n throw Error(`${tag} is not an allowed value for the 'tag' prop`);\n }\n }\n\n}\nView.defaultProps = {\n tag: \"div\"\n};\n\nconst RenderState = require(\"flow-enums-runtime\")({\n Root: \"root\",\n Initial: \"initial\",\n Standard: \"standard\"\n});\nconst RenderStateContext = React.createContext(RenderState.Root);\n\nclass WithSSRPlaceholder extends React.Component {\n constructor(...args) {\n super(...args);\n this.state = {\n mounted: false\n };\n this._isTheRootComponent = false;\n }\n\n componentDidMount() {\n if (this._isTheRootComponent) {\n this.setState({\n mounted: true\n });\n }\n }\n\n _renderAsRootComponent() {\n const {\n mounted\n } = this.state;\n const {\n children,\n placeholder\n } = this.props;\n this._isTheRootComponent = true;\n\n if (mounted) {\n return React.createElement(RenderStateContext.Provider, {\n value: RenderState.Standard\n }, children());\n }\n\n if (placeholder) {\n return React.createElement(RenderStateContext.Provider, {\n value: RenderState.Initial\n }, placeholder());\n }\n\n return null;\n }\n\n _maybeRender(renderState) {\n const {\n children,\n placeholder\n } = this.props;\n\n switch (renderState) {\n case RenderState.Root:\n return this._renderAsRootComponent();\n\n case RenderState.Initial:\n if (placeholder) {\n return placeholder();\n }\n\n return null;\n\n case RenderState.Standard:\n return children();\n }\n\n {\n console.log(`We got a render state we don't understand: \"${JSON.stringify(renderState)}\"`);\n return this._maybeRender(RenderState.Root);\n }\n }\n\n render() {\n return React.createElement(RenderStateContext.Consumer, null, value => this._maybeRender(value));\n }\n\n}\n\nclass UniqueIDFactory {\n constructor(scope) {\n this.get = key => {\n const normalizedKey = key.toLowerCase();\n\n if (!this._hasValidIdChars(key)) {\n throw new Error(`Invalid identifier key: ${key}`);\n }\n\n return `${this._uniqueFactoryName}-${normalizedKey}`;\n };\n\n scope = typeof scope === \"string\" ? scope : \"\";\n const normalizedScope = scope.toLowerCase();\n\n if (!this._hasValidIdChars(normalizedScope)) {\n throw new Error(`Invalid factory scope: ${scope}`);\n }\n\n this._uniqueFactoryName = `uid-${normalizedScope}-${UniqueIDFactory._factoryUniquenessCounter++}`;\n }\n\n _hasValidIdChars(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n\n const invalidCharsReplaced = value.replace(/[^\\d\\w-]/g, \"-\");\n return value === invalidCharsReplaced;\n }\n\n}\nUniqueIDFactory._factoryUniquenessCounter = 0;\n\nclass SsrIDFactory {\n get(id) {\n return id;\n }\n\n}\n\nSsrIDFactory.Default = new SsrIDFactory();\nvar SsrIDFactory$1 = SsrIDFactory.Default;\n\nclass UniqueIDProvider extends React.Component {\n _performRender(firstRender) {\n const {\n children,\n mockOnFirstRender,\n scope\n } = this.props;\n\n if (firstRender) {\n if (mockOnFirstRender) {\n return children(SsrIDFactory$1);\n }\n\n return null;\n }\n\n if (!this._idFactory) {\n this._idFactory = new UniqueIDFactory(scope);\n }\n\n return children(this._idFactory);\n }\n\n render() {\n return React.createElement(WithSSRPlaceholder, {\n placeholder: () => this._performRender(true)\n }, () => this._performRender(false));\n }\n\n}\n\nclass IDProvider extends React.Component {\n renderChildren(ids) {\n const {\n id,\n children\n } = this.props;\n const uniqueId = ids ? ids.get(IDProvider.defaultId) : id;\n\n if (!uniqueId) {\n throw new Error(\"Did not get an identifier factory nor a id prop\");\n }\n\n return children(uniqueId);\n }\n\n render() {\n const {\n id,\n scope\n } = this.props;\n\n if (id) {\n return this.renderChildren();\n } else {\n return React.createElement(UniqueIDProvider, {\n scope: scope,\n mockOnFirstRender: true\n }, ids => this.renderChildren(ids));\n }\n }\n\n}\nIDProvider.defaultId = \"wb-id\";\n\nlet serverSide = false;\nvar server = {\n isServerSide: () => serverSide,\n setServerSide: () => {\n serverSide = true;\n }\n};\n\nconst useUniqueIdWithMock = scope => {\n const renderState = useContext$1(RenderStateContext);\n const idFactory = useRef(null);\n\n if (renderState === RenderState.Root) {\n throw new Error(\"Components using useUniqueIdWithMock() should be descendants of <RenderStateRoot>\");\n }\n\n if (renderState === RenderState.Initial) {\n return SsrIDFactory$1;\n }\n\n if (!idFactory.current) {\n idFactory.current = new UniqueIDFactory(scope);\n }\n\n return idFactory.current;\n};\nconst useUniqueIdWithoutMock = scope => {\n const renderState = useContext$1(RenderStateContext);\n const idFactory = useRef(null);\n\n if (renderState === RenderState.Root) {\n throw new Error(\"Components using useUniqueIdWithoutMock() should be descendants of <RenderStateRoot>\");\n }\n\n if (renderState === RenderState.Initial) {\n return null;\n }\n\n if (!idFactory.current) {\n idFactory.current = new UniqueIDFactory(scope);\n }\n\n return idFactory.current;\n};\n\nconst useForceUpdate = () => {\n const [, setState] = React.useState(false);\n const forceUpdate = React.useCallback(() => setState(state => !state), []);\n return forceUpdate;\n};\n\nconst {\n useContext,\n useEffect,\n useState\n} = React;\nconst RenderStateRoot = ({\n children,\n throwIfNested\n}) => {\n const [firstRender, setFirstRender] = useState(true);\n const contextValue = useContext(RenderStateContext);\n useEffect(() => {\n setFirstRender(false);\n }, []);\n\n if (contextValue !== RenderState.Root) {\n if (throwIfNested) {\n throw new Error(\"There's already a <RenderStateRoot> above this instance in \" + \"the render tree. This instance should be removed.\");\n }\n\n return children;\n }\n\n const value = firstRender ? RenderState.Initial : RenderState.Standard;\n return React.createElement(RenderStateContext.Provider, {\n value: value\n }, children);\n};\nRenderStateRoot.defaultProps = {\n throwIfNested: true\n};\n\nexport { IDProvider, RenderStateRoot, server as Server, Text, UniqueIDProvider, View, WithSSRPlaceholder, addStyle, useForceUpdate, useUniqueIdWithMock, useUniqueIdWithoutMock };\n","import _extends from '@babel/runtime/helpers/extends';\n\n/**\n * A color manipulation library useful for dynamically\n * mixing colors together.\n */\nconst color6Regexp = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;\nconst color3Regexp = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i;\nconst rgbaRegexp = /^rgba?\\(\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*([\\d.]+))?\\s*\\)$/i;\n\n// Parse a color in #abcdef, rgb(...), or rgba(...) form into an object\n// with r,g,b,a keys.\nconst parse = color => {\n if (typeof color !== \"string\") {\n throw new Error(`Failed to parse color: ${color}`);\n }\n\n const color3Match = color.match(color3Regexp);\n\n if (color3Match) {\n return {\n r: parseInt(`${color3Match[1]}${color3Match[1]}`, 16),\n g: parseInt(`${color3Match[2]}${color3Match[2]}`, 16),\n b: parseInt(`${color3Match[3]}${color3Match[3]}`, 16),\n a: 1\n };\n }\n\n const color6Match = color.match(color6Regexp);\n\n if (color6Match) {\n return {\n r: parseInt(color6Match[1], 16),\n g: parseInt(color6Match[2], 16),\n b: parseInt(color6Match[3], 16),\n a: 1\n };\n }\n\n const rgbaMatch = color.match(rgbaRegexp);\n\n if (rgbaMatch) {\n return {\n r: parseFloat(rgbaMatch[1]),\n g: parseFloat(rgbaMatch[2]),\n b: parseFloat(rgbaMatch[3]),\n a: rgbaMatch[4] ? parseFloat(rgbaMatch[4]) : 1\n };\n }\n\n throw new Error(`Failed to parse color: ${color}`);\n}; // Stringify the color in an `rgba()` or `#abcdef` format.\n\n\nconst format = color => {\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n\n if (color.a === 1) {\n const _s = c => {\n const asString = c.toString(16);\n return asString.length === 1 ? asString + asString : asString;\n };\n\n return `#${_s(r)}${_s(g)}${_s(b)}`;\n } else {\n return `rgba(${r},${g},${b},${color.a.toFixed(2)})`;\n }\n}; // Adjust the alpha value of a color.\n\n\nconst fade = (color, percentage) => {\n if (percentage < 0 || percentage > 1) {\n throw new Error(\"Percentage must be between 0 and 1\");\n }\n\n const components = parse(color);\n return format(_extends({}, components, {\n a: components.a * percentage\n }));\n}; // Mix a color into a background color, using the alpha channel of the base\n// color to determine the linear blend.\n\nconst mix = (color, background) => {\n const colorObj = parse(color);\n const bgObj = parse(background);\n return format({\n r: colorObj.r * colorObj.a + bgObj.r * (1 - colorObj.a),\n g: colorObj.g * colorObj.a + bgObj.g * (1 - colorObj.a),\n b: colorObj.b * colorObj.a + bgObj.b * (1 - colorObj.a),\n a: bgObj.a\n });\n};\n\nconst offBlack = \"#21242c\";\nconst white = \"#ffffff\";\nconst Color = {\n // Product\n blue: \"#1865f2\",\n purple: \"#9059ff\",\n green: \"#00a60e\",\n gold: \"#ffb100\",\n red: \"#d92916\",\n // Neutral\n offBlack,\n offBlack64: fade(offBlack, 0.64),\n offBlack50: fade(offBlack, 0.5),\n offBlack32: fade(offBlack, 0.32),\n offBlack16: fade(offBlack, 0.16),\n offBlack8: fade(offBlack, 0.08),\n offWhite: \"#f7f8fa\",\n white,\n white64: fade(white, 0.64),\n white50: fade(white, 0.5),\n // Brand\n darkBlue: \"#0a2a66\",\n teal: \"#14bf96\",\n lightBlue: \"#37c5fd\",\n pink: \"#fa50ae\"\n};\nconst SemanticColor = {\n controlDefault: Color.blue,\n controlDestructive: Color.red\n};\n\nexport default Color;\nexport { SemanticColor, fade, mix };\n","import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/extends';\nimport * as React from 'react';\nimport { StyleSheet } from 'aphrodite';\nimport { withRouter, Link } from 'react-router-dom';\nimport { __RouterContext } from 'react-router';\nimport { addStyle } from '@khanacademy/wonder-blocks-core';\nimport Color from '@khanacademy/wonder-blocks-color';\n\nconst getAppropriateTriggersForRole = role => {\n switch (role) {\n case \"link\":\n return {\n triggerOnEnter: true,\n triggerOnSpace: false\n };\n\n case \"checkbox\":\n case \"radio\":\n case \"listbox\":\n case \"option\":\n return {\n triggerOnEnter: false,\n triggerOnSpace: true\n };\n\n case \"button\":\n case \"menuitem\":\n case \"menu\":\n default:\n return {\n triggerOnEnter: true,\n triggerOnSpace: true\n };\n }\n};\n\nconst disabledHandlers = {\n onClick: () => void 0,\n onMouseEnter: () => void 0,\n onMouseLeave: () => void 0,\n onMouseDown: () => void 0,\n onMouseUp: () => void 0,\n onDragStart: () => void 0,\n onTouchStart: () => void 0,\n onTouchEnd: () => void 0,\n onTouchCancel: () => void 0,\n onKeyDown: () => void 0,\n onKeyUp: () => void 0,\n tabIndex: 0\n};\nconst keyCodes = {\n enter: 13,\n space: 32\n};\nconst startState = {\n hovered: false,\n focused: false,\n pressed: false,\n waiting: false\n};\nclass ClickableBehavior extends React.Component {\n static getDerivedStateFromProps(props, state) {\n if (props.disabled) {\n return _extends({}, startState, {\n focused: state.focused\n });\n } else {\n return null;\n }\n }\n\n constructor(props) {\n super(props);\n\n this.handleClick = e => {\n const {\n onClick = undefined,\n beforeNav = undefined,\n safeWithNav = undefined\n } = this.props;\n\n if (this.enterClick) {\n return;\n }\n\n if (onClick || beforeNav || safeWithNav) {\n this.waitingForClick = false;\n }\n\n this.runCallbackAndMaybeNavigate(e);\n };\n\n this.handleMouseEnter = e => {\n if (e.buttons === 1) {\n this.dragging = true;\n this.setState({\n pressed: true\n });\n } else if (!this.waitingForClick) {\n this.setState({\n hovered: true\n });\n }\n };\n\n this.handleMouseLeave = () => {\n if (!this.waitingForClick) {\n this.dragging = false;\n this.setState({\n hovered: false,\n pressed: false,\n focused: false\n });\n }\n };\n\n this.handleMouseDown = () => {\n this.setState({\n pressed: true\n });\n };\n\n this.handleMouseUp = e => {\n if (this.dragging) {\n this.dragging = false;\n this.handleClick(e);\n }\n\n this.setState({\n pressed: false,\n focused: false\n });\n };\n\n this.handleDragStart = e => {\n this.dragging = true;\n e.preventDefault();\n };\n\n this.handleTouchStart = () => {\n this.setState({\n pressed: true\n });\n };\n\n this.handleTouchEnd = () => {\n this.setState({\n pressed: false\n });\n this.waitingForClick = true;\n };\n\n this.handleTouchCancel = () => {\n this.setState({\n pressed: false\n });\n this.waitingForClick = true;\n };\n\n this.handleKeyDown = e => {\n const {\n onKeyDown,\n role\n } = this.props;\n\n if (onKeyDown) {\n onKeyDown(e);\n }\n\n const keyCode = e.which || e.keyCode;\n const {\n triggerOnEnter,\n triggerOnSpace\n } = getAppropriateTriggersForRole(role);\n\n if (triggerOnEnter && keyCode === keyCodes.enter || triggerOnSpace && keyCode === keyCodes.space) {\n e.preventDefault();\n this.setState({\n pressed: true\n });\n } else if (!triggerOnEnter && keyCode === keyCodes.enter) {\n this.enterClick = true;\n }\n };\n\n this.handleKeyUp = e => {\n const {\n onKeyUp,\n role\n } = this.props;\n\n if (onKeyUp) {\n onKeyUp(e);\n }\n\n const keyCode = e.which || e.keyCode;\n const {\n triggerOnEnter,\n triggerOnSpace\n } = getAppropriateTriggersForRole(role);\n\n if (triggerOnEnter && keyCode === keyCodes.enter || triggerOnSpace && keyCode === keyCodes.space) {\n this.setState({\n pressed: false,\n focused: true\n });\n this.runCallbackAndMaybeNavigate(e);\n } else if (!triggerOnEnter && keyCode === keyCodes.enter) {\n this.enterClick = false;\n }\n };\n\n this.handleFocus = e => {\n this.setState({\n focused: true\n });\n };\n\n this.handleBlur = e => {\n this.setState({\n focused: false,\n pressed: false\n });\n };\n\n this.state = startState;\n this.waitingForClick = false;\n this.enterClick = false;\n this.dragging = false;\n }\n\n navigateOrReset(shouldNavigate) {\n if (shouldNavigate) {\n const {\n history,\n href,\n skipClientNav,\n target = undefined\n } = this.props;\n\n if (href) {\n if (target === \"_blank\") {\n window.open(href, \"_blank\");\n this.setState({\n waiting: false\n });\n } else if (history && !skipClientNav) {\n history.push(href);\n this.setState({\n waiting: false\n });\n } else {\n window.location.assign(href);\n }\n }\n } else {\n this.setState({\n waiting: false\n });\n }\n }\n\n handleSafeWithNav(safeWithNav, shouldNavigate) {\n const {\n skipClientNav,\n history\n } = this.props;\n\n if (history && !skipClientNav || this.props.target === \"_blank\") {\n safeWithNav();\n this.navigateOrReset(shouldNavigate);\n return Promise.resolve();\n } else {\n if (!this.state.waiting) {\n this.setState({\n waiting: true\n });\n }\n\n return safeWithNav().then(() => {\n if (!this.state.waiting) {\n this.setState({\n waiting: true\n });\n }\n\n return;\n }).catch(error => {}).finally(() => {\n this.navigateOrReset(shouldNavigate);\n });\n }\n }\n\n runCallbackAndMaybeNavigate(e) {\n const {\n onClick = undefined,\n beforeNav = undefined,\n safeWithNav = undefined,\n href,\n type\n } = this.props;\n let shouldNavigate = true;\n let canSubmit = true;\n\n if (onClick) {\n onClick(e);\n }\n\n if (e.defaultPrevented) {\n shouldNavigate = false;\n canSubmit = false;\n }\n\n e.preventDefault();\n\n if (!href && type === \"submit\" && canSubmit) {\n let target = e.currentTarget;\n\n while (target) {\n if (target instanceof window.HTMLFormElement) {\n const event = new window.Event(\"submit\", {\n cancelable: true\n });\n target.dispatchEvent(event);\n break;\n }\n\n target = target.parentElement;\n }\n }\n\n if (beforeNav) {\n this.setState({\n waiting: true\n });\n beforeNav().then(() => {\n if (safeWithNav) {\n return this.handleSafeWithNav(safeWithNav, shouldNavigate);\n } else {\n return this.navigateOrReset(shouldNavigate);\n }\n }).catch(() => {});\n } else if (safeWithNav) {\n return this.handleSafeWithNav(safeWithNav, shouldNavigate);\n } else {\n this.navigateOrReset(shouldNavigate);\n }\n }\n\n render() {\n const childrenProps = this.props.disabled ? _extends({}, disabledHandlers, {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur\n }) : {\n onClick: this.handleClick,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n onMouseDown: this.handleMouseDown,\n onMouseUp: this.handleMouseUp,\n onDragStart: this.handleDragStart,\n onTouchStart: this.handleTouchStart,\n onTouchEnd: this.handleTouchEnd,\n onTouchCancel: this.handleTouchCancel,\n onKeyDown: this.handleKeyDown,\n onKeyUp: this.handleKeyUp,\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n tabIndex: 0\n };\n childrenProps.rel = this.props.rel || (this.props.target === \"_blank\" ? \"noopener noreferrer\" : undefined);\n const {\n children\n } = this.props;\n return children && children(this.state, childrenProps);\n }\n\n}\nClickableBehavior.defaultProps = {\n disabled: false\n};\n\nconst isClientSideUrl = href => {\n if (typeof href !== \"string\") {\n return false;\n }\n\n return !/^(https?:)?\\/\\//i.test(href) && !/^([^#]*#[\\w-]*|[\\w\\-.]+:)/.test(href);\n};\n\nconst ClickableBehaviorWithRouter = withRouter(ClickableBehavior);\nfunction getClickableBehavior(href, skipClientNav, router) {\n if (router && skipClientNav !== true && href && isClientSideUrl(href)) {\n return ClickableBehaviorWithRouter;\n }\n\n return ClickableBehavior;\n}\n\nconst _excluded = [\"href\", \"onClick\", \"skipClientNav\", \"beforeNav\", \"safeWithNav\", \"style\", \"target\", \"testId\", \"onKeyDown\", \"onKeyUp\", \"hideDefaultFocusRing\", \"light\", \"disabled\"];\nconst StyledAnchor = addStyle(\"a\");\nconst StyledButton = addStyle(\"button\");\nconst StyledLink = addStyle(Link);\nclass Clickable extends React.Component {\n constructor(...args) {\n super(...args);\n\n this.getCorrectTag = (clickableState, router, commonProps) => {\n const activeHref = this.props.href && !this.props.disabled;\n const useClient = router && !this.props.skipClientNav && isClientSideUrl(this.props.href || \"\");\n\n if (activeHref && useClient && this.props.href) {\n return React.createElement(StyledLink, _extends({}, commonProps, {\n to: this.props.href,\n role: this.props.role,\n target: this.props.target || undefined,\n \"aria-disabled\": this.props.disabled ? \"true\" : undefined\n }), this.props.children(clickableState));\n } else if (activeHref && !useClient) {\n return React.createElement(StyledAnchor, _extends({}, commonProps, {\n href: this.props.href,\n role: this.props.role,\n target: this.props.target || undefined,\n \"aria-disabled\": this.props.disabled ? \"true\" : undefined\n }), this.props.children(clickableState));\n } else {\n return React.createElement(StyledButton, _extends({}, commonProps, {\n type: \"button\",\n \"aria-disabled\": this.props.disabled\n }), this.props.children(clickableState));\n }\n };\n }\n\n renderClickableBehavior(router) {\n const _this$props = this.props,\n {\n href,\n onClick,\n skipClientNav,\n beforeNav = undefined,\n safeWithNav = undefined,\n style,\n target = undefined,\n testId,\n onKeyDown,\n onKeyUp,\n hideDefaultFocusRing,\n light,\n disabled\n } = _this$props,\n restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);\n\n const ClickableBehavior = getClickableBehavior(href, skipClientNav, router);\n\n const getStyle = state => [styles.reset, styles.link, !hideDefaultFocusRing && state.focused && (light ? styles.focusedLight : styles.focused), style];\n\n if (beforeNav) {\n return React.createElement(ClickableBehavior, {\n href: href,\n onClick: onClick,\n beforeNav: beforeNav,\n safeWithNav: safeWithNav,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n disabled: disabled\n }, (state, childrenProps) => this.getCorrectTag(state, router, _extends({}, restProps, {\n \"data-test-id\": testId,\n style: getStyle(state)\n }, childrenProps)));\n } else {\n return React.createElement(ClickableBehavior, {\n href: href,\n onClick: onClick,\n safeWithNav: safeWithNav,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n target: target,\n disabled: disabled\n }, (state, childrenProps) => this.getCorrectTag(state, router, _extends({}, restProps, {\n \"data-test-id\": testId,\n style: getStyle(state)\n }, childrenProps)));\n }\n }\n\n render() {\n return React.createElement(__RouterContext.Consumer, null, router => this.renderClickableBehavior(router));\n }\n\n}\nClickable.defaultProps = {\n light: false,\n disabled: false,\n \"aria-label\": \"\"\n};\nconst styles = StyleSheet.create({\n reset: {\n border: \"none\",\n margin: 0,\n padding: 0,\n width: \"auto\",\n overflow: \"visible\",\n background: \"transparent\",\n textDecoration: \"none\",\n color: \"inherit\",\n font: \"inherit\",\n boxSizing: \"border-box\",\n touchAction: \"manipulation\",\n userSelect: \"none\",\n outline: \"none\",\n lineHeight: \"normal\",\n WebkitFontSmoothing: \"inherit\",\n MozOsxFontSmoothing: \"inherit\"\n },\n link: {\n cursor: \"pointer\"\n },\n focused: {\n outline: `solid 2px ${Color.blue}`\n },\n focusedLight: {\n outline: `solid 2px ${Color.white}`\n }\n});\n\nexport { ClickableBehavior, Clickable as default, getClickableBehavior, isClientSideUrl };\n","// @flow\n\nimport {components} from \"@khanacademy/perseus\";\nimport Clickable from \"@khanacademy/wonder-blocks-clickable\";\nimport Color from \"@khanacademy/wonder-blocks-color\";\nimport {StyleSheet} from \"aphrodite\";\nimport * as React from \"react\";\n\nconst {InlineIcon} = components;\n\ntype InlineIconProps = React.ElementConfig<typeof InlineIcon>;\n\ntype SectionControlButtonProps = {|\n icon: InlineIconProps,\n onClick: () => mixed,\n title: string,\n|};\n\nexport default class SectionControlButton extends React.Component<SectionControlButtonProps> {\n render(): React$Element<typeof Clickable> {\n const {icon, onClick, title} = this.props;\n\n return (\n <Clickable\n className={\n \"section-control-button \" +\n \"simple-button \" +\n \"simple-button--small \"\n }\n onClick={(e) => {\n e.preventDefault();\n onClick();\n }}\n role=\"button\"\n hideDefaultFocusRing={true}\n aria-label={title}\n style={styles.button}\n >\n {({hovered, focused, pressed}) => <InlineIcon {...icon} />}\n </Clickable>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n button: {\n backgroundColor: Color.gold,\n margin: 2,\n paddingRight: 10,\n paddingLeft: 10,\n paddingBottom: 2,\n },\n});\n","// @flow\nimport {\n components,\n icons,\n preprocessTex,\n Dependencies,\n Errors,\n Log,\n PerseusError,\n PerseusMarkdown,\n Util,\n Widgets,\n WIDGET_PROP_BLACKLIST,\n} from \"@khanacademy/perseus\";\nimport $ from \"jquery\";\n// eslint-disable-next-line import/no-unresolved\nimport typeof katex from \"katex\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport _ from \"underscore\";\n\nimport DragTarget from \"./components/drag-target.jsx\";\nimport KatexErrorView from \"./katex-error-view.jsx\";\nimport SectionControlButton from \"./section-control-button.jsx\";\n\nimport type {Alignment, ChangeHandler, WidgetInfo} from \"@khanacademy/perseus\";\n\nconst {InlineIcon, PropCheckBox} = components;\nconst {iconChevronDown, iconChevronRight, iconTrash} = icons;\n\n// like [[snowman input-number 1]]\nconst widgetPlaceholder = \"[[\\u2603 {id}]]\";\nconst widgetRegExp = \"(\\\\[\\\\[\\u2603 {id}\\\\]\\\\])\";\nconst rWidgetSplit = new RegExp(\n widgetRegExp.replace(\"{id}\", \"[a-z-]+ [0-9]+\"),\n \"g\",\n);\n\nconst shortcutRegexp = /^\\[\\[([a-z-]+)$/; // like [[nu, [[int, etc\n\nconst ENDS_WITH_A_PARAGRAPH = /(?:\\n{2,}|^\\n*)$/;\nconst TRAILING_NEWLINES = /(\\n*)$/;\nconst LEADING_NEWLINES = /^(\\n*)/;\n\nconst commafyInteger = (n) => {\n let str = n.toString();\n if (str.length >= 5) {\n str = str.replace(/(\\d)(?=(\\d{3})+$)/g, \"$1{,}\");\n }\n return str;\n};\nconst makeEndWithAParagraphIfNecessary = (content) => {\n if (!ENDS_WITH_A_PARAGRAPH.test(content)) {\n const match = TRAILING_NEWLINES.exec(content);\n if (match) {\n const newlines = match[1];\n return content + \"\\n\\n\".slice(0, 2 - newlines.length);\n }\n }\n return content;\n};\nconst makeStartWithAParagraphAlways = (content) => {\n const match = LEADING_NEWLINES.exec(content);\n if (!match) {\n return content;\n }\n const newlines = match[1];\n return \"\\n\\n\".slice(0, 2 - newlines.length) + content;\n};\n\ntype WidgetSelectProps = {|\n onChange?: (widgetType: string) => mixed,\n|};\n\nclass WidgetSelect extends React.Component<WidgetSelectProps> {\n shouldComponentUpdate() {\n return false;\n }\n\n handleChange = (e: SyntheticEvent<HTMLSelectElement>) => {\n const widgetType = e.currentTarget.value;\n if (widgetType === \"\") {\n // TODO(alpert): Not sure if change will trigger here\n // but might as well be safe\n return;\n }\n if (this.props.onChange) {\n this.props.onChange(widgetType);\n }\n };\n\n render(): React.Node {\n const widgets = Widgets.getPublicWidgets();\n const orderedWidgetNames = _.sortBy(_.keys(widgets), (name) => {\n return widgets[name].displayName;\n });\n const addWidgetString = \"Add a widget\\u2026\";\n return (\n <select value=\"\" onChange={this.handleChange}>\n <option value=\"\">{addWidgetString}</option>\n <option disabled>--</option>\n {_.map(orderedWidgetNames, (name) => {\n return (\n <option key={name} value={name}>\n {widgets[name].displayName}\n </option>\n );\n })}\n </select>\n );\n }\n}\n\ntype WidgetEditorProps = {|\n // Unserialized props\n id: string,\n onChange: (\n widgetInfo: WidgetInfo,\n cb?: () => mixed,\n silent?: boolean,\n ) => mixed,\n onRemove: () => mixed,\n apiOptions: any,\n\n ...WidgetInfo,\n|};\n\ntype WidgetEditorState = {|\n showWidget: boolean,\n widgetInfo: WidgetInfo,\n|};\n\nconst _upgradeWidgetInfo = (props: WidgetEditorProps): WidgetInfo => {\n // We can't call serialize here because this.refs.widget\n // doesn't exist before this component is mounted.\n const filteredProps = _.omit(props, WIDGET_PROP_BLACKLIST);\n return Widgets.upgradeWidgetInfoToLatestVersion(filteredProps);\n};\n\n// This component handles upgading widget editor props via prop\n// upgrade transforms. Widget editors will always be rendered\n// with all available transforms applied, but the results of those\n// transforms will not be propogated upwards until serialization.\n// eslint-disable-next-line react/no-unsafe\nclass WidgetEditor extends React.Component<\n WidgetEditorProps,\n WidgetEditorState,\n> {\n constructor(props: WidgetEditorProps) {\n super(props);\n this.state = {\n showWidget: false,\n widgetInfo: _upgradeWidgetInfo(props),\n };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: WidgetEditorProps) {\n this.setState({widgetInfo: _upgradeWidgetInfo(nextProps)});\n }\n\n _toggleWidget = (e: SyntheticEvent<>) => {\n e.preventDefault();\n this.setState({showWidget: !this.state.showWidget});\n };\n\n _handleWidgetChange = (\n newProps: WidgetEditorProps,\n cb: () => mixed,\n silent: boolean,\n ) => {\n const newWidgetInfo = ((Object.assign(\n {},\n this.state.widgetInfo,\n ): any): WidgetInfo);\n newWidgetInfo.options = Object.assign(\n // eslint-disable-next-line react/no-string-refs\n this.refs.widget.serialize(),\n newProps,\n );\n this.props.onChange(newWidgetInfo, cb, silent);\n };\n\n _toggleStatic = (e: Event) => {\n e.preventDefault();\n const newWidgetInfo = ((Object.assign({}, this.state.widgetInfo, {\n static: !this.state.widgetInfo.static,\n }): any): WidgetInfo);\n this.props.onChange(newWidgetInfo);\n };\n\n _handleAlignmentChange = (e: SyntheticEvent<HTMLSelectElement>) => {\n const newAlignment = ((e.currentTarget.value: any): Alignment);\n const newWidgetInfo = ((Object.assign(\n {},\n this.state.widgetInfo,\n ): any): WidgetInfo);\n newWidgetInfo.alignment = newAlignment;\n this.props.onChange(newWidgetInfo);\n };\n\n getSaveWarnings = () => {\n // eslint-disable-next-line react/no-string-refs\n const issuesFunc = this.refs.widget.getSaveWarnings;\n return issuesFunc ? issuesFunc() : [];\n };\n\n serialize = () => {\n // TODO(alex): Make this properly handle the case where we load json\n // with a more recent widget version than this instance of Perseus\n // knows how to handle.\n const widgetInfo = this.state.widgetInfo;\n return {\n type: widgetInfo.type,\n alignment: widgetInfo.alignment,\n static: widgetInfo.static,\n graded: widgetInfo.graded,\n // eslint-disable-next-line react/no-string-refs\n options: this.refs.widget.serialize(),\n version: widgetInfo.version,\n };\n };\n\n render(): React.Node {\n const widgetInfo = this.state.widgetInfo;\n\n const Ed = Widgets.getEditor(widgetInfo.type);\n let supportedAlignments: $ReadOnlyArray<Alignment>;\n if (this.props.apiOptions.showAlignmentOptions) {\n supportedAlignments = Widgets.getSupportedAlignments(\n widgetInfo.type,\n );\n } else {\n // NOTE(kevinb): \"default\" is not one in `validAlignments` in widgets.js.\n supportedAlignments = [\"default\"];\n }\n\n const supportsStaticMode = Widgets.supportsStaticMode(widgetInfo.type);\n\n const isUngradedEnabled = widgetInfo.type === \"transformer\";\n const gradedPropBox = (\n <PropCheckBox\n label=\"Graded:\"\n graded={widgetInfo.graded}\n onChange={this.props.onChange}\n />\n );\n\n return (\n <div className=\"perseus-widget-editor\">\n <div\n className={\n \"perseus-widget-editor-title \" +\n (this.state.showWidget ? \"open\" : \"closed\")\n }\n >\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n <a\n className=\"perseus-widget-editor-title-id\"\n href=\"#\"\n onClick={this._toggleWidget}\n >\n {this.props.id}\n {this.state.showWidget ? (\n <InlineIcon {...iconChevronDown} />\n ) : (\n <InlineIcon {...iconChevronRight} />\n )}\n </a>\n\n {supportsStaticMode && (\n <input\n type=\"button\"\n onClick={this._toggleStatic}\n className=\"simple-button--small\"\n value={\n widgetInfo.static\n ? \"Unset as static\"\n : \"Set as static\"\n }\n />\n )}\n {supportedAlignments.length > 1 && (\n <select\n className=\"alignment\"\n value={widgetInfo.alignment}\n onChange={this._handleAlignmentChange}\n >\n {supportedAlignments.map((alignment) => (\n <option key={alignment}>{alignment}</option>\n ))}\n </select>\n )}\n <SectionControlButton\n icon={iconTrash}\n onClick={() => {\n this.props.onRemove();\n }}\n title=\"Remove image widget\"\n />\n </div>\n <div\n className={\n \"perseus-widget-editor-content \" +\n (this.state.showWidget ? \"enter\" : \"leave\")\n }\n >\n {isUngradedEnabled && gradedPropBox}\n {Ed && (\n <Ed\n // eslint-disable-next-line react/no-string-refs\n ref=\"widget\"\n onChange={this._handleWidgetChange}\n static={widgetInfo.static}\n apiOptions={this.props.apiOptions}\n {...widgetInfo.options}\n />\n )}\n </div>\n </div>\n );\n }\n}\n\n// This is more general than the actual markdown image parsing regex,\n// which is fine for correctness since it should only mean we could\n// store extra image dimensions, unless the question is insanely\n// formatted.\n// A simplified regex here should hopefully be easier to keep in\n// sync if the markdown parsing changes, though if it becomes\n// easy to hook into the actual markdown regex without copy-pasting\n// it, we should do that.\nconst IMAGE_REGEX = /!\\[[^\\]]*\\]\\(([^\\s)]+)[^)]*\\)/g;\n\n/**\n * Find all the matches to a /g regex.\n *\n * Returns an array of the regex matches. Infinite loops if `regex` does not\n * have a /g modifier.\n *\n * Note: Returns an array of the capture objects, whereas String::match\n * ignores captures. If you don't need captures, use String::match\n */\nconst allMatches = function (regex, str) {\n const result = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const match = regex.exec(str);\n if (!match) {\n break;\n }\n result.push(match);\n }\n return result;\n};\n\n/**\n * Return an array of URLs of all the images in the given renderer\n * markdown.\n */\nconst imageUrlsFromContent = function (content) {\n return _.map(allMatches(IMAGE_REGEX, content), (capture) => capture[1]);\n};\n\ntype EditorProps = $ReadOnly<{|\n apiOptions: any,\n className?: string,\n content: string,\n replace?: any,\n placeholder: string,\n widgets: {|[name: string]: WidgetInfo|},\n images: any,\n disabled: boolean,\n widgetEnabled: boolean,\n immutableWidgets: boolean,\n showWordCount: boolean,\n warnNoPrompt: boolean,\n warnNoWidgets: boolean,\n imageUploader?: (file: string, callback: (url: string) => mixed) => mixed,\n onChange: ChangeHandler,\n|}>;\n\ntype DeafultProps = {|\n content: string,\n disabled: boolean,\n images: {...},\n immutableWidgets: boolean,\n placeholder: string,\n showWordCount: boolean,\n warnNoPrompt: boolean,\n warnNoWidgets: boolean,\n widgetEnabled: boolean,\n widgets: {|[name: string]: WidgetInfo|},\n|};\n\ntype EditorState = {|\n showKatexErrors: boolean,\n textAreaValue: string,\n katex?: katex,\n|};\n\n// eslint-disable-next-line react/no-unsafe\nclass Editor extends React.Component<EditorProps, EditorState> {\n lastUserValue: ?string;\n deferredChange: ?any;\n widgetIds: ?any;\n\n static defaultProps: DeafultProps = {\n content: \"\",\n placeholder: \"\",\n widgets: {},\n images: {},\n disabled: false,\n widgetEnabled: true,\n immutableWidgets: false,\n showWordCount: false,\n warnNoPrompt: false,\n warnNoWidgets: false,\n };\n\n state: EditorState = {\n katex: undefined,\n showKatexErrors: false,\n textAreaValue: this.props.content,\n };\n\n componentDidMount() {\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = null;\n\n // This can't be in componentWillMount because that's happening during\n // the middle of our parent's render, so we can't call\n // this.props.onChange during that, since it calls our parent's\n // setState\n this._sizeImages(this.props);\n // eslint-disable-next-line react/no-string-refs\n $(ReactDOM.findDOMNode(this.refs.textarea))\n .on(\"copy cut\", this._maybeCopyWidgets)\n .on(\"paste\", this._maybePasteWidgets);\n\n Dependencies.getDependencies()\n .getKaTeX()\n .then((katex) => {\n this.setState({\n katex,\n });\n });\n }\n\n // TODO(arun): This is a deprecated method, use the appropriate replacement\n UNSAFE_componentWillReceiveProps(nextProps: EditorProps) {\n if (this.props.content !== nextProps.content) {\n this.setState({textAreaValue: nextProps.content});\n }\n }\n\n componentDidUpdate(prevProps: EditorProps) {\n // TODO(alpert): Maybe fix React so this isn't necessary\n // eslint-disable-next-line react/no-string-refs\n const textarea = ReactDOM.findDOMNode(this.refs.textarea);\n\n // Slightly unorthodox method to ensure that programmatic text changes\n // are in the browser's undo stack.\n // See https://stackoverflow.com/questions/41273569/how-to-enable-ctrl-z-when-you-change-an-input-text-dynamically-with-react\n // Note: On unsupported browsers (*cough* Firefox *cough*) `execCommand`\n // will return false. However at least in Firefox setting `value` on a\n // textbox clears the undo stack so we don't get unexpected undo\n // behavior.\n if (this.lastUserValue !== null && textarea) {\n /**\n * TODO(somewhatabstract, JIRA-XXXX):\n * textarea should be refined with an instanceof check to\n * HTMLTextAreaElement so that these props are available.\n */\n // $FlowFixMe[prop-missing]\n textarea.focus();\n // $FlowFixMe[prop-missing]\n textarea.value = this.lastUserValue;\n // $FlowFixMe[prop-missing]\n textarea.selectionStart = 0;\n // $FlowFixMe[prop-missing]\n textarea.select(0, prevProps.content.length);\n if (\n document.execCommand(\n \"insertText\",\n false,\n this.props.content,\n ) === false\n ) {\n // This command is not implemented. Fall back to setting `value`\n // directly.\n // $FlowFixMe[prop-missing]\n textarea.value = this.props.content;\n }\n this.lastUserValue = null;\n }\n\n // This can't be in componentWillReceiveProps because that's happening\n // during the middle of our parent's render.\n if (this.props.content !== prevProps.content) {\n this._sizeImages(this.props);\n }\n }\n\n componentWillUnmount() {\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API.\n // eslint-disable-next-line no-restricted-syntax\n clearTimeout(this.deferredChange);\n }\n\n getWidgetEditor: (id: string, type: string) => void | React.Node = (\n id: string,\n type: string,\n ) => {\n if (!Widgets.getEditor(type)) {\n return;\n }\n return (\n <WidgetEditor\n key={id}\n ref={id}\n id={id}\n type={type}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this._handleWidgetEditorChange.bind(this, id)}\n // eslint-disable-next-line react/jsx-no-bind\n onRemove={this._handleWidgetEditorRemove.bind(this, id)}\n apiOptions={this.props.apiOptions}\n {...this.props.widgets[id]}\n />\n );\n };\n\n _handleWidgetEditorChange: (\n id: string,\n newWidgetInfo: WidgetInfo,\n cb?: () => mixed,\n silent?: boolean,\n ) => void = (\n id: string,\n newWidgetInfo: WidgetInfo,\n cb?: () => mixed,\n silent?: boolean,\n ) => {\n const widgets = Object.assign({}, this.props.widgets);\n widgets[id] = Object.assign({}, widgets[id], newWidgetInfo);\n this.props.onChange({widgets}, cb, silent);\n };\n\n _handleWidgetEditorRemove: (id: string) => void = (id: string) => {\n // eslint-disable-next-line react/no-string-refs\n const textarea = this.refs.textarea;\n const re = new RegExp(widgetRegExp.replace(\"{id}\", id), \"gm\");\n this.props.onChange({content: textarea.value.replace(re, \"\")});\n };\n\n /**\n * Calculate the size of all the images in props.content, and send\n * those sizes to this.props.images using props.onChange.\n */\n _sizeImages: (props: EditorProps) => void = (props: EditorProps) => {\n const imageUrls = imageUrlsFromContent(props.content);\n\n // Discard any images in our dimension table that no\n // longer exist in content.\n const images = _.pick(props.images, imageUrls);\n\n // Only calculate sizes for images that were not present previously.\n // Most content edits shouldn't have new images.\n // This could get weird in the case of multiple images with the same\n // URL, if you've changed the backing image size, but given graphie\n // hashes it's probably an edge case.\n const newImageUrls = _.filter(imageUrls, (url) => !images[url]);\n\n // TODO(jack): Q promises would make this nicer and only\n // fire once.\n _.each(newImageUrls, (url) => {\n Util.getImageSize(url, (width, height) => {\n // We keep modifying the same image object rather than a new\n // copy from this.props because all changes here are additive.\n // Maintaining old changes isn't strictly necessary if\n // props.onChange calls are not batched, but would be if they\n // were, so this is nice from that anti-race-condition\n // perspective as well.\n images[url] = {\n width: width,\n height: height,\n };\n props.onChange(\n {\n images: _.clone(images),\n },\n null, // callback\n true, // silent\n );\n });\n });\n };\n\n handleDrop: (e: DragEvent) => void = (e: DragEvent) => {\n const {imageUploader} = this.props;\n let content = this.state.textAreaValue || \"\";\n const dataTransfer = e.dataTransfer;\n\n if (!dataTransfer || !imageUploader) {\n return;\n }\n\n // files will hold something if the drag was from the desktop or a file\n // located on the user's computer.\n const files = dataTransfer.files;\n\n // ... but we only get a url if the drag originated in another window\n if (files.length === 0) {\n const imageUrl = dataTransfer.getData(\"URL\");\n\n if (imageUrl) {\n // TODO(joel) - relocate when the image upload dialog lands\n const newContent = content + \"\\n\\n\";\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = this.props.content;\n this.props.onChange({content: newContent});\n }\n\n return;\n }\n\n const origContent = this.state.textAreaValue;\n\n /* For each file we make sure it's an image, then create a sentinel -\n * snowman + identifier to insert into the current text. The sentinel\n * only lives there temporarily until we get a response back from the\n * server that the image is now hosted on AWS, at which time we replace\n * the temporary sentinel with the permanent url for the image.\n *\n * There is an abuse of tap in the middle of the pipeline to make sure\n * everything is sequenced in the correct order. We want to modify the\n * content (given any number of images) at the same time, i.e. only\n * once, so we do that step with the tap. After the content has been\n * changed we send off the request for each image.\n *\n * Note that the snowman doesn't do anything special in this case -\n * it's effectively just part of a broken link. Perseus could be\n * extended to recognize this sentinel and highlight it like for\n * widgets.\n */\n _(files)\n .chain()\n .map(function (file) {\n if (!file.type.match(\"image.*\")) {\n return null;\n }\n\n const sentinel = \"\\u2603 \" + _.uniqueId(\"image_\");\n // TODO(joel) - figure out how to temporarily include the image\n // before the server returns.\n content += \"\\n\\n\";\n\n return {file: file, sentinel: sentinel};\n })\n .reject(_.isNull)\n .tap(() => {\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = origContent;\n this.props.onChange({content: content});\n })\n .each((fileAndSentinel) => {\n imageUploader(fileAndSentinel.file, (url) => {\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = origContent;\n this.props.onChange({\n content: this.state.textAreaValue.replace(\n fileAndSentinel.sentinel,\n url,\n ),\n });\n });\n });\n };\n\n handleChange: (e: SyntheticEvent<HTMLTextAreaElement>) => void = (\n e: SyntheticEvent<HTMLTextAreaElement>,\n ) => {\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API.\n // eslint-disable-next-line no-restricted-syntax\n clearTimeout(this.deferredChange);\n this.setState({textAreaValue: e.currentTarget.value});\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API.\n // eslint-disable-next-line no-restricted-syntax\n this.deferredChange = setTimeout(() => {\n if (this.state.textAreaValue !== this.props.content) {\n this.props.onChange({content: this.state.textAreaValue});\n }\n }, this.props.apiOptions.editorChangeDelay);\n };\n\n _handleKeyDown: (e: SyntheticKeyboardEvent<HTMLTextAreaElement>) => void = (\n e: SyntheticKeyboardEvent<HTMLTextAreaElement>,\n ) => {\n // Tab-completion of widgets. For example, to insert an image:\n // type `[[im`, then tab.\n if (e.key === \"Tab\") {\n // eslint-disable-next-line react/no-string-refs\n const textarea = ReactDOM.findDOMNode(this.refs.textarea);\n\n // findDOMNode can also return Text, but we know it's an element.\n // $FlowFixMe[incompatible-call]\n const word = Util.textarea.getWordBeforeCursor(textarea);\n const matches = word.string.toLowerCase().match(shortcutRegexp);\n\n if (matches != null) {\n const text = matches[1];\n const widgets = Widgets.getAllWidgetTypes();\n const matchingWidgets = _.filter(widgets, (name) => {\n return name.substring(0, text.length) === text;\n });\n\n if (matchingWidgets.length === 1) {\n const widgetType = matchingWidgets[0];\n\n this._addWidgetToContent(\n this.props.content,\n [word.pos.start, word.pos.end + 1],\n widgetType,\n );\n }\n\n e.preventDefault();\n }\n }\n };\n\n _maybeCopyWidgets: (e: SyntheticEvent<HTMLTextAreaElement>) => void = (\n e: SyntheticEvent<HTMLTextAreaElement>,\n ) => {\n // If there are widgets being cut/copied, put the widget JSON in\n // localStorage.perseusLastCopiedWidgets to allow copy-pasting of\n // widgets between Editors. Also store the text to be pasted in\n // localStorage.perseusLastCopiedText since we want to know if the user\n // is actually pasting something originally from Perseus later.\n const textarea = e.currentTarget;\n const selectedText = textarea.value.substring(\n textarea.selectionStart,\n textarea.selectionEnd,\n );\n\n const widgetNames = _.map(\n selectedText.match(rWidgetSplit),\n (syntax) => {\n // $FlowFixMe[incompatible-use] exec could return null.\n return Util.rWidgetParts.exec(syntax)[1];\n },\n );\n\n const widgetData = _.pick(this.serialize().widgets, widgetNames);\n\n // $FlowIgnore[prop-missing] localStorage can be used as an object\n localStorage.perseusLastCopiedText = selectedText;\n // $FlowIgnore[prop-missing] localStorage can be used as an object\n localStorage.perseusLastCopiedWidgets = JSON.stringify(widgetData);\n\n Log.log(`Widgets copied: ${localStorage.perseusLastCopiedWidgets}`);\n };\n\n _maybePasteWidgets: (e: SyntheticEvent<HTMLTextAreaElement>) => void = (\n e: SyntheticEvent<HTMLTextAreaElement>,\n ) => {\n // Use the data from localStorage to paste any widgets we copied\n // before. Avoid name conflicts by renumbering pasted widgets so that\n // their numbers are always higher than the highest numbered widget of\n // their type.\n // TODO(sam): Fix widget numbering in the widget editor titles\n\n // $FlowIgnore[prop-missing] localStorage can be used as an object\n const widgetJSON = localStorage.perseusLastCopiedWidgets;\n // $FlowIgnore[prop-missing] localStorage can be used as an object\n const lastCopiedText = localStorage.perseusLastCopiedText;\n // $FlowIgnore[prop-missing] Unknown originalEvent\n const textToBePasted = e.originalEvent.clipboardData.getData(\"text\");\n\n // Only intercept if we have widget data to paste and the user is\n // pasting something originally from Perseus.\n // TODO(sam/aria/alex): Make it so that you can paste arbitrary text\n // (e.g. from a text editor) instead of exactly what was copied, and\n // let the widgetJSON match up with it. This would let you copy text\n // into a buffer, perform complex operations on it, then paste it back.\n if (widgetJSON && lastCopiedText === textToBePasted) {\n e.preventDefault();\n\n const widgetData = JSON.parse(widgetJSON);\n const safeWidgetMapping = this._safeWidgetNameMapping(widgetData);\n\n // Use safe widget name map to construct the new widget data\n // TODO(aria/alex): Don't use `rWidgetSplit` or other piecemeal\n // regexes directly; abstract this out so that we don't have to\n // worry about potential edge cases.\n const safeWidgetData = {};\n for (const [key, data] of Object.entries(widgetData)) {\n safeWidgetData[safeWidgetMapping[key]] = data;\n }\n const newWidgets = _.extend(safeWidgetData, this.props.widgets);\n\n // Use safe widget name map to construct new text\n const safeText = lastCopiedText.replace(rWidgetSplit, (syntax) => {\n const match = Util.rWidgetParts.exec(syntax);\n // $FlowFixMe[incompatible-use] exec could return null.\n const completeWidget = match[0];\n // $FlowFixMe[incompatible-use] exec could return null.\n const widget = match[1];\n return completeWidget.replace(\n widget,\n safeWidgetMapping[widget],\n );\n });\n\n // Add pasted text to previous content, replacing selected text to\n // replicate normal paste behavior.\n const textarea = e.currentTarget;\n const selectionStart = textarea.selectionStart;\n const newContent =\n this.state.textAreaValue.substr(0, selectionStart) +\n safeText +\n this.state.textAreaValue.substr(textarea.selectionEnd);\n\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = this.state.textAreaValue;\n this.props.onChange(\n {content: newContent, widgets: newWidgets},\n () => {\n const expectedCursorPosition =\n selectionStart + safeText.length;\n Util.textarea.moveCursor(textarea, expectedCursorPosition);\n },\n );\n }\n };\n\n _safeWidgetNameMapping: (widgetData: {[name: string]: any, ...}) => {...} =\n (widgetData: {[name: string]: any, ...}) => {\n // Helper function for _maybePasteWidgets.\n // For each widget about to be pasted, construct a mapping from\n // old widget name to a new widget name that doesn't have conflicts\n // with widgets already in the editor.\n // eg. If there is an \"image 2\" already present in the editor and we're\n // about to paste in two new images, return\n // { \"image 1\": \"image 3\", \"image 2\": \"image 4\" }\n\n // List of widgets about to be pasted as [[name, number], ...]\n const widgets = _.keys(widgetData).map((name) => name.split(\" \"));\n const widgetTypes = _.uniq(widgets.map((widget) => widget[0]));\n\n // List of existing widgets as [[name, number], ...]\n const existingWidgets = _.keys(this.props.widgets).map((name) =>\n name.split(\" \"),\n );\n\n // Mapping of widget type to a safe (non-conflicting) number\n // eg. { \"image\": 2, \"dropdown\": 1 }\n const safeWidgetNums = {};\n _.each(widgetTypes, (type) => {\n safeWidgetNums[type] = _.chain(existingWidgets)\n .filter((existingWidget) => existingWidget[0] === type)\n .map((existingWidget) => +existingWidget[1] + 1)\n .max()\n .value();\n // If there are no existing widgets _.max returns -Infinity\n safeWidgetNums[type] = Math.max(safeWidgetNums[type], 1);\n });\n\n // Construct mapping, incrementing the vals in safeWidgetNums as we go\n const safeWidgetMapping = {};\n _.each(widgets, (widget) => {\n const widgetName = widget.join(\" \");\n const widgetType = widget[0];\n\n safeWidgetMapping[\n widgetName\n ] = `${widgetType} ${safeWidgetNums[widgetType]}`;\n safeWidgetNums[widgetType]++;\n });\n\n return safeWidgetMapping;\n };\n\n _addWidgetToContent: (\n oldContent: string,\n cursorRange: $ReadOnlyArray<number>,\n widgetType: string,\n ) => void = (\n oldContent: string,\n cursorRange: $ReadOnlyArray<number>,\n widgetType: string,\n ) => {\n // eslint-disable-next-line react/no-string-refs\n const textarea = ReactDOM.findDOMNode(this.refs.textarea);\n\n // Note: we have to use _.map here instead of Array::map\n // because the results of a .match might be null if no\n // widgets were found.\n const allWidgetIds = _.map(oldContent.match(rWidgetSplit), (syntax) => {\n const match = Util.rWidgetParts.exec(syntax);\n // $FlowFixMe[incompatible-use] exec could return null.\n const type = match[2];\n // $FlowFixMe[incompatible-use] exec could return null.\n const num = +match[3];\n return [type, num];\n });\n\n const widgetNum = _.reduce(\n allWidgetIds,\n (currentNum, otherId) => {\n const [otherType, otherNum] = otherId;\n if (otherType === widgetType) {\n return Math.max(otherNum + 1, currentNum);\n }\n return currentNum;\n },\n 1,\n );\n\n const id = widgetType + \" \" + widgetNum;\n const widgetContent = widgetPlaceholder.replace(\"{id}\", id);\n\n // Add newlines before block-display widgets like graphs\n const isBlock = Widgets.getDefaultAlignment(widgetType) === \"block\";\n\n const prelude = oldContent.slice(0, cursorRange[0]);\n const postlude = oldContent.slice(cursorRange[1]);\n\n const newPrelude = isBlock\n ? makeEndWithAParagraphIfNecessary(prelude)\n : prelude;\n const newPostlude = isBlock\n ? makeStartWithAParagraphAlways(postlude)\n : postlude;\n\n const newContent = newPrelude + widgetContent + newPostlude;\n\n const newWidgets = _.clone(this.props.widgets);\n newWidgets[id] = {\n options: Widgets.getEditor(widgetType)?.defaultProps,\n type: widgetType,\n // Track widget version on creation, so that a widget editor\n // without a valid version prop can only possibly refer to a\n // pre-versioning creation time.\n version: Widgets.getVersion(widgetType),\n };\n\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = this.props.content;\n this.props.onChange(\n {\n content: newContent,\n widgets: newWidgets,\n },\n function () {\n Util.textarea.moveCursor(\n // findDOMNode can return Text but we know this is Element\n // $FlowFixMe[incompatible-call]\n textarea,\n // We want to put the cursor after the widget\n // and after any added newlines\n newContent.length - postlude.length,\n );\n },\n );\n };\n\n _addWidget: (widgetType: string) => void = (widgetType: string) => {\n // eslint-disable-next-line react/no-string-refs\n const textarea = this.refs.textarea;\n\n this._addWidgetToContent(\n this.props.content,\n [textarea.selectionStart, textarea.selectionEnd],\n widgetType,\n );\n textarea.focus();\n };\n\n addTemplate: (e: SyntheticEvent<HTMLTextAreaElement>) => void = (\n e: SyntheticEvent<HTMLTextAreaElement>,\n ) => {\n const templateType = e.currentTarget.value;\n if (templateType === \"\") {\n return;\n }\n e.currentTarget.value = \"\";\n\n let oldContent = this.props.content;\n\n // Force templates to have a blank line before them,\n // as they are usually used as block elements\n // (especially important for tables)\n oldContent = oldContent.replace(/\\n*$/, \"\\n\\n\");\n\n let template;\n if (templateType === \"table\") {\n template =\n \"header 1 | header 2 | header 3\\n\" +\n \"- | - | -\\n\" +\n \"data 1 | data 2 | data 3\\n\" +\n \"data 4 | data 5 | data 6\\n\" +\n \"data 7 | data 8 | data 9\";\n } else if (templateType === \"titledTable\") {\n template =\n \"|| **Table title** ||\\n\" +\n \"header 1 | header 2 | header 3\\n\" +\n \"- | - | -\\n\" +\n \"data 1 | data 2 | data 3\\n\" +\n \"data 4 | data 5 | data 6\\n\" +\n \"data 7 | data 8 | data 9\";\n } else if (templateType === \"alignment\") {\n template =\n \"$\\\\begin{align} x+5 &= 30 \\\\\\\\\\n\" +\n \"x+5-5 &= 30-5 \\\\\\\\\\n\" +\n \"x &= 25 \\\\end{align}$\";\n } else if (templateType === \"piecewise\") {\n template =\n \"$f(x) = \\\\begin{cases}\\n\" +\n \"7 & \\\\text{if }x=1 \\\\\\\\\\n\" +\n \"f(x-1)+5 & \\\\text{if }x > 1\\n\" +\n \"\\\\end{cases}$\";\n } else if (templateType === \"allWidgets\") {\n template = Widgets.getAllWidgetTypes()\n .map((type) => `[[${Util.snowman} ${type} 1]]`)\n .join(\"\\n\\n\");\n } else {\n throw new PerseusError(\n \"Invalid template type: \" + templateType,\n Errors.InvalidInput,\n {\n metadata: {templateType},\n },\n );\n }\n\n const newContent = oldContent + template;\n\n // See componentDidUpdate() for how this flag is used\n this.lastUserValue = this.props.content;\n this.props.onChange({content: newContent}, this.focusAndMoveToEnd);\n };\n\n getSaveWarnings: () => any = () => {\n // eslint-disable-next-line react/no-string-refs\n const widgetIds = _.intersection(this.widgetIds, _.keys(this.refs));\n const warnings = _(widgetIds)\n .chain()\n .map((id) => {\n // eslint-disable-next-line react/no-string-refs\n const issuesFunc = this.refs[id].getSaveWarnings;\n const issues = issuesFunc ? issuesFunc() : [];\n return _.map(issues, (issue) => id + \": \" + issue);\n })\n .flatten(true)\n .value();\n\n return warnings;\n };\n\n focus: () => void = () => {\n // eslint-disable-next-line react/no-string-refs\n const textarea = ReactDOM.findDOMNode(this.refs.textarea);\n if (textarea) {\n /**\n * TODO(somewhatabstract, JIRA-XXXX):\n * textarea should be refined with an instanceof check to\n * HTMLTextAreaElement so that these props are available.\n */\n // $FlowFixMe[prop-missing]\n textarea.focus();\n }\n };\n\n focusAndMoveToEnd: () => void = () => {\n this.focus();\n // eslint-disable-next-line react/no-string-refs\n const textarea = ReactDOM.findDOMNode(this.refs.textarea);\n if (textarea) {\n /**\n * TODO(somewhatabstract, JIRA-XXXX):\n * textarea should be refined with an instanceof check to\n * HTMLTextAreaElement so that these props are available.\n */\n // $FlowFixMe[prop-missing]\n textarea.selectionStart = textarea.value.length;\n // $FlowFixMe[prop-missing]\n textarea.selectionEnd = textarea.value.length;\n }\n };\n\n serialize: (options: any) => {|\n content: string,\n images: any,\n replace: any | void,\n widgets: {...},\n |} = (options: any) => {\n // need to serialize the widgets since the state might not be\n // completely represented in props. ahem //transformer// (and\n // interactive-graph and plotter).\n const widgets = {};\n // eslint-disable-next-line react/no-string-refs\n const widgetIds = _.intersection(this.widgetIds, _.keys(this.refs));\n _.each(widgetIds, (id) => {\n // eslint-disable-next-line react/no-string-refs\n widgets[id] = this.refs[id].serialize();\n });\n\n // Preserve the data associated with deleted widgets in their last\n // modified form. This is only intended to be useful in the context of\n // immediate cut and paste operations if Editor.serialize() is called\n // in between the two (which ideally should not be happening).\n // TODO(alex): Remove this once all widget.serialize() methods\n // have been fixed to only return props,\n // and the above no longer applies.\n if (options && options.keepDeletedWidgets) {\n _.chain(this.props.widgets)\n .keys()\n .reject((id) => _.contains(widgetIds, id))\n .each((id) => {\n widgets[id] = this.props.widgets[id];\n });\n }\n\n return {\n replace: this.props.replace,\n content: this.props.content,\n images: this.props.images,\n widgets: widgets,\n };\n };\n\n render(): React.Element<\"div\"> {\n let pieces;\n let widgets;\n let underlayPieces;\n let widgetsDropDown;\n let templatesDropDown;\n let widgetsAndTemplates;\n let wordCountDisplay;\n const katexErrorList = [];\n\n if (this.props.showWordCount) {\n const numChars = PerseusMarkdown.characterCount(this.props.content);\n const numWords = Math.floor(numChars / 6);\n wordCountDisplay = (\n <span\n className=\"perseus-editor-word-count\"\n title={\n \"~\" +\n commafyInteger(numWords) +\n \" words (\" +\n commafyInteger(numChars) +\n \" characters)\"\n }\n >\n {commafyInteger(numWords)}\n </span>\n );\n }\n\n const {katex} = this.state;\n\n if (this.props.widgetEnabled && katex) {\n pieces = Util.split(this.props.content, rWidgetSplit);\n widgets = {};\n underlayPieces = [];\n\n for (let i = 0; i < pieces.length; i++) {\n if (i % 2 === 0) {\n // Normal text\n underlayPieces.push(pieces[i]);\n\n const ast = PerseusMarkdown.parse(pieces[i]);\n\n PerseusMarkdown.traverseContent(ast, (node) => {\n if (node.type === \"math\" || node.type === \"blockMath\") {\n const content = preprocessTex(node.content);\n try {\n katex.renderToString(content, {\n colorIsTextColor: true,\n });\n } catch (e) {\n katexErrorList.push({\n math: content,\n message: e.message,\n });\n }\n }\n });\n } else {\n // Widget reference\n const match = Util.rWidgetParts.exec(pieces[i]);\n if (match != null) {\n const id = match[1];\n const type = match[2];\n\n const selected = false;\n // TODO(alpert):\n // var selected = focused && selStart === selEnd &&\n // offset <= selStart &&\n // selStart < offset + text.length;\n // if (selected) {\n // selectedWidget = id;\n // }\n\n const duplicate = id in widgets;\n\n widgets[id] = this.getWidgetEditor(id, type);\n const classes =\n (duplicate || !widgets[id] ? \"error \" : \"\") +\n (selected ? \"selected \" : \"\");\n const key = duplicate ? i : id;\n underlayPieces.push(\n <b className={classes} key={key}>\n {pieces[i]}\n </b>,\n );\n }\n }\n }\n\n // TODO(alpert): Move this to the content-change event handler\n // _.each(_.keys(this.props.widgets), function(id) {\n // if (!(id in widgets)) {\n // // It's strange if these preloaded options stick around\n // // since it's inconsistent with how things work if you\n // // don't have the serialize/deserialize step in the\n // // middle\n // // TODO(alpert): Save options in a consistent manner so\n // // that you can undo the deletion of a widget\n // delete this.props.widgets[id];\n // }\n // }, this);\n\n this.widgetIds = _.keys(widgets);\n widgetsDropDown = (\n // eslint-disable-next-line react/no-string-refs\n <WidgetSelect ref=\"widgetSelect\" onChange={this._addWidget} />\n );\n\n const insertTemplateString = \"Insert template\\u2026\";\n templatesDropDown = (\n <select onChange={this.addTemplate}>\n <option value=\"\">{insertTemplateString}</option>\n <option disabled>--</option>\n <option value=\"table\">Table</option>\n <option value=\"titledTable\">Titled table</option>\n <option value=\"alignment\">Aligned equations</option>\n <option value=\"piecewise\">Piecewise function</option>\n <option disabled>--</option>\n <option value=\"allWidgets\">\n All widgets (for testing)\n </option>\n </select>\n );\n\n if (!this.props.immutableWidgets) {\n const widgetNodes = ((Object.values(widgets): any): React.Node);\n widgetsAndTemplates = (\n <div className=\"perseus-editor-widgets\">\n <div className=\"perseus-editor-widgets-selectors\">\n {widgetsDropDown}\n {templatesDropDown}\n {wordCountDisplay}\n </div>\n {widgetNodes}\n </div>\n );\n // Prevent word count from being displayed elsewhere\n wordCountDisplay = null;\n }\n } else {\n underlayPieces = [this.props.content];\n }\n\n // Without this, the underlay isn't the proper size when the text ends\n // with a newline.\n underlayPieces.push(<br key=\"end\" />);\n\n const completeTextarea = [\n <div\n className=\"perseus-textarea-underlay\"\n // eslint-disable-next-line react/no-string-refs\n ref=\"underlay\"\n key=\"underlay\"\n >\n {underlayPieces}\n </div>,\n <textarea\n // eslint-disable-next-line react/no-string-refs\n ref=\"textarea\"\n key=\"textarea\"\n onChange={this.handleChange}\n onKeyDown={this._handleKeyDown}\n placeholder={this.props.placeholder}\n disabled={this.props.disabled}\n value={this.state.textAreaValue}\n />,\n ];\n\n let textareaWrapper;\n if (this.props.imageUploader) {\n textareaWrapper = (\n <DragTarget\n onDrop={this.handleDrop}\n className=\"perseus-textarea-pair\"\n >\n {completeTextarea}\n </DragTarget>\n );\n } else {\n textareaWrapper = (\n <div className=\"perseus-textarea-pair\">{completeTextarea}</div>\n );\n }\n\n // sync-start:widget-id-regex 1271666319 services/content-editing/perseus/translation/content_traversal.go\n // sync-start:widget-id-regex 447601219 services/static/javascript/perseus-all-package/util.js\n // sync-start:widget-id-regex 1400368396 content_internal/perseus_traversal.py\n const contentWithoutWidgets = this.props.content.replace(\n /\\[\\[\\u2603 (([a-z-]+) ([0-9]+))\\]\\]/g,\n \"\",\n );\n const noPrompt = contentWithoutWidgets.trim().length === 0;\n const noWidgets = !/\\[\\[\\u2603 (([a-z-]+) ([0-9]+))\\]\\]/g.test(\n this.props.content,\n );\n // sync-end:widget-id-regex\n\n const warningStyle = {\n borderTop: \"none\",\n padding: 4,\n backgroundColor: \"pink\",\n };\n\n return (\n <div\n className={\n \"perseus-single-editor \" + (this.props.className || \"\")\n }\n >\n {textareaWrapper}\n {katexErrorList.length > 0 && (\n <KatexErrorView errorList={katexErrorList} />\n )}\n {this.props.warnNoPrompt && noPrompt && (\n <div style={warningStyle}>\n Graded Groups should contain a prompt\n </div>\n )}\n {this.props.warnNoWidgets && noWidgets && (\n <div style={warningStyle}>\n Graded Groups should contain at least one widget\n </div>\n )}\n {wordCountDisplay}\n {widgetsAndTemplates}\n </div>\n );\n }\n}\n\nexport default Editor;\n","// @flow\n/**\n * Displays the given content in an iframe, isolating it from the parent page\n *\n * To simulate the environment of content rendered by itself, content previews\n * are rendered inside iframes, where components such as the math keypad work\n * because the body of the document is not the body of the editor. To make this\n * work, this component renders an iframe and can communicate objects to it\n * through postMessage. The recipient then needs to listen for these messages\n * and pull out the appropriate object stored in the parent's iframeDataStore\n * to get the data to render. When the iframe is loaded, it's javascript calls\n * its requestIframeData function in the parent, which triggers the parent to\n * send the current data.\n */\n\nimport {Log} from \"@khanacademy/perseus\";\nimport createReactClass from \"create-react-class\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nlet nextIframeID = 0;\nconst requestIframeData = {};\nconst updateIframeHeight = {};\nwindow.iframeDataStore = {};\n\n// This is called once after Perseus is loaded and the iframe\n// is ready to render content, then twice a second afterwards\n// to capture the result of animations.\nwindow.addEventListener(\"message\", (event) => {\n if (typeof event.data === \"string\") {\n // In Perseus, we expect the callback to exist, as it is added by\n // `IframeContentRenderer.componentDidMount()`. Unfortunately, this\n // event listener also gets added in Manticore (since we include Perseus\n // from there), and Crowdin fires its own \"message\" events. So we'll\n // just have to ignore the event when we can't find the callback.\n const callback = requestIframeData[event.data];\n if (callback) {\n callback();\n }\n } else if (event.data.id) {\n if (event.data.height !== undefined) {\n updateIframeHeight[event.data.id](event.data.height);\n } else if (event.data.lintWarnings) {\n // This is a lint report being sent back from the linter.\n // TODO:\n // We'll want to display the number of warnings in the HUD.\n // But for now, we just log it to the console\n Log.log(\"LINTER REPORT\", {\n lintWarnings: JSON.stringify(event.data.lintWarnings),\n });\n }\n }\n});\n\nconst IframeContentRenderer: $FlowFixMe = createReactClass({\n displayName: \"IframeContentRenderer\",\n\n propTypes: {\n // The HTML content to render to the iframe\n content: PropTypes.string.isRequired,\n\n // The data-* suffix for passing information to the iframe's JS\n datasetKey: PropTypes.any,\n\n // The value of the data-* attribute\n datasetValue: PropTypes.any,\n\n // Whether to make the iframe's height match its content's height,\n // used to prevent scrolling inside the iframe.\n seamless: PropTypes.bool,\n },\n\n componentDidMount: function () {\n // TODO(scottgrant): This is a hack to remove the deprecated call to\n // this.isMounted() but is still considered an anti-pattern.\n this._isMounted = true;\n\n this.iframeID = nextIframeID;\n nextIframeID++;\n\n this._prepareFrame();\n requestIframeData[this.iframeID] = () => {\n this.sendNewData(this._lastData);\n };\n\n updateIframeHeight[this.iframeID] = (height) => {\n this._lastHeight = height;\n if (this._isMounted && this.props.seamless) {\n // eslint-disable-next-line react/no-string-refs\n this.refs.container.style.height = height + \"px\";\n }\n };\n },\n\n shouldComponentUpdate: function (nextProps) {\n return (\n nextProps.content !== this.props.content ||\n nextProps.datasetValue !== this.props.datasetValue ||\n nextProps.seamless !== this.props.seamless\n );\n },\n\n componentDidUpdate: function (prevProps) {\n if (!this.props.seamless) {\n // eslint-disable-next-line react/no-string-refs\n this.refs.container.style.height = \"100%\";\n } else {\n // eslint-disable-next-line react/no-string-refs\n this.refs.container.style.height = this._lastHeight + \"px\";\n }\n\n if (\n prevProps.content !== this.props.content ||\n prevProps.datasetValue !== this.props.datasetValue\n ) {\n // Not just a change in seamless\n this._prepareFrame();\n }\n },\n\n componentWillUnmount: function () {\n requestIframeData[this.iframeID] = null;\n updateIframeHeight[this.iframeID] = null;\n\n this._isMounted = false;\n },\n\n _prepareFrame: function () {\n // Don't initialize the iframe until the page has loaded\n if (this._frame) {\n // eslint-disable-next-line react/no-string-refs\n this.refs.container.removeChild(this._frame);\n }\n\n this._frame = document.createElement(\"iframe\");\n this._frame.style.width = \"100%\";\n this._frame.style.height = \"100%\";\n\n if (this.props.datasetKey) {\n // If the user has specified a data-* attribute to place on the\n // iframe, we set it here. Right now, this is used to\n // communicate if the iframe should be enabling touch emulation.\n this._frame.dataset[this.props.datasetKey] =\n this.props.datasetValue;\n }\n this._frame.dataset.id = this.iframeID;\n\n if (this.props.seamless) {\n // The seamless prop is the same as the \"nochrome\" prop that\n // gets passed to DeviceFramer. If it is set, then we're going\n // to be displaying editor previews and want to leave some room\n // for lint indicators in the right margin. We use the dataset\n // as above to pass this information on to the perseus-frame\n // component inside the iframe\n this._frame.dataset.lintGutter = \"true\";\n }\n\n // To make sure the value of location.href inside the iframe is the\n // same as the location of the parent, we wait for the iframe to\n // load before writing contents. Without the wait, the location\n // inside the iframe becomes \"about:blank\", which causes problems\n // with loading $LAB.\n this._frame.onload = () => {\n this._frame.onload = null;\n\n // To prevent an issue with the contents of the iframe not being\n // loaded properly, where the javascript inside the iframe is\n // not executed, we push the content window write to the end\n // of the event queue.\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API\n // eslint-disable-next-line no-restricted-syntax\n setTimeout(() => {\n this._frame.contentWindow.document.open();\n this._frame.contentWindow.document.write(this.props.content);\n this._frame.contentWindow.document.close();\n });\n };\n\n // eslint-disable-next-line react/no-string-refs\n this.refs.container.appendChild(this._frame);\n },\n\n sendNewData: function (data) {\n if (this._isMounted && data && this._frame.contentWindow) {\n this._lastData = data;\n\n // We can't use JSON.stringify/parse for this because the apiOptions\n // includes the functions GroupMetadataEditor, groupAnnotator,\n // onFocusChange, and onInputError.\n window.iframeDataStore[this.iframeID] = data;\n this._frame.contentWindow.postMessage(this.iframeID, \"*\");\n }\n },\n\n render: function () {\n // eslint-disable-next-line react/no-string-refs\n return <div ref=\"container\" style={{width: \"100%\", height: \"100%\"}} />;\n },\n});\n\nexport default IframeContentRenderer;\n","/* eslint-disable jsx-a11y/anchor-is-valid */\n// @flow\n\n/**\n * An article editor. Articles are long-form pieces of content, composed of\n * multiple (Renderer) sections concatenated together.\n */\n\nimport {\n components,\n icons,\n ApiOptions,\n Changeable,\n Dependencies,\n Errors,\n PerseusError,\n} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport DeviceFramer from \"./components/device-framer.jsx\";\nimport JsonEditor from \"./components/json-editor.jsx\";\nimport Editor from \"./editor.jsx\";\nimport IframeContentRenderer from \"./iframe-content-renderer.jsx\";\nimport SectionControlButton from \"./section-control-button.jsx\";\n\nimport type {APIOptions} from \"@khanacademy/perseus\";\n\nconst {HUD, InlineIcon} = components;\nconst {iconCircleArrowDown, iconCircleArrowUp, iconPlus, iconTrash} = icons;\n\ntype RendererProps = {|\n content?: string,\n widgets?: Object,\n images?: Object,\n|};\n\ntype JsonType = RendererProps | $ReadOnlyArray<RendererProps>;\ntype DefaultProps = {|\n contentPaths?: $ReadOnlyArray<string>,\n json: JsonType,\n mode: \"diff\" | \"edit\" | \"json\" | \"preview\",\n screen: \"phone\" | \"tablet\" | \"desktop\",\n sectionImageUploadGenerator: (i: number) => React$Element<\"span\">,\n useNewStyles: boolean,\n|};\ntype PerseusArticleEditorProps = {|\n ...DefaultProps,\n apiOptions?: APIOptions,\n frameSource: string,\n imageUploader?: (string, (string) => mixed) => mixed,\n ...Changeable.ChangeableProps,\n|};\n\ntype State = {|\n highlightLint: boolean,\n|};\nexport default class ArticleEditor extends React.Component<\n PerseusArticleEditorProps,\n State,\n> {\n static defaultProps: DefaultProps = {\n contentPaths: [],\n // $FlowFixMe[incompatible-exact]\n json: [{}],\n mode: \"edit\",\n screen: \"desktop\",\n sectionImageUploadGenerator: () => <span />,\n useNewStyles: false,\n };\n\n state: State = {\n highlightLint: true,\n };\n\n componentDidMount() {\n this._updatePreviewFrames();\n }\n\n componentDidUpdate() {\n this._updatePreviewFrames();\n }\n\n _updatePreviewFrames() {\n if (this.props.mode === \"preview\") {\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"frame-all\"].sendNewData({\n type: \"article-all\",\n data: this._sections().map((section, i) => {\n return this._apiOptionsForSection(section, i);\n }),\n });\n } else if (this.props.mode === \"edit\") {\n this._sections().forEach((section, i) => {\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"frame-\" + i].sendNewData({\n type: \"article\",\n data: this._apiOptionsForSection(section, i),\n });\n });\n }\n }\n\n _apiOptionsForSection(section: RendererProps, sectionIndex: number): any {\n // eslint-disable-next-line react/no-string-refs\n const editor = this.refs[`editor${sectionIndex}`];\n return {\n apiOptions: {\n ...ApiOptions.defaults,\n ...this.props.apiOptions,\n\n // Alignment options are always available in article\n // editors\n showAlignmentOptions: true,\n isArticle: true,\n },\n json: section,\n useNewStyles: this.props.useNewStyles,\n linterContext: {\n contentType: \"article\",\n highlightLint: this.state.highlightLint,\n paths: this.props.contentPaths,\n },\n legacyPerseusLint: editor ? editor.getSaveWarnings() : [],\n };\n }\n\n _sections(): $ReadOnlyArray<RendererProps> {\n return Array.isArray(this.props.json)\n ? this.props.json\n : [this.props.json];\n }\n\n _renderEditor(): React$Element<\"div\"> {\n const {imageUploader, sectionImageUploadGenerator} = this.props;\n\n const apiOptions = {\n ...ApiOptions.defaults,\n ...this.props.apiOptions,\n\n // Alignment options are always available in article editors\n showAlignmentOptions: true,\n isArticle: true,\n };\n\n const {KatexProvider} = Dependencies.getDependencies();\n\n const sections = this._sections();\n\n return (\n <div className=\"perseus-editor-table\">\n {sections.map((section, i) => {\n return [\n <div className=\"perseus-editor-row\" key={i}>\n <div className=\"perseus-editor-left-cell\">\n <div className=\"pod-title\">\n Section {i + 1}\n <div\n style={{\n display: \"inline-block\",\n float: \"right\",\n }}\n >\n {sectionImageUploadGenerator(i)}\n <SectionControlButton\n icon={iconPlus}\n onClick={() => {\n this._handleAddSectionAfter(i);\n }}\n title=\"Add a new section after this one\"\n />\n {i + 1 < sections.length && (\n <SectionControlButton\n icon={iconCircleArrowDown}\n onClick={() => {\n this._handleMoveSectionLater(\n i,\n );\n }}\n title=\"Move this section down\"\n />\n )}\n {i > 0 && (\n <SectionControlButton\n icon={iconCircleArrowUp}\n onClick={() => {\n this._handleMoveSectionEarlier(\n i,\n );\n }}\n title=\"Move this section up\"\n />\n )}\n <SectionControlButton\n icon={iconTrash}\n onClick={() => {\n const msg =\n \"Are you sure you \" +\n \"want to delete section \" +\n (i + 1) +\n \"?\";\n /* eslint-disable no-alert */\n if (confirm(msg)) {\n this._handleRemoveSection(\n i,\n );\n }\n /* eslint-enable no-alert */\n }}\n title=\"Delete this section\"\n />\n </div>\n </div>\n <KatexProvider>\n <Editor\n {...section}\n apiOptions={apiOptions}\n imageUploader={imageUploader}\n onChange={_.partial(\n this._handleEditorChange,\n i,\n )}\n placeholder=\"Type your section text here...\"\n ref={\"editor\" + i}\n />\n </KatexProvider>\n </div>\n\n <div className=\"editor-preview\">\n {this._renderIframePreview(i, true)}\n </div>\n </div>,\n ];\n })}\n {this._renderAddSection()}\n {this._renderLinterHUD()}\n </div>\n );\n /* eslint-enable max-len */\n }\n\n _renderAddSection(): React$Element<\"div\"> {\n return (\n <div className=\"perseus-editor-row\">\n <div className=\"perseus-editor-left-cell\">\n <a\n href=\"#\"\n className=\"simple-button orange\"\n onClick={() => {\n this._handleAddSectionAfter(\n this._sections().length - 1,\n );\n }}\n >\n <InlineIcon {...iconPlus} /> Add a section\n </a>\n </div>\n </div>\n );\n }\n\n _renderLinterHUD(): React$Element<any> {\n return (\n <HUD\n message=\"Style warnings\"\n enabled={this.state.highlightLint}\n onClick={() => {\n this.setState({\n highlightLint: !this.state.highlightLint,\n });\n }}\n />\n );\n }\n\n _renderIframePreview(\n i: number | string,\n nochrome: boolean,\n ): React$Element<any> {\n const isMobile =\n this.props.screen === \"phone\" || this.props.screen === \"tablet\";\n\n return (\n <DeviceFramer deviceType={this.props.screen} nochrome={nochrome}>\n <IframeContentRenderer\n ref={\"frame-\" + i}\n key={this.props.screen}\n content={this.props.frameSource}\n datasetKey=\"mobile\"\n datasetValue={isMobile}\n seamless={nochrome}\n />\n </DeviceFramer>\n );\n }\n\n _renderPreviewMode(): React$Element<\"div\"> {\n return (\n <div className=\"standalone-preview\">\n {this._renderIframePreview(\"all\", false)}\n </div>\n );\n }\n\n _handleJsonChange: (newJson: JsonType) => void = (newJson) => {\n this.props.onChange({json: newJson});\n };\n\n _handleEditorChange: (i: number, newProps: RendererProps) => void = (\n i,\n newProps,\n ) => {\n const sections = _.clone(this._sections());\n sections[i] = _.extend({}, sections[i], newProps);\n this.props.onChange({json: sections});\n };\n\n _handleMoveSectionEarlier(i: number) {\n if (i === 0) {\n return;\n }\n const sections = _.clone(this._sections());\n const section = sections[i];\n sections.splice(i, 1);\n sections.splice(i - 1, 0, section);\n this.props.onChange({\n json: sections,\n });\n }\n\n _handleMoveSectionLater(i: number) {\n const sections = _.clone(this._sections());\n if (i + 1 === sections.length) {\n return;\n }\n const section = sections[i];\n sections.splice(i, 1);\n sections.splice(i + 1, 0, section);\n this.props.onChange({\n json: sections,\n });\n }\n\n _handleAddSectionAfter(i: number) {\n // We do a full serialization here because we\n // might be copying widgets:\n const sections = _.clone(this.serialize());\n // Here we do magic to allow you to copy-paste\n // things from the previous section into the new\n // section while preserving widgets.\n // To enable this, we preserve the widgets\n // object for the new section, but wipe out\n // the content.\n const newSection =\n i >= 0\n ? {\n widgets: sections[i].widgets,\n }\n : {};\n sections.splice(i + 1, 0, newSection);\n this.props.onChange({\n json: sections,\n });\n }\n\n _handleRemoveSection(i: number) {\n const sections = _.clone(this._sections());\n sections.splice(i, 1);\n this.props.onChange({\n json: sections,\n });\n }\n\n serialize(): JsonType {\n if (this.props.mode === \"edit\") {\n return this._sections().map((section, i) => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs[\"editor\" + i].serialize();\n });\n }\n if (this.props.mode === \"preview\" || this.props.mode === \"json\") {\n return this.props.json;\n }\n throw new PerseusError(\n \"Could not serialize; mode \" + this.props.mode + \" not found\",\n Errors.Internal,\n );\n }\n\n /**\n * Returns an array, with one element be section.\n * Each element is an array of lint warnings present in that section.\n *\n * This function can currently only be called in edit mode.\n */\n getSaveWarnings(): $ReadOnlyArray<RendererProps> {\n if (this.props.mode !== \"edit\") {\n // TODO(joshuan): We should be able to get save warnings in\n // preview mode.\n throw new PerseusError(\n \"Can only get save warnings in edit mode.\",\n Errors.NotAllowed,\n );\n }\n\n return this._sections().map((section, i) => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs[\"editor\" + i].getSaveWarnings();\n });\n }\n\n render(): React.Node {\n return (\n <div className=\"framework-perseus perseus-article-editor\">\n {this.props.mode === \"edit\" && this._renderEditor()}\n\n {this.props.mode === \"preview\" && this._renderPreviewMode()}\n\n {this.props.mode === \"json\" && (\n <div className=\"json-editor\">\n <div className=\"json-editor-warning\">\n <span>\n Warning: Editing in this mode can lead to broken\n articles!\n </span>\n </div>\n <JsonEditor\n multiLine={true}\n onChange={this._handleJsonChange}\n value={this.props.json}\n />\n </div>\n )}\n </div>\n );\n }\n}\n","// @flow\n/**\n * A component that displays controls for choosing a viewport size.\n * Renders three buttons: \"Phone\", \"Tablet\", and \"Desktop\".\n */\nimport {components, constants, icons} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nimport type {DeviceType} from \"@khanacademy/perseus\";\n\nconst {ButtonGroup, InlineIcon} = components;\nconst {devices} = constants;\nconst {iconDesktop, iconMobilePhone, iconTablet} = icons;\n\ntype Props = {|\n deviceType: DeviceType,\n onViewportSizeChanged: (DeviceType) => mixed,\n|};\n\nclass ViewportResizer extends React.Component<Props> {\n static propTypes = {\n // The current device type that is selected.\n deviceType: PropTypes.string.isRequired,\n // A callback that is passed (width, height) as the dimensions of the\n // viewport to resize to.\n onViewportSizeChanged: PropTypes.func.isRequired,\n };\n\n handleChange: (value: DeviceType) => void = (value: DeviceType) => {\n this.props.onViewportSizeChanged(value);\n };\n\n render(): React.Element<\"span\"> {\n const phoneButtonContents = (\n <span>\n <InlineIcon {...iconMobilePhone} /> Phone\n </span>\n );\n const tabletButtonContents = (\n <span>\n <InlineIcon {...iconTablet} /> Tablet\n </span>\n );\n const desktopButtonContents = (\n <span>\n <InlineIcon {...iconDesktop} /> Desktop\n </span>\n );\n\n // TODO(david): Allow input of custom viewport sizes.\n return (\n <span className=\"viewport-resizer\">\n Viewport:{\" \"}\n <ButtonGroup\n value={this.props.deviceType}\n allowEmpty={false}\n buttons={[\n {value: devices.PHONE, content: phoneButtonContents},\n {value: devices.TABLET, content: tabletButtonContents},\n {\n value: devices.DESKTOP,\n content: desktopButtonContents,\n },\n ]}\n onChange={this.handleChange}\n />\n </span>\n );\n }\n}\n\nexport default ViewportResizer;\n","/*\nSoftware License Agreement (BSD License)\n\nCopyright (c) 2009-2011, Kevin Decker <kpdecker@gmail.com>\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above\n copyright notice, this list of conditions and the\n following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the\n following disclaimer in the documentation and/or other\n materials provided with the distribution.\n\n* Neither the name of Kevin Decker nor the names of its\n contributors may be used to endorse or promote products\n derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n * Text diff implementation.\n *\n * This library supports the following APIS:\n * JsDiff.diffChars: Character by character diff\n * JsDiff.diffWords: Word (as defined by \\b regex) diff which ignores whitespace\n * JsDiff.diffLines: Line based diff\n *\n * JsDiff.diffCss: Diff targeted at CSS content\n *\n * These methods are based on the implementation proposed in\n * \"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986).\n * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927\n */\nvar JsDiff = (function() {\n /*jshint maxparams: 5*/\n function clonePath(path) {\n return { newPos: path.newPos, components: path.components.slice(0) };\n }\n function removeEmpty(array) {\n var ret = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n return ret;\n }\n function escapeHTML(s) {\n var n = s;\n n = n.replace(/&/g, '&');\n n = n.replace(/</g, '<');\n n = n.replace(/>/g, '>');\n n = n.replace(/\"/g, '"');\n\n return n;\n }\n\n var Diff = function(ignoreWhitespace) {\n this.ignoreWhitespace = ignoreWhitespace;\n };\n Diff.prototype = {\n diff: function(oldString, newString) {\n // Handle the identity case (this is due to unrolling editLength == 0\n if (newString === oldString) {\n return [{ value: newString }];\n }\n if (!newString) {\n return [{ value: oldString, removed: true }];\n }\n if (!oldString) {\n return [{ value: newString, added: true }];\n }\n\n newString = this.tokenize(newString);\n oldString = this.tokenize(oldString);\n\n var newLen = newString.length, oldLen = oldString.length;\n var maxEditLength = newLen + oldLen;\n var bestPath = [{ newPos: -1, components: [] }];\n\n // Seed editLength = 0\n var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);\n if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return bestPath[0].components;\n }\n\n for (var editLength = 1; editLength <= maxEditLength; editLength++) {\n for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {\n var basePath;\n var addPath = bestPath[diagonalPath-1],\n removePath = bestPath[diagonalPath+1];\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath-1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos+1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n this.pushComponent(basePath.components, oldString[oldPos], undefined, true);\n } else {\n basePath = clonePath(addPath);\n basePath.newPos++;\n this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined);\n }\n\n var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);\n\n if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return basePath.components;\n } else {\n bestPath[diagonalPath] = basePath;\n }\n }\n }\n },\n\n pushComponent: function(components, value, added, removed) {\n var last = components[components.length-1];\n if (last && last.added === added && last.removed === removed) {\n // We need to clone here as the component clone operation is just\n // as shallow array clone\n components[components.length-1] =\n {value: this.join(last.value, value), added: added, removed: removed };\n } else {\n components.push({value: value, added: added, removed: removed });\n }\n },\n extractCommon: function(basePath, newString, oldString, diagonalPath) {\n var newLen = newString.length,\n oldLen = oldString.length,\n newPos = basePath.newPos,\n oldPos = newPos - diagonalPath;\n while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) {\n newPos++;\n oldPos++;\n\n this.pushComponent(basePath.components, newString[newPos], undefined, undefined);\n }\n basePath.newPos = newPos;\n return oldPos;\n },\n\n equals: function(left, right) {\n var reWhitespace = /\\S/;\n if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) {\n return true;\n } else {\n return left === right;\n }\n },\n join: function(left, right) {\n return left + right;\n },\n tokenize: function(value) {\n return value;\n }\n };\n\n var CharDiff = new Diff();\n\n var WordDiff = new Diff(true);\n var WordWithSpaceDiff = new Diff();\n WordDiff.tokenize = WordWithSpaceDiff.tokenize = function(value) {\n return removeEmpty(value.split(/(\\s+|\\b)/));\n };\n\n var CssDiff = new Diff(true);\n CssDiff.tokenize = function(value) {\n return removeEmpty(value.split(/([{}:;,]|\\s+)/));\n };\n\n var LineDiff = new Diff();\n LineDiff.tokenize = function(value) {\n var retLines = [],\n lines = value.split(/^/m);\n\n for(var i = 0; i < lines.length; i++) {\n var line = lines[i],\n lastLine = lines[i - 1];\n\n // Merge lines that may contain windows new lines\n if (line == '\\n' && lastLine && lastLine[lastLine.length - 1] === '\\r') {\n retLines[retLines.length - 1] += '\\n';\n } else if (line) {\n retLines.push(line);\n }\n }\n\n return retLines;\n };\n\n return {\n Diff: Diff,\n\n diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); },\n diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); },\n diffWordsWithSpace: function(oldStr, newStr) { return WordWithSpaceDiff.diff(oldStr, newStr); },\n diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); },\n\n diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); },\n\n createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {\n var ret = [];\n\n ret.push('Index: ' + fileName);\n ret.push('===================================================================');\n ret.push('--- ' + fileName + (typeof oldHeader === 'undefined' ? '' : '\\t' + oldHeader));\n ret.push('+++ ' + fileName + (typeof newHeader === 'undefined' ? '' : '\\t' + newHeader));\n\n var diff = LineDiff.diff(oldStr, newStr);\n if (!diff[diff.length-1].value) {\n diff.pop(); // Remove trailing newline add\n }\n diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier\n\n function contextLines(lines) {\n return lines.map(function(entry) { return ' ' + entry; });\n }\n function eofNL(curRange, i, current) {\n var last = diff[diff.length-2],\n isLast = i === diff.length-2,\n isLastOfType = i === diff.length-3 && (current.added !== last.added || current.removed !== last.removed);\n\n // Figure out if this is the last line for the given file and missing NL\n if (!/\\n$/.test(current.value) && (isLast || isLastOfType)) {\n curRange.push('\\\');\n }\n }\n\n var oldRangeStart = 0, newRangeStart = 0, curRange = [],\n oldLine = 1, newLine = 1;\n for (var i = 0; i < diff.length; i++) {\n var current = diff[i],\n lines = current.lines || current.value.replace(/\\n$/, '').split('\\n');\n current.lines = lines;\n\n if (current.added || current.removed) {\n if (!oldRangeStart) {\n var prev = diff[i-1];\n oldRangeStart = oldLine;\n newRangeStart = newLine;\n\n if (prev) {\n curRange = contextLines(prev.lines.slice(-4));\n oldRangeStart -= curRange.length;\n newRangeStart -= curRange.length;\n }\n }\n curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?'+':'-') + entry; }));\n eofNL(curRange, i, current);\n\n if (current.added) {\n newLine += lines.length;\n } else {\n oldLine += lines.length;\n }\n } else {\n if (oldRangeStart) {\n // Close out any changes that have been output (or join overlapping)\n if (lines.length <= 8 && i < diff.length-2) {\n // Overlapping\n curRange.push.apply(curRange, contextLines(lines));\n } else {\n // end the range and output\n var contextSize = Math.min(lines.length, 4);\n ret.push(\n '@@ -' + oldRangeStart + ',' + (oldLine-oldRangeStart+contextSize)\n + ' +' + newRangeStart + ',' + (newLine-newRangeStart+contextSize)\n + ' @@');\n ret.push.apply(ret, curRange);\n ret.push.apply(ret, contextLines(lines.slice(0, contextSize)));\n if (lines.length <= 4) {\n eofNL(ret, i, current);\n }\n\n oldRangeStart = 0; newRangeStart = 0; curRange = [];\n }\n }\n oldLine += lines.length;\n newLine += lines.length;\n }\n }\n\n return ret.join('\\n') + '\\n';\n },\n\n applyPatch: function(oldStr, uniDiff) {\n var diffstr = uniDiff.split('\\n');\n var diff = [];\n var remEOFNL = false,\n addEOFNL = false;\n\n for (var i = (diffstr[0][0]==='I'?4:0); i < diffstr.length; i++) {\n if(diffstr[i][0] === '@') {\n var meh = diffstr[i].split(/@@ -(\\d+),(\\d+) \\+(\\d+),(\\d+) @@/);\n diff.unshift({\n start:meh[3],\n oldlength:meh[2],\n oldlines:[],\n newlength:meh[4],\n newlines:[]\n });\n } else if(diffstr[i][0] === '+') {\n diff[0].newlines.push(diffstr[i].substr(1));\n } else if(diffstr[i][0] === '-') {\n diff[0].oldlines.push(diffstr[i].substr(1));\n } else if(diffstr[i][0] === ' ') {\n diff[0].newlines.push(diffstr[i].substr(1));\n diff[0].oldlines.push(diffstr[i].substr(1));\n } else if(diffstr[i][0] === '\\\\') {\n if (diffstr[i-1][0] === '+') {\n remEOFNL = true;\n } else if(diffstr[i-1][0] === '-') {\n addEOFNL = true;\n }\n }\n }\n\n var str = oldStr.split('\\n');\n for (var i = diff.length - 1; i >= 0; i--) {\n var d = diff[i];\n for (var j = 0; j < d.oldlength; j++) {\n if(str[d.start-1+j] !== d.oldlines[j]) {\n return false;\n }\n }\n Array.prototype.splice.apply(str,[d.start-1,+d.oldlength].concat(d.newlines));\n }\n\n if (remEOFNL) {\n while (!str[str.length-1]) {\n str.pop();\n }\n } else if (addEOFNL) {\n str.push('');\n }\n return str.join('\\n');\n },\n\n convertChangesToXML: function(changes){\n var ret = [];\n for ( var i = 0; i < changes.length; i++) {\n var change = changes[i];\n if (change.added) {\n ret.push('<ins>');\n } else if (change.removed) {\n ret.push('<del>');\n }\n\n ret.push(escapeHTML(change.value));\n\n if (change.added) {\n ret.push('</ins>');\n } else if (change.removed) {\n ret.push('</del>');\n }\n }\n return ret.join('');\n },\n\n // See: http://code.google.com/p/google-diff-match-patch/wiki/API\n convertChangesToDMP: function(changes){\n var ret = [], change;\n for ( var i = 0; i < changes.length; i++) {\n change = changes[i];\n ret.push([(change.added ? 1 : change.removed ? -1 : 0), change.value]);\n }\n return ret;\n }\n };\n})();\n\nif (typeof module !== 'undefined') {\n module.exports = JsDiff;\n}\n","// @flow\nimport jsdiff from \"jsdiff\";\nimport _ from \"underscore\";\n\nconst statusFor = function (chunk) {\n if (chunk.added) {\n return \"added\";\n }\n if (chunk.removed) {\n return \"removed\";\n }\n return \"unchanged\";\n};\n\n// Turn a chunk (which contains an array of values and a status)\n// into an array of values, each with the same status\nconst splitUpChunk = (chunk) =>\n _.map(chunk.value, (value) => {\n return {\n value: value,\n status: statusFor(chunk),\n };\n });\n\n// Apply `fn` to every element in `lst` and then concatenate all the results\n// http://clojuredocs.org/clojure_core/clojure.core/mapcat\nconst mapcat = function (lst, fn) {\n return _.flatten(_.map(lst, fn), true /* only flatten one level */);\n};\n\n// > ArrayDiff.diff([1,2,3], [2,3,4]);\n// = [{ \"value\": [1],\n// \"removed\": true },\n// { \"value\": [2, 3] },\n// { \"value\": [4],\n// \"added\": true }]\nconst ArrayDiff = new jsdiff.Diff();\nArrayDiff.tokenize = (array) => _.map(array, (elem) => [elem]);\n// The default is `+` for string concatenation, which doesn't work for array\n// concatenation.\nArrayDiff.join = (a, b) => a.concat(b);\n// By default jsDiff uses ===\nArrayDiff.equals = _.isEqual;\n\n// Take the output of jsdiff's function (which concatenates adjacent entries)\n// and make it just one entry per chunk\n// > flattenChunks([{ \"value\": [1],\n// \"removed\": true },\n// { \"value\": [2, 3] },\n// { \"value\": [4],\n// \"added\": true }])\n// = [{ \"value\":1, \"status\":\"removed\"},\n// { \"value\":2, \"status\":\"unchanged\"},\n// { \"value\":3, \"status\":\"unchanged\"},\n// { \"value\":4, \"status\":\"added\"}]\nconst flattenChunks = (chunks) => mapcat(chunks, splitUpChunk);\n\n// Take two arrays and create a diff for them. The result is two arrays of\n// objects, one for the things that should be included in a 'before', and one\n// for 'after'\nconst stringArrayDiff = function (\n a: $ReadOnlyArray<$FlowFixMe>,\n b: $ReadOnlyArray<$FlowFixMe>,\n): $FlowFixMe {\n const diffResult = ArrayDiff.diff(a, b);\n const flattened = flattenChunks(diffResult);\n\n return {\n before: _.filter(flattened, (entry) => entry.status !== \"added\"),\n after: _.filter(flattened, (entry) => entry.status !== \"removed\"),\n };\n};\n\nexport default stringArrayDiff;\n","/* eslint-disable react/no-unsafe */\n// @flow\nimport {components} from \"@khanacademy/perseus\";\nimport classNames from \"classnames\";\nimport jsdiff from \"jsdiff\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport splitDiff from \"./split-diff.jsx\";\nimport stringArrayDiff from \"./string-array-diff.jsx\";\n\nconst {SvgImage} = components;\n\nconst BEFORE = \"before\";\nconst AFTER = \"after\";\n\nconst IMAGE_REGEX = /http.*?\\.png|web\\+graphie[^)]*/g;\n\nconst imagesInString = function (str) {\n return str.match(IMAGE_REGEX) || [];\n};\n\nconst classFor = function (entry, ifAdded, ifRemoved) {\n if (entry.added) {\n return ifAdded;\n }\n if (entry.removed) {\n return ifRemoved;\n }\n return \"\";\n};\n\nclass ImageDiffSide extends React.Component<$FlowFixMe> {\n static propTypes = {\n images: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n };\n\n render(): React.Node {\n return (\n <div>\n {_.map(this.props.images, (entry, index) => {\n const className = classNames({\n image: true,\n \"image-unchanged\": entry.status === \"unchanged\",\n \"image-added\": entry.status === \"added\",\n \"image-removed\": entry.status === \"removed\",\n });\n return (\n <div key={index}>\n <div className={className}>\n {/* $FlowFixMe[prop-missing]: the alt prop is missing */}\n <SvgImage\n src={entry.value}\n title={entry.value}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n\nclass TextDiff extends React.Component<$FlowFixMe, $FlowFixMe> {\n static propTypes = {\n after: PropTypes.string,\n before: PropTypes.string,\n title: PropTypes.string.isRequired,\n };\n\n static defaultProps: $FlowFixMe = {\n after: \"\",\n before: \"\",\n };\n\n state: $FlowFixMe = {\n collapsed: this.props.before === this.props.after,\n };\n\n UNSAFE_componentWillReceiveProps(nextProps: $FlowFixMe) {\n this.setState({\n collapsed: nextProps.before === nextProps.after,\n });\n }\n\n handleExpand: () => void = () => {\n this.setState({collapsed: false});\n };\n\n render(): React.Node {\n const diffed = jsdiff.diffWords(this.props.before, this.props.after);\n\n const lines = splitDiff(diffed);\n\n const beforeImages = imagesInString(this.props.before);\n const afterImages = imagesInString(this.props.after);\n const images = stringArrayDiff(beforeImages, afterImages);\n\n const renderedLines = _.map(lines, (line) => {\n const contents = {};\n\n contents.before = _(line).map(function (entry, i) {\n return (\n <span\n key={i}\n className={classFor(\n entry,\n \"not-present\",\n \"removed dark\",\n )}\n >\n {entry.value}\n </span>\n );\n });\n\n contents.after = _(line).map(function (entry, i) {\n return (\n <span\n key={i}\n className={classFor(entry, \"added dark\", \"not-present\")}\n >\n {entry.value}\n </span>\n );\n });\n\n return contents;\n });\n\n const className = classNames({\n \"diff-row\": true,\n collapsed: this.state.collapsed,\n });\n\n return (\n <div>\n <div className=\"diff-header\">{this.props.title}</div>\n <div className=\"diff-header\">{this.props.title}</div>\n <div className=\"diff-body ui-helper-clearfix\">\n {_.map([BEFORE, AFTER], (side, index) => {\n return (\n <div className={\"diff-row \" + side} key={index}>\n {!this.state.collapsed &&\n _.map(renderedLines, (line, lineNum) => {\n const changed = line[side].length > 1;\n const lineClass = classNames({\n \"diff-line\": true,\n added: side === AFTER && changed,\n removed: side === BEFORE && changed,\n });\n return (\n <div\n className={lineClass}\n key={lineNum}\n >\n {line[side]}\n </div>\n );\n })}\n {!this.state.collapsed && (\n <ImageDiffSide images={images[side]} />\n )}\n </div>\n );\n })}\n </div>\n {_.map([BEFORE, AFTER], (side, index) => {\n return (\n <div\n className={className + \" \" + side}\n key={index}\n onClick={this.handleExpand}\n >\n {this.state.collapsed && (\n <span>\n <span className=\"expand-button\">\n {\" \"}\n [ show unmodified ]{\" \"}\n </span>\n </span>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n}\n\nexport default TextDiff;\n","// @flow\nimport _ from \"underscore\";\n\n// Split a word-wise diff generated by jsdiff into multiple lines, for the\n// purpose of breaking up the diffs into lines, so that modified lines can be\n// faintly highlighted\n\nconst splitDiff = function (diffEntries: $FlowFixMe): $FlowFixMe {\n const lines = [];\n let currentLine = [];\n _.each(diffEntries, (entry) => {\n const values = entry.value.split(\"\\n\");\n _.each(values, (value, i) => {\n const isNewline = i > 0;\n if (isNewline) {\n lines.push(currentLine);\n currentLine = [];\n }\n const newEntry = _.extend({}, entry, {value: value});\n currentLine.push(newEntry);\n });\n });\n\n if (currentLine.length) {\n lines.push(currentLine);\n }\n return lines;\n};\n\nexport default splitDiff;\n","// @flow\nimport _ from \"underscore\";\n\nconst UNCHANGED = \"unchanged\";\nconst CHANGED = \"changed\";\nconst ADDED = \"added\";\nconst REMOVED = \"removed\";\n\n// For values which do not have further values nested within them (strings,\n// numbers, and booleans)\nconst valueEntry = function (before, after, key) {\n let status;\n if (before === after) {\n status = UNCHANGED;\n } else if (before === undefined) {\n status = ADDED;\n } else if (after === undefined) {\n status = REMOVED;\n } else {\n status = CHANGED;\n }\n\n return {\n after: JSON.stringify(after),\n before: JSON.stringify(before),\n children: [],\n key: key,\n status: status,\n };\n};\n\n// For values which require a more granular diff (objects and arrays)\nconst objectEntry = function (before, after, key) {\n const beforeKeys = _.isObject(before) ? _(before).keys() : [];\n const afterKeys = _.isObject(after) ? _(after).keys() : [];\n const keys = _.union(beforeKeys, afterKeys);\n\n const children = _.map(keys, function (key) {\n return performDiff((before || {})[key], (after || {})[key], key);\n });\n\n let status;\n if (before === undefined) {\n status = ADDED;\n } else if (after === undefined) {\n status = REMOVED;\n } else {\n const changed = _.any(children, function (child) {\n return child.status !== UNCHANGED;\n });\n status = changed ? CHANGED : UNCHANGED;\n }\n\n return {\n after: \"\",\n before: \"\",\n children: children,\n key: key,\n status: status,\n };\n};\n\nconst performDiff = function (\n before: $FlowFixMe,\n after: $FlowFixMe,\n key?: $FlowFixMe,\n): $FlowFixMe {\n if (typeof before === \"object\" || typeof after === \"object\") {\n return objectEntry(before, after, key);\n }\n return valueEntry(before, after, key);\n};\n\nexport default performDiff;\n","// @flow\nimport {components} from \"@khanacademy/perseus\";\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport performDiff from \"./widget-diff-performer.jsx\";\n\nconst {SvgImage} = components;\n\nconst indentationFromDepth = function (depth) {\n return (depth - 1) * 20;\n};\n\nconst BEFORE = \"before\";\nconst AFTER = \"after\";\n\nconst UNCHANGED = \"unchanged\";\n\nclass DiffSide extends React.Component<$FlowFixMe> {\n static propTypes = {\n className: PropTypes.string.isRequired,\n depth: PropTypes.number.isRequired,\n propKey: PropTypes.string.isRequired,\n showKey: PropTypes.bool.isRequired,\n side: PropTypes.oneOf([BEFORE, AFTER]).isRequired,\n value: PropTypes.string,\n };\n\n render(): React.Node {\n const className = classNames(this.props.className, {\n \"diff-row\": true,\n before: this.props.side === BEFORE,\n after: this.props.side === AFTER,\n });\n return (\n <div className={className}>\n <div\n style={{\n paddingLeft: indentationFromDepth(this.props.depth),\n }}\n >\n {this.props.showKey && this.props.propKey + \": \"}\n <span\n className={\"inner-value dark \" + this.props.className}\n >\n {this.props.value}\n </span>\n </div>\n </div>\n );\n }\n}\n\nclass CollapsedRow extends React.Component<$FlowFixMe> {\n static propTypes = {\n depth: PropTypes.number,\n onClick: PropTypes.func.isRequired,\n };\n\n static defaultProps = {\n depth: 0,\n };\n\n render(): React.Node {\n const self = this;\n return (\n <div onClick={self.props.onClick} style={{clear: \"both\"}}>\n {_.map([BEFORE, AFTER], function (side) {\n return (\n <div\n className={\"diff-row collapsed \" + side}\n key={side}\n >\n <div\n style={{\n paddingLeft: indentationFromDepth(\n self.props.depth,\n ),\n }}\n >\n <span> [ show unmodified ] </span>\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n\n// Component representing a single property that may be nested.\nclass DiffEntry extends React.Component<$FlowFixMe, $FlowFixMe> {\n static propTypes = {\n depth: PropTypes.number,\n entry: PropTypes.shape({\n after: PropTypes.string,\n before: PropTypes.string,\n children: PropTypes.arrayOf(PropTypes.any),\n key: PropTypes.string,\n }),\n expanded: PropTypes.bool,\n };\n\n static defaultProps = {\n depth: 0,\n };\n\n state = {\n expanded: this.props.expanded,\n };\n\n expand = () => {\n this.setState({expanded: true});\n };\n\n render(): React.Node {\n const entry = this.props.entry;\n const propertyDeleted = entry.status === \"removed\";\n const propertyAdded = entry.status === \"added\";\n const propertyChanged = entry.status === \"changed\";\n\n const hasChildren = entry.children.length > 0;\n\n const leftClass = classNames({\n removed: propertyDeleted || (propertyChanged && !hasChildren),\n dark: propertyDeleted,\n \"blank-space\": propertyAdded,\n });\n\n const rightClass = classNames({\n added: propertyAdded || (propertyChanged && !hasChildren),\n dark: propertyAdded,\n \"blank-space\": propertyDeleted,\n });\n\n let shownChildren;\n if (this.state.expanded) {\n shownChildren = entry.children;\n } else {\n shownChildren = _(entry.children).select(function (child) {\n return child.status !== UNCHANGED;\n });\n }\n\n let collapsed = shownChildren.length < entry.children.length;\n\n // don't hide just one entry\n if (entry.children.length === shownChildren.length + 1) {\n shownChildren = entry.children;\n collapsed = false;\n }\n\n const self = this;\n return (\n <div>\n {entry.key && (\n <div style={{clear: \"both\"}}>\n <DiffSide\n side={BEFORE}\n className={leftClass}\n depth={this.props.depth}\n propKey={entry.key}\n showKey={!propertyAdded}\n value={entry.before}\n />\n <DiffSide\n side={AFTER}\n className={rightClass}\n depth={this.props.depth}\n propKey={entry.key}\n showKey={!propertyDeleted}\n value={entry.after}\n />\n </div>\n )}\n {_.map(shownChildren, function (child) {\n return (\n <DiffEntry\n key={child.key}\n depth={self.props.depth + 1}\n entry={child}\n expanded={self.state.expanded}\n />\n );\n })}\n {collapsed && (\n <CollapsedRow\n depth={this.props.depth + 1}\n onClick={this.expand}\n />\n )}\n </div>\n );\n }\n}\n\n// For image widgets, show the actual image\nclass ImageWidgetDiff extends React.Component<$FlowFixMe> {\n static propTypes = {\n after: PropTypes.shape({\n options: PropTypes.objectOf(PropTypes.any),\n }).isRequired,\n before: PropTypes.shape({\n options: PropTypes.objectOf(PropTypes.any),\n }).isRequired,\n };\n\n render(): React.Node {\n const {before, after} = this.props;\n const beforeSrc =\n before.options && before.options.backgroundImage\n ? before.options.backgroundImage.url\n : \"\";\n const afterSrc =\n after.options && after.options.backgroundImage\n ? after.options.backgroundImage.url\n : \"\";\n return (\n <div>\n <div className=\"diff-row before\">\n {beforeSrc && (\n <div\n className={classNames({\n image: true,\n \"image-unchanged\": beforeSrc === afterSrc,\n \"image-removed\": beforeSrc !== afterSrc,\n })}\n >\n {/* $FlowFixMe[prop-missing]: the alt props is missing */}\n <SvgImage src={beforeSrc} title={beforeSrc} />\n </div>\n )}\n </div>\n <div className=\"diff-row after\">\n {afterSrc && (\n <div\n className={classNames({\n image: true,\n \"image-unchanged\": beforeSrc === afterSrc,\n \"image-added\": beforeSrc !== afterSrc,\n })}\n >\n {/* $FlowFixMe[prop-missing]: the alt props is missing */}\n <SvgImage src={afterSrc} title={afterSrc} />\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n\nclass WidgetDiff extends React.Component<$FlowFixMe> {\n static propTypes = {\n after: PropTypes.shape({\n options: PropTypes.objectOf(PropTypes.any),\n }),\n before: PropTypes.shape({\n options: PropTypes.objectOf(PropTypes.any),\n }),\n title: PropTypes.string.isRequired,\n type: PropTypes.string,\n };\n\n static defaultProps: $FlowFixMe = {\n after: {},\n before: {},\n type: \"\",\n };\n\n render(): React.Node {\n const {after, before, title, type} = this.props;\n const diff = performDiff(before, after);\n return (\n <div>\n <div className=\"diff-header\">{title}</div>\n <div className=\"diff-header\">{title}</div>\n <div className=\"diff-body ui-helper-clearfix\">\n {type === \"image\" && (\n <ImageWidgetDiff before={before} after={after} />\n )}\n <DiffEntry entry={diff} />\n </div>\n </div>\n );\n }\n}\n\nexport default WidgetDiff;\n","// @flow\n/**\n * A side by side diff view for Perseus renderers.\n */\nimport {Widgets} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport TextDiff from \"./text-diff.jsx\";\nimport WidgetDiff from \"./widget-diff.jsx\";\n\nimport type {PerseusRenderer} from \"@khanacademy/perseus\";\n\n// In diffs, only show the widgetInfo props that can change\nconst filterWidgetInfo = function (widgetInfo, showAlignmentOptions) {\n const {alignment, graded, options, type} = widgetInfo || {};\n\n const filteredWidgetInfo = {options};\n\n // Show alignment options iff multiple valid ones exist for this widget\n if (\n showAlignmentOptions &&\n Widgets.getSupportedAlignments(type).length > 1\n ) {\n // $FlowFixMe[prop-missing]\n filteredWidgetInfo.alignment = alignment;\n }\n\n if (type === \"transformer\") {\n // $FlowFixMe[prop-missing]\n filteredWidgetInfo.graded = graded;\n }\n\n if (Widgets.supportsStaticMode(type)) {\n // $FlowFixMe[prop-missing]\n filteredWidgetInfo.static = widgetInfo?.static ?? undefined;\n }\n\n return filteredWidgetInfo;\n};\n\n// TODO(michaelpolyak): This type is very similar to `PerseusRenderer` type\n// found in `perseus-all-package/perseus-type.js`, consider just using it.\ntype RendererProps = {|\n content: string,\n\n // NOTE: images and widgets may not be set for some items hints,\n // specifically in old revisions, which may only be loaded for diffing.\n widgets: ?PerseusRenderer[\"widgets\"],\n images: ?PerseusRenderer[\"images\"],\n|};\n\ntype Props = {|\n // The \"after\" props of the renderer. Will be displayed on the right.\n after: RendererProps,\n\n // The \"before\" props of the renderer. Will be displayed on the left.\n before: RendererProps,\n\n // If true, show widget alignment options in the diff.\n showAlignmentOptions: boolean,\n\n // If true, render a horizontal rule after this diff.\n showSeparator: boolean,\n\n // The heading to render above the side by side diff.\n // (In a code review tool this would be the filename.)\n title: string,\n|};\n\nclass RendererDiff extends React.Component<Props> {\n static defaultProps: $Rest<Props, {|title: string|}> = {\n after: {\n content: \"\",\n images: {},\n widgets: {},\n },\n before: {\n content: \"\",\n images: {},\n widgets: {},\n },\n showAlignmentOptions: false,\n showSeparator: false,\n };\n\n render(): React.Node {\n const {after, before, showAlignmentOptions, showSeparator, title} =\n this.props;\n\n let textDiff;\n let widgetsDiff;\n\n if (before.content || after.content) {\n textDiff = (\n <TextDiff\n before={before.content}\n after={after.content}\n title={title}\n />\n );\n }\n\n const beforeWidgets = Object.keys(before.widgets ?? {}).filter(\n (widget) => before.content.includes(widget),\n );\n const afterWidgets = Object.keys(after.widgets ?? {}).filter((widget) =>\n after.content.includes(widget),\n );\n\n if (beforeWidgets.length || afterWidgets.length) {\n const widgets = _.union(beforeWidgets, afterWidgets);\n widgetsDiff = widgets.map((widget) => (\n <WidgetDiff\n before={filterWidgetInfo(\n before.widgets?.[widget],\n showAlignmentOptions,\n )}\n after={filterWidgetInfo(\n after.widgets?.[widget],\n showAlignmentOptions,\n )}\n title={widget}\n type={\n (before.widgets?.[widget] ?? {}).type ||\n (after.widgets?.[widget] ?? {}).type\n }\n key={widget}\n />\n ));\n }\n\n return (\n <div>\n {textDiff}\n {widgetsDiff}\n {showSeparator && <div className=\"diff-separator\" />}\n </div>\n );\n }\n}\n\nexport default RendererDiff;\n","/* eslint-disable react/no-unsafe */\n// @flow\n/**\n * A side by side diff view for Perseus articles.\n */\n\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport RendererDiff from \"./renderer-diff.jsx\";\n\nconst rendererProps = PropTypes.shape({\n content: PropTypes.string,\n images: PropTypes.objectOf(PropTypes.any),\n widgets: PropTypes.objectOf(PropTypes.any),\n});\n\ntype Props = $FlowFixMe;\ntype State = $FlowFixMe;\n\nclass ArticleDiff extends React.Component<Props, State> {\n static propTypes = {\n // TODO(alex): Check whether we still have any Perseus articles whose\n // top-level json is an object, not an array. If not, simplify here.\n after: PropTypes.oneOfType([\n rendererProps,\n PropTypes.arrayOf(rendererProps),\n ]).isRequired,\n before: PropTypes.oneOfType([\n rendererProps,\n PropTypes.arrayOf(rendererProps),\n ]).isRequired,\n };\n\n static _stateFromProps: (Props) => State = (props) => {\n const {before, after} = props;\n return {\n before: Array.isArray(before) ? before : [before],\n after: Array.isArray(after) ? after : [after],\n };\n };\n\n state: State = ArticleDiff._stateFromProps(this.props);\n\n UNSAFE_componentWillReceiveProps(nextProps: Props) {\n this.setState(ArticleDiff._stateFromProps(nextProps));\n }\n\n render(): React.Node {\n const {before, after} = this.state;\n\n const sectionCount = Math.max(before.length, after.length);\n\n const sections = _.times(sectionCount, (n) => (\n <RendererDiff\n before={n < before.length ? before[n] : undefined}\n after={n < after.length ? after[n] : undefined}\n title={`Section ${n + 1}`}\n showAlignmentOptions={true}\n showSeparator={n < sectionCount - 1}\n key={n}\n />\n ));\n\n return <div className=\"framework-perseus\">{sections}</div>;\n }\n}\n\nexport default ArticleDiff;\n","// @flow\n/**\n * A side by side diff view for Perseus exercise items\n * in the standard layout.\n */\n\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport RendererDiff from \"./renderer-diff.jsx\";\nimport WidgetDiff from \"./widget-diff.jsx\";\n\nconst itemProps = PropTypes.shape({\n question: PropTypes.shape({}).isRequired,\n answerArea: PropTypes.shape({}).isRequired,\n hints: PropTypes.arrayOf(PropTypes.any).isRequired,\n});\n\ntype Props = $FlowFixMe;\n\nclass ItemDiff extends React.Component<Props> {\n static propTypes = {\n after: itemProps.isRequired,\n before: itemProps.isRequired,\n };\n\n render(): React.Node {\n const {before, after} = this.props;\n\n const hintCount = Math.max(before.hints.length, after.hints.length);\n\n const question = (\n <RendererDiff\n before={before.question}\n after={after.question}\n title=\"Question\"\n showAlignmentOptions={false}\n showSeparator={true}\n />\n );\n\n const extras = (\n <WidgetDiff\n before={before.answerArea}\n after={after.answerArea}\n title=\"Question extras\"\n />\n );\n\n const hints = _.times(hintCount, function (n) {\n return (\n <RendererDiff\n before={\n n < before.hints.length ? before.hints[n] : undefined\n }\n after={n < after.hints.length ? after.hints[n] : undefined}\n title={`Hint ${n + 1}`}\n showAlignmentOptions={false}\n showSeparator={n < hintCount - 1}\n key={n}\n />\n );\n });\n\n return (\n <div className=\"framework-perseus\">\n {question}\n {extras}\n {hints && <div className=\"diff-separator\" />}\n {hints}\n </div>\n );\n }\n}\n\nexport default ItemDiff;\n","// @flow\n/**\n * A side by side diff view for general passage layout tags.\n */\n\nimport * as React from \"react\";\n\nimport TextDiff from \"./text-diff.jsx\";\n\ntype Props = {|\n afterOnly: $ReadOnlyArray<string>,\n beforeOnly: $ReadOnlyArray<string>,\n intersection: $ReadOnlyArray<string>,\n showSeparator: boolean,\n title: string,\n|};\n\nclass TagsDiff extends React.Component<Props> {\n static defaultProps: {|\n afterOnly: $ReadOnlyArray<any>,\n beforeOnly: $ReadOnlyArray<any>,\n showSeparator: boolean,\n title: string,\n |} = {\n afterOnly: [],\n beforeOnly: [],\n showSeparator: false,\n title: \"Question tags\",\n };\n\n render(): React.Element<\"div\"> {\n const {afterOnly, beforeOnly, intersection, showSeparator} = this.props;\n\n const beforeTags = intersection.concat(beforeOnly).join(\"\\n\") + \"\\n\";\n const afterTags = intersection.concat(afterOnly).join(\"\\n\") + \"\\n\";\n\n return (\n <div>\n <TextDiff\n before={beforeTags}\n after={afterTags}\n title={this.props.title}\n />\n {showSeparator && <div className=\"diff-separator\" />}\n </div>\n );\n }\n}\n\nexport default TagsDiff;\n","// @flow\n/**\n * A side by side diff view for Perseus exercise items\n * that do not have the standard question layout.\n */\nimport {\n buildEmptyItemTreeForShape,\n buildMapper,\n itemToTree,\n shapes,\n} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\n\nimport RendererDiff from \"./renderer-diff.jsx\";\nimport TagsDiff from \"./tags-diff.jsx\";\n\nimport type {Item, Path, Shape} from \"@khanacademy/perseus\";\n\ntype ItemList = [mixed, Path];\n\n/**\n * Outputs true if path begins with beginPath, false otherwise.\n */\nfunction beginsWith(path: Path, beginPath: Path): boolean {\n let matches = true;\n for (let i = 0; i < beginPath.length; i++) {\n if (i >= path.length) {\n return false;\n }\n if (beginPath[i] !== path[i]) {\n matches = false;\n }\n }\n return matches;\n}\n\n/**\n * Outputs true if beforePath and afterPath are the same.\n */\nfunction checkPath(beforePath: Path, afterPath: Path): boolean {\n if (beforePath.length !== afterPath.length) {\n return false;\n }\n for (let i = 0, l = beforePath.length; i < l; i++) {\n if (beforePath[i] !== afterPath[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Given a path, returns a title. Puts colons after numbers in the path.\n */\nfunction getTitle(path: Path): string {\n const title = [];\n for (let i = 0; i < path.length; i++) {\n if (typeof path[i] === \"number\") {\n title.push((path[i] + 1).toString() + \":\");\n } else {\n title.push(path[i]);\n }\n }\n return title.join(\" \");\n}\n\ntype Tag = {\n idToName: (string) => string,\n nameToId: (string) => string,\n names: $ReadOnlyArray<string>,\n ...\n};\n\ntype Props = {|\n after: Item,\n before: Item,\n shape: Shape,\n tags: Tag,\n|};\n\nclass StructuredItemDiff extends React.Component<Props> {\n /**\n * Traverses the given shape and adds paths that are present in\n * beforeList and afterList to result. Note that this method assumes\n * the order of elements in beforeList and afterList, which are\n * from buildMapper(), is the same order they appear in in the shape.\n */\n static generateCompletePathsList(\n // eslint-disable-next-line flowtype/no-mutable-array\n beforeList: Array<ItemList>,\n // eslint-disable-next-line flowtype/no-mutable-array\n afterList: Array<ItemList>,\n // eslint-disable-next-line flowtype/no-mutable-array\n result: Array<Path>,\n shape: Shape,\n path: $ReadOnlyArray<any>,\n ): void {\n if (\n shape.type === \"content\" ||\n shape.type === \"hint\" ||\n shape.type === \"tags\"\n ) {\n const beforePath =\n beforeList.length > 0 && checkPath(path, beforeList[0][1]);\n const afterPath =\n afterList.length > 0 && checkPath(path, afterList[0][1]);\n if (beforePath && afterPath) {\n result.push(path);\n beforeList.splice(0, 1);\n afterList.splice(0, 1);\n } else if (beforePath) {\n result.push(path);\n beforeList.splice(0, 1);\n } else if (afterPath) {\n result.push(path);\n afterList.splice(0, 1);\n }\n } else if (shape.type === \"array\") {\n let index = 0;\n let newPath = path.concat(index);\n\n // For array types, the paths will be in the form [<path>, n],\n // where n is an integer > 0 and increments.\n // As long as either beforeList or afterList has a next element that\n // matches [<path>, n], we recurse into that item with the new path.\n while (\n (beforeList.length > 0 &&\n beginsWith(beforeList[0][1], newPath)) ||\n (afterList.length > 0 && beginsWith(afterList[0][1], newPath))\n ) {\n StructuredItemDiff.generateCompletePathsList(\n beforeList,\n afterList,\n result,\n shape.elementShape,\n newPath,\n );\n index++;\n newPath = path.concat(index);\n }\n } else if (shape.type === \"object\") {\n const keys = Object.keys(shape.shape);\n for (let i = 0; i < keys.length; i++) {\n const newPath = path.concat([keys[i]]);\n StructuredItemDiff.generateCompletePathsList(\n beforeList,\n afterList,\n result,\n shape.shape[keys[i]],\n newPath,\n );\n }\n }\n }\n\n render(): React.Element<\"div\"> {\n const {before, after, shape, tags} = this.props;\n\n const beforeList = [];\n const afterList = [];\n\n buildMapper()\n .setContentMapper((c, _, p) => beforeList.push([c, p]))\n .setHintMapper((c, _, p) => beforeList.push([c, p]))\n .setTagsMapper((c, _, p) => beforeList.push([c, p]))\n .mapTree(itemToTree(before), shape);\n\n buildMapper()\n .setContentMapper((c, _, p) => afterList.push([c, p]))\n .setHintMapper((c, _, p) => afterList.push([c, p]))\n .setTagsMapper((c, _, p) => afterList.push([c, p]))\n .mapTree(itemToTree(after), shape);\n\n // These are used in generateCompletePathsList()\n // and are modified in that method.\n const beforeListModified = beforeList.slice();\n const afterListModified = afterList.slice();\n\n const allDiffPaths = [];\n StructuredItemDiff.generateCompletePathsList(\n beforeListModified,\n afterListModified,\n allDiffPaths,\n shape,\n [],\n );\n\n const diffCount = allDiffPaths.length;\n\n const diffs: React.Node = allDiffPaths.map((path, n) => {\n const isTag = path[path.length - 1] === \"tags\";\n const currentTitle = getTitle(path);\n\n let before = beforeList.find((e) => {\n return checkPath(e[1], path);\n });\n let after = afterList.find((e) => {\n return checkPath(e[1], path);\n });\n\n if (isTag) {\n if (!before) {\n before = [[], path];\n }\n if (!after) {\n after = [[], path];\n }\n\n const beforeTags = [];\n if (Array.isArray(before[0])) {\n before[0].forEach((tagId) => {\n if (typeof tagId === \"string\") {\n beforeTags.push(tags.idToName(tagId));\n }\n });\n }\n const afterTags = [];\n if (Array.isArray(after[0])) {\n after[0].forEach((tagId) => {\n if (typeof tagId === \"string\") {\n afterTags.push(tags.idToName(tagId));\n }\n });\n }\n\n const intersection = beforeTags.filter((tag) =>\n afterTags.includes(tag),\n );\n const beforeOnly = beforeTags.filter(\n (tag) => !afterTags.includes(tag),\n );\n const afterOnly = afterTags.filter(\n (tag) => !beforeTags.includes(tag),\n );\n\n return (\n <TagsDiff\n beforeOnly={beforeOnly}\n afterOnly={afterOnly}\n intersection={intersection}\n title={currentTitle}\n showSeparator={n < diffCount - 1}\n key={n}\n />\n );\n }\n if (!before) {\n before = [buildEmptyItemTreeForShape(shapes.content), path];\n }\n if (!after) {\n after = [buildEmptyItemTreeForShape(shapes.content), path];\n }\n return (\n <RendererDiff\n before={(before[0]: $FlowFixMe)}\n after={(after[0]: $FlowFixMe)}\n title={currentTitle}\n showAlignmentOptions={false}\n showSeparator={n < diffCount - 1}\n key={n}\n />\n );\n });\n\n return <div className=\"framework-perseus\">{diffs}</div>;\n }\n}\n\nexport default StructuredItemDiff;\n","/* eslint-disable @babel/no-invalid-this */\n// @flow\n/**\n * Collection of classes for rendering the hint editor area,\n * hint editor boxes, and hint previews\n */\nimport {components, icons} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport DeviceFramer from \"./components/device-framer.jsx\";\nimport Editor from \"./editor.jsx\";\nimport IframeContentRenderer from \"./iframe-content-renderer.jsx\";\n\nimport type {\n APIOptions,\n WidgetDict,\n ImageDict,\n Hint,\n ChangeHandler,\n DeviceType,\n} from \"@khanacademy/perseus\";\n\nconst {InfoTip, InlineIcon} = components;\nconst {iconCircleArrowDown, iconCircleArrowUp, iconPlus, iconTrash} = icons;\n\ntype ImageUploader = (file: string, callback: (url: string) => mixed) => mixed;\n\ntype HintEditorProps = {|\n itemId?: string,\n apiOptions?: APIOptions,\n className: string,\n imageUploader?: ImageUploader,\n showMoveButtons?: boolean,\n showRemoveButton?: boolean,\n showTitle?: boolean,\n content?: ?string,\n replace?: ?boolean,\n widgets?: ?WidgetDict,\n images?: ?ImageDict,\n isLast: boolean,\n isFirst: boolean,\n onMove: (direction: number) => mixed,\n onRemove: () => mixed,\n onChange: ChangeHandler,\n __type?: \"hint\",\n|};\n\n/* Renders a hint editor box\n *\n * This includes:\n * ~ A \"Hint\" title\n * ~ the textarea for the hint\n * ~ the \"remove this hint\" box\n * ~ the move hint up/down arrows\n */\nexport class HintEditor extends React.Component<HintEditorProps> {\n static defaultProps: {|\n className: string,\n content: string,\n replace: boolean,\n showMoveButtons: boolean,\n showRemoveButton: boolean,\n showTitle: boolean,\n |} = {\n className: \"\",\n content: \"\",\n replace: false,\n showMoveButtons: true,\n showTitle: true,\n showRemoveButton: true,\n };\n\n handleChange: (e: SyntheticInputEvent<>) => void = (\n e: SyntheticInputEvent<>,\n ) => {\n this.props.onChange({replace: e.target.checked});\n };\n\n focus: () => void = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.editor.focus();\n };\n\n getSaveWarnings: () => any = () => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.getSaveWarnings();\n };\n\n serialize: (options: any) => any = (options: $FlowFixMe) => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.serialize(options);\n };\n\n render(): React.Element<\"div\"> {\n return (\n <div className={\"perseus-hint-editor \" + this.props.className}>\n {this.props.showTitle && <div className=\"pod-title\">Hint</div>}\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"editor\"\n // Using the AssessmentItem content ID as the key\n // ensures that when the user navigates to another\n // item in the Sidebar, the question editor is\n // re-rendered by React.\n key={this.props.itemId}\n apiOptions={this.props.apiOptions}\n widgets={this.props.widgets || undefined}\n content={this.props.content || undefined}\n images={this.props.images}\n replace={this.props.replace}\n placeholder=\"Type your hint here...\"\n imageUploader={this.props.imageUploader}\n onChange={this.props.onChange}\n />\n <div className=\"hint-controls-container clearfix\">\n {this.props.showMoveButtons && (\n <span className=\"reorder-hints\">\n <button\n type=\"button\"\n className={this.props.isLast ? \"hidden\" : \"\"}\n onClick={_.partial(this.props.onMove, 1)}\n >\n <InlineIcon {...iconCircleArrowDown} />\n </button>{\" \"}\n <button\n type=\"button\"\n className={this.props.isFirst ? \"hidden\" : \"\"}\n onClick={_.partial(this.props.onMove, -1)}\n >\n <InlineIcon {...iconCircleArrowUp} />\n </button>{\" \"}\n {this.props.isLast && (\n <InfoTip>\n <p>\n The last hint is automatically bolded.\n </p>\n </InfoTip>\n )}\n </span>\n )}\n <input\n type=\"checkbox\"\n checked={this.props.replace}\n onChange={this.handleChange}\n />\n Replace previous hint\n {this.props.showRemoveButton && (\n <button\n type=\"button\"\n className=\"remove-hint simple-button orange\"\n onClick={this.props.onRemove}\n >\n <InlineIcon {...iconTrash} />\n Remove this hint{\" \"}\n </button>\n )}\n </div>\n </div>\n );\n }\n}\n\ntype CombinedHintEditorProps = {|\n itemId?: string,\n apiOptions?: APIOptions,\n deviceType: DeviceType,\n frameSource: string,\n imageUploader?: ImageUploader,\n highlightLint?: boolean,\n isLast: boolean,\n isFirst: boolean,\n hint: Hint,\n pos: number, // position\n contentPaths: $ReadOnlyArray<string>,\n onMove: (direction: number) => mixed,\n onRemove: () => mixed,\n onChange: ChangeHandler,\n|};\n\n/* A single hint-row containing a hint editor and preview */\nclass CombinedHintEditor extends React.Component<CombinedHintEditorProps> {\n static defaultProps = {\n highlightLint: false,\n };\n\n componentDidMount() {\n this.updatePreview();\n }\n\n componentDidUpdate() {\n this.updatePreview();\n }\n\n updatePreview = () => {\n const shouldBold =\n this.props.isLast && !/\\*\\*/.test(this.props.hint.content);\n\n // eslint-disable-next-line react/no-string-refs\n this.refs.frame.sendNewData({\n type: \"hint\",\n data: {\n hint: this.props.hint,\n bold: shouldBold,\n pos: this.props.pos,\n apiOptions: this.props.apiOptions,\n linterContext: {\n contentType: \"hint\",\n highlightLint: this.props.highlightLint,\n paths: this.props.contentPaths,\n },\n },\n });\n };\n\n getSaveWarnings = () => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.getSaveWarnings();\n };\n\n serialize = (options: $FlowFixMe) => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.serialize(options);\n };\n\n focus = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.editor.focus();\n };\n\n render(): React.Node {\n const isMobile =\n this.props.deviceType === \"phone\" ||\n this.props.deviceType === \"tablet\";\n return (\n <div\n className={\n \"perseus-combined-hint-editor \" + \"perseus-editor-row\"\n }\n >\n <div className=\"perseus-editor-left-cell\">\n <HintEditor\n // eslint-disable-next-line react/no-string-refs\n ref=\"editor\"\n itemId={this.props.itemId}\n isFirst={this.props.isFirst}\n isLast={this.props.isLast}\n widgets={this.props.hint.widgets}\n content={this.props.hint.content}\n images={this.props.hint.images}\n replace={this.props.hint.replace}\n imageUploader={this.props.imageUploader}\n onChange={this.props.onChange}\n onRemove={this.props.onRemove}\n onMove={this.props.onMove}\n apiOptions={this.props.apiOptions}\n />\n </div>\n <div className=\"perseus-editor-right-cell\">\n <DeviceFramer\n deviceType={this.props.deviceType}\n nochrome={true}\n >\n <IframeContentRenderer\n // eslint-disable-next-line react/no-string-refs\n ref=\"frame\"\n content={this.props.frameSource}\n datasetKey=\"mobile\"\n datasetValue={isMobile}\n seamless={true}\n />\n </DeviceFramer>\n </div>\n </div>\n );\n }\n}\n\ntype CombinedHintsEditorProps = {|\n apiOptions?: APIOptions,\n deviceType: DeviceType,\n frameSource: string,\n imageUploader?: ImageUploader,\n highlightLint?: boolean,\n hints: $ReadOnlyArray<Hint>,\n onChange: ChangeHandler,\n\n // The content ID of the AssessmentItem being edited. It may not be set\n // for non-content library exercise questions.\n itemId?: string,\n|};\n\n/* The entire hints editing/preview area\n *\n * Includes:\n * ~ All the hint edit boxes, move and remove buttons\n * ~ All the hint previews\n * ~ The \"add a hint\" button\n */\nclass CombinedHintsEditor extends React.Component<CombinedHintsEditorProps> {\n static HintEditor: typeof HintEditor = HintEditor;\n\n static defaultProps: {|\n highlightLint: boolean,\n hints: $ReadOnlyArray<any>,\n onChange: () => void,\n |} = {\n onChange: () => {},\n hints: [],\n highlightLint: false,\n };\n\n handleHintChange: (\n i: number,\n newProps: CombinedHintsEditorProps,\n cb: () => mixed,\n silent: boolean,\n ) => void = (\n i: number,\n newProps: CombinedHintsEditorProps,\n cb: () => mixed,\n silent: boolean,\n ) => {\n // TODO(joel) - lens\n const hints = _(this.props.hints).clone();\n hints[i] = _.extend(\n {},\n this.serializeHint(i, {keepDeletedWidgets: true}),\n newProps,\n );\n\n this.props.onChange({hints: hints}, cb, silent);\n };\n\n handleHintRemove: (i: number) => void = (i: number) => {\n const hints = _(this.props.hints).clone();\n hints.splice(i, 1);\n this.props.onChange({hints: hints});\n };\n\n handleHintMove: (i: number, dir: number) => void = (\n i: number,\n dir: number,\n ) => {\n const hints = _(this.props.hints).clone();\n const hint = hints.splice(i, 1)[0];\n hints.splice(i + dir, 0, hint);\n this.props.onChange({hints: hints}, () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"hintEditor\" + (i + dir)].focus();\n });\n };\n\n addHint: () => void = () => {\n const hints = _(this.props.hints)\n .clone()\n .concat([{content: \"\"}]);\n this.props.onChange({hints: hints}, () => {\n const i = hints.length - 1;\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"hintEditor\" + i].focus();\n });\n };\n\n getSaveWarnings: () => any = () => {\n return _.chain(this.props.hints)\n .map((hint, i) => {\n return _.map(\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"hintEditor\" + i].getSaveWarnings(),\n (issue) => \"Hint \" + (i + 1) + \": \" + issue,\n );\n })\n .flatten(true)\n .value();\n };\n\n serialize: (options: any) => $ReadOnlyArray<string> = (\n options: $FlowFixMe,\n ) => {\n return this.props.hints.map((hint, i) => {\n return this.serializeHint(i, options);\n });\n };\n\n serializeHint: (index: number, options: any) => string = (\n index: number,\n options: $FlowFixMe,\n ): string => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs[\"hintEditor\" + index].serialize(options);\n };\n\n render(): React.Element<\"div\"> {\n const {itemId, hints} = this.props;\n const hintElems = _.map(\n hints,\n function (hint, i) {\n return (\n <CombinedHintEditor\n ref={\"hintEditor\" + i}\n key={\"hintEditor\" + i}\n isFirst={i === 0}\n isLast={i + 1 === hints.length}\n itemId={itemId}\n hint={hint}\n pos={i}\n imageUploader={this.props.imageUploader}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.handleHintChange.bind(this, i)}\n // eslint-disable-next-line react/jsx-no-bind\n onRemove={this.handleHintRemove.bind(this, i)}\n // eslint-disable-next-line react/jsx-no-bind\n onMove={this.handleHintMove.bind(this, i)}\n deviceType={this.props.deviceType}\n apiOptions={this.props.apiOptions}\n frameSource={this.props.frameSource}\n highlightLint={this.props.highlightLint}\n // TODO(CP-4838): what should be passed here?\n contentPaths={[]}\n />\n );\n },\n this,\n );\n\n return (\n <div className=\"perseus-hints-editor perseus-editor-table\">\n {hintElems}\n <div className=\"perseus-editor-row\">\n <div className=\"add-hint-container perseus-editor-left-cell\">\n <button\n type=\"button\"\n className=\"add-hint simple-button orange\"\n onClick={this.addHint}\n >\n <InlineIcon {...iconPlus} /> Add a hint\n </button>\n </div>\n </div>\n </div>\n );\n /* eslint-enable max-len */\n }\n}\n\nexport default CombinedHintsEditor;\n","// @flow\nimport {components} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nconst {InfoTip} = components;\n\ntype Props = $FlowFixMe;\n\nclass ItemExtrasEditor extends React.Component<Props> {\n static propTypes = {\n calculator: PropTypes.bool,\n chi2Table: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n periodicTable: PropTypes.bool,\n tTable: PropTypes.bool,\n zTable: PropTypes.bool,\n };\n\n static defaultProps: Props = {\n calculator: false,\n chi2Table: false,\n periodicTable: false,\n tTable: false,\n zTable: false,\n };\n\n serialize: () => $FlowFixMe = () => {\n return {\n calculator: this.props.calculator,\n chi2Table: this.props.chi2Table,\n periodicTable: this.props.periodicTable,\n tTable: this.props.tTable,\n zTable: this.props.zTable,\n };\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-answer-editor\">\n <div className=\"perseus-answer-options\">\n <div>\n <label>\n Show calculator:{\" \"}\n <input\n type=\"checkbox\"\n checked={this.props.calculator}\n onChange={(e) => {\n this.props.onChange({\n calculator: e.target.checked,\n });\n }}\n />\n </label>\n <InfoTip>\n Use the calculator when completing difficult\n calculations is NOT the intent of the question.\n DON’T use the calculator when testing the student’s\n ability to complete different types of computations.\n </InfoTip>\n </div>\n\n <div>\n <label>\n Show periodic table:{\" \"}\n <input\n type=\"checkbox\"\n checked={this.props.periodicTable}\n onChange={(e) => {\n this.props.onChange({\n periodicTable: e.target.checked,\n });\n }}\n />\n </label>\n <InfoTip>\n This provides the student with the ability to view a\n periodic table of the elements, e.g., for answering\n chemistry questions.\n </InfoTip>\n </div>\n\n <div>\n <label>\n Show z table (statistics):{\" \"}\n <input\n type=\"checkbox\"\n checked={this.props.zTable}\n onChange={(e) => {\n this.props.onChange({\n zTable: e.target.checked,\n });\n }}\n />\n </label>\n <InfoTip>\n This provides the student with the ability to view a\n table of critical values for the z distribution,\n e.g. for answering statistics questions.\n </InfoTip>\n </div>\n\n <div>\n <label>\n Show t table (statistics):{\" \"}\n <input\n type=\"checkbox\"\n checked={this.props.tTable}\n onChange={(e) => {\n this.props.onChange({\n tTable: e.target.checked,\n });\n }}\n />\n </label>\n <InfoTip>\n This provides the student with the ability to view a\n table of critical values for the Student's t\n distribution, e.g. for answering statistics\n questions.\n </InfoTip>\n </div>\n\n <div>\n <label>\n Show chi-squared table (statistics):{\" \"}\n <input\n type=\"checkbox\"\n checked={this.props.chi2Table}\n onChange={(e) => {\n this.props.onChange({\n chi2Table: e.target.checked,\n });\n }}\n />\n </label>\n <InfoTip>\n This provides the student with the ability to view a\n table of critical values for the chi-squared\n distribution, e.g. for answering statistics\n questions.\n </InfoTip>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default ItemExtrasEditor;\n","// @flow\nimport {itemDataVersion} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport DeviceFramer from \"./components/device-framer.jsx\";\nimport Editor from \"./editor.jsx\";\nimport IframeContentRenderer from \"./iframe-content-renderer.jsx\";\nimport ItemExtrasEditor from \"./item-extras-editor.jsx\";\n\nimport type {\n APIOptions,\n ImageUploader,\n ChangeHandler,\n} from \"@khanacademy/perseus\";\n\nconst ITEM_DATA_VERSION = itemDataVersion;\n\ntype Props = {|\n apiOptions?: APIOptions,\n deviceType?: string,\n frameSource: string,\n gradeMessage?: string,\n imageUploader?: ImageUploader,\n wasAnswered?: boolean,\n question?: $FlowFixMe,\n answerArea?: $FlowFixMe,\n onChange: ChangeHandler,\n\n // The content ID of the AssessmentItem being edited. It may not be set\n // for non-content library exercise questions.\n itemId?: string,\n|};\n\nclass ItemEditor extends React.Component<Props> {\n static defaultProps: {|\n answerArea: {...},\n onChange: () => void,\n question: {...},\n |} = {\n onChange: () => {},\n question: {},\n answerArea: {},\n };\n\n // Notify the parent that the question or answer area has been updated.\n updateProps: ChangeHandler = (newProps, cb, silent) => {\n const props = _(this.props).pick(\"question\", \"answerArea\");\n\n this.props.onChange(_(props).extend(newProps), cb, silent);\n };\n\n triggerPreviewUpdate: (newData: any) => void = (newData: $FlowFixMe) => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.frame.sendNewData(newData);\n };\n\n handleEditorChange: ChangeHandler = (newProps, cb, silent) => {\n const question = _.extend({}, this.props.question, newProps);\n this.updateProps({question}, cb, silent);\n };\n\n handleItemExtrasChange: ChangeHandler = (newProps, cb, silent) => {\n const answerArea = _.extend({}, this.props.answerArea, newProps);\n this.updateProps({answerArea}, cb, silent);\n };\n\n getSaveWarnings: () => any = () => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.questionEditor.getSaveWarnings();\n };\n\n serialize: (options: any) => {|\n answerArea: any,\n itemDataVersion: {|major: number, minor: number|},\n question: any,\n |} = (options: $FlowFixMe) => {\n return {\n // eslint-disable-next-line react/no-string-refs\n question: this.refs.questionEditor.serialize(options),\n // eslint-disable-next-line react/no-string-refs\n answerArea: this.refs.itemExtrasEditor.serialize(options),\n itemDataVersion: ITEM_DATA_VERSION,\n };\n };\n\n render(): React.Element<\"div\"> {\n const isMobile =\n this.props.deviceType === \"phone\" ||\n this.props.deviceType === \"tablet\";\n return (\n <div className=\"perseus-editor-table\">\n <div className=\"perseus-editor-row perseus-question-container\">\n <div className=\"perseus-editor-left-cell\">\n <div className=\"pod-title\">Question</div>\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"questionEditor\"\n // Using the AssessmentItem content ID as the key\n // ensures that when the user navigates to another\n // item in the Sidebar, the question editor is\n // re-rendered by React.\n key={this.props.itemId}\n placeholder=\"Type your question here...\"\n className=\"perseus-question-editor\"\n imageUploader={this.props.imageUploader}\n onChange={this.handleEditorChange}\n apiOptions={this.props.apiOptions}\n showWordCount={true}\n {...this.props.question}\n />\n </div>\n\n <div className=\"perseus-editor-right-cell\">\n <div id=\"problemarea\">\n <DeviceFramer\n deviceType={this.props.deviceType}\n nochrome={true}\n >\n <IframeContentRenderer\n // eslint-disable-next-line react/no-string-refs\n ref=\"frame\"\n key={this.props.deviceType}\n content={this.props.frameSource}\n datasetKey=\"mobile\"\n datasetValue={isMobile}\n seamless={true}\n />\n </DeviceFramer>\n <div\n id=\"hintsarea\"\n className=\"hintsarea\"\n style={{display: \"none\"}}\n />\n </div>\n </div>\n </div>\n\n <div className=\"perseus-editor-row perseus-answer-container\">\n <div className=\"perseus-editor-left-cell\">\n <div className=\"pod-title\">Question extras</div>\n <ItemExtrasEditor\n // eslint-disable-next-line react/no-string-refs\n ref=\"itemExtrasEditor\"\n onChange={this.handleItemExtrasChange}\n {...this.props.answerArea}\n />\n </div>\n\n <div className=\"perseus-editor-right-cell\">\n <div id=\"answer_area\" />\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default ItemEditor;\n","// @flow\nimport {components, ApiOptions, ClassNames} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport JsonEditor from \"./components/json-editor.jsx\";\nimport ViewportResizer from \"./components/viewport-resizer.jsx\";\nimport CombinedHintsEditor from \"./hint-editor.jsx\";\nimport ItemEditor from \"./item-editor.jsx\";\n\nimport type {\n APIOptions,\n APIOptionsWithDefaults,\n ChangeHandler,\n DeviceType,\n Hint,\n ImageUploader,\n RendererInterface,\n Version,\n KEScore,\n} from \"@khanacademy/perseus\";\n\nconst {HUD} = components;\n\ntype Props = {|\n apiOptions?: APIOptions,\n\n answerArea?: $FlowFixMe, // related to the question\n\n // TODO(CP-4838): Should this be a required prop?\n contentPaths?: $ReadOnlyArray<string>,\n\n // Only used in the perseus demos. Consider removing.\n developerMode: boolean,\n\n // Source HTML for the iframe to render\n frameSource: string,\n\n hints?: $ReadOnlyArray<Hint>, // related to the question\n\n // A function which takes a file object (guaranteed to be an image) and\n // a callback, then calls the callback with the url where the image\n // will be hosted. Image drag and drop is disabled when imageUploader\n // is null.\n imageUploader?: ImageUploader,\n\n // Part of the question\n itemDataVersion?: Version,\n\n // The content ID of the AssessmentItem being edited.\n itemId: string,\n\n // Whether the question is displaying as JSON or if it is\n // showing the editor itself with the rendering\n // Only used in the perseus demos. Consider removing.\n jsonMode: boolean,\n\n // A function which is called with the new JSON blob of content\n onChange: ChangeHandler,\n\n onPreviewDeviceChange: (DeviceType) => mixed,\n previewDevice: DeviceType,\n\n // Initial value of the question being edited\n question?: $FlowFixMe,\n|};\n\ntype PerseusJson = {|\n question: $FlowFixMe,\n answerArea: $FlowFixMe,\n hints: $ReadOnlyArray<Hint>,\n itemDataVersion?: Version,\n|};\n\ntype State = {|\n json: PerseusJson,\n gradeMessage: string,\n wasAnswered: boolean,\n highlightLint: boolean,\n|};\n\nclass EditorPage extends React.Component<Props, State> {\n _isMounted: boolean;\n rendererMountNode: HTMLDivElement;\n renderer: ?RendererInterface;\n\n static defaultProps: {|\n developerMode: boolean,\n jsonMode: boolean,\n onChange: () => void,\n |} = {\n developerMode: false,\n jsonMode: false,\n onChange: () => {},\n };\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n json: _.pick(\n this.props,\n \"question\",\n \"answerArea\",\n \"hints\",\n \"itemDataVersion\",\n ),\n gradeMessage: \"\",\n wasAnswered: false,\n highlightLint: true,\n };\n\n this._isMounted = false;\n }\n\n componentDidMount() {\n // TODO(scottgrant): This is a hack to remove the deprecated call to\n // this.isMounted() but is still considered an anti-pattern.\n this._isMounted = true;\n\n this.rendererMountNode = document.createElement(\"div\");\n this.updateRenderer();\n }\n\n componentDidUpdate() {\n // NOTE: It is required to delay the preview update until after the\n // current frame, to allow for ItemEditor to render its widgets.\n // This then enables to serialize the widgets properties correctly,\n // in order to send data to the preview iframe (IframeContentRenderer).\n // Otherwise, widgets will render in an \"empty\" state in the preview.\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API\n // eslint-disable-next-line no-restricted-syntax\n setTimeout(() => {\n this.updateRenderer();\n });\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n }\n\n toggleJsonMode: () => void = () => {\n this.setState(\n {\n json: this.serialize({keepDeletedWidgets: true}),\n },\n () => {\n this.props.onChange({\n jsonMode: !this.props.jsonMode,\n });\n },\n );\n };\n\n updateRenderer() {\n // Some widgets (namely the image widget) like to call onChange before\n // anything has actually been mounted, which causes problems here. We\n // just ensure don't update until we've mounted\n const hasEditor = !this.props.developerMode || !this.props.jsonMode;\n if (!this._isMounted || !hasEditor) {\n return;\n }\n\n const touch =\n this.props.previewDevice === \"phone\" ||\n this.props.previewDevice === \"tablet\";\n const deviceBasedApiOptions: APIOptionsWithDefaults = {\n ...this.getApiOptions(),\n customKeypad: touch,\n isMobile: touch,\n };\n\n // eslint-disable-next-line react/no-string-refs\n this.refs.itemEditor.triggerPreviewUpdate({\n type: \"question\",\n data: _({\n item: this.serialize(),\n apiOptions: deviceBasedApiOptions,\n initialHintsVisible: 0,\n device: this.props.previewDevice,\n linterContext: {\n contentType: \"exercise\",\n highlightLint: this.state.highlightLint,\n // TODO(CP-4838): is it okay to use [] as a default?\n paths: this.props.contentPaths || [],\n },\n reviewMode: true,\n // eslint-disable-next-line react/no-string-refs\n legacyPerseusLint: this.refs.itemEditor.getSaveWarnings(),\n }).extend(\n _(this.props).pick(\n \"workAreaSelector\",\n \"solutionAreaSelector\",\n \"hintsAreaSelector\",\n \"problemNum\",\n ),\n ),\n });\n }\n\n getApiOptions(): APIOptionsWithDefaults {\n return {\n ...ApiOptions.defaults,\n ...this.props.apiOptions,\n };\n }\n\n getSaveWarnings(): any {\n // eslint-disable-next-line react/no-string-refs\n const issues1 = this.refs.itemEditor.getSaveWarnings();\n // eslint-disable-next-line react/no-string-refs\n const issues2 = this.refs.hintsEditor.getSaveWarnings();\n return issues1.concat(issues2);\n }\n\n serialize(options?: {|keepDeletedWidgets?: boolean|}): any | PerseusJson {\n if (this.props.jsonMode) {\n return this.state.json;\n }\n // eslint-disable-next-line react/no-string-refs\n return _.extend(this.refs.itemEditor.serialize(options), {\n // eslint-disable-next-line react/no-string-refs\n hints: this.refs.hintsEditor.serialize(options),\n });\n }\n\n handleChange: ChangeHandler = (toChange, cb, silent) => {\n const newProps = _(this.props).pick(\"question\", \"hints\", \"answerArea\");\n _(newProps).extend(toChange);\n this.props.onChange(newProps, cb, silent);\n };\n\n changeJSON: (newJson: PerseusJson) => void = (newJson: PerseusJson) => {\n this.setState({\n json: newJson,\n });\n // $FlowIgnore[prop-missing]\n // $FlowIgnore[incompatible-call]: PerseusJson is incompatible with first param of ChangeHandler\n this.props.onChange(newJson);\n };\n\n scorePreview(): ?KEScore {\n // Do we actually ever set this.renderer anywhere in the codebase?\n if (this.renderer) {\n return this.renderer.scoreInput();\n }\n return null;\n }\n\n render(): React.Element<\"div\"> {\n let className = \"framework-perseus\";\n\n const touch =\n this.props.previewDevice === \"phone\" ||\n this.props.previewDevice === \"tablet\";\n const deviceBasedApiOptions: APIOptionsWithDefaults = {\n ...this.getApiOptions(),\n customKeypad: touch,\n isMobile: touch,\n };\n\n if (deviceBasedApiOptions.isMobile) {\n className += \" \" + ClassNames.MOBILE;\n }\n\n return (\n <div id=\"perseus\" className={className}>\n <div style={{marginBottom: 10}}>\n {this.props.developerMode && (\n <span>\n <label>\n {\" \"}\n Developer JSON Mode:{\" \"}\n <input\n type=\"checkbox\"\n checked={this.props.jsonMode}\n onChange={this.toggleJsonMode}\n />\n </label>{\" \"}\n </span>\n )}\n\n {!this.props.jsonMode && (\n <ViewportResizer\n deviceType={this.props.previewDevice}\n onViewportSizeChanged={\n this.props.onPreviewDeviceChange\n }\n />\n )}\n\n {!this.props.jsonMode && (\n <HUD\n message=\"Style warnings\"\n enabled={this.state.highlightLint}\n onClick={() => {\n this.setState({\n highlightLint: !this.state.highlightLint,\n });\n }}\n />\n )}\n </div>\n\n {this.props.developerMode && this.props.jsonMode && (\n <div>\n <JsonEditor\n multiLine={true}\n value={this.state.json}\n onChange={this.changeJSON}\n />\n </div>\n )}\n\n {(!this.props.developerMode || !this.props.jsonMode) && (\n <ItemEditor\n // eslint-disable-next-line react/no-string-refs\n ref=\"itemEditor\"\n itemId={this.props.itemId}\n question={this.props.question}\n answerArea={this.props.answerArea}\n imageUploader={this.props.imageUploader}\n onChange={this.handleChange}\n wasAnswered={this.state.wasAnswered}\n gradeMessage={this.state.gradeMessage}\n deviceType={this.props.previewDevice}\n apiOptions={deviceBasedApiOptions}\n frameSource={this.props.frameSource}\n />\n )}\n\n {(!this.props.developerMode || !this.props.jsonMode) && (\n <CombinedHintsEditor\n // eslint-disable-next-line react/no-string-refs\n ref=\"hintsEditor\"\n itemId={this.props.itemId}\n hints={this.props.hints}\n imageUploader={this.props.imageUploader}\n onChange={this.handleChange}\n deviceType={this.props.previewDevice}\n apiOptions={deviceBasedApiOptions}\n frameSource={this.props.frameSource}\n highlightLint={this.state.highlightLint}\n />\n )}\n </div>\n );\n }\n}\n\nexport default EditorPage;\n","// @flow\n/**\n * Functions for extracting data from items for use in i18n.\n */\nimport {traverse, MultiItems, PerseusMarkdown} from \"@khanacademy/perseus\";\nimport _ from \"underscore\";\n\nconst {findContentNodesInItem, findHintNodesInItem, inferItemShape} =\n MultiItems;\n\n// Takes a renderer content and parses the markdown for images\nfunction findImagesInContent(content, images) {\n const parsed = PerseusMarkdown.parse(content);\n\n PerseusMarkdown.traverseContent(parsed, function (node) {\n if (node.type === \"image\") {\n images.push(node.target);\n }\n });\n}\n\n// Background images in some widgets are annoying to deal with because\n// sometimes the objects aren't full when there isn't an image. So, we do some\n// extra checking to make sure we don't cause an error or push an empty image.\nfunction handleBackgroundImage(graph, images) {\n if (graph && graph.backgroundImage && graph.backgroundImage.url) {\n images.push(graph.backgroundImage.url);\n }\n}\n\n// The callback called for each widget. We check each of the areas of each\n// widget where they contain a renderer for images by calling\n// findImagesInContent. We don't have to recurse through child widgets, because\n// traverseRendererDeep does that for us.\nfunction widgetCallback(widgetInfo, images) {\n if (!widgetInfo.options) {\n return;\n }\n\n // TODO(emily/aria): Move this into the widget files, so we don't have the\n // logic out here.\n if (widgetInfo.type === \"categorizer\") {\n _.each(widgetInfo.options.items, function (item) {\n findImagesInContent(item, images);\n });\n _.each(widgetInfo.options.categories, function (category) {\n findImagesInContent(category, images);\n });\n } else if (widgetInfo.type === \"image\") {\n findImagesInContent(widgetInfo.options.title, images);\n findImagesInContent(widgetInfo.options.caption, images);\n } else if (widgetInfo.type === \"matcher\") {\n _.each(widgetInfo.options.left, function (option) {\n findImagesInContent(option, images);\n });\n _.each(widgetInfo.options.right, function (option) {\n findImagesInContent(option, images);\n });\n _.each(widgetInfo.options.labels, function (label) {\n findImagesInContent(label, images);\n });\n } else if (widgetInfo.type === \"matrix\") {\n findImagesInContent(widgetInfo.options.prefix, images);\n findImagesInContent(widgetInfo.options.suffix, images);\n } else if (widgetInfo.type === \"orderer\") {\n _.each(widgetInfo.options.options, function (option) {\n findImagesInContent(option.content, images);\n });\n } else if (widgetInfo.type === \"passage\") {\n findImagesInContent(widgetInfo.options.passageTitle, images);\n } else if (widgetInfo.type === \"radio\") {\n _.each(widgetInfo.options.choices, function (choice) {\n findImagesInContent(choice.content, images);\n });\n } else if (widgetInfo.type === \"sorter\") {\n _.each(widgetInfo.options.correct, function (option) {\n findImagesInContent(option, images);\n });\n } else if (widgetInfo.type === \"table\") {\n _.each(widgetInfo.options.headers, function (header) {\n findImagesInContent(header, images);\n });\n }\n\n if (widgetInfo.type === \"grapher\") {\n handleBackgroundImage(widgetInfo.options.graph, images);\n } else if (widgetInfo.type === \"image\") {\n handleBackgroundImage(widgetInfo.options, images);\n } else if (widgetInfo.type === \"interactive-graph\") {\n handleBackgroundImage(widgetInfo.options, images);\n } else if (widgetInfo.type === \"measurer\" && widgetInfo.options.image) {\n images.push(widgetInfo.options.image.url);\n } else if (widgetInfo.type === \"plotter\") {\n images.push(widgetInfo.options.picUrl);\n } else if (widgetInfo.type === \"transformer\") {\n handleBackgroundImage(widgetInfo.options.graph, images);\n }\n}\n\nfunction findImagesInRenderers(renderers) {\n const images = [];\n\n _.each(renderers, (renderer) => {\n traverse(\n renderer,\n (content) => {\n findImagesInContent(content, images);\n },\n (widget) => widgetCallback(widget, images),\n );\n });\n\n return images;\n}\n\n// Calls findImagesInContent on all of the different content areas for\n// assessment items\nfunction findImagesInItemData(itemData: $FlowFixMe): $FlowFixMe {\n let renderers = [];\n if (itemData._multi) {\n const shape = inferItemShape(itemData);\n findContentNodesInItem(itemData, shape, (node) => renderers.push(node));\n findHintNodesInItem(itemData, shape, (node) => renderers.push(node));\n } else {\n renderers = [itemData.question, ...itemData.hints];\n }\n return findImagesInRenderers(renderers);\n}\n\n// Calls findImagesInContent on all of the different content areas for\n// articles\nfunction findImagesInArticles(perseusContent: $FlowFixMe): $FlowFixMe {\n return findImagesInRenderers(perseusContent);\n}\n\nexport default {\n findImagesInArticles: findImagesInArticles,\n findImagesInItemData: findImagesInItemData,\n};\n","(function webpackUniversalModuleDefinition(root, factory) {\n if(typeof exports === 'object' && typeof module === 'object')\n module.exports = factory();\n else if(typeof define === 'function' && define.amd)\n define([], factory);\n else if(typeof exports === 'object')\n exports[\"hubble\"] = factory();\n else\n root[\"hubble\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ // The module cache\n/******/ var installedModules = {};\n/******/\n/******/ // The require function\n/******/ function __webpack_require__(moduleId) {\n/******/\n/******/ // Check if module is in cache\n/******/ if(installedModules[moduleId]) {\n/******/ return installedModules[moduleId].exports;\n/******/ }\n/******/ // Create a new module (and put it into the cache)\n/******/ var module = installedModules[moduleId] = {\n/******/ i: moduleId,\n/******/ l: false,\n/******/ exports: {}\n/******/ };\n/******/\n/******/ // Execute the module function\n/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ // Flag the module as loaded\n/******/ module.l = true;\n/******/\n/******/ // Return the exports of the module\n/******/ return module.exports;\n/******/ }\n/******/\n/******/\n/******/ // expose the modules object (__webpack_modules__)\n/******/ __webpack_require__.m = modules;\n/******/\n/******/ // expose the module cache\n/******/ __webpack_require__.c = installedModules;\n/******/\n/******/ // define getter function for harmony exports\n/******/ __webpack_require__.d = function(exports, name, getter) {\n/******/ if(!__webpack_require__.o(exports, name)) {\n/******/ Object.defineProperty(exports, name, {\n/******/ configurable: false,\n/******/ enumerable: true,\n/******/ get: getter\n/******/ });\n/******/ }\n/******/ };\n/******/\n/******/ // getDefaultExport function for compatibility with non-harmony modules\n/******/ __webpack_require__.n = function(module) {\n/******/ var getter = module && module.__esModule ?\n/******/ function getDefault() { return module['default']; } :\n/******/ function getModuleExports() { return module; };\n/******/ __webpack_require__.d(getter, 'a', getter);\n/******/ return getter;\n/******/ };\n/******/\n/******/ // Object.prototype.hasOwnProperty.call\n/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ // __webpack_public_path__\n/******/ __webpack_require__.p = \"\";\n/******/\n/******/ // Load entry module and return exports\n/******/ return __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nvar isObject = function(obj) {\n return obj === Object(obj);;\n}\n\nvar merge = function() {\n var obj = {};\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i];\n if (source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n }\n }\n\n return obj;\n};\n\nvar clone = function(obj) {\n if (!isObject(obj)) {\n return obj;\n }\n\n return Array.isArray(obj) ? obj.slice() : merge(obj);\n};\n\nmodule.exports = { isObject: isObject, merge: merge, clone: clone };\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* TODO batch *all* mutations\n * idea: freeze / thaw implementations for all types\n * lens constructor thaws, freeze delegates to type's freeze\n */\n\nvar util = __webpack_require__(0);\n var clone = util.clone;\n var isObject = util.isObject;\n var merge = util.merge;\n\nvar arr = __webpack_require__(2);\nvar obj = __webpack_require__(3);\nvar str = __webpack_require__(4);\n\n// equivalents, without requiring it\n// find the implementation to use for a given object\nvar dispatch = function(x) {\n if (Array.isArray(x)) {\n return arr;\n } else if (isObject(x)) {\n return obj;\n } else if (typeof x === \"string\") {\n return str;\n }\n};\n\n// This is underscore with a different name\nvar lens = function(obj) {\n if (obj instanceof lens) {\n return obj;\n }\n\n if (!(this instanceof lens)) {\n return new lens(obj);\n }\n\n var ops = dispatch(obj);\n this._wrapped = ops.thaw ? ops.thaw(obj) : obj;\n};\n\nlens.prototype.freeze = function() {\n var obj = this._wrapped;\n var ops = dispatch(obj);\n\n return ops.freeze ? ops.freeze(obj) : obj;\n};\n\nlens.prototype.zoom = function(lensArr) {\n if (this._zoomStack === undefined) {\n this._zoomStack = [];\n }\n\n this._zoomStack.push({\n zoom: lensArr,\n wrapped: this._wrapped\n });\n this._wrapped = lens(this._wrapped).get(lensArr);\n\n return this;\n};\n\nlens.prototype.deZoom = function() {\n var frame = this._zoomStack.pop();\n this._wrapped = lens(frame.wrapped)\n .set(frame.zoom, this._wrapped)\n .freeze();\n\n return this;\n};\n\nlens.prototype.get = function(lensArr) {\n var obj = this._wrapped;\n\n for (var i = 0; i < lensArr.length; i++) {\n obj = dispatch(obj).get(obj, lensArr[i]);\n }\n\n return obj;\n};\n\nlens.prototype.mod = function(lensArr, f) {\n var obj = this._wrapped;\n var newObj = clone(obj);\n var ops = dispatch(obj);\n\n if (lensArr.length === 0) {\n this._wrapped = f(this._wrapped);\n } else if (lensArr.length === 1) {\n this._wrapped = ops.mod(newObj, lensArr[0], f);\n } else {\n var monocle = lensArr[0];\n var shortLens = lensArr.slice(1);\n\n // newObj = ops.mod(obj[monocle], shortLens, f);\n\n newObj[monocle] = lens(obj[monocle])\n .mod(shortLens, f)\n .freeze();\n this._wrapped = newObj;\n }\n\n return this;\n};\n\n// TODO - move to individual files\nlens.prototype.merge = function(lensArr, props) {\n this._wrapped = lens(this._wrapped).mod(lensArr, function(oldProps) {\n return merge(oldProps, props);\n }).freeze();\n\n return this;\n};\n\n// Lens must have length >= 1 or there would be nothing to return\nlens.prototype.del = function(lensArr) {\n var obj = this._wrapped;\n var ops = dispatch(obj);\n\n if (lensArr.length === 1) {\n this._wrapped = ops.del(obj, lensArr[0]);\n } else {\n var monocle = lensArr[0];\n var shortLens = lensArr.slice(1);\n var newObj = clone(obj);\n\n newObj[monocle] = lens(obj[monocle])\n .del(shortLens)\n .freeze();\n\n this._wrapped = newObj;\n }\n\n return this;\n};\n\nlens.prototype.set = function(lensArr, set) {\n return this.mod(lensArr, function() { return set; });\n};\n\nmodule.exports = lens;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nvar get = function(arr, monocle) {\n return arr[monocle];\n};\n\nvar set = function(arr, monocle, val) {\n var newArr = arr.splice();\n newArr[monocle] = val;\n return newArr;\n};\n\nvar mod = function(arr, monocle, f) {\n var newArr = arr.slice();\n newArr[monocle] = f(arr[monocle]);\n return newArr;\n};\n\nvar del = function(arr, monocle) {\n var newArr = arr.slice();\n newArr.splice(monocle, 1);\n return newArr;\n};\n\n/*\n// Lens must point to a member of an array. We'll insert into that array.\nlens.prototype.insertAt = function(lensArr, toInsert) {\n var obj = this._wrapped;\n\n var arrLens = lensArr.slice(0, -1);\n var arr = lens(obj).get(arrLens).slice(); // slice to copy\n\n var arrIdx = lensArr[lensArr.length-1];\n arr.splice(arrIdx, 0, toInsert);\n return lens(obj).set(arrLens, arr);\n};\n\nlens.prototype.insertBefore = lens.prototype.insertAt;\nlens.prototype.insertAfter = function(lensArr, toInsert) {\n var newLens = lensArr.slice();\n newLens[newLens.length-1] += 1;\n return lens(this._wrapped).insertAt(newLens, toInsert);\n};\n*/\n\nmodule.exports = { get: get, set: set, mod: mod, del: del };\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar clone = __webpack_require__(0).clone;\n\nvar get = function(obj, monocle) {\n return obj[monocle];\n};\n\nvar set = function(obj, monocle, val) {\n var newObj = clone(obj);\n newObj[monocle] = val;\n return newObj;\n};\n\nvar mod = function(obj, monocle, f) {\n var newObj = clone(obj);\n newObj[monocle] = f(obj[monocle]);\n return newObj;\n};\n\nvar del = function(obj, monocle) {\n var newObj = clone(obj);\n delete newObj[monocle];\n return newObj;\n};\n\nmodule.exports = { get: get, set: set, mod: mod, del: del };\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nvar get = function(arr, monocle) {\n return arr[monocle];\n};\n\nvar set = function(arr, monocle, val) {\n var newArr = arr.splice();\n newArr[monocle] = val;\n return newArr;\n};\n\nvar mod = function(arr, monocle, f) {\n var newArr = arr.splice();\n newArr[monocle] = f(arr[monocle]);\n return newArr;\n};\n\nvar del = function(arr, monocle) {\n var newArr = arr.slice();\n newArr.splice(monocle);\n return newArr;\n};\n\nmodule.exports = { get: get, set: set, mod: mod, del: del };\n\n\n/***/ })\n/******/ ]);\n});\n","// @flow\n/**\n * Provides a simple styled button\n *\n */\n\nimport {StyleSheet, css} from \"aphrodite\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nclass SimpleButton extends React.Component<$FlowFixMe> {\n static propTypes = {\n children: PropTypes.node,\n color: PropTypes.oneOf([\"orange\", \"green\"]),\n onClick: PropTypes.func,\n };\n\n static defaultProps: $FlowFixMe = {\n children: null,\n color: \"green\",\n onClick: () => {},\n };\n\n render(): React.Node {\n const {children, color, onClick, ...otherProps} = this.props;\n return (\n <div\n className={css(\n styles.baseButton,\n color === \"green\" && styles.green,\n color === \"orange\" && styles.orange,\n )}\n onClick={onClick}\n {...otherProps}\n >\n {children}\n </div>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n baseButton: {\n top: \"0\",\n fontSize: \"11px\",\n padding: \"3px 10px\",\n backgroundRepeat: \"repeat-x\",\n borderColor: `\n rgba(0, 0, 0, 0.1)\n rgba(0, 0, 0, 0.1)\n rgba(0, 0, 0, 0.25)\n `,\n color: \"#ffffff\",\n borderRadius: \"3px\",\n lineHeight: \"15px\",\n cursor: \"pointer\",\n transition: \"box-shadow ease-in-out 0.15s\",\n appearance: \"none\",\n textDecoration: \"none\",\n textAlign: \"center\",\n \":hover\": {\n boxShadow: `0 1px 1px rgba(0, 0, 0, 0.35),\n inset 0 0 50px 5px rgba(255, 255, 255, 0.2)`,\n },\n },\n green: {\n border: \"1px solid #7fab07\",\n backgroundColor: \"#80ac07\",\n backgroundImage: \"linear-gradient(to bottom, #8aba08, #719807)\",\n \":hover\": {\n borderBottomColor: \"#547105\",\n backgroundColor: \"#719807\",\n },\n },\n orange: {\n border: \"1px solid #d45704\",\n backgroundColor: \"#d55704\",\n backgroundImage: \"linear-gradient(to bottom, #e35d04, #c04f03)\",\n \":hover\": {\n borderBottomColor: \"#983e03\",\n backgroundColor: \"#c04f03\",\n },\n },\n});\n\nexport default SimpleButton;\n","// @flow\n/**\n * Editor for a multi-item question.\n *\n * TODO(mdr): The UI for managing arrays isn't visually consistent with\n * HintsEditor. Should we bring them in line with each other?\n */\nimport {\n ApiOptions,\n buildEmptyItemTreeForShape,\n components,\n icons,\n itemToTree,\n MultiItems,\n} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport lens from \"hubble\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport JsonEditor from \"./components/json-editor.jsx\";\nimport SimpleButton from \"./components/simple-button.jsx\";\nimport Editor from \"./editor.jsx\";\nimport {HintEditor} from \"./hint-editor.jsx\";\n\nimport type {\n APIOptions,\n ChangeHandler,\n EditorMode,\n\n // Multi-item item types\n Item,\n // ItemTree is used below, the linter is confused.\n ItemTree, // eslint-disable-line no-unused-vars\n ItemObjectNode,\n ItemArrayNode,\n ContentNode,\n HintNode,\n TagsNode,\n\n // Multi-item shape types\n Shape,\n ArrayShape,\n ObjectShape,\n ContentShape,\n HintShape,\n TagsShape,\n} from \"@khanacademy/perseus\";\n\nconst {InlineIcon} = components;\nconst {iconChevronDown, iconTrash} = icons;\nconst {MultiRenderer} = MultiItems;\n\n// TODO(CP-4849): figure out when $ReadOnlyArray<number> vs $ReadOnlyArray<string> should be used\ntype Path = $ReadOnlyArray<$FlowFixMe>;\n\ntype ModeDropdownProps = {|\n currentMode: EditorMode,\n\n // A function that takes in a string signifying the mode (ex: \"edit\")\n onChange: (mode: EditorMode) => mixed,\n|};\n\n/**\n * Component that displays the mode dropdown.\n *\n * The mode dropdown is the selector at the top of the editor that lets you\n * switch between edit, preview, and dev-only JSON mode.\n */\nclass ModeDropdown extends React.Component<ModeDropdownProps> {\n _handleSelectMode = (event: SyntheticInputEvent<HTMLSelectElement>) => {\n if (this.props.onChange) {\n // event.target.value corresponds to the options' values below which\n // are limited to EditorMode, but flow doesn't know that so we have\n // to cast through any here.\n const value = ((event.target.value: any): EditorMode);\n this.props.onChange(value);\n }\n };\n\n render(): React.Node {\n return (\n <label>\n Mode:{\" \"}\n <select\n value={this.props.currentMode}\n onChange={this._handleSelectMode}\n >\n <option value=\"edit\">Edit</option>\n <option value=\"preview\">Preview</option>\n <option value=\"json\">Dev-only JSON</option>\n </select>\n </label>\n );\n }\n}\n\n/**\n * Convert a camel-cased string to a human-formatted string.\n * \"superCoolThings\" -> \"super cool things\"\n */\nfunction camelCaseToHuman(str: string) {\n // Decapitalize the capital letters, and add a space before each.\n return str.replace(/[A-Z]/g, (s) => \" \" + s.toLowerCase());\n}\n\n/**\n * Capitalize the first letter of the given string.\n * \"super cool things\" -> \"Super cool things\"\n */\nfunction capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}\n\n/**\n * Convert the given pluralized word to a singularized word.\n * \"super cool things\" -> \"super cool thing\"\n */\nfunction pluralToSingular(str: string) {\n if (str.charAt(str.length - 1) === \"s\") {\n // Incredibly weak implementation :P\n return str.slice(0, -1);\n }\n // Uh oh, dunno how to singularize anything but the simplest case!\n // Let's just return the plural form, and hope the user forgives the\n // grammatical inconsistency.\n return str;\n}\n\n/**\n * When iterating through the editors, we don't keep track of the extra\n * `_multi` part at the beginning. This is a helper function which takes a path\n * and prepends that key.\n */\nfunction multiPath(path) {\n return [\"_multi\", ...path];\n}\n\n// Return an h1 if depth=0, h2 if depth=1, etc.\n// NOTE: This component accepts pass-through props.\ntype HeaderProps = {\n depth: number,\n ...\n};\n\nconst Header = ({depth, ...props}: HeaderProps) => {\n const headerLevel = Math.min(depth, 5) + 1;\n const HeaderTag = `h${headerLevel}`;\n return <HeaderTag {...props} />;\n};\n\n// Actions is inexact so that we can pass an instance MultiRendererEditor.\ninterface Actions {\n addArrayElement: (path: Path, shape: Shape) => void;\n mergeValueAtPath: (path: Path, newValue: any) => void;\n setValueAtPath: (path: Path, newValue: any) => void;\n moveArrayElementDown: (path: Path) => void;\n moveArrayElementUp: (path: Path) => void;\n removeArrayElement: (path: Path) => void;\n}\n\n// This type is used to define prop types for various nodes. The S and D type\n// params should match when used, e.g. the prop types for `HintNodeContent` is\n// `NodePropTypes<HintShape, HintNode>`.\ntype NodePropTypes<S = Shape, D = ItemTree> = {|\n shape: S,\n data: D,\n path: Path,\n actions: Actions,\n apiOptions: APIOptions,\n // For the left-hand column, we use edit mode and leave renderers empty.\n // For the right-hand column, we use preview mode and provide renderers\n // via a MultiRenderer.\n // TODO(CP-4850): figure out how to type this, it appears to be a tree where the\n // leaf nodes could be typed using RendererInterface.\n renderers?: $FlowFixMe,\n|};\n\n/**\n * Render a node in the editor tree, given the shape of the target\n * node, the data stored in the target node, the path to the target\n * node, and any UI controls that affect how this node relates to its\n * parent (e.g. remove from parent array).\n *\n * This returns a container element with a pretty title and additional\n * UI controls for this node. Its contents are produced by\n * `NodeContent`. The two functions are mutually recursive.\n *\n * Leaf nodes, like items and hints, render an editor pod around their\n * content. Container nodes, like arrays and objects, render a header above\n * their content.\n */\nconst NodeContainer = (props: {|\n ...NodePropTypes<>,\n controls?: $ReadOnlyArray<React.Node>,\n name?: string,\n|}) => {\n const {\n shape,\n data,\n path,\n actions,\n name: givenName,\n controls,\n ...otherProps\n } = props;\n\n const name = givenName || camelCaseToHuman(path[path.length - 1] || \"\");\n\n const children = (\n <NodeContent\n {...otherProps}\n shape={shape}\n data={data}\n path={path}\n actions={actions}\n />\n );\n\n const key = path.join(\".\");\n\n if (shape.type === \"array\") {\n return (\n <ArrayContainer\n key={key}\n name={name}\n controls={controls}\n path={path}\n shape={shape}\n actions={actions}\n >\n {children}\n </ArrayContainer>\n );\n }\n if (shape.type === \"object\") {\n return (\n <ObjectContainer\n key={key}\n name={name}\n controls={controls}\n path={path}\n >\n {children}\n </ObjectContainer>\n );\n }\n return (\n <LeafContainer\n key={key}\n name={name}\n controls={controls}\n path={path}\n shape={shape}\n >\n {children}\n </LeafContainer>\n );\n};\n\ntype LeafContainerProps = {|\n name: string,\n controls?: React.Node,\n children?: React.Node,\n path: Path,\n shape: Shape,\n|};\nconst LeafContainer = ({\n name,\n controls,\n children,\n path,\n shape,\n}: LeafContainerProps) => {\n const hasPreviewHeading = shape.type === \"content\" || shape.type === \"hint\";\n const previewHeading = hasPreviewHeading && (\n <div className={css(styles.containerHeader)}>\n <Header depth={path.length} className={css(styles.containerTitle)}>\n {capitalize(name)}\n </Header>\n </div>\n );\n return (\n <div className={css(styles.container)}>\n <span className={css(styles.row, styles.rowHeading)}>\n <div className={css(styles.columnLeft)}>\n <div className={\"pod-title \" + css(styles.containerHeader)}>\n <div className={css(styles.containerTitle)}>\n {capitalize(name)}\n </div>\n {controls}\n </div>\n </div>\n <div className={css(styles.columnRight)}>{previewHeading}</div>\n </span>\n {children}\n </div>\n );\n};\n\ninterface ArrayContainerActions {\n addArrayElement: (path: Path, shape: Shape) => void;\n}\n\ntype ArrayContainerProps = {|\n name: string,\n controls?: React.Node,\n children?: React.Node,\n path: Path,\n shape: ArrayShape,\n actions: ArrayContainerActions,\n|};\nconst ArrayContainer = (props: ArrayContainerProps) => {\n const {name, controls, children, path, shape, actions} = props;\n return (\n <div className={css(styles.container)}>\n {controls && (\n <div className={css(styles.columnLeft, styles.containerHeader)}>\n {controls}\n </div>\n )}\n <div>{children}</div>\n <div className={css(styles.columnLeft)}>\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n <a\n href=\"javascript:void 0\"\n onClick={() =>\n actions.addArrayElement(path, shape.elementShape)\n }\n >\n Add a {pluralToSingular(name)}\n </a>\n </div>\n </div>\n );\n};\n\ntype ObjectContainerProps = {|\n name: string,\n controls?: React.Node,\n children?: React.Node,\n path: Path,\n|};\nconst ObjectContainer = ({\n name,\n controls,\n children,\n path,\n}: ObjectContainerProps) => {\n const headingEditor = (\n <div className={css(styles.containerHeader)}>\n <Header depth={path.length} className={css(styles.containerTitle)}>\n {capitalize(name)}\n </Header>\n {controls}\n </div>\n );\n const headingPreview = (name || controls) && (\n <div\n className={css(\n styles.containerHeader,\n styles.previewCollectionHeader,\n )}\n >\n <Header depth={path.length} className={css(styles.containerTitle)}>\n {capitalize(name)}\n </Header>\n </div>\n );\n const hasBothHeadings = headingEditor && headingPreview;\n return (\n <div className={css(styles.container)}>\n {hasBothHeadings && (\n <span className={css(styles.row)}>\n <div className={css(styles.columnLeft)}>\n {headingEditor}\n </div>\n <div className={css(styles.columnRight)}>\n {headingPreview}\n </div>\n </span>\n )}\n <div className={css(path.length > 0 && styles.contentIndent)}>\n {children}\n </div>\n </div>\n );\n};\n\n/**\n * Render the content of node in the editor tree, given the shape of\n * the target node, the data stored in the target node, and the path to\n * the target node.\n *\n * If the target node is a leaf, this returns an editor. Otherwise, it\n * iterates over the child nodes, and outputs `NodeContainer` for\n * each of them. The two functions are mutually recursive.\n */\nconst NodeContent = (props: NodePropTypes<>) => {\n const {shape, data, ...restProps} = props;\n\n // All uses of `data` have been cast through any which isn't safe. This was\n // done to avoid introducing new logic which may have resulted in a change\n // of behavior. Also, there doesn't appear to be a way to tell flow the\n // difference between and `TagsNode` and `ItemArrayNode`, see\n // perseus-all-package/multi-items/item-types.js.\n if (shape.type === \"content\") {\n return (\n <ItemNodeContent\n shape={shape}\n data={((data: any): ContentNode)}\n {...restProps}\n />\n );\n }\n if (shape.type === \"hint\") {\n return (\n <HintNodeContent\n shape={shape}\n data={((data: any): HintNode)}\n {...restProps}\n />\n );\n }\n if (shape.type === \"tags\") {\n return (\n <TagsNodeContent\n shape={shape}\n data={((data: any): TagsNode)}\n {...restProps}\n />\n );\n }\n if (shape.type === \"array\") {\n return (\n <ArrayNodeContent\n shape={shape}\n data={((data: any): ItemArrayNode)}\n {...restProps}\n />\n );\n }\n if (shape.type === \"object\") {\n return (\n <ObjectNodeContent\n shape={shape}\n data={((data: any): ItemObjectNode)}\n {...restProps}\n />\n );\n }\n return null;\n};\n\ntype WithStickinessProps = {|\n sticky: boolean,\n|};\n\ntype WithStickiness<T> = {|\n ...$Exact<T>,\n ...WithStickinessProps,\n|};\n\ntype WithoutStickiness<T> = $Exact<$Rest<T, WithStickinessProps>>;\n\n/**\n * HOC that adds a \"sticky\" prop to the wrapped component that is true\n * when the rendered component is taller than the window. Since sticky content\n * can be somewhat distracting, we'd like to avoid it when not useful. This\n * HOC is useful for only making content sticky when useful.\n *\n * It does so by polling the height and comparing it to the window height.\n */\nconst withStickiness = <\n Config: {...},\n Component: React.ComponentType<WithStickiness<Config>>,\n>(\n WrappedComponent: Component,\n): React.ComponentType<WithoutStickiness<React.ElementConfig<Component>>> => {\n type State = {|sticky: boolean|};\n return class StickyComponent extends React.Component<Config, State> {\n stickynessTimer: IntervalID;\n\n state = {\n sticky: false,\n };\n\n componentDidMount() {\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API.\n // eslint-disable-next-line no-restricted-syntax\n this.stickynessTimer = setInterval(this.updateStickiness, 1000);\n this.updateStickiness();\n }\n\n componentWillUnmount() {\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API.\n // eslint-disable-next-line no-restricted-syntax\n clearInterval(this.stickynessTimer);\n }\n\n updateStickiness = () => {\n const domNode = ReactDOM.findDOMNode(this);\n // $FlowFixMe[prop-missing]\n // $FlowFixMe[incompatible-use]: findDOMNode returns null | Text | Element\n const height = domNode.offsetHeight;\n const windowHeight = window.innerHeight;\n const sticky = height > windowHeight;\n if (sticky !== this.state.sticky) {\n this.setState({\n sticky,\n });\n }\n };\n\n render(): React.Node {\n return (\n /**\n * $FlowFixMe[incompatible-exact]\n * TODO(somewhatabstract, JIRA-XXXX):\n * Cannot create WrappedComponent element because inexact props\n * [1] is incompatible with exact WithStickiness [2].\n */\n <WrappedComponent {...this.props} sticky={this.state.sticky} />\n );\n }\n };\n};\n\nconst ItemNodeContent = withStickiness(\n (props: {|\n ...NodePropTypes<ContentShape, ContentNode>,\n ...WithStickinessProps,\n |}) => {\n const {data, path, actions, apiOptions, renderers, sticky} = props;\n\n const preview = (\n <div className=\"framework-perseus\">{lens(renderers).get(path)}</div>\n );\n\n return (\n <span>\n <div className={css(styles.row)}>\n <div className={css(styles.columnLeft)}>\n <div className={css(sticky && styles.sticky)}>\n {/* TODO(CP-4852): only pass the props to Editor that it uses. */}\n {\n // $FlowFixMe[incompatible-exact]: {...data} pass too many props\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n <Editor\n {...data}\n onChange={(newVal) =>\n actions.mergeValueAtPath(path, newVal)\n }\n apiOptions={apiOptions}\n />\n }\n </div>\n </div>\n <div className={css(styles.columnRight)}>\n <div className={css(sticky && styles.sticky)}>\n {preview}\n </div>\n </div>\n </div>\n </span>\n );\n },\n);\n\nconst HintNodeContent = withStickiness(\n (props: {|\n ...NodePropTypes<HintShape, HintNode>,\n ...WithStickinessProps,\n |}) => {\n const {data, path, actions, apiOptions, renderers, sticky} = props;\n\n const preview = (\n <div className=\"framework-perseus\">{lens(renderers).get(path)}</div>\n );\n\n return (\n <div className={css(styles.row)}>\n <div className={css(styles.columnLeft)}>\n <div className={css(sticky && styles.sticky)}>\n {/**\n * $FlowFixMe[incompatible-exact]\n * TODO(somewhatabstract, JIRA-XXXX):\n * Cannot create WrappedComponent element because\n * inexact props [1] is incompatible with exact\n * WithStickiness [2].\n */}\n <HintEditor\n {...data}\n className={css(styles.hintEditor)}\n onChange={(newVal) =>\n actions.mergeValueAtPath(path, newVal)\n }\n apiOptions={apiOptions}\n showTitle={false}\n showRemoveButton={false}\n showMoveButtons={false}\n // no-op handler since showRemoveButton={false}\n onRemove={() => {}}\n // no-op handler since showMoveButtons={false}\n onMove={(direction: number) => {}}\n isFirst={true}\n isLast={true}\n />\n </div>\n </div>\n <div className={css(styles.columnRight)}>\n <div className={css(sticky && styles.sticky)}>\n {preview}\n </div>\n </div>\n </div>\n );\n },\n);\n\nconst TagsNodeContent = (props: NodePropTypes<TagsShape, TagsNode>) => {\n const {data, path, actions, apiOptions} = props;\n const {GroupMetadataEditor} = apiOptions;\n\n if (GroupMetadataEditor == null) {\n return null;\n }\n return (\n <div className={css(styles.columnLeft)}>\n <div className={css(styles.tagsEditor)}>\n <GroupMetadataEditor\n value={data}\n onChange={(newVal) => actions.setValueAtPath(path, newVal)}\n showTitle={false}\n />\n </div>\n </div>\n );\n};\n\nconst ArrayNodeContent = (props: NodePropTypes<ArrayShape, ItemArrayNode>) => {\n const {shape, data, path, actions, ...otherProps} = props;\n\n const collectionName = camelCaseToHuman(path[path.length - 1]);\n const elementName = pluralToSingular(collectionName);\n\n const elementType = shape.elementShape.type;\n const elementIsLeaf = elementType === \"content\" || elementType === \"hint\";\n\n /**\n * TODO(somewhatabstract, JIRA-XXXX):\n * The NodePropTypes generic and specifically the ItemArrayNode could\n * contain a variety of types that are not arrays. Probably need to refine\n * the type more before doing this work, or rework the `ArrayNodeContent`\n * component to be less permissive about the props it accepts.\n */\n // $FlowFixMe[prop-missing]\n // $FlowFixMe[not-a-function]\n const children = data.map((subdata, i) => {\n const subpath = path.concat(i);\n const controls = [\n i > 0 && (\n <div key=\"moveArrayElementUp\" className={css(styles.control)}>\n <SimpleButton\n color=\"orange\"\n title=\"Move up\"\n onClick={() => actions.moveArrayElementUp(subpath)}\n >\n <div className={css(styles.verticalFlip)}>\n <InlineIcon {...iconChevronDown} />\n </div>\n </SimpleButton>\n </div>\n ),\n // $FlowFixMe[unsafe-addition]\n // $FlowFixMe[prop-missing]\n i < data.length - 1 && (\n <div key=\"moveArrayElementDown\" className={css(styles.control)}>\n <SimpleButton\n color=\"orange\"\n title=\"Move down\"\n onClick={() => actions.moveArrayElementDown(subpath)}\n >\n <InlineIcon {...iconChevronDown} />\n </SimpleButton>\n </div>\n ),\n <div key=\"removeArrayElement\" className={css(styles.control)}>\n <SimpleButton\n color=\"orange\"\n title=\"Delete\"\n onClick={() => actions.removeArrayElement(subpath)}\n >\n <InlineIcon {...iconTrash} />\n </SimpleButton>\n </div>,\n ];\n\n return (\n <div\n key={i}\n className={css(\n styles.arrayElement,\n !elementIsLeaf && styles.arrayElementAndNotLeaf,\n )}\n >\n <NodeContainer\n {...otherProps}\n key={i}\n shape={shape.elementShape}\n data={subdata}\n path={subpath}\n actions={actions}\n name={`${elementName} ${i + 1}`}\n controls={controls}\n />\n </div>\n );\n });\n\n return <div>{children}</div>;\n};\n\nconst ObjectNodeContent = (\n props: NodePropTypes<ObjectShape, ItemObjectNode>,\n) => {\n const {shape, data, path, ...otherProps} = props;\n\n // Object iteration order should automatically match the order in which the\n // keys were defined in the object literal. So, whatever order semantically\n // made sense to the shape's author is the order in which we'll iterate :)\n const children = Object.keys(shape.shape).map((subkey) => (\n <div key={subkey} className={css(styles.objectElement)}>\n <NodeContainer\n {...otherProps}\n shape={shape.shape[subkey]}\n data={data[subkey]}\n path={path.concat(subkey)}\n />\n </div>\n ));\n\n return <div>{children}</div>;\n};\n\ninterface LayoutStatics {\n shape: Shape;\n}\n\ntype MultiRendererEditorProps = {|\n // eslint-disable-next-line no-restricted-syntax\n Layout: React.ComponentType<any> & LayoutStatics,\n apiOptions: APIOptions,\n\n item: Item,\n editorMode: EditorMode,\n\n onChange: ChangeHandler,\n|};\n\nclass MultiRendererEditor extends React.Component<MultiRendererEditorProps> {\n layout: ?React.ElementRef<$FlowFixMe>;\n\n _renderLayout: () => React.Node = () => {\n const {Layout, apiOptions, item} = this.props;\n\n return (\n <Layout\n ref={(node) => (this.layout = node)}\n item={item}\n apiOptions={apiOptions}\n />\n );\n };\n\n _renderJson: () => React.Element<\"div\"> = () => {\n return (\n <div>\n <ModeDropdown\n currentMode={this.props.editorMode}\n onChange={(editorMode) => this.props.onChange({editorMode})}\n />\n <JsonEditor\n multiLine\n value={this.props.item}\n onChange={(item) => this.props.onChange({item})}\n />\n </div>\n );\n };\n\n _renderPreview: () => React.Element<\"div\"> = () => {\n return (\n <div>\n <ModeDropdown\n currentMode={this.props.editorMode}\n onChange={(editorMode) => this.props.onChange({editorMode})}\n />\n {this._renderLayout()}\n </div>\n );\n };\n\n mergeValueAtPath: (path: Path, newValue: any) => void = (\n path: Path,\n newValue: mixed,\n ) => {\n this.props.onChange({\n item: lens(this.props.item)\n .merge(multiPath(path), newValue)\n .freeze(),\n });\n };\n\n setValueAtPath: (path: Path, newValue: any) => void = (\n path: Path,\n newValue: mixed,\n ) => {\n this.props.onChange({\n item: lens(this.props.item).set(multiPath(path), newValue).freeze(),\n });\n };\n\n addArrayElement: (path: Path, shape: Shape) => void = (\n path: Path,\n shape: Shape,\n ) => {\n const currentLength = lens(this.props.item).get(multiPath(path)).length;\n const newElementPath = path.concat(currentLength);\n const newValue = buildEmptyItemTreeForShape(shape);\n this.props.onChange({\n item: lens(this.props.item)\n .set(multiPath(newElementPath), newValue)\n .freeze(),\n });\n };\n\n removeArrayElement: (path: Path) => void = (path: Path) => {\n this.props.onChange({\n item: lens(this.props.item).del(multiPath(path)).freeze(),\n });\n };\n\n moveArrayElementDown: (path: Path) => void = (path: Path) => {\n // Moving an element down can also be expressed as swapping it with the\n // following element.\n const index = path[path.length - 1];\n const nextElementIndex = index + 1;\n const nextElementPath = path.slice(0, -1).concat(nextElementIndex);\n\n const element = lens(this.props.item).get(multiPath(path));\n const nextElement = lens(this.props.item).get(\n multiPath(nextElementPath),\n );\n\n this.props.onChange({\n item: lens(this.props.item)\n .set(multiPath(path), nextElement)\n .set(multiPath(nextElementPath), element)\n .freeze(),\n });\n };\n\n moveArrayElementUp: (path: Path) => void = (path: Path) => {\n // Moving an element up can also be expressed as moving the previous\n // element down.\n const index = path[path.length - 1];\n const previousElementPath = path.slice(0, -1).concat(index - 1);\n this.moveArrayElementDown(previousElementPath);\n };\n\n _renderEdit: () => React.Element<\"div\"> = () => {\n const apiOptions = {\n ...ApiOptions.defaults,\n ...this.props.apiOptions,\n };\n\n const {item} = this.props;\n const itemShape: Shape = this.props.Layout.shape;\n\n return (\n <div className=\"perseus-multirenderer-editor\">\n <ModeDropdown\n currentMode={this.props.editorMode}\n onChange={(editorMode) => this.props.onChange({editorMode})}\n />\n\n <MultiRenderer\n item={item}\n shape={itemShape}\n apiOptions={apiOptions}\n >\n {({renderers}) => (\n <NodeContainer\n shape={itemShape}\n data={itemToTree(item)}\n path={[]}\n actions={this}\n apiOptions={apiOptions}\n renderers={renderers}\n />\n )}\n </MultiRenderer>\n </div>\n );\n };\n\n score: () => any | void = () => {\n if (this.layout) {\n return this.layout.score();\n }\n };\n\n getSerializedState: () => any | void = () => {\n if (this.layout) {\n return this.layout.getSerializedState();\n }\n };\n\n restoreSerializedState: (state: any) => void = (state: $FlowFixMe) => {\n if (this.layout) {\n this.layout.restoreSerializedState(state);\n }\n };\n\n _renderContent: () => React.Element<\"div\"> | React.Node = () => {\n switch (this.props.editorMode) {\n case \"json\":\n return this._renderJson();\n case \"preview\":\n return this._renderPreview();\n case \"edit\":\n return this._renderEdit();\n default:\n return (\n <ModeDropdown\n currentMode={this.props.editorMode}\n onChange={(editorMode) =>\n this.props.onChange({\n editorMode,\n })\n }\n />\n );\n }\n };\n\n render(): React.Element<\"div\"> {\n return <div id=\"perseus\">{this._renderContent()}</div>;\n }\n}\n\nconst styles = StyleSheet.create({\n // This is used in a number of places throughout this file.\n container: {},\n\n // eslint-disable-next-line react-native/no-unused-styles\n editor: {\n width: \"100%\",\n },\n\n // eslint-disable-next-line react-native/no-unused-styles\n treePreview: {\n position: \"relative\",\n },\n\n verticalFlip: {\n transform: \"scaleY(-1)\",\n },\n\n control: {\n marginLeft: 12,\n },\n\n containerHeader: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n\n previewCollectionHeader: {\n marginBottom: 16,\n },\n\n containerTitle: {\n flexGrow: 1,\n margin: 0,\n },\n\n contentIndent: {\n marginLeft: 8,\n },\n\n hintEditor: {\n paddingBottom: 0,\n },\n\n arrayElement: {\n marginBottom: 16,\n },\n\n // Leaf nodes are already wrapped in cute little pods, so they don't need\n // this extra border between array elements.\n arrayElementAndNotLeaf: {\n borderBottom: \"1px solid #ccc\",\n \":first-child\": {\n borderTop: \"1px solid #ccc\",\n paddingTop: 16,\n },\n },\n\n objectElement: {\n marginBottom: 16,\n },\n\n tagsEditor: {\n border: \"1px solid #ddd\",\n padding: \"5px 10px\",\n },\n\n /**\n * A row contains a fixed width editor and a preview that expands as\n * needed.\n */\n row: {\n display: \"flex\",\n position: \"relative\",\n },\n\n /**\n * The editor.\n */\n columnLeft: {\n width: 360,\n marginRight: 30,\n // so that the `position: absolute` of line markers are positioned\n // relative to this.\n position: \"relative\",\n },\n\n /**\n * The preview.\n */\n columnRight: {\n flex: 1,\n marginLeft: 30,\n position: \"relative\",\n },\n\n /**\n * Sticks to just under the heading.\n */\n sticky: {\n position: \"sticky\",\n top: 33, // height of the cute pod for the editor\n },\n\n /**\n * Used for sticky headings.\n */\n rowHeading: {\n position: \"sticky\",\n backgroundColor: \"white\",\n width: \"100%\",\n // TODO(joshuan): Make this less arbitrary. It should be higher than\n // perseus content.\n zIndex: 101,\n top: -1,\n },\n});\n\nexport default MultiRendererEditor;\n","/* eslint-disable react/no-unsafe */\n// @flow\n\n/**\n * Renders an ArticleEditor as a non-controlled component.\n *\n * Normally the parent of ArticleEditor must pass it an onChange callback and\n * then respond to any changes by modifying the ArticleEditor props to reflect\n * those changes. With StatefulArticleEditor changes are stored in state so you\n * can query them with serialize.\n */\n\nimport createReactClass from \"create-react-class\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport ArticleEditor from \"./article-editor.jsx\";\n\n// $FlowFixMe[signature-verification-failure]\nconst StatefulArticleEditor = createReactClass({\n displayName: \"StatefulArticleEditor\",\n\n getInitialState: function () {\n return _({}).extend(this.props, {\n mode: \"edit\",\n onChange: this.handleChange,\n ref: \"editor\",\n screen: \"phone\",\n });\n },\n\n componentDidMount: function () {\n // TODO(scottgrant): This is a hack to remove the deprecated call to\n // this.isMounted() but is still considered an anti-pattern.\n this._isMounted = true;\n },\n\n // getInitialState isn't called if the react component is re-rendered\n // in-place on the dom, in which case this is called instead, so we\n // need to update the state here.\n // (This component is currently re-rendered by the \"Add image\" button.)\n UNSAFE_componentWillReceiveProps: function (nextProps) {\n // be careful not to overwrite our onChange and ref\n this.setState(_(nextProps).omit(\"onChange\", \"ref\"));\n },\n\n componentWillUnmount: function () {\n this._isMounted = false;\n },\n\n getSaveWarnings: function () {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.getSaveWarnings();\n },\n\n serialize: function () {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.serialize();\n },\n\n handleChange: function (newState, cb) {\n if (this._isMounted) {\n this.setState(newState, cb);\n }\n },\n\n scorePreview: function () {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.scorePreview();\n },\n\n render: function () {\n const {mode, screen} = this.state;\n return (\n <div>\n <div style={styles.controlBar}>\n <span style={styles.controls}>\n Mode:{\" \"}\n <span\n onClick={() => this.setState({mode: \"edit\"})}\n style={\n mode === \"edit\"\n ? styles.controlSelected\n : styles.control\n }\n >\n EDIT\n </span>\n {\" | \"}\n <span\n onClick={() => this.setState({mode: \"preview\"})}\n style={\n mode === \"preview\"\n ? styles.controlSelected\n : styles.control\n }\n >\n PREVIEW\n </span>\n {\" | \"}\n <span\n onClick={() => this.setState({mode: \"json\"})}\n style={\n mode === \"json\"\n ? styles.controlSelected\n : styles.control\n }\n >\n JSON\n </span>\n </span>\n <span style={styles.controls}>\n Screen:{\" \"}\n <span\n onClick={() => this.setState({screen: \"phone\"})}\n style={\n screen === \"phone\"\n ? styles.controlSelected\n : styles.control\n }\n >\n PHONE\n </span>\n {\" | \"}\n <span\n onClick={() => this.setState({screen: \"tablet\"})}\n style={\n screen === \"tablet\"\n ? styles.controlSelected\n : styles.control\n }\n >\n TABLET\n </span>\n {\" | \"}\n <span\n onClick={() => this.setState({screen: \"desktop\"})}\n style={\n screen === \"desktop\"\n ? styles.controlSelected\n : styles.control\n }\n >\n DESKTOP\n </span>\n </span>\n </div>\n <div style={styles.editor}>\n <ArticleEditor {...this.state} />\n </div>\n </div>\n );\n },\n});\n\nconst styles = {\n controlBar: {\n marginBottom: 25,\n marginTop: 5,\n },\n controls: {\n marginRight: 10,\n },\n controlSelected: {\n cursor: \"default\",\n fontWeight: 700,\n },\n control: {\n cursor: \"pointer\",\n },\n editor: {\n marginTop: -20,\n },\n};\n\nexport default StatefulArticleEditor;\n","/* eslint-disable react/no-unsafe, react/sort-comp */\n// @flow\nimport createReactClass from \"create-react-class\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport EditorPage from \"./editor-page.jsx\";\n\n/* Renders an EditorPage (or an ArticleEditor) as a non-controlled component.\n *\n * Normally the parent of EditorPage must pass it an onChange callback and then\n * respond to any changes by modifying the EditorPage props to reflect those\n * changes. With StatefulEditorPage changes are stored in state so you can\n * query them with serialize.\n */\n// $FlowFixMe[signature-verification-failure]\nconst StatefulEditorPage = createReactClass({\n displayName: \"StatefulEditorPage\",\n\n propTypes: {\n componentClass: PropTypes.func,\n },\n\n getDefaultProps: function () {\n return {\n componentClass: EditorPage,\n };\n },\n\n render: function () {\n const Component = this.props.componentClass;\n return <Component {...this.state} />;\n },\n\n getInitialState: function () {\n return _({}).extend(_.omit(this.props, \"componentClass\"), {\n onChange: this.handleChange,\n ref: \"editor\",\n });\n },\n\n componentDidMount: function () {\n this._isMounted = true;\n },\n\n componentWillUnmount: function () {\n this._isMounted = false;\n },\n\n // getInitialState isn't called if the react component is re-rendered\n // in-place on the dom, in which case this is called instead, so we\n // need to update the state here.\n // (This component is currently re-rendered by the \"Add image\" button.)\n UNSAFE_componentWillReceiveProps: function (nextProps) {\n this.setState(\n _(nextProps).pick(\n \"apiOptions\",\n \"imageUploader\",\n \"developerMode\",\n \"problemNum\",\n \"previewDevice\",\n \"frameSource\",\n ),\n );\n },\n\n getSaveWarnings: function () {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.getSaveWarnings();\n },\n\n serialize: function () {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.serialize();\n },\n\n handleChange: function (newState, cb) {\n if (this._isMounted) {\n this.setState(newState, cb);\n }\n },\n\n scorePreview: function () {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.scorePreview();\n },\n});\n\nexport default StatefulEditorPage;\n","// @flow\nimport {\n components,\n ApiOptions,\n Categorizer as CategorizerWidget,\n Changeable,\n EditorJsonify,\n} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {PropCheckBox, TextListEditor} = components;\nconst Categorizer = CategorizerWidget.widget;\n\ntype Props = $FlowFixMe;\n\nclass CategorizerEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n apiOptions: ApiOptions.propTypes,\n items: PropTypes.arrayOf(PropTypes.string),\n categories: PropTypes.arrayOf(PropTypes.string),\n values: PropTypes.arrayOf(PropTypes.number),\n randomizeItems: PropTypes.bool,\n };\n\n static widgetName: string = \"categorizer\";\n\n static defaultProps: Props = {\n items: [],\n categories: [],\n values: [],\n randomizeItems: false,\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n <div className=\"perseus-widget-row\">\n <PropCheckBox\n label=\"Randomize item order\"\n labelAlignment=\"right\"\n randomizeItems={this.props.randomizeItems}\n onChange={this.props.onChange}\n />\n </div>\n Categories:\n <TextListEditor\n options={this.props.categories}\n onChange={(cat) => {\n this.change(\"categories\", cat);\n }}\n layout=\"horizontal\"\n />\n Items:\n <TextListEditor\n options={this.props.items}\n onChange={(items) => {\n this.change({\n items: items,\n // TODO(eater): This truncates props.values so there\n // are never more correct answers than items,\n // ensuring the widget is possible to answer\n // correctly. It doesn't necessarly keep each\n // answer with its corresponding item if an item\n // is deleted from the middle. Inconvenient, but\n // it's at least possible for content creators to\n // catch and fix.\n values: _.first(this.props.values, items.length),\n });\n }}\n layout=\"vertical\"\n />\n {/* There are a bunch of props that renderer.jsx passes to each widget\n via widget-container.jsx that we aren't passing to Categorizer here.\n See perseus-all-package/types.js#WidgetProps for details. */}\n {/* $FlowFixMe[prop-missing] */}\n <Categorizer\n apiOptions={this.props.apiOptions}\n items={this.props.items}\n categories={this.props.categories}\n values={this.props.values}\n onChange={(newProps) => {\n this.props.onChange(newProps);\n }}\n // eslint-disable-next-line react/jsx-no-bind\n trackInteraction={function () {}}\n />\n </div>\n );\n }\n}\n\nexport default CategorizerEditor;\n","// @flow\nimport * as React from \"react\";\n\nimport type {CSSProperties} from \"aphrodite\";\n\ntype Props = {|\n value: string,\n onChange: (string) => void,\n className?: string,\n style?: CSSProperties,\n|};\n\ntype State = {|\n value: string,\n|};\n\n/* You know when you want to propagate input to a parent...\n * but then that parent does something with the input...\n * then changing the props of the input...\n * on every keystroke...\n * so if some input is invalid or incomplete...\n * the input gets reset or otherwise effed...\n *\n * This is the solution.\n *\n * Enough melodrama. Its an input that only sends changes\n * to its parent on blur.\n */\n// eslint-disable-next-line react/no-unsafe\nclass BlurInput extends React.Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = {value: this.props.value};\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: Props) {\n this.setState({value: nextProps.value});\n }\n\n handleChange: (e: $FlowFixMe) => void = (e) => {\n this.setState({value: e.target.value});\n };\n\n handleBlur: (e: $FlowFixMe) => void = (e) => {\n this.props.onChange(e.target.value);\n };\n\n render(): React.Element<\"input\"> {\n return (\n <input\n className={this.props.className}\n style={this.props.style}\n type=\"text\"\n value={this.state.value}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n />\n );\n }\n}\n\nexport default BlurInput;\n","/* eslint-disable no-useless-escape */\n// @flow\n/**\n * This editor is for embedding Khan Academy CS programs.\n */\n\nimport {\n components,\n Changeable,\n Dependencies,\n EditorJsonify,\n Errors,\n Log,\n} from \"@khanacademy/perseus\";\nimport $ from \"jquery\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport BlurInput from \"../components/blur-input.jsx\";\n\nconst {InfoTip, PropCheckBox} = components;\n\nconst DEFAULT_WIDTH = 400;\nconst DEFAULT_HEIGHT = 400;\n\n/**\n * This is used for editing a name/value pair.\n */\nclass PairEditor extends React.Component<$FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n name: PropTypes.string,\n value: PropTypes.string,\n };\n\n static defaultProps = {\n name: \"\",\n value: \"\",\n };\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <fieldset className=\"pair-editor\">\n <label>\n Name:{\" \"}\n <BlurInput\n value={this.props.name}\n // $FlowFixMe[incompatible-type] single-param call returns a callback\n onChange={this.change(\"name\")}\n />\n </label>\n <label>\n {\" \"}\n Value:{\" \"}\n <BlurInput\n value={this.props.value}\n // $FlowFixMe[incompatible-type] single-param call returns a callback\n onChange={this.change(\"value\")}\n />\n </label>\n </fieldset>\n );\n }\n}\n\n/**\n * This is used for editing a set of name/value pairs.\n */\nclass PairsEditor extends React.Component<$FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n pairs: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string,\n }),\n ).isRequired,\n };\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n handlePairChange = (pairIndex, pair) => {\n // If they're both non empty, add a new one\n const pairs = this.props.pairs.slice();\n pairs[pairIndex] = pair;\n\n const lastPair = pairs[pairs.length - 1];\n if (lastPair.name && lastPair.value) {\n pairs.push({name: \"\", value: \"\"});\n }\n this.change(\"pairs\", pairs);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n const editors = _.map(this.props.pairs, (pair, i) => {\n return (\n <PairEditor\n key={i}\n name={pair.name}\n value={pair.value}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.handlePairChange.bind(this, i)}\n />\n );\n });\n return <div>{editors}</div>;\n }\n}\n\nconst KA_PROGRAM_URL = /khanacademy\\.org\\/computer-programming\\/[^\\/]+\\/(\\d+)/;\n\n/**\n * Given a program URL from the site, extract its program ID.\n * If the input does not match the known URL patterns, it is assumed to be\n * a program ID.\n */\nfunction isolateProgramID(programUrl) {\n const match = KA_PROGRAM_URL.exec(programUrl);\n if (match) {\n programUrl = match[1];\n }\n\n return programUrl;\n}\n\n/**\n * This is the main editor for this widget, to specify all the options.\n */\nclass CSProgramEditor extends React.Component<$FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n };\n\n static widgetName: string = \"cs-program\";\n\n static defaultProps: $FlowFixMe = {\n programID: \"\",\n programType: null,\n settings: [{name: \"\", value: \"\"}],\n showEditor: false,\n showButtons: false,\n width: DEFAULT_WIDTH,\n height: DEFAULT_HEIGHT,\n };\n\n change: (...args: $ReadOnlyArray<mixed>) => $FlowFixMe = (...args) => {\n // $FlowFixMe[incompatible-call]\n return Changeable.change.apply(this, args);\n };\n\n _handleSettingsChange: ($FlowFixMe) => void = (settings) => {\n this.change({settings: settings.pairs});\n };\n\n _handleProgramIDChange: (string) => void = (programID) => {\n programID = isolateProgramID(programID);\n const {isDevServer, InitialRequestUrl} = Dependencies.getDependencies();\n\n const host = isDevServer\n ? InitialRequestUrl.origin\n : \"https://www.khanacademy.org\";\n const baseUrl = `${host}/api/internal/scratchpads/${programID}`;\n\n $.getJSON(baseUrl)\n .done((programInfo) => {\n const programType = programInfo.userAuthoredContentType;\n this.change({\n width: programInfo.width,\n height: programInfo.height,\n programID: programID,\n programType: programType,\n });\n })\n .fail((jqxhr, textStatus, error) => {\n Log.error(\n \"Error retrieving scratchpad info for program ID \",\n Errors.TransientService,\n {\n cause: error,\n loggedMetadata: {\n textStatus,\n programID,\n },\n },\n );\n this.change({\n width: DEFAULT_WIDTH,\n height: DEFAULT_HEIGHT,\n programID: programID,\n programType: null,\n });\n });\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n <label>\n Url or Program ID:{\" \"}\n <BlurInput\n value={this.props.programID}\n onChange={this._handleProgramIDChange}\n />\n </label>\n <br />\n <PropCheckBox\n label=\"Show Editor\"\n showEditor={this.props.showEditor}\n onChange={this.props.onChange}\n />\n <InfoTip>\n If you show the editor, you should use the \"full-width\"\n alignment to make room for the width of the editor.\n </InfoTip>\n <br />\n <PropCheckBox\n label=\"Show Buttons\"\n showButtons={this.props.showButtons}\n onChange={this.props.onChange}\n />\n <br />\n <label>\n Settings:\n <PairsEditor\n name=\"settings\"\n pairs={this.props.settings}\n onChange={this._handleSettingsChange}\n />\n <InfoTip>\n Settings that you add here are available to the program\n as an object returned by <code>Program.settings()</code>\n </InfoTip>\n </label>\n </div>\n );\n }\n}\n\nexport default CSProgramEditor;\n","// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {TextInput} = components;\n\ntype Props = $FlowFixMe;\n\nclass DefinitionEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n togglePrompt: PropTypes.string,\n definition: PropTypes.string,\n apiOptions: PropTypes.any,\n };\n\n static widgetName: string = \"definition\";\n\n static defaultProps: Props = {\n togglePrompt: \"\",\n definition: \"\",\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-widget-definition-editor\">\n <a\n // eslint-disable-next-line static-service/require-safe-link-to\n href=\"https://docs.google.com/document/d/1udaPef4imOfTMhmLDlWq4SM0mxL0r3YHFZE-5J1uGfo\"\n target=\"_blank\"\n >\n Definition style guide\n </a>\n <div className=\"perseus-widget-row\">\n <label>\n Word to be defined:{\" \"}\n <TextInput\n value={this.props.togglePrompt}\n onChange={this.change(\"togglePrompt\")}\n placeholder=\"define me\"\n />\n </label>\n </div>\n <div className=\"perseus-widget-row\">\n <Editor\n apiOptions={this.props.apiOptions}\n content={this.props.definition}\n widgetEnabled={false}\n placeholder=\"definition goes here\"\n onChange={(props) => {\n const newProps = {};\n if (_.has(props, \"content\")) {\n newProps.definition = props.content;\n }\n this.change(newProps);\n }}\n />\n </div>\n </div>\n );\n }\n}\n\nexport default DefinitionEditor;\n","// @flow\nimport {components, icons, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport _ from \"underscore\";\n\nconst {InfoTip, InlineIcon} = components;\nconst {iconPlus, iconTrash} = icons;\n\ntype Props = $FlowFixMe;\n\nclass DropdownEditor extends React.Component<Props> {\n static propTypes = {\n choices: PropTypes.arrayOf(\n PropTypes.shape({\n content: PropTypes.string,\n correct: PropTypes.bool,\n }),\n ),\n placeholder: PropTypes.string,\n };\n\n static widgetName: string = \"dropdown\";\n\n static defaultProps: Props = {\n placeholder: \"\",\n choices: [\n {\n content: \"\",\n correct: false,\n },\n ],\n };\n\n onPlaceholderChange: (SyntheticInputEvent<>) => void = (e) => {\n const placeholder = e.target.value;\n this.props.onChange({placeholder: placeholder});\n };\n\n onCorrectChange: (number, SyntheticInputEvent<>) => void = (\n choiceIndex,\n ) => {\n const choices = _.map(this.props.choices, function (choice, i) {\n return _.extend({}, choice, {\n correct: i === choiceIndex,\n });\n });\n this.props.onChange({choices: choices});\n };\n\n onContentChange: (number, SyntheticInputEvent<>) => void = (\n choiceIndex,\n e,\n ) => {\n const choices = this.props.choices.slice();\n const choice = _.clone(choices[choiceIndex]);\n choice.content = e.target.value;\n choices[choiceIndex] = choice;\n this.props.onChange({choices: choices});\n };\n\n addChoice: (SyntheticMouseEvent<>) => void = (e) => {\n e.preventDefault();\n\n const choices = this.props.choices;\n const blankChoice = {content: \"\", correct: false};\n this.props.onChange(\n {\n choices: choices.concat([blankChoice]),\n },\n this.focus.bind(this, choices.length),\n );\n };\n\n removeChoice: (number, SyntheticMouseEvent<>) => void = (\n choiceIndex,\n e,\n ) => {\n e.preventDefault();\n const choices = _(this.props.choices).clone();\n choices.splice(choiceIndex, 1);\n this.props.onChange({\n choices: choices,\n });\n };\n\n focus: (number) => boolean = (i) => {\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n ReactDOM.findDOMNode(this.refs[\"editor\" + i]).focus(); // eslint-disable-line react/no-string-refs\n return true;\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n const dropdownGroupName = _.uniqueId(\"perseus_dropdown_\");\n return (\n <div className=\"perseus-widget-dropdown\">\n <div className=\"dropdown-info\">\n Dropdown\n <InfoTip>\n <p>\n The drop down is useful for making inequalities in a\n custom format. We normally use the symbols {\"<\"},{\" \"}\n {\">\"}, ≤, ≥ (in that order) which you can copy into\n the choices. When possible, use the \"multiple\n choice\" answer type instead.\n </p>\n </InfoTip>\n </div>\n <div className=\"dropdown-placeholder\">\n <input\n type=\"text\"\n placeholder=\"Placeholder value\"\n value={this.props.placeholder}\n onChange={this.onPlaceholderChange}\n />\n <InfoTip>\n <p>\n This value will appear as the drop down default. It\n should give the user some indication of the values\n available in the drop down itself, e.g.,\n Yes/No/Maybe.\n </p>\n </InfoTip>\n </div>\n <div className=\"clearfix\" />\n <ul className=\"dropdown-choices\">\n {this.props.choices.map(function (choice, i) {\n const checkedClass = choice.correct\n ? \"correct\"\n : \"incorrect\";\n\n return (\n <li key={\"\" + i}>\n <div>\n <input\n ref={\"radio\" + i}\n type=\"radio\"\n name={dropdownGroupName}\n checked={\n choice.correct ? \"checked\" : \"\"\n }\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onCorrectChange.bind(\n this,\n i,\n )}\n value={i}\n />\n <input\n type=\"text\"\n ref={\"editor\" + i}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onContentChange.bind(\n this,\n i,\n )}\n className={checkedClass}\n value={choice.content}\n />\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n <a\n href=\"#\"\n className=\"simple-button orange\"\n // eslint-disable-next-line react/jsx-no-bind\n onClick={this.removeChoice.bind(\n this,\n i,\n )}\n >\n <span className=\"remove-choice\">\n <InlineIcon {...iconTrash} />\n </span>\n </a>\n </div>\n </li>\n );\n }, this)}\n </ul>\n\n <div className=\"add-choice-container\">\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n <a\n href=\"#\"\n className=\"simple-button orange\"\n onClick={this.addChoice}\n >\n <InlineIcon {...iconPlus} /> Add a choice{\" \"}\n </a>\n </div>\n </div>\n );\n }\n}\n\nexport default DropdownEditor;\n","/*\n * Number Utils\n * A number is a js-number, e.g. 5.12\n */\n\nvar _ = require(\"underscore\");\n\nvar DEFAULT_TOLERANCE = 1e-9;\nvar EPSILON = Math.pow(2, -42);\n\nvar knumber = {\n\n DEFAULT_TOLERANCE: DEFAULT_TOLERANCE,\n EPSILON: EPSILON,\n\n is: function(x) {\n return _.isNumber(x) && !_.isNaN(x);\n },\n\n equal: function(x, y, tolerance) {\n // Checking for undefined makes this function behave nicely\n // with vectors of different lengths that are _.zip'd together\n if (x == null || y == null) {\n return x === y;\n }\n // We check === here so that +/-Infinity comparisons work correctly\n if (x === y) {\n return true;\n }\n if (tolerance == null) {\n tolerance = DEFAULT_TOLERANCE;\n }\n return Math.abs(x - y) < tolerance;\n },\n\n sign: function(x, tolerance) {\n return knumber.equal(x, 0, tolerance) ? 0 : Math.abs(x) / x;\n },\n\n isInteger: function(num, tolerance) {\n return knumber.equal(Math.round(num), num, tolerance);\n },\n\n\n // Round a number to a certain number of decimal places\n round: function(num, precision) {\n var factor = Math.pow(10, precision);\n return Math.round(num * factor) / factor;\n },\n\n // Round num to the nearest multiple of increment\n // i.e. roundTo(83, 5) -> 85\n roundTo: function(num, increment) {\n return Math.round(num / increment) * increment;\n },\n\n floorTo: function(num, increment) {\n return Math.floor(num / increment) * increment;\n },\n\n ceilTo: function(num, increment) {\n return Math.ceil(num / increment) * increment;\n },\n\n /**\n * toFraction\n *\n * Returns a [numerator, denominator] array rational representation\n * of `decimal`\n *\n * See http://en.wikipedia.org/wiki/Continued_fraction for implementation\n * details\n *\n * toFraction(4/8) => [1, 2]\n * toFraction(0.66) => [33, 50]\n * toFraction(0.66, 0.01) => [2/3]\n * toFraction(283 + 1/3) => [850, 3]\n */\n toFraction: function(decimal, tolerance, max_denominator) {\n max_denominator = max_denominator || 1000;\n tolerance = tolerance || EPSILON; // can't be 0\n\n // Initialize everything to compute successive terms of\n // continued-fraction approximations via recurrence relation\n var n = [1, 0], d = [0, 1];\n var a = Math.floor(decimal), t;\n var rem = decimal - a;\n\n while (d[0] <= max_denominator) {\n if (knumber.equal(n[0] / d[0], decimal, tolerance)) {\n return [n[0], d[0]];\n }\n n = [a*n[0] + n[1], n[0]];\n d = [a*d[0] + d[1], d[0]];\n a = Math.floor(1 / rem);\n rem = 1/rem - a;\n }\n\n // We failed to find a nice rational representation,\n // so return an irrational \"fraction\"\n return [decimal, 1];\n }\n};\n\nmodule.exports = knumber;\n\n","/*\n * Vector Utils \n * A vector is an array of numbers e.g. [0, 3, 4].\n */\n\nvar _ = require(\"underscore\");\nvar knumber = require(\"./number.js\");\n\nfunction arraySum(array) {\n return _.reduce(array, function(memo, arg) { return memo + arg; }, 0);\n}\n\nfunction arrayProduct(array) {\n return _.reduce(array, function(memo, arg) { return memo * arg; }, 1);\n}\n\nvar kvector = {\n\n is: function(vec, dimension) {\n if (!_.isArray(vec)) {\n return false;\n }\n if (dimension !== undefined && vec.length !== dimension) {\n return false;\n }\n return _.all(vec, knumber.is);\n },\n\n // Normalize to a unit vector\n normalize: function(v) {\n return kvector.scale(v, 1 / kvector.length(v));\n },\n\n // Length/magnitude of a vector\n length: function(v) {\n return Math.sqrt(kvector.dot(v, v));\n },\n\n // Dot product of two vectors\n dot: function(a, b) {\n var vecs = _.toArray(arguments);\n var zipped = _.zip.apply(_, vecs);\n var multiplied = _.map(zipped, arrayProduct);\n return arraySum(multiplied);\n },\n\n /* vector-add multiple [x, y] coords/vectors\n *\n * kvector.add([1, 2], [3, 4]) -> [4, 6]\n */\n add: function() {\n var points = _.toArray(arguments);\n var zipped = _.zip.apply(_, points);\n return _.map(zipped, arraySum);\n },\n\n subtract: function(v1, v2) {\n return _.map(_.zip(v1, v2), function(dim) {\n return dim[0] - dim[1];\n });\n },\n\n negate: function(v) {\n return _.map(v, function(x) {\n return -x;\n });\n },\n\n // Scale a vector\n scale: function(v1, scalar) {\n return _.map(v1, function(x) {\n return x * scalar;\n });\n },\n\n equal: function(v1, v2, tolerance) {\n // _.zip will nicely deal with the lengths, going through\n // the length of the longest vector. knumber.equal then\n // returns false for any number compared to the undefined\n // passed in if one of the vectors is shorter.\n return _.all(_.zip(v1, v2), function(pair) {\n return knumber.equal(pair[0], pair[1], tolerance);\n });\n },\n\n codirectional: function(v1, v2, tolerance) {\n // The origin is trivially codirectional with all other vectors.\n // This gives nice semantics for codirectionality between points when\n // comparing their difference vectors.\n if (knumber.equal(kvector.length(v1), 0, tolerance) ||\n knumber.equal(kvector.length(v2), 0, tolerance)) {\n return true;\n }\n\n v1 = kvector.normalize(v1);\n v2 = kvector.normalize(v2);\n\n return kvector.equal(v1, v2, tolerance);\n },\n\n collinear: function(v1, v2, tolerance) {\n return kvector.codirectional(v1, v2, tolerance) ||\n kvector.codirectional(v1, kvector.negate(v2), tolerance);\n },\n\n // Convert a cartesian coordinate into a radian polar coordinate\n polarRadFromCart: function(v) {\n var radius = kvector.length(v);\n var theta = Math.atan2(v[1], v[0]);\n\n // Convert angle range from [-pi, pi] to [0, 2pi]\n if (theta < 0) {\n theta += 2 * Math.PI;\n }\n\n return [radius, theta];\n },\n\n // Converts a cartesian coordinate into a degree polar coordinate\n polarDegFromCart: function(v) {\n var polar = kvector.polarRadFromCart(v);\n return [polar[0], polar[1] * 180 / Math.PI];\n },\n\n /* Convert a polar coordinate into a cartesian coordinate\n *\n * Examples:\n * cartFromPolarRad(5, Math.PI)\n * cartFromPolarRad([5, Math.PI])\n */\n cartFromPolarRad: function(radius, theta) {\n if (_.isUndefined(theta)) {\n theta = radius[1];\n radius = radius[0];\n }\n\n return [radius * Math.cos(theta), radius * Math.sin(theta)];\n },\n\n /* Convert a polar coordinate into a cartesian coordinate\n *\n * Examples:\n * cartFromPolarDeg(5, 30)\n * cartFromPolarDeg([5, 30])\n */\n cartFromPolarDeg: function(radius, theta) {\n if (_.isUndefined(theta)) {\n theta = radius[1];\n radius = radius[0];\n }\n\n return kvector.cartFromPolarRad(radius, theta * Math.PI / 180);\n },\n\n // Rotate vector\n rotateRad: function(v, theta) {\n var polar = kvector.polarRadFromCart(v);\n var angle = polar[1] + theta;\n return kvector.cartFromPolarRad(polar[0], angle);\n },\n\n rotateDeg: function(v, theta) {\n var polar = kvector.polarDegFromCart(v);\n var angle = polar[1] + theta;\n return kvector.cartFromPolarDeg(polar[0], angle);\n },\n\n // Angle between two vectors\n angleRad: function(v1, v2) {\n return Math.acos(kvector.dot(v1, v2) /\n (kvector.length(v1) * kvector.length(v2)));\n },\n\n angleDeg: function(v1, v2) {\n return kvector.angleRad(v1, v2) * 180 / Math.PI;\n },\n\n // Vector projection of v1 onto v2\n projection: function(v1, v2) {\n var scalar = kvector.dot(v1, v2) / kvector.dot(v2, v2);\n return kvector.scale(v2, scalar);\n },\n\n // Round each number to a certain number of decimal places\n round: function(vec, precision) {\n return _.map(vec, function(elem, i) {\n return knumber.round(elem, precision[i] || precision);\n });\n },\n\n // Round each number to the nearest increment\n roundTo: function(vec, increment) {\n return _.map(vec, function(elem, i) {\n return knumber.roundTo(elem, increment[i] || increment);\n });\n },\n\n floorTo: function(vec, increment) {\n return _.map(vec, function(elem, i) {\n return knumber.floorTo(elem, increment[i] || increment);\n });\n },\n\n ceilTo: function(vec, increment) {\n return _.map(vec, function(elem, i) {\n return knumber.ceilTo(elem, increment[i] || increment);\n });\n }\n};\n\nmodule.exports = kvector;\n\n","/*\n * Point Utils\n * A point is an array of two numbers e.g. [0, 0].\n */\n\nvar _ = require(\"underscore\");\nvar kvector = require(\"./vector.js\");\nvar knumber = require(\"./number.js\");\n\nvar kpoint = {\n\n // Rotate point (around origin unless a center is specified)\n rotateRad: function(point, theta, center) {\n if (center === undefined) {\n return kvector.rotateRad(point, theta);\n } else {\n return kvector.add(\n center,\n kvector.rotateRad(\n kvector.subtract(point, center),\n theta\n )\n );\n }\n },\n\n rotateDeg: function(point, theta, center) {\n if (center === undefined) {\n return kvector.rotateDeg(point, theta);\n } else {\n return kvector.add(\n center,\n kvector.rotateDeg(\n kvector.subtract(point, center),\n theta\n )\n );\n }\n },\n\n // Distance between two points\n distanceToPoint: function(point1, point2) {\n return kvector.length(kvector.subtract(point1, point2));\n },\n\n // Distance between point and line\n distanceToLine: function(point, line) {\n var lv = kvector.subtract(line[1], line[0]);\n var pv = kvector.subtract(point, line[0]);\n var projectedPv = kvector.projection(pv, lv);\n var distancePv = kvector.subtract(projectedPv, pv);\n return kvector.length(distancePv);\n },\n\n // Reflect point over line\n reflectOverLine: function(point, line) {\n var lv = kvector.subtract(line[1], line[0]);\n var pv = kvector.subtract(point, line[0]);\n var projectedPv = kvector.projection(pv, lv);\n var reflectedPv = kvector.subtract(kvector.scale(projectedPv, 2), pv);\n return kvector.add(line[0], reflectedPv);\n },\n\n /**\n * Compares two points, returning -1, 0, or 1, for use with\n * Array.prototype.sort\n *\n * Note: This technically doesn't satisfy the total-ordering\n * requirements of Array.prototype.sort unless equalityTolerance\n * is 0. In some cases very close points that compare within a\n * few equalityTolerances could appear in the wrong order.\n */\n compare: function(point1, point2, equalityTolerance) {\n if (point1.length !== point2.length) {\n return point1.length - point2.length;\n }\n for (var i = 0; i < point1.length; i++) {\n if (!knumber.equal(point1[i], point2[i], equalityTolerance)) {\n return point1[i] - point2[i];\n }\n }\n return 0;\n }\n};\n\n_.extend(kpoint, {\n // Check if a value is a point\n is: kvector.is,\n\n // Add and subtract vector(s)\n addVector: kvector.add,\n addVectors: kvector.add,\n subtractVector: kvector.subtract,\n equal: kvector.equal,\n\n // Convert from cartesian to polar and back\n polarRadFromCart: kvector.polarRadFromCart,\n polarDegFromCart: kvector.polarDegFromCart,\n cartFromPolarRad: kvector.cartFromPolarRad,\n cartFromPolarDeg: kvector.cartFromPolarDeg,\n\n // Rounding\n round: kvector.round,\n roundTo: kvector.roundTo,\n floorTo: kvector.floorTo,\n ceilTo: kvector.ceilTo\n});\n\nmodule.exports = kpoint;\n\n","/*\n * Line Utils\n * A line is an array of two points e.g. [[-5, 0], [5, 0]].\n */\n\nvar kpoint = require(\"./point.js\");\nvar kvector = require(\"./vector.js\");\n\nvar kline = {\n\n distanceToPoint: function(line, point) {\n return kpoint.distanceToLine(point, line);\n },\n\n reflectPoint: function(line, point) {\n return kpoint.reflectOverLine(point, line);\n },\n\n midpoint: function(line) {\n return [\n (line[0][0] + line[1][0]) / 2,\n (line[0][1] + line[1][1]) / 2\n ];\n },\n\n equal: function(line1, line2, tolerance) {\n // TODO: A nicer implementation might just check collinearity of\n // vectors using underscore magick\n // Compare the directions of the lines\n var v1 = kvector.subtract(line1[1],line1[0]);\n var v2 = kvector.subtract(line2[1],line2[0]);\n if (!kvector.collinear(v1, v2, tolerance)) {\n return false;\n }\n // If the start point is the same for the two lines, then they are the same\n if (kpoint.equal(line1[0], line2[0])) {\n return true;\n }\n // Make sure that the direction to get from line1 to\n // line2 is the same as the direction of the lines\n var line1ToLine2Vector = kvector.subtract(line2[0], line1[0]);\n return kvector.collinear(v1, line1ToLine2Vector, tolerance);\n }\n};\n\nmodule.exports = kline;\n\n","/*\n * Ray Utils\n * A ray is an array of an endpoint and another point along the ray.\n * For example, [[0, 0], [1, 0]] is the ray starting at the origin and\n * traveling along the positive x-axis.\n */\n\nvar kvector = require(\"./vector.js\");\nvar kpoint = require(\"./point.js\");\n\nvar kray = {\n\n equal: function(ray1, ray2, tolerance) {\n // Compare the directions of the rays\n var v1 = kvector.subtract(ray1[1],ray1[0]);\n var v2 = kvector.subtract(ray2[1],ray2[0]);\n\n var sameOrigin = kpoint.equal(ray1[0], ray2[0]);\n var codirectional = kvector.codirectional(v1, v2, tolerance);\n\n return sameOrigin && codirectional;\n }\n};\n\nmodule.exports = kray;\n\n","module.exports = {\n number: require(\"./number.js\"),\n vector: require(\"./vector.js\"),\n point: require(\"./point.js\"),\n line: require(\"./line.js\"),\n ray: require(\"./ray.js\"),\n};\n","/* eslint-disable no-unused-vars, react/forbid-prop-types, react/sort-comp */\n// @flow\n/**\n * This is an example graphie-using widget\n *\n * TODO(jack): Add more comments\n */\n\nimport {\n components,\n ApiOptions,\n Changeable,\n Util,\n WidgetJsonifyDeprecated,\n} from \"@khanacademy/perseus\";\nimport {number as knumber, point as kpoint} from \"kmath\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport type {Coord, WidgetExports} from \"@khanacademy/perseus\";\n\nconst {Graphie} = components;\n\n// $FlowFixMe[prop-missing]\nconst MovablePoint = Graphie.MovablePoint;\n\ntype Props = $FlowFixMe;\n\n/**\n * This is the widget's renderer. It shows up in the right column\n * in the demo, and is what is visible to users, and where\n * users enter their answers.\n */\nclass ExampleGraphieWidget extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n apiOptions: ApiOptions.propTypes,\n\n graph: PropTypes.object.isRequired,\n coord: PropTypes.arrayOf(PropTypes.number),\n };\n\n static defaultProps: Props = {\n // We want to allow our coord to be null to test if the\n // user has interacted with this widget yet when grading it\n coord: null,\n graph: {\n box: [400, 400],\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n gridStep: [1, 1],\n valid: true,\n backgroundImage: null,\n markings: \"grid\",\n showProtractor: false,\n },\n };\n\n /**\n * This is the widget's grading function\n */\n static validate(state: $FlowFixMe, rubric: $FlowFixMe): $FlowFixMe {\n if (state.coord == null) {\n return {\n type: \"invalid\",\n message: null,\n };\n }\n if (kpoint.equal(state.coord, rubric.correct)) {\n return {\n type: \"points\",\n earned: 1,\n total: 1,\n message: null,\n };\n }\n return {\n type: \"points\",\n earned: 0,\n total: 1,\n message: null,\n };\n }\n\n getUserInput: () => $FlowFixMe = () => {\n return WidgetJsonifyDeprecated.getUserInput.call(this);\n };\n\n render(): React.Node {\n return (\n <Graphie\n // eslint-disable-next-line react/no-string-refs\n ref=\"graphie\"\n box={this.props.graph.box}\n range={this.props.graph.range}\n options={this.props.graph}\n setup={this.setupGraphie}\n setDrawingAreaAvailable={\n this.props.apiOptions.setDrawingAreaAvailable\n }\n >\n <MovablePoint\n pointSize={5}\n coord={this.props.coord || [0, 0]}\n constraints={[\n MovablePoint.constraints.snap(),\n MovablePoint.constraints.bound(),\n ]}\n onMove={this.movePoint}\n />\n </Graphie>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n movePoint: (Coord) => void = (newCoord) => {\n this.change({\n coord: newCoord,\n });\n };\n\n _getGridConfig: ($FlowFixMe) => $FlowFixMe = (options) => {\n return _.map(options.step, function (step, i) {\n return Util.gridDimensionConfig(\n step,\n options.range[i],\n options.box[i],\n options.gridStep[i],\n );\n });\n };\n\n setupGraphie: ($FlowFixMe, $FlowFixMe) => $FlowFixMe = (\n graphie,\n options,\n ) => {\n const gridConfig = this._getGridConfig(options);\n graphie.graphInit({\n range: options.range,\n scale: _.pluck(gridConfig, \"scale\"),\n axisArrows: \"<->\",\n labelFormat: function (s) {\n return \"\\\\small{\" + s + \"}\";\n },\n gridStep: options.gridStep,\n tickStep: _.pluck(gridConfig, \"tickStep\"),\n labelStep: 1,\n unityLabels: _.pluck(gridConfig, \"unityLabel\"),\n });\n graphie.label([0, options.range[1][1]], options.labels[1], \"above\");\n };\n\n simpleValidate: ($FlowFixMe) => $FlowFixMe = (rubric) => {\n return ExampleGraphieWidget.validate(this.getUserInput(), rubric);\n };\n}\n\n/**\n * For this widget to work, we must export it.\n * We also must import this file in src/all-widgets.js\n */\nexport default ({\n name: \"example-graphie-widget\",\n displayName: \"Example Graphie Widget\",\n hidden: true, // Hides this widget from the Perseus.Editor widget select\n widget: ExampleGraphieWidget,\n}: WidgetExports<typeof ExampleGraphieWidget>);\n","// @flow\nimport {Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\n\nimport ExampleGraphie from \"./example-graphie-widget.jsx\";\n\nconst ExampleGraphieWidget = ExampleGraphie.widget;\n\ntype Props = $FlowFixMe;\n\n/**\n * This is the widget's editor. This is what shows up on the left side\n * of the screen in the demo page. Only the question writer sees this.\n */\nclass ExampleGraphieWidgetEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n };\n\n static widgetName: \"example-graphie-widget\" = \"example-graphie-widget\";\n\n static defaultProps: Props = {\n correct: [4, 4],\n graph: {\n box: [340, 340],\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n gridStep: [1, 1],\n valid: true,\n backgroundImage: null,\n markings: \"grid\",\n showProtractor: false,\n },\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n handleChange: ($FlowFixMe) => void = (newProps) => {\n if (newProps.coord) {\n this.change({\n correct: newProps.coord,\n });\n }\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n <ExampleGraphieWidget\n graph={this.props.graph}\n coord={this.props.correct}\n onChange={this.handleChange}\n apiOptions={this.props.apiOptions}\n />\n </div>\n );\n }\n}\n\nexport default ExampleGraphieWidgetEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\n\ntype Props = $FlowFixMe;\n\n/**\n * This is the widget's editor. This is what shows up on the left side\n * of the screen in the demo. Only the question writer sees this.\n */\nclass ExampleWidgetEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n };\n\n static widgetName: \"example-widget\" = \"example-widget\";\n\n static defaultProps: Props = {\n correct: \"\",\n };\n\n handleAnswerChange: (SyntheticInputEvent<>) => void = (event) => {\n this.change({\n correct: event.target.value,\n });\n };\n\n render(): React.Node {\n return (\n <div>\n <label>\n Correct answer:\n <input\n value={this.props.correct}\n onChange={this.handleAnswerChange}\n // eslint-disable-next-line react/no-string-refs\n ref=\"input\"\n />\n </label>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n focus: () => boolean = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.input.focus();\n return true;\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default ExampleWidgetEditor;\n","/* eslint-disable react/forbid-prop-types */\n// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {TextInput} = components;\n\nconst defaultExplanationProps = {\n showPrompt: \"Explain\",\n hidePrompt: \"Hide explanation\",\n explanation: \"explanation goes here\\n\\nmore explanation\",\n widgets: {},\n};\n\ntype Props = $FlowFixMe;\ntype State = $FlowFixMe;\n\nclass ExplanationEditor extends React.Component<Props, State> {\n static propTypes = {\n ...Changeable.propTypes,\n showPrompt: PropTypes.string,\n hidePrompt: PropTypes.string,\n explanation: PropTypes.string,\n widgets: PropTypes.object,\n apiOptions: PropTypes.any,\n };\n\n static widgetName: \"explanation\" = \"explanation\";\n static defaultProps: Props = defaultExplanationProps;\n state: State = {};\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-widget-explanation-editor\">\n <div className=\"perseus-widget-row\">\n <label>\n Prompt to show explanation:{\" \"}\n <TextInput\n value={this.props.showPrompt}\n onChange={this.change(\"showPrompt\")}\n />\n </label>\n </div>\n <div className=\"perseus-widget-row\">\n <label>\n Prompt to hide explanation:{\" \"}\n <TextInput\n value={this.props.hidePrompt}\n onChange={this.change(\"hidePrompt\")}\n />\n </label>\n </div>\n <div className=\"perseus-widget-row\">\n <Editor\n apiOptions={this.props.apiOptions}\n content={this.props.explanation}\n widgets={this.props.widgets}\n widgetEnabled={true}\n immutableWidgets={false}\n onChange={(props) => {\n const newProps = {};\n if (_.has(props, \"content\")) {\n newProps.explanation = props.content;\n }\n if (_.has(props, \"widgets\")) {\n newProps.widgets = props.widgets;\n }\n this.change(newProps);\n }}\n />\n </div>\n </div>\n );\n }\n}\n\nexport default ExplanationEditor;\n","/*! KAS | https://github.com/Khan/KAS */\n// This is a @generated file\nvar _, KAS = {};\n\nif (typeof module === \"object\" && module.exports) {\n _ = require(\"underscore\");\n module.exports = KAS;\n} else {\n _ = window._;\n window.KAS = KAS;\n}\n\n(function(KAS) {\n\n/* parser generated by jison 0.4.15 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,7],$V1=[1,17],$V2=[1,13],$V3=[1,14],$V4=[1,15],$V5=[1,32],$V6=[1,22],$V7=[1,23],$V8=[1,24],$V9=[1,25],$Va=[1,26],$Vb=[1,33],$Vc=[1,27],$Vd=[1,28],$Ve=[1,29],$Vf=[1,30],$Vg=[1,20],$Vh=[1,36],$Vi=[1,37],$Vj=[5,6,8,10,33,35,41,43,45],$Vk=[1,39],$Vl=[1,40],$Vm=[5,6,8,10,12,14,16,19,21,22,28,29,30,31,32,33,34,35,37,39,41,42,43,44,45,46],$Vn=[10,16,19,21,22,28,29,30,31,32,34,37,39,42,43,44,46],$Vo=[5,6,8,10,12,14,16,18,19,21,22,28,29,30,31,32,33,34,35,37,39,41,42,43,44,45,46];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"equation\":3,\"expression\":4,\"SIGN\":5,\"EOF\":6,\"additive\":7,\"+\":8,\"multiplicative\":9,\"-\":10,\"triglog\":11,\"*\":12,\"negative\":13,\"/\":14,\"trig\":15,\"TRIG\":16,\"trigfunc\":17,\"^\":18,\"TRIGINV\":19,\"logbase\":20,\"ln\":21,\"log\":22,\"_\":23,\"subscriptable\":24,\"power\":25,\"primitive\":26,\"variable\":27,\"VAR\":28,\"CONST\":29,\"INT\":30,\"FLOAT\":31,\"{\":32,\"}\":33,\"(\":34,\")\":35,\"function\":36,\"FUNC\":37,\"invocation\":38,\"sqrt\":39,\"[\":40,\"]\":41,\"abs\":42,\"|\":43,\"LEFT|\":44,\"RIGHT|\":45,\"FRAC\":46,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"SIGN\",6:\"EOF\",8:\"+\",10:\"-\",12:\"*\",14:\"/\",16:\"TRIG\",18:\"^\",19:\"TRIGINV\",21:\"ln\",22:\"log\",23:\"_\",28:\"VAR\",29:\"CONST\",30:\"INT\",31:\"FLOAT\",32:\"{\",33:\"}\",34:\"(\",35:\")\",37:\"FUNC\",39:\"sqrt\",40:\"[\",41:\"]\",42:\"abs\",43:\"|\",44:\"LEFT|\",45:\"RIGHT|\",46:\"FRAC\"},\nproductions_: [0,[3,4],[3,2],[3,1],[4,1],[7,3],[7,3],[7,1],[9,2],[9,3],[9,3],[9,1],[13,2],[13,1],[15,1],[17,1],[17,3],[17,1],[20,1],[20,1],[20,3],[11,2],[11,2],[11,1],[25,3],[25,1],[27,1],[24,3],[24,1],[24,1],[24,1],[24,1],[24,3],[24,3],[36,1],[38,4],[38,4],[38,7],[38,4],[38,3],[38,3],[38,4],[26,1],[26,1],[26,7]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\nreturn new yy.Eq($$[$0-3], $$[$0-2], $$[$0-1]);\nbreak;\ncase 2:\nreturn $$[$0-1];\nbreak;\ncase 3:\nreturn new yy.Add([]);\nbreak;\ncase 4: case 7: case 11: case 13: case 15: case 20: case 23: case 25: case 42: case 43:\nthis.$ = $$[$0];\nbreak;\ncase 5:\nthis.$ = yy.Add.createOrAppend($$[$0-2], $$[$0]);\nbreak;\ncase 6:\nthis.$ = yy.Add.createOrAppend($$[$0-2], yy.Mul.handleNegative($$[$0], \"subtract\"));\nbreak;\ncase 8:\nthis.$ = yy.Mul.fold(yy.Mul.createOrAppend($$[$0-1], $$[$0]));\nbreak;\ncase 9:\nthis.$ = yy.Mul.fold(yy.Mul.createOrAppend($$[$0-2], $$[$0]));\nbreak;\ncase 10:\nthis.$ = yy.Mul.fold(yy.Mul.handleDivide($$[$0-2], $$[$0]));\nbreak;\ncase 12:\nthis.$ = yy.Mul.handleNegative($$[$0]);\nbreak;\ncase 14: case 17:\nthis.$ = [yytext];\nbreak;\ncase 16:\nthis.$ = $$[$0-2].concat($$[$0]);\nbreak;\ncase 18:\nthis.$ = yy.Log.natural();\nbreak;\ncase 19:\nthis.$ = yy.Log.common();\nbreak;\ncase 21:\nthis.$ = yy.Trig.create($$[$0-1], $$[$0]);\nbreak;\ncase 22:\nthis.$ = yy.Log.create($$[$0-1], $$[$0]);\nbreak;\ncase 24:\nthis.$ = new yy.Pow($$[$0-2], $$[$0]);\nbreak;\ncase 26: case 34:\nthis.$ = yytext;\nbreak;\ncase 27:\nthis.$ = new yy.Var($$[$0-2], $$[$0]);\nbreak;\ncase 28:\nthis.$ = new yy.Var($$[$0]);\nbreak;\ncase 29:\nthis.$ = new yy.Const(yytext.toLowerCase());\nbreak;\ncase 30:\nthis.$ = yy.Int.create(Number(yytext));\nbreak;\ncase 31:\nthis.$ = yy.Float.create(Number(yytext));\nbreak;\ncase 32:\nthis.$ = $$[$0-1].completeParse();\nbreak;\ncase 33:\nthis.$ = $$[$0-1].completeParse().addHint('parens');\nbreak;\ncase 35: case 36:\nthis.$ = yy.Pow.sqrt($$[$0-1]);\nbreak;\ncase 37:\nthis.$ = new yy.Pow.nthroot($$[$0-1], $$[$0-4]);\nbreak;\ncase 38: case 39: case 40:\nthis.$ = new yy.Abs($$[$0-1]);\nbreak;\ncase 41:\nthis.$ = new yy.Func($$[$0-3], $$[$0-1]);\nbreak;\ncase 44:\nthis.$ = yy.Mul.handleDivide($$[$0-4], $$[$0-1]);\nbreak;\n}\n},\ntable: [{3:1,4:2,6:[1,3],7:4,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{1:[3]},{5:[1,34],6:[1,35]},{1:[2,3]},o([5,6],[2,4],{8:$Vh,10:$Vi}),o($Vj,[2,7],{17:9,20:10,25:11,15:12,26:16,24:18,38:19,27:21,36:31,11:38,12:$Vk,14:$Vl,16:$V1,19:$V2,21:$V3,22:$V4,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,37:$Vb,39:$Vc,42:$Vd,44:$Vf,46:$Vg}),o($Vm,[2,11]),{10:$V0,11:8,13:41,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},o($Vm,[2,13]),{10:$V0,11:8,13:42,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{10:$V0,11:8,13:43,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},o($Vm,[2,23]),o($Vn,[2,15],{18:[1,44]}),o($Vn,[2,17]),o($Vn,[2,18]),o($Vn,[2,19],{23:[1,45]}),o($Vm,[2,25],{18:[1,46]}),o([10,16,18,19,21,22,28,29,30,31,32,34,37,39,42,43,44,46],[2,14]),o($Vo,[2,42]),o($Vo,[2,43]),{32:[1,47]},o($Vo,[2,28],{23:[1,48]}),o($Vo,[2,29]),o($Vo,[2,30]),o($Vo,[2,31]),{7:49,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:50,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{32:[1,52],34:[1,51],40:[1,53]},{34:[1,54]},{7:55,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:56,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{34:[1,57]},o([5,6,8,10,12,14,16,18,19,21,22,23,28,29,30,31,32,33,34,35,37,39,41,42,43,44,45,46],[2,26]),{34:[2,34]},{4:58,7:4,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{1:[2,2]},{9:59,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{9:60,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},o($Vm,[2,8]),{10:$V0,11:8,13:61,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{10:$V0,11:8,13:62,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},o($Vm,[2,12]),o($Vm,[2,21]),o($Vm,[2,22]),{10:$V0,11:8,13:63,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{24:64,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va},{10:$V0,11:8,13:65,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:66,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{24:67,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va},{8:$Vh,10:$Vi,33:[1,68]},{8:$Vh,10:$Vi,35:[1,69]},{7:70,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:71,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:72,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:73,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{8:$Vh,10:$Vi,43:[1,74]},{8:$Vh,10:$Vi,45:[1,75]},{7:76,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{6:[1,77]},o($Vj,[2,5],{17:9,20:10,25:11,15:12,26:16,24:18,38:19,27:21,36:31,11:38,12:$Vk,14:$Vl,16:$V1,19:$V2,21:$V3,22:$V4,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,37:$Vb,39:$Vc,42:$Vd,44:$Vf,46:$Vg}),o($Vj,[2,6],{17:9,20:10,25:11,15:12,26:16,24:18,38:19,27:21,36:31,11:38,12:$Vk,14:$Vl,16:$V1,19:$V2,21:$V3,22:$V4,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,37:$Vb,39:$Vc,42:$Vd,44:$Vf,46:$Vg}),o($Vm,[2,9]),o($Vm,[2,10]),o($Vn,[2,16]),o($Vn,[2,20]),o($Vm,[2,24]),{8:$Vh,10:$Vi,33:[1,78]},o($Vo,[2,27]),o($Vo,[2,32]),o($Vo,[2,33]),{8:$Vh,10:$Vi,35:[1,79]},{8:$Vh,10:$Vi,33:[1,80]},{8:$Vh,10:$Vi,41:[1,81]},{8:$Vh,10:$Vi,35:[1,82]},o($Vo,[2,39]),o($Vo,[2,40]),{8:$Vh,10:$Vi,35:[1,83]},{1:[2,1]},{32:[1,84]},o($Vo,[2,35]),o($Vo,[2,36]),{32:[1,85]},o($Vo,[2,38]),o($Vo,[2,41]),{7:86,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{7:87,9:5,10:$V0,11:8,13:6,15:12,16:$V1,17:9,19:$V2,20:10,21:$V3,22:$V4,24:18,25:11,26:16,27:21,28:$V5,29:$V6,30:$V7,31:$V8,32:$V9,34:$Va,36:31,37:$Vb,38:19,39:$Vc,42:$Vd,43:$Ve,44:$Vf,46:$Vg},{8:$Vh,10:$Vi,33:[1,88]},{8:$Vh,10:$Vi,33:[1,89]},o($Vo,[2,44]),o($Vo,[2,37])],\ndefaultActions: {3:[2,3],33:[2,34],35:[2,2],77:[2,1]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n throw new Error(str);\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n //_token_stack:\n function lex() {\n var token;\n token = lexer.lex() || EOF;\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"flex\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:/* skip whitespace */\nbreak;\ncase 1:/* skip \\space */\nbreak;\ncase 2:/* skip '\\ ' */\nbreak;\ncase 3:return \"INT\"\nbreak;\ncase 4:return \"FLOAT\"\nbreak;\ncase 5:return \"^\"\nbreak;\ncase 6:return \"*\"\nbreak;\ncase 7:return \"*\"\nbreak;\ncase 8:return \"*\"\nbreak;\ncase 9:return \"*\"\nbreak;\ncase 10:return \"/\"\nbreak;\ncase 11:return \"/\"\nbreak;\ncase 12:return \"-\"\nbreak;\ncase 13:return \"-\"\nbreak;\ncase 14:return \"+\"\nbreak;\ncase 15:return \"^\"\nbreak;\ncase 16:return \"(\"\nbreak;\ncase 17:return \")\"\nbreak;\ncase 18:return \"(\"\nbreak;\ncase 19:return \")\"\nbreak;\ncase 20:return \"[\"\nbreak;\ncase 21:return \"]\"\nbreak;\ncase 22:return \"{\"\nbreak;\ncase 23:return \"}\"\nbreak;\ncase 24:return \"{\"\nbreak;\ncase 25:return \"}\"\nbreak;\ncase 26:return \"_\"\nbreak;\ncase 27:return \"|\"\nbreak;\ncase 28:return \"LEFT|\"\nbreak;\ncase 29:return \"RIGHT|\"\nbreak;\ncase 30:return \"!\"\nbreak;\ncase 31:return \"SIGN\"\nbreak;\ncase 32:yy_.yytext = \"<=\"; return \"SIGN\"\nbreak;\ncase 33:yy_.yytext = \">=\"; return \"SIGN\"\nbreak;\ncase 34:yy_.yytext = \"<=\"; return \"SIGN\"\nbreak;\ncase 35:yy_.yytext = \">=\"; return \"SIGN\"\nbreak;\ncase 36:yy_.yytext = \"<>\"; return \"SIGN\"\nbreak;\ncase 37:yy_.yytext = \"<>\"; return \"SIGN\"\nbreak;\ncase 38:yy_.yytext = \"<>\"; return \"SIGN\"\nbreak;\ncase 39:yy_.yytext = \"<>\"; return \"SIGN\"\nbreak;\ncase 40:yy_.yytext = \"<=\"; return \"SIGN\"\nbreak;\ncase 41:yy_.yytext = \">=\"; return \"SIGN\"\nbreak;\ncase 42:return \"FRAC\"\nbreak;\ncase 43:return \"FRAC\"\nbreak;\ncase 44:return \"sqrt\"\nbreak;\ncase 45:return \"abs\"\nbreak;\ncase 46:return \"ln\"\nbreak;\ncase 47:return \"log\"\nbreak;\ncase 48:return \"TRIG\"\nbreak;\ncase 49:return \"TRIG\"\nbreak;\ncase 50:return \"TRIG\"\nbreak;\ncase 51:return \"TRIG\"\nbreak;\ncase 52:yy_.yytext = \"sin\"; return \"TRIG\"\nbreak;\ncase 53:yy_.yytext = \"cos\"; return \"TRIG\"\nbreak;\ncase 54:yy_.yytext = \"tan\"; return \"TRIG\"\nbreak;\ncase 55:yy_.yytext = \"csc\"; return \"TRIG\"\nbreak;\ncase 56:yy_.yytext = \"sec\"; return \"TRIG\"\nbreak;\ncase 57:yy_.yytext = \"cot\"; return \"TRIG\"\nbreak;\ncase 58:yy_.yytext = \"arcsin\"; return \"TRIG\"\nbreak;\ncase 59:yy_.yytext = \"arccos\"; return \"TRIG\"\nbreak;\ncase 60:yy_.yytext = \"arctan\"; return \"TRIG\"\nbreak;\ncase 61:yy_.yytext = \"arccsc\"; return \"TRIG\"\nbreak;\ncase 62:yy_.yytext = \"arcsec\"; return \"TRIG\"\nbreak;\ncase 63:yy_.yytext = \"arccot\"; return \"TRIG\"\nbreak;\ncase 64:return \"TRIGINV\"\nbreak;\ncase 65:return \"TRIGINV\"\nbreak;\ncase 66:yy_.yytext = \"sinh\"; return \"TRIG\"\nbreak;\ncase 67:yy_.yytext = \"cosh\"; return \"TRIG\"\nbreak;\ncase 68:yy_.yytext = \"tanh\"; return \"TRIG\"\nbreak;\ncase 69:yy_.yytext = \"csch\"; return \"TRIG\"\nbreak;\ncase 70:yy_.yytext = \"sech\"; return \"TRIG\"\nbreak;\ncase 71:yy_.yytext = \"tanh\"; return \"TRIG\"\nbreak;\ncase 72:return \"CONST\"\nbreak;\ncase 73:yy_.yytext = \"pi\"; return \"CONST\"\nbreak;\ncase 74:yy_.yytext = \"pi\"; return \"CONST\"\nbreak;\ncase 75:return \"VAR\"\nbreak;\ncase 76:yy_.yytext = \"theta\"; return \"VAR\"\nbreak;\ncase 77:yy_.yytext = \"theta\"; return \"VAR\"\nbreak;\ncase 78:return \"VAR\"\nbreak;\ncase 79:yy_.yytext = \"phi\"; return \"VAR\"\nbreak;\ncase 80:yy_.yytext = \"phi\"; return \"VAR\"\nbreak;\ncase 81:return yy.symbolLexer(yy_.yytext)\nbreak;\ncase 82:return \"EOF\"\nbreak;\ncase 83:return \"INVALID\"\nbreak;\ncase 84:console.log(yy_.yytext);\nbreak;\n}\n},\nrules: [/^(?:\\s+)/,/^(?:\\\\space)/,/^(?:\\\\ )/,/^(?:[0-9]+\\.?)/,/^(?:([0-9]+)?\\.[0-9]+)/,/^(?:\\*\\*)/,/^(?:\\*)/,/^(?:\\\\cdot|·)/,/^(?:\\\\times|×)/,/^(?:\\\\ast)/,/^(?:\\/)/,/^(?:\\\\div|÷)/,/^(?:-)/,/^(?:−)/,/^(?:\\+)/,/^(?:\\^)/,/^(?:\\()/,/^(?:\\))/,/^(?:\\\\left\\()/,/^(?:\\\\right\\))/,/^(?:\\[)/,/^(?:\\])/,/^(?:\\{)/,/^(?:\\})/,/^(?:\\\\left\\{)/,/^(?:\\\\right\\})/,/^(?:_)/,/^(?:\\|)/,/^(?:\\\\left\\|)/,/^(?:\\\\right\\|)/,/^(?:\\!)/,/^(?:<=|>=|<>|<|>|=)/,/^(?:\\\\le)/,/^(?:\\\\ge)/,/^(?:\\\\leq)/,/^(?:\\\\geq)/,/^(?:=\\/=)/,/^(?:\\\\ne)/,/^(?:\\\\neq)/,/^(?:≠)/,/^(?:≤)/,/^(?:≥)/,/^(?:\\\\frac)/,/^(?:\\\\dfrac)/,/^(?:sqrt|\\\\sqrt)/,/^(?:abs|\\\\abs)/,/^(?:ln|\\\\ln)/,/^(?:log|\\\\log)/,/^(?:sin|cos|tan)/,/^(?:csc|sec|cot)/,/^(?:sinh|cosh|tanh)/,/^(?:csch|sech|coth)/,/^(?:\\\\sin)/,/^(?:\\\\cos)/,/^(?:\\\\tan)/,/^(?:\\\\csc)/,/^(?:\\\\sec)/,/^(?:\\\\cot)/,/^(?:\\\\arcsin)/,/^(?:\\\\arccos)/,/^(?:\\\\arctan)/,/^(?:\\\\arccsc)/,/^(?:\\\\arcsec)/,/^(?:\\\\arccot)/,/^(?:arcsin|arccos|arctan)/,/^(?:arccsc|arcsec|arccot)/,/^(?:\\\\sinh)/,/^(?:\\\\cosh)/,/^(?:\\\\tanh)/,/^(?:\\\\csch)/,/^(?:\\\\sech)/,/^(?:\\\\coth)/,/^(?:pi)/,/^(?:π)/,/^(?:\\\\pi)/,/^(?:theta)/,/^(?:θ)/,/^(?:\\\\theta)/,/^(?:phi)/,/^(?:φ)/,/^(?:\\\\phi)/,/^(?:[a-zA-Z])/,/^(?:$)/,/^(?:.)/,/^(?:.)/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\nKAS.parser = parser;\n})(KAS);\n// this is a @generated file\n(function(KAS) {\n\n/* parser generated by jison 0.4.15 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,11],$V1=[1,9],$V2=[8,17],$V3=[6,11],$V4=[6,11,13,17];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"unitvalue\":3,\"magnitude\":4,\"unit\":5,\"EOF\":6,\"float\":7,\"POW\":8,\"int\":9,\"multatoms\":10,\"DIV\":11,\"expatom\":12,\"MUL\":13,\"atom\":14,\"^\":15,\"nat\":16,\"ATOM\":17,\"FLOAT\":18,\"NAT\":19,\"NEG\":20,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",6:\"EOF\",8:\"POW\",11:\"DIV\",13:\"MUL\",15:\"^\",17:\"ATOM\",18:\"FLOAT\",19:\"NAT\",20:\"NEG\"},\nproductions_: [0,[3,3],[3,2],[4,3],[4,1],[5,3],[5,1],[10,3],[10,2],[10,1],[12,3],[12,1],[14,1],[7,1],[7,1],[16,1],[9,2],[9,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n\n return {\n type: \"unitMagnitude\",\n magnitude: $$[$0-2],\n unit: $$[$0-1],\n };\n \nbreak;\ncase 2:\n\n return {\n type: \"unitStandalone\",\n unit: $$[$0-1],\n }\n \nbreak;\ncase 3:\n\n this.$ = $$[$0-2] + \"e\" + $$[$0];\n \nbreak;\ncase 4: case 13: case 14: case 15: case 17:\n this.$ = $$[$0]; \nbreak;\ncase 5:\n\n this.$ = {\n num: $$[$0-2],\n denom: $$[$0],\n };\n \nbreak;\ncase 6:\n\n this.$ = {\n num: $$[$0],\n denom: null,\n };\n \nbreak;\ncase 7:\n this.$ = [$$[$0-2]].concat($$[$0]); \nbreak;\ncase 8:\n this.$ = [$$[$0-1]].concat($$[$0]); \nbreak;\ncase 9:\n this.$ = [$$[$0]]; \nbreak;\ncase 10:\n\n this.$ = {\n name: $$[$0-2],\n pow: $$[$0],\n };\n \nbreak;\ncase 11:\n\n this.$ = {\n name: $$[$0],\n pow: 1,\n };\n \nbreak;\ncase 12:\n this.$ = yytext; \nbreak;\ncase 16:\n this.$ = \"-\" + $$[$0]; \nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,7:4,10:5,12:8,14:10,16:7,17:$V0,18:[1,6],19:$V1},{1:[3]},{5:12,10:5,12:8,14:10,17:$V0},{6:[1,13]},{8:[1,14],17:[2,4]},{6:[2,6],11:[1,15]},o($V2,[2,13]),o($V2,[2,14]),o($V3,[2,9],{12:8,14:10,10:17,13:[1,16],17:$V0}),o([6,8,11,13,17],[2,15]),o($V4,[2,11],{15:[1,18]}),o([6,11,13,15,17],[2,12]),{6:[1,19]},{1:[2,2]},{9:20,19:[1,22],20:[1,21]},{10:23,12:8,14:10,17:$V0},{10:24,12:8,14:10,17:$V0},o($V3,[2,8]),{16:25,19:$V1},{1:[2,1]},{17:[2,3]},{19:[1,26]},{17:[2,17]},{6:[2,5]},o($V3,[2,7]),o($V4,[2,10]),{17:[2,16]}],\ndefaultActions: {13:[2,2],19:[2,1],20:[2,3],22:[2,17],23:[2,5],26:[2,16]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n throw new Error(str);\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n //_token_stack:\n function lex() {\n var token;\n token = lexer.lex() || EOF;\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 11;\nbreak;\ncase 1:return '(';\nbreak;\ncase 2:return ')';\nbreak;\ncase 3:return 8;\nbreak;\ncase 4:return 15;\nbreak;\ncase 5:return 13;\nbreak;\ncase 6:return 18;\nbreak;\ncase 7:return 19;\nbreak;\ncase 8:return 20;\nbreak;\ncase 9:return 17;\nbreak;\ncase 10:return 17;\nbreak;\ncase 11:return 17;\nbreak;\ncase 12:/* skip whitespace */\nbreak;\ncase 13:return 6;\nbreak;\n}\n},\nrules: [/^(?:\\/)/,/^(?:\\()/,/^(?:\\))/,/^(?:(\\*|x|\\u00d7|\\u2219|\\u22c5|\\u00b7)\\s*10\\s*\\^)/,/^(?:\\^)/,/^(?:\\*)/,/^(?:[0-9]+\\.[0-9]+)/,/^(?:[0-9]+)/,/^(?:-)/,/^(?:\\u00b0( ?)[cCfF])/,/^(?:fl\\.? oz\\.?)/,/^(?:[\\u00b5]?([A-Za-z-]+|[\\u2103\\u2109\\u212b]))/,/^(?:\\s+)/,/^(?:$)/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\nKAS.unitParser = parser;\n})(KAS);\n/* TODO(charlie): fix these lint errors (http://eslint.org/docs/rules): */\n/* eslint-disable indent, no-undef, no-var, one-var, no-dupe-keys, no-new-func, no-redeclare, no-unused-vars, comma-dangle, max-len, prefer-spread, space-infix-ops, space-unary-ops */\n\n(function(KAS) {\n\n/* The node hierarcy is as follows:\n\n (Expr)\n (Seq) 2+ children\n Add\n Mul\n Pow 2 children\n Log 2 children\n Eq 2 children\n Trig 1 child\n Abs 1 child\n (Symbol)\n Func 1 child e.g. f(x)\n Var leaf node e.g. x, x_n\n Const leaf node e.g. pi, e, <i>\n Unit leaf node e.g. kg\n (Num) leaf node\n Rational e.g. 2/3\n Int\n Float\n\n (abstract, not meant to be instantiated)\n\n == Key design concepts ==\n Functional: All methods return new nodes - nodes are never mutated.\n Ignore commutativity: Commutative inputs should be parsed equivalently.\n Exploit commutativity: Output should take advantage of ordering.\n*/\n\n/* non user-facing functions */\n\n// assert that all abstract methods have been overridden\nvar abstract = function() {\n // Try to give people a bit of information when this happens\n throw new Error(\"Abstract method - must override for expr: \" +\n this.print());\n};\n\n// throw an error that is meant to be caught by the test suite (not user facing)\nvar error = function(message) { throw new Error(message); };\n\n// reliably detect NaN\nvar isNaN = function(object) { return object !== object; };\n\n// return a random float between min (inclusive) and max (exclusive),\n// not that inclusivity means much, probabilistically, on floats\nvar randomFloat = function(min, max) {\n var extent = max - min;\n return Math.random() * extent + min;\n};\n\n/* constants */\nvar ITERATIONS = 12;\nvar TOLERANCE = 9; // decimal places\n\n\n/* abstract base expression node */\nfunction Expr() {}\n\n_.extend(Expr.prototype, {\n\n // this node's immediate constructor\n func: abstract,\n\n // an array of the arguments to this node's immediate constructor\n args: abstract,\n\n // make a new node with the given arguments\n construct: function(args) {\n var instance = new this.func();\n this.func.apply(instance, args);\n return instance;\n },\n\n // an abstraction for chainable, bottom-up recursion\n recurse: function(method) {\n var passed = Array.prototype.slice.call(arguments, 1);\n var args = _.map(this.args(), function(arg) {\n return _.isString(arg) ? arg : arg[method].apply(arg, passed);\n });\n return this.construct(args);\n },\n\n // evaluate numerically with given variable mapping\n eval: abstract,\n\n codegen: abstract,\n\n compile: function() {\n var code = this.codegen();\n try {\n return new Function(\"vars\", \"return \" + code + \";\");\n } catch (e) {\n throw new Error(\"Function did not compile: \" + code);\n }\n },\n\n // returns a string unambiguously representing the expression\n // should be valid as input\n // e.g. this.equals(parse(this.print())) === true\n print: abstract,\n\n // returns a TeX string representing the expression\n tex: abstract,\n\n // returns a TeX string, modified by the given options\n asTex: function(options) {\n\n options = options || {};\n _.defaults(options, {\n display: true,\n dynamic: true,\n times: false\n });\n\n var tex = this.tex();\n\n if (options.display) {\n tex = \"\\\\displaystyle \" + tex;\n }\n if (options.dynamic) {\n tex = tex.replace(/\\(/g, \"\\\\left(\");\n tex = tex.replace(/\\)/g, \"\\\\right)\");\n }\n if (options.times) {\n tex = tex.replace(/\\\\cdot/g, \"\\\\times\");\n }\n\n return tex;\n },\n\n // returns the name of this expression's constructor as a string\n // only used for testing and debugging (the ugly regex is for IE8)\n name: function() {\n if (this.func.name) {\n return this.func.name;\n } else {\n return this.func.toString().match(/^function\\s*([^\\s(]+)/)[1];\n }\n },\n\n // returns a string representing current node structure\n repr: function() {\n return this.name() + \"(\" + _.map(this.args(), function(arg) {\n return _.isString(arg) ? arg : arg.repr();\n }).join(\",\") + \")\";\n },\n\n // removes all negative signs\n strip: function() { return this.recurse(\"strip\"); },\n\n // canonically reorders all commutative elements\n normalize: function() { return this.recurse(\"normalize\"); },\n\n // expands the expression\n expand: function() { return this.recurse(\"expand\"); },\n\n // naively factors out like terms\n factor: function(options) { return this.recurse(\"factor\", options); },\n\n // collect all like terms\n collect: function(options) { return this.recurse(\"collect\", options); },\n\n // strict syntactic equality check\n equals: function(other) {\n return this.normalize().print() === other.normalize().print();\n },\n\n // expand and collect until the expression no longer changes\n simplify: function(options) {\n options = _.extend({\n once: false\n }, options);\n\n // Attempt to factor and collect\n var step1 = this.factor(options);\n var step2 = step1.collect(options);\n\n // Rollback if collect didn't do anything\n if (step1.equals(step2)) {\n step2 = this.collect(options);\n }\n\n // Attempt to expand and collect\n var step3 = step2.expand(options);\n var step4 = step3.collect(options);\n\n // Rollback if collect didn't do anything\n if (step3.equals(step4)) {\n step4 = step2.collect(options);\n }\n\n // One round of simplification complete\n var simplified = step4;\n\n if (options.once || this.equals(simplified)) {\n return simplified;\n } else {\n return simplified.simplify(options);\n }\n },\n\n // check whether this expression is simplified\n isSimplified: function() {\n return this.equals(this.simplify());\n },\n\n // return the child nodes of this node\n exprArgs: function() {\n return _.filter(this.args(), function(arg) {\n return arg instanceof Expr;\n });\n },\n\n // return the variables (function and non) within the expression\n getVars: function(excludeFunc) {\n return _.uniq(_.flatten(_.invoke(this.exprArgs(), \"getVars\", excludeFunc))).sort();\n },\n\n getConsts: function() {\n return _.uniq(_.flatten(_.invoke(this.exprArgs(), \"getConsts\"))).sort();\n },\n\n getUnits: function() {\n return _.flatten(_.invoke(this.exprArgs(), \"getUnits\"));\n },\n\n // check whether this expression node is of a particular type\n is: function(func) {\n return this instanceof func;\n },\n\n // check whether this expression has a particular node type\n has: function(func) {\n if (this instanceof func) {\n return true;\n }\n return _.any(this.exprArgs(), function(arg) { return arg.has(func); });\n },\n\n // raise this expression to a given exponent\n // most useful for eventually implementing i^3 = -i, etc.\n raiseToThe: function(exp) {\n return new Pow(this, exp);\n },\n\n // does this expression have a specific rendering hint?\n // rendering hints are picked up while parsing, but are lost during transformations\n isSubtract: function() { return false; },\n isDivide: function() { return false; },\n isRoot: function() { return false; },\n\n // whether this node needs an explicit multiplication sign if following a Num\n needsExplicitMul: function() {\n return this.args()[0].needsExplicitMul();\n },\n\n // check that the variables in both expressions are the same\n sameVars: function(other) {\n var vars1 = this.getVars();\n var vars2 = other.getVars();\n\n // the other Expr can have more variables than this one\n // this lets you multiply equations by other variables\n var same = function(array1, array2) {\n return !_.difference(array1, array2).length;\n };\n\n var lower = function(array) {\n return _.uniq(_.invoke(array, \"toLowerCase\")).sort();\n };\n\n var equal = same(vars1, vars2);\n var equalIgnoringCase = same(lower(vars1), lower(vars2));\n\n return {equal: equal, equalIgnoringCase: equalIgnoringCase};\n },\n\n // semantic equality check, call after sameVars() to avoid potential false positives\n // plug in random numbers for the variables in both expressions\n // if they both consistently evaluate the same, then they're the same\n compare: function(other) {\n // equation comparisons are handled by Eq.compare()\n if (other instanceof Eq) {\n return false;\n }\n\n var varList = _.union(\n this.getVars(/* excludeFunc */ true),\n other.getVars(/* excludeFunc */ true));\n\n // If the numbers are large we would like to do a relative comparison\n // rather than an absolute one, but if they're small enough then an\n // absolute comparison makes more sense\n var getDelta = function(num1, num2) {\n if (Math.abs(num1) < 1 || Math.abs(num2) < 1) {\n return Math.abs(num1 - num2);\n } else {\n return Math.abs(1 - num1 / num2);\n }\n };\n\n var equalNumbers = function(num1, num2) {\n var delta = getDelta(num1, num2);\n return ((num1 === num2) || /* needed if either is +/- Infinity */\n (isNaN(num1) && isNaN(num2)) ||\n (delta < Math.pow(10, -TOLERANCE)));\n };\n\n // if no variables, only need to evaluate once\n if (!varList.length && !this.has(Unit) && !other.has(Unit)) {\n return equalNumbers(this.eval(), other.eval());\n }\n\n // collect here to avoid sometimes dividing by zero, and sometimes not\n // it is better to be deterministic, e.g. x/x -> 1\n // TODO(alex): may want to keep track of assumptions as they're made\n var expr1 = this.collect();\n var expr2 = other.collect();\n\n var unitList1 = this.getUnits();\n var unitList2 = other.getUnits();\n if (!_.isEqual(unitList1, unitList2)) {\n return false;\n }\n\n // Compare at a set number (currently 12) of points to determine\n // equality.\n //\n // `range` (and `vars`) is the only variable that varies through the\n // iterations. For each of range = 10, 100, and 1000, each random\n // variable is picked from (-range, range).\n //\n // Note that because there are 12 iterations and three ranges, each\n // range is checked four times.\n for (var i = 0; i < ITERATIONS; i++) {\n\n var vars = {};\n\n // One third total iterations each with range 10, 100, and 1000\n var range = Math.pow(10, 1 + Math.floor(3 * i / ITERATIONS));\n\n // Half of the iterations should only use integer values.\n // This is because expressions like (-2)^x are common but result\n // in NaN when evaluated in JS with non-integer values of x.\n // Without this, (-2)^x and (-2)^(x+1) both end up always being NaN\n // and thus equivalent. With this, the most common failure case is\n // avoided. However, less common cases such as (-2)^(x+0.1) and\n // (-2)^(x+1.1) will still both evaluate to NaN and result in a\n // false positive.\n //\n // Note that the above is only true in vanilla JS Number-land,\n // which has no concept of complex numbers. The solution is simple:\n // Integrate a library for handling complex numbers.\n //\n // TODO(alex): Add support for complex numbers, then remove this.\n var useFloats = i % 2 === 0;\n\n _.each(varList, function(v) {\n vars[v] = useFloats ? randomFloat(-range, range)\n : _.random(-range, range);\n });\n\n var equal;\n if (expr1.has(Func) || expr2.has(Func) ||\n expr1.has(Unit) || expr2.has(Unit)) {\n\n var result1 = expr1.partialEval(vars);\n var result2 = expr2.partialEval(vars);\n\n equal = result1.simplify().equals(result2.simplify());\n } else {\n var result1 = expr1.eval(vars);\n var result2 = expr2.eval(vars);\n\n equal = equalNumbers(result1, result2);\n }\n\n if (!equal) {\n return false;\n }\n }\n\n return true;\n },\n\n // evaluate as much of the expression as possible\n partialEval: function(vars) {\n if (this instanceof Unit) {\n return this;\n } else if (!this.has(Func)) {\n return new Float(this.eval(vars).toFixed(TOLERANCE)).collect();\n } else if (this instanceof Func) {\n return new Func(this.symbol, this.arg.partialEval(vars));\n } else {\n return this.recurse(\"partialEval\", vars);\n }\n },\n\n // check that the structure of both expressions is the same\n // all negative signs are stripped and the expressions are converted to\n // a canonical commutative form\n // should only be done after compare() returns true to avoid false positives\n sameForm: function(other) {\n return this.strip().equals(other.strip());\n },\n\n // returns the GCD of this expression and the given factor\n findGCD: function(factor) {\n return this.equals(factor) ? factor : Num.One;\n },\n\n // return this expression's denominator\n getDenominator: function() {\n return Num.One;\n },\n\n // return this expression as a Mul\n asMul: function() {\n return new Mul(Num.One, this);\n },\n\n // TODO(alex): rename to isDefinitePositive or similar?\n // return whether this expression is 100% positive\n isPositive: abstract,\n\n // TODO(alex): rename to hasNegativeSign or similar?\n // return whether this expression has a negative sign\n isNegative: function() { return false; },\n\n // return a factor of this expression that is 100% positive\n asPositiveFactor: function() {\n return this.isPositive() ? this : Num.One;\n },\n\n // return a copy of the expression with a new hint set (preserves hints)\n addHint: function(hint) {\n if (!hint) {\n return this;\n }\n\n var expr = this.construct(this.args());\n expr.hints = _.clone(this.hints);\n expr.hints[hint] = true;\n return expr;\n },\n\n hints: {\n parens: false\n },\n\n // currently unused!\n asExpr: function() { return this; },\n\n // complete parse by performing a few necessary transformations\n completeParse: function() { return this.recurse(\"completeParse\"); },\n\n abs: abstract,\n\n negate: function() {\n return new Mul(Num.Neg, this);\n }\n});\n\n\n/* abstract sequence node */\nfunction Seq() {}\nSeq.prototype = new Expr();\n\n_.extend(Seq.prototype, {\n args: function() { return this.terms; },\n\n normalize: function() {\n var terms = _.sortBy(_.invoke(this.terms, \"normalize\"), function(term) {\n return term.print();\n });\n\n return new this.func(terms);\n },\n\n expand: function() {\n return this.recurse(\"expand\").flatten();\n },\n\n // partition the sequence into its numeric and non-numeric parts\n // makes no guarantees about the validity of either part!\n partition: function() {\n var terms = _.groupBy(this.terms, function(term) {\n return term instanceof Num;\n });\n\n // XXX using a boolean as a key just converts it to a string. I don't\n // think this code was written with that in mind. Probably doesn't\n // matter except for readability.\n var numbers = terms[true] || [];\n var others = terms[false] || [];\n\n return [new this.func(numbers), new this.func(others)];\n },\n\n // ensure that sequences have 2+ terms and no nested sequences of the same type\n // this is a shallow flattening and will return a non-Seq if terms.length <= 1\n flatten: function() {\n var type = this;\n var terms = _.reject(this.terms, function(term) {\n return term.equals(type.identity);\n });\n\n if (terms.length === 0) {\n return type.identity;\n }\n if (terms.length === 1) {\n return terms[0];\n }\n\n var grouped = _.groupBy(terms, function(term) {\n return term instanceof type.func;\n });\n\n // same contains the children which are Seqs of the same type as this Seq\n var same = grouped[true] || [];\n var others = grouped[false] || [];\n\n var flattened = others.concat(_.flatten(_.pluck(same, \"terms\"), /* shallow: */ true));\n return new type.func(flattened);\n },\n\n // the identity associated with the sequence\n identity: undefined,\n\n // reduce a numeric sequence to a Num\n reduce: abstract,\n\n isPositive: function() {\n var terms = _.invoke(this.terms, \"collect\");\n return _.all(_.invoke(terms, \"isPositive\"));\n },\n\n // return a new Seq with a given term replaced by a different term\n // (or array of terms). given term can be passed directly, or by index\n // if no new term is provided, the old one is simply removed\n replace: function(oldTerm, newTerm) {\n var index;\n\n if (oldTerm instanceof Expr) {\n index = _.indexOf(this.terms, oldTerm);\n } else {\n index = oldTerm;\n }\n\n var newTerms = [];\n if (_.isArray(newTerm)) {\n newTerms = newTerm;\n } else if (newTerm) {\n newTerms = [newTerm];\n }\n\n var terms = this.terms.slice(0, index)\n .concat(newTerms)\n .concat(this.terms.slice(index + 1));\n\n return new this.func(terms);\n },\n\n // syntactic sugar for replace()\n remove: function(term) {\n return this.replace(term);\n },\n\n getDenominator: function() {\n // TODO(alex): find and return LCM\n return new Mul(_.invoke(this.terms, \"getDenominator\")).flatten();\n }\n});\n\n\n/* sequence of additive terms */\nfunction Add() {\n if (arguments.length === 1) {\n this.terms = arguments[0];\n } else {\n this.terms = _.toArray(arguments);\n }\n}\nAdd.prototype = new Seq();\n\n_.extend(Add.prototype, {\n func: Add,\n\n eval: function(vars, options) {\n return _.reduce(this.terms, function(memo, term) { return memo + term.eval(vars, options); }, 0);\n },\n\n codegen: function() {\n return _.map(this.terms, function(term) {\n return \"(\" + term.codegen() + \")\";\n }).join(\" + \") || \"0\";\n },\n\n print: function() {\n return _.invoke(this.terms, \"print\").join(\"+\");\n },\n\n tex: function() {\n var tex = \"\";\n\n _.each(this.terms, function(term) {\n if (!tex || term.isSubtract()) {\n tex += term.tex();\n } else {\n tex += \"+\" + term.tex();\n }\n });\n\n return tex;\n },\n\n collect: function(options) {\n var terms = _.invoke(this.terms, \"collect\", options);\n\n // [Expr expr, Num coefficient]\n var pairs = [];\n\n _.each(terms, function(term) {\n if (term instanceof Mul) {\n var muls = term.partition();\n pairs.push([muls[1].flatten(), muls[0].reduce(options)]);\n } else if (term instanceof Num) {\n pairs.push([Num.One, term]);\n } else {\n pairs.push([term, Num.One]);\n }\n });\n\n // { (Expr expr).print(): [[Expr expr, Num coefficient]] }\n var grouped = _.groupBy(pairs, function(pair) {\n return pair[0].normalize().print();\n });\n\n var collected = _.compact(_.map(grouped, function(pairs) {\n var expr = pairs[0][0];\n var sum = new Add(_.zip.apply(_, pairs)[1]);\n var coefficient = sum.reduce(options);\n return new Mul(coefficient, expr).collect(options);\n }));\n\n // TODO(alex): use the Pythagorean identity here\n // e.g. x*sin^2(y) + x*cos^2(y) -> x\n\n return new Add(collected).flatten();\n },\n\n // naively factor out anything that is common to all terms\n // if options.keepNegative is specified, won't factor out a common -1\n factor: function(options) {\n options = _.extend({\n keepNegative: false\n }, options);\n\n var terms = _.invoke(this.terms, \"collect\");\n var factors;\n\n if (terms[0] instanceof Mul) {\n factors = terms[0].terms;\n } else {\n factors = [terms[0]];\n }\n\n _.each(_.rest(this.terms), function(term) {\n factors = _.map(factors, function(factor) {\n return term.findGCD(factor);\n });\n });\n\n if (!options.keepNegative && this.isNegative()) {\n factors.push(Num.Neg);\n }\n\n factors = new Mul(factors).flatten().collect();\n\n var remainder = _.map(terms, function(term) {\n return Mul.handleDivide(term, factors).simplify();\n });\n remainder = new Add(remainder).flatten();\n\n return Mul.createOrAppend(factors, remainder).flatten();\n },\n\n reduce: function(options) {\n return _.reduce(this.terms, function(memo, term) {\n return memo.add(term, options);\n }, this.identity);\n },\n\n needsExplicitMul: function() { return false; },\n\n isNegative: function() {\n var terms = _.invoke(this.terms, \"collect\");\n return _.all(_.invoke(terms, \"isNegative\"));\n },\n\n negate: function() {\n return new Add(_.invoke(this.terms, \"negate\"));\n }\n});\n\n\n/* sequence of multiplicative terms */\nfunction Mul() {\n if (arguments.length === 1) {\n this.terms = arguments[0];\n } else {\n this.terms = _.toArray(arguments);\n }\n}\nMul.prototype = new Seq();\n\n_.extend(Mul.prototype, {\n func: Mul,\n\n eval: function(vars, options) {\n return _.reduce(this.terms, function(memo, term) { return memo * term.eval(vars, options); }, 1);\n },\n\n codegen: function() {\n return _.map(this.terms, function(term) {\n return \"(\" + term.codegen() + \")\";\n }).join(\" * \") || \"0\";\n },\n\n print: function() {\n return _.map(this.terms, function(term) {\n return (term instanceof Add) ? \"(\" + term.print() + \")\" : term.print();\n }).join(\"*\");\n },\n\n getUnits: function() {\n var tmUnits = _(this.terms)\n .chain()\n .map(function(term) {\n return term.getUnits();\n })\n .flatten()\n .value();\n\n tmUnits.sort(function(a, b) {\n return a.unit < b.unit;\n });\n\n return tmUnits;\n },\n\n // since we don't care about commutativity, we can render a Mul any way we choose\n // so we follow convention: first any negatives, then any numbers, then everything else\n tex: function() {\n var cdot = \" \\\\cdot \";\n\n var terms = _.groupBy(this.terms, function(term) {\n if (term.isDivide()) {\n return \"inverse\";\n } else if (term instanceof Num) {\n return \"number\";\n } else {\n return \"other\";\n }\n });\n\n var inverses = terms.inverse || [];\n var numbers = terms.number || [];\n var others = terms.other || [];\n\n var negatives = \"\";\n var numerator;\n\n // check all the numbers to see if there is a rational we can extract,\n // since we would like 1/2x/y to come out as \\frac{1}{2}\\frac{x}{y},\n // and not \\frac{1x}{2y}.\n for (var i = 0; i < numbers.length; i++) {\n var isRational = numbers[i] instanceof Rational &&\n !(numbers[i] instanceof Int);\n if (isRational && others.length > 0 && inverses.length > 0) {\n var withThisRemoved = numbers.slice();\n withThisRemoved.splice(i, 1);\n var newTerms = withThisRemoved.concat(inverses).concat(others);\n return numbers[i].tex() + new Mul(newTerms).tex();\n }\n }\n\n numbers = _.compact(_.map(numbers, function(term) {\n var hasDenom = (term instanceof Rational) && !(term instanceof Int);\n var shouldPushDown = !term.hints.fraction || inverses.length > 0;\n if (hasDenom && shouldPushDown) {\n // e.g. 3x/4 -> 3/4*x (internally) -> 3x/4 (rendered)\n inverses.push(new Pow(new Int(term.d), Num.Div));\n var number = new Int(term.n);\n number.hints = term.hints;\n return _.any(term.hints) ? number : null;\n } else {\n return term;\n }\n }));\n\n if (numbers.length === 0 && others.length === 1) {\n // e.g. (x+y)/z -> \\frac{x+y}{z}\n numerator = others[0].tex();\n } else {\n var tex = \"\";\n\n _.each(numbers, function(term) {\n if (term.hints.subtract && term.hints.entered) {\n negatives += \"-\";\n tex += (tex ? cdot : \"\") + term.abs().tex();\n } else if ((term instanceof Int) && (term.n === -1) &&\n (term.hints.negate || term.hints.subtract)) {\n // e.g. -1*-1 -> --1\n // e.g. -1*x -> -x\n negatives += \"-\";\n } else {\n // e.g. 2*3 -> 2(dot)3\n tex += (tex ? cdot : \"\") + term.tex();\n }\n });\n\n _.each(others, function(term) {\n if (term.needsExplicitMul()) {\n // e.g. 2*2^3 -> 2(dot)2^3\n tex += (tex ? cdot : \"\") + term.tex();\n } else if (term instanceof Add) {\n // e.g. (a+b)*c -> (a+b)c\n tex += \"(\" + term.tex() + \")\";\n } else {\n // e.g. a*b*c -> abc\n tex += term.tex();\n }\n });\n\n numerator = tex ? tex : \"1\";\n }\n\n if (!inverses.length) {\n return negatives + numerator;\n } else {\n var denominator = new Mul(_.invoke(inverses, \"asDivide\")).flatten().tex();\n return negatives + \"\\\\frac{\" + numerator + \"}{\" + denominator + \"}\";\n }\n },\n\n strip: function() {\n var terms = _.map(this.terms, function(term) {\n return term instanceof Num ? term.abs() : term.strip();\n });\n return new Mul(terms).flatten();\n },\n\n // expand numerator and denominator separately\n expand: function() {\n\n var isAdd = function(term) {\n return term instanceof Add;\n };\n\n var isInverse = function(term) {\n return term instanceof Pow && term.exp.isNegative();\n };\n\n var isInverseAdd = function(term) {\n return isInverse(term) && isAdd(term.base);\n };\n\n var mul = this.recurse(\"expand\").flatten();\n\n var hasAdd = _.any(mul.terms, isAdd);\n var hasInverseAdd = _.any(mul.terms, isInverseAdd);\n\n if (!(hasAdd || hasInverseAdd)) {\n return mul;\n }\n\n var terms = _.groupBy(mul.terms, isInverse);\n var normals = terms[false] || [];\n var inverses = terms[true] || [];\n\n if (hasAdd) {\n var grouped = _.groupBy(normals, isAdd);\n var adds = grouped[true] || [];\n var others = grouped[false] || [];\n\n // loop over each additive sequence\n var expanded = _.reduce(adds, function(expanded, add) {\n // loop over each expanded array of terms\n return _.reduce(expanded, function(temp, array) {\n // loop over each additive sequence's terms\n return temp.concat(_.map(add.terms, function(term) {\n return array.concat(term);\n }));\n }, []);\n }, [[]]);\n\n // join each fully expanded array of factors with remaining multiplicative factors\n var muls = _.map(expanded, function(array) {\n return new Mul(others.concat(array)).flatten();\n });\n\n normals = [new Add(muls)];\n }\n\n if (hasInverseAdd) {\n var denominator = new Mul(_.invoke(inverses, \"getDenominator\")).flatten();\n inverses = [new Pow(denominator.expand(), Num.Div)];\n }\n\n return new Mul(normals.concat(inverses)).flatten();\n },\n\n factor: function(options) {\n var factored = this.recurse(\"factor\", options).flatten();\n if (! (factored instanceof Mul)) {\n return factored;\n }\n\n // Combine any factored out Rationals into one, but don't collect\n var grouped = _.groupBy(factored.terms, function(term) {\n return term instanceof Rational;\n });\n\n // Could also accomplish this by passing a new option\n // e.g. return memo.mul(term, {autocollect: false});\n // TODO(alex): Decide whether this is a good use of options or not\n var rational = _.reduce(grouped[true], function(memo, term) {\n return {n: memo.n * term.n, d: memo.d * term.d};\n }, {n: 1, d: 1});\n\n if (rational.d === 1) {\n rational = new Int(rational.n);\n } else {\n rational = new Rational(rational.n, rational.d);\n }\n\n return new Mul((grouped[false] || []).concat(rational)).flatten();\n },\n\n collect: function(options) {\n var partitioned = this.recurse(\"collect\", options).partition();\n var number = partitioned[0].reduce(options);\n\n // e.g. 0*x -> 0\n if (number.eval() === 0) {\n return Num.Zero;\n }\n\n var others = partitioned[1].flatten();\n\n // e.g. 2*2 -> 4\n // e.g. 2*2*x -> 4*x\n if (!(others instanceof Mul)) {\n return new Mul(number, others).flatten();\n }\n\n others = others.terms;\n\n // [Expr base, Expr exp]\n var pairs = [];\n\n _.each(others, function(term) {\n if (term instanceof Pow) {\n pairs.push([term.base, term.exp]);\n } else {\n pairs.push([term, Num.One]);\n }\n });\n\n // {(Expr base).print(): [[Expr base, Expr exp]]}\n var grouped = _.groupBy(pairs, function(pair) {\n return pair[0].normalize().print();\n });\n\n // [[Expr base, Expr exp]]\n var summed = _.compact(_.map(grouped, function(pairs) {\n var base = pairs[0][0];\n var sum = new Add(_.zip.apply(_, pairs)[1]);\n var exp = sum.collect(options);\n\n if (exp instanceof Num && exp.eval() === 0) {\n return null;\n } else {\n return [base, exp];\n }\n }));\n\n // XXX `pairs` is shadowed four or five times in this function\n var pairs = _.groupBy(summed, function(pair) {\n if (pair[0] instanceof Trig && pair[0].isBasic()) {\n return \"trig\";\n } else if (pair[0] instanceof Log) {\n return \"log\";\n } else {\n return \"expr\";\n }\n });\n var trigs = pairs.trig || [];\n var logs = pairs.log || [];\n var exprs = pairs.expr || [];\n\n if (trigs.length > 1) {\n // combine sines and cosines into other trig functions\n\n // {Trig.arg.print(): [[Trig base, Expr exp]]}\n var byArg = _.groupBy(trigs, function(pair) {\n return pair[0].arg.normalize().print();\n });\n\n trigs = [];\n _.each(byArg, function(pairs) {\n var arg = pairs[0][0].arg;\n\n // {Trig.type: Expr exp}\n var funcs = {sin: Num.Zero, cos: Num.Zero};\n _.each(pairs, function(pair) {\n funcs[pair[0].type] = pair[1];\n });\n\n if (Mul.handleNegative(funcs.sin).collect(options).equals(funcs.cos)) {\n // e.g. sin^x(y)/cos^x(y) -> tan^x(y)\n if (funcs.cos.isNegative()) {\n funcs = {tan: funcs.sin};\n } else {\n funcs = {cot: funcs.cos};\n }\n }\n\n // TODO(alex): combine even if exponents not a perfect match\n // TODO(alex): transform 1/sin and 1/cos into csc and sec\n\n _.each(funcs, function(exp, type) {\n trigs.push([new Trig(type, arg), exp]);\n });\n });\n }\n\n if (logs.length > 1) {\n // combine logs with the same base\n\n // {Log.base.print(): [[Log base, Expr exp]]}\n var byBase = _.groupBy(logs, function(pair) {\n return pair[0].base.normalize().print();\n });\n\n logs = [];\n\n _.each(byBase, function(pairs) {\n // only combine two logs of the same base, otherwise commutative\n // differences result in different equally valid output\n // e.g. ln(x)/ln(z)*ln(y) -> log_z(x)*ln(y)\n // e.g. ln(x)*ln(y)/ln(z) -> ln(x)*log_z(y)\n if (pairs.length === 2 &&\n Mul.handleNegative(pairs[0][1]).collect(options).equals(pairs[1][1])) {\n // e.g. ln(x)^y/ln(b)^y -> log_b(x)^y\n if (pairs[0][1].isNegative()) {\n logs.push([new Log(pairs[0][0].power, pairs[1][0].power), pairs[1][1]]);\n } else {\n logs.push([new Log(pairs[1][0].power, pairs[0][0].power), pairs[0][1]]);\n }\n } else {\n logs = logs.concat(pairs);\n }\n });\n\n // TODO(alex): combine if all inverses are the same e.g. ln(y)*ln(z)/ln(x)/ln(x)\n }\n\n pairs = trigs.concat(logs).concat(exprs);\n\n var collected = _.map(pairs, function(pair) {\n return new Pow(pair[0], pair[1]).collect(options);\n });\n\n return new Mul([number].concat(collected)).flatten();\n },\n\n isSubtract: function() {\n return _.any(this.terms, function(term) {\n return term instanceof Num && term.hints.subtract;\n });\n },\n\n // factor a single -1 in to the Mul\n // combine with a Num if all Nums are positive, else add as a term\n factorIn: function(hint) {\n var partitioned = this.partition();\n var numbers = partitioned[0].terms;\n var fold = numbers.length && _.all(numbers, function(num) {\n return num.n > 0;\n });\n\n if (fold) {\n // e.g. - x*2*3 -> x*-2*3\n var num = numbers[0].negate();\n num.hints = numbers[0].hints;\n return this.replace(numbers[0], num.addHint(hint));\n } else {\n // e.g. - x*y -> -1*x*y\n // e.g. - x*-2 -> -1*x*-2\n return new Mul([Num.negativeOne(hint)].concat(this.terms));\n }\n },\n\n // factor out a single hinted -1 (assume it is the division hint)\n // TODO(alex): make more general or rename to be more specific\n factorOut: function() {\n var factored = false;\n var terms = _.compact(_.map(this.terms, function(term, i, list) {\n if (!factored && term instanceof Num && term.hints.divide) {\n factored = true;\n return term.n !== -1 ? term.negate() : null;\n } else {\n return term;\n }\n }));\n\n if (terms.length === 1) {\n return terms[0];\n } else {\n return new Mul(terms);\n }\n },\n\n reduce: function(options) {\n return _.reduce(this.terms, function(memo, term) {\n return memo.mul(term, options);\n }, this.identity);\n },\n\n findGCD: function(factor) {\n return new Mul(_.invoke(this.terms, \"findGCD\", factor)).flatten();\n },\n\n asMul: function() {\n return this;\n },\n\n asPositiveFactor: function() {\n if (this.isPositive()) {\n return this;\n } else {\n var terms = _.invoke(this.collect().terms, \"asPositiveFactor\");\n return new Mul(terms).flatten();\n }\n },\n\n isNegative: function() {\n return _.any(_.invoke(this.collect().terms, \"isNegative\"));\n },\n\n fold: function() {\n return Mul.fold(this);\n },\n\n negate: function() {\n var isNum = function(expr) { return expr instanceof Num; };\n if (_.any(this.terms, isNum)) {\n var num = _.find(this.terms, isNum);\n return this.replace(num, num.negate());\n } else {\n return new Mul([Num.Neg].concat(this.terms));\n }\n }\n});\n\n// static methods for the sequence types\n_.each([Add, Mul], function(type) {\n _.extend(type, {\n // create a new sequence unless left is already one (returns a copy)\n createOrAppend: function(left, right) {\n if (left instanceof type) {\n return new type(left.terms.concat(right));\n } else {\n return new type(left, right);\n }\n }\n });\n});\n\n_.extend(Mul, {\n // negative signs should be folded into numbers whenever possible\n // never fold into a Num that's already negative or a Mul that has a negative Num\n // an optional hint is kept track of to properly render user input\n // an empty hint means negation\n handleNegative: function(expr, hint) {\n if (expr instanceof Num && expr.n > 0) {\n // e.g. - 2 -> -2\n var negated = expr.negate();\n // TODO(alex): rework hint system so that this isn't necessary\n negated.hints = expr.hints;\n return negated.addHint(hint);\n } else if (expr instanceof Mul) {\n // e.g. - x*2*3 -> x*-2*3\n // e.g. - x*y -> -1*x*y\n // e.g. - x*-2 -> -1*x*-2\n return expr.factorIn(hint);\n } else {\n // e.g. - x -> -1*x\n return new Mul(Num.negativeOne(hint), expr);\n }\n },\n\n // division can create either a Rational or a Mul\n handleDivide: function(left, right) {\n\n // dividing by a Mul is the same as repeated division by its terms\n if (right instanceof Mul) {\n var first = Mul.handleDivide(left, right.terms[0]);\n var rest = new Mul(_.rest(right.terms)).flatten();\n return Mul.handleDivide(first, rest);\n }\n\n var isInt = function(expr) { return expr instanceof Int; };\n var isRational = function(expr) { return expr instanceof Rational; };\n\n // for simplification purposes, fold Ints into Rationals if possible\n // e.g. 3x / 4 -> 3/4 * x (will still render as 3x/4)\n if (isInt(right) && left instanceof Mul && _.any(left.terms, isInt)) {\n\n // search from the right\n var reversed = left.terms.slice().reverse();\n var num = _.find(reversed, isRational);\n\n if (!isInt(num)) {\n return new Mul(left.terms.concat([new Rational(1, right.n).addHint(\"fraction\")]));\n }\n\n var rational = new Rational(num.n, right.n);\n rational.hints = num.hints;\n\n // in the case of something like 1/3 * 6/8, we want the\n // 6/8 to be considered a fraction, not just a division\n if (num === reversed[0]) {\n rational = rational.addHint(\"fraction\");\n }\n\n var result;\n if (num.n < 0 && right.n < 0) {\n rational.d = -rational.d;\n return left.replace(num, [Num.Neg, rational]);\n } else {\n return left.replace(num, rational);\n }\n }\n\n var divide = function(a, b) {\n if (b instanceof Int) {\n if (a instanceof Int) {\n if (a.n < 0 && b.n < 0) {\n // e.g. -2 / -3 -> -1*-2/3\n return [Num.Neg, new Rational(a.n, -b.n).addHint(\"fraction\")];\n } else {\n // e.g. 2 / 3 -> 2/3\n // e.g. -2 / 3 -> -2/3\n // e.g. 2 / -3 -> -2/3\n return [new Rational(a.n, b.n).addHint(\"fraction\")];\n }\n } else {\n // e.g. x / 3 -> x*1/3\n // e.g. x / -3 -> x*-1/3\n var inverse = new Rational(1, b.eval());\n if (b.eval() < 0) {\n return [a, inverse.addHint(\"negate\")];\n } else {\n return [a, inverse];\n }\n }\n } else {\n var pow;\n\n if (b instanceof Trig && b.exp) {\n // e.g. sin^2(x) -> sin(x)^2\n var exp = b.exp;\n b.exp = undefined;\n b = new Pow(b, exp);\n }\n\n if (b instanceof Pow) {\n // e.g. (x^2) ^ -1 -> x^-2\n // e.g. (x^y) ^ -1 -> x^(-1*y)\n // e.g. (x^(yz)) ^ -1 -> x^(-1*y*z)\n pow = new Pow(b.base, Mul.handleNegative(b.exp, \"divide\"));\n } else {\n // e.g. x ^ -1 -> x^-1\n pow = new Pow(b, Num.Div);\n }\n\n if (a instanceof Int && a.n === 1) {\n // e.g. 1 / x -> x^-1\n return [pow];\n } else {\n // e.g. 2 / x -> 2*x^-1\n return [a, pow];\n }\n }\n };\n\n if (left instanceof Mul) {\n var divided = divide(_.last(left.terms), right);\n return new Mul(_.initial(left.terms).concat(divided));\n } else {\n var divided = divide(left, right);\n return new Mul(divided).flatten();\n }\n },\n\n // fold negative signs into numbers if possible\n // negative signs are not the same as multiplying by negative one!\n // e.g. -x -> -1*x simplified\n // e.g. -2*x -> -2*x simplified\n // e.g. -x*2 -> -1*x*2 not simplified -> x*-2 simplified\n // e.g. -1*x*2 -> -1*x*2 not simplified\n\n // also fold multiplicative terms into open Trig and Log nodes\n // e.g. (sin x)*x -> sin(x)*x\n // e.g. sin(x)*x -> sin(x)*x\n // e.g. sin(x)*(x) -> sin(x)*x\n // e.g. sin(x)*sin(y) -> sin(x)*sin(y)\n fold: function(expr) {\n if (expr instanceof Mul) {\n // assuming that this will be second to last\n var trigLog = _.find(_.initial(expr.terms), function(term) {\n return (term instanceof Trig || term instanceof Log) && term.hints.open;\n });\n var index = _.indexOf(expr.terms, trigLog);\n\n if (trigLog) {\n var last = _.last(expr.terms);\n if (trigLog.hints.parens || last.hints.parens ||\n last.has(Trig) || last.has(Log)) {\n trigLog.hints.open = false;\n } else {\n var newTrigLog;\n if (trigLog instanceof Trig) {\n newTrigLog = Trig.create([trigLog.type, trigLog.exp], Mul.createOrAppend(trigLog.arg, last).fold());\n } else {\n newTrigLog = Log.create(trigLog.base, Mul.createOrAppend(trigLog.power, last).fold());\n }\n\n if (index === 0) {\n return newTrigLog;\n } else {\n return new Mul(expr.terms.slice(0, index).concat(newTrigLog)).fold();\n }\n }\n }\n\n var partitioned = expr.partition();\n var numbers = partitioned[0].terms;\n\n var pos = function(num) { return num.n > 0; };\n var neg = function(num) { return num.n === -1 && num.hints.negate; };\n var posOrNeg = function(num) { return pos(num) || neg(num); };\n\n if (numbers.length > 1 &&\n _.some(numbers, neg) &&\n _.some(numbers, pos) &&\n _.every(numbers, posOrNeg)) {\n\n var firstNeg = _.indexOf(expr.terms, _.find(expr.terms, neg));\n var firstNum = _.indexOf(expr.terms, _.find(expr.terms, pos));\n\n // e.g. -x*2 -> x*-2\n if (firstNeg < firstNum) {\n return expr.replace(firstNum,\n expr.terms[firstNum].negate())\n .remove(firstNeg);\n }\n }\n }\n\n // in all other cases, make no change\n return expr;\n }\n});\n\n\n/* exponentiation */\nfunction Pow(base, exp) { this.base = base; this.exp = exp; }\nPow.prototype = new Expr();\n\n_.extend(Pow.prototype, {\n func: Pow,\n args: function() { return [this.base, this.exp]; },\n\n eval: function(vars, options) {\n var evaledBase = this.base.eval(vars, options);\n var evaledExp = this.exp.eval(vars, options);\n\n // Math.pow unequivocally returns NaN when provided with both a\n // negative base and a fractional exponent. However, in some cases, we\n // know that our exponent is actually valid for use with negative\n // bases (e.g., (-5)^(1/3)).\n //\n // Here, we explicitly check for such cases. We really only handle a\n // limited subset (by requiring that the exponent is rational with an\n // odd denominator), but it's still useful.\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow\n if (evaledBase < 0) {\n var simplifiedExp = this.exp.simplify();\n\n // If Float, convert to a Rational to enable the logic below\n if (simplifiedExp instanceof Float) {\n var num = simplifiedExp.n;\n var decimals = (num - num.toFixed()).toString().length - 2;\n var denominator = Math.pow(10, decimals);\n var rationalExp = new Rational(num * denominator, denominator);\n simplifiedExp = rationalExp.simplify();\n }\n if (simplifiedExp instanceof Rational) {\n var oddDenominator = Math.abs(simplifiedExp.d) % 2 === 1;\n if (oddDenominator) {\n var oddNumerator = Math.abs(simplifiedExp.n) % 2 === 1;\n var sign = (oddNumerator) ? -1 : 1;\n return sign * Math.pow(-1 * evaledBase, evaledExp);\n }\n }\n }\n return Math.pow(evaledBase, evaledExp);\n },\n\n getUnits: function() {\n return this.base.getUnits().map(function(unit) {\n return {\n unit: unit.unit,\n pow: unit.pow * this.exp.n\n };\n }.bind(this));\n },\n\n codegen: function() {\n return \"Math.pow(\" + this.base.codegen() +\n \", \" + this.exp.codegen() + \")\";\n },\n\n print: function() {\n var base = this.base.print();\n if (this.base instanceof Seq || this.base instanceof Pow) {\n base = \"(\" + base + \")\";\n }\n return base + \"^(\" + this.exp.print() + \")\";\n },\n\n tex: function() {\n if (this.isDivide()) {\n\n // e.g. x ^ -1 w/hint -> 1/x\n return \"\\\\frac{1}{\" + this.asDivide().tex() + \"}\";\n\n } else if (this.isRoot()) {\n\n if (this.exp.n !== 1) {\n error(\"Node marked with hint 'root' does not have exponent \" +\n \"of form 1/x.\");\n }\n\n if (this.exp.d === 2) {\n // e.g. x ^ 1/2 w/hint -> sqrt{x}\n return \"\\\\sqrt{\" + this.base.tex() + \"}\";\n } else {\n // e.g. x ^ 1/y w/hint -> sqrt[y]{x}\n return \"\\\\sqrt[\" + this.exp.d + \"]{\" + this.base.tex() + \"}\";\n }\n\n } else if (this.base instanceof Trig && !this.base.isInverse() &&\n this.exp instanceof Num && this.exp.isSimple() &&\n this.exp.eval() >= 0) {\n\n // e.g sin(x) ^ 2 -> sin^2(x)\n var split = this.base.tex({split: true});\n return split[0] + \"^{\" + this.exp.tex() + \"}\" + split[1];\n\n } else {\n\n // e.g. x ^ y -> x^y\n var base = this.base.tex();\n if (this.base instanceof Seq || this.base instanceof Pow ||\n (this.base instanceof Num && !this.base.isSimple())) {\n // e.g. a+b ^ c -> (a+b)^c\n base = \"(\" + base + \")\";\n } else if (this.base instanceof Trig || this.base instanceof Log) {\n // e.g. ln(x) ^ 2 -> [ln(x)]^2\n base = \"[\" + base + \"]\";\n }\n return base + \"^{\" + this.exp.tex() + \"}\";\n }\n },\n\n needsExplicitMul: function() {\n return this.isRoot() ? false : this.base.needsExplicitMul();\n },\n\n expand: function() {\n var pow = this.recurse(\"expand\");\n\n if (pow.base instanceof Mul) {\n // e.g. (ab)^c -> a^c*b^c\n\n var terms = _.map(pow.base.terms, function(term) {\n return new Pow(term, pow.exp);\n });\n\n return new Mul(terms).expand();\n\n } else if (pow.base instanceof Add && pow.exp instanceof Int && pow.exp.abs().eval() > 1) {\n // e.g. (a+b)^2 -> a*a+a*b+a*b+b*b\n // e.g. (a+b)^-2 -> (a*a+a*b+a*b+b*b)^-1\n\n var positive = pow.exp.eval() > 0;\n var n = pow.exp.abs().eval();\n\n var signed = function(mul) {\n return positive ? mul : new Pow(mul, Num.Div);\n };\n\n // compute and cache powers of 2 up to n\n var cache = { 1: pow.base };\n for (var i = 2; i <= n; i *= 2) {\n var mul = new Mul(cache[i / 2], cache[i / 2]);\n cache[i] = mul.expand().collect();\n }\n\n // if n is a power of 2, you're done!\n if (_.has(cache, n)) {\n return signed(cache[n]);\n }\n\n // otherwise decompose n into powers of 2 ...\n var indices = _.map(n.toString(2).split(\"\"), function(str, i, list) {\n return Number(str) * Math.pow(2, list.length - i - 1);\n });\n indices = _.without(indices, 0);\n\n // ... then combine\n var mul = new Mul(_.pick(cache, indices)).expand().collect();\n return signed(mul);\n\n } else if (pow.exp instanceof Add) { // DEFINITELY want behind super-simplify() flag\n // e.g. x^(a+b) -> x^a*x^b\n\n var terms = _.map(pow.exp.terms, function(term) {\n return new Pow(pow.base, term).expand();\n });\n\n return new Mul(terms).expand();\n } else {\n return pow;\n }\n },\n\n factor: function() {\n var pow = this.recurse(\"factor\");\n if (pow.base instanceof Mul) {\n var terms = _.map(pow.base.terms, function(term) {\n if (term instanceof Int && pow.exp.equals(Num.Div)) {\n // Anything that can be a Rational should be a Rational\n // e.g. 2^(-1) -> 1/2\n return new Rational(1, term.n);\n } else {\n return new Pow(term, pow.exp);\n }\n });\n return new Mul(terms);\n } else {\n return pow;\n }\n },\n\n collect: function(options) {\n\n if (this.base instanceof Pow) {\n // collect this first to avoid having to deal with float precision\n // e.g. sqrt(2)^2 -> 2, not 2.0000000000000004\n // e.g. (x^y)^z -> x^(yz)\n var base = this.base.base;\n var exp = Mul.createOrAppend(this.base.exp, this.exp);\n return new Pow(base, exp).collect(options);\n }\n\n var pow = this.recurse(\"collect\", options);\n\n var isSimilarLog = function(term) {\n return term instanceof Log && term.base.equals(pow.base);\n };\n\n if (pow.exp instanceof Num &&\n pow.exp.eval() === 0) {\n\n // e.g. x^0 -> 1\n return Num.One;\n\n } else if (pow.exp instanceof Num &&\n pow.exp.eval() === 1) {\n\n // e.g. x^1 -> x\n return pow.base;\n\n } else if (isSimilarLog(pow.exp)) {\n\n // e.g. b^(log_b(x)) -> x\n return pow.exp.power;\n\n } else if (pow.exp instanceof Mul &&\n _.any(pow.exp.terms, isSimilarLog)) {\n\n // e.g. b^(2*y*log_b(x)) -> x^(2*y)\n var log = _.find(pow.exp.terms, isSimilarLog);\n var base = log.power;\n var exp = pow.exp.remove(log).flatten();\n return new Pow(base, exp).collect(options);\n\n } else if (pow.base instanceof Num &&\n pow.exp instanceof Num) {\n\n // TODO(alex): Consider encapsualting this logic (and similar logic\n // elsewhere) into a separate Decimal class for user-entered floats\n if (options && options.preciseFloats) {\n // Avoid creating an imprecise float\n // e.g. 23^1.5 -> 12167^0.5, not ~110.304\n\n // If you take the root as specified by the denominator and\n // end up with more digits after the decimal point,\n // the result is imprecise. This works for rationals as well\n // as floats, but ideally rationals should be pre-processed\n // e.g. (1/27)^(1/3) -> 1/3 to avoid most cases.\n // TODO(alex): Catch such cases and avoid converting to floats.\n var exp = pow.exp.asRational();\n var decimalsInBase = pow.base.getDecimalPlaces();\n var root = new Pow(pow.base, new Rational(1, exp.d));\n var decimalsInRoot = root.collect().getDecimalPlaces();\n\n if (decimalsInRoot > decimalsInBase) {\n // Collecting over this denominator would result in an\n // imprecise float, so avoid doing so.\n var newBase = new Pow(pow.base, new Int(exp.n)).collect();\n return new Pow(newBase, new Rational(1, exp.d));\n }\n }\n\n // e.g. 4^1.5 -> 8\n return pow.base.raiseToThe(pow.exp, options);\n } else {\n return pow;\n }\n },\n\n // checks whether this Pow represents user-entered division\n isDivide: function() {\n var isDiv = function(arg) { return arg instanceof Num && arg.hints.divide; };\n return isDiv(this.exp) || (this.exp instanceof Mul && _.any(this.exp.terms, isDiv));\n },\n\n // assuming this Pow represents user-entered division, returns the denominator\n asDivide: function() {\n if (this.exp instanceof Num) {\n if (this.exp.eval() === -1) {\n return this.base;\n } else {\n var negated = this.exp.negate();\n negated.hints = _.clone(this.exp.hints);\n negated.hints.divide = false;\n return new Pow(this.base, negated);\n }\n } else if (this.exp instanceof Mul) {\n return new Pow(this.base, this.exp.factorOut());\n } else {\n error(\"called asDivide() on an Expr that wasn't a Num or Mul\");\n }\n },\n\n isRoot: function() {\n return this.exp instanceof Rational && this.exp.hints.root;\n },\n\n isSquaredTrig: function() {\n return this.base instanceof Trig && !this.base.isInverse() &&\n this.exp instanceof Num && this.exp.eval() === 2;\n },\n\n // extract whatever denominator makes sense, ignoring hints\n // if negative exponent, will recursively include the base's denominator as well\n getDenominator: function() {\n if (this.exp instanceof Num && this.exp.eval() === -1) {\n return Mul.createOrAppend(this.base, this.base.getDenominator()).flatten();\n } else if (this.exp.isNegative()) {\n var pow = new Pow(this.base, Mul.handleNegative(this.exp).collect());\n return Mul.createOrAppend(pow, pow.collect().getDenominator()).flatten();\n } else if (this.base instanceof Num) {\n return new Pow(this.base.getDenominator(), this.exp).collect();\n } else {\n return Num.One;\n }\n },\n\n findGCD: function(factor) {\n var base, exp;\n if (factor instanceof Pow) {\n base = factor.base;\n exp = factor.exp;\n } else {\n base = factor;\n exp = Num.One;\n }\n\n // GCD is only relevant if same base\n if (this.base.equals(base)) {\n if (this.exp.equals(exp)) {\n // exact match\n // e.g. GCD(x^y^z, x^y^z) -> x^y^z\n return this;\n } else if (this.exp instanceof Num && exp instanceof Num) {\n // two numerical exponents\n // e.g. GCD(x^3, x^2) -> x^2\n return new Pow(this.base, Num.min(this.exp, exp)).collect();\n } else if (this.exp instanceof Num || exp instanceof Num) {\n // one numerical exponent\n // e.g. GCD(x^2, x^y) -> 1\n return Num.One;\n }\n\n var expA = this.exp.asMul().partition();\n var expB = exp.asMul().partition();\n\n if (expA[1].equals(expB[1])) {\n // exponents match except for coefficient\n // e.g. GCD(x^3y, x^y) -> x^y\n var coefficient = Num.min(expA[0].reduce(), expB[0].reduce());\n var mul = new Mul(coefficient, expA[1].flatten()).flatten();\n return new Pow(base, mul).collect();\n }\n }\n\n return Num.One;\n },\n\n isPositive: function() {\n if (this.base.isPositive()) {\n return true;\n }\n\n var exp = this.exp.simplify();\n return exp instanceof Int && exp.eval() % 2 === 0;\n },\n\n asPositiveFactor: function() {\n if (this.isPositive()) {\n return this;\n } else {\n var exp = this.exp.simplify();\n if (exp instanceof Int) {\n var n = exp.eval();\n if (n > 2) {\n // e.g. x^3 -> x^2\n return new Pow(this.base, new Int(n-1));\n } else if (n < -2) {\n // e.g. x^-3 -> x^-2\n return new Pow(this.base, new Int(n+1));\n }\n }\n return Num.One;\n }\n }\n});\n\n_.extend(Pow, {\n sqrt: function(arg) {\n return new Pow(arg, Num.Sqrt);\n },\n\n nthroot: function(radicand, degree) {\n var exp = Mul.fold(Mul.handleDivide(new Int(1), degree));\n\n // FIXME(johnsullivan): If oneOverDegree ends up being a pow object,\n // this \"root\" hint is lost between here and when tex() is called.\n return new Pow(radicand, exp.addHint(\"root\"));\n },\n});\n\n\n/* logarithm */\nfunction Log(base, power) { this.base = base; this.power = power; }\nLog.prototype = new Expr();\n\n_.extend(Log.prototype, {\n func: Log,\n args: function() { return [this.base, this.power]; },\n\n eval: function(vars, options) {\n return Math.log(this.power.eval(vars, options)) / Math.log(this.base.eval(vars, options));\n },\n\n codegen: function() {\n return \"(Math.log(\" + this.power.codegen() +\n \") / Math.log(\" + this.base.codegen() + \"))\";\n },\n\n print: function() {\n var power = \"(\" + this.power.print() + \")\";\n if (this.isNatural()) {\n return \"ln\" + power;\n } else {\n return \"log_(\" + this.base.print() + \") \" + power;\n }\n },\n\n tex: function() {\n var power = \"(\" + this.power.tex() + \")\";\n if (this.isNatural()) {\n return \"\\\\ln\" + power;\n } else {\n return \"\\\\log_{\" + this.base.tex() + \"}\" + power;\n }\n },\n\n collect: function(options) {\n var log = this.recurse(\"collect\", options);\n\n if (log.power instanceof Num && log.power.eval() === 1) {\n\n // e.g. ln(1) -> 0\n return Num.Zero;\n\n } else if (log.base.equals(log.power)) {\n\n // e.g. log_b(b) -> 1\n return Num.One;\n\n } else if (log.power instanceof Pow &&\n log.power.base.equals(log.base)) {\n\n // e.g. log_b(b^x) -> x\n return log.power.exp;\n } else {\n return log;\n }\n },\n\n expand: function() {\n var log = this.recurse(\"expand\");\n\n if (log.power instanceof Mul) { // might want behind super-simplify() flag\n // e.g. ln(xy) -> ln(x) + ln(y)\n\n var terms = _.map(log.power.terms, function(term) {\n // need to expand again in case new log powers are Pows\n return new Log(log.base, term).expand();\n });\n\n return new Add(terms);\n\n } else if (log.power instanceof Pow) {\n // e.g. ln(x^y) -> y*ln(x)\n\n return new Mul(log.power.exp, new Log(log.base, log.power.base).expand()).flatten();\n } else if (!log.isNatural()) {\n // e.g. log_b(x) -> ln(x)/ln(b)\n\n return Mul.handleDivide(new Log(Const.e, log.power), new Log(Const.e, log.base));\n } else {\n return log;\n }\n },\n\n hints: _.extend(Log.prototype.hints, {\n open: false\n }),\n\n isPositive: function() {\n var log = this.collect();\n\n if (log.base instanceof Num &&\n log.power instanceof Num) {\n return this.eval() > 0;\n } else {\n return false;\n }\n },\n\n needsExplicitMul: function() { return false; },\n\n isNatural: function() { return this.base.equals(Const.e); }\n});\n\n_.extend(Log, {\n natural: function() { return Const.e; },\n common: function() { return Num.Ten; },\n\n create: function(base, power) {\n var log = new Log(base, power);\n if (!power.hints.parens) {\n log = log.addHint(\"open\");\n }\n return log;\n }\n});\n\n\n/* trigonometric functions */\nfunction Trig(type, arg) { this.type = type; this.arg = arg; }\nTrig.prototype = new Expr();\n\n_.extend(Trig.prototype, {\n func: Trig,\n args: function() { return [this.type, this.arg]; },\n\n functions: {\n sin: {\n eval: Math.sin,\n codegen: \"Math.sin((\",\n tex: \"\\\\sin\",\n expand: function() { return this; }\n },\n cos: {\n eval: Math.cos,\n codegen: \"Math.cos((\",\n tex: \"\\\\cos\",\n expand: function() { return this; }\n },\n tan: {\n eval: Math.tan,\n codegen: \"Math.tan((\",\n tex: \"\\\\tan\",\n expand: function() {\n return Mul.handleDivide(Trig.sin(this.arg), Trig.cos(this.arg));\n }\n },\n csc: {\n eval: function(arg) { return 1 / Math.sin(arg); },\n codegen: \"(1/Math.sin(\",\n tex: \"\\\\csc\",\n expand: function() {\n return Mul.handleDivide(Num.One, Trig.sin(this.arg));\n }\n },\n sec: {\n eval: function(arg) { return 1 / Math.cos(arg); },\n codegen: \"(1/Math.cos(\",\n tex: \"\\\\sec\",\n expand: function() {\n return Mul.handleDivide(Num.One, Trig.cos(this.arg));\n }\n },\n cot: {\n eval: function(arg) { return 1 / Math.tan(arg); },\n codegen: \"(1/Math.tan(\",\n tex: \"\\\\cot\",\n expand: function() {\n return Mul.handleDivide(Trig.cos(this.arg), Trig.sin(this.arg));\n }\n },\n arcsin: {\n eval: Math.asin,\n codegen: \"Math.asin((\",\n tex: \"\\\\arcsin\"\n },\n arccos: {\n eval: Math.acos,\n codegen: \"Math.acos((\",\n tex: \"\\\\arccos\"\n },\n arctan: {\n eval: Math.atan,\n codegen: \"Math.atan((\",\n tex: \"\\\\arctan\"\n },\n arccsc: {\n eval: function(arg) { return Math.asin(1 / arg); },\n codegen: \"Math.asin(1/(\",\n tex: \"\\\\operatorname{arccsc}\"\n },\n arcsec: {\n eval: function(arg) { return Math.acos(1 / arg); },\n codegen: \"Math.acos(1/(\",\n tex: \"\\\\operatorname{arcsec}\"\n },\n arccot: {\n eval: function(arg) { return Math.atan(1 / arg); },\n codegen: \"Math.atan(1/(\",\n tex: \"\\\\operatorname{arccot}\"\n },\n sinh: {\n eval: function(arg) {\n return (Math.exp(arg) - Math.exp(-arg)) / 2;\n },\n codegen: function(argStr) {\n return \"((Math.exp(\" + argStr + \") - Math.exp(-(\" + argStr + \"))) / 2)\";\n },\n tex: \"\\\\sinh\",\n expand: function() { return this; }\n },\n cosh: {\n eval: function(arg) {\n return (Math.exp(arg) + Math.exp(-arg)) / 2;\n },\n codegen: function(argStr) {\n return \"((Math.exp(\" + argStr + \") + Math.exp(-(\" + argStr + \"))) / 2)\";\n },\n tex: \"\\\\cosh\",\n expand: function() { return this; }\n },\n tanh: {\n eval: function(arg) {\n return (Math.exp(arg) - Math.exp(-arg)) / (Math.exp(arg) + Math.exp(-arg));\n },\n codegen: function(argStr) {\n return \"(\" +\n \"(Math.exp(\" + argStr + \") - Math.exp(-(\" + argStr + \")))\" +\n \" / \" +\n \"(Math.exp(\" + argStr + \") + Math.exp(-(\" + argStr + \")))\" +\n \")\";\n },\n tex: \"\\\\tanh\",\n expand: function() {\n return Mul.handleDivide(Trig.sinh(this.arg), Trig.cosh(this.arg));\n }\n },\n csch: {\n eval: function(arg) { return 2 / (Math.exp(arg) - Math.exp(-arg)); },\n codegen: function(argStr) {\n return \"(2 / (Math.exp(\" + argStr + \") - Math.exp(-(\" + argStr + \"))))\";\n },\n tex: \"\\\\csch\",\n expand: function() {\n return Mul.handleDivide(Num.One, Trig.sinh(this.arg));\n }\n },\n sech: {\n eval: function(arg) { return 2 / (Math.exp(arg) + Math.exp(-arg)); },\n codegen: function(argStr) {\n return \"(2 / (Math.exp(\" + argStr + \") + Math.exp(-(\" + argStr + \"))))\";\n },\n tex: \"\\\\sech\",\n expand: function() {\n return Mul.handleDivide(Num.One, Trig.cosh(this.arg));\n }\n },\n coth: {\n eval: function(arg) {\n return (Math.exp(arg) + Math.exp(-arg)) / (Math.exp(arg) - Math.exp(-arg));\n },\n codegen: function(argStr) {\n return \"(\" +\n \"(Math.exp(\" + argStr + \") + Math.exp(-(\" + argStr + \")))\" +\n \" / \" +\n \"(Math.exp(\" + argStr + \") - Math.exp(-(\" + argStr + \")))\" +\n \")\";\n },\n tex: \"\\\\coth\",\n expand: function() {\n return Mul.handleDivide(Trig.cosh(this.arg), Trig.sinh(this.arg));\n }\n },\n },\n\n isEven: function() {\n return _.contains([\"cos\", \"sec\"], this.type);\n },\n\n isInverse: function() {\n return this.type.indexOf(\"arc\") === 0;\n },\n\n isBasic: function() {\n return _.contains([\"sin\", \"cos\"], this.type);\n },\n\n eval: function(vars, options) {\n var func = this.functions[this.type].eval;\n var arg = this.arg.eval(vars, options);\n return func(arg);\n },\n\n codegen: function() {\n var func = this.functions[this.type].codegen;\n if (typeof func === \"function\") {\n return func(this.arg.codegen());\n } else if (typeof func === \"string\") {\n return func + this.arg.codegen() + \"))\";\n } else {\n throw new Error(\"codegen not implemented for \" + this.type);\n }\n },\n\n print: function() {\n return this.type + \"(\" + this.arg.print() + \")\";\n },\n\n tex: function(options) {\n var func = this.functions[this.type].tex;\n var arg = \"(\" + this.arg.tex() + \")\";\n return (options && options.split) ? [func, arg] : func + arg;\n },\n\n hints: _.extend(Trig.prototype.hints, {\n open: false\n }),\n\n isPositive: function() {\n var trig = this.collect();\n\n if (trig.arg instanceof Num) {\n return this.eval() > 0;\n } else {\n return false;\n }\n },\n\n completeParse: function() {\n if (this.exp) {\n var pow = new Pow(this, this.exp);\n this.exp = undefined;\n return pow;\n } else {\n return this;\n }\n },\n\n // TODO(alex): does every new node type need to redefine these?\n needsExplicitMul: function() { return false; },\n\n expand: function() {\n var trig = this.recurse(\"expand\");\n if (!trig.isInverse()) {\n // e.g. tan(x) -> sin(x)/cos(x)\n var expand = trig.functions[trig.type].expand;\n return _.bind(expand, trig)();\n } else {\n return trig;\n }\n },\n\n collect: function(options) {\n var trig = this.recurse(\"collect\", options);\n if (!trig.isInverse() && trig.arg.isNegative()) {\n var arg;\n if (trig.arg instanceof Num) {\n arg = trig.arg.abs();\n } else {\n arg = Mul.handleDivide(trig.arg, Num.Neg).collect(options);\n }\n\n if (trig.isEven()) {\n // e.g. cos(-x) -> cos(x)\n return new Trig(trig.type, arg);\n\n } else {\n // e.g. sin(-x) -> -sin(x)\n return new Mul(Num.Neg, new Trig(trig.type, arg));\n }\n } else {\n return trig;\n }\n }\n});\n\n_.extend(Trig, {\n create: function(pair, arg) {\n var type = pair[0];\n var exp = pair[1];\n\n if (exp && exp.equals(Num.Neg)) {\n // e.g. sin^-1(x) -> arcsin(x)\n type = \"arc\" + type;\n exp = undefined;\n }\n\n var trig = new Trig(type, arg);\n if (!arg.hints.parens) {\n trig = trig.addHint(\"open\");\n }\n\n if (exp) {\n trig.exp = exp;\n }\n\n return trig;\n },\n\n sin: function(arg) {\n return new Trig(\"sin\", arg);\n },\n\n cos: function(arg) {\n return new Trig(\"cos\", arg);\n },\n\n sinh: function(arg) {\n return new Trig(\"sinh\", arg);\n },\n\n cosh: function(arg) {\n return new Trig(\"cosh\", arg);\n }\n});\n\n\nfunction Abs(arg) { this.arg = arg; }\nAbs.prototype = new Expr();\n\n_.extend(Abs.prototype, {\n func: Abs,\n args: function() { return [this.arg]; },\n eval: function(vars, options) { return Math.abs(this.arg.eval(vars, options)); },\n codegen: function() { return \"Math.abs(\" + this.arg.codegen() + \")\"; },\n print: function() { return \"abs(\" + this.arg.print() + \")\"; },\n\n tex: function() {\n return \"\\\\left|\" + this.arg.tex() + \"\\\\right|\";\n },\n\n collect: function(options) {\n var abs = this.recurse(\"collect\", options);\n\n if (abs.arg.isPositive()) {\n // e.g. |2^x| -> 2^x\n return abs.arg;\n } else if (abs.arg instanceof Num) {\n // e.g. |-2| -> 2\n return abs.arg.abs();\n } else if (abs.arg instanceof Mul) {\n // e.g. |-2*pi*x| -> 2*pi*|x|\n var terms = _.groupBy(abs.arg.terms, function(term) {\n if (term.isPositive()) {\n return \"positive\";\n } else if (term instanceof Num) {\n return \"number\";\n } else {\n return \"other\";\n }\n });\n\n var positives = terms.positive.concat(_.invoke(terms.number, \"abs\"));\n\n if (terms.other.length) {\n positives.push(new Abs(new Mul(terms.other).flatten()));\n }\n\n return new Mul(positives).flatten();\n } else {\n return abs;\n }\n },\n\n // this should definitely be behind a super-simplify flag\n expand: function() {\n var abs = this.recurse(\"expand\");\n\n if (abs.arg instanceof Mul) {\n // e.g. |xyz| -> |x|*|y|*|z|\n var terms = _.map(abs.arg.terms, function(term) {\n return new Abs(term);\n });\n return new Mul(terms);\n } else {\n return abs;\n }\n },\n\n isPositive: function() { return true; }\n});\n\n\n/* equation */\nfunction Eq(left, type, right) {\n this.left = left;\n this.type = type;\n this.right = right;\n}\nEq.prototype = new Expr();\n\n_.extend(Eq.prototype, {\n func: Eq,\n args: function() { return [this.left, this.type, this.right]; },\n\n needsExplicitMul: function() { return false; },\n\n print: function() {\n return this.left.print() + this.type + this.right.print();\n },\n\n signs: {\n \"=\": \" = \",\n \"<\": \" < \",\n \">\": \" > \",\n \"<>\": \" \\\\ne \",\n \"<=\": \" \\\\le \",\n \">=\": \" \\\\ge \"\n },\n\n tex: function() {\n return this.left.tex() + this.signs[this.type] + this.right.tex();\n },\n\n normalize: function() {\n var eq = this.recurse(\"normalize\");\n\n if (_.contains([\">\", \">=\"], eq.type)) {\n // inequalities should have the smaller side on the left\n return new Eq(eq.right, eq.type.replace(\">\", \"<\"), eq.left);\n } else {\n return eq;\n }\n },\n\n // convert this equation to an expression set to zero\n // the expression is normalized to a canonical form\n // e.g. y/2=x/4 -> y/2-x/4(=0) -> 2y-x(=0)\n // unless unfactored is specified, will then divide through\n asExpr: function(unfactored) {\n var isZero = function(expr) {\n return expr instanceof Num && expr.isSimple() && expr.eval() === 0;\n };\n\n // first convert to a sequence of additive terms\n var terms = [];\n\n if (this.left instanceof Add) {\n terms = _.clone(this.left.terms);\n } else if (!isZero(this.left)) {\n terms = [this.left];\n }\n\n if (this.right instanceof Add) {\n terms = terms.concat(this.right.negate().terms);\n } else if (!isZero(this.right)) {\n terms.push(this.right.negate());\n }\n\n var isInequality = !this.isEquality();\n\n // Collect over each term individually to transform simple expressions\n // into numbers that might have denominators, taking into account\n // float precision. We have to be very careful to not introduce any\n // irrational floats before asExpr() returns, because by definition\n // they do not have exact denominators...\n terms = _.invoke(terms, \"collect\", {preciseFloats: true});\n\n // ...and we multiply through by every denominator.\n for (var i = 0; i < terms.length; i++) {\n var denominator = terms[i].getDenominator();\n\n // Can't multiply inequalities by non 100% positive factors\n if (isInequality && !denominator.isPositive()) {\n denominator = denominator.asPositiveFactor();\n }\n\n if (!denominator.equals(Num.One)) {\n terms = _.map(terms, function(term) {\n return Mul.createOrAppend(term, denominator).simplify({\n once: true,\n preciseFloats: true\n });\n });\n }\n }\n\n var add = new Add(terms).flatten();\n return unfactored ? add : this.divideThrough(add);\n },\n\n // divide through by every common factor in the expression\n // e.g. 2y-4x(=0) -> y-2x(=0)\n // TODO(alex): Make it an option to only divide by variables/expressions\n // guaranteed to be nonzero\n divideThrough: function(expr) {\n var isInequality = !this.isEquality();\n\n var simplified = expr.simplify({once: true});\n var factored = simplified.factor({keepNegative: isInequality});\n\n if (!(factored instanceof Mul)) {\n return expr;\n }\n\n var terms = factored.terms;\n\n var isAdd = function(term) { return term instanceof Add; };\n var hasVar = function(term) { return !!term.getVars().length; };\n var isOne = function(term) { return term.equals(Num.One); };\n\n var grouped = _.groupBy(terms, isAdd);\n var adds = grouped[true] || [];\n var others = grouped[false] || [];\n\n if (adds.length && this.isEquality()) {\n // keep only Adds\n // e.g. 2xy(z+1)(=0) -> z+1(=0)\n return new Mul(adds).flatten();\n }\n\n var denominator = others;\n\n if (!adds.length) {\n // if no Adds, keep all variable terms to preserve meaning\n // e.g. 42xyz(=0) -> xyz(=0)\n denominator = _.reject(denominator, hasVar);\n }\n\n if (isInequality) {\n // can't divide inequalities by non 100% positive factors\n // e.g. 42x^2y(z+1)(=0) -> y(z+1)(=0)\n denominator = _.invoke(denominator, \"asPositiveFactor\");\n }\n\n // don't need to divide by one\n denominator = _.reject(denominator, isOne);\n\n denominator = _.map(denominator, function(term) {\n return new Pow(term, Num.Div);\n });\n\n var dividedResult = new Mul(terms.concat(denominator)).collect();\n\n // If the end result is the same as the original factoring,\n // rollback the factoring and discard all intermediate steps.\n if (dividedResult.equals(factored)) {\n return simplified;\n } else {\n return dividedResult;\n }\n },\n\n isEquality: function() {\n return _.contains([\"=\", \"<>\"], this.type);\n },\n\n compare: function(other) {\n // expression comparisons are handled by Expr.compare()\n if (!(other instanceof Eq)) {\n return false;\n }\n\n var eq1 = this.normalize();\n var eq2 = other.normalize();\n\n if (eq1.type !== eq2.type) {\n return false;\n }\n\n // need to collect to properly factor out common factors\n // e.g x+2x=6 -> 3x=6 -> 3x-6(=0) -> x-2(=0)\n var expr1 = eq1.divideThrough(eq1.asExpr(/* unfactored */ true).collect());\n var expr2 = eq2.divideThrough(eq2.asExpr(/* unfactored */ true).collect());\n\n if (eq1.isEquality()) {\n // equals and not-equals can be subtracted either way\n return expr1.compare(expr2) ||\n expr1.compare(Mul.handleNegative(expr2));\n } else {\n return expr1.compare(expr2);\n }\n },\n\n // should only be done after compare() returns true to avoid false positives\n sameForm: function(other) {\n var eq1 = this.normalize();\n var eq2 = other.normalize();\n\n var same = eq1.left.sameForm(eq2.left) && eq1.right.sameForm(eq2.right);\n\n if (eq1.isEquality()) {\n // equals and not-equals can be commutative with respect to the sign\n return same || (eq1.left.sameForm(eq2.right) && eq1.right.sameForm(eq2.left));\n } else {\n return same;\n }\n },\n\n // we don't want to override collect because it would turn y=x into y-x(=0)\n // instead, we ask if the equation was in that form, would it be simplified?\n isSimplified: function() {\n var expr = this.asExpr(/* unfactored */ true);\n var simplified = this.divideThrough(expr).simplify();\n return expr.equals(simplified) &&\n this.left.isSimplified() &&\n this.right.isSimplified();\n }\n});\n\n_.extend(Eq.prototype, {\n // Assumptions: Expression is of the form a+bx, and we solve for x\n solveLinearEquationForVariable: function(variable) {\n var expr = this.asExpr();\n if (!expr.is(Add) || expr.terms.length !== 2) {\n throw new Error(\"Can only handle linear equations of the form \" +\n \"a + bx (= 0)\");\n }\n\n var hasVar = function(term) {\n return term.has(Var) && _.contains(term.getVars(), variable.symbol);\n };\n\n var a, b;\n\n if (hasVar(expr.terms[0])) {\n a = Mul.handleNegative(expr.terms[1]);\n b = Mul.handleDivide(expr.terms[0], variable);\n } else {\n a = Mul.handleNegative(expr.terms[0]);\n b = Mul.handleDivide(expr.terms[1], variable);\n }\n\n return Mul.handleDivide(a, b).simplify();\n }\n});\n\n\n/* abstract symbol node */\nfunction Symbol() {}\nSymbol.prototype = new Expr();\n\n_.extend(Symbol.prototype, {\n\n needsExplicitMul: function() { return false; },\n\n findGCD: function(factor) {\n if (factor instanceof Symbol || factor instanceof Num) {\n return this.equals(factor) ? this : Num.One;\n } else {\n return factor.findGCD(this);\n }\n }\n});\n\n\n/* function variable */\nfunction Func(symbol, arg) {\n this.symbol = symbol; this.arg = arg;\n}\nFunc.prototype = new Symbol();\n\n_.extend(Func.prototype, {\n func: Func,\n args: function() { return [this.symbol, this.arg]; },\n\n print: function() {\n return this.symbol + \"(\" + this.arg.print() + \")\";\n },\n\n tex: function() {\n return this.symbol + \"(\" + this.arg.tex() + \")\";\n },\n\n eval: function(vars, options) {\n var arg = this.arg;\n var func = vars[this.symbol];\n var newVars = _.extend(_.clone(vars), {\n x: arg.eval(vars, options)\n });\n var parsedFunc = KAS.parse(func, options);\n if (parsedFunc.parsed) {\n return parsedFunc.expr.eval(newVars, options);\n }\n // If parsedFunc isn't actually parsed, return its error\n return parsedFunc;\n },\n\n codegen: function() {\n return 'vars[\"' + this.symbol + '\"](' +\n this.arg.codegen() + ')';\n },\n\n getUnits: function() {\n return this.arg.getUnits();\n },\n\n getVars: function(excludeFunc) {\n if (excludeFunc) {\n return this.arg.getVars();\n } else {\n return _.union(this.arg.getVars(), [this.symbol]).sort();\n }\n },\n\n getConsts: function() {\n return this.arg.getConsts();\n },\n});\n\n\n/* variable */\nfunction Var(symbol, subscript) {\n this.symbol = symbol;\n this.subscript = subscript;\n}\nVar.prototype = new Symbol();\n\n_.extend(Var.prototype, {\n func: Var,\n args: function() { return [this.symbol, this.subscript]; },\n\n exprArgs: function() { return []; },\n recurse: function() { return this; },\n\n print: function() {\n var sub = \"\";\n if (this.subscript) {\n sub = \"_(\" + this.subscript.print() + \")\";\n }\n return this.symbol + sub;\n },\n\n // Provide a way to easily evalate expressions with the common case,\n // subscripts that consist of a single number or symbol e.g. x_a or x_42\n prettyPrint: function() {\n var sub = this.subscript;\n if (sub && (sub instanceof Num || sub instanceof Symbol)) {\n return this.symbol + \"_\" + sub.print();\n } else {\n return this.print();\n }\n },\n\n tex: function() {\n var sub = \"\";\n if (this.subscript) {\n sub = \"_{\" + this.subscript.tex() + \"}\";\n }\n var prefix = this.symbol.length > 1 ? \"\\\\\" : \"\";\n return prefix + this.symbol + sub;\n },\n\n repr: function() { return \"Var(\" + this.print() + \")\"; },\n\n eval: function(vars, options) {\n return vars[this.prettyPrint()];\n },\n\n codegen: function() {\n return 'vars[\"' + this.prettyPrint() + '\"]';\n },\n\n getVars: function() { return [this.prettyPrint()]; },\n\n isPositive: function() { return false; }\n});\n\n\n/* constant */\nfunction Const(symbol) { this.symbol = symbol; }\nConst.prototype = new Symbol();\n\n_.extend(Const.prototype, {\n func: Const,\n args: function() { return [this.symbol]; },\n recurse: function() { return this; },\n\n eval: function(vars, options) {\n if (this.symbol === \"pi\") {\n return Math.PI;\n } else if (this.symbol === \"e\") {\n return Math.E;\n }\n },\n\n codegen: function() {\n if (this.symbol === \"pi\") {\n return \"Math.PI\";\n } else if (this.symbol === \"e\") {\n return \"Math.E\";\n }\n },\n\n print: function() { return this.symbol; },\n\n tex: function() {\n if (this.symbol === \"pi\") {\n return \"\\\\pi \";\n } else if (this.symbol === \"e\") {\n return \"e\";\n }\n },\n\n isPositive: function() {\n return this.eval() > 0;\n },\n\n abs: function() {\n if (this.eval() > 0) {\n return this;\n } else {\n return Mul.handleNegative(this);\n }\n },\n\n getConsts: function() {\n return [this.print()];\n },\n});\n\nConst.e = new Const(\"e\");\nConst.pi = new Const(\"pi\");\n\n\n/* abstract number node */\nfunction Num() {}\nNum.prototype = new Expr();\n\n_.extend(Num.prototype, {\n repr: function() { return this.print(); },\n strip: function() { return this.abs(); },\n recurse: function() { return this; },\n codegen: function() { return this.print(); },\n\n // takes another Num and returns a new Num\n add: abstract,\n mul: abstract,\n\n // returns this Num's additive inverse\n negate: abstract,\n\n isSubtract: function() { return this.hints.subtract; },\n\n // return the absolute value of the number\n abs: abstract,\n\n needsExplicitMul: function() { return true; },\n\n findGCD: abstract,\n\n isPositive: function() {\n return this.eval() > 0;\n },\n\n isNegative: function() {\n return this.eval() < 0;\n },\n\n asPositiveFactor: function() {\n return this.isPositive() ? this : this.abs();\n },\n\n // hints for interpreting and rendering user input\n hints: _.extend(Num.prototype.hints, {\n negate: false,\n subtract: false,\n divide: false,\n root: false,\n fraction: false,\n entered: false\n }),\n\n // whether a number is considered simple (one term)\n // e.g. for reals, ints and floats are simple\n isSimple: abstract,\n\n // Based on http://stackoverflow.com/a/10454560/2571482\n getDecimalPlaces: function() {\n var match = (\"\" + this.n).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (match) {\n return Math.max(\n 0,\n // Number of digits right of decimal point\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation\n (match[2] ? +match[2] : 0)\n );\n } else {\n return 0;\n }\n },\n\n asRational: abstract\n});\n\n\n/* rational number (n: numerator, d: denominator) */\nfunction Rational(numerator, denominator) {\n var n = numerator; var d = denominator;\n if (d < 0) {\n n = -n; d = -d;\n }\n this.n = n; this.d = d;\n}\nRational.prototype = new Num();\n\n_.extend(Rational.prototype, {\n func: Rational,\n args: function() { return [this.n, this.d]; },\n eval: function() { return this.n / this.d; },\n\n print: function() {\n return this.n.toString() + \"/\" + this.d.toString();\n },\n\n tex: function() {\n var tex = \"\\\\frac{\" + Math.abs(this.n).toString() + \"}{\" + this.d.toString() + \"}\";\n return this.n < 0 ? \"-\" + tex : tex;\n },\n\n add: function(num, options) {\n if (num instanceof Rational) {\n return new Rational(this.n * num.d + this.d * num.n, this.d * num.d).collect();\n } else {\n return num.add(this, options);\n }\n },\n\n mul: function(num, options) {\n if (num instanceof Rational) {\n return new Rational(this.n * num.n, this.d * num.d).collect();\n } else {\n return num.mul(this, options);\n }\n },\n\n collect: function() {\n var gcd = Num.findGCD(this.n, this.d);\n\n var n = this.n / gcd;\n var d = this.d / gcd;\n\n if (d === 1) {\n return new Int(n);\n } else {\n return new Rational(n, d);\n }\n },\n\n negate: function() {\n return new Rational(-this.n, this.d);\n },\n\n abs: function() {\n return new Rational(Math.abs(this.n), this.d);\n },\n\n findGCD: function(factor) {\n // Attempt to factor out common numerators and denominators to return\n // a Rational instead of a Float\n if (factor instanceof Rational) {\n // For more background, see\n // http://math.stackexchange.com/questions/151081/gcd-of-rationals\n var numerator = Num.findGCD(this.n * factor.d, factor.n * this.d);\n var denominator = this.d * factor.d;\n // Create the rational, then call .collect() to simplify it\n return new Rational(numerator, denominator).collect();\n } else if (factor instanceof Int) {\n return new Rational(Num.findGCD(this.n, factor.n), this.d);\n } else {\n return factor.findGCD(this);\n }\n },\n\n // for now, assuming that exp is a Num\n raiseToThe: function(exp) {\n if (exp instanceof Int) {\n var positive = exp.eval() > 0;\n var abs = exp.abs().eval();\n var n = Math.pow(this.n, abs);\n var d = Math.pow(this.d, abs);\n if (positive) {\n return new Rational(n, d).collect();\n } else {\n return new Rational(d, n).collect();\n }\n } else {\n return new Float(this.eval()).raiseToThe(exp);\n }\n },\n\n getDenominator: function() {\n return new Int(this.d);\n },\n\n isSimple: function() { return false; },\n\n asRational: function() { return this; }\n});\n\n\n/* integer (n: numerator/number) */\nfunction Int(number) { this.n = number; }\nInt.prototype = new Rational(0, 1);\n\n_.extend(Int.prototype, {\n func: Int,\n args: function() { return [this.n]; },\n print: function() { return this.n.toString(); },\n tex: function() { return this.n.toString(); },\n negate: function() { return new Int(-this.n); },\n abs: function() { return new Int(Math.abs(this.n)); },\n isSimple: function() { return true; },\n findGCD: function(factor) {\n if (factor instanceof Int) {\n return new Int(Num.findGCD(this.n, factor.n));\n } else {\n return factor.findGCD(this);\n }\n }\n});\n\n_.extend(Int, {\n create: function(n) { return new Int(n).addHint(\"entered\"); }\n});\n\n/* float (n: number) */\nfunction Float(number) { this.n = number; }\nFloat.prototype = new Num();\n\n_.extend(Float.prototype, {\n func: Float,\n args: function() { return [this.n]; },\n eval: function() { return this.n; },\n\n // TODO(alex): when we internationalize number parsing/display\n // we should make sure to use the appropriate decimal mark here\n print: function() { return this.n.toString(); },\n tex: function() { return this.n.toString(); },\n\n add: function(num, options) {\n if (options && options.preciseFloats) {\n return Float.toDecimalPlaces(\n this.n + num.eval(),\n Math.max(this.getDecimalPlaces(), num.getDecimalPlaces())\n );\n } else {\n return new Float(this.n + num.eval()).collect();\n }\n },\n\n mul: function(num, options) {\n if (options && options.preciseFloats) {\n return Float.toDecimalPlaces(\n this.n * num.eval(),\n this.getDecimalPlaces() + num.getDecimalPlaces()\n );\n } else {\n return new Float(this.n * num.eval()).collect();\n }\n },\n\n collect: function() {\n // We used to simplify Floats to Ints here whenever possible, but no\n // longer do so in order to preserve significant figures.\n return this;\n },\n\n negate: function() { return new Float(-this.n); },\n abs: function() { return new Float(Math.abs(this.n)); },\n\n findGCD: function(factor) {\n if (factor instanceof Num) {\n return new Float(Num.findGCD(this.eval(), factor.eval())).collect();\n } else {\n return factor.findGCD(this);\n }\n },\n\n // for now, assuming that exp is a Num\n raiseToThe: function(exp, options) {\n if (options && options.preciseFloats &&\n exp instanceof Int && exp.n > 1) {\n return Float.toDecimalPlaces(\n new Pow(this, exp).eval(),\n this.getDecimalPlaces() * exp.n\n );\n } else {\n return new Float(new Pow(this, exp).eval()).collect();\n }\n },\n\n // only to be used on non-repeating decimals (e.g. user-provided)\n asRational: function() {\n var parts = this.n.toString().split(\".\");\n if (parts.length === 1) {\n return new Rational(this.n, 1);\n } else {\n var numerator = Number(parts.join(\"\"));\n var denominator = Math.pow(10, parts[1].length);\n return new Rational(numerator, denominator).collect();\n }\n },\n\n getDenominator: function() {\n return this.asRational().getDenominator();\n },\n\n isSimple: function() { return true; }\n});\n\n_.extend(Float, {\n create: function(n) { return new Float(n).addHint(\"entered\"); },\n\n // Account for floating point imprecision by explicitly controlling the\n // number of decimal places in common operations (e.g. +, *, ^)\n toDecimalPlaces: function(n, places) {\n return new Float(+n.toFixed(Math.min(places, 20))).collect();\n }\n});\n\n// static methods and fields that are best defined on Num\n_.extend(Num, {\n negativeOne: function(hint) {\n if (hint === \"subtract\") {\n return Num.Sub;\n } else if (hint === \"divide\") {\n return Num.Div;\n } else {\n return Num.Neg;\n }\n },\n\n // find the greatest common denominator\n findGCD: function(a, b) {\n var mod;\n\n a = Math.abs(a);\n b = Math.abs(b);\n\n // Euclid's method doesn't handle non-integers very well. For now\n // we just say we can't pull out a common factor. It might be\n // reasonable to do better than this in the future.\n if (a !== Math.floor(a) || b !== Math.floor(b)) {\n return 1;\n }\n\n while (b) {\n mod = a % b;\n a = b;\n b = mod;\n }\n\n return a;\n },\n\n min: function() {\n return _.min(_.toArray(arguments), function(num) {\n return num.eval();\n });\n },\n\n max: function() {\n return _.max(_.toArray(arguments), function(num) {\n return num.eval();\n });\n }\n});\n\nNum.Neg = new Int(-1).addHint(\"negate\");\nNum.Sub = new Int(-1).addHint(\"subtract\");\nNum.Div = new Int(-1).addHint(\"divide\");\n\nNum.Sqrt = new Rational(1, 2).addHint(\"root\");\n\nNum.Zero = new Int(0);\nNum.One = new Int(1);\nNum.Ten = new Int(10);\n\n\n// set identities here\nAdd.prototype.identity = Num.Zero;\nMul.prototype.identity = Num.One;\n\n\nvar parser = KAS.parser;\n\nvar parseError = function(str, hash) {\n // return int location of parsing error\n throw new Error(hash.loc.first_column);\n};\n\n// expose concrete nodes to parser scope\n// see http://zaach.github.io/jison/docs/#sharing-scope\nparser.yy = {\n Add: Add,\n Mul: Mul,\n Pow: Pow,\n Log: Log,\n Trig: Trig,\n Eq: Eq,\n Abs: Abs,\n Func: Func,\n Const: Const,\n Var: Var,\n Int: Int,\n Float: Float,\n parseError: parseError,\n\n constants: [\"e\"],\n symbolLexer: function(symbol) {\n if (_.contains(parser.yy.constants, symbol)) {\n return \"CONST\";\n } else if (_.contains(parser.yy.functions, symbol)) {\n return \"FUNC\";\n } else {\n return \"VAR\";\n }\n }\n};\n\nKAS.parse = function(input, options) {\n try {\n if (options && options.functions) {\n // reserve the symbol \"i\" for complex numbers\n parser.yy.functions = _.without(options.functions, \"i\");\n } else {\n parser.yy.functions = [];\n }\n\n // If ',' is the decimal dividor in your country, replace any ','s\n // with '.'s.\n // This isn't perfect, since the output will all still have '.'s.\n // TODO(jack): Fix the output to have ','s in this case\n if (options && options.decimal_separator) {\n input = input.split(options.decimal_separator).join(\".\");\n }\n\n var expr = parser.parse(input).completeParse();\n return { parsed: true, expr: expr };\n } catch (e) {\n return { parsed: false, error: e.message };\n }\n};\n\n/* unit */\nfunction Unit(symbol) {\n this.symbol = symbol;\n}\nUnit.prototype = new Symbol();\n\n// If possible, replace unit prefixes with a multiplication.\n//\n// \"g\" -> Unit(\"g\")\n// \"kg\" -> 1000 * Unit(\"g\")\nvar unprefixify = function(symbol) {\n if (_(baseUnits).has(symbol) || _(derivedUnits).has(symbol)) {\n return new Unit(symbol);\n }\n\n // check for prefix\n var prefix = _(_(siPrefixes).keys()).find(function(testPrefix) {\n return new RegExp(\"^\" + testPrefix).test(symbol);\n });\n\n if (prefix) {\n var base = symbol.replace(new RegExp(\"^\" + prefix), \"\");\n\n // It's okay to be here if either:\n // * `base` is a base unit (the seven units listed in baseUnits)\n // * `base` is a derived unit which allows prefixes\n //\n // Otherwise, we're trying to parse a unit label which is not\n // allowed (mwk, mBTU, etc).\n if (_(baseUnits).has(base) ||\n (derivedUnits[base] &&\n derivedUnits[base].prefixes === hasPrefixes)) {\n\n return new Mul(siPrefixes[prefix], new Unit(base));\n } else {\n throw new Error(base + \" does not allow prefixes\");\n }\n } else {\n return new Unit(symbol);\n }\n};\n\nKAS.unitParse = function(input) {\n try {\n var parseResult = KAS.unitParser.parse(input);\n\n // parseResult looks like:\n // {\n // magnitude: \"5\",\n // unit: {\n // num: [\n // { name: \"s\", pow: 2 }\n // ],\n // denom: [\n // { name: \"kg\", pow: 1 }\n // ]\n // }\n // }\n //\n // denom is optionally null\n\n var unitArray = [];\n\n _(parseResult.unit.num).each(function(unitSpec) {\n unitArray.push(\n new Pow(unprefixify(unitSpec.name), new Int(unitSpec.pow))\n );\n });\n\n _(parseResult.unit.denom).each(function(unitSpec) {\n unitArray.push(\n new Pow(unprefixify(unitSpec.name), new Int(-1 * unitSpec.pow))\n );\n });\n\n var unit = new Mul(unitArray).flatten();\n\n if (parseResult.type === \"unitMagnitude\") {\n // in the first case we have a magnitude coefficient as well as the\n // unit itself.\n var coefArray =\n [new Float(+parseResult.magnitude)].concat(unitArray);\n var expr = new Mul(coefArray);\n return {\n parsed: true,\n unit: unit,\n expr: expr,\n coefficient: parseResult.magnitude,\n type: parseResult.type\n };\n } else {\n\n // in the second case it's just the unit with no magnitude.\n return {\n parsed: true,\n unit: unit,\n type: parseResult.type,\n };\n }\n } catch (e) {\n return { parsed: false, error: e.message };\n }\n};\n\n_.extend(Unit.prototype, {\n func: Unit,\n args: function() { return [this.symbol]; },\n recurse: function() { return this; },\n\n eval: function(vars, options) {\n // This is called when comparing units. A unit doesn't affect the\n // numerical value of its coefficient, so this needs to be 1.\n //\n // On the other hand, things must not evaluate to the same thing if\n // they don't have the same type. I believe that's also true - form is\n // checked before numerical equivalence. I do not know where, though.\n // However, there are a couple tests checking this.\n return 1;\n },\n\n getUnits: function() { return [{ unit: this.symbol, pow: 1 }]; },\n\n codegen: function() { return \"1\"; },\n\n print: function() { return this.symbol; },\n\n tex: function() { return this.symbol; },\n\n // Simplify units by replacing prefixes with multiplication\n collect: function(options) {\n if (_(baseUnits).has(this.symbol)) {\n return this;\n } else if (_(derivedUnits).has(this.symbol)) {\n return derivedUnits[this.symbol].conversion;\n } else {\n throw new Error(\"could not understand unit: \" + this.symbol);\n }\n },\n});\n\nvar baseUnits = {\n m: new Unit(\"m\"),\n // Note: kg is the SI base unit but we use g for consistency\n g: new Unit(\"g\"),\n s: new Unit(\"s\"),\n A: new Unit(\"A\"),\n K: new Unit(\"K\"),\n mol: new Unit(\"mol\"),\n cd: new Unit(\"cd\"),\n};\n\nvar siPrefixes = {\n a: new Pow(new Int(10), new Int(-18)),\n f: new Pow(new Int(10), new Int(-15)),\n p: new Pow(new Int(10), new Int(-12)),\n n: new Pow(new Int(10), new Int(-9)),\n u: new Pow(new Int(10), new Int(-6)),\n m: new Pow(new Int(10), new Int(-3)),\n c: new Pow(new Int(10), new Int(-2)),\n d: new Pow(new Int(10), new Int(-1)),\n da: new Int(10),\n h: new Pow(new Int(10), new Int(2)),\n k: new Pow(new Int(10), new Int(3)),\n M: new Pow(new Int(10), new Int(6)),\n G: new Pow(new Int(10), new Int(9)),\n T: new Pow(new Int(10), new Int(12)),\n P: new Pow(new Int(10), new Int(15)),\n E: new Pow(new Int(10), new Int(18)),\n // http://en.wikipedia.org/wiki/Metric_prefix#.22Hella.22_prefix_proposal\n hella: new Pow(new Int(10), new Int(27)),\n};\n\n// Use these two values to mark a unit as either SI-prefixable or not.\nvar hasPrefixes = {};\nvar hasntPrefixes = {};\n\nvar makeAlias = function(str, prefixes) {\n var splits = str.split(\"|\");\n var coefficientStr = splits[0].trim();\n var unitsStr = splits[1].trim();\n\n var coefficient = Num.One;\n if (coefficientStr !== \"\") {\n coefficient = KAS.parse(coefficientStr).expr;\n }\n\n var numdenomStr = unitsStr.split(\"/\");\n var numdenom = [coefficient];\n\n if (numdenomStr[0]) {\n numdenomStr[0]\n .split(\" \")\n .filter(function(x) {\n return x !== \"\";\n }).map(function(x) {\n numdenom.push(new Unit(x));\n });\n }\n\n if (numdenomStr[1]) {\n numdenomStr[1]\n .split(\" \")\n .filter(function(x) {\n return x !== \"\";\n }).map(function(x) {\n numdenom.push(new Pow(new Unit(x), Num.Div));\n });\n }\n\n return {\n conversion: new Mul(numdenom),\n prefixes: prefixes,\n };\n};\n\n// This is a mapping of derived units (or different names for a unit) to their\n// definitions. For example, an inch is defined as 0.0254 m.\n//\n// Definitions don't need to be in terms of base units. For example, tsp is\n// defined in terms of tbsp (which is defined in terms of cup -> gal -> L ->\n// m^3). However, units must get simpler. I.e. there's no loop checking.\n//\n// makeAlias takes two parameters:\n// * a string specifying the simplification to perform\n// - a required pipe separates the constant factor from the base units\n// - the constant factor is parsed by KAS\n// - the base units are in a simple format which disallows exponents and\n// requires multiplicands to be space-separated (\"m m\" rather than \"m^2)\n// with an optional \"/\" separating numerator and denominator\n// - prefixes are not allowed to be used in the converted to units\n// (note that this restriction, the format of the string, and the choice to\n// use a string in the first place are made out of laziness to minimize\n// both typing and parsing)\n// * a boolean specifying whether or not it's acceptable to use SI units\n//\n// Where possible, these units are taken from \"The International System of\n// Units (SI)\" 8th edition (2006).\nvar derivedUnits = {\n // mass\n // The atomic mass unit / dalton.\n Da: makeAlias(\"1.6605388628 x 10^-24 | g\", hasPrefixes),\n u: makeAlias(\"| Da\", hasntPrefixes),\n\n // length\n \"meter\": makeAlias(\"| m\", hasntPrefixes),\n \"meters\": makeAlias(\"| m\", hasntPrefixes),\n \"in\": makeAlias(\"254 / 10000 | m\", hasntPrefixes),\n \"ft\": makeAlias(\"3048 / 10000 | m\", hasntPrefixes),\n \"yd\": makeAlias(\"9144 / 10000 | m\", hasntPrefixes),\n \"mi\": makeAlias(\"1609344 / 1000 | m\", hasntPrefixes),\n \"ly\": makeAlias(\"9.4607 x 10^15 | m\", hasntPrefixes),\n \"nmi\": makeAlias(\"1852 | m\", hasntPrefixes),\n \"Å\": makeAlias(\"10^-10 | m\", hasntPrefixes),\n \"pc\": makeAlias(\"3.0857 x 10^16 | m\", hasntPrefixes),\n\n // time\n \"min\": makeAlias(\"60 | s\", hasntPrefixes),\n \"hr\": makeAlias(\"3600 | s\", hasntPrefixes),\n \"sec\": makeAlias(\"| s\", hasntPrefixes),\n // TODO(joel) make day work\n \"day\": makeAlias(\"86400 | s\", hasntPrefixes),\n \"wk\": makeAlias(\"604800 | s\", hasntPrefixes),\n \"fortnight\": makeAlias(\"14 | day\", hasntPrefixes),\n \"shake\": makeAlias(\"10^-8 | s\", hasntPrefixes),\n \"olympiad\": makeAlias(\"126200000 | s\", hasntPrefixes),\n\n // temperature\n \"°C\": makeAlias(\"1 | K\", hasntPrefixes),\n \"°F\": makeAlias(\"5/9 | K\", hasntPrefixes),\n \"°R\": makeAlias(\"5/9 | K\", hasntPrefixes),\n\n // electric charge\n \"e\": makeAlias(\"1.6021765314 x 10^-19 | C\", hasntPrefixes),\n\n // speed\n \"c\": makeAlias(\"299792458 | m / s\", hasntPrefixes),\n \"kn\": makeAlias(\"514/1000 | m / s\", hasntPrefixes),\n \"kt\": makeAlias(\"| kn\", hasntPrefixes),\n \"knot\": makeAlias(\"| kn\", hasntPrefixes),\n\n // energy\n \"J\": makeAlias(\"| N m\", hasPrefixes),\n \"BTU\": makeAlias(\"1060 | J\", hasntPrefixes),\n \"cal\": makeAlias(\"4184 / 1000 | J\", hasPrefixes),\n \"eV\": makeAlias(\"1.602176514 x 10^-19 | J\", hasPrefixes),\n \"erg\": makeAlias(\"10^−7 | J\", hasPrefixes),\n\n // power\n \"W\": makeAlias(\"| J / s\", hasPrefixes),\n \"H-e\": makeAlias(\"80 | W\", hasntPrefixes),\n\n // force\n \"N\": makeAlias(\"1000 | g m / s s\", hasPrefixes),\n // \"lb\": makeAlias(\"4448 / 1000 | N\", hasntPrefixes),\n // 4.4482216152605\n \"lb\": makeAlias(\"4448221615 / 1000000000 | N\", hasntPrefixes),\n \"dyn\": makeAlias(\"10^-5 | N\", hasntPrefixes),\n\n // pressure\n \"Pa\": makeAlias(\"1 | N / m m m\", hasPrefixes),\n \"bar\": makeAlias(\"10^5 | Pa\", hasPrefixes),\n \"㏔\": makeAlias(\"1/1000 | bar\", hasntPrefixes),\n \"㍴\": makeAlias(\"| bar\", hasntPrefixes),\n \"atm\": makeAlias(\"101325 | Pa\", hasntPrefixes),\n \"Torr\": makeAlias(\"1/760 | atm\", hasntPrefixes),\n \"mmHg\": makeAlias(\"| Torr\", hasntPrefixes),\n\n // area\n \"ha\": makeAlias(\"10^4 | m m\", hasntPrefixes),\n \"b\": makeAlias(\"10^−28 | m m\", hasPrefixes),\n \"barn\": makeAlias(\"| b\", hasPrefixes),\n \"acre\": makeAlias(\"4046.87 | m m\", hasntPrefixes),\n \"skilodge\": makeAlias(\"10^-31 | m m\", hasntPrefixes),\n \"outhouse\": makeAlias(\"10^-34 | m m\", hasntPrefixes),\n \"shed\": makeAlias(\"10^-52 | m m\", hasntPrefixes),\n\n // volume\n \"L\": makeAlias(\"1/1000 | m m m\", hasPrefixes),\n \"gal\": makeAlias(\"3785/1000 | L\", hasPrefixes),\n \"cup\": makeAlias(\"1/16 | gal\", hasntPrefixes),\n \"qt\": makeAlias(\"1/4 | gal\", hasntPrefixes),\n \"quart\": makeAlias(\"| qt\", hasntPrefixes),\n \"p\": makeAlias(\"1/8 | gal\", hasntPrefixes),\n \"pt\": makeAlias(\"| p\", hasntPrefixes),\n \"pint\": makeAlias(\"| p\", hasntPrefixes),\n \"fl oz\": makeAlias(\"1/8 | cup\", hasntPrefixes),\n \"fl. oz.\": makeAlias(\"1/8 | cup\", hasntPrefixes),\n \"tbsp\": makeAlias(\"1/16 | cup\", hasntPrefixes),\n \"tsp\": makeAlias(\"1/3 | tbsp\", hasntPrefixes),\n\n // rotational\n // \"rad\":\n \"rev\": makeAlias(\"2 pi | rad\", hasntPrefixes),\n \"deg\": makeAlias(\"180 pi | rad\", hasntPrefixes),\n \"°\": makeAlias(\"| deg\", hasntPrefixes),\n \"arcminute\": makeAlias(\"1/60 | deg\", hasntPrefixes),\n \"arcsec\": makeAlias(\"1/3600 | deg\", hasntPrefixes),\n\n // dimensionless\n // \"B\": makeAlias(\"10 | dB\", hasntPrefixes), // XXX danger - logarithmic\n // \"dB\"\n // \"nP\"\n \"Hu\": makeAlias(\"1000 | dB\", hasPrefixes),\n \"dozen\": makeAlias(\"12 |\", hasntPrefixes),\n // XXX\n \"mol\": makeAlias(\"6.0221412927 x 10^23 |\", hasPrefixes),\n \"%\": makeAlias(\"1/100 |\", hasntPrefixes),\n \"percent\": makeAlias(\"| %\", hasntPrefixes),\n \"ppm\": makeAlias(\"1/1000000 |\", hasntPrefixes),\n\n // electric / magnetic\n \"V\": makeAlias(\"1000 | g m m / s s C\", hasPrefixes),\n \"C\": makeAlias(\"| A s\", hasPrefixes),\n \"ampere\": makeAlias(\"| A\", hasntPrefixes),\n \"Ω\": makeAlias(\"| V / A\", hasPrefixes),\n \"ohm\": makeAlias(\"| Ω\", hasntPrefixes),\n \"F\": makeAlias(\"| C / V\", hasPrefixes),\n \"H\": makeAlias(\"| ohm s\", hasPrefixes),\n \"T\": makeAlias(\"1000 | g / C s\", hasPrefixes),\n \"Wb\": makeAlias(\"1000 | g m m / C s\", hasPrefixes),\n\n // photometry\n // TODO not sure this is right\n \"lm\": makeAlias(\"pi x 10^4 | cd / m m\", hasntPrefixes),\n \"lx\": makeAlias(\"| lm / m m\", hasntPrefixes),\n \"nit\": makeAlias(\"| cd / m m\", hasntPrefixes),\n \"sb\": makeAlias(\"10^4 | cd / m m\", hasntPrefixes),\n \"stilb\": makeAlias(\"1 | sb\", hasntPrefixes),\n \"apostilb\": makeAlias(\"1 / pi x 10^(-4) | sb\", hasntPrefixes),\n \"blondel\": makeAlias(\"| apostilb\", hasntPrefixes),\n \"asb\": makeAlias(\"| apostilb\", hasntPrefixes),\n \"la\": makeAlias(\"| lm\", hasntPrefixes),\n \"Lb\": makeAlias(\"| lm\", hasntPrefixes),\n \"sk\": makeAlias(\"10^-7 | lm\", hasntPrefixes),\n \"skot\": makeAlias(\"| sk\", hasntPrefixes),\n \"bril\": makeAlias(\"10^-11 | lm\", hasntPrefixes),\n\n // other\n \"Hz\": makeAlias(\"| / s\", hasPrefixes),\n};\n\nKAS.Add = Add;\nKAS.Mul = Mul;\nKAS.Pow = Pow;\nKAS.Log = Log;\nKAS.Eq = Eq;\nKAS.Trig = Trig;\nKAS.Abs = Abs;\nKAS.Func = Func;\nKAS.Var = Var;\nKAS.Const = Const;\nKAS.Unit = Unit;\nKAS.Rational = Rational;\nKAS.Int = Int;\nKAS.Float = Float;\nKAS.Zero = Num.Zero;\nKAS.One = Num.One;\n\n})(KAS);\n\n(function(KAS) {\n // Assumes that both expressions have already been parsed\n // TODO(alex): be able to pass a random() function to compare()\n KAS.compare = function(expr1, expr2, options) {\n var defaults = {\n form: false, // Check that the two expressions have the same form\n simplify: false, // Check that the second expression is simplified\n };\n\n /* Options that could be added in the future:\n * - Allow ratios: e.g. 3/1 and 3 should both be accepted for something\n * like slope\n * - Allow student to choose their own variable names\n */\n\n if (options !== undefined) {\n // eslint-disable-next-line no-undef\n options = _.extend(defaults, options);\n } else {\n options = defaults;\n }\n\n // TODO(CP-1614): Figure out how to make these messages translatable\n\n // Variable check\n var vars = expr1.sameVars(expr2);\n if (!vars.equal) {\n var message;\n if (vars.equalIgnoringCase) {\n message =\n \"Check your variables; one or more are using \" +\n \"the wrong case (upper or lower).\";\n } else {\n message =\n \"Check your variables; you may have used the wrong \" +\n \"letter for one or more of them.\";\n }\n return {\n equal: false,\n wrongVariableCase: vars.equalIgnoringCase,\n wrongVariableNames: !vars.equalIgnoringCase,\n message: message,\n };\n }\n\n // Semantic check\n if (!expr1.compare(expr2)) {\n return {equal: false, message: null};\n }\n\n // Syntactic check\n if (options.form && !expr1.sameForm(expr2)) {\n return {\n equal: false,\n message: \"Your answer is not in the correct form.\",\n };\n }\n\n // Syntactic check\n if (options.simplify && !expr1.isSimplified()) {\n return {\n equal: false,\n message: \"Your answer is not fully expanded and simplified.\",\n };\n }\n\n return {equal: true, message: null};\n };\n})(KAS);\n","// @noflow\nimport createReactClass from \"create-react-class\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nconst PT = PropTypes;\n\n// Takes an array of components to sort\n// eslint-disable-next-line react/no-unsafe\nconst SortableArea = createReactClass({\n propTypes: {\n className: PT.string,\n components: PT.arrayOf(PT.node).isRequired,\n onReorder: PT.func.isRequired,\n style: PT.any,\n verify: PT.func,\n },\n getDefaultProps: function () {\n return {verify: () => true};\n },\n getInitialState: function () {\n return {\n // index of the component being dragged\n dragging: null,\n components: this.props.components,\n };\n },\n // Firefox refuses to drag an element unless you set data on it. Hackily\n // add data each time an item is dragged.\n componentDidMount: function () {\n this._setDragEvents();\n },\n UNSAFE_componentWillReceiveProps: function (nextProps) {\n this.setState({components: nextProps.components});\n },\n componentDidUpdate: function () {\n this._setDragEvents();\n },\n // Alternatively send each handler to each component individually,\n // partially applied\n onDragStart: function (startIndex) {\n this.setState({dragging: startIndex});\n },\n onDrop: function () {\n // tell the parent component\n this.setState({dragging: null});\n this.props.onReorder(this.state.components);\n },\n onDragEnter: function (enterIndex) {\n // When a label is first dragged it triggers a dragEnter with itself,\n // which we don't care about.\n if (this.state.dragging === enterIndex) {\n return;\n }\n\n const newComponents = this.state.components.slice();\n\n // splice the tab out of its old position\n const removed = newComponents.splice(this.state.dragging, 1);\n // ... and into its new position\n newComponents.splice(enterIndex, 0, removed[0]);\n\n const verified = this.props.verify(newComponents);\n if (verified) {\n this.setState({\n dragging: enterIndex,\n components: newComponents,\n });\n }\n return verified;\n },\n _listenEvent: function (e) {\n e.dataTransfer.setData(\"hackhackhack\", \"because browsers!\");\n },\n _cancelEvent: function (e) {\n // prevent the browser from redirecting to 'because browsers!'\n e.preventDefault();\n },\n _setDragEvents: function () {\n this._dragItems = this._dragItems || [];\n const items =\n ReactDOM.findDOMNode(this).querySelectorAll(\"[draggable=true]\");\n\n const oldItems = [];\n const newItems = [];\n\n for (let i = 0; i < this._dragItems.length; i++) {\n const item = this._dragItems[i];\n if (items.indexOf(item) < 0) {\n oldItems.push(item);\n }\n }\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (this._dragItems.indexOf(item) < 0) {\n newItems.push(item);\n }\n }\n\n for (let i = 0; i < newItems.length; i++) {\n const dragItem = newItems[i];\n dragItem.addEventListener(\"dragstart\", this._listenEvent);\n dragItem.addEventListener(\"drop\", this._cancelEvent);\n }\n\n for (let i = 0; i < oldItems.length; i++) {\n const dragItem = oldItems[i];\n dragItem.removeEventListener(\"dragstart\", this._listenEvent);\n dragItem.removeEventListener(\"drop\", this._cancelEvent);\n }\n },\n render: function () {\n const sortables = this.state.components.map((component, index) => (\n <SortableItem\n index={index}\n component={component}\n area={this}\n key={component.key}\n draggable={component.props.draggable}\n dragging={index === this.state.dragging}\n />\n ));\n return (\n <ol className={this.props.className} style={this.props.style}>\n {sortables}\n </ol>\n );\n },\n});\n\n// An individual sortable item\nconst SortableItem = createReactClass({\n propTypes: {\n area: PT.shape({\n onDragEnter: PT.func.isRequired,\n onDragStart: PT.func.isRequired,\n onDrop: PT.func.isRequired,\n }),\n component: PT.node.isRequired,\n dragging: PT.bool.isRequired,\n draggable: PT.bool.isRequired,\n index: PT.number.isRequired,\n },\n handleDragStart: function (e) {\n e.nativeEvent.dataTransfer.effectAllowed = \"move\";\n this.props.area.onDragStart(this.props.index);\n },\n handleDrop: function () {\n this.props.area.onDrop(this.props.index);\n },\n handleDragEnter: function (e) {\n const verified = this.props.area.onDragEnter(this.props.index);\n // Ideally this would change the cursor based on whether this is a\n // valid place to drop.\n e.nativeEvent.dataTransfer.effectAllowed = verified ? \"move\" : \"none\";\n },\n handleDragOver: function (e) {\n // allow a drop by preventing default handling\n e.preventDefault();\n },\n render: function () {\n let dragState = \"sortable-disabled\";\n if (this.props.dragging) {\n dragState = \"sortable-dragging\";\n } else if (this.props.draggable) {\n dragState = \"sortable-enabled\";\n }\n\n return (\n <li\n draggable={this.props.draggable}\n className={dragState}\n onDragStart={this.handleDragStart}\n onDrop={this.handleDrop}\n onDragEnter={this.handleDragEnter}\n onDragOver={this.handleDragOver}\n >\n {this.props.component}\n </li>\n );\n },\n});\n\nexport default SortableArea;\n","/* eslint-disable one-var, react/forbid-prop-types, react/sort-comp */\n// @flow\nimport {\n components,\n Changeable,\n Dependencies,\n Expression,\n} from \"@khanacademy/perseus\";\nimport lens from \"hubble\";\nimport KAS from \"kas\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport SortableArea from \"../components/sortable.jsx\";\n\nconst {InfoTip, PropCheckBox, TexButtons} = components;\nconst {getDependencies} = Dependencies;\n\n// An answer can be considered correct, wrong, or ungraded.\nconst CONSIDERED = [\"correct\", \"wrong\", \"ungraded\"];\n\nconst answerFormType = PropTypes.shape({\n considered: PropTypes.oneOf(CONSIDERED).isRequired,\n value: PropTypes.string.isRequired,\n form: PropTypes.bool.isRequired,\n simplify: PropTypes.bool.isRequired,\n});\n\n// Pick a key that isn't currently used by an answer in answerForms\nconst _makeNewKey = (answerForms) => {\n // first note all the currently used keys in an array, used like a map :3\n // note that this automatically updates the array's length property to\n // be one past the largest key.\n const usedKeys = [];\n answerForms.forEach((ans) => {\n usedKeys[ans.key] = true;\n });\n\n // then scan through the array to find the first unused (undefined) key\n for (let i = 0; i < usedKeys.length; i++) {\n if (!usedKeys[i]) {\n return i;\n }\n }\n\n // if we didn't find a key, make one bigger than all the other keys,\n // since that's how the length property is defined to work on arrays\n return usedKeys.length;\n};\n\nclass ExpressionEditor extends React.Component<$FlowFixMe, $FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n answerForms: PropTypes.arrayOf(answerFormType),\n times: PropTypes.bool,\n buttonSets: TexButtons.buttonSetsType,\n functions: PropTypes.arrayOf(PropTypes.string),\n };\n\n static widgetName: \"expression\" = \"expression\";\n\n static defaultProps: $FlowFixMe = {\n answerForms: [],\n times: false,\n buttonSets: [\"basic\"],\n functions: [\"f\", \"g\", \"h\"],\n };\n\n constructor(props: $FlowFixMe) {\n super(props);\n // Is the format of `value` TeX or plain text?\n // TODO(alex): Remove after backfilling everything to TeX\n // TODO(joel) - sucks if you edit some expression without\n // backslashes or curly braces, then come back to the question and\n // it's surprisingly not TeX anymore.\n\n let isTex;\n // default to TeX if new;\n if (props.answerForms.length === 0) {\n isTex = true;\n } else {\n isTex = _(props.answerForms).any((form) => {\n const {value} = form;\n // only TeX has backslashes and curly braces\n return (\n _.indexOf(value, \"\\\\\") !== -1 ||\n _.indexOf(value, \"{\") !== -1\n );\n });\n }\n\n this.state = {isTex};\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n const answerOptions = this.props.answerForms\n .map((obj, index) => {\n const expressionProps = {\n // note we're using\n // *this.props*.{times,functions,buttonSets} since each\n // answer area has the same settings for those\n times: this.props.times,\n functions: this.props.functions,\n buttonSets: this.props.buttonSets,\n\n buttonsVisible: \"focused\",\n form: obj.form,\n simplify: obj.simplify,\n value: obj.value,\n\n onChange: (props) => this.updateForm(index, props),\n trackInteraction: () => {},\n\n widgetId: this.props.widgetId + \"-\" + index,\n };\n\n return lens(obj)\n .merge([], {\n draggable: true,\n onChange: (props) => this.updateForm(index, props),\n onDelete: () => this.handleRemoveForm(index),\n expressionProps: expressionProps,\n })\n .freeze();\n })\n .map((obj, index) => <AnswerOption key={index} {...obj} />);\n\n const sortable = (\n <SortableArea\n components={answerOptions}\n onReorder={this.handleReorder}\n className=\"answer-options-list\"\n />\n );\n\n // checkboxes to choose which sets of input buttons are shown\n const buttonSetChoices = _(TexButtons.buttonSets).map((set, name) => {\n // The first one gets special cased to always be checked, disabled,\n // and float left.\n const isFirst = name === \"basic\";\n const checked = _.contains(this.props.buttonSets, name) || isFirst;\n const className = isFirst\n ? \"button-set-label-float\"\n : \"button-set-label\";\n return (\n <label className={className} key={name}>\n <input\n type=\"checkbox\"\n checked={checked}\n disabled={isFirst}\n onChange={() => this.handleButtonSet(name)}\n />\n {name}\n </label>\n );\n });\n\n const {TeX} = getDependencies(); // OldExpression only\n\n buttonSetChoices.splice(\n 1,\n 1,\n <label key=\"show-div\">\n <input type=\"checkbox\" onChange={this.handleToggleDiv} />\n <span className=\"show-div-button\">\n show <TeX>\\div</TeX> button\n </span>\n </label>,\n );\n\n return (\n <div className=\"perseus-widget-expression-editor\">\n <h3 className=\"expression-editor-h3\">Global Options</h3>\n\n <div>\n <PropCheckBox\n times={this.props.times}\n onChange={this.props.onChange}\n labelAlignment=\"right\"\n label=\"Use × for rendering multiplication instead of a\n center dot.\"\n />\n <InfoTip>\n <p>\n For pre-algebra problems this option displays\n multiplication as \\times instead of \\cdot in both\n the rendered output and the acceptable formats\n examples.\n </p>\n </InfoTip>\n </div>\n\n <div>\n <label>\n {\"Function variables: \"}\n <input\n type=\"text\"\n defaultValue={this.props.functions.join(\" \")}\n onChange={this.handleFunctions}\n />\n </label>\n <InfoTip>\n <p>\n Single-letter variables listed here will be\n interpreted as functions. This let us know that f(x)\n means \"f of x\" and not \"f times x\".\n </p>\n </InfoTip>\n </div>\n\n <div>\n <div>Button sets:</div>\n {buttonSetChoices}\n </div>\n\n {this.state.isTex && (\n <TexButtons\n className=\"math-input-buttons\"\n sets={this.props.buttonSets}\n convertDotToTimes={this.props.times}\n // onInsert is typed as `(string | ((input: $FlowFixMe) => void)) => void`\n // $FlowFixMe[incompatible-type]\n onInsert={this.handleTexInsert}\n />\n )}\n\n <h3 className=\"expression-editor-h3\">Answers</h3>\n\n <p style={{margin: \"4px 0\"}}>\n student responses area matched against these from top to\n bottom\n </p>\n\n {sortable}\n\n <div>\n <button\n className=\"simple-button orange\"\n style={{fontSize: 13}}\n onClick={this.newAnswer}\n type=\"button\"\n >\n Add new answer\n </button>\n </div>\n </div>\n );\n }\n\n serialize: () => $FlowFixMe = () => {\n const formSerializables = [\n \"value\",\n \"form\",\n \"simplify\",\n \"considered\",\n // it's a little weird to serialize the react key, but saves some\n // effort reconstructing them when this item is loaded later.\n \"key\",\n ];\n const serializables = [\n \"answerForms\",\n \"buttonSets\",\n \"functions\",\n \"times\",\n ];\n\n const answerForms = this.props.answerForms.map((form) => {\n return _(form).pick(formSerializables);\n });\n\n return lens(this.props)\n .set([\"answerForms\"], answerForms)\n .mod([], (props) => _(props).pick(serializables))\n .freeze();\n };\n\n getSaveWarnings: () => $FlowFixMe = () => {\n const issues = [];\n\n if (this.props.answerForms.length === 0) {\n issues.push(\"No answers specified\");\n } else {\n const hasCorrect = !!_(this.props.answerForms).find((form) => {\n return form.considered === \"correct\";\n });\n if (!hasCorrect) {\n issues.push(\"No correct answer specified\");\n }\n\n _(this.props.answerForms).each((form, ix) => {\n if (this.props.value === \"\") {\n issues.push(`Answer ${ix + 1} is empty`);\n } else {\n // note we're not using icu for content creators\n const expression = KAS.parse(form.value, {\n functions: this.props.functions,\n });\n if (!expression.parsed) {\n issues.push(`Couldn't parse ${form.value}`);\n } else if (\n form.simplify &&\n !expression.expr.isSimplified()\n ) {\n issues.push(\n `${form.value} isn't simplified, but is required\" +\n \" to be`,\n );\n }\n }\n });\n\n // TODO(joel) - warn about:\n // - unreachable answers (how??)\n // - specific answers following unspecific answers\n // - incorrect answers as the final form\n }\n\n return issues;\n };\n\n _newEmptyAnswerForm: () => $FlowFixMe = () => {\n return {\n considered: \"correct\",\n form: false,\n\n // note: the key means \"n-th form created\" - not \"form in\n // position n\" and will stay the same for the life of this form\n key: _makeNewKey(this.props.answerForms),\n\n simplify: false,\n value: \"\",\n };\n };\n\n newAnswer: () => void = () => {\n const answerForms = this.props.answerForms.slice();\n answerForms.push(this._newEmptyAnswerForm());\n this.change({answerForms});\n };\n\n handleRemoveForm: (number) => void = (i) => {\n const answerForms = this.props.answerForms.slice();\n answerForms.splice(i, 1);\n this.change({answerForms});\n };\n\n // called when the options (including the expression itself) to an answer\n // form change\n updateForm: (number, $FlowFixMe) => void = (i, props) => {\n const answerForms = lens(this.props.answerForms)\n .merge([i], props)\n .freeze();\n\n this.change({answerForms});\n };\n\n handleReorder: ($FlowFixMe) => void = (components) => {\n const answerForms = _(components).map((component) => {\n const form = _(component.props).pick(\n \"considered\",\n \"form\",\n \"simplify\",\n \"value\",\n );\n form.key = component.key;\n return form;\n });\n\n this.change({answerForms});\n };\n\n // called when the selected buttonset changes\n handleButtonSet: (string) => void = (changingName) => {\n const buttonSetNames = _(TexButtons.buttonSets).keys();\n\n // Filter to preserve order - using .union and .difference would always\n // move the last added button set to the end.\n const buttonSets = _(buttonSetNames).filter((set) => {\n return (\n _(this.props.buttonSets).contains(set) !==\n (set === changingName)\n );\n });\n\n this.props.onChange({buttonSets});\n };\n\n handleToggleDiv: () => void = () => {\n // We always want buttonSets to contain exactly one of \"basic\" and\n // \"basic+div\". Toggle between the two of them.\n // If someone can think of a more elegant formulation of this (there\n // must be one!) feel free to change it.\n let keep, remove;\n if (_(this.props.buttonSets).contains(\"basic+div\")) {\n keep = \"basic\";\n remove = \"basic+div\";\n } else {\n keep = \"basic+div\";\n remove = \"basic\";\n }\n\n const buttonSets = _(this.props.buttonSets)\n .reject((set) => set === remove)\n .concat(keep);\n\n this.change(\"buttonSets\", buttonSets);\n };\n\n // called when the correct answer changes\n handleTexInsert: (string) => void = (str) => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.expression.insert(str);\n };\n\n // called when the function variables change\n handleFunctions: (SyntheticInputEvent<>) => void = (e) => {\n const newProps = {};\n newProps.functions = _.compact(e.target.value.split(/[ ,]+/));\n this.props.onChange(newProps);\n };\n}\n\n// Find the next element in arr after val, wrapping around to the first.\nconst findNextIn = function (arr, val) {\n let ix = _(arr).indexOf(val);\n ix = (ix + 1) % arr.length;\n return arr[ix];\n};\n\nclass AnswerOption extends React.Component<$FlowFixMe, $FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n considered: PropTypes.oneOf(CONSIDERED).isRequired,\n expressionProps: PropTypes.object.isRequired,\n\n // Must the answer have the same form as this answer.\n form: PropTypes.bool.isRequired,\n\n // Must the answer be simplified.\n simplify: PropTypes.bool.isRequired,\n\n onChange: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n };\n\n state: $FlowFixMe = {deleteFocused: false};\n\n handleDeleteBlur = () => {\n this.setState({deleteFocused: false});\n };\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n let removeButton = null;\n if (this.state.deleteFocused) {\n removeButton = (\n <button\n type=\"button\"\n className=\"simple-button orange\"\n onClick={this.handleImSure}\n onBlur={this.handleDeleteBlur}\n >\n I'm sure!\n </button>\n );\n } else {\n removeButton = (\n <button\n type=\"button\"\n className=\"simple-button orange\"\n onClick={this.handleDelete}\n >\n Delete\n </button>\n );\n }\n\n return (\n <div className=\"expression-answer-option\">\n <div className=\"answer-handle\" />\n\n <div className=\"answer-body\">\n <div className=\"answer-considered\">\n <div\n onClick={this.toggleConsidered}\n className={\"answer-status \" + this.props.considered}\n >\n {this.props.considered}\n </div>\n\n <div className=\"answer-expression\">\n <Expression {...this.props.expressionProps} />\n </div>\n </div>\n\n <div className=\"answer-option\">\n <PropCheckBox\n form={this.props.form}\n onChange={this.props.onChange}\n labelAlignment=\"right\"\n label=\"Answer expression must have the same form.\"\n />\n <InfoTip>\n <p>\n The student's answer must be in the same form.\n Commutativity and excess negative signs are\n ignored.\n </p>\n </InfoTip>\n </div>\n\n <div className=\"answer-option\">\n <PropCheckBox\n simplify={this.props.simplify}\n onChange={this.props.onChange}\n labelAlignment=\"right\"\n label=\"Answer expression must be fully expanded and\n simplified.\"\n />\n <InfoTip>\n <p>\n The student's answer must be fully expanded and\n simplified. Answering this equation (x^2+2x+1)\n with this factored equation (x+1)^2 will render\n this response \"Your answer is not fully expanded\n and simplified.\"\n </p>\n </InfoTip>\n </div>\n\n <div className=\"remove-container\">{removeButton}</div>\n </div>\n </div>\n );\n }\n\n handleImSure = () => {\n this.props.onDelete();\n };\n\n handleDelete = () => {\n this.setState({deleteFocused: true});\n };\n\n toggleConsidered = () => {\n const newVal = findNextIn(CONSIDERED, this.props.considered);\n this.change({considered: newVal});\n };\n}\n\nexport default ExpressionEditor;\n","/* eslint-disable react/forbid-prop-types, react/sort-comp */\n// @flow\nimport {components, icons, ApiOptions, Changeable} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {InlineIcon, TextInput} = components;\nconst {iconPlus, iconTrash} = icons;\n\ntype Props = $FlowFixMe;\n\nclass GradedGroupEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n title: PropTypes.string,\n content: PropTypes.string,\n widgets: PropTypes.object,\n images: PropTypes.object,\n apiOptions: ApiOptions.propTypes,\n };\n\n static widgetName: \"graded-group\" = \"graded-group\";\n\n static defaultProps: Props = {\n title: \"\",\n content: \"\",\n widgets: {},\n images: {},\n hint: null,\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n handleAddHint: () => void = () => {\n const hint = {content: \"\"};\n this.props.onChange({hint}, () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"hint-editor\"].focus();\n });\n };\n\n handleRemoveHint: (SyntheticMouseEvent<>) => void = (e) => {\n this.props.onChange({hint: null});\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-group-editor\">\n <div className=\"perseus-widget-row\">\n <label className={css(styles.title)}>\n Title:{\" \"}\n <TextInput\n value={this.props.title}\n className={css(styles.input)}\n onChange={this.change(\"title\")}\n />\n </label>\n </div>\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"editor\"\n content={this.props.content}\n widgets={this.props.widgets}\n apiOptions={this.props.apiOptions}\n images={this.props.images}\n widgetEnabled={true}\n immutableWidgets={false}\n onChange={this.props.onChange}\n warnNoPrompt={true}\n warnNoWidgets={true}\n />\n {!this.props.hint && (\n <button\n type=\"button\"\n style={{marginTop: 10}}\n className=\"add-hint simple-button orange\"\n onClick={this.handleAddHint}\n >\n <InlineIcon {...iconPlus} /> Add a hint\n </button>\n )}\n {this.props.hint && (\n <div className=\"perseus-hint-editor\">\n <div className={css(styles.hintsTitle)}>Hint</div>\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"hint-editor\"\n content={\n this.props.hint ? this.props.hint.content : \"\"\n }\n widgets={\n this.props.hint ? this.props.hint.widgets : {}\n }\n apiOptions={this.props.apiOptions}\n images={this.props.hint && this.props.hint.images}\n widgetEnabled={true}\n immutableWidgets={false}\n onChange={(props) => {\n // Copy all props over from the existing hint\n // and then add new props.\n this.change(\n \"hint\",\n Object.assign({}, this.props.hint, props),\n );\n }}\n />\n <button\n type=\"button\"\n className=\"remove-hint simple-button orange\"\n onClick={this.handleRemoveHint}\n >\n <InlineIcon {...iconTrash} /> Remove this hint\n </button>\n </div>\n )}\n </div>\n );\n }\n\n getSaveWarnings: () => $FlowFixMe = () => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.getSaveWarnings();\n };\n\n serialize: () => {|title: string, hint: ?$FlowFixMe|} = () => {\n return {\n title: this.props.title,\n // eslint-disable-next-line react/no-string-refs\n ...this.refs.editor.serialize(),\n hint:\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"hint-editor\"] &&\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"hint-editor\"].serialize(),\n };\n };\n}\n\nconst styles = StyleSheet.create({\n title: {\n fontSize: 18,\n fontWeight: \"bold\",\n },\n\n input: {\n fontSize: 18,\n },\n\n hintsTitle: {\n marginTop: 10,\n fontSize: \"110%\",\n fontWeight: \"bold\",\n },\n});\n\nexport default GradedGroupEditor;\n","/* eslint-disable react/forbid-prop-types, react/no-unsafe */\n// @flow\nimport {ApiOptions, Changeable} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport GradedGroupEditor from \"./graded-group-editor.jsx\";\n\ntype Props = $FlowFixMe;\n\nclass GradedGroupSetEditor extends React.Component<Props> {\n // eslint-disable-next-line flowtype/no-mutable-array\n _editors: Array<$FlowFixMe>;\n\n static propTypes = {\n ...Changeable.propTypes,\n apiOptions: ApiOptions.propTypes,\n gradedGroups: PropTypes.array,\n onChange: PropTypes.func.isRequired,\n };\n\n static widgetName: \"graded-group-set\" = \"graded-group-set\";\n\n static defaultProps: Props = {\n gradedGroups: [],\n };\n\n // TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`\n UNSAFE_componentWillMount() {\n this._editors = [];\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n getSaveWarnings: () => $ReadOnlyArray<$FlowFixMe> = () => {\n return [].concat(\n ...this._editors.map((editor) =>\n editor ? editor.getSaveWarnings() : [],\n ),\n );\n };\n\n serialize: () => {|gradedGroups: $FlowFixMe|} = () => {\n return {\n gradedGroups: this.props.gradedGroups,\n };\n };\n\n renderGroups: () => React.Node = () => {\n if (!this.props.gradedGroups) {\n return null;\n }\n return this.props.gradedGroups.map((group, i) => (\n <GradedGroupEditor\n key={i}\n ref={(el) => (this._editors[i] = el)}\n {...group}\n apiOptions={this.props.apiOptions}\n widgetEnabled={true}\n immutableWidgets={false}\n onChange={(data) =>\n this.change(\n \"gradedGroups\",\n setArrayItem(this.props.gradedGroups, i, {\n ...this.props.gradedGroups[i],\n ...data,\n }),\n )\n }\n />\n ));\n };\n\n addGroup: () => void = () => {\n const groups = this.props.gradedGroups || [];\n this.change(\n \"gradedGroups\",\n groups.concat([GradedGroupEditor.defaultProps]),\n );\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-group-editor\">\n {this.renderGroups()}\n <button onClick={this.addGroup}>Add group</button>\n </div>\n );\n }\n}\n\nconst setArrayItem = (list, i, value) => [\n ...list.slice(0, i),\n value,\n ...list.slice(i + 1),\n];\n\nexport default GradedGroupSetEditor;\n","/* eslint-disable react/forbid-prop-types, react/no-unsafe */\n// @flow\nimport {\n components,\n interactiveSizes,\n Changeable,\n Dependencies,\n KhanMath,\n Util,\n} from \"@khanacademy/perseus\";\nimport createReactClass from \"create-react-class\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport _ from \"underscore\";\n\nconst {ButtonGroup, InfoTip, PropCheckBox, RangeInput} = components;\nconst {getDependencies} = Dependencies;\n\nconst defaultBackgroundImage = {\n url: null,\n width: 0,\n height: 0,\n};\n\nfunction numSteps(range, step) {\n return Math.floor((range[1] - range[0]) / step);\n}\n\n// $FlowFixMe[signature-verification-failure]\nconst GraphSettings = createReactClass({\n displayName: \"GraphSettings\",\n\n propTypes: {\n ...Changeable.propTypes,\n editableSettings: PropTypes.arrayOf(\n PropTypes.oneOf([\"canvas\", \"graph\", \"snap\", \"image\", \"measure\"]),\n ),\n box: PropTypes.arrayOf(PropTypes.number),\n labels: PropTypes.arrayOf(PropTypes.string),\n range: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),\n step: PropTypes.arrayOf(PropTypes.number),\n gridStep: PropTypes.arrayOf(PropTypes.number),\n snapStep: PropTypes.arrayOf(PropTypes.number),\n valid: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n backgroundImage: PropTypes.object,\n markings: PropTypes.oneOf([\"graph\", \"grid\", \"none\"]),\n showProtractor: PropTypes.bool,\n showRuler: PropTypes.bool,\n showTooltips: PropTypes.bool,\n rulerLabel: PropTypes.string,\n rulerTicks: PropTypes.number,\n },\n\n getDefaultProps: function () {\n return {\n editableSettings: [\"graph\", \"snap\", \"image\", \"measure\"],\n box: [\n interactiveSizes.defaultBoxSizeSmall,\n interactiveSizes.defaultBoxSizeSmall,\n ],\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n gridStep: [1, 1],\n snapStep: [1, 1],\n valid: true,\n backgroundImage: defaultBackgroundImage,\n markings: \"graph\",\n showProtractor: false,\n showRuler: false,\n showTooltips: false,\n rulerLabel: \"\",\n rulerTicks: 10,\n };\n },\n\n getInitialState: function () {\n return this.stateFromProps(this.props);\n },\n\n componentDidMount: function () {\n // TODO(scottgrant): This is a hack to remove the deprecated call to\n // this.isMounted() but is still considered an anti-pattern.\n this._isMounted = true;\n\n this.changeGraph = _.debounce(this.changeGraph, 300);\n },\n\n UNSAFE_componentWillReceiveProps: function (nextProps) {\n // Make sure that state updates when switching\n // between different items in a multi-item editor.\n if (\n !_.isEqual(this.props.labels, nextProps.labels) ||\n !_.isEqual(this.props.gridStep, nextProps.gridStep) ||\n !_.isEqual(this.props.snapStep, nextProps.snapStep) ||\n !_.isEqual(this.props.step, nextProps.step) ||\n !_.isEqual(this.props.range, nextProps.range) ||\n !_.isEqual(this.props.backgroundImage, nextProps.backgroundImage)\n ) {\n this.setState(this.stateFromProps(nextProps));\n }\n },\n\n componentWillUnmount: function () {\n this._isMounted = false;\n },\n\n stateFromProps: function (props) {\n return {\n labelsTextbox: props.labels,\n gridStepTextbox: props.gridStep,\n snapStepTextbox: props.snapStep,\n stepTextbox: props.step,\n rangeTextbox: props.range,\n backgroundImage: _.clone(props.backgroundImage),\n };\n },\n\n change(...args) {\n // $FlowFixMe[object-this-reference]\n return Changeable.change.apply(this, args);\n },\n\n // TODO(aria): Make either a wrapper for standard events to work\n // with this.change, or make these use some TextInput/NumberInput box\n changeRulerLabel: function (e) {\n this.change({rulerLabel: e.target.value});\n },\n\n changeRulerTicks: function (e) {\n this.change({rulerTicks: +e.target.value});\n },\n\n changeBackgroundUrl: function (e) {\n // Only continue on blur or \"enter\"\n if (e.type === \"keypress\" && e.key !== \"Enter\") {\n return;\n }\n\n const setUrl = (url, width, height) => {\n const image = _.clone(this.props.backgroundImage);\n image.url = url;\n image.width = width;\n image.height = height;\n this.setState(\n {\n backgroundImage: image,\n },\n this.changeGraph,\n );\n };\n\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n const url = ReactDOM.findDOMNode(this.refs[\"bg-url\"]).value; // eslint-disable-line react/no-string-refs\n if (url) {\n Util.getImageSize(url, (width, height) => {\n if (this._isMounted) {\n setUrl(url, width, height);\n }\n });\n } else {\n setUrl(null, 0, 0);\n }\n },\n\n renderLabelChoices: function (choices) {\n return _.map(choices, function (nameAndValue) {\n return <option value={nameAndValue[1]}>{nameAndValue[0]}</option>;\n });\n },\n\n validRange: function (range) {\n const numbers = _.every(range, function (num) {\n return _.isFinite(num);\n });\n if (!numbers) {\n return \"Range must be a valid number\";\n }\n if (range[0] >= range[1]) {\n return \"Range must have a higher number on the right\";\n }\n return true;\n },\n\n validateStepValue: function (settings) {\n const {step, range, name, minTicks, maxTicks} = settings;\n\n if (!_.isFinite(step)) {\n return name + \" must be a valid number\";\n }\n const nSteps = numSteps(range, step);\n if (nSteps < minTicks) {\n return (\n name +\n \" is too large, there must be at least \" +\n minTicks +\n \" ticks.\"\n );\n }\n if (nSteps > maxTicks) {\n return (\n name +\n \" is too small, there can be at most \" +\n maxTicks +\n \" ticks.\"\n );\n }\n return true;\n },\n\n validSnapStep: function (step, range) {\n return this.validateStepValue({\n step: step,\n range: range,\n name: \"Snap step\",\n minTicks: 5,\n maxTicks: 60,\n });\n },\n\n validGridStep: function (step, range) {\n return this.validateStepValue({\n step: step,\n range: range,\n name: \"Grid step\",\n minTicks: 3,\n maxTicks: 60,\n });\n },\n\n validStep: function (step, range) {\n return this.validateStepValue({\n step: step,\n range: range,\n name: \"Step\",\n minTicks: 3,\n maxTicks: 20,\n });\n },\n\n validBackgroundImageSize: function (image) {\n // Ignore empty images\n if (!image.url) {\n return true;\n }\n\n const validSize = image.width <= 450 && image.height <= 450;\n\n if (!validSize) {\n return \"Image must be smaller than 450px x 450px.\";\n }\n return true;\n },\n\n validateGraphSettings: function (range, step, gridStep, snapStep, image) {\n const self = this;\n let msg;\n const goodRange = _.every(range, function (range) {\n msg = self.validRange(range);\n return msg === true;\n });\n if (!goodRange) {\n return msg;\n }\n const goodStep = _.every(step, function (step, i) {\n msg = self.validStep(step, range[i]);\n return msg === true;\n });\n if (!goodStep) {\n return msg;\n }\n const goodGridStep = _.every(gridStep, function (gridStep, i) {\n msg = self.validGridStep(gridStep, range[i]);\n return msg === true;\n });\n if (!goodGridStep) {\n return msg;\n }\n const goodSnapStep = _.every(snapStep, function (snapStep, i) {\n msg = self.validSnapStep(snapStep, range[i]);\n return msg === true;\n });\n if (!goodSnapStep) {\n return msg;\n }\n const goodImageSize = this.validBackgroundImageSize(image);\n if (goodImageSize !== true) {\n msg = goodImageSize;\n return msg;\n }\n return true;\n },\n\n changeLabel: function (i, e) {\n const val = e.target.value;\n const labels = this.state.labelsTextbox.slice();\n labels[i] = val;\n this.setState({labelsTextbox: labels}, this.changeGraph);\n },\n\n changeRange: function (i, values) {\n const ranges = this.state.rangeTextbox.slice();\n ranges[i] = values;\n const step = this.state.stepTextbox.slice();\n const gridStep = this.state.gridStepTextbox.slice();\n const snapStep = this.state.snapStepTextbox.slice();\n const scale = Util.scaleFromExtent(ranges[i], this.props.box[i]);\n if (this.validRange(ranges[i]) === true) {\n step[i] = Util.tickStepFromExtent(ranges[i], this.props.box[i]);\n gridStep[i] = Util.gridStepFromTickStep(step[i], scale);\n snapStep[i] = gridStep[i] / 2;\n }\n this.setState(\n {\n stepTextbox: step,\n gridStepTextbox: gridStep,\n snapStepTextbox: snapStep,\n rangeTextbox: ranges,\n },\n this.changeGraph,\n );\n },\n\n changeStep: function (step) {\n this.setState({stepTextbox: step}, this.changeGraph);\n },\n\n changeSnapStep: function (snapStep) {\n this.setState({snapStepTextbox: snapStep}, this.changeGraph);\n },\n\n changeGridStep: function (gridStep) {\n this.setState(\n {\n gridStepTextbox: gridStep,\n snapStepTextbox: _.map(gridStep, function (step) {\n return step / 2;\n }),\n },\n this.changeGraph,\n );\n },\n\n changeGraph: function () {\n const labels = this.state.labelsTextbox;\n const range = _.map(this.state.rangeTextbox, function (range) {\n return _.map(range, Number);\n });\n const step = _.map(this.state.stepTextbox, Number);\n const gridStep = this.state.gridStepTextbox;\n const snapStep = this.state.snapStepTextbox;\n const image = this.state.backgroundImage;\n\n // validationResult is either:\n // true -> the settings are valid\n // a string -> the settings are invalid, and the explanation\n // is contained in the string\n // TODO(aria): Refactor this to not be confusing\n const validationResult = this.validateGraphSettings(\n range,\n step,\n gridStep,\n snapStep,\n image,\n );\n\n if (validationResult === true) {\n // either true or a string\n this.change({\n valid: true,\n labels: labels,\n range: range,\n step: step,\n gridStep: gridStep,\n snapStep: snapStep,\n backgroundImage: image,\n });\n } else {\n this.change({\n valid: validationResult, // a string message, not false\n });\n }\n },\n\n render: function () {\n const scale = [\n KhanMath.roundTo(\n 2,\n Util.scaleFromExtent(this.props.range[0], this.props.box[0]),\n ),\n KhanMath.roundTo(\n 2,\n Util.scaleFromExtent(this.props.range[1], this.props.box[1]),\n ),\n ];\n\n const {TeX} = getDependencies();\n\n return (\n <div>\n {_.contains(this.props.editableSettings, \"canvas\") && (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n Canvas size (x,y pixels)\n <RangeInput\n value={this.props.box}\n onChange={(box) => {\n this.change({box: box});\n }}\n />\n </div>\n <div className=\"perseus-widget-row\">\n Scale (px per div):{\" \"}\n <TeX>{\"(\" + scale[0] + \", \" + scale[1] + \")\"}</TeX>\n </div>\n </div>\n )}\n\n {_.contains(this.props.editableSettings, \"graph\") && (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n {\" \"}\n x Label\n <input\n type=\"text\"\n className=\"graph-settings-axis-label\"\n // eslint-disable-next-line react/no-string-refs\n ref=\"labels-0\"\n onChange={(e) => this.changeLabel(0, e)}\n value={this.state.labelsTextbox[0] || \"\"}\n />\n </div>\n <div className=\"perseus-widget-right-col\">\n y Label\n <input\n type=\"text\"\n className=\"graph-settings-axis-label\"\n // eslint-disable-next-line react/no-string-refs\n ref=\"labels-1\"\n onChange={(e) => this.changeLabel(1, e)}\n value={this.state.labelsTextbox[1] || \"\"}\n />\n </div>\n </div>\n\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n x Range\n <RangeInput\n value={this.state.rangeTextbox[0]}\n onChange={(vals) =>\n this.changeRange(0, vals)\n }\n />\n </div>\n <div className=\"perseus-widget-right-col\">\n y Range\n <RangeInput\n value={this.state.rangeTextbox[1]}\n onChange={(vals) =>\n this.changeRange(1, vals)\n }\n />\n </div>\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n Tick Step\n <RangeInput\n value={this.state.stepTextbox}\n onChange={this.changeStep}\n />\n </div>\n <div className=\"perseus-widget-right-col\">\n Grid Step\n <RangeInput\n value={this.state.gridStepTextbox}\n onChange={this.changeGridStep}\n />\n </div>\n </div>\n {_.contains(this.props.editableSettings, \"snap\") && (\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n Snap Step\n <RangeInput\n value={this.state.snapStepTextbox}\n onChange={this.changeSnapStep}\n />\n </div>\n </div>\n )}\n <div className=\"perseus-widget-row\">\n <label>Markings: </label>\n <ButtonGroup\n value={this.props.markings}\n allowEmpty={false}\n buttons={[\n {value: \"graph\", content: \"Graph\"},\n {value: \"grid\", content: \"Grid\"},\n {value: \"none\", content: \"None\"},\n ]}\n onChange={this.change(\"markings\")}\n />\n </div>\n <div className=\"perseus-widget-left-col\">\n <PropCheckBox\n label=\"Show tooltips\"\n showTooltips={this.props.showTooltips}\n onChange={this.change}\n />\n </div>\n </div>\n )}\n\n {_.contains(this.props.editableSettings, \"image\") && (\n <div className=\"image-settings\">\n <div>Background image:</div>\n <div>\n Url:{\" \"}\n <input\n type=\"text\"\n className=\"graph-settings-background-url\"\n // eslint-disable-next-line react/no-string-refs\n ref=\"bg-url\"\n value={this.state.backgroundImage.url || \"\"}\n onChange={(e) => {\n const image = _.clone(\n this.props.backgroundImage,\n );\n image.url = e.target.value;\n this.setState({backgroundImage: image});\n }}\n onKeyPress={this.changeBackgroundUrl}\n onBlur={this.changeBackgroundUrl}\n />\n <InfoTip>\n <p>\n Create an image in graphie, or use the \"Add\n image\" function to create a background.\n </p>\n </InfoTip>\n </div>\n </div>\n )}\n\n {_.contains(this.props.editableSettings, \"measure\") && (\n <div className=\"misc-settings\">\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n <PropCheckBox\n label=\"Show ruler\"\n showRuler={this.props.showRuler}\n onChange={this.change}\n />\n </div>\n <div className=\"perseus-widget-right-col\">\n <PropCheckBox\n label=\"Show protractor\"\n showProtractor={this.props.showProtractor}\n onChange={this.change}\n />\n </div>\n </div>\n {this.props.showRuler && (\n <div>\n <div>\n <label>\n {\" \"}\n Ruler label:{\" \"}\n <select\n onChange={this.changeRulerLabel}\n value={this.props.rulerLabel}\n >\n <option value=\"\">None</option>\n <optgroup label=\"Metric\">\n {this.renderLabelChoices([\n [\"milimeters\", \"mm\"],\n [\"centimeters\", \"cm\"],\n [\"meters\", \"m\"],\n [\"kilometers\", \"km\"],\n ])}\n </optgroup>\n <optgroup label=\"Imperial\">\n {this.renderLabelChoices([\n [\"inches\", \"in\"],\n [\"feet\", \"ft\"],\n [\"yards\", \"yd\"],\n [\"miles\", \"mi\"],\n ])}\n </optgroup>\n </select>\n </label>\n </div>\n <div>\n <label>\n {\" \"}\n Ruler ticks:{\" \"}\n <select\n onChange={this.changeRulerTicks}\n value={this.props.rulerTicks}\n >\n {_.map(\n [1, 2, 4, 8, 10, 16],\n function (n) {\n return (\n <option value={n}>\n {n}\n </option>\n );\n },\n )}\n </select>\n </label>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n },\n});\n\nexport default GraphSettings;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {\n components,\n Changeable,\n GrapherUtil,\n GrapherWidget,\n SizingUtils,\n} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport GraphSettings from \"../components/graph-settings.jsx\";\n\nconst {InfoTip, MultiButtonGroup} = components;\nconst {containerSizeClass, getInteractiveBoxFromSizeClass} = SizingUtils;\nconst Grapher = GrapherWidget.widget;\nconst {\n DEFAULT_GRAPHER_PROPS,\n allTypes,\n chooseType,\n defaultPlotProps,\n getEquationString,\n typeToButton,\n} = GrapherUtil;\n\ntype Props = $FlowFixMe;\n\nclass GrapherEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n };\n\n static widgetName: \"grapher\" = \"grapher\";\n\n static defaultProps: Props = {\n correct: DEFAULT_GRAPHER_PROPS.plot,\n graph: DEFAULT_GRAPHER_PROPS.graph,\n availableTypes: DEFAULT_GRAPHER_PROPS.availableTypes,\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n const sizeClass = containerSizeClass.SMALL;\n let equationString;\n let graph;\n if (this.props.graph.valid === true) {\n const graphProps = {\n graph: this.props.graph,\n plot: this.props.correct,\n availableTypes: this.props.availableTypes,\n onChange: (newProps, cb) => {\n let correct = this.props.correct;\n if (correct.type === newProps.plot?.type) {\n correct = _.extend({}, correct, newProps.plot);\n } else {\n // Clear options from previous graph\n correct = newProps.plot;\n }\n this.props.onChange({correct: correct}, cb);\n },\n trackInteraction: function () {},\n };\n\n graph = (\n // NOTE(jeremy): This editor doesn't pass in a bunch of\n // standard props that the Renderer provides normally (eg.\n // alignment, findWidgets, etc).\n // $FlowFixMe[prop-missing]\n <Grapher\n {...graphProps}\n apiOptions={this.props.apiOptions}\n containerSizeClass={sizeClass}\n />\n );\n equationString = getEquationString(graphProps);\n } else {\n graph = (\n <div className=\"perseus-error\">{this.props.graph.valid}</div>\n );\n }\n\n return (\n <div>\n <div>\n Correct answer{\" \"}\n <InfoTip>\n <p>\n Graph the correct answer in the graph below and\n ensure the equation or point coordinates displayed\n represent the correct answer.\n </p>\n </InfoTip>{\" \"}\n : {equationString}\n </div>\n\n <GraphSettings\n editableSettings={[\"graph\", \"snap\", \"image\"]}\n box={getInteractiveBoxFromSizeClass(sizeClass)}\n range={this.props.graph.range}\n labels={this.props.graph.labels}\n step={this.props.graph.step}\n gridStep={this.props.graph.gridStep}\n snapStep={this.props.graph.snapStep}\n valid={this.props.graph.valid}\n backgroundImage={this.props.graph.backgroundImage}\n markings={this.props.graph.markings}\n rulerLabel={this.props.graph.rulerLabel}\n rulerTicks={this.props.graph.rulerTicks}\n showTooltips={this.props.graph.showTooltips}\n onChange={this.change(\"graph\")}\n />\n <div className=\"perseus-widget-row\">\n <label>Available functions: </label>\n <MultiButtonGroup\n allowEmpty={false}\n values={this.props.availableTypes}\n buttons={_.map(allTypes, typeToButton)}\n onChange={this.handleAvailableTypesChange}\n />\n </div>\n {graph}\n </div>\n );\n }\n\n handleAvailableTypesChange: ($FlowFixMe) => void = (newAvailableTypes) => {\n let correct = this.props.correct;\n\n // If the currently 'correct' type is removed from the list of types,\n // we need to change it to avoid impossible questions.\n if (!_.contains(newAvailableTypes, this.props.correct.type)) {\n const graph = this.props.graph;\n const newType = chooseType(newAvailableTypes);\n correct = defaultPlotProps(newType, graph);\n }\n this.props.onChange({\n availableTypes: newAvailableTypes,\n correct: correct,\n });\n };\n\n serialize: () => $FlowFixMe = () => {\n return _.chain(this.props)\n .pick(\"correct\", \"availableTypes\")\n .extend({graph: _.omit(this.props.graph, \"box\")})\n .value();\n };\n}\n\nexport default GrapherEditor;\n","/* eslint-disable react/forbid-prop-types, react/sort-comp */\n// @flow\nimport {ApiOptions, Changeable} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\ntype Props = $FlowFixMe;\n\nclass GroupEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n content: PropTypes.string,\n widgets: PropTypes.object,\n images: PropTypes.object,\n metadata: PropTypes.any,\n apiOptions: ApiOptions.propTypes,\n };\n\n static widgetName: \"group\" = \"group\";\n\n static defaultProps: Props = {\n content: \"\",\n widgets: {},\n images: {},\n // `undefined` instead of `null` so that getDefaultProps works for\n // `the GroupMetadataEditor`\n metadata: undefined,\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-group-editor\">\n <div>\n {/* the metadata editor; used for tags on\n khanacademy.org */}\n {this._renderMetadataEditor()}\n </div>\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"editor\"\n content={this.props.content}\n widgets={this.props.widgets}\n apiOptions={this.props.apiOptions}\n images={this.props.images}\n widgetEnabled={true}\n immutableWidgets={false}\n onChange={this.props.onChange}\n />\n </div>\n );\n }\n\n _renderMetadataEditor: () => React.Node = () => {\n const GroupMetadataEditor = this.props.apiOptions.GroupMetadataEditor;\n return (\n <GroupMetadataEditor\n value={this.props.metadata}\n onChange={this.change(\"metadata\")}\n />\n );\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n getSaveWarnings: () => $ReadOnlyArray<$FlowFixMe> = () => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs.editor.getSaveWarnings();\n };\n\n serialize: () => $FlowFixMe = () => {\n // eslint-disable-next-line react/no-string-refs\n return _.extend({}, this.refs.editor.serialize(), {\n metadata: this.props.metadata,\n });\n };\n}\n\nexport default GroupEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport BlurInput from \"../components/blur-input.jsx\";\n\nconst {PropCheckBox} = components;\n\ntype PairEditorProps = $FlowFixMe;\n\n/**\n * This is used for editing a name/value pair.\n */\nclass PairEditor extends React.Component<PairEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n name: PropTypes.string,\n value: PropTypes.string,\n };\n\n static defaultProps: PairEditorProps = {\n name: \"\",\n value: \"\",\n };\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n return (\n <fieldset>\n <label>\n Name:\n <BlurInput\n value={this.props.name}\n // $FlowFixMe[incompatible-type] single-param call returns a callback\n onChange={this.change(\"name\")}\n />\n </label>\n <label>\n Value:\n <BlurInput\n value={this.props.value}\n // $FlowFixMe[incompatible-type] single-param call returns a callback\n onChange={this.change(\"value\")}\n />\n </label>\n </fieldset>\n );\n }\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype PairsEditorProps = $FlowFixMe;\n\n/**\n * This is used for editing a set of name/value pairs.\n */\nclass PairsEditor extends React.Component<PairsEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n pairs: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string,\n }),\n ).isRequired,\n };\n\n render(): React.Node {\n const editors = _.map(this.props.pairs, (pair, i) => {\n return (\n <PairEditor\n key={i}\n name={pair.name}\n value={pair.value}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.handlePairChange.bind(this, i)}\n />\n );\n });\n return <div>{editors}</div>;\n }\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n handlePairChange = (pairIndex, pair) => {\n // If they're both non empty, add a new one\n const pairs = this.props.pairs.slice();\n pairs[pairIndex] = pair;\n\n const lastPair = pairs[pairs.length - 1];\n if (lastPair.name && lastPair.value) {\n pairs.push({name: \"\", value: \"\"});\n }\n this.change(\"pairs\", pairs);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype IframeEditorProps = $FlowFixMe;\n\n/**\n * This is the main editor for this widget, to specify all the options.\n */\nclass IframeEditor extends React.Component<IframeEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n };\n\n static widgetName: \"iframe\" = \"iframe\";\n\n static defaultProps: IframeEditorProps = {\n url: \"\",\n settings: [{name: \"\", value: \"\"}],\n width: \"400\",\n height: \"400\",\n allowFullScreen: false,\n allowTopNavigation: false,\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n return (\n <div>\n <div style={{fontWeight: \"bold\", textAlign: \"center\"}}>\n This widget is deprecated! <br />\n Try using the Video or CS Program widgets instead.\n </div>\n <label>\n Url or Program ID:\n <BlurInput\n value={this.props.url}\n onChange={this.change(\"url\")}\n />\n </label>\n <br />\n <label>\n Settings:\n <PairsEditor\n name=\"settings\"\n pairs={this.props.settings}\n onChange={this.handleSettingsChange}\n />\n </label>\n <br />\n <label>\n Width:\n <BlurInput\n value={this.props.width}\n onChange={this.change(\"width\")}\n />\n </label>\n <label>\n Height:\n <BlurInput\n value={this.props.height}\n onChange={this.change(\"height\")}\n />\n </label>\n <PropCheckBox\n label=\"Allow full screen\"\n allowFullScreen={this.props.allowFullScreen}\n onChange={this.props.onChange}\n />\n <br />\n <PropCheckBox\n label=\"Allow iframe content to redirect the page\"\n allowTopNavigation={this.props.allowTopNavigation}\n onChange={this.props.onChange}\n />\n </div>\n );\n }\n\n handleSettingsChange: ($FlowFixMe) => void = (settings) => {\n this.change({settings: settings.pairs});\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default IframeEditor;\n","/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */\n// @flow\nimport {\n components,\n icons,\n Changeable,\n EditorJsonify,\n Util,\n} from \"@khanacademy/perseus\";\nimport createReactClass from \"create-react-class\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport BlurInput from \"../components/blur-input.jsx\";\nimport Editor from \"../editor.jsx\";\n\nconst {InfoTip, InlineIcon, RangeInput} = components;\n\nconst defaultBoxSize = 400;\nconst defaultRange = [0, 10];\nconst defaultBackgroundImage = {\n url: null,\n width: 0,\n height: 0,\n};\n\n// Match any image URL (including \"web+graphie\" links) that is hosted by KA.\n// We're somewhat generous in our AWS URL matching\n// (\"ka-<something>.s3.amazonaws.com\") so that we don't have to update Perseus\n// every time we add a new proxied AWS bucket.\nconst INTERNALLY_HOSTED_DOMAINS =\n \"(\" +\n \"ka-.*.s3.amazonaws.com|\" +\n \"(fastly|cdn).kastatic.org|\" +\n \"khanacademy.org|\" +\n \"kasandbox.org\" +\n \")\";\nconst INTERNALLY_HOSTED_URL_RE = new RegExp(\n \"^(https?|web\\\\+graphie)://[^/]*\" + INTERNALLY_HOSTED_DOMAINS,\n);\n\n/**\n * Alignment option for captions, relative to specified coordinates.\n */\nconst captionAlignments = [\n \"center\",\n \"above\",\n \"above right\",\n \"right\",\n \"below right\",\n \"below\",\n \"below left\",\n \"left\",\n \"above left\",\n];\n\nconst ImageEditor: $FlowFixMe = createReactClass({\n displayName: \"ImageEditor\",\n\n propTypes: {\n ...Changeable.propTypes,\n },\n\n statics: {\n widgetName: \"image\",\n },\n\n componentDidMount: function () {\n // TODO(scottgrant): This is a hack to remove the deprecated call to\n // this.isMounted() but is still considered an anti-pattern.\n this._isMounted = true;\n },\n\n componentWillUnmount: function () {\n this._isMounted = false;\n },\n\n getDefaultProps: function () {\n return {\n title: \"\",\n range: [defaultRange, defaultRange],\n box: [defaultBoxSize, defaultBoxSize],\n backgroundImage: defaultBackgroundImage,\n labels: [],\n alt: \"\",\n caption: \"\",\n };\n },\n\n getInitialState: function () {\n return {\n backgroundImageError: \"\",\n };\n },\n\n render: function () {\n const backgroundImage = this.props.backgroundImage;\n\n const imageSettings = (\n <div className=\"image-settings\">\n <div>\n <label>\n <div>\n Alt text:\n <InfoTip>\n This is important for screenreaders. The content\n of this alt text will be formatted as markdown\n (tables, emphasis, etc. are supported).\n </InfoTip>\n </div>\n <Editor\n apiOptions={this.props.apiOptions}\n content={this.props.alt}\n onChange={(props) => {\n if (props.content != null) {\n this.change(\"alt\", props.content);\n }\n }}\n widgetEnabled={false}\n />\n </label>\n </div>\n <div>\n <label>\n <div>Caption:</div>\n <Editor\n apiOptions={this.props.apiOptions}\n content={this.props.caption}\n onChange={(props) => {\n if (props.content != null) {\n this.change(\"caption\", props.content);\n }\n }}\n widgetEnabled={false}\n />\n </label>\n </div>\n </div>\n );\n\n const backgroundImageErrorText = (\n <div className=\"renderer-widget-error\">\n {this.state.backgroundImageError}\n </div>\n );\n\n return (\n <div className=\"perseus-image-editor\">\n <label>\n Image url:\n <InfoTip>Paste an image or graphie image URL.</InfoTip>\n {this.state.backgroundImageError &&\n backgroundImageErrorText}\n <BlurInput\n value={backgroundImage.url || \"\"}\n style={{width: 332}}\n onChange={(url) => this.onUrlChange(url, false)}\n />\n </label>\n\n {backgroundImage.url && imageSettings}\n </div>\n );\n },\n\n _renderRowForLabel: function (label, i) {\n return (\n <tr key={i}>\n <td>\n <RangeInput\n value={label.coordinates}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onCoordinateChange.bind(this, i)}\n />\n </td>\n <td style={{verticalAlign: \"bottom\", width: \"5px\"}}>\n <input\n type=\"text\"\n className=\"graph-settings-axis-label\"\n value={label.content}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onContentChange.bind(this, i)}\n />\n </td>\n <td>\n <select\n className=\"perseus-widget-dropdown\"\n value={label.alignment}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onAlignmentChange.bind(this, i)}\n >\n {captionAlignments.map(function (alignment, i) {\n return (\n <option key={\"\" + i} value={alignment}>\n {alignment}\n </option>\n );\n }, this)}\n </select>\n </td>\n <td>\n <a\n href=\"#\"\n className=\"simple-button orange delete-label\"\n title=\"Remove this label\"\n // eslint-disable-next-line react/jsx-no-bind\n onClick={this.removeLabel.bind(this, i)}\n >\n <InlineIcon {...icons.iconTrash} />\n </a>\n </td>\n </tr>\n );\n },\n\n change(...args) {\n // $FlowFixMe[object-this-reference]\n return Changeable.change.apply(this, args);\n },\n\n removeLabel: function (labelIndex, e) {\n e.preventDefault();\n const labels = _(this.props.labels).clone();\n labels.splice(labelIndex, 1);\n this.props.onChange({labels: labels});\n },\n\n onCoordinateChange: function (labelIndex, newCoordinates) {\n const labels = this.props.labels.slice();\n labels[labelIndex] = _.extend({}, labels[labelIndex], {\n coordinates: newCoordinates,\n });\n this.props.onChange({labels: labels});\n },\n\n onContentChange: function (labelIndex, e) {\n const newContent = e.target.value;\n const labels = this.props.labels.slice();\n labels[labelIndex] = _.extend({}, labels[labelIndex], {\n content: newContent,\n });\n this.props.onChange({labels: labels});\n },\n\n onAlignmentChange: function (labelIndex, e) {\n const newAlignment = e.target.value;\n const labels = this.props.labels.slice();\n labels[labelIndex] = _.extend({}, labels[labelIndex], {\n alignment: newAlignment,\n });\n this.props.onChange({labels: labels});\n },\n\n setUrl: function (url, width, height, silent) {\n // Because this calls into WidgetEditor._handleWidgetChange, which\n // checks for this widget's ref to serialize it.\n //\n // Errors if you switch items before the `Image` from `onUrlChange`\n // loads.\n if (!this._isMounted) {\n return;\n }\n\n const image = _.clone(this.props.backgroundImage);\n image.url = url;\n image.width = width;\n image.height = height;\n const box = [image.width, image.height];\n this.props.onChange(\n {\n backgroundImage: image,\n box: box,\n },\n null,\n silent,\n );\n },\n\n // silently load the image when the component mounts\n // silently update url and sizes when the image loads\n // noisily load the image in response to the author changing it\n onUrlChange: function (url, silent) {\n // All article content must be KA-owned!\n if (!INTERNALLY_HOSTED_URL_RE.test(url)) {\n this.setState({\n backgroundImageError:\n \"Images must be from sites hosted by Khan Academy. \" +\n \"Please input a Khan Academy-owned address, or use the \" +\n \"Add Image tool to rehost an existing image\",\n });\n return;\n }\n this.setState({backgroundImageError: \"\"});\n\n // We update our background image prop after the image loads below. To\n // avoid weirdness when we change to a very slow URL, then a much\n // faster URL, we keep track of the URL we're trying to change to.\n this._leadingUrl = url;\n\n if (!url) {\n this.setUrl(url, 0, 0, silent);\n return;\n }\n\n Util.getImageSize(url, (width, height) => {\n if (this._leadingUrl !== url) {\n return;\n }\n\n this.setUrl(url, width, height, true);\n });\n },\n\n onRangeChange: function (type, newRange) {\n const range = this.props.range.slice();\n range[type] = newRange;\n this.props.onChange({range: range});\n },\n\n serialize() {\n // $FlowFixMe[object-this-reference]\n return EditorJsonify.serialize.call(this);\n },\n});\n\nexport default ImageEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {components, Util} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport _ from \"underscore\";\n\nimport BlurInput from \"../components/blur-input.jsx\";\n\nconst {InfoTip} = components;\n\nconst answerTypes = {\n number: {\n name: \"Numbers\",\n forms: \"integer, decimal, proper, improper, mixed\",\n },\n decimal: {\n name: \"Decimals\",\n forms: \"decimal\",\n },\n integer: {\n name: \"Integers\",\n forms: \"integer\",\n },\n rational: {\n name: \"Fractions and mixed numbers\",\n forms: \"integer, proper, improper, mixed\",\n },\n improper: {\n name: \"Improper numbers (no mixed)\",\n forms: \"integer, proper, improper\",\n },\n mixed: {\n name: \"Mixed numbers (no improper)\",\n forms: \"integer, proper, mixed\",\n },\n percent: {\n name: \"Numbers or percents\",\n forms: \"integer, decimal, proper, improper, mixed, percent\",\n },\n pi: {\n name: \"Numbers with pi\",\n forms: \"pi\",\n },\n};\n\ntype Props = $FlowFixMe;\n\nclass InputNumberEditor extends React.Component<Props> {\n static propTypes = {\n value: PropTypes.number,\n simplify: PropTypes.oneOf([\"required\", \"optional\", \"enforced\"]),\n size: PropTypes.oneOf([\"normal\", \"small\"]),\n inexact: PropTypes.bool,\n maxError: PropTypes.number,\n answerType: PropTypes.string,\n rightAlign: PropTypes.bool,\n };\n\n static widgetName: \"input-number\" = \"input-number\";\n\n static defaultProps: Props = {\n value: 0,\n simplify: \"required\",\n size: \"normal\",\n inexact: false,\n maxError: 0.1,\n answerType: \"number\",\n rightAlign: false,\n };\n\n handleAnswerChange: (string) => void = (str) => {\n const value = Util.firstNumericalParse(str) || 0;\n this.props.onChange({value: value});\n };\n\n render(): React.Node {\n const answerTypeOptions = _.map(\n answerTypes,\n function (v, k) {\n return (\n <option value={k} key={k}>\n {v.name}\n </option>\n );\n },\n this,\n );\n\n return (\n <div>\n <div>\n <label>\n Correct answer:{\" \"}\n <BlurInput\n value={\"\" + this.props.value}\n onChange={this.handleAnswerChange}\n // eslint-disable-next-line react/no-string-refs\n ref=\"input\"\n />\n </label>\n </div>\n\n <div>\n <label>\n Unsimplified answers{\" \"}\n <select\n value={this.props.simplify}\n onChange={(e) => {\n this.props.onChange({\n simplify: e.target.value,\n });\n }}\n >\n <option value=\"required\">will not be graded</option>\n <option value=\"optional\">will be accepted</option>\n <option value=\"enforced\">\n will be marked wrong\n </option>\n </select>\n </label>\n <InfoTip>\n <p>\n Normally select \"will not be graded\". This will give\n the user a message saying the answer is correct but\n not simplified. The user will then have to simplify\n it and re-enter, but will not be penalized. (5th\n grade and anything after)\n </p>\n <p>\n Select \"will be accepted\" only if the user is not\n expected to know how to simplify fractions yet.\n (Anything prior to 5th grade)\n </p>\n <p>\n Select \"will be marked wrong\" only if we are\n specifically assessing the ability to simplify.\n </p>\n </InfoTip>\n </div>\n\n <div>\n <label>\n <input\n type=\"checkbox\"\n checked={this.props.inexact}\n onChange={(e) => {\n this.props.onChange({\n inexact: e.target.checked,\n });\n }}\n />{\" \"}\n Allow inexact answers\n </label>\n\n <label>\n <input /* TODO(emily): don't use a hidden checkbox\n for alignment */\n type=\"checkbox\"\n style={{visibility: \"hidden\"}}\n />\n Max error:{\" \"}\n <input\n type=\"text\"\n disabled={!this.props.inexact}\n defaultValue={this.props.maxError}\n onBlur={(e) => {\n const ans =\n \"\" +\n // $FlowFixMe[incompatible-type]\n (Util.firstNumericalParse(e.target.value) ||\n 0);\n e.target.value = ans;\n this.props.onChange({maxError: ans});\n }}\n />\n </label>\n </div>\n\n <div>\n Answer type:{\" \"}\n <select\n value={this.props.answerType}\n onChange={(e) => {\n this.props.onChange({answerType: e.target.value});\n }}\n >\n {answerTypeOptions}\n </select>\n <InfoTip>\n <p>\n Use the default \"Numbers\" unless the answer must be\n in a specific form (e.g., question is about\n converting decimals to fractions).\n </p>\n </InfoTip>\n </div>\n\n <div>\n <label>\n Width{\" \"}\n <select\n value={this.props.size}\n onChange={(e) => {\n this.props.onChange({size: e.target.value});\n }}\n >\n <option value=\"normal\">Normal (80px)</option>\n <option value=\"small\">Small (40px)</option>\n </select>\n </label>\n <InfoTip>\n <p>\n Use size \"Normal\" for all text boxes, unless there\n are multiple text boxes in one line and the answer\n area is too narrow to fit them.\n </p>\n </InfoTip>\n </div>\n\n <div>\n <label>\n <input\n type=\"checkbox\"\n checked={this.props.rightAlign}\n onChange={(e) => {\n this.props.onChange({\n rightAlign: e.target.checked,\n });\n }}\n />{\" \"}\n Right alignment\n </label>\n </div>\n </div>\n );\n }\n\n focus: () => boolean = () => {\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n ReactDOM.findDOMNode(this.refs.input).focus(); // eslint-disable-line react/no-string-refs\n return true;\n };\n\n serialize: () => {|\n value: $FlowFixMe,\n simplify: $FlowFixMe,\n size: $FlowFixMe,\n inexact: $FlowFixMe,\n maxError: $FlowFixMe,\n answerType: $FlowFixMe,\n rightAlign: $FlowFixMe,\n |} = () => {\n return _.pick(\n this.props,\n \"value\",\n \"simplify\",\n \"size\",\n \"inexact\",\n \"maxError\",\n \"answerType\",\n \"rightAlign\",\n );\n };\n}\n\nexport default InputNumberEditor;\n","// @flow\nimport {components, Changeable, Dependencies} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\n\nconst {ButtonGroup, MathInput, NumberInput} = components;\n\ntype Props = {|\n ...Changeable.ChangeableProps,\n constraint: string,\n constraintFn: string,\n constraintXMax: string,\n constraintXMin: string,\n constraintYMax: string,\n constraintYMin: string,\n snap: number,\n|};\n\ntype DefaultProps = {|\n constraint: Props[\"constraint\"],\n constraintFn: Props[\"constraintFn\"],\n constraintXMax: Props[\"constraintXMax\"],\n constraintXMin: Props[\"constraintXMin\"],\n constraintYMax: Props[\"constraintYMax\"],\n constraintYMin: Props[\"constraintYMin\"],\n snap: Props[\"snap\"],\n|};\n\nclass ConstraintEditor extends React.Component<Props> {\n static defaultProps: DefaultProps = {\n constraint: \"none\",\n snap: 0.5,\n constraintFn: \"0\",\n constraintXMin: \"-10\",\n constraintXMax: \"10\",\n constraintYMin: \"-10\",\n constraintYMax: \"10\",\n };\n\n change: (\n propName: string,\n ) => (value: any, callback?: () => mixed) => mixed = (\n propName: string,\n ): ((value: any, callback?: () => mixed) => mixed) => {\n // $FlowFixMe[incompatible-return](WEB-1727): change is an overloaded function, but we aren't typing it as overloaded\n return Changeable.change.call(this, propName);\n };\n\n render(): React.Element<\"div\"> {\n const {TeX} = Dependencies.getDependencies();\n\n return (\n <div>\n <div className=\"perseus-widget-row\">\n Constraint:{\" \"}\n <ButtonGroup\n value={this.props.constraint}\n allowEmpty={false}\n buttons={[\n {value: \"none\", content: \"None\"},\n {value: \"snap\", content: \"Snap\"},\n {value: \"x\", content: \"x=\"},\n {value: \"y\", content: \"y=\"},\n ]}\n onChange={this.change(\"constraint\")}\n />\n </div>\n {this.props.constraint === \"snap\" && (\n <div className=\"perseus-widget-row\">\n Snap:{\" \"}\n <NumberInput\n value={this.props.snap}\n placeholder={0}\n onChange={this.change(\"snap\")}\n />\n </div>\n )}\n {this.props.constraint === \"x\" && (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n <TeX>x=</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.constraintFn}\n onChange={this.change(\"constraintFn\")}\n />\n </div>\n </div>\n )}\n {this.props.constraint === \"y\" && (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n <TeX>y=</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.constraintFn}\n onChange={this.change(\"constraintFn\")}\n />\n </div>\n </div>\n )}\n Ensure these are set so nothing can be dragged off the canvas:\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-row\">\n <TeX>x \\in \\Large[</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.constraintXMin}\n onChange={this.change(\"constraintXMin\")}\n />\n <TeX>, </TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.constraintXMax}\n onChange={this.change(\"constraintXMax\")}\n />{\" \"}\n <TeX>\\Large]</TeX>\n </div>\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-row\">\n <TeX>y \\in \\Large[</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.constraintYMin}\n onChange={this.change(\"constraintYMin\")}\n />\n <TeX>, </TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.constraintYMax}\n onChange={this.change(\"constraintYMax\")}\n />{\" \"}\n <TeX>\\Large]</TeX>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default ConstraintEditor;\n","/* eslint-disable @babel/no-invalid-this, react/no-unsafe, react/sort-comp */\n// @flow\nimport {\n components,\n Changeable,\n Dependencies,\n EditorJsonify,\n KhanColors,\n Util,\n ArrowPicker,\n ColorPicker,\n DashPicker,\n ElementContainer,\n} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport GraphSettings from \"../components/graph-settings.jsx\";\n\nimport ConstraintEditor from \"./interaction/constraint-editor.jsx\";\n\nconst {MathInput, NumberInput, TextInput} = components;\nconst {getDependencies} = Dependencies;\nconst {unescapeMathMode} = Util;\n\nconst defaultInteractionProps = {\n graph: {\n box: [400, 400],\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n tickStep: [1, 1],\n gridStep: [1, 1],\n markings: \"graph\",\n },\n elements: [],\n};\n\ntype PointEditorProps = $FlowFixMe;\n\n//\n// Editor for non-interactive points\n//\n// TODO(eater): Factor this out\n//\nclass PointEditor extends React.Component<PointEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n coordX: PropTypes.string,\n coordY: PropTypes.string,\n color: PropTypes.string,\n };\n\n static defaultProps = {\n coordX: \"0\",\n coordY: \"0\",\n color: KhanColors.BLACK,\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n Coordinate: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.coordX}\n onChange={this.change(\"coordX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.coordY}\n onChange={this.change(\"coordY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n <ColorPicker\n value={this.props.color}\n onChange={this.change(\"color\")}\n />\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype LineEditorProps = $FlowFixMe;\n\n//\n// Editor for non-interactive line segments\n//\n// TODO(eater): Factor this out\n//\nclass LineEditor extends React.Component<LineEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n startX: PropTypes.string,\n startY: PropTypes.string,\n endX: PropTypes.string,\n endY: PropTypes.string,\n color: PropTypes.string,\n strokeDasharray: PropTypes.string,\n arrows: PropTypes.string,\n strokeWidth: PropTypes.number,\n };\n\n static defaultProps = {\n startX: \"-5\",\n startY: \"5\",\n endX: \"5\",\n endY: \"5\",\n color: KhanColors.BLACK,\n strokeDasharray: \"\",\n arrows: \"\",\n strokeWidth: 2,\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n Start: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.startX}\n onChange={this.change(\"startX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.startY}\n onChange={this.change(\"startY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n End: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.endX}\n onChange={this.change(\"endX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.endY}\n onChange={this.change(\"endY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n <ColorPicker\n value={this.props.color}\n onChange={this.change(\"color\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <DashPicker\n value={this.props.strokeDasharray}\n onChange={this.change(\"strokeDasharray\")}\n />\n \n <ArrowPicker\n value={this.props.arrows}\n onChange={this.change(\"arrows\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n Width:{\" \"}\n <NumberInput\n value={this.props.strokeWidth}\n placeholder={2}\n onChange={this.change(\"strokeWidth\")}\n />\n </div>\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype MovablePointEditorProps = $FlowFixMe;\n\n//\n// Editor for interactive movable points\n//\n// TODO(eater): Factor this out\n// TODO(eater): Rethink how constraints are represented\n//\nclass MovablePointEditor extends React.Component<MovablePointEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n startX: PropTypes.string,\n startY: PropTypes.string,\n constraint: PropTypes.string,\n snap: PropTypes.number,\n constraintFn: PropTypes.string,\n };\n\n static defaultProps = {\n startX: \"0\",\n startY: \"0\",\n constraint: \"none\",\n snap: 0.5,\n constraintFn: \"0\",\n constraintXMin: \"-10\",\n constraintXMax: \"10\",\n constraintYMin: \"-10\",\n constraintYMax: \"10\",\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n Start: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.startX}\n onChange={this.change(\"startX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.startY}\n onChange={this.change(\"startY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n Update <TeX>(x_n, y_n)</TeX> for <TeX>n =</TeX>{\" \"}\n <NumberInput\n value={this.props.varSubscript}\n placeholder={0}\n onChange={this.change(\"varSubscript\")}\n />\n </div>\n <ConstraintEditor {...this.props} />\n </div>\n );\n }\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype MovableLineEditorProps = $FlowFixMe;\n\n//\n// Editor for interactive movable line segments\n//\n// TODO(eater): Factor this out\n// TODO(eater): Rethink how constraints are represented\n//\nclass MovableLineEditor extends React.Component<MovableLineEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n startX: PropTypes.string,\n startY: PropTypes.string,\n endX: PropTypes.string,\n endY: PropTypes.string,\n constraint: PropTypes.string,\n snap: PropTypes.number,\n constraintFn: PropTypes.string,\n };\n\n static defaultProps = {\n startX: \"-5\",\n startY: \"5\",\n endX: \"5\",\n endY: \"5\",\n constraint: \"none\",\n snap: 0.5,\n constraintFn: \"0\",\n constraintXMin: \"-10\",\n constraintXMax: \"10\",\n constraintYMin: \"-10\",\n constraintYMax: \"10\",\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n Initial position:\n <div className=\"perseus-widget-row\">\n Start: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.startX}\n onChange={this.change(\"startX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.startY}\n onChange={this.change(\"startY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n End: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.endX}\n onChange={this.change(\"endX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.endY}\n onChange={this.change(\"endY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n Start updates <TeX>(x_n, y_n)</TeX> for <TeX>n =</TeX>\n <NumberInput\n value={this.props.startSubscript}\n placeholder={0}\n onChange={this.change(\"startSubscript\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n End updates <TeX>(x_m, y_m)</TeX> for <TeX>m =</TeX>\n <NumberInput\n value={this.props.endSubscript}\n placeholder={0}\n onChange={this.change(\"endSubscript\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n All constraints are applied to the start point.\n </div>\n <ConstraintEditor {...this.props} />\n </div>\n );\n }\n\n change = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype FunctionEditorProps = $FlowFixMe;\n\n//\n// Editor for function plots\n//\n// TODO(eater): Factor this out\n//\nclass FunctionEditor extends React.Component<FunctionEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n value: PropTypes.string,\n rangeMin: PropTypes.string,\n rangeMax: PropTypes.string,\n color: PropTypes.string,\n strokeDashArray: PropTypes.string,\n strokeWidth: PropTypes.number,\n };\n\n static defaultProps = {\n value: \"x\",\n rangeMin: \"-10\",\n rangeMax: \"10\",\n color: KhanColors.BLUE,\n strokeDasharray: \"\",\n strokeWidth: 2,\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n <TeX>{this.props.funcName + \"(x)=\"}</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.value}\n onChange={this.change(\"value\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n Range: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.rangeMin}\n onChange={this.change(\"rangeMin\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.rangeMax}\n onChange={this.change(\"rangeMax\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n <ColorPicker\n value={this.props.color}\n onChange={this.change(\"color\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <DashPicker\n value={this.props.strokeDasharray}\n onChange={this.change(\"strokeDasharray\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n Width:{\" \"}\n <NumberInput\n value={this.props.strokeWidth}\n placeholder={2}\n onChange={this.change(\"strokeWidth\")}\n />\n </div>\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype ParametricEditorProps = $FlowFixMe;\n\n//\n// Editor for parametric plots\n//\n// TODO(eater): Factor this out\n//\nclass ParametricEditor extends React.Component<ParametricEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n x: PropTypes.string,\n y: PropTypes.string,\n rangeMin: PropTypes.string,\n rangeMax: PropTypes.string,\n color: PropTypes.string,\n strokeDashArray: PropTypes.string,\n strokeWidth: PropTypes.number,\n };\n\n static defaultProps = {\n x: \"cos(t)\",\n y: \"sin(t)\",\n rangeMin: \"0\",\n rangeMax: \"2\\\\pi\",\n color: KhanColors.BLUE,\n strokeDasharray: \"\",\n strokeWidth: 2,\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n <TeX>X(t) =</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.x}\n onChange={this.change(\"x\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <TeX>Y(t) =</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.y}\n onChange={this.change(\"y\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n Range: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.rangeMin}\n onChange={this.change(\"rangeMin\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.rangeMax}\n onChange={this.change(\"rangeMax\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n <ColorPicker\n value={this.props.color}\n onChange={this.change(\"color\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <DashPicker\n value={this.props.strokeDasharray}\n onChange={this.change(\"strokeDasharray\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n Width:{\" \"}\n <NumberInput\n value={this.props.strokeWidth}\n placeholder={2}\n onChange={this.change(\"strokeWidth\")}\n />\n </div>\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype LabelEditorProps = $FlowFixMe;\n\n//\n// Editor for labels\n//\n// TODO(eater): Factor this out maybe?\n// TODO(eater): Add text direction\n//\nclass LabelEditor extends React.Component<LabelEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n color: PropTypes.string,\n coordX: PropTypes.string,\n coordY: PropTypes.string,\n label: PropTypes.string,\n };\n\n static defaultProps = {\n coordX: \"0\",\n coordY: \"0\",\n color: KhanColors.BLACK,\n label: \"\\\\phi\",\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n <TextInput\n value={this.props.label}\n onChange={this.change(\"label\")}\n style={{\n width: \"100%\",\n }}\n />\n </div>\n <div className=\"perseus-widget-row\">\n Location: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.coordX}\n onChange={this.change(\"coordX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.coordY}\n onChange={this.change(\"coordY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n <ColorPicker\n value={this.props.color}\n onChange={this.change(\"color\")}\n />\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype RectangleEditorProps = $FlowFixMe;\n\n//\n// Editor for rectangles\n//\n// TODO(eater): Factor this out maybe?\n//\nclass RectangleEditor extends React.Component<RectangleEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n color: PropTypes.string,\n coordX: PropTypes.string,\n coordY: PropTypes.string,\n height: PropTypes.string,\n width: PropTypes.string,\n };\n\n static defaultProps = {\n coordX: \"-5\",\n coordY: \"5\",\n width: \"2\",\n height: \"3\",\n color: KhanColors.LIGHT_BLUE,\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"graph-settings\">\n <div className=\"perseus-widget-row\">\n Bottom left: <TeX>\\Large(</TeX>\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.coordX}\n onChange={this.change(\"coordX\")}\n />\n <TeX>,</TeX>{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.coordY}\n onChange={this.change(\"coordY\")}\n />\n <TeX>\\Large)</TeX>\n </div>\n <div className=\"perseus-widget-row\">\n Width:{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.width}\n onChange={this.change(\"width\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n Height:{\" \"}\n <MathInput\n buttonSets={[]}\n buttonsVisible=\"never\"\n value={this.props.height}\n onChange={this.change(\"height\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <ColorPicker\n value={this.props.color}\n lightColors={true}\n onChange={this.change(\"color\")}\n />\n </div>\n <div className=\"perseus-widget-row\">\n You want a border? Sorry, draw your own.\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\ntype InteractionEditorProps = $FlowFixMe;\ntype InteractionEditorState = $FlowFixMe;\n\nclass InteractionEditor extends React.Component<\n InteractionEditorProps,\n InteractionEditorState,\n> {\n // TODO(eater): Make more better\n static propTypes = {\n ...Changeable.propTypes,\n elements: PropTypes.arrayOf(PropTypes.object),\n graph: PropTypes.objectOf(PropTypes.any),\n };\n\n static widgetName: \"interaction\" = \"interaction\";\n static defaultProps: InteractionEditorProps = defaultInteractionProps;\n\n state: InteractionEditorState = {\n usedVarSubscripts: this._getAllVarSubscripts(this.props.elements),\n usedFunctionNames: this._getAllFunctionNames(this.props.elements),\n };\n\n UNSAFE_componentWillReceiveProps(nextProps: InteractionEditorProps) {\n this.setState({\n usedVarSubscripts: this._getAllVarSubscripts(nextProps.elements),\n usedFunctionNames: this._getAllFunctionNames(nextProps.elements),\n });\n }\n\n _getAllVarSubscripts(\n elements: $ReadOnlyArray<$FlowFixMe>,\n ): $ReadOnlyArray<$FlowFixMe> {\n return _.map(\n _.where(elements, {type: \"movable-point\"}),\n (element) => element.options.varSubscript,\n )\n .concat(\n _.map(\n _.where(elements, {type: \"movable-line\"}),\n (element) => element.options.startSubscript,\n ),\n )\n .concat(\n _.map(\n _.where(elements, {type: \"movable-line\"}),\n (element) => element.options.endSubscript,\n ),\n );\n }\n\n _getAllFunctionNames(\n elements: $ReadOnlyArray<$FlowFixMe>,\n ): $ReadOnlyArray<string> {\n return _.map(\n _.where(elements, {type: \"function\"}),\n (element) => element.options.funcName,\n );\n }\n\n _updateGraphProps: ($FlowFixMe) => $FlowFixMe = (newProps) => {\n // TODO(eater): GraphSettings should name this tickStep instead\n // of step. Grr..\n this.change({\n graph: _.extend(_.omit(newProps, \"step\"), {\n tickStep: newProps.step,\n }),\n });\n };\n\n _addNewElement: (SyntheticInputEvent<>) => void = (e) => {\n const elementType = e.target.value;\n if (elementType === \"\") {\n return;\n }\n e.target.value = \"\";\n const newElement = {\n type: elementType,\n key:\n elementType +\n \"-\" +\n ((Math.random() * 0xffffff) << 0).toString(16),\n options:\n elementType === \"point\"\n ? _.clone(PointEditor.defaultProps)\n : elementType === \"line\"\n ? _.clone(LineEditor.defaultProps)\n : elementType === \"movable-point\"\n ? _.clone(MovablePointEditor.defaultProps)\n : elementType === \"movable-line\"\n ? _.clone(MovableLineEditor.defaultProps)\n : elementType === \"function\"\n ? _.clone(FunctionEditor.defaultProps)\n : elementType === \"parametric\"\n ? _.clone(ParametricEditor.defaultProps)\n : elementType === \"label\"\n ? _.clone(LabelEditor.defaultProps)\n : elementType === \"rectangle\"\n ? _.clone(RectangleEditor.defaultProps)\n : {},\n };\n\n let nextSubscript;\n if (elementType === \"movable-point\") {\n nextSubscript =\n _.max([_.max(this.state.usedVarSubscripts), -1]) + 1;\n newElement.options.varSubscript = nextSubscript;\n } else if (elementType === \"movable-line\") {\n nextSubscript =\n _.max([_.max(this.state.usedVarSubscripts), -1]) + 1;\n newElement.options.startSubscript = nextSubscript;\n newElement.options.endSubscript = nextSubscript + 1;\n } else if (elementType === \"function\") {\n // TODO(eater): The 22nd function added will be {(x) since '{'\n // comes after 'z'\n const nextLetter = String.fromCharCode(\n _.max([\n _.max(\n _.map(this.state.usedFunctionNames, function (c) {\n return c.charCodeAt(0);\n }),\n ),\n \"e\".charCodeAt(0),\n ]) + 1,\n );\n newElement.options.funcName = nextLetter;\n }\n this.change({\n elements: this.props.elements.concat(newElement),\n });\n };\n\n _deleteElement: (number) => void = (index) => {\n const element = this.props.elements[index];\n this.change({elements: _.without(this.props.elements, element)});\n };\n\n _moveElementUp: (number) => void = (index) => {\n const element = this.props.elements[index];\n const newElements = _.without(this.props.elements, element);\n newElements.splice(index - 1, 0, element);\n this.change({elements: newElements});\n };\n\n _moveElementDown: (number) => void = (index) => {\n const element = this.props.elements[index];\n const newElements = _.without(this.props.elements, element);\n newElements.splice(index + 1, 0, element);\n this.change({elements: newElements});\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n const {TeX} = getDependencies();\n\n return (\n <div className=\"perseus-widget-interaction-editor\">\n <ElementContainer title=\"Grid settings\">\n <GraphSettings\n editableSettings={[\"canvas\", \"graph\"]}\n box={this.props.graph.box}\n labels={this.props.graph.labels}\n range={this.props.graph.range}\n step={this.props.graph.tickStep}\n gridStep={this.props.graph.gridStep}\n markings={this.props.graph.markings}\n onChange={this._updateGraphProps}\n />\n {/* $FlowFixMe[incompatible-type] */}\n {this.props.graph.valid !== true && (\n <div>{this.props.graph.valid}</div>\n )}\n </ElementContainer>\n {_.map(\n this.props.elements,\n function (element, n) {\n if (element.type === \"movable-point\") {\n return (\n <ElementContainer\n title={\n <span>\n Movable point{\" \"}\n <TeX>\n {\"(x_{\" +\n element.options\n .varSubscript +\n \"}, y_{\" +\n element.options\n .varSubscript +\n \"})\"}\n </TeX>\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDelete={this._deleteElement.bind(this, n)}\n key={element.key}\n >\n <MovablePointEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"movable-line\") {\n return (\n <ElementContainer\n title={\n <span>\n Movable line{\" \"}\n <TeX>\n {\"(x_{\" +\n element.options\n .startSubscript +\n \"}, y_{\" +\n element.options\n .startSubscript +\n \"})\"}\n </TeX>{\" \"}\n to{\" \"}\n <TeX>\n {\"(x_{\" +\n element.options\n .endSubscript +\n \"}, y_{\" +\n element.options\n .endSubscript +\n \"})\"}\n </TeX>\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDelete={this._deleteElement.bind(this, n)}\n key={element.key}\n >\n <MovableLineEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"point\") {\n return (\n <ElementContainer\n title={\n <span>\n Point{\" \"}\n <TeX>\n {\"(\" +\n element.options.coordX +\n \", \" +\n element.options.coordY +\n \")\"}\n </TeX>\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDelete={this._deleteElement.bind(this, n)}\n key={element.key}\n >\n <PointEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"line\") {\n return (\n <ElementContainer\n title={\n <span>\n Line{\" \"}\n <TeX>\n {\"(\" +\n element.options.startX +\n \", \" +\n element.options.startY +\n \")\"}\n </TeX>{\" \"}\n to{\" \"}\n <TeX>\n {\"(\" +\n element.options.endX +\n \", \" +\n element.options.endY +\n \")\"}\n </TeX>\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDelete={this._deleteElement.bind(this, n)}\n key={element.key}\n >\n <LineEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"function\") {\n return (\n <ElementContainer\n title={\n <span>\n Function{\" \"}\n <TeX>\n {element.options.funcName +\n \"(x) = \" +\n element.options.value}\n </TeX>\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n onDelete={this._deleteElement}\n key={element.key}\n >\n <FunctionEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"parametric\") {\n return (\n <ElementContainer\n title={<span>Parametric</span>}\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n onDelete={this._deleteElement}\n key={element.key}\n >\n <ParametricEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"label\") {\n return (\n <ElementContainer\n title={\n <span>\n Label{\" \"}\n <TeX>\n {unescapeMathMode(\n element.options.label,\n )}\n </TeX>{\" \"}\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n onDelete={this._deleteElement}\n key={element.key}\n >\n <LabelEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n if (element.type === \"rectangle\") {\n return (\n <ElementContainer\n title={\n <span>\n Rectangle{\" \"}\n <TeX>\n {\"(\" +\n element.options.coordX +\n \", \" +\n element.options.coordY +\n \")\"}\n </TeX>\n — \n <TeX>\n {element.options.width +\n \" \\\\times \" +\n element.options.height}\n </TeX>\n </span>\n }\n // eslint-disable-next-line react/jsx-no-bind\n onUp={\n n === 0\n ? null\n : this._moveElementUp.bind(this, n)\n }\n // eslint-disable-next-line react/jsx-no-bind\n onDown={\n n === this.props.elements.length - 1\n ? null\n : this._moveElementDown.bind(\n this,\n n,\n )\n }\n onDelete={this._deleteElement}\n key={element.key}\n >\n <RectangleEditor\n {...element.options}\n onChange={(newProps) => {\n const elements = JSON.parse(\n JSON.stringify(\n this.props.elements,\n ),\n );\n _.extend(\n elements[n].options,\n newProps,\n );\n this.change({elements: elements});\n }}\n />\n </ElementContainer>\n );\n }\n },\n this,\n )}\n <div className=\"perseus-widget-interaction-editor-select-element\">\n <select onChange={this._addNewElement}>\n <option value=\"\">Add an element{\"\\u2026\"}</option>\n <option disabled>--</option>\n <option value=\"point\">Point</option>\n <option value=\"line\">Line segment</option>\n <option value=\"function\">Function plot</option>\n <option value=\"parametric\">Parametric plot</option>\n <option value=\"label\">Label</option>\n <option value=\"rectangle\">Rectangle</option>\n <option value=\"movable-point\">\n ★ Movable point\n </option>\n <option value=\"movable-line\">\n ★ Movable line segment\n </option>\n </select>\n </div>\n </div>\n );\n /* eslint-enable max-len */\n }\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default InteractionEditor;\n","/* eslint-disable react/no-unsafe, react/sort-comp */\n// @flow\nimport {\n components,\n interactiveSizes,\n InteractiveGraphWidget,\n SizingUtils,\n Util,\n} from \"@khanacademy/perseus\";\nimport createReactClass from \"create-react-class\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport GraphSettings from \"../components/graph-settings.jsx\";\n\nconst {InfoTip} = components;\nconst {containerSizeClass, getInteractiveBoxFromSizeClass} = SizingUtils;\nconst DeprecationMixin = Util.DeprecationMixin;\nconst InteractiveGraph = InteractiveGraphWidget.widget;\n\ntype InteractiveGraphProps = React.ElementConfig<typeof InteractiveGraph>;\n\nconst defaultBackgroundImage = {\n url: null,\n};\n\nconst deprecatedProps = {\n showGraph: function (props) {\n return {markings: props.showGraph ? \"graph\" : \"none\"};\n },\n};\n\nconst InteractiveGraphEditor: $FlowFixMe = createReactClass({\n displayName: \"InteractiveGraphEditor\",\n className: \"perseus-widget-interactive-graph\",\n\n statics: {\n widgetName: \"interactive-graph\",\n },\n\n getDefaultProps: function () {\n return {\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n valid: true,\n backgroundImage: defaultBackgroundImage,\n markings: \"graph\",\n showProtractor: false,\n showRuler: false,\n showTooltips: false,\n rulerLabel: \"\",\n rulerTicks: 10,\n correct: {\n type: \"linear\",\n coords: null,\n },\n };\n },\n\n // TODO(jack): Use versioning instead of DeprecationMixin\n deprecatedProps: deprecatedProps,\n\n // TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`\n UNSAFE_componentWillMount() {\n // $FlowFixMe[object-this-reference]\n DeprecationMixin.UNSAFE_componentWillMount.call(this);\n },\n\n render: function () {\n let graph;\n let equationString;\n\n const gridStep =\n this.props.gridStep ||\n Util.getGridStep(\n this.props.range,\n this.props.step,\n interactiveSizes.defaultBoxSize,\n );\n const snapStep =\n this.props.snapStep || Util.snapStepFromGridStep(gridStep);\n\n const sizeClass = containerSizeClass.SMALL;\n if (this.props.valid === true) {\n // TODO(aria): send these down all at once\n const graphProps = {\n ref: \"graph\",\n box: this.props.box,\n range: this.props.range,\n labels: this.props.labels,\n step: this.props.step,\n gridStep: gridStep,\n snapStep: snapStep,\n graph: this.props.correct,\n backgroundImage: this.props.backgroundImage,\n markings: this.props.markings,\n showProtractor: this.props.showProtractor,\n showRuler: this.props.showRuler,\n rulerLabel: this.props.rulerLabel,\n rulerTicks: this.props.rulerTicks,\n trackInteraction: function () {},\n onChange: (newProps: InteractiveGraphProps) => {\n let correct = this.props.correct;\n // $FlowFixMe[incompatible-use]\n if (correct.type === newProps.graph.type) {\n correct = _.extend({}, correct, newProps.graph);\n } else {\n // Clear options from previous graph\n correct = newProps.graph;\n }\n this.props.onChange({correct: correct});\n },\n };\n graph = (\n // There are a bunch of props that renderer.jsx passes to widgets via\n // getWidgetProps() and widget-container.jsx that the editors don't\n // bother passing.\n // $FlowFixMe[prop-missing]\n <InteractiveGraph\n {...graphProps}\n containerSizeClass={sizeClass}\n apiOptions={{\n ...this.props.apiOptions,\n isMobile: false,\n }}\n />\n );\n // TODO(kevinb): Update getEquationString to only accept the data it actually\n // needs to compute the equation string.\n // $FlowFixMe[prop-missing]\n equationString = InteractiveGraph.getEquationString(graphProps);\n } else {\n graph = <div className=\"perseus-error\">{this.props.valid}</div>;\n }\n\n return (\n <div className=\"perseus-widget-interactive-graph\">\n <div>\n Correct answer{\" \"}\n <InfoTip>\n <p>\n Graph the correct answer in the graph below and\n ensure the equation or point coordinates displayed\n represent the correct answer.\n </p>\n </InfoTip>{\" \"}\n : {equationString}\n </div>\n\n <GraphSettings\n box={getInteractiveBoxFromSizeClass(sizeClass)}\n range={this.props.range}\n labels={this.props.labels}\n step={this.props.step}\n gridStep={gridStep}\n snapStep={snapStep}\n valid={this.props.valid}\n backgroundImage={this.props.backgroundImage}\n markings={this.props.markings}\n showProtractor={this.props.showProtractor}\n showRuler={this.props.showRuler}\n showTooltips={this.props.showTooltips}\n rulerLabel={this.props.rulerLabel}\n rulerTicks={this.props.rulerTicks}\n onChange={this.props.onChange}\n />\n\n {this.props.correct.type === \"polygon\" && (\n <div className=\"type-settings\">\n <label>\n {\" \"}\n Student answer must{\" \"}\n <select\n value={this.props.correct.match}\n onChange={this.changeMatchType}\n >\n <option value=\"exact\">match exactly</option>\n <option value=\"congruent\">be congruent</option>\n <option value=\"approx\">\n be approximately congruent\n </option>\n <option value=\"similar\">be similar</option>\n </select>\n </label>\n <InfoTip>\n <ul>\n <li>\n <p>\n <b>Match Exactly:</b> Match exactly in\n size, orientation, and location on the\n grid even if it is not shown in the\n background.\n </p>\n </li>\n <li>\n <p>\n <b>Be Congruent:</b> Be congruent in\n size and shape, but can be located\n anywhere on the grid.\n </p>\n </li>\n <li>\n <p>\n <b>Be Approximately Congruent:</b> Be\n exactly similar, and congruent in size\n and shape to within 0.1 units, but can\n be located anywhere on the grid.{\" \"}\n <em>\n Use this with snapping to angle\n measure.\n </em>\n </p>\n </li>\n <li>\n <p>\n <b>Be Similar:</b> Be similar with\n matching interior angles, and side\n measures that are matching or a multiple\n of the correct side measures. The figure\n can be located anywhere on the grid.\n </p>\n </li>\n </ul>\n </InfoTip>\n </div>\n )}\n {this.props.correct.type === \"angle\" && (\n <div className=\"type-settings\">\n <div>\n <label>\n {\" \"}\n Student answer must{\" \"}\n <select\n value={this.props.correct.match}\n onChange={this.changeMatchType}\n >\n <option value=\"exact\">match exactly</option>\n <option value=\"congruent\">\n be congruent\n </option>\n </select>\n </label>\n <InfoTip>\n <p>\n Congruency requires only that the angle\n measures are the same. An exact match\n implies congruency, but also requires that\n the angles have the same orientation and\n that the vertices are in the same position.\n </p>\n </InfoTip>\n </div>\n </div>\n )}\n {graph}\n </div>\n );\n },\n\n changeMatchType: function (e) {\n const correct = _.extend({}, this.props.correct, {\n match: e.target.value,\n });\n this.props.onChange({correct: correct});\n },\n\n serialize: function () {\n const json = _.pick(\n this.props,\n \"step\",\n \"backgroundImage\",\n \"markings\",\n \"labels\",\n \"showProtractor\",\n \"showRuler\",\n \"showTooltips\",\n \"rulerLabel\",\n \"rulerTicks\",\n \"range\",\n \"gridStep\",\n \"snapStep\",\n );\n\n // eslint-disable-next-line react/no-string-refs\n const graph = this.refs.graph;\n if (graph) {\n const correct = graph && graph.getUserInput();\n _.extend(json, {\n graph: {type: correct.type},\n correct: correct,\n });\n\n _.each(\n [\n \"allowReflexAngles\",\n \"angleOffsetDeg\",\n \"numPoints\",\n \"numSides\",\n \"numSegments\",\n \"showAngles\",\n \"showSides\",\n \"snapTo\",\n \"snapDegrees\",\n ],\n function (key) {\n if (_.has(correct, key)) {\n json.graph[key] = correct[key];\n }\n },\n );\n }\n return json;\n },\n});\n\nexport default InteractiveGraphEditor;\n","// @flow\n/**\n * DEPRECATED: Use <TextField> from ./text-field.jsx instead.\n *\n * This component wraps an <input> in a <form> to make it easier to add an\n * `onSubmit` handler. In practice though this can complicate things because\n * each field is in it's own form which is not how forms should be structured.\n * If you need to handle `onSubmit`, please use <TextField> directly with your\n * own <form> that wraps all text fields in the form.\n **/\nimport {globalStyles, components} from \"@khanacademy/perseus\";\nimport Color from \"@khanacademy/wonder-blocks-color\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport type {StyleType} from \"@khanacademy/wonder-blocks-core\";\n\ntype Props = {|\n // This id is used to tie the input field to the label that describes it.\n // TODO(diedra): Instead of passing in this id to connect the label and input\n // field, we should pass in the label for the input field and place it\n // inside the <form>.\n id?: string,\n testId?: string,\n type?: string,\n name?: string,\n readOnly?: boolean,\n value?: ?string,\n placeholder?: string,\n // https://reactjs.org/docs/uncontrolled-components.html#default-values\n defaultValue?: ?string,\n disabled?: boolean,\n autoFocus?: boolean,\n maxLength?: number,\n invalid?: \"true\" | \"false\",\n\n // styling\n // This prop is passed directly to <input>. This is incorrect since HTML\n // tags don't know what to do with an aphrodite which is typed as:\n // {\n // _len: number,\n // _name: string,\n // _definition: CSSProperties,\n // }\n // TODO(WB-1026): Update StyleType to reflect the aphrodite type\n // TODO(FEI-3282): Update uses of StyleType in webapp to be correct\n style?: StyleType,\n className?: string,\n width?: number | string,\n grow?: boolean | number,\n shrink?: boolean | number,\n // HACK(mattmorgan) to enforce WB LabelMedium-like styles on this older\n // component.\n labelMediumInputText?: boolean,\n icon?: React.Element<typeof components.Icon>,\n leftSideIcon?: boolean,\n backgroundColor?: string,\n focusBorderColor?: string,\n borderColor?: string,\n color?: string,\n\n // events\n onSubmit?: (SyntheticInputEvent<HTMLInputElement>) => mixed,\n onBlur?: (SyntheticInputEvent<HTMLInputElement>) => mixed,\n onFocus?: (SyntheticInputEvent<HTMLInputElement>) => mixed,\n onChange?: (SyntheticInputEvent<HTMLInputElement>) => mixed,\n onClick?: (SyntheticMouseEvent<HTMLInputElement>) => mixed,\n onKeyPress?: (SyntheticKeyboardEvent<HTMLInputElement>) => mixed,\n onKeyDown?: (SyntheticKeyboardEvent<HTMLInputElement>) => mixed,\n\n // aria\n \"aria-label\"?: string,\n \"aria-describedby\"?: ?string,\n|};\n\ntype State = {|\n focused: boolean,\n|};\n\ntype PropsWithForwardRef = {|\n ...Props,\n forwardedRef: React.Ref<\"input\">,\n|};\n\nclass FormWrappedTextField extends React.Component<PropsWithForwardRef, State> {\n state = {\n focused: false,\n };\n\n handleBlur = (e: SyntheticInputEvent<HTMLInputElement>) => {\n const {onBlur} = this.props;\n onBlur && onBlur(e);\n\n this.setState({focused: false});\n };\n\n handleFocus = (e: SyntheticInputEvent<HTMLInputElement>) => {\n const {onFocus} = this.props;\n onFocus && onFocus(e);\n\n this.setState({focused: true});\n };\n\n disableDefault = (e: Event) => {\n e.preventDefault();\n };\n\n render() {\n const {\n forwardedRef,\n width,\n grow,\n shrink,\n icon,\n backgroundColor,\n focusBorderColor,\n borderColor,\n color,\n onSubmit,\n leftSideIcon,\n id,\n testId,\n type,\n labelMediumInputText,\n ...allProps\n } = this.props;\n const {focused} = this.state;\n\n const extraStyles: any = {};\n const spanStyle = [styles.input, styles.container];\n\n if (width) {\n extraStyles.width = width;\n }\n\n if (grow) {\n extraStyles.flexGrow = grow === true ? 1 : grow;\n }\n\n if (shrink || shrink === 0) {\n extraStyles.flexShrink = shrink === true ? 0 : shrink;\n }\n\n if (backgroundColor) {\n extraStyles.backgroundColor = backgroundColor;\n } else {\n spanStyle.push(styles.defaultBackground);\n }\n\n // Add text color if specified.\n if (color) {\n extraStyles.color = color;\n }\n\n const borderColorStyle = focused\n ? focusBorderColor || Color.blue\n : borderColor || Color.offBlack16;\n extraStyles.border = `1px solid ${borderColorStyle}`;\n\n const wrappedIcon = icon && (\n <span className={css(styles.icon)}>{icon}</span>\n );\n\n const inputBase = labelMediumInputText\n ? styles.labelMediumInputBase\n : styles.inputBase;\n\n // TODO(diedra): The label for the input field should be here inside of\n // the form.\n return (\n <form\n className={css(spanStyle)}\n style={extraStyles}\n onSubmit={onSubmit || this.disableDefault}\n >\n {leftSideIcon && wrappedIcon}\n <input\n {...allProps}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n type={type}\n className={css(inputBase)}\n ref={forwardedRef}\n id={id}\n data-test-id={testId}\n />\n {!leftSideIcon && wrappedIcon}\n </form>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n inputBase: {\n background: \"inherit\",\n border: \"none\",\n ...globalStyles.typography.bodyXsmall,\n outline: \"none\",\n \"::placeholder\": {\n color: globalStyles.colors.gray41,\n },\n width: \"100%\",\n color: \"inherit\",\n marginBottom: 0,\n paddingLeft: 0,\n boxShadow: \"none\",\n padding: 0, // override Chrome's stylesheet\n margin: 0, // override Safari's stylesheet\n },\n // HACK(mattmorgan) to enforce WB LabelMedium-like styles on this older\n // component.\n labelMediumInputBase: {\n background: \"inherit\",\n border: \"none\",\n outline: \"none\",\n \"::placeholder\": {\n color: globalStyles.colors.gray41,\n },\n width: \"100%\",\n fontWeight: \"normal\",\n fontFamily: \"Lato, san-serif\",\n fontSize: \"16px\",\n lineHeight: \"20px\",\n },\n input: {\n height: 40,\n borderRadius: globalStyles.borderRadius,\n boxSizing: \"border-box\",\n padding: \"8px 10px\",\n },\n container: {\n display: \"inline-flex\",\n alignItems: \"center\",\n marginBottom: 0,\n },\n defaultBackground: {\n backgroundColor: globalStyles.colors.white,\n },\n icon: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n\nexport default (React.forwardRef<Props, HTMLInputElement>((props, ref) => (\n <FormWrappedTextField {...props} forwardedRef={ref} />\n)): React$AbstractComponent<Props, HTMLInputElement>);\n","// @flow\n/**\n * A generic link that removes common link styles.\n *\n * This is useful for wrapping many child components in a link and making sure\n * that \"link\" styles don't get applied to all you content.\n */\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\n// TODO(diedra): This is terrible! If we don't have a href for a link, it should\n// be a button instead. We just need to make sure we override the default browser\n// button styling (backgroundColor, border, and padding).\nconst DEFAULT_HREF = \"javascript:void(0)\";\n\ntype AphroditeStyle = any;\n\ntype DefaultProps = {|\n element: string | React.AbstractComponent<any>,\n // Whether the link should appear in a 'highlighted' state. In\n // practice, this will apply the same styles that are applied on-hover.\n highlighted: boolean,\n href: string,\n // Pass through styles but also add our own to normalize\n style: AphroditeStyle | Array<AphroditeStyle>,\n|};\n\ntype LinkProps = {|\n ...DefaultProps,\n children?: React.Node,\n // An additional class name to add. This is supported so-as to allow\n // Perseus to add class-based styles to links when using this\n // component as its base link class.\n className?: string,\n // Additional direct styles to add.\n inlineStyles?: {[key: string]: any, ...},\n // Optional referrer query parameter to add to the end of the URL, used\n // for analytics purposes.\n referrer?: string,\n // A target window to open a link in\n target?: string,\n // The relationship between the linked page and the current page.\n // Mostly used to prevent abuse from linked sites.\n rel?: string,\n // The data-test-id attribute\n testId?: string,\n // Specify either an HTML tag (like \"a\") or a React component (like\n // React Router's `Link`) to be used as the underlying element.\n\n onClick?: (e: SyntheticMouseEvent<>) => mixed,\n onMouseOver?: (e: SyntheticMouseEvent<>) => mixed,\n onMouseLeave?: (e: SyntheticMouseEvent<>) => mixed,\n onMouseEnter?: (e: SyntheticMouseEvent<>) => mixed,\n onBlur?: (e: SyntheticEvent<>) => mixed,\n onFocus?: (e: SyntheticEvent<>) => mixed,\n onKeyDown?: (e: SyntheticKeyboardEvent<>) => mixed,\n \"aria-label\"?: string,\n \"aria-selected\"?: boolean,\n \"aria-current\"?: boolean,\n role?: \"tab\",\n title?: string,\n id?: string,\n tabIndex?: number,\n|};\n\n/**\n * A wrapper that creates an anchor tag with normalized styles\n */\nclass Link extends React.Component<LinkProps> {\n static defaultProps: DefaultProps = {\n highlighted: false,\n href: DEFAULT_HREF,\n style: ([]: Array<AphroditeStyle>),\n element: \"a\",\n };\n\n render(): React.Element<string> | React.Node {\n const {\n children,\n className,\n highlighted,\n href,\n inlineStyles,\n referrer,\n style,\n target,\n testId,\n element,\n ...otherProps\n } = this.props;\n\n // We need to make sure the hash goes at the end of the <a>'s href, so\n // we'll split for now and re-add after potentially adding ?ref=\n // Even though we have defined a default prop for href, if href is\n // set to null, we will still get the null, so we need to handle that.\n const [hrefWithoutHash, hash] = href ? href.split(\"#\") : [DEFAULT_HREF];\n let url = hrefWithoutHash;\n\n if (referrer) {\n if (url.indexOf(\"?\") > -1) {\n url += \"&ref=\" + referrer;\n } else {\n url += \"?ref=\" + referrer;\n }\n }\n\n if (hash) {\n url += \"#\" + hash;\n }\n\n const delegatedStyles = [\n styles.link,\n highlighted && styles.highlighted,\n ];\n\n if (Array.isArray(style)) {\n delegatedStyles.push(...style);\n } else {\n delegatedStyles.push(style);\n }\n\n const delegatedClassName = className ? \" \" + className : \"\";\n\n // When passing an anchor tag, we want to use the native `href`.\n // ReactRouter links, though, need a special `to` prop instead.\n const urlProp = element === \"a\" ? {href: url} : {to: url};\n\n // When the link is set to open in a new window, we want to append\n // some `rel` attributes. This is to ensure that the links we're\n // sending folks to can't hijack the existing page.\n // More info: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/\n //\n // If `rel` is already defined, we assume the caller knows what they're\n // doing. In the future, we may wish to check what keywords are passed,\n // and add in `noopener` and `noreferrer`.\n let rel = otherProps.rel;\n if (target === \"_blank\" && !rel) {\n rel = \"noopener noreferrer\";\n }\n\n return React.createElement(\n element,\n {\n \"data-test-id\": testId,\n ...otherProps,\n ...urlProp,\n className: css(...delegatedStyles) + delegatedClassName,\n style: inlineStyles,\n target,\n rel,\n },\n children,\n );\n }\n}\n\nconst styles = StyleSheet.create({\n link: {\n // Remove the gray background color from active links in IE 10\n // https://necolas.github.io/normalize.css/3.0.2/normalize.css\n backgroundColor: \"transparent\",\n color: \"inherit\",\n textDecoration: \"none\",\n \":hover\": {\n textDecoration: \"underline\",\n },\n },\n highlighted: {\n textDecoration: \"underline\",\n },\n});\n\nexport default Link;\n","// @flow\n/**\n * Controlled list of answer choices, handles adding and removing answers.\n */\n\nimport {components, globalStyles} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport FormWrappedTextField from \"../../components/form-wrapped-text-field.jsx\";\nimport Link from \"../../components/link.jsx\";\n\nconst {colors, typography} = globalStyles;\nconst {Icon} = components;\n\ntype AddAnswerProps = {\n // Callback to add new answer choice.\n onClick: () => void,\n ...\n};\n\ntype AnswerProps = {\n // The answer string, can be plain text or a KaTeX expression.\n answer: string,\n // Callback for when an answer is changed.\n onChange: (answer: string) => void,\n // Callback to remove answer from list of choices.\n onRemove: () => void,\n ...\n};\n\ntype AnswerChoicesProps = {\n // The list of possible answers in a specific order.\n choices: $ReadOnlyArray<string>,\n // Callback for when answers change.\n onChange: (choices: $ReadOnlyArray<string>) => void,\n ...\n};\n\nconst addIcon = {\n path: \"M11 11V7a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2h-4v4a1 1 0 0 1-2 0v-4H7a1 1 0 0 1 0-2h4zm1 13C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z\",\n width: 24,\n height: 24,\n};\n\nconst removeIcon = {\n path: \"M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm-5-9a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2H7z\",\n width: 24,\n height: 24,\n};\n\nconst DraggableGripIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n <filter\n id=\"draggable-grip-shadow\"\n width=\"112.5%\"\n height=\"116.7%\"\n x=\"-6.2%\"\n y=\"-8.3%\"\n filterUnits=\"objectBoundingBox\"\n >\n <feGaussianBlur\n in=\"SourceAlpha\"\n stdDeviation=\".5\"\n result=\"shadowBlurInner\"\n />\n\n <feOffset in=\"shadowBlurInner\" dy=\"1\" result=\"shadowOffsetInner\" />\n\n <feComposite\n in=\"shadowOffsetInner\"\n in2=\"SourceAlpha\"\n k2=\"-1\"\n k3=\"1\"\n operator=\"arithmetic\"\n result=\"shadowInnerInner\"\n />\n\n <feColorMatrix\n in=\"shadowInnerInner\"\n values=\"0 0 0 0 0.129411765 0 0 0 0 0.141176471 0 0 0 0 0.17254902 0 0 0 0.2 0\"\n />\n </filter>\n\n <path\n d=\"M1 4a1 1 0 1 1 0-2h14a1 1 0 0 1 0 2H1zm0 10a1 1 0 0 1 0-2h14a1 1 0 0 1 0 2H1zm0-5a1 1 0 1 1 0-2h14a1 1 0 0 1 0 2H1z\"\n fill={colors.gray17}\n filter=\"url(#draggable-grip-shadow)\"\n />\n </svg>\n);\n\n/**\n * A button link to add a new answer.\n */\nconst AddAnswer = ({onClick}: AddAnswerProps) => (\n <Link\n className={css(styles.addAnswer, editorStyles.addAnswer)}\n onClick={onClick}\n >\n <Icon icon={addIcon} size={24} />\n <div className={css(styles.spacer)} />\n Add an answer choice\n </Link>\n);\n\n/**\n * An answer item in the choices list.\n *\n * TODO(michaelpolyak): Implement answer reordering, CP-117\n */\nconst Answer = ({answer, onChange, onRemove}: AnswerProps) => (\n <li className={css(styles.answer)}>\n <Link onClick={onRemove}>\n <Icon icon={removeIcon} size={24} color=\"#D92916\" />\n </Link>\n\n <div className={css(styles.spacer)} />\n\n <FormWrappedTextField\n grow={1}\n onChange={(e) => onChange(e.target.value)}\n value={answer}\n />\n\n <div className={css(styles.spacer)} />\n\n <Link\n style={[styles.disabled]}\n title=\"Answer reordering is not implemented.\"\n >\n <DraggableGripIcon />\n </Link>\n </li>\n);\n\n/**\n * The list of choices, handles adding, removing and reording of answers.\n */\nconst AnswerChoices = ({\n choices,\n onChange,\n}: AnswerChoicesProps): React.Element<\"div\"> => (\n <div>\n <div className={css(styles.title)}>Answer Choices</div>\n\n <ul className={css(styles.answers)}>\n {choices.map((answer, index) => (\n <Answer\n answer={answer}\n // TODO(michaelpolyak): When answer reording is implemented,\n // key by index may not re-render correctly, CP-117\n key={index}\n // Update answer for choice.\n onChange={(answer) =>\n onChange([\n ...choices.slice(0, index),\n answer,\n ...choices.slice(index + 1),\n ])\n }\n // Remove answer from choices.\n onRemove={() =>\n onChange([\n ...choices.slice(0, index),\n ...choices.slice(index + 1),\n ])\n }\n />\n ))}\n </ul>\n\n <AddAnswer\n // Append a new empty answer to choices.\n onClick={() => onChange([...choices, \"\"])}\n />\n </div>\n);\n\nconst styles = StyleSheet.create({\n title: {\n ...typography.bodyXsmallBold,\n\n marginBottom: 6,\n\n color: colors.gray17,\n },\n\n answers: {\n marginTop: 12,\n marginBottom: 12,\n },\n\n answer: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n\n \":not(:first-child)\": {\n marginTop: 12,\n },\n },\n\n addAnswer: {\n ...typography.bodyXsmallBold,\n\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n\n color: \"#1865f2\",\n },\n\n spacer: {\n width: 16,\n },\n\n disabled: {\n cursor: \"not-allowed\",\n },\n});\n\nconst editorStyles = StyleSheet.create({\n addAnswer: {\n \":link\": {\n color: \"#1865f2\",\n },\n },\n});\n\nexport default AnswerChoices;\n","/* eslint-disable react/sort-comp */\n// @flow\n/**\n * Add hover behavior to another component.\n *\n * This component provides hover and focus status updates in a consistent way\n * across desktop and mobile.\n *\n * For advice on when to use this component instead of Button, see README.md.\n *\n * Many mobile browsers treat :hover as sticky which results in buttons looking\n * pressed even when the user has lifted their finger. This component ensures\n * that when user lifts their finger the hover state is removed.\n *\n * We also chnage how the focus state works. Browsers immediately set the\n * focus state as soon as you click on a button. This component only sets the\n * focus state when a user starts navigating between elements via keybaord.\n *\n * HoverBehavior accepts a function as 'children' which is passed state and\n * an object containing event handlers. The 'children' function should return\n * an React Element of some sort.\n *\n * Example:\n *\n * class MyButtonLikeComponent extends React.Component {\n * render(): React.Node {\n * return <HoverBehavior\n * disabled={this.props.disabled}\n * onClick={this.handleClick}\n * >\n * {({hovered}, handlers) =>\n * <RoundRect\n * textcolor='white'\n * backgroundColor={hovered ? 'red' : 'blue'}/>}\n * {...handlers}\n * >\n * {this.props.children}\n * </RoundRect>\n * }\n * </HoverBehavior>\n * }\n * }\n *\n * This follows a pattern call 'Function as Child Components':\n * https://medium.com/merrickchristensen/function-as-child-components-5f3920a9ace9#.sw0jiio8b\n */\nimport * as React from \"react\";\n\ntype Handlers = {|\n onBlur: () => mixed,\n onClick: (e: SyntheticMouseEvent<>) => mixed,\n onFocus: () => mixed,\n onMouseDown: () => mixed,\n onMouseEnter: () => mixed,\n onMouseLeave: () => mixed,\n onTouchStart: () => mixed,\n onTouchEnd: () => mixed,\n|};\n\ntype State = {|\n focused: boolean,\n hovered: boolean,\n|};\n\ntype Props = {|\n children?: (state: State, handlers: Handlers) => React.Node,\n disabled?: boolean,\n onClick?: (e: SyntheticMouseEvent<>) => mixed,\n startHovered: boolean,\n shouldUpdate: () => boolean,\n|};\n\nexport default class HoverBehavior extends React.Component<Props, State> {\n static defaultProps: {|\n shouldUpdate: () => boolean,\n startHovered: boolean,\n |} = {\n startHovered: false,\n shouldUpdate: () => true,\n };\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n focused: false,\n hovered: props.startHovered,\n };\n }\n\n focusFlag: boolean;\n waitingForClick: boolean;\n\n handleClick: (e: SyntheticMouseEvent<>) => void = (\n e: SyntheticMouseEvent<>,\n ) => {\n if (!this.props.disabled) {\n if (this.props.shouldUpdate()) {\n this.waitingForClick = false;\n }\n if (this.props.onClick && !this.props.disabled) {\n this.props.onClick(e);\n }\n }\n };\n\n handleMouseEnter: () => void = () => {\n if (\n !this.props.disabled &&\n this.props.shouldUpdate() &&\n !this.waitingForClick\n ) {\n this.setState({hovered: true});\n }\n };\n\n handleMouseLeave: () => void = () => {\n if (\n !this.props.disabled &&\n this.props.shouldUpdate() &&\n !this.waitingForClick\n ) {\n this.setState({hovered: false});\n }\n };\n\n handleTouchStart: () => void = () => {\n if (!this.props.disabled && this.props.shouldUpdate()) {\n this.setState({hovered: true});\n }\n };\n\n handleTouchEnd: () => void = () => {\n if (!this.props.disabled && this.props.shouldUpdate()) {\n this.setState({hovered: false});\n this.waitingForClick = true;\n }\n };\n\n handleMouseDown: () => void = () => {\n if (!this.props.disabled && this.props.shouldUpdate()) {\n this.setState({focused: false});\n this.focusFlag = true;\n }\n };\n\n handleBlur: () => void = () => {\n if (!this.props.disabled && this.props.shouldUpdate()) {\n this.setState({focused: false});\n }\n };\n\n handleFocus: () => void = () => {\n if (!this.props.disabled && this.props.shouldUpdate()) {\n if (this.focusFlag) {\n this.focusFlag = false;\n } else {\n this.setState({focused: true});\n }\n }\n };\n\n render(): React.Node {\n const handlers = {\n onBlur: this.handleBlur,\n onClick: this.handleClick,\n onFocus: this.handleFocus,\n onMouseDown: this.handleMouseDown,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n onTouchStart: this.handleTouchStart,\n onTouchEnd: this.handleTouchEnd,\n };\n\n const {children} = this.props;\n return children?.(this.state, handlers) || null;\n }\n}\n","// @flow\n/**\n * Reusable checkbox component.\n **/\nimport {globalStyles} from \"@khanacademy/perseus\";\nimport {css, StyleSheet} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport HoverBehavior from \"./hover-behavior.jsx\";\n\nconst {borderRadius, colors} = globalStyles;\n\nexport type CheckboxProps = {\n // Whether or not the checkbox is checked. The parent responsible for\n // responding to onChange events and updating this prop appropriately.\n checked: boolean,\n // When disable the checkbox will appear faded out and will not\n // respond to events and cannot be tabbed to.\n disabled?: boolean,\n // Appear as if disabled but allow it to respond to events and be\n // tabbed to.\n // This allows us to hook alternate responses into clicking on a\n // disabled checkbox.\n appearDisabled?: boolean,\n // Called when the value has changed.\n onChange: (event: SyntheticInputEvent<>) => void,\n tabIndex?: number | string,\n style?: {|\n marginTop: number,\n |},\n // For e2e test\n dataTestId?: string,\n // Unique identifier for this checkbox.\n id?: string,\n ...\n};\n\n// NOTE(jangmi): Checkbox may have `onChange` depends on circumstances but lack\n// of onChange causes Dev only alert so we provide the no op func as default\n// to prevent that.\nconst onChangeCheckboxNoop = (event: SyntheticInputEvent<>) => {};\n\nexport default class Checkbox extends React.Component<CheckboxProps> {\n static defaultProps: {|\n checked: boolean,\n onChange: (event: SyntheticInputEvent<>) => void,\n |} = {\n checked: false,\n onChange: onChangeCheckboxNoop,\n };\n\n render(): React.Node {\n const {\n checked,\n disabled,\n appearDisabled,\n onChange,\n tabIndex,\n style,\n dataTestId,\n id,\n } = this.props;\n\n const checkedColor = colors.gray41;\n\n return (\n <HoverBehavior>\n {({focused}, handlers) => (\n <div\n {...handlers}\n className={css(\n styles.container,\n focused && styles.focused,\n )}\n style={style}\n data-test-id={dataTestId}\n data-checked={checked}\n >\n <svg\n className={css(\n styles.svg,\n (disabled || appearDisabled) && styles.disabled,\n )}\n width={sizeWithPadding}\n height={sizeWithPadding}\n /* pad the viewbox to avoid bad clipping when zooming */\n viewBox={`-${padding} -${padding}\n ${sizeWithPadding} ${sizeWithPadding}`}\n >\n <g fill=\"none\" fillRule=\"evenodd\">\n {checked && (\n <g>\n <rect\n fill={checkedColor}\n width={size}\n height={size}\n x=\"0\"\n y=\"0\"\n rx={borderRadius}\n />\n <path\n fill={colors.white}\n stroke={colors.white}\n d=\"M4.98 7.41a0.58.58 0 1 0-0.81.81L6.47\n 10.53c0.23.23.59.23.81\n 0l4.55-4.55a0.58.58 0 0\n 0-0.81-0.81L6.88 9.31 4.98 7.41z\"\n />\n </g>\n )}\n {!checked && (\n <rect\n fill={colors.white}\n stroke={colors.gray68}\n width={size - 2 * padding}\n height={size - 2 * padding}\n x={padding}\n y={padding}\n rx=\"4\"\n strokeWidth={borderWidth}\n />\n )}\n </g>\n </svg>\n <input\n type=\"checkbox\"\n id={id}\n checked={checked}\n className={css(\n styles.checkbox,\n disabled && styles.defaultCursor,\n )}\n disabled={disabled}\n onChange={onChange}\n tabIndex={tabIndex}\n />\n </div>\n )}\n </HoverBehavior>\n );\n }\n}\n\nconst size = 16;\nconst padding = 0.5;\nconst borderWidth = 1;\nconst sizeWithPadding = size + 2 * padding;\n\nconst styles = StyleSheet.create({\n container: {\n position: \"relative\",\n display: \"inline-block\",\n verticalAlign: \"middle\",\n lineHeight: 0,\n borderRadius: borderRadius,\n width: sizeWithPadding,\n height: sizeWithPadding,\n flexShrink: 0,\n },\n focused: {\n \"::before\": {\n content: '\"\"',\n position: \"absolute\",\n top: -2,\n right: -2,\n bottom: -2,\n left: -2,\n borderRadius: borderRadius + 2,\n backgroundColor: \"lightblue\", // TODO(kevinb) get real focus ring\n },\n },\n svg: {\n position: \"absolute\",\n left: 0,\n top: 0,\n },\n checkbox: {\n appearance: \"none\",\n opacity: 0,\n position: \"absolute\",\n top: padding,\n width: size,\n height: size,\n margin: 0,\n outline: \"none\",\n cursor: \"pointer\",\n },\n disabled: {\n opacity: 0.5,\n },\n defaultCursor: {\n cursor: \"default\",\n },\n});\n","// @flow\n/**\n * Controlled component to display and change widget options.\n */\n\nimport {globalStyles} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport Checkbox from \"../../components/checkbox.jsx\";\n\nconst {colors, typography} = globalStyles;\n\ntype BehaviorProps = {\n // Whether multiple answer choices may be selected for markers.\n multipleAnswers: boolean,\n // Whether to hide answer choices from user instructions.\n hideChoicesFromInstructions: boolean,\n // Callback for when widget options change.\n onChange: (options: {|\n multipleAnswers?: boolean,\n hideChoicesFromInstructions?: boolean,\n |}) => void,\n ...\n};\n\nconst Behavior = ({\n multipleAnswers,\n hideChoicesFromInstructions,\n onChange,\n}: BehaviorProps): React.Element<\"div\"> => (\n <div>\n <div className={css(styles.title)}>Behavior</div>\n\n <ul>\n <li className={css(styles.option)}>\n <Checkbox\n checked={multipleAnswers}\n onChange={() =>\n onChange({multipleAnswers: !multipleAnswers})\n }\n />\n\n <span className={css(styles.label)}>\n Allow multiple answers per marker\n </span>\n </li>\n\n <li className={css(styles.option)}>\n <Checkbox\n checked={hideChoicesFromInstructions}\n onChange={() =>\n onChange({\n hideChoicesFromInstructions:\n !hideChoicesFromInstructions,\n })\n }\n />\n\n <span className={css(styles.label)}>\n Do not display answer choices in instructions\n </span>\n </li>\n </ul>\n </div>\n);\n\nconst styles = StyleSheet.create({\n title: {\n ...typography.bodyXsmallBold,\n\n marginBottom: 6,\n\n color: colors.gray17,\n },\n\n option: {\n display: \"flex\",\n\n padding: \"6px 0\",\n },\n\n label: {\n ...typography.smallSubheadingMobile,\n\n marginLeft: 16,\n\n color: colors.gray17,\n },\n});\n\nexport default Behavior;\n","// @flow\n/**\n * The Option is an item to be used in the Select components and the\n * derivations such as MultiSelect, CheckList, and CheckBoxList. Also includes\n * OptionGroup which is an internal component used in the dropdowns to house\n * a list of options.\n **/\nimport {components, globalStyles} from \"@khanacademy/perseus\";\nimport {css, StyleSheet} from \"aphrodite\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport {focusWithChromeStickyFocusBugWorkaround} from \"./util.js\";\n\nexport type OptionRenderer = (\n children: ?React.Element<any>,\n value: string,\n selected: boolean,\n disabled?: boolean,\n) => React.Element<any>;\n\nconst {Icon} = components;\nconst {colors} = globalStyles;\n\nconst findAndFocusElement = (component: ?Element) => {\n const DOMNode: ?(Element | Text) = ReactDOM.findDOMNode(component);\n const button = ((DOMNode: any): HTMLInputElement);\n // $FlowIgnore[method-unbinding]\n if (button.focus) {\n focusWithChromeStickyFocusBugWorkaround(button);\n }\n};\n\ntype OptionProps = {|\n // The value to use when the option is selected\n value: string,\n\n // The display of the option\n children?: React.Node,\n\n // Is the current option selected?\n selected?: boolean,\n\n // Is the current option disabled?\n disabled?: boolean,\n\n // An event when an option is clicked\n onClick?: () => void,\n\n // An optional rendering function to render the details of the option\n optionRenderer?: OptionRenderer,\n\n // An optional function to call when the dropdown should close\n // Only relevant if the Option is inside of a dropdown menu\n onDropdownClose?: () => void,\n\n // An optional value to override the focus styling of an option.\n // Use caution when using this - keyboard users need to know what they're\n // focused on in order to interact with the product!\n hideFocusState?: boolean,\n\n // An optional test id that can be used to identify this Option in automated tests.\n testId?: string,\n\n // Text to provide for assistive tech users\n ariaLabel?: string,\n|};\n\nconst check = `M10,3.8C10,4,9.9,4.2,9.8,4.3L5.1,8.9L4.3,9.8C4.2,9.9,4,10,3.8,10\n S3.5,9.9,3.4,9.8L2.5,8.9L0.2,6.6C0.1,6.5,0,6.3,0,6.2s0.1-0.3,0.2-0.4\n l0.9-0.9c0.1-0.1,0.3-0.2,0.4-0.2s0.3,0.1,0.4,0.2l1.9,1.9l4.2-4.2c0.1\n -0.1,0.3-0.2,0.4-0.2c0.2,0,0.3,0.1,0.4,0.2l0.9,0.9C9.9,3.5,10,3.7,\n 10,3.8z`;\n\nexport const optionHeight = 30;\n\nclass Option extends React.Component<OptionProps> {\n node: HTMLDivElement;\n\n handleKeyDown(event: any): void {\n const {onDropdownClose} = this.props;\n const pressedKey = event.key;\n const focusedElement = event.target;\n\n if (pressedKey === \"ArrowDown\" && focusedElement.nextSibling) {\n event.preventDefault();\n focusedElement.nextSibling.focus();\n }\n if (pressedKey === \"ArrowUp\" && focusedElement.previousSibling) {\n event.preventDefault();\n focusedElement.previousSibling.focus();\n }\n if (\n pressedKey === \"ArrowUp\" &&\n !focusedElement.previousSibling &&\n onDropdownClose\n ) {\n event.preventDefault();\n onDropdownClose();\n }\n if (\n (pressedKey === \"Escape\" || pressedKey === \"Tab\") &&\n onDropdownClose\n ) {\n onDropdownClose();\n }\n }\n\n render(): React.Node {\n const {\n selected,\n value,\n onClick,\n children,\n optionRenderer,\n disabled,\n hideFocusState,\n testId,\n ariaLabel,\n } = this.props;\n\n return (\n <button\n // TODO(mdr): We found a new Flow error when upgrading:\n // \"node (null) This type is incompatible with this.node (HTMLDivElement)\"\n // $FlowFixMe[incompatible-type](0.52.0->0.53.0)\n ref={(node) => (this.node = node)}\n value={value}\n role=\"menuitemradio\"\n aria-checked={selected}\n className={css(\n styles.notAButton,\n disabled && styles.cursorDefault,\n hideFocusState && styles.noFocus,\n )}\n onClick={(value: string) => {\n if (!disabled && onClick) {\n // TODO(mdr): We found a new Flow error here when upgrading\n // from 0.35.0 to 0.52.0: \"value (unused function\n // argument)\". This comment was automatically added to\n // this file, to suppress the error for now. Please\n // consider fixing!\n // $FlowFixMe[extra-arg]\n onClick(value);\n }\n }}\n onKeyDown={(event: KeyboardEvent) => this.handleKeyDown(event)}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n data-test-id={testId}\n >\n {optionRenderer &&\n optionRenderer(\n /**\n * This expects a `React.Element<>` but `children` is a\n * `React.Node`. We can convert a `React.Node` to a\n * `React.Element<>` by wrapping it in a fragment.\n */\n <>{children}</>,\n value || \"\",\n selected || false,\n disabled,\n )}\n\n {!optionRenderer && (\n <span\n className={css(\n styles.option,\n selected && styles.optionSelected,\n disabled && styles.optionDisabled,\n )}\n >\n {children}\n {selected && (\n <span className={css(styles.check)}>\n <Icon icon={check} />\n </span>\n )}\n </span>\n )}\n </button>\n );\n }\n}\n\n// TODO(kevinb):\n// - keep the the option group within the page bounds\n// - do we really want to dismiss this on scroll\n// - how does the drop down interact with tooltips? what's the z-index order?\nclass OptionGroup extends React.Component<{\n // An event when an option is selected\n onSelected: (value: string) => void,\n // The list of options to display\n children?: Array<React.Element<typeof Option>>,\n // The currently selected options\n selectedValues: Array<string>,\n // An optional rendering function to render the details of the options\n optionRenderer?: OptionRenderer,\n // An override to skip the bit of top/bottom spacing around the group\n noMargin?: boolean,\n // An optional function to call when the dropdown should close\n onDropdownClose?: () => void,\n // An optional value to override the focus styling of an option.\n // Use caution when using this - keyboard users need to know what\n // they're focused on in order to interact with the product!\n hideFocusState?: boolean,\n ...\n}> {\n focusedElement: Element;\n\n componentDidMount() {\n if (this.focusedElement) {\n findAndFocusElement(this.focusedElement);\n }\n }\n\n render(): React.Element<\"div\"> {\n const {\n children,\n onSelected,\n selectedValues,\n optionRenderer,\n noMargin,\n onDropdownClose,\n hideFocusState,\n } = this.props;\n\n return (\n <div\n style={{top}}\n className={css(\n styles.optionGroup,\n noMargin && styles.optionGroupNoMargin,\n )}\n >\n {React.Children.map(children, (child, index) => {\n const selected = selectedValues.includes(child.props.value);\n\n const reference =\n selected || index === 0\n ? (node: Element) => (this.focusedElement = node)\n : null;\n\n return React.cloneElement(child, {\n ...child.props,\n key: index,\n selected: selected,\n onClick: () => onSelected(child.props.value),\n optionRenderer: optionRenderer,\n ref: reference,\n onDropdownClose: onDropdownClose,\n hideFocusState: hideFocusState,\n });\n })}\n </div>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n optionGroup: {\n margin: \"4px 0\",\n },\n optionGroupNoMargin: {\n margin: 0,\n },\n option: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingLeft: 32,\n paddingRight: 32,\n height: optionHeight,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n color: colors.gray17,\n userSelect: \"none\",\n\n \":hover\": {\n backgroundColor: colors.gray95,\n },\n },\n optionSelected: {\n backgroundColor: colors.gray95,\n color: \"#11ACCD\",\n },\n optionDisabled: {\n color: colors.gray76,\n \":hover\": {\n backgroundColor: \"transparent\",\n },\n },\n check: {\n position: \"absolute\",\n left: 11,\n },\n notAButton: {\n backgroundColor: \"transparent\",\n border: \"none\",\n display: \"block\",\n padding: 0,\n margin: 0,\n width: \"100%\",\n // <button> uses user agent stylesheet over inherit so we need to set\n // it explicitly.\n font: \"inherit\",\n },\n noFocus: {\n outline: \"none\",\n },\n cursorDefault: {\n cursor: \"default\",\n },\n});\n\nexport {OptionGroup};\nexport default Option;\n","// @flow\nexport function focusWithChromeStickyFocusBugWorkaround(element: Element) {\n // NOTE(marksandstrom) Chrome sticky focus bug.\n //\n // There is a bug in Chrome related to sticky positioning and\n // focus: When a child of an element with sticky positioning is\n // focused with the focus() method, the scrollable area\n // containing that element will scroll to the top (even though\n // the element is already visble on the page). For a dropdown\n // this means that the area will be scrolled to the top when\n // the user interacts with the dropdown (since we actively\n // manage dropdown header and option focus for keyboard users).\n //\n // To work around this bug the `preventScroll` focus option is\n // used.\n //\n // Using `focusOptions` is an experimental browser feature\n // \"that should not be used in production code\". However, since\n // Chrome is the only browser we support that exhibits this\n // buggy behavior and using `focusOptions` works around the\n // bug, it is perfectly reasonable to use the feature in this\n // case. We are not relying on the effect of the\n // `preventScroll` option otherwise.\n //\n // focusOptions documentation:\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus\n //\n // Note that there could be cases where we want default focus() behavior.\n // One that comes to mind is a dropdown with a long list of options that\n // might be rendered off screen when opened. With this workaround the\n // selected option would not be scrolled into view if the option is near\n // the end of the list. We're not aware of any uses of the dropdown where\n // this is an issue, however, so there isn't currently a way to out of the\n // `preventScroll` behavior.\n\n // $FlowIgnore[prop-missing]\n element.focus({preventScroll: true});\n}\n","/* eslint-disable react/no-unsafe */\n// @flow\n/**\n * Controlled editor image marker on the question image.\n *\n * Allows to select which label choices are the answers for each marker, using\n * the dropdown component.\n */\n\nimport {globalConstants, globalStyles} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport Option, {OptionGroup} from \"../../components/dropdown-option.jsx\";\nimport FormWrappedTextField from \"../../components/form-wrapped-text-field.jsx\";\n\nimport type {MarkerType} from \"@khanacademy/perseus\";\n\nconst {colors, borderRadius} = globalStyles;\n\ntype MarkerProps = {|\n ...MarkerType,\n\n // The list of possible answer choices.\n choices: $ReadOnlyArray<string>,\n\n // Callback for when any of the marker props are changed.\n onChange: (marker: MarkerType) => void,\n\n // Callback to remove marker from the question image.\n onRemove: () => void,\n|};\n\ntype MarkerState = {|\n // Whether answer choices dropdown is shown, controlled by the user clicking\n // on the marker icon.\n showDropdown: boolean,\n|};\n\nexport default class Marker extends React.Component<MarkerProps, MarkerState> {\n _marker: ?HTMLElement;\n\n constructor(props: MarkerProps) {\n super(props);\n\n this.state = {\n showDropdown: false,\n };\n }\n\n componentDidMount() {\n document.addEventListener(\"click\", this.handleClick, true);\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: MarkerProps) {\n const {answers} = this.props;\n\n // Exclude those answers that are no longer present in choices.\n const filteredAnswers = answers.filter((answer) =>\n nextProps.choices.includes(answer),\n );\n\n if (JSON.stringify(answers) !== JSON.stringify(filteredAnswers)) {\n // Update marker on the next frame when these props take affect.\n // TODO(jeff, CP-3128): Use Wonder Blocks Timing API\n // eslint-disable-next-line no-restricted-syntax\n setTimeout(() => this.updateMarker({answers: filteredAnswers}));\n }\n }\n\n componentWillUnmount() {\n document.removeEventListener(\"click\", this.handleClick, true);\n }\n\n openDropdown() {\n this.setState({showDropdown: true});\n }\n\n updateMarker(props: any) {\n const {answers, label, onChange, x, y} = this.props;\n\n onChange({\n answers,\n label,\n x,\n y,\n // Overwrite with updated prop(s).\n ...props,\n });\n }\n\n handleClick: (e: MouseEvent) => void = (e: MouseEvent) => {\n const {showDropdown} = this.state;\n\n if (this._marker === e.target) {\n this.setState({showDropdown: !showDropdown});\n } else if (showDropdown) {\n // Close dropdown if click event was registered anywhere outside it.\n if (this._marker && !this._marker.contains((e.target: any))) {\n // Ensure other listeners are not triggered on click event that\n // closes the dropdown. A specific case this addresses is when\n // user clicks on question image to close dropdown, a new marker\n // will be created, this is bad for usability.\n e.stopPropagation();\n\n this.setState({showDropdown: false});\n }\n }\n };\n\n handleLabelChange: (e: SyntheticInputEvent<>) => void = (e) => {\n this.updateMarker({label: e.target.value});\n };\n\n handleSelectAnswer: (toggleAnswer: string) => void = (\n toggleAnswer: string,\n ) => {\n let {answers} = this.props;\n\n if (answers.includes(toggleAnswer)) {\n answers = answers.filter((answer) => answer !== toggleAnswer);\n } else {\n answers = [...answers, toggleAnswer];\n }\n\n this.updateMarker({answers});\n };\n\n render(): React.Element<\"div\"> {\n const {answers, choices, label, onRemove, x, y} = this.props;\n\n const {showDropdown} = this.state;\n\n return (\n <div\n className={css(\n styles.marker,\n answers.length > 0 && styles.markerWithAnswers,\n showDropdown && styles.markerSelected,\n )}\n ref={(node) => (this._marker = node)}\n style={{\n left: `${x}%`,\n top: `${y}%`,\n }}\n title={\n \"Click to select marker answers or to delete marker. \" +\n \"Repositioning marker is not implemented.\"\n }\n >\n {showDropdown && (\n <div>\n <div\n className={css(\n styles.dropdownBody,\n styles.dropdownPositionWithArrow,\n )}\n >\n <Option value=\"\" onClick={() => onRemove()}>\n Delete marker\n </Option>\n\n <hr className={css(styles.dividerHorizontal)} />\n\n <OptionGroup\n onSelected={this.handleSelectAnswer}\n // TODO(WB-1096): make selectedValues immutable in wonder-blocks\n // $FlowFixMe[incompatible-type]\n selectedValues={answers}\n >\n {choices.map((choice) => (\n <Option key={choice} value={choice}>\n {choice}\n </Option>\n ))}\n </OptionGroup>\n\n <div className={css(styles.labelContainer)}>\n <FormWrappedTextField\n placeholder=\"ARIA label (for screen readers)\"\n onChange={this.handleLabelChange}\n value={label}\n width=\"100%\"\n />\n </div>\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n marker: {\n position: \"absolute\",\n\n boxSizing: \"content-box\",\n\n width: 16,\n height: 16,\n marginLeft: -8,\n marginTop: -8,\n\n cursor: \"pointer\",\n\n background:\n \"linear-gradient(to bottom, rgba(33, 36, 44, 0.2), rgba(33, 36, 44, 0.5))\",\n\n border: \"solid 2px #ffffff\",\n borderRadius: 16,\n\n boxShadow: \"0 2px 10px 0 rgba(33, 36, 44, 0.1)\",\n },\n\n markerSelected: {\n width: 28,\n height: 28,\n marginLeft: -12,\n marginTop: -12,\n\n border: \"none\",\n borderRadius: 28,\n\n // Render selected marker border as inset.\n \"::before\": {\n content: \"''\",\n display: \"block\",\n\n width: 20,\n height: 20,\n marginLeft: 2,\n marginTop: 2,\n\n border: \"solid 2px #ffffff\",\n borderRadius: 20,\n },\n },\n\n markerWithAnswers: {\n background: \"#1865f2\",\n },\n\n dropdownPositionWithArrow: {\n // Position dropdown to the top right of the marker.\n left: 46,\n bottom: -12,\n\n // With an arrow pointing left towards the marker.\n \"::before\": {\n content: \"''\",\n display: \"block\",\n position: \"absolute\",\n\n width: 0,\n height: 0,\n left: -16,\n bottom: 8,\n\n borderRight: `solid 16px ${colors.gray98}`,\n borderTop: \"solid 16px transparent\",\n borderBottom: \"solid 16px transparent\",\n },\n },\n\n labelContainer: {\n padding: 4,\n },\n\n dividerHorizontal: {\n height: 0,\n margin: 0,\n\n border: `solid ${colors.gray85}`,\n borderWidth: \"0 0 1px\",\n\n boxShadow: \"none\",\n },\n\n // TODO (josh): This should probably be its own component, rather than\n // sharing styles this way.\n dropdownBody: {\n position: \"absolute\",\n border: \"solid 1px rgba(0, 0, 0, 0.1)\",\n zIndex: globalConstants.zindexDropdown,\n color: colors.gray17,\n backgroundColor: colors.gray98,\n borderRadius: borderRadius,\n maxHeight: 320,\n cursor: \"pointer\",\n },\n});\n","// @flow\n/**\n * Controlled component to display question image and create markers to\n * label image with answers from list of choices.\n */\n\nimport {Util, Dependencies, globalStyles} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport Marker from \"./marker.jsx\";\n\nimport type {MarkerType} from \"@khanacademy/perseus\";\n\nconst {colors, typography} = globalStyles;\n\ntype QuestionMarkersProps = {|\n // The list of possible answers in a specific order.\n choices: $ReadOnlyArray<string>,\n\n // The question image properties.\n imageUrl: string,\n imageWidth: number,\n imageHeight: number,\n\n // The list of markers placed on the question image.\n markers: $ReadOnlyArray<MarkerType>,\n\n // Callback for when any of markers change.\n onChange: (markers: $ReadOnlyArray<MarkerType>) => void,\n|};\n\nexport default class QuestionMarkers extends React.Component<QuestionMarkersProps> {\n // eslint-disable-next-line flowtype/no-mutable-array\n _markers: Array<?Marker> = [];\n\n openDropdownForMarkerIndices(indices: $ReadOnlyArray<number>) {\n // Open answer selection dropdown for each of the specified markers.\n indices.forEach((index) => {\n if (this._markers[index]) {\n this._markers[index].openDropdown();\n }\n });\n }\n\n handleImageDoubleClick: (e: SyntheticMouseEvent<>) => void = (\n e: SyntheticMouseEvent<>,\n ) => {\n e.preventDefault();\n\n const rect =\n ((e.currentTarget: any): HTMLElement).getBoundingClientRect();\n\n // Calculate marker position on the question image as percentage offset\n // rounded to one decimal place.\n const x =\n Math.round(((e.clientX - rect.left) / rect.width) * 1000) / 10;\n const y =\n Math.round(((e.clientY - rect.top) / rect.height) * 1000) / 10;\n\n const {markers, onChange} = this.props;\n\n // Add the new marker to the end of the list.\n onChange([\n ...markers,\n {\n answers: [],\n label: \"\",\n x,\n y,\n },\n ]);\n };\n\n render(): React.Element<\"div\"> {\n const {choices, imageUrl, imageWidth, imageHeight, markers, onChange} =\n this.props;\n\n const staticUrl = Dependencies.getDependencies().staticUrl;\n\n // TODO(michaelpolyak): If a Graphie image is specified, only its SVG\n // layer will be rendered, as when rendering the full Graphie its\n // dynamic content may overflow the widget editor, CP-253\n return (\n <div>\n <div className={css(styles.title)}>Markers</div>\n\n <div className={css(styles.subtitle)}>\n {imageUrl ? (\n <span>\n Double-click on the image to add a marker.\n <br />\n <br />\n Markers are read by screen readers in the order that\n you add them here, so add in a logical order for the\n learner (e.g. sequentially, clockwise). You can test\n order by using keyboard tabbing.\n </span>\n ) : (\n \"Upload an image to place markers.\"\n )}\n </div>\n\n {imageUrl && (\n <div\n className={css(styles.markersCanvas)}\n style={{\n maxWidth: imageWidth,\n maxHeight: imageHeight,\n }}\n >\n <img\n alt=\"\"\n className={css(styles.image)}\n src={staticUrl(Util.getRealImageUrl(imageUrl))}\n onDoubleClick={this.handleImageDoubleClick}\n />\n\n {markers.map((marker, index) => (\n <Marker\n {...marker}\n choices={choices}\n key={`${marker.x}.${marker.y}`}\n // Update marker in the list.\n onChange={(marker) =>\n onChange([\n ...markers.slice(0, index),\n marker,\n ...markers.slice(index + 1),\n ])\n }\n // Remove marker from the list.\n onRemove={() =>\n onChange([\n ...markers.slice(0, index),\n ...markers.slice(index + 1),\n ])\n }\n ref={(node) => (this._markers[index] = node)}\n />\n ))}\n </div>\n )}\n </div>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n title: {\n ...typography.bodyXsmallBold,\n\n marginBottom: 6,\n\n color: colors.gray17,\n },\n\n subtitle: {\n ...typography.labelSmall,\n\n marginBottom: 12,\n\n color: colors.gray68,\n },\n\n markersCanvas: {\n position: \"relative\",\n\n border: \"solid 1px rgba(33, 36, 44, 0.16)\",\n },\n\n image: {\n // This makes `markersCanvas` have the same height as the image,\n // enabling to place markers precisely as they're positioned using\n // percentage offsets.\n display: \"block\",\n\n // Contain question image to the widget editor.\n maxWidth: \"100%\",\n },\n});\n","import _extends from '@babel/runtime/helpers/extends';\nimport { StyleSheet } from 'aphrodite';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport * as React from 'react';\nimport { Text } from '@khanacademy/wonder-blocks-core';\n\nconst Regular = 400;\nconst Bold = 700;\nconst Black = 900;\nconst mobile = \"@media (max-width: 1023px)\";\nconst desktop = \"@media (min-width: 1024px)\";\nconst common = {\n display: \"block\"\n};\nconst SansFamily = 'Lato, \"Noto Sans\", sans-serif';\nconst SerifFamily = '\"Noto Serif\", serif';\nconst InconsolataFamily = \"Inconsolata, monospace\";\nconst styles = StyleSheet.create({\n Title: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Black,\n [desktop]: {\n fontSize: 36,\n lineHeight: \"40px\"\n },\n [mobile]: {\n fontSize: 28,\n lineHeight: \"32px\"\n }\n }),\n Tagline: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 20,\n lineHeight: \"24px\"\n }),\n HeadingLarge: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Bold,\n [desktop]: {\n fontSize: 28,\n lineHeight: \"32px\"\n },\n [mobile]: {\n fontSize: 24,\n lineHeight: \"28px\"\n }\n }),\n HeadingMedium: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Bold,\n [desktop]: {\n fontSize: 24,\n lineHeight: \"28px\"\n },\n [mobile]: {\n fontSize: 22,\n lineHeight: \"26px\"\n }\n }),\n HeadingSmall: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Bold,\n fontSize: 20,\n lineHeight: \"24px\"\n }),\n HeadingXSmall: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Bold,\n fontSize: 12,\n lineHeight: \"16px\",\n letterSpacing: 0.6,\n textTransform: \"uppercase\"\n }),\n BodySerifBlock: _extends({}, common, {\n fontFamily: SerifFamily,\n fontWeight: Regular,\n fontSize: 22,\n lineHeight: \"28px\"\n }),\n BodySerif: _extends({}, common, {\n fontFamily: SerifFamily,\n fontWeight: Regular,\n fontSize: 18,\n lineHeight: \"22px\"\n }),\n BodyMonospace: _extends({}, common, {\n fontFamily: InconsolataFamily,\n fontWeight: Regular,\n fontSize: 17,\n lineHeight: \"22px\"\n }),\n Body: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 16,\n lineHeight: \"22px\"\n }),\n LabelLarge: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Bold,\n fontSize: 16,\n lineHeight: \"20px\"\n }),\n LabelMedium: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 16,\n lineHeight: \"20px\"\n }),\n LabelSmall: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 14,\n lineHeight: \"18px\"\n }),\n LabelXSmall: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 12,\n lineHeight: \"16px\"\n }),\n Caption: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 14,\n lineHeight: \"20px\"\n }),\n Footnote: _extends({}, common, {\n fontFamily: SansFamily,\n fontWeight: Regular,\n fontSize: 12,\n lineHeight: \"18px\"\n })\n});\n\nconst _excluded$f = [\"style\", \"children\"];\nclass Title extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$f);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.Title, style]\n }), children);\n }\n\n}\nTitle.defaultProps = {\n tag: \"h1\"\n};\n\nconst _excluded$e = [\"style\", \"children\"];\nclass HeadingLarge extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$e);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.HeadingLarge, style]\n }), children);\n }\n\n}\nHeadingLarge.defaultProps = {\n tag: \"h2\"\n};\n\nconst _excluded$d = [\"style\", \"children\"];\nclass HeadingMedium extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$d);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.HeadingMedium, style]\n }), children);\n }\n\n}\nHeadingMedium.defaultProps = {\n tag: \"h3\"\n};\n\nconst _excluded$c = [\"style\", \"children\"];\nclass HeadingSmall extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$c);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.HeadingSmall, style]\n }), children);\n }\n\n}\nHeadingSmall.defaultProps = {\n tag: \"h4\"\n};\n\nconst _excluded$b = [\"style\", \"children\"];\nclass HeadingXSmall extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$b);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.HeadingXSmall, style]\n }), children);\n }\n\n}\nHeadingXSmall.defaultProps = {\n tag: \"h4\"\n};\n\nconst _excluded$a = [\"style\", \"children\"];\nclass BodySerifBlock extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$a);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.BodySerifBlock, style]\n }), children);\n }\n\n}\nBodySerifBlock.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$9 = [\"style\", \"children\"];\nclass BodySerif extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$9);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.BodySerif, style]\n }), children);\n }\n\n}\nBodySerif.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$8 = [\"style\", \"children\"];\nclass BodyMonospace extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$8);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.BodyMonospace, style]\n }), children);\n }\n\n}\nBodyMonospace.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$7 = [\"style\", \"children\"];\nclass Body extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$7);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.Body, style]\n }), children);\n }\n\n}\nBody.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$6 = [\"style\", \"children\"];\nclass LabelLarge extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$6);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.LabelLarge, style]\n }), children);\n }\n\n}\nLabelLarge.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$5 = [\"style\", \"children\"];\nclass LabelMedium extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$5);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.LabelMedium, style]\n }), children);\n }\n\n}\nLabelMedium.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$4 = [\"style\", \"children\"];\nclass LabelSmall extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$4);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.LabelSmall, style]\n }), children);\n }\n\n}\nLabelSmall.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$3 = [\"style\", \"children\"];\nclass LabelXSmall extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$3);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.LabelXSmall, style]\n }), children);\n }\n\n}\nLabelXSmall.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$2 = [\"style\", \"children\"];\nclass Tagline extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$2);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.Tagline, style]\n }), children);\n }\n\n}\nTagline.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded$1 = [\"style\", \"children\"];\nclass Caption extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$1);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.Caption, style]\n }), children);\n }\n\n}\nCaption.defaultProps = {\n tag: \"span\"\n};\n\nconst _excluded = [\"style\", \"children\"];\nclass Footnote extends React.Component {\n render() {\n const _this$props = this.props,\n {\n style,\n children\n } = _this$props,\n otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded);\n\n return React.createElement(Text, _extends({}, otherProps, {\n style: [styles.Footnote, style]\n }), children);\n }\n\n}\nFootnote.defaultProps = {\n tag: \"span\"\n};\n\nexport { Body, BodyMonospace, BodySerif, BodySerifBlock, Caption, Footnote, HeadingLarge, HeadingMedium, HeadingSmall, HeadingXSmall, LabelLarge, LabelMedium, LabelSmall, LabelXSmall, Tagline, Title, styles };\n","import * as React from 'react';\nimport { StyleSheet } from 'aphrodite';\nimport { addStyle, View } from '@khanacademy/wonder-blocks-core';\nimport Color from '@khanacademy/wonder-blocks-color';\n\nconst heights = {\n xsmall: 16,\n small: 24,\n medium: 48,\n large: 96\n};\nconst paths = {\n xsmall: \"M7.237.741C7.165.393 6.95.154 6.656.053A1.01 1.01 0 0 0 6.18.01c-.053.009-.053.009-.087.017C2.553.949 0 4.214 0 7.91 0 12.36 3.598 16 8 16c4.4 0 8-3.647 8-8.112a1.02 1.02 0 0 0-.118-.423.877.877 0 0 0-.808-.48.909.909 0 0 0-.81.46c-.09.151-.13.296-.146.455-.08 3.493-2.737 6.207-6.118 6.207-3.41 0-6.118-2.74-6.118-6.196 0-2.843 1.936-5.291 4.644-6.022.1-.028.224-.082.352-.177a.928.928 0 0 0 .36-.97z\",\n small: \"M10.598.943c-.093-.449-.362-.748-.732-.875a1.314 1.314 0 0 0-.723-.033C3.83 1.417 0 6.317 0 11.864 0 18.538 5.398 24 12 24c6.598 0 12-5.471 12-12.16a1.333 1.333 0 0 0-.154-.548c-.193-.368-.544-.606-1.023-.606-.472 0-.825.229-1.035.585-.117.2-.169.39-.189.582-.124 5.472-4.294 9.73-9.599 9.73-5.349 0-9.599-4.3-9.599-9.72 0-4.46 3.036-8.299 7.28-9.444.127-.036.291-.107.458-.232.373-.28.57-.711.46-1.244z\",\n medium: \"M44.19 23.455a1.91 1.91 0 1 1 3.801 0h.003c.004.18.006.363.006.545 0 13.255-10.745 24-24 24S0 37.255 0 24 10.745 0 24 0c.182 0 .364.002.545.006V.01a1.91 1.91 0 1 1 0 3.801v.015A20.564 20.564 0 0 0 24 3.818C12.854 3.818 3.818 12.854 3.818 24c0 11.146 9.036 20.182 20.182 20.182 11.146 0 20.182-9.036 20.182-20.182 0-.182-.003-.364-.007-.545h.015z\",\n large: \"M88.38 46.91a3.818 3.818 0 1 1 7.602 0h.006c.008.362.012.725.012 1.09 0 26.51-21.49 48-48 48S0 74.51 0 48 21.49 0 48 0c.365 0 .728.004 1.09.012v.005a3.818 3.818 0 1 1 0 7.602v.032c-.362-.01-.725-.015-1.09-.015C25.708 7.636 7.636 25.708 7.636 48c0 22.292 18.072 40.364 40.364 40.364 22.292 0 40.364-18.072 40.364-40.364 0-.365-.005-.728-.015-1.09h.032z\"\n};\nconst colors = {\n light: Color.white,\n dark: Color.offBlack16\n};\nconst StyledPath = addStyle(\"path\");\nclass CircularSpinner extends React.Component {\n render() {\n const {\n size,\n light,\n style\n } = this.props;\n const height = heights[size];\n const path = paths[size];\n const color = light ? colors.light : colors.dark;\n const svg = React.createElement(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: height,\n height: height,\n viewBox: `0 0 ${height} ${height}`\n }, React.createElement(StyledPath, {\n style: [styles.loadingSpinner, {\n fill: color\n }],\n fillRule: \"nonzero\",\n d: path\n }));\n return React.createElement(View, {\n style: [styles.spinnerContainer, style]\n }, svg);\n }\n\n}\nCircularSpinner.defaultProps = {\n size: \"large\",\n light: false\n};\nconst rotateKeyFrames = {\n \"0%\": {\n transform: \"rotate(0deg)\"\n },\n \"50%\": {\n transform: \"rotate(180deg)\"\n },\n \"100%\": {\n transform: \"rotate(360deg)\"\n }\n};\nconst styles = StyleSheet.create({\n spinnerContainer: {\n justifyContent: \"center\"\n },\n loadingSpinner: {\n transformOrigin: \"50% 50%\",\n animationName: rotateKeyFrames,\n animationDuration: \"1.1s\",\n animationIterationCount: \"infinite\",\n animationTimingFunction: \"linear\"\n }\n});\n\nexport { CircularSpinner };\n","import _extends from '@babel/runtime/helpers/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport * as React from 'react';\nimport { StyleSheet } from 'aphrodite';\nimport { addStyle } from '@khanacademy/wonder-blocks-core';\n\nconst viewportPixelsForSize = size => ({\n small: 16,\n medium: 24,\n large: 48,\n xlarge: 96\n})[size];\nconst getPathForIcon = (icon, size) => {\n if (icon[size]) {\n return {\n assetSize: size,\n path: icon[size]\n };\n } else {\n const desiredPixelSize = viewportPixelsForSize(size);\n const availableSizes = Object.keys(icon);\n\n const sortFn = availableSize => {\n const availablePixelSize = viewportPixelsForSize(availableSize);\n const tooLargeByPixels = availablePixelSize - desiredPixelSize;\n return tooLargeByPixels > 0 ? Number.POSITIVE_INFINITY : Math.abs(tooLargeByPixels);\n };\n\n const assetSizes = availableSizes.sort((a, b) => sortFn(a) - sortFn(b));\n const bestAssetSize = assetSizes[0];\n\n if (bestAssetSize && icon[bestAssetSize]) {\n return {\n assetSize: bestAssetSize,\n path: icon[bestAssetSize]\n };\n } else {\n throw new Error(\"Icon does not contain any valid asset sizes!\");\n }\n }\n};\n\nconst _excluded = [\"color\", \"icon\", \"size\", \"style\"];\nconst StyledSVG = addStyle(\"svg\");\nclass Icon extends React.PureComponent {\n render() {\n const _this$props = this.props,\n {\n color,\n icon,\n size,\n style\n } = _this$props,\n sharedProps = _objectWithoutPropertiesLoose(_this$props, _excluded);\n\n const {\n assetSize,\n path\n } = getPathForIcon(icon, size);\n const pixelSize = viewportPixelsForSize(size);\n const viewboxPixelSize = viewportPixelsForSize(assetSize);\n return React.createElement(StyledSVG, _extends({}, sharedProps, {\n style: [styles.svg, style],\n width: pixelSize,\n height: pixelSize,\n viewBox: `0 0 ${viewboxPixelSize} ${viewboxPixelSize}`\n }), React.createElement(\"path\", {\n fill: color,\n d: path\n }));\n }\n\n}\nIcon.defaultProps = {\n color: \"currentColor\",\n size: \"small\"\n};\nconst styles = StyleSheet.create({\n svg: {\n display: \"inline-block\",\n verticalAlign: \"text-bottom\",\n flexShrink: 0,\n flexGrow: 0\n }\n});\n\nvar iconAssets = {\n add: {\n medium: \"M11 11V7a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2h-4v4a1 1 0 0 1-2 0v-4H7a1 1 0 0 1 0-2h4zm1 13C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z\"\n },\n caretDown: {\n small: \"M8 8.586l3.293-3.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L8 8.586z\",\n medium: \"M17.293 8.293a1 1 0 0 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 1.414-1.414L12 13.586l5.293-5.293z\"\n },\n caretLeft: {\n small: \"M7.414 8l3.293 3.293a1 1 0 0 1-1.414 1.414l-4-4a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 1.414L7.414 8z\",\n medium: \"M15.707 17.293a1 1 0 0 1-1.414 1.414l-6-6a1 1 0 0 1 0-1.414l6-6a1 1 0 0 1 1.414 1.414L10.414 12l5.293 5.293z\"\n },\n caretRight: {\n small: \"M8.586 8L5.293 4.707a1 1 0 0 1 1.414-1.414l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414-1.414L8.586 8z\",\n medium: \"M8.293 17.293a1 1 0 0 0 1.414 1.414l6-6a1 1 0 0 0 0-1.414l-6-6a1 1 0 0 0-1.414 1.414L13.586 12l-5.293 5.293z\"\n },\n caretUp: {\n small: \"M8 7.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L8 7.414z\",\n medium: \"M17.293 15.707a1 1 0 0 0 1.414-1.414l-6-6a1 1 0 0 0-1.414 0l-6 6a1 1 0 0 0 1.414 1.414L12 10.414l5.293 5.293z\"\n },\n check: {\n small: \"M6.072 10.4l6.175-7.058a1 1 0 1 1 1.506 1.317L6.769 12.64a1 1 0 0 1-1.55-.054L2.203 8.604a1 1 0 1 1 1.594-1.208L6.072 10.4z\"\n },\n contentArticle: {\n small: \"M11 12V8h2v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3v2H5v8h6zM9.5 6a.5.5 0 0 1-.5-.5V2l4 4H9.5z\",\n medium: \"M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm3-6v-4h2v5a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h3v2H9v8h6zm-1.5-6a.5.5 0 0 1-.5-.5V6l4 4h-3.5z\"\n },\n contentExercise: {\n small: \"M7.5 6.914L5 9.414V11h1.586l2.5-2.5L7.5 6.914zM8.914 5.5L10.5 7.086 11.586 6 10 4.414 8.914 5.5zM3 9a1 1 0 0 1 .293-.707l6-6a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-6 6A1 1 0 0 1 7 13H4a1 1 0 0 1-1-1V9z\",\n medium: \"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm-.5-11.086l1.586 1.586-2.5 2.5H9v-1.586l2.5-2.5zM12.914 9.5L14 8.414 15.586 10 14.5 11.086 12.914 9.5zM12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zM7 13v3a1 1 0 0 0 1 1h3a1 1 0 0 0 .707-.293l6-6a1 1 0 0 0 0-1.414l-3-3a1 1 0 0 0-1.414 0l-6 6A1 1 0 0 0 7 13z\"\n },\n contentVideo: {\n small: \"M6 5.87v4.263l3.197-2.131L6 5.87zm-.445-2.7l6 4a1 1 0 0 1 0 1.664l-6 4A1 1 0 0 1 4 12.002v-8a1 1 0 0 1 1.555-.832z\",\n medium: \"M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM10.555 7.17l6 4a1 1 0 0 1 0 1.664l-6 4A1 1 0 0 1 9 16.002v-8a1 1 0 0 1 1.555-.832zM11 14.133l3.197-2.131L11 9.87v4.263z\"\n },\n correct: {\n medium: \"M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm-1.928-7.6l6.175-7.058a1 1 0 1 1 1.506 1.317l-6.984 7.981a1 1 0 0 1-1.55-.054l-3.016-3.982a1 1 0 0 1 1.594-1.208l2.275 3.003z\"\n },\n delete: {\n medium: \"M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm-5-9a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2H7z\"\n },\n dismiss: {\n small: \"M8 6.586l3.293-3.293a1 1 0 0 1 1.414 1.414L9.414 8l3.293 3.293a1 1 0 0 1-1.414 1.414L8 9.414l-3.293 3.293a1 1 0 1 1-1.414-1.414L6.586 8 3.293 4.707a1 1 0 0 1 1.414-1.414L8 6.586z\",\n medium: \"M12 10.586L7.706 6.293a1 1 0 1 0-1.413 1.413L10.586 12l-4.293 4.294a1 1 0 0 0 1.413 1.413L12 13.414l4.294 4.293a1 1 0 0 0 1.413-1.413L13.414 12l4.293-4.294a1 1 0 1 0-1.413-1.413L12 10.586z\"\n },\n hint: {\n medium: \"M10.835 15.993a1 1 0 0 1 1.008-.247 5.5 5.5 0 1 0-3.59-3.59 1 1 0 0 1-.246 1.009L6.172 15 9 17.828l1.835-1.835zm-.78 3.61a1.496 1.496 0 0 1-2.11 0l-3.548-3.549a1.496 1.496 0 0 1 0-2.108l1.787-1.787a7.5 7.5 0 1 1 5.657 5.657l-1.787 1.787zm-6.762.104a1 1 0 0 1 1.414-1.414l1 1a1 1 0 0 1-1.414 1.414l-1-1z\"\n },\n incorrect: {\n medium: \"M12 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414L13.414 12l3.293 3.293a1 1 0 0 1-1.414 1.414L12 13.414l-3.293 3.293a1 1 0 1 1-1.414-1.414L10.586 12 7.293 8.707a1 1 0 0 1 1.414-1.414L12 10.586zM12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z\"\n },\n info: {\n small: \"M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm0-2A6 6 0 1 0 8 2a6 6 0 0 0 0 12zM7 8a1 1 0 1 1 2 0v3a1 1 0 0 1-2 0V8zm1-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2z\"\n },\n search: {\n small: \"M11.172 9.757l2.535 2.536a1 1 0 0 1-1.414 1.414l-2.536-2.535a5 5 0 1 1 1.414-1.414zM7 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6z\",\n medium: \"M11 17a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm6.32-1.094l3.387 3.387a1 1 0 0 1-1.414 1.414l-3.387-3.387a8 8 0 1 1 1.414-1.414z\"\n },\n sortableArrowDown: {\n small: \"M7 9.586V4a1 1 0 1 1 2 0v5.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L7 9.586z\"\n },\n sortableArrowUp: {\n small: \"M9 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-4-4a1 1 0 0 0-1.414 0l-4 4a1 1 0 0 0 1.414 1.414L7 6.414V12a1 1 0 1 0 2 0V6.414z\"\n },\n zoomIn: {\n medium: \"M17.32 15.906l3.387 3.387a1 1 0 0 1-1.414 1.414l-3.387-3.387a8 8 0 1 1 1.414-1.414zM12 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H8a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2zm-1 7a6 6 0 1 0 0-12 6 6 0 0 0 0 12z\"\n },\n zoomOut: {\n medium: \"M17.32 15.906l3.387 3.387a1 1 0 0 1-1.414 1.414l-3.387-3.387a8 8 0 1 1 1.414-1.414zM11 17a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8z\"\n }\n};\n\nexport { Icon as default, iconAssets as icons };\n","const Spacing = {\n // Named\n xxxxSmall_2: 2,\n xxxSmall_4: 4,\n xxSmall_6: 6,\n xSmall_8: 8,\n small_12: 12,\n medium_16: 16,\n large_24: 24,\n xLarge_32: 32,\n xxLarge_48: 48,\n xxxLarge_64: 64\n};\n\nexport default Spacing;\n","import _extends from '@babel/runtime/helpers/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport * as React from 'react';\nimport { __RouterContext } from 'react-router';\nimport { isClientSideUrl, getClickableBehavior } from '@khanacademy/wonder-blocks-clickable';\nimport { StyleSheet } from 'aphrodite';\nimport { Link } from 'react-router-dom';\nimport { LabelSmall, LabelLarge } from '@khanacademy/wonder-blocks-typography';\nimport Color, { SemanticColor, mix, fade } from '@khanacademy/wonder-blocks-color';\nimport { addStyle } from '@khanacademy/wonder-blocks-core';\nimport { CircularSpinner } from '@khanacademy/wonder-blocks-progress-spinner';\nimport Icon from '@khanacademy/wonder-blocks-icon';\nimport Spacing from '@khanacademy/wonder-blocks-spacing';\n\nconst _excluded$1 = [\"children\", \"skipClientNav\", \"color\", \"disabled\", \"focused\", \"hovered\", \"href\", \"kind\", \"light\", \"pressed\", \"size\", \"style\", \"testId\", \"type\", \"spinner\", \"icon\", \"id\", \"waiting\"];\nconst StyledAnchor = addStyle(\"a\");\nconst StyledButton = addStyle(\"button\");\nconst StyledLink = addStyle(Link);\nclass ButtonCore extends React.Component {\n renderInner(router) {\n const _this$props = this.props,\n {\n children,\n skipClientNav,\n color,\n disabled: disabledProp,\n focused,\n hovered,\n href = undefined,\n kind,\n light,\n pressed,\n size,\n style,\n testId,\n type = undefined,\n spinner,\n icon,\n id\n } = _this$props,\n restProps = _objectWithoutPropertiesLoose(_this$props, _excluded$1);\n\n const buttonColor = color === \"destructive\" ? SemanticColor.controlDestructive : SemanticColor.controlDefault;\n const iconWidth = icon ? (size === \"small\" ? 16 : 24) + 8 : 0;\n\n const buttonStyles = _generateStyles(buttonColor, kind, light, iconWidth, size);\n\n const disabled = spinner || disabledProp;\n const defaultStyle = [sharedStyles.shared, disabled && sharedStyles.disabled, icon && sharedStyles.withIcon, buttonStyles.default, disabled && buttonStyles.disabled, kind !== \"tertiary\" && !disabled && (pressed ? buttonStyles.active : (hovered || focused) && buttonStyles.focus), size === \"small\" && sharedStyles.small, size === \"xlarge\" && sharedStyles.xlarge];\n\n const commonProps = _extends({\n \"data-test-id\": testId,\n id: id,\n role: \"button\",\n style: [defaultStyle, style]\n }, restProps);\n\n const Label = size === \"small\" ? LabelSmall : LabelLarge;\n const label = React.createElement(Label, {\n style: [sharedStyles.text, size === \"xlarge\" && sharedStyles.xlargeText, icon && sharedStyles.textWithIcon, spinner && sharedStyles.hiddenText, kind === \"tertiary\" && sharedStyles.textWithFocus, kind === \"tertiary\" && !disabled && (pressed ? buttonStyles.active : (hovered || focused) && buttonStyles.focus)]\n }, icon && React.createElement(Icon, {\n size: size,\n color: \"currentColor\",\n icon: icon,\n style: sharedStyles.icon\n }), children);\n const contents = React.createElement(React.Fragment, null, label, spinner && React.createElement(CircularSpinner, {\n style: sharedStyles.spinner,\n size: {\n medium: \"small\",\n small: \"xsmall\",\n xlarge: \"medium\"\n }[size],\n light: kind === \"primary\"\n }));\n\n if (href && !disabled) {\n return router && !skipClientNav && isClientSideUrl(href) ? React.createElement(StyledLink, _extends({}, commonProps, {\n to: href\n }), contents) : React.createElement(StyledAnchor, _extends({}, commonProps, {\n href: href\n }), contents);\n } else {\n return React.createElement(StyledButton, _extends({\n type: type || \"button\"\n }, commonProps, {\n \"aria-disabled\": disabled\n }), contents);\n }\n }\n\n render() {\n return React.createElement(__RouterContext.Consumer, null, router => this.renderInner(router));\n }\n\n}\nconst sharedStyles = StyleSheet.create({\n shared: {\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: 40,\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 16,\n paddingRight: 16,\n border: \"none\",\n borderRadius: 4,\n cursor: \"pointer\",\n outline: \"none\",\n textDecoration: \"none\",\n boxSizing: \"border-box\",\n touchAction: \"manipulation\",\n userSelect: \"none\",\n \":focus\": {\n WebkitTapHighlightColor: \"rgba(0,0,0,0)\"\n }\n },\n withIcon: {\n paddingLeft: 12\n },\n disabled: {\n cursor: \"auto\"\n },\n small: {\n height: 32\n },\n xlarge: {\n height: 60\n },\n text: {\n alignItems: \"center\",\n fontWeight: \"bold\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n display: \"inline-block\",\n pointerEvents: \"none\"\n },\n xlargeText: {\n fontSize: 18,\n lineHeight: \"20px\"\n },\n textWithIcon: {\n display: \"flex\"\n },\n textWithFocus: {\n position: \"relative\"\n },\n hiddenText: {\n visibility: \"hidden\"\n },\n spinner: {\n position: \"absolute\"\n },\n icon: {\n paddingRight: Spacing.xSmall_8\n }\n});\nconst styles = {};\n\nconst _generateStyles = (color, kind, light, iconWidth, size) => {\n const buttonType = color + kind + light.toString() + iconWidth.toString() + size;\n\n if (styles[buttonType]) {\n return styles[buttonType];\n }\n\n const {\n white,\n white50,\n white64,\n offBlack32,\n offBlack50,\n darkBlue\n } = Color;\n const fadedColor = mix(fade(color, 0.32), white);\n const activeColor = mix(offBlack32, color);\n const padding = size === \"xlarge\" ? Spacing.xLarge_32 : Spacing.medium_16;\n let newStyles = {};\n\n if (kind === \"primary\") {\n newStyles = {\n default: {\n background: light ? white : color,\n color: light ? color : white,\n paddingLeft: padding,\n paddingRight: padding\n },\n focus: {\n boxShadow: `0 0 0 1px ${light ? darkBlue : white}, 0 0 0 3px ${light ? white : color}`\n },\n active: {\n boxShadow: `0 0 0 1px ${light ? darkBlue : white}, 0 0 0 3px ${light ? fadedColor : activeColor}`,\n background: light ? fadedColor : activeColor,\n color: light ? activeColor : fadedColor\n },\n disabled: {\n background: light ? fadedColor : offBlack32,\n color: light ? color : white64,\n cursor: \"default\",\n \":focus\": {\n boxShadow: `0 0 0 1px ${light ? offBlack32 : white}, 0 0 0 3px ${light ? fadedColor : offBlack32}`\n }\n }\n };\n } else if (kind === \"secondary\") {\n newStyles = {\n default: {\n background: \"none\",\n color: light ? white : color,\n borderColor: light ? white50 : offBlack50,\n borderStyle: \"solid\",\n borderWidth: 1,\n paddingLeft: iconWidth ? padding - 4 : padding,\n paddingRight: padding\n },\n focus: {\n background: light ? \"transparent\" : white,\n borderColor: light ? white : color,\n borderWidth: 2,\n paddingLeft: iconWidth ? padding - 5 : padding - 1,\n paddingRight: padding - 1\n },\n active: {\n background: light ? activeColor : fadedColor,\n color: light ? fadedColor : activeColor,\n borderColor: light ? fadedColor : activeColor,\n borderWidth: 2,\n paddingLeft: iconWidth ? padding - 5 : padding - 1,\n paddingRight: padding - 1\n },\n disabled: {\n color: light ? white50 : offBlack32,\n borderColor: light ? fadedColor : offBlack32,\n cursor: \"default\",\n \":focus\": {\n borderColor: light ? white50 : offBlack32,\n borderWidth: 2,\n paddingLeft: iconWidth ? padding - 5 : padding - 1,\n paddingRight: padding - 1\n }\n }\n };\n } else if (kind === \"tertiary\") {\n newStyles = {\n default: {\n background: \"none\",\n color: light ? white : color,\n paddingLeft: 0,\n paddingRight: 0\n },\n focus: {\n \":after\": {\n content: \"''\",\n position: \"absolute\",\n height: 2,\n width: `calc(100% - ${iconWidth}px)`,\n right: 0,\n bottom: 0,\n background: light ? white : color,\n borderRadius: 2\n }\n },\n active: {\n color: light ? fadedColor : activeColor,\n \":after\": {\n content: \"''\",\n position: \"absolute\",\n height: 2,\n width: `calc(100% - ${iconWidth}px)`,\n right: 0,\n bottom: \"calc(50% - 11px)\",\n background: light ? fadedColor : activeColor,\n borderRadius: 2\n }\n },\n disabled: {\n color: light ? fadedColor : offBlack32,\n cursor: \"default\"\n }\n };\n } else {\n throw new Error(\"Button kind not recognized\");\n }\n\n styles[buttonType] = StyleSheet.create(newStyles);\n return styles[buttonType];\n};\n\nconst _excluded = [\"href\", \"type\", \"children\", \"skipClientNav\", \"spinner\", \"disabled\", \"onClick\", \"beforeNav\", \"safeWithNav\", \"tabIndex\", \"target\", \"rel\"],\n _excluded2 = [\"tabIndex\"];\nclass Button extends React.Component {\n renderClickableBehavior(router) {\n const _this$props = this.props,\n {\n href = undefined,\n type = undefined,\n children,\n skipClientNav,\n spinner,\n disabled,\n onClick,\n beforeNav = undefined,\n safeWithNav = undefined,\n tabIndex,\n target,\n rel\n } = _this$props,\n sharedButtonCoreProps = _objectWithoutPropertiesLoose(_this$props, _excluded);\n\n const ClickableBehavior = getClickableBehavior(href, skipClientNav, router);\n\n const renderProp = (state, _ref) => {\n let {\n tabIndex: clickableTabIndex\n } = _ref,\n restChildProps = _objectWithoutPropertiesLoose(_ref, _excluded2);\n\n return React.createElement(ButtonCore, _extends({}, sharedButtonCoreProps, state, restChildProps, {\n disabled: disabled,\n spinner: spinner || state.waiting,\n skipClientNav: skipClientNav,\n href: href,\n target: target,\n type: type,\n tabIndex: tabIndex || clickableTabIndex\n }), children);\n };\n\n if (beforeNav) {\n return React.createElement(ClickableBehavior, {\n disabled: spinner || disabled,\n href: href,\n role: \"button\",\n type: type,\n onClick: onClick,\n beforeNav: beforeNav,\n safeWithNav: safeWithNav,\n rel: rel\n }, renderProp);\n } else {\n return React.createElement(ClickableBehavior, {\n disabled: spinner || disabled,\n href: href,\n role: \"button\",\n type: type,\n onClick: onClick,\n safeWithNav: safeWithNav,\n target: target,\n rel: rel\n }, renderProp);\n }\n }\n\n render() {\n return React.createElement(__RouterContext.Consumer, null, router => this.renderClickableBehavior(router));\n }\n\n}\nButton.defaultProps = {\n color: \"default\",\n kind: \"primary\",\n light: false,\n size: \"medium\",\n disabled: false,\n spinner: false\n};\n\nexport { Button as default };\n","// @flow\n/**\n * Controlled component for selecting the question image, for answer labeling.\n */\n\nimport {globalStyles} from \"@khanacademy/perseus\";\nimport Button from \"@khanacademy/wonder-blocks-button\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport FormWrappedTextField from \"../../components/form-wrapped-text-field.jsx\";\n\nconst {colors, typography} = globalStyles;\n\ntype SelectImageProps = {\n // Callback for when image URL is changed.\n onChange: (url: string) => void,\n // The selected image URL.\n url: string,\n ...\n};\n\nconst SelectImage = ({\n onChange,\n url,\n}: SelectImageProps): React.Element<\"div\"> => (\n <div>\n <div className={css(styles.title)}>Image</div>\n\n <div className={css(styles.components)}>\n <FormWrappedTextField\n placeholder=\"URL\"\n grow={1}\n onChange={(e) => onChange(e.target.value)}\n value={url}\n />\n\n <div className={css(styles.spacer)} />\n\n <Button\n // TODO(michaelpolyak): Design calls for uploading an image from\n // the widget. This functionality already exists in\n // `perseus-one-package/item-controls.jsx`, it's not obvious if\n // it can be triggered from within the widget, or requires\n // a similar implementation locally, in which case consider\n // refactoring `perseus-admin-package/image-upload-dialog.jsx`\n // as common utility, CP-118\n disabled={!url}\n aria-label={\n url\n ? \"\"\n : \"Not implemented. Use the 'Add Image' button in \" +\n \"the editor to upload image, then copy the URL here.\"\n }\n onClick={() => onChange(\"\")}\n style={styles.btn}\n >\n {url ? \"Remove\" : \"Upload\"}\n </Button>\n </div>\n </div>\n);\n\nconst styles = StyleSheet.create({\n title: {\n ...typography.bodyXsmallBold,\n\n marginBottom: 6,\n\n color: colors.gray17,\n },\n\n components: {\n display: \"flex\",\n },\n\n spacer: {\n width: 16,\n },\n\n btn: {\n minWidth: 90,\n },\n});\n\nexport default SelectImage;\n","// @flow\n/**\n * Direct image labeling widget editor.\n *\n * Label on image widget enables creating more natural, conceptual questions\n * that involve the use of images, and enable learners to demonstrate their\n * knowledge by directly interacting with the image.\n */\n\nimport {EditorJsonify, Util} from \"@khanacademy/perseus\";\nimport {StyleSheet, css} from \"aphrodite\";\nimport * as React from \"react\";\n\nimport FormWrappedTextField from \"../components/form-wrapped-text-field.jsx\";\n\nimport AnswerChoices from \"./label-image/answer-choices.jsx\";\nimport Behavior from \"./label-image/behavior.jsx\";\nimport QuestionMarkers from \"./label-image/question-markers.jsx\";\nimport SelectImage from \"./label-image/select-image.jsx\";\n\nimport type {MarkerType} from \"@khanacademy/perseus\";\n\ntype LabelImageEditorProps = {|\n // List of answer choices to label question image with.\n choices: $ReadOnlyArray<string>,\n\n // The question image properties.\n imageAlt: string,\n imageUrl: string,\n imageWidth: number,\n imageHeight: number,\n\n // The list of label markers on the question image.\n markers: $ReadOnlyArray<MarkerType>,\n\n // Whether multiple answer choices may be selected for markers.\n multipleAnswers: boolean,\n\n // Whether to hide answer choices from user instructions.\n hideChoicesFromInstructions: boolean,\n\n // Callback for when a widget prop is changed.\n onChange: (options: Object) => void,\n|};\n\nclass LabelImageEditor extends React.Component<LabelImageEditorProps> {\n _questionMarkers: ?QuestionMarkers;\n\n static defaultProps: {|\n choices: $ReadOnlyArray<any>,\n hideChoicesFromInstructions: boolean,\n imageAlt: string,\n imageHeight: number,\n imageUrl: string,\n imageWidth: number,\n markers: $ReadOnlyArray<any>,\n multipleAnswers: boolean,\n |} = {\n choices: [],\n imageAlt: \"\",\n imageUrl: \"\",\n imageWidth: 0,\n imageHeight: 0,\n markers: [],\n multipleAnswers: false,\n hideChoicesFromInstructions: false,\n };\n\n static widgetName: string = \"label-image\";\n\n componentDidUpdate(prevProps: LabelImageEditorProps) {\n const coordsToMarkers = {};\n\n prevProps.markers.forEach(\n (marker) => (coordsToMarkers[`${marker.x}.${marker.y}`] = marker),\n );\n\n // Find the newly added marker indices.\n const newIndices = this.props.markers\n .map((marker, index) =>\n coordsToMarkers.hasOwnProperty(`${marker.x}.${marker.y}`)\n ? -1\n : index,\n )\n .filter((index) => index !== -1);\n\n // Automatically reveal their dropdowns as a prompt to the content\n // creator to select answers and set the ARIA label.\n if (newIndices.length && this._questionMarkers) {\n this._questionMarkers.openDropdownForMarkerIndices(newIndices);\n }\n }\n\n getSaveWarnings: () => $ReadOnlyArray<any | string> = () => {\n const {choices, imageAlt, imageUrl, markers} = this.props;\n\n const warnings = [];\n\n if (choices.length < 2) {\n warnings.push(\"Question requires at least two answer choices\");\n }\n\n if (!imageUrl) {\n warnings.push(\"Image is not specified for question\");\n } else if (!imageAlt) {\n warnings.push(\"Question image has no alt text\");\n }\n\n if (!markers.length) {\n warnings.push(\"Question has no markers, to label answers on image\");\n } else {\n let numNoAnswers = 0;\n let numNoLabels = 0;\n\n for (const marker of markers) {\n if (!marker.answers.length) {\n numNoAnswers++;\n }\n\n if (!marker.label) {\n numNoLabels++;\n }\n }\n\n if (numNoAnswers) {\n warnings.push(\n `Question has ${numNoAnswers} markers with no ` +\n \"answers selected\",\n );\n }\n\n if (numNoLabels) {\n warnings.push(\n `Question has ${numNoLabels} markers with no ` +\n \"ARIA label\",\n );\n }\n }\n\n return warnings;\n };\n\n serialize(): any {\n return EditorJsonify.serialize.call(this);\n }\n\n handleImageChange: (url: string) => void = (url: string) => {\n this.props.onChange({\n imageUrl: url,\n // Initially reset image size when URL is changed so it can be later\n // measured.\n imageWidth: 0,\n imageHeight: 0,\n });\n\n if (url) {\n Util.getImageSize(url, (width, height) => {\n this.props.onChange({\n imageWidth: width,\n imageHeight: height,\n });\n });\n }\n };\n\n handleAltChange: (alt: string) => void = (alt: string) => {\n this.props.onChange({imageAlt: alt});\n };\n\n handleChoicesChange: (choices: $ReadOnlyArray<string>) => void = (\n choices: $ReadOnlyArray<string>,\n ) => {\n this.props.onChange({choices});\n };\n\n handleMarkersChange: (markers: $ReadOnlyArray<MarkerType>) => void = (\n markers: $ReadOnlyArray<MarkerType>,\n ) => {\n this.props.onChange({markers});\n };\n\n handleBehaviorChange: (options: any) => void = (options: Object) => {\n this.props.onChange(options);\n };\n\n render(): React.Element<\"div\"> {\n const {\n choices,\n imageAlt,\n imageUrl,\n imageWidth,\n imageHeight,\n markers,\n multipleAnswers,\n hideChoicesFromInstructions,\n } = this.props;\n\n const imageSelected = imageUrl && imageWidth > 0 && imageHeight > 0;\n\n return (\n <div>\n <SelectImage onChange={this.handleImageChange} url={imageUrl} />\n\n <div className={css(styles.smallSpacer)} />\n\n {imageSelected && (\n <FormWrappedTextField\n placeholder=\"Alt text (for screen readers)\"\n onChange={(e) => this.handleAltChange(e.target.value)}\n value={imageAlt}\n width=\"100%\"\n />\n )}\n\n <div className={css(styles.largeSpacer)} />\n\n <QuestionMarkers\n choices={choices}\n imageUrl={imageSelected ? imageUrl : \"\"}\n imageWidth={imageWidth}\n imageHeight={imageHeight}\n markers={markers}\n onChange={this.handleMarkersChange}\n ref={(node) => (this._questionMarkers = node)}\n />\n\n <div className={css(styles.largeSpacer)} />\n\n <AnswerChoices\n choices={choices}\n onChange={this.handleChoicesChange}\n />\n\n <div className={css(styles.largeSpacer)} />\n\n <Behavior\n multipleAnswers={multipleAnswers}\n hideChoicesFromInstructions={hideChoicesFromInstructions}\n onChange={this.handleBehaviorChange}\n />\n </div>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n largeSpacer: {\n height: 32,\n },\n\n smallSpacer: {\n height: 16,\n },\n});\n\nexport default LabelImageEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InfoTip, NumberInput, PropCheckBox} = components;\n\nconst MAX_SIZE = 8;\n\n// styling\nconst CELL_PADDING = 5;\n\nconst TABLE_STYLE = {\n display: \"table\",\n tableLayout: \"fixed\",\n};\n\nconst ROW_STYLE = {\n display: \"table-row\",\n};\n\nconst CELL_STYLE = {\n display: \"table-cell\",\n padding: CELL_PADDING,\n};\n\nconst BASE_TILE_STYLE = {\n borderRadius: 10,\n cursor: \"pointer\",\n};\n\nconst PATTERNS = {\n plus: () => [\n [false, true, false],\n [true, true, true],\n [false, true, false],\n ],\n x: () => [\n [true, false, true],\n [false, true, false],\n [true, false, true],\n ],\n \"plus/x\": (iter) => {\n return iter % 2 ? PATTERNS.x() : PATTERNS.plus();\n },\n};\n\n/**\n * Clamps value to an integer in the range [min, max]\n */\nconst clampToInt = function (value, min, max) {\n value = Math.floor(value);\n value = Math.max(value, min);\n value = Math.min(value, max);\n return value;\n};\n\n// Returns a copy of the tiles, with tiles flipped according to\n// whether or not their y, x position satisfies the predicate\nconst flipTilesPredicate = (oldCells, predicate) => {\n return _.map(oldCells, (row, y) => {\n return _.map(row, (cell, x) => {\n return predicate(y, x) ? !cell : cell;\n });\n });\n};\n\ntype TileProps = $FlowFixMe;\n\n// A single glowy cell\nclass Tile extends React.Component<TileProps> {\n static propTypes = {\n value: PropTypes.bool.isRequired,\n size: PropTypes.number.isRequired,\n };\n\n render(): React.Node {\n const color = this.props.value ? \"#55dd55\" : \"#115511\";\n const style = _.extend({}, BASE_TILE_STYLE, {\n width: this.props.size,\n height: this.props.size,\n backgroundColor: color,\n });\n return <div style={style} onClick={this._flip} />;\n }\n\n _flip = () => {\n this.props.onChange(!this.props.value);\n };\n}\n\ntype TileGridProps = $FlowFixMe;\n\n// A grid of glowy cells\nclass TileGrid extends React.Component<TileGridProps> {\n static propTypes = {\n cells: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.bool)).isRequired,\n size: PropTypes.number.isRequired,\n };\n\n render(): React.Node {\n return (\n <div style={TABLE_STYLE} className=\"no-select\">\n {_.map(this.props.cells, (row, y) => {\n return (\n <div key={y} style={ROW_STYLE}>\n {_.map(row, (cell, x) => {\n return (\n <div key={x} style={CELL_STYLE}>\n <Tile\n value={cell}\n size={this.props.size}\n onChange={_.partial(\n this.props.onChange,\n y,\n x,\n )}\n />\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n );\n }\n}\n\ntype LightsPuzzleEditorProps = $FlowFixMe;\n\n// The widget editor\nclass LightsPuzzleEditor extends React.Component<LightsPuzzleEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n startCells: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.bool)),\n flipPattern: PropTypes.string.isRequired,\n gradeIncompleteAsWrong: PropTypes.bool.isRequired,\n };\n\n static widgetName: \"lights-puzzle\" = \"lights-puzzle\";\n\n static defaultProps: LightsPuzzleEditorProps = {\n startCells: [\n [false, false, false],\n [false, false, false],\n [false, false, false],\n ],\n flipPattern: \"plus\",\n gradeIncompleteAsWrong: false,\n };\n\n _height: () => number = () => {\n return this.props.startCells.length;\n };\n\n _width: () => number = () => {\n if (this.props.startCells.length !== 0) {\n return this.props.startCells[0].length;\n }\n return 0; // default to 0\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n return (\n <div>\n <div>\n Width:\n <NumberInput\n value={this._width()}\n placeholder={5}\n onChange={this._changeWidth}\n />\n {\", \"}\n Height:\n <NumberInput\n value={this._height()}\n placeholder={5}\n onChange={this._changeHeight}\n />\n </div>\n <div>\n Flip pattern:\n <select\n value={this.props.flipPattern}\n onChange={this._handlePatternChange}\n >\n {_.map(_.keys(PATTERNS), (pattern, i) => {\n return (\n <option value={pattern} key={i}>\n {pattern}\n </option>\n );\n })}\n </select>\n </div>\n <div>\n Grade incomplete puzzles as wrong:{\" \"}\n <PropCheckBox\n gradeIncompleteAsWrong={\n this.props.gradeIncompleteAsWrong\n }\n onChange={this.props.onChange}\n />\n <InfoTip>\n By default, incomplete puzzles are graded as empty.\n </InfoTip>\n </div>\n <div>Starting configuration:</div>\n <div style={{overflowX: \"auto\"}}>\n <TileGrid\n cells={this.props.startCells}\n size={50}\n onChange={this._switchTile}\n />\n </div>\n </div>\n );\n }\n\n _handlePatternChange: (SyntheticInputEvent<>) => void = (e) => {\n this.change(\"flipPattern\", e.target.value);\n };\n\n _changeWidth: (number) => void = (newWidth) => {\n newWidth = clampToInt(newWidth, 1, MAX_SIZE);\n this._truncateCells(newWidth, this._height());\n };\n\n _changeHeight: (number) => void = (newHeight) => {\n newHeight = clampToInt(newHeight, 1, MAX_SIZE);\n this._truncateCells(this._width(), newHeight);\n };\n\n _truncateCells: (number, number) => void = (newWidth, newHeight) => {\n const newCells = _.times(newHeight, (y) => {\n return _.times(newWidth, (x) => {\n // explicitly cast the result to a boolean with !!\n return !!(\n this.props.startCells[y] && this.props.startCells[y][x]\n );\n });\n });\n\n this.change({startCells: newCells});\n };\n\n _switchTile: (number, number) => void = (tileY, tileX) => {\n const newCells = flipTilesPredicate(this.props.startCells, (y, x) => {\n return y === tileY && x === tileX;\n });\n\n this.change({startCells: newCells});\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default LightsPuzzleEditor;\n","/* eslint-disable react/forbid-prop-types, react/sort-comp */\n// @flow\nimport {components} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InfoTip, PropCheckBox, TextListEditor} = components;\n\ntype Props = $FlowFixMe;\n\nclass MatcherEditor extends React.Component<Props> {\n static propTypes = {\n left: PropTypes.array,\n right: PropTypes.array,\n labels: PropTypes.array,\n orderMatters: PropTypes.bool,\n padding: PropTypes.bool,\n };\n\n static widgetName: \"matcher\" = \"matcher\";\n\n static defaultProps: Props = {\n left: [\"$x$\", \"$y$\", \"$z$\"],\n right: [\"$1$\", \"$2$\", \"$3$\"],\n labels: [\"test\", \"label\"],\n orderMatters: false,\n padding: true,\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-matcher-editor\">\n <div>\n {\" \"}\n Correct answer:{\" \"}\n <InfoTip>\n <p>\n Enter the correct answers here. The preview on the\n right will show the cards in a randomized order,\n which is how the student will see them.\n </p>\n </InfoTip>\n </div>\n <div className=\"perseus-clearfix\">\n <TextListEditor\n options={this.props.left}\n onChange={(options, cb) => {\n this.props.onChange({left: options}, cb);\n }}\n layout=\"vertical\"\n />\n <TextListEditor\n options={this.props.right}\n onChange={(options, cb) => {\n this.props.onChange({right: options}, cb);\n }}\n layout=\"vertical\"\n />\n </div>\n <span>\n {\" \"}\n Labels:{\" \"}\n <InfoTip>\n <p>These are entirely optional.</p>\n </InfoTip>\n </span>\n <div>\n <input\n type=\"text\"\n defaultValue={this.props.labels[0]}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onLabelChange.bind(this, 0)}\n />\n <input\n type=\"text\"\n defaultValue={this.props.labels[1]}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onLabelChange.bind(this, 1)}\n />\n </div>\n <div>\n <PropCheckBox\n label=\"Order of the matched pairs matters:\"\n orderMatters={this.props.orderMatters}\n onChange={this.props.onChange}\n />\n <InfoTip>\n <p>\n With this option enabled, only the order provided\n above will be treated as correct. This is useful\n when ordering is significant, such as in the context\n of a proof.\n </p>\n <p>\n If disabled, pairwise matching is sufficient. To\n make this clear, the left column becomes fixed in\n the provided order and only the cards in the right\n column can be moved.\n </p>\n </InfoTip>\n </div>\n <div>\n <PropCheckBox\n label=\"Padding:\"\n padding={this.props.padding}\n onChange={this.props.onChange}\n />\n <InfoTip>\n <p>\n Padding is good for text, but not needed for images.\n </p>\n </InfoTip>\n </div>\n </div>\n );\n }\n\n onLabelChange: (number, SyntheticInputEvent<>) => void = (index, e) => {\n const labels = _.clone(this.props.labels);\n labels[index] = e.target.value;\n this.props.onChange({labels: labels});\n };\n\n getSaveWarnings: () => $ReadOnlyArray<string> = () => {\n if (this.props.left.length !== this.props.right.length) {\n return [\n \"The two halves of the matcher have different numbers\" +\n \" of cards.\",\n ];\n }\n return [];\n };\n\n serialize: $FlowFixMe = () => {\n return _.pick(\n this.props,\n \"left\",\n \"right\",\n \"labels\",\n \"orderMatters\",\n \"padding\",\n );\n };\n}\n\nexport default MatcherEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {\n components,\n Changeable,\n EditorJsonify,\n MatrixWidget,\n} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {RangeInput} = components;\nconst Matrix = MatrixWidget.widget;\n\n// Really large matrices will cause issues with question formatting, so we\n// have to cap it at some point.\nconst MAX_BOARD_SIZE = 6;\n\nconst getMatrixSize = function (matrix) {\n const matrixSize = [1, 1];\n\n // We need to find the widest row and tallest column to get the correct\n // matrix size.\n _(matrix).each((matrixRow, row) => {\n let rowWidth = 0;\n _(matrixRow).each((matrixCol, col) => {\n if (matrixCol != null && matrixCol.toString().length) {\n rowWidth = col + 1;\n }\n });\n\n // Matrix width:\n matrixSize[1] = Math.max(matrixSize[1], rowWidth);\n\n // Matrix height:\n if (rowWidth > 0) {\n matrixSize[0] = Math.max(matrixSize[0], row + 1);\n }\n });\n return matrixSize;\n};\n\ntype Props = $FlowFixMe;\n\nclass MatrixEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n matrixBoardSize: PropTypes.arrayOf(PropTypes.number).isRequired,\n answers: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)),\n prefix: PropTypes.string,\n suffix: PropTypes.string,\n cursorPosition: PropTypes.arrayOf(PropTypes.number),\n };\n\n static widgetName: \"matrix\" = \"matrix\";\n\n static defaultProps: Props = {\n matrixBoardSize: [3, 3],\n answers: [[]],\n prefix: \"\",\n suffix: \"\",\n cursorPosition: [0, 0],\n };\n\n render(): React.Node {\n const matrixProps = _.extend(\n {\n numericInput: true,\n onBlur: () => {},\n onFocus: () => {},\n trackInteraction: () => {},\n },\n this.props,\n );\n return (\n <div className=\"perseus-matrix-editor\">\n <div className=\"perseus-widget-row\">\n {\" \"}\n Max matrix size:{\" \"}\n <RangeInput\n value={this.props.matrixBoardSize}\n onChange={this.onMatrixBoardSizeChange}\n format={this.props.labelStyle}\n useArrowKeys={true}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <Matrix {...matrixProps} />\n </div>\n <div className=\"perseus-widget-row\">\n {\" \"}\n Matrix prefix:{\" \"}\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"prefix\"\n apiOptions={this.props.apiOptions}\n content={this.props.prefix}\n widgetEnabled={false}\n onChange={(newProps) => {\n this.change({prefix: newProps.content});\n }}\n />\n </div>\n <div className=\"perseus-widget-row\">\n {\" \"}\n Matrix suffix:{\" \"}\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"suffix\"\n apiOptions={this.props.apiOptions}\n content={this.props.suffix}\n widgetEnabled={false}\n onChange={(newProps) => {\n this.change({suffix: newProps.content});\n }}\n />\n </div>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n onMatrixBoardSizeChange: ([number, number]) => void = (range) => {\n const matrixSize = getMatrixSize(this.props.answers);\n if (range[0] !== null && range[1] !== null) {\n range = [\n Math.round(Math.min(Math.max(range[0], 1), MAX_BOARD_SIZE)),\n Math.round(Math.min(Math.max(range[1], 1), MAX_BOARD_SIZE)),\n ];\n const answers = _(Math.min(range[0], matrixSize[0])).times(\n (row) => {\n return _(Math.min(range[1], matrixSize[1])).times((col) => {\n return this.props.answers[row][col];\n });\n },\n );\n this.props.onChange({\n matrixBoardSize: range,\n answers: answers,\n });\n }\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default MatrixEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InfoTip, NumberInput, PropCheckBox, RangeInput} = components;\n\nconst defaultImage = {\n url: null,\n top: 0,\n left: 0,\n};\n\ntype Props = $FlowFixMe;\n\nclass MeasurerEditor extends React.Component<Props> {\n static widgetName: \"measurer\" = \"measurer\";\n\n static propTypes = {\n ...Changeable.propTypes,\n box: PropTypes.arrayOf(PropTypes.number),\n image: PropTypes.shape({\n url: PropTypes.string,\n top: PropTypes.number,\n left: PropTypes.number,\n }),\n showProtractor: PropTypes.bool,\n showRuler: PropTypes.bool,\n rulerLabel: PropTypes.string,\n rulerTicks: PropTypes.number,\n rulerPixels: PropTypes.number,\n rulerLength: PropTypes.number,\n };\n\n static defaultProps: Props = {\n box: [480, 480],\n image: {},\n showProtractor: true,\n showRuler: false,\n rulerLabel: \"\",\n rulerTicks: 10,\n rulerPixels: 40,\n rulerLength: 10,\n };\n\n className: string = \"perseus-widget-measurer\";\n\n render(): React.Node {\n const image = _.extend({}, defaultImage, this.props.image);\n\n return (\n <div className=\"perseus-widget-measurer\">\n <div>Image displayed under protractor and/or ruler:</div>\n <div>\n URL:{\" \"}\n <input\n type=\"text\"\n className=\"perseus-widget-measurer-url\"\n // eslint-disable-next-line react/no-string-refs\n ref=\"image-url\"\n defaultValue={image.url}\n onChange={this._changeUrl}\n />\n <InfoTip>\n <p>\n Create an image in graphie, or use the \"Add image\"\n function to create a background.\n </p>\n </InfoTip>\n </div>\n {image.url && (\n <div className=\"perseus-widget-row\">\n <label className=\"perseus-widget-left-col\">\n Pixels from top:{\" \"}\n <NumberInput\n placeholder={0}\n onChange={this._changeTop}\n value={image.top}\n useArrowKeys={true}\n />\n </label>\n <label className=\"perseus-widget-right-col\">\n Pixels from left:{\" \"}\n <NumberInput\n placeholder={0}\n onChange={this._changeLeft}\n value={image.left}\n useArrowKeys={true}\n />\n </label>\n </div>\n )}\n <div>\n Containing area [width, height]:{\" \"}\n <RangeInput\n onChange={this.change(\"box\")}\n value={this.props.box}\n useArrowKeys={true}\n />\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n <PropCheckBox\n label=\"Show ruler\"\n showRuler={this.props.showRuler}\n onChange={this.props.onChange}\n />\n </div>\n <div className=\"perseus-widget-right-col\">\n <PropCheckBox\n label=\"Show protractor\"\n showProtractor={this.props.showProtractor}\n onChange={this.props.onChange}\n />\n </div>\n </div>\n {this.props.showRuler && (\n <div>\n <div>\n <label>\n {\" \"}\n Ruler label:{\" \"}\n <select\n onChange={(e) =>\n this.change(\n \"rulerLabel\",\n e.target.value,\n )\n }\n value={this.props.rulerLabel}\n >\n <option value=\"\">None</option>\n <optgroup label=\"Metric\">\n {this.renderLabelChoices([\n [\"milimeters\", \"mm\"],\n [\"centimeters\", \"cm\"],\n [\"meters\", \"m\"],\n [\"kilometers\", \"km\"],\n ])}\n </optgroup>\n <optgroup label=\"Imperial\">\n {this.renderLabelChoices([\n [\"inches\", \"in\"],\n [\"feet\", \"ft\"],\n [\"yards\", \"yd\"],\n [\"miles\", \"mi\"],\n ])}\n </optgroup>\n </select>\n </label>\n </div>\n <div>\n <label>\n {\" \"}\n Ruler ticks:{\" \"}\n <select\n onChange={(e) =>\n this.change(\n \"rulerTicks\",\n +e.target.value,\n )\n }\n value={this.props.rulerTicks}\n >\n {_.map([1, 2, 4, 8, 10, 16], function (n) {\n return (\n <option key={n} value={n}>\n {n}\n </option>\n );\n })}\n </select>\n </label>\n </div>\n <div>\n <label>\n Ruler pixels per unit:{\" \"}\n <NumberInput\n placeholder={40}\n onChange={this.change(\"rulerPixels\")}\n value={this.props.rulerPixels}\n useArrowKeys={true}\n />\n </label>\n </div>\n <div>\n <label>\n Ruler length in units:{\" \"}\n <NumberInput\n placeholder={10}\n onChange={this.change(\"rulerLength\")}\n value={this.props.rulerLength}\n useArrowKeys={true}\n />\n </label>\n </div>\n </div>\n )}\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n _changeUrl: (SyntheticInputEvent<>) => void = (e) => {\n this._changeImage(\"url\", e.target.value);\n };\n\n _changeTop: ($FlowFixMe) => void = (newTop) => {\n this._changeImage(\"top\", newTop);\n };\n\n _changeLeft: ($FlowFixMe) => void = (newLeft) => {\n this._changeImage(\"left\", newLeft);\n };\n\n _changeImage: (string, $FlowFixMe) => void = (subProp, newValue) => {\n const image = _.clone(this.props.image);\n image[subProp] = newValue;\n this.change(\"image\", image);\n };\n\n renderLabelChoices: (\n $ReadOnlyArray<[string, string]>,\n ) => $ReadOnlyArray<React.Element<\"option\">> = (choices) => {\n return _.map(choices, function (nameAndValue) {\n const [name, value] = nameAndValue;\n return (\n <option key={value} value={value}>\n {name}\n </option>\n );\n });\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default MeasurerEditor;\n","// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nconst {NumberInput, TextInput} = components;\n\ntype Props = $FlowFixMe;\n\nclass MoleculeWidgetEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n rotationAngle: PropTypes.number,\n smiles: PropTypes.string,\n };\n\n static widgetName: \"molecule-renderer\" = \"molecule-renderer\";\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n updateMolecule: (string) => void = (newValue) => {\n this.change({smiles: newValue});\n };\n\n updateRotation: (string) => void = (newValue) => {\n this.change({rotationAngle: newValue});\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n <div>\n {/* TODO(colin): instead of nbsp hacks, use styles to get\n the spacing right. */}\n <label>\n SMILES: \n <TextInput\n onChange={this.updateMolecule}\n value={this.props.smiles}\n />\n </label>\n </div>\n <div>\n <label>\n Rotation (deg): \n <NumberInput\n onChange={this.updateRotation}\n value={this.props.rotationAngle}\n />\n </label>\n </div>\n </div>\n );\n }\n}\n\nexport default MoleculeWidgetEditor;\n","// @flow\nimport {components, EditorJsonify} from \"@khanacademy/perseus\";\nimport {number as knumber} from \"kmath\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {ButtonGroup, InfoTip, NumberInput, PropCheckBox, RangeInput} =\n components;\n\ntype Range = [number, number];\n\nconst bound = (x: number, gt: number, lt: number): number =>\n Math.min(Math.max(x, gt), lt);\n\nconst EN_DASH = \"\\u2013\";\n\ntype Props = $FlowFixMe;\n\nclass NumberLineEditor extends React.Component<Props> {\n static propTypes = {\n range: PropTypes.arrayOf(PropTypes.number).isRequired,\n\n labelRange: PropTypes.arrayOf(PropTypes.number).isRequired,\n labelStyle: PropTypes.string.isRequired,\n labelTicks: PropTypes.bool,\n\n divisionRange: PropTypes.arrayOf(PropTypes.number).isRequired,\n numDivisions: PropTypes.number.isRequired,\n snapDivisions: PropTypes.number,\n\n tickStep: PropTypes.number,\n correctRel: PropTypes.oneOf([\"lt\", \"gt\", \"le\", \"ge\", \"eq\"]),\n correctX: PropTypes.number,\n initialX: PropTypes.number,\n isTickCtrl: PropTypes.bool,\n\n onChange: PropTypes.func.isRequired,\n\n static: PropTypes.bool,\n showTooltips: PropTypes.bool,\n };\n\n static widgetName: \"number-line\" = \"number-line\";\n\n static defaultProps: Props = {\n range: [0, 10],\n\n labelRange: [null, null],\n labelStyle: \"decimal\",\n labelTicks: true,\n\n divisionRange: [1, 12],\n numDivisions: 5,\n snapDivisions: 2,\n\n tickStep: null,\n correctRel: \"eq\",\n correctX: null,\n initialX: null,\n\n showTooltips: false,\n };\n\n onRangeChange: (Range) => void = (range) => {\n // Changing the range constrains the initial position, as well as the\n // position of the answer and labels. Atm, it just marks them as\n // invalid and prevents the number line from showing; it was annoying\n // to change it for them, because if they're typing in fractions,\n // it registers one-at-a-time and messes things up.\n this.props.onChange({range: range});\n };\n\n onLabelRangeChange: (number, number) => void = (i, num) => {\n let labelRange = this.props.labelRange.slice();\n const otherNum = labelRange[1 - i];\n\n if (num == null || otherNum == null) {\n labelRange[i] = num;\n } else {\n // If both labels have values, this updates the \"appropriate\" one.\n // It enforces that the position of the left label <= right label.\n // If left otherwise, it makes certain aspects of validation hard.\n labelRange = [Math.min(num, otherNum), Math.max(num, otherNum)];\n }\n\n this.props.onChange({labelRange: labelRange});\n };\n\n onDivisionRangeChange: (Range) => void = (divisionRange) => {\n let numDivisions = this.props.numDivisions;\n numDivisions = bound(numDivisions, divisionRange[0], divisionRange[1]);\n this.props.onChange({\n divisionRange: divisionRange,\n numDivisions: numDivisions,\n });\n };\n\n onNumChange: (\"correctX\" | \"initialX\" | \"snapDivisions\", number) => void = (\n key,\n value,\n ) => {\n const opts = {};\n opts[key] = value;\n this.props.onChange(opts);\n };\n\n onNumDivisionsChange: (number) => void = (numDivisions) => {\n const divRange = this.props.divisionRange.slice();\n\n // Don't allow a fraction for the number of divisions\n numDivisions = _.isFinite(numDivisions) ? Math.round(numDivisions) : 0;\n\n // Don't allow negative numbers for the number of divisions\n numDivisions = numDivisions < 0 ? numDivisions * -1 : numDivisions;\n\n // If the number of divisions isn't blank, update the number line\n if (numDivisions) {\n // Constrain numDivisions to be within the allowed range\n numDivisions = Math.min(\n divRange[1],\n Math.max(divRange[0], numDivisions),\n );\n\n this.props.onChange({\n tickStep: null,\n divisionRange: divRange,\n numDivisions: numDivisions,\n });\n }\n };\n\n onTickStepChange: (number) => void = (tickStep) => {\n this.props.onChange({\n numDivisions: null,\n tickStep: tickStep,\n });\n };\n\n onChangeRelation: (SyntheticInputEvent<>) => void = (e) => {\n const value = e.target.value;\n this.props.onChange({\n correctRel: value,\n isInequality: value !== \"eq\",\n });\n };\n\n onLabelStyleChange: ($FlowFixMe) => void = (labelStyle) => {\n this.props.onChange({\n labelStyle: labelStyle,\n });\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n const range = this.props.range;\n const labelRange = this.props.labelRange;\n const divisionRange = this.props.divisionRange;\n\n range[0] = +range[0];\n range[1] = +range[1];\n\n const width = range[1] - range[0];\n const numDivisions = this.props.numDivisions;\n const snapDivisions = this.props.snapDivisions;\n const tickStep = this.props.tickStep;\n const isTickCtrl = this.props.isTickCtrl;\n\n let step;\n if (!isTickCtrl) {\n // this will help constrain the answer to what is reachable\n step = tickStep\n ? tickStep / snapDivisions\n : width / numDivisions / snapDivisions;\n } else {\n // but if tickCtrl is on, the range of what is reachable is\n // rather large, and it becomes obnoxious to check for this\n step = null;\n }\n\n const labelStyleEditorButtons = [\n {\n value: \"decimal\",\n content: \"0.75\",\n title: \"Decimals\",\n },\n {\n value: \"improper\",\n content: \"\\u2077\\u2044\\u2084\",\n title: \"Improper fractions\",\n },\n {\n value: \"mixed\",\n content: \"1\\u00BE\",\n title: \"Mixed numbers\",\n },\n {\n value: \"non-reduced\",\n content: \"\\u2078\\u2044\\u2084\",\n title: \"Non-reduced\",\n },\n ];\n\n return (\n <div className=\"perseus-widget-number-line-editor\">\n <div className=\"perseus-widget-row\">\n Correct x{\" \"}\n <select\n value={this.props.correctRel}\n onChange={this.onChangeRelation}\n >\n <option value=\"eq\"> = </option>\n <option value=\"lt\"> < </option>\n <option value=\"gt\"> > </option>\n <option value=\"le\"> ≤ </option>\n <option value=\"ge\"> ≥ </option>\n </select>{\" \"}\n <NumberInput\n value={this.props.correctX}\n format={this.props.labelStyle}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onNumChange.bind(this, \"correctX\")}\n checkValidity={(val) =>\n val >= range[0] &&\n val <= range[1] &&\n (!step ||\n knumber.isInteger((val - range[0]) / step))\n }\n placeholder=\"answer\"\n size=\"normal\"\n useArrowKeys={true}\n />\n <InfoTip>\n <p>\n This is the correct answer. The answer is validated\n (as right or wrong) by using only the end position\n of the point and the relation (=, <, >, ≤,\n ≥).\n </p>\n </InfoTip>\n </div>\n\n <div className=\"perseus-widget-row\">\n {this.props.static ? (\n <label>\n {/* Don't display initial position input in\n static mode since it isn't used. */}\n Range:\n </label>\n ) : (\n <label>\n Position:{\" \"}\n <NumberInput\n value={this.props.initialX}\n format={this.props.labelStyle}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onNumChange.bind(\n this,\n \"initialX\",\n )}\n placeholder={range[0]}\n checkValidity={(val) => {\n return val >= range[0] && val <= range[1];\n }}\n useArrowKeys={true}\n />\n {\" \\u2208 \"}\n </label>\n )}\n\n <RangeInput\n value={range}\n onChange={this.onRangeChange}\n format={this.props.labelStyle}\n useArrowKeys={true}\n />\n <InfoTip>\n <p>\n This controls the initial position of the point\n along the number line and the\n <strong>range</strong>, the position of the\n endpoints of the number line. Setting the range\n constrains the position of the answer and the\n labels.\n </p>\n <p>\n In static mode, the initial position of the point is\n determined by Correct x instead of position.\n </p>\n </InfoTip>\n </div>\n <div className=\"perseus-widget-row\">\n <div className=\"perseus-widget-left-col\">\n Labels:{\" \"}\n <NumberInput\n value={labelRange[0]}\n placeholder={range[0]}\n format={this.props.labelStyle}\n checkValidity={(val) =>\n val >= range[0] && val <= range[1]\n }\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onLabelRangeChange.bind(this, 0)}\n useArrowKeys={true}\n />\n <span> & </span>\n <NumberInput\n value={labelRange[1]}\n placeholder={range[1]}\n format={this.props.labelStyle}\n checkValidity={(val) =>\n val >= range[0] && val <= range[1]\n }\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onLabelRangeChange.bind(this, 1)}\n useArrowKeys={true}\n />\n <InfoTip>\n <p>\n This controls the position of the left / right\n labels. By default, the labels are set by the\n range <br />\n <strong>Note:</strong> Ensure that the labels\n line up with the tick marks, or it may be\n confusing for users.\n </p>\n </InfoTip>\n </div>\n </div>\n <div className=\"perseus-widget-row\">\n Style:{\" \"}\n <ButtonGroup\n allowEmpty={false}\n value={this.props.labelStyle}\n buttons={labelStyleEditorButtons}\n onChange={this.onLabelStyleChange}\n />\n <InfoTip>\n <p>\n This controls the styling of the labels for the two\n main labels as well as all the tick mark labels, if\n applicable. Your choices are decimal, improper\n fractions, mixed fractions, and non-reduced\n fractions.\n </p>\n </InfoTip>\n </div>\n <div className=\"perseus-widget-row\">\n {!this.props.static && (\n <div className=\"perseus-widget-left-col\">\n <PropCheckBox\n label=\"Show tick controller\"\n isTickCtrl={this.props.isTickCtrl}\n onChange={this.props.onChange}\n />\n </div>\n )}\n <div className=\"perseus-widget-right-col\">\n <PropCheckBox\n label=\"Show label ticks\"\n labelTicks={this.props.labelTicks}\n onChange={this.props.onChange}\n />\n </div>\n </div>\n\n <div className=\"perseus-widget-row\">\n {!this.props.static && (\n <PropCheckBox\n label=\"Show tooltips\"\n showTooltips={this.props.showTooltips}\n onChange={this.props.onChange}\n />\n )}\n </div>\n <div className=\"perseus-widget-row\">\n {isTickCtrl && (\n <span>\n <label>\n Start num divisions at{\" \"}\n <NumberInput\n value={this.props.numDivisions || null}\n format=\"decimal\"\n onChange={this.onNumDivisionsChange}\n checkValidity={(val) => {\n return (\n val >= divisionRange[0] &&\n val <= divisionRange[1]\n );\n }}\n placeholder={width / this.props.tickStep}\n useArrowKeys={true}\n />\n </label>\n <InfoTip>\n <p>\n This controls the number (and position) of\n the tick marks. The number of divisions is\n constrained to\n {\" \" +\n divisionRange[0] +\n EN_DASH +\n divisionRange[1]}\n .\n <br />\n <strong>Note:</strong> The user will be able\n to specify the number of divisions in a\n number input.\n </p>\n </InfoTip>\n </span>\n )}\n {!isTickCtrl && (\n <span>\n <label>\n Num divisions:{\" \"}\n <NumberInput\n value={this.props.numDivisions || null}\n format=\"decimal\"\n onChange={this.onNumDivisionsChange}\n checkValidity={(val) => {\n return (\n val >= divisionRange[0] &&\n val <= divisionRange[1]\n );\n }}\n placeholder={width / this.props.tickStep}\n useArrowKeys={true}\n />\n </label>{\" \"}\n <label>\n or tick step:{\" \"}\n <NumberInput\n value={this.props.tickStep || null}\n format={this.props.labelStyle}\n onChange={this.onTickStepChange}\n checkValidity={(val) => {\n return val > 0 && val <= width;\n }}\n placeholder={\n width / this.props.numDivisions\n }\n useArrowKeys={true}\n />\n </label>\n <InfoTip>\n <p>\n This controls the number (and position) of\n the tick marks; you can either set the\n number of divisions (2 divisions would split\n the entire range in two halves), or the tick\n step (the distance between ticks) and the\n other value will be updated accordingly.{\" \"}\n <br />\n <strong>Note:</strong> There is no check to\n see if labels coordinate with the tick\n marks, which may be confusing for users if\n the blue labels and black ticks are\n off-step.\n </p>\n </InfoTip>\n </span>\n )}\n </div>\n <div className=\"perseus-widget-row\">\n <label>\n Snap increments per tick:{\" \"}\n <NumberInput\n value={snapDivisions}\n checkValidity={(val) => val > 0}\n format={this.props.labelStyle}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onNumChange.bind(\n this,\n \"snapDivisions\",\n )}\n useArrowKeys={true}\n />\n </label>\n <InfoTip>\n <p>\n This determines the number of different places the\n point will snap between two adjacent tick marks.{\" \"}\n <br />\n <strong>Note:</strong>Ensure the required number of\n snap increments is provided to answer the question.\n </p>\n </InfoTip>\n </div>\n </div>\n );\n }\n}\n\nexport default NumberLineEditor;\n","/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */\n// @flow\nimport {\n components,\n icons,\n Changeable,\n EditorJsonify,\n Util,\n} from \"@khanacademy/perseus\";\nimport createReactClass from \"create-react-class\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {\n ButtonGroup,\n InfoTip,\n InlineIcon,\n MultiButtonGroup,\n NumberInput,\n PropCheckBox,\n TextInput,\n} = components;\nconst {iconGear, iconTrash} = icons;\nconst {firstNumericalParse} = Util;\n\nconst answerFormButtons = [\n {title: \"Integers\", value: \"integer\", content: \"6\"},\n {title: \"Decimals\", value: \"decimal\", content: \"0.75\"},\n {title: \"Proper fractions\", value: \"proper\", content: \"\\u2157\"},\n {\n title: \"Improper fractions\",\n value: \"improper\",\n content: \"\\u2077\\u2044\\u2084\",\n },\n {title: \"Mixed numbers\", value: \"mixed\", content: \"1\\u00BE\"},\n {title: \"Numbers with \\u03C0\", value: \"pi\", content: \"\\u03C0\"},\n];\n\nconst initAnswer = (status) => {\n return {\n value: null,\n status: status,\n message: \"\",\n simplify: \"required\",\n answerForms: [],\n strict: false,\n maxError: null,\n };\n};\n\nconst NumericInputEditor: any = createReactClass({\n displayName: \"NumericInputEditor\",\n\n propTypes: {\n ...Changeable.propTypes,\n },\n\n statics: {\n widgetName: \"numeric-input\",\n },\n\n getDefaultProps: function () {\n return {\n answers: [initAnswer(\"correct\")],\n size: \"normal\",\n coefficient: false,\n labelText: \"\",\n multipleNumberInput: false,\n rightAlign: false,\n };\n },\n\n getInitialState: function () {\n return {\n lastStatus: \"wrong\",\n showOptions: _.map(this.props.answers, () => false),\n };\n },\n\n render: function () {\n const answers = this.props.answers;\n\n const unsimplifiedAnswers = (i) => (\n <div className=\"perseus-widget-row\">\n <label>Unsimplified answers are</label>\n <ButtonGroup\n value={answers[i][\"simplify\"]}\n allowEmpty={false}\n buttons={[\n {value: \"required\", content: \"ungraded\"},\n {value: \"optional\", content: \"accepted\"},\n {value: \"enforced\", content: \"wrong\"},\n ]}\n onChange={this.updateAnswer(i, \"simplify\")}\n />\n <InfoTip>\n <p>\n Normally select \"ungraded\". This will give the user a\n message saying the answer is correct but not simplified.\n The user will then have to simplify it and re-enter, but\n will not be penalized. (5th grade and after)\n </p>\n <p>\n Select \"accepted\" only if the user is not expected to\n know how to simplify fractions yet. (Anything prior to\n 5th grade)\n </p>\n <p>\n Select \"wrong\" <em>only</em> if we are specifically\n assessing the ability to simplify.\n </p>\n </InfoTip>\n </div>\n );\n\n const suggestedAnswerTypes = (i) => (\n <div>\n <div className=\"perseus-widget-row\">\n <label>Choose the suggested answer formats</label>\n <MultiButtonGroup\n buttons={answerFormButtons}\n values={answers[i][\"answerForms\"]}\n onChange={this.updateAnswer(i, \"answerForms\")}\n />\n <InfoTip>\n <p>\n Formats will be autoselected for you based on the\n given answer; to show no suggested formats and\n accept all types, simply have a decimal/integer be\n the answer. Values with π will have format \"pi\",\n and values that are fractions will have some subset\n (mixed will be \"mixed\" and \"proper\"; improper/proper\n will both be \"improper\" and \"proper\"). If you would\n like to specify that it is only a proper fraction\n (or only a mixed/improper fraction), deselect the\n other format. Except for specific cases, you should\n not need to change the autoselected formats.\n </p>\n <p>\n To restrict the answer to <em>only</em> an improper\n fraction (i.e. 7/4), select the improper fraction\n and toggle \"strict\" to true. This <b>will not</b>{\" \"}\n accept 1.75 as an answer.{\" \"}\n </p>\n <p>\n Unless you are testing that specific skill, please\n do not restrict the answer format.\n </p>\n </InfoTip>\n </div>\n <div className=\"perseus-widget-row\">\n <PropCheckBox\n label=\"Strictly match only these formats\"\n strict={answers[i][\"strict\"]}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.updateAnswer.bind(this, i)}\n />\n </div>\n </div>\n );\n\n const maxError = (i) => (\n <div className=\"perseus-widget-row\">\n <label>\n Max error{\" \"}\n <NumberInput\n className=\"max-error\"\n value={answers[i][\"maxError\"]}\n onChange={this.updateAnswer(i, \"maxError\")}\n placeholder=\"0\"\n />\n </label>\n </div>\n );\n\n const inputSize = (\n <div className=\"perseus-widget-row\">\n <label>Width: </label>\n <ButtonGroup\n value={this.props.size}\n allowEmpty={false}\n buttons={[\n {value: \"normal\", content: \"Normal (80px)\"},\n {value: \"small\", content: \"Small (40px)\"},\n ]}\n onChange={this.change(\"size\")}\n />\n <InfoTip>\n <p>\n Use size \"Normal\" for all text boxes, unless there are\n multiple text boxes in one line and the answer area is\n too narrow to fit them.\n </p>\n </InfoTip>\n </div>\n );\n\n const rightAlign = (\n <div className=\"perseus-widget-row\">\n <PropCheckBox\n label=\"Right alignment\"\n rightAlign={this.props.rightAlign}\n onChange={this.props.onChange}\n />\n </div>\n );\n\n const labelText = (\n <div className=\"perseus-widget-row\">\n <label>\n Label text:{\" \"}\n <TextInput\n value={this.props.labelText}\n onChange={this.change(\"labelText\")}\n />\n </label>\n <InfoTip>\n <p>\n Text to describe this input. This will be shown to users\n using screenreaders.\n </p>\n </InfoTip>\n </div>\n );\n\n const coefficientCheck = (\n <div>\n <div className=\"perseus-widget-row\">\n <PropCheckBox\n label=\"Coefficient\"\n coefficient={this.props.coefficient}\n onChange={this.props.onChange}\n />\n <InfoTip>\n <p>\n A coefficient style number allows the student to use\n - for -1 and an empty string to mean 1.\n </p>\n </InfoTip>\n </div>\n </div>\n );\n\n const addAnswerButton = (\n <div>\n <a\n href=\"javascript:void(0)\"\n className=\"simple-button orange\"\n onClick={() => this.addAnswer()}\n onKeyDown={(e) => this.onSpace(e, this.addAnswer)}\n >\n <span>Add new answer</span>\n </a>\n </div>\n );\n\n const instructions = {\n wrong: \"(address the mistake/misconception)\",\n ungraded: \"(explain in detail to avoid confusion)\",\n correct: \"(reinforce the user's understanding)\",\n };\n\n const generateInputAnswerEditors = () =>\n answers.map((answer, i) => {\n const editor = (\n <Editor\n apiOptions={this.props.apiOptions}\n content={answer.message || \"\"}\n placeholder={\n \"Why is this answer \" +\n answer.status +\n \"?\\t\" +\n instructions[answer.status]\n }\n widgetEnabled={false}\n onChange={(newProps) => {\n if (\"content\" in newProps) {\n this.updateAnswer(i, {\n message: newProps.content,\n });\n }\n }}\n />\n );\n return (\n <div className=\"perseus-widget-row\" key={i}>\n <div\n className={\n \"input-answer-editor-value-container\" +\n (answer.maxError ? \" with-max-error\" : \"\")\n }\n >\n <NumberInput\n value={answer.value}\n className=\"numeric-input-value\"\n placeholder=\"answer\"\n format={_.last(answer.answerForms)}\n onFormatChange={(newValue, format) => {\n // NOTE(charlie): The mobile web expression\n // editor relies on this automatic answer\n // form resolution for determining when to\n // show the Pi symbol. If we get rid of it,\n // we should also disable Pi for\n // NumericInput and require problems that\n // use Pi to build on Expression.\n // Alternatively, we could store answers\n // as plaintext and parse them to determine\n // whether or not to reveal Pi on the\n // keypad (right now, answers are stored as\n // resolved values, like '0.125' rather\n // than '1/8').\n let forms;\n if (format === \"pi\") {\n forms = [\"pi\"];\n } else if (format === \"mixed\") {\n forms = [\"proper\", \"mixed\"];\n } else if (\n format === \"proper\" ||\n format === \"improper\"\n ) {\n forms = [\"proper\", \"improper\"];\n }\n this.updateAnswer(i, {\n value: firstNumericalParse(newValue),\n answerForms: forms,\n });\n }}\n onChange={(newValue) => {\n this.updateAnswer(i, {\n value: firstNumericalParse(newValue),\n });\n }}\n />\n {answer.strict && (\n <div\n className=\"is-strict-indicator\"\n title=\"strictly equivalent to\"\n >\n ≡\n </div>\n )}\n {answer.simplify !== \"required\" &&\n answer.status === \"correct\" && (\n <div\n className={\n \"simplify-indicator \" +\n answer.simplify\n }\n title=\"accepts unsimplified answers\"\n >\n ‰\n </div>\n )}\n {answer.maxError ? (\n <div className=\"max-error-container\">\n <div className=\"max-error-plusmn\">\n ±\n </div>\n <NumberInput\n placeholder={0}\n value={answers[i][\"maxError\"]}\n format={_.last(answer.answerForms)}\n onChange={this.updateAnswer(\n i,\n \"maxError\",\n )}\n />\n </div>\n ) : null}\n <div className=\"value-divider\" />\n <a\n href=\"javascript:void(0)\"\n className={\"answer-status \" + answer.status}\n onClick={() => this.onStatusChange(i)}\n onKeyDown={(e) =>\n this.onSpace(e, this.onStatusChange, i)\n }\n >\n {answer.status}\n </a>\n <a\n href=\"javascript:void(0)\"\n className=\"answer-trash\"\n onClick={() => this.onTrashAnswer(i)}\n onKeyDown={(e) =>\n this.onSpace(e, this.onTrashAnswer, i)\n }\n >\n <InlineIcon {...iconTrash} />\n </a>\n <a\n href=\"javascript:void(0)\"\n className=\"options-toggle\"\n onClick={() => this.onToggleOptions(i)}\n onKeyDown={(e) =>\n this.onSpace(e, this.onToggleOptions, i)\n }\n >\n <InlineIcon {...iconGear} />\n </a>\n </div>\n <div className=\"input-answer-editor-message\">\n {editor}\n </div>\n {this.state.showOptions[i] && (\n <div className=\"options-container\">\n {maxError(i)}\n {answer.status === \"correct\" &&\n unsimplifiedAnswers(i)}\n {suggestedAnswerTypes(i)}\n </div>\n )}\n </div>\n );\n });\n\n return (\n <div className=\"perseus-input-number-editor\">\n <div ref={(e) => (this.multInputOption = e)}>\n <select onChange={this.onMultipleInputChange}>\n <option value=\"simple-numeric-input\">\n Ask for one correct solution\n </option>\n <option value=\"multiple-numeric-input\">\n Ask for all correct solutions\n </option>\n </select>\n </div>\n <div className=\"ui-title\">User input</div>\n <div className=\"msg-title\">\n Message shown to user on attempt\n </div>\n {generateInputAnswerEditors()}\n {addAnswerButton}\n {inputSize}\n {rightAlign}\n {coefficientCheck}\n {labelText}\n </div>\n );\n },\n\n change(...args) {\n // $FlowFixMe[object-this-reference]\n return Changeable.change.apply(this, args);\n },\n\n onToggleOptions: function (choiceIndex) {\n const showOptions = this.state.showOptions.slice();\n showOptions[choiceIndex] = !showOptions[choiceIndex];\n this.setState({showOptions: showOptions});\n },\n\n onTrashAnswer: function (choiceIndex) {\n if (choiceIndex >= 0 && choiceIndex < this.props.answers.length) {\n const answers = this.props.answers.slice(0);\n answers.splice(choiceIndex, 1);\n this.props.onChange({answers: answers});\n }\n },\n\n onSpace: function (e, callback) {\n if (e.key === \" \") {\n e.preventDefault(); // prevent page shifting\n const args = _.toArray(arguments).slice(2);\n callback.apply(this, args);\n }\n },\n\n onStatusChange: function (choiceIndex) {\n const statuses = [\"wrong\", \"ungraded\", \"correct\"];\n const answers = this.props.answers;\n const i = _.indexOf(statuses, answers[choiceIndex].status);\n const newStatus = statuses[(i + 1) % statuses.length];\n\n this.updateAnswer(choiceIndex, {\n status: newStatus,\n simplify: newStatus === \"correct\" ? \"required\" : \"accepted\",\n });\n },\n\n onMultipleInputChange: function (event) {\n const newOption = event.target.value;\n if (newOption === \"multiple-numeric-input\") {\n this.props.onChange({multipleNumberInput: true});\n } else {\n this.props.onChange({multipleNumberInput: false});\n }\n },\n\n updateAnswer: function (choiceIndex, update) {\n if (!_.isObject(update)) {\n return _.partial(\n (choiceIndex, key, value) => {\n const update = {};\n update[key] = value;\n this.updateAnswer(choiceIndex, update);\n },\n choiceIndex,\n update,\n );\n }\n\n let answers = _.clone(this.props.answers);\n\n // Don't bother to make a new answer box unless we are editing the last\n // one.\n // TODO(oliver): This might not be necessary anymore.\n if (choiceIndex === answers.length) {\n const lastAnswer = initAnswer(this.state.lastStatus);\n answers = answers.concat(lastAnswer);\n }\n\n answers[choiceIndex] = _.extend({}, answers[choiceIndex], update);\n this.props.onChange({answers: answers});\n },\n\n addAnswer: function () {\n const lastAnswer = initAnswer(this.state.lastStatus);\n const answers = this.props.answers.concat(lastAnswer);\n this.props.onChange({answers: answers});\n },\n\n getSaveWarnings: function () {\n // Filter out all the empty answers\n const warnings = [];\n // TODO(emily): This doesn't actually work, because the value is either\n // null or undefined when undefined, probably.\n if (_.contains(_.pluck(this.props.answers, \"value\"), \"\")) {\n warnings.push(\"One or more answers is empty\");\n }\n this.props.answers.forEach((answer, i) => {\n const formatError =\n answer.strict &&\n (!answer.answerForms || answer.answerForms.length === 0);\n if (formatError) {\n warnings.push(\n `Answer ${i + 1} is set to string format ` +\n \"matching, but no format was selected\",\n );\n }\n });\n return warnings;\n },\n\n serialize() {\n // $FlowFixMe[object-this-reference]\n return EditorJsonify.serialize.call(this);\n },\n});\n\nexport default NumericInputEditor;\n","/* eslint-disable one-var, react/forbid-prop-types, react/sort-comp */\n// @flow\nimport {components} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InfoTip, TextListEditor} = components;\n\nconst NORMAL = \"normal\",\n AUTO = \"auto\",\n HORIZONTAL = \"horizontal\",\n VERTICAL = \"vertical\";\n\ntype Props = $FlowFixMe;\n\nclass OrdererEditor extends React.Component<Props> {\n static propTypes = {\n correctOptions: PropTypes.array,\n otherOptions: PropTypes.array,\n height: PropTypes.oneOf([NORMAL, AUTO]),\n layout: PropTypes.oneOf([HORIZONTAL, VERTICAL]),\n onChange: PropTypes.func.isRequired,\n };\n\n static widgetName: \"orderer\" = \"orderer\";\n\n static defaultProps: Props = {\n correctOptions: [{content: \"$x$\"}],\n otherOptions: [{content: \"$y$\"}],\n height: NORMAL,\n layout: HORIZONTAL,\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-widget-orderer\">\n <div>\n {\" \"}\n Correct answer:{\" \"}\n <InfoTip>\n <p>\n Place the cards in the correct order. The same card\n can be used more than once in the answer but will\n only be displayed once at the top of a stack of\n identical cards.\n </p>\n </InfoTip>\n </div>\n <TextListEditor\n options={_.pluck(this.props.correctOptions, \"content\")}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onOptionsChange.bind(this, \"correctOptions\")}\n layout={this.props.layout}\n />\n\n <div>\n {\" \"}\n Other cards:{\" \"}\n <InfoTip>\n <p>Create cards that are not part of the answer.</p>\n </InfoTip>\n </div>\n <TextListEditor\n options={_.pluck(this.props.otherOptions, \"content\")}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this.onOptionsChange.bind(this, \"otherOptions\")}\n layout={this.props.layout}\n />\n\n <div>\n <label>\n {\" \"}\n Layout:{\" \"}\n <select\n value={this.props.layout}\n onChange={this.onLayoutChange}\n >\n <option value={HORIZONTAL}>Horizontal</option>\n <option value={VERTICAL}>Vertical</option>\n </select>\n </label>\n <InfoTip>\n <p>\n Use the horizontal layout for short text and small\n images. The vertical layout is best for longer text\n (e.g. proofs).\n </p>\n </InfoTip>\n </div>\n <div>\n <label>\n {\" \"}\n Height:{\" \"}\n <select\n value={this.props.height}\n onChange={this.onHeightChange}\n >\n <option value={NORMAL}>Normal</option>\n <option value={AUTO}>Automatic</option>\n </select>\n </label>\n <InfoTip>\n <p>Use \"Normal\" for text, \"Automatic\" for images.</p>\n </InfoTip>\n </div>\n </div>\n );\n }\n\n onOptionsChange: (\n \"correctOptions\" | \"otherOptions\",\n $FlowFixMe,\n $FlowFixMe,\n ) => $FlowFixMe = (whichOptions, options, cb) => {\n const props = {};\n props[whichOptions] = _.map(options, function (option) {\n return {content: option};\n });\n this.props.onChange(props, cb);\n };\n\n onLayoutChange: (SyntheticInputEvent<>) => void = (e) => {\n this.props.onChange({layout: e.target.value});\n };\n\n onHeightChange: (SyntheticInputEvent<>) => void = (e) => {\n this.props.onChange({height: e.target.value});\n };\n\n serialize: () => $FlowFixMe = () => {\n // We combine the correct answer and the other cards by merging them,\n // removing duplicates and empty cards, and sorting them into\n // categories based on their content\n const options = _.chain(_.pluck(this.props.correctOptions, \"content\"))\n .union(_.pluck(this.props.otherOptions, \"content\"))\n .uniq()\n .reject(function (content) {\n return content === \"\";\n })\n .sort()\n .sortBy(function (content) {\n if (/\\d/.test(content)) {\n return 0;\n }\n if (/^\\$?[a-zA-Z]+\\$?$/.test(content)) {\n return 2;\n }\n return 1;\n })\n .map(function (content) {\n return {content: content};\n })\n .value();\n\n return {\n options: options,\n correctOptions: this.props.correctOptions,\n otherOptions: this.props.otherOptions,\n height: this.props.height,\n layout: this.props.layout,\n };\n };\n}\n\nexport default OrdererEditor;\n","// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {InfoTip, PropCheckBox} = components;\n\ntype Props = $FlowFixMe;\n\nclass PassageEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n passageTitle: PropTypes.string,\n passageText: PropTypes.string,\n footnotes: PropTypes.string,\n showLineNumbers: PropTypes.bool,\n };\n\n static widgetName: \"passage\" = \"passage\";\n\n static defaultProps: Props = {\n passageTitle: \"\",\n passageText: \"\",\n footnotes: \"\",\n showLineNumbers: true,\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n const passageEditor = (\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"passage-editor\"\n apiOptions={this.props.apiOptions}\n content={this.props.passageText}\n widgetEnabled={false}\n placeholder=\"Type passage here...\"\n onChange={(newProps) => {\n this.change({passageText: newProps.content});\n }}\n showWordCount={true}\n />\n );\n const footnotesEditor = (\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"passage-footnotes-editor\"\n apiOptions={this.props.apiOptions}\n content={this.props.footnotes}\n widgetEnabled={false}\n placeholder=\"Type footnotes here...\"\n onChange={(newProps) => {\n this.change({footnotes: newProps.content});\n }}\n />\n );\n return (\n <div className=\"perseus-widget-passage-editor\">\n <div className=\"perseus-widget-row\">\n <PropCheckBox\n label=\"Show line numbers\"\n labelAlignment=\"right\"\n showLineNumbers={this.props.showLineNumbers}\n onChange={this.props.onChange}\n />\n </div>\n <div>\n Passage title:\n <InfoTip>\n <p>\n An optional title that will appear directly above\n the passage in the same font style. (E.g. Passage 1)\n </p>\n </InfoTip>\n <div>\n <input\n type=\"text\"\n defaultValue={this.props.passageTitle}\n onChange={(e) => {\n this.change({passageTitle: e.target.value});\n }}\n />\n </div>\n </div>\n <div>\n Passage Text:\n {passageEditor}\n </div>\n <div>\n Footnotes:\n <InfoTip>\n <p>\n To add footnotes, add ^ characters where they belong\n in the passage. Then, add ^ in the footnotes area to\n reference the footnotes in the passage.\n </p>\n </InfoTip>\n {footnotesEditor}\n </div>\n </div>\n );\n }\n}\n\nexport default PassageEditor;\n","// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nconst {InfoTip, NumberInput, TextInput} = components;\n\ntype Props = $FlowFixMe;\n\nclass PassageRefEditor extends React.Component<Props> {\n static propTypes: Props = {\n ...Changeable.propTypes,\n passageNumber: PropTypes.number,\n referenceNumber: PropTypes.number,\n summaryText: PropTypes.string,\n };\n\n static widgetName: \"passage-ref\" = \"passage-ref\";\n\n static defaultProps: Props = {\n passageNumber: 1,\n referenceNumber: 1,\n summaryText: \"\",\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n <div>\n <label>\n {\"Passage Number: \"}\n <NumberInput\n value={this.props.passageNumber}\n onChange={this.change(\"passageNumber\")}\n />\n </label>\n </div>\n <div>\n <label>\n {\"Reference Number: \"}\n <NumberInput\n value={this.props.referenceNumber}\n onChange={this.change(\"referenceNumber\")}\n />\n </label>\n </div>\n <div>\n <label>\n {\"Summary Text: \"}\n <TextInput\n value={this.props.summaryText}\n onChange={this.change(\"summaryText\")}\n />\n <InfoTip>\n <p>\n Short summary of the referenced section. This\n will be included in parentheses and quotes\n automatically.\n </p>\n <p>Ex: The start ... the end</p>\n </InfoTip>\n </label>\n </div>\n </div>\n );\n }\n}\n\nexport default PassageRefEditor;\n","// @flow\nimport {Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\ntype Props = $FlowFixMe;\n\nclass PassageRefTargetEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n content: PropTypes.string,\n };\n\n static widgetName: \"passage-ref-target\" = \"passage-ref-target\";\n\n static defaultProps: Props = {\n content: \"\",\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n handleContentChange: (SyntheticInputEvent<>) => void = (e) => {\n this.change({content: e.target.value});\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n Content:\n <input\n type=\"text\"\n value={this.props.content}\n onChange={this.handleContentChange}\n />\n </div>\n );\n }\n}\n\nexport default PassageRefTargetEditor;\n","/* eslint-disable @babel/no-invalid-this, one-var, react/no-unsafe, react/sort-comp */\n// @flow\nimport {\n components,\n Dependencies,\n PlotterWidget,\n Util,\n} from \"@khanacademy/perseus\";\nimport {number as knumber} from \"kmath\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport _ from \"underscore\";\n\nimport BlurInput from \"../components/blur-input.jsx\";\n\nconst {InfoTip, NumberInput, RangeInput, TextListEditor} = components;\nconst Plotter = PlotterWidget.widget;\n\nconst BAR = \"bar\",\n LINE = \"line\",\n PIC = \"pic\",\n HISTOGRAM = \"histogram\",\n DOTPLOT = \"dotplot\";\n\n// Return a copy of array with length n, padded with given value\nfunction padArray(array, n, value) {\n const copy = _.clone(array);\n copy.length = n;\n for (let i = array.length; i < n; i++) {\n copy[i] = value;\n }\n return copy;\n}\n\nconst editorDefaults = {\n scaleY: 1,\n maxY: 10,\n snapsPerLine: 2,\n};\n\nconst widgetPropTypes = {\n type: PropTypes.oneOf([BAR, LINE, PIC, HISTOGRAM, DOTPLOT]),\n labels: PropTypes.arrayOf(PropTypes.string),\n categories: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n ),\n\n scaleY: PropTypes.number,\n maxY: PropTypes.number,\n snapsPerLine: PropTypes.number,\n\n picSize: PropTypes.number,\n pixBoxHeight: PropTypes.number,\n picUrl: PropTypes.string,\n\n plotDimensions: PropTypes.arrayOf(PropTypes.number),\n labelInterval: PropTypes.number,\n starting: PropTypes.arrayOf(PropTypes.number),\n correct: PropTypes.arrayOf(PropTypes.number),\n static: PropTypes.bool,\n onChange: PropTypes.func,\n};\n\nconst formatNumber = (num) => \"$\" + knumber.round(num, 2) + \"$\";\n\ntype Props = $FlowFixMe;\ntype State = $FlowFixMe;\n\nclass PlotterEditor extends React.Component<Props, State> {\n static propTypes = widgetPropTypes;\n static widgetName: string = \"plotter\";\n\n static defaultProps: Props = {\n ...editorDefaults,\n correct: [1],\n starting: [1],\n\n type: BAR,\n labels: [\"\", \"\"],\n categories: [\"\"],\n\n picSize: 30,\n picBoxHeight: 36,\n plotDimensions: [275, 200],\n labelInterval: 1,\n\n get picUrl() {\n const staticUrl = Dependencies.getDependencies().staticUrl;\n if (staticUrl) {\n return staticUrl(\"/images/badges/earth-small.png\");\n }\n\n return null;\n },\n };\n\n state: State = {\n editing: this.props.static ? \"starting\" : \"correct\",\n pic: null,\n loadedUrl: null,\n minX: null,\n maxX: null,\n tickStep: null,\n };\n\n // TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`\n UNSAFE_componentWillMount() {\n this.fetchPic(this.props.picUrl);\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: $FlowFixMe) {\n this.fetchPic(nextProps.picUrl);\n\n if (nextProps.static) {\n this.setState({\n editing: \"starting\",\n });\n }\n }\n\n fetchPic: (string) => $FlowFixMe = (url) => {\n if (this.state.loadedUrl !== url) {\n const pic = new Image();\n pic.src = url;\n pic.onload = () => {\n this.setState({\n pic: pic,\n loadedUrl: url,\n });\n };\n }\n };\n\n render(): React.Node {\n const setFromScale = _.contains(\n [LINE, HISTOGRAM, DOTPLOT],\n this.props.type,\n );\n const canChangeSnaps = !_.contains([PIC, DOTPLOT], this.props.type);\n const props = {\n trackInteraction: () => {},\n ...this.props,\n };\n\n return (\n <div className=\"perseus-widget-plotter-editor\">\n <div>\n Chart type:{\" \"}\n {_.map(\n [BAR, LINE, PIC, HISTOGRAM, DOTPLOT],\n function (type) {\n return (\n <label key={type}>\n <input\n type=\"radio\"\n name=\"chart-type\"\n checked={this.props.type === type}\n onChange={_.partial(\n this.changeType,\n type,\n )}\n />\n {type}\n </label>\n );\n },\n this,\n )}\n </div>\n <div>\n Labels:{\" \"}\n {_.map(\n [\"x\", \"y\"],\n function (axis, i) {\n return (\n <label key={axis}>\n {axis + \":\"}\n <input\n type=\"text\"\n onChange={_.partial(\n this.changeLabel,\n i,\n )}\n defaultValue={this.props.labels[i]}\n />\n </label>\n );\n },\n this,\n )}\n </div>\n\n {setFromScale && (\n <div className=\"set-from-scale-box\">\n <span className=\"categories-title\">\n Set Categories From Scale\n </span>\n <div>\n <label>\n Tick Step:{\" \"}\n <NumberInput\n placeholder={1}\n useArrowKeys={true}\n value={this.state.tickStep}\n onChange={this.handleChangeTickStep}\n />\n </label>\n <InfoTip>\n <p>The difference between adjacent ticks.</p>\n </InfoTip>\n </div>\n <div>\n <label>\n Range:{\" \"}\n <RangeInput\n placeholder={[0, 10]}\n useArrowKeys={true}\n value={[this.state.minX, this.state.maxX]}\n onChange={this.handleChangeRange}\n />\n </label>\n </div>\n <div>\n <button onClick={this.setCategoriesFromScale}>\n Set Categories{\" \"}\n </button>\n </div>\n </div>\n )}\n <div>\n <label>\n Label Interval:{\" \"}\n <NumberInput\n useArrowKeys={true}\n value={this.props.labelInterval}\n onChange={this.changeLabelInterval}\n />\n </label>\n <InfoTip>\n <p>\n Which ticks to display the labels for. For instance,\n setting this to \"4\" will only show every 4th label\n (plus the last one)\n </p>\n </InfoTip>\n </div>\n {this.props.type === PIC && (\n <div>\n <label>\n Picture:{\" \"}\n <BlurInput\n className=\"pic-url\"\n value={this.props.picUrl}\n onChange={this.changePicUrl}\n />\n <InfoTip>\n <p>\n Use the default picture of Earth, or insert\n the URL for a different picture using the\n \"Add image\" function.\n </p>\n </InfoTip>\n </label>\n {this.state.pic &&\n this.state.pic.width !== this.state.pic.height && (\n <p className=\"warning\">\n <b>Warning</b>: You are using a picture\n which is not square. This means the image\n will get distorted. You should probably crop\n it to be square.\n </p>\n )}\n </div>\n )}\n <div>\n <label>\n Categories:{\" \"}\n <TextListEditor\n // eslint-disable-next-line react/no-string-refs\n ref=\"categories\"\n layout=\"horizontal\"\n options={this.props.categories}\n onChange={this.changeCategories}\n />\n </label>\n </div>\n <div>\n <label>\n Scale (y):{\" \"}\n <input\n type=\"text\"\n onChange={this.changeScale}\n defaultValue={this.props.scaleY}\n />\n </label>\n </div>\n <div>\n <label>\n Max y:{\" \"}\n <input\n type=\"text\"\n // eslint-disable-next-line react/no-string-refs\n ref=\"maxY\"\n onChange={this.changeMax}\n defaultValue={this.props.maxY}\n />\n </label>\n </div>\n {canChangeSnaps && (\n <div>\n <label>\n Snaps per line:{\" \"}\n <input\n type=\"text\"\n onChange={this.changeSnaps}\n defaultValue={this.props.snapsPerLine}\n />\n </label>\n <InfoTip>\n <p>\n Creates the specified number of divisions\n between the horizontal lines. Fewer snaps\n between lines makes the graph easier for the\n student to create correctly.\n </p>\n </InfoTip>\n </div>\n )}\n <div>\n Editing values:{\" \"}\n {[\"correct\", \"starting\"].map((editing) => (\n <label key={editing}>\n <input\n type=\"radio\"\n disabled={\n editing === \"correct\" && this.props.static\n }\n checked={\n this.props.static\n ? editing === \"starting\"\n : this.state.editing === editing\n }\n onChange={(e) => this.changeEditing(editing)}\n />\n {editing}\n </label>\n ))}\n <InfoTip>\n <p>\n Use this toggle to switch between editing the\n correct answer (what the student will be graded on)\n and the starting values (what the student will see\n plotted when they start the problem). Note: These\n cannot be the same.\n </p>\n <p>\n In static mode, the starting values are rendered out\n to the displayed widget.\n </p>\n </InfoTip>\n </div>\n <Plotter\n {...props}\n starting={this.props[this.state.editing]}\n onChange={this.handlePlotterChange}\n />\n </div>\n );\n }\n\n handleChangeTickStep: (number) => void = (value) => {\n this.setState({\n tickStep: value,\n });\n };\n\n handleChangeRange: ([number, number]) => void = (newValue) => {\n this.setState({\n minX: newValue[0],\n maxX: newValue[1],\n });\n };\n\n changeLabelInterval: (number) => void = (value) => {\n this.props.onChange({\n labelInterval: value,\n });\n };\n\n handlePlotterChange: ($FlowFixMe) => void = (newProps) => {\n const props = {};\n props[this.state.editing] = newProps.values;\n this.props.onChange(props);\n };\n\n changeType: ($FlowFixMe) => void = (type) => {\n let categories;\n if (type === HISTOGRAM) {\n // Switching to histogram, add a label (0) to the left\n categories = [formatNumber(0)].concat(this.props.categories);\n this.props.onChange({type: type, categories: categories});\n } else if (this.props.type === HISTOGRAM) {\n // Switching from histogram, remove a label from the left\n categories = this.props.categories.slice(1);\n this.props.onChange({type: type, categories: categories});\n } else {\n this.props.onChange({type: type});\n }\n\n if (categories) {\n // eslint-disable-next-line react/no-string-refs\n const node = ReactDOM.findDOMNode(this.refs.categories);\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n node.value = categories.join(\", \");\n }\n };\n\n changeLabel: (number, $FlowFixMe) => void = (i, e) => {\n const labels = _.clone(this.props.labels);\n labels[i] = e.target.value;\n this.props.onChange({labels: labels});\n };\n\n changePicUrl: (string) => void = (value) => {\n // We don't need the labels and other data in the plotter, so just\n // extract the raw image and use that.\n // TODO(emily): Maybe indicate that such a change has happened?\n const url = Util.getRealImageUrl(value);\n\n this.props.onChange({picUrl: url});\n };\n\n changeCategories: ($FlowFixMe) => void = (categories) => {\n let n = categories.length;\n if (this.props.type === HISTOGRAM) {\n // Histograms with n labels/categories have n - 1 buckets\n n--;\n }\n const value = this.props.scaleY;\n\n this.props.onChange({\n categories: categories,\n correct: padArray(this.props.correct, n, value),\n starting: padArray(this.props.starting, n, value),\n });\n };\n\n changeScale: ($FlowFixMe) => void = (e) => {\n const oldScale = this.props.scaleY;\n const newScale = +e.target.value || editorDefaults.scaleY;\n\n const scale = function (value) {\n return (value * newScale) / oldScale;\n };\n\n const maxY = scale(this.props.maxY);\n\n this.props.onChange({\n scaleY: newScale,\n maxY: maxY,\n correct: _.map(this.props.correct, scale),\n starting: _.map(this.props.starting, scale),\n });\n\n // $FlowFixMe[prop-missing]\n // $FlowFixMe[incompatible-use]\n ReactDOM.findDOMNode(this.refs.maxY).value = maxY; // eslint-disable-line react/no-string-refs\n };\n\n changeMax: ($FlowFixMe) => void = (e) => {\n this.props.onChange({\n maxY: +e.target.value || editorDefaults.maxY,\n });\n };\n\n changeSnaps: ($FlowFixMe) => void = (e) => {\n this.props.onChange({\n snapsPerLine: +e.target.value || editorDefaults.snapsPerLine,\n });\n };\n\n changeEditing: (string) => void = (editing) => {\n this.setState({editing: editing});\n };\n\n setCategoriesFromScale: () => void = () => {\n const scale = this.state.tickStep || 1;\n const min = this.state.minX || 0;\n const max = this.state.maxX || 0;\n const length = Math.floor((max - min) / scale) * scale;\n\n let categories;\n if (this.props.type === HISTOGRAM || this.props.type === DOTPLOT) {\n // Ranges for histogram and dotplot labels should start at zero\n categories = _.range(0, length + scale, scale);\n } else {\n categories = _.range(scale, length + scale, scale);\n }\n\n categories = _.map(categories, (num) => num + min);\n categories = _.map(categories, formatNumber);\n\n this.changeCategories(categories);\n\n // eslint-disable-next-line react/no-string-refs\n const node = ReactDOM.findDOMNode(this.refs.categories);\n\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n node.value = categories.join(\", \");\n };\n\n serialize: () => $FlowFixMe = () => {\n const json = _.pick(\n this.props,\n \"correct\",\n \"starting\",\n \"type\",\n \"labels\",\n \"categories\",\n \"scaleY\",\n \"maxY\",\n \"snapsPerLine\",\n \"labelInterval\",\n );\n\n if (this.props.type === PIC) {\n json.picUrl = this.props.picUrl;\n }\n\n return json;\n };\n}\n\nexport default PlotterEditor;\n","/* eslint-disable jsx-a11y/anchor-is-valid, react/forbid-prop-types, react/sort-comp */\n// @flow\nimport {\n components,\n icons,\n ApiOptions,\n BaseRadio,\n Changeable,\n} from \"@khanacademy/perseus\";\nimport * as i18n from \"@khanacademy/wonder-blocks-i18n\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../../editor.jsx\";\n\nconst {InlineIcon, PropCheckBox} = components;\nconst {iconPlus, iconTrash} = icons;\n\nclass ChoiceEditor extends React.Component<$FlowFixMe> {\n static propTypes = {\n apiOptions: ApiOptions.propTypes,\n\n choice: PropTypes.object,\n showDelete: PropTypes.bool,\n onClueChange: PropTypes.func,\n onContentChange: PropTypes.func,\n onDelete: PropTypes.func,\n };\n\n render(): React.Node {\n const checkedClass = this.props.choice.correct\n ? \"correct\"\n : \"incorrect\";\n let placeholder = \"Type a choice here...\";\n\n if (this.props.choice.isNoneOfTheAbove) {\n placeholder = this.props.choice.correct\n ? \"Type the answer to reveal to the user...\"\n : \"None of the above\";\n }\n\n const editor = (\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"content-editor\"\n apiOptions={this.props.apiOptions}\n content={this.props.choice.content || \"\"}\n widgetEnabled={false}\n placeholder={placeholder}\n disabled={\n this.props.choice.isNoneOfTheAbove &&\n !this.props.choice.correct\n }\n onChange={this.props.onContentChange}\n />\n );\n\n const clueEditor = (\n <Editor\n // eslint-disable-next-line react/no-string-refs\n ref=\"clue-editor\"\n apiOptions={this.props.apiOptions}\n content={this.props.choice.clue || \"\"}\n widgetEnabled={false}\n placeholder={i18n._(\n \"Why is this choice %(correctOrIncorrect)s?\",\n {correctOrIncorrect: checkedClass},\n )}\n onChange={this.props.onClueChange}\n />\n );\n\n const deleteLink = (\n <a\n className=\"simple-button orange delete-choice\"\n href=\"#\"\n onClick={this.props.onDelete}\n title=\"Remove this choice\"\n >\n <InlineIcon {...iconTrash} />\n </a>\n );\n\n return (\n <div className=\"choice-clue-editors\">\n <div className={`choice-editor ${checkedClass}`}>{editor}</div>\n <div className=\"clue-editor\">{clueEditor}</div>\n {this.props.showDelete && deleteLink}\n </div>\n );\n }\n}\n\nclass RadioEditor extends React.Component<$FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n apiOptions: ApiOptions.propTypes,\n choices: PropTypes.arrayOf(\n PropTypes.shape({\n content: PropTypes.string,\n clue: PropTypes.string,\n correct: PropTypes.bool,\n }),\n ),\n displayCount: PropTypes.number,\n randomize: PropTypes.bool,\n hasNoneOfTheAbove: PropTypes.bool,\n multipleSelect: PropTypes.bool,\n countChoices: PropTypes.bool,\n\n // TODO(kevinb): DEPRECATED: This is be used to force deselectEnabled\n // behavior on mobile but not on desktop. When enabled, the user can\n // deselect a radio input by tapping on it again.\n deselectEnabled: PropTypes.bool,\n\n static: PropTypes.bool,\n };\n\n static widgetName: string = \"radio\";\n\n static defaultProps: $FlowFixMe = {\n choices: [{}, {}],\n displayCount: null,\n randomize: false,\n hasNoneOfTheAbove: false,\n multipleSelect: false,\n countChoices: false,\n deselectEnabled: false,\n };\n\n render(): React.Node {\n const numCorrect = _.reduce(\n this.props.choices,\n function (memo, choice) {\n return choice.correct ? memo + 1 : memo;\n },\n 0,\n );\n return (\n <div>\n <div className=\"perseus-widget-row\">\n <a\n href={\n // This is an editor component, not user-facing.\n // eslint-disable-next-line static-service/require-safe-link-to\n \"https://docs.google.com/document/d/1frZf7yrWVWb1n4tVjqlzqVUiv1pn4cZXbxgP62-JDBY/edit#heading=h.8ng1isya19nu\"\n }\n target=\"_blank\"\n >\n Multiple choice style guide\n </a>\n <br />\n <div className=\"perseus-widget-left-col\">\n <PropCheckBox\n label=\"Multiple selections\"\n labelAlignment=\"right\"\n multipleSelect={this.props.multipleSelect}\n onChange={this.onMultipleSelectChange}\n />\n </div>\n <div className=\"perseus-widget-right-col\">\n <PropCheckBox\n label=\"Randomize order\"\n labelAlignment=\"right\"\n randomize={this.props.randomize}\n onChange={this.props.onChange}\n />\n </div>\n {this.props.multipleSelect && (\n <div className=\"perseus-widget-left-col\">\n <PropCheckBox\n label=\"Specify number correct\"\n labelAlignment=\"right\"\n countChoices={this.props.countChoices}\n onChange={this.onCountChoicesChange}\n />\n </div>\n )}\n </div>\n\n <BaseRadio\n // eslint-disable-next-line react/no-string-refs\n ref=\"baseRadio\"\n multipleSelect={this.props.multipleSelect}\n countChoices={this.props.countChoices}\n numCorrect={numCorrect}\n editMode={true}\n labelWrap={false}\n apiOptions={this.props.apiOptions}\n choices={this.props.choices.map(function (choice, i) {\n return {\n content: (\n <ChoiceEditor\n ref={`choice-editor${i}`}\n apiOptions={this.props.apiOptions}\n choice={choice}\n onContentChange={(newProps) => {\n if (\"content\" in newProps) {\n this.onContentChange(\n i,\n newProps.content,\n );\n }\n }}\n onClueChange={(newProps) => {\n if (\"content\" in newProps) {\n this.onClueChange(\n i,\n newProps.content,\n );\n }\n }}\n // eslint-disable-next-line react/jsx-no-bind\n onDelete={this.onDelete.bind(this, i)}\n showDelete={this.props.choices.length >= 2}\n />\n ),\n isNoneOfTheAbove: choice.isNoneOfTheAbove,\n checked: choice.correct,\n };\n }, this)}\n onChange={this.onChange}\n />\n\n <div className=\"add-choice-container\">\n <a\n className=\"simple-button orange\"\n href=\"#\"\n // eslint-disable-next-line react/jsx-no-bind\n onClick={this.addChoice.bind(this, false)}\n >\n <InlineIcon {...iconPlus} /> Add a choice{\" \"}\n </a>\n\n {!this.props.hasNoneOfTheAbove && (\n <a\n className=\"simple-button\"\n href=\"#\"\n // eslint-disable-next-line react/jsx-no-bind\n onClick={this.addChoice.bind(this, true)}\n >\n <InlineIcon {...iconPlus} /> None of the above{\" \"}\n </a>\n )}\n </div>\n </div>\n );\n }\n\n change: (...args: $ReadOnlyArray<mixed>) => $FlowFixMe = (...args) => {\n // $FlowFixMe[incompatible-call]\n return Changeable.change.apply(this, args);\n };\n\n onMultipleSelectChange: ($FlowFixMe) => $FlowFixMe = (allowMultiple) => {\n allowMultiple = allowMultiple.multipleSelect;\n\n const numCorrect = _.reduce(\n this.props.choices,\n function (memo, choice) {\n return choice.correct ? memo + 1 : memo;\n },\n 0,\n );\n\n if (!allowMultiple && numCorrect > 1) {\n const choices = _.map(this.props.choices, function (choice) {\n return _.defaults(\n {\n correct: false,\n },\n choice,\n );\n });\n this.props.onChange({\n multipleSelect: allowMultiple,\n choices: choices,\n });\n } else {\n this.props.onChange({\n multipleSelect: allowMultiple,\n });\n }\n };\n\n onCountChoicesChange: ($FlowFixMe) => void = (count) => {\n count = count.countChoices;\n this.props.onChange({countChoices: count});\n };\n\n onChange: ($FlowFixMe) => void = ({checked}) => {\n const choices = _.map(this.props.choices, (choice, i) => {\n return _.extend({}, choice, {\n correct: checked[i],\n content:\n choice.isNoneOfTheAbove && !checked[i]\n ? \"\"\n : choice.content,\n });\n });\n\n this.props.onChange({choices: choices});\n };\n\n onContentChange: ($FlowFixMe, $FlowFixMe) => void = (\n choiceIndex,\n newContent,\n ) => {\n const choices = this.props.choices.slice();\n choices[choiceIndex] = _.extend({}, choices[choiceIndex], {\n content: newContent,\n });\n this.props.onChange({choices: choices});\n };\n\n onClueChange: ($FlowFixMe, $FlowFixMe) => void = (choiceIndex, newClue) => {\n const choices = this.props.choices.slice();\n choices[choiceIndex] = _.extend({}, choices[choiceIndex], {\n clue: newClue,\n });\n if (newClue === \"\") {\n delete choices[choiceIndex].clue;\n }\n this.props.onChange({choices: choices});\n };\n\n onDelete: (number, $FlowFixMe) => void = (choiceIndex, e) => {\n e.preventDefault();\n\n const choices = this.props.choices.slice();\n const deleted = choices[choiceIndex];\n\n choices.splice(choiceIndex, 1);\n\n this.props.onChange({\n choices: choices,\n hasNoneOfTheAbove:\n this.props.hasNoneOfTheAbove && !deleted.isNoneOfTheAbove,\n });\n };\n\n addChoice: (boolean, $FlowFixMe) => void = (noneOfTheAbove, e) => {\n e.preventDefault();\n\n const choices = this.props.choices.slice();\n const newChoice = {isNoneOfTheAbove: noneOfTheAbove};\n const addIndex =\n choices.length - (this.props.hasNoneOfTheAbove ? 1 : 0);\n\n choices.splice(addIndex, 0, newChoice);\n\n this.props.onChange(\n {\n choices: choices,\n hasNoneOfTheAbove:\n noneOfTheAbove || this.props.hasNoneOfTheAbove,\n },\n () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs[`choice-editor${addIndex}`].refs[\n \"content-editor\"\n ].focus();\n },\n );\n };\n\n setDisplayCount: (number) => void = (num) => {\n this.props.onChange({displayCount: num});\n };\n\n focus: () => boolean = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs[\"choice-editor0\"].refs[\"content-editor\"].focus();\n return true;\n };\n\n getSaveWarnings: () => $ReadOnlyArray<string> = () => {\n if (!_.some(_.pluck(this.props.choices, \"correct\"))) {\n return [\"No choice is marked as correct.\"];\n }\n return [];\n };\n\n serialize: () => $FlowFixMe = () => {\n return _.pick(\n this.props,\n \"choices\",\n \"randomize\",\n \"multipleSelect\",\n \"countChoices\",\n \"displayCount\",\n \"hasNoneOfTheAbove\",\n \"deselectEnabled\",\n );\n };\n}\n\nexport default RadioEditor;\n","// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\n\nconst {NumberInput, TextInput} = components;\n\ntype Props = $FlowFixMe;\n\nclass ReactionDiagramWidgetEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n rotationAngle: PropTypes.arrayOf(PropTypes.number),\n separators: PropTypes.arrayOf(PropTypes.object),\n smiles: PropTypes.arrayOf(PropTypes.string),\n };\n\n static widgetName: \"reaction-diagram\" = \"reaction-diagram\";\n\n static defaultProps: Props = {\n smiles: [\"\", \"\"],\n rotationAngle: [0, 0],\n separators: [{type: \"right\", topText: \"\", bottomText: \"\"}],\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n updateMolecule: (number) => ($FlowFixMe) => void = (idx) => {\n return function (newValue) {\n const newSmiles = [...this.props.smiles];\n newSmiles[idx] = newValue;\n this.change({smiles: newSmiles});\n }.bind(this);\n };\n\n updateRotation: (number) => ($FlowFixMe) => void = (idx) => {\n return function (newValue) {\n const newRot = [...this.props.rotationAngle];\n newRot[idx] = newValue;\n this.change({rotationAngle: newRot});\n }.bind(this);\n };\n\n updateSeparators: (number, string) => ($FlowFixMe) => void = (\n idx,\n propName,\n ) => {\n return (newValue) => {\n const newSep = this.props.separators.map((sep) => {\n return {...sep};\n });\n newSep[idx][propName] = newValue;\n this.change({separators: newSep});\n };\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n // TODO(colin): use styling instead of   hacks.\n return (\n <div>\n <div>\n <label>\n LHS SMILES: \n <TextInput\n onChange={this.updateMolecule(0)}\n value={this.props.smiles[0]}\n />\n </label>\n </div>\n <div>\n <label>\n LHS Rotation (deg): \n <NumberInput\n onChange={this.updateRotation(0)}\n value={this.props.rotationAngle[0]}\n />\n </label>\n </div>\n <div>\n <label>\n RHS SMILES: \n <TextInput\n onChange={this.updateMolecule(1)}\n value={this.props.smiles[1]}\n />\n </label>\n </div>\n <div>\n <label>\n RHS Rotation (deg): \n <NumberInput\n onChange={this.updateRotation(1)}\n value={this.props.rotationAngle[1]}\n />\n </label>\n </div>\n <div>\n <label>\n Top of arrow text: \n <TextInput\n onChange={this.updateSeparators(0, \"topText\")}\n value={this.props.separators[0].topText}\n />\n </label>\n </div>\n <div>\n <label>\n Bottom of arrow text: \n <TextInput\n onChange={this.updateSeparators(0, \"bottomText\")}\n value={this.props.separators[0].bottomText}\n />\n </label>\n </div>\n </div>\n );\n }\n}\n\nexport default ReactionDiagramWidgetEditor;\n","/* eslint-disable jsx-a11y/anchor-is-valid, no-alert, react/sort-comp */\n// @flow\nimport {components, icons, ApiOptions} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {InlineIcon} = components;\nconst {iconCircleArrowDown, iconCircleArrowUp, iconPlus, iconTrash} = icons;\n\ntype StepControlButtonProps = $FlowFixMe;\n\nclass StepControlButton extends React.Component<StepControlButtonProps> {\n render(): React.Node {\n return (\n <a\n href=\"#\"\n className={\n \"step-control-button \" +\n \"simple-button \" +\n \"simple-button--small \" +\n \"orange\"\n }\n onClick={(e) => {\n e.preventDefault();\n this.props.onClick();\n }}\n >\n <InlineIcon {...this.props.icon} />\n </a>\n );\n }\n}\n\ntype SequenceEditorProps = $FlowFixMe;\n\nclass SequenceEditor extends React.Component<SequenceEditorProps> {\n static propTypes = {\n json: PropTypes.arrayOf(\n PropTypes.shape({\n content: PropTypes.string,\n widgets: PropTypes.objectOf(PropTypes.any),\n images: PropTypes.objectOf(PropTypes.any),\n }),\n ),\n apiOptions: ApiOptions.propTypes,\n onChange: PropTypes.func.isRequired,\n };\n\n static widgetName: \"sequence\" = \"sequence\";\n\n static defaultProps: SequenceEditorProps = {\n json: [\n {\n content: \"\",\n widgets: {},\n images: {},\n },\n ],\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-sequence-editor\">\n {_.map(this.props.json, (json, i) => {\n return (\n <div key={i}>\n Step {i + 1}\n <div\n style={{\n display: \"inline-block\",\n float: \"right\",\n }}\n >\n {i + 1 < this.props.json.length && (\n <StepControlButton\n icon={iconCircleArrowDown}\n onClick={() => {\n this._handleMoveStepLater(i);\n }}\n />\n )}\n {i > 0 && (\n <StepControlButton\n icon={iconCircleArrowUp}\n onClick={() => {\n this._handleMoveStepEarlier(i);\n }}\n />\n )}\n <StepControlButton\n icon={iconTrash}\n onClick={() => {\n const msg =\n \"Are you sure you \" +\n \"want to remove step \" +\n (i + 1) +\n \"?\";\n if (confirm(msg)) {\n this._handleRemoveStep(i);\n }\n }}\n />\n <StepControlButton\n icon={iconPlus}\n onClick={() => {\n this._handleAddStepAfter(i);\n }}\n />\n </div>\n <Editor\n ref={\"editor\" + i}\n apiOptions={this.props.apiOptions}\n content={json.content}\n widgets={json.widgets}\n images={json.images}\n widgetEnabled={true}\n immutableWidgets={false}\n onChange={_.partial(\n this._handleEditorChange,\n i,\n )}\n />\n </div>\n );\n })}\n </div>\n );\n }\n\n _handleEditorChange: (number, $FlowFixMe) => void = (i, newProps) => {\n const steps = _.clone(this.props.json);\n steps[i] = _.extend({}, steps[i], newProps);\n this.props.onChange({json: steps});\n };\n\n serialize: () => $FlowFixMe = () => {\n return {\n json: _.times(this.props.json.length, (i) => {\n // eslint-disable-next-line react/no-string-refs\n return this.refs[\"editor\" + i].serialize();\n }),\n };\n };\n\n _handleMoveStepEarlier: (number) => void = (i) => {\n if (i === 0) {\n return;\n }\n const steps = _.clone(this.props.json);\n const step = steps[i];\n steps.splice(i, 1);\n steps.splice(i - 1, 0, step);\n this.props.onChange({\n json: steps,\n });\n };\n\n _handleMoveStepLater: (number) => void = (i) => {\n const steps = _.clone(this.props.json);\n if (i + 1 === steps.length) {\n return;\n }\n const step = steps[i];\n steps.splice(i, 1);\n steps.splice(i + 1, 0, step);\n this.props.onChange({\n json: steps,\n });\n };\n\n _handleAddStepAfter: (number) => void = (i) => {\n // We do a full serialization here because we\n // might be copying widgets:\n const steps = _.clone(this.props.json);\n // Here we do magic to allow you to copy-paste\n // things from the previous section into the new\n // section while preserving widgets.\n // To enable this, we preserve the widgets\n // object for the new section, but wipe out\n // the content.\n const newStep =\n i >= 0\n ? {\n widgets: steps[i].widgets,\n }\n : {};\n steps.splice(i + 1, 0, newStep);\n this.props.onChange({\n json: steps,\n });\n };\n\n _handleRemoveStep: (number) => void = (i) => {\n const steps = _.clone(this.props.json);\n steps.splice(i, 1);\n this.props.onChange({\n json: steps,\n });\n };\n}\n\nexport default SequenceEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\n/**\n * This is the editor for the simple-markdown-tester widget. This is what shows\n * up on the left side of the screen in the demo. Only the question writer\n * sees this.\n */\nimport {Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport * as React from \"react\";\n\ntype TextAreaProps = $FlowFixMe;\n\nclass TextArea extends React.Component<TextAreaProps> {\n render(): React.Node {\n return (\n <textarea\n // eslint-disable-next-line react/no-string-refs\n ref=\"input\"\n value={this.props.value || \"\"}\n onChange={this.changeValue}\n />\n );\n }\n\n focus = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.input.focus();\n return true;\n };\n\n changeValue = (e) => {\n // Translating from the js event e to the value\n // of the textbox to send to onChange\n this.props.onChange(e.target.value);\n };\n}\n\ntype SimpleMarkdownTesterEditorProps = $FlowFixMe;\n\nclass SimpleMarkdownTesterEditor extends React.Component<SimpleMarkdownTesterEditorProps> {\n static propTypes = {\n ...Changeable.propTypes,\n };\n\n static widgetName: \"simple-markdown-tester\" = \"simple-markdown-tester\";\n\n static defaultProps: SimpleMarkdownTesterEditorProps = {\n value: \"\",\n };\n\n render(): React.Node {\n return (\n <div>\n <label>\n <div>Simple markdown contents:</div>\n <div>\n <TextArea\n value={this.props.value}\n onChange={this.change(\"value\")}\n // eslint-disable-next-line react/no-string-refs\n ref=\"input\"\n />\n </div>\n </label>\n </div>\n );\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n focus: () => boolean = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.input.focus();\n return true;\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default SimpleMarkdownTesterEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport * as i18n from \"@khanacademy/wonder-blocks-i18n\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InfoTip, NumberInput} = components;\n\nconst maxTrials = 5000;\n\ntype Props = $FlowFixMe;\n\nclass SimulatorEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n xAxisLabel: PropTypes.string,\n yAxisLabel: PropTypes.string,\n numTrials: PropTypes.number,\n proportionLabel: PropTypes.string,\n proportionOrPercentage: PropTypes.string,\n };\n\n static widgetName: string = \"simulator\";\n\n static defaultProps: Props = {\n xAxisLabel: \"Proportion (%)\",\n yAxisLabel: \"Number of times seen\",\n numTrials: 100,\n proportionLabel: \"Underlying proportion\",\n proportionOrPercentage: \"proportion\",\n };\n\n render(): React.Node {\n return (\n <div className=\"perseus-widget-simulator\">\n <div>\n {i18n._(\"X-Axis Label\")}:\n <input\n type=\"text\"\n className=\"graph-settings-axis-label\"\n value={this.props.xAxisLabel}\n onChange={_.partial(\n this.handleTargetValueChange,\n \"xAxisLabel\",\n )}\n />\n </div>\n <div>\n {i18n._(\"Y-Axis Label\")}:\n <input\n type=\"text\"\n className=\"graph-settings-axis-label\"\n value={this.props.yAxisLabel}\n onChange={_.partial(\n this.handleTargetValueChange,\n \"yAxisLabel\",\n )}\n />\n </div>\n <div>\n {i18n._('\"True Proportion\" Label')}:\n <input\n type=\"text\"\n className=\"graph-settings-axis-label\"\n value={this.props.proportionLabel}\n onChange={_.partial(\n this.handleTargetValueChange,\n \"proportionLabel\",\n )}\n />\n <InfoTip>\n <p>\n This text will be displayed next to the box in which\n the user enters the sample proportion for their\n simulation. For example, if your question is about\n surveying for approval ratings, you might want this\n to say \"Sample approval rating\".\n </p>\n </InfoTip>\n </div>\n <div>\n {i18n._(\"Proportion or Percentage\")}:\n <select\n className=\"perseus-widget-dropdown\"\n value={this.props.proportionOrPercentage}\n onChange={_.partial(\n this.handleTargetValueChange,\n \"proportionOrPercentage\",\n )}\n >\n <option key=\"proportion\" value=\"proportion\">\n Proportion\n </option>\n <option key=\"percentage\" value=\"percentage\">\n Percentage\n </option>\n </select>\n <InfoTip>\n <p>\n Do you want the user to describe their simulation in\n terms of a proportion or a percentage?\n </p>\n </InfoTip>\n </div>\n <div>\n {i18n._(\"Number of trials\")}:\n <NumberInput\n value={this.props.numTrials}\n checkValidity={(val) => {\n return val >= 0 && val <= maxTrials;\n }}\n onChange={this.change(\"numTrials\")}\n />\n <InfoTip>\n <p>\n This controls the number of trials used in the\n simulation. For example, if you set this to 50, then\n the survey will be conducted 50 times. Warning:\n setting this too high (i.e., greater than 5000 or\n so) will freeze the page.\n </p>\n </InfoTip>\n </div>\n </div>\n );\n }\n\n change: (...args: $ReadOnlyArray<mixed>) => $FlowFixMe = (...args) => {\n // $FlowFixMe[incompatible-call]\n return Changeable.change.apply(this, args);\n };\n\n handleTargetValueChange: (string, $FlowFixMe) => void = (propName, e) => {\n this.change(propName, e.target.value);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n}\n\nexport default SimulatorEditor;\n","/* eslint-disable react/forbid-prop-types */\n// @flow\nimport {components} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InfoTip, PropCheckBox, TextListEditor} = components;\n\nconst HORIZONTAL = \"horizontal\";\nconst VERTICAL = \"vertical\";\n\ntype Props = $FlowFixMe;\n\nclass SorterEditor extends React.Component<Props> {\n static propTypes = {\n correct: PropTypes.array,\n layout: PropTypes.oneOf([HORIZONTAL, VERTICAL]),\n padding: PropTypes.bool,\n };\n\n static widgetName: \"sorter\" = \"sorter\";\n\n static defaultProps: Props = {\n correct: [\"$x$\", \"$y$\", \"$z$\"],\n layout: HORIZONTAL,\n padding: true,\n };\n\n onLayoutChange: (SyntheticInputEvent<>) => void = (e) => {\n this.props.onChange({layout: e.target.value});\n };\n\n serialize: ($FlowFixMe) => void = () => {\n return _.pick(this.props, \"correct\", \"layout\", \"padding\");\n };\n\n render(): React.Node {\n const editor = this;\n\n return (\n <div>\n <div>\n {\" \"}\n Correct answer:{\" \"}\n <InfoTip>\n <p>\n Enter the correct answer (in the correct order)\n here. The preview on the right will have the cards\n in a randomized order, which is how the student will\n see them.\n </p>\n </InfoTip>\n </div>\n <TextListEditor\n options={this.props.correct}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={function (options, cb) {\n editor.props.onChange({correct: options}, cb);\n }}\n layout={this.props.layout}\n />\n <div>\n <label>\n {\" \"}\n Layout:{\" \"}\n <select\n value={this.props.layout}\n onChange={this.onLayoutChange}\n >\n <option value={HORIZONTAL}>Horizontal</option>\n <option value={VERTICAL}>Vertical</option>\n </select>\n </label>\n <InfoTip>\n <p>\n Use the horizontal layout for short text and small\n images. The vertical layout is best for longer text\n and larger images.\n </p>\n </InfoTip>\n </div>\n <div>\n <PropCheckBox\n label=\"Padding:\"\n padding={this.props.padding}\n onChange={this.props.onChange}\n />\n <InfoTip>\n <p>\n Padding is good for text, but not needed for images.\n </p>\n </InfoTip>\n </div>\n </div>\n );\n }\n}\n\nexport default SorterEditor;\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {components, TableWidget, Util} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport _ from \"underscore\";\n\nimport Editor from \"../editor.jsx\";\n\nconst {InfoTip, NumberInput} = components;\nconst Table = TableWidget.widget;\n\ntype Props = $FlowFixMe;\n\nclass TableEditor extends React.Component<Props> {\n static propTypes = {\n rows: PropTypes.number,\n columns: PropTypes.number,\n headers: PropTypes.arrayOf(PropTypes.string),\n answers: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string)),\n };\n\n static widgetName: \"table\" = \"table\";\n\n static defaultProps: Props = (function () {\n const defaultRows = 4;\n const defaultColumns = 1;\n const blankAnswers = _(defaultRows).times(function () {\n return Util.stringArrayOfSize(defaultColumns);\n });\n return {\n headers: [\"\"],\n rows: defaultRows,\n columns: defaultColumns,\n answers: blankAnswers,\n };\n })();\n\n focus: () => void = () => {\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n ReactDOM.findDOMNode(this.refs.numberOfColumns).focus(); // eslint-disable-line react/no-string-refs\n };\n\n render(): React.Node {\n const tableProps = _.pick(\n this.props,\n \"headers\",\n \"answers\",\n \"onChange\",\n \"apiOptions\",\n );\n _.extend(tableProps, {\n editableHeaders: true,\n Editor,\n onFocus: () => {},\n onBlur: () => {},\n trackInteraction: () => {},\n });\n\n return (\n <div>\n <div className=\"perseus-widget-row\">\n <label>\n Number of columns:{\" \"}\n <NumberInput\n // eslint-disable-next-line react/no-string-refs\n ref=\"numberOfColumns\"\n value={this.props.columns}\n onChange={(val) => {\n if (val) {\n this.onSizeInput(this.props.rows, val);\n }\n }}\n useArrowKeys={true}\n />\n </label>\n </div>\n <div className=\"perseus-widget-row\">\n <label>\n Number of rows:{\" \"}\n <NumberInput\n // eslint-disable-next-line react/no-string-refs\n ref=\"numberOfRows\"\n value={this.props.rows}\n onChange={(val) => {\n if (val) {\n this.onSizeInput(val, this.props.columns);\n }\n }}\n useArrowKeys={true}\n />\n </label>\n </div>\n <div>\n {\" \"}\n Table of answers:{\" \"}\n <InfoTip>\n <p>\n The student has to fill out all cells in the table.\n For partially filled tables create a table using the\n template, and insert text input boxes as desired.\n </p>\n </InfoTip>\n </div>\n <div>\n <Table {...tableProps} />\n </div>\n </div>\n );\n }\n\n onSizeInput: (number, number) => void = (numRawRows, numRawColumns) => {\n let rows = +numRawRows || 0;\n let columns = +numRawColumns || 0;\n rows = Math.min(Math.max(1, rows), 30);\n columns = Math.min(Math.max(1, columns), 6);\n const oldColumns = this.props.columns;\n const oldRows = this.props.rows;\n\n const answers = this.props.answers;\n // Truncate if necessary; else, append\n if (rows <= oldRows) {\n answers.length = rows;\n } else {\n _(rows - oldRows).times(function () {\n answers.push(Util.stringArrayOfSize(oldColumns));\n });\n }\n\n function fixColumnSizing(array) {\n // Truncate if necessary; else, append\n if (columns <= oldColumns) {\n array.length = columns;\n } else {\n _(columns - oldColumns).times(function () {\n array.push(\"\");\n });\n }\n }\n\n const headers = this.props.headers;\n fixColumnSizing(headers);\n _.each(answers, fixColumnSizing);\n\n this.props.onChange({\n rows: rows,\n columns: columns,\n answers: answers,\n headers: headers,\n });\n };\n\n serialize: () => $FlowFixMe = () => {\n const json = _.pick(this.props, \"headers\", \"rows\", \"columns\");\n\n return _.extend({}, json, {\n answers: _.map(this.props.answers, _.clone),\n });\n };\n}\n\nexport default TableEditor;\n","/* eslint-disable camelcase, react/sort-comp */\n// @flow\nimport {\n components,\n ApiOptions,\n Errors,\n KhanColors,\n PerseusError,\n TransformerWidget,\n Util,\n} from \"@khanacademy/perseus\";\nimport {\n line as kline,\n number as knumber,\n point as kpoint,\n ray as kray,\n vector as kvector,\n} from \"kmath\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport GraphSettings from \"../components/graph-settings.jsx\";\n\nconst {Graph, InfoTip, PropCheckBox} = components;\nconst Transformer = TransformerWidget.widget;\nconst {deepEq, getGridStep} = Util;\n\nfunction arraySum(array) {\n return _.reduce(\n array,\n function (memo, arg) {\n return memo + arg;\n },\n 0,\n );\n}\n\nconst defaultBackgroundImage = {\n url: null,\n};\n\n/* Scales a distance from the default range of\n * [-10, 10] to a given props.range pair\n *\n * Used for sizing various transformation tools\n * (rotation handle, dilation circle)\n */\nfunction scaleToRange(dist, range) {\n const spreadX = range[0][1] - range[0][0];\n const spreadY = range[1][1] - range[1][0];\n\n return (dist * Math.max(spreadX, spreadY)) / 20;\n}\n\nfunction orderInsensitiveCoordsEqual(coords1, coords2) {\n coords1 = _.clone(coords1).sort(kpoint.compare);\n coords2 = _.clone(coords2).sort(kpoint.compare);\n return _.all(\n _.map(coords1, function (coord1, i) {\n const coord2 = coords2[i];\n return kpoint.equal(coord1, coord2);\n }),\n );\n}\n\nconst defaultGraphProps = function (setProps, boxSize) {\n setProps = setProps || {};\n const labels = setProps.labels || [\"x\", \"y\"];\n const range = setProps.range || [\n [-10, 10],\n [-10, 10],\n ];\n const step = setProps.step || [1, 1];\n const gridStep = setProps.gridStep || getGridStep(range, step, boxSize);\n return {\n box: [boxSize, boxSize],\n labels: labels,\n range: range,\n step: step,\n gridStep: gridStep,\n valid: true,\n backgroundImage: defaultBackgroundImage,\n markings: \"grid\",\n showProtractor: false,\n };\n};\n\nconst defaultTransformerProps = {\n apiOptions: ApiOptions.defaults,\n gradeEmpty: false,\n graphMode: \"interactive\",\n listMode: \"dynamic\",\n graph: {},\n tools: {\n translation: {\n enabled: true,\n required: false,\n constraints: {},\n },\n rotation: {\n enabled: true,\n required: false,\n constraints: {\n fixed: false,\n },\n coord: [1, 6],\n },\n reflection: {\n enabled: true,\n required: false,\n constraints: {\n fixed: false,\n },\n coords: [\n [2, -4],\n [2, 2],\n ],\n },\n dilation: {\n enabled: true,\n required: false,\n constraints: {\n fixed: false,\n },\n coord: [6, 6],\n },\n },\n drawSolutionShape: true,\n starting: {\n shape: {\n type: \"polygon-3\",\n coords: [\n [2, 2],\n [2, 6],\n [7, 2],\n ],\n },\n transformations: [],\n },\n correct: {\n shape: {\n type: \"polygon-3\",\n coords: [\n [2, 2],\n [2, 6],\n [7, 2],\n ],\n },\n transformations: [],\n },\n};\n\nclass ToolSettings extends React.Component<$FlowFixMe> {\n static defaultProps = {\n allowFixed: true,\n };\n\n render(): React.Node {\n return (\n <div>\n {this.props.name}:{\" \"}\n <PropCheckBox\n label=\"enabled:\"\n enabled={this.props.settings.enabled}\n onChange={this.props.onChange}\n />{\" \"}\n {this.props.settings.enabled && (\n <PropCheckBox\n label=\"required:\"\n required={this.props.settings.required}\n onChange={this.props.onChange}\n />\n )}\n {this.props.settings.enabled && (\n <InfoTip>\n 'Required' will only grade the answer as correct if the\n student has used at least one such transformation.\n </InfoTip>\n )}{\" \"}\n {this.props.allowFixed && this.props.settings.enabled && (\n <PropCheckBox\n label=\"fixed:\"\n fixed={this.props.settings.constraints.fixed}\n onChange={this.changeConstraints}\n />\n )}\n {this.props.allowFixed && this.props.settings.enabled && (\n <InfoTip>\n Enable 'fixed' to prevent the student from repositioning\n the tool. The tool will appear in the position at which\n it is placed in the editor below.\n </InfoTip>\n )}\n </div>\n );\n }\n\n changeConstraints = (changed) => {\n const newConstraints = _.extend({}, this.props.constraints, changed);\n this.props.onChange({\n constraints: newConstraints,\n });\n };\n}\n\nclass TransformationExplorerSettings extends React.Component<$FlowFixMe> {\n render(): React.Node {\n return (\n <div className=\"transformer-settings\">\n <div>\n {\" \"}\n Mode:{\" \"}\n <select value={this.getMode()} onChange={this.changeMode}>\n <option value=\"interactive,dynamic\">\n {\" \"}\n Exploration with text{\" \"}\n </option>\n <option value=\"interactive,static\">\n {\" \"}\n Exploration without text{\" \"}\n </option>\n <option value=\"dynamic,interactive\">\n {\" \"}\n Formal with movement{\" \"}\n </option>\n <option value=\"static,interactive\">\n {\" \"}\n Formal without movement{\" \"}\n </option>\n </select>\n <InfoTip>\n <ul>\n <li>\n <b>Exploration:</b> Students create\n transformations with tools on the graph.{\" \"}\n </li>\n <li>\n <b>Formal with movement:</b> Students specify\n transformations mathematically in the\n transformation list. Graph shows the results of\n these transformations.{\" \"}\n </li>\n <li>\n <b>Formal without movement:</b> Students specify\n transformations mathematically in the\n transformation list. Graph does not update.{\" \"}\n </li>\n </ul>\n </InfoTip>\n </div>\n <ToolSettings\n name=\"Translations\"\n settings={this.props.tools.translation}\n allowFixed={false}\n onChange={this.changeHandlerFor(\"translation\")}\n />\n <ToolSettings\n name=\"Rotations\"\n settings={this.props.tools.rotation}\n onChange={this.changeHandlerFor(\"rotation\")}\n />\n <ToolSettings\n name=\"Reflections\"\n settings={this.props.tools.reflection}\n onChange={this.changeHandlerFor(\"reflection\")}\n />\n <ToolSettings\n name=\"Dilations\"\n settings={this.props.tools.dilation}\n onChange={this.changeHandlerFor(\"dilation\")}\n />\n <PropCheckBox\n label=\"Draw Solution:\"\n drawSolutionShape={this.props.drawSolutionShape}\n onChange={this.props.onChange}\n />\n </div>\n );\n }\n\n getMode = () => {\n return this.props.graphMode + \",\" + this.props.listMode;\n };\n\n changeMode = (e) => {\n const selected = e.target.value;\n const modes = selected.split(\",\");\n\n this.props.onChange({\n graphMode: modes[0],\n listMode: modes[1],\n });\n };\n\n changeHandlerFor = (toolName) => {\n return (change) => {\n const newTools = _.clone(this.props.tools);\n newTools[toolName] = _.extend(\n {},\n this.props.tools[toolName],\n change,\n );\n\n this.props.onChange({\n tools: newTools,\n });\n };\n };\n}\n\nconst ShapeTypes: $FlowFixMe = {\n getPointCountForType: function (type) {\n const splitType = type.split(\"-\");\n if (splitType[0] === \"polygon\") {\n return splitType[1] || 3;\n }\n if (splitType[0] === \"line\" || splitType[0] === \"lineSegment\") {\n return 2;\n }\n if (splitType[0] === \"angle\") {\n return 3;\n }\n if (splitType[0] === \"circle\") {\n return 2;\n }\n if (splitType[0] === \"point\") {\n return 1;\n }\n },\n\n addMovableShape: function (graphie, options) {\n if (options.editable && options.translatable) {\n throw new PerseusError(\n \"It doesn't make sense to have a movable shape \" +\n \"where you can stretch the points and translate them \" +\n \"simultaneously.\",\n Errors.InvalidInput,\n {metadata: {options}},\n );\n }\n\n const points = _.map(options.shape.coords, function (coord) {\n let isMoving = false;\n let previousCoord = coord;\n\n const onMove = function (x, y) {\n if (!isMoving) {\n previousCoord = currentPoint.coord;\n isMoving = true;\n }\n\n let moveVector = kvector.subtract([x, y], currentPoint.coord);\n\n // Translate from (x, y) semantics to (dX, dY) semantics\n // This is more useful for translations on multiple points,\n // where we care about how the points moved, not where any\n // individual point ended up\n if (options.onMove) {\n moveVector = options.onMove(moveVector[0], moveVector[1]);\n }\n\n // Perform a translation on all points in this shape when\n // any point moves\n if (options.translatable) {\n _.each(points, function (point) {\n // The point itself will be updated by the\n // movablePoint class, so only translate the other\n // points\n if (point !== currentPoint) {\n point.setCoord(\n kvector.add(point.coord, moveVector),\n );\n }\n });\n }\n\n // Update our shape and our currentPoint\n // Without this, some shapes (circles, angles) appear\n // \"bouncy\" as they are updated with currentPoint at the\n // current mouse coordinate (oldCoord), rather than newCoord\n const oldCoord = currentPoint.coord;\n const newCoord = kvector.add(currentPoint.coord, moveVector);\n // Temporarily change our coordinate so that\n // shape.update() sees the new coordinate\n currentPoint.coord = newCoord;\n shape.update();\n // ...But don't break onMove, which assumes it\n // is the only thing changing our coord\n currentPoint.coord = oldCoord;\n return newCoord;\n };\n\n const onMoveEnd = function () {\n // onMove isn't guaranteed to be called before onMoveEnd, so\n // we have to take into account that we may not have moved and\n // set previousCoord.\n if (options.onMoveEnd && isMoving) {\n isMoving = false;\n // We don't use the supplied x and y parameters here\n // because MovablePoint's onMoveEnd semantics suck.\n // It returns the mouseX, mouseY without processing them\n // through onMove, leaving us with weird fractional moves\n const change = kvector.subtract(\n currentPoint.coord,\n previousCoord,\n );\n options.onMoveEnd(change[0], change[1]);\n }\n shape.update();\n };\n\n const currentPoint = graphie.addMovablePoint({\n coord: coord,\n normalStyle: options.normalPointStyle,\n highlightStyle: options.highlightPointStyle,\n constraints: {\n fixed: !options.translatable && !options.editable,\n },\n visible: options.showPoints,\n snapX: (options.snap && options.snap[0]) || 0,\n snapY: (options.snap && options.snap[1]) || 0,\n bounded: false, // Don't bound it when placing it on the graph\n onMove: onMove,\n onMoveEnd: onMoveEnd,\n });\n\n // Bound it when moving\n // We can't set this earlier, because doing so would mean any\n // points outside of the graph would be moved into a moved into\n // a position that doesn't preserve the shape\n currentPoint.bounded = true;\n\n return currentPoint;\n });\n\n const shape = ShapeTypes.addShape(graphie, options, points);\n const removeShapeWithoutPoints = shape.remove;\n shape.remove = function () {\n removeShapeWithoutPoints.apply(shape);\n _.invoke(points, \"remove\");\n };\n return shape;\n },\n\n addShape: function (graphie, options, points) {\n points = points || options.shape.coords;\n\n const types = ShapeTypes._typesOf(options.shape);\n const typeOptions =\n options.shape.options || ShapeTypes.defaultOptions(types);\n\n const shapes = ShapeTypes._mapTypes(\n types,\n points,\n function (type, points, i) {\n const shapeOptions = _.extend({}, options, typeOptions[i]);\n return ShapeTypes._addType(graphie, type, points, shapeOptions);\n },\n );\n\n const updateFuncs = _.filter(_.pluck(shapes, \"update\"), _.identity);\n const update = function () {\n _.invoke(updateFuncs, \"call\");\n };\n\n const removeFuncs = _.filter(_.pluck(shapes, \"remove\"), _.identity);\n const remove = function () {\n _.invoke(removeFuncs, \"call\");\n };\n\n const getOptions = function () {\n return _.map(shapes, function (shape) {\n if (shape.getOptions) {\n return shape.getOptions();\n }\n return {};\n });\n };\n\n const toJSON = function () {\n const coords = _.map(points, function (pt) {\n if (_.isArray(pt)) {\n return pt;\n }\n return pt.coord;\n });\n return {\n type: types,\n coords: coords,\n options: getOptions(),\n };\n };\n\n return {\n type: types,\n points: points,\n update: update,\n remove: remove,\n toJSON: toJSON,\n getOptions: getOptions,\n };\n },\n\n equal: function (shape1, shape2) {\n const types1 = ShapeTypes._typesOf(shape1);\n const types2 = ShapeTypes._typesOf(shape2);\n if (types1.length !== types2.length) {\n return false;\n }\n const shapes1 = ShapeTypes._mapTypes(\n types1,\n shape1.coords,\n ShapeTypes._combine,\n );\n const shapes2 = ShapeTypes._mapTypes(\n types2,\n shape2.coords,\n ShapeTypes._combine,\n );\n return _.all(\n _.map(shapes1, function (partialShape1, i) {\n const partialShape2 = shapes2[i];\n if (partialShape1.type !== partialShape2.type) {\n return false;\n }\n return ShapeTypes._forType(partialShape1.type).equal(\n partialShape1.coords,\n partialShape2.coords,\n );\n }),\n );\n },\n\n _typesOf: function (shape) {\n let types = shape.type;\n if (!_.isArray(types)) {\n types = [types];\n }\n return _.map(types, function (type) {\n if (type === \"polygon\") {\n return \"polygon-3\";\n }\n return type;\n });\n },\n\n defaultOptions: function (types) {\n return _.map(types, function (type) {\n const typeDefaultOptions = ShapeTypes._forType(type).defaultOptions;\n return _.extend({}, typeDefaultOptions);\n });\n },\n\n _forType: function (type) {\n const baseType = type.split(\"-\")[0];\n return ShapeTypes[baseType];\n },\n\n _mapTypes: function (types, points, func, context) {\n return _.map(types, function (type, i) {\n const pointCount = ShapeTypes.getPointCountForType(type);\n const currentPoints = _.first(points, pointCount);\n points = _.rest(points, pointCount);\n return func.call(context, type, currentPoints, i);\n });\n },\n\n _addType: function (graphie, type, points, options) {\n const lineCoords = _.isArray(points[0])\n ? {\n coordA: points[0],\n coordZ: points[1],\n }\n : {\n pointA: points[0],\n pointZ: points[1],\n };\n\n type = type.split(\"-\")[0];\n if (type === \"polygon\") {\n const polygon = graphie.addMovablePolygon(\n _.extend({}, options, {\n fixed: !options.editable,\n snapX: (options.snap && options.snap[0]) || 0,\n snapY: (options.snap && options.snap[1]) || 0,\n points: points,\n constrainToGraph: false,\n }),\n );\n return {\n update: polygon.transform.bind(polygon),\n remove: polygon.remove.bind(polygon),\n };\n }\n if (type === \"line\" || type === \"lineSegment\") {\n const line = graphie.addMovableLineSegment(\n _.extend({}, options, lineCoords, {\n movePointsWithLine: true,\n fixed: true,\n constraints: {\n fixed: true,\n },\n extendLine: type === \"line\",\n }),\n );\n\n // TODO(jack): Hide points on uneditable lines when translation\n // is a vector.\n // We can't just remove the points yet, because they are the\n // translation handle for the line.\n return {\n update: line.transform.bind(line, true),\n remove: line.remove.bind(line),\n };\n }\n if (type === \"angle\") {\n // If this angle is editable, we want to be able to make angles\n // both larger and smaller than 180 degrees.\n // If this angle is not editable, it should always maintain\n // it's angle measure, even if it is reflected (causing the\n // clockwise-ness of the points to change)\n const shouldChangeReflexivity = options.editable ? null : false;\n\n const angle = graphie.addMovableAngle({\n angleLabel: \"$deg0\",\n fixed: true,\n points: points,\n normalStyle: options.normalStyle,\n reflex: options.reflex,\n });\n\n // Hide non-vertex points on uneditable angles\n if (!_.isArray(points[0]) && !options.editable) {\n points[0].remove();\n points[2].remove();\n }\n return {\n update: angle.update.bind(angle, shouldChangeReflexivity),\n remove: angle.remove.bind(angle),\n getOptions: function () {\n return {\n reflex: angle.isReflex(),\n };\n },\n };\n }\n if (type === \"circle\") {\n let perimeter = {\n // temporary object for the first removal\n remove: _.identity,\n };\n const redrawPerim = function () {\n const coord0 = points[0].coord || points[0];\n const coord1 = points[1].coord || points[1];\n const radius = kpoint.distanceToPoint(coord0, coord1);\n perimeter.remove();\n perimeter = graphie.circle(\n coord0,\n radius,\n _.extend(\n {\n stroke: KhanColors.DYNAMIC,\n \"stroke-width\": 2,\n },\n options.normalStyle,\n ),\n );\n };\n\n redrawPerim();\n if (points[1].remove && !options.editable) {\n points[1].remove();\n }\n\n return {\n update: redrawPerim,\n remove: function () {\n // Not _.bind because the remove function changes\n // when the perimeter is redrawn\n perimeter.remove();\n },\n };\n }\n if (type === \"point\") {\n // do nothing\n return {\n update: null,\n remove: null,\n };\n }\n throw new PerseusError(\n \"Invalid shape type \" + type,\n Errors.InvalidInput,\n );\n },\n\n _combine: function (type, coords) {\n return {\n type: type,\n coords: coords,\n };\n },\n\n polygon: {\n equal: orderInsensitiveCoordsEqual,\n },\n\n line: {\n equal: kline.equal,\n },\n\n lineSegment: {\n equal: orderInsensitiveCoordsEqual,\n },\n\n angle: {\n equal: function (points1, points2) {\n if (!kpoint.equal(points1[1], points2[1])) {\n return false;\n }\n\n const line1_0 = [points1[1], points1[0]];\n const line1_2 = [points1[1], points1[2]];\n const line2_0 = [points2[1], points2[0]];\n const line2_2 = [points2[1], points2[2]];\n\n const equalUnflipped =\n kray.equal(line1_0, line2_0) && kray.equal(line1_2, line2_2);\n const equalFlipped =\n kray.equal(line1_0, line2_2) && kray.equal(line1_2, line2_0);\n\n return equalUnflipped || equalFlipped;\n },\n\n defaultOptions: {\n reflex: false,\n },\n },\n\n circle: {\n equal: function (points1, points2) {\n const radius1 = kpoint.distanceToPoint(points1[0], points1[1]);\n const radius2 = kpoint.distanceToPoint(points2[0], points2[1]);\n return (\n kpoint.equal(points1[0], points2[0]) &&\n knumber.equal(radius1, radius2)\n );\n },\n },\n\n point: {\n equal: kpoint.equal,\n },\n};\n\nclass TransformationsShapeEditor extends React.Component<$FlowFixMe> {\n render(): React.Node {\n return (\n <div>\n <Graph\n // eslint-disable-next-line react/no-string-refs\n ref=\"graph\"\n box={this.props.graph.box}\n range={this.props.graph.range}\n labels={this.props.graph.labels}\n step={this.props.graph.step}\n gridStep={this.props.graph.gridStep}\n markings={this.props.graph.markings}\n backgroundImage={this.props.graph.backgroundImage}\n onGraphieUpdated={this.setupGraphie}\n />\n <select\n key=\"type-select\"\n value={this.getTypeString(this.props.shape.type)}\n onChange={this.changeType}\n >\n <option value=\"polygon-3\">Triangle</option>\n <option value=\"polygon-4\">Quadrilateral</option>\n <option value=\"polygon-5\">Pentagon</option>\n <option value=\"polygon-6\">Hexagon</option>\n <option value=\"line\">Line</option>\n <option value=\"line,line\">2 lines</option>\n <option value=\"lineSegment\">Line segment</option>\n <option value=\"lineSegment,lineSegment\">\n {\" \"}\n 2 line segments{\" \"}\n </option>\n <option value=\"angle\">Angle</option>\n <option value=\"circle\">Circle</option>\n </select>\n </div>\n );\n }\n\n /* Return the option string for a given type */\n getTypeString = (type) => {\n if (_.isArray(type)) {\n return _.map(type, this.getTypeString).join(\",\");\n }\n if (type === \"polygon\") {\n return \"polygon-\" + this.props.shape.coords.length;\n }\n return type;\n };\n\n /* Change the type on the window event e\n *\n * e.target.value is the new type string\n */\n changeType = (e) => {\n const types = String(e.target.value).split(\",\");\n const pointCount = arraySum(\n _.map(types, ShapeTypes.getPointCountForType),\n );\n\n // eslint-disable-next-line react/no-string-refs\n const radius = scaleToRange(4, this.refs.graph.props.range);\n const offset = (1 / 2 - 1 / pointCount) * 180;\n const coords = _.times(pointCount, function (i) {\n return kpoint.rotateDeg(\n [radius, 0],\n (360 * i) / pointCount + offset,\n );\n });\n\n this.props.onChange({\n shape: {\n type: types,\n coords: coords,\n options: ShapeTypes.defaultOptions(types),\n },\n });\n };\n\n componentDidMount() {\n // eslint-disable-next-line react/no-string-refs\n this.setupGraphie(this.refs.graph.graphie());\n }\n\n componentDidUpdate(prevProps) {\n if (!deepEq(prevProps.shape, this.props.shape)) {\n // eslint-disable-next-line react/no-string-refs\n this.refs.graph.reset();\n }\n }\n\n updateCoords = () => {\n this.props.onChange({\n // $FlowFixMe[prop-missing]\n shape: this.shape.toJSON(),\n });\n };\n\n setupGraphie = (graphie) => {\n // $FlowFixMe[prop-missing]\n this.shape = ShapeTypes.addMovableShape(graphie, {\n editable: true,\n snap: graphie.snap,\n shape: this.props.shape,\n onMoveEnd: this.updateCoords,\n });\n };\n}\n\nclass TransformerEditor extends React.Component<$FlowFixMe> {\n // TODO (jack): These should be refactored into a nice object at the top\n // so that we don't have all this duplication\n static defaultProps: $FlowFixMe = defaultTransformerProps;\n\n static widgetName: string = \"transformer\";\n\n render(): React.Node {\n // Fill in any missing value in this.props.graph\n // this can happen because the graph json doesn't include\n // box, for example\n const graph = _.extend(\n defaultGraphProps(this.props.graph, 340),\n this.props.graph,\n );\n\n return (\n <div>\n <div>\n <PropCheckBox\n label=\"Grade empty answers as wrong:\"\n gradeEmpty={this.props.gradeEmpty}\n onChange={this.props.onChange}\n />\n <InfoTip>\n <p>\n We generally do not grade empty answers. This\n usually works well, but sometimes can result in\n giving away part of an answer in a multi-part\n question.\n </p>\n <p>\n If this is a multi-part question (there is another\n widget), you probably want to enable this option.\n Otherwise, you should leave it disabled.\n </p>\n <p>Confused? Talk to Elizabeth.</p>\n </InfoTip>\n </div>\n <div>Graph settings:</div>\n <GraphSettings\n box={graph.box}\n labels={graph.labels}\n range={graph.range}\n step={graph.step}\n gridStep={graph.gridStep}\n valid={graph.valid}\n backgroundImage={graph.backgroundImage}\n markings={graph.markings}\n showProtractor={graph.showProtractor}\n onChange={this.changeGraph}\n />\n <div>Transformation settings:</div>\n <TransformationExplorerSettings\n // eslint-disable-next-line react/no-string-refs\n ref=\"transformationSettings\"\n graphMode={this.props.graphMode}\n listMode={this.props.listMode}\n tools={this.props.tools}\n drawSolutionShape={this.props.drawSolutionShape}\n onChange={this.props.onChange}\n />\n <div>Starting location:</div>\n <TransformationsShapeEditor\n // eslint-disable-next-line react/no-string-refs\n ref=\"shapeEditor\"\n graph={graph}\n shape={this.props.starting.shape}\n onChange={this.changeStarting}\n setDrawingAreaAvailable={\n this.props.apiOptions.setDrawingAreaAvailable\n }\n />\n <div>Solution transformations:</div>\n <Transformer\n // eslint-disable-next-line react/no-string-refs\n ref=\"explorer\"\n graph={graph}\n graphMode={this.props.graphMode}\n listMode={this.props.listMode}\n gradeEmpty={this.props.gradeEmpty}\n tools={this.props.tools}\n drawSolutionShape={this.props.drawSolutionShape}\n starting={this.props.starting}\n correct={this.props.starting}\n transformations={this.props.correct.transformations}\n onChange={this.changeTransformer}\n trackInteraction={() => {}}\n />\n </div>\n );\n }\n\n // propagate a props change on our graph settings to\n // this.props.graph\n changeGraph: ($FlowFixMe, $FlowFixMe) => void = (\n graphChanges,\n callback,\n ) => {\n const newGraph = _.extend({}, this.props.graph, graphChanges);\n this.props.onChange(\n {\n graph: newGraph,\n },\n callback,\n );\n };\n\n // propagate a props change on our starting graph to\n // this.props.starting\n changeStarting: ($FlowFixMe) => void = (startingChanges) => {\n const newStarting = _.extend({}, this.props.starting, startingChanges);\n this.props.onChange({\n starting: newStarting,\n });\n };\n\n // propagate a transformations change onto correct.transformations\n changeTransformer: ($FlowFixMe, $FlowFixMe) => void = (\n changes,\n callback,\n ) => {\n if (changes.transformations) {\n changes.correct = {\n ...this.props.correct,\n transformations: changes.transformations,\n };\n delete changes.transformations;\n }\n this.props.onChange(changes, callback);\n };\n\n serialize: () => $FlowFixMe = () => {\n // eslint-disable-next-line react/no-string-refs\n const json = this.refs.explorer.getEditorJSON();\n json.correct = json.answer;\n delete json.answer;\n return json;\n };\n}\n\nexport default TransformerEditor;\n","/* eslint-disable react/no-unsafe */\n// @flow\nimport {\n components,\n displaySigFigs,\n icons,\n Changeable,\n EditorJsonify,\n} from \"@khanacademy/perseus\";\nimport KAS from \"kas\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst {InlineIcon, NumberInput} = components;\nconst {iconOk, iconRemove} = icons;\n\n// TODO(joel): teach KAS how to accept an answer only if it's expressed in\n// terms of a certain type.\n// TODO(joel): Allow sigfigs within a range rather than an exact expected\n// value?\n\nconst ALL = (\"all\": \"all\");\nconst SOME = (\"some\": \"some\");\nconst MAX_SIGFIGS = 10;\n\nconst sigfigPrint = function (num, sigfigs) {\n return displaySigFigs(num, sigfigs, -MAX_SIGFIGS, false);\n};\n\n// Extract the primitive units from a unit expression. This first simplifies\n// `expr` to a `Mul` like \"5 kg m / s^2\" then removes the first term.\nconst primUnits = function (expr) {\n return expr.simplify().asMul().partition()[1].flatten().simplify();\n};\n\ntype UnitExampleProps = $FlowFixMe;\ntype UnitExampleState = $FlowFixMe;\n\n// Show the name of a unit and whether it's recognized by KAS.\n//\n// In the future I plan for this to show an example of a thing that would be\n// accepted in that unit.\nclass UnitExample extends React.Component<UnitExampleProps, UnitExampleState> {\n // TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`\n UNSAFE_componentWillMount() {\n this._checkValidity(this.props);\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n this._checkValidity(nextProps);\n }\n\n _checkValidity = ({name, original, sigfigs}) => {\n const parseResult = KAS.unitParse(name);\n let solvedExample = \"\";\n\n // A unit is valid if it parses and is equivalent to the original.\n let valid = true;\n\n if (parseResult.parsed && original) {\n const x = new KAS.Var(\"x\");\n const {unit} = parseResult;\n const equality = new KAS.Eq(original, \"=\", new KAS.Mul(x, unit));\n try {\n const answer = equality.solveLinearEquationForVariable(x);\n\n // The third parameter is the least significant decimal place.\n // I.e. the index of the last place you care about\n // (543210.(-1)(-2)(-3) etc). We use -10 because that should\n // always be safe since we only care up to maximum 10 decimal\n // places.\n solvedExample = sigfigPrint(answer.eval(), sigfigs);\n\n valid = KAS.compare(primUnits(original), primUnits(unit)).equal;\n } catch (e) {\n valid = false;\n }\n } else {\n valid = false;\n }\n\n this.setState({\n valid,\n solvedExample,\n });\n };\n\n render(): React.Node {\n let icon;\n if (this.state.valid) {\n icon = (\n <span>\n <span className=\"unit-example-okay\">\n <InlineIcon {...iconOk} />\n </span>\n {this.state.solvedExample}\n </span>\n );\n } else {\n icon = (\n <span className=\"unit-example-not-okay\">\n <InlineIcon {...iconRemove} />\n </span>\n );\n }\n\n return (\n <div>\n {icon} {this.props.name}\n </div>\n );\n }\n}\n\ntype UnitInputEditorProps = $FlowFixMe;\n\nclass UnitInputEditor extends React.Component<UnitInputEditorProps> {\n parsed: ?boolean;\n groupId: string;\n original: ?$FlowFixMe;\n\n static propTypes = {\n ...Changeable.propTypes,\n value: PropTypes.string,\n acceptingUnits: PropTypes.arrayOf(PropTypes.string),\n accepting: PropTypes.oneOf([ALL, SOME]),\n sigfigs: PropTypes.number,\n };\n\n static widgetName: \"unit-input\" = \"unit-input\";\n\n static defaultProps: UnitInputEditorProps = {\n value: \"5x10^5 kg m / s^2\",\n accepting: ALL,\n sigfigs: 3,\n };\n\n constructor(props: UnitExampleProps) {\n super(props);\n\n this.groupId = _.uniqueId(\"accepting\");\n this._doOriginal(props);\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: UnitInputEditorProps) {\n this._doOriginal(nextProps);\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n handleAcceptingUnitsChange: (SyntheticInputEvent<>) => void = (event) => {\n const acceptingUnits = event.target.value\n .split(\",\")\n .map((str) => str.trim())\n .filter((str) => str !== \"\");\n this.change({acceptingUnits});\n };\n\n handleSigfigChange: (number) => void = (sigfigs) => {\n this.change({sigfigs});\n };\n\n _checkSigfigValidity: (number) => boolean = (sigfigs) => {\n return sigfigs > 0 && sigfigs <= MAX_SIGFIGS;\n };\n\n _setAccepting: (typeof SOME | typeof ALL) => void = (val) => {\n this.change({accepting: val});\n };\n\n _doOriginal: (UnitExampleProps) => void = (props) => {\n const tryParse = KAS.unitParse(props.value);\n this.parsed = false;\n\n // Only update this state if the unit parsed *and* it has a magnitude\n // attached to it. KAS can also parse units without magnitudes (\"1.2\n // g\" vs \"g\").\n if (tryParse.parsed && tryParse.type === \"unitMagnitude\") {\n this.original = tryParse.expr;\n this.parsed = true;\n }\n };\n\n onChange: (SyntheticInputEvent<>) => void = (event) => {\n this.props.onChange({value: event.target.value});\n };\n\n getSaveWarnings: () => $ReadOnlyArray<string> = () => {\n const {value, accepting, acceptingUnits} = this.props;\n const warnings = [];\n\n const tryParse = KAS.unitParse(value);\n if (!tryParse.parsed) {\n warnings.push(\"Answer did not parse\");\n }\n\n if (accepting === SOME && acceptingUnits.length === 0) {\n warnings.push(\"There are no accepted units\");\n }\n\n return warnings;\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n const {acceptingUnits = [], accepting} = this.props;\n let acceptingElem = null;\n if (accepting === SOME) {\n const unitsArr = acceptingUnits.map((name, i) => (\n <UnitExample\n name={name}\n original={this.original || null}\n sigfigs={this.props.sigfigs}\n key={i}\n />\n ));\n\n acceptingElem = (\n <div>\n <input\n type=\"text\"\n defaultValue={acceptingUnits.join(\", \")}\n onChange={this.handleAcceptingUnitsChange}\n />{\" \"}\n (comma-separated)\n {unitsArr}\n </div>\n );\n }\n\n return (\n <div className=\"unit-editor\">\n <div>\n <input\n value={this.props.value}\n className=\"unit-editor-canonical\"\n onChange={this.onChange}\n />{\" \"}\n {this.parsed ? (\n <span className=\"unit-example-okay\">\n <InlineIcon {...iconOk} />\n </span>\n ) : (\n <span className=\"unit-example-not-okay\">\n <InlineIcon {...iconRemove} />\n </span>\n )}\n </div>\n\n <div>\n Significant Figures:{\" \"}\n <NumberInput\n value={this.props.sigfigs}\n onChange={this.handleSigfigChange}\n checkValidity={this._checkSigfigValidity}\n useArrowKeys\n />\n </div>\n\n <div>\n <label>\n <input\n type=\"radio\"\n name={this.groupId}\n onChange={() => this._setAccepting(ALL)}\n checked={this.props.accepting === ALL}\n />\n {\" Any equivalent unit \"}\n </label>\n <label>\n <input\n type=\"radio\"\n name={this.groupId}\n onChange={() => this._setAccepting(SOME)}\n checked={this.props.accepting === SOME}\n />\n {\" Only these units \"}\n </label>\n </div>\n\n {acceptingElem}\n </div>\n );\n }\n}\n\nexport default UnitInputEditor;\n","// @flow\nimport {components, Changeable, EditorJsonify} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport BlurInput from \"../components/blur-input.jsx\";\n\nconst {InfoTip} = components;\n\nconst KA_VIDEO_URL = /khanacademy\\.org\\/.*\\/v\\/(.*)$/;\n\n/**\n * Turns Khan Academy URLs into the KA slugs, if possible. Any other URLs are\n * returned unchanged.\n */\nfunction getSlugFromUrl(url) {\n const match = KA_VIDEO_URL.exec(url);\n if (match) {\n return match[1];\n }\n return url;\n}\n\ntype Props = $FlowFixMe;\n\n/**\n * This is the main editor for this widget, to specify all the options.\n */\nclass VideoEditor extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n location: PropTypes.string,\n onChange: PropTypes.func,\n };\n\n static widgetName: \"video\" = \"video\";\n\n static defaultProps: Props = {\n location: \"\",\n };\n\n _handleUrlChange: (string) => void = (url) => {\n this.props.onChange({location: getSlugFromUrl(url)});\n };\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n serialize: () => $FlowFixMe = () => {\n return EditorJsonify.serialize.call(this);\n };\n\n render(): React.Node {\n return (\n <div>\n <label>\n KA Video Slug:{\" \"}\n <BlurInput\n value={this.props.location}\n style={{width: 290}}\n onChange={this._handleUrlChange}\n />\n <InfoTip>\n KA video URLs will be converted to just the slug.\n </InfoTip>\n </label>\n </div>\n );\n }\n}\n\nexport default VideoEditor;\n","// @flow\n\nimport CategorizerEditor from \"./widgets/categorizer-editor.jsx\";\nimport CSProgramEditor from \"./widgets/cs-program-editor.jsx\";\nimport DefinitionEditor from \"./widgets/definition-editor.jsx\";\nimport DropdownEditor from \"./widgets/dropdown-editor.jsx\";\nimport ExampleGraphieWidgetEditor from \"./widgets/example-graphie-widget-editor.jsx\";\nimport ExampleWidgetEditor from \"./widgets/example-widget-editor.jsx\";\nimport ExplanationEditor from \"./widgets/explanation-editor.jsx\";\nimport ExpressionEditor from \"./widgets/expression-editor.jsx\";\nimport GradedGroupEditor from \"./widgets/graded-group-editor.jsx\";\nimport GradedGroupSetEditor from \"./widgets/graded-group-set-editor.jsx\";\nimport GrapherEditor from \"./widgets/grapher-editor.jsx\";\nimport GroupEditor from \"./widgets/group-editor.jsx\";\nimport IframeEditor from \"./widgets/iframe-editor.jsx\";\nimport ImageEditor from \"./widgets/image-editor.jsx\";\nimport InputNumberEditor from \"./widgets/input-number-editor.jsx\";\nimport InteractionEditor from \"./widgets/interaction-editor.jsx\";\nimport InteractiveGraphEditor from \"./widgets/interactive-graph-editor.jsx\";\nimport LabelImageEditor from \"./widgets/label-image-editor.jsx\";\nimport LightsPuzzleEditor from \"./widgets/lights-puzzle-editor.jsx\";\nimport MatcherEditor from \"./widgets/matcher-editor.jsx\";\nimport MatrixEditor from \"./widgets/matrix-editor.jsx\";\nimport MeasurerEditor from \"./widgets/measurer-editor.jsx\";\nimport MoleculeEditor from \"./widgets/molecule-editor.jsx\";\nimport NumberLineEditor from \"./widgets/number-line-editor.jsx\";\nimport NumericInputEditor from \"./widgets/numeric-input-editor.jsx\";\nimport OrdererEditor from \"./widgets/orderer-editor.jsx\";\nimport PassageEditor from \"./widgets/passage-editor.jsx\";\nimport PassageRefEditor from \"./widgets/passage-ref-editor.jsx\";\nimport PassageRefTargetEditor from \"./widgets/passage-ref-target-editor.jsx\";\nimport PlotterEditor from \"./widgets/plotter-editor.jsx\";\nimport RadioEditor from \"./widgets/radio/editor.jsx\";\nimport ReactionDiagramEditor from \"./widgets/reaction-diagram-editor.jsx\";\nimport SequenceEditor from \"./widgets/sequence-editor.jsx\";\nimport SimpleMarkdownTesterEditor from \"./widgets/simple-markdown-tester-editor.jsx\";\nimport SimulatorEditor from \"./widgets/simulator-editor.jsx\";\nimport SorterEditor from \"./widgets/sorter-editor.jsx\";\nimport TableEditor from \"./widgets/table-editor.jsx\";\nimport TransformerEditor from \"./widgets/transformer-editor.jsx\";\nimport UnitEditor from \"./widgets/unit-editor.jsx\";\nimport VideoEditor from \"./widgets/video-editor.jsx\";\n\nexport default [\n CategorizerEditor,\n CSProgramEditor,\n DefinitionEditor,\n DropdownEditor,\n ExampleGraphieWidgetEditor,\n ExampleWidgetEditor,\n ExplanationEditor,\n ExpressionEditor,\n GradedGroupEditor,\n GradedGroupSetEditor,\n GrapherEditor,\n GroupEditor,\n IframeEditor,\n ImageEditor,\n InputNumberEditor,\n InteractionEditor,\n InteractiveGraphEditor,\n LabelImageEditor,\n LightsPuzzleEditor,\n MatcherEditor,\n MatrixEditor,\n MeasurerEditor,\n MoleculeEditor,\n NumberLineEditor,\n NumericInputEditor,\n OrdererEditor,\n PassageEditor,\n PassageRefEditor,\n PassageRefTargetEditor,\n PlotterEditor,\n ReactionDiagramEditor,\n SequenceEditor,\n SimpleMarkdownTesterEditor,\n SimulatorEditor,\n SorterEditor,\n TableEditor,\n TransformerEditor,\n UnitEditor,\n VideoEditor,\n RadioEditor,\n];\n","/* eslint-disable react/sort-comp */\n// @flow\n/**\n * This is a simple number-entry widget\n * It is not as powerful as number-input, but has a simpler, more\n * representative structure as an example widget, and is easier to\n * test new ideas on.\n *\n * TODO(jack): Add more comments\n */\nimport {Changeable} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nimport type {WidgetExports} from \"@khanacademy/perseus\";\n\nclass TextInput extends React.Component<$FlowFixMe> {\n render(): React.Node {\n return (\n <input\n // eslint-disable-next-line react/no-string-refs\n ref=\"input\"\n value={this.props.value || \"\"}\n onChange={this.changeValue}\n />\n );\n }\n\n focus = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.input.focus();\n return true;\n };\n\n changeValue = (e) => {\n // Translating from the js event e to the value\n // of the textbox to send to onChange\n this.props.onChange(e.target.value);\n };\n}\n\n/**\n * This is the widget's renderer. It shows up in the right column\n * in the demo, and is what is visible to users, and where\n * users enter their answers.\n */\nclass ExampleWidget extends React.Component<$FlowFixMe> {\n static propTypes = {\n ...Changeable.propTypes,\n value: PropTypes.string,\n };\n\n static defaultProps: $FlowFixMe = {\n value: \"\",\n };\n\n /**\n * This is the widget's grading function. simpleValidate generally\n * defers to this function.\n *\n * value is usually the result of getUserInput on the widget\n * rubric is the result of calling serialize() on the editor\n */\n static validate(value: string, rubric: $FlowFixMe): $FlowFixMe {\n if (value === \"\") {\n return {\n type: \"invalid\",\n message:\n \"It looks like you haven't answered all of the \" +\n \"question yet.\",\n };\n }\n if (value === rubric.correct) {\n return {\n type: \"points\",\n earned: 1,\n total: 1,\n message: null,\n };\n }\n return {\n type: \"points\",\n earned: 0,\n total: 1,\n message: null,\n };\n }\n\n /**\n * Tell our parent to update our props.\n */\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n render(): React.Node {\n return (\n <TextInput\n // eslint-disable-next-line react/no-string-refs\n ref=\"input\"\n value={this.props.value}\n onChange={this.change(\"value\")}\n />\n );\n }\n\n getUserInput: () => string = () => {\n return this.props.value;\n };\n\n /**\n * Widgets that are focusable should add a focus method that returns\n * true if focusing succeeded. The first such widget found will be\n * focused on page load.\n */\n focus: () => boolean = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.input.focus();\n return true;\n };\n\n /**\n * simpleValidate is called for grading. Rubric is the result of calling\n * getUserInput() on the editor that created this widget.\n *\n * Should return an object representing the grading result, such as\n * {\n * type: \"points\",\n * earned: 1,\n * total: 1,\n * message: null\n * }\n */\n simpleValidate: ($FlowFixMe) => $FlowFixMe = (rubric) => {\n return ExampleWidget.validate(this.getUserInput(), rubric);\n };\n}\n\n/**\n * For this widget to work, we must import this file in src/all-widgets.js\n */\nexport default ({\n name: \"example-widget\",\n displayName: \"Example Widget\",\n\n // Tell the renderer what type of `display:` style we would like\n // for the component wrapping this one.\n defaultAlignment: \"inline-block\",\n\n hidden: true, // Hides this widget from the Perseus.Editor widget select\n widget: ExampleWidget,\n}: WidgetExports<typeof ExampleWidget>);\n","/* eslint-disable react/sort-comp */\n// @flow\nimport {Changeable, PerseusMarkdown} from \"@khanacademy/perseus\";\nimport PropTypes from \"prop-types\";\nimport * as React from \"react\";\nimport _ from \"underscore\";\n\nconst mdParse = PerseusMarkdown.parse;\nconst mdOutput = PerseusMarkdown.basicOutput;\n\ntype Props = $FlowFixMe;\n\nclass SimpleMarkdownTester extends React.Component<Props> {\n static propTypes = {\n ...Changeable.propTypes,\n value: PropTypes.string,\n };\n\n static defaultProps: Props = {\n value: \"\",\n };\n\n /**\n * This is the widget's grading function.\n *\n * simpleValidate generally defers to this function\n *\n * state is usually the result of toJSON on the widget\n * rubric is the result of calling toJSON() on the editor\n */\n static validate(state: $FlowFixMe, rubric: $FlowFixMe): $FlowFixMe {\n return {\n type: \"points\",\n earned: 0,\n total: 0,\n message: null,\n };\n }\n\n change: ($FlowFixMe, $FlowFixMe, $FlowFixMe) => $FlowFixMe = (...args) => {\n return Changeable.change.apply(this, args);\n };\n\n toJSON: () => {...} = () => {\n return {};\n };\n\n render(): React.Node {\n const parsed = mdParse(this.props.value);\n const output = mdOutput(parsed);\n return <div>{output}</div>;\n }\n\n /**\n * Widgets that are focusable should add a focus method that returns\n * true if focusing succeeded. The first such widget found will be\n * focused on page load.\n */\n focus: () => boolean = () => {\n // eslint-disable-next-line react/no-string-refs\n this.refs.input.focus();\n return true;\n };\n\n /**\n * simpleValidate is called for grading. Rubric is the result of calling\n * toJSON() on the editor that created this widget.\n *\n * Should return an object representing the grading result, such as\n * {\n * type: \"points\",\n * earned: 1,\n * total: 1,\n * message: null\n * }\n */\n simpleValidate: ($FlowFixMe) => $FlowFixMe = (rubric) => {\n return SimpleMarkdownTester.validate(this.toJSON(), rubric);\n };\n}\n\n/**\n * For this widget to work, we must import this file in src/all-widgets.js\n */\nexport default {\n name: \"simple-markdown-tester\",\n displayName: \"Simple Markdown Tester\",\n hidden: true, // Hides this widget from the Perseus.Editor widget select\n widget: SimpleMarkdownTester,\n transform: _.identity,\n};\n","// @flow\nimport {widgets} from \"@khanacademy/perseus\";\n\nimport testingWidgets from \"./testing-widgets.js\";\n\nimport type {WidgetExports} from \"@khanacademy/perseus\";\n\nexport default ([...widgets, ...testingWidgets]: $ReadOnlyArray<\n WidgetExports<>,\n>);\n","// @flow\nimport ExampleGraphieWidget from \"./widgets/example-graphie-widget.jsx\";\nimport ExampleWidget from \"./widgets/example-widget.jsx\";\nimport SimpleMarkdownTester from \"./widgets/simple-markdown-tester.jsx\";\n\nimport type {WidgetExports} from \"@khanacademy/perseus\";\n\nexport default ([\n ExampleGraphieWidget,\n ExampleWidget,\n SimpleMarkdownTester,\n]: $ReadOnlyArray<WidgetExports<>>);\n","// @flow\nexport * as Perseus from \"@khanacademy/perseus\";\n\nexport {default as ArticleEditor} from \"./article-editor.jsx\";\nexport {default as DeviceFramer} from \"./components/device-framer.jsx\";\nexport {default as ViewportResizer} from \"./components/viewport-resizer.jsx\";\nexport {default as ArticleDiff} from \"./diffs/article-diff.jsx\";\nexport {default as ItemDiff} from \"./diffs/item-diff.jsx\";\nexport {default as StructuredItemDiff} from \"./diffs/structured-item-diff.jsx\";\nexport {default as EditorPage} from \"./editor-page.jsx\";\nexport {default as Editor} from \"./editor.jsx\";\nexport {default as i18n} from \"./i18n.jsx\";\nexport {default as IframeContentRenderer} from \"./iframe-content-renderer.jsx\";\nexport {default as MultiRendererEditor} from \"./multirenderer-editor.jsx\";\nexport {default as StatefulArticleEditor} from \"./stateful-article-editor.jsx\";\nexport {default as StatefulEditorPage} from \"./stateful-editor-page.jsx\";\n\nimport \"./styles/perseus-editor.less\";\n\n// eslint-disable-next-line import/order\nimport {Widgets} from \"@khanacademy/perseus\";\nimport AllEditors from \"./all-editors.js\";\nimport AllWidgets from \"./all-widgets.js\";\n\nWidgets.registerEditors(AllEditors);\nWidgets.registerWidgets(AllWidgets);\n\nexport {AllEditors, AllWidgets};\n"],"names":["SCREEN_SIZES","phone","width","height","framedWidth","tablet","desktop","DeviceFramer","React","Component","render","deviceType","this","props","nochrome","createElement","key","style","constants","perseusFrameBorderWidth","lintGutterWidth","children","scale","screenStyle","backgroundColor","color","textAlign","border","margin","zoom","className","PropTypes","element","isRequired","oneOf","devices","PHONE","TABLET","DESKTOP","bool","JsonEditor","createReactClass","displayName","getInitialState","currentValue","JSON","stringify","value","valid","UNSAFE_componentWillReceiveProps","nextProps","state","_","isEqual","parse","setState","classes","onChange","handleChange","onKeyDown","handleKeyDown","onBlur","handleBlur","e","cursorPos","target","selectionStart","v","textBefore","substring","textAfter","length","selectionEnd","preventDefault","nextString","json","isString","ex","DragTarget","propTypes","onDrop","func","component","any","shouldDragHighlight","getDefaultProps","dragHover","handleDrop","stopPropagation","handleDragEnd","handleDragOver","handleDragLeave","handleDragEnter","opacity","forwardProps","Object","assign","_extends","onDragEnd","onDragOver","onDragEnter","onDragLeave","KatexErrorView","constructor","super","arguments","_defineProperty","showErrors","errorList","disclosureClass","css","styles","errorContainer","title","onClick","handleToggleKatexErrors","fontSize","errorExplanation","map","index","error","math","message","arrayOf","shape","string","StyleSheet","create","padding","borderTop","_objectWithoutPropertiesLoose","source","excluded","i","sourceKeys","keys","indexOf","prototype","hasOwnProperty","call","apply","_setPrototypeOf","o","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","isAbsolute","pathname","charAt","spliceOne","list","k","n","pop","isProduction","process","env","NODE_ENV","warning","condition","text","console","warn","Error","x","prefix","invariant","provided","addLeadingSlash","path","stripLeadingSlash","substr","hasBasename","toLowerCase","stripBasename","stripTrailingSlash","slice","createPath","location","search","hash","createLocation","currentLocation","hashIndex","searchIndex","parsePath","undefined","decodeURI","URIError","to","from","hasTrailingSlash","toParts","split","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","last","up","part","unshift","result","join","resolvePathname","createTransitionManager","prompt","listeners","setPrompt","nextPrompt","confirmTransitionTo","action","getUserConfirmation","callback","appendListener","fn","isActive","listener","push","filter","item","notifyListeners","_len","args","Array","_key","forEach","canUseDOM","window","document","getConfirmation","confirm","getHistoryState","history","createBrowserHistory","ua","globalHistory","canUseHistory","navigator","userAgent","needsHashChangeListener","_props","_props$forceRefresh","forceRefresh","_props$getUserConfirm","_props$keyLength","keyLength","basename","getDOMLocation","historyState","_ref","_window$location","createKey","Math","random","toString","transitionManager","nextState","handlePopState","event","isExtraneousPopstateEvent","handlePop","handleHashChange","forceNextPop","ok","fromLocation","toLocation","toIndex","allKeys","fromIndex","delta","go","revertPop","initialLocation","createHref","listenerCount","checkDOMListeners","addEventListener","removeEventListener","isBlocked","href","pushState","prevIndex","nextKeys","replace","replaceState","goBack","goForward","block","unblock","listen","unlisten","HashPathCoders","hashbang","encodePath","decodePath","noslash","slash","stripHash","url","getHashPath","replaceHashPath","createHashHistory","canGoWithoutReload","_props$hashType","hashType","_HashPathCoders$hashT","ignorePath","a","b","encodedPath","prevLocation","allPaths","lastIndexOf","baseTag","querySelector","getAttribute","pushHashPath","nextPaths","clamp","lowerBound","upperBound","min","max","createMemoryHistory","_props$initialEntries","initialEntries","_props$initialIndex","initialIndex","entries","entry","nextIndex","nextEntries","splice","canGo","commonjsGlobal","globalThis","global","createEventEmitter","handlers","on","handler","off","h","get","set","newValue","changedBits","createContext","defaultValue","calculateChangedBits","_Provider$childContex","_Consumer$contextType","contextProp","getUniqueId","Provider","_Component","_this","emitter","_proto","getChildContext","componentWillReceiveProps","oldValue","y","childContextTypes","object","Consumer","_Component2","_this2","getValue","onUpdate","observedBits","_proto2","componentDidMount","context","componentWillUnmount","isArray","contextTypes","isarray","arr","pathToRegexpModule","exports","pathToRegexp","pathToRegexp_1","compile","str","options","tokensToFunction","tokensToRegExp","PATH_REGEXP","RegExp","res","tokens","defaultDelimiter","delimiter","exec","m","escaped","offset","next","name","capture","group","modifier","asterisk","partial","repeat","optional","pattern","escapeGroup","escapeString","encodeURIComponentPretty","encodeURI","c","charCodeAt","toUpperCase","matches","flags","obj","opts","data","encode","pretty","encodeURIComponent","token","segment","TypeError","j","test","attachKeys","re","sensitive","strict","end","route","endsWithDelimiter","groups","match","regexpToRegexp","parts","arrayToRegexp","stringToRegexp","module","Symbol","for","d","f","g","l","q","r","t","w","z","u","$$typeof","type","A","reactIs_production_min","AsyncMode","ConcurrentMode","ContextProvider","Element","ForwardRef","Fragment","Memo","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","require$$0","hasSymbol","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_ASYNC_MODE_TYPE","REACT_CONCURRENT_MODE_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_BLOCK_TYPE","REACT_FUNDAMENTAL_TYPE","REACT_RESPONDER_TYPE","REACT_SCOPE_TYPE","$$typeofType","ContextConsumer","Lazy","hasWarnedAboutDeprecatedIsAsyncMode","reactIs_development","isPortal","reactIs","REACT_STATICS","contextType","defaultProps","getDerivedStateFromError","getDerivedStateFromProps","mixins","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","defineProperty","getOwnPropertyNames","getOwnPropertySymbols","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics_cjs","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","descriptor","createNamedContext","historyContext","Router","_React$Component","_isMounted","_pendingLocation","staticContext","computeRootMatch","params","isExact","node","componentDidUpdate","prevProps","MemoryRouter","array","number","messageType","oneOfType","cache$1","cacheCount$1","matchPath","_options","_options$exact","exact","_options$strict","_options$sensitive","reduce","matched","_compilePath","cacheKey","pathCache","regexp","compilePath$1","values","memo","isEmptyChildren","Children","count","evalChildrenDev","Route","context$1","computedMatch","_this$props","base","createURL","staticHandler","methodName","noop","propName","StaticRouter","handlePush","navigateTo","handleReplace","handleListen","handleBlock","_this$props$basename","_this$props$context","addBasename","_this$props2","_this$props2$basename","_this$props2$context","_this$props2$location","rest","Switch","child","isValidElement","cloneElement","useContext","buildNames","cjs","esm","umd","initialBuildName","BrowserRouter","HashRouter","resolveToLocation","normalizeToLocation","forwardRefShim","C","forwardRef","LinkAnchor","forwardedRef","innerRef","navigate","_onClick","defaultPrevented","button","metaKey","altKey","ctrlKey","shiftKey","isModifiedEvent","ref","Link","_ref2","_ref2$component","__RouterContext","isDuplicateNavigation","toType","refType","current","forwardRefShim$1","forwardRef$1","NavLink","_ref$ariaCurrent","ariaCurrent","_ref$activeClassName","activeClassName","activeStyle","classNameProp","isActiveProp","locationProp","styleProp","escapedPath","classnames","joinClassnames","ariaCurrentType","flatten","processStyleList","stylesheetStyles","inlineStyles","shouldInlineStyles","SNAPSHOT_INLINE_APHRODITE","_definition","def","inlineStylesObject","inlineStylesStyleSheet","_excluded$2","isHeaderRegex","styles$1","WebkitFontSmoothing","MozOsxFontSmoothing","header","marginTop","marginBottom","Text","tag","Tag","testId","otherProps","isHeader","styleAttributes","_excluded$1","addStyle","defaultStyle","reset","overrides","aphroditeClassName","Boolean","_excluded","default","alignItems","borderWidth","borderStyle","boxSizing","display","flexDirection","position","zIndex","minHeight","minWidth","StyledDiv","StyledArticle","StyledAside","StyledNav","StyledSection","View","RenderState","require","Root","Initial","Standard","RenderStateContext","WithSSRPlaceholder","mounted","_isTheRootComponent","_renderAsRootComponent","placeholder","_maybeRender","renderState","log","UniqueIDFactory","scope","normalizedKey","_hasValidIdChars","_uniqueFactoryName","normalizedScope","_factoryUniquenessCounter","invalidCharsReplaced","SsrIDFactory","id","Default","SsrIDFactory$1","UniqueIDProvider","_performRender","firstRender","mockOnFirstRender","_idFactory","IDProvider","renderChildren","ids","uniqueId","defaultId","color6Regexp","color3Regexp","rgbaRegexp","color3Match","parseInt","color6Match","rgbaMatch","parseFloat","format","round","_s","asString","toFixed","fade","percentage","components","mix","background","colorObj","bgObj","Color","blue","purple","green","gold","red","offBlack","offBlack64","offBlack50","offBlack32","offBlack16","offBlack8","offWhite","white","white64","white50","darkBlue","teal","lightBlue","pink","SemanticColor","controlDefault","controlDestructive","getAppropriateTriggersForRole","role","triggerOnEnter","triggerOnSpace","disabledHandlers","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onDragStart","onTouchStart","onTouchEnd","onTouchCancel","onKeyUp","tabIndex","keyCodes","startState","hovered","focused","pressed","waiting","ClickableBehavior","static","disabled","handleClick","beforeNav","safeWithNav","enterClick","waitingForClick","runCallbackAndMaybeNavigate","handleMouseEnter","buttons","dragging","handleMouseLeave","handleMouseDown","handleMouseUp","handleDragStart","handleTouchStart","handleTouchEnd","handleTouchCancel","keyCode","which","handleKeyUp","handleFocus","navigateOrReset","shouldNavigate","skipClientNav","open","handleSafeWithNav","Promise","resolve","then","catch","finally","canSubmit","currentTarget","HTMLFormElement","Event","cancelable","dispatchEvent","parentElement","childrenProps","onFocus","rel","isClientSideUrl","ClickableBehaviorWithRouter","wrappedComponentRef","remainingProps","WrappedComponent","hoistStatics","withRouter","getClickableBehavior","router","StyledAnchor","StyledButton","StyledLink","Clickable","getCorrectTag","clickableState","commonProps","activeHref","useClient","renderClickableBehavior","hideDefaultFocusRing","light","restProps","getStyle","link","focusedLight","overflow","textDecoration","font","touchAction","userSelect","outline","lineHeight","cursor","InlineIcon","SectionControlButton","icon","paddingRight","paddingLeft","paddingBottom","PropCheckBox","iconChevronDown","iconChevronRight","iconTrash","icons","rWidgetSplit","shortcutRegexp","ENDS_WITH_A_PARAGRAPH","TRAILING_NEWLINES","LEADING_NEWLINES","commafyInteger","WidgetSelect","widgetType","shouldComponentUpdate","widgets","Widgets","getPublicWidgets","orderedWidgetNames","sortBy","_upgradeWidgetInfo","filteredProps","omit","WIDGET_PROP_BLACKLIST","upgradeWidgetInfoToLatestVersion","WidgetEditor","showWidget","newProps","cb","silent","newWidgetInfo","widgetInfo","refs","widget","serialize","newAlignment","alignment","issuesFunc","getSaveWarnings","graded","version","supportedAlignments","Ed","getEditor","apiOptions","showAlignmentOptions","getSupportedAlignments","supportsStaticMode","isUngradedEnabled","gradedPropBox","label","_toggleWidget","_toggleStatic","_handleAlignmentChange","onRemove","_handleWidgetChange","IMAGE_REGEX","Editor","katex","showKatexErrors","textAreaValue","content","_handleWidgetEditorChange","bind","_handleWidgetEditorRemove","textarea","imageUrls","regex","allMatches","images","pick","newImageUrls","each","Util","getImageSize","clone","imageUploader","dataTransfer","files","origContent","chain","file","sentinel","reject","isNull","tap","lastUserValue","fileAndSentinel","imageUrl","getData","newContent","clearTimeout","deferredChange","setTimeout","editorChangeDelay","ReactDOM","findDOMNode","word","getWordBeforeCursor","getAllWidgetTypes","matchingWidgets","_addWidgetToContent","pos","start","selectedText","widgetNames","syntax","rWidgetParts","widgetData","localStorage","perseusLastCopiedText","perseusLastCopiedWidgets","Log","widgetJSON","lastCopiedText","textToBePasted","originalEvent","clipboardData","safeWidgetMapping","_safeWidgetNameMapping","safeWidgetData","newWidgets","extend","safeText","completeWidget","expectedCursorPosition","moveCursor","widgetTypes","uniq","existingWidgets","safeWidgetNums","existingWidget","widgetName","oldContent","cursorRange","_Widgets$getEditor","allWidgetIds","widgetNum","currentNum","otherId","otherType","otherNum","widgetContent","isBlock","getDefaultAlignment","prelude","postlude","newlines","makeEndWithAParagraphIfNecessary","makeStartWithAParagraphAlways","getVersion","focus","templateType","template","PerseusError","Errors","InvalidInput","metadata","snowman","focusAndMoveToEnd","widgetIds","intersection","issues","issue","keepDeletedWidgets","contains","_sizeImages","$","_maybeCopyWidgets","_maybePasteWidgets","Dependencies","getDependencies","getKaTeX","select","execCommand","pieces","underlayPieces","widgetsDropDown","templatesDropDown","widgetsAndTemplates","wordCountDisplay","katexErrorList","showWordCount","numChars","PerseusMarkdown","characterCount","numWords","floor","widgetEnabled","ast","traverseContent","preprocessTex","renderToString","colorIsTextColor","duplicate","getWidgetEditor","_addWidget","addTemplate","immutableWidgets","widgetNodes","completeTextarea","textareaWrapper","_handleKeyDown","noPrompt","trim","noWidgets","warningStyle","warnNoPrompt","warnNoWidgets","nextIframeID","requestIframeData","updateIframeHeight","iframeDataStore","lintWarnings","IframeContentRenderer","datasetKey","datasetValue","seamless","iframeID","_prepareFrame","sendNewData","_lastData","_lastHeight","container","_frame","removeChild","dataset","lintGutter","onload","contentWindow","write","close","appendChild","postMessage","HUD","iconCircleArrowDown","iconCircleArrowUp","iconPlus","ArticleEditor","highlightLint","newJson","sections","_sections","_updatePreviewFrames","mode","section","_apiOptionsForSection","sectionIndex","editor","ApiOptions","defaults","isArticle","useNewStyles","linterContext","contentType","paths","contentPaths","legacyPerseusLint","_renderEditor","sectionImageUploadGenerator","KatexProvider","float","_handleAddSectionAfter","_handleMoveSectionLater","_handleMoveSectionEarlier","_handleRemoveSection","_handleEditorChange","_renderIframePreview","_renderAddSection","_renderLinterHUD","enabled","isMobile","screen","frameSource","_renderPreviewMode","newSection","Internal","NotAllowed","multiLine","_handleJsonChange","ButtonGroup","iconDesktop","iconMobilePhone","iconTablet","ViewportResizer","onViewportSizeChanged","phoneButtonContents","tabletButtonContents","desktopButtonContents","allowEmpty","JsDiff","clonePath","newPos","removeEmpty","ret","Diff","ignoreWhitespace","diff","oldString","newString","removed","added","tokenize","newLen","oldLen","maxEditLength","bestPath","oldPos","extractCommon","editLength","diagonalPath","basePath","addPath","removePath","canAdd","canRemove","pushComponent","equals","left","right","reWhitespace","CharDiff","WordDiff","WordWithSpaceDiff","CssDiff","LineDiff","retLines","lines","line","lastLine","diffChars","oldStr","newStr","diffWords","diffWordsWithSpace","diffLines","diffCss","createPatch","fileName","oldHeader","newHeader","contextLines","eofNL","curRange","isLast","isLastOfType","oldRangeStart","newRangeStart","oldLine","newLine","prev","contextSize","applyPatch","uniDiff","diffstr","remEOFNL","addEOFNL","meh","oldlength","oldlines","newlength","convertChangesToXML","changes","s","change","convertChangesToDMP","statusFor","chunk","splitUpChunk","status","ArrayDiff","jsdiff","elem","flattenChunks","chunks","mapcat","lst","SvgImage","imagesInString","classFor","ifAdded","ifRemoved","ImageDiffSide","classNames","image","src","TextDiff","collapsed","before","after","diffResult","flattened","diffEntries","currentLine","newEntry","splitDiff","beforeImages","afterImages","renderedLines","contents","side","lineNum","changed","lineClass","handleExpand","objectEntry","beforeKeys","isObject","afterKeys","union","performDiff","valueEntry","indentationFromDepth","depth","DiffSide","showKey","propKey","CollapsedRow","self","clear","DiffEntry","expanded","shownChildren","propertyDeleted","propertyAdded","propertyChanged","hasChildren","leftClass","dark","rightClass","expand","ImageWidgetDiff","beforeSrc","backgroundImage","afterSrc","objectOf","WidgetDiff","filterWidgetInfo","_widgetInfo$static","filteredWidgetInfo","RendererDiff","_before$widgets","_after$widgets","textDiff","widgetsDiff","showSeparator","beforeWidgets","includes","afterWidgets","_before$widgets2","_after$widgets2","_before$widgets$widge","_before$widgets3","_after$widgets$widget","_after$widgets3","rendererProps","ArticleDiff","_stateFromProps","sectionCount","times","itemProps","question","answerArea","hints","ItemDiff","hintCount","extras","TagsDiff","afterOnly","beforeOnly","beforeTags","afterTags","beginsWith","beginPath","checkPath","beforePath","afterPath","StructuredItemDiff","beforeList","afterList","newPath","generateCompletePathsList","elementShape","tags","buildMapper","setContentMapper","setHintMapper","setTagsMapper","mapTree","itemToTree","beforeListModified","afterListModified","allDiffPaths","diffCount","diffs","isTag","currentTitle","getTitle","find","tagId","idToName","buildEmptyItemTreeForShape","shapes","InfoTip","HintEditor","checked","showTitle","itemId","showMoveButtons","onMove","isFirst","showRemoveButton","CombinedHintEditor","shouldBold","hint","frame","bold","updatePreview","CombinedHintsEditor","serializeHint","dir","hintElems","handleHintChange","handleHintRemove","handleHintMove","addHint","ItemExtrasEditor","calculator","chi2Table","periodicTable","tTable","zTable","ITEM_DATA_VERSION","itemDataVersion","ItemEditor","newData","updateProps","questionEditor","itemExtrasEditor","handleEditorChange","handleItemExtrasChange","EditorPage","jsonMode","toChange","gradeMessage","wasAnswered","rendererMountNode","updateRenderer","hasEditor","developerMode","touch","previewDevice","deviceBasedApiOptions","_objectSpread","getApiOptions","customKeypad","itemEditor","triggerPreviewUpdate","initialHintsVisible","device","reviewMode","issues1","issues2","hintsEditor","scorePreview","renderer","scoreInput","ClassNames","MOBILE","toggleJsonMode","onPreviewDeviceChange","changeJSON","findContentNodesInItem","findHintNodesInItem","inferItemShape","MultiItems","findImagesInContent","parsed","handleBackgroundImage","graph","findImagesInRenderers","renderers","traverse","items","categories","category","caption","option","labels","suffix","passageTitle","choices","choice","correct","headers","picUrl","widgetCallback","factory","i18n","findImagesInArticles","perseusContent","findImagesInItemData","itemData","_multi","modules","installedModules","__webpack_require__","moduleId","getter","configurable","enumerable","__esModule","property","merge","prop","util","dispatch","lens","ops","_wrapped","thaw","freeze","lensArr","_zoomStack","wrapped","deZoom","mod","newObj","monocle","shortLens","oldProps","del","val","newArr","SimpleButton","_objectWithoutProperties","baseButton","orange","top","backgroundRepeat","borderColor","borderRadius","transition","appearance","boxShadow","borderBottomColor","MultiRenderer","ModeDropdown","currentMode","_handleSelectMode","camelCaseToHuman","capitalize","pluralToSingular","multiPath","Header","headerLevel","HeaderTag","NodeContainer","actions","givenName","controls","_excluded2","NodeContent","ArrayContainer","ObjectContainer","LeafContainer","previewHeading","containerHeader","containerTitle","row","rowHeading","columnLeft","columnRight","addArrayElement","_ref3","headingEditor","headingPreview","previewCollectionHeader","hasBothHeadings","contentIndent","_excluded3","ItemNodeContent","HintNodeContent","TagsNodeContent","ArrayNodeContent","ObjectNodeContent","withStickiness","sticky","domNode","offsetHeight","innerHeight","stickynessTimer","setInterval","updateStickiness","clearInterval","preview","newVal","mergeValueAtPath","hintEditor","direction","GroupMetadataEditor","tagsEditor","setValueAtPath","_excluded4","elementName","elementType","elementIsLeaf","subdata","subpath","control","moveArrayElementUp","verticalFlip","moveArrayElementDown","removeArrayElement","arrayElement","arrayElementAndNotLeaf","_excluded5","subkey","objectElement","MultiRendererEditor","Layout","layout","editorMode","_renderLayout","currentLength","newElementPath","nextElementIndex","nextElementPath","nextElement","previousElementPath","itemShape","_ref4","score","getSerializedState","restoreSerializedState","_renderJson","_renderPreview","_renderEdit","_renderContent","treePreview","transform","marginLeft","flexGrow","borderBottom","paddingTop","marginRight","flex","StatefulArticleEditor","newState","controlBar","controlSelected","fontWeight","StatefulEditorPage","componentClass","TextListEditor","Categorizer","CategorizerWidget","CategorizerEditor","Changeable","EditorJsonify","labelAlignment","randomizeItems","cat","first","trackInteraction","BlurInput","PairEditor","PairsEditor","_len2","_key2","pairIndex","pair","pairs","lastPair","editors","handlePairChange","KA_PROGRAM_URL","CSProgramEditor","_this3","_len3","_key3","settings","programID","programUrl","isDevServer","InitialRequestUrl","host","origin","baseUrl","getJSON","done","programInfo","programType","userAuthoredContentType","fail","jqxhr","textStatus","TransientService","cause","loggedMetadata","_handleProgramIDChange","showEditor","showButtons","_handleSettingsChange","TextInput","DefinitionEditor","togglePrompt","definition","has","DropdownEditor","choiceIndex","dropdownGroupName","onPlaceholderChange","checkedClass","onCorrectChange","onContentChange","removeChoice","addChoice","EPSILON","pow","knumber","DEFAULT_TOLERANCE","is","isNumber","isNaN","equal","tolerance","abs","sign","isInteger","num","precision","factor","roundTo","increment","floorTo","ceilTo","ceil","toFraction","decimal","max_denominator","rem","require$$1","arraySum","arg","arrayProduct","kvector","vec","dimension","all","normalize","sqrt","dot","vecs","toArray","zipped","zip","multiplied","add","points","subtract","v1","v2","dim","negate","scalar","codirectional","collinear","polarRadFromCart","radius","theta","atan2","PI","polarDegFromCart","polar","cartFromPolarRad","isUndefined","cos","sin","cartFromPolarDeg","rotateRad","angle","rotateDeg","angleRad","acos","angleDeg","projection","vector","require$$2","kpoint","point","center","distanceToPoint","point1","point2","distanceToLine","lv","pv","projectedPv","distancePv","reflectOverLine","reflectedPv","equalityTolerance","addVector","addVectors","subtractVector","kline","reflectPoint","midpoint","line1","line2","line1ToLine2Vector","kmath","ray","ray1","ray2","sameOrigin","Graphie","MovablePoint","ExampleGraphieWidget","WidgetJsonifyDeprecated","getUserInput","newCoord","coord","step","gridDimensionConfig","range","box","gridStep","graphie","gridConfig","_getGridConfig","graphInit","pluck","axisArrows","labelFormat","tickStep","labelStep","unityLabels","rubric","validate","earned","total","setup","setupGraphie","setDrawingAreaAvailable","pointSize","constraints","snap","bound","movePoint","markings","showProtractor","ExampleGraphieWidget$2","hidden","ExampleGraphie","ExampleGraphieWidgetEditor","ExampleWidgetEditor","input","handleAnswerChange","ExplanationEditor","showPrompt","hidePrompt","explanation","KAS","parser","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","$Vc","$Vd","$Ve","$Vf","$Vg","$Vh","$Vi","$Vj","$Vk","$Vl","$Vm","$Vn","$Vo","trace","yy","symbols_","equation","expression","SIGN","EOF","additive","multiplicative","triglog","negative","trig","TRIG","trigfunc","TRIGINV","logbase","ln","subscriptable","power","primitive","variable","VAR","CONST","INT","FLOAT","function","FUNC","invocation","FRAC","$accept","$end","terminals_","productions_","performAction","yytext","yyleng","yylineno","yystate","$$","_$","$0","Eq","Add","createOrAppend","Mul","handleNegative","fold","handleDivide","natural","common","Trig","Pow","Var","Const","Int","Number","Float","completeParse","nthroot","Abs","Func","table","defaultActions","parseError","recoverable","stack","vstack","lstack","TERROR","lexer","sharedState","setInput","yylloc","yyloc","ranges","lex","symbol","len","expected","yyval","errStr","showPosition","loc","first_line","last_line","first_column","last_column","_input","_more","_backtrack","conditionStack","ch","unput","oldLines","more","backtrack_lexer","less","pastInput","past","upcomingInput","pre","test_match","indexed_rule","backup","tempMatch","rules","_currentRules","begin","popState","conditions","topState","stateStackSize","yy_","$avoiding_name_collisions","YY_START","symbolLexer","INITIAL","inclusive","Parser","unitvalue","magnitude","unit","POW","int","multatoms","DIV","expatom","MUL","atom","nat","ATOM","NAT","NEG","denom","unitParser","abstract","print","Expr","Seq","terms","exp","subscript","Num","Rational","numerator","denominator","construct","instance","recurse","method","passed","eval","codegen","code","Function","tex","asTex","dynamic","repr","strip","collect","other","simplify","once","step1","step2","step3","step4","simplified","isSimplified","exprArgs","getVars","excludeFunc","invoke","sort","getConsts","getUnits","raiseToThe","isSubtract","isDivide","isRoot","needsExplicitMul","sameVars","vars1","vars2","same","array1","array2","difference","lower","equalIgnoringCase","varList","equalNumbers","num1","num2","getDelta","Unit","expr1","expr2","unitList1","unitList2","vars","useFloats","extent","result1","partialEval","result2","sameForm","findGCD","One","getDenominator","asMul","isPositive","isNegative","asPositiveFactor","expr","parens","asExpr","Neg","term","partition","groupBy","numbers","others","identity","grouped","oldTerm","newTerm","newTerms","remove","muls","collected","compact","keepNegative","factors","remainder","tmUnits","cdot","inverses","inverse","negatives","withThisRemoved","hasDenom","shouldPushDown","fraction","Div","entered","isAdd","isInverse","mul","hasAdd","hasInverseAdd","normals","adds","temp","factored","rational","partitioned","Zero","summed","trigs","isBasic","logs","exprs","byArg","funcs","tan","cot","byBase","factorIn","negativeOne","factorOut","divide","isNum","negated","isInt","reversed","reverse","divided","initial","trigLog","newTrigLog","neg","some","every","firstNeg","firstNum","evaledBase","evaledExp","simplifiedExp","decimals","asDivide","isSimple","positive","signed","cache","indices","without","isSimilarLog","preciseFloats","asRational","decimalsInBase","getDecimalPlaces","newBase","isDiv","root","isSquaredTrig","expA","expB","Sqrt","radicand","degree","isNatural","Ten","functions","csc","sec","arcsin","asin","arccos","arctan","atan","arccsc","arcsec","arccot","sinh","argStr","cosh","tanh","csch","sech","coth","isEven","positives","signs","eq","unfactored","isZero","isInequality","isEquality","divideThrough","dividedResult","eq1","eq2","solveLinearEquationForVariable","newVars","parsedFunc","sub","prettyPrint","E","pi","gcd","toDecimalPlaces","places","Sub","decimal_separator","unprefixify","baseUnits","derivedUnits","siPrefixes","testPrefix","prefixes","hasPrefixes","unitParse","parseResult","unitArray","unitSpec","coefficient","conversion","K","mol","cd","da","M","G","T","P","hella","hasntPrefixes","makeAlias","splits","coefficientStr","unitsStr","numdenomStr","numdenom","Da","meter","meters","in","ft","yd","mi","ly","nmi","pc","hr","day","wk","fortnight","shake","olympiad","kn","kt","knot","J","BTU","cal","eV","erg","W","N","lb","dyn","Pa","bar","atm","Torr","mmHg","ha","barn","acre","skilodge","outhouse","shed","L","gal","cup","qt","quart","pt","pint","tbsp","tsp","rev","deg","arcminute","Hu","dozen","percent","ppm","V","ampere","ohm","F","H","Wb","lm","lx","nit","sb","stilb","apostilb","blondel","asb","la","Lb","sk","skot","bril","Hz","form","wrongVariableCase","wrongVariableNames","PT","SortableArea","onReorder","verify","_setDragEvents","startIndex","enterIndex","newComponents","verified","_listenEvent","setData","_cancelEvent","_dragItems","querySelectorAll","oldItems","newItems","dragItem","sortables","SortableItem","area","draggable","nativeEvent","effectAllowed","dragState","TexButtons","CONSIDERED","answerFormType","considered","_makeNewKey","answerForms","usedKeys","ans","ExpressionEditor","isTex","formSerializables","serializables","ix","_newEmptyAnswerForm","changingName","buttonSetNames","buttonSets","keep","insert","answerOptions","expressionProps","buttonsVisible","updateForm","widgetId","onDelete","handleRemoveForm","AnswerOption","sortable","handleReorder","buttonSetChoices","handleButtonSet","TeX","handleToggleDiv","handleFunctions","sets","convertDotToTimes","onInsert","handleTexInsert","newAnswer","buttonSetsType","deleteFocused","removeButton","handleImSure","handleDeleteBlur","handleDelete","toggleConsidered","Expression","GradedGroupEditor","handleAddHint","hintsTitle","handleRemoveHint","GradedGroupSetEditor","_editors","gradedGroups","el","setArrayItem","UNSAFE_componentWillMount","renderGroups","addGroup","RangeInput","defaultBackgroundImage","GraphSettings","editableSettings","snapStep","showRuler","showTooltips","rulerLabel","rulerTicks","interactiveSizes","defaultBoxSizeSmall","stateFromProps","changeGraph","debounce","labelsTextbox","gridStepTextbox","snapStepTextbox","stepTextbox","rangeTextbox","changeRulerLabel","changeRulerTicks","changeBackgroundUrl","setUrl","renderLabelChoices","nameAndValue","validRange","isFinite","validateStepValue","minTicks","maxTicks","nSteps","numSteps","validSnapStep","validGridStep","validStep","validBackgroundImageSize","validateGraphSettings","msg","goodRange","goodStep","goodGridStep","goodSnapStep","goodImageSize","changeLabel","changeRange","scaleFromExtent","tickStepFromExtent","gridStepFromTickStep","changeStep","changeSnapStep","changeGridStep","validationResult","KhanMath","vals","onKeyPress","MultiButtonGroup","containerSizeClass","getInteractiveBoxFromSizeClass","SizingUtils","Grapher","GrapherWidget","DEFAULT_GRAPHER_PROPS","allTypes","chooseType","defaultPlotProps","getEquationString","typeToButton","GrapherUtil","GrapherEditor","newAvailableTypes","newType","availableTypes","equationString","sizeClass","SMALL","graphProps","plot","_newProps$plot","handleAvailableTypesChange","GroupEditor","_renderMetadataEditor","IframeEditor","handleSettingsChange","allowFullScreen","allowTopNavigation","defaultRange","INTERNALLY_HOSTED_URL_RE","captionAlignments","ImageEditor","statics","alt","backgroundImageError","imageSettings","backgroundImageErrorText","onUrlChange","_renderRowForLabel","coordinates","onCoordinateChange","verticalAlign","onAlignmentChange","removeLabel","labelIndex","newCoordinates","_leadingUrl","onRangeChange","newRange","answerTypes","forms","integer","improper","mixed","InputNumberEditor","firstNumericalParse","answerTypeOptions","inexact","visibility","maxError","answerType","size","rightAlign","MathInput","NumberInput","ConstraintEditor","constraint","constraintFn","constraintXMin","constraintXMax","constraintYMin","constraintYMax","unescapeMathMode","PointEditor","coordX","coordY","ColorPicker","KhanColors","BLACK","LineEditor","startX","startY","endX","endY","DashPicker","strokeDasharray","ArrowPicker","arrows","strokeWidth","MovablePointEditor","varSubscript","MovableLineEditor","_this4","_len4","_key4","startSubscript","endSubscript","FunctionEditor","_this5","_len5","_key5","funcName","rangeMin","rangeMax","strokeDashArray","BLUE","ParametricEditor","_this6","_len6","_key6","LabelEditor","_this7","_len7","_key7","RectangleEditor","_this8","_len8","_key8","lightColors","LIGHT_BLUE","InteractionEditor","_this9","usedVarSubscripts","_getAllVarSubscripts","elements","usedFunctionNames","_getAllFunctionNames","nextSubscript","newElement","nextLetter","String","fromCharCode","newElements","_len9","_key9","where","ElementContainer","_updateGraphProps","onUp","_moveElementUp","onDown","_moveElementDown","_deleteElement","_addNewElement","DeprecationMixin","InteractiveGraph","InteractiveGraphWidget","InteractiveGraphEditor","coords","deprecatedProps","showGraph","getGridStep","defaultBoxSize","snapStepFromGridStep","changeMatchType","FormWrappedTextField","grow","shrink","focusBorderColor","onSubmit","leftSideIcon","labelMediumInputText","allProps","extraStyles","spanStyle","flexShrink","defaultBackground","borderColorStyle","wrappedIcon","inputBase","labelMediumInputBase","disableDefault","globalStyles","typography","bodyXsmall","colors","gray41","fontFamily","justifyContent","FormWrappedTextField$1","highlighted","referrer","hrefWithoutHash","delegatedStyles","delegatedClassName","urlProp","Icon","addIcon","removeIcon","DraggableGripIcon","viewBox","filterUnits","stdDeviation","dy","in2","k2","k3","operator","fill","gray17","AddAnswer","addAnswer","editorStyles","spacer","Answer","answer","AnswerChoices","answers","bodyXsmallBold","HoverBehavior","shouldUpdate","focusFlag","startHovered","Checkbox","appearDisabled","dataTestId","checkedColor","svg","sizeWithPadding","fillRule","rx","stroke","gray68","checkbox","defaultCursor","bottom","Behavior","multipleAnswers","hideChoicesFromInstructions","smallSubheadingMobile","Option","onDropdownClose","pressedKey","focusedElement","nextSibling","previousSibling","selected","optionRenderer","hideFocusState","ariaLabel","notAButton","cursorDefault","noFocus","optionSelected","optionDisabled","check","OptionGroup","preventScroll","onSelected","selectedValues","noMargin","optionGroup","optionGroupNoMargin","reference","whiteSpace","textOverflow","gray95","gray76","Marker","showDropdown","_marker","updateMarker","toggleAnswer","filteredAnswers","openDropdown","marker","markerWithAnswers","markerSelected","dropdownBody","dropdownPositionWithArrow","dividerHorizontal","handleSelectAnswer","labelContainer","handleLabelChange","borderRight","gray98","gray85","globalConstants","zindexDropdown","maxHeight","QuestionMarkers","rect","getBoundingClientRect","clientX","clientY","markers","openDropdownForMarkerIndices","_markers","imageWidth","imageHeight","staticUrl","subtitle","markersCanvas","maxWidth","getRealImageUrl","onDoubleClick","handleImageDoubleClick","labelSmall","mobile","SansFamily","Title","Tagline","HeadingLarge","HeadingMedium","HeadingSmall","HeadingXSmall","letterSpacing","textTransform","BodySerifBlock","BodySerif","BodyMonospace","Body","LabelLarge","LabelMedium","LabelSmall","LabelXSmall","Caption","Footnote","_excluded$f","_excluded$e","_excluded$d","_excluded$c","_excluded$b","_excluded$a","_excluded$9","_excluded$8","_excluded$7","_excluded$6","_excluded$5","_excluded$4","_excluded$3","heights","xsmall","small","medium","large","StyledPath","CircularSpinner","xmlns","loadingSpinner","spinnerContainer","transformOrigin","animationName","animationDuration","animationIterationCount","animationTimingFunction","viewportPixelsForSize","xlarge","StyledSVG","PureComponent","sharedProps","assetSize","desiredPixelSize","availableSizes","sortFn","availableSize","tooLargeByPixels","POSITIVE_INFINITY","bestAssetSize","getPathForIcon","pixelSize","viewboxPixelSize","Spacing","ButtonCore","renderInner","disabledProp","kind","spinner","buttonStyles","_generateStyles","sharedStyles","shared","withIcon","active","Label","xlargeText","textWithIcon","hiddenText","textWithFocus","WebkitTapHighlightColor","pointerEvents","iconWidth","buttonType","fadedColor","activeColor","newStyles","Button","sharedButtonCoreProps","renderProp","clickableTabIndex","restChildProps","SelectImage","btn","LabelImageEditor","imageAlt","warnings","numNoAnswers","numNoLabels","coordsToMarkers","newIndices","_questionMarkers","imageSelected","handleImageChange","smallSpacer","handleAltChange","largeSpacer","handleMarkersChange","handleChoicesChange","handleBehaviorChange","TABLE_STYLE","tableLayout","ROW_STYLE","CELL_STYLE","BASE_TILE_STYLE","PATTERNS","plus","iter","clampToInt","Tile","_flip","TileGrid","cells","cell","LightsPuzzleEditor","startCells","newWidth","_truncateCells","_height","newHeight","_width","newCells","tileY","tileX","oldCells","predicate","_changeWidth","_changeHeight","flipPattern","_handlePatternChange","gradeIncompleteAsWrong","overflowX","_switchTile","MatcherEditor","onLabelChange","orderMatters","Matrix","MatrixWidget","MatrixEditor","matrixSize","matrix","matrixRow","rowWidth","matrixCol","col","getMatrixSize","matrixBoardSize","matrixProps","numericInput","onMatrixBoardSizeChange","labelStyle","useArrowKeys","cursorPosition","defaultImage","MeasurerEditor","_changeImage","newTop","newLeft","subProp","_changeUrl","_changeTop","_changeLeft","rulerPixels","rulerLength","MoleculeWidgetEditor","smiles","rotationAngle","updateMolecule","updateRotation","NumberLineEditor","labelRange","divisionRange","gt","lt","numDivisions","divRange","correctRel","snapDivisions","isTickCtrl","onChangeRelation","correctX","onNumChange","checkValidity","initialX","onLabelRangeChange","onLabelStyleChange","labelTicks","onNumDivisionsChange","onTickStepChange","iconGear","answerFormButtons","initAnswer","NumericInputEditor","labelText","multipleNumberInput","lastStatus","showOptions","unsimplifiedAnswers","updateAnswer","suggestedAnswerTypes","inputSize","coefficientCheck","addAnswerButton","onSpace","instructions","wrong","ungraded","multInputOption","onMultipleInputChange","onFormatChange","onStatusChange","onTrashAnswer","onToggleOptions","generateInputAnswerEditors","statuses","newStatus","update","lastAnswer","OrdererEditor","whichOptions","correctOptions","otherOptions","onOptionsChange","onLayoutChange","onHeightChange","PassageEditor","passageEditor","passageText","footnotesEditor","footnotes","showLineNumbers","PassageRefEditor","passageNumber","referenceNumber","summaryText","PassageRefTargetEditor","handleContentChange","Plotter","PlotterWidget","padArray","copy","editorDefaults","scaleY","maxY","snapsPerLine","widgetPropTypes","picSize","pixBoxHeight","plotDimensions","labelInterval","starting","formatNumber","PlotterEditor","editing","pic","loadedUrl","minX","maxX","Image","oldScale","newScale","changeCategories","fetchPic","setFromScale","canChangeSnaps","changeType","axis","handleChangeTickStep","handleChangeRange","setCategoriesFromScale","changeLabelInterval","changePicUrl","changeScale","changeMax","changeSnaps","changeEditing","handlePlotterChange","picBoxHeight","ChoiceEditor","isNoneOfTheAbove","clueEditor","clue","correctOrIncorrect","onClueChange","deleteLink","showDelete","RadioEditor","allowMultiple","multipleSelect","numCorrect","countChoices","newClue","deleted","hasNoneOfTheAbove","noneOfTheAbove","newChoice","addIndex","displayCount","onMultipleSelectChange","randomize","onCountChoicesChange","BaseRadio","editMode","labelWrap","deselectEnabled","ReactionDiagramWidgetEditor","idx","newSmiles","newRot","newSep","separators","sep","updateSeparators","topText","bottomText","StepControlButton","SequenceEditor","steps","newStep","_handleMoveStepLater","_handleMoveStepEarlier","_handleRemoveStep","_handleAddStepAfter","TextArea","changeValue","SimpleMarkdownTesterEditor","SimulatorEditor","xAxisLabel","handleTargetValueChange","yAxisLabel","proportionLabel","proportionOrPercentage","numTrials","SorterEditor","Table","TableWidget","TableEditor","numberOfColumns","numRawRows","numRawColumns","rows","columns","oldColumns","oldRows","fixColumnSizing","stringArrayOfSize","tableProps","editableHeaders","onSizeInput","Graph","Transformer","TransformerWidget","deepEq","orderInsensitiveCoordsEqual","coords1","coords2","coord1","coord2","defaultTransformerProps","gradeEmpty","graphMode","listMode","tools","translation","required","rotation","fixed","reflection","dilation","drawSolutionShape","transformations","ToolSettings","newConstraints","allowFixed","changeConstraints","TransformationExplorerSettings","modes","toolName","newTools","getMode","changeMode","changeHandlerFor","ShapeTypes","getPointCountForType","splitType","addMovableShape","editable","translatable","isMoving","previousCoord","currentPoint","addMovablePoint","normalStyle","normalPointStyle","highlightStyle","highlightPointStyle","visible","showPoints","snapX","snapY","bounded","moveVector","setCoord","oldCoord","onMoveEnd","addShape","removeShapeWithoutPoints","types","_typesOf","typeOptions","defaultOptions","_mapTypes","shapeOptions","_addType","updateFuncs","removeFuncs","getOptions","toJSON","shape1","shape2","types1","types2","shapes1","_combine","shapes2","partialShape1","partialShape2","_forType","typeDefaultOptions","baseType","pointCount","currentPoints","lineCoords","coordA","coordZ","pointA","pointZ","polygon","addMovablePolygon","constrainToGraph","addMovableLineSegment","movePointsWithLine","extendLine","shouldChangeReflexivity","addMovableAngle","angleLabel","reflex","isReflex","perimeter","redrawPerim","coord0","circle","DYNAMIC","lineSegment","points1","points2","line1_0","line1_2","line2_0","line2_2","equalUnflipped","kray","equalFlipped","radius1","radius2","TransformationsShapeEditor","getTypeString","dist","spreadX","spreadY","updateCoords","onGraphieUpdated","TransformerEditor","graphChanges","newGraph","startingChanges","newStarting","explorer","getEditorJSON","setProps","boxSize","changeStarting","changeTransformer","iconOk","iconRemove","primUnits","UnitExample","original","sigfigs","solvedExample","equality","displaySigFigs","sigfigPrint","_checkValidity","UnitInputEditor","acceptingUnits","accepting","tryParse","groupId","_doOriginal","acceptingElem","unitsArr","handleAcceptingUnitsChange","handleSigfigChange","_checkSigfigValidity","_setAccepting","KA_VIDEO_URL","getSlugFromUrl","VideoEditor","_handleUrlChange","AllEditors","MoleculeEditor","ReactionDiagramEditor","UnitEditor","ExampleWidget","ExampleWidget$1","defaultAlignment","mdParse","mdOutput","basicOutput","SimpleMarkdownTester","output","AllWidgets","registerEditors","registerWidgets"],"mappings":"k/EASA,IAAMA,GAAe,CACjBC,MAAO,CACHC,MAAO,IACPC,OAAQ,IACRC,YAAa,KAEjBC,OAAQ,CACJH,MAAO,IACPC,OAAQ,IACRC,YAAa,KAEjBE,QAAS,CACLJ,MAAO,IACPC,OAAQ,IACRC,YAAa,MAMrB,MAAMG,WAAqBC,EAAMC,UAY7BC,SACI,IAAMC,EAAaC,KAAKC,MAAMF,WAE9B,GAA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