@lokascript/compilation-service 2.9.4 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4219,6 +4219,37 @@ function parseTakeCommand(ctx, identifierNode) {
4219
4219
  }
4220
4220
  return CommandNodeBuilder.fromIdentifier(identifierNode).withArgs(...args).withModifiers(modifiers).endingAt(ctx.getPosition()).build();
4221
4221
  }
4222
+ function consumeViewTransitionTail(ctx, args) {
4223
+ if (!ctx.check("using")) {
4224
+ return false;
4225
+ }
4226
+ ctx.advance();
4227
+ if (!ctx.match("view")) {
4228
+ throw new Error("expected 'view transition' after 'using'");
4229
+ }
4230
+ if (!ctx.match("transition")) {
4231
+ throw new Error("expected 'transition' after 'using view'");
4232
+ }
4233
+ args.push(ctx.createIdentifier("using"));
4234
+ args.push(ctx.createIdentifier("view"));
4235
+ args.push(ctx.createIdentifier("transition"));
4236
+ return true;
4237
+ }
4238
+ function parseProcessCommand(ctx, identifierNode) {
4239
+ if (!ctx.check("partials")) {
4240
+ return null;
4241
+ }
4242
+ const args = [];
4243
+ consumeKeywordToArgs(ctx, "partials", args);
4244
+ if (consumeKeywordToArgs(ctx, KEYWORDS$1.IN, args)) {
4245
+ const contentArg = parseOneArgument(ctx, ["using"]);
4246
+ if (contentArg) {
4247
+ args.push(contentArg);
4248
+ }
4249
+ }
4250
+ consumeViewTransitionTail(ctx, args);
4251
+ return CommandNodeBuilder.fromIdentifier(identifierNode).withArgs(...args).endingAt(ctx.getPosition()).build();
4252
+ }
4222
4253
  function parseAddCommand(ctx, commandToken) {
4223
4254
  const args = [];
4224
4255
  if (ctx.match("{")) {
@@ -4326,6 +4357,7 @@ function parseSwapCommand(ctx, identifierNode) {
4326
4357
  args.push(contentExpr);
4327
4358
  }
4328
4359
  }
4360
+ consumeViewTransitionTail(ctx, args);
4329
4361
  return CommandNodeBuilder.fromIdentifier(identifierNode).withArgs(...args).endingAt(ctx.getPosition()).build();
4330
4362
  }
4331
4363
  function parseWaitCommand(ctx, commandToken) {
@@ -4789,6 +4821,8 @@ function parseCompoundCommand(ctx, identifierNode) {
4789
4821
  case "swap":
4790
4822
  case "morph":
4791
4823
  return parseSwapCommand(ctx, identifierNode);
4824
+ case "process":
4825
+ return parseProcessCommand(ctx, identifierNode) ?? parseRegularCommand(ctx, identifierNode);
4792
4826
  default:
4793
4827
  return parseRegularCommand(ctx, identifierNode);
4794
4828
  }
@@ -5101,6 +5135,9 @@ function parseTellCommand(ctx, identifierNode) {
5101
5135
  if (!target) {
5102
5136
  throw new Error("tell command requires a target expression");
5103
5137
  }
5138
+ if (ctx.check(KEYWORDS$1.TO)) {
5139
+ ctx.advance();
5140
+ }
5104
5141
  const commands = [];
5105
5142
  while (!ctx.isAtEnd()) {
5106
5143
  if (ctx.checkIsCommand()) {
@@ -5118,7 +5155,11 @@ function parseTellCommand(ctx, identifierNode) {
5118
5155
  if (ctx.match(KEYWORDS$1.AND) || ctx.match(KEYWORDS$1.THEN)) {
5119
5156
  continue;
5120
5157
  }
5121
- if (ctx.check(KEYWORDS$1.ELSE) || ctx.check(KEYWORDS$1.END)) {
5158
+ if (ctx.check(KEYWORDS$1.ELSE)) {
5159
+ break;
5160
+ }
5161
+ if (ctx.check(KEYWORDS$1.END)) {
5162
+ ctx.advance();
5122
5163
  break;
5123
5164
  }
5124
5165
  if (ctx.checkIsCommand()) {
@@ -7231,7 +7272,8 @@ var Parser = class _Parser {
7231
7272
  "closest",
7232
7273
  "js",
7233
7274
  "tell",
7234
- "fetch"
7275
+ "fetch",
7276
+ "process"
7235
7277
  ];
7236
7278
  if (this.semanticAdapter && !skipSemanticParsing.includes(commandName.toLowerCase())) {
7237
7279
  const remainingInput = this.getRemainingInput();
@@ -8149,6 +8191,12 @@ function createChildContext(parent, element) {
8149
8191
  function isHTMLElement$2(value) {
8150
8192
  return value !== null && typeof value === "object" && "nodeType" in value && value.nodeType === 1 && "tagName" in value && typeof value.tagName === "string" && "classList" in value;
8151
8193
  }
8194
+ function isInsertableNode(value) {
8195
+ if (value === null || typeof value !== "object")
8196
+ return false;
8197
+ const nodeType = value.nodeType;
8198
+ return nodeType === 1 || nodeType === 3 || nodeType === 11;
8199
+ }
8152
8200
  function isNodeList(value) {
8153
8201
  return value !== null && typeof value === "object" && "length" in value && typeof value.length === "number" && (Symbol.iterator in value || typeof value.item === "function");
8154
8202
  }
@@ -9920,6 +9968,11 @@ function evaluateLiteral(node) {
9920
9968
  }
9921
9969
  async function evaluateIdentifier(node, context) {
9922
9970
  const name = node.name;
9971
+ if (name.startsWith("$")) {
9972
+ notifyGlobalRead(name.slice(1), context);
9973
+ } else if (node.scope === "global") {
9974
+ notifyGlobalRead(name, context);
9975
+ }
9923
9976
  if (name === "me" || name === "my" || name === "I") {
9924
9977
  return getExpr(context, "me").evaluate(context);
9925
9978
  }
@@ -9939,7 +9992,6 @@ async function evaluateIdentifier(node, context) {
9939
9992
  return getExpr(context, "document").evaluate(context);
9940
9993
  }
9941
9994
  if (node.scope === "global" && context.globals?.has(name)) {
9942
- notifyGlobalRead(name, context);
9943
9995
  return context.globals.get(name);
9944
9996
  }
9945
9997
  if (node.scope === "element") {
@@ -9950,12 +10002,9 @@ async function evaluateIdentifier(node, context) {
9950
10002
  return context.locals.get(name);
9951
10003
  }
9952
10004
  if (context.globals && context.globals.has(name)) {
9953
- if (name.startsWith("$"))
9954
- notifyGlobalRead(name.slice(1), context);
9955
10005
  return context.globals.get(name);
9956
10006
  }
9957
10007
  if (name.startsWith("$") && context.globals && context.globals.has(name.slice(1))) {
9958
- notifyGlobalRead(name.slice(1), context);
9959
10008
  return context.globals.get(name.slice(1));
9960
10009
  }
9961
10010
  if (context[name] !== void 0) {
@@ -11196,7 +11245,7 @@ var CommandAdapterV2 = class {
11196
11245
  return {
11197
11246
  description: this.impl.metadata?.description || "",
11198
11247
  examples: this.impl.metadata?.examples || [],
11199
- syntax: Array.isArray(syntax) ? syntax.join(" | ") : syntax || ""
11248
+ syntax: typeof syntax === "string" ? syntax : syntax ? syntax.join(" | ") : ""
11200
11249
  };
11201
11250
  }
11202
11251
  async execute(context, ...args) {
@@ -11264,10 +11313,8 @@ var CommandAdapterV2 = class {
11264
11313
  }
11265
11314
  }
11266
11315
  validate(input) {
11267
- if (this.impl.validate) {
11268
- return this.impl.validate(input);
11269
- }
11270
- return { isValid: true, errors: [], suggestions: [] };
11316
+ const isValid = this.impl.validate ? this.impl.validate(input) : true;
11317
+ return { isValid, errors: [], suggestions: [] };
11271
11318
  }
11272
11319
  };
11273
11320
  var CommandRegistryV2 = class {
@@ -15928,7 +15975,7 @@ function command(config2) {
15928
15975
  };
15929
15976
  }
15930
15977
  function commandMeta(metadata) {
15931
- return { isBlocking: false, hasBody: false, version: "1.0.0", ...metadata };
15978
+ return { ...metadata };
15932
15979
  }
15933
15980
  function createFactory(CommandClass) {
15934
15981
  return () => new CommandClass();
@@ -16793,7 +16840,7 @@ function insertContent(target, content, position) {
16793
16840
  insertReplace(target, content);
16794
16841
  return;
16795
16842
  }
16796
- if (isHTMLElement$2(content)) {
16843
+ if (isInsertableNode(content)) {
16797
16844
  insertElement(target, content, position);
16798
16845
  } else {
16799
16846
  insertText(target, content, position);
@@ -16803,7 +16850,7 @@ function insertContentSemantic(target, content, position) {
16803
16850
  insertContent(target, content, toInsertPosition(position));
16804
16851
  }
16805
16852
  function insertReplace(target, content) {
16806
- if (isHTMLElement$2(content)) {
16853
+ if (isInsertableNode(content)) {
16807
16854
  target.innerHTML = "";
16808
16855
  target.appendChild(content);
16809
16856
  } else {
@@ -16847,6 +16894,52 @@ function insertText(target, content, position) {
16847
16894
  target.insertAdjacentText(domPosition, content);
16848
16895
  }
16849
16896
  }
16897
+ function moveOrInsert(parent, element, ref) {
16898
+ const p = parent;
16899
+ if (typeof p.moveBefore === "function" && element.isConnected && parent.isConnected) {
16900
+ try {
16901
+ p.moveBefore(element, ref);
16902
+ return;
16903
+ } catch {
16904
+ }
16905
+ }
16906
+ parent.insertBefore(element, ref);
16907
+ }
16908
+ function insertElementsInOrder(target, elements, position) {
16909
+ switch (position) {
16910
+ case "beforeend":
16911
+ for (const el of elements)
16912
+ moveOrInsert(target, el, null);
16913
+ break;
16914
+ case "afterbegin":
16915
+ for (let i = elements.length - 1; i >= 0; i--) {
16916
+ moveOrInsert(target, elements[i], target.firstChild);
16917
+ }
16918
+ break;
16919
+ case "beforebegin": {
16920
+ const parent = target.parentElement;
16921
+ if (!parent)
16922
+ return;
16923
+ for (const el of elements)
16924
+ moveOrInsert(parent, el, target);
16925
+ break;
16926
+ }
16927
+ case "afterend": {
16928
+ const parent = target.parentElement;
16929
+ if (!parent)
16930
+ return;
16931
+ for (let i = elements.length - 1; i >= 0; i--) {
16932
+ moveOrInsert(parent, elements[i], target.nextSibling);
16933
+ }
16934
+ break;
16935
+ }
16936
+ case "replace":
16937
+ target.innerHTML = "";
16938
+ for (const el of elements)
16939
+ moveOrInsert(target, el, null);
16940
+ break;
16941
+ }
16942
+ }
16850
16943
  function removeElement(element) {
16851
16944
  if (element.parentNode) {
16852
16945
  element.remove();
@@ -17876,7 +17969,11 @@ var PutCommand = (() => {
17876
17969
  } else {
17877
17970
  for (const t of targets) {
17878
17971
  const content = this.parseValue(value);
17879
- insertContentSemantic(t, content, position);
17972
+ if (Array.isArray(content)) {
17973
+ insertElementsInOrder(t, content, toInsertPosition(position));
17974
+ } else {
17975
+ insertContentSemantic(t, content, position);
17976
+ }
17880
17977
  }
17881
17978
  }
17882
17979
  return targets;
@@ -17908,6 +18005,11 @@ var PutCommand = (() => {
17908
18005
  parseValue(v2) {
17909
18006
  if (isHTMLElement$2(v2))
17910
18007
  return v2;
18008
+ if (Array.isArray(v2) && v2.length > 0 && v2.every(isHTMLElement$2)) {
18009
+ return v2;
18010
+ }
18011
+ if (isInsertableNode(v2))
18012
+ return v2;
17911
18013
  return v2 == null ? "" : String(v2);
17912
18014
  }
17913
18015
  looksLikeCss(s) {
@@ -19104,7 +19206,8 @@ var morphAdapter = {
19104
19206
  function getStartViewTransition() {
19105
19207
  if (typeof document === "undefined")
19106
19208
  return void 0;
19107
- return document.startViewTransition;
19209
+ const fn = document.startViewTransition;
19210
+ return typeof fn === "function" ? fn.bind(document) : void 0;
19108
19211
  }
19109
19212
  function isViewTransitionsSupported() {
19110
19213
  return typeof getStartViewTransition() === "function";
@@ -19341,7 +19444,7 @@ var SwapCommand = (() => {
19341
19444
  };
19342
19445
  }
19343
19446
  }
19344
- let useViewTransition = false;
19447
+ let useViewTransition = raw.modifiers?.viewTransition !== void 0;
19345
19448
  if (usingIndex !== -1) {
19346
19449
  const afterUsing = argKeywords.slice(usingIndex + 1);
19347
19450
  if (afterUsing.includes("view") && afterUsing.includes("transition")) {
@@ -19537,7 +19640,7 @@ var MorphCommand = (() => {
19537
19640
  const withIndex = argKeywords.findIndex((k) => k === "with");
19538
19641
  const overIndex = argKeywords.findIndex((k) => k === "over");
19539
19642
  const usingIndex = argKeywords.findIndex((k) => k === "using");
19540
- let useViewTransition = false;
19643
+ let useViewTransition = raw.modifiers?.viewTransition !== void 0;
19541
19644
  if (usingIndex !== -1) {
19542
19645
  const afterUsing = argKeywords.slice(usingIndex + 1);
19543
19646
  if (afterUsing.includes("view") && afterUsing.includes("transition")) {
@@ -19613,7 +19716,11 @@ var MorphCommand = (() => {
19613
19716
  })();
19614
19717
  _classThis.metadata = commandMeta({
19615
19718
  description: "Morph content into target elements (intelligent diffing, preserves state)",
19616
- syntax: ["morph <target> with <content>", "morph over <target> with <content>"],
19719
+ syntax: [
19720
+ "morph <target> with <content>",
19721
+ "morph over <target> with <content>",
19722
+ "morph <target> with <content> using view transition"
19723
+ ],
19617
19724
  examples: ["morph #target with it", "morph over #modal with fetchedContent"],
19618
19725
  sideEffects: ["dom-mutation"],
19619
19726
  category: "dom",
@@ -20237,24 +20344,32 @@ var ProcessPartialsCommand = (() => {
20237
20344
  if (!args || args.length === 0) {
20238
20345
  throw new Error("process partials command requires content argument");
20239
20346
  }
20240
- const evaluatedArgs = [];
20241
- const argStrings = [];
20242
- for (const arg of args) {
20243
- const evaluated = await evaluator.evaluate(arg, context);
20244
- evaluatedArgs.push(evaluated);
20245
- if (typeof evaluated === "string") {
20246
- argStrings.push(evaluated.toLowerCase());
20247
- }
20248
- }
20249
- const partialsIndex = argStrings.findIndex((s) => s === "partials");
20347
+ const keywordOf = (node) => {
20348
+ const n = node;
20349
+ if (!n || typeof n !== "object")
20350
+ return null;
20351
+ if (n.type === "identifier" && typeof n.name === "string")
20352
+ return n.name.toLowerCase();
20353
+ if (n.type === "literal" && typeof n.value === "string")
20354
+ return n.value.toLowerCase();
20355
+ return null;
20356
+ };
20357
+ const keywords = args.map(keywordOf);
20358
+ const partialsIndex = keywords.indexOf("partials");
20359
+ const inIndex = keywords.indexOf("in");
20360
+ let contentNode;
20250
20361
  if (partialsIndex === -1) {
20251
- throw new Error('process command expects "partials" keyword: process partials in <content>');
20252
- }
20253
- const inIndex = argStrings.findIndex((s) => s === "in");
20254
- if (inIndex === -1 || inIndex <= partialsIndex) {
20255
- throw new Error('process partials command expects "in" keyword: process partials in <content>');
20362
+ if (inIndex !== -1) {
20363
+ throw new Error('process command expects "partials" keyword: process partials in <content>');
20364
+ }
20365
+ contentNode = args[0];
20366
+ } else {
20367
+ if (inIndex === -1 || inIndex <= partialsIndex) {
20368
+ throw new Error('process partials command expects "in" keyword: process partials in <content>');
20369
+ }
20370
+ contentNode = args[inIndex + 1];
20256
20371
  }
20257
- const contentArg = evaluatedArgs[inIndex + 1];
20372
+ const contentArg = contentNode ? await evaluator.evaluate(contentNode, context) : void 0;
20258
20373
  let html;
20259
20374
  if (typeof contentArg === "string") {
20260
20375
  html = contentArg;
@@ -20265,10 +20380,10 @@ var ProcessPartialsCommand = (() => {
20265
20380
  } else {
20266
20381
  throw new Error("process partials: content must be an HTML string or element");
20267
20382
  }
20268
- const usingIndex = argStrings.findIndex((s) => s === "using");
20269
- let useViewTransition = false;
20383
+ let useViewTransition = raw.modifiers?.viewTransition !== void 0;
20384
+ const usingIndex = keywords.indexOf("using");
20270
20385
  if (usingIndex !== -1) {
20271
- const remaining = argStrings.slice(usingIndex + 1).join(" ");
20386
+ const remaining = keywords.slice(usingIndex + 1);
20272
20387
  if (remaining.includes("view") && remaining.includes("transition")) {
20273
20388
  useViewTransition = true;
20274
20389
  }
@@ -25863,6 +25978,7 @@ var Runtime = class extends RuntimeBase {
25863
25978
  return this.registry;
25864
25979
  }
25865
25980
  };
25981
+ var VERSION$1 = "2.10.0";
25866
25982
  function createLiteral$1(value, dataType) {
25867
25983
  return dataType ? { type: "literal", value, dataType } : { type: "literal", value };
25868
25984
  }
@@ -30140,14 +30256,26 @@ var MultilingualDSLImpl = class {
30140
30256
  }
30141
30257
  translate(input, fromLanguage, toLanguage) {
30142
30258
  if (isExplicitSyntax$1(input)) return input;
30143
- for (const language of [fromLanguage, toLanguage]) {
30144
- if (!this.profileProvider.getProfile(language)) {
30145
- throw new Error(
30146
- `translate() requires a grammar profile for language "${language}", but none is configured. Set 'grammarProfile' on the LanguageConfig for "${language}" in createMultilingualDSL() (parse/validate/compile do not need it), or inject a custom 'profileProvider'.`
30147
- );
30259
+ let node;
30260
+ try {
30261
+ node = this.parseWithConfidence(input, fromLanguage).node;
30262
+ } catch (parseError) {
30263
+ if (this.hasGrammarProfile(fromLanguage) && this.hasGrammarProfile(toLanguage)) {
30264
+ return this.transformer.transform(input, fromLanguage, toLanguage);
30148
30265
  }
30266
+ throw parseError;
30267
+ }
30268
+ const rendered = this.registry.getSupportedLanguages().includes(toLanguage) ? this.render(node, toLanguage) : null;
30269
+ if (rendered != null) return rendered;
30270
+ if (this.hasGrammarProfile(fromLanguage) && this.hasGrammarProfile(toLanguage)) {
30271
+ return this.transformer.transform(input, fromLanguage, toLanguage);
30149
30272
  }
30150
- return this.transformer.transform(input, fromLanguage, toLanguage);
30273
+ throw new Error(
30274
+ `translate() could not render action "${node.action}" in language "${toLanguage}": no custom renderer, domain renderer, or schema pattern covers it, and no grammar profile is configured for the transformer fallback. Either add "${toLanguage}" to the DSL's languages/renderer, or set 'grammarProfile' on its LanguageConfig in createMultilingualDSL() (parse/validate/compile do not need it).`
30275
+ );
30276
+ }
30277
+ hasGrammarProfile(language) {
30278
+ return this.profileProvider.getProfile(language) != null;
30151
30279
  }
30152
30280
  compile(input, language) {
30153
30281
  if (!this.codeGenerator) {
@@ -34400,6 +34528,8 @@ var initSchema;
34400
34528
  var behaviorSchema;
34401
34529
  var installSchema;
34402
34530
  var measureSchema;
34531
+ var USING_VIEW_MARKER_ALL_LANGS;
34532
+ var VIEW_TRANSITION_MANNER_ROLE;
34403
34533
  var swapSchema;
34404
34534
  var morphSchema;
34405
34535
  var beepSchema;
@@ -34422,7 +34552,6 @@ var init_command_schemas = __esm({
34422
34552
  category: "dom-class",
34423
34553
  primaryRole: "patient",
34424
34554
  // `toggle .active on #btn for 2s` \u2192 args ['.active'], modifiers { on, for }.
34425
- // NOTE: `duration` is read here but not declared in `roles` below.
34426
34555
  ast: { args: ["patient"], modifiers: { on: "destination", for: "duration" } },
34427
34556
  roles: [
34428
34557
  {
@@ -34432,7 +34561,13 @@ var init_command_schemas = __esm({
34432
34561
  expectedTypes: ["selector"],
34433
34562
  selectorKinds: ["class", "attribute"],
34434
34563
  svoPosition: 1,
34435
- sovPosition: 2
34564
+ sovPosition: 2,
34565
+ // zh: the transformer emits `\u5207\u6362 \u628a .active` (the profile's \u628a patient
34566
+ // marker), but natural zh writes `\u5207\u6362 .active` bare \u2014 the handcrafted
34567
+ // patterns' form. Optional accepts both; without it the generated
34568
+ // pattern REQUIRED \u628a and the slim bundles could not parse the bare
34569
+ // form at all. Same treatment as go's destination.
34570
+ markerOptional: { zh: true }
34436
34571
  },
34437
34572
  {
34438
34573
  role: "destination",
@@ -34770,6 +34905,8 @@ var init_command_schemas = __esm({
34770
34905
  markerOverride: {
34771
34906
  en: "",
34772
34907
  // No marker before destination in English: "set :x to 5"
34908
+ es: "",
34909
+ // "establecer x a 5" - no marker before variable (profile default `en` matched nothing)
34773
34910
  ja: "\u3092",
34774
34911
  // "x \u3092 10 \u306b \u8a2d\u5b9a" - variable gets object marker
34775
34912
  ko: "\uB97C",
@@ -34792,9 +34929,19 @@ var init_command_schemas = __esm({
34792
34929
  // generated hi set patterns carried the swapped markers and matched no
34793
34930
  // corpus, so the whole hi set-family (set-text/inner-html/style/attribute)
34794
34931
  // fell to the bare-event fallback (S6 set-trio).
34795
- hi: "\u0915\u094B"
34932
+ hi: "\u0915\u094B",
34796
34933
  // target (destination) gets \u0915\u094b
34797
- }
34934
+ // zh: the transformer emits the verb-first BA form `\u8bbe\u7f6e \u628a X \u5230 V`
34935
+ // (\u628a before the variable), while natural zh writes `\u8bbe\u7f6e X \u4e3a V`
34936
+ // (unmarked). \u628a as the marker, optional below, accepts both. The
34937
+ // profile default \u5728 matched neither form, so the generated zh set
34938
+ // patterns were dead weight and the slim bundles (schema-generated
34939
+ // patterns only) could not parse set at all.
34940
+ zh: "\u628A"
34941
+ },
34942
+ // Accept the unmarked natural form alongside the transformer's \u628a form
34943
+ // (same treatment as go's destination).
34944
+ markerOptional: { zh: true }
34798
34945
  },
34799
34946
  {
34800
34947
  role: "patient",
@@ -34837,8 +34984,14 @@ var init_command_schemas = __esm({
34837
34984
  // "x \u0995\u09c7 10 \u09a4\u09c7 \u09b8\u09c7\u099f" - destination marker on value
34838
34985
  qu: "man",
34839
34986
  // "x ta 10 man churay" - destination marker on value
34840
- hi: "\u092E\u0947\u0902"
34987
+ hi: "\u092E\u0947\u0902",
34841
34988
  // value (patient) gets \u092e\u0947\u0902 \u2014 see the destination note above
34989
+ // zh: the transformer/corpus form marks the value with \u5230 (`\u8bbe\u7f6e \u628a X
34990
+ // \u5230 V`); natural zh uses \u4e3a (`\u8bbe\u7f6e X \u4e3a V`). \u5230 is the override,
34991
+ // the \u4e3a-family rides along as variants (all merged as alternatives
34992
+ // by schemaMarkerAlternatives). Profile default \u628a was the PATIENT
34993
+ // marker, which never precedes set's value in either form.
34994
+ zh: "\u5230"
34842
34995
  },
34843
34996
  // Turkish dative is allomorphic under vowel harmony: the i18n transformer
34844
34997
  // emits `e` for quoted-string values (`"red" e`) but `-ya` for a value
@@ -34851,7 +35004,11 @@ var init_command_schemas = __esm({
34851
35004
  // not parse as a bare command while `t\u0131klama da @disabled i do\u011fru ya
34852
35005
  // ayarla` did. See STRUCTURAL_ARCS_ROADMAP.md (tr set-attribute).
34853
35006
  markerVariants: {
34854
- tr: ["e", "a", "ye", "ya"]
35007
+ tr: ["e", "a", "ye", "ya"],
35008
+ // Natural zh value markers (`\u8bbe\u7f6e X \u4e3a V`), simplified + traditional +
35009
+ // resultative \u2014 the handcrafted set-zh-full alternatives, kept parseable
35010
+ // alongside the transformer's \u5230 override above.
35011
+ zh: ["\u4E3A", "\u70BA", "\u6210"]
34855
35012
  }
34856
35013
  },
34857
35014
  {
@@ -35513,8 +35670,8 @@ var init_command_schemas = __esm({
35513
35670
  description: "Take content from a source element",
35514
35671
  category: "dom-content",
35515
35672
  primaryRole: "patient",
35516
- // `take .active from #parent` \u2192 args ['.active'], modifiers { from: '#parent' }.
35517
- ast: { args: ["patient"], modifiers: { from: "source" } },
35673
+ // `take .active from #parent for me` \u2192 args ['.active'], modifiers { from, for }.
35674
+ ast: { args: ["patient"], modifiers: { from: "source", for: "recipient" } },
35518
35675
  roles: [
35519
35676
  {
35520
35677
  role: "patient",
@@ -35537,6 +35694,38 @@ var init_command_schemas = __esm({
35537
35694
  expectedTypes: ["selector", "reference"],
35538
35695
  svoPosition: 2,
35539
35696
  sovPosition: 1
35697
+ },
35698
+ {
35699
+ role: "recipient",
35700
+ description: "The element the class moves ONTO (`take .active from .tab for me`)",
35701
+ required: false,
35702
+ // References only, deliberately. Upstream accepts an element expression,
35703
+ // but the 23 non-en corpus surfaces carry the recipient as a BARE
35704
+ // trailing pronoun (i18n renders `\u2026 von .tab-button ich`), so this slot
35705
+ // is marker-less almost everywhere and a selector-typed slot would
35706
+ // swallow the second selector of `take .active from .a .b`. English is
35707
+ // unaffected: `take` is on the core parser's skipSemanticParsing list,
35708
+ // so the traditional parser owns `for <anything>` there.
35709
+ expectedTypes: ["reference"],
35710
+ svoPosition: 3,
35711
+ sovPosition: 3,
35712
+ // NO default. The runtime already defaults the recipient to `me`
35713
+ // (commands/animation/take.ts), and a schema default would emit an
35714
+ // explicit `for me` modifier on every take \u2014 re-smuggling the exact
35715
+ // "absent means absent" semantics #859 removed from `source`.
35716
+ //
35717
+ // Shape-anchored on `reference`: without it this optional slot weighs
35718
+ // into every take pattern's denominator in `scoreRoleCoverage`, dropping
35719
+ // plain `take .active from .tab-button` from 1.0 to ~0.69 \u2014 the toggle-es
35720
+ // regression class the R1 role-set flip ratchet exists to catch.
35721
+ valueShape: "reference",
35722
+ // en only. The other 23 languages render the recipient unmarked, so a
35723
+ // marker there would never match their corpus rows; where the marker-less
35724
+ // slot proves inert they stay uncaptured and the pattern lands in the
35725
+ // baseline's `roleLossyPatterns` as named R1 burn-down tail. A language
35726
+ // gets a real particle here ONLY if the empty slot perturbs its other
35727
+ // parses (toggle's ja \u9593 / ko \ub3d9\uc548 case).
35728
+ markerOverride: { en: "for" }
35540
35729
  }
35541
35730
  ]
35542
35731
  };
@@ -36601,6 +36790,47 @@ var init_command_schemas = __esm({
36601
36790
  }
36602
36791
  ]
36603
36792
  };
36793
+ USING_VIEW_MARKER_ALL_LANGS = {
36794
+ en: "using view",
36795
+ es: "using view",
36796
+ pt: "using view",
36797
+ fr: "using view",
36798
+ de: "using view",
36799
+ it: "using view",
36800
+ ja: "using view",
36801
+ ko: "using view",
36802
+ zh: "using view",
36803
+ ar: "using view",
36804
+ he: "using view",
36805
+ hi: "using view",
36806
+ bn: "using view",
36807
+ tr: "using view",
36808
+ ru: "using view",
36809
+ uk: "using view",
36810
+ pl: "using view",
36811
+ id: "using view",
36812
+ vi: "using view",
36813
+ th: "using view",
36814
+ ms: "using view",
36815
+ tl: "using view",
36816
+ sw: "using view",
36817
+ qu: "using view"
36818
+ };
36819
+ VIEW_TRANSITION_MANNER_ROLE = {
36820
+ role: "manner",
36821
+ description: "Run the swap inside a `document.startViewTransition()` (`using view transition`)",
36822
+ required: false,
36823
+ // Both types, because the SAME word tokenizes differently per language and
36824
+ // the difference is an accident of vocabulary: `transition` is a command
36825
+ // keyword in en/fr (it is also their verb) and a bare identifier everywhere
36826
+ // else, which types it `literal` in the first group and `expression` in the
36827
+ // second. Measured: with `['literal']` alone only en and fr captured the
36828
+ // tail. Widening is safe precisely because the slot is marker-guarded \u2014
36829
+ // nothing reaches it until `using view` has matched.
36830
+ expectedTypes: ["literal", "expression"],
36831
+ valueShape: "keyword",
36832
+ markerOverride: USING_VIEW_MARKER_ALL_LANGS
36833
+ };
36604
36834
  swapSchema = {
36605
36835
  action: "swap",
36606
36836
  description: "Swap DOM content using various strategies (innerHTML, outerHTML, delete, etc.)",
@@ -36621,7 +36851,11 @@ var init_command_schemas = __esm({
36621
36851
  // work. Preserved verbatim by the Arc F migration (a faithful migration must
36622
36852
  // not change output) and pinned as two `drift` exemptions; this is the
36623
36853
  // behavior fix those entries were waiting for.
36624
- ast: { args: ["method", "destination", "patient"] },
36854
+ //
36855
+ // `manner` is the exception to "keyword-positional args": it rides as
36856
+ // `modifiers.viewTransition`, which SwapCommand.parseInput reads for presence
36857
+ // alongside its existing flat-args `using`/`view`/`transition` scan.
36858
+ ast: { args: ["method", "destination", "patient"], modifiers: { viewTransition: "manner" } },
36625
36859
  roles: [
36626
36860
  {
36627
36861
  role: "method",
@@ -36716,6 +36950,11 @@ var init_command_schemas = __esm({
36716
36950
  ar: "\u0628\u0640",
36717
36951
  tl: "nang"
36718
36952
  }
36953
+ },
36954
+ {
36955
+ ...VIEW_TRANSITION_MANNER_ROLE,
36956
+ svoPosition: 4,
36957
+ sovPosition: 4
36719
36958
  }
36720
36959
  ]
36721
36960
  };
@@ -36726,7 +36965,15 @@ var init_command_schemas = __esm({
36726
36965
  primaryRole: "patient",
36727
36966
  // `morph #list to it` \u2192 args [content], modifiers { on: element }.
36728
36967
  // Content is source or destination; the element being morphed is the patient.
36729
- ast: { args: [["source", "destination"]], modifiers: { on: "patient" } },
36968
+ //
36969
+ // `manner` rides as `modifiers.viewTransition`, same as swap/process \u2014
36970
+ // MorphCommand.parseInput reads it for presence alongside its existing
36971
+ // flat-args `using`/`view`/`transition` scan (the traditional-parser path,
36972
+ // which owns English because morph sits on SKIP_SEMANTIC_COMMANDS).
36973
+ ast: {
36974
+ args: [["source", "destination"]],
36975
+ modifiers: { on: "patient", viewTransition: "manner" }
36976
+ },
36730
36977
  roles: [
36731
36978
  {
36732
36979
  role: "patient",
@@ -36747,6 +36994,18 @@ var init_command_schemas = __esm({
36747
36994
  sovPosition: 2,
36748
36995
  markerOverride: { en: "to" }
36749
36996
  // "morph #target to it"
36997
+ },
36998
+ {
36999
+ // `morph #target to it using view transition` \u2014 the same tail as swap and
37000
+ // process, closed here for the same reason (#870's third-schema filing):
37001
+ // without the role the semantic parser matched morph at confidence 1.0
37002
+ // and stranded the tail, so every semantic-only consumer (multilingual
37003
+ // bundles, the bridge, `translate()`) silently dropped the animation
37004
+ // request in all 24 languages. Morph has NO hand-written patterns in any
37005
+ // language, so this schema role is the whole fix on the pattern side.
37006
+ ...VIEW_TRANSITION_MANNER_ROLE,
37007
+ svoPosition: 3,
37008
+ sovPosition: 3
36750
37009
  }
36751
37010
  ]
36752
37011
  };
@@ -36933,6 +37192,13 @@ var init_command_schemas = __esm({
36933
37192
  description: "Process hx-partial markup in HTML content",
36934
37193
  category: "dom-content",
36935
37194
  primaryRole: "patient",
37195
+ // `process partials in it` \u2192 args ['it']; the optional tail rides as
37196
+ // `modifiers.viewTransition`, which ProcessPartialsCommand.parseInput has
37197
+ // read since #861 (`raw.modifiers?.viewTransition !== undefined`). Without a
37198
+ // descriptor this schema fell through to `buildGenericCommand`, whose
37199
+ // modifier list is fixed (destination/duration/method/style) and would have
37200
+ // dropped a captured `manner` on the floor.
37201
+ ast: { args: ["patient"], modifiers: { viewTransition: "manner" } },
36936
37202
  roles: [
36937
37203
  {
36938
37204
  role: "patient",
@@ -36942,6 +37208,11 @@ var init_command_schemas = __esm({
36942
37208
  svoPosition: 1,
36943
37209
  sovPosition: 1,
36944
37210
  markerOverride: PARTIALS_IN_MARKER_ALL_LANGS
37211
+ },
37212
+ {
37213
+ ...VIEW_TRANSITION_MANNER_ROLE,
37214
+ svoPosition: 2,
37215
+ sovPosition: 2
36945
37216
  }
36946
37217
  ]
36947
37218
  };
@@ -38526,7 +38797,9 @@ var init_french = __esm({
38526
38797
  trigger: { primary: "d\xE9clencher", normalized: "trigger" },
38527
38798
  send: { primary: "envoyer", alternatives: ["envoie"], normalized: "send" },
38528
38799
  focus: { primary: "focaliser", alternatives: ["concentrer"], normalized: "focus" },
38529
- blur: { primary: "d\xE9focaliser", normalized: "blur" },
38800
+ // `d\u00e9focaliser` is an unattested infinitive; French pedagogy writes
38801
+ // `perte de focus` for the event (2026-07 terminology review).
38802
+ blur: { primary: "perte de focus", alternatives: ["d\xE9focaliser"], normalized: "blur" },
38530
38803
  // Phase 1 (v0.9.90): DOM / form state / debug
38531
38804
  // `vide` (adjective, "empty") is the i18n transformer's `is empty` predicate
38532
38805
  // form; `vider` is the verb ("to empty"). Accept both so the emptiness check
@@ -38539,7 +38812,13 @@ var init_french = __esm({
38539
38812
  reset: { primary: "r\xE9initialiser", alternatives: ["reinitialiser"], normalized: "reset" },
38540
38813
  breakpoint: { primary: "point-arr\xEAt", alternatives: ["point-arret"], normalized: "breakpoint" },
38541
38814
  go: { primary: "aller", alternatives: ["naviguer", "va"], normalized: "go" },
38542
- scroll: { primary: "d\xE9filer", alternatives: ["faire-d\xE9filer"], normalized: "scroll" },
38815
+ // MDN fr and the OQLF standardize the noun `d\u00e9filement` for the event; the
38816
+ // infinitive stays as an alternative.
38817
+ scroll: {
38818
+ primary: "d\xE9filement",
38819
+ alternatives: ["defilement", "d\xE9filer", "faire-d\xE9filer"],
38820
+ normalized: "scroll"
38821
+ },
38543
38822
  push: { primary: "pousser", normalized: "push" },
38544
38823
  replace: { primary: "remplacer", normalized: "replace" },
38545
38824
  process: { primary: "traiter", normalized: "process" },
@@ -38605,9 +38884,15 @@ var init_french = __esm({
38605
38884
  after: { primary: "apr\xE8s", normalized: "after" },
38606
38885
  // Common event names (for event handler patterns)
38607
38886
  click: { primary: "clic", alternatives: ["clique"], normalized: "click" },
38608
- // `resize` event (window-resize): dict emits redimensionner; register it so the
38609
- // event types as literal="resize" (matching en) instead of expression.
38610
- resize: { primary: "redimensionner", normalized: "resize" },
38887
+ // `resize` event (window-resize): the noun `redimensionnement` is the
38888
+ // attested event form ("lors du redimensionnement de la fen\u00eatre"). The dict
38889
+ // still emits redimensionner, kept as an alternative so the event keeps
38890
+ // typing as literal="resize" (matching en) instead of expression.
38891
+ resize: {
38892
+ primary: "redimensionnement",
38893
+ alternatives: ["redimensionner"],
38894
+ normalized: "resize"
38895
+ },
38611
38896
  hover: { primary: "survol", alternatives: ["survoler"], normalized: "hover" },
38612
38897
  submit: { primary: "soumission", alternatives: ["soumettre"], normalized: "submit" },
38613
38898
  input: { primary: "saisie", alternatives: ["entr\xE9e"], normalized: "input" },
@@ -42360,9 +42645,17 @@ var init_turkish = __esm({
42360
42645
  on: { primary: "\xFCzerinde", alternatives: ["zaman"], normalized: "on" },
42361
42646
  trigger: { primary: "tetikle", normalized: "trigger" },
42362
42647
  send: { primary: "g\xF6nder", normalized: "send" },
42363
- // DOM focus
42364
- focus: { primary: "odak", alternatives: ["odaklanma"], normalized: "focus" },
42365
- blur: { primary: "bulan\u0131k", alternatives: ["bulan\u0131kl\u0131k", "bulanik"], normalized: "blur" },
42648
+ // DOM focus. `odaklanma` (the act of focusing) leads over the static state
42649
+ // noun `odak` \u2014 Turkish event prose says "odaklanma olay\u0131". `bulan\u0131k` was
42650
+ // the optical blur (CSS filters, image processing), never the DOM event;
42651
+ // native usage is `odak kayb\u0131` (loss of focus). 2026-07 terminology-review
42652
+ // corrections; old forms stay as parse alternatives.
42653
+ focus: { primary: "odaklanma", alternatives: ["odak"], normalized: "focus" },
42654
+ blur: {
42655
+ primary: "odak kayb\u0131",
42656
+ alternatives: ["odak kaybi", "bulan\u0131k", "bulan\u0131kl\u0131k", "bulanik"],
42657
+ normalized: "blur"
42658
+ },
42366
42659
  // Phase 1 (v0.9.90): DOM / form state / debug
42367
42660
  empty: { primary: "bo\u015Falt", alternatives: ["bosalt", "bo\u015F"], normalized: "empty" },
42368
42661
  open: { primary: "a\xE7", alternatives: ["ac"], normalized: "open" },
@@ -42383,7 +42676,9 @@ var init_turkish = __esm({
42383
42676
  },
42384
42677
  hover: { primary: "\xFCzerine gelme", alternatives: ["\xFCzerinde gezinme"], normalized: "hover" },
42385
42678
  submit: { primary: "g\xF6nderme", normalized: "submit" },
42386
- input: { primary: "giri\u015F", alternatives: ["girdi", "giris"], normalized: "input" },
42679
+ // `giri\u015f` reads as entry/login (giri\u015f yapma) and can imply an auth event;
42680
+ // the data-input term is `girdi` ("Girdi (Input) Eventleri").
42681
+ input: { primary: "girdi", alternatives: ["giri\u015F", "giris"], normalized: "input" },
42387
42682
  change: { primary: "de\u011Fi\u015Fiklik", alternatives: ["de\u011Fi\u015Fim", "degisim"], normalized: "change" },
42388
42683
  // `load` event: the i18n dict emits y\u00fckle for `load`. Without this keyword the
42389
42684
  // SOV reorder's mid-stream `y\u00fckle de` (on load) tokenized as the `install`
@@ -42393,7 +42688,13 @@ var init_turkish = __esm({
42393
42688
  load: { primary: "y\xFCkle", normalized: "load" },
42394
42689
  // Navigation
42395
42690
  go: { primary: "git", normalized: "go" },
42396
- scroll: { primary: "kayd\u0131r", alternatives: ["kaydir"], normalized: "scroll" },
42691
+ // `kayd\u0131r` is the bare imperative; the attested event noun is `kayd\u0131rma`
42692
+ // ("kayd\u0131rma olay\u0131"). The imperative stays as an alternative.
42693
+ scroll: {
42694
+ primary: "kayd\u0131rma",
42695
+ alternatives: ["kaydirma", "kayd\u0131r", "kaydir"],
42696
+ normalized: "scroll"
42697
+ },
42397
42698
  push: { primary: "itele", alternatives: ["push"], normalized: "push" },
42398
42699
  replace: { primary: "de\u011Fi\u015Ftir_url", alternatives: ["degistir_url"], normalized: "replace" },
42399
42700
  process: { primary: "i\u015Fle", alternatives: ["isle"], normalized: "process" },
@@ -43339,6 +43640,58 @@ var init_chinese = __esm({
43339
43640
  };
43340
43641
  }
43341
43642
  });
43643
+ function resolveMarkerForRole(roleSpec, profile) {
43644
+ const overrideMarker = roleSpec.markerOverride?.[profile.code];
43645
+ const defaultMarker = profile.roleMarkers[roleSpec.role];
43646
+ if (overrideMarker !== void 0) {
43647
+ const alternatives = legacyMarkerAlternatives(roleSpec, profile.code, overrideMarker);
43648
+ return {
43649
+ primary: overrideMarker,
43650
+ ...alternatives && { alternatives },
43651
+ position: defaultMarker?.position ?? "before",
43652
+ isOverride: true
43653
+ };
43654
+ }
43655
+ if (defaultMarker && defaultMarker.primary) {
43656
+ const result = {
43657
+ primary: defaultMarker.primary,
43658
+ position: defaultMarker.position,
43659
+ isOverride: false
43660
+ };
43661
+ if (defaultMarker.alternatives) {
43662
+ result.alternatives = defaultMarker.alternatives;
43663
+ }
43664
+ return result;
43665
+ }
43666
+ return null;
43667
+ }
43668
+ function legacyMarkerAlternatives(roleSpec, languageCode, overrideMarker) {
43669
+ const legacy = roleSpec.markerLegacy?.[languageCode];
43670
+ if (!legacy?.length) return void 0;
43671
+ const alternatives = [...new Set(legacy)].filter((a) => a && a !== overrideMarker);
43672
+ return alternatives.length ? alternatives : void 0;
43673
+ }
43674
+ function schemaMarkerAlternatives(roleSpec, languageCode, marker) {
43675
+ const legacy = roleSpec.markerLegacy?.[languageCode] ?? [];
43676
+ const variants = roleSpec.methodCarrier ? [] : roleSpec.markerVariants?.[languageCode] ?? [];
43677
+ const alternatives = [.../* @__PURE__ */ new Set([...legacy, ...variants])].filter((a) => a && a !== marker);
43678
+ return alternatives.length ? alternatives : void 0;
43679
+ }
43680
+ var ROLE_MARKER_CONCEPTS;
43681
+ var init_marker_resolution = __esm({
43682
+ "src/parser/utils/marker-resolution.ts"() {
43683
+ ROLE_MARKER_CONCEPTS = /* @__PURE__ */ new Set([
43684
+ "destination",
43685
+ "source",
43686
+ "patient",
43687
+ "object",
43688
+ "event",
43689
+ "eventmarker",
43690
+ "manner",
43691
+ "instrument"
43692
+ ]);
43693
+ }
43694
+ });
43342
43695
  function getPutPatternsBn() {
43343
43696
  return [
43344
43697
  // SOV verb-final positional put: `{patient} <posWord> {destination} \u0995\u09c7 \u09b0\u09be\u0996\u09c1\u09a8`
@@ -58214,47 +58567,6 @@ var init_role_positioning = __esm({
58214
58567
  "src/parser/utils/role-positioning.ts"() {
58215
58568
  }
58216
58569
  });
58217
- function resolveMarkerForRole(roleSpec, profile) {
58218
- const overrideMarker = roleSpec.markerOverride?.[profile.code];
58219
- const defaultMarker = profile.roleMarkers[roleSpec.role];
58220
- if (overrideMarker !== void 0) {
58221
- const alternatives = legacyMarkerAlternatives(roleSpec, profile.code, overrideMarker);
58222
- return {
58223
- primary: overrideMarker,
58224
- ...alternatives && { alternatives },
58225
- position: defaultMarker?.position ?? "before",
58226
- isOverride: true
58227
- };
58228
- }
58229
- if (defaultMarker && defaultMarker.primary) {
58230
- const result = {
58231
- primary: defaultMarker.primary,
58232
- position: defaultMarker.position,
58233
- isOverride: false
58234
- };
58235
- if (defaultMarker.alternatives) {
58236
- result.alternatives = defaultMarker.alternatives;
58237
- }
58238
- return result;
58239
- }
58240
- return null;
58241
- }
58242
- function legacyMarkerAlternatives(roleSpec, languageCode, overrideMarker) {
58243
- const legacy = roleSpec.markerLegacy?.[languageCode];
58244
- if (!legacy?.length) return void 0;
58245
- const alternatives = [...new Set(legacy)].filter((a) => a && a !== overrideMarker);
58246
- return alternatives.length ? alternatives : void 0;
58247
- }
58248
- function schemaMarkerAlternatives(roleSpec, languageCode, marker) {
58249
- const legacy = roleSpec.markerLegacy?.[languageCode] ?? [];
58250
- const variants = roleSpec.methodCarrier ? [] : roleSpec.markerVariants?.[languageCode] ?? [];
58251
- const alternatives = [.../* @__PURE__ */ new Set([...legacy, ...variants])].filter((a) => a && a !== marker);
58252
- return alternatives.length ? alternatives : void 0;
58253
- }
58254
- var init_marker_resolution = __esm({
58255
- "src/parser/utils/marker-resolution.ts"() {
58256
- }
58257
- });
58258
58570
  function resolveRoleMarker(roleSpec, profile) {
58259
58571
  let marker;
58260
58572
  let alternatives;
@@ -58287,6 +58599,44 @@ function appendOptionalScope(tokens, extraction, commandSchema) {
58287
58599
  });
58288
58600
  extraction.scope = { fromRole: "scope" };
58289
58601
  }
58602
+ function appendOptionalViewTransition(tokens, extraction, commandSchema, languageCode) {
58603
+ appendOptionalTailRole(tokens, extraction, commandSchema, languageCode, "manner", {
58604
+ requireMarker: true
58605
+ });
58606
+ }
58607
+ function appendOptionalRecipient(tokens, extraction, commandSchema, languageCode) {
58608
+ appendOptionalTailRole(tokens, extraction, commandSchema, languageCode, "recipient", {
58609
+ requireMarker: false
58610
+ });
58611
+ }
58612
+ function appendOptionalTailRole(tokens, extraction, commandSchema, languageCode, role, opts) {
58613
+ const spec = commandSchema.roles.find((r) => r.role === role && !r.required);
58614
+ if (!spec) return;
58615
+ const marker = spec.markerOverride?.[languageCode];
58616
+ if (opts.requireMarker && !marker) return;
58617
+ tokens.push({
58618
+ type: "group",
58619
+ optional: true,
58620
+ tokens: [
58621
+ ...(marker ? marker.split(/\s+/) : []).map((word) => ({
58622
+ type: "literal",
58623
+ value: word
58624
+ })),
58625
+ {
58626
+ type: "role",
58627
+ role,
58628
+ optional: true,
58629
+ expectedTypes: spec.expectedTypes,
58630
+ // Load-bearing, same as on the generated command patterns: it exempts
58631
+ // the trailing slot from the matcher's verb guard, keeps the uncaptured
58632
+ // slot out of `scoreRoleCoverage`'s denominator, and (for `keyword`)
58633
+ // normalizes the captured value type to the EN reference's `literal`.
58634
+ ...spec.valueShape !== void 0 ? { valueShape: spec.valueShape } : {}
58635
+ }
58636
+ ]
58637
+ });
58638
+ extraction[role] = { fromRole: role };
58639
+ }
58290
58640
  function generateSOVEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config2) {
58291
58641
  const tokens = [];
58292
58642
  tokens.push({ type: "role", role: "event", optional: false });
@@ -58381,6 +58731,15 @@ function generateSOVPatientFirstEventHandlerPattern(commandSchema, profile, keyw
58381
58731
  tokens.push(
58382
58732
  ...swapsOperands ? eventHandlerPatientGroup(commandSchema, trailingMarker) : eventHandlerDestinationGroup(commandSchema, trailingMarker)
58383
58733
  );
58734
+ const extraction = {
58735
+ action: { value: commandSchema.action },
58736
+ event: { fromRole: "event" },
58737
+ [frontedRole]: { fromRole: frontedRole },
58738
+ ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
58739
+ ...eventHandlerSourceExtraction(commandSchema)
58740
+ };
58741
+ appendOptionalRecipient(tokens, extraction, commandSchema, profile.code);
58742
+ appendOptionalViewTransition(tokens, extraction, commandSchema, profile.code);
58384
58743
  return {
58385
58744
  id: `${commandSchema.action}-event-${profile.code}-sov-patient-first`,
58386
58745
  language: profile.code,
@@ -58390,13 +58749,71 @@ function generateSOVPatientFirstEventHandlerPattern(commandSchema, profile, keyw
58390
58749
  format: `{patient} ${patientMarker?.primary || ""} {event} ${eventMarker.primary} ${keyword.primary}`,
58391
58750
  tokens
58392
58751
  },
58393
- extraction: {
58394
- action: { value: commandSchema.action },
58395
- event: { fromRole: "event" },
58396
- [frontedRole]: { fromRole: frontedRole },
58397
- ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
58398
- ...eventHandlerSourceExtraction(commandSchema)
58752
+ extraction
58753
+ };
58754
+ }
58755
+ function generateSOVPatientFirstSourceFrontedEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config2) {
58756
+ const sourceSpec = commandSchema.roles.find((r) => r.role === "source");
58757
+ if (!sourceSpec) return null;
58758
+ const { marker: sourceMarker, alternatives: sourceAlts } = resolveRoleMarker(sourceSpec, profile);
58759
+ const patientMarker = profile.roleMarkers.patient;
58760
+ if (!sourceMarker) return null;
58761
+ if (sourceMarker === eventMarker.primary || sourceMarker === patientMarker?.primary) return null;
58762
+ const tokens = [];
58763
+ tokens.push({ type: "role", role: "patient", optional: false });
58764
+ if (patientMarker) {
58765
+ tokens.push(
58766
+ patientMarker.alternatives ? {
58767
+ type: "literal",
58768
+ value: patientMarker.primary,
58769
+ alternatives: patientMarker.alternatives
58770
+ } : { type: "literal", value: patientMarker.primary }
58771
+ );
58772
+ }
58773
+ tokens.push({
58774
+ type: "role",
58775
+ role: "source",
58776
+ optional: false,
58777
+ ...sourceSpec.expectedTypes ? { expectedTypes: sourceSpec.expectedTypes } : {},
58778
+ ...sourceSpec.valueShape !== void 0 ? { valueShape: sourceSpec.valueShape } : {}
58779
+ });
58780
+ for (const word of sourceMarker.split(/\s+/)) {
58781
+ tokens.push(
58782
+ sourceAlts && sourceMarker.split(/\s+/).length === 1 ? { type: "literal", value: word, alternatives: sourceAlts } : { type: "literal", value: word }
58783
+ );
58784
+ }
58785
+ tokens.push({ type: "role", role: "event", optional: false });
58786
+ if (eventMarker.position === "after") {
58787
+ const markerWords = eventMarker.primary.split(/\s+/);
58788
+ if (markerWords.length > 1) {
58789
+ for (const word of markerWords) tokens.push({ type: "literal", value: word });
58790
+ } else {
58791
+ tokens.push(
58792
+ eventMarker.alternatives ? { type: "literal", value: eventMarker.primary, alternatives: eventMarker.alternatives } : { type: "literal", value: eventMarker.primary }
58793
+ );
58399
58794
  }
58795
+ }
58796
+ tokens.push(
58797
+ keyword.alternatives ? { type: "literal", value: keyword.primary, alternatives: keyword.alternatives } : { type: "literal", value: keyword.primary }
58798
+ );
58799
+ const extraction = {
58800
+ action: { value: commandSchema.action },
58801
+ event: { fromRole: "event" },
58802
+ patient: { fromRole: "patient" },
58803
+ source: { fromRole: "source" }
58804
+ };
58805
+ appendOptionalRecipient(tokens, extraction, commandSchema, profile.code);
58806
+ appendOptionalViewTransition(tokens, extraction, commandSchema, profile.code);
58807
+ return {
58808
+ id: `${commandSchema.action}-event-${profile.code}-sov-source-fronted`,
58809
+ language: profile.code,
58810
+ command: "on",
58811
+ priority: (config2.basePriority ?? 100) + 48,
58812
+ template: {
58813
+ format: `{patient} ${patientMarker?.primary || ""} {source} ${sourceMarker} {event} ${eventMarker.primary} ${keyword.primary}`,
58814
+ tokens
58815
+ },
58816
+ extraction
58400
58817
  };
58401
58818
  }
58402
58819
  function generateSOVPatientFirstWithDestEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config2) {
@@ -58836,6 +59253,16 @@ function generateVSOVerbFirstEventHandlerPattern(commandSchema, profile, keyword
58836
59253
  });
58837
59254
  }
58838
59255
  }
59256
+ const extraction = {
59257
+ action: { value: commandSchema.action },
59258
+ event: { fromRole: "event" },
59259
+ [swapsOperands ? "destination" : "patient"]: {
59260
+ fromRole: swapsOperands ? "destination" : "patient"
59261
+ },
59262
+ ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
59263
+ ...eventHandlerSourceExtraction(commandSchema)
59264
+ };
59265
+ appendOptionalViewTransition(tokens, extraction, commandSchema, profile.code);
58839
59266
  return {
58840
59267
  id: `${commandSchema.action}-event-${profile.code}-vso-verb-first`,
58841
59268
  language: profile.code,
@@ -58846,15 +59273,7 @@ function generateVSOVerbFirstEventHandlerPattern(commandSchema, profile, keyword
58846
59273
  format: `${keyword.primary} {patient} ${destMarker?.primary || ""} {destination?} ${eventMarker.primary} {event}`,
58847
59274
  tokens
58848
59275
  },
58849
- extraction: {
58850
- action: { value: commandSchema.action },
58851
- event: { fromRole: "event" },
58852
- [swapsOperands ? "destination" : "patient"]: {
58853
- fromRole: swapsOperands ? "destination" : "patient"
58854
- },
58855
- ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
58856
- ...eventHandlerSourceExtraction(commandSchema)
58857
- }
59276
+ extraction
58858
59277
  };
58859
59278
  }
58860
59279
  function generateVSOVerbFirstTwoRoleEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config2) {
@@ -59295,6 +59714,14 @@ function generateEventHandlerPatterns(commandSchema, profile, config2 = defaultC
59295
59714
  config2
59296
59715
  )
59297
59716
  );
59717
+ const sourceFronted = generateSOVPatientFirstSourceFrontedEventHandlerPattern(
59718
+ commandSchema,
59719
+ profile,
59720
+ keyword,
59721
+ eventMarker,
59722
+ config2
59723
+ );
59724
+ if (sourceFronted) patterns.push(sourceFronted);
59298
59725
  const destMarkerCheck = profile.roleMarkers.destination;
59299
59726
  if (destMarkerCheck && destMarkerCheck.primary !== eventMarker.primary) {
59300
59727
  patterns.push(
@@ -59454,7 +59881,11 @@ function buildRoleToken(roleSpec, profile) {
59454
59881
  type: "role",
59455
59882
  role: roleSpec.role,
59456
59883
  optional: !roleSpec.required,
59457
- expectedTypes: roleSpec.expectedTypes
59884
+ expectedTypes: roleSpec.expectedTypes,
59885
+ // The matcher reads this too \u2014 a `'keyword'`-shaped slot holds a fixed
59886
+ // keyword phrase (`using view transition`) and must not be skipped by the
59887
+ // trailing-slot verb guard.
59888
+ ...roleSpec.valueShape !== void 0 ? { valueShape: roleSpec.valueShape } : {}
59458
59889
  };
59459
59890
  const prefixLiteral = roleSpec.valuePrefixLiteral?.[profile.code];
59460
59891
  const pushPrefixed = () => {
@@ -59762,6 +60193,7 @@ var init_pick = __esm({
59762
60193
  pickPatternsEn = [pickVariantEnglish];
59763
60194
  }
59764
60195
  });
60196
+ var VIEW_TRANSITION_TAIL;
59765
60197
  var swapSimpleEnglish;
59766
60198
  var swapElementEnglish;
59767
60199
  var swapStrategyOfEnglish;
@@ -59769,6 +60201,21 @@ var swapStrategyEnglish;
59769
60201
  var swapPatternsEn;
59770
60202
  var init_swap = __esm({
59771
60203
  "src/patterns/languages/en/swap.ts"() {
60204
+ VIEW_TRANSITION_TAIL = {
60205
+ type: "group",
60206
+ optional: true,
60207
+ tokens: [
60208
+ { type: "literal", value: "using" },
60209
+ { type: "literal", value: "view" },
60210
+ {
60211
+ type: "role",
60212
+ role: "manner",
60213
+ optional: true,
60214
+ expectedTypes: ["literal", "expression"],
60215
+ valueShape: "keyword"
60216
+ }
60217
+ ]
60218
+ };
59772
60219
  swapSimpleEnglish = {
59773
60220
  id: "swap-en-handcrafted",
59774
60221
  language: "en",
@@ -59776,11 +60223,12 @@ var init_swap = __esm({
59776
60223
  priority: 110,
59777
60224
  // Higher than generated patterns
59778
60225
  template: {
59779
- format: "swap {method} {destination}",
60226
+ format: "swap {method} {destination} [using view {manner}]",
59780
60227
  tokens: [
59781
60228
  { type: "literal", value: "swap" },
59782
60229
  { type: "role", role: "method" },
59783
- { type: "role", role: "destination" }
60230
+ { type: "role", role: "destination" },
60231
+ VIEW_TRANSITION_TAIL
59784
60232
  ]
59785
60233
  },
59786
60234
  extraction: {
@@ -59794,12 +60242,13 @@ var init_swap = __esm({
59794
60242
  command: "swap",
59795
60243
  priority: 120,
59796
60244
  template: {
59797
- format: "swap {destination} with {patient}",
60245
+ format: "swap {destination} with {patient} [using view {manner}]",
59798
60246
  tokens: [
59799
60247
  { type: "literal", value: "swap" },
59800
60248
  { type: "role", role: "destination" },
59801
60249
  { type: "literal", value: "with" },
59802
- { type: "role", role: "patient" }
60250
+ { type: "role", role: "patient" },
60251
+ VIEW_TRANSITION_TAIL
59803
60252
  ]
59804
60253
  },
59805
60254
  extraction: {}
@@ -59810,14 +60259,15 @@ var init_swap = __esm({
59810
60259
  command: "swap",
59811
60260
  priority: 140,
59812
60261
  template: {
59813
- format: "swap {method} of {destination} with {patient}",
60262
+ format: "swap {method} of {destination} with {patient} [using view {manner}]",
59814
60263
  tokens: [
59815
60264
  { type: "literal", value: "swap" },
59816
60265
  { type: "role", role: "method" },
59817
60266
  { type: "literal", value: "of" },
59818
60267
  { type: "role", role: "destination" },
59819
60268
  { type: "literal", value: "with" },
59820
- { type: "role", role: "patient" }
60269
+ { type: "role", role: "patient" },
60270
+ VIEW_TRANSITION_TAIL
59821
60271
  ]
59822
60272
  },
59823
60273
  extraction: {}
@@ -59828,13 +60278,14 @@ var init_swap = __esm({
59828
60278
  command: "swap",
59829
60279
  priority: 130,
59830
60280
  template: {
59831
- format: "swap {method} {destination} with {patient}",
60281
+ format: "swap {method} {destination} with {patient} [using view {manner}]",
59832
60282
  tokens: [
59833
60283
  { type: "literal", value: "swap" },
59834
60284
  { type: "role", role: "method" },
59835
60285
  { type: "role", role: "destination" },
59836
60286
  { type: "literal", value: "with" },
59837
- { type: "role", role: "patient" }
60287
+ { type: "role", role: "patient" },
60288
+ VIEW_TRANSITION_TAIL
59838
60289
  ]
59839
60290
  },
59840
60291
  extraction: {}
@@ -63325,6 +63776,7 @@ function isTypeCompatible(actualType, expectedTypes) {
63325
63776
  }
63326
63777
  return false;
63327
63778
  }
63779
+ init_marker_resolution();
63328
63780
  init_command_schemas();
63329
63781
  init_english();
63330
63782
  function getPossessiveReference(profile, keyword) {
@@ -63877,7 +64329,8 @@ var DefaultConfidenceModel = class {
63877
64329
  const hasDefault = (role) => {
63878
64330
  return pattern.extraction?.[role]?.default !== void 0;
63879
64331
  };
63880
- const schemaRoles = commandSchemas[pattern.command]?.roles;
64332
+ const wrappedAction = pattern.command === "on" ? pattern.extraction?.action?.value : void 0;
64333
+ const schemaRoles = commandSchemas[wrappedAction ?? pattern.command]?.roles;
63881
64334
  const isShapeAnchored = (role) => schemaRoles?.find((r) => r.role === role)?.valueShape !== void 0;
63882
64335
  for (const token of pattern.template.tokens) {
63883
64336
  if (token.type === "role") {
@@ -64270,7 +64723,7 @@ var _PatternMatcher2 = class _PatternMatcher3 {
64270
64723
  return patternToken.optional || false;
64271
64724
  }
64272
64725
  }
64273
- if (patternToken.optional && nextPatternToken === void 0 && patternToken.role !== "event" && patternToken.role !== "action" && token.kind === "keyword") {
64726
+ if (patternToken.optional && nextPatternToken === void 0 && patternToken.role !== "event" && patternToken.role !== "action" && patternToken.valueShape !== "keyword" && token.kind === "keyword") {
64274
64727
  const verbNorm = (token.normalized ?? token.value).toLowerCase();
64275
64728
  if (verbNorm in commandSchemas) {
64276
64729
  return true;
@@ -64425,7 +64878,14 @@ var _PatternMatcher2 = class _PatternMatcher3 {
64425
64878
  }
64426
64879
  }
64427
64880
  }
64428
- captured.set(patternToken.role, value);
64881
+ if (patternToken.valueShape === "keyword" && value.type === "expression") {
64882
+ captured.set(
64883
+ patternToken.role,
64884
+ createLiteral(String(value.raw ?? ""))
64885
+ );
64886
+ } else {
64887
+ captured.set(patternToken.role, value);
64888
+ }
64429
64889
  tokens.advance();
64430
64890
  if (patternToken.role === "event") {
64431
64891
  const filterTok = tokens.peek();
@@ -65014,17 +65474,7 @@ var _PatternMatcher2 = class _PatternMatcher3 {
65014
65474
  * so this never blocks a genuine `my value` / `its style` possessive.
65015
65475
  */
65016
65476
  isRoleMarkerConcept(normalized2) {
65017
- const markerConcepts = /* @__PURE__ */ new Set([
65018
- "destination",
65019
- "source",
65020
- "patient",
65021
- "object",
65022
- "event",
65023
- "eventmarker",
65024
- "manner",
65025
- "instrument"
65026
- ]);
65027
- return markerConcepts.has(normalized2.toLowerCase());
65477
+ return ROLE_MARKER_CONCEPTS.has(normalized2.toLowerCase());
65028
65478
  }
65029
65479
  /**
65030
65480
  * Does `token` look like an EVENT name for the `event` role? Events are bare
@@ -65410,7 +65860,7 @@ var _PatternMatcher2 = class _PatternMatcher3 {
65410
65860
  */
65411
65861
  matchGroupToken(tokens, patternToken, captured, nextPatternToken) {
65412
65862
  const mark = tokens.mark();
65413
- const capturedBefore = new Set(captured.keys());
65863
+ const capturedBefore = new Map(captured);
65414
65864
  const success = this.matchTokenSequence(
65415
65865
  tokens,
65416
65866
  patternToken.tokens,
@@ -65424,6 +65874,11 @@ var _PatternMatcher2 = class _PatternMatcher3 {
65424
65874
  captured.delete(role);
65425
65875
  }
65426
65876
  }
65877
+ for (const [role, value] of capturedBefore) {
65878
+ if (captured.get(role) !== value) {
65879
+ captured.set(role, value);
65880
+ }
65881
+ }
65427
65882
  return patternToken.optional || false;
65428
65883
  }
65429
65884
  return true;
@@ -65525,7 +65980,7 @@ var _PatternMatcher2 = class _PatternMatcher3 {
65525
65980
  } else if (rule.value !== void 0) {
65526
65981
  captured.set(role, { type: "literal", value: rule.value });
65527
65982
  } else if (rule.default) {
65528
- captured.set(role, rule.default);
65983
+ captured.set(role, { ...rule.default, implicit: true });
65529
65984
  }
65530
65985
  }
65531
65986
  }
@@ -65716,6 +66171,7 @@ function registerTokenizer2(tokenizer) {
65716
66171
  }
65717
66172
  init_registry();
65718
66173
  init_command_schemas();
66174
+ init_marker_resolution();
65719
66175
  init_registry();
65720
66176
  var OPENER_ACTIONS = ["if", "unless", "repeat", "for", "while"];
65721
66177
  var PASCAL_CASE_NAME = /^[A-Z][A-Za-z0-9_]*$/;
@@ -66373,14 +66829,20 @@ var SemanticRendererImpl = class {
66373
66829
  return parts.join(" ");
66374
66830
  }
66375
66831
  /**
66376
- * Join a statement list the way a block body reads: ` then ` between siblings,
66377
- * but a single space immediately after a loop/tell block header (whose body
66378
- * follows directly). Shared by renderConditional's branches; renderCompound
66379
- * keeps its own copy because it also handles the multi-handler and bind-feature
66380
- * cases.
66832
+ * Join a statement list the way a block body reads: the target language's `then`
66833
+ * between siblings, but a single space immediately after a loop/tell block header
66834
+ * (whose body follows directly). Used by renderConditional's branches;
66835
+ * renderCompound keeps its own copy because it also handles the multi-handler
66836
+ * and bind-feature cases.
66837
+ *
66838
+ * The chain word is localized (`this.keyword(language, 'then')`) for the same
66839
+ * reason renderCompound localizes it: a hardcoded English `then` leaks into every
66840
+ * non-en block body (`\u3082\u3057 \u2026 \u524a\u9664 then \u8ffd\u52a0`), which no target-language tokenizer
66841
+ * recognizes as a connector.
66381
66842
  */
66382
66843
  joinStatements(statements, language) {
66383
66844
  const rendered = statements.map((s) => this.render(s, language));
66845
+ const thenKw = this.keyword(language, "then");
66384
66846
  let out = rendered[0] ?? "";
66385
66847
  for (let i = 1; i < rendered.length; i++) {
66386
66848
  const prev = statements[i - 1];
@@ -66388,7 +66850,7 @@ var SemanticRendererImpl = class {
66388
66850
  if (prev.kind === "command" && BLOCK_NEEDS_TRAILING_END.has(prev.action)) {
66389
66851
  out += ` ${this.keyword(language, "end")}`;
66390
66852
  }
66391
- out += (afterBlockHeader ? " " : " then ") + rendered[i];
66853
+ out += (afterBlockHeader ? " " : ` ${thenKw} `) + rendered[i];
66392
66854
  }
66393
66855
  return out;
66394
66856
  }
@@ -66561,6 +67023,7 @@ var SemanticRendererImpl = class {
66561
67023
  if (!roleToken) continue;
66562
67024
  const roleValue = node.roles.get(roleName);
66563
67025
  if (roleValue?.type !== "reference" || roleValue.value !== "me") continue;
67026
+ if (!roleValue.implicit) continue;
66564
67027
  if (roleName === "destination") {
66565
67028
  const patient = node.roles.get("patient");
66566
67029
  if (patient?.type === "literal" && patient.dataType === "string") continue;
@@ -66998,7 +67461,7 @@ function fillSchemaDefaults(node) {
66998
67461
  const roles = node.roles;
66999
67462
  for (const spec of schema.roles) {
67000
67463
  if (spec.default !== void 0 && !roles.has(spec.role)) {
67001
- roles.set(spec.role, { ...spec.default });
67464
+ roles.set(spec.role, { ...spec.default, implicit: true });
67002
67465
  }
67003
67466
  }
67004
67467
  }
@@ -67584,7 +68047,7 @@ var _SemanticParserImpl = class _SemanticParserImpl2 {
67584
68047
  }
67585
68048
  let eventModifiers = patternMatcher.extractEventModifiers(tokens);
67586
68049
  const sourceValue = match.captured.get("source");
67587
- if (sourceValue && match.pattern.id.includes("source") && !(sourceValue.type === "reference" && sourceValue.value === "me")) {
68050
+ if (sourceValue && match.pattern.id.endsWith("source") && !(sourceValue.type === "reference" && sourceValue.value === "me")) {
67588
68051
  eventModifiers = { ...eventModifiers ?? {}, from: sourceValue };
67589
68052
  }
67590
68053
  const additionalEvents = this.extractOrConjunctionEvents(tokens, language);
@@ -67734,13 +68197,18 @@ var _SemanticParserImpl = class _SemanticParserImpl2 {
67734
68197
  if (!spec) return true;
67735
68198
  return spec.expectedTypes.length > 0 && !spec.expectedTypes.includes(valType(val));
67736
68199
  };
68200
+ const isMarkerConceptJunk = (role, val) => role === "patient" && !!schema && !schema.roles.some((r) => r.role === "patient") && valType(val) === "literal" && ROLE_MARKER_CONCEPTS.has(
68201
+ String(val.value ?? "").toLowerCase()
68202
+ );
67737
68203
  const preservesFused = !!first && first.kind === "command" && Object.entries(roles).every(([role, val]) => {
67738
- if (isIgnorableFusedRole(role, val)) return true;
68204
+ if (isIgnorableFusedRole(role, val) || isMarkerConceptJunk(role, val)) return true;
67739
68205
  const rv = first.roles.get(mapRole(role));
67740
68206
  if (rv !== void 0 && valType(rv) === valType(val)) return true;
67741
68207
  if (role === "patient" && actionName === "pick" && valType(val) === "literal") {
67742
68208
  const mv = first.roles.get("method");
67743
- return mv !== void 0 && valType(mv) === "literal" && String(mv.value) === String(val.value);
68209
+ const mvType = valType(mv);
68210
+ const mvSurface = mvType === "literal" ? String(mv.value) : mvType === "expression" ? String(mv.raw) : void 0;
68211
+ return mvSurface !== void 0 && mvSurface === String(val.value);
67744
68212
  }
67745
68213
  return false;
67746
68214
  });
@@ -67750,7 +68218,12 @@ var _SemanticParserImpl = class _SemanticParserImpl2 {
67750
68218
  // the swap can never swallow a body command. The body-swallowing
67751
68219
  // generated repeat matches none of these ids.
67752
68220
  /^repeat-.*-(times|for-in|while-head|until-head)$/.test(reparsePid);
67753
- if (reparsed.length === 1 && first && first.kind === "command" && first.action === actionName && preservesFused && headOnlyOk && first.roles.size > Object.keys(roles).length) {
68221
+ if (reparsed.length === 1 && first && first.kind === "command" && first.action === actionName && preservesFused && headOnlyOk && // Strictly-more: the re-parse must recover something the fused
68222
+ // capture lacked. Junk marker captures are excluded from the
68223
+ // count \u2014 a fused shape whose ONLY role is a swallowed marker
68224
+ // (scroll: `destination:literal="destination"`) would otherwise
68225
+ // tie 1 > 1 and veto its own repair.
68226
+ first.roles.size > Object.entries(roles).filter(([r, v2]) => !isMarkerConceptJunk(r, v2)).length) {
67754
68227
  commandNode = first;
67755
68228
  while (tokens.position() < clauseEnd) tokens.advance();
67756
68229
  } else {
@@ -74371,7 +74844,7 @@ function getGetPatternsBn() {
74371
74844
  tokens: [
74372
74845
  { type: "role", role: "source" },
74373
74846
  { type: "literal", value: "\u09A5\u09C7\u0995\u09C7" },
74374
- { type: "literal", value: "\u09AA\u09BE\u09A8", alternatives: ["\u09A8\u09BF\u09A8"] }
74847
+ { type: "literal", value: "\u09AA\u09BE\u09A8" }
74375
74848
  ]
74376
74849
  },
74377
74850
  extraction: {
@@ -74387,7 +74860,7 @@ function getGetPatternsBn() {
74387
74860
  template: {
74388
74861
  format: "\u09AA\u09BE\u09A8 {source}",
74389
74862
  tokens: [
74390
- { type: "literal", value: "\u09AA\u09BE\u09A8", alternatives: ["\u09A8\u09BF\u09A8"] },
74863
+ { type: "literal", value: "\u09AA\u09BE\u09A8" },
74391
74864
  { type: "role", role: "source" }
74392
74865
  ]
74393
74866
  },
@@ -74471,7 +74944,7 @@ function getGetPatternsIt() {
74471
74944
  template: {
74472
74945
  format: "ottenere {patient} da {source}",
74473
74946
  tokens: [
74474
- { type: "literal", value: "ottenere", alternatives: ["ottieni", "get", "prendere"] },
74947
+ { type: "literal", value: "ottenere", alternatives: ["ottieni", "get"] },
74475
74948
  { type: "role", role: "patient" },
74476
74949
  {
74477
74950
  type: "group",
@@ -74561,7 +75034,7 @@ function getGetPatternsRu() {
74561
75034
  template: {
74562
75035
  format: "\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C {patient} \u0438\u0437 {source}",
74563
75036
  tokens: [
74564
- { type: "literal", value: "\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C", alternatives: ["\u043F\u043E\u043B\u0443\u0447\u0438", "\u0432\u0437\u044F\u0442\u044C", "\u0432\u043E\u0437\u044C\u043C\u0438"] },
75037
+ { type: "literal", value: "\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C", alternatives: ["\u043F\u043E\u043B\u0443\u0447\u0438"] },
74565
75038
  { type: "role", role: "patient" },
74566
75039
  {
74567
75040
  type: "group",
@@ -74586,7 +75059,7 @@ function getGetPatternsRu() {
74586
75059
  template: {
74587
75060
  format: "\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C {patient}",
74588
75061
  tokens: [
74589
- { type: "literal", value: "\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C", alternatives: ["\u043F\u043E\u043B\u0443\u0447\u0438", "\u0432\u0437\u044F\u0442\u044C", "\u0432\u043E\u0437\u044C\u043C\u0438"] },
75062
+ { type: "literal", value: "\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C", alternatives: ["\u043F\u043E\u043B\u0443\u0447\u0438"] },
74590
75063
  { type: "role", role: "patient" }
74591
75064
  ]
74592
75065
  },
@@ -74627,7 +75100,7 @@ function getGetPatternsUk() {
74627
75100
  template: {
74628
75101
  format: "\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438 {patient} \u0437 {source}",
74629
75102
  tokens: [
74630
- { type: "literal", value: "\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438", alternatives: ["\u043E\u0442\u0440\u0438\u043C\u0430\u0439", "\u0432\u0437\u044F\u0442\u0438", "\u0432\u0456\u0437\u044C\u043C\u0438"] },
75103
+ { type: "literal", value: "\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438", alternatives: ["\u043E\u0442\u0440\u0438\u043C\u0430\u0439"] },
74631
75104
  { type: "role", role: "patient" },
74632
75105
  {
74633
75106
  type: "group",
@@ -74652,7 +75125,7 @@ function getGetPatternsUk() {
74652
75125
  template: {
74653
75126
  format: "\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438 {patient}",
74654
75127
  tokens: [
74655
- { type: "literal", value: "\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438", alternatives: ["\u043E\u0442\u0440\u0438\u043C\u0430\u0439", "\u0432\u0437\u044F\u0442\u0438", "\u0432\u0456\u0437\u044C\u043C\u0438"] },
75128
+ { type: "literal", value: "\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438", alternatives: ["\u043E\u0442\u0440\u0438\u043C\u0430\u0439"] },
74656
75129
  { type: "role", role: "patient" }
74657
75130
  ]
74658
75131
  },
@@ -74672,7 +75145,7 @@ function getGetPatternsVi() {
74672
75145
  template: {
74673
75146
  format: "l\u1EA5y gi\xE1 tr\u1ECB c\u1EE7a {target}",
74674
75147
  tokens: [
74675
- { type: "literal", value: "l\u1EA5y gi\xE1 tr\u1ECB", alternatives: ["nh\u1EADn", "l\u1EA5y"] },
75148
+ { type: "literal", value: "l\u1EA5y gi\xE1 tr\u1ECB", alternatives: ["nh\u1EADn"] },
74676
75149
  { type: "group", optional: true, tokens: [{ type: "literal", value: "c\u1EE7a" }] },
74677
75150
  { type: "role", role: "patient" }
74678
75151
  ]
@@ -74683,13 +75156,17 @@ function getGetPatternsVi() {
74683
75156
  },
74684
75157
  {
74685
75158
  id: "get-vi-simple",
75159
+ // Head was `l\u1ea5y` (alt `l\u1ea5y gi\u00e1 tr\u1ecb`) \u2014 but bare `l\u1ea5y` is vi's TAKE verb,
75160
+ // so this pattern claimed every `l\u1ea5y .active t\u1eeb \u2026`. vi's get verb is the
75161
+ // three-word `l\u1ea5y gi\u00e1 tr\u1ecb` ("take the value of"), which is what the i18n
75162
+ // transformer renders; the bare form has no valid `get` surface.
74686
75163
  language: "vi",
74687
75164
  command: "get",
74688
75165
  priority: 90,
74689
75166
  template: {
74690
- format: "l\u1EA5y {target}",
75167
+ format: "l\u1EA5y gi\xE1 tr\u1ECB {target}",
74691
75168
  tokens: [
74692
- { type: "literal", value: "l\u1EA5y", alternatives: ["nh\u1EADn", "l\u1EA5y gi\xE1 tr\u1ECB"] },
75169
+ { type: "literal", value: "l\u1EA5y gi\xE1 tr\u1ECB", alternatives: ["nh\u1EADn"] },
74693
75170
  { type: "role", role: "patient" }
74694
75171
  ]
74695
75172
  },
@@ -76428,6 +76905,12 @@ function getSendPatternsForLanguage(language) {
76428
76905
  return [];
76429
76906
  }
76430
76907
  }
76908
+ var PICK_UNIT_WORDS = /* @__PURE__ */ new Set(["character", "characters", "item", "items"]);
76909
+ var retypePickUnitWord = (raw) => {
76910
+ if (PICK_UNIT_WORDS.has(raw)) return { type: "expression", raw };
76911
+ const n = Number(raw);
76912
+ return createLiteral(raw !== "" && !Number.isNaN(n) ? n : raw);
76913
+ };
76431
76914
  function makePickVariantPattern(language, spec) {
76432
76915
  const tokens = [{ type: "literal", value: "pick" }];
76433
76916
  if (spec.objectMarkers?.length) {
@@ -76467,7 +76950,7 @@ function makePickVariantPattern(language, spec) {
76467
76950
  tokens
76468
76951
  },
76469
76952
  extraction: {
76470
- method: { position: 1 },
76953
+ method: { position: 1, transform: retypePickUnitWord },
76471
76954
  patient: { position: 2 },
76472
76955
  source: {
76473
76956
  marker: spec.srcMarker,
@@ -76518,7 +77001,7 @@ function makePickVerbFinalPattern(language, spec) {
76518
77001
  },
76519
77002
  extraction: {
76520
77003
  source: { position: 0 },
76521
- method: { position: 2 },
77004
+ method: { position: 2, transform: retypePickUnitWord },
76522
77005
  patient: { position: 3 }
76523
77006
  }
76524
77007
  };
@@ -79005,7 +79488,7 @@ function createRuntimeInstance(options) {
79005
79488
  return new Runtime(options);
79006
79489
  }
79007
79490
  function getVersion() {
79008
- return "2.0.0";
79491
+ return VERSION$1;
79009
79492
  }
79010
79493
  function toCompileError(error) {
79011
79494
  return {
@@ -86429,4 +86912,4 @@ export {
86429
86912
  toCoreAST,
86430
86913
  validatePartialContent
86431
86914
  };
86432
- //# sourceMappingURL=dist-VGR6QDPB.js.map
86915
+ //# sourceMappingURL=dist-6PFOOXNF.js.map