@doenet/doenetml 0.7.21-dev.361 → 0.7.21-dev.362

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.
Files changed (141) hide show
  1. package/{AnswerResponseButton-BzVcEOrl.js → AnswerResponseButton-FrNXi7jz.js} +8 -10
  2. package/{Description-CeDL7FZY.js → Description-D4h1QV0r.js} +20 -3
  3. package/{GraphFrame-8IPcvXqk.js → GraphFrame-7muJHYBu.js} +2 -2
  4. package/{JSXGraphRenderer-Be41lgIz.js → JSXGraphRenderer-DH6ZzfYT.js} +1 -1
  5. package/{NonInlineMediaWrapper-Tf8Bgp1V.js → NonInlineMediaWrapper-CqBvf7rz.js} +1 -1
  6. package/Viewer/DocViewer.d.ts.map +1 -1
  7. package/Viewer/coreWorkerBoot.d.ts.map +1 -1
  8. package/Viewer/renderers/_error.d.ts.map +1 -1
  9. package/Viewer/renderers/answer.d.ts.map +1 -1
  10. package/Viewer/renderers/booleanInput.d.ts.map +1 -1
  11. package/Viewer/renderers/choiceInput.d.ts.map +1 -1
  12. package/Viewer/renderers/containerBlock.d.ts.map +1 -1
  13. package/Viewer/renderers/containerInline.d.ts.map +1 -1
  14. package/Viewer/renderers/feedback.d.ts.map +1 -1
  15. package/Viewer/renderers/footnote.d.ts.map +1 -1
  16. package/Viewer/renderers/fractionInput.d.ts.map +1 -1
  17. package/Viewer/renderers/hint.d.ts.map +1 -1
  18. package/Viewer/renderers/list.d.ts.map +1 -1
  19. package/Viewer/renderers/mathInput.d.ts.map +1 -1
  20. package/Viewer/renderers/matrixInput.d.ts.map +1 -1
  21. package/Viewer/renderers/orbitalDiagramInput.d.ts.map +1 -1
  22. package/Viewer/renderers/p.d.ts.map +1 -1
  23. package/Viewer/renderers/pretzel.d.ts.map +1 -1
  24. package/Viewer/renderers/section.d.ts.map +1 -1
  25. package/Viewer/renderers/slider.d.ts.map +1 -1
  26. package/Viewer/renderers/solution.d.ts.map +1 -1
  27. package/Viewer/renderers/subsetOfRealsInput.d.ts.map +1 -1
  28. package/Viewer/renderers/summaryStatistics.d.ts.map +1 -1
  29. package/Viewer/renderers/textInput.d.ts.map +1 -1
  30. package/Viewer/renderers/utils/AnswerResponseButton.d.ts.map +1 -1
  31. package/Viewer/renderers/utils/Description.d.ts.map +1 -1
  32. package/Viewer/renderers/utils/checkWork.d.ts +5 -1
  33. package/Viewer/renderers/utils/checkWork.d.ts.map +1 -1
  34. package/Viewer/renderers/utils/disclosure.d.ts +16 -0
  35. package/Viewer/renderers/utils/disclosure.d.ts.map +1 -0
  36. package/Viewer/renderers/utils/validationState.d.ts +3 -1
  37. package/Viewer/renderers/utils/validationState.d.ts.map +1 -1
  38. package/Viewer/renderersLoadComponent.d.ts.map +1 -1
  39. package/{_error-DhRiszio.js → _error-BdTgXDgj.js} +4 -3
  40. package/{alert-CExDcbrh.js → alert-Bp9rBO1c.js} +3 -3
  41. package/{angle-FCTtCuvN.js → angle-xoJC6SFX.js} +6 -6
  42. package/{answer-BLusvBSG.js → answer-_Zvxo4jA.js} +8 -6
  43. package/{asList-Dv__hv6D.js → asList-DZD-Xdrj.js} +2 -2
  44. package/{blockQuote-B6Wtw4HN.js → blockQuote-CUi9cydG.js} +3 -3
  45. package/{boolean-IP59-Zjp.js → boolean-CX7vVQJz.js} +2 -2
  46. package/{booleanInput-BCNoC_vo.js → booleanInput-CceFBEy2.js} +9 -7
  47. package/{br-BqejfFtq.js → br-C_fdDVKv.js} +2 -2
  48. package/{button-DzYMy3G6.js → button-DBxivYmV.js} +4 -4
  49. package/{c-wV9nNSPC.js → c-Dr5FHPut.js} +3 -3
  50. package/{cell-Cfv7v4mc.js → cell-hqwqMA4A.js} +3 -3
  51. package/{choiceInput-BjbqDU9d.js → choiceInput-7JZaBHNZ.js} +10 -7
  52. package/{circle-CQ5lWEtc.js → circle-BqfCWmj2.js} +6 -6
  53. package/{cobwebPolyline-CAStHK_5.js → cobwebPolyline-JFOTL1HK.js} +4 -4
  54. package/{codeEditor-C2tiWOSh.js → codeEditor-oSH9duvd.js} +2 -2
  55. package/{composites-BVLPwfSW.js → composites-DbpoF3XJ.js} +1 -1
  56. package/{containerBlock-CLEUmhMM.js → containerBlock-BwJnX0UE.js} +7 -5
  57. package/{containerInline-kv3umsgq.js → containerInline-DSHf9h9o.js} +7 -5
  58. package/{curve-gdmcSsYU.js → curve-BH7j7hXT.js} +4 -4
  59. package/disclosure-axyZa36E.js +6 -0
  60. package/{doenetml-BXSsTmMg.js → doenetml-CCMBYR_b.js} +1712 -227
  61. package/doenetml-external-worker.js +2 -2
  62. package/doenetml-inline-worker.js +2 -2
  63. package/doenetml.d.ts.map +1 -1
  64. package/{ellipsis-D4fj-dH6.js → ellipsis-CQ4585lT.js} +2 -2
  65. package/{em-BLDmBPbZ.js → em-CYcBkUiA.js} +3 -3
  66. package/{embed-DFjdhAuI.js → embed-Be0he9Uz.js} +2 -2
  67. package/{feedback-BDSuY82b.js → feedback-ByTDuaNm.js} +7 -5
  68. package/{figure-DCQvyct_.js → figure-Dl_yKz7e.js} +3 -3
  69. package/{fillPatterns-DePmEjFP.js → fillPatterns-B-Wb7Rdw.js} +1 -1
  70. package/{footnote-EqPCQBWN.js → footnote-BpmhdxIC.js} +6 -8
  71. package/{fractionInput-CLSJPyA_.js → fractionInput-CCMZLzep.js} +10 -7
  72. package/{graph-C6hIOAwD.js → graph-CJRztDFF.js} +6 -6
  73. package/{hint-5LodBIQj.js → hint-39ljV3xf.js} +9 -9
  74. package/{hr-C9sb2QsS.js → hr-ACnfIwXC.js} +2 -2
  75. package/{image-CVqPuME4.js → image-DvAqXhei.js} +7 -7
  76. package/{index-yIMJFPe2.js → index-CMIXIik7.js} +1 -1
  77. package/{index.es-DnBW6AYz.js → index.es-p77isnix.js} +1 -1
  78. package/index.js +1 -1
  79. package/{label-BH-b9r-w.js → label-C63Ww5PO.js} +6 -6
  80. package/{labelWithLatex-DpzLXHtw.js → labelWithLatex-ClPeO6KG.js} +1 -1
  81. package/{legend-Dmq310xU.js → legend-BIyyKsy5.js} +4 -4
  82. package/{line-BerJZTGH.js → line-nzRw-2iw.js} +6 -6
  83. package/{lineFamilyDragHandlers-YfhC_Q94.js → lineFamilyDragHandlers-LT5y2nwm.js} +1 -1
  84. package/{lineSegment-BUtYPLbh.js → lineSegment-DEV7vXZ3.js} +5 -5
  85. package/{list-Ye_2Ltwm.js → list-0vosUKx2.js} +7 -5
  86. package/{lq-BiqdUNus.js → lq-C6SI-4Ja.js} +2 -2
  87. package/{lsq-DiKKUzSa.js → lsq-77sCkOO8.js} +2 -2
  88. package/{markupRenderer-Cb5alIAV.js → markupRenderer-BkS3m7gW.js} +1 -1
  89. package/{math-CIdkbUN1.js → math-dC5Avala.js} +6 -6
  90. package/{mathInput-BzRlJdzU.js → mathInput-Be03NUZy.js} +25 -13
  91. package/{matrixInput-DDs7lvBh.js → matrixInput-BZHnwuib.js} +23 -9
  92. package/{mdash-6RQrvN6B.js → mdash-D-AfwjXw.js} +2 -2
  93. package/{nbsp-Bv8MOxpQ.js → nbsp-D2K2UhZb.js} +2 -2
  94. package/{ndash-9o2u4hWP.js → ndash-DadHhIWX.js} +2 -2
  95. package/{number-CkoP-Awu.js → number-dzVGZ9ov.js} +6 -6
  96. package/{orbitalDiagram-B0YGzU6e.js → orbitalDiagram-Dxcuy3dt.js} +2 -2
  97. package/{orbitalDiagramInput-CMOVOQd6.js → orbitalDiagramInput-CI-jzpnD.js} +25 -10
  98. package/{p-Ds5IiZOP.js → p-pEbvJ23K.js} +7 -5
  99. package/package.json +1 -1
  100. package/{paginatorControls-2F08srE_.js → paginatorControls-DGwC24KV.js} +2 -2
  101. package/{pegboard-CJ7R1ORC.js → pegboard-DThvj_AK.js} +4 -4
  102. package/{point-DWqkuQLD.js → point-DRIItKT6.js} +6 -6
  103. package/{polygon-DVaeOcPw.js → polygon-CyiUEjCg.js} +6 -6
  104. package/{polyline-DQvHh8rj.js → polyline-Boz-zlQv.js} +5 -5
  105. package/{pre-C_MW5Olo.js → pre-Bjvq5iJ4.js} +3 -3
  106. package/{prefigure-Ci1f1zUh.js → prefigure-BPQPwHBD.js} +1 -1
  107. package/{pretzel-DVucy8kL.js → pretzel-CfNL3RKC.js} +10 -7
  108. package/{q-CNXXCBSX.js → q-DJbSp6bj.js} +3 -3
  109. package/{ray-DJJXgWjR.js → ray-BfGfX6gD.js} +5 -5
  110. package/{ref-Cd36RrOw.js → ref-B-M85Wgb.js} +2 -2
  111. package/{regionBetweenCurveXAxis-C4leqEex.js → regionBetweenCurveXAxis-CGlQKapF.js} +5 -5
  112. package/{regionBetweenCurves-BMps4Bio.js → regionBetweenCurves-DV7ARKKw.js} +5 -5
  113. package/{row-CbA-d6r0.js → row-DBEHryOQ.js} +2 -2
  114. package/{rq-DOr-Phc5.js → rq-DSkqTb4D.js} +2 -2
  115. package/{rsq-DIEK5RYn.js → rsq-CmYO91JS.js} +2 -2
  116. package/{section-DxVcSpPO.js → section-P6nedLi8.js} +26 -22
  117. package/{sha256-J35x7uWS-BC2XE0XO.js → sha256-J35x7uWS-BtnkRJk3.js} +1 -1
  118. package/{sideBySide-Dax2p65a.js → sideBySide-B__iobBS.js} +2 -2
  119. package/{slider-WcUbkagC.js → slider-Cj1kf_PL.js} +6 -5
  120. package/{solution-pYYqr4mI.js → solution-CugnzBD0.js} +10 -10
  121. package/{spreadsheet-BrvEPVkR.js → spreadsheet-BDQTKOo4.js} +2 -2
  122. package/{sq-CsVdwQ0w.js → sq-DRRKkcQ2.js} +3 -3
  123. package/style.css +7 -0
  124. package/{subsetOfRealsInput-C7LSCImc.js → subsetOfRealsInput-runRYoEh.js} +34 -6
  125. package/{summaryStatistics-Dx4n5bYn.js → summaryStatistics-CpAo0yUx.js} +11 -6
  126. package/{table-BCG2EBik.js → table-DFoJXU6W.js} +2 -2
  127. package/{tabular-DEiey_kF.js → tabular-CHSfbyFz.js} +2 -2
  128. package/{tag-CfZ-K_y5.js → tag-CgmbdQFT.js} +2 -2
  129. package/{text-C6U0VcDc.js → text-Cp6jnCrT.js} +6 -6
  130. package/{textInput-CaAFDfjE.js → textInput-Dqw-NXoY.js} +12 -9
  131. package/{tooltip-provider-kvNemycF.js → tooltip-provider-BTQ5leCb.js} +1 -1
  132. package/{useAnchoredGraphDragHandler-BUbd_SAk.js → useAnchoredGraphDragHandler-CoDUH2rg.js} +1 -1
  133. package/useDoenetRenderer-DAqF5zFD.js +114 -0
  134. package/{useSubmitActionWithDelay-BysJ9T7y.js → useSubmitActionWithDelay-DBHyoI8R.js} +52 -24
  135. package/utils/i18n.d.ts +46 -0
  136. package/utils/i18n.d.ts.map +1 -0
  137. package/validationState-DI_lxk1a.js +21 -0
  138. package/{vector-eEvp4DAc.js → vector-Dnoio46i.js} +6 -6
  139. package/{video-B7wOIA1h.js → video-DQw2pxWK.js} +4 -4
  140. package/useDoenetRenderer-BAq1ktng.js +0 -114
  141. package/validationState-CVwSJZpB.js +0 -13
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import React__default, { createContext, useRef, useEffect, useCallback, useState, useContext, useLayoutEffect, useMemo, isValidElement, forwardRef as forwardRef$3, createElement as createElement$3, useImperativeHandle, useReducer, createRef, useSyncExternalStore } from "react";
2
+ import React__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, useState, useLayoutEffect, isValidElement, forwardRef as forwardRef$3, createElement as createElement$3, useImperativeHandle, useReducer, createRef, useSyncExternalStore } from "react";
3
3
  import require$$2, { createPortal, flushSync } from "react-dom";
4
4
  function getDefaultExportFromCjs$5(x2) {
5
5
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -20730,7 +20730,7 @@ var forEachName$2, hasName$2, commonInit$2, mapTail$2, mapMethods$2, weakMapMeth
20730
20730
  })), isWeakSet_default$2, init_isWeakSet$2 = __esmMin$2((() => {
20731
20731
  init__tagTester$2(), isWeakSet_default$2 = tagTester$2(`WeakSet`);
20732
20732
  }));
20733
- function values$2(t4) {
20733
+ function values$3(t4) {
20734
20734
  for (var n2 = keys$3(t4), r2 = n2.length, i2 = Array(r2), a2 = 0; a2 < r2; a2++) i2[a2] = t4[n2[a2]];
20735
20735
  return i2;
20736
20736
  }
@@ -21327,7 +21327,7 @@ var init_some$2 = __esmMin$2((() => {
21327
21327
  init__cb$2(), init__isArrayLike$2(), init_keys$2();
21328
21328
  }));
21329
21329
  function contains$5(t4, n2, r2, i2) {
21330
- return _isArrayLike_default$2(t4) || (t4 = values$2(t4)), (typeof r2 != `number` || i2) && (r2 = 0), indexOf_default$2(t4, n2, r2) >= 0;
21330
+ return _isArrayLike_default$2(t4) || (t4 = values$3(t4)), (typeof r2 != `number` || i2) && (r2 = 0), indexOf_default$2(t4, n2, r2) >= 0;
21331
21331
  }
21332
21332
  var init_contains$2 = __esmMin$2((() => {
21333
21333
  init__isArrayLike$2(), init_values$2(), init_indexOf$2();
@@ -21359,7 +21359,7 @@ var init_where$2 = __esmMin$2((() => {
21359
21359
  function max$4(t4, n2, r2) {
21360
21360
  var i2 = -1 / 0, a2 = -1 / 0, o2, s2;
21361
21361
  if (n2 == null || typeof n2 == `number` && typeof t4[0] != `object` && t4 != null) {
21362
- t4 = _isArrayLike_default$2(t4) ? t4 : values$2(t4);
21362
+ t4 = _isArrayLike_default$2(t4) ? t4 : values$3(t4);
21363
21363
  for (var c2 = 0, l2 = t4.length; c2 < l2; c2++) o2 = t4[c2], o2 != null && o2 > i2 && (i2 = o2);
21364
21364
  } else n2 = cb$2(n2, r2), each$3(t4, function(t5, r3, o3) {
21365
21365
  s2 = n2(t5, r3, o3), (s2 > a2 || s2 === -1 / 0 && i2 === -1 / 0) && (i2 = t5, a2 = s2);
@@ -21372,7 +21372,7 @@ var init_max$2 = __esmMin$2((() => {
21372
21372
  function min$4(t4, n2, r2) {
21373
21373
  var i2 = 1 / 0, a2 = 1 / 0, o2, s2;
21374
21374
  if (n2 == null || typeof n2 == `number` && typeof t4[0] != `object` && t4 != null) {
21375
- t4 = _isArrayLike_default$2(t4) ? t4 : values$2(t4);
21375
+ t4 = _isArrayLike_default$2(t4) ? t4 : values$3(t4);
21376
21376
  for (var c2 = 0, l2 = t4.length; c2 < l2; c2++) o2 = t4[c2], o2 != null && o2 < i2 && (i2 = o2);
21377
21377
  } else n2 = cb$2(n2, r2), each$3(t4, function(t5, r3, o3) {
21378
21378
  s2 = n2(t5, r3, o3), (s2 < a2 || s2 === 1 / 0 && i2 === 1 / 0) && (i2 = t5, a2 = s2);
@@ -21383,13 +21383,13 @@ var init_min$2 = __esmMin$2((() => {
21383
21383
  init__isArrayLike$2(), init_values$2(), init__cb$2(), init_each$2();
21384
21384
  }));
21385
21385
  function toArray$3(t4) {
21386
- return t4 ? isArray_default$2(t4) ? slice$2.call(t4) : isString_default$2(t4) ? t4.match(reStrSymbol$2) : _isArrayLike_default$2(t4) ? map$3(t4, identity$4) : values$2(t4) : [];
21386
+ return t4 ? isArray_default$2(t4) ? slice$2.call(t4) : isString_default$2(t4) ? t4.match(reStrSymbol$2) : _isArrayLike_default$2(t4) ? map$3(t4, identity$4) : values$3(t4) : [];
21387
21387
  }
21388
21388
  var reStrSymbol$2, init_toArray$2 = __esmMin$2((() => {
21389
21389
  init_isArray$2(), init__setup$2(), init_isString$2(), init__isArrayLike$2(), init_map$2(), init_identity$2(), init_values$2(), reStrSymbol$2 = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
21390
21390
  }));
21391
21391
  function sample$2(t4, n2, r2) {
21392
- if (n2 == null || r2) return _isArrayLike_default$2(t4) || (t4 = values$2(t4)), t4[random$3(t4.length - 1)];
21392
+ if (n2 == null || r2) return _isArrayLike_default$2(t4) || (t4 = values$3(t4)), t4[random$3(t4.length - 1)];
21393
21393
  var i2 = toArray$3(t4), a2 = _getLength_default$2(i2);
21394
21394
  n2 = Math.max(Math.min(n2, a2), 0);
21395
21395
  for (var o2 = a2 - 1, s2 = 0; s2 < n2; s2++) {
@@ -21616,11 +21616,11 @@ var init_mixin$2 = __esmMin$2((() => {
21616
21616
  return t5 != null && (t5 = n2.apply(t5, arguments)), chainResult$2(this, t5);
21617
21617
  };
21618
21618
  }), underscore_array_methods_default$2 = _$1$2;
21619
- })), modules_exports$2 = __exportAll$2({ VERSION: () => VERSION$2, after: () => after$2, all: () => every$2, allKeys: () => allKeys$2, any: () => some$2, assign: () => extendOwn_default$2, before: () => before$2, bind: () => bind_default$2, bindAll: () => bindAll_default$2, chain: () => chain$4, chunk: () => chunk$2, clone: () => clone$5, collect: () => map$3, compact: () => compact$2, compose: () => compose$3, constant: () => constant$2, contains: () => contains$5, countBy: () => countBy_default$2, create: () => create$3, debounce: () => debounce$3, default: () => underscore_array_methods_default$2, defaults: () => defaults_default$2, defer: () => defer_default$2, delay: () => delay_default$2, detect: () => find$3, difference: () => difference_default$2, drop: () => rest$2, each: () => each$3, escape: () => escape_default$2, every: () => every$2, extend: () => extend_default$2, extendOwn: () => extendOwn_default$2, filter: () => filter$3, find: () => find$3, findIndex: () => findIndex_default$2, findKey: () => findKey$2, findLastIndex: () => findLastIndex_default$2, findWhere: () => findWhere$2, first: () => first$2, flatten: () => flatten$2$2, foldl: () => reduce_default$2, foldr: () => reduceRight_default$2, forEach: () => each$3, functions: () => functions$1$2, get: () => get$5, groupBy: () => groupBy_default$2, has: () => has$4, head: () => first$2, identity: () => identity$4, include: () => contains$5, includes: () => contains$5, indexBy: () => indexBy_default$2, indexOf: () => indexOf_default$2, initial: () => initial$2, inject: () => reduce_default$2, intersection: () => intersection$2, invert: () => invert$2, invoke: () => invoke_default$2, isArguments: () => isArguments_default$2, isArray: () => isArray_default$2, isArrayBuffer: () => isArrayBuffer_default$2, isBoolean: () => isBoolean$5, isDataView: () => isDataView_default$2, isDate: () => isDate_default$2, isElement: () => isElement$6, isEmpty: () => isEmpty$2, isEqual: () => isEqual$2, isError: () => isError_default$2, isFinite: () => isFinite$1$2, isFunction: () => isFunction_default$2, isMap: () => isMap_default$2, isMatch: () => isMatch$2, isNaN: () => isNaN$1$2, isNull: () => isNull$3, isNumber: () => isNumber_default$2, isObject: () => isObject$4, isRegExp: () => isRegExp_default$2, isSet: () => isSet_default$2, isString: () => isString_default$2, isSymbol: () => isSymbol_default$2, isTypedArray: () => isTypedArray_default$2, isUndefined: () => isUndefined$3, isWeakMap: () => isWeakMap_default$2, isWeakSet: () => isWeakSet_default$2, iteratee: () => iteratee$2, keys: () => keys$3, last: () => last$2, lastIndexOf: () => lastIndexOf_default$2, map: () => map$3, mapObject: () => mapObject$3, matcher: () => matcher$2, matches: () => matcher$2, max: () => max$4, memoize: () => memoize$3, methods: () => functions$1$2, min: () => min$4, mixin: () => mixin$3, negate: () => negate$2, noop: () => noop$6, now: () => now_default$2, object: () => object$2, omit: () => omit_default$2, once: () => once_default$2, pairs: () => pairs$2, partial: () => partial$2, partition: () => partition_default$2, pick: () => pick_default$2, pluck: () => pluck$2, property: () => property$2, propertyOf: () => propertyOf$2, random: () => random$3, range: () => range$2, reduce: () => reduce_default$2, reduceRight: () => reduceRight_default$2, reject: () => reject$2, rest: () => rest$2, restArguments: () => restArguments$2, result: () => result$2, sample: () => sample$2, select: () => filter$3, shuffle: () => shuffle$2, size: () => size$4, some: () => some$2, sortBy: () => sortBy$2, sortedIndex: () => sortedIndex$2, tail: () => rest$2, take: () => first$2, tap: () => tap$2, template: () => template$2, templateSettings: () => templateSettings_default$2, throttle: () => throttle$2, times: () => times$2, toArray: () => toArray$3, toPath: () => toPath$1$2, transpose: () => unzip$2, unescape: () => unescape_default$2, union: () => union_default$2, uniq: () => uniq$2, unique: () => uniq$2, uniqueId: () => uniqueId$2, unzip: () => unzip$2, values: () => values$2, where: () => where$2, without: () => without_default$2, wrap: () => wrap$5, zip: () => zip_default$2 }), init_modules$2 = __esmMin$2((() => {
21619
+ })), modules_exports$2 = __exportAll$2({ VERSION: () => VERSION$2, after: () => after$2, all: () => every$2, allKeys: () => allKeys$2, any: () => some$2, assign: () => extendOwn_default$2, before: () => before$2, bind: () => bind_default$2, bindAll: () => bindAll_default$2, chain: () => chain$4, chunk: () => chunk$2, clone: () => clone$5, collect: () => map$3, compact: () => compact$2, compose: () => compose$3, constant: () => constant$2, contains: () => contains$5, countBy: () => countBy_default$2, create: () => create$3, debounce: () => debounce$3, default: () => underscore_array_methods_default$2, defaults: () => defaults_default$2, defer: () => defer_default$2, delay: () => delay_default$2, detect: () => find$3, difference: () => difference_default$2, drop: () => rest$2, each: () => each$3, escape: () => escape_default$2, every: () => every$2, extend: () => extend_default$2, extendOwn: () => extendOwn_default$2, filter: () => filter$3, find: () => find$3, findIndex: () => findIndex_default$2, findKey: () => findKey$2, findLastIndex: () => findLastIndex_default$2, findWhere: () => findWhere$2, first: () => first$2, flatten: () => flatten$2$2, foldl: () => reduce_default$2, foldr: () => reduceRight_default$2, forEach: () => each$3, functions: () => functions$1$2, get: () => get$5, groupBy: () => groupBy_default$2, has: () => has$4, head: () => first$2, identity: () => identity$4, include: () => contains$5, includes: () => contains$5, indexBy: () => indexBy_default$2, indexOf: () => indexOf_default$2, initial: () => initial$2, inject: () => reduce_default$2, intersection: () => intersection$2, invert: () => invert$2, invoke: () => invoke_default$2, isArguments: () => isArguments_default$2, isArray: () => isArray_default$2, isArrayBuffer: () => isArrayBuffer_default$2, isBoolean: () => isBoolean$5, isDataView: () => isDataView_default$2, isDate: () => isDate_default$2, isElement: () => isElement$6, isEmpty: () => isEmpty$2, isEqual: () => isEqual$2, isError: () => isError_default$2, isFinite: () => isFinite$1$2, isFunction: () => isFunction_default$2, isMap: () => isMap_default$2, isMatch: () => isMatch$2, isNaN: () => isNaN$1$2, isNull: () => isNull$3, isNumber: () => isNumber_default$2, isObject: () => isObject$4, isRegExp: () => isRegExp_default$2, isSet: () => isSet_default$2, isString: () => isString_default$2, isSymbol: () => isSymbol_default$2, isTypedArray: () => isTypedArray_default$2, isUndefined: () => isUndefined$3, isWeakMap: () => isWeakMap_default$2, isWeakSet: () => isWeakSet_default$2, iteratee: () => iteratee$2, keys: () => keys$3, last: () => last$2, lastIndexOf: () => lastIndexOf_default$2, map: () => map$3, mapObject: () => mapObject$3, matcher: () => matcher$2, matches: () => matcher$2, max: () => max$4, memoize: () => memoize$3, methods: () => functions$1$2, min: () => min$4, mixin: () => mixin$3, negate: () => negate$2, noop: () => noop$6, now: () => now_default$2, object: () => object$2, omit: () => omit_default$2, once: () => once_default$2, pairs: () => pairs$2, partial: () => partial$2, partition: () => partition_default$2, pick: () => pick_default$2, pluck: () => pluck$2, property: () => property$2, propertyOf: () => propertyOf$2, random: () => random$3, range: () => range$2, reduce: () => reduce_default$2, reduceRight: () => reduceRight_default$2, reject: () => reject$2, rest: () => rest$2, restArguments: () => restArguments$2, result: () => result$2, sample: () => sample$2, select: () => filter$3, shuffle: () => shuffle$2, size: () => size$4, some: () => some$2, sortBy: () => sortBy$2, sortedIndex: () => sortedIndex$2, tail: () => rest$2, take: () => first$2, tap: () => tap$2, template: () => template$2, templateSettings: () => templateSettings_default$2, throttle: () => throttle$2, times: () => times$2, toArray: () => toArray$3, toPath: () => toPath$1$2, transpose: () => unzip$2, unescape: () => unescape_default$2, union: () => union_default$2, uniq: () => uniq$2, unique: () => uniq$2, uniqueId: () => uniqueId$2, unzip: () => unzip$2, values: () => values$3, where: () => where$2, without: () => without_default$2, wrap: () => wrap$5, zip: () => zip_default$2 }), init_modules$2 = __esmMin$2((() => {
21620
21620
  init__setup$2(), init_restArguments$2(), init_isObject$2(), init_isNull$2(), init_isUndefined$2(), init_isBoolean$2(), init_isElement$2(), init_isString$2(), init_isNumber$2(), init_isDate$2(), init_isRegExp$2(), init_isError$2(), init_isSymbol$2(), init_isArrayBuffer$2(), init_isDataView$2(), init_isArray$2(), init_isFunction$2(), init_isArguments$2(), init_isFinite$2(), init_isNaN$2(), init_isTypedArray$2(), init_isEmpty$2(), init_isMatch$2(), init_isEqual$2(), init_isMap$2(), init_isWeakMap$2(), init_isSet$2(), init_isWeakSet$2(), init_keys$2(), init_allKeys$2(), init_values$2(), init_pairs$2(), init_invert$2(), init_functions$2(), init_extend$2(), init_extendOwn$2(), init_defaults$2(), init_create$2(), init_clone$2(), init_tap$2(), init_get$2(), init_has$2(), init_mapObject$2(), init_identity$2(), init_constant$2(), init_noop$2(), init_toPath$2(), init_property$2(), init_propertyOf$2(), init_matcher$2(), init_times$2(), init_random$2(), init_now$2(), init_escape$2(), init_unescape$2(), init_templateSettings$2(), init_template$2(), init_result$2(), init_uniqueId$2(), init_chain$2(), init_iteratee$2(), init_partial$2(), init_bind$2(), init_bindAll$2(), init_memoize$2(), init_delay$2(), init_defer$2(), init_throttle$2(), init_debounce$2(), init_wrap$2(), init_negate$2(), init_compose$2(), init_after$2(), init_before$2(), init_once$2(), init_findKey$2(), init_findIndex$2(), init_findLastIndex$2(), init_sortedIndex$2(), init_indexOf$2(), init_lastIndexOf$2(), init_find$2(), init_findWhere$2(), init_each$2(), init_map$2(), init_reduce$2(), init_reduceRight$2(), init_filter$2(), init_reject$2(), init_every$2(), init_some$2(), init_contains$2(), init_invoke$2(), init_pluck$2(), init_where$2(), init_max$2(), init_min$2(), init_shuffle$2(), init_sample$2(), init_sortBy$2(), init_groupBy$2(), init_indexBy$2(), init_countBy$2(), init_partition$2(), init_toArray$2(), init_size$2(), init_pick$2(), init_omit$2(), init_first$2(), init_initial$2(), init_last$2(), init_rest$2(), init_compact$2(), init_flatten$2(), init_without$2(), init_uniq$2(), init_union$2(), init_intersection$2(), init_difference$2(), init_unzip$2(), init_zip$2(), init_object$2(), init_range$2(), init_chunk$2(), init_mixin$2(), init_underscore_array_methods$2();
21621
21621
  })), _$3, init_index_default$2 = __esmMin$2((() => {
21622
21622
  init_modules$2(), _$3 = mixin$3(modules_exports$2), _$3._ = _$3;
21623
- })), index_all_exports$2 = __exportAll$2({ VERSION: () => VERSION$2, after: () => after$2, all: () => every$2, allKeys: () => allKeys$2, any: () => some$2, assign: () => extendOwn_default$2, before: () => before$2, bind: () => bind_default$2, bindAll: () => bindAll_default$2, chain: () => chain$4, chunk: () => chunk$2, clone: () => clone$5, collect: () => map$3, compact: () => compact$2, compose: () => compose$3, constant: () => constant$2, contains: () => contains$5, countBy: () => countBy_default$2, create: () => create$3, debounce: () => debounce$3, default: () => _$3, defaults: () => defaults_default$2, defer: () => defer_default$2, delay: () => delay_default$2, detect: () => find$3, difference: () => difference_default$2, drop: () => rest$2, each: () => each$3, escape: () => escape_default$2, every: () => every$2, extend: () => extend_default$2, extendOwn: () => extendOwn_default$2, filter: () => filter$3, find: () => find$3, findIndex: () => findIndex_default$2, findKey: () => findKey$2, findLastIndex: () => findLastIndex_default$2, findWhere: () => findWhere$2, first: () => first$2, flatten: () => flatten$2$2, foldl: () => reduce_default$2, foldr: () => reduceRight_default$2, forEach: () => each$3, functions: () => functions$1$2, get: () => get$5, groupBy: () => groupBy_default$2, has: () => has$4, head: () => first$2, identity: () => identity$4, include: () => contains$5, includes: () => contains$5, indexBy: () => indexBy_default$2, indexOf: () => indexOf_default$2, initial: () => initial$2, inject: () => reduce_default$2, intersection: () => intersection$2, invert: () => invert$2, invoke: () => invoke_default$2, isArguments: () => isArguments_default$2, isArray: () => isArray_default$2, isArrayBuffer: () => isArrayBuffer_default$2, isBoolean: () => isBoolean$5, isDataView: () => isDataView_default$2, isDate: () => isDate_default$2, isElement: () => isElement$6, isEmpty: () => isEmpty$2, isEqual: () => isEqual$2, isError: () => isError_default$2, isFinite: () => isFinite$1$2, isFunction: () => isFunction_default$2, isMap: () => isMap_default$2, isMatch: () => isMatch$2, isNaN: () => isNaN$1$2, isNull: () => isNull$3, isNumber: () => isNumber_default$2, isObject: () => isObject$4, isRegExp: () => isRegExp_default$2, isSet: () => isSet_default$2, isString: () => isString_default$2, isSymbol: () => isSymbol_default$2, isTypedArray: () => isTypedArray_default$2, isUndefined: () => isUndefined$3, isWeakMap: () => isWeakMap_default$2, isWeakSet: () => isWeakSet_default$2, iteratee: () => iteratee$2, keys: () => keys$3, last: () => last$2, lastIndexOf: () => lastIndexOf_default$2, map: () => map$3, mapObject: () => mapObject$3, matcher: () => matcher$2, matches: () => matcher$2, max: () => max$4, memoize: () => memoize$3, methods: () => functions$1$2, min: () => min$4, mixin: () => mixin$3, negate: () => negate$2, noop: () => noop$6, now: () => now_default$2, object: () => object$2, omit: () => omit_default$2, once: () => once_default$2, pairs: () => pairs$2, partial: () => partial$2, partition: () => partition_default$2, pick: () => pick_default$2, pluck: () => pluck$2, property: () => property$2, propertyOf: () => propertyOf$2, random: () => random$3, range: () => range$2, reduce: () => reduce_default$2, reduceRight: () => reduceRight_default$2, reject: () => reject$2, rest: () => rest$2, restArguments: () => restArguments$2, result: () => result$2, sample: () => sample$2, select: () => filter$3, shuffle: () => shuffle$2, size: () => size$4, some: () => some$2, sortBy: () => sortBy$2, sortedIndex: () => sortedIndex$2, tail: () => rest$2, take: () => first$2, tap: () => tap$2, template: () => template$2, templateSettings: () => templateSettings_default$2, throttle: () => throttle$2, times: () => times$2, toArray: () => toArray$3, toPath: () => toPath$1$2, transpose: () => unzip$2, unescape: () => unescape_default$2, union: () => union_default$2, uniq: () => uniq$2, unique: () => uniq$2, uniqueId: () => uniqueId$2, unzip: () => unzip$2, values: () => values$2, where: () => where$2, without: () => without_default$2, wrap: () => wrap$5, zip: () => zip_default$2 }), init_index_all$2 = __esmMin$2((() => {
21623
+ })), index_all_exports$2 = __exportAll$2({ VERSION: () => VERSION$2, after: () => after$2, all: () => every$2, allKeys: () => allKeys$2, any: () => some$2, assign: () => extendOwn_default$2, before: () => before$2, bind: () => bind_default$2, bindAll: () => bindAll_default$2, chain: () => chain$4, chunk: () => chunk$2, clone: () => clone$5, collect: () => map$3, compact: () => compact$2, compose: () => compose$3, constant: () => constant$2, contains: () => contains$5, countBy: () => countBy_default$2, create: () => create$3, debounce: () => debounce$3, default: () => _$3, defaults: () => defaults_default$2, defer: () => defer_default$2, delay: () => delay_default$2, detect: () => find$3, difference: () => difference_default$2, drop: () => rest$2, each: () => each$3, escape: () => escape_default$2, every: () => every$2, extend: () => extend_default$2, extendOwn: () => extendOwn_default$2, filter: () => filter$3, find: () => find$3, findIndex: () => findIndex_default$2, findKey: () => findKey$2, findLastIndex: () => findLastIndex_default$2, findWhere: () => findWhere$2, first: () => first$2, flatten: () => flatten$2$2, foldl: () => reduce_default$2, foldr: () => reduceRight_default$2, forEach: () => each$3, functions: () => functions$1$2, get: () => get$5, groupBy: () => groupBy_default$2, has: () => has$4, head: () => first$2, identity: () => identity$4, include: () => contains$5, includes: () => contains$5, indexBy: () => indexBy_default$2, indexOf: () => indexOf_default$2, initial: () => initial$2, inject: () => reduce_default$2, intersection: () => intersection$2, invert: () => invert$2, invoke: () => invoke_default$2, isArguments: () => isArguments_default$2, isArray: () => isArray_default$2, isArrayBuffer: () => isArrayBuffer_default$2, isBoolean: () => isBoolean$5, isDataView: () => isDataView_default$2, isDate: () => isDate_default$2, isElement: () => isElement$6, isEmpty: () => isEmpty$2, isEqual: () => isEqual$2, isError: () => isError_default$2, isFinite: () => isFinite$1$2, isFunction: () => isFunction_default$2, isMap: () => isMap_default$2, isMatch: () => isMatch$2, isNaN: () => isNaN$1$2, isNull: () => isNull$3, isNumber: () => isNumber_default$2, isObject: () => isObject$4, isRegExp: () => isRegExp_default$2, isSet: () => isSet_default$2, isString: () => isString_default$2, isSymbol: () => isSymbol_default$2, isTypedArray: () => isTypedArray_default$2, isUndefined: () => isUndefined$3, isWeakMap: () => isWeakMap_default$2, isWeakSet: () => isWeakSet_default$2, iteratee: () => iteratee$2, keys: () => keys$3, last: () => last$2, lastIndexOf: () => lastIndexOf_default$2, map: () => map$3, mapObject: () => mapObject$3, matcher: () => matcher$2, matches: () => matcher$2, max: () => max$4, memoize: () => memoize$3, methods: () => functions$1$2, min: () => min$4, mixin: () => mixin$3, negate: () => negate$2, noop: () => noop$6, now: () => now_default$2, object: () => object$2, omit: () => omit_default$2, once: () => once_default$2, pairs: () => pairs$2, partial: () => partial$2, partition: () => partition_default$2, pick: () => pick_default$2, pluck: () => pluck$2, property: () => property$2, propertyOf: () => propertyOf$2, random: () => random$3, range: () => range$2, reduce: () => reduce_default$2, reduceRight: () => reduceRight_default$2, reject: () => reject$2, rest: () => rest$2, restArguments: () => restArguments$2, result: () => result$2, sample: () => sample$2, select: () => filter$3, shuffle: () => shuffle$2, size: () => size$4, some: () => some$2, sortBy: () => sortBy$2, sortedIndex: () => sortedIndex$2, tail: () => rest$2, take: () => first$2, tap: () => tap$2, template: () => template$2, templateSettings: () => templateSettings_default$2, throttle: () => throttle$2, times: () => times$2, toArray: () => toArray$3, toPath: () => toPath$1$2, transpose: () => unzip$2, unescape: () => unescape_default$2, union: () => union_default$2, uniq: () => uniq$2, unique: () => uniq$2, uniqueId: () => uniqueId$2, unzip: () => unzip$2, values: () => values$3, where: () => where$2, without: () => without_default$2, wrap: () => wrap$5, zip: () => zip_default$2 }), init_index_all$2 = __esmMin$2((() => {
21624
21624
  init_index_default$2(), init_modules$2();
21625
21625
  }));
21626
21626
  init_index_all$2();
@@ -26137,7 +26137,7 @@ var round_numbers_to_precision_plus_decimals_sub$2 = function(t4, n2 = 4, r2 = 2
26137
26137
  return parseFloat(a2 < 0 ? toFixed$4(t4, a2) + `0`.repeat(mathjs_default$2.abs(a2)) : toFixed$4(t4, a2));
26138
26138
  }
26139
26139
  return Array.isArray(t4) ? [t4[0], ...t4.slice(1).map((t5) => round_numbers_to_precision_plus_decimals_sub$2(t5, n2, r2))] : t4;
26140
- }, match_exports$2 = __exportAll$2({ match: () => match$3 }), match$3 = function(t4, n2, r2) {
26140
+ }, match_exports$2 = __exportAll$2({ match: () => match$4 }), match$4 = function(t4, n2, r2) {
26141
26141
  return match$1$2(get_tree$2(t4), get_tree$2(n2), r2);
26142
26142
  }, expression_to_tree$1$2 = [simplify_exports$2, differentiation_exports$2, normalization_exports$2, arithmetic_exports$2, transformation_exports$2, solve_exports$2, sets_exports$2, matrix_exports$2, rational_exports$2, round_exports$2], expression_to_other$2 = [variables_exports$2, printing_exports$2, equality_exports$2, integration_exports$2, evaluation_exports$2, analytic_exports$2, sign_error_exports$2, match_exports$2], standard_exports$2 = __exportAll$2({ abs: () => abs$3, acos: () => acos$3, acosh: () => acosh$4, acot: () => acot$2, acoth: () => acoth$2, acsc: () => acsc$2, acsch: () => acsch$2, asec: () => asec$2, asech: () => asech$2, asin: () => asin$3, asinh: () => asinh$4, atan: () => atan$3, atan2: () => atan2$3, atanh: () => atanh$4, conj: () => conj$2, cos: () => cos$3, cosh: () => cosh$5, cot: () => cot$2, coth: () => coth$2, csc: () => csc$2, csch: () => csch$2, erf: () => erf$2, exp: () => exp$3, factorial: () => factorial$2, gamma: () => gamma$2, im: () => im$2, log: () => log$3, log10: () => log10$4, re: () => re$3, sec: () => sec$2, sech: () => sech$2, sign: () => sign$4, sin: () => sin$3, sinh: () => sinh$5, sqrt: () => sqrt$3, tan: () => tan$3, tanh: () => tanh$4 });
26143
26143
  function abs$3(t4) {
@@ -27598,7 +27598,7 @@ async function cidFromArrayBuffer(data) {
27598
27598
  await crypto.subtle.digest("SHA-256", new Uint8Array());
27599
27599
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
27600
27600
  } catch (e2) {
27601
- const sha256 = (await import("./sha256-J35x7uWS-BC2XE0XO.js").then((n2) => n2.s)).default;
27601
+ const sha256 = (await import("./sha256-J35x7uWS-BtnkRJk3.js").then((n2) => n2.s)).default;
27602
27602
  digest = (data2) => sha256(data2, {
27603
27603
  asBytes: true
27604
27604
  });
@@ -31563,10 +31563,10 @@ let TreeCursor$2 = class TreeCursor2 {
31563
31563
  get node() {
31564
31564
  if (!this.buffer)
31565
31565
  return this._tree;
31566
- let cache = this.bufferNode, result2 = null, depth = 0;
31567
- if (cache && cache.context == this.buffer) {
31566
+ let cache2 = this.bufferNode, result2 = null, depth = 0;
31567
+ if (cache2 && cache2.context == this.buffer) {
31568
31568
  scan: for (let index2 = this.index, d2 = this.stack.length; d2 >= 0; ) {
31569
- for (let c2 = cache; c2; c2 = c2._parent)
31569
+ for (let c2 = cache2; c2; c2 = c2._parent)
31570
31570
  if (c2.index == index2) {
31571
31571
  if (index2 == this.index)
31572
31572
  return c2;
@@ -39901,7 +39901,1255 @@ function findMatchingChild(dastRoot, elementName) {
39901
39901
  }
39902
39902
  return { success: false };
39903
39903
  }
39904
+ class FluentType {
39905
+ /**
39906
+ * Create a `FluentType` instance.
39907
+ *
39908
+ * @param value The JavaScript value to wrap.
39909
+ */
39910
+ constructor(value) {
39911
+ this.value = value;
39912
+ }
39913
+ /**
39914
+ * Unwrap the raw value stored by this `FluentType`.
39915
+ */
39916
+ valueOf() {
39917
+ return this.value;
39918
+ }
39919
+ }
39920
+ class FluentNone extends FluentType {
39921
+ /**
39922
+ * Create an instance of `FluentNone` with an optional fallback value.
39923
+ * @param value The fallback value of this `FluentNone`.
39924
+ */
39925
+ constructor(value = "???") {
39926
+ super(value);
39927
+ }
39928
+ /**
39929
+ * Format this `FluentNone` to the fallback string.
39930
+ */
39931
+ toString(scope) {
39932
+ return `{${this.value}}`;
39933
+ }
39934
+ }
39935
+ class FluentNumber extends FluentType {
39936
+ /**
39937
+ * Create an instance of `FluentNumber` with options to the
39938
+ * `Intl.NumberFormat` constructor.
39939
+ *
39940
+ * @param value The number value of this `FluentNumber`.
39941
+ * @param opts Options which will be passed to `Intl.NumberFormat`.
39942
+ */
39943
+ constructor(value, opts = {}) {
39944
+ super(value);
39945
+ this.opts = opts;
39946
+ }
39947
+ /**
39948
+ * Format this `FluentNumber` to a string.
39949
+ */
39950
+ toString(scope) {
39951
+ if (scope) {
39952
+ try {
39953
+ const nf = scope.memoizeIntlObject(Intl.NumberFormat, this.opts);
39954
+ return nf.format(this.value);
39955
+ } catch (err) {
39956
+ scope.reportError(err);
39957
+ }
39958
+ }
39959
+ return this.value.toString(10);
39960
+ }
39961
+ }
39962
+ class FluentDateTime extends FluentType {
39963
+ static supportsValue(value) {
39964
+ if (typeof value === "number")
39965
+ return true;
39966
+ if (value instanceof Date)
39967
+ return true;
39968
+ if (value instanceof FluentType)
39969
+ return FluentDateTime.supportsValue(value.valueOf());
39970
+ if ("Temporal" in globalThis) {
39971
+ const _Temporal = globalThis.Temporal;
39972
+ if (value instanceof _Temporal.Instant || value instanceof _Temporal.PlainDateTime || value instanceof _Temporal.PlainDate || value instanceof _Temporal.PlainMonthDay || value instanceof _Temporal.PlainTime || value instanceof _Temporal.PlainYearMonth) {
39973
+ return true;
39974
+ }
39975
+ }
39976
+ return false;
39977
+ }
39978
+ /**
39979
+ * Create an instance of `FluentDateTime` with options to the
39980
+ * `Intl.DateTimeFormat` constructor.
39981
+ *
39982
+ * @param value The number value of this `FluentDateTime`, in milliseconds.
39983
+ * @param opts Options which will be passed to `Intl.DateTimeFormat`.
39984
+ */
39985
+ constructor(value, opts = {}) {
39986
+ if (value instanceof FluentDateTime) {
39987
+ opts = { ...value.opts, ...opts };
39988
+ value = value.value;
39989
+ } else if (value instanceof FluentType) {
39990
+ value = value.valueOf();
39991
+ }
39992
+ if (typeof value === "object" && "calendarId" in value && opts.calendar === void 0) {
39993
+ opts = { ...opts, calendar: value.calendarId };
39994
+ }
39995
+ super(value);
39996
+ this.opts = opts;
39997
+ }
39998
+ [Symbol.toPrimitive](hint) {
39999
+ return hint === "string" ? this.toString() : this.toNumber();
40000
+ }
40001
+ /**
40002
+ * Convert this `FluentDateTime` to a number.
40003
+ * Note that this isn't always possible due to the nature of Temporal objects.
40004
+ * In such cases, a TypeError will be thrown.
40005
+ */
40006
+ toNumber() {
40007
+ const value = this.value;
40008
+ if (typeof value === "number")
40009
+ return value;
40010
+ if (value instanceof Date)
40011
+ return value.getTime();
40012
+ if ("epochMilliseconds" in value) {
40013
+ return value.epochMilliseconds;
40014
+ }
40015
+ if ("toZonedDateTime" in value) {
40016
+ return value.toZonedDateTime("UTC").epochMilliseconds;
40017
+ }
40018
+ throw new TypeError("Unwrapping a non-number value as a number");
40019
+ }
40020
+ /**
40021
+ * Format this `FluentDateTime` to a string.
40022
+ */
40023
+ toString(scope) {
40024
+ if (scope) {
40025
+ try {
40026
+ const dtf = scope.memoizeIntlObject(Intl.DateTimeFormat, this.opts);
40027
+ return dtf.format(this.value);
40028
+ } catch (err) {
40029
+ scope.reportError(err);
40030
+ }
40031
+ }
40032
+ if (typeof this.value === "number" || this.value instanceof Date) {
40033
+ return new Date(this.value).toISOString();
40034
+ }
40035
+ return this.value.toString();
40036
+ }
40037
+ }
40038
+ const MAX_PLACEABLES = 100;
40039
+ const FSI = "⁨";
40040
+ const PDI = "⁩";
40041
+ function match$3(scope, selector2, key) {
40042
+ if (key === selector2) {
40043
+ return true;
40044
+ }
40045
+ if (key instanceof FluentNumber && selector2 instanceof FluentNumber && key.value === selector2.value) {
40046
+ return true;
40047
+ }
40048
+ if (selector2 instanceof FluentNumber && typeof key === "string") {
40049
+ let category = scope.memoizeIntlObject(Intl.PluralRules, selector2.opts).select(selector2.value);
40050
+ if (key === category) {
40051
+ return true;
40052
+ }
40053
+ }
40054
+ return false;
40055
+ }
40056
+ function getDefault(scope, variants, star) {
40057
+ if (variants[star]) {
40058
+ return resolvePattern(scope, variants[star].value);
40059
+ }
40060
+ scope.reportError(new RangeError("No default"));
40061
+ return new FluentNone();
40062
+ }
40063
+ function getArguments(scope, args) {
40064
+ const positional = [];
40065
+ const named = /* @__PURE__ */ Object.create(null);
40066
+ for (const arg of args) {
40067
+ if (arg.type === "narg") {
40068
+ named[arg.name] = resolveExpression(scope, arg.value);
40069
+ } else {
40070
+ positional.push(resolveExpression(scope, arg));
40071
+ }
40072
+ }
40073
+ return { positional, named };
40074
+ }
40075
+ function resolveExpression(scope, expr) {
40076
+ switch (expr.type) {
40077
+ case "str":
40078
+ return expr.value;
40079
+ case "num":
40080
+ return new FluentNumber(expr.value, {
40081
+ minimumFractionDigits: expr.precision
40082
+ });
40083
+ case "var":
40084
+ return resolveVariableReference(scope, expr);
40085
+ case "mesg":
40086
+ return resolveMessageReference(scope, expr);
40087
+ case "term":
40088
+ return resolveTermReference(scope, expr);
40089
+ case "func":
40090
+ return resolveFunctionReference(scope, expr);
40091
+ case "select":
40092
+ return resolveSelectExpression(scope, expr);
40093
+ default:
40094
+ return new FluentNone();
40095
+ }
40096
+ }
40097
+ function resolveVariableReference(scope, { name: name2 }) {
40098
+ let arg;
40099
+ if (scope.params) {
40100
+ if (Object.prototype.hasOwnProperty.call(scope.params, name2)) {
40101
+ arg = scope.params[name2];
40102
+ } else {
40103
+ return new FluentNone(`$${name2}`);
40104
+ }
40105
+ } else if (scope.args && Object.prototype.hasOwnProperty.call(scope.args, name2)) {
40106
+ arg = scope.args[name2];
40107
+ } else {
40108
+ scope.reportError(new ReferenceError(`Unknown variable: $${name2}`));
40109
+ return new FluentNone(`$${name2}`);
40110
+ }
40111
+ if (arg instanceof FluentType) {
40112
+ return arg;
40113
+ }
40114
+ switch (typeof arg) {
40115
+ case "string":
40116
+ return arg;
40117
+ case "number":
40118
+ return new FluentNumber(arg);
40119
+ case "object":
40120
+ if (FluentDateTime.supportsValue(arg)) {
40121
+ return new FluentDateTime(arg);
40122
+ }
40123
+ // eslint-disable-next-line no-fallthrough
40124
+ default:
40125
+ scope.reportError(new TypeError(`Variable type not supported: $${name2}, ${typeof arg}`));
40126
+ return new FluentNone(`$${name2}`);
40127
+ }
40128
+ }
40129
+ function resolveMessageReference(scope, { name: name2, attr }) {
40130
+ const message = scope.bundle._messages.get(name2);
40131
+ if (!message) {
40132
+ scope.reportError(new ReferenceError(`Unknown message: ${name2}`));
40133
+ return new FluentNone(name2);
40134
+ }
40135
+ if (attr) {
40136
+ const attribute = message.attributes[attr];
40137
+ if (attribute) {
40138
+ return resolvePattern(scope, attribute);
40139
+ }
40140
+ scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));
40141
+ return new FluentNone(`${name2}.${attr}`);
40142
+ }
40143
+ if (message.value) {
40144
+ return resolvePattern(scope, message.value);
40145
+ }
40146
+ scope.reportError(new ReferenceError(`No value: ${name2}`));
40147
+ return new FluentNone(name2);
40148
+ }
40149
+ function resolveTermReference(scope, { name: name2, attr, args }) {
40150
+ const id2 = `-${name2}`;
40151
+ const term = scope.bundle._terms.get(id2);
40152
+ if (!term) {
40153
+ scope.reportError(new ReferenceError(`Unknown term: ${id2}`));
40154
+ return new FluentNone(id2);
40155
+ }
40156
+ if (attr) {
40157
+ const attribute = term.attributes[attr];
40158
+ if (attribute) {
40159
+ scope.params = getArguments(scope, args).named;
40160
+ const resolved2 = resolvePattern(scope, attribute);
40161
+ scope.params = null;
40162
+ return resolved2;
40163
+ }
40164
+ scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));
40165
+ return new FluentNone(`${id2}.${attr}`);
40166
+ }
40167
+ scope.params = getArguments(scope, args).named;
40168
+ const resolved = resolvePattern(scope, term.value);
40169
+ scope.params = null;
40170
+ return resolved;
40171
+ }
40172
+ function resolveFunctionReference(scope, { name: name2, args }) {
40173
+ let func = scope.bundle._functions[name2];
40174
+ if (!func) {
40175
+ scope.reportError(new ReferenceError(`Unknown function: ${name2}()`));
40176
+ return new FluentNone(`${name2}()`);
40177
+ }
40178
+ if (typeof func !== "function") {
40179
+ scope.reportError(new TypeError(`Function ${name2}() is not callable`));
40180
+ return new FluentNone(`${name2}()`);
40181
+ }
40182
+ try {
40183
+ let resolved = getArguments(scope, args);
40184
+ return func(resolved.positional, resolved.named);
40185
+ } catch (err) {
40186
+ scope.reportError(err);
40187
+ return new FluentNone(`${name2}()`);
40188
+ }
40189
+ }
40190
+ function resolveSelectExpression(scope, { selector: selector2, variants, star }) {
40191
+ let sel = resolveExpression(scope, selector2);
40192
+ if (sel instanceof FluentNone) {
40193
+ return getDefault(scope, variants, star);
40194
+ }
40195
+ for (const variant of variants) {
40196
+ const key = resolveExpression(scope, variant.key);
40197
+ if (match$3(scope, sel, key)) {
40198
+ return resolvePattern(scope, variant.value);
40199
+ }
40200
+ }
40201
+ return getDefault(scope, variants, star);
40202
+ }
40203
+ function resolveComplexPattern(scope, ptn) {
40204
+ if (scope.dirty.has(ptn)) {
40205
+ scope.reportError(new RangeError("Cyclic reference"));
40206
+ return new FluentNone();
40207
+ }
40208
+ scope.dirty.add(ptn);
40209
+ const result2 = [];
40210
+ const useIsolating = scope.bundle._useIsolating && ptn.length > 1;
40211
+ for (const elem of ptn) {
40212
+ if (typeof elem === "string") {
40213
+ result2.push(scope.bundle._transform(elem));
40214
+ continue;
40215
+ }
40216
+ scope.placeables++;
40217
+ if (scope.placeables > MAX_PLACEABLES) {
40218
+ scope.dirty.delete(ptn);
40219
+ throw new RangeError(`Too many placeables expanded: ${scope.placeables}, max allowed is ${MAX_PLACEABLES}`);
40220
+ }
40221
+ if (useIsolating) {
40222
+ result2.push(FSI);
40223
+ }
40224
+ result2.push(resolveExpression(scope, elem).toString(scope));
40225
+ if (useIsolating) {
40226
+ result2.push(PDI);
40227
+ }
40228
+ }
40229
+ scope.dirty.delete(ptn);
40230
+ return result2.join("");
40231
+ }
40232
+ function resolvePattern(scope, value) {
40233
+ if (typeof value === "string") {
40234
+ return scope.bundle._transform(value);
40235
+ }
40236
+ return resolveComplexPattern(scope, value);
40237
+ }
40238
+ class Scope {
40239
+ constructor(bundle, errors2, args) {
40240
+ this.dirty = /* @__PURE__ */ new WeakSet();
40241
+ this.params = null;
40242
+ this.placeables = 0;
40243
+ this.bundle = bundle;
40244
+ this.errors = errors2;
40245
+ this.args = args;
40246
+ }
40247
+ reportError(error) {
40248
+ if (!this.errors || !(error instanceof Error)) {
40249
+ throw error;
40250
+ }
40251
+ this.errors.push(error);
40252
+ }
40253
+ memoizeIntlObject(ctor2, opts) {
40254
+ let cache2 = this.bundle._intls.get(ctor2);
40255
+ if (!cache2) {
40256
+ cache2 = {};
40257
+ this.bundle._intls.set(ctor2, cache2);
40258
+ }
40259
+ let id2 = JSON.stringify(opts);
40260
+ if (!cache2[id2]) {
40261
+ cache2[id2] = new ctor2(this.bundle.locales, opts);
40262
+ }
40263
+ return cache2[id2];
40264
+ }
40265
+ }
40266
+ function values$2(opts, allowed) {
40267
+ const unwrapped = /* @__PURE__ */ Object.create(null);
40268
+ for (const [name2, opt] of Object.entries(opts)) {
40269
+ if (allowed.includes(name2)) {
40270
+ unwrapped[name2] = opt.valueOf();
40271
+ }
40272
+ }
40273
+ return unwrapped;
40274
+ }
40275
+ const NUMBER_ALLOWED = [
40276
+ "unitDisplay",
40277
+ "currencyDisplay",
40278
+ "useGrouping",
40279
+ "minimumIntegerDigits",
40280
+ "minimumFractionDigits",
40281
+ "maximumFractionDigits",
40282
+ "minimumSignificantDigits",
40283
+ "maximumSignificantDigits"
40284
+ ];
40285
+ function NUMBER(args, opts) {
40286
+ let arg = args[0];
40287
+ if (arg instanceof FluentNone) {
40288
+ return new FluentNone(`NUMBER(${arg.valueOf()})`);
40289
+ }
40290
+ if (arg instanceof FluentNumber) {
40291
+ return new FluentNumber(arg.valueOf(), {
40292
+ ...arg.opts,
40293
+ ...values$2(opts, NUMBER_ALLOWED)
40294
+ });
40295
+ }
40296
+ if (arg instanceof FluentDateTime) {
40297
+ return new FluentNumber(arg.toNumber(), {
40298
+ ...values$2(opts, NUMBER_ALLOWED)
40299
+ });
40300
+ }
40301
+ throw new TypeError("Invalid argument to NUMBER");
40302
+ }
40303
+ const DATETIME_ALLOWED = [
40304
+ "dateStyle",
40305
+ "timeStyle",
40306
+ "fractionalSecondDigits",
40307
+ "dayPeriod",
40308
+ "hour12",
40309
+ "weekday",
40310
+ "era",
40311
+ "year",
40312
+ "month",
40313
+ "day",
40314
+ "hour",
40315
+ "minute",
40316
+ "second",
40317
+ "timeZoneName"
40318
+ ];
40319
+ function DATETIME(args, opts) {
40320
+ let arg = args[0];
40321
+ if (arg instanceof FluentNone) {
40322
+ return new FluentNone(`DATETIME(${arg.valueOf()})`);
40323
+ }
40324
+ if (arg instanceof FluentDateTime || arg instanceof FluentNumber) {
40325
+ return new FluentDateTime(arg, values$2(opts, DATETIME_ALLOWED));
40326
+ }
40327
+ throw new TypeError("Invalid argument to DATETIME");
40328
+ }
40329
+ const cache = /* @__PURE__ */ new Map();
40330
+ function getMemoizerForLocale(locales) {
40331
+ const stringLocale = Array.isArray(locales) ? locales.join(" ") : locales;
40332
+ let memoizer = cache.get(stringLocale);
40333
+ if (memoizer === void 0) {
40334
+ memoizer = /* @__PURE__ */ new Map();
40335
+ cache.set(stringLocale, memoizer);
40336
+ }
40337
+ return memoizer;
40338
+ }
40339
+ class FluentBundle {
40340
+ /**
40341
+ * Create an instance of `FluentBundle`.
40342
+ *
40343
+ * @example
40344
+ * ```js
40345
+ * let bundle = new FluentBundle(["en-US", "en"]);
40346
+ *
40347
+ * let bundle = new FluentBundle(locales, {useIsolating: false});
40348
+ *
40349
+ * let bundle = new FluentBundle(locales, {
40350
+ * useIsolating: true,
40351
+ * functions: {
40352
+ * NODE_ENV: () => process.env.NODE_ENV
40353
+ * }
40354
+ * });
40355
+ * ```
40356
+ *
40357
+ * @param locales - Used to instantiate `Intl` formatters used by translations.
40358
+ * @param options - Optional configuration for the bundle.
40359
+ */
40360
+ constructor(locales, { functions: functions2, useIsolating = true, transform: transform2 = (v2) => v2 } = {}) {
40361
+ this._terms = /* @__PURE__ */ new Map();
40362
+ this._messages = /* @__PURE__ */ new Map();
40363
+ this.locales = Array.isArray(locales) ? locales : [locales];
40364
+ this._functions = {
40365
+ NUMBER,
40366
+ DATETIME,
40367
+ ...functions2
40368
+ };
40369
+ this._useIsolating = useIsolating;
40370
+ this._transform = transform2;
40371
+ this._intls = getMemoizerForLocale(locales);
40372
+ }
40373
+ /**
40374
+ * Check if a message is present in the bundle.
40375
+ *
40376
+ * @param id - The identifier of the message to check.
40377
+ */
40378
+ hasMessage(id2) {
40379
+ return this._messages.has(id2);
40380
+ }
40381
+ /**
40382
+ * Return a raw unformatted message object from the bundle.
40383
+ *
40384
+ * Raw messages are `{value, attributes}` shapes containing translation units
40385
+ * called `Patterns`. `Patterns` are implementation-specific; they should be
40386
+ * treated as black boxes and formatted with `FluentBundle.formatPattern`.
40387
+ *
40388
+ * @param id - The identifier of the message to check.
40389
+ */
40390
+ getMessage(id2) {
40391
+ return this._messages.get(id2);
40392
+ }
40393
+ /**
40394
+ * Add a translation resource to the bundle.
40395
+ *
40396
+ * @example
40397
+ * ```js
40398
+ * let res = new FluentResource("foo = Foo");
40399
+ * bundle.addResource(res);
40400
+ * bundle.getMessage("foo");
40401
+ * // → {value: .., attributes: {..}}
40402
+ * ```
40403
+ *
40404
+ * @param res
40405
+ * @param options
40406
+ */
40407
+ addResource(res, { allowOverrides = false } = {}) {
40408
+ const errors2 = [];
40409
+ for (let i2 = 0; i2 < res.body.length; i2++) {
40410
+ let entry = res.body[i2];
40411
+ if (entry.id.startsWith("-")) {
40412
+ if (allowOverrides === false && this._terms.has(entry.id)) {
40413
+ errors2.push(new Error(`Attempt to override an existing term: "${entry.id}"`));
40414
+ continue;
40415
+ }
40416
+ this._terms.set(entry.id, entry);
40417
+ } else {
40418
+ if (allowOverrides === false && this._messages.has(entry.id)) {
40419
+ errors2.push(new Error(`Attempt to override an existing message: "${entry.id}"`));
40420
+ continue;
40421
+ }
40422
+ this._messages.set(entry.id, entry);
40423
+ }
40424
+ }
40425
+ return errors2;
40426
+ }
40427
+ /**
40428
+ * Format a `Pattern` to a string.
40429
+ *
40430
+ * Format a raw `Pattern` into a string. `args` will be used to resolve
40431
+ * references to variables passed as arguments to the translation.
40432
+ *
40433
+ * In case of errors `formatPattern` will try to salvage as much of the
40434
+ * translation as possible and will still return a string. For performance
40435
+ * reasons, the encountered errors are not returned but instead are appended
40436
+ * to the `errors` array passed as the third argument.
40437
+ *
40438
+ * If `errors` is omitted, the first encountered error will be thrown.
40439
+ *
40440
+ * @example
40441
+ * ```js
40442
+ * let errors = [];
40443
+ * bundle.addResource(
40444
+ * new FluentResource("hello = Hello, {$name}!"));
40445
+ *
40446
+ * let hello = bundle.getMessage("hello");
40447
+ * if (hello.value) {
40448
+ * bundle.formatPattern(hello.value, {name: "Jane"}, errors);
40449
+ * // Returns "Hello, Jane!" and `errors` is empty.
40450
+ *
40451
+ * bundle.formatPattern(hello.value, undefined, errors);
40452
+ * // Returns "Hello, {$name}!" and `errors` is now:
40453
+ * // [<ReferenceError: Unknown variable: name>]
40454
+ * }
40455
+ * ```
40456
+ */
40457
+ formatPattern(pattern, args = null, errors2 = null) {
40458
+ if (typeof pattern === "string") {
40459
+ return this._transform(pattern);
40460
+ }
40461
+ let scope = new Scope(this, errors2, args);
40462
+ try {
40463
+ let value = resolveComplexPattern(scope, pattern);
40464
+ return value.toString(scope);
40465
+ } catch (err) {
40466
+ if (scope.errors && err instanceof Error) {
40467
+ scope.errors.push(err);
40468
+ return new FluentNone().toString(scope);
40469
+ }
40470
+ throw err;
40471
+ }
40472
+ }
40473
+ }
40474
+ const RE_MESSAGE_START = /^(-?[a-zA-Z][\w-]*) *= */gm;
40475
+ const RE_ATTRIBUTE_START = /\.([a-zA-Z][\w-]*) *= */y;
40476
+ const RE_VARIANT_START = /\*?\[/y;
40477
+ const RE_NUMBER_LITERAL = /(-?[0-9]+(?:\.([0-9]+))?)/y;
40478
+ const RE_IDENTIFIER = /([a-zA-Z][\w-]*)/y;
40479
+ const RE_REFERENCE = /([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y;
40480
+ const RE_FUNCTION_NAME = /^[A-Z][A-Z0-9_-]*$/;
40481
+ const RE_TEXT_RUN = /([^{}\n\r]+)/y;
40482
+ const RE_STRING_RUN = /([^\\"\n\r]*)/y;
40483
+ const RE_STRING_ESCAPE = /\\([\\"])/y;
40484
+ const RE_UNICODE_ESCAPE = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y;
40485
+ const RE_LEADING_NEWLINES = /^\n+/;
40486
+ const RE_TRAILING_SPACES = / +$/;
40487
+ const RE_BLANK_LINES = / *\r?\n/g;
40488
+ const RE_INDENT = /( *)$/;
40489
+ const TOKEN_BRACE_OPEN = /{\s*/y;
40490
+ const TOKEN_BRACE_CLOSE = /\s*}/y;
40491
+ const TOKEN_BRACKET_OPEN = /\[\s*/y;
40492
+ const TOKEN_BRACKET_CLOSE = /\s*] */y;
40493
+ const TOKEN_PAREN_OPEN = /\s*\(\s*/y;
40494
+ const TOKEN_ARROW = /\s*->\s*/y;
40495
+ const TOKEN_COLON = /\s*:\s*/y;
40496
+ const TOKEN_COMMA = /\s*,?\s*/y;
40497
+ const TOKEN_BLANK = /\s+/y;
40498
+ class FluentResource {
40499
+ constructor(source) {
40500
+ this.body = [];
40501
+ RE_MESSAGE_START.lastIndex = 0;
40502
+ let cursor2 = 0;
40503
+ while (true) {
40504
+ let next = RE_MESSAGE_START.exec(source);
40505
+ if (next === null) {
40506
+ break;
40507
+ }
40508
+ cursor2 = RE_MESSAGE_START.lastIndex;
40509
+ try {
40510
+ this.body.push(parseMessage(next[1]));
40511
+ } catch (err) {
40512
+ if (err instanceof SyntaxError) {
40513
+ continue;
40514
+ }
40515
+ throw err;
40516
+ }
40517
+ }
40518
+ function test(re2) {
40519
+ re2.lastIndex = cursor2;
40520
+ return re2.test(source);
40521
+ }
40522
+ function consumeChar(char, errorClass) {
40523
+ if (source[cursor2] === char) {
40524
+ cursor2++;
40525
+ return true;
40526
+ }
40527
+ if (errorClass) {
40528
+ throw new errorClass(`Expected ${char}`);
40529
+ }
40530
+ return false;
40531
+ }
40532
+ function consumeToken(re2, errorClass) {
40533
+ if (test(re2)) {
40534
+ cursor2 = re2.lastIndex;
40535
+ return true;
40536
+ }
40537
+ if (errorClass) {
40538
+ throw new errorClass(`Expected ${re2.toString()}`);
40539
+ }
40540
+ return false;
40541
+ }
40542
+ function match2(re2) {
40543
+ re2.lastIndex = cursor2;
40544
+ let result2 = re2.exec(source);
40545
+ if (result2 === null) {
40546
+ throw new SyntaxError(`Expected ${re2.toString()}`);
40547
+ }
40548
+ cursor2 = re2.lastIndex;
40549
+ return result2;
40550
+ }
40551
+ function match1(re2) {
40552
+ return match2(re2)[1];
40553
+ }
40554
+ function parseMessage(id2) {
40555
+ let value = parsePattern();
40556
+ let attributes = parseAttributes();
40557
+ if (value === null && Object.keys(attributes).length === 0) {
40558
+ throw new SyntaxError("Expected message value or attributes");
40559
+ }
40560
+ return { id: id2, value, attributes };
40561
+ }
40562
+ function parseAttributes() {
40563
+ let attrs = /* @__PURE__ */ Object.create(null);
40564
+ while (test(RE_ATTRIBUTE_START)) {
40565
+ let name2 = match1(RE_ATTRIBUTE_START);
40566
+ let value = parsePattern();
40567
+ if (value === null) {
40568
+ throw new SyntaxError("Expected attribute value");
40569
+ }
40570
+ attrs[name2] = value;
40571
+ }
40572
+ return attrs;
40573
+ }
40574
+ function parsePattern() {
40575
+ let first2;
40576
+ if (test(RE_TEXT_RUN)) {
40577
+ first2 = match1(RE_TEXT_RUN);
40578
+ }
40579
+ if (source[cursor2] === "{" || source[cursor2] === "}") {
40580
+ return parsePatternElements(first2 ? [first2] : [], Infinity);
40581
+ }
40582
+ let indent2 = parseIndent();
40583
+ if (indent2) {
40584
+ if (first2) {
40585
+ return parsePatternElements([first2, indent2], indent2.length);
40586
+ }
40587
+ indent2.value = trim2(indent2.value, RE_LEADING_NEWLINES);
40588
+ return parsePatternElements([indent2], indent2.length);
40589
+ }
40590
+ if (first2) {
40591
+ return trim2(first2, RE_TRAILING_SPACES);
40592
+ }
40593
+ return null;
40594
+ }
40595
+ function parsePatternElements(elements2 = [], commonIndent) {
40596
+ while (true) {
40597
+ if (test(RE_TEXT_RUN)) {
40598
+ elements2.push(match1(RE_TEXT_RUN));
40599
+ continue;
40600
+ }
40601
+ if (source[cursor2] === "{") {
40602
+ elements2.push(parsePlaceable());
40603
+ continue;
40604
+ }
40605
+ if (source[cursor2] === "}") {
40606
+ throw new SyntaxError("Unbalanced closing brace");
40607
+ }
40608
+ let indent2 = parseIndent();
40609
+ if (indent2) {
40610
+ elements2.push(indent2);
40611
+ commonIndent = Math.min(commonIndent, indent2.length);
40612
+ continue;
40613
+ }
40614
+ break;
40615
+ }
40616
+ let lastIndex = elements2.length - 1;
40617
+ let lastElement = elements2[lastIndex];
40618
+ if (typeof lastElement === "string") {
40619
+ elements2[lastIndex] = trim2(lastElement, RE_TRAILING_SPACES);
40620
+ }
40621
+ let baked = [];
40622
+ for (let element2 of elements2) {
40623
+ if (element2 instanceof Indent) {
40624
+ element2 = element2.value.slice(0, element2.value.length - commonIndent);
40625
+ }
40626
+ if (element2) {
40627
+ baked.push(element2);
40628
+ }
40629
+ }
40630
+ return baked;
40631
+ }
40632
+ function parsePlaceable() {
40633
+ consumeToken(TOKEN_BRACE_OPEN, SyntaxError);
40634
+ let selector2 = parseInlineExpression();
40635
+ if (consumeToken(TOKEN_BRACE_CLOSE)) {
40636
+ return selector2;
40637
+ }
40638
+ if (consumeToken(TOKEN_ARROW)) {
40639
+ let variants = parseVariants();
40640
+ consumeToken(TOKEN_BRACE_CLOSE, SyntaxError);
40641
+ return {
40642
+ type: "select",
40643
+ selector: selector2,
40644
+ ...variants
40645
+ };
40646
+ }
40647
+ throw new SyntaxError("Unclosed placeable");
40648
+ }
40649
+ function parseInlineExpression() {
40650
+ if (source[cursor2] === "{") {
40651
+ return parsePlaceable();
40652
+ }
40653
+ if (test(RE_REFERENCE)) {
40654
+ let [, sigil, name2, attr = null] = match2(RE_REFERENCE);
40655
+ if (sigil === "$") {
40656
+ return { type: "var", name: name2 };
40657
+ }
40658
+ if (consumeToken(TOKEN_PAREN_OPEN)) {
40659
+ let args = parseArguments();
40660
+ if (sigil === "-") {
40661
+ return { type: "term", name: name2, attr, args };
40662
+ }
40663
+ if (RE_FUNCTION_NAME.test(name2)) {
40664
+ return { type: "func", name: name2, args };
40665
+ }
40666
+ throw new SyntaxError("Function names must be all upper-case");
40667
+ }
40668
+ if (sigil === "-") {
40669
+ return {
40670
+ type: "term",
40671
+ name: name2,
40672
+ attr,
40673
+ args: []
40674
+ };
40675
+ }
40676
+ return { type: "mesg", name: name2, attr };
40677
+ }
40678
+ return parseLiteral();
40679
+ }
40680
+ function parseArguments() {
40681
+ let args = [];
40682
+ while (true) {
40683
+ switch (source[cursor2]) {
40684
+ case ")":
40685
+ cursor2++;
40686
+ return args;
40687
+ case void 0:
40688
+ throw new SyntaxError("Unclosed argument list");
40689
+ }
40690
+ args.push(parseArgument());
40691
+ consumeToken(TOKEN_COMMA);
40692
+ }
40693
+ }
40694
+ function parseArgument() {
40695
+ let expr = parseInlineExpression();
40696
+ if (expr.type !== "mesg") {
40697
+ return expr;
40698
+ }
40699
+ if (consumeToken(TOKEN_COLON)) {
40700
+ return {
40701
+ type: "narg",
40702
+ name: expr.name,
40703
+ value: parseLiteral()
40704
+ };
40705
+ }
40706
+ return expr;
40707
+ }
40708
+ function parseVariants() {
40709
+ let variants = [];
40710
+ let count = 0;
40711
+ let star;
40712
+ while (test(RE_VARIANT_START)) {
40713
+ if (consumeChar("*")) {
40714
+ star = count;
40715
+ }
40716
+ let key = parseVariantKey();
40717
+ let value = parsePattern();
40718
+ if (value === null) {
40719
+ throw new SyntaxError("Expected variant value");
40720
+ }
40721
+ variants[count++] = { key, value };
40722
+ }
40723
+ if (count === 0) {
40724
+ return null;
40725
+ }
40726
+ if (star === void 0) {
40727
+ throw new SyntaxError("Expected default variant");
40728
+ }
40729
+ return { variants, star };
40730
+ }
40731
+ function parseVariantKey() {
40732
+ consumeToken(TOKEN_BRACKET_OPEN, SyntaxError);
40733
+ let key;
40734
+ if (test(RE_NUMBER_LITERAL)) {
40735
+ key = parseNumberLiteral();
40736
+ } else {
40737
+ key = {
40738
+ type: "str",
40739
+ value: match1(RE_IDENTIFIER)
40740
+ };
40741
+ }
40742
+ consumeToken(TOKEN_BRACKET_CLOSE, SyntaxError);
40743
+ return key;
40744
+ }
40745
+ function parseLiteral() {
40746
+ if (test(RE_NUMBER_LITERAL)) {
40747
+ return parseNumberLiteral();
40748
+ }
40749
+ if (source[cursor2] === '"') {
40750
+ return parseStringLiteral();
40751
+ }
40752
+ throw new SyntaxError("Invalid expression");
40753
+ }
40754
+ function parseNumberLiteral() {
40755
+ let [, value, fraction = ""] = match2(RE_NUMBER_LITERAL);
40756
+ let precision = fraction.length;
40757
+ return {
40758
+ type: "num",
40759
+ value: parseFloat(value),
40760
+ precision
40761
+ };
40762
+ }
40763
+ function parseStringLiteral() {
40764
+ consumeChar('"', SyntaxError);
40765
+ let value = "";
40766
+ while (true) {
40767
+ value += match1(RE_STRING_RUN);
40768
+ if (source[cursor2] === "\\") {
40769
+ value += parseEscapeSequence();
40770
+ continue;
40771
+ }
40772
+ if (consumeChar('"')) {
40773
+ return { type: "str", value };
40774
+ }
40775
+ throw new SyntaxError("Unclosed string literal");
40776
+ }
40777
+ }
40778
+ function parseEscapeSequence() {
40779
+ if (test(RE_STRING_ESCAPE)) {
40780
+ return match1(RE_STRING_ESCAPE);
40781
+ }
40782
+ if (test(RE_UNICODE_ESCAPE)) {
40783
+ let [, codepoint4, codepoint6] = match2(RE_UNICODE_ESCAPE);
40784
+ let codepoint = parseInt(codepoint4 || codepoint6, 16);
40785
+ return codepoint <= 55295 || 57344 <= codepoint ? (
40786
+ // It's a Unicode scalar value.
40787
+ String.fromCodePoint(codepoint)
40788
+ ) : (
40789
+ // Lonely surrogates can cause trouble when the parsing result is
40790
+ // saved using UTF-8. Use U+FFFD REPLACEMENT CHARACTER instead.
40791
+ "�"
40792
+ );
40793
+ }
40794
+ throw new SyntaxError("Unknown escape sequence");
40795
+ }
40796
+ function parseIndent() {
40797
+ let start = cursor2;
40798
+ consumeToken(TOKEN_BLANK);
40799
+ switch (source[cursor2]) {
40800
+ case ".":
40801
+ case "[":
40802
+ case "*":
40803
+ case "}":
40804
+ case void 0:
40805
+ return false;
40806
+ case "{":
40807
+ return makeIndent2(source.slice(start, cursor2));
40808
+ }
40809
+ if (source[cursor2 - 1] === " ") {
40810
+ return makeIndent2(source.slice(start, cursor2));
40811
+ }
40812
+ return false;
40813
+ }
40814
+ function trim2(text2, re2) {
40815
+ return text2.replace(re2, "");
40816
+ }
40817
+ function makeIndent2(blank) {
40818
+ let value = blank.replace(RE_BLANK_LINES, "\n");
40819
+ let length = RE_INDENT.exec(blank)[1].length;
40820
+ return new Indent(value, length);
40821
+ }
40822
+ }
40823
+ }
40824
+ class Indent {
40825
+ constructor(value, length) {
40826
+ this.value = value;
40827
+ this.length = length;
40828
+ }
40829
+ }
40830
+ const chrome$2 = "# Viewer chrome: buttons, panel headers, and other UI the reader interacts\n# with. Rendered on the main thread and selected by `uiLocale`.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`submit-button`, `answer-status.correct`).\n#\n# This catalog is the source of truth for every other locale: `lint:i18n`\n# rejects a translation that defines a key missing here. Run\n# `npm run codegen -w @doenet/i18n` after editing.\n\n\n## Answer submission — the check-work button and the status it reports.\n\nanswer-checking = Checking...\nanswer-submitting = Submitting...\n\n# Announced to a screen reader while the submission is in flight. Separate\n# from the button's own text, which is abbreviated.\nanswer-checking-status = Checking answer\nanswer-submitting-status = Submitting answer\n\nanswer-correct = Correct\nanswer-incorrect = Incorrect\n\n# Shown instead of a correctness verdict when the activity withholds\n# correctness: the response was recorded, nothing is claimed about it.\nanswer-response-saved = Response Saved\n\n# Partial credit. `-credit` is used when repeated attempts reduce the credit\n# available, `-correct` when they do not, and `-short` on a button too narrow\n# for a word.\nanswer-percent-credit = { $percent }% Credit\nanswer-percent-correct = { $percent }% Correct\nanswer-percent-short = { $percent } %\n\nmax-credit-available = Max credit available: { $percent }%\n\n# Fluent formats `{ $count }` with `Intl.NumberFormat`, so a four-digit\n# attempt count renders as \"1,000\" where the hand-built string said \"1000\".\n# That is the one place English output is not byte-identical to what this\n# replaced, and grouping is the locale-correct rendering, so it stands.\nattempts-remaining =\n { $count ->\n [0] no attempts remaining\n [one] { $count } attempt remaining\n *[other] { $count } attempts remaining\n }\n\n# Appended to an input's accessible name once its response has been graded,\n# so a screen reader reports the verdict along with the field.\nvalidation-correct = (Correct)\nvalidation-incorrect = (Incorrect)\nvalidation-partially-correct = (Partially correct)\n\n# Tooltip on the badge that reports how many responses have been submitted to\n# one answer, shown only to a host that asked for it. `$answerId` is the\n# answer's authored name and is never translated.\nanswer-show-responses =\n { $count ->\n [one] Show { $count } response to { $answerId }\n *[other] Show { $count } responses to { $answerId }\n }\n\n\n## Disclosure panels\n\nfeedback-heading = Feedback\n\n# Follows a disclosure panel's own heading — \"Solution (click to open)\" — and\n# is shared by `<solution>`, `<hint>`, and a collapsible `<section>`. The whole\n# parenthetical is one message: where the word for open or close falls inside\n# it is the translator's business.\ncollapsible-click-to-open = (click to open)\ncollapsible-click-to-close = (click to close)\n\n# Placeholder inside a panel that has been opened before its contents have\n# arrived from the core. Shared by `<solution>` and a collapsible `<section>`.\ncollapsible-initializing = Initializing...\n\n# Tooltip on a footnote marker, naming what activating it will do.\nfootnote-show = Show footnote\nfootnote-hide = Hide footnote\n\n# Tooltip on the ⓘ affordance that reveals an input's description.\ndescription-more-information = more information\n\n\n## Controls\n\nslider-previous = Prev\nslider-next = Next\n\nkeyboard-open = Open Keyboard\nkeyboard-close = Close Keyboard\n\n# Accessible names of a matrix input's size controls, whose visible labels are\n# the symbols `r-` `r+` `c-` `c+`.\nmatrix-remove-row = Remove row\nmatrix-add-row = Add row\nmatrix-remove-column = Remove column\nmatrix-add-column = Add column\n\n# Modes and actions of the subset-of-reals input's control strip. The button\n# that selects all of the reals is the symbol `R`, not a word, and stays in\n# place.\nsubset-add-remove-points = Add/Remove points\nsubset-toggle-points-intervals = Toggle points and intervals\nsubset-move-points = Move Points\nsubset-clear = Clear\n\n# Buttons that edit an orbital diagram: rows hold boxes, boxes hold up to\n# three spin arrows.\norbital-add-row = Add Row\norbital-remove-row = Remove Row\norbital-add-box = Add Box\norbital-remove-box = Remove Box\norbital-add-up-arrow = Add Up Arrow\norbital-add-down-arrow = Add Down Arrow\norbital-remove-arrow = Remove Arrow\n\n# Accessible name of the text field naming one row of an orbital diagram,\n# counting from 1.\norbital-row-label = Label for row { $row }\n\n# Labels the answer column of a pretzel exercise's grid.\npretzel-answer = Answer\n\n# Caption above the table a `<summaryStatistics>` renders. `$column` is the\n# authored name of the data column being summarized and is never translated.\n# The table's own headings (`mean`, `stdev`, `quartile1`, …) are the statistic\n# ids an author references, not prose, and stay in place.\nsummary-statistics-caption = Summary statistics of { $column }\n\n\n## Math input\n\n# Accessible name of the popover that previews the typed expression, and of\n# the rendered expression inside it.\nmath-input-preview-region = math expression preview\nmath-input-preview = Preview\nmath-input-invalid-expression = Invalid expression:\n\n\n## Document status\n\n# Shown while the core is still starting up and nothing can be rendered yet.\nviewer-initializing = Initializing...\n\n\n## Errors\n\n# Prefixes an error message wherever one is shown in place of content: an\n# `<error>` the core reported, the error boundary's fallback, and the\n# placeholder left where a renderer chunk failed to load.\nerror-heading = Error\n\n# Banner above a document that compiled with at least one error in it.\ndocument-contains-errors = This document contains errors!\n\n# Shown in place of the document when a renderer threw and the error boundary\n# caught it.\nsomething-went-wrong = Something went wrong.\n\n# Shown in place of a single renderer whose code chunk never arrived.\nrenderer-load-failed = a renderer failed to load. Please reload the page.\n\n# Shown in place of the document when the core worker could not be started\n# after retries, rather than leaving the pane blank.\ncore-start-failed = The document viewer could not be started. Please reload the page.\n";
40831
+ const content$4 = "# Worker-generated content: style descriptions (\"thick red line\"), boolean\n# words, and other prose the core computes into the document. Selected by\n# `documentLocale`, which follows the content's language rather than the\n# reader's UI language.\n#\n# Intentionally empty in i18n Phase 0 (#1515). Phase 2 moves the color words\n# behind `resolveColorWord`'s existing `translate` hook into this file.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`color.blue`, `css-color.rebeccapurple`).\n";
40832
+ const diagnostics = "# Errors and warnings surfaced to the reader or author. Produced by the worker\n# but addressed to whoever is looking at the screen, so these are selected by\n# `uiLocale`, not `documentLocale`.\n#\n# Intentionally empty in i18n Phase 0 (#1515). Phase 3 moves the diagnostic\n# messages into this file.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`invalid-attribute-value`).\n";
40833
+ const editor = "# Editor and language-server surfaces: formatter labels, completion detail\n# text, hover help. Selected by `uiLocale`.\n#\n# Intentionally empty in i18n Phase 0 (#1515). A later phase moves the editor\n# strings into this file; note that the LSP ships bundled with its DoenetML\n# version, so these catalogs are version-correct rather than always-latest.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`format-document`).\n";
40834
+ const CATALOG_NAMESPACES = [
40835
+ "chrome",
40836
+ "content",
40837
+ "diagnostics",
40838
+ "editor"
40839
+ ];
40840
+ function combineCatalogs(catalogs) {
40841
+ return CATALOG_NAMESPACES.map((namespace) => catalogs[namespace]).filter((source) => source !== void 0).join("\n");
40842
+ }
39904
40843
  const DEFAULT_LOCALE = "en";
40844
+ const EN_CATALOGS = {
40845
+ chrome: chrome$2,
40846
+ content: content$4,
40847
+ diagnostics,
40848
+ editor
40849
+ };
40850
+ const EN_CATALOG_SOURCE = combineCatalogs(EN_CATALOGS);
40851
+ function localeResourceKey(resources) {
40852
+ return Object.keys(resources ?? {}).sort().join(",");
40853
+ }
40854
+ function lookupPattern(bundle, key) {
40855
+ const separator = key.indexOf(".");
40856
+ const id2 = separator === -1 ? key : key.slice(0, separator);
40857
+ const attribute = separator === -1 ? null : key.slice(separator + 1);
40858
+ const message = bundle.getMessage(id2);
40859
+ if (!message) {
40860
+ return null;
40861
+ }
40862
+ if (attribute === null) {
40863
+ return message.value;
40864
+ }
40865
+ return message.attributes[attribute] ?? null;
40866
+ }
40867
+ function createBundle(locale, source, useIsolating, onError) {
40868
+ const bundle = new FluentBundle(locale, { useIsolating });
40869
+ const errors2 = bundle.addResource(new FluentResource(source));
40870
+ for (const error of errors2) {
40871
+ onError?.(error, "", locale);
40872
+ }
40873
+ return bundle;
40874
+ }
40875
+ function createTranslator(locales, resources, options2 = {}) {
40876
+ const {
40877
+ useIsolating = false,
40878
+ onError,
40879
+ includeBuiltinEnglish = true
40880
+ } = options2;
40881
+ const bundles = [];
40882
+ for (const locale of locales) {
40883
+ const source = resources[locale];
40884
+ if (source !== void 0) {
40885
+ bundles.push(createBundle(locale, source, useIsolating, onError));
40886
+ }
40887
+ }
40888
+ if (includeBuiltinEnglish) {
40889
+ bundles.push(
40890
+ createBundle(
40891
+ DEFAULT_LOCALE,
40892
+ EN_CATALOG_SOURCE,
40893
+ useIsolating,
40894
+ onError
40895
+ )
40896
+ );
40897
+ }
40898
+ return function translate(key, args, fallback) {
40899
+ for (const bundle of bundles) {
40900
+ const pattern = lookupPattern(bundle, key);
40901
+ if (pattern === null) {
40902
+ continue;
40903
+ }
40904
+ const errors2 = [];
40905
+ const formatted = bundle.formatPattern(pattern, args, errors2);
40906
+ for (const error of errors2) {
40907
+ onError?.(error, key, bundle.locales[0]);
40908
+ }
40909
+ return formatted;
40910
+ }
40911
+ return fallback ?? key;
40912
+ };
40913
+ }
40914
+ const languageCodeRe = "([a-z]{2,3}|\\*)";
40915
+ const scriptCodeRe = "(?:-([a-z]{4}|\\*))";
40916
+ const regionCodeRe = "(?:-([a-z]{2}|\\*))";
40917
+ const variantCodeRe = "(?:-(([0-9][a-z0-9]{3}|[a-z0-9]{5,8})|\\*))";
40918
+ const localeRe = new RegExp(`^${languageCodeRe}${scriptCodeRe}?${regionCodeRe}?${variantCodeRe}?$`, "i");
40919
+ class Locale {
40920
+ /**
40921
+ * Parses a locale id using the localeRe into an array with four elements.
40922
+ *
40923
+ * If the second argument `range` is set to true, it places range `*` char
40924
+ * in place of any missing piece.
40925
+ *
40926
+ * It also allows skipping the script section of the id, so `en-US` is
40927
+ * properly parsed as `en-*-US-*`.
40928
+ */
40929
+ constructor(locale) {
40930
+ const result2 = localeRe.exec(locale.replace(/_/g, "-"));
40931
+ if (!result2) {
40932
+ this.isWellFormed = false;
40933
+ return;
40934
+ }
40935
+ let [, language2, script, region, variant] = result2;
40936
+ if (language2) {
40937
+ this.language = language2.toLowerCase();
40938
+ }
40939
+ if (script) {
40940
+ this.script = script[0].toUpperCase() + script.slice(1);
40941
+ }
40942
+ if (region) {
40943
+ this.region = region.toUpperCase();
40944
+ }
40945
+ this.variant = variant;
40946
+ this.isWellFormed = true;
40947
+ }
40948
+ isEqual(other) {
40949
+ return this.language === other.language && this.script === other.script && this.region === other.region && this.variant === other.variant;
40950
+ }
40951
+ matches(other, thisRange = false, otherRange = false) {
40952
+ return (this.language === other.language || thisRange && this.language === void 0 || otherRange && other.language === void 0) && (this.script === other.script || thisRange && this.script === void 0 || otherRange && other.script === void 0) && (this.region === other.region || thisRange && this.region === void 0 || otherRange && other.region === void 0) && (this.variant === other.variant || thisRange && this.variant === void 0 || otherRange && other.variant === void 0);
40953
+ }
40954
+ toString() {
40955
+ return [this.language, this.script, this.region, this.variant].filter((part) => part !== void 0).join("-");
40956
+ }
40957
+ clearVariants() {
40958
+ this.variant = void 0;
40959
+ }
40960
+ clearRegion() {
40961
+ this.region = void 0;
40962
+ }
40963
+ addLikelySubtags() {
40964
+ const newLocale = getLikelySubtagsMin(this.toString().toLowerCase());
40965
+ if (newLocale) {
40966
+ this.language = newLocale.language;
40967
+ this.script = newLocale.script;
40968
+ this.region = newLocale.region;
40969
+ this.variant = newLocale.variant;
40970
+ return true;
40971
+ }
40972
+ return false;
40973
+ }
40974
+ }
40975
+ const likelySubtagsMin = {
40976
+ ar: "ar-arab-eg",
40977
+ "az-arab": "az-arab-ir",
40978
+ "az-ir": "az-arab-ir",
40979
+ be: "be-cyrl-by",
40980
+ da: "da-latn-dk",
40981
+ el: "el-grek-gr",
40982
+ en: "en-latn-us",
40983
+ fa: "fa-arab-ir",
40984
+ ja: "ja-jpan-jp",
40985
+ ko: "ko-kore-kr",
40986
+ pt: "pt-latn-br",
40987
+ sr: "sr-cyrl-rs",
40988
+ "sr-ru": "sr-latn-ru",
40989
+ sv: "sv-latn-se",
40990
+ ta: "ta-taml-in",
40991
+ uk: "uk-cyrl-ua",
40992
+ zh: "zh-hans-cn",
40993
+ "zh-hant": "zh-hant-tw",
40994
+ "zh-hk": "zh-hant-hk",
40995
+ "zh-mo": "zh-hant-mo",
40996
+ "zh-tw": "zh-hant-tw",
40997
+ "zh-gb": "zh-hant-gb",
40998
+ "zh-us": "zh-hant-us"
40999
+ };
41000
+ const regionMatchingLangs = [
41001
+ "az",
41002
+ "bg",
41003
+ "cs",
41004
+ "de",
41005
+ "es",
41006
+ "fi",
41007
+ "fr",
41008
+ "hu",
41009
+ "it",
41010
+ "lt",
41011
+ "lv",
41012
+ "nl",
41013
+ "pl",
41014
+ "ro",
41015
+ "ru"
41016
+ ];
41017
+ function getLikelySubtagsMin(loc) {
41018
+ if (Object.prototype.hasOwnProperty.call(likelySubtagsMin, loc)) {
41019
+ return new Locale(likelySubtagsMin[loc]);
41020
+ }
41021
+ const locale = new Locale(loc);
41022
+ if (locale.language && regionMatchingLangs.includes(locale.language)) {
41023
+ locale.region = locale.language.toUpperCase();
41024
+ return locale;
41025
+ }
41026
+ return null;
41027
+ }
41028
+ function filterMatches(requestedLocales, availableLocales, strategy) {
41029
+ const supportedLocales = /* @__PURE__ */ new Set();
41030
+ const availableLocalesMap = /* @__PURE__ */ new Map();
41031
+ for (let locale of availableLocales) {
41032
+ let newLocale = new Locale(locale);
41033
+ if (newLocale.isWellFormed) {
41034
+ availableLocalesMap.set(locale, new Locale(locale));
41035
+ }
41036
+ }
41037
+ outer: for (const reqLocStr of requestedLocales) {
41038
+ const reqLocStrLC = reqLocStr.toLowerCase();
41039
+ const requestedLocale = new Locale(reqLocStrLC);
41040
+ if (requestedLocale.language === void 0) {
41041
+ continue;
41042
+ }
41043
+ for (const key of availableLocalesMap.keys()) {
41044
+ if (reqLocStrLC === key.toLowerCase()) {
41045
+ supportedLocales.add(key);
41046
+ availableLocalesMap.delete(key);
41047
+ if (strategy === "lookup") {
41048
+ return Array.from(supportedLocales);
41049
+ } else if (strategy === "filtering") {
41050
+ continue;
41051
+ } else {
41052
+ continue outer;
41053
+ }
41054
+ }
41055
+ }
41056
+ for (const [key, availableLocale] of availableLocalesMap.entries()) {
41057
+ if (availableLocale.matches(requestedLocale, true, false)) {
41058
+ supportedLocales.add(key);
41059
+ availableLocalesMap.delete(key);
41060
+ if (strategy === "lookup") {
41061
+ return Array.from(supportedLocales);
41062
+ } else if (strategy === "filtering") {
41063
+ continue;
41064
+ } else {
41065
+ continue outer;
41066
+ }
41067
+ }
41068
+ }
41069
+ if (requestedLocale.addLikelySubtags()) {
41070
+ for (const [key, availableLocale] of availableLocalesMap.entries()) {
41071
+ if (availableLocale.matches(requestedLocale, true, false)) {
41072
+ supportedLocales.add(key);
41073
+ availableLocalesMap.delete(key);
41074
+ if (strategy === "lookup") {
41075
+ return Array.from(supportedLocales);
41076
+ } else if (strategy === "filtering") {
41077
+ continue;
41078
+ } else {
41079
+ continue outer;
41080
+ }
41081
+ }
41082
+ }
41083
+ }
41084
+ requestedLocale.clearVariants();
41085
+ for (const [key, availableLocale] of availableLocalesMap.entries()) {
41086
+ if (availableLocale.matches(requestedLocale, true, true)) {
41087
+ supportedLocales.add(key);
41088
+ availableLocalesMap.delete(key);
41089
+ if (strategy === "lookup") {
41090
+ return Array.from(supportedLocales);
41091
+ } else if (strategy === "filtering") {
41092
+ continue;
41093
+ } else {
41094
+ continue outer;
41095
+ }
41096
+ }
41097
+ }
41098
+ requestedLocale.clearRegion();
41099
+ if (requestedLocale.addLikelySubtags()) {
41100
+ for (const [key, availableLocale] of availableLocalesMap.entries()) {
41101
+ if (availableLocale.matches(requestedLocale, true, false)) {
41102
+ supportedLocales.add(key);
41103
+ availableLocalesMap.delete(key);
41104
+ if (strategy === "lookup") {
41105
+ return Array.from(supportedLocales);
41106
+ } else if (strategy === "filtering") {
41107
+ continue;
41108
+ } else {
41109
+ continue outer;
41110
+ }
41111
+ }
41112
+ }
41113
+ }
41114
+ requestedLocale.clearRegion();
41115
+ for (const [key, availableLocale] of availableLocalesMap.entries()) {
41116
+ if (availableLocale.matches(requestedLocale, true, true)) {
41117
+ supportedLocales.add(key);
41118
+ availableLocalesMap.delete(key);
41119
+ if (strategy === "lookup") {
41120
+ return Array.from(supportedLocales);
41121
+ } else if (strategy === "filtering") {
41122
+ continue;
41123
+ } else {
41124
+ continue outer;
41125
+ }
41126
+ }
41127
+ }
41128
+ }
41129
+ return Array.from(supportedLocales);
41130
+ }
41131
+ function negotiateLanguages(requestedLocales, availableLocales, { strategy = "filtering", defaultLocale } = {}) {
41132
+ const supportedLocales = filterMatches(Array.from(requestedLocales !== null && requestedLocales !== void 0 ? requestedLocales : []).map(String), Array.from(availableLocales !== null && availableLocales !== void 0 ? availableLocales : []).map(String), strategy);
41133
+ if (strategy === "lookup") {
41134
+ if (defaultLocale === void 0) {
41135
+ throw new Error("defaultLocale cannot be undefined for strategy `lookup`");
41136
+ }
41137
+ if (supportedLocales.length === 0) {
41138
+ supportedLocales.push(defaultLocale);
41139
+ }
41140
+ } else if (defaultLocale && !supportedLocales.includes(defaultLocale)) {
41141
+ supportedLocales.push(defaultLocale);
41142
+ }
41143
+ return supportedLocales;
41144
+ }
41145
+ function negotiateLocales(requested, available, options2 = {}) {
41146
+ const { defaultLocale = DEFAULT_LOCALE } = options2;
41147
+ const availableWithDefault = available.includes(defaultLocale) ? available : [...available, defaultLocale];
41148
+ return negotiateLanguages(requested, availableWithDefault, {
41149
+ strategy: "filtering",
41150
+ defaultLocale
41151
+ });
41152
+ }
39905
41153
  function declaredDocumentLocale(authoredLang, hostLocale) {
39906
41154
  const tag2 = (authoredLang ?? "").trim() || (hostLocale ?? "").trim();
39907
41155
  if (tag2 === "") {
@@ -39909,6 +41157,9 @@ function declaredDocumentLocale(authoredLang, hostLocale) {
39909
41157
  }
39910
41158
  return normalizeLocaleTag(tag2) || void 0;
39911
41159
  }
41160
+ function resolveDocumentLocale(authoredLang, hostLocale) {
41161
+ return declaredDocumentLocale(authoredLang, hostLocale) ?? DEFAULT_LOCALE;
41162
+ }
39912
41163
  function resolveUiLocale(uiLocale, documentLocale) {
39913
41164
  return normalizeLocaleTag(uiLocale ?? "") || documentLocale;
39914
41165
  }
@@ -39923,6 +41174,153 @@ function normalizeLocaleTag(tag2) {
39923
41174
  return trimmed;
39924
41175
  }
39925
41176
  }
41177
+ const PSEUDO_LOCALE = "en-XA";
41178
+ const ACCENT_MAP = {
41179
+ a: "á",
41180
+ b: "ƀ",
41181
+ c: "ç",
41182
+ d: "ð",
41183
+ e: "é",
41184
+ f: "ƒ",
41185
+ g: "ğ",
41186
+ h: "ĥ",
41187
+ i: "í",
41188
+ j: "ĵ",
41189
+ k: "ķ",
41190
+ l: "ļ",
41191
+ m: "ɱ",
41192
+ n: "ñ",
41193
+ o: "ó",
41194
+ p: "þ",
41195
+ q: "ʠ",
41196
+ r: "ř",
41197
+ s: "š",
41198
+ t: "ţ",
41199
+ u: "ú",
41200
+ v: "ṽ",
41201
+ w: "ŵ",
41202
+ x: "ẋ",
41203
+ y: "ý",
41204
+ z: "ž",
41205
+ A: "Á",
41206
+ B: "Ɓ",
41207
+ C: "Ç",
41208
+ D: "Ð",
41209
+ E: "É",
41210
+ F: "Ƒ",
41211
+ G: "Ğ",
41212
+ H: "Ĥ",
41213
+ I: "Í",
41214
+ J: "Ĵ",
41215
+ K: "Ķ",
41216
+ L: "Ļ",
41217
+ M: "Ṁ",
41218
+ N: "Ñ",
41219
+ O: "Ó",
41220
+ P: "Þ",
41221
+ Q: "Ɋ",
41222
+ R: "Ř",
41223
+ S: "Š",
41224
+ T: "Ţ",
41225
+ U: "Ú",
41226
+ V: "Ṽ",
41227
+ W: "Ŵ",
41228
+ X: "Ẋ",
41229
+ Y: "Ý",
41230
+ Z: "Ž"
41231
+ };
41232
+ const MESSAGE_PREFIX = /^([a-zA-Z][\w-]*\s*=\s*)/;
41233
+ const TERM_PREFIX = /^(-[a-zA-Z][\w-]*\s*=\s*)/;
41234
+ const ATTRIBUTE_PREFIX = /^(\s+\.[a-zA-Z][\w-]*\s*=\s*)/;
41235
+ const VARIANT_PREFIX = /^(\s*\*?\[[^\]]*\]\s*)/;
41236
+ const INDENT_PREFIX = /^(\s+)/;
41237
+ function accentTextRuns(value) {
41238
+ let depth = 0;
41239
+ let letterCount = 0;
41240
+ let text2 = "";
41241
+ for (const char of value) {
41242
+ if (char === "{") {
41243
+ depth += 1;
41244
+ text2 += char;
41245
+ continue;
41246
+ }
41247
+ if (char === "}") {
41248
+ depth = Math.max(0, depth - 1);
41249
+ text2 += char;
41250
+ continue;
41251
+ }
41252
+ if (depth > 0) {
41253
+ text2 += char;
41254
+ continue;
41255
+ }
41256
+ const accented = ACCENT_MAP[char];
41257
+ if (accented === void 0) {
41258
+ text2 += char;
41259
+ } else {
41260
+ text2 += accented;
41261
+ letterCount += 1;
41262
+ }
41263
+ }
41264
+ return { text: text2, letterCount };
41265
+ }
41266
+ function splitValue(line2) {
41267
+ if (line2.trim() === "" || line2.trimStart().startsWith("#")) {
41268
+ return null;
41269
+ }
41270
+ for (const pattern of [
41271
+ MESSAGE_PREFIX,
41272
+ TERM_PREFIX,
41273
+ ATTRIBUTE_PREFIX,
41274
+ VARIANT_PREFIX,
41275
+ INDENT_PREFIX
41276
+ ]) {
41277
+ const match2 = pattern.exec(line2);
41278
+ if (match2) {
41279
+ return { prefix: match2[1], value: line2.slice(match2[1].length) };
41280
+ }
41281
+ }
41282
+ return { prefix: "", value: line2 };
41283
+ }
41284
+ function pseudoLocalize(ftlSource, options2 = {}) {
41285
+ const { expansion = 0.3, brackets = ["»", "«"] } = options2;
41286
+ const [open, close] = brackets;
41287
+ return ftlSource.split("\n").map((line2) => {
41288
+ const split = splitValue(line2);
41289
+ if (split === null) {
41290
+ return line2;
41291
+ }
41292
+ const { text: text2, letterCount } = accentTextRuns(split.value);
41293
+ if (letterCount === 0) {
41294
+ return line2;
41295
+ }
41296
+ const padding = "·".repeat(Math.ceil(letterCount * expansion));
41297
+ return `${split.prefix}${open}${text2}${padding}${close}`;
41298
+ }).join("\n");
41299
+ }
41300
+ const esChrome = "# Spanish viewer chrome. Translated from `locales/en/chrome.ftl`, which is the\n# source of truth: `lint:i18n` rejects a key that does not exist there, and\n# reports a key that exists there but not here as missing coverage.\n#\n# Message ids are never translated — only the text to the right of `=`.\n#\n# Register: impersonal throughout — infinitives and bare nouns, never a `tú`\n# or `usted` verb form. The viewer does not know how formally a deployment\n# addresses its readers, and an impersonal label is correct for both.\n\n\n## Answer submission\n\nanswer-checking = Comprobando...\nanswer-submitting = Enviando...\n\nanswer-checking-status = Comprobando la respuesta\nanswer-submitting-status = Enviando la respuesta\n\nanswer-correct = Correcto\nanswer-incorrect = Incorrecto\n\nanswer-response-saved = Respuesta guardada\n\n# Spanish typographic convention puts a space before the percent sign.\nanswer-percent-credit = { $percent } % de crédito\nanswer-percent-correct = { $percent } % correcto\nanswer-percent-short = { $percent } %\n\nmax-credit-available = Crédito máximo disponible: { $percent } %\n\nattempts-remaining =\n { $count ->\n [0] no quedan intentos\n [one] queda { $count } intento\n *[other] quedan { $count } intentos\n }\n\nvalidation-correct = (Correcto)\nvalidation-incorrect = (Incorrecto)\nvalidation-partially-correct = (Parcialmente correcto)\n\n# `Mostrar` is the infinitive, per the register note above.\nanswer-show-responses =\n { $count ->\n [one] Mostrar { $count } respuesta a { $answerId }\n *[other] Mostrar { $count } respuestas a { $answerId }\n }\n\n\n## Disclosure panels\n\nfeedback-heading = Comentarios\n\ncollapsible-click-to-open = (clic para abrir)\ncollapsible-click-to-close = (clic para cerrar)\ncollapsible-initializing = Inicializando...\n\nfootnote-show = Mostrar la nota al pie\nfootnote-hide = Ocultar la nota al pie\n\ndescription-more-information = más información\n\n\n## Controls\n\nslider-previous = Anterior\nslider-next = Siguiente\n\nkeyboard-open = Abrir el teclado\nkeyboard-close = Cerrar el teclado\n\nmatrix-remove-row = Eliminar fila\nmatrix-add-row = Añadir fila\nmatrix-remove-column = Eliminar columna\nmatrix-add-column = Añadir columna\n\nsubset-add-remove-points = Añadir/Eliminar puntos\nsubset-toggle-points-intervals = Alternar puntos e intervalos\nsubset-move-points = Mover puntos\nsubset-clear = Borrar\n\norbital-add-row = Añadir fila\norbital-remove-row = Eliminar fila\norbital-add-box = Añadir casilla\norbital-remove-box = Eliminar casilla\norbital-add-up-arrow = Añadir flecha hacia arriba\norbital-add-down-arrow = Añadir flecha hacia abajo\norbital-remove-arrow = Eliminar flecha\n\norbital-row-label = Etiqueta de la fila { $row }\n\npretzel-answer = Respuesta\n\nsummary-statistics-caption = Resumen estadístico de { $column }\n\n\n## Math input\n\nmath-input-preview-region = vista previa de la expresión matemática\nmath-input-preview = Vista previa\nmath-input-invalid-expression = Expresión no válida:\n\n\n## Document status\n\nviewer-initializing = Inicializando...\n\n\n## Errors\n\nerror-heading = Error\n\ndocument-contains-errors = ¡Este documento contiene errores!\n\nsomething-went-wrong = Algo salió mal.\n\n# Follows `error-heading` and a colon, so it begins in lower case, as in\n# English. The instruction is an infinitive, per the register note above.\nrenderer-load-failed = no se pudo cargar un componente. Recargar la página.\n\ncore-start-failed = No se pudo iniciar el visor del documento. Recargar la página.\n";
41301
+ const BUNDLED_CHROME_CATALOGS = {
41302
+ [DEFAULT_LOCALE]: EN_CATALOGS.chrome,
41303
+ es: esChrome
41304
+ };
41305
+ let pseudoChromeCatalog;
41306
+ function getPseudoChromeCatalog() {
41307
+ return pseudoChromeCatalog ??= pseudoLocalize(EN_CATALOGS.chrome);
41308
+ }
41309
+ function chromeResources(normalizedUiLocale, hostResources) {
41310
+ const resources = { ...BUNDLED_CHROME_CATALOGS };
41311
+ if (normalizedUiLocale === PSEUDO_LOCALE) {
41312
+ resources[PSEUDO_LOCALE] = getPseudoChromeCatalog();
41313
+ }
41314
+ return Object.assign(resources, hostResources);
41315
+ }
41316
+ function createChromeTranslator(uiLocale, hostResources) {
41317
+ const normalized = normalizeLocaleTag(uiLocale) || DEFAULT_LOCALE;
41318
+ const resources = chromeResources(normalized, hostResources);
41319
+ const locales = negotiateLocales([normalized], Object.keys(resources));
41320
+ return createTranslator(locales, resources);
41321
+ }
41322
+ let enChromeTranslator;
41323
+ const EN_CHROME_TRANSLATOR = (key, args, fallback) => (enChromeTranslator ??= createTranslator([], {}))(key, args, fallback);
39926
41324
  function readDocumentLang(dast) {
39927
41325
  const documentElement = dast.children.find(
39928
41326
  (child) => child.type === "element" && child.name === "document"
@@ -41488,7 +42886,7 @@ function isPlain(val) {
41488
42886
  const type = typeof val;
41489
42887
  return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject$4(val);
41490
42888
  }
41491
- function findNonSerializableValue(value, path = "", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) {
42889
+ function findNonSerializableValue(value, path = "", isSerializable = isPlain, getEntries, ignoredPaths = [], cache2) {
41492
42890
  let foundNestedSerializable;
41493
42891
  if (!isSerializable(value)) {
41494
42892
  return {
@@ -41499,7 +42897,7 @@ function findNonSerializableValue(value, path = "", isSerializable = isPlain, ge
41499
42897
  if (typeof value !== "object" || value === null) {
41500
42898
  return false;
41501
42899
  }
41502
- if (cache?.has(value)) return false;
42900
+ if (cache2?.has(value)) return false;
41503
42901
  const entries = getEntries != null ? getEntries(value) : Object.entries(value);
41504
42902
  const hasIgnoredPaths = ignoredPaths.length > 0;
41505
42903
  for (const [key, nestedValue] of entries) {
@@ -41522,13 +42920,13 @@ function findNonSerializableValue(value, path = "", isSerializable = isPlain, ge
41522
42920
  };
41523
42921
  }
41524
42922
  if (typeof nestedValue === "object") {
41525
- foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
42923
+ foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache2);
41526
42924
  if (foundNestedSerializable) {
41527
42925
  return foundNestedSerializable;
41528
42926
  }
41529
42927
  }
41530
42928
  }
41531
- if (cache && isNestedFrozen(value)) cache.add(value);
42929
+ if (cache2 && isNestedFrozen(value)) cache2.add(value);
41532
42930
  return false;
41533
42931
  }
41534
42932
  function isNestedFrozen(value) {
@@ -41554,7 +42952,7 @@ function createSerializableStateInvariantMiddleware(options2 = {}) {
41554
42952
  ignoreActions = false,
41555
42953
  disableCache = false
41556
42954
  } = options2;
41557
- const cache = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;
42955
+ const cache2 = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;
41558
42956
  return (storeAPI) => (next) => (action) => {
41559
42957
  if (!isAction(action)) {
41560
42958
  return next(action);
@@ -41563,7 +42961,7 @@ function createSerializableStateInvariantMiddleware(options2 = {}) {
41563
42961
  const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
41564
42962
  if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
41565
42963
  measureUtils.measureTime(() => {
41566
- const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
42964
+ const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache2);
41567
42965
  if (foundActionNonSerializableValue) {
41568
42966
  const {
41569
42967
  keyPath,
@@ -41576,7 +42974,7 @@ function createSerializableStateInvariantMiddleware(options2 = {}) {
41576
42974
  if (!ignoreState) {
41577
42975
  measureUtils.measureTime(() => {
41578
42976
  const state = storeAPI.getState();
41579
- const foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
42977
+ const foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache2);
41580
42978
  if (foundStateNonSerializableValue) {
41581
42979
  const {
41582
42980
  keyPath,
@@ -42987,6 +44385,32 @@ const store = configureStore({
42987
44385
  keyboard: keyboardSlice.reducer
42988
44386
  }
42989
44387
  });
44388
+ const I18nContext = createContext(EN_CHROME_TRANSLATOR);
44389
+ function useChromeTranslator(uiLocale, localeResources) {
44390
+ const resourceKey = localeResourceKey(localeResources);
44391
+ return useMemo(
44392
+ () => createChromeTranslator(uiLocale, localeResources),
44393
+ [uiLocale, resourceKey]
44394
+ );
44395
+ }
44396
+ function useHostChromeTranslator(uiLocale, documentLocale, localeResources) {
44397
+ return useChromeTranslator(
44398
+ resolveUiLocale(
44399
+ uiLocale,
44400
+ resolveDocumentLocale(void 0, documentLocale)
44401
+ ),
44402
+ localeResources
44403
+ );
44404
+ }
44405
+ function I18nProvider({
44406
+ translate,
44407
+ children
44408
+ }) {
44409
+ return /* @__PURE__ */ jsxRuntimeExports$3.jsx(I18nContext.Provider, { value: translate, children });
44410
+ }
44411
+ function useT() {
44412
+ return useContext(I18nContext);
44413
+ }
42990
44414
  function isTransientDynamicImportError(error) {
42991
44415
  const message = error instanceof Error ? error.message : String(error);
42992
44416
  return /Failed to fetch dynamically imported module/i.test(message) || /Importing a module script failed/i.test(message) || /error loading dynamically imported module/i.test(message) || /dynamically imported module/i.test(message);
@@ -43012,6 +44436,7 @@ async function importRendererWithRetry(loader, name2, retries = 3, initialDelayM
43012
44436
  }
43013
44437
  }
43014
44438
  function RendererLoadFailed(props2) {
44439
+ const t4 = useT();
43015
44440
  return /* @__PURE__ */ jsxRuntimeExports$3.jsxs(
43016
44441
  "div",
43017
44442
  {
@@ -43027,8 +44452,14 @@ function RendererLoadFailed(props2) {
43027
44452
  textAlign: "center"
43028
44453
  },
43029
44454
  children: [
43030
- /* @__PURE__ */ jsxRuntimeExports$3.jsx("b", { children: "Error" }),
43031
- ": a renderer failed to load. Please reload the page."
44455
+ /* @__PURE__ */ jsxRuntimeExports$3.jsx("b", { children: t4("error-heading", void 0, "Error") }),
44456
+ ":",
44457
+ " ",
44458
+ t4(
44459
+ "renderer-load-failed",
44460
+ void 0,
44461
+ "a renderer failed to load. Please reload the page."
44462
+ )
43032
44463
  ]
43033
44464
  }
43034
44465
  );
@@ -43306,7 +44737,7 @@ function DocViewer({
43306
44737
  const coreCreated = useRef(false);
43307
44738
  const coreCreationInProgress = useRef(false);
43308
44739
  const coreId = useRef("");
43309
- const diagnostics = useRef([]);
44740
+ const diagnostics2 = useRef([]);
43310
44741
  const [hasInitialError, setHasInitialError] = useState(false);
43311
44742
  const actionsBeforeCoreCreated = useRef([]);
43312
44743
  const preventMoreAnimations = useRef(false);
@@ -43328,6 +44759,7 @@ function DocViewer({
43328
44759
  uiLocale,
43329
44760
  effectiveDocumentLocale
43330
44761
  );
44762
+ const translate = useChromeTranslator(effectiveUiLocale, localeResources);
43331
44763
  const coreWorker = useRef(null);
43332
44764
  const coreWorkerKill = useRef(
43333
44765
  null
@@ -43478,7 +44910,7 @@ function DocViewer({
43478
44910
  return allStateVariables;
43479
44911
  };
43480
44912
  window["returnDiagnostics" + postfixForWindowFunctions] = function() {
43481
- return diagnostics.current;
44913
+ return diagnostics2.current;
43482
44914
  };
43483
44915
  window["callAction" + postfixForWindowFunctions] = async function({
43484
44916
  actionName,
@@ -43774,7 +45206,7 @@ function DocViewer({
43774
45206
  for (const rendererClassName of coreInfo.current.rendererTypesInDocument) {
43775
45207
  rendererClassNames.push(rendererClassName);
43776
45208
  rendererLoaders.push(
43777
- () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./renderers/GraphFrame.tsx": () => import("./GraphFrame-8IPcvXqk.js"), "./renderers/JSXGraphRenderer.tsx": () => import("./JSXGraphRenderer-Be41lgIz.js").then((n2) => n2.m), "./renderers/_error.tsx": () => import("./_error-DhRiszio.js"), "./renderers/alert.tsx": () => import("./alert-CExDcbrh.js"), "./renderers/angle.tsx": () => import("./angle-FCTtCuvN.js"), "./renderers/answer.tsx": () => import("./answer-BLusvBSG.js"), "./renderers/asList.tsx": () => import("./asList-Dv__hv6D.js"), "./renderers/blockQuote.tsx": () => import("./blockQuote-B6Wtw4HN.js"), "./renderers/boolean.tsx": () => import("./boolean-IP59-Zjp.js"), "./renderers/booleanInput.tsx": () => import("./booleanInput-BCNoC_vo.js"), "./renderers/br.tsx": () => import("./br-BqejfFtq.js"), "./renderers/button.tsx": () => import("./button-DzYMy3G6.js"), "./renderers/c.tsx": () => import("./c-wV9nNSPC.js"), "./renderers/cell.tsx": () => import("./cell-Cfv7v4mc.js"), "./renderers/choiceInput.tsx": () => import("./choiceInput-BjbqDU9d.js"), "./renderers/circle.tsx": () => import("./circle-CQ5lWEtc.js"), "./renderers/cobwebPolyline.tsx": () => import("./cobwebPolyline-CAStHK_5.js"), "./renderers/codeEditor.tsx": () => import("./codeEditor-C2tiWOSh.js"), "./renderers/containerBlock.tsx": () => import("./containerBlock-CLEUmhMM.js"), "./renderers/containerInline.tsx": () => import("./containerInline-kv3umsgq.js"), "./renderers/curve.tsx": () => import("./curve-gdmcSsYU.js"), "./renderers/ellipsis.tsx": () => import("./ellipsis-D4fj-dH6.js"), "./renderers/em.tsx": () => import("./em-BLDmBPbZ.js"), "./renderers/embed.tsx": () => import("./embed-DFjdhAuI.js"), "./renderers/feedback.tsx": () => import("./feedback-BDSuY82b.js"), "./renderers/figure.tsx": () => import("./figure-DCQvyct_.js"), "./renderers/footnote.tsx": () => import("./footnote-EqPCQBWN.js"), "./renderers/fractionInput.tsx": () => import("./fractionInput-CLSJPyA_.js"), "./renderers/graph.tsx": () => import("./graph-C6hIOAwD.js"), "./renderers/hint.tsx": () => import("./hint-5LodBIQj.js"), "./renderers/hr.tsx": () => import("./hr-C9sb2QsS.js"), "./renderers/image.tsx": () => import("./image-CVqPuME4.js"), "./renderers/label.tsx": () => import("./label-BH-b9r-w.js"), "./renderers/legend.tsx": () => import("./legend-Dmq310xU.js"), "./renderers/line.tsx": () => import("./line-BerJZTGH.js"), "./renderers/lineSegment.tsx": () => import("./lineSegment-BUtYPLbh.js"), "./renderers/list.tsx": () => import("./list-Ye_2Ltwm.js"), "./renderers/lq.tsx": () => import("./lq-BiqdUNus.js"), "./renderers/lsq.tsx": () => import("./lsq-DiKKUzSa.js"), "./renderers/math.tsx": () => import("./math-CIdkbUN1.js"), "./renderers/mathInput.tsx": () => import("./mathInput-BzRlJdzU.js"), "./renderers/matrixInput.tsx": () => import("./matrixInput-DDs7lvBh.js"), "./renderers/mdash.tsx": () => import("./mdash-6RQrvN6B.js"), "./renderers/nbsp.tsx": () => import("./nbsp-Bv8MOxpQ.js"), "./renderers/ndash.tsx": () => import("./ndash-9o2u4hWP.js"), "./renderers/number.tsx": () => import("./number-CkoP-Awu.js"), "./renderers/orbitalDiagram.tsx": () => import("./orbitalDiagram-B0YGzU6e.js"), "./renderers/orbitalDiagramInput.tsx": () => import("./orbitalDiagramInput-CMOVOQd6.js"), "./renderers/p.tsx": () => import("./p-Ds5IiZOP.js"), "./renderers/paginatorControls.tsx": () => import("./paginatorControls-2F08srE_.js"), "./renderers/pegboard.tsx": () => import("./pegboard-CJ7R1ORC.js"), "./renderers/point.tsx": () => import("./point-DWqkuQLD.js"), "./renderers/polygon.tsx": () => import("./polygon-DVaeOcPw.js"), "./renderers/polyline.tsx": () => import("./polyline-DQvHh8rj.js"), "./renderers/pre.tsx": () => import("./pre-C_MW5Olo.js"), "./renderers/prefigure.tsx": () => import("./prefigure-Ci1f1zUh.js"), "./renderers/pretzel.tsx": () => import("./pretzel-DVucy8kL.js"), "./renderers/q.tsx": () => import("./q-CNXXCBSX.js"), "./renderers/ray.tsx": () => import("./ray-DJJXgWjR.js"), "./renderers/ref.tsx": () => import("./ref-Cd36RrOw.js"), "./renderers/regionBetweenCurveXAxis.tsx": () => import("./regionBetweenCurveXAxis-C4leqEex.js"), "./renderers/regionBetweenCurves.tsx": () => import("./regionBetweenCurves-BMps4Bio.js"), "./renderers/row.tsx": () => import("./row-CbA-d6r0.js"), "./renderers/rq.tsx": () => import("./rq-DOr-Phc5.js"), "./renderers/rsq.tsx": () => import("./rsq-DIEK5RYn.js"), "./renderers/section.tsx": () => import("./section-DxVcSpPO.js"), "./renderers/sideBySide.tsx": () => import("./sideBySide-Dax2p65a.js"), "./renderers/slider.tsx": () => import("./slider-WcUbkagC.js"), "./renderers/solution.tsx": () => import("./solution-pYYqr4mI.js"), "./renderers/spreadsheet.tsx": () => import("./spreadsheet-BrvEPVkR.js"), "./renderers/sq.tsx": () => import("./sq-CsVdwQ0w.js"), "./renderers/subsetOfRealsInput.tsx": () => import("./subsetOfRealsInput-C7LSCImc.js"), "./renderers/summaryStatistics.tsx": () => import("./summaryStatistics-Dx4n5bYn.js"), "./renderers/table.tsx": () => import("./table-BCG2EBik.js"), "./renderers/tabular.tsx": () => import("./tabular-DEiey_kF.js"), "./renderers/tag.tsx": () => import("./tag-CfZ-K_y5.js"), "./renderers/text.tsx": () => import("./text-C6U0VcDc.js"), "./renderers/textInput.tsx": () => import("./textInput-CaAFDfjE.js"), "./renderers/vector.tsx": () => import("./vector-eEvp4DAc.js"), "./renderers/video.tsx": () => import("./video-B7wOIA1h.js") }), `./renderers/${rendererClassName}.tsx`, 3)
45209
+ () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./renderers/GraphFrame.tsx": () => import("./GraphFrame-7muJHYBu.js"), "./renderers/JSXGraphRenderer.tsx": () => import("./JSXGraphRenderer-DH6ZzfYT.js").then((n2) => n2.m), "./renderers/_error.tsx": () => import("./_error-BdTgXDgj.js"), "./renderers/alert.tsx": () => import("./alert-Bp9rBO1c.js"), "./renderers/angle.tsx": () => import("./angle-xoJC6SFX.js"), "./renderers/answer.tsx": () => import("./answer-_Zvxo4jA.js"), "./renderers/asList.tsx": () => import("./asList-DZD-Xdrj.js"), "./renderers/blockQuote.tsx": () => import("./blockQuote-CUi9cydG.js"), "./renderers/boolean.tsx": () => import("./boolean-CX7vVQJz.js"), "./renderers/booleanInput.tsx": () => import("./booleanInput-CceFBEy2.js"), "./renderers/br.tsx": () => import("./br-C_fdDVKv.js"), "./renderers/button.tsx": () => import("./button-DBxivYmV.js"), "./renderers/c.tsx": () => import("./c-Dr5FHPut.js"), "./renderers/cell.tsx": () => import("./cell-hqwqMA4A.js"), "./renderers/choiceInput.tsx": () => import("./choiceInput-7JZaBHNZ.js"), "./renderers/circle.tsx": () => import("./circle-BqfCWmj2.js"), "./renderers/cobwebPolyline.tsx": () => import("./cobwebPolyline-JFOTL1HK.js"), "./renderers/codeEditor.tsx": () => import("./codeEditor-oSH9duvd.js"), "./renderers/containerBlock.tsx": () => import("./containerBlock-BwJnX0UE.js"), "./renderers/containerInline.tsx": () => import("./containerInline-DSHf9h9o.js"), "./renderers/curve.tsx": () => import("./curve-BH7j7hXT.js"), "./renderers/ellipsis.tsx": () => import("./ellipsis-CQ4585lT.js"), "./renderers/em.tsx": () => import("./em-CYcBkUiA.js"), "./renderers/embed.tsx": () => import("./embed-Be0he9Uz.js"), "./renderers/feedback.tsx": () => import("./feedback-ByTDuaNm.js"), "./renderers/figure.tsx": () => import("./figure-Dl_yKz7e.js"), "./renderers/footnote.tsx": () => import("./footnote-BpmhdxIC.js"), "./renderers/fractionInput.tsx": () => import("./fractionInput-CCMZLzep.js"), "./renderers/graph.tsx": () => import("./graph-CJRztDFF.js"), "./renderers/hint.tsx": () => import("./hint-39ljV3xf.js"), "./renderers/hr.tsx": () => import("./hr-ACnfIwXC.js"), "./renderers/image.tsx": () => import("./image-DvAqXhei.js"), "./renderers/label.tsx": () => import("./label-C63Ww5PO.js"), "./renderers/legend.tsx": () => import("./legend-BIyyKsy5.js"), "./renderers/line.tsx": () => import("./line-nzRw-2iw.js"), "./renderers/lineSegment.tsx": () => import("./lineSegment-DEV7vXZ3.js"), "./renderers/list.tsx": () => import("./list-0vosUKx2.js"), "./renderers/lq.tsx": () => import("./lq-C6SI-4Ja.js"), "./renderers/lsq.tsx": () => import("./lsq-77sCkOO8.js"), "./renderers/math.tsx": () => import("./math-dC5Avala.js"), "./renderers/mathInput.tsx": () => import("./mathInput-Be03NUZy.js"), "./renderers/matrixInput.tsx": () => import("./matrixInput-BZHnwuib.js"), "./renderers/mdash.tsx": () => import("./mdash-D-AfwjXw.js"), "./renderers/nbsp.tsx": () => import("./nbsp-D2K2UhZb.js"), "./renderers/ndash.tsx": () => import("./ndash-DadHhIWX.js"), "./renderers/number.tsx": () => import("./number-dzVGZ9ov.js"), "./renderers/orbitalDiagram.tsx": () => import("./orbitalDiagram-Dxcuy3dt.js"), "./renderers/orbitalDiagramInput.tsx": () => import("./orbitalDiagramInput-CI-jzpnD.js"), "./renderers/p.tsx": () => import("./p-pEbvJ23K.js"), "./renderers/paginatorControls.tsx": () => import("./paginatorControls-DGwC24KV.js"), "./renderers/pegboard.tsx": () => import("./pegboard-DThvj_AK.js"), "./renderers/point.tsx": () => import("./point-DRIItKT6.js"), "./renderers/polygon.tsx": () => import("./polygon-CyiUEjCg.js"), "./renderers/polyline.tsx": () => import("./polyline-Boz-zlQv.js"), "./renderers/pre.tsx": () => import("./pre-Bjvq5iJ4.js"), "./renderers/prefigure.tsx": () => import("./prefigure-BPQPwHBD.js"), "./renderers/pretzel.tsx": () => import("./pretzel-CfNL3RKC.js"), "./renderers/q.tsx": () => import("./q-DJbSp6bj.js"), "./renderers/ray.tsx": () => import("./ray-BfGfX6gD.js"), "./renderers/ref.tsx": () => import("./ref-B-M85Wgb.js"), "./renderers/regionBetweenCurveXAxis.tsx": () => import("./regionBetweenCurveXAxis-CGlQKapF.js"), "./renderers/regionBetweenCurves.tsx": () => import("./regionBetweenCurves-DV7ARKKw.js"), "./renderers/row.tsx": () => import("./row-DBEHryOQ.js"), "./renderers/rq.tsx": () => import("./rq-DSkqTb4D.js"), "./renderers/rsq.tsx": () => import("./rsq-CmYO91JS.js"), "./renderers/section.tsx": () => import("./section-P6nedLi8.js"), "./renderers/sideBySide.tsx": () => import("./sideBySide-B__iobBS.js"), "./renderers/slider.tsx": () => import("./slider-Cj1kf_PL.js"), "./renderers/solution.tsx": () => import("./solution-CugnzBD0.js"), "./renderers/spreadsheet.tsx": () => import("./spreadsheet-BDQTKOo4.js"), "./renderers/sq.tsx": () => import("./sq-DRRKkcQ2.js"), "./renderers/subsetOfRealsInput.tsx": () => import("./subsetOfRealsInput-runRYoEh.js"), "./renderers/summaryStatistics.tsx": () => import("./summaryStatistics-CpAo0yUx.js"), "./renderers/table.tsx": () => import("./table-DFoJXU6W.js"), "./renderers/tabular.tsx": () => import("./tabular-CHSfbyFz.js"), "./renderers/tag.tsx": () => import("./tag-CgmbdQFT.js"), "./renderers/text.tsx": () => import("./text-Cp6jnCrT.js"), "./renderers/textInput.tsx": () => import("./textInput-Dqw-NXoY.js"), "./renderers/vector.tsx": () => import("./vector-Dnoio46i.js"), "./renderers/video.tsx": () => import("./video-DQw2pxWK.js") }), `./renderers/${rendererClassName}.tsx`, 3)
43778
45210
  );
43779
45211
  }
43780
45212
  const documentComponentInstructions = coreInfo.current.documentToRender;
@@ -43812,8 +45244,8 @@ function DocViewer({
43812
45244
  init: init2 = false
43813
45245
  }) {
43814
45246
  if (newDiagnostics) {
43815
- diagnostics.current = newDiagnostics;
43816
- setDiagnosticsCallback?.(diagnostics.current, doenetML);
45247
+ diagnostics2.current = newDiagnostics;
45248
+ setDiagnosticsCallback?.(diagnostics2.current, doenetML);
43817
45249
  if (init2 && newDiagnostics.some((diagnostic2) => diagnostic2.type === "error")) {
43818
45250
  setHasInitialError(true);
43819
45251
  }
@@ -44018,7 +45450,13 @@ function DocViewer({
44018
45450
  function failCoreStart() {
44019
45451
  coreCreationInProgress.current = false;
44020
45452
  setIsInErrorState?.(true);
44021
- setErrMsg(CORE_START_FAILED_MESSAGE);
45453
+ setErrMsg(
45454
+ translate(
45455
+ "core-start-failed",
45456
+ void 0,
45457
+ CORE_START_FAILED_MESSAGE
45458
+ )
45459
+ );
44022
45460
  setHasInitialError(true);
44023
45461
  }
44024
45462
  async function handshakeCore(attempt) {
@@ -44120,13 +45558,13 @@ function DocViewer({
44120
45558
  }
44121
45559
  }
44122
45560
  if (dastResult.diagnostics) {
44123
- diagnostics.current = dastResult.diagnostics;
44124
- if (diagnostics.current.some(
45561
+ diagnostics2.current = dastResult.diagnostics;
45562
+ if (diagnostics2.current.some(
44125
45563
  (diagnostic2) => diagnostic2.type === "error"
44126
45564
  )) {
44127
45565
  setHasInitialError(true);
44128
45566
  }
44129
- setDiagnosticsCallback?.(diagnostics.current, doenetML);
45567
+ setDiagnosticsCallback?.(diagnostics2.current, doenetML);
44130
45568
  }
44131
45569
  } else {
44132
45570
  setIsInErrorState?.(true);
@@ -44295,9 +45733,9 @@ function DocViewer({
44295
45733
  lastDocumentLocale.current = documentLocale ?? null;
44296
45734
  changedState = true;
44297
45735
  }
44298
- const localeResourceKey = Object.keys(localeResources ?? {}).sort().join(",");
44299
- if (lastLocaleResourceKey.current !== localeResourceKey) {
44300
- lastLocaleResourceKey.current = localeResourceKey;
45736
+ const resourceKey = localeResourceKey(localeResources);
45737
+ if (lastLocaleResourceKey.current !== resourceKey) {
45738
+ lastLocaleResourceKey.current = resourceKey;
44301
45739
  changedState = true;
44302
45740
  }
44303
45741
  if (changedState) {
@@ -44372,7 +45810,11 @@ function DocViewer({
44372
45810
  backgroundColor: "var(--canvas)",
44373
45811
  color: "var(--canvasText)"
44374
45812
  },
44375
- children: /* @__PURE__ */ jsxRuntimeExports$3.jsx("p", { children: "Initializing...." })
45813
+ children: /* @__PURE__ */ jsxRuntimeExports$3.jsx("p", { children: translate(
45814
+ "viewer-initializing",
45815
+ void 0,
45816
+ "Initializing..."
45817
+ ) })
44376
45818
  }
44377
45819
  );
44378
45820
  }
@@ -44423,7 +45865,11 @@ function DocViewer({
44423
45865
  borderStyle: "solid",
44424
45866
  borderColor: "var(--mainRed)"
44425
45867
  };
44426
- errorOverview = /* @__PURE__ */ jsxRuntimeExports$3.jsx("div", { style: errorStyle, children: /* @__PURE__ */ jsxRuntimeExports$3.jsx("b", { children: "This document contains errors!" }) });
45868
+ errorOverview = /* @__PURE__ */ jsxRuntimeExports$3.jsx("div", { style: errorStyle, children: /* @__PURE__ */ jsxRuntimeExports$3.jsx("b", { children: translate(
45869
+ "document-contains-errors",
45870
+ void 0,
45871
+ "This document contains errors!"
45872
+ ) }) });
44427
45873
  }
44428
45874
  return /* @__PURE__ */ jsxRuntimeExports$3.jsxs(
44429
45875
  ErrorBoundary,
@@ -44432,6 +45878,7 @@ function DocViewer({
44432
45878
  errorHandler,
44433
45879
  ignoreError: ignoreRendererError,
44434
45880
  coreCreated: coreCreated.current,
45881
+ translate,
44435
45882
  children: [
44436
45883
  noCoreWarning,
44437
45884
  /* @__PURE__ */ jsxRuntimeExports$3.jsxs(
@@ -44443,7 +45890,7 @@ function DocViewer({
44443
45890
  ref: viewerContainerRef,
44444
45891
  children: [
44445
45892
  errorOverview,
44446
- /* @__PURE__ */ jsxRuntimeExports$3.jsx(DocContext.Provider, { value: contextForRenderers, children: documentRenderer })
45893
+ /* @__PURE__ */ jsxRuntimeExports$3.jsx(DocContext.Provider, { value: contextForRenderers, children: /* @__PURE__ */ jsxRuntimeExports$3.jsx(I18nProvider, { translate, children: documentRenderer }) })
44447
45894
  ]
44448
45895
  }
44449
45896
  )
@@ -44468,6 +45915,7 @@ class ErrorBoundary extends React__default.Component {
44468
45915
  if (!this.props.coreCreated) {
44469
45916
  return null;
44470
45917
  } else {
45918
+ const { translate } = this.props;
44471
45919
  return /* @__PURE__ */ jsxRuntimeExports$3.jsxs(
44472
45920
  "div",
44473
45921
  {
@@ -44481,8 +45929,14 @@ class ErrorBoundary extends React__default.Component {
44481
45929
  borderColor: "var(--mainRed)"
44482
45930
  },
44483
45931
  children: [
44484
- /* @__PURE__ */ jsxRuntimeExports$3.jsx("b", { children: "Error" }),
44485
- ": Something went wrong."
45932
+ /* @__PURE__ */ jsxRuntimeExports$3.jsx("b", { children: translate("error-heading", void 0, "Error") }),
45933
+ ":",
45934
+ " ",
45935
+ translate(
45936
+ "something-went-wrong",
45937
+ void 0,
45938
+ "Something went wrong."
45939
+ )
44486
45940
  ]
44487
45941
  }
44488
45942
  );
@@ -47299,10 +48753,10 @@ function requireReactDomClient_production() {
47299
48753
  refCount: 0
47300
48754
  };
47301
48755
  }
47302
- function releaseCache(cache) {
47303
- cache.refCount--;
47304
- 0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
47305
- cache.controller.abort();
48756
+ function releaseCache(cache2) {
48757
+ cache2.refCount--;
48758
+ 0 === cache2.refCount && scheduleCallback$2(NormalPriority, function() {
48759
+ cache2.controller.abort();
47306
48760
  });
47307
48761
  }
47308
48762
  var currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null;
@@ -52634,21 +54088,21 @@ function requireReactDomClient_production() {
52634
54088
  case 23:
52635
54089
  case 22:
52636
54090
  if (null !== fiber.memoizedState && null !== fiber.memoizedState.cachePool) {
52637
- var cache = fiber.memoizedState.cachePool.pool;
52638
- null != cache && cache.refCount++;
54091
+ var cache2 = fiber.memoizedState.cachePool.pool;
54092
+ null != cache2 && cache2.refCount++;
52639
54093
  }
52640
54094
  break;
52641
54095
  case 24:
52642
54096
  releaseCache(fiber.memoizedState.cache);
52643
54097
  }
52644
- cache = fiber.child;
52645
- if (null !== cache) cache.return = fiber, nextEffect = cache;
54098
+ cache2 = fiber.child;
54099
+ if (null !== cache2) cache2.return = fiber, nextEffect = cache2;
52646
54100
  else
52647
54101
  a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
52648
- cache = nextEffect;
52649
- var sibling = cache.sibling, returnFiber = cache.return;
52650
- detachFiberAfterEffects(cache);
52651
- if (cache === fiber) {
54102
+ cache2 = nextEffect;
54103
+ var sibling = cache2.sibling, returnFiber = cache2.return;
54104
+ detachFiberAfterEffects(cache2);
54105
+ if (cache2 === fiber) {
52652
54106
  nextEffect = null;
52653
54107
  break a;
52654
54108
  }
@@ -52663,8 +54117,8 @@ function requireReactDomClient_production() {
52663
54117
  }
52664
54118
  var DefaultAsyncDispatcher = {
52665
54119
  getCacheForType: function(resourceType) {
52666
- var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
52667
- void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
54120
+ var cache2 = readContext(CacheContext), cacheForType = cache2.data.get(resourceType);
54121
+ void 0 === cacheForType && (cacheForType = resourceType(), cache2.data.set(resourceType, cacheForType));
52668
54122
  return cacheForType;
52669
54123
  },
52670
54124
  cacheSignal: function() {
@@ -55752,24 +57206,24 @@ function requireReactDomClient_production() {
55752
57206
  var tagCaches = null;
55753
57207
  function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
55754
57208
  if (null === tagCaches) {
55755
- var cache = /* @__PURE__ */ new Map();
57209
+ var cache2 = /* @__PURE__ */ new Map();
55756
57210
  var caches = tagCaches = /* @__PURE__ */ new Map();
55757
- caches.set(ownerDocument, cache);
57211
+ caches.set(ownerDocument, cache2);
55758
57212
  } else
55759
- caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
55760
- if (cache.has(type)) return cache;
55761
- cache.set(type, null);
57213
+ caches = tagCaches, cache2 = caches.get(ownerDocument), cache2 || (cache2 = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache2));
57214
+ if (cache2.has(type)) return cache2;
57215
+ cache2.set(type, null);
55762
57216
  ownerDocument = ownerDocument.getElementsByTagName(type);
55763
57217
  for (caches = 0; caches < ownerDocument.length; caches++) {
55764
57218
  var node = ownerDocument[caches];
55765
57219
  if (!(node[internalHoistableMarker] || node[internalInstanceKey] || "link" === type && "stylesheet" === node.getAttribute("rel")) && "http://www.w3.org/2000/svg" !== node.namespaceURI) {
55766
57220
  var nodeKey = node.getAttribute(keyAttribute) || "";
55767
57221
  nodeKey = type + nodeKey;
55768
- var existing = cache.get(nodeKey);
55769
- existing ? existing.push(node) : cache.set(nodeKey, [node]);
57222
+ var existing = cache2.get(nodeKey);
57223
+ existing ? existing.push(node) : cache2.set(nodeKey, [node]);
55770
57224
  }
55771
57225
  }
55772
- return cache;
57226
+ return cache2;
55773
57227
  }
55774
57228
  function mountHoistable(hoistableRoot, type, instance) {
55775
57229
  hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
@@ -60586,19 +62040,19 @@ function requireReactDomClient_development() {
60586
62040
  refCount: 0
60587
62041
  };
60588
62042
  }
60589
- function retainCache(cache) {
60590
- cache.controller.signal.aborted && console.warn(
62043
+ function retainCache(cache2) {
62044
+ cache2.controller.signal.aborted && console.warn(
60591
62045
  "A cache instance was retained after it was already freed. This likely indicates a bug in React."
60592
62046
  );
60593
- cache.refCount++;
62047
+ cache2.refCount++;
60594
62048
  }
60595
- function releaseCache(cache) {
60596
- cache.refCount--;
60597
- 0 > cache.refCount && console.warn(
62049
+ function releaseCache(cache2) {
62050
+ cache2.refCount--;
62051
+ 0 > cache2.refCount && console.warn(
60598
62052
  "A cache instance was released after it was already freed. This likely indicates a bug in React."
60599
62053
  );
60600
- 0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
60601
- cache.controller.abort();
62054
+ 0 === cache2.refCount && scheduleCallback$2(NormalPriority, function() {
62055
+ cache2.controller.abort();
60602
62056
  });
60603
62057
  }
60604
62058
  function startUpdateTimerByLane(lane, method, fiber) {
@@ -72740,24 +74194,24 @@ function requireReactDomClient_development() {
72740
74194
  }
72741
74195
  function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
72742
74196
  if (null === tagCaches) {
72743
- var cache = /* @__PURE__ */ new Map();
74197
+ var cache2 = /* @__PURE__ */ new Map();
72744
74198
  var caches = tagCaches = /* @__PURE__ */ new Map();
72745
- caches.set(ownerDocument, cache);
74199
+ caches.set(ownerDocument, cache2);
72746
74200
  } else
72747
- caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
72748
- if (cache.has(type)) return cache;
72749
- cache.set(type, null);
74201
+ caches = tagCaches, cache2 = caches.get(ownerDocument), cache2 || (cache2 = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache2));
74202
+ if (cache2.has(type)) return cache2;
74203
+ cache2.set(type, null);
72750
74204
  ownerDocument = ownerDocument.getElementsByTagName(type);
72751
74205
  for (caches = 0; caches < ownerDocument.length; caches++) {
72752
74206
  var node = ownerDocument[caches];
72753
74207
  if (!(node[internalHoistableMarker] || node[internalInstanceKey] || "link" === type && "stylesheet" === node.getAttribute("rel")) && node.namespaceURI !== SVG_NAMESPACE) {
72754
74208
  var nodeKey = node.getAttribute(keyAttribute) || "";
72755
74209
  nodeKey = type + nodeKey;
72756
- var existing = cache.get(nodeKey);
72757
- existing ? existing.push(node) : cache.set(nodeKey, [node]);
74210
+ var existing = cache2.get(nodeKey);
74211
+ existing ? existing.push(node) : cache2.set(nodeKey, [node]);
72758
74212
  }
72759
74213
  }
72760
- return cache;
74214
+ return cache2;
72761
74215
  }
72762
74216
  function mountHoistable(hoistableRoot, type, instance) {
72763
74217
  hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
@@ -76015,8 +77469,8 @@ function requireReactDomClient_development() {
76015
77469
  didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
76016
77470
  var offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null, inProgressLanes = null, inProgressRoot = null, hostParent = null, hostParentIsContainer = false, currentHoistableRoot = null, inHydratedSubtree = false, suspenseyCommitFlag = 8192, DefaultAsyncDispatcher = {
76017
77471
  getCacheForType: function(resourceType) {
76018
- var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
76019
- void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
77472
+ var cache2 = readContext(CacheContext), cacheForType = cache2.data.get(resourceType);
77473
+ void 0 === cacheForType && (cacheForType = resourceType(), cache2.data.set(resourceType, cacheForType));
76020
77474
  return cacheForType;
76021
77475
  },
76022
77476
  cacheSignal: function() {
@@ -80514,6 +81968,7 @@ function requireClassnames$1() {
80514
81968
  }
80515
81969
  var classnamesExports$1 = requireClassnames$1();
80516
81970
  const classNames$1 = /* @__PURE__ */ getDefaultExportFromCjs$1$1(classnamesExports$1);
81971
+ const untranslated = (key, _args, fallback) => fallback ?? key;
80517
81972
  const KeyboardIcon = () => /* @__PURE__ */ React__default.createElement(
80518
81973
  "svg",
80519
81974
  {
@@ -80531,9 +81986,13 @@ const KeyboardIcon = () => /* @__PURE__ */ React__default.createElement(
80531
81986
  );
80532
81987
  function KeyboardTray({
80533
81988
  onClick,
80534
- theme: theme2
81989
+ theme: theme2,
81990
+ translate
80535
81991
  }) {
80536
81992
  const [open, setOpen] = React__default.useState(false);
81993
+ const t4 = translate ?? untranslated;
81994
+ const openLabel = t4("keyboard-open", void 0, "Open Keyboard");
81995
+ const closeLabel = t4("keyboard-close", void 0, "Close Keyboard");
80537
81996
  return createPortal(
80538
81997
  /* @__PURE__ */ React__default.createElement(
80539
81998
  "div",
@@ -80557,8 +82016,8 @@ function KeyboardTray({
80557
82016
  {
80558
82017
  className: "open-keyboard-button",
80559
82018
  onClick: () => setOpen((old) => !old),
80560
- title: open ? "Close Keyboard" : "Open Keyboard",
80561
- "aria-label": open ? "Close Keyboard" : "Open Keyboard"
82019
+ title: open ? closeLabel : openLabel,
82020
+ "aria-label": open ? closeLabel : openLabel
80562
82021
  },
80563
82022
  /* @__PURE__ */ React__default.createElement(KeyboardIcon, null)
80564
82023
  ),
@@ -80567,8 +82026,8 @@ function KeyboardTray({
80567
82026
  {
80568
82027
  className: "close-keyboard-button",
80569
82028
  onClick: () => setOpen(false),
80570
- title: "Close Keyboard",
80571
- "aria-label": "Close Keyboard"
82029
+ title: closeLabel,
82030
+ "aria-label": closeLabel
80572
82031
  },
80573
82032
  "×"
80574
82033
  ), /* @__PURE__ */ React__default.createElement(ManagedKeyboard, { onClick }))
@@ -106875,36 +108334,42 @@ function getActiveRegistration() {
106875
108334
  }
106876
108335
  return null;
106877
108336
  }
106878
- function getTrayTheme() {
108337
+ function getTrayRegistration() {
106879
108338
  const activeRegistration = getActiveRegistration();
106880
108339
  if (activeRegistration) {
106881
- return activeRegistration.theme;
108340
+ return activeRegistration;
106882
108341
  }
106883
108342
  const lastActiveRegistration = getRegistrationById(
106884
108343
  virtualKeyboardState.lastActiveRegistrationId
106885
108344
  );
106886
108345
  if (lastActiveRegistration) {
106887
- return lastActiveRegistration.theme;
108346
+ return lastActiveRegistration;
106888
108347
  }
106889
108348
  const registrations = virtualKeyboardState.registrations;
106890
- return registrations[registrations.length - 1]?.theme;
108349
+ return registrations[registrations.length - 1];
106891
108350
  }
106892
108351
  function rerenderTray() {
106893
- const theme2 = getTrayTheme();
108352
+ const registration = getTrayRegistration();
108353
+ const theme2 = registration?.theme;
108354
+ const translate = registration?.translate;
106894
108355
  const trayEl = getTrayElement();
106895
108356
  if (trayEl) {
106896
108357
  const currentTheme = trayEl.getAttribute("data-theme") ?? void 0;
106897
- if (currentTheme === theme2) {
108358
+ if (currentTheme === theme2 && virtualKeyboardState.lastRenderedTranslate === translate) {
106898
108359
  return;
106899
108360
  }
106900
108361
  }
106901
- virtualKeyboardState.keyboardReactRoot?.render(renderTray(theme2));
108362
+ virtualKeyboardState.lastRenderedTranslate = translate;
108363
+ virtualKeyboardState.keyboardReactRoot?.render(
108364
+ renderTray(theme2, translate)
108365
+ );
106902
108366
  }
106903
- function renderTray(theme2) {
108367
+ function renderTray(theme2, translate) {
106904
108368
  return /* @__PURE__ */ React__default.createElement(MathJaxContext, { config: mathjaxConfig, version: 4 }, /* @__PURE__ */ React__default.createElement(
106905
108369
  KeyboardTray,
106906
108370
  {
106907
108371
  theme: theme2,
108372
+ translate,
106908
108373
  onClick: (e2) => {
106909
108374
  getActiveRegistration()?.onClick(e2);
106910
108375
  }
@@ -106914,6 +108379,7 @@ function renderTray(theme2) {
106914
108379
  function UniqueKeyboardTray({
106915
108380
  onClick,
106916
108381
  theme: theme2,
108382
+ translate,
106917
108383
  ownerRef
106918
108384
  }) {
106919
108385
  const [id2] = React__default.useState(() => {
@@ -106942,6 +108408,7 @@ function UniqueKeyboardTray({
106942
108408
  id: id2,
106943
108409
  onClick,
106944
108410
  theme: theme2,
108411
+ translate,
106945
108412
  ownerRef
106946
108413
  });
106947
108414
  rerenderTray();
@@ -106985,10 +108452,11 @@ function UniqueKeyboardTray({
106985
108452
  if (registration) {
106986
108453
  registration.onClick = onClick;
106987
108454
  registration.theme = theme2;
108455
+ registration.translate = translate;
106988
108456
  registration.ownerRef = ownerRef;
106989
108457
  rerenderTray();
106990
108458
  }
106991
- }, [onClick, ownerRef, theme2]);
108459
+ }, [onClick, ownerRef, theme2, translate]);
106992
108460
  return null;
106993
108461
  }
106994
108462
  function ExternalAwareVirtualKeyboard({
@@ -106996,6 +108464,7 @@ function ExternalAwareVirtualKeyboard({
106996
108464
  onClick = () => {
106997
108465
  },
106998
108466
  theme: theme2,
108467
+ translate,
106999
108468
  ownerRef
107000
108469
  }) {
107001
108470
  React__default.useEffect(() => {
@@ -107017,7 +108486,8 @@ function ExternalAwareVirtualKeyboard({
107017
108486
  {
107018
108487
  onClick,
107019
108488
  ownerRef,
107020
- theme: theme2
108489
+ theme: theme2,
108490
+ translate
107021
108491
  }
107022
108492
  );
107023
108493
  }
@@ -124305,12 +125775,12 @@ class CachedOrder {
124305
125775
  this.fresh = fresh;
124306
125776
  this.order = order2;
124307
125777
  }
124308
- static update(cache, changes) {
124309
- if (changes.empty && !cache.some((c2) => c2.fresh))
124310
- return cache;
124311
- let result2 = [], lastDir = cache.length ? cache[cache.length - 1].dir : Direction.LTR;
124312
- for (let i2 = Math.max(0, cache.length - 10); i2 < cache.length; i2++) {
124313
- let entry = cache[i2];
125778
+ static update(cache2, changes) {
125779
+ if (changes.empty && !cache2.some((c2) => c2.fresh))
125780
+ return cache2;
125781
+ let result2 = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
125782
+ for (let i2 = Math.max(0, cache2.length - 10); i2 < cache2.length; i2++) {
125783
+ let entry = cache2[i2];
124314
125784
  if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
124315
125785
  result2.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
124316
125786
  }
@@ -127761,10 +129231,10 @@ let TreeCursor$1 = class TreeCursor22 {
127761
129231
  get node() {
127762
129232
  if (!this.buffer)
127763
129233
  return this._tree;
127764
- let cache = this.bufferNode, result2 = null, depth = 0;
127765
- if (cache && cache.context == this.buffer) {
129234
+ let cache2 = this.bufferNode, result2 = null, depth = 0;
129235
+ if (cache2 && cache2.context == this.buffer) {
127766
129236
  scan: for (let index2 = this.index, d2 = this.stack.length; d2 >= 0; ) {
127767
- for (let c2 = cache; c2; c2 = c2._parent)
129237
+ for (let c2 = cache2; c2; c2 = c2._parent)
127768
129238
  if (c2.index == index2) {
127769
129239
  if (index2 == this.index)
127770
129240
  return c2;
@@ -134300,16 +135770,16 @@ class SelectedDiagnostic {
134300
135770
  }
134301
135771
  }
134302
135772
  class LintState {
134303
- constructor(diagnostics, panel, selected) {
134304
- this.diagnostics = diagnostics;
135773
+ constructor(diagnostics2, panel, selected) {
135774
+ this.diagnostics = diagnostics2;
134305
135775
  this.panel = panel;
134306
135776
  this.selected = selected;
134307
135777
  }
134308
- static init(diagnostics, panel, state) {
135778
+ static init(diagnostics2, panel, state) {
134309
135779
  let diagnosticFilter = state.facet(lintConfig).markerFilter;
134310
135780
  if (diagnosticFilter)
134311
- diagnostics = diagnosticFilter(diagnostics, state);
134312
- let sorted = diagnostics.slice().sort((a2, b2) => a2.from - b2.from || a2.to - b2.to);
135781
+ diagnostics2 = diagnosticFilter(diagnostics2, state);
135782
+ let sorted = diagnostics2.slice().sort((a2, b2) => a2.from - b2.from || a2.to - b2.to);
134313
135783
  let deco = new RangeSetBuilder$1(), active = [], pos = 0;
134314
135784
  let scan = state.doc.iter(), scanPos = 0, docLen = state.doc.length;
134315
135785
  for (let i2 = 0; ; ) {
@@ -134387,9 +135857,9 @@ class LintState {
134387
135857
  return new LintState(set2, panel, findDiagnostic(set2));
134388
135858
  }
134389
135859
  }
134390
- function findDiagnostic(diagnostics, diagnostic2 = null, after2 = 0) {
135860
+ function findDiagnostic(diagnostics2, diagnostic2 = null, after2 = 0) {
134391
135861
  let found = null;
134392
- diagnostics.between(after2, 1e9, (from, to2, { spec }) => {
135862
+ diagnostics2.between(after2, 1e9, (from, to2, { spec }) => {
134393
135863
  if (diagnostic2 && spec.diagnostics.indexOf(diagnostic2) < 0)
134394
135864
  return;
134395
135865
  if (!found)
@@ -134412,9 +135882,9 @@ function hideTooltip(tr2, tooltip) {
134412
135882
  function maybeEnableLint(state, effects) {
134413
135883
  return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of(lintExtensions));
134414
135884
  }
134415
- function setDiagnostics(state, diagnostics) {
135885
+ function setDiagnostics(state, diagnostics2) {
134416
135886
  return {
134417
- effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)])
135887
+ effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics2)])
134418
135888
  };
134419
135889
  }
134420
135890
  const setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define();
@@ -134454,9 +135924,9 @@ const lintState = /* @__PURE__ */ StateField.define({
134454
135924
  });
134455
135925
  const activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
134456
135926
  function lintTooltip(view, pos, side) {
134457
- let { diagnostics } = view.state.field(lintState);
135927
+ let { diagnostics: diagnostics2 } = view.state.field(lintState);
134458
135928
  let found, start = -1, end = -1;
134459
- diagnostics.between(pos - (side < 0 ? 1 : 0), pos + (side > 0 ? 1 : 0), (from, to2, { spec }) => {
135929
+ diagnostics2.between(pos - (side < 0 ? 1 : 0), pos + (side > 0 ? 1 : 0), (from, to2, { spec }) => {
134460
135930
  if (pos >= from && pos <= to2 && (from == to2 || (pos > from || side > 0) && (pos < to2 || side < 0))) {
134461
135931
  found = spec.diagnostics;
134462
135932
  start = from;
@@ -134478,8 +135948,8 @@ function lintTooltip(view, pos, side) {
134478
135948
  }
134479
135949
  };
134480
135950
  }
134481
- function diagnosticsTooltip(view, diagnostics) {
134482
- return crelt("ul", { class: "cm-tooltip-lint" }, diagnostics.map((d2) => renderDiagnostic(view, d2, false)));
135951
+ function diagnosticsTooltip(view, diagnostics2) {
135952
+ return crelt("ul", { class: "cm-tooltip-lint" }, diagnostics2.map((d2) => renderDiagnostic(view, d2, false)));
134483
135953
  }
134484
135954
  const openLintPanel = (view) => {
134485
135955
  let field = view.state.field(lintState, false);
@@ -134665,10 +136135,10 @@ class LintPanel {
134665
136135
  return -1;
134666
136136
  }
134667
136137
  update() {
134668
- let { diagnostics, selected } = this.view.state.field(lintState);
136138
+ let { diagnostics: diagnostics2, selected } = this.view.state.field(lintState);
134669
136139
  let i2 = 0, needsSync = false, newSelectedItem = null;
134670
136140
  let seen = /* @__PURE__ */ new Set();
134671
- diagnostics.between(0, this.view.state.doc.length, (_start, _end, { spec }) => {
136141
+ diagnostics2.between(0, this.view.state.doc.length, (_start, _end, { spec }) => {
134672
136142
  for (let diagnostic2 of spec.diagnostics) {
134673
136143
  if (seen.has(diagnostic2))
134674
136144
  continue;
@@ -134869,9 +136339,9 @@ const baseTheme = /* @__PURE__ */ EditorView.baseTheme({
134869
136339
  function severityWeight(sev) {
134870
136340
  return sev == "error" ? 4 : sev == "warning" ? 3 : sev == "info" ? 2 : 1;
134871
136341
  }
134872
- function maxSeverity(diagnostics) {
136342
+ function maxSeverity(diagnostics2) {
134873
136343
  let sev = "hint", weight = 1;
134874
- for (let d2 of diagnostics) {
136344
+ for (let d2 of diagnostics2) {
134875
136345
  let w2 = severityWeight(d2.severity);
134876
136346
  if (w2 > weight) {
134877
136347
  weight = w2;
@@ -135698,7 +137168,7 @@ var jsxRuntimeExports = requireJsxRuntime();
135698
137168
  var _excluded = ["className", "value", "selection", "extensions", "onChange", "onStatistics", "onCreateEditor", "onUpdate", "autoFocus", "theme", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "basicSetup", "placeholder", "indentWithTab", "editable", "readOnly", "root", "initialState"];
135699
137169
  var ReactCodeMirror = /* @__PURE__ */ forwardRef$3((props2, ref) => {
135700
137170
  var className = props2.className, _props$value = props2.value, value = _props$value === void 0 ? "" : _props$value, selection2 = props2.selection, _props$extensions = props2.extensions, extensions = _props$extensions === void 0 ? [] : _props$extensions, onChange = props2.onChange, onStatistics = props2.onStatistics, onCreateEditor = props2.onCreateEditor, onUpdate = props2.onUpdate, autoFocus = props2.autoFocus, _props$theme = props2.theme, theme2 = _props$theme === void 0 ? "light" : _props$theme, height = props2.height, minHeight = props2.minHeight, maxHeight = props2.maxHeight, width = props2.width, minWidth = props2.minWidth, maxWidth = props2.maxWidth, basicSetup3 = props2.basicSetup, placeholder2 = props2.placeholder, indentWithTab2 = props2.indentWithTab, editable2 = props2.editable, readOnly2 = props2.readOnly, root2 = props2.root, initialState2 = props2.initialState, other = _objectWithoutPropertiesLoose(props2, _excluded);
135701
- var editor = useRef(null);
137171
+ var editor2 = useRef(null);
135702
137172
  var _useCodeMirror = useCodeMirror({
135703
137173
  root: root2,
135704
137174
  value,
@@ -135724,12 +137194,12 @@ var ReactCodeMirror = /* @__PURE__ */ forwardRef$3((props2, ref) => {
135724
137194
  initialState: initialState2
135725
137195
  }), state = _useCodeMirror.state, view = _useCodeMirror.view, container = _useCodeMirror.container, setContainer = _useCodeMirror.setContainer;
135726
137196
  useImperativeHandle(ref, () => ({
135727
- editor: editor.current,
137197
+ editor: editor2.current,
135728
137198
  state,
135729
137199
  view
135730
- }), [editor, container, state, view]);
137200
+ }), [editor2, container, state, view]);
135731
137201
  var setEditorRef = useCallback((el) => {
135732
- editor.current = el;
137202
+ editor2.current = el;
135733
137203
  setContainer(el);
135734
137204
  }, [setContainer]);
135735
137205
  if (typeof value !== "string") {
@@ -137266,10 +138736,10 @@ class TreeCursor {
137266
138736
  get node() {
137267
138737
  if (!this.buffer)
137268
138738
  return this._tree;
137269
- let cache = this.bufferNode, result2 = null, depth = 0;
137270
- if (cache && cache.context == this.buffer) {
138739
+ let cache2 = this.bufferNode, result2 = null, depth = 0;
138740
+ if (cache2 && cache2.context == this.buffer) {
137271
138741
  scan: for (let index2 = this.index, d2 = this.stack.length; d2 >= 0; ) {
137272
- for (let c2 = cache; c2; c2 = c2._parent)
138742
+ for (let c2 = cache2; c2; c2 = c2._parent)
137273
138743
  if (c2.index == index2) {
137274
138744
  if (index2 == this.index)
137275
138745
  return c2;
@@ -149059,8 +150529,8 @@ var CodeActionTriggerKind$1;
149059
150529
  })(CodeActionTriggerKind$1 || (CodeActionTriggerKind$1 = {}));
149060
150530
  var CodeActionContext$1;
149061
150531
  (function(CodeActionContext2) {
149062
- function create2(diagnostics, only, triggerKind) {
149063
- let result2 = { diagnostics };
150532
+ function create2(diagnostics2, only, triggerKind) {
150533
+ let result2 = { diagnostics: diagnostics2 };
149064
150534
  if (only !== void 0 && only !== null) {
149065
150535
  result2.only = only;
149066
150536
  }
@@ -186558,7 +188028,7 @@ class LSPPlugin {
186558
188028
  if (!this.view) {
186559
188029
  return;
186560
188030
  }
186561
- const diagnostics = [];
188031
+ const diagnostics2 = [];
186562
188032
  for (const diagnostic2 of this.diagnostics) {
186563
188033
  const { range: range2, message, severity, source, markClass, code: code2 } = diagnostic2;
186564
188034
  const cmSeverity = lspSeverityToCmSeverity[severity] ?? "info";
@@ -186570,7 +188040,7 @@ class LSPPlugin {
186570
188040
  continue;
186571
188041
  }
186572
188042
  const { from, to: to2 } = offsets;
186573
- diagnostics.push({
188043
+ diagnostics2.push({
186574
188044
  from,
186575
188045
  to: to2,
186576
188046
  severity: cmSeverity,
@@ -186593,7 +188063,7 @@ class LSPPlugin {
186593
188063
  }
186594
188064
  });
186595
188065
  }
186596
- diagnostics.sort((a2, b2) => {
188066
+ diagnostics2.sort((a2, b2) => {
186597
188067
  if (a2.from < b2.from) {
186598
188068
  return -1;
186599
188069
  } else if (a2.from > b2.from) {
@@ -186604,7 +188074,7 @@ class LSPPlugin {
186604
188074
  });
186605
188075
  const diagnosticTransaction = setDiagnostics(
186606
188076
  this.view.state,
186607
- diagnostics
188077
+ diagnostics2
186608
188078
  );
186609
188079
  this.view.dispatch(diagnosticTransaction);
186610
188080
  }
@@ -187326,7 +188796,7 @@ const CodeMirror = React__default.memo(function CodeMirror2({
187326
188796
  highlightActiveLine: !readOnly2,
187327
188797
  highlightActiveLineGutter: !readOnly2
187328
188798
  },
187329
- onChange: (editor, update) => {
188799
+ onChange: (editor2, update) => {
187330
188800
  if (onChange) {
187331
188801
  onChange(update.state.doc.toString());
187332
188802
  }
@@ -193399,8 +194869,8 @@ function hasFixedPositionAncestor(element2, stopNode) {
193399
194869
  }
193400
194870
  return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
193401
194871
  }
193402
- function getClippingElementAncestors(element2, cache) {
193403
- const cachedResult = cache.get(element2);
194872
+ function getClippingElementAncestors(element2, cache2) {
194873
+ const cachedResult = cache2.get(element2);
193404
194874
  if (cachedResult) {
193405
194875
  return cachedResult;
193406
194876
  }
@@ -193422,7 +194892,7 @@ function getClippingElementAncestors(element2, cache) {
193422
194892
  }
193423
194893
  currentNode = getParentNode(currentNode);
193424
194894
  }
193425
- cache.set(element2, result2);
194895
+ cache2.set(element2, result2);
193426
194896
  return result2;
193427
194897
  }
193428
194898
  function getClippingRect(_ref) {
@@ -193719,14 +195189,14 @@ const size = size$1;
193719
195189
  const arrow = arrow$1;
193720
195190
  const limitShift = limitShift$1;
193721
195191
  const computePosition = (reference, floating, options2) => {
193722
- const cache = /* @__PURE__ */ new Map();
195192
+ const cache2 = /* @__PURE__ */ new Map();
193723
195193
  const mergedOptions = {
193724
195194
  platform,
193725
195195
  ...options2
193726
195196
  };
193727
195197
  const platformWithCache = {
193728
195198
  ...mergedOptions.platform,
193729
- _c: cache
195199
+ _c: cache2
193730
195200
  };
193731
195201
  return computePosition$1(reference, floating, {
193732
195202
  ...mergedOptions,
@@ -202220,17 +203690,17 @@ function FormattedDiagnosticMessage({ message }) {
202220
203690
  );
202221
203691
  }
202222
203692
  function DiagnosticList({
202223
- diagnostics,
203693
+ diagnostics: diagnostics2,
202224
203694
  emptyMessage,
202225
203695
  testPrefix,
202226
203696
  icon,
202227
203697
  iconClassName
202228
203698
  }) {
202229
- if (diagnostics.length === 0) {
203699
+ if (diagnostics2.length === 0) {
202230
203700
  return /* @__PURE__ */ jsxRuntimeExports$3.jsx(jsxRuntimeExports$3.Fragment, { children: emptyMessage });
202231
203701
  }
202232
203702
  const diagnosticIdentityCounts = /* @__PURE__ */ new Map();
202233
- return /* @__PURE__ */ jsxRuntimeExports$3.jsx("ul", { className: "diagnostic-list", children: diagnostics.map((diagnostic2, i2) => {
203703
+ return /* @__PURE__ */ jsxRuntimeExports$3.jsx("ul", { className: "diagnostic-list", children: diagnostics2.map((diagnostic2, i2) => {
202234
203704
  const location = diagnosticLocationLabel(diagnostic2);
202235
203705
  const identity2 = diagnosticIdentityKey(diagnostic2);
202236
203706
  const currentCount = diagnosticIdentityCounts.get(identity2) ?? 0;
@@ -207630,10 +209100,10 @@ function EditorFooter({
207630
209100
  "div",
207631
209101
  {
207632
209102
  className: "doenetml-version",
207633
- title: `DoenetML version ${"0.7.21-dev.361"}`,
209103
+ title: `DoenetML version ${"0.7.21-dev.362"}`,
207634
209104
  children: [
207635
209105
  "v",
207636
- "0.7.21-dev.361"
209106
+ "0.7.21-dev.362"
207637
209107
  ]
207638
209108
  }
207639
209109
  ),
@@ -212098,8 +213568,8 @@ var CodeActionTriggerKind;
212098
213568
  })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
212099
213569
  var CodeActionContext;
212100
213570
  (function(CodeActionContext2) {
212101
- function create2(diagnostics, only, triggerKind) {
212102
- let result2 = { diagnostics };
213571
+ function create2(diagnostics2, only, triggerKind) {
213572
+ let result2 = { diagnostics: diagnostics2 };
212103
213573
  if (only !== void 0 && only !== null) {
212104
213574
  result2.only = only;
212105
213575
  }
@@ -214373,11 +215843,11 @@ function toLspDiagnostic(diagnostic2) {
214373
215843
  };
214374
215844
  }
214375
215845
  function toAdditionalDiagnosticsForLsp({
214376
- diagnostics,
215846
+ diagnostics: diagnostics2,
214377
215847
  showInfoAnnotations,
214378
215848
  showAccessibilityAnnotations
214379
215849
  }) {
214380
- return diagnostics.filter((diagnostic2) => {
215850
+ return diagnostics2.filter((diagnostic2) => {
214381
215851
  if (!diagnostic2.position) {
214382
215852
  return false;
214383
215853
  }
@@ -214398,13 +215868,13 @@ function toAdditionalDiagnosticsForLsp({
214398
215868
  }
214399
215869
  function mergeDiagnosticsByType({
214400
215870
  initialDiagnostics,
214401
- diagnostics
215871
+ diagnostics: diagnostics2
214402
215872
  }) {
214403
215873
  const warnings = [
214404
215874
  ...initialDiagnostics.filter(
214405
215875
  (diagnostic2) => diagnostic2.type === "warning"
214406
215876
  ),
214407
- ...diagnostics.filter(
215877
+ ...diagnostics2.filter(
214408
215878
  (diagnostic2) => diagnostic2.type === "warning"
214409
215879
  )
214410
215880
  ];
@@ -214412,7 +215882,7 @@ function mergeDiagnosticsByType({
214412
215882
  ...initialDiagnostics.filter(
214413
215883
  (diagnostic2) => diagnostic2.type === "error"
214414
215884
  ),
214415
- ...diagnostics.filter(
215885
+ ...diagnostics2.filter(
214416
215886
  (diagnostic2) => diagnostic2.type === "error"
214417
215887
  )
214418
215888
  ];
@@ -214420,13 +215890,13 @@ function mergeDiagnosticsByType({
214420
215890
  ...initialDiagnostics.filter(
214421
215891
  (diagnostic2) => diagnostic2.type === "info"
214422
215892
  ),
214423
- ...diagnostics.filter(
215893
+ ...diagnostics2.filter(
214424
215894
  (diagnostic2) => diagnostic2.type === "info"
214425
215895
  )
214426
215896
  ];
214427
215897
  const accessibility = [
214428
215898
  ...initialDiagnostics.filter(isAccessibilityRecord),
214429
- ...diagnostics.filter(isAccessibilityRecord)
215899
+ ...diagnostics2.filter(isAccessibilityRecord)
214430
215900
  ];
214431
215901
  return {
214432
215902
  warnings,
@@ -215575,7 +217045,7 @@ const EditorViewer = React__default.forwardRef(function EditorViewer2({
215575
217045
  const [infoPanelIsOpen, setInfoPanelIsOpen] = useState(
215576
217046
  resolvedInitialOpenTab !== null
215577
217047
  );
215578
- const [diagnostics, setDiagnostics2] = useState([]);
217048
+ const [diagnostics2, setDiagnostics2] = useState([]);
215579
217049
  const [diagnosticsSource, setDiagnosticsSource] = useState(initialDoenetML);
215580
217050
  const [receivedDiagnosticsFromViewer, setReceivedDiagnosticsFromViewer] = useState(false);
215581
217051
  const [showInfoAnnotations, setShowInfoAnnotations] = useState(false);
@@ -215677,7 +217147,7 @@ const EditorViewer = React__default.forwardRef(function EditorViewer2({
215677
217147
  }
215678
217148
  useEffect(() => {
215679
217149
  const additionalDiagnostics = toAdditionalDiagnosticsForLsp({
215680
- diagnostics: [...initialDiagnostics, ...diagnostics],
217150
+ diagnostics: [...initialDiagnostics, ...diagnostics2],
215681
217151
  showInfoAnnotations,
215682
217152
  showAccessibilityAnnotations
215683
217153
  });
@@ -215687,7 +217157,7 @@ const EditorViewer = React__default.forwardRef(function EditorViewer2({
215687
217157
  );
215688
217158
  }, [
215689
217159
  initialDiagnostics,
215690
- diagnostics,
217160
+ diagnostics2,
215691
217161
  showInfoAnnotations,
215692
217162
  showAccessibilityAnnotations
215693
217163
  ]);
@@ -215704,9 +217174,9 @@ const EditorViewer = React__default.forwardRef(function EditorViewer2({
215704
217174
  } = useMemo(
215705
217175
  () => mergeDiagnosticsByType({
215706
217176
  initialDiagnostics,
215707
- diagnostics
217177
+ diagnostics: diagnostics2
215708
217178
  }),
215709
- [initialDiagnostics, diagnostics]
217179
+ [initialDiagnostics, diagnostics2]
215710
217180
  );
215711
217181
  const diagnosticsSummaryCallbackRef = useRef(diagnosticsSummaryCallback);
215712
217182
  diagnosticsSummaryCallbackRef.current = diagnosticsSummaryCallback;
@@ -215732,7 +217202,7 @@ const EditorViewer = React__default.forwardRef(function EditorViewer2({
215732
217202
  },
215733
217203
  diagnosticsSource
215734
217204
  );
215735
- }, [diagnostics, receivedDiagnosticsFromViewer, diagnosticsSource]);
217205
+ }, [diagnostics2, receivedDiagnosticsFromViewer, diagnosticsSource]);
215736
217206
  const [responses, setResponses] = useState([]);
215737
217207
  useEffect(() => setResponses([]), [initialDoenetML]);
215738
217208
  useEffect(() => {
@@ -216322,6 +217792,11 @@ function DoenetViewer({
216322
217792
  const lastPropSet = useRef([]);
216323
217793
  const variantIndex = useRef(1);
216324
217794
  const resolvedTheme = useResolvedTheme(darkMode);
217795
+ const translateChrome = useHostChromeTranslator(
217796
+ uiLocale,
217797
+ documentLocale,
217798
+ localeResources
217799
+ );
216325
217800
  const ref = useRef(null);
216326
217801
  const isOnPage = useIsOnPage(ref);
216327
217802
  const [hidden, setHidden] = useState(true);
@@ -216337,11 +217812,11 @@ function DoenetViewer({
216337
217812
  );
216338
217813
  }
216339
217814
  }, []);
216340
- const effectiveDiagnosticsCallback = setErrorsAndWarningsCallback ? (diagnostics, source) => {
216341
- setDiagnosticsCallback?.(diagnostics, source);
217815
+ const effectiveDiagnosticsCallback = setErrorsAndWarningsCallback ? (diagnostics2, source) => {
217816
+ setDiagnosticsCallback?.(diagnostics2, source);
216342
217817
  setErrorsAndWarningsCallback({
216343
- errors: diagnostics.filter(isErrorRecord),
216344
- warnings: diagnostics.filter(isWarningRecord)
217818
+ errors: diagnostics2.filter(isErrorRecord),
217819
+ warnings: diagnostics2.filter(isWarningRecord)
216345
217820
  });
216346
217821
  } : setDiagnosticsCallback;
216347
217822
  const flags = { ...defaultFlags, ...specifiedFlags };
@@ -216444,18 +217919,19 @@ function DoenetViewer({
216444
217919
  onInit(r2);
216445
217920
  }
216446
217921
  },
216447
- children: /* @__PURE__ */ jsxRuntimeExports$3.jsxs(
217922
+ children: /* @__PURE__ */ jsxRuntimeExports$3.jsx(I18nProvider, { translate: translateChrome, children: /* @__PURE__ */ jsxRuntimeExports$3.jsxs(
216448
217923
  WrapWithKeyboard,
216449
217924
  {
216450
217925
  addVirtualKeyboard,
216451
217926
  externalVirtualKeyboardProvided,
216452
217927
  theme: resolvedTheme,
217928
+ translate: translateChrome,
216453
217929
  children: [
216454
217930
  variantSelector,
216455
217931
  viewer
216456
217932
  ]
216457
217933
  }
216458
- )
217934
+ ) })
216459
217935
  }
216460
217936
  )
216461
217937
  }
@@ -216503,6 +217979,11 @@ const DoenetEditor = React__default.forwardRef(function DoenetEditor2({
216503
217979
  useExistingMathjax = false
216504
217980
  }, ref) {
216505
217981
  const resolvedTheme = useResolvedTheme(darkMode);
217982
+ const translateChrome = useHostChromeTranslator(
217983
+ uiLocale,
217984
+ documentLocale,
217985
+ localeResources
217986
+ );
216506
217987
  const normalizedShowDiagnostics = showDiagnostics ?? showErrorsWarnings ?? true;
216507
217988
  if (showDiagnostics === void 0 && showErrorsWarnings !== void 0 && !warnedShowErrorsWarningsDeprecation) {
216508
217989
  warnedShowErrorsWarningsDeprecation = true;
@@ -216524,7 +218005,7 @@ const DoenetEditor = React__default.forwardRef(function DoenetEditor2({
216524
218005
  ],
216525
218006
  [initialDiagnostics, initialErrors, initialWarnings]
216526
218007
  );
216527
- const editor = /* @__PURE__ */ jsxRuntimeExports$3.jsx(
218008
+ const editor2 = /* @__PURE__ */ jsxRuntimeExports$3.jsx(
216528
218009
  EditorViewer,
216529
218010
  {
216530
218011
  ref,
@@ -216569,15 +218050,16 @@ const DoenetEditor = React__default.forwardRef(function DoenetEditor2({
216569
218050
  version: 4,
216570
218051
  src: mathjaxUrl,
216571
218052
  useExistingMathJax: useExistingMathjax,
216572
- children: /* @__PURE__ */ jsxRuntimeExports$3.jsx("div", { "data-theme": resolvedTheme, style: { display: "contents" }, children: /* @__PURE__ */ jsxRuntimeExports$3.jsx(
218053
+ children: /* @__PURE__ */ jsxRuntimeExports$3.jsx("div", { "data-theme": resolvedTheme, style: { display: "contents" }, children: /* @__PURE__ */ jsxRuntimeExports$3.jsx(I18nProvider, { translate: translateChrome, children: /* @__PURE__ */ jsxRuntimeExports$3.jsx(
216573
218054
  WrapWithKeyboard,
216574
218055
  {
216575
218056
  addVirtualKeyboard,
216576
218057
  externalVirtualKeyboardProvided,
216577
218058
  theme: resolvedTheme,
216578
- children: editor
218059
+ translate: translateChrome,
218060
+ children: editor2
216579
218061
  }
216580
- ) })
218062
+ ) }) })
216581
218063
  }
216582
218064
  ) });
216583
218065
  });
@@ -216585,6 +218067,7 @@ function WrapWithKeyboard({
216585
218067
  addVirtualKeyboard,
216586
218068
  externalVirtualKeyboardProvided,
216587
218069
  theme: theme2,
218070
+ translate,
216588
218071
  children
216589
218072
  }) {
216590
218073
  const dispatch = useAppDispatch();
@@ -216595,6 +218078,7 @@ function WrapWithKeyboard({
216595
218078
  externalVirtualKeyboardProvided,
216596
218079
  ownerRef: focusedMathInput,
216597
218080
  theme: theme2,
218081
+ translate,
216598
218082
  onClick: (keyCommands) => {
216599
218083
  dispatch(keyboardSlice.actions.setKeyboardInput(keyCommands));
216600
218084
  }
@@ -216607,63 +218091,64 @@ function WrapWithKeyboard({
216607
218091
  ] });
216608
218092
  }
216609
218093
  export {
216610
- PopoverDisclosure as $,
216611
- renderersLoadComponent as A,
218094
+ usePopoverStore as $,
218095
+ mainSlice as A,
216612
218096
  Button2 as B,
216613
218097
  CodeMirror as C,
216614
218098
  DoenetEditor as D,
216615
- encodeFillPatternColorToken as E,
216616
- deepCompare as F,
216617
- ActionButtonGroup as G,
216618
- ActionButton as H,
216619
- ToggleButtonGroup as I,
216620
- EditorViewer as J,
216621
- memo as K,
216622
- forwardRef as L,
218099
+ renderersLoadComponent as E,
218100
+ encodeFillPatternColorToken as F,
218101
+ deepCompare as G,
218102
+ ActionButtonGroup as H,
218103
+ ActionButton as I,
218104
+ ToggleButtonGroup as J,
218105
+ EditorViewer as K,
218106
+ memo as L,
216623
218107
  MathJax as M,
216624
- createElement as N,
216625
- createHook as O,
216626
- usePopoverContext as P,
216627
- invariant as Q,
216628
- useStoreState as R,
216629
- getBasePlacement as S,
218108
+ forwardRef as N,
218109
+ createElement as O,
218110
+ createHook as P,
218111
+ usePopoverContext as Q,
218112
+ invariant as R,
218113
+ useStoreState as S,
216630
218114
  ToggleButton as T,
216631
- useId as U,
216632
- useMergeRefs as V,
216633
- removeUndefinedValues as W,
216634
- useSafeLayoutEffect as X,
216635
- getWindow$1 as Y,
216636
- usePopoverStore as Z,
218115
+ getBasePlacement as U,
218116
+ useId as V,
218117
+ useMergeRefs as W,
218118
+ removeUndefinedValues as X,
218119
+ useSafeLayoutEffect as Y,
218120
+ getWindow$1 as Z,
216637
218121
  __variableDynamicImportRuntimeHelper as _,
216638
218122
  DoenetViewer as a,
216639
- MdInfoOutline as a0,
216640
- Popover as a1,
216641
- keyboardSlice as a2,
216642
- FocusedMathInputContext as a3,
216643
- DEFAULT_MATH_INPUT_FUNCTION_NAMES as a4,
216644
- PopoverAnchor as a5,
216645
- createStoreContext as a6,
216646
- HovercardScopedContextProvider as a7,
216647
- HovercardContextProvider as a8,
216648
- createDialogComponent as a9,
216649
- useWrapElement as aa,
216650
- useHovercard as ab,
216651
- isFalsyBooleanCallback as ac,
216652
- contains as ad,
216653
- sync as ae,
216654
- chain as af,
216655
- useEvent as ag,
216656
- useHovercardAnchor as ah,
216657
- createStore as ai,
216658
- createHovercardStore as aj,
216659
- defaultValue as ak,
216660
- useStore as al,
216661
- useStoreProps as am,
216662
- useHovercardStoreProps as an,
216663
- getDefaultExportFromCjs$5 as ao,
216664
- roundForDisplay as ap,
216665
- autoUpdate as aq,
216666
- CANVAS_DARK_MODE_COLOR as ar,
218123
+ PopoverDisclosure as a0,
218124
+ MdInfoOutline as a1,
218125
+ Popover as a2,
218126
+ keyboardSlice as a3,
218127
+ FocusedMathInputContext as a4,
218128
+ DEFAULT_MATH_INPUT_FUNCTION_NAMES as a5,
218129
+ PopoverAnchor as a6,
218130
+ createStoreContext as a7,
218131
+ HovercardScopedContextProvider as a8,
218132
+ HovercardContextProvider as a9,
218133
+ createDialogComponent as aa,
218134
+ useWrapElement as ab,
218135
+ useHovercard as ac,
218136
+ isFalsyBooleanCallback as ad,
218137
+ contains as ae,
218138
+ sync as af,
218139
+ chain as ag,
218140
+ useEvent as ah,
218141
+ useHovercardAnchor as ai,
218142
+ createStore as aj,
218143
+ createHovercardStore as ak,
218144
+ defaultValue as al,
218145
+ useStore as am,
218146
+ useStoreProps as an,
218147
+ useHovercardStoreProps as ao,
218148
+ getDefaultExportFromCjs$5 as ap,
218149
+ roundForDisplay as aq,
218150
+ autoUpdate as ar,
218151
+ CANVAS_DARK_MODE_COLOR as as,
216667
218152
  creativeCommonsVersions as b,
216668
218153
  cidFromText as c,
216669
218154
  defaultCreativeCommonsVersion$2 as d,
@@ -216679,14 +218164,14 @@ export {
216679
218164
  jsxRuntimeExports$3 as n,
216680
218165
  DocContext as o,
216681
218166
  DynamicMath as p,
216682
- Context$2 as q,
218167
+ useRecordVisibilityChanges as q,
216683
218168
  retrieveTextFileForCid as r,
216684
218169
  serializedComponentsReplacer as s,
216685
218170
  textRendererStyle as t,
216686
- useRecordVisibilityChanges as u,
216687
- cesc as v,
216688
- createFunctionFromDefinition as w,
216689
- Button as x,
216690
- useAppSelector as y,
216691
- mainSlice as z
218171
+ useT as u,
218172
+ Context$2 as v,
218173
+ cesc as w,
218174
+ createFunctionFromDefinition as x,
218175
+ Button as y,
218176
+ useAppSelector as z
216692
218177
  };