@qoretechnologies/reqraft 0.10.45-pr.95.gc02205d → 0.10.45

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 (144) hide show
  1. package/.claude/CLAUDE.md +12 -0
  2. package/.tasks/INDEX.md +1 -0
  3. package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +72 -0
  4. package/dist/components/composer/Composer.d.ts.map +1 -1
  5. package/dist/components/composer/Composer.js +5 -1
  6. package/dist/components/composer/Composer.js.map +1 -1
  7. package/dist/components/form/engine/CompactRow.d.ts +20 -1
  8. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  9. package/dist/components/form/engine/CompactRow.js +279 -41
  10. package/dist/components/form/engine/CompactRow.js.map +1 -1
  11. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  12. package/dist/components/form/engine/CompactToolbar.js +72 -72
  13. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  14. package/dist/components/form/engine/FormEngine.d.ts +48 -1
  15. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  16. package/dist/components/form/engine/FormEngine.js +203 -98
  17. package/dist/components/form/engine/FormEngine.js.map +1 -1
  18. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  19. package/dist/components/form/engine/_structuredData/SchemaDataView.js +55 -13
  20. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  21. package/dist/components/form/engine/_structuredData/structuredData.d.ts +15 -0
  22. package/dist/components/form/engine/_structuredData/structuredData.d.ts.map +1 -1
  23. package/dist/components/form/engine/_structuredData/structuredData.js +22 -1
  24. package/dist/components/form/engine/_structuredData/structuredData.js.map +1 -1
  25. package/dist/components/form/engine/compactRowStyles.d.ts +2 -0
  26. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  27. package/dist/components/form/engine/compactRowStyles.js +21 -4
  28. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  29. package/dist/components/form/engine/compactToolbarContext.d.ts +8 -0
  30. package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
  31. package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
  32. package/dist/components/form/engine/readFirst.d.ts +24 -0
  33. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  34. package/dist/components/form/engine/readFirst.js +84 -6
  35. package/dist/components/form/engine/readFirst.js.map +1 -1
  36. package/dist/components/form/fields/Field.d.ts.map +1 -1
  37. package/dist/components/form/fields/Field.js +1 -1
  38. package/dist/components/form/fields/Field.js.map +1 -1
  39. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +12 -2
  40. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  41. package/dist/components/form/fields/allowed-values/AllowedValues.js +16 -6
  42. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  43. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  44. package/dist/components/form/fields/auto/AutoFormField.js +64 -14
  45. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  46. package/dist/components/form/fields/long-string/LongString.d.ts +9 -1
  47. package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
  48. package/dist/components/form/fields/long-string/LongString.js +25 -4
  49. package/dist/components/form/fields/long-string/LongString.js.map +1 -1
  50. package/dist/components/form/fields/template/ExampleValueModal.d.ts +29 -0
  51. package/dist/components/form/fields/template/ExampleValueModal.d.ts.map +1 -0
  52. package/dist/components/form/fields/template/ExampleValueModal.js +122 -0
  53. package/dist/components/form/fields/template/ExampleValueModal.js.map +1 -0
  54. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
  55. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +3 -3
  56. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
  57. package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
  58. package/dist/components/form/fields/template/TemplateField.js +35 -6
  59. package/dist/components/form/fields/template/TemplateField.js.map +1 -1
  60. package/dist/components/form/fields/template/__fixtures__/longExampleValue.d.ts +2 -0
  61. package/dist/components/form/fields/template/__fixtures__/longExampleValue.d.ts.map +1 -0
  62. package/dist/components/form/fields/template/__fixtures__/longExampleValue.js +9 -0
  63. package/dist/components/form/fields/template/__fixtures__/longExampleValue.js.map +1 -0
  64. package/dist/components/form/index.d.ts +1 -0
  65. package/dist/components/form/index.d.ts.map +1 -1
  66. package/dist/components/form/index.js +1 -0
  67. package/dist/components/form/index.js.map +1 -1
  68. package/dist/components/searchFilterBar/SearchFilterBar.d.ts +12 -1
  69. package/dist/components/searchFilterBar/SearchFilterBar.d.ts.map +1 -1
  70. package/dist/components/searchFilterBar/SearchFilterBar.js +2 -2
  71. package/dist/components/searchFilterBar/SearchFilterBar.js.map +1 -1
  72. package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
  73. package/dist/components/ticketThread/TicketThread.js +1 -1
  74. package/dist/components/ticketThread/TicketThread.js.map +1 -1
  75. package/dist/helpers/common.d.ts +8 -1
  76. package/dist/helpers/common.d.ts.map +1 -1
  77. package/dist/helpers/common.js +9 -1
  78. package/dist/helpers/common.js.map +1 -1
  79. package/dist/helpers/optionUiTypes.d.ts +30 -0
  80. package/dist/helpers/optionUiTypes.d.ts.map +1 -0
  81. package/dist/helpers/optionUiTypes.js +156 -0
  82. package/dist/helpers/optionUiTypes.js.map +1 -0
  83. package/dist/helpers/options.d.ts +19 -0
  84. package/dist/helpers/options.d.ts.map +1 -1
  85. package/dist/helpers/options.js +25 -1
  86. package/dist/helpers/options.js.map +1 -1
  87. package/dist/helpers/providerValue.d.ts +68 -0
  88. package/dist/helpers/providerValue.d.ts.map +1 -0
  89. package/dist/helpers/providerValue.js +50 -0
  90. package/dist/helpers/providerValue.js.map +1 -0
  91. package/dist/helpers/singleLineString.d.ts +37 -0
  92. package/dist/helpers/singleLineString.d.ts.map +1 -0
  93. package/dist/helpers/singleLineString.js +66 -0
  94. package/dist/helpers/singleLineString.js.map +1 -0
  95. package/dist/helpers/templates.d.ts +100 -0
  96. package/dist/helpers/templates.d.ts.map +1 -1
  97. package/dist/helpers/templates.js +237 -4
  98. package/dist/helpers/templates.js.map +1 -1
  99. package/dist/helpers/validations.d.ts +103 -2
  100. package/dist/helpers/validations.d.ts.map +1 -1
  101. package/dist/helpers/validations.js +858 -91
  102. package/dist/helpers/validations.js.map +1 -1
  103. package/dist/index.d.ts +1 -1
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +2 -1
  106. package/dist/index.js.map +1 -1
  107. package/package.json +1 -1
  108. package/src/components/composer/Composer.tsx +7 -3
  109. package/src/components/form/engine/CompactRow.tsx +391 -29
  110. package/src/components/form/engine/CompactToolbar.tsx +105 -98
  111. package/src/components/form/engine/FormEngine.stories.tsx +863 -12
  112. package/src/components/form/engine/FormEngine.tsx +231 -68
  113. package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +104 -0
  114. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +158 -101
  115. package/src/components/form/engine/_structuredData/structuredData.ts +20 -0
  116. package/src/components/form/engine/compactRowStyles.ts +38 -1
  117. package/src/components/form/engine/compactToolbarContext.ts +8 -0
  118. package/src/components/form/engine/readFirst.ts +125 -35
  119. package/src/components/form/fields/Field.tsx +3 -1
  120. package/src/components/form/fields/allowed-values/AllowedValues.tsx +24 -2
  121. package/src/components/form/fields/array/ArrayAutoField.stories.tsx +81 -0
  122. package/src/components/form/fields/auto/AutoFormField.stories.tsx +47 -1
  123. package/src/components/form/fields/auto/AutoFormField.tsx +73 -11
  124. package/src/components/form/fields/long-string/LongString.tsx +46 -5
  125. package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +5 -0
  126. package/src/components/form/fields/template/ExampleValueModal.stories.tsx +114 -0
  127. package/src/components/form/fields/template/ExampleValueModal.tsx +99 -0
  128. package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +8 -4
  129. package/src/components/form/fields/template/TemplateField.stories.tsx +314 -1
  130. package/src/components/form/fields/template/TemplateField.tsx +47 -8
  131. package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +7 -0
  132. package/src/components/form/index.tsx +1 -0
  133. package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +62 -0
  134. package/src/components/searchFilterBar/SearchFilterBar.tsx +13 -0
  135. package/src/components/ticketThread/TicketThread.tsx +7 -0
  136. package/src/helpers/common.ts +11 -1
  137. package/src/helpers/optionUiTypes.ts +161 -0
  138. package/src/helpers/options.ts +23 -0
  139. package/src/helpers/providerValue.ts +125 -0
  140. package/src/helpers/singleLineString.ts +61 -0
  141. package/src/helpers/templates.ts +272 -3
  142. package/src/helpers/validations.ts +1177 -109
  143. package/src/hooks/useWebSocket/useWebsocket.stories.tsx +23 -2
  144. package/src/index.tsx +1 -0
@@ -1,5 +1,15 @@
1
1
  import { IReqoreFormTemplates } from '@qoretechnologies/reqore/dist/components/Textarea';
2
2
  import { TReqoreDropdownItem } from '@qoretechnologies/reqore/dist/components/Dropdown/list';
3
+ /**
4
+ * The DOM ceiling for a serialized example value in a picker item — a
5
+ * binary-carrying field's example (e.g. an email attachment body) can be an
6
+ * entire base64 file, and it must not enter the item wholesale. The VISUAL
7
+ * truncation is not this number: past the ceiling the item also gets a
8
+ * single-line-ellipsis description (`descriptionEffect.noWrap`), which cuts at
9
+ * the popover's ACTUAL rendered width — container-intrinsic, no breakpoints —
10
+ * paired with the "?" action that shows the full value.
11
+ */
12
+ export declare const TEMPLATE_EXAMPLE_PREVIEW_LENGTH = 150;
3
13
  /**
4
14
  * Shared template string utilities.
5
15
  * Used by both validations and TemplateField.
@@ -15,7 +25,97 @@ export declare const getTemplateTagStyle: (meta?: TTemplateMeta) => {
15
25
  export declare const isValueTemplate: (value: string) => boolean;
16
26
  export declare const getTemplateKey: (value: string) => string;
17
27
  export declare const getTemplateValue: (value: string) => string;
28
+ /**
29
+ * The canonical template-token grammar (twin of the IDE's
30
+ * `helpers/templateValue.ts` — keep the two in step). A token is
31
+ * `$<key>:<segment>(:<segment>)*` where the key may carry dashes
32
+ * (`-expr`) and every segment is either a plain word or a braced
33
+ * context reference — `{W2n….filename}` — whose content may hold dots,
34
+ * colons, spaces and dashes (`:{deep:test:list}`,
35
+ * `{id.Created by.name}`). `isValueTemplate` above stays deliberately
36
+ * LOOSER (starts with `$`, has `:`): it answers "does the user mean a
37
+ * template here" while typing; use the strict check below when a decision
38
+ * must not misfire on user-typed dollar-strings.
39
+ */
40
+ export declare const TEMPLATE_TOKEN_SOURCE = "\\$[A-Za-z_][\\w-]*(?::(?:\\{[^}]*\\}|[A-Za-z_][\\w-]*))+";
41
+ /** STRICT whole-value check: the entire string is one well-formed template
42
+ * token (`:{id.path}`, `:item`, …) — nothing before or after.
43
+ * `'$foo: hello'` passes the loose check but not this one. */
44
+ export declare const isCompleteTemplateToken: (value?: unknown) => value is string;
45
+ /** A complete token carrying at least one BRACED context segment —
46
+ * `$data:{W2n….filename}`, `$qore-expr:{1 + 2}`. These are machine-written
47
+ * references nobody types by hand, so a surface may render them as a picker
48
+ * chip. Plain word-path tokens (`$local:id`) stay typeable and belong in the
49
+ * template-offering input (build #123 review). Word segments cannot contain
50
+ * `{`, so `:{` inside a complete token always starts a braced segment. */
51
+ export declare const isBracedTemplateToken: (value?: unknown) => value is string;
52
+ /**
53
+ * The longest catalogue item whose path is a PREFIX of `value`, plus the part
54
+ * of the path it does not cover.
55
+ *
56
+ * A catalogue can only offer what the action's output type declares, so it
57
+ * stops at a list: `choices` is offered, `choices[0].message.content` is not —
58
+ * an operator hand-extends the path past the named field. Such a value has no
59
+ * item to match and used to render as its own raw token. Naming it by its
60
+ * nearest ancestor (`Choices[0].message.content`) keeps the chip readable
61
+ * without inventing a catalogue entry that does not exist.
62
+ *
63
+ * The match must break at a path boundary (`.` or `[`) so `choicesOther` is
64
+ * never named after `choices`, and the token keys must agree so a `$config:`
65
+ * item never names a `$data:` value.
66
+ */
67
+ export declare const findTemplateByPath: (templates: IReqoreFormTemplates, value: string) => {
68
+ item: TReqoreDropdownItem;
69
+ remainder: string;
70
+ } | undefined;
18
71
  export declare const findTemplate: (templates: IReqoreFormTemplates, value: string) => TReqoreDropdownItem | undefined;
72
+ /**
73
+ * The one answer to "what is this reference called?", so a value reads the
74
+ * same in the picker chip, the read-only tag and the compact row's summary.
75
+ * Exact match first (aliases included), then the nearest catalogue ancestor
76
+ * for a hand-extended path, and finally the raw token — which is honest when
77
+ * the catalogue holds nothing that explains the value.
78
+ */
79
+ export declare const resolveTemplateLabel: (templates: IReqoreFormTemplates | undefined, value: string) => {
80
+ label: string;
81
+ item?: TReqoreDropdownItem;
82
+ };
83
+ /**
84
+ * What to call a reference when the catalogue explains nothing about it — the
85
+ * reference's own path, with the token wrapper stripped:
86
+ * `$data:{dc_ai_reply.choices[0].message.content}` reads as
87
+ * `dc_ai_reply.choices[0].message.content`.
88
+ *
89
+ * Surfaces exist with no catalogue at all (the Automation Hub template preview
90
+ * never fetches one), and there the raw token is the only thing left to show.
91
+ * Showing it as `$data:{…}` renders a value as code; showing the path renders
92
+ * it as a name, which is the honest floor.
93
+ */
94
+ export declare const getTemplateReferencePath: (value: string) => string;
95
+ /**
96
+ * The best available name for a reference, for a surface that must show
97
+ * something readable no matter what: the catalogue's name when it has one,
98
+ * otherwise the bare path. `resolveTemplateLabel` keeps falling back to the
99
+ * raw token, because a picker that cannot resolve a value should say exactly
100
+ * what the value is.
101
+ */
102
+ export declare const describeTemplateReference: (templates: IReqoreFormTemplates | undefined, value: string) => {
103
+ label: string;
104
+ item?: TReqoreDropdownItem;
105
+ };
106
+ export type TTemplateTextSegment = {
107
+ kind: 'text';
108
+ text: string;
109
+ } | {
110
+ kind: 'token';
111
+ text: string;
112
+ };
113
+ /**
114
+ * Splits prose that embeds template tokens into its literal and token parts —
115
+ * `trim("$data:{…}")` becomes `trim("`, the token, `")`. Used to chip the
116
+ * references inside a rendered expression instead of printing them raw.
117
+ */
118
+ export declare const splitTemplateTokens: (text?: string) => TTemplateTextSegment[];
19
119
  export declare const filterTemplatesByType: (templates?: IReqoreFormTemplates, fieldType?: string, hasArgSchema?: boolean) => IReqoreFormTemplates;
20
120
  interface ITemplateItemPayload {
21
121
  display_name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/helpers/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EACL,mBAAmB,EAEpB,MAAM,wDAAwD,CAAC;AAIhE;;;GAGG;AAEH,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5F,eAAO,MAAM,mBAAmB,UACvB,aAAa,KACnB;IAAE,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;CAI1C,CAAC;AAEF,eAAO,MAAM,eAAe,UAAW,MAAM,KAAG,OAK/C,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAG9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MAGhD,CAAC;AAEF,eAAO,MAAM,YAAY,cACZ,oBAAoB,SACxB,MAAM,KACZ,mBAAmB,GAAG,SAoBxB,CAAC;AAMF,eAAO,MAAM,qBAAqB,eACrB,oBAAoB,qCAEhB,OAAO,KACrB,oBAgEF,CAAC;AAOF,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,MAAM,EAAE,MAAM,GAAG;QACh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ACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;QAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,eAAO,MAAM,cAAc,eACb,iBAAiB,KAC5B,oBAAoB,GAAG,SAgJzB,CAAC"}
@@ -20,9 +20,22 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  return to.concat(ar || Array.prototype.slice.call(from));
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.buildTemplates = exports.filterTemplatesByType = exports.findTemplate = exports.getTemplateValue = exports.getTemplateKey = exports.isValueTemplate = exports.getTemplateTagStyle = void 0;
23
+ exports.buildTemplates = exports.filterTemplatesByType = exports.splitTemplateTokens = exports.describeTemplateReference = exports.getTemplateReferencePath = exports.resolveTemplateLabel = exports.findTemplate = exports.findTemplateByPath = exports.isBracedTemplateToken = exports.isCompleteTemplateToken = exports.TEMPLATE_TOKEN_SOURCE = exports.getTemplateValue = exports.getTemplateKey = exports.isValueTemplate = exports.getTemplateTagStyle = exports.TEMPLATE_EXAMPLE_PREVIEW_LENGTH = void 0;
24
+ var reqore_1 = require("@qoretechnologies/reqore");
24
25
  var lodash_1 = require("lodash");
26
+ var react_1 = require("react");
27
+ var ExampleValueModal_1 = require("../components/form/fields/template/ExampleValueModal");
25
28
  var expressions_1 = require("./expressions");
29
+ /**
30
+ * The DOM ceiling for a serialized example value in a picker item — a
31
+ * binary-carrying field's example (e.g. an email attachment body) can be an
32
+ * entire base64 file, and it must not enter the item wholesale. The VISUAL
33
+ * truncation is not this number: past the ceiling the item also gets a
34
+ * single-line-ellipsis description (`descriptionEffect.noWrap`), which cuts at
35
+ * the popover's ACTUAL rendered width — container-intrinsic, no breakpoints —
36
+ * paired with the "?" action that shows the full value.
37
+ */
38
+ exports.TEMPLATE_EXAMPLE_PREVIEW_LENGTH = 150;
26
39
  var getTemplateTagStyle = function (meta) {
27
40
  if (meta === null || meta === void 0 ? void 0 : meta.isEventTrigger)
28
41
  return { intent: 'success' };
@@ -48,13 +61,119 @@ var getTemplateValue = function (value) {
48
61
  return value.substring(colonIndex + 1);
49
62
  };
50
63
  exports.getTemplateValue = getTemplateValue;
64
+ /**
65
+ * The canonical template-token grammar (twin of the IDE's
66
+ * `helpers/templateValue.ts` — keep the two in step). A token is
67
+ * `$<key>:<segment>(:<segment>)*` where the key may carry dashes
68
+ * (`-expr`) and every segment is either a plain word or a braced
69
+ * context reference — `{W2n….filename}` — whose content may hold dots,
70
+ * colons, spaces and dashes (`:{deep:test:list}`,
71
+ * `{id.Created by.name}`). `isValueTemplate` above stays deliberately
72
+ * LOOSER (starts with `$`, has `:`): it answers "does the user mean a
73
+ * template here" while typing; use the strict check below when a decision
74
+ * must not misfire on user-typed dollar-strings.
75
+ */
76
+ exports.TEMPLATE_TOKEN_SOURCE = '\\$[A-Za-z_][\\w-]*(?::(?:\\{[^}]*\\}|[A-Za-z_][\\w-]*))+';
77
+ var COMPLETE_TEMPLATE_TOKEN = new RegExp("^".concat(exports.TEMPLATE_TOKEN_SOURCE, "$"));
78
+ /** STRICT whole-value check: the entire string is one well-formed template
79
+ * token (`:{id.path}`, `:item`, …) — nothing before or after.
80
+ * `'$foo: hello'` passes the loose check but not this one. */
81
+ var isCompleteTemplateToken = function (value) {
82
+ return typeof value === 'string' && COMPLETE_TEMPLATE_TOKEN.test(value);
83
+ };
84
+ exports.isCompleteTemplateToken = isCompleteTemplateToken;
85
+ /** A complete token carrying at least one BRACED context segment —
86
+ * `$data:{W2n….filename}`, `$qore-expr:{1 + 2}`. These are machine-written
87
+ * references nobody types by hand, so a surface may render them as a picker
88
+ * chip. Plain word-path tokens (`$local:id`) stay typeable and belong in the
89
+ * template-offering input (build #123 review). Word segments cannot contain
90
+ * `{`, so `:{` inside a complete token always starts a braced segment. */
91
+ var isBracedTemplateToken = function (value) {
92
+ return (0, exports.isCompleteTemplateToken)(value) && value.includes(':{');
93
+ };
94
+ exports.isBracedTemplateToken = isBracedTemplateToken;
95
+ /**
96
+ * An FSM state carries TWO identities: the key it occupies in the `states`
97
+ * hash and its own `id`. The IDE gives both the same nanoid, so nothing
98
+ * authored there can tell them apart — but a template hand-writes numbered
99
+ * keys (`'1'`, `'2'`, …) over meaningful ids (`dc_ai_reply`), its saved
100
+ * `$data:{…}` references use the **id**, and the server's design-time
101
+ * catalogue spells its item values with the **key**. The two never match as
102
+ * text, so a template-derived Qog renders the raw token where a named chip
103
+ * belongs.
104
+ *
105
+ * The producer of the catalogue (the IDE, which is the side that holds the
106
+ * states) attaches the alternate spelling here rather than rewriting either
107
+ * side — a picked value must keep storing exactly what the catalogue says.
108
+ * Consuming it is therefore purely a display concern.
109
+ */
110
+ var matchesTemplateValue = function (item, value) {
111
+ var _a, _b;
112
+ return item.value === value ||
113
+ !!((_b = (_a = item.metadata) === null || _a === void 0 ? void 0 : _a.aliasValues) === null || _b === void 0 ? void 0 : _b.includes(value));
114
+ };
115
+ /** Splits `$data:{a.b.c}` into its key (`$data`) and inner path (`a.b.c`). */
116
+ var TEMPLATE_TOKEN_PATH = /^(\$[A-Za-z_][\w-]*):\{(.*)\}$/;
117
+ var getTokenPath = function (value) {
118
+ var match = typeof value === 'string' ? TEMPLATE_TOKEN_PATH.exec(value) : null;
119
+ return match ? { key: match[1], path: match[2] } : undefined;
120
+ };
121
+ /**
122
+ * The longest catalogue item whose path is a PREFIX of `value`, plus the part
123
+ * of the path it does not cover.
124
+ *
125
+ * A catalogue can only offer what the action's output type declares, so it
126
+ * stops at a list: `choices` is offered, `choices[0].message.content` is not —
127
+ * an operator hand-extends the path past the named field. Such a value has no
128
+ * item to match and used to render as its own raw token. Naming it by its
129
+ * nearest ancestor (`Choices[0].message.content`) keeps the chip readable
130
+ * without inventing a catalogue entry that does not exist.
131
+ *
132
+ * The match must break at a path boundary (`.` or `[`) so `choicesOther` is
133
+ * never named after `choices`, and the token keys must agree so a `$config:`
134
+ * item never names a `$data:` value.
135
+ */
136
+ var findTemplateByPath = function (templates, value) {
137
+ var ref = getTokenPath(value);
138
+ if (!ref)
139
+ return undefined;
140
+ var best;
141
+ var consider = function (item, candidate) {
142
+ var itemPath = getTokenPath(candidate);
143
+ if (!itemPath || itemPath.key !== ref.key || !ref.path.startsWith(itemPath.path)) {
144
+ return;
145
+ }
146
+ var boundary = ref.path[itemPath.path.length];
147
+ if (boundary !== '.' && boundary !== '[') {
148
+ return;
149
+ }
150
+ if (!best || itemPath.path.length > best.path.length) {
151
+ best = { item: item, path: itemPath.path, remainder: ref.path.slice(itemPath.path.length) };
152
+ }
153
+ };
154
+ var walk = function (items) {
155
+ items === null || items === void 0 ? void 0 : items.forEach(function (item) {
156
+ var _a, _b;
157
+ consider(item, item.value);
158
+ (_b = (_a = item.metadata) === null || _a === void 0 ? void 0 : _a.aliasValues) === null || _b === void 0 ? void 0 : _b.forEach(function (alias) {
159
+ return consider(item, alias);
160
+ });
161
+ if (item.items) {
162
+ walk(item.items);
163
+ }
164
+ });
165
+ };
166
+ walk(templates === null || templates === void 0 ? void 0 : templates.items);
167
+ return best ? { item: best.item, remainder: best.remainder } : undefined;
168
+ };
169
+ exports.findTemplateByPath = findTemplateByPath;
51
170
  var findTemplate = function (templates, value) {
52
171
  if (!value)
53
172
  return undefined;
54
173
  var result = undefined;
55
174
  var findItem = function (items) {
56
175
  items === null || items === void 0 ? void 0 : items.forEach(function (item) {
57
- if (item.value === value) {
176
+ if (matchesTemplateValue(item, value)) {
58
177
  result = item;
59
178
  return;
60
179
  }
@@ -67,6 +186,93 @@ var findTemplate = function (templates, value) {
67
186
  return result;
68
187
  };
69
188
  exports.findTemplate = findTemplate;
189
+ /**
190
+ * Joins a catalogue item's name to the part of the path it does not cover.
191
+ * A field step reads as a step (`Choices › message`), while an array index
192
+ * binds to the name it indexes (`Choices[0]`) rather than floating off it.
193
+ */
194
+ var composeExtendedLabel = function (label, remainder) {
195
+ return remainder.startsWith('.') ? "".concat(label, " \u203A ").concat(remainder.slice(1)) : "".concat(label).concat(remainder);
196
+ };
197
+ /**
198
+ * The one answer to "what is this reference called?", so a value reads the
199
+ * same in the picker chip, the read-only tag and the compact row's summary.
200
+ * Exact match first (aliases included), then the nearest catalogue ancestor
201
+ * for a hand-extended path, and finally the raw token — which is honest when
202
+ * the catalogue holds nothing that explains the value.
203
+ */
204
+ var resolveTemplateLabel = function (templates, value) {
205
+ if (!templates || !value) {
206
+ return { label: value };
207
+ }
208
+ var exact = (0, exports.findTemplate)(templates, value);
209
+ if (exact) {
210
+ return { label: exact.label || value, item: exact };
211
+ }
212
+ var extended = (0, exports.findTemplateByPath)(templates, value);
213
+ if (extended) {
214
+ return {
215
+ label: composeExtendedLabel(extended.item.label, extended.remainder),
216
+ item: extended.item,
217
+ };
218
+ }
219
+ return { label: value };
220
+ };
221
+ exports.resolveTemplateLabel = resolveTemplateLabel;
222
+ /**
223
+ * What to call a reference when the catalogue explains nothing about it — the
224
+ * reference's own path, with the token wrapper stripped:
225
+ * `$data:{dc_ai_reply.choices[0].message.content}` reads as
226
+ * `dc_ai_reply.choices[0].message.content`.
227
+ *
228
+ * Surfaces exist with no catalogue at all (the Automation Hub template preview
229
+ * never fetches one), and there the raw token is the only thing left to show.
230
+ * Showing it as `$data:{…}` renders a value as code; showing the path renders
231
+ * it as a name, which is the honest floor.
232
+ */
233
+ var getTemplateReferencePath = function (value) { var _a, _b; return (_b = (_a = getTokenPath(value)) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : value; };
234
+ exports.getTemplateReferencePath = getTemplateReferencePath;
235
+ /**
236
+ * The best available name for a reference, for a surface that must show
237
+ * something readable no matter what: the catalogue's name when it has one,
238
+ * otherwise the bare path. `resolveTemplateLabel` keeps falling back to the
239
+ * raw token, because a picker that cannot resolve a value should say exactly
240
+ * what the value is.
241
+ */
242
+ var describeTemplateReference = function (templates, value) {
243
+ var resolved = (0, exports.resolveTemplateLabel)(templates, value);
244
+ return resolved.item ? resolved : { label: (0, exports.getTemplateReferencePath)(value) };
245
+ };
246
+ exports.describeTemplateReference = describeTemplateReference;
247
+ var EMBEDDED_TEMPLATE_TOKEN = new RegExp(exports.TEMPLATE_TOKEN_SOURCE, 'g');
248
+ /**
249
+ * Splits prose that embeds template tokens into its literal and token parts —
250
+ * `trim("$data:{…}")` becomes `trim("`, the token, `")`. Used to chip the
251
+ * references inside a rendered expression instead of printing them raw.
252
+ */
253
+ var splitTemplateTokens = function (text) {
254
+ if (!text) {
255
+ return [];
256
+ }
257
+ var segments = [];
258
+ var lastIndex = 0;
259
+ // A fresh regex per call: a shared /g instance carries `lastIndex` between
260
+ // calls and would skip tokens on the second string it is given.
261
+ var pattern = new RegExp(EMBEDDED_TEMPLATE_TOKEN.source, 'g');
262
+ var match;
263
+ while ((match = pattern.exec(text)) !== null) {
264
+ if (match.index > lastIndex) {
265
+ segments.push({ kind: 'text', text: text.slice(lastIndex, match.index) });
266
+ }
267
+ segments.push({ kind: 'token', text: match[0] });
268
+ lastIndex = match.index + match[0].length;
269
+ }
270
+ if (lastIndex < text.length) {
271
+ segments.push({ kind: 'text', text: text.slice(lastIndex) });
272
+ }
273
+ return segments;
274
+ };
275
+ exports.splitTemplateTokens = splitTemplateTokens;
70
276
  // Ported verbatim from qorus-ide `helpers/functions.tsx` (FIELD_STACK_REPORT
71
277
  // batch) — the previous reqraft version used naive badge equality; the IDE
72
278
  // routes compatibility through `areQorusTypesCompatible` (int↔string coercion
@@ -126,11 +332,21 @@ var buildTemplates = function (templates) {
126
332
  if (items === void 0) { items = []; }
127
333
  return items.map(function (_a) {
128
334
  var itemDisplayName = _a.display_name, value = _a.value, example_value = _a.example_value, type = _a.type, childItems = _a.items, itemDataRole = _a.data_role;
335
+ var serializedExample = example_value !== undefined ? JSON.stringify(example_value) : undefined;
336
+ var exampleIsLong = serializedExample !== undefined &&
337
+ serializedExample.length > exports.TEMPLATE_EXAMPLE_PREVIEW_LENGTH;
129
338
  var item = {
130
339
  label: itemDisplayName,
131
- description: example_value
132
- ? "Example value: ".concat(JSON.stringify(example_value))
340
+ description: serializedExample
341
+ ? "Example value: ".concat(exampleIsLong
342
+ ? "".concat(serializedExample.slice(0, exports.TEMPLATE_EXAMPLE_PREVIEW_LENGTH), "\u2026")
343
+ : serializedExample)
133
344
  : undefined,
345
+ // Ellipsize ONLY where the "?" full-value affordance exists — for a
346
+ // short value an ellipsis would hide information with no way to
347
+ // reveal it. The single line cuts at the rendered width, so the
348
+ // preview adapts to any popover/panel width without breakpoints.
349
+ descriptionEffect: exampleIsLong ? { noWrap: true } : undefined,
134
350
  badge: type,
135
351
  metadata: {
136
352
  image: logo,
@@ -146,6 +362,23 @@ var buildTemplates = function (templates) {
146
362
  transparent: false,
147
363
  minimal: true,
148
364
  };
365
+ if (exampleIsLong) {
366
+ // Menu-item actions stop propagation, so the click never selects or
367
+ // expands the item. The modal rides reqore's global modal queue
368
+ // (rendered by the provider portal), so no host component is needed
369
+ // — the modals wrapper injects `isOpen`/`onClose` itself.
370
+ item.rightAction = {
371
+ icon: 'QuestionLine',
372
+ compact: true,
373
+ tooltip: 'Show the full example value',
374
+ onClick: function () {
375
+ reqore_1.modalStore.getState().addModal((0, react_1.createElement)(ExampleValueModal_1.ReqraftTemplateExampleValueModal, {
376
+ label: itemDisplayName,
377
+ value: serializedExample,
378
+ }));
379
+ },
380
+ };
381
+ }
149
382
  if (childItems === null || childItems === void 0 ? void 0 : childItems.length) {
150
383
  item.items = mapTemplates(childItems, app, action, logo, display_name, builtIn, isEventTrigger, dataRole);
151
384
  item.stackWithActions = false;
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/helpers/templates.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,iCAAyC;AACzC,6CAAwD;AASjD,IAAM,mBAAmB,GAAG,UACjC,IAAoB;IAEpB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACvD,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAChD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,IAAM,eAAe,GAAG,UAAC,KAAa;IAC3C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACtD,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B;AAEK,IAAM,cAAc,GAAG,UAAC,KAAa;IACnC,IAAA,GAAG,GAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAApB,CAAqB;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEK,IAAM,gBAAgB,GAAG,UAAC,KAAa;IAC5C,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EAAE;oBACR,QAAQ,EAAE,SAAS;iBACpB;gBACD,KAAK,EAAE,YAAY,CACjB,KAAK,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,SAAS,CACV;aACF,CAAC;QAvByB,CAuBzB,CACH;KACsB,CAAC;AAC5B,CAAC,CAAC;AAlJW,QAAA,cAAc,kBAkJzB"}
@@ -1,4 +1,19 @@
1
1
  import { IQorusFormSchema, TQorusForm } from '@qoretechnologies/ts-toolkit';
2
+ import { TVariableActionValue } from './providerValue';
3
+ /**
4
+ * A five-field cron expression, from either representation a caller may hold.
5
+ *
6
+ * A schedule reaches the form in one of two shapes, and both are legitimate: a
7
+ * joined string (`"0 0 1 1 *"`), or the hash a Qorus job carries
8
+ * (`{minutes, hours, days, months, dow}` — also accepted under the singular
9
+ * `minute`/`hour`/`day`/`month`/`weekday` spellings). The renderer already
10
+ * accepted both; validation did not, and fed the hash straight to
11
+ * `isValidCron`, which calls `.trim()` on it.
12
+ *
13
+ * Returns `undefined` for anything that is neither, so the caller reports an
14
+ * invalid value rather than throwing.
15
+ */
16
+ export declare const cronExpressionFromValue: (value: unknown) => string | undefined;
2
17
  export interface IValidationResult {
3
18
  isValid: boolean;
4
19
  reason?: string;
@@ -13,16 +28,48 @@ interface IFieldValidationProps {
13
28
  validation_regex?: string;
14
29
  required_groups?: string[];
15
30
  optionSchema?: IQorusFormSchema;
16
- options?: TQorusForm;
31
+ /** The sibling option VALUES, for required-group and dependency checks.
32
+ * Widened because a schema entry is also passed straight in as `field`, and
33
+ * a schema entry carries an `options` of its own — the field's UI options
34
+ * bag (`{ file?: DropzoneOptions }`) — under the same name. */
35
+ options?: TQorusForm | Record<string, any>;
17
36
  isFunction?: boolean;
18
37
  arg_schema?: IQorusFormSchema;
19
38
  ui_element_type?: string;
20
39
  element_type?: string;
21
40
  allowed_values?: any[];
41
+ element_allowed_values?: any[];
22
42
  disabled?: boolean;
23
43
  metadata?: Record<string, any>;
44
+ /** The expression catalogue, when a caller holds one already — see
45
+ * {@link setExpressionCatalogueReader} for where it comes from otherwise. */
46
+ expressions?: any[];
47
+ /** The two key names an `array-of-pairs` row is made of. */
48
+ fields?: string[];
49
+ /** Set for a provider chosen as an FSM variable, which must support an action. */
50
+ isVariable?: boolean;
51
+ /** The declaration a `var-action` is resolved against. Partial because it
52
+ * carries only the provider half — the action supplies the variable half,
53
+ * and the two are merged before the provider validator sees them. */
54
+ variableData?: {
55
+ value?: Partial<TVariableActionValue>;
56
+ };
24
57
  [key: string]: any;
25
58
  }
59
+ /**
60
+ * Where the expression catalogue comes from when a caller does not carry one.
61
+ *
62
+ * Every other rule here is a pure function of the value and its schema, but an
63
+ * expression can only be checked against the catalogue of operations the server
64
+ * publishes — which is application state, fetched once and held in a store. The
65
+ * library must not reach into a consumer's store, so the consumer hands the
66
+ * reader in instead: qorus-ide registers one that reads its expressions store.
67
+ *
68
+ * Unregistered, the catalogue is empty, and `case 'expression'` then validates
69
+ * only what an expression can be judged on by itself (see the ordering there).
70
+ */
71
+ type TExpressionCatalogueReader = () => any[] | undefined;
72
+ export declare const setExpressionCatalogueReader: (reader?: TExpressionCatalogueReader) => void;
26
73
  export declare const _validateField: (type: string, value?: any, field?: IFieldValidationProps, canBeNull?: boolean) => IValidationResult;
27
74
  /**
28
75
  * Read one arg out of a hash, whichever of the two legitimate shapes it is in.
@@ -46,8 +93,62 @@ export declare const validateField: (type: string, value?: any, field?: IFieldVa
46
93
  export declare const maybeParseYaml: (yaml: any) => any;
47
94
  export declare const isValueSet: (value: any, canBeNull?: boolean) => boolean;
48
95
  export declare const getValueOrDefaultValue: (value: any, defaultValue: any, canBeNull?: boolean) => any;
49
- export declare const getTypeFromValue: (value: any) => string;
96
+ /** Deliberately un-annotated: the inferred literal union is what callers assign
97
+ * into their own narrower type aliases, and widening it to `string` breaks
98
+ * them. */
99
+ export declare const getTypeFromValue: (value: any) => "string" | "date" | "list" | "auto" | "int" | "float" | "hash" | "any" | "bool";
50
100
  export declare const validateOptionWithRequiredGroups: (options: TQorusForm, schema: IQorusFormSchema, groups: string[]) => boolean;
101
+ /** Why a required option is not satisfied by the current values. */
102
+ export type TUnresolvedRequiredOptionReason =
103
+ /** No value at all — neither typed, nor defaulted, nor preselected. */
104
+ 'missing'
105
+ /** The option's dependencies are not fulfilled, so its value cannot be final yet. */
106
+ | 'dependency'
107
+ /** A value is present but does not validate against the option's type / schema. */
108
+ | 'invalid';
109
+ export interface IUnresolvedRequiredOption {
110
+ /** The option's key in the schema. */
111
+ name: string;
112
+ reason: TUnresolvedRequiredOptionReason;
113
+ /** The failing validation, present only for the `invalid` reason. */
114
+ validation?: IValidationResult;
115
+ }
116
+ export declare const getUnresolvedRequiredOptionReason: ({ name, reason }: IUnresolvedRequiredOption, optionSchema?: IQorusFormSchema) => string;
117
+ /**
118
+ * List every required option that the given values do not resolve.
119
+ *
120
+ * `required` on an option schema means "the effective configuration must carry
121
+ * this option" — NOT "the user has to type it in". An option whose schema
122
+ * default or preselected value already resolves it needs no user input at all,
123
+ * which is why callers pass values that have been through `fixOptions()`
124
+ * (defaults, preselected values and rich-text default envelopes applied)
125
+ * rather than the raw values the server returned.
126
+ *
127
+ * This is the single owner of the "which required options still need input"
128
+ * question: `validateField('options', …)` uses it for form validity, and
129
+ * qorus-ide's `ConnectionManagementModal` uses it to decide whether a
130
+ * connection can be created — and its OAuth2 flow started — without showing a
131
+ * form at all.
132
+ */
133
+ export declare const getUnresolvedRequiredOptions: (optionSchema?: IQorusFormSchema, options?: TQorusForm) => IUnresolvedRequiredOption[];
134
+ /**
135
+ * Split a dependency entry into the sibling it names and how its value is compared.
136
+ *
137
+ * Three forms: `name` (the sibling must simply have a value), `name=value` (it must
138
+ * have exactly that value) and `name!=value` (it must have a value, and not that
139
+ * one). The negative form is what lets a field say it applies to every variant of a
140
+ * record but one — spelling that as an `any-of` list of every other variant is both
141
+ * unreadable in the "Depends on" lock and silently wrong the moment a variant is
142
+ * added.
143
+ *
144
+ * `!=` deliberately requires the sibling to be answered: "not X" is a statement about
145
+ * an answer, so an unanswered sibling does not satisfy it and the field stays locked.
146
+ */
147
+ export declare const parseDependency: (dependency: string) => {
148
+ name: string;
149
+ op?: '=' | '!=';
150
+ value?: string;
151
+ };
51
152
  export declare const hasAllDependenciesFullfilled: (dependencies: string[] | string[][], options: TQorusForm, optionsSchema?: IQorusFormSchema) => boolean;
52
153
  export {};
53
154
  //# sourceMappingURL=validations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../src/helpers/validations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAyB,MAAM,8BAA8B,CAAC;AAenG,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;6DACyD;IACzD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAA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