base-screen 0.1.2 → 0.2.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.
Files changed (133) hide show
  1. package/README.md +12 -5
  2. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-callbacks.d.ts +2 -0
  3. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-controller.d.ts +73 -16
  4. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-panel.d.ts +41 -0
  5. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-panel-controller.d.ts +62 -0
  6. package/dist/_internal/engine/browser/controllers/designer-size-tier-controller.d.ts +60 -0
  7. package/dist/_internal/engine/browser/controllers/panel/designer-material-group-navigation-controller.d.ts +2 -0
  8. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller.d.ts +2 -0
  9. package/dist/_internal/engine/browser/controllers/panel/designer-panel-inspector-controller.d.ts +6 -0
  10. package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +1 -0
  11. package/dist/_internal/engine/browser/controllers/workbench/designer-panel-layout-controller.d.ts +22 -1
  12. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +5 -0
  13. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +1 -0
  14. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-markup.d.ts +2 -0
  15. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-skeleton.d.ts +7 -0
  16. package/dist/_internal/engine/browser/dom/workspace/designer-workspace.d.ts +1 -1
  17. package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +1 -0
  18. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +5 -1
  19. package/dist/_internal/engine/designer-blueprint-workbench-panel-C2MoZwKA.js +3548 -0
  20. package/dist/_internal/engine/designer-dataset-controller-CPytVNBK.js +4426 -0
  21. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +7 -0
  22. package/dist/_internal/engine/designer-element/runtime/designer-element-skeleton.d.ts +14 -0
  23. package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +12 -2
  24. package/dist/_internal/engine/designer-left-panel-groups-dom-WMsH33zw.js +573 -0
  25. package/dist/_internal/engine/designer-ui-primitives-CH4RNiMa.js +2155 -0
  26. package/dist/_internal/engine/host-resource-selection-5Cf_gclK.js +2188 -0
  27. package/dist/_internal/engine/index.js +4944 -17147
  28. package/dist/_internal/renderer/index.js +266 -216
  29. package/dist/_internal/renderer/viewer/viewer-skeleton.d.ts +10 -0
  30. package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +2 -0
  31. package/dist/_internal/renderer/viewer/viewer.d.ts +8 -0
  32. package/dist/_internal/sdk/auto-register.js +7 -7
  33. package/dist/_internal/sdk/designer-auto-register.js +2 -2
  34. package/dist/_internal/sdk/designer.d.ts +6 -0
  35. package/dist/_internal/sdk/designer.js +11 -1
  36. package/dist/_internal/sdk/index.d.ts +1 -1
  37. package/dist/_internal/sdk/index.js +6 -6
  38. package/dist/authoring-EcyK2YVN.js +103 -0
  39. package/dist/authoring-EcyK2YVN.js.map +1 -0
  40. package/dist/auto-register.js +12 -10
  41. package/dist/auto-register.js.map +1 -1
  42. package/dist/contracts.js +5 -4
  43. package/dist/contracts.js.map +1 -1
  44. package/dist/{contrast-B4TH-dvm.js → contrast-CZFqj1I5.js} +23 -23
  45. package/dist/{contrast-B4TH-dvm.js.map → contrast-CZFqj1I5.js.map} +1 -1
  46. package/dist/core.js +10 -8
  47. package/dist/core.js.map +1 -1
  48. package/dist/designer-Byw45cUM.js +21 -0
  49. package/dist/designer-Byw45cUM.js.map +1 -0
  50. package/dist/designer-auto-register.js +5 -3
  51. package/dist/designer-auto-register.js.map +1 -1
  52. package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js +3517 -0
  53. package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js.map +1 -0
  54. package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js +4354 -0
  55. package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js.map +1 -0
  56. package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js +557 -0
  57. package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js.map +1 -0
  58. package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js +2146 -0
  59. package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js.map +1 -0
  60. package/dist/designer.js +5 -3
  61. package/dist/{dist-CR13A2Yb.js → dist-BHTClwId.js} +4785 -16808
  62. package/dist/dist-BHTClwId.js.map +1 -0
  63. package/dist/{dist-CAdGDmU3.js → dist-DfAV2jGI.js} +277 -227
  64. package/dist/dist-DfAV2jGI.js.map +1 -0
  65. package/dist/editor-descriptor-schema-Be30Wv8w.js +190 -0
  66. package/dist/editor-descriptor-schema-Be30Wv8w.js.map +1 -0
  67. package/dist/engine.js +4 -2
  68. package/dist/hierarchy-BQZrZWbC.js +86 -0
  69. package/dist/hierarchy-BQZrZWbC.js.map +1 -0
  70. package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js +2141 -0
  71. package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js.map +1 -0
  72. package/dist/index.js +11 -9
  73. package/dist/{manager-Bhqi_KmD.js → manager-B2CZ2b5I.js} +2 -2
  74. package/dist/{manager-Bhqi_KmD.js.map → manager-B2CZ2b5I.js.map} +1 -1
  75. package/dist/material-BPlvEmDi.js +12 -0
  76. package/dist/material-BPlvEmDi.js.map +1 -0
  77. package/dist/material-auto-register.d.ts +1 -0
  78. package/dist/material-auto-register.js +16 -0
  79. package/dist/material-auto-register.js.map +1 -0
  80. package/dist/{material-definition-BJ4ujhuj.js → material-definition-B9xCZcD-.js} +2 -2
  81. package/dist/{material-definition-BJ4ujhuj.js.map → material-definition-B9xCZcD-.js.map} +1 -1
  82. package/dist/{material-manifest-LdgIkzgH.js → material-manifest-bsGl6vZZ.js} +70 -256
  83. package/dist/material-manifest-bsGl6vZZ.js.map +1 -0
  84. package/dist/material.js +3 -2
  85. package/dist/parse-B0hwp_yj.js +264 -0
  86. package/dist/parse-B0hwp_yj.js.map +1 -0
  87. package/dist/plugin-core.js +3 -2
  88. package/dist/plugin-manager.js +1 -1
  89. package/dist/{plugin-package-BfZLl3ru.js → plugin-package-BT-pCoTt.js} +3 -3
  90. package/dist/{plugin-package-BfZLl3ru.js.map → plugin-package-BT-pCoTt.js.map} +1 -1
  91. package/dist/{plugin-registration-CYtTqIxF.js → plugin-registration-BjS_CXJU.js} +2 -2
  92. package/dist/{plugin-registration-CYtTqIxF.js.map → plugin-registration-BjS_CXJU.js.map} +1 -1
  93. package/dist/plugin-sdk.js +3 -3
  94. package/dist/{plugins-DRaykV9c.js → plugins-B9bwk-t6.js} +2 -2
  95. package/dist/{plugins-DRaykV9c.js.map → plugins-B9bwk-t6.js.map} +1 -1
  96. package/dist/plugins.js +5 -5
  97. package/dist/renderer.js +1 -1
  98. package/dist/runtime-dispatch-Dt9fhcI5.js +360 -0
  99. package/dist/runtime-dispatch-Dt9fhcI5.js.map +1 -0
  100. package/dist/{src-Bm7u11mN-BPS5TRsq.js → src-Bm7u11mN-BMeb9fvV.js} +40 -39
  101. package/dist/{src-Bm7u11mN-BPS5TRsq.js.map → src-Bm7u11mN-BMeb9fvV.js.map} +1 -1
  102. package/dist/{material-2XmHe-aH.js → text-BVzTcUas.js} +44 -52
  103. package/dist/text-BVzTcUas.js.map +1 -0
  104. package/dist/value-ref-y4_YKUP5.js +278 -0
  105. package/dist/value-ref-y4_YKUP5.js.map +1 -0
  106. package/dist/{viewer-CrJupI8I-D2BtwLsA.js → viewer-CrJupI8I-DZZfdHXr.js} +5 -5
  107. package/dist/{viewer-CrJupI8I-D2BtwLsA.js.map → viewer-CrJupI8I-DZZfdHXr.js.map} +1 -1
  108. package/dist/viewer-auto-register.js +2 -2
  109. package/dist/viewer.js +2 -2
  110. package/package.json +12 -17
  111. package/dist/_internal/react/components.d.ts +0 -32
  112. package/dist/_internal/react/index.d.ts +0 -14
  113. package/dist/_internal/react/index.js +0 -215
  114. package/dist/_internal/vue/components.d.ts +0 -36
  115. package/dist/_internal/vue/global-styles.d.ts +0 -10
  116. package/dist/_internal/vue/index.d.ts +0 -14
  117. package/dist/_internal/vue/index.js +0 -290
  118. package/dist/designer-xtN0h7PL.js +0 -11
  119. package/dist/designer-xtN0h7PL.js.map +0 -1
  120. package/dist/dist-CAdGDmU3.js.map +0 -1
  121. package/dist/dist-CR13A2Yb.js.map +0 -1
  122. package/dist/material-2XmHe-aH.js.map +0 -1
  123. package/dist/material-manifest-LdgIkzgH.js.map +0 -1
  124. package/dist/parse-CYwxTDJU.js +0 -364
  125. package/dist/parse-CYwxTDJU.js.map +0 -1
  126. package/dist/react.d.ts +0 -1
  127. package/dist/react.js +0 -213
  128. package/dist/react.js.map +0 -1
  129. package/dist/value-ref-Z0o70Vy6.js +0 -716
  130. package/dist/value-ref-Z0o70Vy6.js.map +0 -1
  131. package/dist/vue.d.ts +0 -1
  132. package/dist/vue.js +0 -288
  133. package/dist/vue.js.map +0 -1
@@ -1,716 +0,0 @@
1
- import { i as e } from "./image-url-D6mUcjY1.js";
2
- import { I as t, T as n } from "./schema-C38FI_z2.js";
3
- import { a as r } from "./read-data-value-WmMKWshv.js";
4
- import { t as i } from "./equality-DjZ9cv4u.js";
5
- //#region ../core/dist/blueprint/runtime-json.js
6
- function a(e, t, n) {
7
- switch (e.kind) {
8
- case "literal": return u(e.value);
9
- case "event-payload": return s(t, e.path);
10
- case "variable": return Object.hasOwn(n, e.variableId) ? u(n[e.variableId]) : p("BLUEPRINT_EXPRESSION_INVALID", "Blueprint variable is missing.");
11
- case "array": {
12
- let r = [];
13
- for (let i of e.items) {
14
- let e = a(i, t, n);
15
- if (!e.ok) return e;
16
- r.push(e.value);
17
- }
18
- return u(r);
19
- }
20
- case "object": {
21
- let r = {};
22
- for (let [i, o] of Object.entries(e.properties)) {
23
- let e = a(o, t, n);
24
- if (!e.ok) return e;
25
- r[i] = e.value;
26
- }
27
- return u(r);
28
- }
29
- }
30
- }
31
- function o(e, t, n) {
32
- let r = a(e.left, t, n);
33
- if (!r.ok) return p("BLUEPRINT_CONDITION_INVALID", "Blueprint condition is invalid.");
34
- if (e.operator === "exists") return {
35
- ok: !0,
36
- value: r.value !== void 0,
37
- diagnostics: []
38
- };
39
- if (e.right === void 0) return p("BLUEPRINT_CONDITION_INVALID", "Blueprint condition is invalid.");
40
- let o = a(e.right, t, n);
41
- if (!o.ok) return p("BLUEPRINT_CONDITION_INVALID", "Blueprint condition is invalid.");
42
- let s = r.value, c = o.value;
43
- if ([
44
- "gt",
45
- "gte",
46
- "lt",
47
- "lte"
48
- ].includes(e.operator) && (typeof s != "number" || typeof c != "number" || !Number.isFinite(s) || !Number.isFinite(c)) || e.operator === "contains" && !(typeof s == "string" && typeof c == "string" || Array.isArray(s))) return p("BLUEPRINT_CONDITION_INVALID", "Blueprint condition is invalid.");
49
- switch (e.operator) {
50
- case "eq": return {
51
- ok: !0,
52
- value: i(s, c),
53
- diagnostics: []
54
- };
55
- case "neq": return {
56
- ok: !0,
57
- value: !i(s, c),
58
- diagnostics: []
59
- };
60
- case "gt": return {
61
- ok: !0,
62
- value: s > c,
63
- diagnostics: []
64
- };
65
- case "gte": return {
66
- ok: !0,
67
- value: s >= c,
68
- diagnostics: []
69
- };
70
- case "lt": return {
71
- ok: !0,
72
- value: s < c,
73
- diagnostics: []
74
- };
75
- case "lte": return {
76
- ok: !0,
77
- value: s <= c,
78
- diagnostics: []
79
- };
80
- case "contains": return {
81
- ok: !0,
82
- value: typeof s == "string" ? s.includes(c) : s.some((e) => i(e, c)),
83
- diagnostics: []
84
- };
85
- default: return p("BLUEPRINT_CONDITION_INVALID", "Blueprint condition is invalid.");
86
- }
87
- }
88
- function s(e, t) {
89
- if (t.length > 16 || t.some((e) => !/^[A-Za-z_][A-Za-z0-9_]{0,127}$/.test(e) || [
90
- "__proto__",
91
- "prototype",
92
- "constructor"
93
- ].includes(e))) return p("BLUEPRINT_EXPRESSION_INVALID", "Blueprint event path is invalid.");
94
- let n = e;
95
- for (let e of t) {
96
- if (typeof n != "object" || !n || !Object.hasOwn(n, e)) return p("BLUEPRINT_EXPRESSION_INVALID", "Blueprint event path is missing.");
97
- n = n[e];
98
- }
99
- return u(n);
100
- }
101
- function c(t) {
102
- let n = e(t, { maxBytes: 2097152 });
103
- if (!n.ok || n.value === null || Array.isArray(n.value) || typeof n.value != "object") throw Error("Blueprint variable state must be a JSON object.");
104
- return { ...n.value };
105
- }
106
- function l(t) {
107
- let n = e(t, { maxBytes: 2097152 });
108
- if (!n.ok) throw Error("Blueprint plan contains invalid JSON.");
109
- return n.value;
110
- }
111
- function u(e) {
112
- try {
113
- return {
114
- ok: !0,
115
- value: l(e),
116
- diagnostics: []
117
- };
118
- } catch {
119
- return p("BLUEPRINT_EXPRESSION_INVALID", "Blueprint expression exceeds budget.");
120
- }
121
- }
122
- function d(e) {
123
- return l(e);
124
- }
125
- function f(e) {
126
- return l(e);
127
- }
128
- function p(e, t) {
129
- return {
130
- ok: !1,
131
- diagnostics: [{
132
- severity: "error",
133
- code: e,
134
- path: [],
135
- message: t
136
- }]
137
- };
138
- }
139
- //#endregion
140
- //#region ../core/dist/blueprint/runtime-compile.js
141
- function m(e, n = { hasBlueprintCapability: () => !0 }) {
142
- let i = t(e.blueprint);
143
- for (let e of i) {
144
- for (let t of e.requiredCapabilities ?? []) if (!n.hasBlueprintCapability(t)) return p("BLUEPRINT_CAPABILITY_UNAVAILABLE", "Blueprint capability is unavailable.");
145
- if (e.actions.some((e) => e.type === "component-visibility") && !n.hasBlueprintCapability("blueprint.action.component-visibility")) return p("BLUEPRINT_CAPABILITY_UNAVAILABLE", "Blueprint capability is unavailable.");
146
- }
147
- let a = {};
148
- for (let t of e.variables) {
149
- let e = r(t);
150
- a[e.id] = l(e.controlled && e.value.kind === "data-source-field" ? null : e.initialValue);
151
- }
152
- return {
153
- ok: !0,
154
- value: {
155
- rules: i.map((e) => ({
156
- ...e,
157
- trigger: { ...e.trigger },
158
- ...e.condition ? { condition: f(e.condition) } : {},
159
- actions: e.actions.map((e) => e.type === "component-visibility" || e.type === "request-variable" || e.type === "request-component-data" ? {
160
- ...e,
161
- ...e.type === "component-visibility" && e.transition !== void 0 ? { transition: { ...e.transition } } : {}
162
- } : {
163
- ...e,
164
- ...e.type === "set-variable" ? { value: d(e.value) } : { payload: d(e.payload) }
165
- })
166
- })),
167
- initialVariables: a
168
- },
169
- diagnostics: []
170
- };
171
- }
172
- //#endregion
173
- //#region ../core/dist/blueprint/runtime-dispatch.js
174
- function h(e, t, n) {
175
- return _(e, t, n, !1);
176
- }
177
- function g(e, t, n) {
178
- return _(e, t, n, !0);
179
- }
180
- function _(t, n, r, i) {
181
- let s = e(r.payload, { maxBytes: 262144 });
182
- if (!s.ok) return s;
183
- let l = c(n), u = [], d = [], f = [], p = [], m = [], h = [];
184
- for (let [e, n] of t.rules.entries()) {
185
- let t = [], c = {
186
- ruleId: n.id,
187
- triggerMatched: !1,
188
- condition: "not-evaluated",
189
- actions: t
190
- };
191
- if (!y(n.trigger, r)) {
192
- i && h.push(c);
193
- continue;
194
- }
195
- if (c.triggerMatched = !0, n.condition) {
196
- let t = o(n.condition, s.value, l);
197
- if (!t.ok) return b(t, [e]);
198
- if (c.condition = t.value ? "passed" : "failed", !t.value) {
199
- i && h.push(c);
200
- continue;
201
- }
202
- } else c.condition = "none";
203
- let g = { ...l }, _ = [...u], x = [...d], S = [...f], C = [...p], w = [...m];
204
- for (let [r, o] of n.actions.entries()) {
205
- if (o.type === "component-visibility") {
206
- S.push({
207
- componentId: o.componentId,
208
- operation: o.operation,
209
- ...o.transition === void 0 ? {} : { transition: { ...o.transition } }
210
- }), i && t.push({
211
- type: "component-visibility",
212
- actionIndex: r,
213
- componentId: o.componentId,
214
- operation: o.operation,
215
- output: {
216
- componentId: o.componentId,
217
- operation: o.operation
218
- },
219
- detached: {
220
- type: "component-visibility",
221
- actionIndex: r,
222
- componentId: o.componentId,
223
- operation: o.operation
224
- }
225
- });
226
- continue;
227
- }
228
- if (o.type === "request-variable") {
229
- if (C.push(o.variableId), i) {
230
- let e = { variableId: o.variableId };
231
- t.push({
232
- type: "request-variable",
233
- actionIndex: r,
234
- variableId: o.variableId,
235
- output: e,
236
- detached: {
237
- type: "request-variable",
238
- actionIndex: r,
239
- variableId: o.variableId
240
- }
241
- });
242
- }
243
- continue;
244
- }
245
- if (o.type === "request-component-data") {
246
- if (w.push(o.componentId), i) {
247
- let e = { componentId: o.componentId };
248
- t.push({
249
- type: "request-component-data",
250
- actionIndex: r,
251
- componentId: o.componentId,
252
- output: e,
253
- detached: {
254
- type: "request-component-data",
255
- actionIndex: r,
256
- componentId: o.componentId
257
- }
258
- });
259
- }
260
- continue;
261
- }
262
- let n = a(o.type === "set-variable" ? o.value : o.payload, s.value, g);
263
- if (!n.ok) return b(n, [e, r]);
264
- if (o.type === "set-variable" ? g[o.variableId] = n.value : o.type === "emit-host-event" ? _.push({
265
- name: o.eventName,
266
- payload: n.value
267
- }) : x.push({
268
- name: o.actionId,
269
- payload: n.value
270
- }), i) {
271
- let e = v(o, r, n.value);
272
- e !== void 0 && t.push(e);
273
- }
274
- }
275
- Object.assign(l, g), u.push(..._.slice(u.length)), d.push(...x.slice(d.length)), f.push(...S.slice(f.length)), p.push(...C.slice(p.length)), m.push(...w.slice(m.length)), i && h.push(c);
276
- }
277
- return i ? {
278
- ok: !0,
279
- value: {
280
- variables: l,
281
- hostEvents: u,
282
- hostActions: d,
283
- visibilityEffects: f,
284
- variableRequests: p,
285
- componentDataRequests: m,
286
- ruleTraces: h
287
- },
288
- diagnostics: []
289
- } : {
290
- ok: !0,
291
- value: {
292
- variables: l,
293
- hostEvents: u,
294
- hostActions: d,
295
- visibilityEffects: f,
296
- variableRequests: p,
297
- componentDataRequests: m
298
- },
299
- diagnostics: []
300
- };
301
- }
302
- function v(e, t, n) {
303
- return e.type === "set-variable" ? {
304
- type: "set-variable",
305
- actionIndex: t,
306
- variableId: e.variableId,
307
- output: n,
308
- detached: {
309
- type: "set-variable",
310
- actionIndex: t,
311
- variableId: e.variableId,
312
- output: n
313
- }
314
- } : e.type === "emit-host-event" ? {
315
- type: "emit-host-event",
316
- actionIndex: t,
317
- eventName: e.eventName,
318
- output: n,
319
- detached: {
320
- type: "emit-host-event",
321
- actionIndex: t,
322
- eventName: e.eventName,
323
- output: n
324
- }
325
- } : {
326
- type: "host-action",
327
- actionIndex: t,
328
- actionId: e.actionId,
329
- output: n,
330
- detached: {
331
- type: "host-action",
332
- actionIndex: t,
333
- actionId: e.actionId,
334
- output: n
335
- }
336
- };
337
- }
338
- function y(e, t) {
339
- let n = t.type ?? "material-event";
340
- return e.type !== n || e.eventName !== t.name ? !1 : e.type === "material-event" && "componentId" in t ? e.componentId === t.componentId : e.type === "variable-event" && t.type === "variable-event" && e.variableId === t.variableId;
341
- }
342
- function b(e, t) {
343
- let n = e.diagnostics[0];
344
- return n === void 0 ? {
345
- ok: !1,
346
- diagnostics: []
347
- } : {
348
- ok: !1,
349
- diagnostics: [{
350
- severity: "error",
351
- code: n.code,
352
- path: t,
353
- message: n.message
354
- }]
355
- };
356
- }
357
- //#endregion
358
- //#region ../core/dist/hierarchy/hierarchy.js
359
- var x = /* @__PURE__ */ new WeakMap();
360
- function S(e) {
361
- let t = x.get(e);
362
- if (t !== void 0) return t;
363
- let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
364
- for (let t = 0; t < e.components.length; t++) {
365
- let i = e.components[t];
366
- n.set(i.id, {
367
- component: i,
368
- index: t
369
- });
370
- let a = i.parentId, o = r.get(a);
371
- o === void 0 ? r.set(a, [i.id]) : o.push(i.id);
372
- }
373
- let i = {
374
- byId: n,
375
- childrenByParent: r
376
- };
377
- return x.set(e, i), i;
378
- }
379
- function C(e) {
380
- return e.childrenByParent.get(null) ?? [];
381
- }
382
- function w(e, t) {
383
- let n = [], r = e.byId.get(t);
384
- if (r === void 0) return n;
385
- let i = /* @__PURE__ */ new Set([t]), a = r.component.parentId;
386
- for (; a !== null && !i.has(a) && (n.push(a), i.add(a), r = e.byId.get(a), r !== void 0);) a = r.component.parentId;
387
- return n;
388
- }
389
- function T(e, t) {
390
- return w(e, t).length;
391
- }
392
- function E(e, t) {
393
- let n = [], r = [...e.childrenByParent.get(t) ?? []].reverse(), i = /* @__PURE__ */ new Set();
394
- for (; r.length > 0;) {
395
- let t = r.pop();
396
- if (i.has(t)) continue;
397
- i.add(t), n.push(t);
398
- let a = e.childrenByParent.get(t);
399
- if (a !== void 0) for (let e = a.length - 1; e >= 0; e--) r.push(a[e]);
400
- }
401
- return n;
402
- }
403
- function D(e, t) {
404
- let n = e.byId.get(t);
405
- return n === void 0 ? !1 : n.component.status.hidden ? !0 : w(e, t).some((t) => e.byId.get(t)?.component.status.hidden ?? !1);
406
- }
407
- function O(e, t) {
408
- let n = e.byId.get(t);
409
- return n === void 0 ? !1 : n.component.status.locked ? !0 : w(e, t).some((t) => e.byId.get(t)?.component.status.locked ?? !1);
410
- }
411
- function k(e, t, n) {
412
- let r = e.byId.get(t), i = e.byId.get(n);
413
- return r.component.zIndex === i.component.zIndex ? r.index - i.index : r.component.zIndex - i.component.zIndex;
414
- }
415
- function A(e, t) {
416
- return [...t].sort((t, n) => k(e, t, n));
417
- }
418
- var j = /* @__PURE__ */ new WeakMap();
419
- function M(e) {
420
- let t = j.get(e);
421
- if (t !== void 0) return t;
422
- let n = S(e), r = [], i = [...A(n, C(n))].reverse(), a = /* @__PURE__ */ new Set();
423
- for (; i.length > 0;) {
424
- let e = i.pop();
425
- if (a.has(e)) continue;
426
- a.add(e), r.push(e);
427
- let t = n.childrenByParent.get(e);
428
- if (t !== void 0) {
429
- let e = A(n, t);
430
- for (let t = e.length - 1; t >= 0; t--) i.push(e[t]);
431
- }
432
- }
433
- return j.set(e, r), r;
434
- }
435
- function ee(e, t) {
436
- let n = /* @__PURE__ */ new Set();
437
- for (let r of t) for (let t of E(e, r)) n.add(t);
438
- return n;
439
- }
440
- //#endregion
441
- //#region ../core/dist/json/path-update.js
442
- var te = 16, ne = /* @__PURE__ */ new Set([
443
- "__proto__",
444
- "prototype",
445
- "constructor"
446
- ]);
447
- function N(e, t) {
448
- if (!H(t)) return;
449
- let n = e;
450
- for (let e of t) {
451
- if (typeof n != "object" || !n) return;
452
- let t = n;
453
- if (Array.isArray(n)) {
454
- if (typeof e != "number" || e >= n.length) return;
455
- n = n[e];
456
- } else {
457
- if (typeof e != "string" || !Object.hasOwn(t, e)) return;
458
- n = t[e];
459
- }
460
- }
461
- return n;
462
- }
463
- function P(e, t, n) {
464
- if (!H(t) || t.length === 0) return;
465
- let r = B(e, t, t.length - 1, !0);
466
- if (r === void 0) return;
467
- let i = r.container, a = t[t.length - 1];
468
- if (Array.isArray(i)) {
469
- if (typeof a != "number" || a >= i.length) return;
470
- i[a] = n;
471
- } else {
472
- if (typeof a != "string") return;
473
- i[a] = n;
474
- }
475
- return r.root;
476
- }
477
- function F(e, t) {
478
- if (!H(t) || t.length === 0) return;
479
- let n = B(e, t, t.length - 1, !1);
480
- if (n === void 0) return;
481
- let r = n.container, i = t[t.length - 1];
482
- if (Array.isArray(r)) {
483
- if (typeof i != "number" || i >= r.length) return;
484
- r.splice(i, 1);
485
- } else {
486
- if (typeof i != "string") return;
487
- delete r[i];
488
- }
489
- return n.root;
490
- }
491
- function I(e, t, n, r) {
492
- return P(e, [...t, n], r);
493
- }
494
- function L(e, t, n, r) {
495
- if (!H(t) || t.length === 0 || !Number.isInteger(n) || n < 0) return;
496
- let i = B(e, t, t.length, !1);
497
- if (i === void 0) return;
498
- let a = i.container;
499
- if (Array.isArray(a)) return a.splice(Math.min(n, a.length), 0, r), i.root;
500
- }
501
- function R(e, t, n, r) {
502
- if (!H(t) || t.length === 0 || !Number.isInteger(n) || !Number.isInteger(r)) return;
503
- let i = B(e, t, t.length, !1);
504
- if (i === void 0) return;
505
- let a = i.container;
506
- if (!Array.isArray(a) || n < 0 || n >= a.length || r < 0 || r >= a.length) return;
507
- let [o] = a.splice(n, 1);
508
- if (o !== void 0) return a.splice(r, 0, o), i.root;
509
- }
510
- function z(e, t, n) {
511
- if (!H(t) || t.length === 0 || !Number.isInteger(n) || n < 0) return;
512
- let r = B(e, t, t.length, !1);
513
- if (r === void 0) return;
514
- let i = r.container;
515
- if (Array.isArray(i) && !(n >= i.length)) return i.splice(n, 1), r.root;
516
- }
517
- function B(e, t, n, r) {
518
- let i = { ...e }, a = i;
519
- for (let e = 0; e < n; e++) {
520
- let n = t[e], a;
521
- if (Array.isArray(i)) {
522
- if (typeof n != "number" || n >= i.length) return;
523
- a = i[n];
524
- } else {
525
- if (typeof n != "string") return;
526
- a = i[n];
527
- }
528
- if (typeof a != "object" || !a) return;
529
- let o = Array.isArray(a) ? [...a] : { ...a };
530
- r && V(o, t[e + 1]), i[n] = o, i = o;
531
- }
532
- return {
533
- root: a,
534
- container: i
535
- };
536
- }
537
- function V(e, t) {
538
- typeof e != "object" || !e || Array.isArray(e) || typeof t == "string" && !Object.hasOwn(e, t) && (e[t] = {});
539
- }
540
- function H(e) {
541
- if (e.length === 0 || e.length > te) return !1;
542
- for (let t = 0; t < e.length; t++) {
543
- let n = e[t];
544
- if (typeof n == "number") {
545
- if (!Number.isInteger(n) || n < 0) return !1;
546
- continue;
547
- }
548
- if (n.length === 0 || n.length > 128 || !/^[A-Za-z0-9._:-]+$/.test(n) || ne.has(n)) return !1;
549
- }
550
- return !0;
551
- }
552
- //#endregion
553
- //#region ../core/dist/data/value-ref.js
554
- function U(e, t, r = n) {
555
- if (e.kind === "inline") return W(e.value);
556
- if (e.kind === "variable") {
557
- let n = t.variableValues[e.variableId];
558
- return !Object.hasOwn(t.variableValues, e.variableId) || n === void 0 ? {
559
- kind: "failed",
560
- dataSourceId: null,
561
- reason: "variable-missing"
562
- } : W(n);
563
- }
564
- return G(e.dataSourceId, e.path, t, r);
565
- }
566
- function W(t) {
567
- let n = e(t);
568
- return n.ok ? {
569
- kind: "value",
570
- value: n.value
571
- } : {
572
- kind: "failed",
573
- dataSourceId: null,
574
- reason: "value-invalid"
575
- };
576
- }
577
- function G(t, n, r, i) {
578
- if (r.dataSourceErrors.has(t)) return {
579
- kind: "failed",
580
- dataSourceId: t,
581
- reason: "data-source-error"
582
- };
583
- if (!r.dataSourceValues.has(t)) return {
584
- kind: "pending",
585
- dataSourceId: t
586
- };
587
- let a = r.dataSourceValues.get(t), o = n.length === 0 ? a : N(a, n);
588
- if (o === void 0) return {
589
- kind: "value",
590
- value: void 0
591
- };
592
- let s = e(o, { maxBytes: i });
593
- return s.ok ? {
594
- kind: "value",
595
- value: s.value
596
- } : {
597
- kind: "failed",
598
- dataSourceId: t,
599
- reason: "value-invalid"
600
- };
601
- }
602
- function K(e) {
603
- let t = q(e) ? [e] : Object.values(e ?? {}), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
604
- for (let e of t) e.kind === "variable" ? n.add(e.variableId) : e.kind === "data-source-field" && r.add(e.dataSourceId);
605
- return {
606
- variableIds: [...n].sort(),
607
- dataSourceIds: [...r].sort()
608
- };
609
- }
610
- function q(e) {
611
- return e != null && typeof e.kind == "string";
612
- }
613
- function J(e, t, n) {
614
- if (e === null) return n.length === 0 ? {
615
- ok: !0,
616
- value: { fields: {} },
617
- diagnostics: []
618
- } : Z(["binding"]);
619
- let r = new Map(t.map((e) => [e.id, e])), i = new Map(n.map((e) => [e.id, e])), a = {};
620
- for (let [t, n] of Object.entries(e.fields)) {
621
- let e = i.get(t);
622
- if (e === void 0 || !Y(e) || n.length < e.minFields || n.length > e.maxFields || new Set(n).size !== n.length) return Z([
623
- "binding",
624
- "fields",
625
- t
626
- ]);
627
- let o = [];
628
- for (let i of n) {
629
- let n = r.get(i);
630
- if (n === void 0 || !e.valueTypes.includes(n.valueType)) return Z([
631
- "binding",
632
- "fields",
633
- t
634
- ]);
635
- o.push(re(n));
636
- }
637
- a[t] = o;
638
- }
639
- for (let e of n) if (!Y(e) || (a[e.id]?.length ?? 0) < e.minFields) return Z([
640
- "binding",
641
- "fields",
642
- e.id
643
- ]);
644
- return {
645
- ok: !0,
646
- value: { fields: a },
647
- diagnostics: []
648
- };
649
- }
650
- function Y(e) {
651
- return /^[A-Za-z_][A-Za-z0-9_]{0,127}$/.test(e.id) && Number.isInteger(e.minFields) && Number.isInteger(e.maxFields) && e.minFields >= 0 && e.maxFields >= e.minFields && e.maxFields <= 256 && e.valueTypes.length > 0 && new Set(e.valueTypes).size === e.valueTypes.length && e.valueTypes.every(X);
652
- }
653
- function X(e) {
654
- return e === "string" || e === "number" || e === "boolean" || e === "date";
655
- }
656
- function re(e) {
657
- return {
658
- id: e.id,
659
- label: e.label,
660
- valueType: e.valueType,
661
- ...e.nullable === void 0 ? {} : { nullable: e.nullable },
662
- ...e.unit === void 0 ? {} : { unit: e.unit },
663
- ...e.format === void 0 ? {} : { format: e.format }
664
- };
665
- }
666
- function Z(e) {
667
- return {
668
- ok: !1,
669
- diagnostics: [{
670
- severity: "error",
671
- code: "HOST_DATASET_BINDING_INVALID",
672
- path: e,
673
- message: "Host dataset configuration is invalid."
674
- }]
675
- };
676
- }
677
- function Q(e) {
678
- return [...new Set(Object.values(e).flatMap((e) => e.kind === "variable" ? [e.variableId] : []))].sort();
679
- }
680
- function ie(t, r) {
681
- let i = {};
682
- for (let [a, o] of Object.entries(t)) {
683
- let t = o.kind === "literal" ? o.value : r[o.variableId];
684
- if (t === void 0) return $(["params", a]);
685
- let s = e(t, { maxBytes: n });
686
- if (!s.ok) return $(["params", a]);
687
- i[a] = s.value;
688
- }
689
- let a = e(i, { maxBytes: n });
690
- return !a.ok || !ae(a.value) ? $(["params"]) : {
691
- ok: !0,
692
- value: {
693
- params: a.value,
694
- dependencies: Q(t)
695
- },
696
- diagnostics: []
697
- };
698
- }
699
- function ae(e) {
700
- return typeof e == "object" && !!e && !Array.isArray(e);
701
- }
702
- function $(e) {
703
- return {
704
- ok: !1,
705
- diagnostics: [{
706
- severity: "error",
707
- code: "HOST_DATASET_PARAMETER_INVALID",
708
- path: e,
709
- message: "Host dataset configuration is invalid."
710
- }]
711
- };
712
- }
713
- //#endregion
714
- export { g as C, h as S, ee as _, J as a, D as b, L as c, I as d, P as f, E as g, w as h, Q as i, R as l, T as m, ie as n, F as o, S as p, U as r, N as s, K as t, z as u, M as v, m as w, O as x, C as y };
715
-
716
- //# sourceMappingURL=value-ref-Z0o70Vy6.js.map