@linxin666/dsh-client-ui-task-board 0.4.6 → 0.4.8

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 (73) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +15 -6
  3. package/README.zh.md +15 -6
  4. package/lib/client.js +1634 -822
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +1072 -125
  7. package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
  8. package/lib/types/client/PluginSettingsCard.d.ts +39 -0
  9. package/lib/types/client/TaskBoardSettingsCard.d.ts +56 -0
  10. package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
  11. package/lib/types/client/board/model-options.d.ts +67 -0
  12. package/lib/types/client/board/preset-label.d.ts +21 -0
  13. package/lib/types/client/board/preset-roster.d.ts +45 -0
  14. package/lib/types/client/board/team-run-promotion.d.ts +26 -0
  15. package/lib/types/client/locales.d.ts +18 -0
  16. package/lib/types/client/telemetry.d.ts +14 -2
  17. package/lib/types/core/card-defaults.d.ts +78 -0
  18. package/lib/types/core/controller.d.ts +32 -7
  19. package/lib/types/core/execution-summary.d.ts +52 -0
  20. package/lib/types/core/extension.d.ts +34 -0
  21. package/lib/types/core/launch-width.d.ts +31 -0
  22. package/lib/types/core/reasoning-effort.d.ts +57 -0
  23. package/lib/types/core/spend-budget.d.ts +28 -0
  24. package/lib/types/core/subtask.d.ts +30 -8
  25. package/lib/types/core/tasks.d.ts +51 -1
  26. package/lib/types/core/use-cases/task-create.d.ts +10 -5
  27. package/lib/types/core/use-cases/task-update.d.ts +1 -1
  28. package/lib/types/host/launch-admission.d.ts +72 -0
  29. package/lib/types/host-ledger.d.ts +33 -6
  30. package/lib/types/host-runner.d.ts +83 -5
  31. package/lib/types/host-service.d.ts +116 -2
  32. package/lib/types/host-spend.d.ts +52 -0
  33. package/lib/types/index.d.ts +98 -0
  34. package/lib/types/loopback.d.ts +20 -1
  35. package/lib/types/protocol.d.ts +13 -0
  36. package/package.json +28 -28
  37. package/src/client/CardDefaultPresetField.tsx +101 -0
  38. package/src/client/PluginSettingsCard.tsx +63 -3
  39. package/src/client/TaskBoardSettingsCard.tsx +251 -16
  40. package/src/client/board/LinkSubtaskModal.tsx +8 -0
  41. package/src/client/board/NewTaskModal.tsx +86 -40
  42. package/src/client/board/ReasoningEffortField.tsx +50 -0
  43. package/src/client/board/TaskDetail.tsx +42 -6
  44. package/src/client/board/model-options.ts +178 -0
  45. package/src/client/board/preset-label.ts +32 -0
  46. package/src/client/board/preset-roster.ts +58 -0
  47. package/src/client/board/team-run-promotion.ts +39 -0
  48. package/src/client/index.ts +98 -94
  49. package/src/client/locales.ts +38 -2
  50. package/src/client/settings-card.module.css +70 -1
  51. package/src/client/settings-entry-form.ts +0 -1
  52. package/src/client/telemetry.ts +47 -2
  53. package/src/core/card-defaults.ts +132 -0
  54. package/src/core/controller.ts +44 -9
  55. package/src/core/execution-summary.ts +96 -0
  56. package/src/core/extension.ts +34 -0
  57. package/src/core/launch-width.ts +38 -0
  58. package/src/core/reasoning-effort.ts +92 -0
  59. package/src/core/spend-budget.ts +35 -0
  60. package/src/core/store.ts +9 -0
  61. package/src/core/subtask.ts +48 -13
  62. package/src/core/tasks.ts +63 -1
  63. package/src/core/use-cases/task-create.ts +27 -16
  64. package/src/core/use-cases/task-update.ts +6 -1
  65. package/src/host/agent-tools.ts +21 -8
  66. package/src/host/launch-admission.ts +140 -0
  67. package/src/host-ledger.ts +80 -10
  68. package/src/host-runner.ts +199 -25
  69. package/src/host-service.ts +340 -27
  70. package/src/host-spend.ts +105 -0
  71. package/src/index.ts +182 -2
  72. package/src/loopback.ts +25 -1
  73. package/src/protocol.ts +28 -4
package/lib/client.js CHANGED
@@ -6,6 +6,7 @@ window.__ModuleLoader__.load({
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
+ let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
9
10
  //#region src/core/extension.ts
10
11
  /** Cordis service name the host and browser halves each publish. */
11
12
  const TASK_BOARD_SERVICE_NAME = "taskBoard";
@@ -80,6 +81,12 @@ window.__ModuleLoader__.load({
80
81
  }
81
82
  //#endregion
82
83
  //#region src/core/tasks.ts
84
+ /**
85
+ * Upper bound of one recorded summary, in characters. The ledger stores a
86
+ * conclusion, not a transcript: a reader that needs the whole message follows
87
+ * {@link ExecutionSummary.seq} into the session history.
88
+ */
89
+ const EXECUTION_SUMMARY_LIMIT = 4e3;
83
90
  /** Every stop reason this build understands; the repair and wire gates share it. */
84
91
  const SCHEDULE_STOP_REASONS = [
85
92
  "fired",
@@ -294,6 +301,7 @@ window.__ModuleLoader__.load({
294
301
  mode: normalizeTargetId(input.mode),
295
302
  permission: isTaskPermission(input.permission) ? input.permission : void 0,
296
303
  model: normalizeTargetId(input.model),
304
+ reasoningEffort: normalizeTargetId(input.reasoningEffort),
297
305
  reuseSession: input.reuseSession === true ? true : void 0,
298
306
  teamRun: input.teamRun === true ? true : void 0,
299
307
  goalRun: input.goalRun === true ? true : void 0,
@@ -508,6 +516,26 @@ window.__ModuleLoader__.load({
508
516
  return { ok: true };
509
517
  }
510
518
  /**
519
+ * Whether a cascade member takes part in a new run.
520
+ *
521
+ * The task the user ran is always a member: the request names that card, and
522
+ * the operator asked for it to run whatever its column says. A descendant does
523
+ * not join once it sits in the `done` column — its work is finished, so running
524
+ * the parent again is a run of the parent, never a second execution of work
525
+ * that is already done. The rule keys on the column alone, so it covers both a
526
+ * subtask that ran and one an operator moved to done by hand, and it holds for
527
+ * every trigger: a manual run, a re-run, and a due occurrence of a schedule.
528
+ * A card whose own schedule is enabled settles back into `todo`, so a scheduled
529
+ * subtask stays a participant; to make a finished one run again, move it back
530
+ * to `todo` or run it on its own.
531
+ * @param task - the candidate member.
532
+ * @param rootId - the task the run request named.
533
+ * @returns false when this member is left alone by the run.
534
+ */
535
+ function joinsCascadeRun(task, rootId) {
536
+ return task.id === rootId || task.status !== "done";
537
+ }
538
+ /**
511
539
  * The permission a task would actually run under: its handover bundle's pin
512
540
  * wins over the plain pin field, exactly as the runner resolves it.
513
541
  */
@@ -875,6 +903,57 @@ window.__ModuleLoader__.load({
875
903
  return /^\d+$/.test(value);
876
904
  }
877
905
  //#endregion
906
+ //#region src/core/card-defaults.ts
907
+ /** Trim one optional target: blank text means "not set", like every stored pin. */
908
+ function textOf(value) {
909
+ return value?.trim() ?? "";
910
+ }
911
+ /**
912
+ * Resolve the execution targets a new card starts from.
913
+ * @param defaults - the board's configured new-card defaults, if any.
914
+ * @param source - the card this one is created from (a duplicate or a parent), if any.
915
+ * @param picked - what the caller chose explicitly; a non-blank value wins.
916
+ * @returns the four targets, blank where nothing supplies a value.
917
+ */
918
+ function resolveCardTargets(defaults, source, picked) {
919
+ const defaultMode = textOf(defaults?.mode);
920
+ const defaultPermission = textOf(defaults?.permission);
921
+ const defaultModel = textOf(defaults?.model);
922
+ const defaultEffort = defaultModel === "" ? "" : textOf(defaults?.reasoningEffort);
923
+ const chosen = {
924
+ mode: textOf(picked?.mode),
925
+ permission: textOf(picked?.permission),
926
+ model: textOf(picked?.model),
927
+ reasoningEffort: textOf(picked?.reasoningEffort)
928
+ };
929
+ const copied = source === void 0 ? void 0 : {
930
+ mode: textOf(source.task.mode),
931
+ permission: textOf(source.task.permission),
932
+ model: textOf(source.task.model),
933
+ reasoningEffort: textOf(source.task.reasoningEffort)
934
+ };
935
+ /** The value carried over from the source card, or the board default. */
936
+ const inherited = (key) => {
937
+ const fallback = key === "mode" ? defaultMode : key === "model" ? defaultModel : defaultPermission;
938
+ if (copied === void 0 || key === "permission" && source?.kind === "parent") return fallback;
939
+ return copied[key] === "" ? fallback : copied[key];
940
+ };
941
+ const mode = chosen.mode === "" ? inherited("mode") : chosen.mode;
942
+ const permission = chosen.permission === "" ? inherited("permission") : chosen.permission;
943
+ const model = chosen.model === "" ? inherited("model") : chosen.model;
944
+ let reasoningEffort = chosen.reasoningEffort;
945
+ if (reasoningEffort === "" && chosen.model === "") {
946
+ const sourced = copied === void 0 ? "" : copied.reasoningEffort;
947
+ reasoningEffort = sourced !== "" ? sourced : model !== "" && model === defaultModel ? defaultEffort : "";
948
+ }
949
+ return {
950
+ mode,
951
+ permission,
952
+ model,
953
+ reasoningEffort
954
+ };
955
+ }
956
+ //#endregion
878
957
  //#region src/core/use-cases/task-create.ts
879
958
  /**
880
959
  * Create-task use case: mint a new task from user input, rejecting a blank
@@ -887,18 +966,22 @@ window.__ModuleLoader__.load({
887
966
  * appended ledger, or the unchanged ledger when the title is blank or the
888
967
  * requested parent link is refused.
889
968
  *
890
- * A subtask inherits the execution targets its parent already pins (workspace,
891
- * agent preset, permission, model) unless the form supplied its own; the
892
- * parent human permission confirmation travels with an inherited permission,
893
- * so a subtask of an already-confirmed elevated card is runnable at once.
969
+ * The execution targets resolve through {@link resolveCardTargets}: what the
970
+ * caller sent wins, then the parent's own pins, then - only when the caller
971
+ * opted in with `applyCardDefaults` - the deployment's configured new-card
972
+ * defaults. Without the flag the resolution sees no defaults at all, which is
973
+ * exactly the inline parent inheritance this path has always applied. The
974
+ * workspace is not part of that resolution: a subtask still takes the parent's
975
+ * workspace, and the defaults never name one.
894
976
  * @param tasks - current ledger.
895
977
  * @param input - raw user input (title/description/prompt + optional schedule/parent).
896
978
  * @param now - clock instant (ms epoch).
897
979
  * @param id - minted task id.
898
980
  * @param maxSubtaskDepth - deployment subtask depth limit.
899
981
  * @param hostTimeZone - zone a rule that stores no zone of its own follows.
982
+ * @param cardDefaults - the deployment's new-card defaults, read live at creation.
900
983
  */
901
- function applyCreateTask(tasks, input, now, id, maxSubtaskDepth = 1, hostTimeZone = resolveHostTimeZone()) {
984
+ function applyCreateTask(tasks, input, now, id, maxSubtaskDepth = 1, hostTimeZone = resolveHostTimeZone(), cardDefaults) {
902
985
  if (input.title.trim() === "") return {
903
986
  task: void 0,
904
987
  tasks,
@@ -924,11 +1007,22 @@ window.__ModuleLoader__.load({
924
1007
  error: `subtask depth limit (${limit}) exceeded`
925
1008
  };
926
1009
  }
927
- let task = createTask(parent === void 0 ? input : {
1010
+ const seed = resolveCardTargets(input.applyCardDefaults === true ? cardDefaults : void 0, parent === void 0 ? void 0 : {
1011
+ kind: "parent",
1012
+ task: parent
1013
+ }, {
1014
+ mode: input.mode,
1015
+ permission: input.permission,
1016
+ model: input.model,
1017
+ reasoningEffort: input.reasoningEffort
1018
+ });
1019
+ let task = createTask({
928
1020
  ...input,
929
- workspaceId: input.workspaceId ?? parent.workspaceId,
930
- mode: input.mode ?? parent.mode,
931
- model: input.model ?? parent.model
1021
+ workspaceId: input.workspaceId ?? parent?.workspaceId,
1022
+ mode: seed.mode,
1023
+ permission: isTaskPermission(seed.permission) ? seed.permission : void 0,
1024
+ model: seed.model,
1025
+ reasoningEffort: seed.reasoningEffort
932
1026
  }, now, id);
933
1027
  const requested = input.schedule;
934
1028
  if (requested?.enabled === true) {
@@ -1378,6 +1472,7 @@ window.__ModuleLoader__.load({
1378
1472
  const mode = "mode" in patch ? normalizeTargetId(patch.mode) : void 0;
1379
1473
  const permission = "permission" in patch ? normalizePermission(task.permission, patch.permission) : void 0;
1380
1474
  const model = "model" in patch ? normalizeTargetId(patch.model) : void 0;
1475
+ const reasoningEffort = "reasoningEffort" in patch ? normalizeTargetId(patch.reasoningEffort) : void 0;
1381
1476
  const next = {
1382
1477
  ...task,
1383
1478
  ...rest,
@@ -1403,6 +1498,7 @@ window.__ModuleLoader__.load({
1403
1498
  if (mode !== void 0 || "mode" in patch) next.mode = mode;
1404
1499
  if (permission !== void 0 || "permission" in patch) next.permission = permission;
1405
1500
  if (model !== void 0 || "model" in patch) next.model = model;
1501
+ if (reasoningEffort !== void 0 || "reasoningEffort" in patch) next.reasoningEffort = reasoningEffort;
1406
1502
  return next;
1407
1503
  });
1408
1504
  }
@@ -1544,6 +1640,21 @@ window.__ModuleLoader__.load({
1544
1640
  return await this.initializeRemote();
1545
1641
  }
1546
1642
  /**
1643
+ * Re-read the authoritative Host snapshot.
1644
+ *
1645
+ * The board's volatile deployment configuration — the new-card defaults among
1646
+ * it — is republished the moment the settings document is written, but the SSE
1647
+ * frame that republish emits carries the value as of BEFORE the write (the
1648
+ * loader hands the update to the fiber while the new document is not yet
1649
+ * visible to it), so a mirror that followed frames alone would stay one edit
1650
+ * behind and the create dialog would prefill from the previous defaults for
1651
+ * the rest of the session. The surface that owns the write asks for the
1652
+ * snapshot again instead of trusting the frame.
1653
+ */
1654
+ refreshHostState() {
1655
+ this.refreshRemote();
1656
+ }
1657
+ /**
1547
1658
  * Show the board. The layout owns which panel the center column renders, so
1548
1659
  * the state flip and the panel selection travel together here; a composition
1549
1660
  * with no layout face (tests, a shell-less host) still flips the state.
@@ -1616,7 +1727,7 @@ window.__ModuleLoader__.load({
1616
1727
  }
1617
1728
  createTask(input) {
1618
1729
  const id = this.uuid();
1619
- const { task, tasks } = applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth());
1730
+ const { task, tasks } = applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth(), void 0, this.hostState?.cardDefaults);
1620
1731
  if (task === void 0) return void 0;
1621
1732
  this.tasks = [...tasks];
1622
1733
  this.persistAndNotify();
@@ -1626,7 +1737,7 @@ window.__ModuleLoader__.load({
1626
1737
  async createTaskConfirmed(input) {
1627
1738
  if (this.deps.transport === void 0) return this.createTask(input);
1628
1739
  const id = this.uuid();
1629
- if (applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth()).task === void 0) return void 0;
1740
+ if (applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth(), void 0, this.hostState?.cardDefaults).task === void 0) return void 0;
1630
1741
  return await this.commitRemote({
1631
1742
  kind: "create",
1632
1743
  id,
@@ -2009,18 +2120,20 @@ window.__ModuleLoader__.load({
2009
2120
  return this.hostState?.maxSubtaskDepth ?? 1;
2010
2121
  }
2011
2122
  /**
2012
- * Project a Host snapshot onto the browser's mirror. SSE frames and partial
2013
- * snapshots carry only the volatile subset (revision/scheduler/power), so the
2014
- * deployment constants the UI reads — the session-default permission the
2015
- * confirmation banner compares against and the subtask depth limit — are
2016
- * carried over from the last full snapshot instead of being dropped by a
2017
- * heartbeat frame.
2123
+ * Project a Host snapshot onto the browser's mirror. Every snapshot the
2124
+ * transport serves is a full document (bootstrap/state/action all answer
2125
+ * `TaskBoardHostService.snapshot()`), so the deployment constants the UI reads
2126
+ * — the session-default permission the confirmation banner compares against,
2127
+ * the subtask depth limit, the platform switches and the extensions a provider
2128
+ * published — are taken as published, carried over only where the snapshot
2129
+ * itself omits the key.
2018
2130
  */
2019
2131
  mirrorOf(snapshot) {
2020
2132
  const sessionDefaultPermission = snapshot.sessionDefaultPermission ?? this.hostState?.sessionDefaultPermission;
2021
2133
  const maxSubtaskDepth = snapshot.maxSubtaskDepth ?? this.hostState?.maxSubtaskDepth;
2022
2134
  const teamRunAvailable = snapshot.teamRunAvailable ?? this.hostState?.teamRunAvailable;
2023
2135
  const goalRunEnabled = snapshot.goalRunEnabled ?? this.hostState?.goalRunEnabled;
2136
+ const cardDefaults = snapshot.cardDefaults;
2024
2137
  const extensions = snapshot.extensions ?? this.hostState?.extensions;
2025
2138
  return {
2026
2139
  revision: snapshot.revision,
@@ -2030,6 +2143,7 @@ window.__ModuleLoader__.load({
2030
2143
  ...maxSubtaskDepth === void 0 ? {} : { maxSubtaskDepth },
2031
2144
  ...teamRunAvailable === void 0 ? {} : { teamRunAvailable },
2032
2145
  ...goalRunEnabled === void 0 ? {} : { goalRunEnabled },
2146
+ ...cardDefaults === void 0 ? {} : { cardDefaults },
2033
2147
  ...extensions === void 0 ? {} : { extensions }
2034
2148
  };
2035
2149
  }
@@ -2064,6 +2178,189 @@ window.__ModuleLoader__.load({
2064
2178
  }
2065
2179
  };
2066
2180
  //#endregion
2181
+ //#region src/client/board/model-options.ts
2182
+ /** A plain JSON object, or undefined for anything else (including arrays). */
2183
+ function record(value) {
2184
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
2185
+ }
2186
+ /** A non-empty string, or undefined. */
2187
+ function text(value) {
2188
+ return typeof value === "string" && value !== "" ? value : void 0;
2189
+ }
2190
+ /** The effort ids an adapter published for one model, in catalog order. */
2191
+ function effortIdsOf(reasoning) {
2192
+ const efforts = [];
2193
+ for (const entry of Array.isArray(reasoning.efforts) ? reasoning.efforts : []) {
2194
+ const id = text(record(entry)?.id);
2195
+ if (id !== void 0 && !efforts.includes(id)) efforts.push(id);
2196
+ }
2197
+ return efforts;
2198
+ }
2199
+ /**
2200
+ * What the catalog declares about one model's reasoning: a published
2201
+ * `reasoning` block is what "this route reasons" means, and a model published
2202
+ * without one is declared to have none. A model the reply never described at
2203
+ * all is a different state, expressed by the row carrying no capability.
2204
+ */
2205
+ function reasoningOf(model) {
2206
+ const reasoning = record(model.reasoning);
2207
+ if (reasoning === void 0) return { supported: false };
2208
+ const efforts = effortIdsOf(reasoning);
2209
+ return {
2210
+ supported: true,
2211
+ ...efforts.length === 0 ? {} : { efforts }
2212
+ };
2213
+ }
2214
+ /**
2215
+ * One picker row, or undefined when the entry carries no usable id.
2216
+ * @param withCapability - whether this reply declares reasoning metadata at
2217
+ * all; the flat discovery list does not, so its rows stay silent about it.
2218
+ */
2219
+ function rowOf(model, provider, withCapability) {
2220
+ const id = text(model.id);
2221
+ if (id === void 0) return void 0;
2222
+ const reasoning = withCapability ? reasoningOf(model) : void 0;
2223
+ return {
2224
+ id: provider === void 0 ? id : `${provider}/${id}`,
2225
+ name: text(model.name) ?? id,
2226
+ ...provider === void 0 ? {} : { provider },
2227
+ ...reasoning === void 0 ? {} : { reasoning }
2228
+ };
2229
+ }
2230
+ /**
2231
+ * Normalize a `session/modelCatalog` reply into picker rows: one row per model
2232
+ * of every provider group, keyed by the qualified route an execution pins.
2233
+ * @param value - the raw catalog reply.
2234
+ * @returns the rows, empty when the reply is unreadable.
2235
+ */
2236
+ function modelOptionsFromCatalog(value) {
2237
+ const options = [];
2238
+ const groups = record(value)?.groups;
2239
+ for (const entry of Array.isArray(groups) ? groups : []) {
2240
+ const group = record(entry);
2241
+ if (group === void 0) continue;
2242
+ const provider = text(group.id) ?? text(group.provider);
2243
+ for (const item of Array.isArray(group.models) ? group.models : []) {
2244
+ const model = record(item);
2245
+ if (model === void 0) continue;
2246
+ const row = rowOf(model, provider, true);
2247
+ if (row !== void 0) options.push(row);
2248
+ }
2249
+ }
2250
+ return options;
2251
+ }
2252
+ /**
2253
+ * Normalize the flat `llm/discoverModels` list into picker rows. That reply
2254
+ * names models only, so every row leaves the reasoning capability unknown.
2255
+ * @param value - the raw discovery list.
2256
+ * @returns the rows, empty when the list is unreadable.
2257
+ */
2258
+ function modelOptionsFromDiscoveredModels(value) {
2259
+ const options = [];
2260
+ for (const item of Array.isArray(value) ? value : []) {
2261
+ const model = record(item);
2262
+ if (model === void 0) continue;
2263
+ const row = rowOf(model, void 0, false);
2264
+ if (row !== void 0) options.push(row);
2265
+ }
2266
+ return options;
2267
+ }
2268
+ /**
2269
+ * The picker rows of a model roster: the qualified `provider/model` route as
2270
+ * the value a pin stores, and the provider beside the model name so two
2271
+ * providers offering one model name stay distinguishable.
2272
+ * @param models - the roster rows.
2273
+ * @returns the choice rows, in roster order.
2274
+ */
2275
+ function modelChoiceRows(models) {
2276
+ return models.map((model) => ({
2277
+ value: model.id,
2278
+ label: (model.provider === void 0 ? "" : model.provider + " · ") + (model.name ?? model.id)
2279
+ }));
2280
+ }
2281
+ /**
2282
+ * The capability row the roster publishes for one model route.
2283
+ * @returns undefined when no model is pinned, or the roster does not describe
2284
+ * the pinned one — an unknown model is not the same as a model without
2285
+ * reasoning.
2286
+ */
2287
+ function reasoningOfModel(models, modelId) {
2288
+ if (modelId === "") return void 0;
2289
+ return models.find((item) => item.id === modelId)?.reasoning;
2290
+ }
2291
+ /**
2292
+ * The effort ids the picker offers for a model, in catalog order.
2293
+ * @returns an empty list when the model is unpinned, unknown, declares no
2294
+ * reasoning, or publishes no selectable level.
2295
+ */
2296
+ function reasoningEffortsFor(models, modelId) {
2297
+ const reasoning = reasoningOfModel(models, modelId);
2298
+ return reasoning?.supported === true ? [...reasoning.efforts ?? []] : [];
2299
+ }
2300
+ /** Whether the effort picker may be operated: a pinned model with declared, selectable levels. */
2301
+ function reasoningPickerEnabled(models, modelId) {
2302
+ return reasoningEffortsFor(models, modelId).length > 0;
2303
+ }
2304
+ /**
2305
+ * The effort to keep when the picked model changes. Only a model that declares
2306
+ * its levels can invalidate one: a model the roster cannot describe keeps the
2307
+ * stored value, because the roster has no grounds to call it invalid.
2308
+ * @param effort - the effort currently stored/selected ('' = follow the default).
2309
+ * @returns the effort to keep.
2310
+ */
2311
+ function reconcileReasoningEffort(models, modelId, effort) {
2312
+ if (effort === "") return "";
2313
+ const reasoning = reasoningOfModel(models, modelId);
2314
+ if (reasoning === void 0) return modelId === "" ? "" : effort;
2315
+ return reasoning.efforts?.includes(effort) === true ? effort : "";
2316
+ }
2317
+ /**
2318
+ * The copy explaining why the picker is in its current state. One lookup for
2319
+ * both editors, so the create dialog and the detail page never drift apart.
2320
+ */
2321
+ function reasoningHintKey(models, modelId) {
2322
+ if (modelId === "") return "exec.reasoning.hint.pickModel";
2323
+ if (reasoningOfModel(models, modelId) === void 0) return "exec.reasoning.hint.unknownModel";
2324
+ return reasoningPickerEnabled(models, modelId) ? "exec.reasoning.hint.inherit" : "exec.reasoning.hint.noEfforts";
2325
+ }
2326
+ //#endregion
2327
+ //#region src/client/board/preset-roster.ts
2328
+ /**
2329
+ * Read the agent-preset roster of one deployment. The caller passes the
2330
+ * namespace resolved inside its scoped inject, so a host that serves no such
2331
+ * namespace never reaches here; a host that serves it answers `ok: false`
2332
+ * instead, which leaves the caller's options untouched.
2333
+ * @param remote - the `remote.agentPresets` namespace.
2334
+ * @returns the roster, or a failed read the caller ignores.
2335
+ */
2336
+ async function readPresetRoster(remote) {
2337
+ const response = await remote.list();
2338
+ if (!response.ok) return {
2339
+ ok: false,
2340
+ presets: []
2341
+ };
2342
+ return {
2343
+ ok: true,
2344
+ presets: response.value.presets
2345
+ };
2346
+ }
2347
+ /**
2348
+ * Normalize one roster into the picker rows the UI consumes. A preset that
2349
+ * cannot compose a session keeps its `broken` reason: the pickers show it and
2350
+ * disable it, so a missing preset never looks like a missing roster.
2351
+ * @param presets - the roster rows.
2352
+ * @returns the picker options.
2353
+ */
2354
+ function presetOptionsFromRoster(presets) {
2355
+ return presets.map((preset) => ({
2356
+ id: preset.id,
2357
+ name: preset.name,
2358
+ description: preset.description,
2359
+ broken: preset.broken,
2360
+ isDefault: preset.isDefault
2361
+ }));
2362
+ }
2363
+ //#endregion
2067
2364
  //#region src/client/main-session.ts
2068
2365
  /**
2069
2366
  * Resolve the Session the main view currently shows.
@@ -2078,6 +2375,52 @@ window.__ModuleLoader__.load({
2078
2375
  if (byId === void 0 || byId === null) return void 0;
2079
2376
  for (const row of Object.values(byId)) if (row !== void 0 && (row.retainedBy?.mainView ?? 0) > 0) return row.id;
2080
2377
  }
2378
+ //#endregion
2379
+ //#region src/core/execution-summary.ts
2380
+ /**
2381
+ * What one execution left behind: the text of its last assistant message,
2382
+ * recorded on the execution record next to the verdict it belongs to.
2383
+ *
2384
+ * A settled execution used to carry only a verdict, so a parent card could see
2385
+ * that a subtask succeeded without ever seeing what it produced, and had to
2386
+ * guess or redo the work. The card's own content cannot answer that: card
2387
+ * content is the plan and freezes at the first execution
2388
+ * (`canEditTaskContent`), so the closing words of a run are recorded on the
2389
+ * execution record instead.
2390
+ *
2391
+ * Pure (no cordis, no runtime imports) so the settlement path is unit-testable
2392
+ * without a session, and so a text-less run degrades to "no field" rather than
2393
+ * to an empty string.
2394
+ */
2395
+ /**
2396
+ * Bound one summary, keeping its tail: the closing paragraphs carry the
2397
+ * conclusion a reader is after, and the omitted opening is announced instead of
2398
+ * silently dropped. Mirrors the evidence reader's tail bound.
2399
+ */
2400
+ function truncateExecutionSummary(text, limit = EXECUTION_SUMMARY_LIMIT) {
2401
+ if (text.length <= limit) return text;
2402
+ const notice = "[truncated " + String(text.length - limit) + " chars] ";
2403
+ return notice.length >= limit ? text.slice(-limit) : notice + text.slice(-(limit - notice.length));
2404
+ }
2405
+ /**
2406
+ * Repair one persisted or reported summary.
2407
+ *
2408
+ * A summary is informational, so an unreadable one is dropped on its own rather
2409
+ * than costing the execution (or the task row) it hangs on. A hand-edited
2410
+ * overlong text is bounded on the way in, so no reader ever holds more than the
2411
+ * limit.
2412
+ */
2413
+ function normalizeExecutionSummary(value) {
2414
+ if (typeof value !== "object" || value === null) return void 0;
2415
+ const row = value;
2416
+ if (typeof row.text !== "string" || typeof row.seq !== "number" || !Number.isFinite(row.seq)) return void 0;
2417
+ const text = row.text.trim();
2418
+ if (text === "") return void 0;
2419
+ return {
2420
+ text: truncateExecutionSummary(text),
2421
+ seq: row.seq
2422
+ };
2423
+ }
2081
2424
  /** Marker replacing every sensitive match. */
2082
2425
  const REDACTED_MARKER = "[REDACTED]";
2083
2426
  const BEGIN = "<<<FREEZE";
@@ -2813,6 +3156,7 @@ window.__ModuleLoader__.load({
2813
3156
  if (record.parentId !== void 0 && typeof record.parentId !== "string") return false;
2814
3157
  if (record.workspaceId !== void 0 && typeof record.workspaceId !== "string") return false;
2815
3158
  if (record.mode !== void 0 && typeof record.mode !== "string") return false;
3159
+ if (record.reasoningEffort !== void 0 && typeof record.reasoningEffort !== "string") return false;
2816
3160
  if (record.permission !== void 0 && typeof record.permission !== "string") return false;
2817
3161
  if (record.integrations !== void 0 && (typeof record.integrations !== "object" || record.integrations === null || Array.isArray(record.integrations))) return false;
2818
3162
  if (record.hidden !== void 0 && typeof record.hidden !== "boolean") return false;
@@ -2973,11 +3317,13 @@ window.__ModuleLoader__.load({
2973
3317
  runGroupId: normalizeTargetId(execution.runGroupId),
2974
3318
  ownResult: isExecutionOutcome(execution.ownResult) ? execution.ownResult : void 0,
2975
3319
  ownError: typeof execution.ownError === "string" ? execution.ownError : void 0,
3320
+ summary: normalizeExecutionSummary(execution.summary),
2976
3321
  verification: normalizeVerification(execution.verification),
2977
3322
  external: execution.external === true ? true : void 0
2978
3323
  }));
2979
3324
  task.workspaceId = normalizeTargetId(row.workspaceId);
2980
3325
  task.mode = normalizeTargetId(row.mode);
3326
+ task.reasoningEffort = normalizeTargetId(row.reasoningEffort);
2981
3327
  task.archivedAt = typeof row.archivedAt === "number" && Number.isFinite(row.archivedAt) ? row.archivedAt : void 0;
2982
3328
  task.permission = isTaskPermission(row.permission) ? row.permission : void 0;
2983
3329
  task.reuseSession = row.reuseSession === true ? true : void 0;
@@ -3318,6 +3664,14 @@ window.__ModuleLoader__.load({
3318
3664
  "exec.permission.danger-full-access": "完全访问",
3319
3665
  "exec.model.default": "宿主默认(agent-default-model)",
3320
3666
  "exec.model.unknown": "(未知模型/回退默认)",
3667
+ "exec.reasoning": "思考档位",
3668
+ "exec.reasoning.inherit": "沿用模型/宿主默认",
3669
+ "exec.reasoning.unknown": "(未知档位)",
3670
+ "exec.reasoning.hint.pickModel": "先选择要钉住的模型,才能设置它的思考档位。",
3671
+ "exec.reasoning.hint.unknownModel": "无法从当前名册确认该模型的可选档位;已保存的值原样保留。",
3672
+ "exec.reasoning.hint.noEfforts": "该模型没有可选的思考档位,始终沿用模型/宿主的默认值。",
3673
+ "exec.reasoning.hint.inherit": "留空即沿用该模型/宿主的默认档位。",
3674
+ "exec.teamRunAutoHint": "创建或关联子任务成功后,父任务会自动开启 Agent Team 执行(可随时手动关闭)。",
3321
3675
  "exec.reuseSession": "在同一对话继续",
3322
3676
  "exec.teamRun": "用 Agent Team 执行(Leader/teammate)",
3323
3677
  "exec.teamRunHint": "开启后:执行本任务只启动一个 Leader 会话,每个子任务由它派生为 teammate 并在该会话内并行工作(子任务自身的权限钉住不适用)。关闭则每个成员各开独立会话。",
@@ -3362,6 +3716,10 @@ window.__ModuleLoader__.load({
3362
3716
  "settings.maxSubtaskDepth": "子任务深度上限",
3363
3717
  "settings.maxSubtaskDepthHint": "默认 1:一个任务只允许一层子任务,子任务不能再创建或关联子任务。最大 3。执行父任务会并发执行它的整棵子任务树,层级越深,一次执行开启的会话越多。",
3364
3718
  "settings.maxSubtaskDepthOption": "{depth} 层",
3719
+ "settings.runLaunchWidth": "并发启动上限",
3720
+ "settings.runLaunchWidthHint": "默认 3。一次执行会开启整棵子任务树,但同一刻最多只有这么多个成员在创建会话并入队 Prompt,其余成员排队等待——全部都会启动,只是分批进入运行列。默认值取自本仓「重型实施子代理并发 ≤ 3」的实测纪律。取值 1–16:越大启动越快,Host 的内存与 swap 压力越高。执行中修改只影响尚未入列的启动。",
3721
+ "settings.spendBudgetTokens": "每日 token 上限",
3722
+ "settings.spendBudgetTokensHint": "默认 0,表示不设闸,行为与没有这项设置时完全一致(不读账本、不计数)。设为正整数后,今日已用 token 达到该值时:手动执行与重新执行被拒绝,调用方看到的拒绝文本就是原因;到点的定时执行把原因写进调度错误并跳过本次触发,不消耗计划次数,因此调高上限或跨过本地零点后下一次触发照常执行。计量单位是 token 而不是金额:使用账本只对 DeepSeek 官方路由计价,其他路由恒为 0。今日已用取自该账本按本地日期分桶的输入、缓存读写与输出之和,与「使用统计」面板的口径一致。",
3365
3723
  "settings.runBehaviorTitle": "运行行为",
3366
3724
  "settings.runBehaviorCardHint": "全局原生 /goal 执行开关(总开关,默认关闭)。",
3367
3725
  "settings.goalRunGlobal": "全局启用 DSH 原生 /goal 执行",
@@ -3391,6 +3749,11 @@ window.__ModuleLoader__.load({
3391
3749
  "settings.goalVerificationEffortFallback": "所选推理强度 {requested} 不被目标模型支持,已回退为 {resolved}。",
3392
3750
  "settings.goalVerificationEffortFallbackNone": "所选推理强度 {requested} 不被目标模型支持,已回退为该模型默认档位(不显式传参)。",
3393
3751
  "settings.goalVerificationModelInvalid": "配置的验收模型不是 provider/model 形式,已回退宿主默认。",
3752
+ "settings.cardDefaultsTitle": "新建卡片默认值",
3753
+ "settings.cardDefaultsCardHint": "新建对话框打开时预填的 Agent 预设、权限、模型与思考档位;留空即不设置,创建卡片的行为与未配置时完全一致。它们只是预填,不改变任何既有语义,新建的卡片仍可随时修改;思考档位默认值只在卡片最终钉住的模型就是这里的默认模型时才生效。",
3754
+ "settings.cardDefaultModeHint": "留空不钉住任何值,新建卡片照旧继承部署默认预设。取值优先级为:新建对话框里的显式选择 > 复制源卡或父任务已钉住的值 > 这里的默认值;子任务沿用父卡已钉住的值。",
3755
+ "settings.cardDefaultPermissionHint": "留空为不设置(用会话默认)。高于会话默认权限基线的默认值仍只是预填:卡片执行前照旧需要人工确认。子任务从不沿用父卡的权限,只在父卡未钉住、且这里设置了默认值时才预填。",
3756
+ "settings.cardDefaultModelHint": "留空为宿主默认(agent-default-model)。对话框里的显式选择优先于源卡/父卡已钉住的值,后者优先于这里的默认值;自己选了模型的调用方不借用任何默认档位。",
3394
3757
  "running.executing": "执行中",
3395
3758
  "running.verifying": "验收中",
3396
3759
  "running.repairing": "验收未通过修复中",
@@ -3464,7 +3827,8 @@ window.__ModuleLoader__.load({
3464
3827
  "detail.subtasks.link": "关联现有任务",
3465
3828
  "detail.subtasks.detach": "解除关联",
3466
3829
  "detail.subtasks.runningLock": "子任务正在执行,结算后才能解除关联或改挂父任务",
3467
- "detail.subtasks.runHint": "执行本任务会同时并发执行它的 {count} 个子任务;子任务失败不影响其它子任务继续执行。",
3830
+ "detail.subtasks.runHint": "执行本任务会同时并发执行它 {count} 个未完成的子任务;已在完成列的子任务不会重复执行,子任务失败不影响其它子任务继续执行。",
3831
+ "detail.subtasks.runHintSettled": "这个任务的子任务都已在完成列;执行本任务不会重复执行它们,要让某个子任务再跑一次,把它移回待办列或单独执行它。",
3468
3832
  "detail.subtasks.waiting": "等待子任务结算",
3469
3833
  "detail.subtasks.depthLimit": "当前子任务深度上限为 {depth} 层,子任务不能再创建或关联子任务。",
3470
3834
  "detail.subtasks.hostOnly": "连接 Host 后才能创建或关联子任务。",
@@ -3742,6 +4106,14 @@ window.__ModuleLoader__.load({
3742
4106
  "exec.permission.danger-full-access": "Full Access",
3743
4107
  "exec.model.default": "Host default (agent-default-model)",
3744
4108
  "exec.model.unknown": " (unknown / fallback to default)",
4109
+ "exec.reasoning": "Reasoning effort",
4110
+ "exec.reasoning.inherit": "Model or Host default",
4111
+ "exec.reasoning.unknown": " (unknown effort)",
4112
+ "exec.reasoning.hint.pickModel": "Pin a model first, then choose its reasoning effort.",
4113
+ "exec.reasoning.hint.unknownModel": "The current roster cannot confirm this model's effort levels; the stored value is kept as it is.",
4114
+ "exec.reasoning.hint.noEfforts": "This model offers no selectable reasoning effort, so the model or Host default always applies.",
4115
+ "exec.reasoning.hint.inherit": "Leave it empty to follow the model or Host default.",
4116
+ "exec.teamRunAutoHint": "Once a subtask is created or linked, the parent task turns on Agent Team execution automatically (you can switch it off at any time).",
3745
4117
  "exec.reuseSession": "Continue in the same conversation",
3746
4118
  "exec.teamRun": "Run with an Agent Team (Lead + teammates)",
3747
4119
  "exec.teamRunHint": "On: running this task starts one Lead session and spawns a teammate per subtask inside it, working in parallel (a subtask permission pin does not apply). Off: every member gets its own independent session.",
@@ -3786,6 +4158,10 @@ window.__ModuleLoader__.load({
3786
4158
  "settings.maxSubtaskDepth": "Subtask depth limit",
3787
4159
  "settings.maxSubtaskDepthHint": "Default 1: a task may carry one level of subtasks, and a subtask cannot create or link further subtasks. Maximum 3. Running a task also runs its whole subtask tree concurrently, and every extra level opens more sessions per run.",
3788
4160
  "settings.maxSubtaskDepthOption": "{depth} levels",
4161
+ "settings.runLaunchWidth": "Concurrent run launches",
4162
+ "settings.runLaunchWidthHint": "Default 3. A run opens its whole subtree, but only this many members create their session and queue their prompt at the same time; the rest wait their turn. Every member still starts, entering the running column in batches. The default comes from this repository's measured guidance for heavy implementation subagents (at most three). Range 1 to 16: a larger width starts runs sooner and costs the Host more memory and swap. Edited during a run, it bounds the launches that have not been admitted yet.",
4163
+ "settings.spendBudgetTokens": "Daily token cap",
4164
+ "settings.spendBudgetTokensHint": "Default 0 means no gate: behavior is exactly what it was before this setting existed, with no ledger read and no counting. With a positive cap, once today's measured spend reaches it a manual run or re-run is refused and the caller sees that message as the refusal, while a due schedule writes the reason to the scheduler error and skips that occurrence without spending a planned run — raising the cap, or the local day rolling over, lets the next trigger run as usual. The unit is tokens rather than money: the usage ledger prices only DeepSeek's own routes and stays 0 on every other route. Today's spend is that ledger's local-date bucket summed over input, cache read/write and output, the same measure the usage panel shows.",
3789
4165
  "settings.runBehaviorTitle": "Run behavior",
3790
4166
  "settings.runBehaviorCardHint": "The global native /goal switch (master control, off by default).",
3791
4167
  "settings.goalRunGlobal": "Global: run tasks with dsh native /goal",
@@ -3814,6 +4190,11 @@ window.__ModuleLoader__.load({
3814
4190
  "settings.goalVerificationRouteMissing": "The host serves no model catalog, so no judge route resolves: with acceptance on, a goal completion claim is refused and recorded as an acceptance anomaly.",
3815
4191
  "settings.goalVerificationEffortFallback": "The selected reasoning effort {requested} is not supported by the target model; it falls back to {resolved}.",
3816
4192
  "settings.goalVerificationEffortFallbackNone": "The selected reasoning effort {requested} is not supported by the target model; it falls back to that model default level (not sent explicitly).",
4193
+ "settings.cardDefaultsTitle": "New-card defaults",
4194
+ "settings.cardDefaultsCardHint": "What the new-task dialog opens with: agent preset, permission, model and reasoning effort. Blank sets nothing, so creating a card behaves exactly as it does unconfigured. They are only prefills and change no existing meaning, and every new card stays editable; the default reasoning effort applies only while a card ends up on the configured default model.",
4195
+ "settings.cardDefaultModeHint": "Blank pins nothing: a new card keeps following the deployment default preset. A target resolves as the explicit choice in the new-task dialog, then the value carried over from the source card or parent, then this default; a subtask keeps what its parent already pinned.",
4196
+ "settings.cardDefaultPermissionHint": "Blank sets nothing (the session default applies). A default above the session permission baseline is still only a prefill: the card still needs a human confirmation before it may run. A subtask never carries its parent permission; this default fills in only where the parent pinned none.",
4197
+ "settings.cardDefaultModelHint": "Blank is the host default (agent-default-model). An explicit choice in the dialog wins over the value carried over from the source card or parent, which wins over this default; a caller that pins a model of its own borrows no default reasoning level.",
3817
4198
  "settings.goalVerificationModelInvalid": "The configured judge model is not a provider/model route; the host default is used instead.",
3818
4199
  "running.executing": "Executing",
3819
4200
  "running.verifying": "Verifying",
@@ -3888,7 +4269,8 @@ window.__ModuleLoader__.load({
3888
4269
  "detail.subtasks.link": "Link existing task",
3889
4270
  "detail.subtasks.detach": "Detach",
3890
4271
  "detail.subtasks.runningLock": "This subtask is running; it can be detached or re-linked once it settles",
3891
- "detail.subtasks.runHint": "Running this task also runs its {count} subtasks concurrently; one subtask failing does not stop the others.",
4272
+ "detail.subtasks.runHint": "Running this task also runs its {count} unfinished subtasks concurrently; a subtask already in the done column is not run again, and one subtask failing does not stop the others.",
4273
+ "detail.subtasks.runHintSettled": "Every subtask of this task is already in the done column; running this task does not repeat them. To run one again, move it back to the todo column or run it on its own.",
3892
4274
  "detail.subtasks.waiting": "Waiting for subtasks",
3893
4275
  "detail.subtasks.depthLimit": "The subtask depth limit is {depth}; a subtask cannot create or link further subtasks.",
3894
4276
  "detail.subtasks.hostOnly": "Connect to the Host to create or link subtasks.",
@@ -5055,9 +5437,9 @@ window.__ModuleLoader__.load({
5055
5437
  return VERIFICATION_PHASE_KEY[verificationPhase(verification)];
5056
5438
  }
5057
5439
  //#endregion
5058
- //#region ../../node_modules/.pnpm/marked@18.0.14/node_modules/marked/lib/marked.esm.js
5440
+ //#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
5059
5441
  /**
5060
- * marked v18.0.14 - a markdown parser
5442
+ * marked v18.1.1 - a markdown parser
5061
5443
  * Copyright (c) 2018-2026, MarkedJS. (MIT License)
5062
5444
  * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
5063
5445
  * https://github.com/markedjs/marked
@@ -5066,7 +5448,7 @@ window.__ModuleLoader__.load({
5066
5448
  * DO NOT EDIT THIS FILE
5067
5449
  * The code in this file is generated from files in ./src/
5068
5450
  */
5069
- function I() {
5451
+ function B() {
5070
5452
  return {
5071
5453
  async: !1,
5072
5454
  breaks: !1,
@@ -5080,31 +5462,31 @@ window.__ModuleLoader__.load({
5080
5462
  walkTokens: null
5081
5463
  };
5082
5464
  }
5083
- var y = I();
5084
- function W(l) {
5085
- y = l;
5465
+ var y = B();
5466
+ function V(a) {
5467
+ y = a;
5086
5468
  }
5087
- var A = { exec: () => null };
5088
- function C(l) {
5469
+ var M = { exec: () => null };
5470
+ function D(a) {
5089
5471
  let e = [];
5090
5472
  return (t) => {
5091
- let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
5092
- return s || (s = l(n), e[n] = s), s;
5473
+ let n = Math.max(0, Math.min(3, t - 1)), i = e[n];
5474
+ return i || (i = a(n), e[n] = i), i;
5093
5475
  };
5094
5476
  }
5095
- function h(l, e = "") {
5096
- let t = typeof l == "string" ? l : l.source, n = {
5097
- replace: (s, r) => {
5477
+ function h(a, e = "") {
5478
+ let t = typeof a == "string" ? a : a.source, n = {
5479
+ replace: (i, r) => {
5098
5480
  let o = typeof r == "string" ? r : r.source;
5099
- return o = o.replace(x.caret, "$1"), t = t.replace(s, o), n;
5481
+ return o = o.replace(x.caret, "$1"), t = t.replace(i, o), n;
5100
5482
  },
5101
5483
  getRegex: () => new RegExp(t, e)
5102
5484
  };
5103
5485
  return n;
5104
5486
  }
5105
- var _e = ((l = "") => {
5487
+ var ze = ((a = "") => {
5106
5488
  try {
5107
- return !!new RegExp("(?<=1)(?<!1)" + l);
5489
+ return !!new RegExp("(?<=1)(?<!1)" + a);
5108
5490
  } catch {
5109
5491
  return !1;
5110
5492
  }
@@ -5148,7 +5530,8 @@ window.__ModuleLoader__.load({
5148
5530
  endAngleBracket: />$/,
5149
5531
  pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
5150
5532
  unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
5151
- numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,
5533
+ numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,
5534
+ numericCharacterReferenceOrAmpersand: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
5152
5535
  escapeTest: /[&<>"']/,
5153
5536
  escapeReplace: /[&<>"']/g,
5154
5537
  escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
@@ -5162,299 +5545,300 @@ window.__ModuleLoader__.load({
5162
5545
  spaceLine: /^ +$/gm,
5163
5546
  notSpaceStart: /^\S*/,
5164
5547
  endingNewline: /\n$/,
5165
- listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
5166
- nextBulletRegex: C((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
5167
- hrRegex: C((l) => new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
5168
- fencesBeginRegex: C((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
5169
- headingBeginRegex: C((l) => new RegExp(`^ {0,${l}}#`)),
5170
- htmlBeginRegex: C((l) => new RegExp(`^ {0,${l}}(?:</?(?:${N})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
5171
- blockquoteBeginRegex: C((l) => new RegExp(`^ {0,${l}}>`))
5548
+ listItemRegex: (a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),
5549
+ nextBulletRegex: D((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
5550
+ hrRegex: D((a) => new RegExp(`^ {0,${a}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
5551
+ fencesBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),
5552
+ headingBeginRegex: D((a) => new RegExp(`^ {0,${a}}#`)),
5553
+ htmlBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:</?(?:${Q})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
5554
+ blockquoteBeginRegex: D((a) => new RegExp(`^ {0,${a}}>`))
5172
5555
  };
5173
- var $e = /^(?:[ \t]*(?:\n|$))+/;
5174
- var Le = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
5175
- var ze = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
5176
- var G = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
5177
- var Ae = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
5178
- var J = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
5179
- var ce = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
5180
- var he = h(ce).replace(/bull/g, J).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
5181
- var Ee = h(ce).replace(/bull/g, J).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
5182
- var V = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
5183
- var Me = /^[^\n]+/;
5184
- var Y = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
5185
- var Ie = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Y).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
5186
- var Ce = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, J).getRegex();
5187
- var N = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
5188
- var ee = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
5189
- var Be = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ee).replace("tag", N).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
5190
- var de = (l) => h(V).replace("hr", G).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", N).getRegex();
5191
- var De = de(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
5192
- var qe = de(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
5193
- var te = {
5194
- blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", qe).getRegex(),
5195
- code: Le,
5196
- def: Ie,
5197
- fences: ze,
5198
- heading: Ae,
5199
- hr: G,
5200
- html: Be,
5201
- lheading: he,
5202
- list: Ce,
5203
- newline: $e,
5204
- paragraph: De,
5205
- table: A,
5206
- text: Me
5556
+ var Ee = /^(?:[ \t]*(?:\n|$))+/;
5557
+ var Me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
5558
+ var Ce = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
5559
+ var N = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
5560
+ var Ie = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
5561
+ var Y = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
5562
+ var fe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
5563
+ var me = h(fe).replace(/bull/g, Y).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
5564
+ var Be = h(fe).replace(/bull/g, Y).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
5565
+ var ee = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
5566
+ var De = /^[^\n]+/;
5567
+ var te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
5568
+ var qe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", te).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
5569
+ var Ze = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Y).getRegex();
5570
+ var Q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
5571
+ var ne = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
5572
+ var ve = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ne).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
5573
+ var xe = (a) => h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", a).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
5574
+ var He = xe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
5575
+ var Ge = xe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
5576
+ var re = {
5577
+ blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ge).getRegex(),
5578
+ code: Me,
5579
+ def: qe,
5580
+ fences: Ce,
5581
+ heading: Ie,
5582
+ hr: N,
5583
+ html: ve,
5584
+ lheading: me,
5585
+ list: Ze,
5586
+ newline: Ee,
5587
+ paragraph: He,
5588
+ table: M,
5589
+ text: De
5207
5590
  };
5208
- var le = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", G).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", N).getRegex();
5209
- var Ze = {
5210
- ...te,
5211
- lheading: Ee,
5212
- table: le,
5213
- paragraph: h(V).replace("hr", G).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", le).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", N).getRegex()
5591
+ var de = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
5592
+ var Qe = {
5593
+ ...re,
5594
+ lheading: Be,
5595
+ table: de,
5596
+ paragraph: h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", de).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex()
5214
5597
  };
5215
- var He = {
5216
- ...te,
5217
- html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ee).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
5598
+ var je = {
5599
+ ...re,
5600
+ html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ne).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
5218
5601
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
5219
5602
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
5220
- fences: A,
5603
+ fences: M,
5221
5604
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
5222
- paragraph: h(V).replace("hr", G).replace("heading", ` *#{1,6} *[^
5223
- ]`).replace("lheading", he).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
5605
+ paragraph: h(ee).replace("hr", N).replace("heading", ` *#{1,6} *[^
5606
+ ]`).replace("lheading", me).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
5224
5607
  };
5225
- var Ge = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
5226
- var Ne = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
5227
- var ke = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
5228
- var Qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
5229
- var $ = /[\p{P}\p{S}]/u;
5230
- var B = /[\s\p{P}\p{S}]/u;
5231
- var Q = /[^\s\p{P}\p{S}]/u;
5232
- var je = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, B).getRegex();
5233
- var Fe = /[\p{Pi}\p{Ps}"']/u;
5234
- var ge = /(?!~)[\p{P}\p{S}]/u;
5235
- var Ue = /(?!~)[\s\p{P}\p{S}]/u;
5236
- var Ke = /(?:[^\s\p{P}\p{S}]|~)/u;
5237
- var We = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", _e ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
5238
- var fe = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
5239
- var Xe = h(fe, "u").replace(/punct/g, $).getRegex();
5240
- var Je = h(fe, "u").replace(/punct/g, ge).getRegex();
5241
- var Ye = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Fe).replace(/punct/g, $).getRegex();
5242
- var me = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
5243
- var et = h(me, "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5244
- var tt = h(me, "gu").replace(/notPunctSpace/g, Ke).replace(/punctSpace/g, Ue).replace(/punct/g, ge).getRegex();
5245
- var rt = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5246
- var st = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5247
- var ot = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5248
- var at = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, $).getRegex();
5249
- var ut = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5250
- var pt = h(/\\(punct)/, "gu").replace(/punct/g, $).getRegex();
5251
- var ct = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
5252
- var ht = h(ee).replace("(?:-->|$)", "-->").getRegex();
5253
- var dt = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ht).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
5254
- var xe = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
5255
- var U = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", xe).getRegex();
5256
- var kt = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", U).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
5257
- var gt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", U).replace("ref", Y).getRegex();
5258
- var ft = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Y).getRegex();
5259
- var ue = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
5260
- var mt = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", xe).getRegex();
5261
- var xt = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", mt).replace("ref", ue).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ue).getRegex()).getRegex();
5262
- var pe = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
5263
- var Rt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
5264
- var ne = {
5265
- _backpedal: A,
5266
- anyPunctuation: pt,
5267
- autolink: ct,
5268
- blockSkip: We,
5269
- br: ke,
5270
- code: Ne,
5271
- del: A,
5272
- delLDelim: A,
5273
- delRDelim: A,
5274
- emStrongLDelim: Xe,
5275
- emStrongRDelimAst: et,
5276
- emStrongRDelimUnd: st,
5277
- escape: Ge,
5278
- link: kt,
5279
- nolink: ft,
5280
- punctuation: je,
5281
- reflink: gt,
5282
- reflinkSearch: xt,
5283
- tag: dt,
5284
- text: Qe,
5285
- url: A
5608
+ var Fe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
5609
+ var Ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
5610
+ var be = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
5611
+ var Ke = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
5612
+ var S = /[\p{P}\p{S}]/u;
5613
+ var q = /[\s\p{P}\p{S}]/u;
5614
+ var j = /[^\s\p{P}\p{S}]/u;
5615
+ var Xe = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, q).getRegex();
5616
+ var We = /[\p{Pi}\p{Ps}"']/u;
5617
+ var Re = /(?!~)[\p{P}\p{S}]/u;
5618
+ var Ve = /(?!~)[\s\p{P}\p{S}]/u;
5619
+ var Je = /(?:[^\s\p{P}\p{S}]|~)/u;
5620
+ var Ye = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ze ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
5621
+ var Te = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
5622
+ var et = h(Te, "u").replace(/punct/g, S).getRegex();
5623
+ var tt = h(Te, "u").replace(/punct/g, Re).getRegex();
5624
+ var rt = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, We).replace(/punct/g, S).getRegex();
5625
+ var Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
5626
+ var st = h(Oe, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5627
+ var it = h(Oe, "gu").replace(/notPunctSpace/g, Je).replace(/punctSpace/g, Ve).replace(/punct/g, Re).getRegex();
5628
+ var at = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5629
+ var lt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5630
+ var pt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5631
+ var ct = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, S).getRegex();
5632
+ var dt = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5633
+ var kt = h(/\\(punct)/, "gu").replace(/punct/g, S).getRegex();
5634
+ var gt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, S).getRegex();
5635
+ var ft = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
5636
+ var mt = h(ne).replace("(?:-->|$)", "-->").getRegex();
5637
+ var xt = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", mt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
5638
+ var we = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
5639
+ var K = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", we).getRegex();
5640
+ var bt = h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", K).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
5641
+ var Rt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", K).replace("ref", te).getRegex();
5642
+ var Tt = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", te).getRegex();
5643
+ var ke = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
5644
+ var Ot = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", we).getRegex();
5645
+ var wt = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", Ot).replace("ref", ke).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ke).getRegex()).getRegex();
5646
+ var ge = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
5647
+ var yt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
5648
+ var se = {
5649
+ _backpedal: M,
5650
+ anyPunctuation: kt,
5651
+ anyPunctuationOutsideCode: gt,
5652
+ autolink: ft,
5653
+ blockSkip: Ye,
5654
+ br: be,
5655
+ code: Ue,
5656
+ del: M,
5657
+ delLDelim: M,
5658
+ delRDelim: M,
5659
+ emStrongLDelim: et,
5660
+ emStrongRDelimAst: st,
5661
+ emStrongRDelimUnd: lt,
5662
+ escape: Fe,
5663
+ link: bt,
5664
+ nolink: Tt,
5665
+ punctuation: Xe,
5666
+ reflink: Rt,
5667
+ reflinkSearch: wt,
5668
+ tag: xt,
5669
+ text: Ke,
5670
+ url: M
5286
5671
  };
5287
- var Tt = {
5288
- ...ne,
5289
- emStrongLDelim: Ye,
5290
- emStrongRDelimAst: rt,
5291
- emStrongRDelimUnd: ot,
5292
- link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", U).getRegex(),
5293
- reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", U).getRegex()
5672
+ var St = {
5673
+ ...se,
5674
+ emStrongLDelim: rt,
5675
+ emStrongRDelimAst: at,
5676
+ emStrongRDelimUnd: pt,
5677
+ link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", K).getRegex(),
5678
+ reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", K).getRegex()
5294
5679
  };
5295
- var X = {
5296
- ...ne,
5297
- emStrongRDelimAst: tt,
5298
- emStrongLDelim: Je,
5299
- delLDelim: at,
5300
- delRDelim: ut,
5301
- url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Rt).replace("protocol", pe).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
5680
+ var J = {
5681
+ ...se,
5682
+ emStrongRDelimAst: it,
5683
+ emStrongLDelim: tt,
5684
+ delLDelim: ct,
5685
+ delRDelim: dt,
5686
+ url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", yt).replace("protocol", ge).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
5302
5687
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
5303
5688
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
5304
- text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", pe).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
5689
+ text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", ge).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
5305
5690
  };
5306
- var Ot = {
5307
- ...X,
5308
- br: h(ke).replace("{2,}", "*").getRegex(),
5309
- text: h(X.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
5691
+ var _t = {
5692
+ ...J,
5693
+ br: h(be).replace("{2,}", "*").getRegex(),
5694
+ text: h(J.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
5310
5695
  };
5311
- var j = {
5312
- normal: te,
5313
- gfm: Ze,
5314
- pedantic: He
5696
+ var F = {
5697
+ normal: re,
5698
+ gfm: Qe,
5699
+ pedantic: je
5315
5700
  };
5316
- var D = {
5317
- normal: ne,
5318
- gfm: X,
5319
- breaks: Ot,
5320
- pedantic: Tt
5701
+ var Z = {
5702
+ normal: se,
5703
+ gfm: J,
5704
+ breaks: _t,
5705
+ pedantic: St
5321
5706
  };
5322
- var wt = {
5707
+ var $t = {
5323
5708
  "&": "&amp;",
5324
5709
  "<": "&lt;",
5325
5710
  ">": "&gt;",
5326
5711
  "\"": "&quot;",
5327
5712
  "'": "&#39;"
5328
5713
  };
5329
- var be = (l) => wt[l];
5330
- function O(l, e) {
5714
+ var Pe = (a) => $t[a];
5715
+ function w(a, e) {
5331
5716
  if (e) {
5332
- if (x.escapeTest.test(l)) return l.replace(x.escapeReplace, be);
5333
- } else if (x.escapeTestNoEncode.test(l)) return l.replace(x.escapeReplaceNoEncode, be);
5334
- return l;
5335
- }
5336
- function Re(l) {
5337
- return l.replace(x.numericCharacterReference, (e, t, n) => {
5338
- let s = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
5339
- return s === 0 || s > 1114111 || s >= 55296 && s <= 57343 ? "�" : String.fromCodePoint(s);
5340
- });
5341
- }
5342
- function re(l) {
5717
+ if (x.escapeTest.test(a)) return a.replace(x.escapeReplace, Pe);
5718
+ } else if (x.escapeTestNoEncode.test(a)) return a.replace(x.escapeReplaceNoEncode, Pe);
5719
+ return a;
5720
+ }
5721
+ function ye(a) {
5722
+ return x.numericCharacterReference.test(a) ? a.replace(x.numericCharacterReferenceOrAmpersand, (e, t, n) => {
5723
+ if (t === void 0 && n === void 0) return "&amp;";
5724
+ let i = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
5725
+ return i === 0 || i > 1114111 || i >= 55296 && i <= 57343 ? "�" : i === 38 ? "&amp;" : String.fromCodePoint(i);
5726
+ }) : a;
5727
+ }
5728
+ function ie(a) {
5343
5729
  try {
5344
- l = encodeURI(l).replace(x.percentDecode, "%");
5730
+ a = encodeURI(a).replace(x.percentDecode, "%");
5345
5731
  } catch {
5346
5732
  return null;
5347
5733
  }
5348
- return l;
5734
+ return a;
5349
5735
  }
5350
- function se(l, e) {
5351
- let n = l.replace(x.findPipe, (r, o, i) => {
5352
- let u = !1, a = o;
5353
- for (; --a >= 0 && i[a] === "\\";) u = !u;
5354
- return u ? "|" : " |";
5355
- }).split(x.splitPipe), s = 0;
5736
+ function oe(a, e) {
5737
+ let n = a.replace(x.findPipe, (r, o, s) => {
5738
+ let l = !1, u = o;
5739
+ for (; --u >= 0 && s[u] === "\\";) l = !l;
5740
+ return l ? "|" : " |";
5741
+ }).split(x.splitPipe), i = 0;
5356
5742
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
5357
5743
  else for (; n.length < e;) n.push("");
5358
- for (; s < n.length; s++) n[s] = n[s].trim().replace(x.slashPipe, "|");
5744
+ for (; i < n.length; i++) n[i] = n[i].trim().replace(x.slashPipe, "|");
5359
5745
  return n;
5360
5746
  }
5361
- function L(l, e, t) {
5362
- let n = l.length;
5747
+ function A(a, e, t) {
5748
+ let n = a.length;
5363
5749
  if (n === 0) return "";
5364
- let s = 0;
5365
- for (; s < n;) {
5366
- let r = l.charAt(n - s - 1);
5367
- if (r === e && !t) s++;
5368
- else if (r !== e && t) s++;
5750
+ let i = 0;
5751
+ for (; i < n;) {
5752
+ let r = a.charAt(n - i - 1);
5753
+ if (r === e && !t) i++;
5754
+ else if (r !== e && t) i++;
5369
5755
  else break;
5370
5756
  }
5371
- return l.slice(0, n - s);
5757
+ return a.slice(0, n - i);
5372
5758
  }
5373
- function ie(l) {
5374
- let e = l.split(`
5759
+ function ae(a) {
5760
+ let e = a.split(`
5375
5761
  `), t = e.length - 1;
5376
5762
  for (; t >= 0 && x.blankLine.test(e[t]);) t--;
5377
- return e.length - t <= 2 ? l : e.slice(0, t + 1).join(`
5763
+ return e.length - t <= 2 ? a : e.slice(0, t + 1).join(`
5378
5764
  `);
5379
5765
  }
5380
- function q(l) {
5381
- return l.trim().toLowerCase().toUpperCase().toLowerCase();
5766
+ function v(a) {
5767
+ return a.trim().toLowerCase().toUpperCase().toLowerCase();
5382
5768
  }
5383
- function Te(l, e) {
5384
- if (l.indexOf(e[1]) === -1) return -1;
5769
+ function le(a, e) {
5770
+ if (a.indexOf(e[0]) === -1 && a.indexOf(e[1]) === -1) return -1;
5385
5771
  let t = 0;
5386
- for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
5387
- else if (l[n] === e[0]) t++;
5388
- else if (l[n] === e[1] && (t--, t < 0)) return n;
5772
+ for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
5773
+ else if (a[n] === e[0]) t++;
5774
+ else if (a[n] === e[1] && (t--, t < 0)) return n;
5389
5775
  return t > 0 ? -2 : -1;
5390
5776
  }
5391
- function oe(l, e = 0) {
5777
+ function X(a, e = 0) {
5392
5778
  let t = e, n = "";
5393
- for (let s of l) if (s === " ") {
5779
+ for (let i of a) if (i === " ") {
5394
5780
  let r = 4 - t % 4;
5395
5781
  n += " ".repeat(r), t += r;
5396
- } else n += s, t++;
5782
+ } else n += i, t++;
5397
5783
  return n;
5398
5784
  }
5399
- function Oe(l, e, t, n, s) {
5400
- let r = e.href, o = e.title || null, i = l[1].replace(s.other.outputLinkReplace, "$1"), u = l[0].charAt(0) === "!";
5401
- n.state.inLink = !0;
5402
- let a = n.state.linkEmitted, p = n.state.inRawBlock;
5403
- n.state.linkEmitted = !1;
5404
- let c = n.inlineTokens(i), d = n.state.linkEmitted;
5405
- if (n.state.linkEmitted = a, n.state.inLink = !1, !u) {
5406
- if (d) {
5785
+ function Se(a, e, t, n, i) {
5786
+ let r = e.href, o = e.title || null, s = a[1].replace(i.other.outputLinkReplace, "$1"), l = a[0].charAt(0) === "!", u = n.state.inLink, c = n.state.linkEmitted, p = n.state.inRawBlock;
5787
+ n.state.inLink = !0, n.state.linkEmitted = !1;
5788
+ let d = n.inlineTokens(s), g = n.state.linkEmitted;
5789
+ if (n.state.linkEmitted = c, n.state.inLink = u, !l) {
5790
+ if (g) {
5407
5791
  n.state.inRawBlock = p;
5408
5792
  return;
5409
5793
  }
5410
5794
  n.state.linkEmitted = !0;
5411
5795
  }
5412
5796
  return {
5413
- type: u ? "image" : "link",
5797
+ type: l ? "image" : "link",
5414
5798
  raw: t,
5415
5799
  href: r,
5416
5800
  title: o,
5417
- text: i,
5418
- tokens: c
5801
+ text: s,
5802
+ tokens: d
5419
5803
  };
5420
5804
  }
5421
- function yt(l, e, t) {
5422
- let n = l.match(t.other.indentCodeCompensation);
5805
+ function Lt(a, e, t) {
5806
+ let n = a.match(t.other.indentCodeCompensation);
5423
5807
  if (n === null) return e;
5424
- let s = n[1];
5808
+ let i = n[1];
5425
5809
  return e.split(`
5426
5810
  `).map((r) => {
5427
5811
  let o = r.match(t.other.beginningSpace);
5428
5812
  if (o === null) return r;
5429
- let [i] = o;
5430
- return r.slice(Math.min(i.length, s.length));
5813
+ let [s] = o;
5814
+ return r.slice(Math.min(s.length, i.length));
5431
5815
  }).join(`
5432
5816
  `);
5433
5817
  }
5434
- function we(l, e, t, n) {
5818
+ function _e(a, e, t, n) {
5435
5819
  if (!e.includes("<")) return !1;
5436
- for (let s = 0; s < e.length; s++) {
5437
- if (e[s] === "\\") {
5438
- s++;
5820
+ for (let i = 0; i < e.length; i++) {
5821
+ if (e[i] === "\\") {
5822
+ i++;
5439
5823
  continue;
5440
5824
  }
5441
- if (e[s] === "`") {
5442
- let i = n.inline.code.exec(e.slice(s));
5443
- if (i) {
5444
- s += i[0].length - 1;
5825
+ if (e[i] === "`") {
5826
+ let s = n.inline.code.exec(e.slice(i));
5827
+ if (s) {
5828
+ i += s[0].length - 1;
5445
5829
  continue;
5446
5830
  }
5447
5831
  }
5448
- if (e[s] !== "<") continue;
5449
- let r = l.slice(t + s), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
5832
+ if (e[i] !== "<") continue;
5833
+ let r = a.slice(t + i), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
5450
5834
  if (o) {
5451
- if (o[0].length > e.length - s) return !0;
5452
- s += o[0].length - 1;
5835
+ if (o[0].length > e.length - i) return !0;
5836
+ i += o[0].length - 1;
5453
5837
  }
5454
5838
  }
5455
5839
  return !1;
5456
5840
  }
5457
- var P = class {
5841
+ var _ = class {
5458
5842
  options;
5459
5843
  rules;
5460
5844
  lexer;
@@ -5471,7 +5855,7 @@ window.__ModuleLoader__.load({
5471
5855
  code(e) {
5472
5856
  let t = this.rules.block.code.exec(e);
5473
5857
  if (t) {
5474
- let n = this.options.pedantic ? t[0] : ie(t[0]);
5858
+ let n = this.options.pedantic ? t[0] : ae(t[0]);
5475
5859
  return {
5476
5860
  type: "code",
5477
5861
  raw: n,
@@ -5483,12 +5867,12 @@ window.__ModuleLoader__.load({
5483
5867
  fences(e) {
5484
5868
  let t = this.rules.block.fences.exec(e);
5485
5869
  if (t) {
5486
- let n = t[0], s = yt(n, t[3] || "", this.rules);
5870
+ let n = t[0], i = Lt(n, t[3] || "", this.rules);
5487
5871
  return {
5488
5872
  type: "code",
5489
5873
  raw: n,
5490
5874
  lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
5491
- text: s
5875
+ text: i
5492
5876
  };
5493
5877
  }
5494
5878
  }
@@ -5497,12 +5881,12 @@ window.__ModuleLoader__.load({
5497
5881
  if (t) {
5498
5882
  let n = t[2].trim();
5499
5883
  if (this.rules.other.endingHash.test(n)) {
5500
- let s = L(n, "#");
5501
- (this.options.pedantic || !s || this.rules.other.endingSpaceTabChar.test(s)) && (n = s.trim());
5884
+ let i = A(n, "#");
5885
+ (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
5502
5886
  }
5503
5887
  return {
5504
5888
  type: "heading",
5505
- raw: L(t[0], `
5889
+ raw: A(t[0], `
5506
5890
  `),
5507
5891
  depth: t[1].length,
5508
5892
  text: n,
@@ -5514,55 +5898,55 @@ window.__ModuleLoader__.load({
5514
5898
  let t = this.rules.block.hr.exec(e);
5515
5899
  if (t) return {
5516
5900
  type: "hr",
5517
- raw: L(t[0], `
5901
+ raw: A(t[0], `
5518
5902
  `)
5519
5903
  };
5520
5904
  }
5521
5905
  blockquote(e) {
5522
5906
  let t = this.rules.block.blockquote.exec(e);
5523
5907
  if (t) {
5524
- let n = L(t[0], `
5908
+ let n = A(t[0], `
5525
5909
  `).split(`
5526
- `), s = "", r = "", o = [];
5910
+ `), i = "", r = "", o = [];
5527
5911
  for (; n.length > 0;) {
5528
- let i = !1, u = [], a;
5529
- for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), i = !0;
5530
- else if (!i) u.push(n[a]);
5912
+ let s = !1, l = [], u;
5913
+ for (u = 0; u < n.length; u++) if (this.rules.other.blockquoteStart.test(n[u])) l.push(n[u]), s = !0;
5914
+ else if (!s) l.push(n[u]);
5531
5915
  else break;
5532
- n = n.slice(a);
5533
- let p = u.join(`
5534
- `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
5916
+ n = n.slice(u);
5917
+ let c = l.join(`
5918
+ `), p = c.replace(this.rules.other.blockquoteSetextReplace, `
5535
5919
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
5536
- s = s ? `${s}
5537
- ${p}` : p, r = r ? `${r}
5538
- ${c}` : c;
5920
+ i = i ? `${i}
5921
+ ${c}` : c, r = r ? `${r}
5922
+ ${p}` : p;
5539
5923
  let d = this.lexer.state.top;
5540
- if (this.lexer.state.top = !0, this.lexer.blockTokens(c, o, !0), this.lexer.state.top = d, n.length === 0) break;
5541
- let m = o.at(-1);
5542
- if (m?.type === "code") break;
5543
- if (m?.type === "blockquote") {
5544
- let b = m, g = n.join(`
5545
- `), w = b.raw + `
5546
- ` + g.replace(this.rules.other.blockquoteSetextReplace2, ""), f = this.blockquote(w);
5547
- o[o.length - 1] = f;
5548
- let M = w.substring(f.raw.length).replace(/^\n/, ""), v = M ? M.split(`
5549
- `).length : 0, Z = v ? n.slice(0, -v) : n;
5550
- Z.length > 0 && (s = `${s}
5551
- ${Z.join(`
5552
- `)}`), r = r.substring(0, r.length - b.text.length) + f.text;
5924
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(p, o, !0), this.lexer.state.top = d, n.length === 0) break;
5925
+ let g = o.at(-1);
5926
+ if (g?.type === "code" || g?.type === "heading" || g?.type === "hr" || g?.type === "html") break;
5927
+ if (g?.type === "blockquote") {
5928
+ let k = g, P = n.join(`
5929
+ `), R = k.raw + `
5930
+ ` + P.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(R);
5931
+ o[o.length - 1] = m;
5932
+ let E = R.substring(m.raw.length).replace(/^\n/, ""), b = E ? E.split(`
5933
+ `).length : 0, H = b ? n.slice(0, -b) : n;
5934
+ H.length > 0 && (i = `${i}
5935
+ ${H.join(`
5936
+ `)}`), r = r.substring(0, r.length - k.text.length) + m.text;
5553
5937
  break;
5554
- } else if (m?.type === "list") {
5555
- let b = m, g = b.raw + `
5938
+ } else if (g?.type === "list") {
5939
+ let k = g, P = k.raw + `
5556
5940
  ` + n.join(`
5557
- `), w = this.list(g);
5558
- o[o.length - 1] = w, s = s.substring(0, s.length - m.raw.length) + w.raw, r = r.substring(0, r.length - b.raw.length) + w.raw, n = g.substring(o.at(-1).raw.length).split(`
5941
+ `), R = this.list(P);
5942
+ o[o.length - 1] = R, i = i.substring(0, i.length - g.raw.length) + R.raw, r = r.substring(0, r.length - k.raw.length) + R.raw, n = P.substring(o.at(-1).raw.length).split(`
5559
5943
  `);
5560
5944
  continue;
5561
5945
  }
5562
5946
  }
5563
5947
  return {
5564
5948
  type: "blockquote",
5565
- raw: s,
5949
+ raw: i,
5566
5950
  tokens: o,
5567
5951
  text: r
5568
5952
  };
@@ -5571,93 +5955,93 @@ ${Z.join(`
5571
5955
  list(e) {
5572
5956
  let t = this.rules.block.list.exec(e);
5573
5957
  if (t) {
5574
- let n = t[1].trim(), s = n.length > 1, r = {
5958
+ let n = e, i = () => n.length - e.length, r = t[1].trim(), o = r.length > 1, s = {
5575
5959
  type: "list",
5576
5960
  raw: "",
5577
- ordered: s,
5578
- start: s ? +n.slice(0, -1) : "",
5961
+ ordered: o,
5962
+ start: o ? +r.slice(0, -1) : "",
5579
5963
  loose: !1,
5580
5964
  items: []
5581
5965
  };
5582
- n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
5583
- let o = this.rules.other.listItemRegex(n), i = !1;
5966
+ r = o ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = o ? r : "[*+-]");
5967
+ let l = this.rules.other.listItemRegex(r), u = !1;
5584
5968
  for (; e;) {
5585
- let a = !1, p = "", c = "";
5586
- if (!(t = o.exec(e)) || this.rules.block.hr.test(e)) break;
5587
- p = t[0], e = e.substring(p.length);
5588
- let d = t[2].split(`
5589
- `, 1)[0], m = t[1].length, b = this.options.pedantic ? oe(d, m) : d.replace(this.rules.other.leadingSpaceTab, (M) => oe(M, m)), g = e.split(`
5590
- `, 1)[0], w = !b.trim(), f = 0;
5591
- if (this.options.pedantic ? (f = 2, c = b.trimStart()) : w ? f = m + 1 : (f = b.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = b.slice(f), f += m), w && this.rules.other.blankLine.test(g) && (p += g + `
5592
- `, e = e.substring(g.length + 1), a = !0), !a) {
5593
- let M = this.rules.other.nextBulletRegex(f), v = this.rules.other.hrRegex(f), Z = this.rules.other.fencesBeginRegex(f), ae = this.rules.other.headingBeginRegex(f), ye = this.rules.other.htmlBeginRegex(f), Pe = this.rules.other.blockquoteBeginRegex(f);
5969
+ let p = !1, d = "";
5970
+ if (!(t = l.exec(e)) || this.rules.block.hr.test(e)) break;
5971
+ let g = i();
5972
+ e = e.substring(t[0].length);
5973
+ let k = t[2].split(`
5974
+ `, 1)[0], P = t[1].length, R = this.options.pedantic ? X(k, P) : k.replace(this.rules.other.leadingSpaceTab, (W) => X(W, P)), m = e.split(`
5975
+ `, 1)[0], E = !R.trim(), b = 0;
5976
+ if (this.options.pedantic ? (b = 2, d = R.trimStart()) : E ? b = P + 1 : (b = R.search(this.rules.other.nonSpaceChar), b = b > 4 ? 1 : b, d = R.slice(b), b += P), E && this.rules.other.blankLine.test(m) && (e = e.substring(m.length + 1), p = !0), !p) {
5977
+ let W = this.rules.other.nextBulletRegex(b), ue = this.rules.other.hrRegex(b), pe = this.rules.other.fencesBeginRegex(b), ce = this.rules.other.headingBeginRegex(b), $e = this.rules.other.htmlBeginRegex(b), Le = this.rules.other.blockquoteBeginRegex(b);
5594
5978
  for (; e;) {
5595
- let K = e.split(`
5596
- `, 1)[0], H;
5597
- if (g = K, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), H = g) : H = g.replace(this.rules.other.leadingSpaceTab, (Se) => Se.replace(this.rules.other.tabCharGlobal, " ")), Z.test(g) || ae.test(g) || ye.test(g) || Pe.test(g) || M.test(g) || v.test(g)) break;
5598
- if (H.search(this.rules.other.nonSpaceChar) >= f || !g.trim()) c += `
5599
- ` + H.slice(f);
5979
+ let he = e.split(`
5980
+ `, 1)[0], G;
5981
+ if (m = he, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), G = m) : G = m.replace(this.rules.other.leadingSpaceTab, (Ae) => X(Ae)), pe.test(m) || ce.test(m) || $e.test(m) || Le.test(m) || W.test(m) || ue.test(m)) break;
5982
+ if (G.search(this.rules.other.nonSpaceChar) >= b || !m.trim()) d += `
5983
+ ` + G.slice(b);
5600
5984
  else {
5601
- if (w || b.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Z.test(b) || ae.test(b) || v.test(b)) break;
5602
- c += `
5603
- ` + g;
5985
+ if (E || R.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || pe.test(R) || ce.test(R) || ue.test(R)) break;
5986
+ d += `
5987
+ ` + m;
5604
5988
  }
5605
- w = !g.trim(), p += K + `
5606
- `, e = e.substring(K.length + 1), b = H.slice(f);
5989
+ E = !m.trim(), e = e.substring(he.length + 1), R = G.slice(b);
5607
5990
  }
5608
5991
  }
5609
- r.loose || (i ? r.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (i = !0)), r.items.push({
5992
+ let H = n.slice(g, i());
5993
+ s.loose || (u ? s.loose = !0 : this.rules.other.doubleBlankLine.test(H) && (u = !0)), s.items.push({
5610
5994
  type: "list_item",
5611
- raw: p,
5612
- task: !!this.options.gfm && this.rules.other.listIsTask.test(c),
5995
+ raw: H,
5996
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(d),
5613
5997
  loose: !1,
5614
- text: c,
5998
+ text: d,
5615
5999
  tokens: []
5616
- }), r.raw += p;
6000
+ });
5617
6001
  }
5618
- let u = r.items.at(-1);
5619
- if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
6002
+ let c = s.items.at(-1);
6003
+ if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
5620
6004
  else return;
5621
- r.raw = r.raw.trimEnd();
5622
- for (let a of r.items) if (this.lexer.state.top = !1, a.tokens = this.lexer.blockTokens(a.text, []), !r.loose) {
5623
- let p = a.tokens.filter((d) => d.type === "space");
5624
- r.loose = p.length > 0 && p.some((d) => this.rules.other.anyLine.test(d.raw));
6005
+ s.raw = n.slice(0, i()).trimEnd();
6006
+ for (let p of s.items) if (this.lexer.state.top = !1, p.tokens = this.lexer.blockTokens(p.text, []), !s.loose) {
6007
+ let d = p.tokens.filter((k) => k.type === "space");
6008
+ s.loose = d.length > 0 && d.some((k) => this.rules.other.anyLine.test(k.raw));
5625
6009
  }
5626
- for (let a of r.items) {
5627
- let p = a.tokens[0];
5628
- if (a.task && (p?.type === "text" || p?.type === "paragraph")) {
5629
- a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p.raw = p.raw.replace(this.rules.other.listReplaceTask, ""), p.text = p.text.replace(this.rules.other.listReplaceTask, "");
5630
- for (let d = this.lexer.inlineQueue.length - 1; d >= 0; d--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)) {
5631
- this.lexer.inlineQueue[d].src = this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask, "");
6010
+ for (let p of s.items) {
6011
+ let d = p.tokens[0];
6012
+ if (p.task && (d?.type === "text" || d?.type === "paragraph")) {
6013
+ p.text = p.text.replace(this.rules.other.listReplaceTask, ""), d.raw = d.raw.replace(this.rules.other.listReplaceTask, ""), d.text = d.text.replace(this.rules.other.listReplaceTask, "");
6014
+ for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
6015
+ this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
5632
6016
  break;
5633
6017
  }
5634
- let c = this.rules.other.listTaskCheckbox.exec(a.raw);
5635
- if (c) {
5636
- let d = {
6018
+ let g = this.rules.other.listTaskCheckbox.exec(p.raw);
6019
+ if (g) {
6020
+ let k = {
5637
6021
  type: "checkbox",
5638
- raw: c[0] + " ",
5639
- checked: c[0] !== "[ ]"
6022
+ raw: g[0] + " ",
6023
+ checked: g[0] !== "[ ]"
5640
6024
  };
5641
- a.checked = d.checked, r.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = d.raw + a.tokens[0].raw, a.tokens[0].text = d.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(d)) : a.tokens.unshift({
6025
+ p.checked = k.checked, s.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = k.raw + p.tokens[0].raw, p.tokens[0].text = k.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(k)) : p.tokens.unshift({
5642
6026
  type: "paragraph",
5643
- raw: d.raw,
5644
- text: d.raw,
5645
- tokens: [d]
5646
- }) : a.tokens.unshift(d);
6027
+ raw: k.raw,
6028
+ text: k.raw,
6029
+ tokens: [k]
6030
+ }) : p.tokens.unshift(k);
5647
6031
  }
5648
- } else a.task && (a.task = !1);
6032
+ } else p.task && (p.task = !1);
5649
6033
  }
5650
- if (r.loose) for (let a of r.items) {
5651
- a.loose = !0;
5652
- for (let p of a.tokens) p.type === "text" && (p.type = "paragraph");
6034
+ if (s.loose) for (let p of s.items) {
6035
+ p.loose = !0;
6036
+ for (let d of p.tokens) d.type === "text" && (d.type = "paragraph");
5653
6037
  }
5654
- return r;
6038
+ return s;
5655
6039
  }
5656
6040
  }
5657
6041
  html(e) {
5658
6042
  let t = this.rules.block.html.exec(e);
5659
6043
  if (t) {
5660
- let n = ie(t[0]);
6044
+ let n = ae(t[0]);
5661
6045
  return {
5662
6046
  type: "html",
5663
6047
  block: !0,
@@ -5670,13 +6054,14 @@ ${Z.join(`
5670
6054
  def(e) {
5671
6055
  let t = this.rules.block.def.exec(e);
5672
6056
  if (t) {
5673
- let n = q(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
6057
+ if (!this.rules.other.startAngleBracket.test(t[2]) && le(t[2], "()") !== -1) return;
6058
+ let n = v(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
5674
6059
  return {
5675
6060
  type: "def",
5676
6061
  tag: n,
5677
- raw: L(t[0], `
6062
+ raw: A(t[0], `
5678
6063
  `),
5679
- href: s,
6064
+ href: i,
5680
6065
  title: r
5681
6066
  };
5682
6067
  }
@@ -5684,28 +6069,28 @@ ${Z.join(`
5684
6069
  table(e) {
5685
6070
  let t = this.rules.block.table.exec(e);
5686
6071
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
5687
- let n = se(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
6072
+ let n = oe(t[1]), i = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
5688
6073
  `) : [], o = {
5689
6074
  type: "table",
5690
- raw: L(t[0], `
6075
+ raw: A(t[0], `
5691
6076
  `),
5692
6077
  header: [],
5693
6078
  align: [],
5694
6079
  rows: []
5695
6080
  };
5696
- if (n.length === s.length) {
5697
- for (let i of s) this.rules.other.tableAlignRight.test(i) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? o.align.push("left") : o.align.push(null);
5698
- for (let i = 0; i < n.length; i++) o.header.push({
5699
- text: n[i],
5700
- tokens: this.lexer.inline(n[i]),
6081
+ if (n.length === i.length) {
6082
+ for (let s of i) this.rules.other.tableAlignRight.test(s) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o.align.push("left") : o.align.push(null);
6083
+ for (let s = 0; s < n.length; s++) o.header.push({
6084
+ text: n[s],
6085
+ tokens: this.lexer.inline(n[s]),
5701
6086
  header: !0,
5702
- align: o.align[i]
6087
+ align: o.align[s]
5703
6088
  });
5704
- for (let i of r) o.rows.push(se(i, o.header.length).map((u, a) => ({
5705
- text: u,
5706
- tokens: this.lexer.inline(u),
6089
+ for (let s of r) o.rows.push(oe(s, o.header.length).map((l, u) => ({
6090
+ text: l,
6091
+ tokens: this.lexer.inline(l),
5707
6092
  header: !1,
5708
- align: o.align[a]
6093
+ align: o.align[u]
5709
6094
  })));
5710
6095
  return o;
5711
6096
  }
@@ -5716,7 +6101,7 @@ ${Z.join(`
5716
6101
  let n = t[1].trim();
5717
6102
  return {
5718
6103
  type: "heading",
5719
- raw: L(t[0], `
6104
+ raw: A(t[0], `
5720
6105
  `),
5721
6106
  depth: t[2].charAt(0) === "=" ? 1 : 2,
5722
6107
  text: n,
@@ -5766,29 +6151,30 @@ ${Z.join(`
5766
6151
  };
5767
6152
  }
5768
6153
  link(e) {
6154
+ if (this.lexer.state.linkParenPossible === !1) return;
5769
6155
  let t = this.rules.inline.link.exec(e);
5770
6156
  if (t) {
5771
6157
  let n = t[0].charAt(0) === "!" ? 2 : 1;
5772
- if (!this.options.pedantic && we(e, t[1], n, this.rules)) return;
5773
- let s = t[2].trim();
5774
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(s)) {
5775
- if (!this.rules.other.endAngleBracket.test(s)) return;
5776
- let i = L(s.slice(0, -1), "\\");
5777
- if ((s.length - i.length) % 2 === 0) return;
6158
+ if (!this.options.pedantic && _e(e, t[1], n, this.rules)) return;
6159
+ let i = t[2].trim();
6160
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
6161
+ if (!this.rules.other.endAngleBracket.test(i)) return;
6162
+ let s = A(i.slice(0, -1), "\\");
6163
+ if ((i.length - s.length) % 2 === 0) return;
5778
6164
  } else {
5779
- let i = Te(t[2], "()");
5780
- if (i === -2) return;
5781
- if (i > -1) {
5782
- let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
5783
- t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, a).trim(), t[3] = "";
6165
+ let s = le(t[2], "()");
6166
+ if (s === -2) return;
6167
+ if (s > -1) {
6168
+ let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
6169
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, u).trim(), t[3] = "";
5784
6170
  }
5785
6171
  }
5786
6172
  let r = t[2], o = "";
5787
6173
  if (this.options.pedantic) {
5788
- let i = this.rules.other.pedanticHrefTitle.exec(r);
5789
- i && (r = i[1], o = i[3]);
6174
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
6175
+ s && (r = s[1], o = s[3]);
5790
6176
  } else o = t[3] ? t[3].slice(1, -1) : "";
5791
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(s) ? r = r.slice(1) : r = r.slice(1, -1)), Oe(t, {
6177
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r = r.slice(1) : r = r.slice(1, -1)), Se(t, {
5792
6178
  href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
5793
6179
  title: o && o.replace(this.rules.inline.anyPunctuation, "$1")
5794
6180
  }, t[0], this.lexer, this.rules);
@@ -5797,55 +6183,55 @@ ${Z.join(`
5797
6183
  reflink(e, t) {
5798
6184
  let n;
5799
6185
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
5800
- let s = n[0].charAt(0) === "!" ? 2 : 1;
5801
- if (!this.options.pedantic && we(e, n[1], s, this.rules)) return;
5802
- let o = t[q((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
6186
+ let i = n[0].charAt(0) === "!" ? 2 : 1;
6187
+ if (!this.options.pedantic && _e(e, n[1], i, this.rules)) return;
6188
+ let o = t[v((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
5803
6189
  if (!o) {
5804
- let i = n[0].charAt(0);
6190
+ let s = n[0].charAt(0);
5805
6191
  return {
5806
6192
  type: "text",
5807
- raw: i,
5808
- text: i
6193
+ raw: s,
6194
+ text: s
5809
6195
  };
5810
6196
  }
5811
- return Oe(n, o, n[0], this.lexer, this.rules);
6197
+ return Se(n, o, n[0], this.lexer, this.rules);
5812
6198
  }
5813
6199
  }
5814
6200
  emStrong(e, t, n = "") {
5815
- let s = this.rules.inline.emStrongLDelim.exec(e);
5816
- if (!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
5817
- if (!(s[1] || s[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
5818
- let o = [...s[0]].length - 1, i, u, a = o, p = 0, c = s[0][0], d = n === c, m = c === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
5819
- for (m.lastIndex = 0, t = t.slice(-1 * e.length + o); (s = m.exec(t)) !== null;) {
5820
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
5821
- if (u = [...i].length, s[3] || s[4]) {
5822
- a += u;
6201
+ let i = this.rules.inline.emStrongLDelim.exec(e);
6202
+ if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
6203
+ if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
6204
+ let o = [...i[0]].length - 1, s, l, u = o, c = 0, p = i[0][0], d = n === p, g = p === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
6205
+ for (g.lastIndex = 0, t = t.slice(-1 * e.length + o); (i = g.exec(t)) !== null;) {
6206
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue;
6207
+ if (l = [...s].length, i[3] || i[4]) {
6208
+ u += l;
5823
6209
  continue;
5824
- } else if (s[5] || s[6]) {
5825
- if (o % 3 && !((o + u) % 3)) {
5826
- p += u;
6210
+ } else if (i[5] || i[6]) {
6211
+ if (o % 3 && !((o + l) % 3)) {
6212
+ c += l;
5827
6213
  continue;
5828
6214
  }
5829
6215
  if (d) break;
5830
6216
  }
5831
- if (a -= u, a > 0) continue;
5832
- u = Math.min(u, u + a + p);
5833
- let b = [...s[0]][0].length, g = e.slice(0, o + s.index + b + u);
5834
- if (Math.min(o, u) % 2) {
5835
- let f = g.slice(1, -1);
6217
+ if (u -= l, u > 0) continue;
6218
+ l = Math.min(l, l + u + c);
6219
+ let k = [...i[0]][0].length, P = e.slice(0, o + i.index + k + l);
6220
+ if (Math.min(o, l) % 2) {
6221
+ let m = P.slice(1, -1);
5836
6222
  return {
5837
6223
  type: "em",
5838
- raw: g,
5839
- text: f,
5840
- tokens: this.lexer.inlineTokens(f)
6224
+ raw: P,
6225
+ text: m,
6226
+ tokens: this.lexer.inlineTokens(m)
5841
6227
  };
5842
6228
  }
5843
- let w = g.slice(2, -2);
6229
+ let R = P.slice(2, -2);
5844
6230
  return {
5845
6231
  type: "strong",
5846
- raw: g,
5847
- text: w,
5848
- tokens: this.lexer.inlineTokens(w)
6232
+ raw: P,
6233
+ text: R,
6234
+ tokens: this.lexer.inlineTokens(R)
5849
6235
  };
5850
6236
  }
5851
6237
  }
@@ -5853,8 +6239,8 @@ ${Z.join(`
5853
6239
  codespan(e) {
5854
6240
  let t = this.rules.inline.code.exec(e);
5855
6241
  if (t) {
5856
- let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
5857
- return s && r && (n = n.substring(1, n.length - 1)), {
6242
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
6243
+ return i && r && (n = n.substring(1, n.length - 1)), {
5858
6244
  type: "codespan",
5859
6245
  raw: t[0],
5860
6246
  text: n
@@ -5869,24 +6255,24 @@ ${Z.join(`
5869
6255
  };
5870
6256
  }
5871
6257
  del(e, t, n = "") {
5872
- let s = this.rules.inline.delLDelim.exec(e);
5873
- if (!s) return;
5874
- if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
5875
- let o = [...s[0]].length - 1, i, u, a = o, p = this.rules.inline.delRDelim;
5876
- for (p.lastIndex = 0, t = t.slice(-1 * e.length + o); (s = p.exec(t)) !== null;) {
5877
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (u = [...i].length, u !== o)) continue;
5878
- if (s[3] || s[4]) {
5879
- a += u;
6258
+ let i = this.rules.inline.delLDelim.exec(e);
6259
+ if (!i) return;
6260
+ if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
6261
+ let o = [...i[0]].length - 1, s, l, u = o, c = this.rules.inline.delRDelim;
6262
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + o); (i = c.exec(t)) !== null;) {
6263
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (l = [...s].length, l !== o)) continue;
6264
+ if (i[3] || i[4]) {
6265
+ u += l;
5880
6266
  continue;
5881
6267
  }
5882
- if (a -= u, a > 0) continue;
5883
- u = Math.min(u, u + a);
5884
- let c = [...s[0]][0].length, d = e.slice(0, o + s.index + c + u), m = d.slice(o, -o);
6268
+ if (u -= l, u > 0) continue;
6269
+ l = Math.min(l, l + u);
6270
+ let p = [...i[0]][0].length, d = e.slice(0, o + i.index + p + l), g = d.slice(o, -o);
5885
6271
  return {
5886
6272
  type: "del",
5887
6273
  raw: d,
5888
- text: m,
5889
- tokens: this.lexer.inlineTokens(m)
6274
+ text: g,
6275
+ tokens: this.lexer.inlineTokens(g)
5890
6276
  };
5891
6277
  }
5892
6278
  }
@@ -5894,12 +6280,12 @@ ${Z.join(`
5894
6280
  autolink(e) {
5895
6281
  let t = this.rules.inline.autolink.exec(e);
5896
6282
  if (t) {
5897
- let n, s;
5898
- return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), {
6283
+ let n, i;
6284
+ return t[2] === "@" ? (n = t[1], i = "mailto:" + n) : (n = t[1], i = n), {
5899
6285
  type: "link",
5900
6286
  raw: t[0],
5901
6287
  text: n,
5902
- href: s,
6288
+ href: i,
5903
6289
  autolink: !0,
5904
6290
  tokens: [{
5905
6291
  type: "text",
@@ -5912,20 +6298,20 @@ ${Z.join(`
5912
6298
  url(e) {
5913
6299
  let t;
5914
6300
  if (t = this.rules.inline.url.exec(e)) {
5915
- let n, s;
5916
- if (t[2] === "@") n = t[0], s = "mailto:" + n;
6301
+ let n, i;
6302
+ if (t[2] === "@") n = t[0], i = "mailto:" + n;
5917
6303
  else {
5918
6304
  let r;
5919
6305
  do
5920
6306
  r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
5921
6307
  while (r !== t[0]);
5922
- n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
6308
+ n = t[0], t[1] === "www." ? i = "http://" + t[0] : i = t[0];
5923
6309
  }
5924
6310
  return {
5925
6311
  type: "link",
5926
6312
  raw: t[0],
5927
6313
  text: n,
5928
- href: s,
6314
+ href: i,
5929
6315
  autolink: !0,
5930
6316
  tokens: [{
5931
6317
  type: "text",
@@ -5942,43 +6328,44 @@ ${Z.join(`
5942
6328
  return {
5943
6329
  type: "text",
5944
6330
  raw: t[0],
5945
- text: n ? t[0] : Re(t[0]),
6331
+ text: n ? t[0] : ye(t[0]),
5946
6332
  escaped: n
5947
6333
  };
5948
6334
  }
5949
6335
  }
5950
6336
  };
5951
- var R = class l {
6337
+ var T = class a {
5952
6338
  tokens;
5953
6339
  options;
5954
6340
  state;
5955
6341
  inlineQueue;
5956
6342
  tokenizer;
5957
6343
  constructor(e) {
5958
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
6344
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new _(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
5959
6345
  inLink: !1,
5960
6346
  inRawBlock: !1,
5961
6347
  linkEmitted: !1,
6348
+ linkParenPossible: !0,
5962
6349
  top: !0
5963
6350
  };
5964
6351
  let t = {
5965
6352
  other: x,
5966
- block: j.normal,
5967
- inline: D.normal
6353
+ block: F.normal,
6354
+ inline: Z.normal
5968
6355
  };
5969
- this.options.pedantic ? (t.block = j.pedantic, t.inline = D.pedantic) : this.options.gfm && (t.block = j.gfm, this.options.breaks ? t.inline = D.breaks : t.inline = D.gfm), this.tokenizer.rules = t;
6356
+ this.options.pedantic ? (t.block = F.pedantic, t.inline = Z.pedantic) : this.options.gfm && (t.block = F.gfm, this.options.breaks ? t.inline = Z.breaks : t.inline = Z.gfm), this.tokenizer.rules = t;
5970
6357
  }
5971
6358
  static get rules() {
5972
6359
  return {
5973
- block: j,
5974
- inline: D
6360
+ block: F,
6361
+ inline: Z
5975
6362
  };
5976
6363
  }
5977
6364
  static lex(e, t) {
5978
- return new l(t).lex(e);
6365
+ return new a(t).lex(e);
5979
6366
  }
5980
6367
  static lexInline(e, t) {
5981
- return new l(t).inlineTokens(e);
6368
+ return new a(t).inlineTokens(e);
5982
6369
  }
5983
6370
  lex(e) {
5984
6371
  e = e.replace(x.carriageReturn, `
@@ -5991,29 +6378,29 @@ ${Z.join(`
5991
6378
  }
5992
6379
  blockTokens(e, t = [], n = !1) {
5993
6380
  this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
5994
- let s = Infinity;
6381
+ let i = Infinity;
5995
6382
  for (; e;) {
5996
- if (e.length < s) s = e.length;
6383
+ if (e.length < i) i = e.length;
5997
6384
  else {
5998
6385
  this.infiniteLoopError(e.charCodeAt(0));
5999
6386
  break;
6000
6387
  }
6001
6388
  let r;
6002
- if (this.options.extensions?.block?.some((i) => (r = i.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
6389
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
6003
6390
  if (r = this.tokenizer.space(e)) {
6004
6391
  e = e.substring(r.raw.length);
6005
- let i = t.at(-1);
6006
- r.raw.length === 1 && i !== void 0 ? i.raw += `
6392
+ let s = t.at(-1);
6393
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
6007
6394
  ` : t.push(r);
6008
6395
  continue;
6009
6396
  }
6010
6397
  if (r = this.tokenizer.code(e)) {
6011
6398
  e = e.substring(r.raw.length);
6012
- let i = t.at(-1);
6013
- i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
6399
+ let s = t.at(-1);
6400
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
6014
6401
  `) ? "" : `
6015
- `) + r.raw, i.text += `
6016
- ` + r.text, this.inlineQueue.at(-1).src = i.text) : t.push(r);
6402
+ `) + r.raw, s.text += `
6403
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
6017
6404
  continue;
6018
6405
  }
6019
6406
  if (r = this.tokenizer.fences(e)) {
@@ -6042,11 +6429,11 @@ ${Z.join(`
6042
6429
  }
6043
6430
  if (r = this.tokenizer.def(e)) {
6044
6431
  e = e.substring(r.raw.length);
6045
- let i = t.at(-1);
6046
- i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
6432
+ let s = t.at(-1);
6433
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
6047
6434
  `) ? "" : `
6048
- `) + r.raw, i.text += `
6049
- ` + r.raw, this.inlineQueue.at(-1).src = i.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
6435
+ `) + r.raw, s.text += `
6436
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
6050
6437
  href: r.href,
6051
6438
  title: r.title
6052
6439
  }, t.push(r));
@@ -6062,26 +6449,26 @@ ${Z.join(`
6062
6449
  }
6063
6450
  let o = e;
6064
6451
  if (this.options.extensions?.startBlock) {
6065
- let i = Infinity, u = e.slice(1), a;
6066
- this.options.extensions.startBlock.forEach((p) => {
6067
- a = p.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (i = Math.min(i, a));
6068
- }), i < Infinity && i >= 0 && (o = e.substring(0, i + 1));
6452
+ let s = Infinity, l = e.slice(1), u;
6453
+ this.options.extensions.startBlock.forEach((c) => {
6454
+ u = c.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (s = Math.min(s, u));
6455
+ }), s < Infinity && s >= 0 && (o = e.substring(0, s + 1));
6069
6456
  }
6070
6457
  if (this.state.top && (r = this.tokenizer.paragraph(o))) {
6071
- let i = t.at(-1);
6072
- n && i?.type === "paragraph" ? (i.raw += (i.raw.endsWith(`
6458
+ let s = t.at(-1);
6459
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
6073
6460
  `) ? "" : `
6074
- `) + r.raw, i.text += `
6075
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
6461
+ `) + r.raw, s.text += `
6462
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
6076
6463
  continue;
6077
6464
  }
6078
6465
  if (r = this.tokenizer.text(e)) {
6079
6466
  e = e.substring(r.raw.length);
6080
- let i = t.at(-1);
6081
- i?.type === "text" ? (i.raw += (i.raw.endsWith(`
6467
+ let s = t.at(-1);
6468
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
6082
6469
  `) ? "" : `
6083
- `) + r.raw, i.text += `
6084
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : t.push(r);
6470
+ `) + r.raw, s.text += `
6471
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
6085
6472
  continue;
6086
6473
  }
6087
6474
  if (e) {
@@ -6102,93 +6489,102 @@ ${Z.join(`
6102
6489
  let t = this.tokenizer.rules.inline.link;
6103
6490
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
6104
6491
  for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
6105
- let s = n[0], r = s.lastIndexOf("[");
6106
- if (!(s.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, q(s.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(s.slice(1, r - 1)))) return !0;
6492
+ let i = n[0], r = i.lastIndexOf("[");
6493
+ if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, v(i.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(i.slice(1, r - 1)))) return !0;
6107
6494
  }
6108
6495
  return !1;
6109
6496
  }
6110
6497
  inlineTokens(e, t = []) {
6111
6498
  this.tokenizer.lexer = this;
6499
+ let n = this.state.linkParenPossible;
6500
+ this.state.linkParenPossible = n && e.includes(")");
6501
+ try {
6502
+ return this.#e(e, t);
6503
+ } finally {
6504
+ this.state.linkParenPossible = n;
6505
+ }
6506
+ }
6507
+ #e(e, t) {
6112
6508
  let n = e;
6113
6509
  if (this.tokens.links && e.includes("[")) {
6114
- let i = this.tokenizer.rules.inline.reflinkSearch, u = (a) => {
6115
- let p = a.lastIndexOf("[");
6116
- if (!Object.hasOwn(this.tokens.links, q(a.slice(p + 1, -1)))) return a;
6117
- if (p > 1 && a.charAt(0) !== "!") {
6118
- let c = a.slice(1, p - 1);
6119
- if (this.linkInText(c)) return "[" + c.replace(i, u) + "][" + "a".repeat(a.length - p - 2) + "]";
6510
+ let s = this.tokenizer.rules.inline.reflinkSearch, l = (u) => {
6511
+ let c = u.lastIndexOf("[");
6512
+ if (!Object.hasOwn(this.tokens.links, v(u.slice(c + 1, -1)))) return u;
6513
+ if (c > 1 && u.charAt(0) !== "!") {
6514
+ let p = u.slice(1, c - 1);
6515
+ if (this.linkInText(p)) return "[" + p.replace(s, l) + "][" + "a".repeat(u.length - c - 2) + "]";
6120
6516
  }
6121
- return "[" + "a".repeat(a.length - 2) + "]";
6517
+ return "[" + "a".repeat(u.length - 2) + "]";
6122
6518
  };
6123
- n = n.replace(i, u);
6519
+ n = n.replace(s, l);
6124
6520
  }
6125
- n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (i) => "+".repeat(i.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (i, u, a) => {
6126
- let p = a ? a.length : 0;
6127
- return i.slice(0, p) + "[" + "a".repeat(i.length - p - 2) + "]";
6521
+ n = n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (s, l, u) => u ? "+".repeat(s.length) : l ? l + s.slice(l.length, -l.length).replace(/`/g, "+") + l : s), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, l, u) => {
6522
+ let c = u ? u.length : 0;
6523
+ return s.slice(0, c) + "[" + "a".repeat(s.length - c - 2) + "]";
6128
6524
  }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
6129
- let s = !1, r = "", o = Infinity;
6525
+ let i = !1, r = "", o = Infinity;
6130
6526
  for (; e;) {
6131
6527
  if (e.length < o) o = e.length;
6132
6528
  else {
6133
6529
  this.infiniteLoopError(e.charCodeAt(0));
6134
6530
  break;
6135
6531
  }
6136
- s || (r = ""), s = !1;
6137
- let i;
6138
- if (this.options.extensions?.inline?.some((a) => (i = a.call({ lexer: this }, e, t)) ? (e = e.substring(i.raw.length), t.push(i), !0) : !1)) continue;
6139
- if (i = this.tokenizer.escape(e)) {
6140
- e = e.substring(i.raw.length), t.push(i);
6532
+ i || (r = ""), i = !1;
6533
+ let s;
6534
+ if (this.options.extensions?.inline?.some((u) => (s = u.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), !0) : !1)) continue;
6535
+ if (s = this.tokenizer.escape(e)) {
6536
+ e = e.substring(s.raw.length), t.push(s);
6141
6537
  continue;
6142
6538
  }
6143
- if (i = this.tokenizer.tag(e)) {
6144
- e = e.substring(i.raw.length), t.push(i);
6539
+ if (s = this.tokenizer.tag(e)) {
6540
+ e = e.substring(s.raw.length), t.push(s);
6145
6541
  continue;
6146
6542
  }
6147
- if (i = this.tokenizer.link(e)) {
6148
- e = e.substring(i.raw.length), t.push(i);
6543
+ if (s = this.tokenizer.link(e)) {
6544
+ e = e.substring(s.raw.length), t.push(s);
6149
6545
  continue;
6150
6546
  }
6151
- if (i = this.tokenizer.reflink(e, this.tokens.links)) {
6152
- e = e.substring(i.raw.length);
6153
- let a = t.at(-1);
6154
- i.type === "text" && a?.type === "text" ? (a.raw += i.raw, a.text += i.text) : t.push(i);
6547
+ if (s = this.tokenizer.reflink(e, this.tokens.links)) {
6548
+ e = e.substring(s.raw.length);
6549
+ let u = t.at(-1);
6550
+ s.type === "text" && u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
6155
6551
  continue;
6156
6552
  }
6157
- if (i = this.tokenizer.emStrong(e, n, r)) {
6158
- e = e.substring(i.raw.length), t.push(i);
6553
+ if (s = this.tokenizer.emStrong(e, n, r)) {
6554
+ e = e.substring(s.raw.length), t.push(s);
6159
6555
  continue;
6160
6556
  }
6161
- if (i = this.tokenizer.codespan(e)) {
6162
- e = e.substring(i.raw.length), t.push(i);
6557
+ if (s = this.tokenizer.codespan(e)) {
6558
+ e = e.substring(s.raw.length), t.push(s);
6163
6559
  continue;
6164
6560
  }
6165
- if (i = this.tokenizer.br(e)) {
6166
- e = e.substring(i.raw.length), t.push(i);
6561
+ if (s = this.tokenizer.br(e)) {
6562
+ e = e.substring(s.raw.length), t.push(s);
6167
6563
  continue;
6168
6564
  }
6169
- if (i = this.tokenizer.del(e, n, r)) {
6170
- e = e.substring(i.raw.length), t.push(i);
6565
+ if (s = this.tokenizer.del(e, n, r)) {
6566
+ e = e.substring(s.raw.length), t.push(s);
6171
6567
  continue;
6172
6568
  }
6173
- if (i = this.tokenizer.autolink(e)) {
6174
- e = e.substring(i.raw.length), t.push(i);
6569
+ if (s = this.tokenizer.autolink(e)) {
6570
+ e = e.substring(s.raw.length), t.push(s);
6175
6571
  continue;
6176
6572
  }
6177
- if (!this.state.inLink && (i = this.tokenizer.url(e))) {
6178
- e = e.substring(i.raw.length), t.push(i);
6573
+ if (!this.state.inLink && (s = this.tokenizer.url(e))) {
6574
+ e = e.substring(s.raw.length), t.push(s);
6179
6575
  continue;
6180
6576
  }
6181
- let u = e;
6577
+ let l = e;
6182
6578
  if (this.options.extensions?.startInline) {
6183
- let a = Infinity, p = e.slice(1), c;
6579
+ let u = Infinity, c = e.slice(1), p;
6184
6580
  this.options.extensions.startInline.forEach((d) => {
6185
- c = d.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
6186
- }), a < Infinity && a >= 0 && (u = e.substring(0, a + 1));
6581
+ p = d.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (u = Math.min(u, p));
6582
+ }), u < Infinity && u >= 0 && (l = e.substring(0, u + 1));
6187
6583
  }
6188
- if (i = this.tokenizer.inlineText(u)) {
6189
- e = e.substring(i.raw.length), i.raw.slice(-1) !== "_" && (r = i.raw.slice(-1)), s = !0;
6190
- let a = t.at(-1);
6191
- a?.type === "text" ? (a.raw += i.raw, a.text += i.text) : t.push(i);
6584
+ if (s = this.tokenizer.inlineText(l)) {
6585
+ e = e.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r = s.raw.slice(-1)), i = !0;
6586
+ let u = t.at(-1);
6587
+ u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
6192
6588
  continue;
6193
6589
  }
6194
6590
  if (e) {
@@ -6204,7 +6600,7 @@ ${Z.join(`
6204
6600
  else throw new Error(t);
6205
6601
  }
6206
6602
  };
6207
- var S = class {
6603
+ var $ = class {
6208
6604
  options;
6209
6605
  parser;
6210
6606
  constructor(e) {
@@ -6214,10 +6610,10 @@ ${Z.join(`
6214
6610
  return "";
6215
6611
  }
6216
6612
  code({ text: e, lang: t, escaped: n }) {
6217
- let s = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
6613
+ let i = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
6218
6614
  ` : "";
6219
- return s ? "<pre><code class=\"language-" + O(s) + "\">" + (n ? r : O(r, !0)) + `</code></pre>
6220
- ` : "<pre><code>" + (n ? r : O(r, !0)) + `</code></pre>
6615
+ return i ? "<pre><code class=\"language-" + w(i) + "\">" + (n ? r : w(r, !0)) + `</code></pre>
6616
+ ` : "<pre><code>" + (n ? r : w(r, !0)) + `</code></pre>
6221
6617
  `;
6222
6618
  }
6223
6619
  blockquote({ tokens: e }) {
@@ -6240,14 +6636,14 @@ ${this.parser.parse(e)}</blockquote>
6240
6636
  `;
6241
6637
  }
6242
6638
  list(e) {
6243
- let t = e.ordered, n = e.start, s = "";
6244
- for (let i = 0; i < e.items.length; i++) {
6245
- let u = e.items[i];
6246
- s += this.listitem(u);
6639
+ let t = e.ordered, n = e.start, i = "";
6640
+ for (let s = 0; s < e.items.length; s++) {
6641
+ let l = e.items[s];
6642
+ i += this.listitem(l);
6247
6643
  }
6248
6644
  let r = t ? "ol" : "ul", o = t && n !== 1 ? " start=\"" + n + "\"" : "";
6249
6645
  return "<" + r + o + `>
6250
- ` + s + "</" + r + `>
6646
+ ` + i + "</" + r + `>
6251
6647
  `;
6252
6648
  }
6253
6649
  listitem(e) {
@@ -6265,17 +6661,17 @@ ${this.parser.parse(e)}</blockquote>
6265
6661
  let t = "", n = "";
6266
6662
  for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
6267
6663
  t += this.tablerow({ text: n });
6268
- let s = "";
6664
+ let i = "";
6269
6665
  for (let r = 0; r < e.rows.length; r++) {
6270
6666
  let o = e.rows[r];
6271
6667
  n = "";
6272
- for (let i = 0; i < o.length; i++) n += this.tablecell(o[i]);
6273
- s += this.tablerow({ text: n });
6668
+ for (let s = 0; s < o.length; s++) n += this.tablecell(o[s]);
6669
+ i += this.tablerow({ text: n });
6274
6670
  }
6275
- return s && (s = `<tbody>${s}</tbody>`), `<table>
6671
+ return i && (i = `<tbody>${i}</tbody>`), `<table>
6276
6672
  <thead>
6277
6673
  ` + t + `</thead>
6278
- ` + s + `</table>
6674
+ ` + i + `</table>
6279
6675
  `;
6280
6676
  }
6281
6677
  tablerow({ text: e }) {
@@ -6295,7 +6691,7 @@ ${e}</tr>
6295
6691
  return `<em>${this.parser.parseInline(e)}</em>`;
6296
6692
  }
6297
6693
  codespan({ text: e }) {
6298
- return `<code>${O(e, !0)}</code>`;
6694
+ return `<code>${w(e, !0)}</code>`;
6299
6695
  }
6300
6696
  br(e) {
6301
6697
  return "<br>";
@@ -6303,23 +6699,23 @@ ${e}</tr>
6303
6699
  del({ tokens: e }) {
6304
6700
  return `<del>${this.parser.parseInline(e)}</del>`;
6305
6701
  }
6306
- link({ href: e, title: t, text: n, tokens: s, autolink: r }) {
6307
- let o = r ? O(n, !0) : this.parser.parseInline(s), i = re(e);
6308
- if (i === null) return o;
6309
- e = O(i, r);
6310
- let u = "<a href=\"" + e + "\"";
6311
- return t && (u += " title=\"" + O(t) + "\""), u += ">" + o + "</a>", u;
6312
- }
6313
- image({ href: e, title: t, text: n, tokens: s }) {
6314
- s && (n = this.parser.parseInline(s, this.parser.textRenderer));
6315
- let r = re(e);
6316
- if (r === null) return O(n);
6702
+ link({ href: e, title: t, text: n, tokens: i, autolink: r }) {
6703
+ let o = r ? w(n, !0) : this.parser.parseInline(i), s = ie(e);
6704
+ if (s === null) return o;
6705
+ e = w(s, r);
6706
+ let l = "<a href=\"" + e + "\"";
6707
+ return t && (l += " title=\"" + w(t) + "\""), l += ">" + o + "</a>", l;
6708
+ }
6709
+ image({ href: e, title: t, text: n, tokens: i }) {
6710
+ i && (n = this.parser.parseInline(i, this.parser.textRenderer));
6711
+ let r = ie(e);
6712
+ if (r === null) return w(n);
6317
6713
  e = r;
6318
- let o = `<img src="${O(e)}" alt="${O(n)}"`;
6319
- return t && (o += ` title="${O(t)}"`), o += ">", o;
6714
+ let o = `<img src="${w(e)}" alt="${w(n)}"`;
6715
+ return t && (o += ` title="${w(t)}"`), o += ">", o;
6320
6716
  }
6321
6717
  text(e) {
6322
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : O(e.text);
6718
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
6323
6719
  }
6324
6720
  };
6325
6721
  var z = class {
@@ -6354,27 +6750,27 @@ ${e}</tr>
6354
6750
  return e;
6355
6751
  }
6356
6752
  };
6357
- var T = class l {
6753
+ var O = class a {
6358
6754
  options;
6359
6755
  renderer;
6360
6756
  textRenderer;
6361
6757
  constructor(e) {
6362
- this.options = e || y, this.options.renderer = this.options.renderer || new S(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
6758
+ this.options = e || y, this.options.renderer = this.options.renderer || new $(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
6363
6759
  }
6364
6760
  static parse(e, t) {
6365
- return new l(t).parse(e);
6761
+ return new a(t).parse(e);
6366
6762
  }
6367
6763
  static parseInline(e, t) {
6368
- return new l(t).parseInline(e);
6764
+ return new a(t).parseInline(e);
6369
6765
  }
6370
6766
  parse(e) {
6371
6767
  this.renderer.parser = this;
6372
6768
  let t = "";
6373
6769
  for (let n = 0; n < e.length; n++) {
6374
- let s = e[n];
6375
- if (this.options.extensions?.renderers?.[s.type]) {
6376
- let o = s, i = this.options.extensions.renderers[o.type].call({ parser: this }, o);
6377
- if (i !== !1 || ![
6770
+ let i = e[n];
6771
+ if (this.options.extensions?.renderers?.[i.type]) {
6772
+ let o = i, s = this.options.extensions.renderers[o.type].call({ parser: this }, o);
6773
+ if (s !== !1 || ![
6378
6774
  "space",
6379
6775
  "hr",
6380
6776
  "heading",
@@ -6388,11 +6784,11 @@ ${e}</tr>
6388
6784
  "paragraph",
6389
6785
  "text"
6390
6786
  ].includes(o.type)) {
6391
- t += i || "";
6787
+ t += s || "";
6392
6788
  continue;
6393
6789
  }
6394
6790
  }
6395
- let r = s;
6791
+ let r = i;
6396
6792
  switch (r.type) {
6397
6793
  case "space":
6398
6794
  t += this.renderer.space(r);
@@ -6442,11 +6838,11 @@ ${e}</tr>
6442
6838
  parseInline(e, t = this.renderer) {
6443
6839
  this.renderer.parser = this;
6444
6840
  let n = "";
6445
- for (let s = 0; s < e.length; s++) {
6446
- let r = e[s];
6841
+ for (let i = 0; i < e.length; i++) {
6842
+ let r = e[i];
6447
6843
  if (this.options.extensions?.renderers?.[r.type]) {
6448
- let i = this.options.extensions.renderers[r.type].call({ parser: this }, r);
6449
- if (i !== !1 || ![
6844
+ let s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
6845
+ if (s !== !1 || ![
6450
6846
  "escape",
6451
6847
  "html",
6452
6848
  "link",
@@ -6459,7 +6855,7 @@ ${e}</tr>
6459
6855
  "del",
6460
6856
  "text"
6461
6857
  ].includes(r.type)) {
6462
- n += i || "";
6858
+ n += s || "";
6463
6859
  continue;
6464
6860
  }
6465
6861
  }
@@ -6499,16 +6895,16 @@ ${e}</tr>
6499
6895
  n += t.text(o);
6500
6896
  break;
6501
6897
  default: {
6502
- let i = "Token with \"" + o.type + "\" type was not found.";
6503
- if (this.options.silent) return console.error(i), "";
6504
- throw new Error(i);
6898
+ let s = "Token with \"" + o.type + "\" type was not found.";
6899
+ if (this.options.silent) return console.error(s), "";
6900
+ throw new Error(s);
6505
6901
  }
6506
6902
  }
6507
6903
  }
6508
6904
  return n;
6509
6905
  }
6510
6906
  };
6511
- var _ = class {
6907
+ var L = class {
6512
6908
  options;
6513
6909
  block;
6514
6910
  constructor(e) {
@@ -6538,46 +6934,50 @@ ${e}</tr>
6538
6934
  return e;
6539
6935
  }
6540
6936
  provideLexer(e = this.block) {
6541
- return e ? R.lex : R.lexInline;
6937
+ return e ? T.lex : T.lexInline;
6542
6938
  }
6543
6939
  provideParser(e = this.block) {
6544
- return e ? T.parse : T.parseInline;
6940
+ return e ? O.parse : O.parseInline;
6545
6941
  }
6546
6942
  };
6547
- var F = class {
6548
- defaults = I();
6943
+ function C(a, e) {
6944
+ if (Array.isArray(e)) for (let t = 0; t < e.length; t++) a.push(e[t]);
6945
+ else a.push(e);
6946
+ }
6947
+ var U = class {
6948
+ defaults = B();
6549
6949
  options = this.setOptions;
6550
6950
  parse = this.parseMarkdown(!0);
6551
6951
  parseInline = this.parseMarkdown(!1);
6552
- Parser = T;
6553
- Renderer = S;
6952
+ Parser = O;
6953
+ Renderer = $;
6554
6954
  TextRenderer = z;
6555
- Lexer = R;
6556
- Tokenizer = P;
6557
- Hooks = _;
6955
+ Lexer = T;
6956
+ Tokenizer = _;
6957
+ Hooks = L;
6558
6958
  constructor(...e) {
6559
6959
  this.use(...e);
6560
6960
  }
6561
6961
  walkTokens(e, t) {
6562
6962
  let n = [];
6563
- for (let s of e) switch (n = n.concat(t.call(this, s)), s.type) {
6963
+ for (let i of e) switch (C(n, t.call(this, i)), i.type) {
6564
6964
  case "table": {
6565
- let r = s;
6566
- for (let o of r.header) n = n.concat(this.walkTokens(o.tokens, t));
6567
- for (let o of r.rows) for (let i of o) n = n.concat(this.walkTokens(i.tokens, t));
6965
+ let r = i;
6966
+ for (let o of r.header) C(n, this.walkTokens(o.tokens, t));
6967
+ for (let o of r.rows) for (let s of o) C(n, this.walkTokens(s.tokens, t));
6568
6968
  break;
6569
6969
  }
6570
6970
  case "list": {
6571
- let r = s;
6572
- n = n.concat(this.walkTokens(r.items, t));
6971
+ let r = i;
6972
+ C(n, this.walkTokens(r.items, t));
6573
6973
  break;
6574
6974
  }
6575
6975
  default: {
6576
- let r = s;
6976
+ let r = i;
6577
6977
  this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
6578
- let i = r[o].flat(Infinity);
6579
- n = n.concat(this.walkTokens(i, t));
6580
- }) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, t)));
6978
+ let s = r[o].flat(Infinity);
6979
+ C(n, this.walkTokens(s, t));
6980
+ }) : r.tokens && C(n, this.walkTokens(r.tokens, t));
6581
6981
  }
6582
6982
  }
6583
6983
  return n;
@@ -6588,14 +6988,14 @@ ${e}</tr>
6588
6988
  childTokens: {}
6589
6989
  };
6590
6990
  return e.forEach((n) => {
6591
- let s = { ...n };
6592
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
6991
+ let i = { ...n };
6992
+ if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((r) => {
6593
6993
  if (!r.name) throw new Error("extension name required");
6594
6994
  if ("renderer" in r) {
6595
6995
  let o = t.renderers[r.name];
6596
- o ? t.renderers[r.name] = function(...i) {
6597
- let u = r.renderer.apply(this, i);
6598
- return u === !1 && (u = o.apply(this, i)), u;
6996
+ o ? t.renderers[r.name] = function(...s) {
6997
+ let l = r.renderer.apply(this, s);
6998
+ return l === !1 && (l = o.apply(this, s)), l;
6599
6999
  } : t.renderers[r.name] = r.renderer;
6600
7000
  }
6601
7001
  if ("tokenizer" in r) {
@@ -6604,21 +7004,21 @@ ${e}</tr>
6604
7004
  o ? o.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
6605
7005
  }
6606
7006
  "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
6607
- }), s.extensions = t), n.renderer) {
6608
- let r = this.defaults.renderer || new S(this.defaults);
7007
+ }), i.extensions = t), n.renderer) {
7008
+ let r = this.defaults.renderer || new $(this.defaults);
6609
7009
  for (let o in n.renderer) {
6610
7010
  if (!(o in r)) throw new Error(`renderer '${o}' does not exist`);
6611
7011
  if (["options", "parser"].includes(o)) continue;
6612
- let i = o, u = n.renderer[i], a = r[i];
6613
- r[i] = (...p) => {
6614
- let c = u.apply(r, p);
6615
- return c === !1 && (c = a.apply(r, p)), c || "";
7012
+ let s = o, l = n.renderer[s], u = r[s];
7013
+ r[s] = (...c) => {
7014
+ let p = l.apply(r, c);
7015
+ return p === !1 && (p = u.apply(r, c)), p || "";
6616
7016
  };
6617
7017
  }
6618
- s.renderer = r;
7018
+ i.renderer = r;
6619
7019
  }
6620
7020
  if (n.tokenizer) {
6621
- let r = this.defaults.tokenizer || new P(this.defaults);
7021
+ let r = this.defaults.tokenizer || new _(this.defaults);
6622
7022
  for (let o in n.tokenizer) {
6623
7023
  if (!(o in r)) throw new Error(`tokenizer '${o}' does not exist`);
6624
7024
  if ([
@@ -6626,48 +7026,48 @@ ${e}</tr>
6626
7026
  "rules",
6627
7027
  "lexer"
6628
7028
  ].includes(o)) continue;
6629
- let i = o, u = n.tokenizer[i], a = r[i];
6630
- r[i] = (...p) => {
6631
- let c = u.apply(r, p);
6632
- return c === !1 && (c = a.apply(r, p)), c;
7029
+ let s = o, l = n.tokenizer[s], u = r[s];
7030
+ r[s] = (...c) => {
7031
+ let p = l.apply(r, c);
7032
+ return p === !1 && (p = u.apply(r, c)), p;
6633
7033
  };
6634
7034
  }
6635
- s.tokenizer = r;
7035
+ i.tokenizer = r;
6636
7036
  }
6637
7037
  if (n.hooks) {
6638
- let r = this.defaults.hooks || new _();
7038
+ let r = this.defaults.hooks || new L();
6639
7039
  for (let o in n.hooks) {
6640
7040
  if (!(o in r)) throw new Error(`hook '${o}' does not exist`);
6641
7041
  if (["options", "block"].includes(o)) continue;
6642
- let i = o, u = n.hooks[i], a = r[i];
6643
- _.passThroughHooks.has(o) ? r[i] = (p) => {
6644
- if (this.defaults.async && _.passThroughHooksRespectAsync.has(o)) return (async () => {
6645
- let d = await u.call(r, p);
6646
- return a.call(r, d);
7042
+ let s = o, l = n.hooks[s], u = r[s];
7043
+ L.passThroughHooks.has(o) ? r[s] = (c) => {
7044
+ if (this.defaults.async && L.passThroughHooksRespectAsync.has(o)) return (async () => {
7045
+ let d = await l.call(r, c);
7046
+ return u.call(r, d);
6647
7047
  })();
6648
- let c = u.call(r, p);
6649
- return a.call(r, c);
6650
- } : r[i] = (...p) => {
7048
+ let p = l.call(r, c);
7049
+ return u.call(r, p);
7050
+ } : r[s] = (...c) => {
6651
7051
  if (this.defaults.async) return (async () => {
6652
- let d = await u.apply(r, p);
6653
- return d === !1 && (d = await a.apply(r, p)), d;
7052
+ let d = await l.apply(r, c);
7053
+ return d === !1 && (d = await u.apply(r, c)), d;
6654
7054
  })();
6655
- let c = u.apply(r, p);
6656
- return c === !1 && (c = a.apply(r, p)), c;
7055
+ let p = l.apply(r, c);
7056
+ return p === !1 && (p = u.apply(r, c)), p;
6657
7057
  };
6658
7058
  }
6659
- s.hooks = r;
7059
+ i.hooks = r;
6660
7060
  }
6661
7061
  if (n.walkTokens) {
6662
7062
  let r = this.defaults.walkTokens, o = n.walkTokens;
6663
- s.walkTokens = function(i) {
6664
- let u = [];
6665
- return u.push(o.call(this, i)), r && (u = u.concat(r.call(this, i))), u;
7063
+ i.walkTokens = function(s) {
7064
+ let l = [];
7065
+ return l.push(o.call(this, s)), r && C(l, r.call(this, s)), l;
6666
7066
  };
6667
7067
  }
6668
7068
  this.defaults = {
6669
7069
  ...this.defaults,
6670
- ...s
7070
+ ...i
6671
7071
  };
6672
7072
  }), this;
6673
7073
  }
@@ -6678,34 +7078,34 @@ ${e}</tr>
6678
7078
  }, this;
6679
7079
  }
6680
7080
  lexer(e, t) {
6681
- return R.lex(e, t ?? this.defaults);
7081
+ return T.lex(e, t ?? this.defaults);
6682
7082
  }
6683
7083
  parser(e, t) {
6684
- return T.parse(e, t ?? this.defaults);
7084
+ return O.parse(e, t ?? this.defaults);
6685
7085
  }
6686
7086
  parseMarkdown(e) {
6687
- return (n, s) => {
6688
- let r = { ...s }, o = {
7087
+ return (n, i) => {
7088
+ let r = { ...i }, o = {
6689
7089
  ...this.defaults,
6690
7090
  ...r
6691
- }, i = this.onError(!!o.silent, !!o.async);
6692
- if (this.defaults.async === !0 && r.async === !1) return i(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
6693
- if (typeof n > "u" || n === null) return i(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
6694
- if (typeof n != "string") return i(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
7091
+ }, s = this.onError(!!o.silent, !!o.async);
7092
+ if (this.defaults.async === !0 && r.async === !1) return s(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
7093
+ if (typeof n > "u" || n === null) return s(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
7094
+ if (typeof n != "string") return s(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
6695
7095
  if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async) return (async () => {
6696
- let u = o.hooks ? await o.hooks.preprocess(n) : n, p = await (o.hooks ? await o.hooks.provideLexer(e) : e ? R.lex : R.lexInline)(u, o), c = o.hooks ? await o.hooks.processAllTokens(p) : p;
6697
- o.walkTokens && await Promise.all(this.walkTokens(c, o.walkTokens));
6698
- let m = await (o.hooks ? await o.hooks.provideParser(e) : e ? T.parse : T.parseInline)(c, o);
6699
- return o.hooks ? await o.hooks.postprocess(m) : m;
6700
- })().catch(i);
7096
+ let l = o.hooks ? await o.hooks.preprocess(n) : n, c = await (o.hooks ? await o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(l, o), p = o.hooks ? await o.hooks.processAllTokens(c) : c;
7097
+ o.walkTokens && await Promise.all(this.walkTokens(p, o.walkTokens));
7098
+ let g = await (o.hooks ? await o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(p, o);
7099
+ return o.hooks ? await o.hooks.postprocess(g) : g;
7100
+ })().catch(s);
6701
7101
  try {
6702
7102
  o.hooks && (n = o.hooks.preprocess(n));
6703
- let a = (o.hooks ? o.hooks.provideLexer(e) : e ? R.lex : R.lexInline)(n, o);
6704
- o.hooks && (a = o.hooks.processAllTokens(a)), o.walkTokens && this.walkTokens(a, o.walkTokens);
6705
- let c = (o.hooks ? o.hooks.provideParser(e) : e ? T.parse : T.parseInline)(a, o);
6706
- return o.hooks && (c = o.hooks.postprocess(c)), c;
6707
- } catch (u) {
6708
- return i(u);
7103
+ let u = (o.hooks ? o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(n, o);
7104
+ o.hooks && (u = o.hooks.processAllTokens(u)), o.walkTokens && this.walkTokens(u, o.walkTokens);
7105
+ let p = (o.hooks ? o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(u, o);
7106
+ return o.hooks && (p = o.hooks.postprocess(p)), p;
7107
+ } catch (l) {
7108
+ return s(l);
6709
7109
  }
6710
7110
  };
6711
7111
  }
@@ -6713,46 +7113,46 @@ ${e}</tr>
6713
7113
  return (n) => {
6714
7114
  if (n.message += `
6715
7115
  Please report this to https://github.com/markedjs/marked.`, e) {
6716
- let s = "<p>An error occurred:</p><pre>" + O(n.message + "", !0) + "</pre>";
6717
- return t ? Promise.resolve(s) : s;
7116
+ let i = "<p>An error occurred:</p><pre>" + w(n.message + "", !0) + "</pre>";
7117
+ return t ? Promise.resolve(i) : i;
6718
7118
  }
6719
7119
  if (t) return Promise.reject(n);
6720
7120
  throw n;
6721
7121
  };
6722
7122
  }
6723
7123
  };
6724
- var E = new F();
6725
- function k(l, e) {
6726
- return E.parse(l, e);
7124
+ var I = new U();
7125
+ function f(a, e) {
7126
+ return I.parse(a, e);
6727
7127
  }
6728
- k.options = k.setOptions = function(l) {
6729
- return E.setOptions(l), k.defaults = E.defaults, W(k.defaults), k;
7128
+ f.options = f.setOptions = function(a) {
7129
+ return I.setOptions(a), f.defaults = I.defaults, V(f.defaults), f;
6730
7130
  };
6731
- k.getDefaults = I;
6732
- k.defaults = y;
6733
- function Pt(...l) {
6734
- return E.use(...l), k.defaults = E.defaults, W(k.defaults), k;
6735
- }
6736
- k.use = Pt;
6737
- k.walkTokens = function(l, e) {
6738
- return E.walkTokens(l, e);
7131
+ f.getDefaults = B;
7132
+ f.defaults = y;
7133
+ function At(...a) {
7134
+ return I.use(...a), f.defaults = I.defaults, V(f.defaults), f;
7135
+ }
7136
+ f.use = At;
7137
+ f.walkTokens = function(a, e) {
7138
+ return I.walkTokens(a, e);
6739
7139
  };
6740
- k.parseInline = E.parseInline;
6741
- k.Parser = T;
6742
- k.parser = T.parse;
6743
- k.Renderer = S;
6744
- k.TextRenderer = z;
6745
- k.Lexer = R;
6746
- k.lexer = R.lex;
6747
- k.Tokenizer = P;
6748
- k.Hooks = _;
6749
- k.parse = k;
6750
- k.options;
6751
- k.setOptions;
6752
- k.walkTokens;
6753
- k.parseInline;
6754
- T.parse;
6755
- R.lex;
7140
+ f.parseInline = I.parseInline;
7141
+ f.Parser = O;
7142
+ f.parser = O.parse;
7143
+ f.Renderer = $;
7144
+ f.TextRenderer = z;
7145
+ f.Lexer = T;
7146
+ f.lexer = T.lex;
7147
+ f.Tokenizer = _;
7148
+ f.Hooks = L;
7149
+ f.parse = f;
7150
+ f.options;
7151
+ f.setOptions;
7152
+ f.walkTokens;
7153
+ f.parseInline;
7154
+ O.parse;
7155
+ T.lex;
6756
7156
  //#endregion
6757
7157
  //#region src/core/issue-form.ts
6758
7158
  /**
@@ -6830,7 +7230,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
6830
7230
  }
6831
7231
  /** Readable summary without changing the task source or creating DOM HTML. */
6832
7232
  function markdownToPlainText(source) {
6833
- return plain(R.lex(source, { gfm: true }), " ").replace(/\s+/g, " ").trim();
7233
+ return plain(T.lex(source, { gfm: true }), " ").replace(/\s+/g, " ").trim();
6834
7234
  }
6835
7235
  /**
6836
7236
  * Card excerpt: the plain text a reader can tell cards apart by.
@@ -6848,7 +7248,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
6848
7248
  const blocks = [];
6849
7249
  const summary = [];
6850
7250
  let inSummary = false;
6851
- for (const token of R.lex(source, { gfm: true })) {
7251
+ for (const token of T.lex(source, { gfm: true })) {
6852
7252
  if (token.type === "heading") {
6853
7253
  inSummary = SUMMARY_HEADING.test(plain([token]).replace(HEADING_COLON, "").trim());
6854
7254
  continue;
@@ -6971,7 +7371,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
6971
7371
  }
6972
7372
  /** Markdown rendered as React nodes: raw HTML and automatic image loads are disabled. */
6973
7373
  function TaskMarkdown({ source }) {
6974
- const content = (0, react.useMemo)(() => renderTokens(R.lex(source, { gfm: true })), [source]);
7374
+ const content = (0, react.useMemo)(() => renderTokens(T.lex(source, { gfm: true })), [source]);
6975
7375
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6976
7376
  className: task_markdown_module_css_default.markdownRoot,
6977
7377
  children: content
@@ -7314,6 +7714,87 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7314
7714
  if (fallback === void 0) return t("exec.mode.inherit");
7315
7715
  return t("exec.mode.inheritWith", { preset: presetLabel(fallback) });
7316
7716
  }
7717
+ /**
7718
+ * The picker rows of one roster, split into the built-in and the user presets.
7719
+ * Both pickers render these rows — the create dialog's mode select and the
7720
+ * settings card's default-preset field — so their wording and their
7721
+ * unavailable rows cannot drift apart.
7722
+ * @param presets - the roster options.
7723
+ * @returns one row list per group, in roster order.
7724
+ */
7725
+ function presetChoiceRows(presets) {
7726
+ const row = (preset) => ({
7727
+ id: preset.id,
7728
+ label: presetLabel(preset) + (preset.isDefault ? t("exec.mode.defaultSuffix") : "") + (preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""),
7729
+ disabled: preset.broken !== void 0
7730
+ });
7731
+ return {
7732
+ builtin: presets.filter((preset) => isBuiltinPreset(preset.id)).map(row),
7733
+ custom: presets.filter((preset) => !isBuiltinPreset(preset.id)).map(row)
7734
+ };
7735
+ }
7736
+ //#endregion
7737
+ //#region src/client/board/ReasoningEffortField.tsx
7738
+ /** The controlled reasoning-effort picker. */
7739
+ function ReasoningEffortField({ models, modelId, value, pending, onChange }) {
7740
+ const efforts = reasoningEffortsFor(models, modelId);
7741
+ const unlisted = value !== "" && !efforts.includes(value);
7742
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
7743
+ className: board_module_css_default.field,
7744
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7745
+ className: board_module_css_default.fieldLabel,
7746
+ children: t("exec.reasoning")
7747
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
7748
+ className: board_module_css_default.select,
7749
+ value,
7750
+ disabled: pending || !reasoningPickerEnabled(models, modelId),
7751
+ onChange: (event) => {
7752
+ onChange(event.target.value);
7753
+ },
7754
+ children: [
7755
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7756
+ value: "",
7757
+ children: t("exec.reasoning.inherit")
7758
+ }),
7759
+ unlisted && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
7760
+ value,
7761
+ disabled: true,
7762
+ children: [value, t("exec.reasoning.unknown")]
7763
+ }),
7764
+ efforts.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7765
+ value: effort,
7766
+ children: effort
7767
+ }, effort))
7768
+ ]
7769
+ })]
7770
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7771
+ className: board_module_css_default.detailText,
7772
+ children: t(reasoningHintKey(models, modelId))
7773
+ })] });
7774
+ }
7775
+ //#endregion
7776
+ //#region src/client/board/team-run-promotion.ts
7777
+ /**
7778
+ * Whether a join would promote this parent: the deployment serves Agent Teams
7779
+ * and the parent has not opted in yet.
7780
+ * @param controller - the board controller (the snapshot carries both facts).
7781
+ * @param parent - the task that gained a subtask, if there is one.
7782
+ */
7783
+ function parentAwaitsTeamRunPromotion(controller, parent) {
7784
+ if (parent === void 0) return false;
7785
+ const snapshot = controller.getSnapshot();
7786
+ if (snapshot.host?.teamRunAvailable !== true) return false;
7787
+ return (snapshot.tasks.find((task) => task.id === parent.id) ?? parent).teamRun !== true;
7788
+ }
7789
+ /**
7790
+ * Opt the parent in after the Host confirmed the join.
7791
+ * @returns true when the opt-in was written; false when it did not apply.
7792
+ */
7793
+ async function promoteParentForTeamRun(controller, parent) {
7794
+ if (parent === void 0) return false;
7795
+ if (!parentAwaitsTeamRunPromotion(controller, parent)) return false;
7796
+ return await controller.updateTask(parent.id, { teamRun: true });
7797
+ }
7317
7798
  //#endregion
7318
7799
  //#region src/client/board/NewTaskModal.tsx
7319
7800
  /**
@@ -7326,10 +7807,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7326
7807
  const [title, setTitle] = (0, react.useState)(initialTask?.title ?? "");
7327
7808
  const [description, setDescription] = (0, react.useState)(initialTask?.description ?? "");
7328
7809
  const [prompt, setPrompt] = (0, react.useState)(initialTask?.prompt ?? "");
7810
+ const [seed] = (0, react.useState)(() => {
7811
+ const source = parentTask !== void 0 ? {
7812
+ kind: "parent",
7813
+ task: parentTask
7814
+ } : initialTask !== void 0 ? {
7815
+ kind: "duplicate",
7816
+ task: initialTask
7817
+ } : void 0;
7818
+ return resolveCardTargets(controller.getSnapshot().host?.cardDefaults, source);
7819
+ });
7329
7820
  const [workspaceId, setWorkspaceId] = (0, react.useState)(initialTask?.workspaceId ?? parentTask?.workspaceId ?? defaultWorkspaceId ?? "");
7330
- const [mode, setMode] = (0, react.useState)(initialTask?.mode ?? parentTask?.mode ?? "");
7331
- const [permission, setPermission] = (0, react.useState)(initialTask?.permission ?? "");
7332
- const [model, setModel] = (0, react.useState)(initialTask?.model ?? parentTask?.model ?? "");
7821
+ const [mode, setMode] = (0, react.useState)(seed.mode);
7822
+ const [permission, setPermission] = (0, react.useState)(seed.permission);
7823
+ const [model, setModel] = (0, react.useState)(seed.model);
7824
+ const [reasoningEffort, setReasoningEffort] = (0, react.useState)(seed.reasoningEffort);
7333
7825
  const inheritedPermission = parentTask === void 0 ? void 0 : effectiveTaskPermission(parentTask);
7334
7826
  const [reuseSession, setReuseSession] = (0, react.useState)(initialTask?.reuseSession ?? false);
7335
7827
  const [goalRun, setGoalRun] = (0, react.useState)(initialTask?.goalRun ?? false);
@@ -7357,18 +7849,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7357
7849
  const [parsePending, setParsePending] = (0, react.useState)(false);
7358
7850
  const [parseError, setParseError] = (0, react.useState)(void 0);
7359
7851
  const parseAbort = (0, react.useRef)(void 0);
7360
- const parseModels = options.models ?? [];
7852
+ const models = options.models ?? [];
7361
7853
  const workspaceKnown = workspaceId === "" || options.workspaces.some((item) => item.workspaceId === workspaceId);
7362
7854
  const modeKnown = mode === "" || options.presets.some((item) => item.id === mode);
7363
- const modelKnown = model === "" || parseModels.some((item) => item.id === model);
7855
+ const modelKnown = model === "" || models.some((item) => item.id === model);
7364
7856
  (0, react.useEffect)(() => controller.subscribe(() => {
7365
7857
  const snapshot = controller.getSnapshot();
7366
7858
  setOptions(snapshot.executionOptions);
7367
7859
  setGoalRunEnabled(snapshot.host?.goalRunEnabled === true);
7368
7860
  }), [controller]);
7369
7861
  (0, react.useEffect)(() => {
7370
- if (parseModel === "" || parseModels.length === 0) return;
7371
- if (parseModels.some((option) => option.id === parseModel)) return;
7862
+ if (parseModel === "" || models.length === 0) return;
7863
+ if (models.some((option) => option.id === parseModel)) return;
7372
7864
  setParseModel("");
7373
7865
  writeParseModelPreference("");
7374
7866
  }, [parseModel, options.models]);
@@ -7452,10 +7944,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7452
7944
  ...parentTask === void 0 ? {} : { parentId: parentTask.id },
7453
7945
  freeze,
7454
7946
  handover,
7455
- workspaceId: workspaceId === "" ? void 0 : workspaceId,
7456
- mode: mode === "" ? void 0 : mode,
7457
- permission: permission === "" ? void 0 : permission,
7458
- model: model === "" ? void 0 : model,
7947
+ ...workspaceId === "" ? {} : { workspaceId },
7948
+ ...mode === "" ? {} : { mode },
7949
+ ...permission === "" ? {} : { permission },
7950
+ ...model === "" ? {} : { model },
7951
+ ...reasoningEffort === "" ? {} : { reasoningEffort },
7459
7952
  ...reuseSession ? { reuseSession: true } : {},
7460
7953
  ...goalRun ? { goalRun: true } : {},
7461
7954
  ...skipVerification ? { skipVerification: true } : {},
@@ -7478,6 +7971,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7478
7971
  setError(controller.getSnapshot().transportError ?? t("new.required"));
7479
7972
  return;
7480
7973
  }
7974
+ await promoteParentForTeamRun(controller, parentTask);
7481
7975
  if (isDuplicate && archiveOriginal && initialTask !== void 0) if (onDuplicateSuccess !== void 0) await onDuplicateSuccess(initialTask.id);
7482
7976
  else await controller.archiveTask(initialTask.id);
7483
7977
  if (runAfterCreate) {
@@ -7489,19 +7983,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7489
7983
  const scheduleTimeZone = scheduleZone === "" ? hostTimeZone : scheduleZone;
7490
7984
  const scheduleNextRun = !scheduleEnabled ? void 0 : scheduleMode === "once" ? parseZonedInput(scheduleAt, scheduleTimeZone) : scheduleCron.trim() !== "" && isValidCron(scheduleCron) ? nextRunAtMs(scheduleCron, Date.now(), scheduleTimeZone) : void 0;
7491
7985
  const modalTitle = parentTask !== void 0 ? t("new.subtaskTitle") : isDuplicate ? t("new.duplicateTitle") : t("board.new");
7492
- const builtinPresets = options.presets.filter((preset) => isBuiltinPreset(preset.id));
7493
- const customPresets = options.presets.filter((preset) => !isBuiltinPreset(preset.id));
7986
+ const presetRows = presetChoiceRows(options.presets);
7494
7987
  const inheritLabel = inheritPresetLabel(options.presets);
7495
7988
  const selectedPreset = options.presets.find((preset) => preset.id === mode);
7496
7989
  const modeLabel = mode === "" ? inheritLabel : selectedPreset === void 0 ? mode : presetLabel(selectedPreset);
7497
7990
  const workspaceLabel = workspaceId === "" ? t("exec.workspace.recent") : options.workspaces.find((item) => item.workspaceId === workspaceId)?.title ?? workspaceId;
7498
7991
  const permissionLabel = permission === "" ? inheritedPermission === void 0 ? t("exec.permission.default") : t("exec.permission.inheritParent", { permission: t(`exec.permission.${inheritedPermission}`) }) : t(`exec.permission.${permission}`);
7499
7992
  const modelLabel = model === "" ? t("exec.model.default") : (options.models ?? []).find((item) => item.id === model)?.name ?? model;
7993
+ const modelSummary = reasoningEffort === "" ? modelLabel : `${modelLabel} · ${reasoningEffort}`;
7500
7994
  const executionSummary = [
7501
7995
  workspaceLabel,
7502
7996
  modeLabel,
7503
7997
  permissionLabel,
7504
- ...model === "" ? [] : [modelLabel]
7998
+ ...model === "" ? [] : [modelSummary]
7505
7999
  ].join(" · ");
7506
8000
  const tagCount = cleanTags(tags).length;
7507
8001
  const labelsSummary = tagCount === 0 ? t("new.summary.none") : t("new.summary.labelCount", { count: String(tagCount) });
@@ -7567,7 +8061,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7567
8061
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7568
8062
  value: "",
7569
8063
  children: t("exec.model.default")
7570
- }), parseModels.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8064
+ }), models.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7571
8065
  value: option.id,
7572
8066
  children: option.name ?? option.id
7573
8067
  }, option.id))]
@@ -7595,7 +8089,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7595
8089
  ]
7596
8090
  })
7597
8091
  }),
7598
- parentTask !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
8092
+ parentTask !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
7599
8093
  className: board_module_css_default.detailText,
7600
8094
  "data-dsh-part": "subtask-inherit",
7601
8095
  children: [
@@ -7605,7 +8099,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7605
8099
  " · ",
7606
8100
  t("new.subtaskInherit")
7607
8101
  ]
7608
- }),
8102
+ }), parentAwaitsTeamRunPromotion(controller, parentTask) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8103
+ className: board_module_css_default.detailText,
8104
+ children: t("exec.teamRunAutoHint")
8105
+ })] }),
7609
8106
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CollapsibleSection, {
7610
8107
  title: t("new.section.content"),
7611
8108
  defaultOpen: true,
@@ -7690,29 +8187,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7690
8187
  value: mode,
7691
8188
  children: [mode, t("exec.mode.removed")]
7692
8189
  }),
7693
- builtinPresets.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
8190
+ presetRows.builtin.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
7694
8191
  label: t("exec.mode.builtinGroup"),
7695
- children: builtinPresets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
7696
- value: preset.id,
7697
- disabled: preset.broken !== void 0,
7698
- children: [
7699
- presetLabel(preset),
7700
- preset.isDefault ? t("exec.mode.defaultSuffix") : "",
7701
- preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""
7702
- ]
7703
- }, preset.id))
8192
+ children: presetRows.builtin.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8193
+ value: row.id,
8194
+ disabled: row.disabled,
8195
+ children: row.label
8196
+ }, row.id))
7704
8197
  }),
7705
- customPresets.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
8198
+ presetRows.custom.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
7706
8199
  label: t("exec.mode.customGroup"),
7707
- children: customPresets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
7708
- value: preset.id,
7709
- disabled: preset.broken !== void 0,
7710
- children: [
7711
- presetLabel(preset),
7712
- preset.isDefault ? t("exec.mode.defaultSuffix") : "",
7713
- preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""
7714
- ]
7715
- }, preset.id))
8200
+ children: presetRows.custom.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8201
+ value: row.id,
8202
+ disabled: row.disabled,
8203
+ children: row.label
8204
+ }, row.id))
7716
8205
  })
7717
8206
  ]
7718
8207
  })]
@@ -7746,7 +8235,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7746
8235
  className: board_module_css_default.select,
7747
8236
  value: model,
7748
8237
  onChange: (event) => {
7749
- setModel(event.target.value);
8238
+ const next = event.target.value;
8239
+ setModel(next);
8240
+ setReasoningEffort((current) => reconcileReasoningEffort(models, next, current));
7750
8241
  },
7751
8242
  children: [
7752
8243
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
@@ -7757,12 +8248,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7757
8248
  value: model,
7758
8249
  children: [model, t("exec.model.unknown")]
7759
8250
  }),
7760
- options.models?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8251
+ models.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7761
8252
  value: item.id,
7762
8253
  children: item.name ?? item.id
7763
8254
  }, item.id))
7764
8255
  ]
7765
8256
  })]
8257
+ }),
8258
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningEffortField, {
8259
+ models,
8260
+ modelId: model,
8261
+ value: reasoningEffort,
8262
+ pending,
8263
+ onChange: setReasoningEffort
7766
8264
  })
7767
8265
  ]
7768
8266
  }),
@@ -8419,6 +8917,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
8419
8917
  setPending(true);
8420
8918
  setError(void 0);
8421
8919
  if (await controller.setParent(taskId, parent.id)) {
8920
+ await promoteParentForTeamRun(controller, parent);
8422
8921
  onClose();
8423
8922
  return;
8424
8923
  }
@@ -8445,6 +8944,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
8445
8944
  className: board_module_css_default.fieldHint,
8446
8945
  children: t("link.subtask.hint")
8447
8946
  }),
8947
+ parentAwaitsTeamRunPromotion(controller, parent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8948
+ className: board_module_css_default.fieldHint,
8949
+ children: t("exec.teamRunAutoHint")
8950
+ }),
8448
8951
  candidates.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8449
8952
  className: board_module_css_default.detailText,
8450
8953
  children: t("link.subtask.empty")
@@ -8894,13 +9397,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
8894
9397
  /** The execution-target editor: workspace / mode / permission pickers. */
8895
9398
  function ExecutionSettingsSection({ controller, task, pending, executionOptions, teamRunAvailable, goalRunEnabled }) {
8896
9399
  const options = executionOptions;
9400
+ const models = options.models ?? [];
8897
9401
  const workspaceId = task.workspaceId ?? "";
8898
9402
  const mode = task.mode ?? "";
8899
9403
  const permission = task.permission ?? "";
8900
9404
  const model = task.model ?? "";
9405
+ const reasoningEffort = task.reasoningEffort ?? "";
8901
9406
  const workspaceKnown = workspaceId === "" || options.workspaces.some((item) => item.workspaceId === workspaceId);
8902
9407
  const modeKnown = mode === "" || options.presets.some((item) => item.id === mode);
8903
- const modelKnown = model === "" || (options.models ?? []).some((item) => item.id === model);
9408
+ const modelKnown = model === "" || models.some((item) => item.id === model);
8904
9409
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
8905
9410
  className: board_module_css_default.detailSection,
8906
9411
  children: [
@@ -9001,7 +9506,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9001
9506
  value: model,
9002
9507
  disabled: pending,
9003
9508
  onChange: (event) => {
9004
- controller.updateTask(task.id, { model: event.target.value === "" ? void 0 : event.target.value });
9509
+ const next = event.target.value;
9510
+ const effort = reconcileReasoningEffort(models, next, reasoningEffort);
9511
+ controller.updateTask(task.id, {
9512
+ model: next,
9513
+ ...effort === reasoningEffort ? {} : { reasoningEffort: effort }
9514
+ });
9005
9515
  },
9006
9516
  children: [
9007
9517
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
@@ -9012,13 +9522,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9012
9522
  value: model,
9013
9523
  children: [model, t("exec.model.unknown")]
9014
9524
  }),
9015
- options.models?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
9525
+ models.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
9016
9526
  value: item.id,
9017
9527
  children: item.name ?? item.id
9018
9528
  }, item.id))
9019
9529
  ]
9020
9530
  })]
9021
9531
  }),
9532
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningEffortField, {
9533
+ models,
9534
+ modelId: model,
9535
+ value: reasoningEffort,
9536
+ pending,
9537
+ onChange: (effort) => {
9538
+ controller.updateTask(task.id, { reasoningEffort: effort });
9539
+ }
9540
+ }),
9022
9541
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
9023
9542
  className: board_module_css_default.scheduleToggle,
9024
9543
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
@@ -9471,6 +9990,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9471
9990
  });
9472
9991
  }
9473
9992
  /**
9993
+ * The run hint of one card: how many subtasks a run opens, counting the same
9994
+ * members the Host will launch (`joinsCascadeRun` leaves a finished subtask
9995
+ * alone), or why it opens none even though the card has subtasks.
9996
+ */
9997
+ function subtaskRunHint(parentId, children) {
9998
+ const runnable = children.filter((child) => joinsCascadeRun(child, parentId));
9999
+ return runnable.length > 0 ? t("detail.subtasks.runHint", { count: String(runnable.length) }) : t("detail.subtasks.runHintSettled");
10000
+ }
10001
+ /**
9474
10002
  * The subtask block: the parent link, the direct subtasks with their status,
9475
10003
  * and the actions that grow or prune the tree. Every gate here mirrors the
9476
10004
  * Host lineage gate for affordance only; the Host re-checks the action.
@@ -9544,7 +10072,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9544
10072
  }),
9545
10073
  children.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9546
10074
  className: board_module_css_default.detailText,
9547
- children: t("detail.subtasks.runHint", { count: String(children.length) })
10075
+ children: subtaskRunHint(task.id, children)
9548
10076
  }),
9549
10077
  !archived && (canAddChild ? controller.isHostBacked() ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9550
10078
  className: board_module_css_default.subtaskAddRow,
@@ -9901,7 +10429,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9901
10429
  type: "button",
9902
10430
  className: board_module_css_default.primaryButton,
9903
10431
  disabled: busy || pending,
9904
- title: subtaskChildren.length > 0 ? t("detail.subtasks.runHint", { count: String(subtaskChildren.length) }) : void 0,
10432
+ title: subtaskChildren.length > 0 ? subtaskRunHint(current.id, subtaskChildren) : void 0,
9905
10433
  onClick: () => {
9906
10434
  controller.rerunTask(current.id).then(() => {
9907
10435
  if (controller.getSnapshot().transportError === void 0) controller.closeTask();
@@ -10652,7 +11180,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10652
11180
  }
10653
11181
  //#endregion
10654
11182
  //#region \0dsh-css:packages/dsh-task-board/src/client/settings-card.module.css.mjs
10655
- const css$1 = ".Jh0q7G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.Jh0q7G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:13px;padding:16px;display:flex}.Jh0q7G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.Jh0q7G_headerStatic{box-sizing:border-box;border-radius:12px;align-items:center;gap:13px;width:100%;padding:16px;display:flex}.Jh0q7G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Jh0q7G_mark{background:var(--dsw-alias-bg-module-platform);width:34px;height:34px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;place-items:center;transition:color .16s;display:grid}.Jh0q7G_header:hover .Jh0q7G_mark,.Jh0q7G_cardOpen .Jh0q7G_mark{color:var(--dsw-alias-label-primary)}.Jh0q7G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.Jh0q7G_description{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.5}.Jh0q7G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_chevron{color:var(--dsw-alias-label-tertiary);flex:none;width:16px;height:16px;transition:transform .16s,color .16s}.Jh0q7G_header:hover .Jh0q7G_chevron{color:var(--dsw-alias-label-secondary)}.Jh0q7G_chevronOpen{transform:rotate(180deg)}.Jh0q7G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.Jh0q7G_readOnly{color:var(--dsw-alias-label-secondary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.Jh0q7G_failed{min-width:0;color:var(--dsw-alias-state-error-primary,#b42318);text-overflow:ellipsis;white-space:nowrap;flex:1;margin:0;font-size:12px;line-height:1.5;overflow:hidden}.Jh0q7G_discard,.Jh0q7G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.Jh0q7G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.Jh0q7G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.Jh0q7G_discard:disabled,.Jh0q7G_save:disabled{opacity:.4;cursor:default}.Jh0q7G_discard:focus-visible,.Jh0q7G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Jh0q7G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.Jh0q7G_field+.Jh0q7G_field{border-top:1px solid var(--dsw-alias-border-l2)}.Jh0q7G_head{align-items:center;gap:8px;display:flex}.Jh0q7G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.Jh0q7G_badges{align-items:center;gap:8px;display:inline-flex}.Jh0q7G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.Jh0q7G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.Jh0q7G_reset:disabled{cursor:default}.Jh0q7G_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Jh0q7G_input,.Jh0q7G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_input:focus-visible,.Jh0q7G_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.Jh0q7G_input:disabled,.Jh0q7G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.Jh0q7G_inputInvalid{border:1px solid var(--dsw-alias-state-error-primary,#b42318);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-state-error-primary,#b42318);outline-offset:1px;border-color:var(--dsw-alias-state-error-primary,#b42318)}.Jh0q7G_selectWrap{position:relative}.Jh0q7G_selectButton{appearance:none;text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}.Jh0q7G_selectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.Jh0q7G_selectChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.Jh0q7G_selectChevronOpen{transform:rotate(180deg)}.Jh0q7G_selectPopup{z-index:40;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-height:240px;box-shadow:0 8px 24px var(--dsw-alias-bg-mask-2);opacity:0;border-radius:8px;flex-direction:column;padding:4px;transition:opacity .1s,transform .1s;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;transform:translateY(-4px)}.Jh0q7G_selectPopupOpen{opacity:1;transform:none}.Jh0q7G_selectPopupClose{opacity:0;pointer-events:none;transform:translateY(-4px)}.Jh0q7G_selectOption{color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;flex-shrink:0;padding:6px 10px;font-size:13px;line-height:1.5;overflow:hidden}.Jh0q7G_selectOption:hover,.Jh0q7G_selectOptionActive{background:var(--dsw-alias-interactive-bg-hover)}.Jh0q7G_selectOptionSelected{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);font-weight:500}.Jh0q7G_invalid{color:var(--dsw-alias-state-error-primary,#b42318);margin:0;font-size:12px;line-height:1.5}.Jh0q7G_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:1.5}@media (prefers-reduced-motion:reduce){.Jh0q7G_card,.Jh0q7G_header,.Jh0q7G_mark,.Jh0q7G_chevron,.Jh0q7G_chevronOpen,.Jh0q7G_discard,.Jh0q7G_save,.Jh0q7G_selectChevron,.Jh0q7G_selectChevronOpen,.Jh0q7G_selectPopup{transition:none}}";
11183
+ const css$1 = ".Jh0q7G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.Jh0q7G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:13px;padding:16px;display:flex}.Jh0q7G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.Jh0q7G_headerStatic{box-sizing:border-box;border-radius:12px;align-items:center;gap:13px;width:100%;padding:16px;display:flex}.Jh0q7G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Jh0q7G_mark{background:var(--dsw-alias-bg-module-platform);width:34px;height:34px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;place-items:center;transition:color .16s;display:grid}.Jh0q7G_header:hover .Jh0q7G_mark,.Jh0q7G_cardOpen .Jh0q7G_mark{color:var(--dsw-alias-label-primary)}.Jh0q7G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.Jh0q7G_description{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.5}.Jh0q7G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_headerAction{flex:none;align-items:center;display:inline-flex}.Jh0q7G_chevron{color:var(--dsw-alias-label-tertiary);flex:none;width:16px;height:16px;transition:transform .16s,color .16s}.Jh0q7G_header:hover .Jh0q7G_chevron{color:var(--dsw-alias-label-secondary)}.Jh0q7G_chevronOpen{transform:rotate(180deg)}.Jh0q7G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.Jh0q7G_readOnly{color:var(--dsw-alias-label-secondary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.Jh0q7G_failed{min-width:0;color:var(--dsw-alias-state-error-primary,#b42318);text-overflow:ellipsis;white-space:nowrap;flex:1;margin:0;font-size:12px;line-height:1.5;overflow:hidden}.Jh0q7G_discard,.Jh0q7G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.Jh0q7G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.Jh0q7G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.Jh0q7G_discard:disabled,.Jh0q7G_save:disabled{opacity:.4;cursor:default}.Jh0q7G_discard:focus-visible,.Jh0q7G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Jh0q7G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.Jh0q7G_field+.Jh0q7G_field{border-top:1px solid var(--dsw-alias-border-l2)}.Jh0q7G_head{align-items:center;gap:8px;display:flex}.Jh0q7G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.Jh0q7G_badges{align-items:center;gap:8px;display:inline-flex}.Jh0q7G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.Jh0q7G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.Jh0q7G_reset:disabled{cursor:default}.Jh0q7G_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Jh0q7G_input,.Jh0q7G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_input:focus-visible,.Jh0q7G_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.Jh0q7G_input:disabled,.Jh0q7G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.Jh0q7G_inputInvalid{border:1px solid var(--dsw-alias-state-error-primary,#b42318);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-state-error-primary,#b42318);outline-offset:1px;border-color:var(--dsw-alias-state-error-primary,#b42318)}.Jh0q7G_selectWrap{position:relative}.Jh0q7G_selectButton{appearance:none;text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}.Jh0q7G_selectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.Jh0q7G_selectChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.Jh0q7G_selectChevronOpen{transform:rotate(180deg)}.Jh0q7G_selectPopup{z-index:40;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-height:240px;box-shadow:0 8px 24px var(--dsw-alias-bg-mask-2);opacity:0;border-radius:8px;flex-direction:column;padding:4px;transition:opacity .1s,transform .1s;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;transform:translateY(-4px)}.Jh0q7G_selectPopupOpen{opacity:1;transform:none}.Jh0q7G_selectPopupClose{opacity:0;pointer-events:none;transform:translateY(-4px)}.Jh0q7G_selectOption{color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;flex-shrink:0;padding:6px 10px;font-size:13px;line-height:1.5;overflow:hidden}.Jh0q7G_selectOption:hover,.Jh0q7G_selectOptionActive{background:var(--dsw-alias-interactive-bg-hover)}.Jh0q7G_selectOptionSelected{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);font-weight:500}.Jh0q7G_invalid{color:var(--dsw-alias-state-error-primary,#b42318);margin:0;font-size:12px;line-height:1.5}.Jh0q7G_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:1.5}.Jh0q7G_toggle{appearance:none;cursor:pointer;font:inherit;background:0 0;border:0;border-radius:999px;align-items:center;margin:0;padding:0;display:inline-flex}.Jh0q7G_toggleTrack{background:var(--dsw-alias-label-dimmed);border-radius:999px;flex:none;width:30px;height:16px;transition:background .18s;position:relative}.Jh0q7G_toggleThumb{background:var(--dsw-alias-bg-layer-3);border-radius:50%;width:12px;height:12px;transition:left .18s;position:absolute;top:2px;left:2px}.Jh0q7G_toggle[aria-checked=true] .Jh0q7G_toggleTrack{background:var(--dsw-alias-button-primary-fill,var(--dsw-alias-label-primary))}.Jh0q7G_toggle[aria-checked=true] .Jh0q7G_toggleThumb{background:var(--dsw-alias-label-primary-foreground,var(--dsw-alias-bg-layer-3));left:16px}.Jh0q7G_toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Jh0q7G_toggle:disabled{opacity:.45;cursor:default}@media (prefers-reduced-motion:reduce){.Jh0q7G_card,.Jh0q7G_header,.Jh0q7G_mark,.Jh0q7G_chevron,.Jh0q7G_chevronOpen,.Jh0q7G_discard,.Jh0q7G_save,.Jh0q7G_selectChevron,.Jh0q7G_selectChevronOpen,.Jh0q7G_selectPopup,.Jh0q7G_toggleTrack,.Jh0q7G_toggleThumb{transition:none}}";
10656
11184
  const tagId$1 = "@linxin666/dsh-client-ui-task-board/packages/dsh-task-board/src/client/settings-card.module.css";
10657
11185
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
10658
11186
  const tag = document.createElement("style");
@@ -10677,6 +11205,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10677
11205
  "head": "Jh0q7G_head",
10678
11206
  "headText": "Jh0q7G_headText",
10679
11207
  "header": "Jh0q7G_header",
11208
+ "headerAction": "Jh0q7G_headerAction",
10680
11209
  "headerStatic": "Jh0q7G_headerStatic",
10681
11210
  "hint": "Jh0q7G_hint",
10682
11211
  "input": "Jh0q7G_input",
@@ -10701,9 +11230,89 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10701
11230
  "selectPopup": "Jh0q7G_selectPopup",
10702
11231
  "selectPopupClose": "Jh0q7G_selectPopupClose",
10703
11232
  "selectPopupOpen": "Jh0q7G_selectPopupOpen",
10704
- "selectWrap": "Jh0q7G_selectWrap"
11233
+ "selectWrap": "Jh0q7G_selectWrap",
11234
+ "toggle": "Jh0q7G_toggle",
11235
+ "toggleThumb": "Jh0q7G_toggleThumb",
11236
+ "toggleTrack": "Jh0q7G_toggleTrack"
10705
11237
  };
10706
11238
  //#endregion
11239
+ //#region src/client/CardDefaultPresetField.tsx
11240
+ /**
11241
+ * Render the default-preset select.
11242
+ * @param props - the field contract and the roster to list.
11243
+ * @returns the field.
11244
+ */
11245
+ function CardDefaultPresetField(props) {
11246
+ const presets = props.presets;
11247
+ const rows = presetChoiceRows(presets ?? []);
11248
+ const unlisted = props.text !== "" && presets !== void 0 && !presets.some((preset) => preset.id === props.text);
11249
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11250
+ className: settings_card_module_css_default.field,
11251
+ children: [
11252
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11253
+ className: settings_card_module_css_default.head,
11254
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
11255
+ className: settings_card_module_css_default.label,
11256
+ htmlFor: props.id,
11257
+ children: props.label
11258
+ }), props.overridden ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11259
+ className: settings_card_module_css_default.badges,
11260
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11261
+ className: settings_card_module_css_default.badge,
11262
+ children: props.overriddenLabel
11263
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11264
+ type: "button",
11265
+ className: settings_card_module_css_default.reset,
11266
+ disabled: props.disabled,
11267
+ onClick: props.onReset,
11268
+ children: props.resetLabel
11269
+ })]
11270
+ }) : null]
11271
+ }),
11272
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
11273
+ id: props.id,
11274
+ className: settings_card_module_css_default.select,
11275
+ value: props.text,
11276
+ disabled: props.disabled,
11277
+ "aria-invalid": props.invalid || void 0,
11278
+ onChange: (event) => {
11279
+ props.onEdit(event.target.value);
11280
+ },
11281
+ children: [
11282
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11283
+ value: "",
11284
+ children: inheritPresetLabel(presets ?? [])
11285
+ }),
11286
+ unlisted ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
11287
+ value: props.text,
11288
+ children: [props.text, t("exec.mode.removed")]
11289
+ }) : null,
11290
+ rows.builtin.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
11291
+ label: t("exec.mode.builtinGroup"),
11292
+ children: rows.builtin.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11293
+ value: row.id,
11294
+ disabled: row.disabled,
11295
+ children: row.label
11296
+ }, row.id))
11297
+ }) : null,
11298
+ rows.custom.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
11299
+ label: t("exec.mode.customGroup"),
11300
+ children: rows.custom.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11301
+ value: row.id,
11302
+ disabled: row.disabled,
11303
+ children: row.label
11304
+ }, row.id))
11305
+ }) : null
11306
+ ]
11307
+ }),
11308
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11309
+ className: props.invalid ? settings_card_module_css_default.invalid : settings_card_module_css_default.hint,
11310
+ children: props.invalid ? props.invalidLabel : props.hint
11311
+ })
11312
+ ]
11313
+ });
11314
+ }
11315
+ //#endregion
10707
11316
  //#region src/client/PluginSettingsCard.tsx
10708
11317
  /**
10709
11318
  * Family-shared chrome for plugin settings cards: a disclosure header naming
@@ -10739,6 +11348,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10739
11348
  className: settings_card_module_css_default.headText,
10740
11349
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10741
11350
  className: settings_card_module_css_default.name,
11351
+ id: props.titleId,
10742
11352
  title,
10743
11353
  children: title
10744
11354
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -10747,6 +11357,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10747
11357
  children: props.descriptionNode ?? description
10748
11358
  })]
10749
11359
  }),
11360
+ props.headerAction !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11361
+ className: settings_card_module_css_default.headerAction,
11362
+ children: props.headerAction
11363
+ }) : null,
10750
11364
  state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10751
11365
  className: settings_card_module_css_default.pending,
10752
11366
  title: props.t("settings.unsaved"),
@@ -10771,6 +11385,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10771
11385
  className: settings_card_module_css_default.headText,
10772
11386
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10773
11387
  className: settings_card_module_css_default.name,
11388
+ id: props.titleId,
10774
11389
  title,
10775
11390
  children: title
10776
11391
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -10779,6 +11394,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10779
11394
  children: props.descriptionNode ?? description
10780
11395
  })]
10781
11396
  }),
11397
+ props.headerAction !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11398
+ className: settings_card_module_css_default.headerAction,
11399
+ children: props.headerAction
11400
+ }) : null,
10782
11401
  state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10783
11402
  className: settings_card_module_css_default.pending,
10784
11403
  title: props.t("settings.unsaved"),
@@ -10814,7 +11433,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10814
11433
  }
10815
11434
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
10816
11435
  className: cardClass,
10817
- children: [header, expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11436
+ children: [header, expanded && props.headerOnly !== true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10818
11437
  className: settings_card_module_css_default.body,
10819
11438
  children: [
10820
11439
  !state.writable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -11162,20 +11781,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11162
11781
  });
11163
11782
  }
11164
11783
  //#endregion
11165
- //#region \0dsh-store-engine
11166
- const platform = ["@deepseek-ai/dsh-client", "-store"].join("");
11167
- const legacy = ["@deepseek-ai/dsh-client-runtime", "/client"].join("");
11168
- let engine;
11169
- try {
11170
- engine = require(platform);
11171
- } catch {
11172
- engine = require(legacy);
11173
- }
11174
- const createSnapshotStore = engine.createSnapshotStore;
11175
- engine.defineStore;
11176
- engine.shallowEqual;
11177
- //#endregion
11178
11784
  //#region src/client/settings-form.ts
11785
+ /** A free-text field. An empty draft clears the field. */
11786
+ function textField(field) {
11787
+ return {
11788
+ field,
11789
+ format: (value) => typeof value === "string" ? value : "",
11790
+ parse: (text) => {
11791
+ const trimmed = text.trim();
11792
+ return trimmed === "" ? { kind: "clear" } : {
11793
+ kind: "set",
11794
+ value: trimmed
11795
+ };
11796
+ }
11797
+ };
11798
+ }
11179
11799
  /** A boolean field, edited through true/false draft text. */
11180
11800
  function booleanField(field) {
11181
11801
  return {
@@ -11195,6 +11815,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11195
11815
  }
11196
11816
  };
11197
11817
  }
11818
+ /** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */
11819
+ function choiceField(field, choices) {
11820
+ return {
11821
+ field,
11822
+ format: (value) => typeof value === "string" && choices.includes(value) ? value : "",
11823
+ parse: (text) => {
11824
+ if (text === "") return { kind: "clear" };
11825
+ return choices.includes(text) ? {
11826
+ kind: "set",
11827
+ value: text
11828
+ } : void 0;
11829
+ }
11830
+ };
11831
+ }
11198
11832
  /**
11199
11833
  * Stages one card's edits over one settings namespace and writes them on save.
11200
11834
  *
@@ -11236,7 +11870,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11236
11870
  }
11237
11871
  /** Publish a projection of this form, rebuilt whenever the form or a draft changes. */
11238
11872
  bind(project) {
11239
- const store = createSnapshotStore(project());
11873
+ const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(project());
11240
11874
  this.listeners.add(() => {
11241
11875
  store.set(project());
11242
11876
  });
@@ -11536,36 +12170,62 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11536
12170
  };
11537
12171
  }
11538
12172
  /**
11539
- * The judge-model field: blank inherits the host model catalog default, and a
11540
- * non-blank draft must be a qualified provider/model route. An unparseable
11541
- * draft blocks the save instead of storing a route nothing can resolve.
12173
+ * The run-launch width field: a whole number of concurrent launches inside the
12174
+ * supported range, because the Host schema (`runLaunchWidth`) is numeric. A
12175
+ * draft outside the range blocks the save instead of staging a value the Host
12176
+ * would clamp behind the user's back.
11542
12177
  */
11543
- function judgeModelField() {
12178
+ function runLaunchWidthField() {
11544
12179
  return {
11545
- field: "goalVerificationModel",
11546
- format: (value) => typeof value === "string" ? value : "",
12180
+ field: "runLaunchWidth",
12181
+ format: (value) => typeof value === "number" && Number.isInteger(value) ? String(value) : "",
11547
12182
  parse: (text) => {
11548
12183
  const trimmed = text.trim();
11549
12184
  if (trimmed === "") return { kind: "clear" };
11550
- return parseModelRoute(trimmed) === void 0 ? void 0 : {
12185
+ if (!/^\d+$/.test(trimmed)) return void 0;
12186
+ const width = Number(trimmed);
12187
+ return width >= 1 && width <= 16 ? {
11551
12188
  kind: "set",
11552
- value: trimmed
12189
+ value: width
12190
+ } : void 0;
12191
+ }
12192
+ };
12193
+ }
12194
+ /**
12195
+ * The daily token cap field: whole tokens, 0 for "no gate". Every non-negative
12196
+ * whole number is a legal cap, so the draft only has to be one; a blank draft
12197
+ * clears the entry back to the schema default (0).
12198
+ */
12199
+ function spendBudgetField() {
12200
+ return {
12201
+ field: "spendBudgetTokens",
12202
+ format: (value) => typeof value === "number" && Number.isInteger(value) ? String(value) : "",
12203
+ parse: (text) => {
12204
+ const trimmed = text.trim();
12205
+ if (trimmed === "") return { kind: "clear" };
12206
+ if (!/^\d+$/.test(trimmed)) return void 0;
12207
+ return {
12208
+ kind: "set",
12209
+ value: Number(trimmed)
11553
12210
  };
11554
12211
  }
11555
12212
  };
11556
12213
  }
11557
12214
  /**
11558
- * The reasoning-effort field. Any non-blank id is staged: which levels a model
11559
- * accepts is decided by the host catalog, and the settings card shows the
11560
- * resolved level (including a fallback) rather than guessing here.
12215
+ * The judge-model field: blank inherits the host model catalog default, and a
12216
+ * non-blank draft must be a qualified provider/model route. An unparseable
12217
+ * draft blocks the save instead of storing a route nothing can resolve.
12218
+ * The new-card default model uses the same gate, so both fields accept exactly
12219
+ * the routes an execution can pin.
11561
12220
  */
11562
- function judgeEffortField() {
12221
+ function modelRouteField(field) {
11563
12222
  return {
11564
- field: "goalVerificationReasoningEffort",
12223
+ field,
11565
12224
  format: (value) => typeof value === "string" ? value : "",
11566
12225
  parse: (text) => {
11567
12226
  const trimmed = text.trim();
11568
- return trimmed === "" ? { kind: "clear" } : {
12227
+ if (trimmed === "") return { kind: "clear" };
12228
+ return parseModelRoute(trimmed) === void 0 ? void 0 : {
11569
12229
  kind: "set",
11570
12230
  value: trimmed
11571
12231
  };
@@ -11577,6 +12237,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11577
12237
  dispatch;
11578
12238
  form;
11579
12239
  store;
12240
+ /** The deployment's agent-preset roster, once its runtime read has answered. */
12241
+ presets;
11580
12242
  /** @param scope - the bound configuration form for the `task-board` namespace. */
11581
12243
  constructor(scope, dispatch) {
11582
12244
  this.dispatch = dispatch;
@@ -11586,10 +12248,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11586
12248
  booleanField("preventIdleSleep"),
11587
12249
  subtaskDepthField(),
11588
12250
  sessionPollField(),
12251
+ runLaunchWidthField(),
12252
+ spendBudgetField(),
11589
12253
  booleanField("goalRunEnabled"),
11590
12254
  booleanField("goalVerification"),
11591
- judgeModelField(),
11592
- judgeEffortField()
12255
+ modelRouteField("goalVerificationModel"),
12256
+ textField("goalVerificationReasoningEffort"),
12257
+ textField("cardDefaultMode"),
12258
+ choiceField("cardDefaultPermission", TASK_PERMISSIONS),
12259
+ modelRouteField("cardDefaultModel"),
12260
+ textField("cardDefaultReasoningEffort")
11593
12261
  ]);
11594
12262
  this.store = this.form.bind(() => this.projection());
11595
12263
  }
@@ -11601,13 +12269,33 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11601
12269
  preventIdleSleep: this.form.field("preventIdleSleep"),
11602
12270
  maxSubtaskDepth: this.form.field("maxSubtaskDepth"),
11603
12271
  sessionPollSeconds: this.form.field("sessionPollSeconds"),
12272
+ runLaunchWidth: this.form.field("runLaunchWidth"),
12273
+ spendBudgetTokens: this.form.field("spendBudgetTokens"),
11604
12274
  goalRunEnabled: this.form.field("goalRunEnabled"),
11605
12275
  goalVerification: this.form.field("goalVerification"),
11606
12276
  goalVerificationModel: this.form.field("goalVerificationModel"),
11607
- goalVerificationReasoningEffort: this.form.field("goalVerificationReasoningEffort")
12277
+ goalVerificationReasoningEffort: this.form.field("goalVerificationReasoningEffort"),
12278
+ cardDefaultMode: this.form.field("cardDefaultMode"),
12279
+ cardDefaultPermission: this.form.field("cardDefaultPermission"),
12280
+ cardDefaultModel: this.form.field("cardDefaultModel"),
12281
+ cardDefaultReasoningEffort: this.form.field("cardDefaultReasoningEffort"),
12282
+ ...this.presets === void 0 ? {} : { presets: this.presets }
11608
12283
  };
11609
12284
  }
11610
12285
  /**
12286
+ * Publish the deployment's agent-preset roster to the default-preset field.
12287
+ * The roster is a runtime fact read outside this card (src/client/index.ts
12288
+ * wires it once for both the board's pickers and this topic); it can arrive
12289
+ * late or not at all, and until it does the field lists the inherit choice
12290
+ * alone. This never blocks a save: a deployment that serves no roster still
12291
+ * has a writable settings document.
12292
+ * @param presets - the roster rows.
12293
+ */
12294
+ setPresetRoster(presets) {
12295
+ this.presets = presets;
12296
+ this.store.set(this.projection());
12297
+ }
12298
+ /**
11611
12299
  * Build the face the card's slot registration injects.
11612
12300
  * @returns the card's snapshot and its form actions.
11613
12301
  */
@@ -11723,6 +12411,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11723
12411
  invalidLabel: t("settings.invalidNumber"),
11724
12412
  disabled
11725
12413
  };
12414
+ const defaultModels = modelOptionsFromCatalog(catalog);
12415
+ const defaultModel = state.cardDefaultModel.text;
12416
+ const defaultEffortChoices = reasoningEffortsFor(defaultModels, defaultModel).map((effort) => ({
12417
+ value: effort,
12418
+ label: effort
12419
+ }));
12420
+ /**
12421
+ * Drop a staged default level the newly picked default model cannot honour,
12422
+ * exactly as the create dialog's own model picker does (one shared rule):
12423
+ * the level belongs to the route it was chosen for.
12424
+ */
12425
+ const dropUnhonouredEffort = (nextModel) => {
12426
+ const current = state.cardDefaultReasoningEffort.text;
12427
+ const kept = reconcileReasoningEffort(defaultModels, nextModel, current);
12428
+ if (kept !== current) props.edit("cardDefaultReasoningEffort", kept);
12429
+ };
11726
12430
  const nestedShell = {
11727
12431
  available: true,
11728
12432
  exposed: true,
@@ -11835,6 +12539,34 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11835
12539
  onReset: () => {
11836
12540
  props.resetField("maxSubtaskDepth");
11837
12541
  }
12542
+ }),
12543
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
12544
+ id: "settings-task-board-run-launch-width",
12545
+ label: t("settings.runLaunchWidth"),
12546
+ hint: t("settings.runLaunchWidthHint"),
12547
+ numeric: true,
12548
+ ...fieldProps,
12549
+ ...state.runLaunchWidth,
12550
+ onEdit: (text) => {
12551
+ props.edit("runLaunchWidth", text);
12552
+ },
12553
+ onReset: () => {
12554
+ props.resetField("runLaunchWidth");
12555
+ }
12556
+ }),
12557
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
12558
+ id: "settings-task-board-spend-budget",
12559
+ label: t("settings.spendBudgetTokens"),
12560
+ hint: t("settings.spendBudgetTokensHint"),
12561
+ numeric: true,
12562
+ ...fieldProps,
12563
+ ...state.spendBudgetTokens,
12564
+ onEdit: (text) => {
12565
+ props.edit("spendBudgetTokens", text);
12566
+ },
12567
+ onReset: () => {
12568
+ props.resetField("spendBudgetTokens");
12569
+ }
11838
12570
  })
11839
12571
  ]
11840
12572
  }),
@@ -11949,6 +12681,83 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11949
12681
  })
11950
12682
  ]
11951
12683
  }),
12684
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PluginSettingsCard, {
12685
+ t,
12686
+ titleKey: "settings.cardDefaultsTitle",
12687
+ descriptionKey: "settings.cardDefaultsCardHint",
12688
+ defaultOpen: false,
12689
+ hideFooter: true,
12690
+ state: nestedShell,
12691
+ onSave: props.save,
12692
+ onDiscard: props.discard,
12693
+ children: [
12694
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardDefaultPresetField, {
12695
+ id: "settings-task-board-card-default-mode",
12696
+ label: t("new.agentPreset"),
12697
+ hint: t("settings.cardDefaultModeHint"),
12698
+ presets: state.presets,
12699
+ ...fieldProps,
12700
+ ...state.cardDefaultMode,
12701
+ onEdit: (text) => {
12702
+ props.edit("cardDefaultMode", text);
12703
+ },
12704
+ onReset: () => {
12705
+ props.resetField("cardDefaultMode");
12706
+ }
12707
+ }),
12708
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
12709
+ id: "settings-task-board-card-default-permission",
12710
+ label: t("new.permission"),
12711
+ hint: t("settings.cardDefaultPermissionHint"),
12712
+ inheritLabel: t("exec.permission.default"),
12713
+ choices: TASK_PERMISSIONS.map((id) => ({
12714
+ value: id,
12715
+ label: t(`exec.permission.${id}`)
12716
+ })),
12717
+ ...fieldProps,
12718
+ ...state.cardDefaultPermission,
12719
+ onEdit: (text) => {
12720
+ props.edit("cardDefaultPermission", text);
12721
+ },
12722
+ onReset: () => {
12723
+ props.resetField("cardDefaultPermission");
12724
+ }
12725
+ }),
12726
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
12727
+ id: "settings-task-board-card-default-model",
12728
+ label: t("new.model"),
12729
+ hint: t("settings.cardDefaultModelHint"),
12730
+ inheritLabel: t("exec.model.default"),
12731
+ choices: modelChoiceRows(defaultModels),
12732
+ ...fieldProps,
12733
+ ...state.cardDefaultModel,
12734
+ onEdit: (text) => {
12735
+ props.edit("cardDefaultModel", text);
12736
+ dropUnhonouredEffort(text);
12737
+ },
12738
+ onReset: () => {
12739
+ props.resetField("cardDefaultModel");
12740
+ dropUnhonouredEffort("");
12741
+ }
12742
+ }),
12743
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
12744
+ id: "settings-task-board-card-default-effort",
12745
+ label: t("exec.reasoning"),
12746
+ hint: t(reasoningHintKey(defaultModels, defaultModel)),
12747
+ inheritLabel: t("exec.reasoning.inherit"),
12748
+ choices: defaultEffortChoices,
12749
+ ...fieldProps,
12750
+ ...state.cardDefaultReasoningEffort,
12751
+ disabled: disabled || !reasoningPickerEnabled(defaultModels, defaultModel),
12752
+ onEdit: (text) => {
12753
+ props.edit("cardDefaultReasoningEffort", text);
12754
+ },
12755
+ onReset: () => {
12756
+ props.resetField("cardDefaultReasoningEffort");
12757
+ }
12758
+ })
12759
+ ]
12760
+ }),
11952
12761
  renderSlot("task-board.settings.section", { dispatch })
11953
12762
  ]
11954
12763
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -12330,17 +13139,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12330
13139
  };
12331
13140
  //#endregion
12332
13141
  //#region src/client/telemetry.ts
13142
+ /** localStorage key carrying the family-wide telemetry opt-out ('1' = off). */
13143
+ const TELEMETRY_OPT_OUT_KEY = "dsh-web-ui-telemetry-opt-out";
12333
13144
  const VISITOR_KEY = "dsh-web-ui-telemetry-visitor";
12334
13145
  const DAY_KEY_PREFIX = "dsh-web-ui-telemetry-day:";
12335
13146
  const ENDPOINT = "https://dsh-market.com/api/telemetry/event";
12336
13147
  /** The building package's version, when the bundle carries it. */
12337
13148
  function bakedVersion() {
12338
13149
  try {
12339
- return "0.4.6";
13150
+ return "0.4.8";
12340
13151
  } catch {
12341
13152
  return;
12342
13153
  }
12343
13154
  }
13155
+ /** Whether the user switched the family-wide opt-out on (reads storage only). */
13156
+ function isTelemetryOptedOut() {
13157
+ try {
13158
+ return localStorage.getItem(TELEMETRY_OPT_OUT_KEY) === "1";
13159
+ } catch {
13160
+ return false;
13161
+ }
13162
+ }
13163
+ /** Whether the browser itself asks not to be tracked; a failed read means no signal. */
13164
+ function doNotTrackRequested() {
13165
+ try {
13166
+ return navigator.doNotTrack === "1" || navigator.doNotTrack === "yes";
13167
+ } catch {
13168
+ return false;
13169
+ }
13170
+ }
13171
+ /** Whether a heartbeat must be suppressed right now: opt-out stored, or the browser asks not to be tracked. */
13172
+ function isTelemetrySuppressed() {
13173
+ return isTelemetryOptedOut() || doNotTrackRequested();
13174
+ }
12344
13175
  /** Read or lazily create the anonymous visitor id; null when storage is unavailable. */
12345
13176
  function visitorId() {
12346
13177
  try {
@@ -12369,6 +13200,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12369
13200
  */
12370
13201
  function reportDailyHeartbeat(items) {
12371
13202
  try {
13203
+ if (isTelemetrySuppressed()) return;
12372
13204
  if (items.length === 0) return;
12373
13205
  const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
12374
13206
  if (navigator.webdriver) return;
@@ -12535,8 +13367,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12535
13367
  base: void 0,
12536
13368
  user: void 0,
12537
13369
  revision: void 0,
12538
- writable: false,
12539
- mode: "host"
13370
+ writable: false
12540
13371
  };
12541
13372
  }
12542
13373
  /**
@@ -12728,25 +13559,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12728
13559
  "layout"
12729
13560
  ];
12730
13561
  /**
12731
- * Read the agent-preset roster through the generated api-remotes face. The
12732
- * caller passes the namespace resolved inside its scoped inject, so a host
12733
- * that serves no such namespace never reaches here; a host that serves it
12734
- * answers `ok: false` instead, which leaves the picker options untouched.
12735
- * @param remote - the `remote.agentPresets` namespace.
12736
- * @returns the roster, or a failed read the caller ignores.
12737
- */
12738
- async function readPresetRoster(remote) {
12739
- const response = await remote.list();
12740
- if (!response.ok) return {
12741
- ok: false,
12742
- presets: []
12743
- };
12744
- return {
12745
- ok: true,
12746
- presets: response.value.presets
12747
- };
12748
- }
12749
- /**
12750
13562
  * Mount the task board.
12751
13563
  * @param ctx - client root context (services: sessions, workspaces).
12752
13564
  */
@@ -12789,6 +13601,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12789
13601
  ctx.effect(() => () => {
12790
13602
  settingsCard.dispose();
12791
13603
  }, "task-board: settings card");
13604
+ let presetRoster;
13605
+ let liveController;
13606
+ const pushPresetOptions = async (presetRemote) => {
13607
+ try {
13608
+ const roster = await readPresetRoster(presetRemote);
13609
+ if (!roster.ok) return;
13610
+ const presets = presetOptionsFromRoster(roster.presets);
13611
+ presetRoster = presets;
13612
+ settingsCard.setPresetRoster(presets);
13613
+ liveController?.setExecutionOptions({ presets });
13614
+ } catch (error) {
13615
+ console.error("[dsh-task-board] agent preset roster read failed", error);
13616
+ }
13617
+ };
13618
+ const presetRosterFeed = ctx.inject(["remote.agentPresets"], (inner) => {
13619
+ const presetRemote = inner.get("remote.agentPresets");
13620
+ if (presetRemote === void 0) return;
13621
+ pushPresetOptions(presetRemote);
13622
+ return inner.on("connection/reset", () => {
13623
+ pushPresetOptions(presetRemote);
13624
+ });
13625
+ });
13626
+ ctx.effect(() => () => {
13627
+ presetRosterFeed.dispose();
13628
+ }, "task-board: agent preset roster");
12792
13629
  let uiDisposer;
12793
13630
  const mountUi = () => {
12794
13631
  if (uiDisposer !== void 0) return;
@@ -12810,6 +13647,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12810
13647
  controller.start();
12811
13648
  clientService.attach(controller);
12812
13649
  const disposers = [];
13650
+ liveController = controller;
13651
+ if (presetRoster !== void 0) controller.setExecutionOptions({ presets: presetRoster });
13652
+ let followedDefaults = cardDefaultSignature(settingsForm.getSnapshot().value);
13653
+ disposers.push(settingsForm.subscribe(() => {
13654
+ const next = cardDefaultSignature(settingsForm.getSnapshot().value);
13655
+ if (next === followedDefaults) return;
13656
+ followedDefaults = next;
13657
+ controller.refreshHostState();
13658
+ }));
12813
13659
  const pushWorkspaceOptions = () => {
12814
13660
  const snapshot = workspaces.list.getSnapshot();
12815
13661
  controller.setExecutionOptions({ workspaces: snapshot.items.map((item) => ({
@@ -12822,32 +13668,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12822
13668
  controller.setWorkspaceCreator(async (path) => {
12823
13669
  return { workspaceId: (await workspaces.create({ path })).workspaceId };
12824
13670
  });
12825
- const pushPresetOptions = async (presetRemote) => {
12826
- try {
12827
- const roster = await readPresetRoster(presetRemote);
12828
- if (!roster.ok) return;
12829
- controller.setExecutionOptions({ presets: roster.presets.map((preset) => ({
12830
- id: preset.id,
12831
- name: preset.name,
12832
- description: preset.description,
12833
- broken: preset.broken,
12834
- isDefault: preset.isDefault
12835
- })) });
12836
- } catch (error) {
12837
- console.error("[dsh-task-board] agent preset roster read failed", error);
12838
- }
12839
- };
12840
- const presetRosterFeed = ctx.inject(["remote.agentPresets"], (inner) => {
12841
- const presetRemote = inner.get("remote.agentPresets");
12842
- if (presetRemote === void 0) return;
12843
- pushPresetOptions(presetRemote);
12844
- return inner.on("connection/reset", () => {
12845
- pushPresetOptions(presetRemote);
12846
- });
12847
- });
12848
- disposers.push(() => {
12849
- presetRosterFeed.dispose();
12850
- });
12851
13671
  const pushModelOptions = async () => {
12852
13672
  try {
12853
13673
  let models = [];
@@ -12859,43 +13679,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12859
13679
  }
12860
13680
  if (typeof sessionRemote?.modelCatalog === "function") {
12861
13681
  const res = await sessionRemote.modelCatalog();
12862
- if (res.ok && Array.isArray(res.value?.groups)) for (const g of res.value.groups) {
12863
- const provider = g.id ?? g.provider;
12864
- for (const m of g.models ?? []) {
12865
- const qualifiedId = provider ? `${provider}/${m.id}` : m.id;
12866
- models.push({
12867
- id: qualifiedId,
12868
- name: m.name ?? m.id,
12869
- provider
12870
- });
12871
- }
12872
- }
13682
+ if (res.ok) models = modelOptionsFromCatalog(res.value);
12873
13683
  }
12874
13684
  if (models.length === 0) {
12875
13685
  const conn = ctx.get("connection");
12876
13686
  if (conn?.api) {
12877
- if (typeof conn.api.llm?.discoverModels === "function") {
12878
- const list = (await conn.api.llm.discoverModels())?.result?.value?.models;
12879
- if (Array.isArray(list)) models = list.map((m) => ({
12880
- id: m.id,
12881
- name: m.name
12882
- }));
12883
- }
13687
+ if (typeof conn.api.llm?.discoverModels === "function") models = modelOptionsFromDiscoveredModels((await conn.api.llm.discoverModels())?.result?.value?.models);
12884
13688
  const catalogFn = typeof conn.api.session?.modelCatalog === "function" ? conn.api.session.modelCatalog : typeof conn.api.sessions?.modelCatalog === "function" ? conn.api.sessions.modelCatalog : void 0;
12885
- if (models.length === 0 && catalogFn !== void 0) {
12886
- const groups = (await catalogFn())?.result?.value?.groups;
12887
- if (Array.isArray(groups)) for (const g of groups) {
12888
- const provider = g.id ?? g.provider;
12889
- for (const m of g.models ?? []) {
12890
- const qualifiedId = provider ? `${provider}/${m.id}` : m.id;
12891
- models.push({
12892
- id: qualifiedId,
12893
- name: m.name ?? m.id,
12894
- provider
12895
- });
12896
- }
12897
- }
12898
- }
13689
+ if (models.length === 0 && catalogFn !== void 0) models = modelOptionsFromCatalog((await catalogFn())?.result?.value);
12899
13690
  }
12900
13691
  }
12901
13692
  if (models.length > 0) controller.setExecutionOptions({ models });
@@ -12925,6 +13716,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12925
13716
  for (const dispose of disposers.splice(0)) dispose();
12926
13717
  clientService.detach();
12927
13718
  controller.dispose();
13719
+ liveController = void 0;
12928
13720
  uiDisposer = void 0;
12929
13721
  };
12930
13722
  };
@@ -12966,6 +13758,26 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12966
13758
  });
12967
13759
  }
12968
13760
  /**
13761
+ * The four new-card defaults one settings document holds, as a change
13762
+ * signature.
13763
+ *
13764
+ * Deliberately nothing but those four keys: the settings form also carries the
13765
+ * board's own switches and the acceptance configuration, and an edit to one of
13766
+ * those says nothing about the defaults the create dialog prefills from. Not a
13767
+ * second normalization of Host state — the value never leaves this comparison.
13768
+ * @param value - the settings form's effective section, if it has one.
13769
+ * @returns a stable string that changes exactly when the defaults do.
13770
+ */
13771
+ function cardDefaultSignature(value) {
13772
+ const section = value ?? {};
13773
+ return JSON.stringify([
13774
+ section.cardDefaultMode,
13775
+ section.cardDefaultPermission,
13776
+ section.cardDefaultModel,
13777
+ section.cardDefaultReasoningEffort
13778
+ ]);
13779
+ }
13780
+ /**
12969
13781
  * The profile entry id this package's own row carries, for a page that serves
12970
13782
  * no family binder.
12971
13783
  *