@khanacademy/perseus 39.0.0 → 40.0.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/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
9
9
  var Tooltip$1 = require('@khanacademy/wonder-blocks-tooltip');
10
10
  var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
11
11
  var aphrodite = require('aphrodite');
12
- var classNames = require('classnames');
12
+ var classNames$1 = require('classnames');
13
13
  var React = require('react');
14
14
  var ReactDOM = require('react-dom');
15
15
  var _ = require('underscore');
@@ -67,7 +67,7 @@ function _interopNamespace(e) {
67
67
  var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
68
68
  var PerseusLinter__namespace = /*#__PURE__*/_interopNamespace(PerseusLinter);
69
69
  var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip$1);
70
- var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
70
+ var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames$1);
71
71
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
72
72
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
73
73
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
@@ -3999,12 +3999,12 @@ Zoom.prototype.dispose = function () {
3999
3999
  const ZoomService = new ZoomServiceClass();
4000
4000
 
4001
4001
  // @baseFontFamily: "Lato", sans-serif;
4002
- const baseFontFamily$1 = "'Lato', sans-serif";
4002
+ const baseFontFamily = "'Lato', sans-serif";
4003
4003
  // @boldFontFamily: "Lato-Bold", "Lato", sans-serif;
4004
4004
  const boldFontFamily = "'Lato-Bold', 'Lato', sans-serif";
4005
4005
  // @kaGreen: #71b307;
4006
- const kaGreen$1 = "#71B307";
4007
- const white$1 = "#FFFFFF";
4006
+ const kaGreen = "#71B307";
4007
+ const white = "#FFFFFF";
4008
4008
  const gray97 = "#F6F7F7";
4009
4009
  const gray85 = "#D6D8DA";
4010
4010
  const gray76 = "#BABEC2";
@@ -4012,23 +4012,23 @@ const gray68 = "#888D93";
4012
4012
  const gray17 = "#21242c";
4013
4013
 
4014
4014
  // @pure-sm-min: 568px;
4015
- const pureSmMin$2 = "568px";
4015
+ const pureSmMin$1 = "568px";
4016
4016
  // @pure-md-min: 768px;
4017
- const pureMdMin$2 = "768px";
4017
+ const pureMdMin$1 = "768px";
4018
4018
  // @pure-lg-min: 1024px;
4019
- const pureLgMin$2 = "1024px";
4019
+ const pureLgMin$1 = "1024px";
4020
4020
  // @pure-xl-min: 1280px;
4021
- const pureXlMin$2 = "1280px";
4021
+ const pureXlMin$1 = "1280px";
4022
4022
  // @pure-xs-max: (@pure-sm-min - 1);
4023
- const pureXsMax$2 = "567px";
4023
+ const pureXsMax$1 = "567px";
4024
4024
  // @pure-sm-max: (@pure-md-min - 1);
4025
- const pureSmMax$2 = "767px";
4025
+ const pureSmMax$1 = "767px";
4026
4026
  // @pure-md-max: (@pure-lg-min - 1);
4027
- const pureMdMax$2 = "1023px";
4027
+ const pureMdMax$1 = "1023px";
4028
4028
  // @pure-lg-max: (@pure-xl-min - 1);
4029
- const pureLgMax$2 = "1279px";
4029
+ const pureLgMax$1 = "1279px";
4030
4030
  // @tableBackgroundAccent: #f9f9f9; // for striping
4031
- const tableBackgroundAccent$1 = "#F9F9F9";
4031
+ const tableBackgroundAccent = "#F9F9F9";
4032
4032
  // @zIndexAboveScratchpad: @zIndexScratchPad + 1;
4033
4033
  const zIndexAboveScratchpad$1 = 2;
4034
4034
  // @zIndexInteractiveComponent: @zIndexAboveScratchpad + 1;
@@ -4056,26 +4056,26 @@ const checkedColor$1 = "#71B307";
4056
4056
  const articleMaxWidthInPx = 688;
4057
4057
  const articleMaxWidthTableInPx = 512;
4058
4058
 
4059
- var constants$1 = /*#__PURE__*/Object.freeze({
4059
+ var constants = /*#__PURE__*/Object.freeze({
4060
4060
  __proto__: null,
4061
- baseFontFamily: baseFontFamily$1,
4061
+ baseFontFamily: baseFontFamily,
4062
4062
  boldFontFamily: boldFontFamily,
4063
- kaGreen: kaGreen$1,
4064
- white: white$1,
4063
+ kaGreen: kaGreen,
4064
+ white: white,
4065
4065
  gray97: gray97,
4066
4066
  gray85: gray85,
4067
4067
  gray76: gray76,
4068
4068
  gray68: gray68,
4069
4069
  gray17: gray17,
4070
- pureSmMin: pureSmMin$2,
4071
- pureMdMin: pureMdMin$2,
4072
- pureLgMin: pureLgMin$2,
4073
- pureXlMin: pureXlMin$2,
4074
- pureXsMax: pureXsMax$2,
4075
- pureSmMax: pureSmMax$2,
4076
- pureMdMax: pureMdMax$2,
4077
- pureLgMax: pureLgMax$2,
4078
- tableBackgroundAccent: tableBackgroundAccent$1,
4070
+ pureSmMin: pureSmMin$1,
4071
+ pureMdMin: pureMdMin$1,
4072
+ pureLgMin: pureLgMin$1,
4073
+ pureXlMin: pureXlMin$1,
4074
+ pureXsMax: pureXsMax$1,
4075
+ pureSmMax: pureSmMax$1,
4076
+ pureMdMax: pureMdMax$1,
4077
+ pureLgMax: pureLgMax$1,
4078
+ tableBackgroundAccent: tableBackgroundAccent,
4079
4079
  zIndexAboveScratchpad: zIndexAboveScratchpad$1,
4080
4080
  zIndexInteractiveComponent: zIndexInteractiveComponent$1,
4081
4081
  phoneMargin: phoneMargin,
@@ -14999,77 +14999,26 @@ const iconCheck = {
14999
14999
  width: 24,
15000
15000
  height: 24
15001
15001
  };
15002
- const iconCheckMedium = {
15003
- path: "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",
15004
- width: 16,
15005
- height: 16
15006
- };
15007
15002
  const iconChevronDown = {
15008
15003
  path: "M99.669 13.048q0 3.36-2.352 5.712l-41.664 41.664q-2.408 2.408-5.88 2.408t-5.712-2.408l-41.664-41.664q-2.408-2.24-2.408-5.712t2.408-5.88l4.76-4.816q2.52-2.352 5.88-2.352t5.656 2.352l31.136 31.136 31.08-31.136q2.352-2.352 5.712-2.352t5.88 2.352l4.816 4.816q2.352 2.52 2.352 5.88z",
15009
15004
  width: 100,
15010
15005
  height: 63.034
15011
15006
  };
15012
- const iconChevronRight = {
15013
- path: "M62.808 49.728q0 3.36-2.352 5.88l-41.72 41.664q-2.352 2.408-5.768 2.408t-5.768-2.408l-4.872-4.76q-2.352-2.52-2.352-5.88t2.352-5.712l31.08-31.136-31.08-31.024q-2.352-2.52-2.352-5.88t2.352-5.712l4.872-4.76q2.296-2.408 5.768-2.408t5.768 2.408l41.72 41.664q2.352 2.296 2.352 5.656z",
15014
- width: 63.034,
15015
- height: 100
15016
- };
15017
15007
  const iconCircle = {
15018
15008
  path: "M100.035 50.046q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
15019
15009
  width: 100,
15020
15010
  height: 100
15021
15011
  };
15022
- const iconCircleArrowDown = {
15023
- path: "M50.046 83.676q1.767 0 2.907-1.14l29.526-29.526q1.197-1.197 1.197-2.907t-1.197-2.964l-5.928-5.928q-1.197-1.14-2.964-1.14t-2.907 1.14l-12.312 12.312l0-32.661q0-1.71-1.254-2.964t-2.907-1.254l-8.322 0q-1.71 0-2.964 1.254t-1.254 2.964l0 32.661l-12.312-12.312q-1.197-1.254-2.907-1.254t-2.907 1.254l-5.928 5.928q-1.197 1.197-1.197 2.964t1.197 2.907l29.469 29.526q1.197 1.14 2.964 1.14zm49.989-33.63q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
15024
- width: 100,
15025
- height: 100
15026
- };
15027
- const iconCircleArrowUp = {
15028
- path: "M54.207 83.391q1.653 0 2.907-1.254t1.254-2.907l0-32.718l12.312 12.312q1.254 1.254 2.964 1.254t2.907-1.254l5.928-5.928q1.197-1.197 1.14-2.964 0-1.767-1.14-2.907l-29.526-29.526q-1.197-1.14-2.907-1.14t-2.964 1.14l-29.469 29.526q-1.197 1.254-1.197 2.964t1.197 2.907l5.928 5.928q1.197 1.197 2.907 1.197t2.907-1.197l12.312-12.312l0 32.718q0 1.653 1.254 2.907t2.964 1.254l8.322 0zm45.828-33.345q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
15029
- width: 100,
15030
- height: 100
15031
- };
15032
15012
  const iconCircleThin = {
15033
15013
  path: "M50.046 8.322q-8.493 0-16.188 3.306-15.561 6.669-22.173 22.23-3.363 7.695-3.363 16.188t3.306 16.188 8.949 13.281q5.586 5.586 13.281 8.892t16.188 3.306 16.188-3.306 13.281-8.892 8.892-13.281 3.306-16.188-3.306-16.188-8.892-13.281-13.281-8.949q-7.695-3.306-16.188-3.306zm0 91.713q-13.623 0-25.137-6.726t-18.183-18.183q-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.726 25.137-6.726 25.137-18.24 18.126q-11.514 6.726-25.08 6.726z",
15034
15014
  width: 100,
15035
15015
  height: 99.944
15036
15016
  };
15037
- const iconDesktop = {
15038
- path: "M94.208 52.119l0-43.746q0-.69-.506-1.15t-1.196-.506l-84.088 0q-.69 0-1.196.506t-.506 1.15l0 43.746q0 .69.506 1.196t1.196.506l84.088 0q.69 0 1.196-.506t.506-1.196zm6.716-43.746l0 57.224q0 3.45-2.484 5.934t-5.934 2.484l-28.566 0q0 3.128 2.53 7.774.828 1.61.828 2.622t-1.012 2.07q-1.012 1.012-2.346.966l-26.91 0q-1.38 0-2.392-1.012t-1.012-2.024q0-1.058 1.656-4.14t1.748-6.256l-28.612 0q-3.45 0-5.934-2.484t-2.484-5.934l0-57.224q0-3.45 2.484-5.934t5.934-2.438l84.088 0q3.45 0 5.98 2.438 2.438 2.484 2.438 5.934z",
15039
- width: 100,
15040
- height: 86.648
15041
- };
15042
- const iconDropdownArrow = {
15043
- path: "M9 9.8c0 .5.7 1.7 1.5 2.8 1.5 1.9 1.5 1.9 3 0C15.7 9.7 15.4 9 12 9c-1.6 0-3 .4-3 .8z",
15044
- width: 24,
15045
- height: 24
15046
- };
15047
- const iconExclamationSign = {
15048
- path: "M58.368 81.225l0-12.369q0-.912-.57-1.539t-1.425-.627l-12.54 0q-.855-.057-1.482.627t-.684 1.539l0 12.369q-.057.855.627 1.482t1.539.684l12.54 0q.855 0 1.425-.627t.57-1.539zm1.026-62.871q0-1.596-2.223-1.71l-14.307 0q-2.109 0-2.223 1.71l1.14 40.47q0 .627.627 1.14t1.539.456l12.084 0q.912-.057 1.539-.513t.684-1.083zm-9.348-18.354q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.726 25.137-6.726 25.137-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669z",
15049
- width: 100,
15050
- height: 99.944
15051
- };
15052
- // Grabbed from https://github.com/encharm/Font-Awesome-SVG-PNG
15053
- const iconGear = {
15054
- path: "M1152 896q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm512-109v222q0 12-8 23t-20 13l-185 28q-19 54-39 91 35 50 107 138 10 12 10 25t-9 23q-27 37-99 108t-94 71q-12 0-26-9l-138-108q-44 23-91 38-16 136-29 186-7 28-36 28h-222q-14 0-24.5-8.5t-11.5-21.5l-28-184q-49-16-90-37l-141 107q-10 9-25 9-14 0-25-11-126-114-165-168-7-10-7-23 0-12 8-23 15-21 51-66.5t54-70.5q-27-50-41-99l-183-27q-13-2-21-12.5t-8-23.5v-222q0-12 8-23t19-13l186-28q14-46 39-92-40-57-107-138-10-12-10-24 0-10 9-23 26-36 98.5-107.5t94.5-71.5q13 0 26 10l138 107q44-23 91-38 16-136 29-186 7-28 36-28h222q14 0 24.5 8.5t11.5 21.5l28 184q49 16 90 37l142-107q9-9 24-9 13 0 25 10 129 119 165 170 7 8 7 22 0 12-8 23-15 21-51 66.5t-54 70.5q26 50 41 98l183 28q13 2 21 12.5t8 23.5z",
15055
- width: 1792,
15056
- height: 1792
15057
- };
15058
- const iconMobilePhone = {
15059
- path: "M36.04 89.557q0-2.584-1.836-4.42t-4.42-1.836-4.352 1.836q-1.836 1.836-1.836 4.42t1.836 4.352 4.42 1.836q2.652-.068 4.42-1.836t1.768-4.352zm16.184-12.444l0-54.74q0-1.088-.748-1.768t-1.768-.68l-39.78 0q-1.088 0-1.768.748t-.68 1.7l0 54.74q0 1.02.748 1.768t1.7.68l39.78 0q1.02-.068 1.768-.748t.748-1.7zm-14.892-65.892q0-1.224-1.292-1.292l-12.444 0q-1.224.068-1.224 1.292t1.224 1.224l12.444 0q1.292 0 1.292-1.224zm22.372-1.292l0 79.628q0 3.944-2.992 6.936t-7.004 2.992l-39.78 0q-4.012 0-7.004-2.924-2.924-2.924-2.924-7.004l0-79.628q0-4.012 2.924-6.936t7.004-2.992l39.78 0q4.012-.068 7.004 2.924t2.992 7.004z",
15060
- width: 60.013,
15061
- height: 100
15062
- };
15063
15017
  const iconOk = {
15064
15018
  path: "M37.964 76.048q-2.576 0-4.368-1.792l-31.864-31.864q-1.792-1.792-1.792-4.368t1.792-4.368l8.736-8.68q1.792-1.792 4.368-1.792t4.312 1.792l18.816 18.872 42-42.056q1.792-1.792 4.368-1.792t4.312 1.792l8.736 8.736q1.792 1.792 1.792 4.368t-1.792 4.312l-55.048 55.048q-1.792 1.792-4.368 1.792z",
15065
15019
  width: 100,
15066
15020
  height: 76.637
15067
15021
  };
15068
- const iconPlus = {
15069
- path: "M99.758 43.09l0 13.578q0 2.852-1.984 4.836t-4.836 1.984l-29.45 0l0 29.45q0 2.852-1.984 4.836t-4.836 1.984l-13.578 0q-2.852 0-4.836-1.984t-1.984-4.836l0-29.45l-29.45 0q-2.852 0-4.836-1.984t-1.984-4.836l0-13.578q0-2.852 1.984-4.836t4.836-1.984l29.45 0l0-29.45q0-2.852 1.984-4.836t4.836-1.984l13.578 0q2.852 0 4.836 1.984t1.984 4.836l0 29.45l29.45 0q2.852 0 4.836 1.984t1.984 4.836z",
15070
- width: 100,
15071
- height: 100
15072
- };
15073
15022
  const iconRemove = {
15074
15023
  path: "M100.464 80.808q0 3.404-2.368 5.772l-11.47 11.544q-2.368 2.368-5.772 2.368t-5.698-2.368l-24.864-24.864-24.864 24.864q-2.368 2.368-5.772 2.368t-5.772-2.368l-11.47-11.544q-2.368-2.368-2.368-5.772t2.368-5.698l24.864-24.864-24.864-24.864q-2.368-2.368-2.368-5.772t2.368-5.772l11.47-11.47q2.368-2.368 5.772-2.368t5.772 2.368l24.864 24.864 24.864-24.864q2.294-2.368 5.698-2.368t5.772 2.368l11.47 11.47q2.368 2.368 2.368 5.772t-2.368 5.772l-24.864 24.864 24.864 24.864q2.368 2.294 2.368 5.698z",
15075
15024
  width: 100,
@@ -15085,53 +15034,17 @@ const iconTryAgain = {
15085
15034
  width: 23,
15086
15035
  height: 23
15087
15036
  };
15088
- const iconTablet = {
15089
- path: "M45.322 90.706q0-1.86-1.302-3.224-1.364-1.364-3.224-1.364t-3.224 1.364-1.302 3.224q0 1.86 1.364 3.224 1.302 1.364 3.162 1.302 1.86.062 3.224-1.302t1.302-3.224zm27.218-11.346l0-68.014q0-.93-.682-1.612t-1.55-.682l-58.962 0q-.93 0-1.612.682t-.682 1.612l0 68.014q0 .93.682 1.612t1.612.62l58.962 0q.992-.062 1.612-.682t.62-1.55zm9.114-68.014l0 77.066q0 4.65-3.348 7.998t-7.998 3.348l-58.962 0q-4.65 0-7.998-3.348t-3.348-7.998l0-77.066q0-4.65 3.348-7.998t7.998-3.348l58.962 0q4.65 0 7.998 3.348t3.348 7.998z",
15090
- width: 81.852,
15091
- height: 100
15092
- };
15093
15037
  const iconTrash = {
15094
15038
  path: "M31.293 37.506q2.052 0 2.052 2.109l0 37.506q0 1.995-2.052 2.109l-4.218 0q-.912-.057-1.482-.627t-.57-1.482l0-37.506q0-2.109 2.052-2.109l4.218 0zm18.753 2.109l0 37.506q0 .912-.57 1.482t-1.539.627l-4.161 0q-1.995 0-2.109-2.109l0-37.506q.057-.912.627-1.482t1.482-.627l4.161 0q.969.057 1.539.627t.57 1.482zm14.592-2.109q2.052 0 2.052 2.109l0 37.506q0 1.995-2.052 2.109l-4.161 0q-.969-.057-1.539-.627t-.57-1.482l0-37.506q0-2.109 2.109-2.109l4.161 0zm10.431 49.248l0-61.731l-58.368 0l0 61.731q.057 2.679.969 3.819t1.083 1.14l54.207 0q.171 0 1.14-1.083t.969-3.876zm-43.776-70.11l29.184 0l-3.135-7.581q-.456-.57-1.14-.741l-20.634 0q-.627.114-1.083.741zm-31.293 2.109q0-1.995 2.109-2.109l20.121 0l4.56-10.83q.969-2.394 3.477-4.104 2.565-1.71 5.187-1.71l20.805 0q2.622 0 5.187 1.71t3.477 4.104l4.56 10.83l20.178 0q.912.057 1.482.627t.57 1.482l0 4.161q0 1.995-2.052 2.109l-6.27 0l0 61.731q0 5.415-3.078 9.348t-7.353 3.933l-54.207 0q-4.275 0-7.353-3.819t-3.078-9.177l0-62.016l-6.213 0q-.969 0-1.539-.57t-.57-1.539l0-4.161z",
15095
15039
  width: 91.681,
15096
15040
  height: 100
15097
15041
  };
15098
- const iconUndo = {
15099
- path: "M10,6.6C10,7.2,9.8,8,9.3,9.1c0,0,0,0.1-0.1,0.1S9.2,9.3,9.2,9.4c0,0,0,0.1-0.1,0.1C9,9.6,9,9.6,8.9,9.6 c-0.1,0-0.1,0-0.1-0.1c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1s0-0.1,0-0.1c0-0.3,0-0.5,0-0.7c0-0.4,0-0.7-0.1-1C8.6,7.1,8.5,6.9,8.4,6.7S8.2,6.3,8,6.1C7.8,5.9,7.6,5.8,7.4,5.7S6.9,5.5,6.7,5.5S6.1,5.4,5.8,5.4c-0.3,0-0.6,0-1,0H3.6v1.4c0,0.1,0,0.2-0.1,0.3C3.4,7.1,3.3,7.1,3.2,7.1C3.1,7.1,3,7.1,3,7L0.1,4.1C0,4.1,0,4,0,3.9s0-0.2,0.1-0.3L3,0.8C3,0.7,3.1,0.7,3.2,0.7c0.1,0,0.2,0,0.3,0.1C3.5,0.9,3.6,0.9,3.6,1v1.4h1.2c2.6,0,4.3,0.7,4.9,2.2C9.9,5.2,10,5.8,10,6.6z",
15100
- width: 10,
15101
- height: 10
15102
- };
15103
15042
  const iconMinus = {
15104
15043
  path: `M8,13 L16,13 C16.5522847,13 17,12.5522847 17,12 C17,11.4477153 16.5522847,11 16,11 L8,11 C7.44771525,11 7,11.4477153 7,12 C7,12.5522847 7.44771525,13 8,13 Z`,
15105
15044
  width: 24,
15106
15045
  height: 24
15107
15046
  };
15108
15047
 
15109
- var iconPaths = /*#__PURE__*/Object.freeze({
15110
- __proto__: null,
15111
- iconCheck: iconCheck,
15112
- iconCheckMedium: iconCheckMedium,
15113
- iconChevronDown: iconChevronDown,
15114
- iconChevronRight: iconChevronRight,
15115
- iconCircle: iconCircle,
15116
- iconCircleArrowDown: iconCircleArrowDown,
15117
- iconCircleArrowUp: iconCircleArrowUp,
15118
- iconCircleThin: iconCircleThin,
15119
- iconDesktop: iconDesktop,
15120
- iconDropdownArrow: iconDropdownArrow,
15121
- iconExclamationSign: iconExclamationSign,
15122
- iconGear: iconGear,
15123
- iconMobilePhone: iconMobilePhone,
15124
- iconOk: iconOk,
15125
- iconPlus: iconPlus,
15126
- iconRemove: iconRemove,
15127
- iconStar: iconStar,
15128
- iconTryAgain: iconTryAgain,
15129
- iconTablet: iconTablet,
15130
- iconTrash: iconTrash,
15131
- iconUndo: iconUndo,
15132
- iconMinus: iconMinus
15133
- });
15134
-
15135
15048
  /* eslint-disable @babel/no-invalid-this */
15136
15049
  const add$1 = {
15137
15050
  constrain: function () {
@@ -18400,7 +18313,7 @@ const styles$C = aphrodite.StyleSheet.create({
18400
18313
  },
18401
18314
  ":hover ~ div span[data-lint-inside-table]": {
18402
18315
  backgroundColor: warningColor,
18403
- color: white$1
18316
+ color: white
18404
18317
  }
18405
18318
  },
18406
18319
  // This is how we position the hover target for inline lint.
@@ -18436,7 +18349,7 @@ const styles$C = aphrodite.StyleSheet.create({
18436
18349
  // draw attention to the linty content.
18437
18350
  ":hover ~ span": {
18438
18351
  backgroundColor: warningColor,
18439
- color: white$1
18352
+ color: white
18440
18353
  }
18441
18354
  },
18442
18355
  radioWidgetHoverTarget: {
@@ -18478,7 +18391,7 @@ const styles$C = aphrodite.StyleSheet.create({
18478
18391
  // draw attention to the linty content.
18479
18392
  ":hover ~ span": {
18480
18393
  backgroundColor: warningColor,
18481
- color: white$1
18394
+ color: white
18482
18395
  }
18483
18396
  },
18484
18397
  // This is the class for the lint indicator in the margin.
@@ -18515,10 +18428,10 @@ const styles$C = aphrodite.StyleSheet.create({
18515
18428
  // When it is displayed, it goes on top!
18516
18429
  zIndex: 1000,
18517
18430
  // These styles control what the tooltip looks like
18518
- color: white$1,
18431
+ color: white,
18519
18432
  backgroundColor: gray17,
18520
18433
  opacity: 0.9,
18521
- fontFamily: baseFontFamily$1,
18434
+ fontFamily: baseFontFamily,
18522
18435
  fontSize: "12px",
18523
18436
  lineHeight: "15px",
18524
18437
  width: "320px",
@@ -19536,7 +19449,7 @@ var preprocessTex = (texCode => texCode
19536
19449
 
19537
19450
  const {
19538
19451
  interactiveSizes
19539
- } = constants$1;
19452
+ } = constants;
19540
19453
 
19541
19454
  // Note: these size cutoffs represent content-width cutoffs as specified in
19542
19455
  // http://zpl.io/1mVmvU (broken link - we no longer use Zeplin)
@@ -19569,13 +19482,6 @@ const getInteractiveBoxFromSizeClass = sizeClass => {
19569
19482
  return [interactiveSizes.defaultBoxSize, interactiveSizes.defaultBoxSize];
19570
19483
  };
19571
19484
 
19572
- var sizingUtils = /*#__PURE__*/Object.freeze({
19573
- __proto__: null,
19574
- containerSizeClass: containerSizeClass,
19575
- getClassFromWidth: getClassFromWidth,
19576
- getInteractiveBoxFromSizeClass: getInteractiveBoxFromSizeClass
19577
- });
19578
-
19579
19485
  class WidgetContainer extends React__namespace.Component {
19580
19486
  widgetRef = /*#__PURE__*/React__namespace.createRef();
19581
19487
  static defaultProps = {
@@ -21260,7 +21166,14 @@ const Triangle = props => {
21260
21166
  }
21261
21167
  });
21262
21168
  };
21263
- const TooltipArrow = props => {
21169
+ const TooltipArrow = _ref => {
21170
+ let {
21171
+ position = "relative",
21172
+ visibility = "visible",
21173
+ left = 100,
21174
+ top = 0,
21175
+ ...props
21176
+ } = _ref;
21264
21177
  // TODO(aria): Think about adding a box-shadow to the triangle here
21265
21178
  // See http://css-tricks.com/triangle-with-shadow/
21266
21179
 
@@ -21271,10 +21184,10 @@ const TooltipArrow = props => {
21271
21184
  return /*#__PURE__*/React__namespace.createElement("div", {
21272
21185
  style: {
21273
21186
  display: "block",
21274
- position: props.position,
21275
- visibility: props.visibility,
21276
- left: props.left,
21277
- top: props["top"],
21187
+ position: position,
21188
+ visibility: visibility,
21189
+ left: left,
21190
+ top: top,
21278
21191
  width: props.width + 2,
21279
21192
  height: props.height + 1,
21280
21193
  marginTop: -1,
@@ -21300,12 +21213,6 @@ const TooltipArrow = props => {
21300
21213
  height: props.height
21301
21214
  }));
21302
21215
  };
21303
- TooltipArrow.defaultProps = {
21304
- position: "relative",
21305
- visibility: "visible",
21306
- left: 0,
21307
- top: 0
21308
- };
21309
21216
  const VERTICAL_CORNERS = {
21310
21217
  top: {
21311
21218
  top: "-100%"
@@ -22176,48 +22083,35 @@ function numericInputValidator(userInput, rubric, strings) {
22176
22083
  // We may have received TeX; try to parse it before grading.
22177
22084
  // If `currentValue` is not TeX, this should be a no-op.
22178
22085
  const currentValue = ParseTex(userInput.currentValue);
22179
- const correctAnswers = rubric.answers.filter(answer => answer.status === "correct");
22180
- const normalizedAnswerExpected = correctAnswers.every(answer => Math.abs(answer.value) <= 1);
22181
-
22182
- // Look through all correct answers for one that matches either
22183
- // precisely or approximately and return the appropriate message:
22184
- // - if precise, return the message that the answer came with
22185
- // - if it needs to be simplified, etc., show that message
22186
- let result = correctAnswers.map(answer => {
22187
- // The coefficient is an attribute of the widget
22188
- let localValue = currentValue;
22189
- if (rubric.coefficient) {
22190
- if (!localValue) {
22191
- localValue = 1;
22192
- } else if (localValue === "-") {
22193
- localValue = -1;
22194
- }
22195
- }
22196
- const validate = createValidator(answer);
22197
- return validate(maybeParsePercentInput(localValue, normalizedAnswerExpected));
22198
- }).find(match => match.correct || match.empty);
22199
- if (!result) {
22200
- // Otherwise, if the guess is not correct
22201
- const otherAnswers = [].concat(
22202
- // @ts-expect-error - TS2769 - No overload matches this call.
22203
- rubric.answers.filter(answer => answer.status === "ungraded"), rubric.answers.filter(answer => answer.status === "wrong"));
22086
+ const normalizedAnswerExpected = rubric.answers.filter(answer => answer.status === "correct").every(answer => Math.abs(answer.value) <= 1);
22204
22087
 
22205
- // Look through all other answers and if one matches either
22206
- // precisely or approximately return the answer's message
22207
- const match = otherAnswers.find(answer => {
22208
- const validate = createValidator(answer);
22209
- return validate(maybeParsePercentInput(currentValue, normalizedAnswerExpected)).correct;
22210
- });
22211
- result = {
22212
- // @ts-expect-error - TS2339 - Property 'status' does not exist on type 'never'.
22213
- empty: match ? match.status === "ungraded" : false,
22214
- // @ts-expect-error - TS2339 - Property 'status' does not exist on type 'never'.
22215
- correct: match ? match.status === "correct" : false,
22216
- // @ts-expect-error - TS2339 - Property 'message' does not exist on type 'never'.
22217
- message: match ? match.message : null,
22218
- guess: currentValue
22219
- };
22088
+ // The coefficient is an attribute of the widget
22089
+ let localValue = currentValue;
22090
+ if (rubric.coefficient) {
22091
+ if (!localValue) {
22092
+ localValue = 1;
22093
+ } else if (localValue === "-") {
22094
+ localValue = -1;
22095
+ }
22220
22096
  }
22097
+ const matchedAnswer = rubric.answers.map(answer => {
22098
+ const validateFn = createValidator(answer);
22099
+ const score = validateFn(maybeParsePercentInput(localValue, normalizedAnswerExpected));
22100
+ return {
22101
+ ...answer,
22102
+ score
22103
+ };
22104
+ }).find(answer => {
22105
+ // NOTE: "answer.score.correct" indicates a match via the validate function.
22106
+ // It does NOT indicate that the answer itself is correct.
22107
+ return answer.score.correct || answer.status === "correct" && answer.score.empty;
22108
+ });
22109
+ const result = matchedAnswer?.status === "correct" ? matchedAnswer.score : {
22110
+ empty: matchedAnswer?.status === "ungraded",
22111
+ correct: matchedAnswer?.status === "correct",
22112
+ message: matchedAnswer?.message ?? null,
22113
+ guess: localValue
22114
+ };
22221
22115
 
22222
22116
  // TODO(eater): Seems silly to translate result to this
22223
22117
  // invalid/points thing and immediately translate it
@@ -24806,29 +24700,29 @@ var PassageRef$1 = {
24806
24700
  * });
24807
24701
  */
24808
24702
  const {
24809
- pureXsMax: pureXsMax$1,
24810
- pureSmMin: pureSmMin$1,
24811
- pureSmMax: pureSmMax$1,
24812
- pureMdMin: pureMdMin$1,
24813
- pureMdMax: pureMdMax$1,
24814
- pureLgMin: pureLgMin$1,
24815
- pureLgMax: pureLgMax$1,
24816
- pureXlMin: pureXlMin$1
24817
- } = constants$1;
24703
+ pureXsMax,
24704
+ pureSmMin,
24705
+ pureSmMax,
24706
+ pureMdMin,
24707
+ pureMdMax,
24708
+ pureLgMin,
24709
+ pureLgMax,
24710
+ pureXlMin
24711
+ } = constants;
24818
24712
  var mediaQueries = {
24819
- xs: `@media screen and (max-width: ${pureXsMax$1})`,
24820
- sm: `@media screen and (min-width: ${pureSmMin$1}) and ` + `(max-width: ${pureSmMax$1})`,
24821
- md: `@media screen and (min-width: ${pureMdMin$1}) and ` + `(max-width: ${pureMdMax$1})`,
24822
- lg: `@media screen and (min-width: ${pureLgMin$1}) and ` + `(max-width: ${pureLgMax$1})`,
24823
- xl: `@media screen and (min-width: ${pureXlMin$1})`,
24824
- xsOrSmaller: `@media screen and (max-width: ${pureXsMax$1})`,
24825
- smOrSmaller: `@media screen and (max-width: ${pureSmMax$1})`,
24826
- mdOrSmaller: `@media screen and (max-width: ${pureMdMax$1})`,
24827
- lgOrSmaller: `@media screen and (max-width: ${pureLgMax$1})`,
24828
- smOrLarger: `@media screen and (min-width: ${pureSmMin$1})`,
24829
- mdOrLarger: `@media screen and (min-width: ${pureMdMin$1})`,
24830
- lgOrLarger: `@media screen and (min-width: ${pureLgMin$1})`,
24831
- xlOrLarger: `@media screen and (min-width: ${pureXlMin$1})`
24713
+ xs: `@media screen and (max-width: ${pureXsMax})`,
24714
+ sm: `@media screen and (min-width: ${pureSmMin}) and ` + `(max-width: ${pureSmMax})`,
24715
+ md: `@media screen and (min-width: ${pureMdMin}) and ` + `(max-width: ${pureMdMax})`,
24716
+ lg: `@media screen and (min-width: ${pureLgMin}) and ` + `(max-width: ${pureLgMax})`,
24717
+ xl: `@media screen and (min-width: ${pureXlMin})`,
24718
+ xsOrSmaller: `@media screen and (max-width: ${pureXsMax})`,
24719
+ smOrSmaller: `@media screen and (max-width: ${pureSmMax})`,
24720
+ mdOrSmaller: `@media screen and (max-width: ${pureMdMax})`,
24721
+ lgOrSmaller: `@media screen and (max-width: ${pureLgMax})`,
24722
+ smOrLarger: `@media screen and (min-width: ${pureSmMin})`,
24723
+ mdOrLarger: `@media screen and (min-width: ${pureMdMin})`,
24724
+ lgOrLarger: `@media screen and (min-width: ${pureLgMin})`,
24725
+ xlOrLarger: `@media screen and (min-width: ${pureXlMin})`
24832
24726
  };
24833
24727
 
24834
24728
  const {
@@ -24838,7 +24732,7 @@ const {
24838
24732
  checkedColor,
24839
24733
  circleSize,
24840
24734
  radioMarginWidth
24841
- } = constants$1;
24735
+ } = constants;
24842
24736
  var sharedStyles = aphrodite.StyleSheet.create({
24843
24737
  perseusInteractive: {
24844
24738
  zIndex: zIndexInteractiveComponent,
@@ -25191,13 +25085,13 @@ function getA11yText(letter, checked, correct, crossedOut, showCorrectness, stri
25191
25085
  /**
25192
25086
  * Renders a circular selection ring around the child.
25193
25087
  */
25194
- const FocusRing = function (props) {
25195
- const {
25196
- visible,
25197
- color,
25198
- children,
25199
- multipleSelect
25200
- } = props;
25088
+ const FocusRing = function (_ref) {
25089
+ let {
25090
+ visible = true,
25091
+ color = kaGreen,
25092
+ multipleSelect = false,
25093
+ children
25094
+ } = _ref;
25201
25095
  const borderColor = visible ? color : "transparent";
25202
25096
  const borderRadius = multipleSelect ? 5 : "50%";
25203
25097
  const style = {
@@ -25210,11 +25104,6 @@ const FocusRing = function (props) {
25210
25104
  style: style
25211
25105
  }, children);
25212
25106
  };
25213
- FocusRing.defaultProps = {
25214
- visible: true,
25215
- color: kaGreen$1,
25216
- multipleSelect: false
25217
- };
25218
25107
  const styles$v = aphrodite.StyleSheet.create({
25219
25108
  ring: {
25220
25109
  margin: "auto",
@@ -25327,7 +25216,7 @@ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, cor
25327
25216
  backgroundColor = "transparent";
25328
25217
  } else if (checked) {
25329
25218
  const bg = showCorrectness && correct ? wonderBlocksTokens.color.green : wonderBlocksTokens.color.blue;
25330
- color = white$1;
25219
+ color = white;
25331
25220
  backgroundColor = bg;
25332
25221
  borderColor = bg;
25333
25222
  } else {
@@ -25405,7 +25294,7 @@ const styles$s = aphrodite.StyleSheet.create({
25405
25294
  borderStyle: "solid",
25406
25295
  borderWidth: 2,
25407
25296
  // The default icons have letters in them. Style those letters.
25408
- fontFamily: baseFontFamily$1,
25297
+ fontFamily: baseFontFamily,
25409
25298
  // NOTE(emily): We explicitly set the font weight instead of using the
25410
25299
  // "bold font family" so that characters which fall back to the default
25411
25300
  // font get bolded too.
@@ -25753,13 +25642,13 @@ var Choice$1 = /*#__PURE__*/React__namespace.forwardRef((props, ref) => /*#__PUR
25753
25642
  forwardedRef: ref
25754
25643
  })));
25755
25644
 
25756
- const ChoiceNoneAbove = function (props) {
25757
- const {
25758
- showContent,
25645
+ const ChoiceNoneAbove = function (_ref) {
25646
+ let {
25759
25647
  content,
25760
25648
  forwardedRef,
25649
+ showContent = true,
25761
25650
  ...rest
25762
- } = props;
25651
+ } = _ref;
25763
25652
  const {
25764
25653
  strings
25765
25654
  } = usePerseusI18n();
@@ -25787,9 +25676,6 @@ const ChoiceNoneAbove = function (props) {
25787
25676
  ref: forwardedRef
25788
25677
  }));
25789
25678
  };
25790
- ChoiceNoneAbove.defaultProps = {
25791
- showContent: true
25792
- };
25793
25679
  var ChoiceNoneAbove$1 = /*#__PURE__*/React__namespace.forwardRef((props, ref) => /*#__PURE__*/React__namespace.createElement(ChoiceNoneAbove, _extends({}, props, {
25794
25680
  forwardedRef: ref
25795
25681
  })));
@@ -25811,20 +25697,21 @@ function getInstructionsText(multipleSelect, countChoices, numCorrect, strings)
25811
25697
  }
25812
25698
  return strings.chooseOneAnswer;
25813
25699
  }
25814
- const BaseRadio = function (props) {
25815
- const {
25700
+ const BaseRadio = function (_ref) {
25701
+ let {
25816
25702
  apiOptions,
25817
25703
  reviewModeRubric,
25818
25704
  reviewMode,
25819
25705
  choices,
25820
- editMode,
25821
- multipleSelect,
25706
+ editMode = false,
25707
+ multipleSelect = false,
25822
25708
  labelWrap,
25823
25709
  countChoices,
25824
25710
  numCorrect,
25825
25711
  isLastUsedWidget,
25712
+ onChange,
25826
25713
  registerFocusFunction
25827
- } = props;
25714
+ } = _ref;
25828
25715
  const {
25829
25716
  strings
25830
25717
  } = usePerseusI18n();
@@ -25881,12 +25768,6 @@ const BaseRadio = function (props) {
25881
25768
  // contains a boolean value specifying the new checked and crossed-out
25882
25769
  // value of this choice.
25883
25770
  function updateChoice(choiceIndex, newValues) {
25884
- const {
25885
- multipleSelect,
25886
- choices,
25887
- onChange
25888
- } = props;
25889
-
25890
25771
  // Get the baseline `checked` values. If we're checking a new answer
25891
25772
  // and multiple-select is not on, we should clear all choices to be
25892
25773
  // unchecked. Otherwise, we should copy the old checked values.
@@ -26053,10 +25934,6 @@ const BaseRadio = function (props) {
26053
25934
  className: aphrodite.css(styles$p.responsiveContainer)
26054
25935
  }, fieldset);
26055
25936
  };
26056
- BaseRadio.defaultProps = {
26057
- editMode: false,
26058
- multipleSelect: false
26059
- };
26060
25937
  const styles$p = aphrodite.StyleSheet.create({
26061
25938
  instructions: {
26062
25939
  display: "block",
@@ -26155,7 +26032,7 @@ function radioValidator(userInput, rubric, strings) {
26155
26032
  };
26156
26033
  }
26157
26034
 
26158
- // TODO: should numCorrect actually be on the rubric
26035
+ // TODO(LEMS-2541): should numCorrect actually be on the rubric
26159
26036
  // instead of the userInput?
26160
26037
  if (userInput.numCorrect && userInput.numCorrect > 1 && numSelected !== userInput.numCorrect) {
26161
26038
  return {
@@ -26165,7 +26042,7 @@ function radioValidator(userInput, rubric, strings) {
26165
26042
  // If NOTA and some other answer are checked, ...
26166
26043
  }
26167
26044
 
26168
- // TODO: should noneOfTheAboveSelected be replaced with a
26045
+ // TODO(LEMS-2541): should noneOfTheAboveSelected be replaced with a
26169
26046
  // combination of choicesSelected and noneOfTheAboveIndex?
26170
26047
  if (userInput.noneOfTheAboveSelected && numSelected > 1) {
26171
26048
  return {
@@ -26175,7 +26052,7 @@ function radioValidator(userInput, rubric, strings) {
26175
26052
  }
26176
26053
  const correct = userInput.choicesSelected.every((selected, i) => {
26177
26054
  let isCorrect;
26178
- // TODO: should noneOfTheAboveIndex actually be on the rubric
26055
+ // TODO(LEMS-2541): should noneOfTheAboveIndex actually be on the rubric
26179
26056
  // instead of the userInput?
26180
26057
  if (userInput.noneOfTheAboveIndex === i) {
26181
26058
  isCorrect = rubric.choices.every((choice, j) => {
@@ -26217,7 +26094,6 @@ class Radio$1 extends React__namespace.Component {
26217
26094
  let noneOfTheAboveSelected = false;
26218
26095
  const choiceStates = props.choiceStates;
26219
26096
  const choicesSelected = choiceStates.map(() => false);
26220
- const countChoices = props.countChoices;
26221
26097
  const numCorrect = props.numCorrect;
26222
26098
  for (let i = 0; i < choicesSelected.length; i++) {
26223
26099
  const index = props.choices[i].originalIndex;
@@ -26231,7 +26107,6 @@ class Radio$1 extends React__namespace.Component {
26231
26107
  }
26232
26108
  }
26233
26109
  return {
26234
- countChoices,
26235
26110
  choicesSelected,
26236
26111
  numCorrect,
26237
26112
  noneOfTheAboveIndex,
@@ -26247,7 +26122,6 @@ class Radio$1 extends React__namespace.Component {
26247
26122
  let noneOfTheAboveIndex = null;
26248
26123
  let noneOfTheAboveSelected = false;
26249
26124
  const choicesSelected = [...values];
26250
- const countChoices = props.countChoices;
26251
26125
  const numCorrect = props.numCorrect;
26252
26126
  const valuesLength = values.length;
26253
26127
  for (let i = 0; i < valuesLength; i++) {
@@ -26265,7 +26139,6 @@ class Radio$1 extends React__namespace.Component {
26265
26139
  choicesSelected,
26266
26140
  noneOfTheAboveIndex,
26267
26141
  noneOfTheAboveSelected,
26268
- countChoices,
26269
26142
  numCorrect
26270
26143
  };
26271
26144
  }
@@ -27837,7 +27710,7 @@ const styles$j = aphrodite.StyleSheet.create({
27837
27710
  gradedGroup: {
27838
27711
  borderTop: `1px solid ${gray76}`,
27839
27712
  borderBottom: `1px solid ${gray76}`,
27840
- backgroundColor: tableBackgroundAccent$1,
27713
+ backgroundColor: tableBackgroundAccent,
27841
27714
  marginLeft: negativePhoneMargin,
27842
27715
  marginRight: negativePhoneMargin,
27843
27716
  paddingBottom: phoneMargin,
@@ -28126,7 +27999,7 @@ const styles$i = aphrodite.StyleSheet.create({
28126
27999
  container: {
28127
28000
  borderTop: `1px solid ${gray76}`,
28128
28001
  borderBottom: `1px solid ${gray76}`,
28129
- backgroundColor: tableBackgroundAccent$1,
28002
+ backgroundColor: tableBackgroundAccent,
28130
28003
  marginLeft: negativePhoneMargin,
28131
28004
  marginRight: negativePhoneMargin,
28132
28005
  paddingBottom: phoneMargin,
@@ -28731,21 +28604,6 @@ const typeToButton = type => {
28731
28604
  };
28732
28605
  };
28733
28606
 
28734
- var util = /*#__PURE__*/Object.freeze({
28735
- __proto__: null,
28736
- DEFAULT_BACKGROUND_IMAGE: DEFAULT_BACKGROUND_IMAGE,
28737
- allTypes: allTypes,
28738
- functionForType: functionForType,
28739
- getEquationString: getEquationString,
28740
- pointsFromNormalized: pointsFromNormalized,
28741
- maybePointsFromNormalized: maybePointsFromNormalized,
28742
- defaultPlotProps: defaultPlotProps,
28743
- chooseType: chooseType,
28744
- getGridAndSnapSteps: getGridAndSnapSteps,
28745
- DEFAULT_GRAPHER_PROPS: DEFAULT_GRAPHER_PROPS,
28746
- typeToButton: typeToButton
28747
- });
28748
-
28749
28607
  function getCoefficientsByType(data) {
28750
28608
  if (data.type === "exponential" || data.type === "logarithm") {
28751
28609
  const grader = functionForType(data.type);
@@ -29349,23 +29207,23 @@ var Group$1 = {
29349
29207
  isLintable: true
29350
29208
  };
29351
29209
 
29352
- function iframeValidator(state) {
29210
+ function iframeValidator(userInput) {
29353
29211
  // The iframe can tell us whether it's correct or incorrect,
29354
29212
  // and pass an optional message
29355
- if (state.status === "correct") {
29213
+ if (userInput.status === "correct") {
29356
29214
  return {
29357
29215
  type: "points",
29358
29216
  earned: 1,
29359
29217
  total: 1,
29360
- message: state.message || null
29218
+ message: userInput.message || null
29361
29219
  };
29362
29220
  }
29363
- if (state.status === "incorrect") {
29221
+ if (userInput.status === "incorrect") {
29364
29222
  return {
29365
29223
  type: "points",
29366
29224
  earned: 0,
29367
29225
  total: 1,
29368
- message: state.message || null
29226
+ message: userInput.message || null
29369
29227
  };
29370
29228
  }
29371
29229
  return {
@@ -31347,7 +31205,7 @@ const styles$g = aphrodite.StyleSheet.create({
31347
31205
  fontFamily: boldFontFamily,
31348
31206
  fontSize: "15px",
31349
31207
  lineHeight: "18px",
31350
- color: white$1,
31208
+ color: white,
31351
31209
  userSelect: "none",
31352
31210
  borderWidth: 0 // <button> gives us a border by default
31353
31211
  },
@@ -32421,7 +32279,12 @@ const actions = {
32421
32279
  },
32422
32280
  polygon: {
32423
32281
  movePoint,
32424
- moveAll
32282
+ moveAll,
32283
+ addPoint,
32284
+ removePoint,
32285
+ focusPoint,
32286
+ blurPoint,
32287
+ clickPoint
32425
32288
  },
32426
32289
  quadratic: {
32427
32290
  movePoint
@@ -32565,6 +32428,7 @@ function reinitialize(params) {
32565
32428
  * https://www.w3.org/WAI/WCAG21/Understanding/target-size.html
32566
32429
  */
32567
32430
  const TARGET_SIZE = 44;
32431
+ const REMOVE_BUTTON_ID = "perseus_mafs_remove_button";
32568
32432
 
32569
32433
  // same as pointsFromNormalized in interactive-graph.tsx
32570
32434
  const normalizePoints = (range, step, coordsList, noSnap) => coordsList.map(coords =>
@@ -32596,6 +32460,9 @@ function bound$1(_ref) {
32596
32460
  const boundingBox = inset(snapStep, range);
32597
32461
  return clampToBox(boundingBox, point);
32598
32462
  }
32463
+ function isUnlimitedGraphState(state) {
32464
+ return state.type === "point" && state.numPoints === "unlimited" || state.type === "polygon" && state.numSides === "unlimited";
32465
+ }
32599
32466
 
32600
32467
  var isProduction = process.env.NODE_ENV === 'production';
32601
32468
  var prefix = 'Invariant failed';
@@ -32770,25 +32637,18 @@ const hitboxSizePx = 48;
32770
32637
  // MovablePointView is a purely presentational component (i.e. it is a pure
32771
32638
  // function with no state or effects) that renders the SVG for a movable point
32772
32639
  // on an interactive graph.
32773
- //
32774
- // It has two modes for managing tabbing / focus: "controlled" (where the caller
32775
- // manages the display of the focus ring, and the point itself cannot be
32776
- // focused) and "uncontrolled" (where the point is focusable, and the browser
32777
- // manages the focus state and styling). For context on why we did this, see
32778
- // the description of https://github.com/Khan/perseus/pull/1240
32779
32640
  const MovablePointView = /*#__PURE__*/React.forwardRef((props, hitboxRef) => {
32780
32641
  const {
32781
32642
  range,
32782
32643
  markings,
32783
- showTooltips,
32784
- disableKeyboardInteraction
32644
+ showTooltips
32785
32645
  } = useGraphConfig();
32786
32646
  const {
32787
32647
  point,
32788
32648
  color = wonderBlocksTokens.color.blue,
32789
32649
  dragging,
32790
- focusBehavior,
32791
32650
  cursor,
32651
+ showFocusRing,
32792
32652
  onClick = () => {}
32793
32653
  } = props;
32794
32654
 
@@ -32798,7 +32658,7 @@ const MovablePointView = /*#__PURE__*/React.forwardRef((props, hitboxRef) => {
32798
32658
  let [_, value] = _ref;
32799
32659
  return value === color;
32800
32660
  })?.[0] ?? "blue";
32801
- const pointClasses = `movable-point ${dragging ? "movable-point--dragging" : ""} ${focusClass(focusBehavior)}`;
32661
+ const pointClasses = classNames("movable-point", dragging && "movable-point--dragging", showFocusRing && "movable-point--focus");
32802
32662
  const [[x, y]] = useTransformVectorsToPixels(point);
32803
32663
  const [[xMin, xMax], [yMin, yMax]] = range;
32804
32664
  const [[verticalStartX]] = useTransformVectorsToPixels([xMin, 0]);
@@ -32827,15 +32687,6 @@ const MovablePointView = /*#__PURE__*/React.forwardRef((props, hitboxRef) => {
32827
32687
  cursor
32828
32688
  },
32829
32689
  "data-testid": "movable-point",
32830
- tabIndex: disableKeyboardInteraction ? -1 : tabIndex(focusBehavior),
32831
- onFocus: event => {
32832
- const callback = getOnFocusChangeCallback(focusBehavior);
32833
- callback && callback(event, true);
32834
- },
32835
- onBlur: event => {
32836
- const callback = getOnFocusChangeCallback(focusBehavior);
32837
- callback && callback(event, false);
32838
- },
32839
32690
  onClick: onClick
32840
32691
  }, /*#__PURE__*/React__namespace.createElement("circle", {
32841
32692
  className: "movable-point-hitbox",
@@ -32872,25 +32723,102 @@ const MovablePointView = /*#__PURE__*/React.forwardRef((props, hitboxRef) => {
32872
32723
  }
32873
32724
  }, svgForPoint) : svgForPoint);
32874
32725
  });
32875
- function focusClass(config) {
32876
- if (config.type === "controlled" && config.showFocusRing) {
32877
- return "movable-point--focus";
32726
+
32727
+ // TODO(benchristel): Move this to a more central location if it's reused.
32728
+ // Or install the library.
32729
+ function classNames() {
32730
+ for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) {
32731
+ names[_key] = arguments[_key];
32878
32732
  }
32879
- return "";
32733
+ return names.filter(Boolean).join(" ");
32880
32734
  }
32881
- function tabIndex(config) {
32882
- if (config.type === "uncontrolled") {
32883
- return config.tabIndex;
32884
- }
32885
- return undefined;
32735
+
32736
+ function useControlPoint(params) {
32737
+ const {
32738
+ snapStep,
32739
+ disableKeyboardInteraction
32740
+ } = useGraphConfig();
32741
+ const {
32742
+ point,
32743
+ color,
32744
+ cursor,
32745
+ constrain = p => snap(snapStep, p),
32746
+ onMove = noop$1,
32747
+ onClick = noop$1,
32748
+ onFocus = noop$1,
32749
+ onBlur = noop$1,
32750
+ forwardedRef = noop$1
32751
+ } = params;
32752
+ const [focused, setFocused] = React.useState(false);
32753
+ const focusableHandleRef = React.useRef(null);
32754
+ useDraggable({
32755
+ gestureTarget: focusableHandleRef,
32756
+ point,
32757
+ onMove,
32758
+ constrainKeyboardMovement: constrain
32759
+ });
32760
+ const visiblePointRef = React.useRef(null);
32761
+ const {
32762
+ dragging
32763
+ } = useDraggable({
32764
+ gestureTarget: visiblePointRef,
32765
+ point,
32766
+ onMove,
32767
+ constrainKeyboardMovement: constrain
32768
+ });
32769
+ React.useLayoutEffect(() => {
32770
+ setForwardedRef(forwardedRef, focusableHandleRef.current);
32771
+ }, [forwardedRef]);
32772
+ const focusableHandle = /*#__PURE__*/React__namespace.createElement("g", {
32773
+ "data-testid": "movable-point__focusable-handle",
32774
+ className: "movable-point__focusable-handle",
32775
+ tabIndex: disableKeyboardInteraction ? -1 : 0,
32776
+ ref: focusableHandleRef,
32777
+ onFocus: event => {
32778
+ onFocus(event);
32779
+ setFocused(true);
32780
+ },
32781
+ onBlur: event => {
32782
+ onBlur(event);
32783
+ setFocused(false);
32784
+ }
32785
+ });
32786
+ const visiblePoint = /*#__PURE__*/React__namespace.createElement(MovablePointView, {
32787
+ cursor: cursor,
32788
+ onClick: () => {
32789
+ onClick();
32790
+ focusableHandleRef.current?.focus();
32791
+ },
32792
+ point: point,
32793
+ dragging: dragging,
32794
+ color: color,
32795
+ ref: visiblePointRef,
32796
+ showFocusRing: focused
32797
+ });
32798
+ return {
32799
+ focusableHandle,
32800
+ visiblePoint,
32801
+ focusableHandleRef,
32802
+ visiblePointRef
32803
+ };
32886
32804
  }
32887
- function getOnFocusChangeCallback(config) {
32888
- if (config.type === "uncontrolled") {
32889
- return config.onFocusChange;
32805
+
32806
+ // TODO(benchristel): move this to a more central place if we want to reuse it.
32807
+ function setForwardedRef(ref, value) {
32808
+ if (typeof ref === "function") {
32809
+ ref(value);
32810
+ } else if (ref !== null) {
32811
+ ref.current = value;
32890
32812
  }
32891
- return () => {};
32892
32813
  }
32893
32814
 
32815
+ // This `noop` const is an optimization. Above, we use the forwardedRef
32816
+ // variable, which defaults to `noop`, in a useEffect deps array. Using `noop`
32817
+ // as the default value instead of `() => {}` ensures that the forwardedRef
32818
+ // variable will have the same value on repeated renders, preventing the
32819
+ // useEffect callback from re-running needlessly.
32820
+ const noop$1 = () => {};
32821
+
32894
32822
  const MovableLine = props => {
32895
32823
  const {
32896
32824
  onMoveLine = () => {},
@@ -32914,11 +32842,19 @@ const MovableLine = props => {
32914
32842
  const {
32915
32843
  visiblePoint: visiblePoint1,
32916
32844
  focusableHandle: focusableHandle1
32917
- } = useControlPoint(start, color, p => onMovePoint(0, p));
32845
+ } = useControlPoint({
32846
+ point: start,
32847
+ color,
32848
+ onMove: p => onMovePoint(0, p)
32849
+ });
32918
32850
  const {
32919
32851
  visiblePoint: visiblePoint2,
32920
32852
  focusableHandle: focusableHandle2
32921
- } = useControlPoint(end, color, p => onMovePoint(1, p));
32853
+ } = useControlPoint({
32854
+ point: end,
32855
+ color,
32856
+ onMove: p => onMovePoint(1, p)
32857
+ });
32922
32858
  const line = /*#__PURE__*/React__namespace.createElement(Line$1, {
32923
32859
  start: start,
32924
32860
  end: end,
@@ -32928,51 +32864,6 @@ const MovableLine = props => {
32928
32864
  });
32929
32865
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, focusableHandle1, line, focusableHandle2, visiblePoint1, visiblePoint2);
32930
32866
  };
32931
- function useControlPoint(point, color, onMovePoint) {
32932
- const {
32933
- snapStep,
32934
- disableKeyboardInteraction
32935
- } = useGraphConfig();
32936
- const [focused, setFocused] = React.useState(false);
32937
- const keyboardHandleRef = React.useRef(null);
32938
- useDraggable({
32939
- gestureTarget: keyboardHandleRef,
32940
- point,
32941
- onMove: onMovePoint,
32942
- constrainKeyboardMovement: p => snap(snapStep, p)
32943
- });
32944
- const visiblePointRef = React.useRef(null);
32945
- const {
32946
- dragging
32947
- } = useDraggable({
32948
- gestureTarget: visiblePointRef,
32949
- point,
32950
- onMove: onMovePoint,
32951
- constrainKeyboardMovement: p => snap(snapStep, p)
32952
- });
32953
- const focusableHandle = /*#__PURE__*/React__namespace.createElement("g", {
32954
- "data-testid": "movable-point__focusable-handle",
32955
- className: "movable-point__focusable-handle",
32956
- tabIndex: disableKeyboardInteraction ? -1 : 0,
32957
- ref: keyboardHandleRef,
32958
- onFocus: () => setFocused(true),
32959
- onBlur: () => setFocused(false)
32960
- });
32961
- const visiblePoint = /*#__PURE__*/React__namespace.createElement(MovablePointView, {
32962
- point: point,
32963
- dragging: dragging,
32964
- color: color,
32965
- ref: visiblePointRef,
32966
- focusBehavior: {
32967
- type: "controlled",
32968
- showFocusRing: focused
32969
- }
32970
- });
32971
- return {
32972
- focusableHandle,
32973
- visiblePoint
32974
- };
32975
- }
32976
32867
  const defaultStroke = "var(--movable-line-stroke-color)";
32977
32868
  const Line$1 = props => {
32978
32869
  const {
@@ -33482,59 +33373,16 @@ function calculateBisectorPoint(point1, point2, vertex, isReflex, allowReflex, a
33482
33373
 
33483
33374
  const MovablePoint$1 = /*#__PURE__*/React__namespace.forwardRef((props, pointRef) => {
33484
33375
  const {
33485
- snapStep
33486
- } = useGraphConfig();
33487
- const elementRef = React.useRef(null);
33488
- const {
33489
- point,
33490
- onMove = () => {},
33491
- onFocusChange = () => {},
33492
- onClick = () => {},
33493
- cursor,
33494
- color = wonderBlocksTokens.color.blue,
33495
- constrain = p => snap(snapStep, p)
33496
- } = props;
33497
- const {
33498
- dragging
33499
- } = useDraggable({
33500
- gestureTarget: elementRef,
33501
- point,
33502
- onMove,
33503
- constrainKeyboardMovement: constrain
33504
- });
33505
- return /*#__PURE__*/React__namespace.createElement(MovablePointView, {
33506
- ref: ref => {
33507
- // Note: This handles the case where pointRef is either a
33508
- // function or a MutableRefObject. Mostly this is to satisfy
33509
- // the type system, the function branch seems to be the only
33510
- // one that occurs
33511
- if (typeof pointRef === "function") {
33512
- pointRef(ref);
33513
- } else if (pointRef !== null) {
33514
- pointRef.current = ref;
33515
- }
33516
-
33517
- // This ref is for the useDraggable and is not passed up the
33518
- // chain
33519
- elementRef.current = ref;
33520
- },
33521
- point: point,
33522
- color: color,
33523
- dragging: dragging,
33524
- focusBehavior: {
33525
- type: "uncontrolled",
33526
- tabIndex: 0,
33527
- onFocusChange
33528
- },
33529
- onClick: () => {
33530
- onClick && onClick();
33531
- elementRef.current?.focus();
33532
- },
33533
- cursor: cursor
33376
+ visiblePoint,
33377
+ focusableHandle
33378
+ } = useControlPoint({
33379
+ ...props,
33380
+ forwardedRef: pointRef
33534
33381
  });
33382
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, focusableHandle, visiblePoint);
33535
33383
  });
33536
33384
 
33537
- const PolygonGraph = props => {
33385
+ const LimitedPolygonGraph = props => {
33538
33386
  const [hovered, setHovered] = React__namespace.useState(false);
33539
33387
  // This is more so required for the re-rendering that occurs when state
33540
33388
  // updates; specifically with regard to line weighting and polygon focus.
@@ -33646,6 +33494,153 @@ const PolygonGraph = props => {
33646
33494
  }
33647
33495
  })));
33648
33496
  };
33497
+
33498
+ // TODO(catjohnson): reduce redundancy between LimitedPolygonGraph and UnlimitedPolygonGraph
33499
+ // both components are vary similar, however more implementation is needed to be added before
33500
+ // it is clear what can and can't be shared between components.
33501
+ const UnlimitedPolygonGraph = props => {
33502
+ const [hovered, setHovered] = React__namespace.useState(false);
33503
+ // This is more so required for the re-rendering that occurs when state
33504
+ // updates; specifically with regard to line weighting and polygon focus.
33505
+ const [focusVisible, setFocusVisible] = React__namespace.useState(false);
33506
+ const {
33507
+ dispatch
33508
+ } = props;
33509
+ const {
33510
+ coords,
33511
+ showAngles,
33512
+ showSides,
33513
+ range,
33514
+ snapStep,
33515
+ snapTo = "grid"
33516
+ } = props.graphState;
33517
+ const graphConfig = useGraphConfig();
33518
+
33519
+ // TODO(catjohnson): Explore abstracting this code as it is similar to point.tsx
33520
+ // and hopefully we can cut down ont the unlimited graph redundancy.
33521
+ const {
33522
+ range: [x, y],
33523
+ disableKeyboardInteraction,
33524
+ graphDimensionsInPixels
33525
+ } = graphConfig;
33526
+ const widthPx = graphDimensionsInPixels[0];
33527
+ const heightPx = graphDimensionsInPixels[1];
33528
+ const [[left, top]] = useTransformVectorsToPixels([x[0], y[1]]);
33529
+ const pointRef = React__namespace.useRef([]);
33530
+
33531
+ // TODO(benchristel): can the default set of points be removed here? I don't
33532
+ // think coords can be null.
33533
+ const points = coords ?? [[0, 0]];
33534
+ const polygonRef = React__namespace.useRef(null);
33535
+ const dragReferencePoint = points[0];
33536
+ const constrain = ["angles", "sides"].includes(snapTo) ? p => p : p => snap(snapStep, p);
33537
+ const {
33538
+ dragging
33539
+ } = useDraggable({
33540
+ gestureTarget: polygonRef,
33541
+ point: dragReferencePoint,
33542
+ onMove: newPoint => {
33543
+ const delta = mafs.vec.sub(newPoint, dragReferencePoint);
33544
+ dispatch(actions.polygon.moveAll(delta));
33545
+ },
33546
+ constrainKeyboardMovement: constrain
33547
+ });
33548
+ const lines = getLines(points);
33549
+ React__namespace.useEffect(() => {
33550
+ const focusedIndex = props.graphState.focusedPointIndex;
33551
+ if (focusedIndex != null) {
33552
+ pointRef.current[focusedIndex]?.focus();
33553
+ }
33554
+ }, [props.graphState.focusedPointIndex, pointRef]);
33555
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("rect", {
33556
+ style: {
33557
+ fill: "rgba(0,0,0,0)",
33558
+ cursor: "crosshair"
33559
+ },
33560
+ width: widthPx,
33561
+ height: heightPx,
33562
+ x: left,
33563
+ y: top,
33564
+ onClick: event => {
33565
+ const elementRect = event.currentTarget.getBoundingClientRect();
33566
+ const x = event.clientX - elementRect.x;
33567
+ const y = event.clientY - elementRect.y;
33568
+ const graphCoordinates = pixelsToVectors([[x, y]], graphConfig);
33569
+ dispatch(actions.polygon.addPoint(graphCoordinates[0]));
33570
+ }
33571
+ }), /*#__PURE__*/React__namespace.createElement(mafs.Polygon, {
33572
+ points: [...points],
33573
+ color: "var(--movable-line-stroke-color)",
33574
+ svgPolygonProps: {
33575
+ strokeWidth: focusVisible ? "var(--movable-line-stroke-weight-active)" : "var(--movable-line-stroke-weight)",
33576
+ style: {
33577
+ fill: "transparent"
33578
+ }
33579
+ }
33580
+ }), props.graphState.coords.map((point, i) => {
33581
+ const pt1 = points.at(i - 1);
33582
+ const pt2 = points[(i + 1) % points.length];
33583
+ if (!pt1 || !pt2) {
33584
+ return null;
33585
+ }
33586
+ return /*#__PURE__*/React__namespace.createElement(PolygonAngle, {
33587
+ key: "angle-" + i,
33588
+ centerPoint: point,
33589
+ endPoints: [pt1, pt2],
33590
+ range: range,
33591
+ polygonLines: lines,
33592
+ showAngles: !!showAngles,
33593
+ snapTo: snapTo
33594
+ });
33595
+ }), showSides && lines.map((_ref2, i) => {
33596
+ let [start, end] = _ref2;
33597
+ const [x, y] = mafs.vec.midpoint(start, end);
33598
+ const length = parseFloat(mafs.vec.dist(start, end).toFixed(snapTo === "sides" ? 0 : 1));
33599
+ return /*#__PURE__*/React__namespace.createElement(TextLabel, {
33600
+ key: "side-" + i,
33601
+ x: x,
33602
+ y: y
33603
+ }, !Number.isInteger(length) && "≈ ", length);
33604
+ }), /*#__PURE__*/React__namespace.createElement(mafs.Polygon, {
33605
+ points: [...points],
33606
+ color: "transparent",
33607
+ svgPolygonProps: {
33608
+ ref: polygonRef,
33609
+ tabIndex: disableKeyboardInteraction ? -1 : 0,
33610
+ strokeWidth: TARGET_SIZE,
33611
+ style: {
33612
+ cursor: dragging ? "grabbing" : "grab",
33613
+ fill: hovered ? "var(--mafs-blue)" : "transparent"
33614
+ },
33615
+ onMouseEnter: () => setHovered(true),
33616
+ onMouseLeave: () => setHovered(false),
33617
+ // Required to remove line weighting when user clicks away
33618
+ // from the focused polygon
33619
+ onKeyDownCapture: () => {
33620
+ setFocusVisible(hasFocusVisible(polygonRef.current));
33621
+ },
33622
+ // Required for lines to darken on focus
33623
+ onFocus: () => setFocusVisible(hasFocusVisible(polygonRef.current)),
33624
+ // Required for line weighting to update on blur. Without this,
33625
+ // the user has to hover over the shape for it to update
33626
+ onBlur: () => setFocusVisible(hasFocusVisible(polygonRef.current)),
33627
+ className: "movable-polygon"
33628
+ }
33629
+ }), props.graphState.coords.map((point, i) => /*#__PURE__*/React__namespace.createElement(MovablePoint$1, {
33630
+ key: i,
33631
+ point: point,
33632
+ onMove: destination => dispatch(actions.pointGraph.movePoint(i, destination)),
33633
+ ref: ref => {
33634
+ pointRef.current[i] = ref;
33635
+ },
33636
+ onFocus: () => {
33637
+ dispatch(actions.pointGraph.focusPoint(i));
33638
+ },
33639
+ onClick: () => {
33640
+ dispatch(actions.pointGraph.clickPoint(i));
33641
+ }
33642
+ })));
33643
+ };
33649
33644
  function getLines(points) {
33650
33645
  return points.map((point, i) => {
33651
33646
  const next = points[(i + 1) % points.length];
@@ -33663,6 +33658,10 @@ const hasFocusVisible = element => {
33663
33658
  return matches(":focus");
33664
33659
  }
33665
33660
  };
33661
+ const PolygonGraph = props => {
33662
+ const numSides = props.graphState.numSides;
33663
+ return numSides === "unlimited" ? UnlimitedPolygonGraph(props) : LimitedPolygonGraph(props);
33664
+ };
33666
33665
 
33667
33666
  function getGradableGraph(state, initialGraph) {
33668
33667
  if (!state.hasBeenInteractedWith) {
@@ -34114,10 +34113,10 @@ function UnlimitedPointGraph(props) {
34114
34113
  const {
34115
34114
  dispatch
34116
34115
  } = props;
34117
- const graphState = useGraphConfig();
34116
+ const graphConfig = useGraphConfig();
34118
34117
  const {
34119
34118
  range: [[minX, maxX], [minY, maxY]]
34120
- } = graphState;
34119
+ } = graphConfig;
34121
34120
  const width = maxX - minX;
34122
34121
  const height = maxY - minY;
34123
34122
  const [[widthPx, heightPx]] = useTransformDimensionsToPixels([width, height]);
@@ -34142,7 +34141,7 @@ function UnlimitedPointGraph(props) {
34142
34141
  const elementRect = event.currentTarget.getBoundingClientRect();
34143
34142
  const x = event.clientX - elementRect.x;
34144
34143
  const y = event.clientY - elementRect.y;
34145
- const graphCoordinates = pixelsToVectors([[x, y]], graphState);
34144
+ const graphCoordinates = pixelsToVectors([[x, y]], graphConfig);
34146
34145
  dispatch(actions.pointGraph.addPoint(graphCoordinates[0]));
34147
34146
  }
34148
34147
  }), props.graphState.coords.map((point, i) => /*#__PURE__*/React__namespace.createElement(MovablePoint$1, {
@@ -34152,23 +34151,8 @@ function UnlimitedPointGraph(props) {
34152
34151
  ref: ref => {
34153
34152
  itemsRef.current[i] = ref;
34154
34153
  },
34155
- onFocusChange: (event, isFocused) => {
34156
- if (isFocused) {
34157
- dispatch(actions.pointGraph.focusPoint(i));
34158
- } else {
34159
- if (event.relatedTarget?.id === REMOVE_BUTTON_ID) {
34160
- return;
34161
- // This is an optimization: If the next target
34162
- // is a point then don't blur because it casues
34163
- // the remove button to get taken off the page
34164
- // and then put back on The new point will
34165
- // receive focus and set the correct state in
34166
- // the reducer
34167
- } else if (event.relatedTarget?.classList.contains("movable-point")) {
34168
- return;
34169
- }
34170
- dispatch(actions.pointGraph.blurPoint());
34171
- }
34154
+ onFocus: () => {
34155
+ dispatch(actions.pointGraph.focusPoint(i));
34172
34156
  },
34173
34157
  onClick: () => {
34174
34158
  dispatch(actions.pointGraph.clickPoint(i));
@@ -34330,7 +34314,6 @@ function useDraggablePx(args) {
34330
34314
  * - Protractor
34331
34315
  * - Interactive Graph Elements
34332
34316
  */
34333
- const REMOVE_BUTTON_ID = "perseus_mafs_remove_button";
34334
34317
  const MafsGraph = props => {
34335
34318
  const {
34336
34319
  state,
@@ -34370,6 +34353,7 @@ const MafsGraph = props => {
34370
34353
  const {
34371
34354
  strings
34372
34355
  } = usePerseusI18n();
34356
+ const interactionPrompt = isUnlimitedGraphState(state) && state.showKeyboardInteractionInvitation;
34373
34357
  wonderBlocksCore.useOnMountEffect(() => {
34374
34358
  analytics.onAnalyticsEvent({
34375
34359
  type: "perseus:interactive-graph-widget:rendered",
@@ -34482,7 +34466,7 @@ const MafsGraph = props => {
34482
34466
  }, /*#__PURE__*/React__namespace.createElement("svg", nestedSVGAttributes, props.showProtractor && /*#__PURE__*/React__namespace.createElement(Protractor, null), renderGraph({
34483
34467
  state,
34484
34468
  dispatch
34485
- }))))), state.type === "point" && state.showKeyboardInteractionInvitation && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
34469
+ }))))), interactionPrompt && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
34486
34470
  style: {
34487
34471
  textAlign: "center",
34488
34472
  backgroundColor: "white",
@@ -34499,7 +34483,7 @@ const MafsGraph = props => {
34499
34483
  state,
34500
34484
  dispatch,
34501
34485
  width,
34502
- strings
34486
+ perseusStrings: strings
34503
34487
  })));
34504
34488
  };
34505
34489
  const renderPointGraphControls = props => {
@@ -34509,7 +34493,7 @@ const renderPointGraphControls = props => {
34509
34493
  focusedPointIndex
34510
34494
  } = props.state;
34511
34495
  const {
34512
- strings
34496
+ perseusStrings
34513
34497
  } = props;
34514
34498
  const shouldShowRemoveButton = showRemovePointButton && focusedPointIndex !== null;
34515
34499
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
@@ -34527,7 +34511,7 @@ const renderPointGraphControls = props => {
34527
34511
  onClick: () => {
34528
34512
  props.dispatch(actions.pointGraph.addPoint([0, 0]));
34529
34513
  }
34530
- }, strings.addPoint), interactionMode === "mouse" && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
34514
+ }, perseusStrings.addPoint), interactionMode === "mouse" && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
34531
34515
  id: REMOVE_BUTTON_ID,
34532
34516
  kind: "secondary",
34533
34517
  color: "destructive"
@@ -34540,17 +34524,66 @@ const renderPointGraphControls = props => {
34540
34524
  marginLeft: "20px",
34541
34525
  visibility: shouldShowRemoveButton ? "visible" : "hidden"
34542
34526
  },
34543
- onClick: event => {
34527
+ onClick: _event => {
34544
34528
  props.dispatch(actions.pointGraph.removePoint(props.state.focusedPointIndex));
34545
34529
  }
34546
- }, strings.removePoint));
34530
+ }, perseusStrings.removePoint));
34531
+ };
34532
+
34533
+ /**
34534
+ * TODO(catjohnson): The polygon controls will be vastly different from the point controls.
34535
+ * Will be keeping this function as is for the time being, even if it's a copy of the point graph
34536
+ * controls.
34537
+ */
34538
+ const renderPolygonGraphControls = props => {
34539
+ const {
34540
+ interactionMode,
34541
+ showRemovePointButton,
34542
+ focusedPointIndex
34543
+ } = props.state;
34544
+ const {
34545
+ perseusStrings
34546
+ } = props;
34547
+ const shouldShowRemoveButton = showRemovePointButton && focusedPointIndex !== null;
34548
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
34549
+ style: {
34550
+ flexDirection: "row",
34551
+ width: props.width
34552
+ }
34553
+ }, interactionMode === "keyboard" && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
34554
+ kind: "secondary",
34555
+ style: {
34556
+ width: "100%",
34557
+ marginLeft: "20px"
34558
+ },
34559
+ tabIndex: 0,
34560
+ onClick: () => {
34561
+ props.dispatch(actions.polygon.addPoint([0, 0]));
34562
+ }
34563
+ }, perseusStrings.addPoint), interactionMode === "mouse" && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
34564
+ id: REMOVE_BUTTON_ID,
34565
+ kind: "secondary",
34566
+ color: "destructive"
34567
+ // This button is meant to be interacted with by the mouse only
34568
+ // Never allow learners to tab to this button
34569
+ ,
34570
+ tabIndex: -1,
34571
+ style: {
34572
+ width: "100%",
34573
+ marginLeft: "20px",
34574
+ visibility: shouldShowRemoveButton ? "visible" : "hidden"
34575
+ },
34576
+ onClick: _event => {
34577
+ props.dispatch(actions.polygon.removePoint(props.state.focusedPointIndex));
34578
+ }
34579
+ }, perseusStrings.removePoint));
34547
34580
  };
34548
34581
  const renderGraphControls = props => {
34549
34582
  const {
34550
34583
  state,
34551
34584
  dispatch,
34552
34585
  width,
34553
- strings
34586
+ perseusStrings
34554
34587
  } = props;
34555
34588
  const {
34556
34589
  type
@@ -34562,7 +34595,17 @@ const renderGraphControls = props => {
34562
34595
  state,
34563
34596
  dispatch,
34564
34597
  width,
34565
- strings
34598
+ perseusStrings
34599
+ });
34600
+ }
34601
+ return null;
34602
+ case "polygon":
34603
+ if (state.numSides === "unlimited") {
34604
+ return renderPolygonGraphControls({
34605
+ state,
34606
+ dispatch,
34607
+ width,
34608
+ perseusStrings
34566
34609
  });
34567
34610
  }
34568
34611
  return null;
@@ -34571,21 +34614,28 @@ const renderGraphControls = props => {
34571
34614
  }
34572
34615
  };
34573
34616
  function handleFocusEvent(event, state, dispatch) {
34574
- if (state.type === "point" && state.numPoints === "unlimited") {
34617
+ if (isUnlimitedGraphState(state)) {
34575
34618
  if (event.target.classList.contains("mafs-graph") && state.interactionMode === "mouse") {
34576
34619
  dispatch(actions.global.changeKeyboardInvitationVisibility(true));
34577
34620
  }
34578
34621
  }
34579
34622
  }
34580
- function handleBlurEvent(event, state, dispatch) {
34581
- if (state.type === "point" && state.numPoints === "unlimited") {
34623
+ function handleBlurEvent(_event, state, dispatch) {
34624
+ if (isUnlimitedGraphState(state)) {
34582
34625
  dispatch(actions.global.changeKeyboardInvitationVisibility(false));
34583
34626
  }
34584
34627
  }
34585
34628
  function handleKeyboardEvent(event, state, dispatch) {
34586
- if (state.type === "point" && state.numPoints === "unlimited") {
34629
+ if (isUnlimitedGraphState(state)) {
34587
34630
  if (event.key === "Backspace") {
34588
- dispatch(actions.global.deleteIntent());
34631
+ // TODO(benchristel): Checking classList here is a hack to prevent
34632
+ // points from being deleted if the user presses the backspace key
34633
+ // while the whole graph is focused. Instead of doing this, we
34634
+ // should move the keyboard event handler to the movable point
34635
+ // handle element.
34636
+ if (document.activeElement?.classList.contains("movable-point__focusable-handle")) {
34637
+ dispatch(actions.global.deleteIntent());
34638
+ }
34589
34639
 
34590
34640
  // After removing a point blur
34591
34641
  // It would be nice if this could focus on the graph but doing so
@@ -34844,10 +34894,15 @@ function initializeGraphState(params) {
34844
34894
  return {
34845
34895
  ...shared,
34846
34896
  type: "polygon",
34897
+ numSides: graph.numSides || 0,
34847
34898
  showAngles: Boolean(graph.showAngles),
34848
34899
  showSides: Boolean(graph.showSides),
34849
34900
  coords: getPolygonCoords(graph, range, step),
34850
- snapTo: graph.snapTo ?? "grid"
34901
+ snapTo: graph.snapTo ?? "grid",
34902
+ focusedPointIndex: null,
34903
+ showRemovePointButton: false,
34904
+ interactionMode: "mouse",
34905
+ showKeyboardInteractionInvitation: false
34851
34906
  };
34852
34907
  case "point":
34853
34908
  return {
@@ -35141,10 +35196,9 @@ function interactiveGraphReducer(state, action) {
35141
35196
  }
35142
35197
  function doDeleteIntent(state, action) {
35143
35198
  // For unlimited point graphs
35144
- if (state.type === "point" && state.numPoints === "unlimited") {
35145
- // if there's a focused point
35199
+ if (isUnlimitedGraphState(state)) {
35200
+ // Remove the last point that was focused, if any
35146
35201
  if (state.focusedPointIndex !== null) {
35147
- // Remove the focused focus
35148
35202
  return doRemovePoint(state, actions.pointGraph.removePoint(state.focusedPointIndex));
35149
35203
  }
35150
35204
  }
@@ -35152,6 +35206,7 @@ function doDeleteIntent(state, action) {
35152
35206
  }
35153
35207
  function doFocusPoint(state, action) {
35154
35208
  switch (state.type) {
35209
+ case "polygon":
35155
35210
  case "point":
35156
35211
  return {
35157
35212
  ...state,
@@ -35163,6 +35218,7 @@ function doFocusPoint(state, action) {
35163
35218
  }
35164
35219
  function doBlurPoint(state, action) {
35165
35220
  switch (state.type) {
35221
+ case "polygon":
35166
35222
  case "point":
35167
35223
  const nextState = {
35168
35224
  ...state,
@@ -35177,10 +35233,7 @@ function doBlurPoint(state, action) {
35177
35233
  }
35178
35234
  }
35179
35235
  function doClickPoint(state, action) {
35180
- if (state.type !== "point") {
35181
- return state;
35182
- }
35183
- if (state.numPoints === "unlimited") {
35236
+ if (isUnlimitedGraphState(state)) {
35184
35237
  return {
35185
35238
  ...state,
35186
35239
  focusedPointIndex: action.index,
@@ -35190,10 +35243,7 @@ function doClickPoint(state, action) {
35190
35243
  return state;
35191
35244
  }
35192
35245
  function doChangeInteractionMode(state, action) {
35193
- if (state.type !== "point") {
35194
- return state;
35195
- }
35196
- if (state.numPoints === "unlimited") {
35246
+ if (isUnlimitedGraphState(state)) {
35197
35247
  const nextKeyboardInvitation = action.mode === "keyboard" ? false : state.showKeyboardInteractionInvitation;
35198
35248
  return {
35199
35249
  ...state,
@@ -35204,10 +35254,7 @@ function doChangeInteractionMode(state, action) {
35204
35254
  return state;
35205
35255
  }
35206
35256
  function doChangeKeyboardInvitationVisibility(state, action) {
35207
- if (state.type !== "point") {
35208
- return state;
35209
- }
35210
- if (state.numPoints === "unlimited") {
35257
+ if (isUnlimitedGraphState(state)) {
35211
35258
  return {
35212
35259
  ...state,
35213
35260
  showKeyboardInteractionInvitation: action.shouldShow,
@@ -35554,7 +35601,7 @@ function doChangeRange(state, action) {
35554
35601
  };
35555
35602
  }
35556
35603
  function doAddPoint(state, action) {
35557
- if (state.type !== "point") {
35604
+ if (!isUnlimitedGraphState(state)) {
35558
35605
  return state;
35559
35606
  }
35560
35607
  const {
@@ -35579,7 +35626,7 @@ function doAddPoint(state, action) {
35579
35626
  };
35580
35627
  }
35581
35628
  function doRemovePoint(state, action) {
35582
- if (state.type !== "point") {
35629
+ if (!isUnlimitedGraphState(state)) {
35583
35630
  return state;
35584
35631
  }
35585
35632
  let nextFocusedPointIndex;
@@ -37868,9 +37915,6 @@ function shouldUseMafs(mafsFlags, graph) {
37868
37915
  return Boolean(mafsFlags["point"]);
37869
37916
  case "polygon":
37870
37917
  if (graph.numSides === UNLIMITED) {
37871
- // TODO(benchristel): add a feature flag for the "unlimited"
37872
- // case once we've implemented polygon graphs with unlimited
37873
- // sides
37874
37918
  return Boolean(mafsFlags["unlimited-polygon"]);
37875
37919
  }
37876
37920
  return Boolean(mafsFlags["polygon"]);
@@ -37888,976 +37932,15 @@ var InteractiveGraph$1 = {
37888
37932
  validator: interactiveGraphValidator
37889
37933
  };
37890
37934
 
37891
- const black = "#000000";
37892
- const grayDarker = "#333333";
37893
- const grayDark = "#555555";
37894
- const gray = "#999999";
37895
- const grayLight = "#AAAAAA";
37896
- const grayLighter = "#DDDDDD";
37897
- const white = "#FFFFFF";
37898
- const blue = "#005A88";
37899
- const blueDark = "#2C3747";
37900
- const green = "#76A005";
37901
- const red = "#CF5044";
37902
- const yellow = "#FFC40D";
37903
- const orange = "#BF4F04";
37904
- const pink = "#C3325F";
37905
- const purple = "#7A43B6";
37906
- const bodyBackground = "#FFFFFF";
37907
- const textColor = "#444444";
37908
- const linkColor = "#005987";
37909
- const linkColorHover = "#678D00";
37910
- const sansFontFamily = "'Helvetica Neue',Helvetica,Arial,sans-serif";
37911
- const serifFontFamily = "Georgia,'Times New Roman',Times,serif";
37912
- const monoFontFamily = "Monaco,Menlo,Consolas,'Courier New',monospace";
37913
- const baseFontSize = "14px";
37914
- const baseFontFamily = "inherit";
37915
- const baseLineHeight = "20px";
37916
- const altFontFamily = "Georgia,'Times New Roman',Times,serif";
37917
- const headingsFontFamily = "inherit";
37918
- const headingsFontWeight = "bold";
37919
- const headingsColor = "inherit";
37920
- const fontSizeLarge = "18px";
37921
- const fontSizeSmall = "12px";
37922
- const fontSizeMini = "10.5px";
37923
- const paddingLarge = "11px 19px";
37924
- const paddingSmall = "2px 10px";
37925
- const paddingMini = "0 6px";
37926
- const baseBorderRadius = "4px";
37927
- const borderRadiusLarge = "6px";
37928
- const borderRadiusSmall = "3px";
37929
- const tableBackground = "#000000";
37930
- const tableBackgroundAccent = "#F9F9F9";
37931
- const tableBackgroundHover = "#F5F5F5";
37932
- const tableBorder = "#DDDDDD";
37933
- const btnBackground = "#FFFFFF";
37934
- const btnBackgroundHighlight = "rgb(230, 230, 230)";
37935
- const btnBorder = "#CCCCCC";
37936
- const btnPrimaryBackground = "#0088CC";
37937
- const btnPrimaryBackgroundHighlight = "rgb(0, 68, 204)";
37938
- const btnInfoBackground = "#5BC0DE";
37939
- const btnInfoBackgroundHighlight = "#2F96B4";
37940
- const btnSuccessBackground = "#62C462";
37941
- const btnSuccessBackgroundHighlight = "#51A351";
37942
- const btnWarningBackground = "rgb(251, 180, 81)";
37943
- const btnWarningBackgroundHighlight = "#F89406";
37944
- const btnDangerBackground = "#EE5F5B";
37945
- const btnDangerBackgroundHighlight = "#BD362F";
37946
- const btnInverseBackground = "#444444";
37947
- const btnInverseBackgroundHighlight = "#222222";
37948
- const inputBackground = "#FFFFFF";
37949
- const inputBorder = "#CCCCCC";
37950
- const inputBorderRadius = "4px";
37951
- const inputDisabledBackground = "#EEEEEE";
37952
- const formActionsBackground = "#F5F5F5";
37953
- const inputHeight = "30px";
37954
- const dropdownBackground = "#FFFFFF";
37955
- const dropdownBorder = "rgba(0, 0, 0, 0.2)";
37956
- const dropdownDividerTop = "#E5E5E5";
37957
- const dropdownDividerBottom = "#FFFFFF";
37958
- const dropdownLinkColor = "#333333";
37959
- const dropdownLinkColorHover = "#FFFFFF";
37960
- const dropdownLinkColorActive = "#FFFFFF";
37961
- const dropdownLinkBackgroundActive = "#0088CC";
37962
- const dropdownLinkBackgroundHover = "#0088CC";
37963
- const zindexDropdown = 1000;
37964
- const zindexPopover = 1010;
37965
- const zindexTooltip = 1030;
37966
- const zindexFixedNavbar = 1030;
37967
- const zindexHeader = 1060;
37968
- const zindexModalBackdrop = 1070;
37969
- const zindexModal = 1080;
37970
- const zindexAboveModal = 1090;
37971
- const iconSpritePath = "../img/glyphicons-halflings.png";
37972
- const iconWhiteSpritePath = "../img/glyphicons-halflings-white.png";
37973
- const placeholderText = "#999999";
37974
- const hrBorder = "#EEEEEE";
37975
- const horizontalComponentOffset = "180px";
37976
- const wellBackground = "#F5F5F5";
37977
- const navbarCollapseWidth = "979px";
37978
- const navbarCollapseDesktopWidth = "980px";
37979
- const navbarHeight = "40px";
37980
- const navbarBackgroundHighlight = "#FFFFFF";
37981
- const navbarBackground = "rgb(242, 242, 242)";
37982
- const navbarBorder = "rgb(212, 212, 212)";
37983
- const navbarText = "#777777";
37984
- const navbarLinkColor = "#777777";
37985
- const navbarLinkColorHover = "#333333";
37986
- const navbarLinkColorActive = "#555555";
37987
- const navbarLinkBackgroundHover = "#000000";
37988
- const navbarLinkBackgroundActive = "rgb(230, 230, 230)";
37989
- const navbarBrandColor = "#777777";
37990
- const navbarInverseBackground = "#111111";
37991
- const navbarInverseBackgroundHighlight = "#222222";
37992
- const navbarInverseBorder = "#252525";
37993
- const navbarInverseText = "#999999";
37994
- const navbarInverseLinkColor = "#999999";
37995
- const navbarInverseLinkColorHover = "#FFFFFF";
37996
- const navbarInverseLinkColorActive = "#FFFFFF";
37997
- const navbarInverseLinkBackgroundHover = "#000000";
37998
- const navbarInverseLinkBackgroundActive = "#111111";
37999
- const navbarInverseSearchBackground = "rgb(82, 82, 82)";
38000
- const navbarInverseSearchBackgroundFocus = "#FFFFFF";
38001
- const navbarInverseSearchBorder = "#111111";
38002
- const navbarInverseSearchPlaceholderColor = "#CCCCCC";
38003
- const navbarInverseBrandColor = "#999999";
38004
- const paginationBackground = "#FFFFFF";
38005
- const paginationBorder = "#DDDDDD";
38006
- const paginationActiveBackground = "#F5F5F5";
38007
- const heroUnitBackground = "#EEEEEE";
38008
- const heroUnitHeadingColor = "inherit";
38009
- const heroUnitLeadColor = "inherit";
38010
- const warningText = "#C09853";
38011
- const warningBackground = "#FCF8E3";
38012
- const warningBorder = "rgb(251, 239, 213)";
38013
- const errorText = "#B94A48";
38014
- const errorBackground = "#F2DEDE";
38015
- const errorBorder = "rgb(238, 211, 215)";
38016
- const successText = "#468847";
38017
- const successBackground = "#DFF0D8";
38018
- const successBorder = "rgb(212, 232, 197)";
38019
- const infoText = "#4A7C17";
38020
- const infoBackground = "#EDF2DF";
38021
- const infoBorder = "rgb(228, 232, 197)";
38022
- const tooltipColor = "#FFFFFF";
38023
- const tooltipBackground = "#000000";
38024
- const tooltipArrowWidth = "5px";
38025
- const tooltipArrowColor = "#000000";
38026
- const popoverBackground = "#FFFFFF";
38027
- const popoverArrowWidth = "10px";
38028
- const popoverArrowColor = "#FFFFFF";
38029
- const popoverTitleBackground = "rgb(247, 247, 247)";
38030
- const popoverArrowOuterWidth = "11px";
38031
- const popoverArrowOuterColor = "rgba(0, 0, 0, 0.25)";
38032
- const gridColumns = "12";
38033
- const gridColumnWidth = "60px";
38034
- const gridGutterWidth = "20px";
38035
- const gridRowWidth = "940px";
38036
- const gridColumnWidth1200 = "70px";
38037
- const gridGutterWidth1200 = "30px";
38038
- const gridRowWidth1200 = "1170px";
38039
- const gridColumnWidth768 = "42px";
38040
- const gridGutterWidth768 = "20px";
38041
- const gridRowWidth768 = "724px";
38042
- const fluidGridColumnWidth = "6.382978723404255%";
38043
- const fluidGridGutterWidth = "2.127659574468085%";
38044
- const fluidGridColumnWidth1200 = "5.982905982905983%";
38045
- const fluidGridGutterWidth1200 = "2.564102564102564%";
38046
- const fluidGridColumnWidth768 = "5.801104972375691%";
38047
- const fluidGridGutterWidth768 = "2.7624309392265194%";
38048
- const kaGreen = "#71B307";
38049
- const kaGreenLight = "#BED47A";
38050
- const kaBlue = "#314453";
38051
- const kaBlueLight = "#4D6779";
38052
- const grayExtraDark = "#111111";
38053
- const grayExtraLight = "#EEEEEE";
38054
- const graySuperLight = "#F7F7F7";
38055
- const whiteDark = "#FDFDFD";
38056
- const dark = "#21242C";
38057
- const blueDarkUnsaturated = "#3B414E";
38058
- const blueDarkSaturated = "#1F3043";
38059
- const blueLight = "#A9C0D1";
38060
- const greenLight = "#C6D1AD";
38061
- const greenDark = "#356700";
38062
- const yellowGreen = "#9DB63B";
38063
- const okGreen = "#A7CF5B";
38064
- const alertRed = "#C42420";
38065
- const coral = "#EE6666";
38066
- const grayBlue = "#9AB3B9";
38067
- const lightPageBackground = "#FDFDFD";
38068
- const yclaBlue = "#49BAD5";
38069
- const yclaTeal = "#56D0B3";
38070
- const yclaTealDark = "#50C1A7";
38071
- const yclaGreenDark = "#3D9A82";
38072
- const yclaGreen = "#81C262";
38073
- const learnstormBlue = "#4898FC";
38074
- const homepageBlue = "#46A8BF";
38075
- const backgroundBlue = "#00294A";
38076
- const teacherSignupBlue = "#335d7d";
38077
- const homepageGreen = "#2B8E7B";
38078
- const streakColor = "#F79734";
38079
- const facebookColor = "#1A60A2";
38080
- const blueGoogleColor = "#2CAFE2";
38081
- const redGoogleColor = "#BF4434";
38082
- const homepageColor = "#2D585E";
38083
- const lightTextColor = "#898989";
38084
- const fontSizeTiny = "11px";
38085
- const fontSizeNormal = "14px";
38086
- const fontSizeMedium = "16px";
38087
- const fontSizeExtraLarge = "24px";
38088
- const fontSizeHuge = "36px";
38089
- const fontSizeBakana = "48px";
38090
- const fontSizeBananas = "60px";
38091
- const fixedWidthFontFamily = "'Helvetica Neue',Helvetica,Arial,sans-serif";
38092
- const contentPadding = "20px";
38093
- const primaryButtonBackground = "#89B908";
38094
- const primaryButtonBorder = "#76A005";
38095
- const buttonTextColor = "rgb(122, 122, 122)";
38096
- const buttonBorderRadius = "3px";
38097
- const basicBorderColor = "#CCCCCC";
38098
- const minContainerWidth = "1000px";
38099
- const maxContainerWidth = "1200px";
38100
- const formHintColor = "#999999";
38101
- const guidelineExampleText = "#606060";
38102
- const hoverCardWidth = "450px";
38103
- const menuHighlightColor = "#96AB4F";
38104
- const menuHighlightBorderColor = "#76A005";
38105
- const menuActiveTextColor = "#FFFFFF";
38106
- const menuInactiveTextColor = "#444444";
38107
- const menuSubheaderTextColor = "rgb(120, 120, 120)";
38108
- const menuBorderColor = "#94A170";
38109
- const unreadBackgroundColor = "#ECEEF4";
38110
- const menuLineHeight = "18px";
38111
- const menuSubheaderLineHeight = "17px";
38112
- const menuSubheaderFontSize = "9px";
38113
- const notificationBarColor = "#4858A4";
38114
- const modalBodyTopPadding = "20px";
38115
- const modalDialogPadding = "15px";
38116
- const modalSectionPadding = "9px";
38117
- const mathDomain1 = "#11ACCD";
38118
- const mathDomain2 = "#63D9EA";
38119
- const mathDomain3 = "#027d97";
38120
- const mathDomain4 = "#085566";
38121
- const partnerContentDomain1 = "#01A995";
38122
- const partnerContentDomain2 = "#01D1C1";
38123
- const partnerContentDomain3 = "#208170";
38124
- const partnerContentDomain4 = "#144F44";
38125
- const csDomain1 = "#1FAB54";
38126
- const csDomain2 = "#74CF70";
38127
- const csDomain3 = "#0D923F";
38128
- const csDomain4 = "#085E29";
38129
- const economicsDomain1 = "#E07D10";
38130
- const economicsDomain2 = "#FFBE26";
38131
- const economicsDomain3 = "#A75A05";
38132
- const economicsDomain4 = "#953C02";
38133
- const collegeCareersMoreDomain1 = "#01A995";
38134
- const collegeCareersMoreDomain2 = "#01D1C1";
38135
- const collegeCareersMoreDomain3 = "#208170";
38136
- const collegeCareersMoreDomain4 = "#144F44";
38137
- const humanitiesDomain1 = "#E84D39";
38138
- const humanitiesDomain2 = "#FF8482";
38139
- const humanitiesDomain3 = "#BE2612";
38140
- const humanitiesDomain4 = "#8C1C0D";
38141
- const gtpDomain1 = "#1865F2";
38142
- const gtpDomain2 = "#1865F2";
38143
- const gtpDomain3 = "#1865F2";
38144
- const gtpDomain4 = "#1865F2";
38145
- const scienceDomain1 = "#CA337C";
38146
- const scienceDomain2 = "#FF92C6";
38147
- const scienceDomain3 = "#9E034E";
38148
- const scienceDomain4 = "#6B0235";
38149
- const testPrepDomain1 = "#1865F2";
38150
- const testPrepDomain2 = "#1865F2";
38151
- const testPrepDomain3 = "#1865F2";
38152
- const testPrepDomain4 = "#1865F2";
38153
- const defaultDomain1 = "#1865F2";
38154
- const defaultDomain2 = "#66afe9";
38155
- const defaultDomain3 = "#1152b0";
38156
- const defaultDomain4 = "#0d3d82";
38157
- const defaultDomainColor = "#314453";
38158
- const defaultSubjectColor = "#4D6779";
38159
- const defaultTopicColor = "#6A8DA6";
38160
- const defaultHoverColor = "#314453";
38161
- const defaultLinkColor = "#314453";
38162
- const defaultLinkHoverColor = "#6A8DA6";
38163
- const scienceDomainColor = "#94424F";
38164
- const scienceSubjectColor = "#9D4A5A";
38165
- const scienceTopicColor = "#C55F73";
38166
- const scienceHoverColor = "#94424F";
38167
- const scienceLinkColor = "#94424F";
38168
- const scienceLinkHoverColor = "#C55F73";
38169
- const humanitiesDomainColor = "#AD3434";
38170
- const humanitiesSubjectColor = "#C13B31";
38171
- const humanitiesTopicColor = "#D24A45";
38172
- const humanitiesHoverColor = "#AD3434";
38173
- const humanitiesLinkColor = "#AD3434";
38174
- const humanitiesLinkHoverColor = "#D24A45";
38175
- const economicsDomainColor = "#B77033";
38176
- const economicsSubjectColor = "#BF7B34";
38177
- const economicsTopicColor = "#D1933B";
38178
- const economicsHoverColor = "#B77033";
38179
- const economicsLinkColor = "#B77033";
38180
- const economicsLinkHoverColor = "#D1933B";
38181
- const csDomainColor = "#437A39";
38182
- const csSubjectColor = "#53893E";
38183
- const csTopicColor = "#689B51";
38184
- const csHoverColor = "#437A39";
38185
- const csLinkColor = "#437A39";
38186
- const csLinkHoverColor = "#689B51";
38187
- const partnerContentDomainColor = "#218270";
38188
- const partnerContentSubjectColor = "#2C8D7B";
38189
- const partnerContentTopicColor = "#329A86";
38190
- const partnerContentHoverColor = "#218270";
38191
- const partnerContentLinkColor = "#218270";
38192
- const partnerContentLinkHoverColor = "#329A86";
38193
- const essayDomainColor = "#0071B3";
38194
- const mathDomainColor = "#1C758A";
38195
- const mathSubjectColor = "#46A8BF";
38196
- const mathTopicColor = "#4FBAD4";
38197
- const mathHoverColor = "#1C758A";
38198
- const mathLinkColor = "#1C758A";
38199
- const mathLinkHoverColor = "#4FBAD4";
38200
- const testPrepDomainColor = "#644172";
38201
- const testPrepSubjectColor = "#7E5F8E";
38202
- const testPrepTopicColor = "#9A72AC";
38203
- const testPrepHoverColor = "#644172";
38204
- const testPrepLinkColor = "#644172";
38205
- const testPrepLinkHoverColor = "#9A72AC";
38206
- const collegeCareersMoreDomainColor = "#218270";
38207
- const collegeCareersMoreSubjectColor = "#2C8D7B";
38208
- const collegeCareersMoreTopicColor = "#329A86";
38209
- const collegeCareersMoreHoverColor = "#218270";
38210
- const collegeCareersMoreLinkColor = "#218270";
38211
- const collegeCareersMoreLinkHoverColor = "#329A86";
38212
- const colorProficient = "#1C758A";
38213
- const colorPracticed = "rgb(158, 221, 235)";
38214
- const colorMastery1 = "rgb(90, 197, 221)";
38215
- const colorMastery2 = "rgb(42, 174, 203)";
38216
- const colorMastery3 = "#1C758A";
38217
- const colorSuggested = "#73982C";
38218
- const colorReview = "#E35D04";
38219
- const colorNotStarted = "#CCCCCC";
38220
- const colorStarted = "#C7E5F7";
38221
- const colorStruggling = "#C30202";
38222
- const colorPersonal = "#00809C";
38223
- const colorPractice = "#96D9FF";
38224
- const colorEnergyPoints = "#005987";
38225
- const pureSmMin = "568px";
38226
- const pureMdMin = "768px";
38227
- const pureLgMin = "1024px";
38228
- const pureXlMin = "1200px";
38229
- const pureXsMax = "567px";
38230
- const pureSmMax = "767px";
38231
- const pureMdMax = "1023px";
38232
- const pureLgMax = "1199px";
38233
-
38234
- var globalConstants = /*#__PURE__*/Object.freeze({
38235
- __proto__: null,
38236
- black: black,
38237
- grayDarker: grayDarker,
38238
- grayDark: grayDark,
38239
- gray: gray,
38240
- grayLight: grayLight,
38241
- grayLighter: grayLighter,
38242
- white: white,
38243
- blue: blue,
38244
- blueDark: blueDark,
38245
- green: green,
38246
- red: red,
38247
- yellow: yellow,
38248
- orange: orange,
38249
- pink: pink,
38250
- purple: purple,
38251
- bodyBackground: bodyBackground,
38252
- textColor: textColor,
38253
- linkColor: linkColor,
38254
- linkColorHover: linkColorHover,
38255
- sansFontFamily: sansFontFamily,
38256
- serifFontFamily: serifFontFamily,
38257
- monoFontFamily: monoFontFamily,
38258
- baseFontSize: baseFontSize,
38259
- baseFontFamily: baseFontFamily,
38260
- baseLineHeight: baseLineHeight,
38261
- altFontFamily: altFontFamily,
38262
- headingsFontFamily: headingsFontFamily,
38263
- headingsFontWeight: headingsFontWeight,
38264
- headingsColor: headingsColor,
38265
- fontSizeLarge: fontSizeLarge,
38266
- fontSizeSmall: fontSizeSmall,
38267
- fontSizeMini: fontSizeMini,
38268
- paddingLarge: paddingLarge,
38269
- paddingSmall: paddingSmall,
38270
- paddingMini: paddingMini,
38271
- baseBorderRadius: baseBorderRadius,
38272
- borderRadiusLarge: borderRadiusLarge,
38273
- borderRadiusSmall: borderRadiusSmall,
38274
- tableBackground: tableBackground,
38275
- tableBackgroundAccent: tableBackgroundAccent,
38276
- tableBackgroundHover: tableBackgroundHover,
38277
- tableBorder: tableBorder,
38278
- btnBackground: btnBackground,
38279
- btnBackgroundHighlight: btnBackgroundHighlight,
38280
- btnBorder: btnBorder,
38281
- btnPrimaryBackground: btnPrimaryBackground,
38282
- btnPrimaryBackgroundHighlight: btnPrimaryBackgroundHighlight,
38283
- btnInfoBackground: btnInfoBackground,
38284
- btnInfoBackgroundHighlight: btnInfoBackgroundHighlight,
38285
- btnSuccessBackground: btnSuccessBackground,
38286
- btnSuccessBackgroundHighlight: btnSuccessBackgroundHighlight,
38287
- btnWarningBackground: btnWarningBackground,
38288
- btnWarningBackgroundHighlight: btnWarningBackgroundHighlight,
38289
- btnDangerBackground: btnDangerBackground,
38290
- btnDangerBackgroundHighlight: btnDangerBackgroundHighlight,
38291
- btnInverseBackground: btnInverseBackground,
38292
- btnInverseBackgroundHighlight: btnInverseBackgroundHighlight,
38293
- inputBackground: inputBackground,
38294
- inputBorder: inputBorder,
38295
- inputBorderRadius: inputBorderRadius,
38296
- inputDisabledBackground: inputDisabledBackground,
38297
- formActionsBackground: formActionsBackground,
38298
- inputHeight: inputHeight,
38299
- dropdownBackground: dropdownBackground,
38300
- dropdownBorder: dropdownBorder,
38301
- dropdownDividerTop: dropdownDividerTop,
38302
- dropdownDividerBottom: dropdownDividerBottom,
38303
- dropdownLinkColor: dropdownLinkColor,
38304
- dropdownLinkColorHover: dropdownLinkColorHover,
38305
- dropdownLinkColorActive: dropdownLinkColorActive,
38306
- dropdownLinkBackgroundActive: dropdownLinkBackgroundActive,
38307
- dropdownLinkBackgroundHover: dropdownLinkBackgroundHover,
38308
- zindexDropdown: zindexDropdown,
38309
- zindexPopover: zindexPopover,
38310
- zindexTooltip: zindexTooltip,
38311
- zindexFixedNavbar: zindexFixedNavbar,
38312
- zindexHeader: zindexHeader,
38313
- zindexModalBackdrop: zindexModalBackdrop,
38314
- zindexModal: zindexModal,
38315
- zindexAboveModal: zindexAboveModal,
38316
- iconSpritePath: iconSpritePath,
38317
- iconWhiteSpritePath: iconWhiteSpritePath,
38318
- placeholderText: placeholderText,
38319
- hrBorder: hrBorder,
38320
- horizontalComponentOffset: horizontalComponentOffset,
38321
- wellBackground: wellBackground,
38322
- navbarCollapseWidth: navbarCollapseWidth,
38323
- navbarCollapseDesktopWidth: navbarCollapseDesktopWidth,
38324
- navbarHeight: navbarHeight,
38325
- navbarBackgroundHighlight: navbarBackgroundHighlight,
38326
- navbarBackground: navbarBackground,
38327
- navbarBorder: navbarBorder,
38328
- navbarText: navbarText,
38329
- navbarLinkColor: navbarLinkColor,
38330
- navbarLinkColorHover: navbarLinkColorHover,
38331
- navbarLinkColorActive: navbarLinkColorActive,
38332
- navbarLinkBackgroundHover: navbarLinkBackgroundHover,
38333
- navbarLinkBackgroundActive: navbarLinkBackgroundActive,
38334
- navbarBrandColor: navbarBrandColor,
38335
- navbarInverseBackground: navbarInverseBackground,
38336
- navbarInverseBackgroundHighlight: navbarInverseBackgroundHighlight,
38337
- navbarInverseBorder: navbarInverseBorder,
38338
- navbarInverseText: navbarInverseText,
38339
- navbarInverseLinkColor: navbarInverseLinkColor,
38340
- navbarInverseLinkColorHover: navbarInverseLinkColorHover,
38341
- navbarInverseLinkColorActive: navbarInverseLinkColorActive,
38342
- navbarInverseLinkBackgroundHover: navbarInverseLinkBackgroundHover,
38343
- navbarInverseLinkBackgroundActive: navbarInverseLinkBackgroundActive,
38344
- navbarInverseSearchBackground: navbarInverseSearchBackground,
38345
- navbarInverseSearchBackgroundFocus: navbarInverseSearchBackgroundFocus,
38346
- navbarInverseSearchBorder: navbarInverseSearchBorder,
38347
- navbarInverseSearchPlaceholderColor: navbarInverseSearchPlaceholderColor,
38348
- navbarInverseBrandColor: navbarInverseBrandColor,
38349
- paginationBackground: paginationBackground,
38350
- paginationBorder: paginationBorder,
38351
- paginationActiveBackground: paginationActiveBackground,
38352
- heroUnitBackground: heroUnitBackground,
38353
- heroUnitHeadingColor: heroUnitHeadingColor,
38354
- heroUnitLeadColor: heroUnitLeadColor,
38355
- warningText: warningText,
38356
- warningBackground: warningBackground,
38357
- warningBorder: warningBorder,
38358
- errorText: errorText,
38359
- errorBackground: errorBackground,
38360
- errorBorder: errorBorder,
38361
- successText: successText,
38362
- successBackground: successBackground,
38363
- successBorder: successBorder,
38364
- infoText: infoText,
38365
- infoBackground: infoBackground,
38366
- infoBorder: infoBorder,
38367
- tooltipColor: tooltipColor,
38368
- tooltipBackground: tooltipBackground,
38369
- tooltipArrowWidth: tooltipArrowWidth,
38370
- tooltipArrowColor: tooltipArrowColor,
38371
- popoverBackground: popoverBackground,
38372
- popoverArrowWidth: popoverArrowWidth,
38373
- popoverArrowColor: popoverArrowColor,
38374
- popoverTitleBackground: popoverTitleBackground,
38375
- popoverArrowOuterWidth: popoverArrowOuterWidth,
38376
- popoverArrowOuterColor: popoverArrowOuterColor,
38377
- gridColumns: gridColumns,
38378
- gridColumnWidth: gridColumnWidth,
38379
- gridGutterWidth: gridGutterWidth,
38380
- gridRowWidth: gridRowWidth,
38381
- gridColumnWidth1200: gridColumnWidth1200,
38382
- gridGutterWidth1200: gridGutterWidth1200,
38383
- gridRowWidth1200: gridRowWidth1200,
38384
- gridColumnWidth768: gridColumnWidth768,
38385
- gridGutterWidth768: gridGutterWidth768,
38386
- gridRowWidth768: gridRowWidth768,
38387
- fluidGridColumnWidth: fluidGridColumnWidth,
38388
- fluidGridGutterWidth: fluidGridGutterWidth,
38389
- fluidGridColumnWidth1200: fluidGridColumnWidth1200,
38390
- fluidGridGutterWidth1200: fluidGridGutterWidth1200,
38391
- fluidGridColumnWidth768: fluidGridColumnWidth768,
38392
- fluidGridGutterWidth768: fluidGridGutterWidth768,
38393
- kaGreen: kaGreen,
38394
- kaGreenLight: kaGreenLight,
38395
- kaBlue: kaBlue,
38396
- kaBlueLight: kaBlueLight,
38397
- grayExtraDark: grayExtraDark,
38398
- grayExtraLight: grayExtraLight,
38399
- graySuperLight: graySuperLight,
38400
- whiteDark: whiteDark,
38401
- dark: dark,
38402
- blueDarkUnsaturated: blueDarkUnsaturated,
38403
- blueDarkSaturated: blueDarkSaturated,
38404
- blueLight: blueLight,
38405
- greenLight: greenLight,
38406
- greenDark: greenDark,
38407
- yellowGreen: yellowGreen,
38408
- okGreen: okGreen,
38409
- alertRed: alertRed,
38410
- coral: coral,
38411
- grayBlue: grayBlue,
38412
- lightPageBackground: lightPageBackground,
38413
- yclaBlue: yclaBlue,
38414
- yclaTeal: yclaTeal,
38415
- yclaTealDark: yclaTealDark,
38416
- yclaGreenDark: yclaGreenDark,
38417
- yclaGreen: yclaGreen,
38418
- learnstormBlue: learnstormBlue,
38419
- homepageBlue: homepageBlue,
38420
- backgroundBlue: backgroundBlue,
38421
- teacherSignupBlue: teacherSignupBlue,
38422
- homepageGreen: homepageGreen,
38423
- streakColor: streakColor,
38424
- facebookColor: facebookColor,
38425
- blueGoogleColor: blueGoogleColor,
38426
- redGoogleColor: redGoogleColor,
38427
- homepageColor: homepageColor,
38428
- lightTextColor: lightTextColor,
38429
- fontSizeTiny: fontSizeTiny,
38430
- fontSizeNormal: fontSizeNormal,
38431
- fontSizeMedium: fontSizeMedium,
38432
- fontSizeExtraLarge: fontSizeExtraLarge,
38433
- fontSizeHuge: fontSizeHuge,
38434
- fontSizeBakana: fontSizeBakana,
38435
- fontSizeBananas: fontSizeBananas,
38436
- fixedWidthFontFamily: fixedWidthFontFamily,
38437
- contentPadding: contentPadding,
38438
- primaryButtonBackground: primaryButtonBackground,
38439
- primaryButtonBorder: primaryButtonBorder,
38440
- buttonTextColor: buttonTextColor,
38441
- buttonBorderRadius: buttonBorderRadius,
38442
- basicBorderColor: basicBorderColor,
38443
- minContainerWidth: minContainerWidth,
38444
- maxContainerWidth: maxContainerWidth,
38445
- formHintColor: formHintColor,
38446
- guidelineExampleText: guidelineExampleText,
38447
- hoverCardWidth: hoverCardWidth,
38448
- menuHighlightColor: menuHighlightColor,
38449
- menuHighlightBorderColor: menuHighlightBorderColor,
38450
- menuActiveTextColor: menuActiveTextColor,
38451
- menuInactiveTextColor: menuInactiveTextColor,
38452
- menuSubheaderTextColor: menuSubheaderTextColor,
38453
- menuBorderColor: menuBorderColor,
38454
- unreadBackgroundColor: unreadBackgroundColor,
38455
- menuLineHeight: menuLineHeight,
38456
- menuSubheaderLineHeight: menuSubheaderLineHeight,
38457
- menuSubheaderFontSize: menuSubheaderFontSize,
38458
- notificationBarColor: notificationBarColor,
38459
- modalBodyTopPadding: modalBodyTopPadding,
38460
- modalDialogPadding: modalDialogPadding,
38461
- modalSectionPadding: modalSectionPadding,
38462
- mathDomain1: mathDomain1,
38463
- mathDomain2: mathDomain2,
38464
- mathDomain3: mathDomain3,
38465
- mathDomain4: mathDomain4,
38466
- partnerContentDomain1: partnerContentDomain1,
38467
- partnerContentDomain2: partnerContentDomain2,
38468
- partnerContentDomain3: partnerContentDomain3,
38469
- partnerContentDomain4: partnerContentDomain4,
38470
- csDomain1: csDomain1,
38471
- csDomain2: csDomain2,
38472
- csDomain3: csDomain3,
38473
- csDomain4: csDomain4,
38474
- economicsDomain1: economicsDomain1,
38475
- economicsDomain2: economicsDomain2,
38476
- economicsDomain3: economicsDomain3,
38477
- economicsDomain4: economicsDomain4,
38478
- collegeCareersMoreDomain1: collegeCareersMoreDomain1,
38479
- collegeCareersMoreDomain2: collegeCareersMoreDomain2,
38480
- collegeCareersMoreDomain3: collegeCareersMoreDomain3,
38481
- collegeCareersMoreDomain4: collegeCareersMoreDomain4,
38482
- humanitiesDomain1: humanitiesDomain1,
38483
- humanitiesDomain2: humanitiesDomain2,
38484
- humanitiesDomain3: humanitiesDomain3,
38485
- humanitiesDomain4: humanitiesDomain4,
38486
- gtpDomain1: gtpDomain1,
38487
- gtpDomain2: gtpDomain2,
38488
- gtpDomain3: gtpDomain3,
38489
- gtpDomain4: gtpDomain4,
38490
- scienceDomain1: scienceDomain1,
38491
- scienceDomain2: scienceDomain2,
38492
- scienceDomain3: scienceDomain3,
38493
- scienceDomain4: scienceDomain4,
38494
- testPrepDomain1: testPrepDomain1,
38495
- testPrepDomain2: testPrepDomain2,
38496
- testPrepDomain3: testPrepDomain3,
38497
- testPrepDomain4: testPrepDomain4,
38498
- defaultDomain1: defaultDomain1,
38499
- defaultDomain2: defaultDomain2,
38500
- defaultDomain3: defaultDomain3,
38501
- defaultDomain4: defaultDomain4,
38502
- defaultDomainColor: defaultDomainColor,
38503
- defaultSubjectColor: defaultSubjectColor,
38504
- defaultTopicColor: defaultTopicColor,
38505
- defaultHoverColor: defaultHoverColor,
38506
- defaultLinkColor: defaultLinkColor,
38507
- defaultLinkHoverColor: defaultLinkHoverColor,
38508
- scienceDomainColor: scienceDomainColor,
38509
- scienceSubjectColor: scienceSubjectColor,
38510
- scienceTopicColor: scienceTopicColor,
38511
- scienceHoverColor: scienceHoverColor,
38512
- scienceLinkColor: scienceLinkColor,
38513
- scienceLinkHoverColor: scienceLinkHoverColor,
38514
- humanitiesDomainColor: humanitiesDomainColor,
38515
- humanitiesSubjectColor: humanitiesSubjectColor,
38516
- humanitiesTopicColor: humanitiesTopicColor,
38517
- humanitiesHoverColor: humanitiesHoverColor,
38518
- humanitiesLinkColor: humanitiesLinkColor,
38519
- humanitiesLinkHoverColor: humanitiesLinkHoverColor,
38520
- economicsDomainColor: economicsDomainColor,
38521
- economicsSubjectColor: economicsSubjectColor,
38522
- economicsTopicColor: economicsTopicColor,
38523
- economicsHoverColor: economicsHoverColor,
38524
- economicsLinkColor: economicsLinkColor,
38525
- economicsLinkHoverColor: economicsLinkHoverColor,
38526
- csDomainColor: csDomainColor,
38527
- csSubjectColor: csSubjectColor,
38528
- csTopicColor: csTopicColor,
38529
- csHoverColor: csHoverColor,
38530
- csLinkColor: csLinkColor,
38531
- csLinkHoverColor: csLinkHoverColor,
38532
- partnerContentDomainColor: partnerContentDomainColor,
38533
- partnerContentSubjectColor: partnerContentSubjectColor,
38534
- partnerContentTopicColor: partnerContentTopicColor,
38535
- partnerContentHoverColor: partnerContentHoverColor,
38536
- partnerContentLinkColor: partnerContentLinkColor,
38537
- partnerContentLinkHoverColor: partnerContentLinkHoverColor,
38538
- essayDomainColor: essayDomainColor,
38539
- mathDomainColor: mathDomainColor,
38540
- mathSubjectColor: mathSubjectColor,
38541
- mathTopicColor: mathTopicColor,
38542
- mathHoverColor: mathHoverColor,
38543
- mathLinkColor: mathLinkColor,
38544
- mathLinkHoverColor: mathLinkHoverColor,
38545
- testPrepDomainColor: testPrepDomainColor,
38546
- testPrepSubjectColor: testPrepSubjectColor,
38547
- testPrepTopicColor: testPrepTopicColor,
38548
- testPrepHoverColor: testPrepHoverColor,
38549
- testPrepLinkColor: testPrepLinkColor,
38550
- testPrepLinkHoverColor: testPrepLinkHoverColor,
38551
- collegeCareersMoreDomainColor: collegeCareersMoreDomainColor,
38552
- collegeCareersMoreSubjectColor: collegeCareersMoreSubjectColor,
38553
- collegeCareersMoreTopicColor: collegeCareersMoreTopicColor,
38554
- collegeCareersMoreHoverColor: collegeCareersMoreHoverColor,
38555
- collegeCareersMoreLinkColor: collegeCareersMoreLinkColor,
38556
- collegeCareersMoreLinkHoverColor: collegeCareersMoreLinkHoverColor,
38557
- colorProficient: colorProficient,
38558
- colorPracticed: colorPracticed,
38559
- colorMastery1: colorMastery1,
38560
- colorMastery2: colorMastery2,
38561
- colorMastery3: colorMastery3,
38562
- colorSuggested: colorSuggested,
38563
- colorReview: colorReview,
38564
- colorNotStarted: colorNotStarted,
38565
- colorStarted: colorStarted,
38566
- colorStruggling: colorStruggling,
38567
- colorPersonal: colorPersonal,
38568
- colorPractice: colorPractice,
38569
- colorEnergyPoints: colorEnergyPoints,
38570
- pureSmMin: pureSmMin,
38571
- pureMdMin: pureMdMin,
38572
- pureLgMin: pureLgMin,
38573
- pureXlMin: pureXlMin,
38574
- pureXsMax: pureXsMax,
38575
- pureSmMax: pureSmMax,
38576
- pureMdMax: pureMdMax,
38577
- pureLgMax: pureLgMax
38578
- });
38579
-
38580
- const colors = {
38581
- white: "#FFFFFF",
38582
- gray98: "#FAFAFA",
38583
- gray97: "#F6F7F7",
38584
- gray95: "#F0F1F2",
38585
- gray90: "#E3E5E6",
38586
- gray85: "#D6D8DA",
38587
- gray76: "#BABEC2",
38588
- gray72: "#999A9D",
38589
- gray68: "#888D93",
38590
- gray55: "#707378",
38591
- gray41: "#626569",
38592
- gray25: "#3B3E40",
38593
- gray17: "#21242C",
38594
- gray10: "#1499af",
38595
- black: "#000000",
38596
- // These colors are pulled out from constants.js, which is itself generated
38597
- // from variables.less. We should probably avoid duplicating these here.
38598
- alertRed,
38599
- homepageBlue,
38600
- kaBlue,
38601
- kaBlueLight,
38602
- kaGreen,
38603
- kaGreenLight,
38604
- learnstormBlue,
38605
- backgroundBlue,
38606
- adminGreen: "#78C008",
38607
- kaBlueExtraLight: "#39c2db",
38608
- kaBlueHover: "#0c7f99",
38609
- kaGreenHover: "#518005",
38610
- // Domain-agnostic colors related to the study guide experience in the
38611
- // content library.
38612
- skyDark: "#001f4d",
38613
- recommendationGold: "#ffbe26",
38614
- starAced: "#ff9c39",
38615
- // We interploate the domain colors into this colors object for
38616
- // historical reasons, but everyone using domain-specific colors
38617
- // should switch to using the domainColors() function to look up
38618
- // colors instead.
38619
- //
38620
- // TODO(davidflanagan): remove this line once everything is
38621
- // working correctly with the domainColors() accessor.
38622
- // ...domainToColorsMap,
38623
- // mission: missionColors,
38624
-
38625
- // Colors for various OAuth providers
38626
- google: "#C1432f",
38627
- modernGoogle: "#be2612",
38628
- modernGoogleHover: "#8c1c0d",
38629
- facebook: "#4267B2",
38630
- modernFacebook: "#4267B2",
38631
- modernFacebookHover: "#00294a",
38632
- wonderBlocksGold: "#FFB100",
38633
- wonderBlocksLightBlue: "#37C5FD",
38634
- // We're using rgba instead of opacity to avoid affecting the focus outline
38635
- // when we just want to make the color transparent.
38636
- breadcrumbs: "rgba(255, 255, 255, 0.7)"
38637
- };
38638
- const borderRadius = 4;
38639
- const breadcrumbStyles = {
38640
- color: colors.breadcrumbs,
37935
+ // TODO: can we use WB typography?
37936
+ const bodyXsmallBold = {
37937
+ // For emphasized metadata, descriptions, etc
38641
37938
  fontFamily: "inherit",
38642
37939
  fontSize: 15,
38643
37940
  fontWeight: "bold",
38644
- letterSpacing: 0.8,
38645
- lineHeight: "19px",
38646
- textTransform: "uppercase",
38647
- // Disable subpixel antialiasing for OSX (improves light on dark text)
38648
- MozOsxFontSmoothing: "grayscale",
38649
- WebkitFontSmoothing: "antialiased"
38650
- };
38651
- const fonts = {
38652
- // The body of the page is setup to use 'Helvetica' by default and
38653
- // 'Lato' if/once it downloads. For your elements to follow this
38654
- // pattern, all you need is to make the text in your element
38655
- // inherit from the body using the "inherit" value.
38656
- regular: "inherit"
38657
- };
38658
- const typography = {
38659
- // For subject names
38660
- subjectHeadingDesktop: {
38661
- fontFamily: "inherit",
38662
- fontSize: 50,
38663
- fontWeight: "bold",
38664
- lineHeight: "61px"
38665
- },
38666
- subjectHeadingMobile: {
38667
- fontFamily: "inherit",
38668
- fontSize: 35,
38669
- fontWeight: "bold",
38670
- lineHeight: "37px"
38671
- },
38672
- // For the most important thing on the page
38673
- conceptHeadingDesktop: {
38674
- fontFamily: "inherit",
38675
- fontSize: 35,
38676
- fontWeight: "bold",
38677
- lineHeight: "37px"
38678
- },
38679
- conceptHeadingMobile: {
38680
- fontFamily: "inherit",
38681
- fontSize: 23,
38682
- fontWeight: "bold",
38683
- lineHeight: "27px"
38684
- },
38685
- // For sections or modules
38686
- subheadingDesktop: {
38687
- fontFamily: "inherit",
38688
- fontSize: 23,
38689
- fontWeight: "bold",
38690
- lineHeight: "27px"
38691
- },
38692
- subheadingMobile: {
38693
- fontFamily: "inherit",
38694
- fontSize: 20,
38695
- fontWeight: "bold",
38696
- lineHeight: "24px"
38697
- },
38698
- smallSubheadingDesktop: {
38699
- fontFamily: "inherit",
38700
- fontSize: 20,
38701
- lineHeight: 1.25
38702
- },
38703
- smallSubheadingMobile: {
38704
- fontFamily: "inherit",
38705
- fontSize: 15,
38706
- lineHeight: 1.25
38707
- },
38708
- // For callouts
38709
- smallHeading: {
38710
- color: colors.gray25,
38711
- fontFamily: "inherit",
38712
- fontSize: 17,
38713
- fontWeight: "bold",
38714
- lineHeight: "23px"
38715
- },
38716
- smallHeadingMobile: {
38717
- color: colors.gray25,
38718
- fontFamily: "inherit",
38719
- fontSize: 15,
38720
- fontWeight: "bold",
38721
- lineHeight: "18px"
38722
- },
38723
- // Accent headings
38724
- accentHeading: {
38725
- color: colors.gray68,
38726
- fontFamily: "inherit",
38727
- fontSize: 15,
38728
- fontWeight: "bold",
38729
- letterSpacing: 0.8,
38730
- lineHeight: "19px",
38731
- textTransform: "uppercase"
38732
- },
38733
- bodyLarge: {
38734
- // For articles with multiple paragraphs
38735
- fontFamily: fonts.regular,
38736
- fontSize: 20,
38737
- lineHeight: "30px"
38738
- },
38739
- bodySmall: {
38740
- // For small blocks of copy
38741
- fontFamily: fonts.regular,
38742
- fontSize: 17,
38743
- fontWeight: "normal",
38744
- lineHeight: "23px"
38745
- },
38746
- bodySmallBold: {
38747
- // For small blocks of copy
38748
- fontFamily: fonts.regular,
38749
- fontSize: 17,
38750
- fontWeight: "bold",
38751
- lineHeight: "23px"
38752
- },
38753
- bodyXsmall: {
38754
- // For metadata, descriptions, etc
38755
- fontFamily: fonts.regular,
38756
- fontSize: 15,
38757
- lineHeight: "22px"
38758
- },
38759
- bodyXsmallBold: {
38760
- // For emphasized metadata, descriptions, etc
38761
- fontFamily: "inherit",
38762
- fontSize: 15,
38763
- fontWeight: "bold",
38764
- lineHeight: "22px"
38765
- },
38766
- breadcrumb: breadcrumbStyles,
38767
- // For in-page tabs, breadcrumbs
38768
- breadcrumbSmall: {
38769
- // For in-page tabs and leaf page breadcrumbs
38770
- ...breadcrumbStyles,
38771
- fontSize: 12,
38772
- lineHeight: "13px"
38773
- },
38774
- labelLarge: {
38775
- // For chiclets and thumbnail titles
38776
- fontFamily: "inherit",
38777
- fontSize: 23,
38778
- fontWeight: "bold",
38779
- lineHeight: "27px"
38780
- },
38781
- labelMedium: {
38782
- // For chiclets and thumbnail titles
38783
- fontFamily: "inherit",
38784
- fontSize: 15,
38785
- fontWeight: "bold",
38786
- lineHeight: "18px"
38787
- },
38788
- labelSmall: {
38789
- // Generally used with labelLarge, for breadcrumbs in thumbnails
38790
- fontFamily: fonts.regular,
38791
- fontSize: 12,
38792
- lineHeight: "14px"
38793
- },
38794
- caption: {
38795
- // For image captions
38796
- fontFamily: fonts.regular,
38797
- fontSize: 14,
38798
- fontStyle: "italic",
38799
- lineHeight: "17px"
38800
- },
38801
- desktopScalingOnMobile: {
38802
- // For when you need Mobile Safari and friends to stick to desktop
38803
- // sizes
38804
- MozTextSizeAdjust: "100%",
38805
- MsTextSizeAdjust: "100%",
38806
- WebkitTextSizeAdjust: "100%"
38807
- },
38808
- // TODO (josh): This should move to within <ModalHeader>
38809
- modalSubtitle: {
38810
- fontSize: 12,
38811
- lineHeight: 1.65,
38812
- // NOTE (josh): Font smoothing used here to create a 'medium' weight
38813
- // font, between normal and bold, on webkit browsers.
38814
- // This prop is an a11y risk when used on non-bold text, since it
38815
- // makes text very thin, but it's fine on bold text.
38816
- WebkitFontSmoothing: "antialiased",
38817
- fontWeight: "bold"
38818
- },
38819
- // HACK(kevinb): temporary wonder blocks styles for header only
38820
- // TODO(kevinb): use components from wonder-blocks-typography instead
38821
- wonderBlocksHeader: {
38822
- paddingLeft: 16,
38823
- paddingRight: 16,
38824
- paddingBottom: 24,
38825
- paddingTop: 34,
38826
- [mediaQueries.mdOrLarger]: {
38827
- paddingBottom: 32
38828
- }
38829
- },
38830
- // HACK(kevinb): temporary wonder blocks styles for header only
38831
- // TODO(kevinb): use components from wonder-blocks-typography instead
38832
- wonderBlocksTitle: {
38833
- color: colors.white,
38834
- fontWeight: 900,
38835
- // "Black" weight
38836
- fontSize: 28,
38837
- lineHeight: "32px",
38838
- margin: 0,
38839
- [mediaQueries.mdOrLarger]: {
38840
- fontSize: 36,
38841
- lineHeight: "40px"
38842
- }
38843
- },
38844
- // HACK(kevinb): temporary wonder blocks styles for header only
38845
- // TODO(kevinb): use components from wonder-blocks-typography instead
38846
- wonderBlocksLabelLarge: {
38847
- fontSize: 16,
38848
- lineHeight: "20px",
38849
- fontWeight: 700 // Bold
38850
- }
37941
+ lineHeight: "22px"
38851
37942
  };
38852
37943
 
38853
- var globalStyles = /*#__PURE__*/Object.freeze({
38854
- __proto__: null,
38855
- colors: colors,
38856
- borderRadius: borderRadius,
38857
- fonts: fonts,
38858
- typography: typography
38859
- });
38860
-
38861
37944
  const AnswerChoices = props => {
38862
37945
  const {
38863
37946
  strings
@@ -39775,7 +38858,7 @@ const styles$a = aphrodite.StyleSheet.create({
39775
38858
  paddingBottom: 16
39776
38859
  },
39777
38860
  instructionsCaption: {
39778
- ...typography.bodyXsmallBold,
38861
+ ...bodyXsmallBold,
39779
38862
  paddingBottom: 16
39780
38863
  },
39781
38864
  instructionsChoices: {
@@ -40749,9 +39832,9 @@ var Matcher$1 = {
40749
39832
  validator: matcherValidator
40750
39833
  };
40751
39834
 
40752
- function matrixValidator(state, rubric, strings) {
39835
+ function matrixValidator(userInput, rubric, strings) {
40753
39836
  const solution = rubric.answers;
40754
- const supplied = state.answers;
39837
+ const supplied = userInput.answers;
40755
39838
  const solutionSize = getMatrixSize(solution);
40756
39839
  const suppliedSize = getMatrixSize(supplied);
40757
39840
  const incorrectSize = solutionSize[0] !== suppliedSize[0] || solutionSize[1] !== suppliedSize[1];
@@ -43610,9 +42693,9 @@ const makeSafeUrl = (urlString, locale) => {
43610
42693
  };
43611
42694
  const styles$6 = aphrodite.StyleSheet.create({
43612
42695
  widgetContainer: {
43613
- borderRadius: borderRadiusLarge,
42696
+ borderRadius: 6,
43614
42697
  borderWidth: 1,
43615
- borderColor: basicBorderColor,
42698
+ borderColor: "#CCC",
43616
42699
  padding: wonderBlocksTokens.spacing.medium_16,
43617
42700
  paddingBottom: 0
43618
42701
  },
@@ -45101,7 +44184,7 @@ const init = function (options) {
45101
44184
 
45102
44185
  // This file is processed by a Rollup plugin (replace) to inject the production
45103
44186
  const libName = "@khanacademy/perseus";
45104
- const libVersion = "39.0.0";
44187
+ const libVersion = "40.0.0";
45105
44188
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
45106
44189
 
45107
44190
  const apiVersion = {
@@ -45382,7 +44465,7 @@ const styles$3 = aphrodite.StyleSheet.create({
45382
44465
  },
45383
44466
  lastRenderedNewHint: {
45384
44467
  marginBottom: 0,
45385
- borderLeftColor: kaGreen$1
44468
+ borderLeftColor: kaGreen
45386
44469
  }
45387
44470
  });
45388
44471
 
@@ -45573,7 +44656,7 @@ const styles$2 = aphrodite.StyleSheet.create({
45573
44656
  fontSize: "100%",
45574
44657
  fontFamily: "inherit",
45575
44658
  fontWeight: "bold",
45576
- color: kaGreen$1,
44659
+ color: kaGreen,
45577
44660
  padding: 0,
45578
44661
  position: "relative"
45579
44662
  },
@@ -45975,28 +45058,6 @@ const ref = /*#__PURE__*/React__namespace.forwardRef((props, ref) => /*#__PURE__
45975
45058
  }));
45976
45059
  }));
45977
45060
 
45978
- const devices = {
45979
- PHONE: "phone",
45980
- TABLET: "tablet",
45981
- DESKTOP: "desktop"
45982
- };
45983
-
45984
- // How many pixels do we reserve on the right-hand side of a preview
45985
- // for displaying lint indicators? This space needs to be reserved
45986
- // in DeviceFramer, but it is actually allocated in PerseusFrame
45987
- const lintGutterWidth = 36;
45988
-
45989
- // How wide a border does PerseusFrame draw? We need to allocate enough
45990
- // space for it in DeviceFramer.
45991
- const perseusFrameBorderWidth = 1;
45992
-
45993
- var constants = /*#__PURE__*/Object.freeze({
45994
- __proto__: null,
45995
- devices: devices,
45996
- lintGutterWidth: lintGutterWidth,
45997
- perseusFrameBorderWidth: perseusFrameBorderWidth
45998
- });
45999
-
46000
45061
  /**
46001
45062
  * Traverses a {content, widgets, images} renderer props object,
46002
45063
  * such as `itemData.question`
@@ -48689,6 +47750,18 @@ const EditorJsonify = {
48689
47750
  }
48690
47751
  };
48691
47752
 
47753
+ /**
47754
+ * Main entry point
47755
+ */
47756
+ const GrapherUtil = {
47757
+ allTypes,
47758
+ DEFAULT_GRAPHER_PROPS,
47759
+ chooseType,
47760
+ defaultPlotProps,
47761
+ getEquationString,
47762
+ typeToButton
47763
+ };
47764
+
48692
47765
  exports.ApiOptions = ApiOptions;
48693
47766
  exports.ArticleRenderer = ArticleRenderer;
48694
47767
  exports.BaseRadio = BaseRadio;
@@ -48698,7 +47771,7 @@ exports.ClassNames = ClassNames;
48698
47771
  exports.Dependencies = dependencies;
48699
47772
  exports.EditorJsonify = EditorJsonify;
48700
47773
  exports.Expression = Expression;
48701
- exports.GrapherUtil = util;
47774
+ exports.GrapherUtil = GrapherUtil;
48702
47775
  exports.GrapherWidget = Grapher$1;
48703
47776
  exports.HintRenderer = HintRenderer;
48704
47777
  exports.HintsRenderer = HintsRenderer;
@@ -48722,17 +47795,17 @@ exports.QUESTION_WIDGETS = QUESTION_WIDGETS;
48722
47795
  exports.Radio = Radio;
48723
47796
  exports.Renderer = Renderer;
48724
47797
  exports.ServerItemRenderer = ref;
48725
- exports.SizingUtils = sizingUtils;
48726
47798
  exports.TableWidget = Table$1;
48727
47799
  exports.Util = Util;
48728
47800
  exports.WIDGET_PROP_DENYLIST = denylist;
48729
47801
  exports.Widgets = widgets$1;
48730
47802
  exports.addWidget = addWidget;
48731
47803
  exports.apiVersion = apiVersion;
47804
+ exports.bodyXsmallBold = bodyXsmallBold;
48732
47805
  exports.buildEmptyItemTreeForShape = buildEmptyItemTreeForShape;
48733
47806
  exports.buildMapper = buildMapper;
48734
47807
  exports.components = components;
48735
- exports.constants = constants;
47808
+ exports.containerSizeClass = containerSizeClass;
48736
47809
  exports.contentHasWidgetType = contentHasWidgetType;
48737
47810
  exports.convertWidgetNameToEnum = convertWidgetNameToEnum;
48738
47811
  exports.displaySigFigs = displaySigFigs;
@@ -48750,6 +47823,7 @@ exports.getCircleCoords = getCircleCoords;
48750
47823
  exports.getClockwiseAngle = getClockwiseAngle;
48751
47824
  exports.getCorrectAnswerForWidgetId = getCorrectAnswerForWidgetId;
48752
47825
  exports.getImagesWithoutAltData = getImagesWithoutAltData;
47826
+ exports.getInteractiveBoxFromSizeClass = getInteractiveBoxFromSizeClass;
48753
47827
  exports.getLineCoords = getLineCoords;
48754
47828
  exports.getLinearSystemCoords = getLinearSystemCoords;
48755
47829
  exports.getPointCoords = getPointCoords;
@@ -48764,9 +47838,8 @@ exports.getWidgetIdsFromContentByType = getWidgetIdsFromContentByType;
48764
47838
  exports.getWidgetTypeByWidgetId = getWidgetTypeByWidgetId;
48765
47839
  exports.getWidgetsFromWidgetMap = getWidgetsFromWidgetMap;
48766
47840
  exports.getWidgetsMapFromItemData = getWidgetsMapFromItemData;
48767
- exports.globalConstants = globalConstants;
48768
- exports.globalStyles = globalStyles;
48769
- exports.icons = iconPaths;
47841
+ exports.iconChevronDown = iconChevronDown;
47842
+ exports.iconTrash = iconTrash;
48770
47843
  exports.init = init;
48771
47844
  exports.injectWidgets = injectWidgets;
48772
47845
  exports.interactiveSizes = interactiveSizes$1;