@doenet/v06-to-v07 0.7.21-dev.363 → 0.7.21-dev.364

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.
@@ -42591,7 +42591,7 @@ async function cidFromArrayBuffer(data) {
42591
42591
  await crypto.subtle.digest("SHA-256", new Uint8Array());
42592
42592
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
42593
42593
  } catch (e22) {
42594
- const sha256 = (await import("./sha256-1m3pbIuR-CNO6DkjL-lZLUD3lN.js").then((n2) => n2.s)).default;
42594
+ const sha256 = (await import("./sha256-1m3pbIuR-CcR_uzOg-DFbzNMx_.js").then((n2) => n2.s)).default;
42595
42595
  digest = (data2) => sha256(data2, {
42596
42596
  asBytes: true
42597
42597
  });
@@ -46357,7 +46357,7 @@ class Indent {
46357
46357
  }
46358
46358
  const chrome$1 = "# 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";
46359
46359
  const content = '# 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# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`color.blue`, `noun.line-segment`).\n\n\n## Style vocabulary\n##\n## The words the style pipeline derives from a component\'s numeric and\n## enumerated style values. A word an author writes directly — `lineColorWord`,\n## `markerStyleWord`, and their siblings — passes through untranslated: the\n## author chose those words, and rewriting them would be a surprise. So does a\n## CSS named color asked for by name ("rebeccapurple"), which\n## `resolveColorWord` deliberately preserves.\n##\n## Every adjective here is handed `$gender`, the grammatical gender of the noun\n## it describes (see `noun-gender`). English has no agreement and ignores it; a\n## language that inflects selects on it.\n\n# The canonical color families a color value resolves to.\ncolor =\n .black = black\n .white = white\n .gray = gray\n .red = red\n .orange = orange\n .yellow = yellow\n .green = green\n .cyan = cyan\n .blue = blue\n .purple = purple\n .pink = pink\n .brown = brown\n\n# Stroke widths. Only the extremes are named — a middling width is described by\n# its color alone.\nline-width =\n .thick = thick\n .thin = thin\n\n# Dash patterns. A solid stroke is described by its color alone.\nline-style =\n .dashed = dashed\n .dotted = dotted\n\n# Patterns a shape\'s interior can be filled with. A solid fill is described by\n# its color alone.\nfill-style =\n .horizontal = horizontal lines\n .vertical = vertical lines\n .diagonal = diagonal lines\n .backdiagonal = reverse diagonal lines\n .dots = dots\n .diamonds = diamonds\n\n# The things being described. The shapes a point can be drawn as ("square",\n# "cross") are nouns too: a point\'s description names its marker shape rather\n# than always saying "point".\nnoun =\n .line = line\n .line-segment = line segment\n .ray = ray\n .vector = vector\n .curve = curve\n .function = function\n .parabola = parabola\n .polyline = polyline\n .polygon = polygon\n .triangle = triangle\n .rectangle = rectangle\n .circle = circle\n .region = region\n .point = point\n .square = square\n .diamond = diamond\n .cross = cross\n .plus = plus\n\n# A regular polygon names its side count, so it is a message of its own rather\n# than one of `noun`\'s attributes.\n#\n# `$part` splits the noun where a language needs it split: `head` is the word\n# the adjectives attach to, `tail` a complement that follows them. English\n# folds the side count into the head and has no tail; Spanish says "polígono\n# regular" and puts "de 5 lados" after the adjectives, so that they stay beside\n# the noun they agree with. `style-with-noun` and `style-filled-with-noun`\n# place the two halves.\n#\n# `$numSides` is a real number, so it is formatted by the locale\'s own rules —\n# a 1000-gon reads "1,000-sided" here and "de 1000 lados" in Spanish. That is\n# the number-formatting policy in the README, and the one place a description\n# is not character-for-character what the pre-catalog code produced.\nnoun-regular-polygon =\n { $part ->\n [tail] { "" }\n *[head] { $numSides }-sided regular polygon\n }\n\n# The grammatical gender of the noun being described, passed to every adjective\n# describing it so that translations can agree. English has no grammatical\n# gender, so every noun answers the same and the answer goes unused.\n#\n# `$noun` is one of `noun`\'s attribute names, `regular-polygon` for the shape\n# `noun-regular-polygon` names, or the head of a phrase the description builds\n# without naming it as a noun: `border`, `fill`, `text`, or `background`. A\n# word this message does not list falls to its default gender — which is also\n# what an author\'s own `markerStyleWord` gets, since the catalog has never seen\n# it.\nnoun-gender = neuter\n\n\n## Style composition\n##\n## `$parts` names which pieces the style actually supplies, so that a\n## translation can order and inflect each combination on its own terms instead\n## of substituting into a fixed English frame. An absent piece is a different\n## branch, never an empty placeable.\n\n# The adjectives describing a stroke: its width, its dash pattern, and its\n# color. Also describes a shape\'s border, where the color is dropped when it\n# matches the fill it surrounds.\nstyle-stroke =\n { $parts ->\n [width-style-color] { $width } { $lineStyle } { $color }\n [width-color] { $width } { $color }\n [style-color] { $lineStyle } { $color }\n [width-style] { $width } { $lineStyle }\n [width] { $width }\n [style] { $lineStyle }\n *[color] { $color }\n }\n\n# A style description followed by what it describes: "thick red line".\n#\n# `$nounTail` is the noun\'s trailing complement, for the nouns whose\n# translation splits around the adjectives (see `noun-regular-polygon`).\n# English has none today, so it only ever selects `noun` for itself — the other\n# variant is still what a partly-translated locale falls back to, and dropping\n# it would drop that locale\'s side count.\nstyle-with-noun =\n { $parts ->\n [noun-tail] { $description } { $noun } { $nounTail }\n *[noun] { $description } { $noun }\n }\n\n# The word marking a shape as filled.\n#\n# A key of its own, looked up by the code and handed to the messages below as\n# `$filled`, rather than literal text inside them: a language that inflects it\n# has to agree it with the shape. Referencing it from those messages would not\n# do — a term reference (`{ -filled }`) gets an empty scope and never sees\n# `$gender`, and a message reference resolves only inside its own bundle, so a\n# locale that translated `style-filled` but not this word would render the\n# reference literally instead of falling back to English.\nstyle-filled-word = filled\n\n# A filled shape, and the pattern its interior is drawn with, if any.\nstyle-filled =\n { $parts ->\n [pattern] { $filled } { $color } with { $pattern }\n *[plain] { $filled } { $color }\n }\n\n# The same, naming the shape: "filled blue circle with diamonds".\n#\n# The `-tail` variants carry the noun\'s trailing complement, as\n# `style-with-noun` does.\nstyle-filled-with-noun =\n { $parts ->\n [pattern] { $filled } { $color } { $noun } with { $pattern }\n [plain-tail] { $filled } { $color } { $noun } { $nounTail }\n [pattern-tail] { $filled } { $color } { $noun } { $nounTail } with { $pattern }\n *[plain] { $filled } { $color } { $noun }\n }\n\n# The border clause appended to a filled shape: "with a thick red border".\n#\n# `$parts` carries two distinctions English cares about: whether a fill pattern\n# was already mentioned, which makes this a further clause ("and") rather than\n# the first ("with"), and whether the surrounding description named the shape,\n# which is where English wants an article.\nstyle-border-clause =\n { $parts ->\n [with-article] with a { $border } border\n [and] and { $border } border\n [and-article] and a { $border } border\n *[with] with { $border } border\n }\n\n# How a shape\'s interior is filled, on its own: "blue diamonds".\nstyle-fill =\n { $parts ->\n [pattern] { $color } { $pattern }\n *[plain] { $color }\n }\n\nstyle-unfilled = unfilled\n\n# How a piece of text is styled: its color, and the background behind it.\nstyle-text =\n { $parts ->\n [background] { $color } with a { $background } background\n *[plain] { $color }\n }\n\n# What `backgroundColor` answers when nothing is drawn behind the text.\nstyle-background-none = none\n';
46360
- 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";
46360
+ 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# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`invalid-attribute-value`).\n#\n# Reached by stable diagnostic code rather than by a literal `t("key")` call:\n# `DIAGNOSTIC_CODES` in `src/diagnostics.ts` maps `doenet-w0001` to the id\n# below, and `lint:i18n` treats that registry as the call site. Adding a\n# message here without registering a code for it fails the lint as an orphan.\n#\n# Translators: `through`, `endpoint`, `midpointOffset`, `numDimensions` and the\n# like are DoenetML attribute names. They are part of the language, not prose,\n# and must be left in English exactly as written.\n\n## `<lineSegment>`\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nline-segment-attributes-ignored-with-endpoints =\n { $attributesCount ->\n [one] { $attributes } is ignored when two endpoints are specified\n *[other] { $attributes } are ignored when two endpoints are specified\n }\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nline-segment-attributes-ignored-with-endpoint-and-midpoint =\n { $attributesCount ->\n [one] { $attributes } is ignored when an endpoint and a midpoint are both specified\n *[other] { $attributes } are ignored when an endpoint and a midpoint are both specified\n }\n\nline-segment-midpoint-offset-without-midpoint = midpointOffset has no effect without a midpoint\n\n## `<line>`\n\nline-points-undetermined-dimensions = Line through points of undetermined dimensions.\n\nline-points-too-few-dimensions = Line must be through points of at least two dimensions.\n\n# $variables is a bare enumeration of variable names, not an "and" list.\nline-points-depend-on-variables = Line is through points that depend on variables: { $variables }.\n\nline-equation-invalid-format = Invalid format for equation of line in variables { $variable1 } and { $variable2 }.\n\n## `<ray>`\n\nray-overprescribed-through = Ray is prescribed by through, endpoint, and direction. Ignoring specified through.\n\nray-dimension-mismatch = numDimensions mismatch in ray.\n\n## `<vector>`\n\nvector-overprescribed-head = Vector is prescribed by head, tail, and displacement. Ignoring specified head.\n\nvector-dimension-mismatch = numDimensions mismatch in vector.\n';
46361
46361
  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";
46362
46362
  const CATALOG_NAMESPACES = [
46363
46363
  "chrome",
@@ -46365,10 +46365,7 @@ const CATALOG_NAMESPACES = [
46365
46365
  "diagnostics",
46366
46366
  "editor"
46367
46367
  ];
46368
- const WORKER_NAMESPACES = [
46369
- "content",
46370
- "diagnostics"
46371
- ];
46368
+ const WORKER_NAMESPACES = ["content"];
46372
46369
  const CHROME_NAMESPACES = [
46373
46370
  "chrome",
46374
46371
  "diagnostics"
@@ -46397,13 +46394,23 @@ function lookupPattern(bundle, key) {
46397
46394
  }
46398
46395
  return message.attributes[attribute] ?? null;
46399
46396
  }
46400
- function createBundle(locale, source, useIsolating, onError) {
46401
- const bundle = new FluentBundle(locale, { useIsolating });
46397
+ function intlFormattingLocale(locale) {
46398
+ try {
46399
+ Intl.getCanonicalLocales(locale);
46400
+ return locale;
46401
+ } catch {
46402
+ return DEFAULT_LOCALE;
46403
+ }
46404
+ }
46405
+ function createChainLink(locale, source, useIsolating, onError) {
46406
+ const bundle = new FluentBundle(intlFormattingLocale(locale), {
46407
+ useIsolating
46408
+ });
46402
46409
  const errors = bundle.addResource(new FluentResource(source));
46403
46410
  for (const error of errors) {
46404
46411
  onError?.(error, "", locale);
46405
46412
  }
46406
- return bundle;
46413
+ return { locale, bundle };
46407
46414
  }
46408
46415
  function createTranslator(locales, resources, options = {}) {
46409
46416
  const {
@@ -46415,12 +46422,14 @@ function createTranslator(locales, resources, options = {}) {
46415
46422
  for (const locale of locales) {
46416
46423
  const source = resources[locale];
46417
46424
  if (source !== void 0) {
46418
- bundles.push(createBundle(locale, source, useIsolating, onError));
46425
+ bundles.push(
46426
+ createChainLink(locale, source, useIsolating, onError)
46427
+ );
46419
46428
  }
46420
46429
  }
46421
46430
  if (includeBuiltinEnglish) {
46422
46431
  bundles.push(
46423
- createBundle(
46432
+ createChainLink(
46424
46433
  DEFAULT_LOCALE,
46425
46434
  EN_CATALOG_SOURCE,
46426
46435
  useIsolating,
@@ -46428,8 +46437,8 @@ function createTranslator(locales, resources, options = {}) {
46428
46437
  )
46429
46438
  );
46430
46439
  }
46431
- return function translate(key, args, fallback) {
46432
- for (const bundle of bundles) {
46440
+ const translate = (key, args, fallback) => {
46441
+ for (const { locale, bundle } of bundles) {
46433
46442
  const pattern = lookupPattern(bundle, key);
46434
46443
  if (pattern === null) {
46435
46444
  continue;
@@ -46437,12 +46446,14 @@ function createTranslator(locales, resources, options = {}) {
46437
46446
  const errors = [];
46438
46447
  const formatted = bundle.formatPattern(pattern, args, errors);
46439
46448
  for (const error of errors) {
46440
- onError?.(error, key, bundle.locales[0]);
46449
+ onError?.(error, key, locale);
46441
46450
  }
46442
46451
  return formatted;
46443
46452
  }
46444
46453
  return fallback ?? key;
46445
46454
  };
46455
+ translate.localeOf = (key) => bundles.find(({ bundle }) => lookupPattern(bundle, key) !== null)?.locale;
46456
+ return translate;
46446
46457
  }
46447
46458
  const languageCodeRe = "([a-z]{2,3}|\\*)";
46448
46459
  const scriptCodeRe = "(?:-([a-z]{4}|\\*))";
@@ -46706,8 +46717,13 @@ function normalizeLocaleTag(tag2) {
46706
46717
  }
46707
46718
  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";
46708
46719
  const esContent = "# Spanish content catalog: the prose the core computes into the document.\n# Selected by `documentLocale` — the language the activity was written in.\n#\n# Spanish inflects. Adjectives follow their noun and agree with it in gender,\n# so every adjective below selects on `$gender`, the gender of the noun it\n# describes, and the composition messages put the noun first. Neither is\n# expressible by substituting into the English word order, which is why the\n# catalog controls the order and not the code.\n\n\n## Vocabulario de estilos\n\ncolor =\n .black =\n { $gender ->\n [f] negra\n *[m] negro\n }\n .white =\n { $gender ->\n [f] blanca\n *[m] blanco\n }\n .gray = gris\n .red =\n { $gender ->\n [f] roja\n *[m] rojo\n }\n .orange = naranja\n .yellow =\n { $gender ->\n [f] amarilla\n *[m] amarillo\n }\n .green = verde\n .cyan = cian\n .blue = azul\n .purple =\n { $gender ->\n [f] morada\n *[m] morado\n }\n .pink = rosa\n .brown = marrón\n\nline-width =\n .thick =\n { $gender ->\n [f] gruesa\n *[m] grueso\n }\n .thin =\n { $gender ->\n [f] delgada\n *[m] delgado\n }\n\nline-style =\n .dashed =\n { $gender ->\n [f] discontinua\n *[m] discontinuo\n }\n .dotted =\n { $gender ->\n [f] punteada\n *[m] punteado\n }\n\n# Sintagmas nominales: van detrás de «con» y no concuerdan con nada.\nfill-style =\n .horizontal = líneas horizontales\n .vertical = líneas verticales\n .diagonal = líneas diagonales\n .backdiagonal = líneas diagonales inversas\n .dots = puntos\n .diamonds = rombos\n\nnoun =\n .line = línea\n .line-segment = segmento\n .ray = semirrecta\n .vector = vector\n .curve = curva\n .function = función\n .parabola = parábola\n .polyline = polilínea\n .polygon = polígono\n .triangle = triángulo\n .rectangle = rectángulo\n .circle = círculo\n .region = región\n .point = punto\n .square = cuadrado\n .diamond = rombo\n .cross = cruz\n .plus = signo más\n\n# El nombre se parte: «polígono regular» lleva los adjetivos y «de 5 lados»\n# cierra el sintagma detrás de ellos. Si el complemento fuera delante, los\n# adjetivos quedarían separados del nombre con el que concuerdan («polígono\n# regular de 5 lados grueso rojo»).\nnoun-regular-polygon =\n { $part ->\n [tail] de { $numSides } lados\n *[head] polígono regular\n }\n\n# Además de los nombres de arriba, `$noun` puede ser «regular-polygon» (el\n# nombre que compone `noun-regular-polygon`) o el núcleo de un sintagma que no\n# se nombra en la descripción: «border», «fill», «text» y «background». Todos\n# ellos son masculinos en español —polígono, borde, relleno, texto, fondo—, así\n# que caen en el caso por defecto.\nnoun-gender =\n { $noun ->\n [line] f\n [ray] f\n [curve] f\n [function] f\n [parabola] f\n [polyline] f\n [region] f\n [cross] f\n *[other] m\n }\n\n\n## Composición de estilos\n\nstyle-stroke =\n { $parts ->\n [width-style-color] { $lineStyle } { $width } { $color }\n [width-color] { $width } { $color }\n [style-color] { $lineStyle } { $color }\n [width-style] { $lineStyle } { $width }\n [width] { $width }\n [style] { $lineStyle }\n *[color] { $color }\n }\n\n# El nombre va delante y los adjetivos detrás: «línea discontinua gruesa roja».\n# El complemento del nombre, si lo hay, cierra el sintagma: «polígono regular\n# grueso rojo de 5 lados».\nstyle-with-noun =\n { $parts ->\n [noun-tail] { $noun } { $description } { $nounTail }\n *[noun] { $noun } { $description }\n }\n\nstyle-filled-word =\n { $gender ->\n [f] rellena\n *[m] relleno\n }\n\nstyle-filled =\n { $parts ->\n [pattern] { $color } { $filled } con { $pattern }\n *[plain] { $color } { $filled }\n }\n\n# Aquí el complemento va pegado al nombre, y no al final como en\n# `style-with-noun`: «relleno de …» se lee como «lleno de …», así que «relleno\n# de 5 lados» diría otra cosa. «Polígono regular de 5 lados azul relleno».\nstyle-filled-with-noun =\n { $parts ->\n [pattern] { $noun } { $color } { $filled } con { $pattern }\n [plain-tail] { $noun } { $nounTail } { $color } { $filled }\n [pattern-tail] { $noun } { $nounTail } { $color } { $filled } con { $pattern }\n *[plain] { $noun } { $color } { $filled }\n }\n\n# «borde» es masculino, así que los adjetivos del borde concuerdan con él y no\n# con la figura que rodea.\nstyle-border-clause =\n { $parts ->\n [with-article] con un borde { $border }\n [and] y borde { $border }\n [and-article] y un borde { $border }\n *[with] con borde { $border }\n }\n\n# «de color» evita tener que concordar el color con un patrón en plural.\nstyle-fill =\n { $parts ->\n [pattern] { $pattern } de color { $color }\n *[plain] { $color }\n }\n\nstyle-unfilled = sin relleno\n\nstyle-text =\n { $parts ->\n [background] { $color } con un fondo { $background }\n *[plain] { $color }\n }\n\nstyle-background-none = ninguno\n";
46720
+ const esDiagnostics = "# Advertencias y errores mostrados a quien lee o escribe el documento.\n# Seleccionados por `uiLocale`.\n#\n# Los nombres de atributos y componentes de DoenetML (`through`, `endpoint`,\n# `numDimensions`, …) forman parte del lenguaje y se dejan en inglés.\n\n## `<lineSegment>`\n\nline-segment-attributes-ignored-with-endpoints =\n { $attributesCount ->\n [one] { $attributes } se ignora cuando se especifican los dos extremos\n *[other] { $attributes } se ignoran cuando se especifican los dos extremos\n }\n\nline-segment-attributes-ignored-with-endpoint-and-midpoint =\n { $attributesCount ->\n [one] { $attributes } se ignora cuando se especifican un extremo y el punto medio\n *[other] { $attributes } se ignoran cuando se especifican un extremo y el punto medio\n }\n\nline-segment-midpoint-offset-without-midpoint = midpointOffset no tiene efecto sin un punto medio\n\n## `<line>`\n\n# «Recta», no «línea», aunque `noun.line` en content.ftl diga «línea»: no es\n# una incoherencia, sino la diferencia entre describir el trazo dibujado («una\n# línea azul gruesa») y hablar del objeto geométrico, que en matemáticas es\n# una recta —de ahí «la ecuación de la recta».\n\nline-points-undetermined-dimensions = La recta pasa por puntos de dimensiones indeterminadas.\n\nline-points-too-few-dimensions = La recta debe pasar por puntos de al menos dos dimensiones.\n\nline-points-depend-on-variables = La recta pasa por puntos que dependen de las variables: { $variables }.\n\n# Enumeradas con coma en vez de «y»: las variables de <line> son `x` e `y` por\n# omisión, y «en las variables x y y» sería a la vez incorrecto (ante el sonido\n# /i/ la conjunción es «e») e ilegible. La coma es correcta sea cual sea el\n# nombre de la variable, que aquí no se conoce de antemano.\nline-equation-invalid-format = Formato no válido para la ecuación de la recta en las variables { $variable1 }, { $variable2 }.\n\n## `<ray>`\n\nray-overprescribed-through = La semirrecta está determinada por through, endpoint y direction. Se ignora el through especificado.\n\nray-dimension-mismatch = Discrepancia de numDimensions en la semirrecta.\n\n## `<vector>`\n\nvector-overprescribed-head = El vector está determinado por head, tail y displacement. Se ignora el head especificado.\n\nvector-dimension-mismatch = Discrepancia de numDimensions en el vector.\n";
46709
46721
  const BUNDLED_TRANSLATIONS = {
46710
- es: { chrome: esChrome, content: esContent }
46722
+ es: {
46723
+ chrome: esChrome,
46724
+ content: esContent,
46725
+ diagnostics: esDiagnostics
46726
+ }
46711
46727
  };
46712
46728
  function bundledResources(namespaces, { includeEnglish = false } = {}) {
46713
46729
  const resources = {};
@@ -46743,6 +46759,75 @@ function createTranslatorFromLocaleData(localeData, locale = localeData.locale)
46743
46759
  const chain2 = negotiateLocales([locale], Object.keys(resources));
46744
46760
  return createTranslator(chain2, resources);
46745
46761
  }
46762
+ const DIAGNOSTIC_CODES = {
46763
+ "doenet-i0001": "line-segment-attributes-ignored-with-endpoints",
46764
+ "doenet-i0002": "line-segment-midpoint-offset-without-midpoint",
46765
+ "doenet-i0003": "line-segment-attributes-ignored-with-endpoint-and-midpoint",
46766
+ "doenet-w0001": "line-points-undetermined-dimensions",
46767
+ "doenet-w0002": "line-points-too-few-dimensions",
46768
+ "doenet-w0003": "line-points-depend-on-variables",
46769
+ "doenet-w0004": "line-equation-invalid-format",
46770
+ "doenet-w0005": "ray-overprescribed-through",
46771
+ "doenet-w0006": "ray-dimension-mismatch",
46772
+ "doenet-w0007": "vector-overprescribed-head",
46773
+ "doenet-w0008": "vector-dimension-mismatch"
46774
+ };
46775
+ function isDiagnosticCode(code) {
46776
+ return Object.prototype.hasOwnProperty.call(DIAGNOSTIC_CODES, code);
46777
+ }
46778
+ function asListArg(value) {
46779
+ if (Array.isArray(value)) {
46780
+ return { list: value };
46781
+ }
46782
+ if (typeof value === "object" && value !== null && "list" in value) {
46783
+ const candidate = value;
46784
+ return Array.isArray(candidate.list) ? candidate : void 0;
46785
+ }
46786
+ return void 0;
46787
+ }
46788
+ const LIST_TYPES = ["conjunction", "disjunction", "unit"];
46789
+ function listFormatFor(locale, type) {
46790
+ const options = {
46791
+ style: "long",
46792
+ type: LIST_TYPES.includes(type) ? type : "conjunction"
46793
+ };
46794
+ try {
46795
+ return new Intl.ListFormat(locale, options);
46796
+ } catch {
46797
+ return new Intl.ListFormat(DEFAULT_LOCALE, options);
46798
+ }
46799
+ }
46800
+ function lowerArgs(args, locale) {
46801
+ if (args === void 0 || args === null) {
46802
+ return void 0;
46803
+ }
46804
+ const lowered = {};
46805
+ for (const [name2, value] of Object.entries(args)) {
46806
+ if (typeof value === "string" || typeof value === "number") {
46807
+ lowered[name2] = value;
46808
+ continue;
46809
+ }
46810
+ const listArg = asListArg(value);
46811
+ if (listArg === void 0) {
46812
+ lowered[name2] = String(value);
46813
+ continue;
46814
+ }
46815
+ lowered[name2] = listFormatFor(locale, listArg.type).format(
46816
+ listArg.list.map((item) => String(item))
46817
+ );
46818
+ lowered[`${name2}Count`] = listArg.list.length;
46819
+ }
46820
+ return lowered;
46821
+ }
46822
+ let enTranslator;
46823
+ function formatEnglishDiagnostic(code, args) {
46824
+ if (!isDiagnosticCode(code)) {
46825
+ return String(code);
46826
+ }
46827
+ const key = DIAGNOSTIC_CODES[code];
46828
+ enTranslator ??= createTranslator([], {});
46829
+ return enTranslator(key, lowerArgs(args, DEFAULT_LOCALE), code);
46830
+ }
46746
46831
  function getVariantsForDescendantsForUniqueVariants({
46747
46832
  variantIndex,
46748
46833
  serializedComponent,
@@ -101128,6 +101213,24 @@ function returnLineFamilyLabelPositionAttribute() {
101128
101213
  description: "Where the label sits along this line/curve."
101129
101214
  };
101130
101215
  }
101216
+ function codedDiagnostic({
101217
+ type,
101218
+ code,
101219
+ args,
101220
+ position: position2,
101221
+ sourceDoc,
101222
+ level
101223
+ }) {
101224
+ return {
101225
+ type,
101226
+ message: formatEnglishDiagnostic(code, args),
101227
+ code,
101228
+ ...args === void 0 ? {} : { args },
101229
+ ...position2 === void 0 ? {} : { position: position2 },
101230
+ ...sourceDoc === void 0 ? {} : { sourceDoc },
101231
+ ...level === void 0 ? {} : { level }
101232
+ };
101233
+ }
101131
101234
  class Line extends GraphicalComponent {
101132
101235
  constructor(args) {
101133
101236
  super(args);
@@ -102166,10 +102269,10 @@ class Line extends GraphicalComponent {
102166
102269
  }
102167
102270
  let numDimens = dependencyValues.numDimensions;
102168
102271
  if (Number.isNaN(numDimens)) {
102169
- let warning = {
102170
- message: "Line through points of undetermined dimensions.",
102171
- type: "warning"
102172
- };
102272
+ let warning = codedDiagnostic({
102273
+ type: "warning",
102274
+ code: "doenet-w0001"
102275
+ });
102173
102276
  return {
102174
102277
  setValue: {
102175
102278
  equation: blankMath2,
@@ -102181,10 +102284,10 @@ class Line extends GraphicalComponent {
102181
102284
  };
102182
102285
  }
102183
102286
  if (numDimens < 2) {
102184
- let warning = {
102185
- message: "Line must be through points of at least two dimensions.",
102186
- type: "warning"
102187
- };
102287
+ let warning = codedDiagnostic({
102288
+ type: "warning",
102289
+ code: "doenet-w0002"
102290
+ });
102188
102291
  return {
102189
102292
  setValue: {
102190
102293
  equation: blankMath2,
@@ -102202,10 +102305,19 @@ class Line extends GraphicalComponent {
102202
102305
  let varStrings = [...variables2.map((x2) => x2.toString())];
102203
102306
  for (let i2 = 0; i2 < numDimens; i2++) {
102204
102307
  if (point1x.variables().indexOf(varStrings[i2]) !== -1 || point1y.variables().indexOf(varStrings[i2]) !== -1 || point2x.variables().indexOf(varStrings[i2]) !== -1 || point2y.variables().indexOf(varStrings[i2]) !== -1) {
102205
- let warning = {
102206
- message: "Line is through points that depend on variables: " + varStrings.join(", ") + ".",
102207
- type: "warning"
102208
- };
102308
+ let warning = codedDiagnostic({
102309
+ type: "warning",
102310
+ code: "doenet-w0003",
102311
+ // A bare enumeration, not an "and" list: the
102312
+ // message names which variables were seen, it
102313
+ // doesn't conjoin them.
102314
+ args: {
102315
+ variables: {
102316
+ list: varStrings,
102317
+ type: "unit"
102318
+ }
102319
+ }
102320
+ });
102209
102321
  return {
102210
102322
  setValue: {
102211
102323
  equation: blankMath2,
@@ -102868,6 +102980,13 @@ class Line extends GraphicalComponent {
102868
102980
  }
102869
102981
  }
102870
102982
  }
102983
+ function invalidEquationFormatDiagnostic(var1String, var2String) {
102984
+ return codedDiagnostic({
102985
+ type: "warning",
102986
+ code: "doenet-w0004",
102987
+ args: { variable1: var1String, variable2: var2String }
102988
+ });
102989
+ }
102871
102990
  function calculateCoeffsFromEquation({ equation, variables: variables2 }) {
102872
102991
  let var1 = variables2[0];
102873
102992
  let var2 = variables2[1];
@@ -102913,11 +103032,12 @@ function calculateCoeffsFromEquation({ equation, variables: variables2 }) {
102913
103032
  } else if (typeof term === "number") {
102914
103033
  c0 = term;
102915
103034
  } else if (!Array.isArray(term)) {
102916
- let warning = {
102917
- message: "Invalid format for equation of line in variables " + var1 + " and " + var2 + ".",
102918
- type: "warning"
103035
+ return {
103036
+ success: false,
103037
+ sendDiagnostics: [
103038
+ invalidEquationFormatDiagnostic(var1String, var2String)
103039
+ ]
102919
103040
  };
102920
- return { success: false, sendDiagnostics: [warning] };
102921
103041
  } else {
102922
103042
  let operator = term[0];
102923
103043
  let operands = term.slice(1);
@@ -102930,11 +103050,12 @@ function calculateCoeffsFromEquation({ equation, variables: variables2 }) {
102930
103050
  cv2 = ["-", coeffs.coeffvar2.tree];
102931
103051
  c0 = ["-", coeffs.coeff0.tree];
102932
103052
  } else if (operator === "+") {
102933
- let warning = {
102934
- message: "Invalid format for equation of line in variables " + var1 + " and " + var2 + ".",
102935
- type: "warning"
103053
+ return {
103054
+ success: false,
103055
+ sendDiagnostics: [
103056
+ invalidEquationFormatDiagnostic(var1String, var2String)
103057
+ ]
102936
103058
  };
102937
- return { success: false, sendDiagnostics: [warning] };
102938
103059
  } else if (operator === "*") {
102939
103060
  let var1ind = -1, var2ind = -1;
102940
103061
  for (let i2 = 0; i2 < operands.length; i2++) {
@@ -103003,19 +103124,21 @@ function calculatePointsFromCoeffs({
103003
103124
  let var1String = var1.toString();
103004
103125
  let var2String = var2.toString();
103005
103126
  if (coeffvar1.variables(true).indexOf(var1String) !== -1 || coeffvar1.variables(true).indexOf(var2String) !== -1 || coeffvar2.variables(true).indexOf(var1String) !== -1 || coeffvar2.variables(true).indexOf(var2String) !== -1 || coeff0.variables(true).indexOf(var1String) !== -1 || coeff0.variables(true).indexOf(var2String) !== -1) {
103006
- let warning = {
103007
- message: "Invalid format for equation of line in variables " + var1String + " and " + var2String + ".",
103008
- type: "warning"
103127
+ return {
103128
+ success: false,
103129
+ sendDiagnostics: [
103130
+ invalidEquationFormatDiagnostic(var1String, var2String)
103131
+ ]
103009
103132
  };
103010
- return { success: false, sendDiagnostics: [warning] };
103011
103133
  }
103012
103134
  let zero = Context.fromAst(0);
103013
103135
  if (coeffvar1.equals(zero) && coeffvar2.equals(zero)) {
103014
- let warning = {
103015
- message: "Invalid format for equation of line in variables " + var1String + " and " + var2String + ".",
103016
- type: "warning"
103136
+ return {
103137
+ success: false,
103138
+ sendDiagnostics: [
103139
+ invalidEquationFormatDiagnostic(var1String, var2String)
103140
+ ]
103017
103141
  };
103018
- return { success: false, sendDiagnostics: [warning] };
103019
103142
  }
103020
103143
  let a2 = coeffvar1.evaluate_to_constant();
103021
103144
  let b2 = coeffvar2.evaluate_to_constant();
@@ -123186,15 +123309,6 @@ class Coords extends MathComponent {
123186
123309
  // }
123187
123310
  // }
123188
123311
  }
123189
- function buildIgnoredPhrase(ignored) {
123190
- if (ignored.length === 1) {
123191
- return `${ignored[0]} is`;
123192
- } else if (ignored.length === 2) {
123193
- return `${ignored[0]} and ${ignored[1]} are`;
123194
- } else {
123195
- return `${ignored.slice(0, -1).join(", ")}, and ${ignored.slice(-1)} are`;
123196
- }
123197
- }
123198
123312
  function directionFromSlope(slope) {
123199
123313
  if (slope === Infinity || slope === -Infinity) {
123200
123314
  return [0, Math.sign(slope)];
@@ -123570,17 +123684,18 @@ class LineSegment extends GraphicalComponent {
123570
123684
  ignored.push("midpointOffset");
123571
123685
  }
123572
123686
  result2.sendDiagnostics = [
123573
- {
123687
+ codedDiagnostic({
123574
123688
  type: "info",
123575
- message: `${buildIgnoredPhrase(ignored)} ignored when two endpoints are specified`
123576
- }
123689
+ code: "doenet-i0001",
123690
+ args: { attributes: ignored }
123691
+ })
123577
123692
  ];
123578
123693
  } else if (!basedOnSlopeOrMidpoint && !usedDefault.midpointOffset) {
123579
123694
  result2.sendDiagnostics = [
123580
- {
123695
+ codedDiagnostic({
123581
123696
  type: "info",
123582
- message: "midpointOffset has no effect without a midpoint"
123583
- }
123697
+ code: "doenet-i0002"
123698
+ })
123584
123699
  ];
123585
123700
  }
123586
123701
  return result2;
@@ -123906,16 +124021,21 @@ class LineSegment extends GraphicalComponent {
123906
124021
  if (g2.lengthAttr !== null) {
123907
124022
  ignored.push("length");
123908
124023
  }
123909
- sendDiagnostics.push({
123910
- type: "info",
123911
- message: `${buildIgnoredPhrase(ignored)} ignored when an endpoint and a midpoint are both specified`
123912
- });
124024
+ sendDiagnostics.push(
124025
+ codedDiagnostic({
124026
+ type: "info",
124027
+ code: "doenet-i0003",
124028
+ args: { attributes: ignored }
124029
+ })
124030
+ );
123913
124031
  }
123914
124032
  } else if (!g2.midpointSpecified && !gUsedDefault.midpointOffset) {
123915
- sendDiagnostics.push({
123916
- type: "info",
123917
- message: "midpointOffset has no effect without a midpoint"
123918
- });
124033
+ sendDiagnostics.push(
124034
+ codedDiagnostic({
124035
+ type: "info",
124036
+ code: "doenet-i0002"
124037
+ })
124038
+ );
123919
124039
  }
123920
124040
  let unconstrainedEndpoints = {};
123921
124041
  if (g2.numEndpointsSpecified === 1 && g2.midpointSpecified) {
@@ -125409,14 +125529,13 @@ class Ray extends GraphicalComponent {
125409
125529
  if (dependencyValues.endpointAttr !== null && dependencyValues.directionAttr !== null) {
125410
125530
  let diagnostics2 = [];
125411
125531
  if (dependencyValues.throughAttr !== null) {
125412
- const warning = {
125413
- type: "warning",
125414
- message: "Ray is prescribed by through, endpoint, and direction. Ignoring specified through."
125415
- };
125416
- if (dependencyValues.throughAttr.position) {
125417
- warning.position = dependencyValues.throughAttr.position;
125418
- }
125419
- diagnostics2.push(warning);
125532
+ diagnostics2.push(
125533
+ codedDiagnostic({
125534
+ type: "warning",
125535
+ code: "doenet-w0005",
125536
+ position: dependencyValues.throughAttr.position ?? void 0
125537
+ })
125538
+ );
125420
125539
  }
125421
125540
  return {
125422
125541
  setValue: { basedOnThrough: false },
@@ -125773,10 +125892,10 @@ class Ray extends GraphicalComponent {
125773
125892
  if (dependencyValues.basedOnDirection) {
125774
125893
  if (dependencyValues.basedOnEndpoint) {
125775
125894
  if (dependencyValues.numDimDirection !== dependencyValues.numDimEndpoint) {
125776
- let warning = {
125777
- message: "numDimensions mismatch in ray.",
125778
- type: "warning"
125779
- };
125895
+ let warning = codedDiagnostic({
125896
+ type: "warning",
125897
+ code: "doenet-w0006"
125898
+ });
125780
125899
  return {
125781
125900
  setValue: { numDimensions: NaN },
125782
125901
  sendDiagnostics: [warning]
@@ -125784,10 +125903,10 @@ class Ray extends GraphicalComponent {
125784
125903
  }
125785
125904
  } else if (dependencyValues.basedOnThrough) {
125786
125905
  if (dependencyValues.numDimDirection !== dependencyValues.numDimThrough) {
125787
- let warning = {
125788
- message: "numDimensions mismatch in ray.",
125789
- type: "warning"
125790
- };
125906
+ let warning = codedDiagnostic({
125907
+ type: "warning",
125908
+ code: "doenet-w0006"
125909
+ });
125791
125910
  return {
125792
125911
  setValue: { numDimensions: NaN },
125793
125912
  sendDiagnostics: [warning]
@@ -125798,10 +125917,10 @@ class Ray extends GraphicalComponent {
125798
125917
  } else if (dependencyValues.basedOnEndpoint) {
125799
125918
  if (dependencyValues.basedOnThrough) {
125800
125919
  if (dependencyValues.numDimEndpoint !== dependencyValues.numDimThrough) {
125801
- let warning = {
125802
- message: "numDimensions mismatch in ray.",
125803
- type: "warning"
125804
- };
125920
+ let warning = codedDiagnostic({
125921
+ type: "warning",
125922
+ code: "doenet-w0006"
125923
+ });
125805
125924
  return {
125806
125925
  setValue: { numDimensions: NaN },
125807
125926
  sendDiagnostics: [warning]
@@ -137463,14 +137582,13 @@ class Vector extends GraphicalComponent {
137463
137582
  if (dependencyValues.tailAttr !== null && dependencyValues.sourceOfDisplacement !== null) {
137464
137583
  let diagnostics2 = [];
137465
137584
  if (dependencyValues.headAttr !== null) {
137466
- const warning = {
137467
- type: "warning",
137468
- message: "Vector is prescribed by head, tail, and displacement. Ignoring specified head."
137469
- };
137470
- if (dependencyValues.headAttr.position) {
137471
- warning.position = dependencyValues.headAttr.position;
137472
- }
137473
- diagnostics2.push(warning);
137585
+ diagnostics2.push(
137586
+ codedDiagnostic({
137587
+ type: "warning",
137588
+ code: "doenet-w0007",
137589
+ position: dependencyValues.headAttr.position ?? void 0
137590
+ })
137591
+ );
137474
137592
  }
137475
137593
  return {
137476
137594
  setValue: { basedOnHead: false },
@@ -137875,10 +137993,10 @@ class Vector extends GraphicalComponent {
137875
137993
  if (dependencyValues.basedOnDisplacement) {
137876
137994
  if (dependencyValues.basedOnTail) {
137877
137995
  if (dependencyValues.numDimDisplacement !== dependencyValues.numDimTail) {
137878
- let warning = {
137879
- message: "numDimensions mismatch in vector.",
137880
- type: "warning"
137881
- };
137996
+ let warning = codedDiagnostic({
137997
+ type: "warning",
137998
+ code: "doenet-w0008"
137999
+ });
137882
138000
  return {
137883
138001
  setValue: { numDimensions: NaN },
137884
138002
  sendDiagnostics: [warning]
@@ -137886,10 +138004,10 @@ class Vector extends GraphicalComponent {
137886
138004
  }
137887
138005
  } else if (dependencyValues.basedOnHead) {
137888
138006
  if (dependencyValues.numDimDisplacement !== dependencyValues.numDimHead) {
137889
- let warning = {
137890
- message: "numDimensions mismatch in vector.",
137891
- type: "warning"
137892
- };
138007
+ let warning = codedDiagnostic({
138008
+ type: "warning",
138009
+ code: "doenet-w0008"
138010
+ });
137893
138011
  return {
137894
138012
  setValue: { numDimensions: NaN },
137895
138013
  sendDiagnostics: [warning]
@@ -137900,10 +138018,10 @@ class Vector extends GraphicalComponent {
137900
138018
  } else if (dependencyValues.basedOnTail) {
137901
138019
  if (dependencyValues.basedOnHead) {
137902
138020
  if (dependencyValues.numDimTail !== dependencyValues.numDimHead) {
137903
- let warning = {
137904
- message: "numDimensions mismatch in vector.",
137905
- type: "warning"
137906
- };
138021
+ let warning = codedDiagnostic({
138022
+ type: "warning",
138023
+ code: "doenet-w0008"
138024
+ });
137907
138025
  return {
137908
138026
  setValue: { numDimensions: NaN },
137909
138027
  sendDiagnostics: [warning]
@@ -232731,4 +232849,4 @@ export {
232731
232849
  getDefaultExportFromCjs as g,
232732
232850
  updateSyntaxFromV06toV07 as u
232733
232851
  };
232734
- //# sourceMappingURL=index-bLuGdCHE.js.map
232852
+ //# sourceMappingURL=index-NJbOIT2j.js.map