@uipath/rules-tool 1.206.0-preview.301 → 1.207.0-preview.305

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 (50) hide show
  1. package/dist/DmnFactory-2Z66XPBB-dcse77vg.js +10 -0
  2. package/dist/DmnModelTypes-QISEK3CY-vth5tgqd.js +8 -0
  3. package/dist/KieDmnMarshaller-KLYKOHUQ-jae862c0.js +8 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +6 -6
  5. package/dist/{business-rules-zfzwr08c.js → business-rules-4b4d9pw6.js} +4 -4
  6. package/dist/{constants-1sdwfz26.js → constants-yt6m7vkn.js} +12 -12
  7. package/dist/{first-party-service-ej32b6j2.js → first-party-service-r63v6skt.js} +1 -1
  8. package/dist/hitPolicyResult-2NPUZW2E-rddfkhb2.js +14 -0
  9. package/dist/{index-y5yffb2s.js → index-189nh3zq.js} +642 -513
  10. package/dist/{index-88sps467.js → index-g955264n.js} +7 -5
  11. package/dist/index-jm0j1yn2.js +212 -0
  12. package/dist/{index-s9wmt93c.js → index-thn9n1n9.js} +1 -1
  13. package/dist/index-xvy3d6qz.js +8 -0
  14. package/dist/index.js +2 -2
  15. package/dist/{rule-catalog-780050xk.js → rule-catalog-0zntgf3s.js} +34 -10
  16. package/dist/rules-command-error-5jq3z0ny.js +15 -0
  17. package/dist/{rules-debug-service-97ye6e73.js → rules-debug-service-cfaqvnep.js} +16 -9
  18. package/dist/{rules-init-service-21zyjtff.js → rules-init-service-vhd0gzmd.js} +7 -7
  19. package/dist/{rules-refresh-service-x3gfnfqt.js → rules-refresh-service-r7fpbbfv.js} +3 -3
  20. package/dist/{rules-validate-service-e47hgykv.js → rules-validate-service-jrw7c1q9.js} +8 -10
  21. package/dist/{solution-definition-helper-trxp0zbj.js → solution-definition-helper-s5v427j0.js} +1 -1
  22. package/dist/{tool-6m0p5jax.js → tool-0r1ykkjf.js} +12 -5
  23. package/dist/{tool-yfaf9b8c.js → tool-19fj7ema.js} +36 -9
  24. package/dist/{tool-sjp6fvze.js → tool-2cxm18e8.js} +2 -2
  25. package/dist/tool-2grmcreg.js +117 -0
  26. package/dist/{tool-b475et36.js → tool-46g75ed0.js} +3 -3
  27. package/dist/{tool-syavphgt.js → tool-5sgkktdb.js} +287 -139
  28. package/dist/{tool-dt23fa28.js → tool-a1wk2tqc.js} +28 -26
  29. package/dist/{tool-jzdt6z77.js → tool-c0peefw8.js} +7 -6
  30. package/dist/tool-e83bfqmj.js +192 -0
  31. package/dist/{tool-3755q59j.js → tool-fsmgxvqa.js} +189 -15
  32. package/dist/tool-fv5xtqv5.js +736 -0
  33. package/dist/{tool-vqm4apm6.js → tool-jykscmfk.js} +206 -203
  34. package/dist/{tool-0tbve332.js → tool-kmzhfjw8.js} +64 -10
  35. package/dist/tool-q02dmnzm.js +74 -0
  36. package/dist/{tool-93hqhaj3.js → tool-q3jw2emw.js} +100 -96
  37. package/dist/tool.js +2 -2
  38. package/package.json +2 -2
  39. package/dist/DmnFactory-L7MABUC6-q2sr3grz.js +0 -10
  40. package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +0 -8
  41. package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +0 -8
  42. package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +0 -12
  43. package/dist/index-egzwtc07.js +0 -19
  44. package/dist/index-z4kt2kt6.js +0 -8
  45. package/dist/index-zeszs1ra.js +0 -184
  46. package/dist/rules-command-error-2x1vm0wt.js +0 -13
  47. package/dist/tool-2nmqvfmt.js +0 -26
  48. package/dist/tool-89e90qrm.js +0 -777
  49. package/dist/tool-m59a481n.js +0 -49
  50. package/dist/tool-sbtf80ft.js +0 -218
@@ -10,13 +10,13 @@ import {
10
10
  parseLimit,
11
11
  parseOffset,
12
12
  parseBoundedInt
13
- } from "./tool-syavphgt.js";
13
+ } from "./tool-5sgkktdb.js";
14
14
  // package.json
15
15
  var package_default = {
16
16
  name: "@uipath/rules-tool",
17
17
  author: "UiPath",
18
18
  license: "SEE LICENSE IN LICENSE.txt",
19
- version: "1.206.0-preview.301",
19
+ version: "1.207.0-preview.305",
20
20
  description: "Create and manage UiPath Business Rules (DMN) projects.",
21
21
  private: false,
22
22
  repository: {
@@ -54,7 +54,7 @@ var package_default = {
54
54
  "@types/node": "^25.5.2",
55
55
  "@uipath/auth": "workspace:*",
56
56
  "@uipath/common": "workspace:*",
57
- "@uipath/dmn-editor-utils": "0.1201.7",
57
+ "@uipath/dmn-editor-utils": "0.1246.8",
58
58
  "@uipath/filesystem": "workspace:*",
59
59
  "@uipath/orchestrator-sdk": "workspace:*",
60
60
  "@uipath/packager-tool-businessrules": "workspace:*",
@@ -92,8 +92,8 @@ var RULES_DEBUG_EXAMPLES = [
92
92
  ];
93
93
  var registerDebugCommand = (program) => {
94
94
  program.command("debug").description("Upload the rules project's solution to Studio Web and evaluate it once through the rules engine. Returns the decision outputs and errors, and the trace id that shows which rules fired.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").option("-i, --inputs <json>", "Input values as a JSON object or @file.json").option("--folder-path <path>", "Folder to evaluate in and record the run's trace under (default: your personal workspace)").option("--folder-key <key>", "Key (GUID) of the folder to evaluate in and record the run's trace under").option("--timeout <seconds>", "Maximum seconds to wait for the rules engine to evaluate (default: 120)", (value) => parseBoundedInt(value, "--timeout", { min: 1, max: 3600 })).option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", (value) => Number.parseInt(value, 10), 10).examples(RULES_DEBUG_EXAMPLES).trackedAction(processContext, async (projectPath, options) => {
95
- const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
96
- const { debugRuleProjectAsync } = await import("./rules-debug-service-97ye6e73.js");
95
+ const { reportRulesFailure } = await import("./rules-command-error-5jq3z0ny.js");
96
+ const { debugRuleProjectAsync } = await import("./rules-debug-service-cfaqvnep.js");
97
97
  const [error, result] = await catchError(debugRuleProjectAsync(projectPath, options));
98
98
  if (error) {
99
99
  await reportRulesFailure("Failed to debug business rules project", error);
@@ -189,15 +189,15 @@ var RULES_DESCRIBE_EXAMPLES = [
189
189
  var registerDescribeCommand = (program) => {
190
190
  const command = program.command("describe").description("(Preview) Get the entry points of a deployed business rule's active version, with their input and output argument schemas. Use them to map arguments when binding the rule. Same row shape as 'uip or packages entry-points'.").argument("<rule-name>", "Business rule name");
191
191
  addUnsupportedTenantOption(addFolderOptions(command)).examples(RULES_DESCRIBE_EXAMPLES).trackedAction(processContext, async (name, options) => {
192
- const rules = await import("./business-rules-zfzwr08c.js");
193
- const { reportRulesFailure, RulesCommandError } = await import("./rules-command-error-2x1vm0wt.js");
192
+ const rules = await import("./business-rules-4b4d9pw6.js");
193
+ const { reportRulesFailure, RulesCommandError } = await import("./rules-command-error-5jq3z0ny.js");
194
194
  if (options.tenant !== undefined) {
195
195
  await reportRulesFailure("Failed to describe business rule", new RulesCommandError("'uip rules describe' does not support --tenant: it reads the rule from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Run 'uip login tenant set <tenant-name>' to switch tenants, then run the command again."));
196
196
  return;
197
197
  }
198
198
  const [error, entryPoints] = await catchError((async () => {
199
199
  const folder = await rules.resolveRequiredFolder(options);
200
- const { describeRuleAsync } = await import("./rule-catalog-780050xk.js");
200
+ const { describeRuleAsync } = await import("./rule-catalog-0zntgf3s.js");
201
201
  return describeRuleAsync(name, folder);
202
202
  })());
203
203
  if (error) {
@@ -236,8 +236,8 @@ var RULES_GET_EXAMPLES = [
236
236
  var registerGetCommand = (program) => {
237
237
  const command = program.command("get").description("(Preview) Get a deployed business rule by name. Use 'rules versions' for its version history and 'rules describe' for its argument contract.").argument("<rule-name>", "Business rule name");
238
238
  addTenantOption(addFolderOptions(command)).examples(RULES_GET_EXAMPLES).trackedAction(processContext, async (name, options) => {
239
- const rules = await import("./business-rules-zfzwr08c.js");
240
- const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
239
+ const rules = await import("./business-rules-4b4d9pw6.js");
240
+ const { DEPLOYED_RULES_FORBIDDEN_MESSAGE, reportRulesFailure } = await import("./rules-command-error-5jq3z0ny.js");
241
241
  const [error, found] = await catchError((async () => {
242
242
  const folder = await rules.resolveRequiredFolder(options);
243
243
  const api = await rules.createRulesApi(options.tenant, folder);
@@ -245,7 +245,7 @@ var registerGetCommand = (program) => {
245
245
  return { rule, folder };
246
246
  })());
247
247
  if (error) {
248
- await reportRulesFailure("Failed to get business rule", error);
248
+ await reportRulesFailure("Failed to get business rule", error, { forbiddenMessage: DEPLOYED_RULES_FORBIDDEN_MESSAGE });
249
249
  return;
250
250
  }
251
251
  OutputFormatter.success({
@@ -290,7 +290,7 @@ Packing or uploading the solution will sync solution resources automatically.`
290
290
  ];
291
291
  var registerInitCommand = (program) => {
292
292
  program.command("init").description("Create a new business rules project seeded with one decision table. If run outside an existing solution, a parent '<name>Solution' is scaffolded automatically and the rules project is created inside it. If run inside an existing solution, the project is added to that solution.").argument("<name>", "Business rules project name").option("--force", "Force initialization even if target directory exists and is not empty").option("--skip-solution-registration", "Do not auto-register this project in the surrounding solution").examples(RULES_INIT_EXAMPLES).trackedAction(processContext, async (name, options) => {
293
- const { rulesInitAsync } = await import("./rules-init-service-21zyjtff.js");
293
+ const { rulesInitAsync } = await import("./rules-init-service-vhd0gzmd.js");
294
294
  const [error, result] = await catchError(rulesInitAsync(name, {
295
295
  force: options.force,
296
296
  skipRegistration: options.skipSolutionRegistration === true
@@ -366,10 +366,12 @@ var RULES_LIST_EXAMPLES = [
366
366
  var registerListCommand = (program) => {
367
367
  const command = program.command("list").description("(Preview) List business rules deployed to Orchestrator in a folder, or across all accessible folders with --all-folders. Returns key, name, folder, description and, for one folder, current version. --all-folders returns one row per folder a rule is shared to.");
368
368
  addTenantOption(addFolderOptions(command)).option("--all-folders", "List business rules across all accessible folders").option("-l, --limit <number>", "Number of items to return", parseLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of items to skip", parseOffset, 0).examples(RULES_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
369
- const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
369
+ const { DEPLOYED_RULES_FORBIDDEN_MESSAGE, reportRulesFailure } = await import("./rules-command-error-5jq3z0ny.js");
370
370
  const [error, result] = await catchError(listRules(options));
371
371
  if (error) {
372
- await reportRulesFailure("Failed to list business rules", error);
372
+ await reportRulesFailure("Failed to list business rules", error, options.allFolders ? undefined : {
373
+ forbiddenMessage: DEPLOYED_RULES_FORBIDDEN_MESSAGE
374
+ });
373
375
  return;
374
376
  }
375
377
  OutputFormatter.success({
@@ -386,8 +388,8 @@ var registerListCommand = (program) => {
386
388
  });
387
389
  };
388
390
  async function listRules(options) {
389
- const rules = await import("./business-rules-zfzwr08c.js");
390
- const { RulesCommandError } = await import("./rules-command-error-2x1vm0wt.js");
391
+ const rules = await import("./business-rules-4b4d9pw6.js");
392
+ const { RulesCommandError } = await import("./rules-command-error-5jq3z0ny.js");
391
393
  const hasFolderSelector = options.folderPath !== undefined || options.folderKey !== undefined;
392
394
  if (options.allFolders && hasFolderSelector) {
393
395
  throw new RulesCommandError("Option --all-folders cannot be used with --folder-path or --folder-key.", "invalid_argument", "Use --all-folders by itself, or provide a single folder selector with --folder-path or --folder-key.");
@@ -410,11 +412,11 @@ async function listRules(options) {
410
412
  };
411
413
  }
412
414
  async function listRulesAcrossFolders(options) {
413
- const { RulesCommandError } = await import("./rules-command-error-2x1vm0wt.js");
415
+ const { RulesCommandError } = await import("./rules-command-error-5jq3z0ny.js");
414
416
  if (options.tenant !== undefined) {
415
417
  throw new RulesCommandError("'uip rules list --all-folders' does not support --tenant: it lists rules from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder in that tenant, or run 'uip login tenant set <tenant-name>' to switch tenants.");
416
418
  }
417
- const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-780050xk.js");
419
+ const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-0zntgf3s.js");
418
420
  const result = await listRulesAcrossFoldersAsync(options.limit, options.offset);
419
421
  if (!result) {
420
422
  throw new RulesCommandError("Listing business rules across folders needs the Node CLI: the browser build cannot read the resource catalog.", "configuration_error", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder.");
@@ -441,8 +443,8 @@ var RULES_REFRESH_EXAMPLES = [
441
443
  ];
442
444
  var registerRefreshCommand = (program) => {
443
445
  program.command("refresh").description("Regenerate entry-points.json and bindings_v2.json from the rules project's .dmn, keeping each published entry point's uniqueId. Run it after editing a .dmn outside Studio Web, before 'uip solution pack'.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").examples(RULES_REFRESH_EXAMPLES).trackedAction(processContext, async (projectPath) => {
444
- const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
445
- const { refreshRuleProjectAsync } = await import("./rules-refresh-service-x3gfnfqt.js");
446
+ const { reportRulesFailure } = await import("./rules-command-error-5jq3z0ny.js");
447
+ const { refreshRuleProjectAsync } = await import("./rules-refresh-service-r7fpbbfv.js");
446
448
  const [error, result] = await catchError(refreshRuleProjectAsync(projectPath));
447
449
  if (error) {
448
450
  await reportRulesFailure("Failed to refresh business rules package files", error);
@@ -480,8 +482,8 @@ var RULES_VALIDATE_EXAMPLES = [
480
482
  ];
481
483
  var registerValidateCommand = (program) => {
482
484
  program.command("validate").description("Check a rules project for what Studio Web blocks publish and debug on, the designer's diagnostics for each .dmn, and for an entry-points.json out of step with the .dmn. Errors exit 1; warnings are reported only.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").examples(RULES_VALIDATE_EXAMPLES).trackedAction(processContext, async (projectPath) => {
483
- const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
484
- const { validateRuleProjectAsync } = await import("./rules-validate-service-e47hgykv.js");
485
+ const { reportRulesFailure } = await import("./rules-command-error-5jq3z0ny.js");
486
+ const { validateRuleProjectAsync } = await import("./rules-validate-service-jrw7c1q9.js");
485
487
  const [error, result] = await catchError(validateRuleProjectAsync(projectPath));
486
488
  if (error) {
487
489
  await reportRulesFailure("Failed to validate business rules project", error);
@@ -556,8 +558,8 @@ var RULES_VERSIONS_EXAMPLES = [
556
558
  var registerVersionsCommand = (program) => {
557
559
  const command = program.command("versions").description("(Preview) List the versions of a deployed business rule. The active version is the one consumers evaluate.").argument("<rule-name>", "Business rule name");
558
560
  addTenantOption(addFolderOptions(command)).option("-l, --limit <number>", "Number of versions to return", parseLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of versions to skip", parseOffset, 0).examples(RULES_VERSIONS_EXAMPLES).trackedAction(processContext, async (name, options) => {
559
- const rules = await import("./business-rules-zfzwr08c.js");
560
- const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
561
+ const rules = await import("./business-rules-4b4d9pw6.js");
562
+ const { DEPLOYED_RULES_FORBIDDEN_MESSAGE, reportRulesFailure } = await import("./rules-command-error-5jq3z0ny.js");
561
563
  const [error, page] = await catchError((async () => {
562
564
  const folder = await rules.resolveRequiredFolder(options);
563
565
  const api = await rules.createRulesApi(options.tenant, folder);
@@ -572,7 +574,7 @@ var registerVersionsCommand = (program) => {
572
574
  });
573
575
  })());
574
576
  if (error) {
575
- await reportRulesFailure("Failed to list business rule versions", error);
577
+ await reportRulesFailure("Failed to list business rule versions", error, { forbiddenMessage: DEPLOYED_RULES_FORBIDDEN_MESSAGE });
576
578
  return;
577
579
  }
578
580
  const items = page.value ?? [];
@@ -609,4 +611,4 @@ var registerCommands2 = async (program) => {
609
611
 
610
612
  export { metadata2, registerCommands2 };
611
613
 
612
- //# debugId=DB2659C43656D8F764756E2164756E21
614
+ //# debugId=2F187CC89B32495364756E2164756E21
@@ -3,7 +3,7 @@ import {
3
3
  classifiedFailure,
4
4
  OutputFormatter,
5
5
  processContext
6
- } from "./tool-syavphgt.js";
6
+ } from "./tool-5sgkktdb.js";
7
7
 
8
8
  // src/services/rules-command-error.ts
9
9
  class RulesCommandError2 extends Error {
@@ -22,10 +22,11 @@ class RulesCommandError2 extends Error {
22
22
  function isJsonObject2(value) {
23
23
  return typeof value === "object" && value !== null && !Array.isArray(value);
24
24
  }
25
- async function reportRulesFailure2(message, error) {
25
+ var DEPLOYED_RULES_FORBIDDEN_MESSAGE2 = "Forbidden (403). Reading business rules needs the BusinessRules.View permission (an external application also needs the OR.BusinessRules or OR.BusinessRules.Read scope), on an environment with Business Rules turned on.";
26
+ async function reportRulesFailure2(message, error, options) {
26
27
  if (error instanceof RulesCommandError2) {
27
28
  OutputFormatter.error({
28
- Result: error.errorCode === "configuration_error" ? RESULTS.ConfigError : RESULTS.Failure,
29
+ Result: error.errorCode === "configuration_error" ? RESULTS.ConfigError : error.errorCode === "permission_denied" ? RESULTS.AuthenticationError : RESULTS.Failure,
29
30
  ErrorCode: error.errorCode,
30
31
  Message: error.message,
31
32
  Instructions: error.instructions,
@@ -33,11 +34,11 @@ async function reportRulesFailure2(message, error) {
33
34
  ...error.context ? { Context: error.context } : {}
34
35
  });
35
36
  } else {
36
- OutputFormatter.error(await classifiedFailure(message, error));
37
+ OutputFormatter.error(await classifiedFailure(message, error, options));
37
38
  }
38
39
  processContext.exit(1);
39
40
  }
40
41
 
41
- export { RulesCommandError2, isJsonObject2, reportRulesFailure2 };
42
+ export { RulesCommandError2, isJsonObject2, DEPLOYED_RULES_FORBIDDEN_MESSAGE2, reportRulesFailure2 };
42
43
 
43
- //# debugId=5F74FF1A10A8429C64756E2164756E21
44
+ //# debugId=9EC408117B88DB8364756E2164756E21
@@ -0,0 +1,192 @@
1
+ // ../../node_modules/@uipath/dmn-editor-utils/dist/chunks/chunk-ORXVXKSJ.js
2
+ var t = { First: "FIRST", Unique: "UNIQUE", Priority: "PRIORITY", Any: "ANY", Collect: "COLLECT", RuleOrder: "RULE ORDER", OutputOrder: "OUTPUT ORDER" };
3
+ var a = Object.values(t);
4
+ var i = { Sum: "SUM", Min: "MIN", Max: "MAX", Count: "COUNT" };
5
+ var s = Object.values(i);
6
+ var e = { String: "string", Number: "number", Boolean: "boolean", Any: "Any", Date: "date", Time: "time", DateAndTime: "date and time", DaysAndTimeDuration: "days and time duration", YearsAndMonthsDuration: "years and months duration" };
7
+ var r = Object.values(e);
8
+ var o = new Set([e.DaysAndTimeDuration, e.YearsAndMonthsDuration]);
9
+ var d = new Set([e.Date, e.Time, e.DateAndTime, ...o]);
10
+ var p = new Map([["dayTimeDuration", e.DaysAndTimeDuration], ["yearMonthDuration", e.YearsAndMonthsDuration]]);
11
+
12
+ // ../../node_modules/@uipath/dmn-editor-utils/dist/chunks/chunk-YYMG77I5.js
13
+ var b3 = (e) => e.includes(":") ? e.split(":").pop() ?? e : e;
14
+ var O = new Set(["number", "integer", "long", "double", "decimal"]);
15
+ var M = (e) => O.has(b3(e));
16
+ var x = (e) => M(e) ? "number" : b3(e);
17
+ var z2 = (e) => !!e && x(e) === "Any";
18
+ var Q = (e) => {
19
+ let n = e.chain[e.chain.length - 1];
20
+ return !e.components && !e.recursive && !!n && !n.allowedValues && !e.baseTypeRef && !e.foreign;
21
+ };
22
+ var E = (e) => !!e?.baseTypeRef && e.baseTypeRef !== "Any" && r.includes(e.baseTypeRef) && !e.isCollection && !e.components && !e.foreign && !e.recursive;
23
+ var I = ["string", "number", "boolean"];
24
+ var q = (e) => E(e) && I.includes(e?.baseTypeRef ?? "") ? e?.baseTypeRef : undefined;
25
+ var A = (e) => e.chain.filter((n) => n.isCollection).length > 1;
26
+ var H2 = (e) => {
27
+ if (!(!e?.isCollection || e.components || e.foreign || e.recursive))
28
+ return !A(e) && I.includes(e.baseTypeRef ?? "") ? e.baseTypeRef : undefined;
29
+ };
30
+ var J = (e, n) => {
31
+ let t = e;
32
+ for (let [s, o] of n.entries()) {
33
+ if (!t)
34
+ return {};
35
+ if (t.isCollection)
36
+ return { crosses: "list", crossedAfter: s };
37
+ if (E(t))
38
+ return { crosses: "single", crossedAfter: s };
39
+ t = t.components?.find((a) => a.name === o)?.type;
40
+ }
41
+ return t ? { type: t } : {};
42
+ };
43
+ var u = (e) => {
44
+ let n = Object.entries(e ?? {}).flatMap(([t, s]) => t.startsWith("@_xmlns:") && typeof s == "string" ? [[t.slice(8), s]] : []);
45
+ return n.length ? Object.fromEntries(n) : undefined;
46
+ };
47
+ var D = (e, n, t = [], s) => {
48
+ if (Array.isArray(e)) {
49
+ for (let i of e)
50
+ D(i, n, t, s);
51
+ return;
52
+ }
53
+ if (!e || typeof e != "object" || s?.(e))
54
+ return;
55
+ let o = u(e), a = o ? [o, ...t] : t;
56
+ for (let [i, r2] of Object.entries(e))
57
+ if ((i === "@_typeRef" || i === "@_outputTypeRef") && typeof r2 == "string")
58
+ n(r2, a, (p2) => {
59
+ e[i] = p2;
60
+ });
61
+ else if (i === "typeRef" && typeof r2?.__$$text == "string") {
62
+ let p2 = r2, c = u(r2);
63
+ n(p2.__$$text, c ? [c, ...a] : a, (m) => {
64
+ p2.__$$text = m;
65
+ });
66
+ } else
67
+ i !== "dmndi:DMNDI" && D(r2, n, a, s);
68
+ };
69
+ var k = (e, n, t) => {
70
+ let s = { namespace: e["@_namespace"] }, o = new Set;
71
+ return D(n, (i, r2) => {
72
+ let { name: p2, space: c } = l(i, r2, s);
73
+ c === "local" && o.add(p2);
74
+ }, N3([e]), t), o.size ? [...o].sort((i, r2) => i.localeCompare(r2)) : undefined;
75
+ };
76
+ var L = (e) => {
77
+ let n = new Map, t = (o, a) => {
78
+ let i = P(o), r2 = i === undefined ? undefined : g(i, s) ?? g(i, a);
79
+ i !== undefined && r2 !== undefined && !n.has(i) && n.set(i, r2);
80
+ }, s = N3([e]);
81
+ return D([e.itemDefinition, e.drgElement], t, s), n.size ? Object.fromEntries(n) : undefined;
82
+ };
83
+ var X = (e) => {
84
+ let n = { namespace: e["@_namespace"] }, t = new Set((e.itemDefinition ?? []).map((o) => o["@_name"])), s = (o, a, i) => {
85
+ let { name: r2, space: p2 } = l(o, a, n), c = p.get(r2), m = p2 === "foreign" && R.exec(o)?.[1] === "feel" && g("feel", a) === undefined;
86
+ c && (p2 === "feel" || m || p2 === "local" && !t.has(r2) && !t.has(c)) && i(`${o.slice(0, -r2.length)}${c}`);
87
+ };
88
+ D([e.itemDefinition, e.drgElement], s, N3([e]));
89
+ };
90
+ var j2 = (e) => {
91
+ let n = new Set, t = (o) => {
92
+ let a = o;
93
+ for (let i = 2;n.has(a); i++)
94
+ a = `${o}#${i}`;
95
+ return n.add(a), a;
96
+ }, s = (o, a) => {
97
+ let i = o["@_id"] || t(a), r2 = o.itemComponent?.map((d) => s(d, `${i}/${d["@_name"]}`)), p2 = u(o), c = u(o.typeRef), m = o.functionItem, f = [m?.["@_outputTypeRef"], ...(m?.parameters ?? []).map((d) => d["@_typeRef"])].filter((d) => !!d);
98
+ return { id: i, name: o["@_name"] ?? "", isCollection: o["@_isCollection"] === true, typeRef: o.typeRef?.__$$text, allowedValues: o.allowedValues?.text?.__$$text, ...r2?.length ? { components: r2 } : {}, ...p2 ? { namespaces: p2 } : {}, ...c ? { typeRefNamespaces: c } : {}, ...f.length ? { functionTypeRefs: f } : {} };
99
+ };
100
+ return e.itemDefinition?.map((o) => s(o, `itemDefinition/${o["@_name"]}`));
101
+ };
102
+ var Z2 = (e) => ({ itemDefinitions: j2(e), namespace: e["@_namespace"], namespaces: L(e) });
103
+ var F = (e) => ("inputExpression" in e) ? e.inputExpression?.text?.__$$text?.trim() : undefined;
104
+ var ee = (e, n) => {
105
+ let t = e.drgElement ?? [], s = new Set(t.flatMap((a) => {
106
+ if (a.__$$element !== "inputData")
107
+ return [];
108
+ let i = (a.variable?.["@_name"]?.trim() || a["@_name"]?.trim()) ?? "";
109
+ return i ? [i] : [];
110
+ })), o = (a) => s.has(F(a) ?? "");
111
+ return k(e, t.filter((a) => a !== n && a.__$$element !== "inputData"), o);
112
+ };
113
+ var R = /^([\p{L}_][\p{L}\p{N}_.-]*):(.+)$/u;
114
+ var P = (e) => R.exec(e)?.[1];
115
+ var V = /^https?:\/\/www\.omg\.org\/spec\/(?:FEEL\/\d{8}|DMN\/\d{8}\/FEEL)\/?$/;
116
+ var g = (e, n) => n.find((t) => Object.prototype.hasOwnProperty.call(t, e))?.[e];
117
+ var N3 = (e) => e.flatMap((n) => {
118
+ let t = u(n);
119
+ return t ? [t] : [];
120
+ });
121
+ var W = new Map;
122
+ var C = new WeakMap;
123
+ var h = (e) => {
124
+ if (!e)
125
+ return W;
126
+ let n = C.get(e);
127
+ if (!n) {
128
+ let t = new Map;
129
+ for (let s of e)
130
+ t.has(s.name) || t.set(s.name, s);
131
+ n = t, C.set(e, n);
132
+ }
133
+ return n;
134
+ };
135
+ var l = (e, n, t) => {
136
+ let s = R.exec(e);
137
+ if (!s)
138
+ return { name: e, space: "local" };
139
+ let o = g(s[1], n);
140
+ return o === undefined ? { name: s[2], space: "foreign" } : o === t.namespace ? { name: s[2], space: "local" } : { name: s[2], space: V.test(o) ? "feel" : "foreign" };
141
+ };
142
+ var y = (e) => e.namespaces ? [e.namespaces] : [];
143
+ var T = (e, n) => {
144
+ let t = e.namespaces ? [e.namespaces, ...n] : n;
145
+ return { scope: t, typeRefScope: e.typeRefNamespaces ? [e.typeRefNamespaces, ...t] : t };
146
+ };
147
+ var ne2 = (e, n) => {
148
+ if (n.typeRef === undefined)
149
+ return;
150
+ let { name: t, space: s } = l(n.typeRef, T(n, y(e)).typeRefScope, e);
151
+ return s === "local" ? h(e.itemDefinitions).get(t) : undefined;
152
+ };
153
+ var $ = (e, n, t, s = [], o = t) => {
154
+ let a = h(e.itemDefinitions);
155
+ for (;; ) {
156
+ let i = s.some((f) => f.isCollection);
157
+ if (n === undefined || s[s.length - 1]?.components?.length)
158
+ return { chain: s, scope: o, isCollection: i };
159
+ let { name: r2, space: p2 } = l(n, t, e);
160
+ if (p2 === "foreign")
161
+ return { chain: s, scope: o, isCollection: i, foreign: true };
162
+ let c = p2 === "local" ? a.get(r2) : undefined, m = c ? s.indexOf(c) : -1;
163
+ if (m >= 0 && s.slice(m).some((f) => f.isCollection))
164
+ return { chain: s, scope: o, isCollection: i, recursive: true };
165
+ if (!c || m >= 0)
166
+ return { chain: s, scope: o, isCollection: i, baseTypeRef: x(r2) };
167
+ s.push(c), { scope: o, typeRefScope: t } = T(c, y(e)), n = c.typeRef;
168
+ }
169
+ };
170
+ var U = (e, n, t) => {
171
+ let { scope: s, typeRefScope: o } = T(e, n);
172
+ return $(t, e.typeRef, o, [e], s);
173
+ };
174
+ var v = ({ scope: e, ...n }, t, s) => {
175
+ let o = n.chain[n.chain.length - 1];
176
+ if (!o?.components?.length)
177
+ return n;
178
+ if (s.has(o))
179
+ return { ...n, recursive: true };
180
+ let a = new Set(s).add(o), i = o.components.map((r2) => ({ id: r2.id, name: r2.name, type: v(U(r2, e, t), t, a) }));
181
+ return { ...n, components: i };
182
+ };
183
+ var w = (e, n, t) => $(e, n, [...t, ...y(e)]);
184
+ var se = (e, n, t = []) => v(w(e, n, t), e, new Set);
185
+ var oe = (e, n, t = []) => {
186
+ let { scope: s, ...o } = w(e, n, t);
187
+ return o;
188
+ };
189
+
190
+ export { t, a, i, s, e, r, o, d, b3, x, z2, Q, q, H2, J, u, X, j2, Z2, F, ee, g, N3, ne2, se, oe };
191
+
192
+ //# debugId=77C4A85339B2E1EC64756E2164756E21