@fses/workbench-app 0.2.16 → 0.2.17
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.
- package/WORKBENCH-CLOSURE.json +18 -12
- package/dist/Workspace-r8ayksVF.js +23176 -0
- package/dist/canvas/api/index.js +1 -1
- package/dist/{canvasFacade-B2EHgdqA.js → canvasFacade-B8jYm_aO.js} +748 -748
- package/dist/cardFactory-DmEBcCf4.js +1460 -0
- package/dist/extensions/index.js +1 -1
- package/dist/fses-workbench-app.js +5 -5
- package/dist/{index-CMM-5ObU.js → index-DEOR_GPc.js} +350 -346
- package/dist/internal/personal-workbench/fde-skill-cards/runtime/fdeSkillProtocolChartDisplayData.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/assistantPersonaProfiles.d.ts +6 -6
- package/dist/internal/personal-workbench/lib/cardStyleConfig.d.ts +26 -26
- package/dist/internal/personal-workbench/lib/echartsOptionEditorBridge.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/historyCardBindingRestore.fixture.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/workbenchCanvasBusinessGapChecklist.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchCardRecommendationFallback.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchCardRecommendationReturnItemUpsert.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/workbenchDataBindingBadge.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/workbenchImageComposeEntry.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchLayout.d.ts +0 -5
- package/dist/runtime/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useWorkbenchRuntime-DLf_FgC7.js → useWorkbenchRuntime-DDD22mdF.js} +7817 -7813
- package/dist/version.d.ts +1 -1
- package/dist/{workbenchCustomComponentRegistry-Bt94Lgko.js → workbenchCustomComponentRegistry-CWUPjCnJ.js} +74 -74
- package/node_modules/@byteluck-fe/locale-message/README.md +2 -0
- package/node_modules/@byteluck-fe/locale-message/dist/index.d.ts +37 -0
- package/node_modules/@byteluck-fe/locale-message/dist/locale-message.js +55 -0
- package/node_modules/@byteluck-fe/locale-message/package.json +37 -0
- package/node_modules/@fses/ai-chat/dist/components/ContextUsageRing.vue.d.ts +5 -0
- package/node_modules/@fses/ai-chat/dist/components/FsesAiChat.vue.d.ts +5 -0
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +5446 -5321
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +16 -18
- package/node_modules/@fses/ai-chat/dist/style.css +1 -1
- package/node_modules/@fses/ai-chat/dist/utils/attachment-upload.d.ts +0 -5
- package/node_modules/@fses/ai-chat/package.json +6 -5
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +10144 -9914
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +1517 -1503
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
- package/node_modules/@fses/workbench-card/dist/renderers/chart/chartRendererRegistry.d.ts +97 -97
- package/node_modules/@fses/workbench-card/dist/renderers/style.css +1 -1
- package/node_modules/@fses/workbench-card/package.json +4 -1
- package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +99 -98
- package/node_modules/@fses/workbench-card/src/registry/compositeCardPatterns.ts +31 -30
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateCategories.ts +24 -23
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +765 -764
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +765 -764
- package/node_modules/@fses/workbench-card/src/renderers/WorkbenchBlockRenderer.vue +143 -129
- package/node_modules/@fses/workbench-card/src/renderers/chart/ChartRegistry.vue +4 -3
- package/node_modules/@fses/workbench-card/src/renderers/chart/EChartsProtocolRenderer.vue +2 -1
- package/node_modules/@fses/workbench-card/src/renderers/chart/chartRendererRegistry.ts +99 -98
- package/node_modules/@fses/workbench-card/src/renderers/chart/useEchart.ts +30 -29
- package/node_modules/@fses/workbench-card/src/renderers/native/nativeBindings.ts +11 -10
- package/node_modules/@fses/workbench-card/src/renderers/nested/nestedBlockBindings.ts +102 -101
- package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceCompositeBindings.ts +364 -363
- package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceRiskAndStrategyBindings.ts +90 -89
- package/node_modules/@fses/workbench-card/src/renderers/useWorkbenchBlockRendererBindings.ts +33 -32
- package/package.json +4 -3
- package/dist/Workspace-CfKvji6S.js +0 -22896
- package/dist/cardFactory-BK3CA-Gn.js +0 -1443
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { L as
|
|
2
|
-
const
|
|
3
|
-
{ id: "card.header.left", kind: "slot", status: "active", displayName: "Card header left slot", userFacingName: "
|
|
4
|
-
{ id: "card.header.right", kind: "slot", status: "active", displayName: "Card header right slot", userFacingName: "
|
|
5
|
-
{ id: "card.body.toolbar", kind: "slot", status: "active", displayName: "Card body toolbar slot", userFacingName: "
|
|
6
|
-
{ id: "card.body.inline", kind: "slot", status: "active", displayName: "Card body inline slot", userFacingName: "
|
|
7
|
-
{ id: "card.body.emptyState", kind: "slot", status: "active", displayName: "Card empty state slot", userFacingName: "
|
|
8
|
-
{ id: "card.footer.actions", kind: "slot", status: "active", displayName: "Card footer action slot", userFacingName: "
|
|
9
|
-
{ id: "card.detail.panel", kind: "slot", status: "active", displayName: "Card detail panel slot", userFacingName: "
|
|
10
|
-
{ id: "workspace.banner.topRight", kind: "slot", status: "active", displayName: "Workspace banner top right slot", userFacingName: "
|
|
11
|
-
{ id: "iconButton+popover", kind: "ui", status: "active", displayName: "Icon button with popover", userFacingName: "
|
|
12
|
-
{ id: "inlinePanel", kind: "ui", status: "active", displayName: "Inline panel", userFacingName: "
|
|
13
|
-
{ id: "filterBar", kind: "ui", status: "active", displayName: "Filter bar", userFacingName: "
|
|
14
|
-
{ id: "dropdownMenu", kind: "ui", status: "planned", displayName: "Dropdown menu", userFacingName: "
|
|
15
|
-
{ id: "drawerPanel", kind: "ui", status: "active", displayName: "Drawer panel", userFacingName: "
|
|
16
|
-
{ id: "cardSearchIndex", kind: "data", status: "active", displayName: "Card search index", userFacingName: "
|
|
17
|
-
{ id: "routeTargetRegistry", kind: "data", status: "active", displayName: "Route target registry", userFacingName: "
|
|
18
|
-
{ id: "businessObjectQuery", kind: "data", status: "active", displayName: "Business object query", userFacingName: "
|
|
19
|
-
{ id: "metricQuery", kind: "data", status: "planned", displayName: "Metric query", userFacingName: "
|
|
20
|
-
{ id: "focusCard", kind: "action", status: "active", displayName: "Focus card", userFacingName: "
|
|
21
|
-
{ id: "openRoute", kind: "action", status: "active", displayName: "Open route", userFacingName: "
|
|
22
|
-
{ id: "refreshData", kind: "action", status: "active", displayName: "Refresh data", userFacingName: "
|
|
23
|
-
{ id: "toggleFavorite", kind: "action", status: "active", displayName: "Toggle favorite", userFacingName: "
|
|
24
|
-
{ id: "exportData", kind: "action", status: "active", displayName: "Export data", userFacingName: "
|
|
25
|
-
{ id: "tableSelection", kind: "action", status: "active", displayName: "Table selection", userFacingName: "
|
|
26
|
-
{ id: "openDrawer", kind: "action", status: "active", displayName: "Open drawer", userFacingName: "
|
|
27
|
-
{ id: "callApiAction", kind: "action", status: "active", displayName: "Call API action", userFacingName: "
|
|
28
|
-
{ id: "submitForm", kind: "action", status: "planned", displayName: "Submit form", userFacingName: "
|
|
29
|
-
{ id: "approveTask", kind: "action", status: "planned", displayName: "Approve task", userFacingName: "
|
|
30
|
-
{ id: "onSelectResult", kind: "trigger", status: "active", displayName: "On select result", userFacingName: "
|
|
31
|
-
{ id: "onSubmit", kind: "trigger", status: "active", displayName: "On submit", userFacingName: "
|
|
32
|
-
{ id: "onClick", kind: "trigger", status: "active", displayName: "On click", userFacingName: "
|
|
33
|
-
{ id: "onChange", kind: "trigger", status: "active", displayName: "On change", userFacingName: "
|
|
34
|
-
{ id: "processCenter", kind: "routeTarget", status: "active", displayName: "Process center", userFacingName: "
|
|
35
|
-
],
|
|
1
|
+
import { d as u, L as Kt, a as rt, r as zt, l as Vt, b as qt } from "./cardFactory-DmEBcCf4.js";
|
|
2
|
+
const Et = [
|
|
3
|
+
{ id: "card.header.left", kind: "slot", status: "active", displayName: "Card header left slot", userFacingName: u("FWA.ff101787571029524"), description: u("FWA.cc9c1787570656561"), riskLevel: "low", sideEffects: [] },
|
|
4
|
+
{ id: "card.header.right", kind: "slot", status: "active", displayName: "Card header right slot", userFacingName: u("FWA.28db1787571030051"), description: u("FWA.eed41787570610595"), riskLevel: "low", sideEffects: [] },
|
|
5
|
+
{ id: "card.body.toolbar", kind: "slot", status: "active", displayName: "Card body toolbar slot", userFacingName: u("FWA.c8551787570987280"), description: u("FWA.42af1787570612169"), riskLevel: "low", sideEffects: [] },
|
|
6
|
+
{ id: "card.body.inline", kind: "slot", status: "active", displayName: "Card body inline slot", userFacingName: u("FWA.aabe1787571030593"), description: u("FWA.fd1c1787570583904"), riskLevel: "low", sideEffects: [] },
|
|
7
|
+
{ id: "card.body.emptyState", kind: "slot", status: "active", displayName: "Card empty state slot", userFacingName: u("FWA.cf1a1787571147147"), description: u("FWA.44c31787570613219"), riskLevel: "low", sideEffects: [] },
|
|
8
|
+
{ id: "card.footer.actions", kind: "slot", status: "active", displayName: "Card footer action slot", userFacingName: u("FWA.72861787571031177"), description: u("FWA.60331787570569176"), riskLevel: "low", sideEffects: [] },
|
|
9
|
+
{ id: "card.detail.panel", kind: "slot", status: "active", displayName: "Card detail panel slot", userFacingName: u("FWA.11401787571031677"), description: u("FWA.c1211787570755497"), riskLevel: "low", sideEffects: [] },
|
|
10
|
+
{ id: "workspace.banner.topRight", kind: "slot", status: "active", displayName: "Workspace banner top right slot", userFacingName: u("FWA.05c81787570988100"), description: u("FWA.8b3e1787570756878"), riskLevel: "low", sideEffects: [] },
|
|
11
|
+
{ id: "iconButton+popover", kind: "ui", status: "active", displayName: "Icon button with popover", userFacingName: u("FWA.1ce81787570988765"), description: u("FWA.f24e1787570757634"), riskLevel: "low", sideEffects: [] },
|
|
12
|
+
{ id: "inlinePanel", kind: "ui", status: "active", displayName: "Inline panel", userFacingName: u("FWA.f5d51787571147564"), description: u("FWA.ab861787570657262"), riskLevel: "low", sideEffects: [] },
|
|
13
|
+
{ id: "filterBar", kind: "ui", status: "active", displayName: "Filter bar", userFacingName: u("FWA.7b391787571592730"), description: u("FWA.10621787570910009"), riskLevel: "low", sideEffects: [] },
|
|
14
|
+
{ id: "dropdownMenu", kind: "ui", status: "planned", displayName: "Dropdown menu", userFacingName: u("FWA.3c3f1787571438794"), description: u("FWA.a9b71787570911026"), riskLevel: "low", sideEffects: [] },
|
|
15
|
+
{ id: "drawerPanel", kind: "ui", status: "active", displayName: "Drawer panel", userFacingName: u("FWA.72271787571438804"), description: u("FWA.a4871787570758551"), riskLevel: "medium", sideEffects: [] },
|
|
16
|
+
{ id: "cardSearchIndex", kind: "data", status: "active", displayName: "Card search index", userFacingName: u("FWA.94161787570989176"), description: u("FWA.d79e1787570614267"), riskLevel: "low", sideEffects: [] },
|
|
17
|
+
{ id: "routeTargetRegistry", kind: "data", status: "active", displayName: "Route target registry", userFacingName: u("FWA.52841787571083554"), description: u("FWA.ace01787570722798"), riskLevel: "low", sideEffects: [] },
|
|
18
|
+
{ id: "businessObjectQuery", kind: "data", status: "active", displayName: "Business object query", userFacingName: u("FWA.beee1787571148023"), description: u("FWA.2f801787570615313"), riskLevel: "medium", sideEffects: [] },
|
|
19
|
+
{ id: "metricQuery", kind: "data", status: "planned", displayName: "Metric query", userFacingName: u("FWA.dfd31787571148548"), description: u("FWA.d3e61787570759500"), riskLevel: "medium", sideEffects: [] },
|
|
20
|
+
{ id: "focusCard", kind: "action", status: "active", displayName: "Focus card", userFacingName: u("FWA.29f51787571263364"), description: u("FWA.56901787570911552"), riskLevel: "low", sideEffects: [] },
|
|
21
|
+
{ id: "openRoute", kind: "action", status: "active", displayName: "Open route", userFacingName: u("FWA.f7ac1787571438829"), description: u("FWA.45491787570658308"), riskLevel: "medium", sideEffects: ["navigate"] },
|
|
22
|
+
{ id: "refreshData", kind: "action", status: "active", displayName: "Refresh data", userFacingName: u("FWA.c7c41787571438840"), description: u("FWA.38231787570840924"), riskLevel: "low", sideEffects: [] },
|
|
23
|
+
{ id: "toggleFavorite", kind: "action", status: "active", displayName: "Toggle favorite", userFacingName: u("FWA.1f621787571084077"), description: u("FWA.fccb1787570723406"), riskLevel: "low", sideEffects: ["workspace_mutation"] },
|
|
24
|
+
{ id: "exportData", kind: "action", status: "active", displayName: "Export data", userFacingName: u("FWA.a4cc1787571438861"), description: u("FWA.e4421787570512024"), riskLevel: "medium", sideEffects: ["export"] },
|
|
25
|
+
{ id: "tableSelection", kind: "action", status: "active", displayName: "Table selection", userFacingName: u("FWA.cb0d1787571263547"), description: u("FWA.65981787570724371"), riskLevel: "low", sideEffects: [] },
|
|
26
|
+
{ id: "openDrawer", kind: "action", status: "active", displayName: "Open drawer", userFacingName: u("FWA.437b1787571149072"), description: u("FWA.98d41787570760241"), riskLevel: "low", sideEffects: [] },
|
|
27
|
+
{ id: "callApiAction", kind: "action", status: "active", displayName: "Call API action", userFacingName: u("FWA.81b21787571032674"), description: u("FWA.5ea41787570616361"), riskLevel: "high", sideEffects: ["business_mutation"] },
|
|
28
|
+
{ id: "submitForm", kind: "action", status: "planned", displayName: "Submit form", userFacingName: u("FWA.39961787571438890"), description: u("FWA.7e7a1787570684524"), riskLevel: "high", sideEffects: ["business_mutation"] },
|
|
29
|
+
{ id: "approveTask", kind: "action", status: "planned", displayName: "Approve task", userFacingName: u("FWA.8b921787571438910"), description: u("FWA.3a2e1787570875998"), riskLevel: "high", sideEffects: ["workflow"] },
|
|
30
|
+
{ id: "onSelectResult", kind: "trigger", status: "active", displayName: "On select result", userFacingName: u("FWA.673b1787571264412"), description: u("FWA.a7ef1787570761195"), riskLevel: "low", sideEffects: [] },
|
|
31
|
+
{ id: "onSubmit", kind: "trigger", status: "active", displayName: "On submit", userFacingName: u("FWA.a80b1787571593140"), description: u("FWA.3d7d1787570659358"), riskLevel: "low", sideEffects: [] },
|
|
32
|
+
{ id: "onClick", kind: "trigger", status: "active", displayName: "On click", userFacingName: u("FWA.cf321787571593665"), description: u("FWA.2a5a1787570792007"), riskLevel: "low", sideEffects: [] },
|
|
33
|
+
{ id: "onChange", kind: "trigger", status: "active", displayName: "On change", userFacingName: u("FWA.96471787571264938"), description: u("FWA.93d81787570725419"), riskLevel: "low", sideEffects: [] },
|
|
34
|
+
{ id: "processCenter", kind: "routeTarget", status: "active", displayName: "Process center", userFacingName: u("FWA.18201787571438929"), description: u("FWA.09ce1787570792529"), riskLevel: "medium", sideEffects: ["navigate"] }
|
|
35
|
+
], ga = {
|
|
36
36
|
processCenter: {
|
|
37
37
|
id: "processCenter",
|
|
38
|
-
name: "
|
|
38
|
+
name: u("FWA.18201787571438929"),
|
|
39
39
|
route: "/process-center",
|
|
40
40
|
acceptedParams: ["keyword", "source"]
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function Rt(t, e) {
|
|
44
|
+
return Et.find(
|
|
45
45
|
(a) => a.id === t && (!e || a.kind === e)
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
48
|
+
function xa(t) {
|
|
49
|
+
return Et.filter((e) => e.kind === t && e.status === "active").map((e) => e.id);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function j(t, e) {
|
|
52
52
|
var a;
|
|
53
|
-
return ((a =
|
|
53
|
+
return ((a = Rt(t, e)) == null ? void 0 : a.status) === "active";
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function jt(t) {
|
|
56
56
|
return {
|
|
57
57
|
slot: t.slot,
|
|
58
58
|
ui: t.ui.kind,
|
|
@@ -63,137 +63,137 @@ function $t(t) {
|
|
|
63
63
|
routeTargets: t.actions.filter((e) => e.type === "openRoute").map((e) => e.target).filter((e) => !!e)
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const e =
|
|
68
|
-
return
|
|
69
|
-
|
|
66
|
+
function Yt(t) {
|
|
67
|
+
const e = jt(t), a = [];
|
|
68
|
+
return j(e.slot, "slot") || a.push(e.slot), j(e.ui, "ui") || a.push(e.ui), j(e.data, "data") || a.push(e.data), e.actions.forEach((n) => {
|
|
69
|
+
j(n, "action") || a.push(n);
|
|
70
70
|
}), e.triggers.forEach((n) => {
|
|
71
|
-
|
|
71
|
+
j(n, "trigger") || a.push(n);
|
|
72
72
|
}), e.routeTargets.forEach((n) => {
|
|
73
|
-
|
|
73
|
+
j(n, "routeTarget") || a.push(n);
|
|
74
74
|
}), [...new Set(a)];
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Ut(t) {
|
|
77
77
|
return [...new Set(t)].map((e) => {
|
|
78
|
-
const a =
|
|
78
|
+
const a = Rt(e);
|
|
79
79
|
return {
|
|
80
80
|
id: e,
|
|
81
|
-
userFacingName: (a == null ? void 0 : a.userFacingName) ||
|
|
82
|
-
description: (a == null ? void 0 : a.description) ||
|
|
81
|
+
userFacingName: (a == null ? void 0 : a.userFacingName) || ht(e),
|
|
82
|
+
description: (a == null ? void 0 : a.description) || u("FWA.84421787570528428", { p0: ht(e) }),
|
|
83
83
|
status: (a == null ? void 0 : a.status) === "disabled" ? "disabled" : (a == null ? void 0 : a.status) === "planned" ? "planned" : "unknown"
|
|
84
84
|
};
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function ht(t) {
|
|
88
88
|
const e = {
|
|
89
|
-
exportData: "
|
|
90
|
-
exportFile: "
|
|
91
|
-
tableSelection: "
|
|
92
|
-
businessObjectQuery: "
|
|
93
|
-
metricQuery: "
|
|
94
|
-
refreshData: "
|
|
95
|
-
toggleFavorite: "
|
|
96
|
-
submitForm: "
|
|
97
|
-
approveTask: "
|
|
98
|
-
drawerPanel: "
|
|
99
|
-
filterBar: "
|
|
89
|
+
exportData: u("FWA.a4cc1787571438861"),
|
|
90
|
+
exportFile: u("FWA.a4cc1787571438861"),
|
|
91
|
+
tableSelection: u("FWA.cb0d1787571263547"),
|
|
92
|
+
businessObjectQuery: u("FWA.beee1787571148023"),
|
|
93
|
+
metricQuery: u("FWA.dfd31787571148548"),
|
|
94
|
+
refreshData: u("FWA.c7c41787571438840"),
|
|
95
|
+
toggleFavorite: u("FWA.1f621787571084077"),
|
|
96
|
+
submitForm: u("FWA.39961787571438890"),
|
|
97
|
+
approveTask: u("FWA.8b921787571438910"),
|
|
98
|
+
drawerPanel: u("FWA.72271787571438804"),
|
|
99
|
+
filterBar: u("FWA.7b391787571592730")
|
|
100
100
|
};
|
|
101
|
-
return e[t] ? e[t] : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[._-]+/g, " ").trim() || "
|
|
101
|
+
return e[t] ? e[t] : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[._-]+/g, " ").trim() || u("FWA.fd9f1787571149593");
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function $t(t, e = "") {
|
|
104
104
|
return {
|
|
105
105
|
missingPrimitives: [...new Set(t)],
|
|
106
106
|
gapType: "runtime_capability_primitives",
|
|
107
107
|
userNeed: e,
|
|
108
|
-
missingCapabilities:
|
|
108
|
+
missingCapabilities: Ut(t)
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
const
|
|
112
|
-
function
|
|
111
|
+
const Xt = /* @__PURE__ */ new Set(["callApiAction", "submitForm", "approveTask"]);
|
|
112
|
+
function Jt(t) {
|
|
113
113
|
return !!(t && typeof t == "object" && !Array.isArray(t));
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function at(t, e) {
|
|
116
|
+
return $t(t, e);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
if (!
|
|
118
|
+
function Qt(t, e = u("FWA.096d1787571020642")) {
|
|
119
|
+
if (!Jt(t))
|
|
120
120
|
return {
|
|
121
121
|
allowed: !1,
|
|
122
122
|
error: {
|
|
123
123
|
code: "INVALID_PARAMS",
|
|
124
|
-
message: "
|
|
124
|
+
message: u("FWA.7a4a1787570431480")
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
const a = t, n = Array.isArray(a.actions) ? a.actions.map((s) => s.type).filter((s) =>
|
|
127
|
+
const a = t, n = Array.isArray(a.actions) ? a.actions.map((s) => s.type).filter((s) => Xt.has(s)) : [];
|
|
128
128
|
if (n.length > 0)
|
|
129
129
|
return {
|
|
130
130
|
allowed: !1,
|
|
131
|
-
gap:
|
|
131
|
+
gap: at(n, e),
|
|
132
132
|
error: {
|
|
133
133
|
code: "POLICY_REJECTED",
|
|
134
|
-
message:
|
|
134
|
+
message: u("FWA.9e4b1787570536667", { p0: n.join("、") }),
|
|
135
135
|
details: { highRisk: n }
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
const i =
|
|
138
|
+
const i = Yt(a);
|
|
139
139
|
return i.length > 0 ? {
|
|
140
140
|
allowed: !1,
|
|
141
|
-
gap:
|
|
141
|
+
gap: at(i, e),
|
|
142
142
|
error: {
|
|
143
143
|
code: "PRIMITIVE_GAP",
|
|
144
|
-
message: "
|
|
145
|
-
details:
|
|
144
|
+
message: u("FWA.d1b41787570265678"),
|
|
145
|
+
details: at(i, e)
|
|
146
146
|
}
|
|
147
147
|
} : {
|
|
148
148
|
allowed: !0,
|
|
149
149
|
capability: a
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
function
|
|
152
|
+
const X = 4, w = Kt, S = 12, Lt = 8, Ot = 6, Ia = 4, ft = "card.custom.nestedContainer", Zt = "nested-card-container", te = 240, Ht = 16, Tt = 0.35, yt = 8, st = 2, dt = 1, ee = 1, ae = 12, U = 12, ne = 3;
|
|
153
|
+
function T(t) {
|
|
154
154
|
return Math.round(t * 1e3) / 1e3;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function V(t, e, a) {
|
|
157
157
|
return Math.min(a, Math.max(e, t));
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function f(t) {
|
|
160
160
|
return Math.max(0, Math.round(Number.isFinite(t) ? t : 0));
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function gt(t) {
|
|
163
163
|
return Math.max(0, Math.round(Number.isFinite(t) ? t : 0));
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function h(t) {
|
|
166
166
|
return Math.max(1, Math.round(Number.isFinite(t) ? t : 1));
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const a =
|
|
170
|
-
return n > S ? n :
|
|
168
|
+
function ie(t, e) {
|
|
169
|
+
const a = h(e), n = h(t);
|
|
170
|
+
return n > S ? n : h(n / S * a);
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
const n =
|
|
172
|
+
function re(t, e, a) {
|
|
173
|
+
const n = h(t.w), s = e && a && n <= h(a.w) && n <= S ? ie(t.w, e.w) : n;
|
|
174
174
|
return {
|
|
175
175
|
i: t.i,
|
|
176
|
-
x:
|
|
177
|
-
y:
|
|
176
|
+
x: V(f(t.x), 0, Math.max(0, w - s)),
|
|
177
|
+
y: f(t.y),
|
|
178
178
|
w: s,
|
|
179
|
-
h:
|
|
179
|
+
h: h(t.h),
|
|
180
180
|
static: t.static
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Q(t, e, a) {
|
|
184
184
|
const n = e > 0 ? e : a;
|
|
185
|
-
return
|
|
185
|
+
return T(t / n * a);
|
|
186
186
|
}
|
|
187
187
|
function B(t, e, a) {
|
|
188
188
|
a !== void 0 && (t[e] = a);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function C(t, e) {
|
|
191
191
|
const a = t.y - e.y;
|
|
192
192
|
if (a !== 0) return a;
|
|
193
193
|
const n = t.x - e.x;
|
|
194
194
|
return n !== 0 ? n : t.i.localeCompare(e.i);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function se(t) {
|
|
197
197
|
const e = /* @__PURE__ */ new Map();
|
|
198
198
|
t.forEach((n) => {
|
|
199
199
|
e.set(n.y, [...e.get(n.y) || [], n]);
|
|
@@ -201,89 +201,89 @@ function re(t) {
|
|
|
201
201
|
const a = /* @__PURE__ */ new Map();
|
|
202
202
|
return e.forEach((n) => {
|
|
203
203
|
var d;
|
|
204
|
-
const i = n.slice().sort(
|
|
205
|
-
!s || (d = s.children) != null && d.length || Math.max(...i.map((r) => r.x + r.w)) !==
|
|
204
|
+
const i = n.slice().sort(C), s = i[i.length - 1];
|
|
205
|
+
!s || (d = s.children) != null && d.length || Math.max(...i.map((r) => r.x + r.w)) !== w - 1 || a.set(s.i, {
|
|
206
206
|
...s,
|
|
207
|
-
w:
|
|
207
|
+
w: w - s.x
|
|
208
208
|
});
|
|
209
209
|
}), t.map((n) => a.get(n.i) || n);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function ut(t, e) {
|
|
212
212
|
return t.x < e.x + e.w && t.x + t.w > e.x;
|
|
213
213
|
}
|
|
214
214
|
function _t(t, e) {
|
|
215
215
|
return Math.max(0, Math.min(t.x + t.w, e.x + e.w) - Math.max(t.x, e.x));
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
if (!
|
|
217
|
+
function Y(t, e) {
|
|
218
|
+
if (!ut(t, e)) return !1;
|
|
219
219
|
const a = _t(t, e);
|
|
220
220
|
return a <= 0 ? !1 : a / Math.max(1, Math.min(t.w, e.w)) >= 0.25;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
return
|
|
222
|
+
function xt(t, e) {
|
|
223
|
+
return Y(t, e) && t.y < e.y + e.h;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
if (_t(t, e) <= 0 ||
|
|
225
|
+
function oe(t, e) {
|
|
226
|
+
if (_t(t, e) <= 0 || Y(t, e) || !(t.y < e.y + e.h && e.y < t.y + t.h) || t.x <= e.x || t.x >= e.x + e.w) return null;
|
|
227
227
|
const i = Math.max(1, t.x - e.x);
|
|
228
228
|
return i < e.w ? { ...e, w: i } : null;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function J(t) {
|
|
231
231
|
const e = [];
|
|
232
|
-
return t.slice().sort(
|
|
232
|
+
return t.slice().sort(C).forEach((a) => {
|
|
233
233
|
const n = e.find((i) => {
|
|
234
234
|
const s = Math.min(...i.map((r) => r.y)), c = Math.max(...i.map((r) => r.y + r.h)), d = Math.max(0, Math.min(a.y + a.h, c) - Math.max(a.y, s));
|
|
235
235
|
return Math.abs(a.y - s) <= 1 || d / Math.max(1, Math.min(a.h, c - s)) >= 0.7;
|
|
236
236
|
});
|
|
237
|
-
n ? (n.push(a), n.sort(
|
|
237
|
+
n ? (n.push(a), n.sort(C)) : e.push([a]);
|
|
238
238
|
}), e;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
if (t.length < 3 || t.some((
|
|
242
|
-
var
|
|
243
|
-
return (
|
|
240
|
+
function ce(t) {
|
|
241
|
+
if (t.length < 3 || t.some((p) => {
|
|
242
|
+
var y;
|
|
243
|
+
return (y = p.children) == null ? void 0 : y.length;
|
|
244
244
|
})) return t;
|
|
245
|
-
const e = t.slice().sort(
|
|
245
|
+
const e = t.slice().sort(C), a = e[0], n = e[e.length - 1];
|
|
246
246
|
if (!a || !n) return t;
|
|
247
|
-
const i = n.x + n.w - a.x, s = e.reduce((
|
|
247
|
+
const i = n.x + n.w - a.x, s = e.reduce((p, y) => p + y.w, 0), c = e.slice(1).map((p, y) => p.x - (e[y].x + e[y].w));
|
|
248
248
|
if (c.length < 2) return t;
|
|
249
249
|
const d = Math.max(...c), r = Math.min(...c);
|
|
250
250
|
if (d - r <= 0) return t;
|
|
251
251
|
const o = i - s;
|
|
252
252
|
if (o < 0) return t;
|
|
253
|
-
const
|
|
254
|
-
let
|
|
255
|
-
return e.map((
|
|
256
|
-
const
|
|
257
|
-
return
|
|
253
|
+
const l = Math.max(0, Math.round(o / Math.max(1, e.length - 1)));
|
|
254
|
+
let m = a.x;
|
|
255
|
+
return e.map((p, y) => {
|
|
256
|
+
const I = V(m, 0, Math.max(0, w - p.w));
|
|
257
|
+
return m = I + p.w + l, y === e.length - 1 && I + p.w > w ? p : { ...p, x: I };
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function de(t) {
|
|
261
261
|
const e = /* @__PURE__ */ new Map();
|
|
262
|
-
return
|
|
263
|
-
|
|
262
|
+
return J(t).forEach((a) => {
|
|
263
|
+
ce(a).forEach((n) => e.set(n.i, n));
|
|
264
264
|
}), t.map((a) => e.get(a.i) || a);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
const a = Math.max(1, e.maxGapRows ?? 4), n = Math.max(0, e.targetGapRows ?? 0), i = t.filter((
|
|
266
|
+
function va(t, e) {
|
|
267
|
+
const a = Math.max(1, e.maxGapRows ?? 4), n = Math.max(0, e.targetGapRows ?? 0), i = t.filter((x) => !x.parentId).slice().sort(C), s = i.find(e.isHeader);
|
|
268
268
|
if (!s) return t;
|
|
269
|
-
const c =
|
|
270
|
-
const
|
|
271
|
-
return
|
|
269
|
+
const c = f(s.y), d = c + h(s.h), o = J(i).map((x) => x.slice().sort(C)).filter((x) => Math.min(...x.map((g) => f(g.y))) > c && x.some(e.isSuccessorStrip)).sort((x, F) => {
|
|
270
|
+
const g = Math.min(...x.map((N) => f(N.y))), W = Math.min(...F.map((N) => f(N.y)));
|
|
271
|
+
return g - W;
|
|
272
272
|
})[0];
|
|
273
273
|
if (!o || o.length < 2) return t;
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
const
|
|
279
|
-
i.filter((
|
|
274
|
+
const l = Math.min(...o.map((x) => f(x.y)));
|
|
275
|
+
if (l - d <= a) return t;
|
|
276
|
+
const p = d + n, y = l - p;
|
|
277
|
+
if (y <= 0) return t;
|
|
278
|
+
const I = new Set(
|
|
279
|
+
i.filter((x) => f(x.y) >= l).map((x) => String(x.i))
|
|
280
280
|
);
|
|
281
|
-
return t.map((
|
|
281
|
+
return t.map((x) => I.has(String(x.i)) ? { ...x, y: Math.max(0, f(x.y) - y) } : x);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ue(t, e) {
|
|
284
284
|
if (t.length < 3) return;
|
|
285
|
-
const a = t.slice().sort(
|
|
286
|
-
if (!n || Math.abs(e.x - n.x) >
|
|
285
|
+
const a = t.slice().sort(C), n = a[0];
|
|
286
|
+
if (!n || Math.abs(e.x - n.x) > dt) return;
|
|
287
287
|
const i = e.x + e.w;
|
|
288
288
|
let s = n.x + n.w, c = 1;
|
|
289
289
|
for (let d = 1; d < a.length; d += 1) {
|
|
@@ -294,56 +294,56 @@ function de(t, e) {
|
|
|
294
294
|
if (!(c < 2 || c >= a.length))
|
|
295
295
|
return s;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function me(t) {
|
|
298
298
|
var a, n;
|
|
299
299
|
const e = [];
|
|
300
300
|
for (let i = 1; i < t.length; i += 1) {
|
|
301
|
-
const s = (t[i - 1] || []).slice().sort(
|
|
301
|
+
const s = (t[i - 1] || []).slice().sort(C), c = (t[i] || []).slice().sort(C);
|
|
302
302
|
if (s.length < 3 || c.length !== 2) continue;
|
|
303
303
|
const d = c[0], r = c[1];
|
|
304
304
|
if (!d || !r || (a = d.children) != null && a.length || (n = r.children) != null && n.length || d.w < r.w * 1.35) continue;
|
|
305
|
-
const o =
|
|
305
|
+
const o = ue(s, d);
|
|
306
306
|
if (o === void 0) continue;
|
|
307
|
-
const
|
|
308
|
-
!Number.isFinite(
|
|
307
|
+
const m = Math.min(o, r.x - dt) - d.x;
|
|
308
|
+
!Number.isFinite(m) || m <= d.w || e.push({
|
|
309
309
|
...d,
|
|
310
|
-
w:
|
|
310
|
+
w: V(m, 1, w - d.x)
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
313
|
return e;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
const e =
|
|
315
|
+
function le(t) {
|
|
316
|
+
const e = J(t), a = new Map(me(e).map((n) => [n.i, n]));
|
|
317
317
|
return a.size === 0 ? t : t.map((n) => a.get(n.i) || n);
|
|
318
318
|
}
|
|
319
319
|
function k(t) {
|
|
320
320
|
return /(?:recognized|image-fallback)-\d+/.test(t.i);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function pe(t) {
|
|
323
323
|
return new Set(t.filter((e) => {
|
|
324
324
|
var a, n, i, s;
|
|
325
325
|
return k({ i: e.id }) && (((a = e.meta) == null ? void 0 : a.imageLayoutManualOverride) === !0 && ((n = e.meta) == null ? void 0 : n.imageLayoutManualOverrideSource) === "gridstack" || ((i = e.meta) == null ? void 0 : i.manualCanvasLayout) === !0 && ((s = e.meta) == null ? void 0 : s.layoutManualOverrideSource) === "gridstack");
|
|
326
326
|
}).map((e) => e.id));
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Z(t) {
|
|
329
329
|
const e = t.i.match(/(?:recognized|image-fallback)-(\d+)/), a = e ? Number(e[1]) : Number.POSITIVE_INFINITY;
|
|
330
330
|
return Number.isFinite(a) ? a : Number.POSITIVE_INFINITY;
|
|
331
331
|
}
|
|
332
|
-
function pe(t, e) {
|
|
333
|
-
const a = Q(t) - Q(e);
|
|
334
|
-
return a !== 0 ? a : E(t, e);
|
|
335
|
-
}
|
|
336
332
|
function he(t, e) {
|
|
337
|
-
const a =
|
|
338
|
-
return
|
|
333
|
+
const a = Z(t) - Z(e);
|
|
334
|
+
return a !== 0 ? a : C(t, e);
|
|
339
335
|
}
|
|
340
336
|
function fe(t, e) {
|
|
341
|
-
const a =
|
|
337
|
+
const a = Z(t);
|
|
338
|
+
return e.some((n) => Z(n) > a && Y(t, n) && n.y < t.y);
|
|
339
|
+
}
|
|
340
|
+
function ye(t, e) {
|
|
341
|
+
const a = e.filter((n) => Y(t, n)).map((n) => n.y + n.h);
|
|
342
342
|
if (a.length !== 0)
|
|
343
343
|
return Math.max(...a);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const a = t.filter((d) => !d.parentId && k(d) && !e.has(String(d.i))).sort(
|
|
345
|
+
function mt(t, e = /* @__PURE__ */ new Set()) {
|
|
346
|
+
const a = t.filter((d) => !d.parentId && k(d) && !e.has(String(d.i))).sort(he);
|
|
347
347
|
if (a.length < 2) return t;
|
|
348
348
|
const n = /* @__PURE__ */ new Map(), i = Math.min(...a.map((d) => d.y));
|
|
349
349
|
a.forEach((d) => {
|
|
@@ -351,180 +351,180 @@ function ut(t, e = /* @__PURE__ */ new Set()) {
|
|
|
351
351
|
...d,
|
|
352
352
|
y: n.size === 0 ? i : d.y
|
|
353
353
|
}, o = [...n.values()];
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
|
|
354
|
+
if (fe(r, a)) {
|
|
355
|
+
const l = ye(r, o);
|
|
356
|
+
l !== void 0 && r.y > l && (r.y = l);
|
|
357
357
|
}
|
|
358
|
-
for (; o.some((
|
|
359
|
-
const
|
|
360
|
-
...o.filter((
|
|
358
|
+
for (; o.some((l) => xt(r, l)); ) {
|
|
359
|
+
const l = Math.max(
|
|
360
|
+
...o.filter((m) => xt(r, m)).map((m) => m.y + m.h)
|
|
361
361
|
);
|
|
362
|
-
r.y =
|
|
362
|
+
r.y = l;
|
|
363
363
|
}
|
|
364
|
-
o.forEach((
|
|
365
|
-
const
|
|
366
|
-
|
|
364
|
+
o.forEach((l) => {
|
|
365
|
+
const m = oe(r, l);
|
|
366
|
+
m && n.set(m.i, m);
|
|
367
367
|
}), n.set(d.i, r);
|
|
368
368
|
});
|
|
369
|
-
const s =
|
|
370
|
-
|
|
369
|
+
const s = le(
|
|
370
|
+
de([...n.values()])
|
|
371
371
|
), c = new Map(s.map((d) => [d.i, d]));
|
|
372
372
|
return [...c.entries()].some(([d, r]) => {
|
|
373
|
-
const o = a.find((
|
|
373
|
+
const o = a.find((l) => l.i === d);
|
|
374
374
|
return r.y !== (o == null ? void 0 : o.y) || r.x !== (o == null ? void 0 : o.x) || r.w !== (o == null ? void 0 : o.w);
|
|
375
375
|
}) ? t.map((d) => c.get(d.i) || d) : t;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ge(t, e) {
|
|
378
378
|
if (!e || t.parentId || e.parentId || !k(t)) return !1;
|
|
379
|
-
const a =
|
|
380
|
-
return (
|
|
379
|
+
const a = f(t.x), n = f(e.x), i = f(t.y), s = f(e.y), c = h(t.w), d = h(e.w), r = h(t.h), o = h(e.h), l = n >= w * 0.15 && n + d >= w * 0.85, m = n >= w * 0.15 && d >= w * 0.45, p = a < Math.max(0, n - 4), y = c < Math.max(d * 0.7, d - 12), I = c > Math.max(d * 1.25, d + 12), x = a < Math.max(0, n - 4) && Math.abs(a + c - (n + d)) <= Math.max(6, d * 0.25), F = Math.abs(i - s) <= Math.max(2, Math.round(o * 0.15)), g = Math.max(0, Math.min(i + r, s + o) - Math.max(i, s)), W = F || g / Math.max(1, Math.min(r, o)) >= 0.65 || i > s && i < s + o, N = Array.isArray(t.children) && t.children.length > 0 && o > r && o >= Math.max(r + 4, r * 1.8);
|
|
380
|
+
return (l || m) && W && p && (y || x || I) || N;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
const a =
|
|
382
|
+
function xe(t, e) {
|
|
383
|
+
const a = f(t.y), n = f(e.y), i = h(t.h), s = h(e.h), c = Math.max(0, Math.min(a + i, n + s) - Math.max(a, n));
|
|
384
384
|
return Math.abs(a - n) <= Math.max(2, Math.round(Math.min(i, s) * 0.25)) || c / Math.max(1, Math.min(i, s)) >= 0.7;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
if (!
|
|
388
|
-
const a =
|
|
386
|
+
function Ie(t, e) {
|
|
387
|
+
if (!Y(t, e)) return !1;
|
|
388
|
+
const a = f(t.y) <= f(e.y) ? t : e, n = a === t ? e : t, i = f(a.y) + h(a.h), s = f(n.y), c = Math.max(2, Math.min(h(a.h), h(n.h)));
|
|
389
389
|
return s >= i - 1 && s <= i + c;
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function ve(t, e) {
|
|
392
392
|
if (t.length < 2) return !1;
|
|
393
|
-
const a = t.slice().sort(
|
|
394
|
-
if (Math.max(...a.map((s) =>
|
|
393
|
+
const a = t.slice().sort(C), n = Math.min(...a.map((s) => f(s.x)));
|
|
394
|
+
if (Math.max(...a.map((s) => f(s.x) + h(s.w))) - n < w * 0.75) return !1;
|
|
395
395
|
for (let s = 0; s < a.length; s += 1)
|
|
396
396
|
for (let c = s + 1; c < a.length; c += 1) {
|
|
397
397
|
const d = a[s], r = a[c];
|
|
398
|
-
if (!d || !r || !
|
|
399
|
-
const o = e.get(String(d.i)),
|
|
400
|
-
if (!(!o || !
|
|
398
|
+
if (!d || !r || !xe(d, r) || ut(d, r)) continue;
|
|
399
|
+
const o = e.get(String(d.i)), l = e.get(String(r.i));
|
|
400
|
+
if (!(!o || !l) && Ie(o, l))
|
|
401
401
|
return !0;
|
|
402
402
|
}
|
|
403
403
|
return !1;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
const a =
|
|
405
|
+
function Ae(t, e) {
|
|
406
|
+
const a = h(t.h), n = h(e.h), i = Array.isArray(t.children) ? t.children : [];
|
|
407
407
|
if (i.length === 0) return Math.max(a, n);
|
|
408
|
-
const s = i.reduce((r, o) => Math.max(r,
|
|
408
|
+
const s = i.reduce((r, o) => Math.max(r, f(o.y) + h(o.h)), 0), c = Math.max(10, s + 6), d = a <= 8 && i.length <= 2 ? 18 : Number.POSITIVE_INFINITY;
|
|
409
409
|
return Math.min(
|
|
410
410
|
Math.max(a, n, c),
|
|
411
411
|
d
|
|
412
412
|
);
|
|
413
413
|
}
|
|
414
414
|
function Me(t) {
|
|
415
|
-
return k(t) && !t.parentId &&
|
|
415
|
+
return k(t) && !t.parentId && f(t.x) <= dt && h(t.w) >= w * 0.45 && h(t.h) >= 36 && f(t.y) > 20 && f(t.x) + h(t.w) < w * 0.85;
|
|
416
416
|
}
|
|
417
417
|
function Se(t, e) {
|
|
418
|
-
const a =
|
|
418
|
+
const a = f(t.x), n = f(t.y), i = h(t.w), s = h(t.h);
|
|
419
419
|
return e.some((c) => {
|
|
420
420
|
if (String(c.i) === String(t.i) || c.parentId || !k(c)) return !1;
|
|
421
|
-
const d =
|
|
422
|
-
return !(d >= a + Math.min(i,
|
|
421
|
+
const d = f(c.x), r = f(c.y), o = h(c.h);
|
|
422
|
+
return !(d >= a + Math.min(i, w * 0.45) - 1) || o < s * 0.55 ? !1 : Math.max(0, Math.min(n + s, r + o) - Math.max(n, r)) / Math.max(1, Math.min(s, o)) >= 0.35;
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
const e =
|
|
425
|
+
function We(t) {
|
|
426
|
+
const e = J(t.filter((n) => !n.parentId && k(n))), a = /* @__PURE__ */ new Set();
|
|
427
427
|
return e.forEach((n) => {
|
|
428
|
-
const i = n.slice().sort(
|
|
428
|
+
const i = n.slice().sort(C);
|
|
429
429
|
i.filter(Me).forEach((c) => {
|
|
430
|
-
const d =
|
|
431
|
-
i.filter((
|
|
430
|
+
const d = h(c.h);
|
|
431
|
+
i.filter((l) => String(l.i) !== String(c.i)).some((l) => h(l.h) >= d * 0.55) || Se(c, t) || a.add(String(c.i));
|
|
432
432
|
});
|
|
433
433
|
}), a.size === 0 ? t : t.map((n) => {
|
|
434
434
|
if (!a.has(String(n.i))) return n;
|
|
435
|
-
const i =
|
|
435
|
+
const i = f(n.x), s = Math.max(h(n.w), w - i);
|
|
436
436
|
return {
|
|
437
437
|
...n,
|
|
438
438
|
x: i,
|
|
439
439
|
w: s,
|
|
440
|
-
minW: Math.min(s,
|
|
441
|
-
maxW: Math.max(s,
|
|
440
|
+
minW: Math.min(s, h(n.minW ?? s)),
|
|
441
|
+
maxW: Math.max(s, h(n.maxW ?? s))
|
|
442
442
|
};
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
if ((e == null ? void 0 : e.version) !==
|
|
445
|
+
function Aa(t, e) {
|
|
446
|
+
if ((e == null ? void 0 : e.version) !== X) return t;
|
|
447
447
|
const a = new Map(e.nodes.filter((r) => !r.parentId).map((r) => [String(r.i), r])), n = new Map(t.nodes.filter((r) => !r.parentId && k(r)).map((r) => [String(r.i), r])), i = /* @__PURE__ */ new Set();
|
|
448
448
|
if (t.nodes.forEach((r) => {
|
|
449
|
-
|
|
450
|
-
}),
|
|
451
|
-
|
|
449
|
+
ge(r, a.get(String(r.i))) && i.add(String(r.i));
|
|
450
|
+
}), J([...a.values()].filter((r) => k(r))).forEach((r) => {
|
|
451
|
+
ve(r, n) && r.forEach((o) => i.add(String(o.i)));
|
|
452
452
|
}), i.size === 0) return t;
|
|
453
453
|
const s = new Set(i);
|
|
454
454
|
t.nodes.filter((r) => !r.parentId && k(r)).forEach((r) => {
|
|
455
455
|
if (s.has(String(r.i))) return;
|
|
456
456
|
const o = a.get(String(r.i));
|
|
457
457
|
if (!o) return;
|
|
458
|
-
[...i].some((
|
|
459
|
-
const
|
|
460
|
-
if (!
|
|
461
|
-
const
|
|
458
|
+
[...i].some((m) => {
|
|
459
|
+
const p = a.get(m);
|
|
460
|
+
if (!p) return !1;
|
|
461
|
+
const y = Math.abs(f(o.y) - f(p.y)) <= Math.max(
|
|
462
462
|
1,
|
|
463
|
-
Math.round(Math.min(
|
|
464
|
-
),
|
|
465
|
-
return
|
|
463
|
+
Math.round(Math.min(h(o.h), h(p.h)) * 0.2)
|
|
464
|
+
), I = !ut(o, p);
|
|
465
|
+
return y && I && Y(r, p);
|
|
466
466
|
}) && s.add(String(r.i));
|
|
467
467
|
});
|
|
468
468
|
const c = t.nodes.map((r) => {
|
|
469
469
|
const o = a.get(String(r.i));
|
|
470
470
|
if (!s.has(String(r.i)) || !o) return r;
|
|
471
|
-
const
|
|
471
|
+
const l = Ae(r, o), m = {
|
|
472
472
|
...r,
|
|
473
473
|
x: o.x,
|
|
474
474
|
y: o.y,
|
|
475
475
|
w: o.w,
|
|
476
|
-
h:
|
|
477
|
-
},
|
|
478
|
-
return
|
|
479
|
-
Math.max(1,
|
|
480
|
-
|
|
481
|
-
),
|
|
482
|
-
}), d =
|
|
483
|
-
return
|
|
476
|
+
h: l
|
|
477
|
+
}, p = o.minW ?? r.minW, y = o.maxW ?? r.maxW, I = o.maxH ?? r.maxH;
|
|
478
|
+
return p !== void 0 && (m.minW = p), m.minH = Math.min(
|
|
479
|
+
Math.max(1, h(o.minH ?? o.h), Array.isArray(r.children) ? l : 1),
|
|
480
|
+
l
|
|
481
|
+
), y !== void 0 && (m.maxW = y), I !== void 0 && (m.maxH = I), m;
|
|
482
|
+
}), d = We(c);
|
|
483
|
+
return lt({
|
|
484
484
|
...t,
|
|
485
|
-
nodes:
|
|
485
|
+
nodes: mt(d).sort(C)
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
const i =
|
|
490
|
-
|
|
488
|
+
function tt(t, e, a = w, n) {
|
|
489
|
+
const i = Q(t.x, e, a), s = Q(t.x + t.w, e, a), c = V(
|
|
490
|
+
gt(i),
|
|
491
491
|
0,
|
|
492
492
|
Math.max(0, a - 1)
|
|
493
|
-
), r =
|
|
493
|
+
), r = V(gt(s), c + 1, a) - c, o = {
|
|
494
494
|
i: t.i,
|
|
495
495
|
x: c,
|
|
496
|
-
y:
|
|
496
|
+
y: f(t.y),
|
|
497
497
|
w: r,
|
|
498
|
-
h:
|
|
498
|
+
h: h(t.h)
|
|
499
499
|
};
|
|
500
|
-
return B(o, "minW", t.minW === void 0 ? void 0 :
|
|
500
|
+
return B(o, "minW", t.minW === void 0 ? void 0 : V(h(Q(t.minW, e, a)), 1, a)), B(o, "maxW", t.maxW === void 0 ? void 0 : V(h(Q(t.maxW, e, a)), 1, a)), B(o, "minH", t.minH === void 0 ? void 0 : h(t.minH)), B(o, "maxH", t.maxH === void 0 ? void 0 : h(t.maxH)), B(o, "static", t.static), n && (o.parentId = n), o;
|
|
501
501
|
}
|
|
502
502
|
function Ma(t, e) {
|
|
503
|
-
const a = e.cols || e.maxCols ||
|
|
504
|
-
const s =
|
|
503
|
+
const a = e.cols || e.maxCols || w, n = se(t.map((i) => {
|
|
504
|
+
const s = tt({ ...i.layout, i: i.id }, a, w), c = Dt(i);
|
|
505
505
|
return c.length > 0 ? { ...s, children: c } : s;
|
|
506
|
-
}).sort(
|
|
506
|
+
}).sort(C));
|
|
507
507
|
return {
|
|
508
|
-
version:
|
|
509
|
-
cols:
|
|
510
|
-
rowHeight:
|
|
511
|
-
gap:
|
|
512
|
-
nodes:
|
|
508
|
+
version: X,
|
|
509
|
+
cols: w,
|
|
510
|
+
rowHeight: Lt,
|
|
511
|
+
gap: Ot,
|
|
512
|
+
nodes: mt(n, pe(t)).sort(C)
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function It(t, e, a) {
|
|
516
516
|
if (!Number.isFinite(t.x) || !Number.isFinite(t.y) || !Number.isFinite(t.w) || !Number.isFinite(t.h) || t.w < 1 || t.h < 1) return !0;
|
|
517
517
|
if (!e) return t.h > a || t.y > a;
|
|
518
518
|
const n = Math.max(1, e.h), i = Math.max(0, e.y), s = Math.max(a, n * 4 + 20);
|
|
519
519
|
return t.h > Math.max(a, n * 4 + 20) || Math.abs(t.y - i) > s;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function we(t, e) {
|
|
522
522
|
if (!e || !/(?:recognized|image-fallback)-\d+/.test(t.i)) return !1;
|
|
523
523
|
const a = Math.abs(t.y - e.y), n = Math.max(t.h, e.h) / Math.max(1, Math.min(t.h, e.h)), i = Math.max(t.w, e.w) / Math.max(1, Math.min(t.w, e.w));
|
|
524
524
|
return a > Math.max(6, e.h * 0.5) || n > 1.65 || i > 1.45;
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
const c =
|
|
526
|
+
function nt(t, e, a, n, i, s) {
|
|
527
|
+
const c = tt({
|
|
528
528
|
i: t.i,
|
|
529
529
|
x: t.x,
|
|
530
530
|
y: t.y,
|
|
@@ -535,7 +535,7 @@ function at(t, e, a, n, i, s) {
|
|
|
535
535
|
maxW: t.maxW,
|
|
536
536
|
maxH: t.maxH,
|
|
537
537
|
static: t.static
|
|
538
|
-
}, e, a, t.parentId), d = n ?
|
|
538
|
+
}, e, a, t.parentId), d = n ? tt({
|
|
539
539
|
i: n.i,
|
|
540
540
|
x: n.x,
|
|
541
541
|
y: n.y,
|
|
@@ -546,7 +546,7 @@ function at(t, e, a, n, i, s) {
|
|
|
546
546
|
maxW: n.maxW,
|
|
547
547
|
maxH: n.maxH,
|
|
548
548
|
static: n.static
|
|
549
|
-
}, a, a, n.parentId) : void 0, r = d &&
|
|
549
|
+
}, a, a, n.parentId) : void 0, r = d && It(d, void 0, i) ? { ...d, h: Math.min(d.h, i) } : d, o = It(c, r, i) || s && we(c, r) ? r || { ...c, h: Math.min(c.h, i) } : c;
|
|
550
550
|
return {
|
|
551
551
|
...t,
|
|
552
552
|
...o,
|
|
@@ -555,54 +555,54 @@ function at(t, e, a, n, i, s) {
|
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
557
|
function Sa(t, e = {}) {
|
|
558
|
-
var
|
|
559
|
-
const a = t.cols ||
|
|
560
|
-
(((
|
|
561
|
-
), r = t.nodes.map((
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
558
|
+
var F;
|
|
559
|
+
const a = t.cols || w, n = e.maxItemRows || te, i = e.repairStaleImageFallback !== !1, s = e.preserveManualImageNodeIds || /* @__PURE__ */ new Set(), c = e.preserveManualNestedImageParentIds || /* @__PURE__ */ new Set(), d = new Map(
|
|
560
|
+
(((F = e.fallbackTree) == null ? void 0 : F.nodes) || []).filter((g) => !g.parentId).map((g) => [g.i, g])
|
|
561
|
+
), r = t.nodes.map((g) => {
|
|
562
|
+
const W = !g.parentId, N = W ? w : S, b = W ? a : S, _ = W ? d.get(g.i) : void 0, P = nt(
|
|
563
|
+
g,
|
|
564
|
+
b,
|
|
565
|
+
N,
|
|
566
566
|
_,
|
|
567
567
|
n,
|
|
568
|
-
i && !s.has(String(
|
|
569
|
-
), D = new Map(((_ == null ? void 0 : _.children) || []).map((
|
|
570
|
-
{ ...
|
|
568
|
+
i && !s.has(String(g.i))
|
|
569
|
+
), D = new Map(((_ == null ? void 0 : _.children) || []).map((v) => [v.i, v])), G = Array.isArray(g.children) ? g.children.map((v) => nt(
|
|
570
|
+
{ ...v, parentId: v.parentId || g.i },
|
|
571
571
|
S,
|
|
572
572
|
S,
|
|
573
|
-
D.get(
|
|
573
|
+
D.get(v.i),
|
|
574
574
|
n,
|
|
575
|
-
i && !c.has(String(
|
|
576
|
-
)) :
|
|
575
|
+
i && !c.has(String(g.i))
|
|
576
|
+
)) : g.children;
|
|
577
577
|
return G === void 0 ? P : { ...P, children: G };
|
|
578
|
-
}), o = new Set(r.filter((
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
578
|
+
}), o = new Set(r.filter((g) => !g.parentId).map((g) => g.i)), l = e.missingNodeFallbackTree || e.fallbackTree, m = ((l == null ? void 0 : l.nodes) || []).filter((g) => !g.parentId && !o.has(g.i)).map((g) => nt(
|
|
579
|
+
g,
|
|
580
|
+
w,
|
|
581
|
+
w,
|
|
582
582
|
void 0,
|
|
583
583
|
n,
|
|
584
584
|
i
|
|
585
|
-
)),
|
|
586
|
-
...
|
|
587
|
-
if (!Array.isArray(
|
|
588
|
-
const
|
|
589
|
-
return
|
|
585
|
+
)), p = new Set(m.map((g) => g.i)), I = [
|
|
586
|
+
...p.size === 0 ? r : r.map((g) => {
|
|
587
|
+
if (!Array.isArray(g.children)) return g;
|
|
588
|
+
const W = g.children.filter((N) => !p.has(N.i));
|
|
589
|
+
return W.length === g.children.length ? g : { ...g, children: W };
|
|
590
590
|
}),
|
|
591
|
-
...
|
|
592
|
-
],
|
|
591
|
+
...m
|
|
592
|
+
], x = i ? mt(I, /* @__PURE__ */ new Set([
|
|
593
593
|
...s,
|
|
594
|
-
...[...c].filter((
|
|
595
|
-
])) :
|
|
596
|
-
return
|
|
594
|
+
...[...c].filter((g) => !s.has(g))
|
|
595
|
+
])) : I;
|
|
596
|
+
return lt({
|
|
597
597
|
...t,
|
|
598
|
-
version:
|
|
599
|
-
cols:
|
|
600
|
-
rowHeight:
|
|
601
|
-
gap:
|
|
602
|
-
nodes:
|
|
598
|
+
version: X,
|
|
599
|
+
cols: w,
|
|
600
|
+
rowHeight: Lt,
|
|
601
|
+
gap: Ot,
|
|
602
|
+
nodes: x.sort(C)
|
|
603
603
|
});
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Wa(t) {
|
|
606
606
|
const e = (a) => {
|
|
607
607
|
const n = {
|
|
608
608
|
...a,
|
|
@@ -618,7 +618,7 @@ function wa(t) {
|
|
|
618
618
|
}))
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function wa(t) {
|
|
622
622
|
const e = {
|
|
623
623
|
id: t.i,
|
|
624
624
|
x: t.x,
|
|
@@ -632,39 +632,39 @@ function Na(t) {
|
|
|
632
632
|
};
|
|
633
633
|
return t.static ? (e.noMove = !0, e.noResize = !0, e.locked = !0) : t.static === !1 && (e.noMove = !1, e.noResize = !1, e.locked = !1), e;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function Fe(t) {
|
|
636
636
|
return {
|
|
637
637
|
id: String(t.i),
|
|
638
|
-
x:
|
|
639
|
-
y:
|
|
640
|
-
w:
|
|
641
|
-
h:
|
|
638
|
+
x: f(t.x),
|
|
639
|
+
y: f(t.y),
|
|
640
|
+
w: h(t.w),
|
|
641
|
+
h: h(t.h)
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function Ne(t, e) {
|
|
645
645
|
return {
|
|
646
646
|
id: String(t.id || (e == null ? void 0 : e.i) || ""),
|
|
647
|
-
x:
|
|
648
|
-
y:
|
|
649
|
-
w:
|
|
650
|
-
h:
|
|
647
|
+
x: f(t.x ?? (e == null ? void 0 : e.x) ?? 0),
|
|
648
|
+
y: f(t.y ?? (e == null ? void 0 : e.y) ?? 0),
|
|
649
|
+
w: h(t.w ?? (e == null ? void 0 : e.w) ?? 1),
|
|
650
|
+
h: h(t.h ?? (e == null ? void 0 : e.h) ?? 1)
|
|
651
651
|
};
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Ce(t, e) {
|
|
654
654
|
return t.x < e.x + e.w && t.x + t.w > e.x && t.y < e.y + e.h && t.y + t.h > e.y;
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function be(t, e) {
|
|
657
657
|
return e.y > t.y && e.x === t.x && e.w === t.w && e.h === t.h;
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
return
|
|
659
|
+
function Ee(t, e, a) {
|
|
660
|
+
return be(t, e) ? a.some((n) => Ce(t, n) && e.y >= n.y + n.h - 1) : !1;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function Re(t, e, a) {
|
|
663
663
|
if (!a || a.size === 0) return /* @__PURE__ */ new Set();
|
|
664
664
|
const n = new Map(
|
|
665
665
|
t.filter((c) => typeof c.id == "string" && c.id.length > 0).map((c) => {
|
|
666
666
|
const d = String(c.id);
|
|
667
|
-
return [d,
|
|
667
|
+
return [d, Ne(c, e.get(d))];
|
|
668
668
|
})
|
|
669
669
|
), i = /* @__PURE__ */ new Map();
|
|
670
670
|
a.forEach((c) => {
|
|
@@ -677,40 +677,40 @@ function Le(t, e, a) {
|
|
|
677
677
|
if (i.has(d)) return;
|
|
678
678
|
const r = e.get(d);
|
|
679
679
|
if (!r) return;
|
|
680
|
-
const o =
|
|
681
|
-
|
|
680
|
+
const o = Fe(r);
|
|
681
|
+
Ee(o, c, [...i.values()]) && (i.set(d, c), s = !0);
|
|
682
682
|
});
|
|
683
683
|
return new Set([...i.keys()].filter((c) => !a.has(c)));
|
|
684
684
|
}
|
|
685
|
-
function
|
|
686
|
-
const n = new Map(e.nodes.map((d) => [String(d.i), d])), i = a.editedWidgetIds, s =
|
|
687
|
-
const r = d.id, o = n.get(r),
|
|
685
|
+
function Fa(t, e, a = {}) {
|
|
686
|
+
const n = new Map(e.nodes.map((d) => [String(d.i), d])), i = a.editedWidgetIds, s = Re(t, n, i), c = t.filter((d) => typeof d.id == "string" && d.id.length > 0).map((d) => {
|
|
687
|
+
const r = d.id, o = n.get(r), l = !i || i.has(r) || s.has(r) || !o, m = {
|
|
688
688
|
...o || { i: r, x: 0, y: 0, w: 1, h: 1 },
|
|
689
689
|
i: r,
|
|
690
|
-
x:
|
|
691
|
-
y:
|
|
692
|
-
w:
|
|
693
|
-
h:
|
|
690
|
+
x: T(l ? d.x ?? (o == null ? void 0 : o.x) ?? 0 : o.x),
|
|
691
|
+
y: T(l ? d.y ?? (o == null ? void 0 : o.y) ?? 0 : o.y),
|
|
692
|
+
w: T(l ? d.w ?? (o == null ? void 0 : o.w) ?? 1 : o.w),
|
|
693
|
+
h: T(l ? d.h ?? (o == null ? void 0 : o.h) ?? 1 : o.h)
|
|
694
694
|
};
|
|
695
|
-
return B(
|
|
695
|
+
return B(m, "minW", d.minW ?? (o == null ? void 0 : o.minW)), B(m, "maxW", d.maxW ?? (o == null ? void 0 : o.maxW)), B(m, "minH", d.minH ?? (o == null ? void 0 : o.minH)), B(m, "maxH", d.maxH ?? (o == null ? void 0 : o.maxH)), B(m, "static", o == null ? void 0 : o.static), m;
|
|
696
696
|
});
|
|
697
|
-
return
|
|
697
|
+
return lt({
|
|
698
698
|
...e,
|
|
699
|
-
version:
|
|
700
|
-
cols:
|
|
701
|
-
nodes: c.sort(
|
|
699
|
+
version: X,
|
|
700
|
+
cols: w,
|
|
701
|
+
nodes: c.sort(C)
|
|
702
702
|
});
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function Na(t) {
|
|
705
705
|
return {
|
|
706
706
|
...t,
|
|
707
|
-
cols:
|
|
708
|
-
maxCols:
|
|
707
|
+
cols: w,
|
|
708
|
+
maxCols: w,
|
|
709
709
|
isSquareCell: !1,
|
|
710
|
-
layoutVersion:
|
|
710
|
+
layoutVersion: X
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function Ca(t, e) {
|
|
714
714
|
return {
|
|
715
715
|
...t || {},
|
|
716
716
|
layoutTree: e
|
|
@@ -719,11 +719,11 @@ function Ea(t, e) {
|
|
|
719
719
|
function M(t) {
|
|
720
720
|
return t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function Le(t) {
|
|
723
723
|
const e = M(t.data), a = M(t.meta), n = M(t.source);
|
|
724
|
-
return a.capabilityId ===
|
|
724
|
+
return a.capabilityId === ft || e.containerRole === Zt || n.resourceKey === ft;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function lt(t) {
|
|
727
727
|
const e = /* @__PURE__ */ new Set();
|
|
728
728
|
if (t.nodes.forEach((n) => {
|
|
729
729
|
n.parentId && e.add(String(n.i)), (n.children || []).forEach((i) => {
|
|
@@ -733,7 +733,7 @@ function mt(t) {
|
|
|
733
733
|
const a = t.nodes.filter((n) => n.parentId || !e.has(String(n.i)));
|
|
734
734
|
return a.length === t.nodes.length ? t : { ...t, nodes: a };
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function O(t) {
|
|
737
737
|
return M(t).shape === "customCanvas";
|
|
738
738
|
}
|
|
739
739
|
function Bt(t) {
|
|
@@ -741,97 +741,97 @@ function Bt(t) {
|
|
|
741
741
|
const e = M(t.data), a = M(t.renderer), n = typeof t.title == "string" ? t.title.trim() : "", i = !t.data && !t.dataShape && !t.visualKind && !a.rendererKey, s = !n || n === t.id || /(?:recognized|image-fallback)-\d+/.test(n);
|
|
742
742
|
return i || s || Object.keys(e).length === 0 && !t.capabilityId;
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function vt(t) {
|
|
745
745
|
var a;
|
|
746
746
|
if (!t) return -1;
|
|
747
747
|
let e = 0;
|
|
748
748
|
return t.title && t.title !== t.id && !/(?:recognized|image-fallback)-\d+/.test(t.title) && (e += 3), t.data && (e += 4), t.dataShape && (e += 2), t.visualKind && (e += 2), (a = t.renderer) != null && a.rendererKey && (e += 2), t.capabilityId && (e += 2), (t.dataBinding || t.dataBindingId) && (e += 2), t.dataBindingStatus && t.dataBindingStatus !== "ready" && (e += 1), t.humanIntervention && (e += 1), Bt(t) && (e -= 4), e;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
return [t, e, a].filter((i) => !!i).sort((i, s) =>
|
|
750
|
+
function Oe(t, e, a) {
|
|
751
|
+
return [t, e, a].filter((i) => !!i).sort((i, s) => vt(s) - vt(i))[0] || a;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function He(t) {
|
|
754
754
|
return {
|
|
755
|
-
columns: ["
|
|
755
|
+
columns: [u("FWA.53ad1787571628618"), u("FWA.bce71787571626973")],
|
|
756
756
|
rows: t.map((e, a) => ({
|
|
757
757
|
id: `fallback-row-${a + 1}`,
|
|
758
758
|
cells: [
|
|
759
|
-
typeof e.label == "string" && e.label.trim() ? e.label.trim() :
|
|
760
|
-
typeof e.value == "string" && e.value.trim() ? e.value.trim() : "
|
|
759
|
+
typeof e.label == "string" && e.label.trim() ? e.label.trim() : u("FWA.b8e61787570918490", { p0: a + 1 }),
|
|
760
|
+
typeof e.value == "string" && e.value.trim() ? e.value.trim() : u("FWA.681d1787571548904")
|
|
761
761
|
]
|
|
762
762
|
}))
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Te(t, e) {
|
|
766
766
|
var n;
|
|
767
767
|
const a = `${t.id} ${t.title || ""} ${e.title || ""} ${((n = e.meta) == null ? void 0 : n.capabilityId) || ""}`;
|
|
768
768
|
return /image-fallback-16|asset|资产台账|资产 & 成本|资产&成本/i.test(a) ? {
|
|
769
|
-
title: "
|
|
769
|
+
title: u("FWA.2a2a1787570955592"),
|
|
770
770
|
visualKind: "todoGrid",
|
|
771
771
|
dataShape: "rows",
|
|
772
772
|
rendererKey: "metricTiles",
|
|
773
773
|
capabilityId: "card.metric.combo",
|
|
774
774
|
items: [
|
|
775
|
-
{ label: "
|
|
776
|
-
{ label: "
|
|
777
|
-
{ label: "
|
|
778
|
-
{ label: "
|
|
775
|
+
{ label: u("FWA.78241787571088778"), value: u("FWA.681d1787571548904"), tone: "warning" },
|
|
776
|
+
{ label: u("FWA.34591787571035365"), value: u("FWA.681d1787571548904"), tone: "warning" },
|
|
777
|
+
{ label: u("FWA.b1891787570879762"), value: u("FWA.681d1787571548904"), tone: "warning" },
|
|
778
|
+
{ label: u("FWA.22281787571036340"), value: u("FWA.681d1787571548904"), tone: "warning" }
|
|
779
779
|
]
|
|
780
780
|
} : /image-fallback-18|成本分析|费用分析|donut/i.test(a) ? {
|
|
781
|
-
title: "
|
|
781
|
+
title: u("FWA.55a41787571088690"),
|
|
782
782
|
visualKind: "donut",
|
|
783
783
|
dataShape: "rows",
|
|
784
784
|
rendererKey: "donut",
|
|
785
785
|
capabilityId: "card.chart.donut",
|
|
786
786
|
items: [
|
|
787
|
-
{ label: "
|
|
788
|
-
{ label: "
|
|
789
|
-
{ label: "
|
|
790
|
-
{ label: "
|
|
787
|
+
{ label: u("FWA.8b221787571282306"), value: u("FWA.681d1787571548904"), share: 42, tone: "info" },
|
|
788
|
+
{ label: u("FWA.84f11787571487274"), value: u("FWA.681d1787571548904"), share: 25, tone: "violet" },
|
|
789
|
+
{ label: u("FWA.2c2c1787571487772"), value: u("FWA.681d1787571548904"), share: 17, tone: "warning" },
|
|
790
|
+
{ label: u("FWA.17521787571282866"), value: u("FWA.681d1787571548904"), share: 16, tone: "neutral" }
|
|
791
791
|
]
|
|
792
792
|
} : /image-fallback-19|image-fallback-21|成本优化|预算执行|cost/i.test(a) ? {
|
|
793
|
-
title: "
|
|
793
|
+
title: u("FWA.a1571787571337994"),
|
|
794
794
|
visualKind: "simpleList",
|
|
795
795
|
dataShape: "rows",
|
|
796
796
|
rendererKey: "simpleList",
|
|
797
797
|
capabilityId: "card.analysis.businessSuggestion",
|
|
798
798
|
items: [
|
|
799
|
-
{ label: "
|
|
800
|
-
{ label: "
|
|
801
|
-
{ label: "
|
|
799
|
+
{ label: u("FWA.e8861787571089301"), value: u("FWA.681d1787571548904"), tone: "warning" },
|
|
800
|
+
{ label: u("FWA.7a591787570997769"), value: u("FWA.681d1787571548904"), tone: "healthy" },
|
|
801
|
+
{ label: u("FWA.34b61787571162352"), value: u("FWA.681d1787571548904"), tone: "healthy" }
|
|
802
802
|
]
|
|
803
803
|
} : /image-fallback-17|资产异常|异常/i.test(a) ? {
|
|
804
|
-
title: "
|
|
804
|
+
title: u("FWA.35b91787571337857"),
|
|
805
805
|
visualKind: "simpleList",
|
|
806
806
|
dataShape: "rows",
|
|
807
807
|
rendererKey: "simpleList",
|
|
808
808
|
capabilityId: "card.table.list",
|
|
809
809
|
items: [
|
|
810
|
-
{ label: "
|
|
811
|
-
{ label: "
|
|
812
|
-
{ label: "
|
|
810
|
+
{ label: u("FWA.24fb1787571036986"), value: u("FWA.681d1787571548904"), tone: "warning" },
|
|
811
|
+
{ label: u("FWA.6b841787570880093"), value: u("FWA.681d1787571548904"), tone: "critical" },
|
|
812
|
+
{ label: u("FWA.9b5b1787571090349"), value: u("FWA.681d1787571548904"), tone: "healthy" }
|
|
813
813
|
]
|
|
814
814
|
} : {
|
|
815
|
-
title: e.title ?
|
|
815
|
+
title: e.title ? u("FWA.83381787570958739", { p0: e.title }) : u("FWA.f4261787571163224"),
|
|
816
816
|
visualKind: "simpleList",
|
|
817
817
|
dataShape: "rows",
|
|
818
818
|
rendererKey: "simpleList",
|
|
819
819
|
capabilityId: "card.table.list",
|
|
820
820
|
items: [
|
|
821
|
-
{ label: "
|
|
822
|
-
{ label: "
|
|
821
|
+
{ label: u("FWA.6f771787571090873"), value: u("FWA.681d1787571548904"), tone: "warning" },
|
|
822
|
+
{ label: u("FWA.73f11787570880755"), value: u("FWA.6fec1787571387310"), tone: "info" }
|
|
823
823
|
]
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
826
|
function _e(t, e) {
|
|
827
|
-
var r, o,
|
|
827
|
+
var r, o, l, m, p;
|
|
828
828
|
const a = `${((r = e.meta) == null ? void 0 : r.composeSource) || ""} ${String(M(e.data).source || "")}`;
|
|
829
829
|
if (!/image/i.test(a) || !Bt(t)) return t;
|
|
830
|
-
const n =
|
|
830
|
+
const n = Te(t, e), i = t.dataBindingId || ot(t.dataBinding) || `${t.id}-binding`, s = t.humanIntervention || {
|
|
831
831
|
required: !0,
|
|
832
832
|
reason: "missing_business_context",
|
|
833
|
-
message:
|
|
834
|
-
}, c = Array.isArray((o = t.data) == null ? void 0 : o.items) ? t.data.items : n.items, d =
|
|
833
|
+
message: u("FWA.a0df1787570419279", { p0: n.title })
|
|
834
|
+
}, c = Array.isArray((o = t.data) == null ? void 0 : o.items) ? t.data.items : n.items, d = He(c);
|
|
835
835
|
return {
|
|
836
836
|
...t,
|
|
837
837
|
title: n.title,
|
|
@@ -846,12 +846,12 @@ function _e(t, e) {
|
|
|
846
846
|
...t.dataBinding || {},
|
|
847
847
|
bindingId: i,
|
|
848
848
|
status: "error",
|
|
849
|
-
queryIntent: t.queryIntent ||
|
|
849
|
+
queryIntent: t.queryIntent || u("FWA.b9df1787570936049", { p0: n.title }),
|
|
850
850
|
humanIntervention: s
|
|
851
851
|
},
|
|
852
|
-
dataBindingError: t.dataBindingError || "
|
|
852
|
+
dataBindingError: t.dataBindingError || u("FWA.ca871787570878538"),
|
|
853
853
|
humanIntervention: s,
|
|
854
|
-
queryIntent: t.queryIntent ||
|
|
854
|
+
queryIntent: t.queryIntent || u("FWA.b9df1787570936049", { p0: n.title }),
|
|
855
855
|
renderer: t.renderer || { engine: "custom", rendererKey: n.rendererKey },
|
|
856
856
|
state: t.state || {
|
|
857
857
|
mode: "final",
|
|
@@ -863,27 +863,27 @@ function _e(t, e) {
|
|
|
863
863
|
...t.data || {},
|
|
864
864
|
shape: n.dataShape,
|
|
865
865
|
items: c,
|
|
866
|
-
columns: Array.isArray((
|
|
867
|
-
rows: Array.isArray((
|
|
866
|
+
columns: Array.isArray((l = t.data) == null ? void 0 : l.columns) ? t.data.columns : d.columns,
|
|
867
|
+
rows: Array.isArray((m = t.data) == null ? void 0 : m.rows) ? t.data.rows : d.rows,
|
|
868
868
|
dataBindingId: i,
|
|
869
869
|
dataBindingStatus: "error",
|
|
870
|
-
dataBindingError: t.dataBindingError || "
|
|
870
|
+
dataBindingError: t.dataBindingError || u("FWA.ca871787570878538"),
|
|
871
871
|
humanIntervention: s,
|
|
872
872
|
dataBindingHumanIntervention: s,
|
|
873
873
|
capabilityId: t.capabilityId || n.capabilityId,
|
|
874
874
|
dataShape: t.dataShape || n.dataShape,
|
|
875
875
|
visualKind: t.visualKind || n.visualKind,
|
|
876
|
-
rendererKey: ((
|
|
877
|
-
queryIntent: t.queryIntent ||
|
|
876
|
+
rendererKey: ((p = t.renderer) == null ? void 0 : p.rendererKey) || n.rendererKey,
|
|
877
|
+
queryIntent: t.queryIntent || u("FWA.b9df1787570936049", { p0: n.title })
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
881
|
function Be(t) {
|
|
882
882
|
const e = M(t.meta), a = M(t.data), n = M(e.visual), i = M(t.renderer), s = M(e.v2), c = Array.isArray(a.nestedBlocks) ? a.nestedBlocks : [], d = `${t.title} ${t.subtitle || ""} ${JSON.stringify(a.elements || [])}`;
|
|
883
|
-
return c.length === 0 && !
|
|
883
|
+
return c.length === 0 && !Le(t) || e.organizationKind === "welcome_banner" || e.imageCanvasChromeOnly === !0 || n.businessSummaryBand === "risk" || a.nestedLayoutMode === "absolute" || i.rendererKey === "customCanvas" && /GLOBAL RISK POSTURE|risk posture|风险总览|经营健康综合得分/i.test(d) || s.referenceCompositeKind !== void 0;
|
|
884
884
|
}
|
|
885
|
-
function
|
|
886
|
-
return
|
|
885
|
+
function ba(t) {
|
|
886
|
+
return O(t.data) ? !Be(t) : !1;
|
|
887
887
|
}
|
|
888
888
|
function kt(t, e) {
|
|
889
889
|
const a = _e(t, e), n = a.layout ? { ...a.layout, i: a.id } : Pt(a, 0), i = M(a.meta), s = a.renderer || {
|
|
@@ -943,26 +943,26 @@ function kt(t, e) {
|
|
|
943
943
|
}
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function ot(t) {
|
|
947
947
|
const e = M(t), a = e.bindingId || e.id;
|
|
948
948
|
return typeof a == "string" && a.trim() ? a : void 0;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
var
|
|
950
|
+
function pt(t, e = {}) {
|
|
951
|
+
var g, W, N, b;
|
|
952
952
|
const a = M(t.data), n = M(t.meta), i = t.renderer || {
|
|
953
953
|
engine: "custom",
|
|
954
954
|
rendererKey: typeof n.rendererKey == "string" ? n.rendererKey : "customCanvas"
|
|
955
|
-
}, s = typeof n.capabilityId == "string" ? n.capabilityId : typeof a.capabilityId == "string" ? a.capabilityId : typeof ((
|
|
955
|
+
}, s = typeof n.capabilityId == "string" ? n.capabilityId : typeof a.capabilityId == "string" ? a.capabilityId : typeof ((W = (g = t.source) == null ? void 0 : g.params) == null ? void 0 : W.capabilityId) == "string" ? t.source.params.capabilityId : void 0, c = typeof n.dataShape == "string" ? n.dataShape : typeof a.dataShape == "string" ? a.dataShape : typeof a.shape == "string" ? a.shape : i.rendererKey, d = typeof n.visualKind == "string" ? n.visualKind : typeof a.visualKind == "string" ? a.visualKind : void 0, r = M(a.dataBinding), o = M(n.dataBinding), l = typeof a.dataBindingId == "string" ? a.dataBindingId : typeof n.dataBindingId == "string" ? n.dataBindingId : ot(r) ?? ot(o), m = typeof a.dataBindingStatus == "string" ? a.dataBindingStatus : typeof n.dataBindingStatus == "string" ? n.dataBindingStatus : typeof r.status == "string" ? r.status : ((N = t.state) == null ? void 0 : N.status) || "ready", p = M(a.humanIntervention), y = M(n.humanIntervention), I = typeof a.queryIntent == "string" ? a.queryIntent : typeof n.queryIntent == "string" ? n.queryIntent : typeof r.queryIntent == "string" ? r.queryIntent : void 0, x = e.layout || t.layout, F = {
|
|
956
956
|
i: t.id,
|
|
957
|
-
x:
|
|
958
|
-
y:
|
|
959
|
-
w:
|
|
960
|
-
h:
|
|
961
|
-
minW:
|
|
962
|
-
minH:
|
|
963
|
-
maxW:
|
|
964
|
-
maxH:
|
|
965
|
-
static:
|
|
957
|
+
x: x.x,
|
|
958
|
+
y: x.y,
|
|
959
|
+
w: x.w,
|
|
960
|
+
h: x.h,
|
|
961
|
+
minW: x.minW,
|
|
962
|
+
minH: x.minH,
|
|
963
|
+
maxW: x.maxW,
|
|
964
|
+
maxH: x.maxH,
|
|
965
|
+
static: x.static,
|
|
966
966
|
...e.parentId ? { parentId: e.parentId } : {}
|
|
967
967
|
};
|
|
968
968
|
return {
|
|
@@ -980,24 +980,24 @@ function lt(t, e = {}) {
|
|
|
980
980
|
},
|
|
981
981
|
slot: "main",
|
|
982
982
|
composeSource: typeof a.composeSource == "string" ? a.composeSource : void 0,
|
|
983
|
-
dataBindingId:
|
|
983
|
+
dataBindingId: l,
|
|
984
984
|
...Object.keys(r).length > 0 ? { dataBinding: r } : {},
|
|
985
|
-
dataBindingStatus:
|
|
985
|
+
dataBindingStatus: m,
|
|
986
986
|
dataBindingError: typeof a.dataBindingError == "string" ? a.dataBindingError : typeof n.dataBindingError == "string" ? n.dataBindingError : void 0,
|
|
987
|
-
humanIntervention: Object.keys(
|
|
988
|
-
queryIntent:
|
|
987
|
+
humanIntervention: Object.keys(p).length > 0 ? p : Object.keys(y).length > 0 ? y : void 0,
|
|
988
|
+
queryIntent: I,
|
|
989
989
|
subType: t.subType,
|
|
990
990
|
renderer: i,
|
|
991
991
|
state: t.state,
|
|
992
|
-
layout:
|
|
993
|
-
visual: (
|
|
992
|
+
layout: F,
|
|
993
|
+
visual: (b = t.meta) == null ? void 0 : b.visual,
|
|
994
994
|
data: {
|
|
995
995
|
...a,
|
|
996
|
-
dataBindingStatus:
|
|
997
|
-
...
|
|
996
|
+
dataBindingStatus: m,
|
|
997
|
+
...l ? { dataBindingId: l } : {},
|
|
998
998
|
...Object.keys(r).length > 0 ? { dataBinding: r } : {},
|
|
999
|
-
...Object.keys(
|
|
1000
|
-
...
|
|
999
|
+
...Object.keys(p).length > 0 ? { humanIntervention: p } : {},
|
|
1000
|
+
...I ? { queryIntent: I } : {},
|
|
1001
1001
|
capabilityId: s,
|
|
1002
1002
|
dataShape: c,
|
|
1003
1003
|
visualKind: d,
|
|
@@ -1026,7 +1026,7 @@ function Pt(t, e) {
|
|
|
1026
1026
|
h: 5
|
|
1027
1027
|
};
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function L(t) {
|
|
1030
1030
|
const e = Number(t);
|
|
1031
1031
|
return Number.isFinite(e) ? e : void 0;
|
|
1032
1032
|
}
|
|
@@ -1037,205 +1037,205 @@ function Pe(t) {
|
|
|
1037
1037
|
function De(t) {
|
|
1038
1038
|
var n, i;
|
|
1039
1039
|
const e = M(t.data), a = `${((n = t.meta) == null ? void 0 : n.composeSource) || ""} ${typeof e.source == "string" ? e.source : ""} ${((i = t.source) == null ? void 0 : i.service) || ""}`;
|
|
1040
|
-
return
|
|
1040
|
+
return O(t.data) && /image/i.test(a) && Array.isArray(t.data.nestedBlocks) && t.data.nestedBlocks.length > 0;
|
|
1041
1041
|
}
|
|
1042
1042
|
function Ge(t) {
|
|
1043
|
-
return !
|
|
1043
|
+
return !O(t.data) || !Array.isArray(t.data.nestedBlocks) ? [] : De(t) ? t.data.nestedBlocks : t.data.nestedBlocks.filter((e) => {
|
|
1044
1044
|
const a = Pe(e);
|
|
1045
1045
|
return !a || a === t.id;
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function et(t, e, a, n) {
|
|
1049
1049
|
return a > 0 && t >= a && t < a + n ? Math.max(0, t - a) : t;
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
var
|
|
1053
|
-
if (!
|
|
1054
|
-
const i = M(e.data.nestedLayoutBasis), s =
|
|
1051
|
+
function Ke(t, e, a, n) {
|
|
1052
|
+
var z;
|
|
1053
|
+
if (!O(e.data) || e.data.nestedLayoutMode === "grid") return null;
|
|
1054
|
+
const i = M(e.data.nestedLayoutBasis), s = L(i.w), c = L(i.h);
|
|
1055
1055
|
if (s === void 0 || c === void 0) return null;
|
|
1056
|
-
const d =
|
|
1057
|
-
if (
|
|
1058
|
-
const
|
|
1056
|
+
const d = L(i.x) ?? 0, r = L(i.y) ?? 0, o = Math.max(1, s), l = Math.max(1, c), m = L(t.x), p = L(t.y), y = L(t.w), I = L(t.h);
|
|
1057
|
+
if (m === void 0 || p === void 0 || y === void 0 || I === void 0) return null;
|
|
1058
|
+
const x = Math.max(
|
|
1059
1059
|
S,
|
|
1060
|
-
|
|
1061
|
-
),
|
|
1060
|
+
h(L((z = e.layout) == null ? void 0 : z.h) ?? S)
|
|
1061
|
+
), F = et(m, y, d, o), g = et(p, I, r, l), W = Math.max(1, n ?? o), N = Math.max(1, a ?? l), b = S / W, _ = x / N, P = T(g * _), D = Math.max(1, x - P), G = D > yt ? yt : 0, v = Math.max(1, I * _), H = Math.max(1, D - G), A = T(Math.min(v, H)), E = t.minH === void 0 ? void 0 : h(t.minH), K = E === void 0 ? Math.max(2, Math.min(A, Math.ceil(A * 0.4))) : Math.min(A, E);
|
|
1062
1062
|
return {
|
|
1063
1063
|
...t,
|
|
1064
|
-
x:
|
|
1064
|
+
x: f(F * b),
|
|
1065
1065
|
y: P,
|
|
1066
|
-
w:
|
|
1067
|
-
h:
|
|
1068
|
-
minW: t.minW === void 0 ? void 0 :
|
|
1069
|
-
minH:
|
|
1070
|
-
maxW: t.maxW === void 0 ? void 0 :
|
|
1071
|
-
maxH: t.maxH === void 0 ? void 0 :
|
|
1066
|
+
w: T(Math.max(1, y * b)),
|
|
1067
|
+
h: A,
|
|
1068
|
+
minW: t.minW === void 0 ? void 0 : T(Math.max(1, t.minW * b)),
|
|
1069
|
+
minH: T(K),
|
|
1070
|
+
maxW: t.maxW === void 0 ? void 0 : T(Math.max(1, t.maxW * b)),
|
|
1071
|
+
maxH: t.maxH === void 0 ? void 0 : T(Math.max(1, t.maxH * _))
|
|
1072
1072
|
};
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1075
|
-
if (!
|
|
1076
|
-
const a = M(e.data.nestedLayoutBasis), n =
|
|
1074
|
+
function ze(t, e) {
|
|
1075
|
+
if (!O(e.data) || e.data.nestedLayoutMode === "grid") return null;
|
|
1076
|
+
const a = M(e.data.nestedLayoutBasis), n = L(a.w), i = L(a.h);
|
|
1077
1077
|
if (n === void 0 || i === void 0) return null;
|
|
1078
|
-
const s =
|
|
1079
|
-
const
|
|
1080
|
-
if (
|
|
1081
|
-
const
|
|
1082
|
-
return [{ right:
|
|
1078
|
+
const s = L(a.x) ?? 0, c = L(a.y) ?? 0, d = Math.max(1, n), r = Math.max(1, i), o = t.flatMap((y) => {
|
|
1079
|
+
const I = L(y.x), x = L(y.y), F = L(y.w), g = L(y.h);
|
|
1080
|
+
if (I === void 0 || x === void 0 || F === void 0 || g === void 0) return [];
|
|
1081
|
+
const W = et(I, F, s, d), N = et(x, g, c, r);
|
|
1082
|
+
return [{ right: W + F, bottom: N + g }];
|
|
1083
1083
|
});
|
|
1084
1084
|
if (o.length === 0) return null;
|
|
1085
|
-
const
|
|
1085
|
+
const l = Math.max(...o.map((y) => y.right)), m = Math.max(...o.map((y) => y.bottom)), p = l <= d && m <= r;
|
|
1086
1086
|
return {
|
|
1087
|
-
cols:
|
|
1088
|
-
rows:
|
|
1087
|
+
cols: p ? d : Math.max(d, l),
|
|
1088
|
+
rows: p ? r : Math.max(r, m)
|
|
1089
1089
|
};
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Ve(t, e) {
|
|
1092
1092
|
var i, s;
|
|
1093
|
-
if (!
|
|
1093
|
+
if (!O(t.data)) return !1;
|
|
1094
1094
|
const a = M(t.data), n = `${((i = t.meta) == null ? void 0 : i.composeSource) || ""} ${typeof a.source == "string" ? a.source : ""} ${((s = t.source) == null ? void 0 : s.service) || ""}`;
|
|
1095
|
-
return !/image/i.test(n) || t.data.nestedLayoutMode === "stack" || t.data.nestedLayoutMode === "grid" ? !1 : e.length >
|
|
1095
|
+
return !/image/i.test(n) || t.data.nestedLayoutMode === "stack" || t.data.nestedLayoutMode === "grid" ? !1 : e.length > st;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function qe(t, e) {
|
|
1098
1098
|
var r;
|
|
1099
1099
|
if (t.length === 0) return [];
|
|
1100
|
-
const a = [...t].sort(
|
|
1101
|
-
return a.map((o,
|
|
1102
|
-
const
|
|
1100
|
+
const a = [...t].sort(C), n = Math.min(2, Math.max(1, a.length)), i = Math.max(1, Math.ceil(a.length / n)), s = Math.max(i, h(((r = e.layout) == null ? void 0 : r.h) ?? i)), c = Math.max(1, Math.floor(s / i)), d = Math.floor(S / n);
|
|
1101
|
+
return a.map((o, l) => {
|
|
1102
|
+
const m = l % n, p = Math.floor(l / n), y = m === n - 1 ? S - d : m * d, I = m === n - 1 ? S - y : d, x = p * c, F = p === i - 1 ? s : (p + 1) * c, g = Math.max(1, F - x);
|
|
1103
1103
|
return {
|
|
1104
1104
|
...o,
|
|
1105
|
-
x:
|
|
1106
|
-
y:
|
|
1107
|
-
w:
|
|
1108
|
-
h:
|
|
1109
|
-
minW: o.minW === void 0 ? void 0 : Math.min(
|
|
1110
|
-
minH: o.minH === void 0 ? void 0 : Math.min(
|
|
1111
|
-
maxW: o.maxW === void 0 ? void 0 : Math.max(
|
|
1112
|
-
maxH: o.maxH === void 0 ? void 0 : Math.max(
|
|
1105
|
+
x: y,
|
|
1106
|
+
y: x,
|
|
1107
|
+
w: I,
|
|
1108
|
+
h: g,
|
|
1109
|
+
minW: o.minW === void 0 ? void 0 : Math.min(I, h(o.minW)),
|
|
1110
|
+
minH: o.minH === void 0 ? void 0 : Math.min(g, h(o.minH)),
|
|
1111
|
+
maxW: o.maxW === void 0 ? void 0 : Math.max(I, h(o.maxW)),
|
|
1112
|
+
maxH: o.maxH === void 0 ? void 0 : Math.max(g, h(o.maxH))
|
|
1113
1113
|
};
|
|
1114
1114
|
});
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function je(t, e) {
|
|
1117
1117
|
const a = Math.max(
|
|
1118
1118
|
0,
|
|
1119
|
-
Math.min(
|
|
1119
|
+
Math.min(f(t.x) + h(t.w), f(e.x) + h(e.w)) - Math.max(f(t.x), f(e.x))
|
|
1120
1120
|
), n = Math.max(
|
|
1121
1121
|
0,
|
|
1122
|
-
Math.min(
|
|
1122
|
+
Math.min(f(t.y) + h(t.h), f(e.y) + h(e.h)) - Math.max(f(t.y), f(e.y))
|
|
1123
1123
|
);
|
|
1124
1124
|
return a * n;
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Ye(t) {
|
|
1127
1127
|
for (let e = 0; e < t.length; e += 1) {
|
|
1128
1128
|
const a = t[e];
|
|
1129
1129
|
if (a)
|
|
1130
1130
|
for (let n = e + 1; n < t.length; n += 1) {
|
|
1131
1131
|
const i = t[n];
|
|
1132
1132
|
if (!i) continue;
|
|
1133
|
-
const s =
|
|
1133
|
+
const s = je(a, i);
|
|
1134
1134
|
if (s <= 0) continue;
|
|
1135
|
-
const c =
|
|
1135
|
+
const c = h(a.w) * h(a.h), d = h(i.w) * h(i.h);
|
|
1136
1136
|
if (s / Math.max(1, Math.min(c, d)) >= 0.6) return !0;
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
return !1;
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1142
|
-
if (t.length < 2 || !
|
|
1141
|
+
function Ea(t, e = {}) {
|
|
1142
|
+
if (t.length < 2 || !Ye(t))
|
|
1143
1143
|
return t.map((o) => ({ ...o }));
|
|
1144
|
-
const a = t.map((o,
|
|
1144
|
+
const a = t.map((o, l) => ({ child: o, index: l })).sort((o, l) => f(o.child.y) - f(l.child.y) || f(o.child.x) - f(l.child.x) || o.index - l.index).map((o) => o.child), n = Math.min(2, Math.max(1, a.length)), i = Math.max(1, Math.ceil(a.length / n)), s = a.reduce((o, l) => Math.max(
|
|
1145
1145
|
o,
|
|
1146
|
-
|
|
1146
|
+
f(l.y) + h(l.h)
|
|
1147
1147
|
), 0), c = Math.max(
|
|
1148
1148
|
S,
|
|
1149
1149
|
i,
|
|
1150
|
-
|
|
1150
|
+
h(e.parentRows ?? 0),
|
|
1151
1151
|
s
|
|
1152
1152
|
), d = Math.max(1, Math.floor(c / i)), r = Math.floor(S / n);
|
|
1153
|
-
return a.map((o,
|
|
1154
|
-
const
|
|
1153
|
+
return a.map((o, l) => {
|
|
1154
|
+
const m = l % n, p = Math.floor(l / n), y = m === n - 1 ? S - r : m * r, I = m === n - 1 ? S - y : r, x = p * d, F = p === i - 1 ? c : (p + 1) * d, g = Math.max(1, F - x);
|
|
1155
1155
|
return {
|
|
1156
1156
|
...o,
|
|
1157
|
-
x:
|
|
1158
|
-
y:
|
|
1159
|
-
w:
|
|
1160
|
-
h:
|
|
1161
|
-
minW: o.minW === void 0 ? void 0 : Math.min(
|
|
1162
|
-
minH: o.minH === void 0 ? void 0 : Math.min(
|
|
1163
|
-
maxW: o.maxW === void 0 ? void 0 : Math.max(
|
|
1164
|
-
maxH: o.maxH === void 0 ? void 0 : Math.max(
|
|
1157
|
+
x: y,
|
|
1158
|
+
y: x,
|
|
1159
|
+
w: I,
|
|
1160
|
+
h: g,
|
|
1161
|
+
minW: o.minW === void 0 ? void 0 : Math.min(I, h(o.minW)),
|
|
1162
|
+
minH: o.minH === void 0 ? void 0 : Math.min(g, h(o.minH)),
|
|
1163
|
+
maxW: o.maxW === void 0 ? void 0 : Math.max(I, h(o.maxW)),
|
|
1164
|
+
maxH: o.maxH === void 0 ? void 0 : Math.max(g, h(o.maxH))
|
|
1165
1165
|
};
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1169
|
-
if (t.length <
|
|
1170
|
-
const a = Math.min(...t.map((o) =>
|
|
1171
|
-
return i >= d +
|
|
1168
|
+
function Ue(t, e) {
|
|
1169
|
+
if (t.length < ee || t.length > ae) return !1;
|
|
1170
|
+
const a = Math.min(...t.map((o) => f(o.y))), n = Math.max(...t.map((o) => f(o.y) + h(o.h))), i = Math.max(1, n - a), s = Math.max(...t.map((o) => h(o.h))), c = t.length === 1 ? 1 : t.length >= 7 ? 3 : 2, d = Math.ceil(t.length / c) * U, r = e >= d + U;
|
|
1171
|
+
return i >= d + U || s > U * 1.5 || r;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
const a =
|
|
1175
|
-
if (!
|
|
1173
|
+
function Ra(t, e = {}) {
|
|
1174
|
+
const a = h(e.parentRows ?? 0);
|
|
1175
|
+
if (!Ue(t, a))
|
|
1176
1176
|
return t.map((c) => ({ ...c }));
|
|
1177
|
-
const n = t.map((c, d) => ({ child: c, index: d })).sort((c, d) =>
|
|
1177
|
+
const n = t.map((c, d) => ({ child: c, index: d })).sort((c, d) => f(c.child.y) - f(d.child.y) || f(c.child.x) - f(d.child.x) || c.index - d.index).map((c) => c.child), i = n.length === 1 ? 1 : n.length >= 7 ? 3 : 2, s = Math.floor(S / i);
|
|
1178
1178
|
return n.map((c, d) => {
|
|
1179
|
-
const r = d % i, o = Math.floor(d / i),
|
|
1179
|
+
const r = d % i, o = Math.floor(d / i), l = r === i - 1 ? S - s : r * s, m = r === i - 1 ? S - l : s, p = U;
|
|
1180
1180
|
return {
|
|
1181
1181
|
...c,
|
|
1182
|
-
x:
|
|
1183
|
-
y: o *
|
|
1184
|
-
w:
|
|
1185
|
-
h:
|
|
1186
|
-
minW: c.minW === void 0 ? void 0 : Math.min(
|
|
1187
|
-
minH: c.minH === void 0 ? void 0 : Math.min(
|
|
1188
|
-
maxW: c.maxW === void 0 ? void 0 : Math.max(
|
|
1189
|
-
maxH: c.maxH === void 0 ? void 0 : Math.max(
|
|
1182
|
+
x: l,
|
|
1183
|
+
y: o * p,
|
|
1184
|
+
w: m,
|
|
1185
|
+
h: p,
|
|
1186
|
+
minW: c.minW === void 0 ? void 0 : Math.min(m, h(c.minW)),
|
|
1187
|
+
minH: c.minH === void 0 ? void 0 : Math.min(p, h(c.minH)),
|
|
1188
|
+
maxW: c.maxW === void 0 ? void 0 : Math.max(m, h(c.maxW)),
|
|
1189
|
+
maxH: c.maxH === void 0 ? void 0 : Math.max(p, h(c.maxH))
|
|
1190
1190
|
};
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function La(t) {
|
|
1194
1194
|
const e = t.reduce((a, n) => Math.max(
|
|
1195
1195
|
a,
|
|
1196
|
-
|
|
1196
|
+
f(n.y) + h(n.h)
|
|
1197
1197
|
), 0);
|
|
1198
|
-
return e > 0 ? e +
|
|
1198
|
+
return e > 0 ? e + ne : 0;
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function $e(t, e) {
|
|
1201
1201
|
if (t.length === 0 || e < 12) return !1;
|
|
1202
|
-
const a = Math.min(...t.map((s) =>
|
|
1203
|
-
return i <=
|
|
1202
|
+
const a = Math.min(...t.map((s) => f(s.y))), n = Math.max(...t.map((s) => f(s.y) + h(s.h))), i = Math.max(1, n - a);
|
|
1203
|
+
return i <= Ht || i / Math.max(1, e) < Tt;
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Xe(t) {
|
|
1206
1206
|
const e = /* @__PURE__ */ new Map();
|
|
1207
1207
|
return t.forEach((a) => {
|
|
1208
|
-
const n =
|
|
1208
|
+
const n = f(a.x), i = Math.min(S - 1, Math.max(0, n));
|
|
1209
1209
|
e.set(i, [...e.get(i) || [], a]);
|
|
1210
|
-
}), [...e.entries()].sort(([a], [n]) => a - n).map(([, a]) => a.sort((n, i) =>
|
|
1210
|
+
}), [...e.entries()].sort(([a], [n]) => a - n).map(([, a]) => a.sort((n, i) => f(n.y) - f(i.y) || f(n.x) - f(i.x) || String(n.i).localeCompare(String(i.i))));
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1213
|
-
const s = Math.max(S, i), c = Math.max(1, Math.floor(S / Math.max(1, a))), d = e === a - 1 ? S - c : e * c, r = Math.min(...n.map((
|
|
1214
|
-
|
|
1215
|
-
Math.round(
|
|
1212
|
+
function Je(t, e, a, n, i) {
|
|
1213
|
+
const s = Math.max(S, i), c = Math.max(1, Math.floor(S / Math.max(1, a))), d = e === a - 1 ? S - c : e * c, r = Math.min(...n.map((I) => f(I.y))), o = Math.max(...n.map((I) => f(I.y) + h(I.h))), l = Math.max(1, o - r), m = s / l, p = Math.max(0, Math.round((f(t.y) - r) * m)), y = Math.max(
|
|
1214
|
+
h(t.minH ?? 1),
|
|
1215
|
+
Math.round(h(t.h) * m)
|
|
1216
1216
|
);
|
|
1217
1217
|
return {
|
|
1218
1218
|
...t,
|
|
1219
1219
|
x: d,
|
|
1220
1220
|
w: e === a - 1 ? S - d : c,
|
|
1221
|
-
y:
|
|
1222
|
-
h:
|
|
1223
|
-
minW: Math.min(c,
|
|
1224
|
-
minH: Math.min(
|
|
1221
|
+
y: p,
|
|
1222
|
+
h: y,
|
|
1223
|
+
minW: Math.min(c, h(t.minW ?? Math.min(3, c))),
|
|
1224
|
+
minH: Math.min(y, h(t.minH ?? 2))
|
|
1225
1225
|
};
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function Qe(t, e) {
|
|
1228
1228
|
var d, r;
|
|
1229
1229
|
const a = M(e.data), n = `${((d = e.meta) == null ? void 0 : d.composeSource) || ""} ${typeof a.source == "string" ? a.source : ""}`;
|
|
1230
1230
|
if (!/image/i.test(n)) return [...t];
|
|
1231
|
-
const i =
|
|
1232
|
-
if (
|
|
1233
|
-
const s =
|
|
1234
|
-
return s.forEach((o,
|
|
1235
|
-
o.forEach((
|
|
1236
|
-
c.set(String(
|
|
1237
|
-
u,
|
|
1231
|
+
const i = h(((r = e.layout) == null ? void 0 : r.h) ?? 0);
|
|
1232
|
+
if (!$e(t, i)) return [...t];
|
|
1233
|
+
const s = Xe(t).slice(0, S), c = /* @__PURE__ */ new Map();
|
|
1234
|
+
return s.forEach((o, l) => {
|
|
1235
|
+
o.forEach((m) => {
|
|
1236
|
+
c.set(String(m.i), Je(
|
|
1238
1237
|
m,
|
|
1238
|
+
l,
|
|
1239
1239
|
s.length,
|
|
1240
1240
|
o,
|
|
1241
1241
|
i
|
|
@@ -1243,58 +1243,58 @@ function Je(t, e) {
|
|
|
1243
1243
|
});
|
|
1244
1244
|
}), t.map((o) => c.get(String(o.i)) || o);
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function At(t) {
|
|
1247
1247
|
return !t || t.length === 0 ? 0 : t.reduce((e, a) => Math.max(
|
|
1248
1248
|
e,
|
|
1249
|
-
|
|
1249
|
+
f(a.y) + h(a.h)
|
|
1250
1250
|
), 0);
|
|
1251
1251
|
}
|
|
1252
1252
|
function Mt(t) {
|
|
1253
1253
|
return t.map((e) => e.i).sort().join("|");
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return
|
|
1255
|
+
function Ze(t, e) {
|
|
1256
|
+
return f(t.x) === f(e.x) && f(t.y) === f(e.y) && h(t.w) === h(e.w) && h(t.h) === h(e.h);
|
|
1257
1257
|
}
|
|
1258
1258
|
function St(t) {
|
|
1259
|
-
return t.length === 0 ? 0 : Math.min(...t.map((e) =>
|
|
1259
|
+
return t.length === 0 ? 0 : Math.min(...t.map((e) => f(e.y)));
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function Oa(t, e) {
|
|
1262
1262
|
if (!t || t.length === 0 || e.length === 0 || Mt(t) !== Mt(e)) return !1;
|
|
1263
|
-
const a = new Map(e.map((
|
|
1264
|
-
const
|
|
1265
|
-
return
|
|
1263
|
+
const a = new Map(e.map((p) => [p.i, p])), n = t.filter((p) => {
|
|
1264
|
+
const y = a.get(p.i);
|
|
1265
|
+
return y ? !Ze(p, y) : !0;
|
|
1266
1266
|
}).length;
|
|
1267
1267
|
if (n === 0) return !1;
|
|
1268
|
-
const i =
|
|
1268
|
+
const i = At(t), s = At(e);
|
|
1269
1269
|
if (s < 12) return !1;
|
|
1270
|
-
const c = St(t), d = St(e), r = t.reduce((
|
|
1271
|
-
return i <=
|
|
1270
|
+
const c = St(t), d = St(e), r = t.reduce((p, y) => Math.max(p, h(y.h)), 0), o = e.reduce((p, y) => Math.max(p, h(y.h)), 0), l = r / Math.max(1, i), m = o / Math.max(1, s);
|
|
1271
|
+
return i <= Ht || i / Math.max(1, s) < Tt || o >= 16 && r <= 8 || t.length > st && c >= Math.max(4, d + 6) && n >= Math.max(1, Math.ceil(t.length * 0.5)) || t.length > st && n >= Math.max(1, Math.ceil(t.length * 0.5)) && r > o * 1.5 && l > m * 1.4;
|
|
1272
1272
|
}
|
|
1273
1273
|
function Dt(t) {
|
|
1274
1274
|
const e = Ge(t);
|
|
1275
1275
|
if (e.length === 0) return [];
|
|
1276
|
-
const a = e.map((c, d) => Pt(c, d)), n =
|
|
1277
|
-
return (n ?
|
|
1278
|
-
i &&
|
|
1276
|
+
const a = e.map((c, d) => Pt(c, d)), n = Ve(t, e), i = n ? null : ze(a, t);
|
|
1277
|
+
return (n ? qe(a, t) : i ? a : Qe(a, t)).map((c) => tt(
|
|
1278
|
+
i && Ke(c, t, i.rows, i.cols) || c,
|
|
1279
1279
|
S,
|
|
1280
1280
|
S,
|
|
1281
1281
|
t.id
|
|
1282
|
-
)).sort(
|
|
1282
|
+
)).sort(C);
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
const n =
|
|
1286
|
-
return [...e].sort(
|
|
1284
|
+
function ta(t, e, a = /* @__PURE__ */ new Map()) {
|
|
1285
|
+
const n = O(t.data) && Array.isArray(t.data.nestedBlocks) ? t.data.nestedBlocks : [], i = new Map(n.map((s) => [s.id, s]));
|
|
1286
|
+
return [...e].sort(C).map((s) => {
|
|
1287
1287
|
const c = {
|
|
1288
1288
|
id: s.i,
|
|
1289
1289
|
title: s.i,
|
|
1290
1290
|
kind: "display",
|
|
1291
1291
|
slot: "main",
|
|
1292
1292
|
dataBindingStatus: "error",
|
|
1293
|
-
dataBindingError: "
|
|
1293
|
+
dataBindingError: u("FWA.ca871787570878538"),
|
|
1294
1294
|
humanIntervention: { required: !0, reason: "missing_nested_payload" }
|
|
1295
1295
|
};
|
|
1296
1296
|
return {
|
|
1297
|
-
...
|
|
1297
|
+
...Oe(i.get(s.i), a.get(s.i), c),
|
|
1298
1298
|
id: s.i,
|
|
1299
1299
|
layout: {
|
|
1300
1300
|
i: s.i,
|
|
@@ -1312,20 +1312,20 @@ function Ze(t, e, a = /* @__PURE__ */ new Map()) {
|
|
|
1312
1312
|
};
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function ea(t) {
|
|
1316
1316
|
const e = /* @__PURE__ */ new Map();
|
|
1317
1317
|
return t.forEach((a) => {
|
|
1318
|
-
!
|
|
1318
|
+
!O(a.data) || !Array.isArray(a.data.nestedBlocks) || a.data.nestedBlocks.forEach((n) => {
|
|
1319
1319
|
e.set(n.id, n);
|
|
1320
1320
|
});
|
|
1321
1321
|
}), e;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function aa(t, e, a) {
|
|
1324
1324
|
const n = new Map(e.map((i) => [i.id, i]));
|
|
1325
1325
|
a.forEach(({ node: i }) => {
|
|
1326
1326
|
if (t.has(i.i) || !i.parentId) return;
|
|
1327
1327
|
const s = n.get(i.i);
|
|
1328
|
-
s && t.set(i.i,
|
|
1328
|
+
s && t.set(i.i, pt(s, {
|
|
1329
1329
|
parentId: i.parentId,
|
|
1330
1330
|
layout: {
|
|
1331
1331
|
...s.layout,
|
|
@@ -1335,27 +1335,27 @@ function ea(t, e, a) {
|
|
|
1335
1335
|
}));
|
|
1336
1336
|
});
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function na(t) {
|
|
1339
1339
|
const e = /* @__PURE__ */ new Map();
|
|
1340
1340
|
return t.forEach((a) => {
|
|
1341
|
-
!
|
|
1341
|
+
!O(a.data) || !Array.isArray(a.data.nestedBlocks) || a.data.nestedBlocks.forEach((n) => {
|
|
1342
1342
|
e.set(n.id, a.id);
|
|
1343
1343
|
});
|
|
1344
1344
|
}), e;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function ia(t, e, a, n, i) {
|
|
1347
1347
|
const s = new Map(t.map((d) => [d.id, d])), c = [];
|
|
1348
1348
|
return e.forEach((d, r) => {
|
|
1349
1349
|
if (s.has(r) || i.has(r)) return;
|
|
1350
|
-
const o = n.get(r),
|
|
1351
|
-
!
|
|
1352
|
-
layout:
|
|
1350
|
+
const o = n.get(r), l = o ? s.get(o) : void 0, m = a.get(r);
|
|
1351
|
+
!l || !m || c.push(ke(m, l, {
|
|
1352
|
+
layout: re(
|
|
1353
1353
|
{ ...d, i: r },
|
|
1354
1354
|
o ? e.get(o) : void 0,
|
|
1355
|
-
|
|
1355
|
+
m.layout ? { ...m.layout } : void 0
|
|
1356
1356
|
)
|
|
1357
1357
|
}));
|
|
1358
|
-
}), c.sort((d, r) =>
|
|
1358
|
+
}), c.sort((d, r) => C({
|
|
1359
1359
|
i: d.id,
|
|
1360
1360
|
x: d.layout.x,
|
|
1361
1361
|
y: d.layout.y,
|
|
@@ -1369,17 +1369,17 @@ function na(t, e, a, n, i) {
|
|
|
1369
1369
|
h: r.layout.h
|
|
1370
1370
|
}));
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1372
|
+
function ra(t) {
|
|
1373
1373
|
return Object.prototype.hasOwnProperty.call(t, "children");
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function Wt(t, e) {
|
|
1376
1376
|
return (e == null ? void 0 : e.origin) === "replacement" && e.listingParentId === t && e.node.parentId === t;
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function wt(t, e) {
|
|
1379
1379
|
const a = t.get(e.node.i);
|
|
1380
1380
|
(a == null ? void 0 : a.parentSource) === "explicitParentId" && e.parentSource === "inferredParent" || t.set(e.node.i, e);
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1382
|
+
function sa(t) {
|
|
1383
1383
|
const e = /* @__PURE__ */ new Map();
|
|
1384
1384
|
return t.forEach(({ node: a }) => {
|
|
1385
1385
|
const n = a.parentId;
|
|
@@ -1388,7 +1388,7 @@ function ra(t) {
|
|
|
1388
1388
|
i.push(a), e.set(n, i);
|
|
1389
1389
|
}), e;
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function oa(t, e, a) {
|
|
1392
1392
|
const n = /* @__PURE__ */ new Map();
|
|
1393
1393
|
return Dt(t).forEach((i) => {
|
|
1394
1394
|
var c;
|
|
@@ -1396,88 +1396,88 @@ function sa(t, e, a) {
|
|
|
1396
1396
|
s && s.parentId !== t.id || n.set(i.i, i);
|
|
1397
1397
|
}), (a.get(t.id) || []).forEach((i) => {
|
|
1398
1398
|
n.set(i.i, i);
|
|
1399
|
-
}), [...n.values()].sort(
|
|
1400
|
-
}
|
|
1401
|
-
function
|
|
1402
|
-
const a = new Map(e.nodes.filter((
|
|
1403
|
-
e.nodes.forEach((
|
|
1404
|
-
|
|
1405
|
-
}), e.nodes.forEach((
|
|
1406
|
-
|
|
1407
|
-
node:
|
|
1399
|
+
}), [...n.values()].sort(C);
|
|
1400
|
+
}
|
|
1401
|
+
function Ha(t, e) {
|
|
1402
|
+
const a = new Map(e.nodes.filter((m) => !m.parentId).map((m) => [m.i, m])), n = ea(t), i = na(t), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Map();
|
|
1403
|
+
e.nodes.forEach((m) => {
|
|
1404
|
+
ra(m) && s.add(m.i);
|
|
1405
|
+
}), e.nodes.forEach((m) => {
|
|
1406
|
+
m.parentId && (s.has(m.parentId) || wt(d, {
|
|
1407
|
+
node: m,
|
|
1408
1408
|
parentSource: "explicitParentId",
|
|
1409
1409
|
origin: "flat"
|
|
1410
|
-
})), (Array.isArray(
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1413
|
-
node: { ...
|
|
1414
|
-
parentSource:
|
|
1410
|
+
})), (Array.isArray(m.children) ? m.children : []).forEach((y) => {
|
|
1411
|
+
const I = y.parentId || m.i, x = y.parentId ? "explicitParentId" : "inferredParent";
|
|
1412
|
+
wt(d, {
|
|
1413
|
+
node: { ...y, parentId: I },
|
|
1414
|
+
parentSource: x,
|
|
1415
1415
|
origin: "replacement",
|
|
1416
|
-
listingParentId:
|
|
1416
|
+
listingParentId: m.i
|
|
1417
1417
|
});
|
|
1418
1418
|
});
|
|
1419
1419
|
});
|
|
1420
|
-
const r =
|
|
1421
|
-
|
|
1422
|
-
const
|
|
1423
|
-
if (!
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1420
|
+
const r = sa(d);
|
|
1421
|
+
aa(n, t, d), d.forEach(({ node: m }) => {
|
|
1422
|
+
const p = m.parentId;
|
|
1423
|
+
if (!p) return;
|
|
1424
|
+
const y = i.get(m.i);
|
|
1425
|
+
y && y !== p && c.add(y);
|
|
1426
1426
|
});
|
|
1427
|
-
const o =
|
|
1427
|
+
const o = ia(
|
|
1428
1428
|
t,
|
|
1429
1429
|
a,
|
|
1430
1430
|
n,
|
|
1431
1431
|
i,
|
|
1432
1432
|
d
|
|
1433
1433
|
);
|
|
1434
|
-
return o.forEach((
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1437
|
-
}), [...t.filter((
|
|
1438
|
-
const
|
|
1439
|
-
...
|
|
1440
|
-
i:
|
|
1441
|
-
x:
|
|
1442
|
-
y:
|
|
1443
|
-
w:
|
|
1444
|
-
h:
|
|
1445
|
-
minW:
|
|
1446
|
-
minH:
|
|
1447
|
-
maxW:
|
|
1448
|
-
maxH:
|
|
1449
|
-
static:
|
|
1450
|
-
} :
|
|
1451
|
-
if (!
|
|
1452
|
-
return { ...
|
|
1453
|
-
const
|
|
1454
|
-
const
|
|
1455
|
-
return
|
|
1434
|
+
return o.forEach((m) => {
|
|
1435
|
+
const p = i.get(m.id);
|
|
1436
|
+
p && c.add(p);
|
|
1437
|
+
}), [...t.filter((m) => !d.has(m.id)).map((m) => {
|
|
1438
|
+
const p = a.get(m.id), y = p ? {
|
|
1439
|
+
...m.layout,
|
|
1440
|
+
i: m.id,
|
|
1441
|
+
x: p.x,
|
|
1442
|
+
y: p.y,
|
|
1443
|
+
w: p.w,
|
|
1444
|
+
h: p.h,
|
|
1445
|
+
minW: p.minW,
|
|
1446
|
+
minH: p.minH,
|
|
1447
|
+
maxW: p.maxW,
|
|
1448
|
+
maxH: p.maxH,
|
|
1449
|
+
static: p.static
|
|
1450
|
+
} : m.layout;
|
|
1451
|
+
if (!O(m.data))
|
|
1452
|
+
return { ...m, layout: y };
|
|
1453
|
+
const I = s.has(m.id), x = r.get(m.id) || [], F = x.some((N) => {
|
|
1454
|
+
const b = d.get(N.i);
|
|
1455
|
+
return b ? I ? Wt(m.id, b) : b.origin === "flat" || b.parentSource === "explicitParentId" : !1;
|
|
1456
1456
|
});
|
|
1457
|
-
if (!(
|
|
1458
|
-
return { ...
|
|
1459
|
-
const
|
|
1460
|
-
const
|
|
1461
|
-
return
|
|
1462
|
-
}) :
|
|
1457
|
+
if (!(I || F || c.has(m.id)))
|
|
1458
|
+
return { ...m, layout: y };
|
|
1459
|
+
const W = I ? x.filter((N) => {
|
|
1460
|
+
const b = d.get(N.i);
|
|
1461
|
+
return Wt(m.id, b);
|
|
1462
|
+
}) : oa(m, d, r);
|
|
1463
1463
|
return {
|
|
1464
|
-
...
|
|
1465
|
-
layout:
|
|
1464
|
+
...m,
|
|
1465
|
+
layout: y,
|
|
1466
1466
|
meta: {
|
|
1467
|
-
...
|
|
1467
|
+
...m.meta,
|
|
1468
1468
|
manualCanvasLayout: !0,
|
|
1469
1469
|
layoutManualOverride: !0,
|
|
1470
1470
|
layoutManualOverrideSource: "gridstack"
|
|
1471
1471
|
},
|
|
1472
1472
|
data: {
|
|
1473
|
-
...
|
|
1473
|
+
...m.data,
|
|
1474
1474
|
nestedLayoutMode: "grid",
|
|
1475
|
-
nestedBlocks:
|
|
1475
|
+
nestedBlocks: ta(m, W, n)
|
|
1476
1476
|
}
|
|
1477
1477
|
};
|
|
1478
1478
|
}), ...o];
|
|
1479
1479
|
}
|
|
1480
|
-
const
|
|
1480
|
+
const Ft = {
|
|
1481
1481
|
patch: "modifyCard",
|
|
1482
1482
|
updateData: "changeDataSource",
|
|
1483
1483
|
updateStyle: "modifyCard",
|
|
@@ -1486,40 +1486,40 @@ const Ct = {
|
|
|
1486
1486
|
updatePosition: "adjustLayout",
|
|
1487
1487
|
replaceRenderer: "changeChart"
|
|
1488
1488
|
};
|
|
1489
|
-
function
|
|
1489
|
+
function ca(t) {
|
|
1490
1490
|
return {
|
|
1491
1491
|
...t,
|
|
1492
1492
|
blocks: t.blocks.map((e) => ({
|
|
1493
1493
|
...e,
|
|
1494
1494
|
layout: { ...e.layout },
|
|
1495
|
-
data:
|
|
1496
|
-
meta:
|
|
1495
|
+
data: ct(e.data),
|
|
1496
|
+
meta: ct(e.meta),
|
|
1497
1497
|
renderer: e.renderer ? { ...e.renderer } : void 0,
|
|
1498
1498
|
state: { ...e.state }
|
|
1499
1499
|
}))
|
|
1500
1500
|
};
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1502
|
+
function ct(t) {
|
|
1503
1503
|
return !t || typeof t != "object" ? t : JSON.parse(JSON.stringify(t));
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function R(t, e, a) {
|
|
1506
1506
|
return {
|
|
1507
1507
|
status: "failed",
|
|
1508
1508
|
affectedCardIds: [],
|
|
1509
1509
|
error: { code: t, message: e, details: a }
|
|
1510
1510
|
};
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function da(t) {
|
|
1513
1513
|
return (t == null ? void 0 : t.scope) || "card";
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function ua(t, e) {
|
|
1516
1516
|
return e ? t.blocks.findIndex((a) => a.id === e) : -1;
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1518
|
+
function ma(t, e) {
|
|
1519
1519
|
if (!e) return null;
|
|
1520
1520
|
for (let a = 0; a < t.blocks.length; a += 1) {
|
|
1521
1521
|
const n = t.blocks[a];
|
|
1522
|
-
if (!
|
|
1522
|
+
if (!O(n.data) || !Array.isArray(n.data.nestedBlocks)) continue;
|
|
1523
1523
|
const i = n.data.nestedBlocks.findIndex((c) => c.id === e);
|
|
1524
1524
|
if (i < 0) continue;
|
|
1525
1525
|
const s = n.data.nestedBlocks[i];
|
|
@@ -1533,11 +1533,11 @@ function ua(t, e) {
|
|
|
1533
1533
|
}
|
|
1534
1534
|
return null;
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function la(t, e, a) {
|
|
1537
1537
|
const n = t.blocks[e.parentIndex];
|
|
1538
|
-
if (!
|
|
1538
|
+
if (!O(n.data)) return;
|
|
1539
1539
|
const i = n.data, s = Array.isArray(i.nestedBlocks) ? [...i.nestedBlocks] : [];
|
|
1540
|
-
s[e.childIndex] =
|
|
1540
|
+
s[e.childIndex] = pt(a, {
|
|
1541
1541
|
parentId: n.id,
|
|
1542
1542
|
layout: {
|
|
1543
1543
|
...a.layout,
|
|
@@ -1553,9 +1553,9 @@ function ma(t, e, a) {
|
|
|
1553
1553
|
}
|
|
1554
1554
|
};
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1556
|
+
function pa(t, e) {
|
|
1557
1557
|
const a = t.blocks[e.parentIndex];
|
|
1558
|
-
if (!
|
|
1558
|
+
if (!O(a.data)) return;
|
|
1559
1559
|
const n = a.data, i = Array.isArray(n.nestedBlocks) ? [...n.nestedBlocks] : [];
|
|
1560
1560
|
i.splice(e.childIndex, 1), t.blocks[e.parentIndex] = {
|
|
1561
1561
|
...a,
|
|
@@ -1566,20 +1566,20 @@ function la(t, e) {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1569
|
+
function Nt(t, e) {
|
|
1570
1570
|
const a = { ...t };
|
|
1571
|
-
return typeof e.title == "string" && (a.title = e.title), typeof e.subtitle == "string" && (a.subtitle = e.subtitle), e.data && typeof e.data == "object" && (a.data =
|
|
1571
|
+
return typeof e.title == "string" && (a.title = e.title), typeof e.subtitle == "string" && (a.subtitle = e.subtitle), e.data && typeof e.data == "object" && (a.data = ct(e.data)), e.meta && typeof e.meta == "object" && (a.meta = { ...a.meta || {}, ...e.meta }), e.renderer && typeof e.renderer == "object" && (a.renderer = { ...a.renderer || { engine: "echarts", rendererKey: "customCanvas" }, ...e.renderer }), e.layout && typeof e.layout == "object" && (a.layout = { ...a.layout, ...e.layout }), a;
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function it(t) {
|
|
1574
1574
|
var a, n, i, s;
|
|
1575
1575
|
const e = String(((a = t.meta) == null ? void 0 : a.capabilityId) || ((n = t.source) == null ? void 0 : n.resourceKey) || "");
|
|
1576
1576
|
return ((i = t.meta) == null ? void 0 : i.workbenchOrganizationCard) === !0 || String(((s = t.meta) == null ? void 0 : s.macroCapabilityId) || "").includes("workbench") || e.startsWith("card.workbench.") || t.id.startsWith("workbench-org-");
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function ha(t) {
|
|
1579
1579
|
return `canvas-tx-${t}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1582
|
-
return t in
|
|
1581
|
+
function fa(t) {
|
|
1582
|
+
return t in Ft ? Ft[t] : [
|
|
1583
1583
|
"freeModify",
|
|
1584
1584
|
"renameTitle",
|
|
1585
1585
|
"editBodyText",
|
|
@@ -1598,70 +1598,70 @@ function ha(t) {
|
|
|
1598
1598
|
].includes(t) ? t : null;
|
|
1599
1599
|
}
|
|
1600
1600
|
async function Gt(t, e) {
|
|
1601
|
-
var
|
|
1602
|
-
const a =
|
|
1603
|
-
if (!a) return
|
|
1601
|
+
var p, y, I, x, F, g, W, N, b, _, P, D, G;
|
|
1602
|
+
const a = fa(e.operation);
|
|
1603
|
+
if (!a) return R("UNSUPPORTED_OPERATION", u("FWA.56c81787570677852", { p0: e.operation }));
|
|
1604
1604
|
if (e.baseSnapshotVersion !== void 0 && e.baseSnapshotVersion !== t.version)
|
|
1605
|
-
return
|
|
1605
|
+
return R("VERSION_CONFLICT", u("FWA.54f41787570602213"), {
|
|
1606
1606
|
expected: e.baseSnapshotVersion,
|
|
1607
1607
|
actual: t.version
|
|
1608
1608
|
});
|
|
1609
|
-
const n =
|
|
1609
|
+
const n = ca(t), i = e.payload || {}, s = da(e.target), c = ua(n, (p = e.target) == null ? void 0 : p.cardId), d = c >= 0 ? null : ma(n, (y = e.target) == null ? void 0 : y.cardId), r = c >= 0 ? n.blocks[c] : d == null ? void 0 : d.materializedBlock, o = (v) => {
|
|
1610
1610
|
if (c >= 0) {
|
|
1611
|
-
n.blocks[c] =
|
|
1611
|
+
n.blocks[c] = v;
|
|
1612
1612
|
return;
|
|
1613
1613
|
}
|
|
1614
|
-
d &&
|
|
1614
|
+
d && la(n, d, v);
|
|
1615
1615
|
};
|
|
1616
1616
|
if (!["clearCanvas", "overwriteCanvas", "rollback"].includes(a) && !r)
|
|
1617
|
-
return
|
|
1618
|
-
const
|
|
1617
|
+
return R("CARD_NOT_FOUND", u("FWA.8a571787570651078"), e.target);
|
|
1618
|
+
const l = [], m = ha(a);
|
|
1619
1619
|
if (a === "locateCard")
|
|
1620
1620
|
return r ? {
|
|
1621
1621
|
status: "success",
|
|
1622
1622
|
snapshot: t,
|
|
1623
1623
|
affectedCardIds: [r.id],
|
|
1624
1624
|
locatedCardId: r.id,
|
|
1625
|
-
transactionId:
|
|
1626
|
-
} :
|
|
1625
|
+
transactionId: m
|
|
1626
|
+
} : R("CARD_NOT_FOUND", u("FWA.61061787571020611"), e.target);
|
|
1627
1627
|
if (a === "clearCanvas") {
|
|
1628
|
-
const
|
|
1629
|
-
return n.blocks =
|
|
1628
|
+
const v = i.includeSystemCards === !0, H = n.blocks.length;
|
|
1629
|
+
return n.blocks = v ? [] : n.blocks.filter(it), l.push(...t.blocks.filter((A) => v || !it(A)).map((A) => A.id)), {
|
|
1630
1630
|
status: "success",
|
|
1631
1631
|
snapshot: { ...n, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
|
|
1632
|
-
affectedCardIds:
|
|
1633
|
-
transactionId:
|
|
1634
|
-
error:
|
|
1632
|
+
affectedCardIds: l,
|
|
1633
|
+
transactionId: m,
|
|
1634
|
+
error: H === n.blocks.length ? { code: "OBJECT_NOT_FOUND", message: u("FWA.dcb71787570784860") } : void 0
|
|
1635
1635
|
};
|
|
1636
1636
|
}
|
|
1637
1637
|
if (a === "overwriteCanvas") {
|
|
1638
|
-
const
|
|
1639
|
-
if (
|
|
1640
|
-
const
|
|
1641
|
-
for (const
|
|
1642
|
-
const
|
|
1643
|
-
...
|
|
1644
|
-
...
|
|
1638
|
+
const v = Array.isArray(i.blocks) ? i.blocks : [];
|
|
1639
|
+
if (v.length === 0) return R("INVALID_PARAMS", u("FWA.11e71787570342151"));
|
|
1640
|
+
const A = i.keepSystemCards !== !1 ? n.blocks.filter(it) : [], E = [];
|
|
1641
|
+
for (const K of v) {
|
|
1642
|
+
const z = await rt(K, [
|
|
1643
|
+
...A.map((q) => q.layout),
|
|
1644
|
+
...E.map((q) => q.layout)
|
|
1645
1645
|
]);
|
|
1646
|
-
|
|
1646
|
+
z.block && E.push(z.block);
|
|
1647
1647
|
}
|
|
1648
|
-
return n.blocks = [...
|
|
1648
|
+
return n.blocks = [...A, ...E], l.push(...E.map((K) => K.id)), {
|
|
1649
1649
|
status: "success",
|
|
1650
1650
|
snapshot: { ...n, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
|
|
1651
|
-
affectedCardIds:
|
|
1652
|
-
transactionId:
|
|
1651
|
+
affectedCardIds: l,
|
|
1652
|
+
transactionId: m
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
1655
1655
|
if (a === "rollback") {
|
|
1656
|
-
const
|
|
1657
|
-
return !
|
|
1656
|
+
const v = i.snapshot;
|
|
1657
|
+
return !v || typeof v != "object" ? R("INVALID_PARAMS", u("FWA.ed301787570410944")) : {
|
|
1658
1658
|
status: "success",
|
|
1659
|
-
snapshot: { ...
|
|
1660
|
-
affectedCardIds: ((
|
|
1661
|
-
transactionId:
|
|
1659
|
+
snapshot: { ...v, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
|
|
1660
|
+
affectedCardIds: ((I = v.blocks) == null ? void 0 : I.map((H) => H.id)) || [],
|
|
1661
|
+
transactionId: m
|
|
1662
1662
|
};
|
|
1663
1663
|
}
|
|
1664
|
-
if (!r) return
|
|
1664
|
+
if (!r) return R("CARD_NOT_FOUND", u("FWA.88a31787571020621"), e.target);
|
|
1665
1665
|
if (a === "deleteCard") {
|
|
1666
1666
|
if (s === "canvas") return await Gt(t, { ...e, operation: "clearCanvas" });
|
|
1667
1667
|
s === "cardObject" ? (o({
|
|
@@ -1669,77 +1669,77 @@ async function Gt(t, e) {
|
|
|
1669
1669
|
meta: {
|
|
1670
1670
|
...r.meta || {},
|
|
1671
1671
|
removedObjects: [
|
|
1672
|
-
...Array.isArray((
|
|
1673
|
-
((
|
|
1672
|
+
...Array.isArray((x = r.meta) == null ? void 0 : x.removedObjects) ? r.meta.removedObjects : [],
|
|
1673
|
+
((F = e.target) == null ? void 0 : F.objectSelector) || i.objectSelector || { deletedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
1674
1674
|
]
|
|
1675
1675
|
}
|
|
1676
|
-
}),
|
|
1676
|
+
}), l.push(r.id)) : (d ? pa(n, d) : n.blocks.splice(c, 1), l.push(r.id));
|
|
1677
1677
|
}
|
|
1678
1678
|
if (a === "replaceCard") {
|
|
1679
|
-
const
|
|
1680
|
-
...
|
|
1681
|
-
layout:
|
|
1682
|
-
}, n.blocks.filter((
|
|
1683
|
-
if (!
|
|
1684
|
-
o(
|
|
1679
|
+
const v = i.insertCard || i.card || i, H = i.keepLayout !== !1, A = await rt({
|
|
1680
|
+
...v,
|
|
1681
|
+
layout: H ? r.layout : v.layout
|
|
1682
|
+
}, n.blocks.filter((E) => E.id !== r.id).map((E) => E.layout));
|
|
1683
|
+
if (!A.block) return R("CAPABILITY_NOT_FOUND", A.reason || u("FWA.4ccc1787570941093"), A);
|
|
1684
|
+
o(A.block), l.push(r.id, A.block.id);
|
|
1685
1685
|
}
|
|
1686
1686
|
if (a === "renameTitle") {
|
|
1687
|
-
const
|
|
1688
|
-
if (!
|
|
1689
|
-
o({ ...r, title:
|
|
1687
|
+
const v = typeof i.title == "string" ? i.title : typeof i.text == "string" ? i.text : "";
|
|
1688
|
+
if (!v.trim()) return R("INVALID_PARAMS", u("FWA.351d1787570411451"));
|
|
1689
|
+
o({ ...r, title: v }), l.push(r.id);
|
|
1690
1690
|
}
|
|
1691
1691
|
if (a === "editBodyText" || a === "editText") {
|
|
1692
|
-
const
|
|
1693
|
-
if (!
|
|
1692
|
+
const v = typeof i.text == "string" ? i.text : typeof i.bodyText == "string" ? i.bodyText : "";
|
|
1693
|
+
if (!v.trim()) return R("INVALID_PARAMS", u("FWA.583c1787570503113", { p0: a }));
|
|
1694
1694
|
o({
|
|
1695
1695
|
...r,
|
|
1696
1696
|
meta: {
|
|
1697
1697
|
...r.meta || {},
|
|
1698
|
-
bodyText: a === "editBodyText" ?
|
|
1699
|
-
editedText: a === "editText" ?
|
|
1698
|
+
bodyText: a === "editBodyText" ? v : (g = r.meta) == null ? void 0 : g.bodyText,
|
|
1699
|
+
editedText: a === "editText" ? v : (W = r.meta) == null ? void 0 : W.editedText
|
|
1700
1700
|
}
|
|
1701
|
-
}),
|
|
1701
|
+
}), l.push(r.id);
|
|
1702
1702
|
}
|
|
1703
1703
|
if (a === "changeChart") {
|
|
1704
|
-
const
|
|
1705
|
-
if (!
|
|
1704
|
+
const v = typeof i.rendererKey == "string" ? i.rendererKey : "";
|
|
1705
|
+
if (!v.trim()) return R("INVALID_PARAMS", u("FWA.e2121787570322856"));
|
|
1706
1706
|
o({
|
|
1707
1707
|
...r,
|
|
1708
|
-
renderer: { ...r.renderer || { engine: "echarts", rendererKey:
|
|
1708
|
+
renderer: { ...r.renderer || { engine: "echarts", rendererKey: v }, rendererKey: v },
|
|
1709
1709
|
meta: { ...r.meta || {}, chartChangedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
1710
|
-
}),
|
|
1710
|
+
}), l.push(r.id);
|
|
1711
1711
|
}
|
|
1712
1712
|
if (a === "changeDataSource") {
|
|
1713
|
-
if (!i.data && !i.source) return
|
|
1714
|
-
o(
|
|
1713
|
+
if (!i.data && !i.source) return R("INVALID_PARAMS", u("FWA.8c001787570199538"));
|
|
1714
|
+
o(Nt(r, i)), l.push(r.id);
|
|
1715
1715
|
}
|
|
1716
1716
|
if (a === "adjustLayout") {
|
|
1717
|
-
const
|
|
1718
|
-
if (!
|
|
1719
|
-
const
|
|
1717
|
+
const v = i.layout;
|
|
1718
|
+
if (!v) return R("INVALID_PARAMS", u("FWA.e9f01787570385143"));
|
|
1719
|
+
const H = n.blocks.filter((E) => E.id !== r.id).map((E) => E.layout), A = zt({
|
|
1720
1720
|
preset: "medium",
|
|
1721
|
-
layout: { ...r.layout, ...
|
|
1722
|
-
placed:
|
|
1721
|
+
layout: { ...r.layout, ...v },
|
|
1722
|
+
placed: H
|
|
1723
1723
|
});
|
|
1724
|
-
o({ ...r, layout:
|
|
1724
|
+
o({ ...r, layout: Vt(r.id, A) }), l.push(r.id);
|
|
1725
1725
|
}
|
|
1726
1726
|
if (a === "modifyCard" || a === "freeModify") {
|
|
1727
|
-
if (a === "freeModify" && !(((
|
|
1728
|
-
return
|
|
1729
|
-
o(
|
|
1727
|
+
if (a === "freeModify" && !(((N = e.target) == null ? void 0 : N.cardId) && i.scope && i.content && i.expectedResult))
|
|
1728
|
+
return R("INVALID_PARAMS", u("FWA.7ddd1787570282904"));
|
|
1729
|
+
o(Nt(r, i)), l.push(r.id);
|
|
1730
1730
|
}
|
|
1731
1731
|
if (a === "mutateCapability") {
|
|
1732
|
-
const
|
|
1733
|
-
if (!
|
|
1734
|
-
const
|
|
1735
|
-
if (
|
|
1736
|
-
const
|
|
1737
|
-
if (!
|
|
1738
|
-
const
|
|
1739
|
-
var
|
|
1740
|
-
return
|
|
1741
|
-
}),
|
|
1742
|
-
o({ ...r, meta: { ...r.meta || {}, capabilityMounts:
|
|
1732
|
+
const v = i.mutation;
|
|
1733
|
+
if (!v || typeof v != "object") return R("INVALID_PARAMS", u("FWA.6f5b1787570300729"));
|
|
1734
|
+
const H = v.capabilitySpec;
|
|
1735
|
+
if (v.action === "mount" || v.action === "replace") {
|
|
1736
|
+
const A = Qt(H, String(i.userNeed || u("FWA.b7411787571020631")));
|
|
1737
|
+
if (!A.allowed || !A.capability) return R(((b = A.error) == null ? void 0 : b.code) || "POLICY_REJECTED", ((_ = A.error) == null ? void 0 : _.message) || u("FWA.03c11787570602730"), A.gap || ((P = A.error) == null ? void 0 : P.details));
|
|
1738
|
+
const E = Array.isArray((D = r.meta) == null ? void 0 : D.capabilityMounts) ? r.meta.capabilityMounts : [], K = v.action === "replace" ? [...E.filter((z) => {
|
|
1739
|
+
var q;
|
|
1740
|
+
return z.id !== ((q = A.capability) == null ? void 0 : q.id);
|
|
1741
|
+
}), A.capability] : [...E, A.capability];
|
|
1742
|
+
o({ ...r, meta: { ...r.meta || {}, capabilityMounts: K } }), l.push(r.id);
|
|
1743
1743
|
} else
|
|
1744
1744
|
o({
|
|
1745
1745
|
...r,
|
|
@@ -1747,26 +1747,26 @@ async function Gt(t, e) {
|
|
|
1747
1747
|
...r.meta || {},
|
|
1748
1748
|
capabilityMutationLog: [
|
|
1749
1749
|
...Array.isArray((G = r.meta) == null ? void 0 : G.capabilityMutationLog) ? r.meta.capabilityMutationLog : [],
|
|
1750
|
-
|
|
1750
|
+
v
|
|
1751
1751
|
]
|
|
1752
1752
|
}
|
|
1753
|
-
}),
|
|
1753
|
+
}), l.push(r.id);
|
|
1754
1754
|
}
|
|
1755
|
-
return
|
|
1755
|
+
return l.length === 0 ? R("UNSUPPORTED_OPERATION", u("FWA.67921787570603779", { p0: a })) : {
|
|
1756
1756
|
status: "success",
|
|
1757
1757
|
snapshot: {
|
|
1758
1758
|
...n,
|
|
1759
1759
|
version: t.version + 1,
|
|
1760
1760
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1761
1761
|
},
|
|
1762
|
-
affectedCardIds: [...new Set(
|
|
1763
|
-
transactionId:
|
|
1762
|
+
affectedCardIds: [...new Set(l)],
|
|
1763
|
+
transactionId: m
|
|
1764
1764
|
};
|
|
1765
1765
|
}
|
|
1766
|
-
function
|
|
1766
|
+
function Ct(t) {
|
|
1767
1767
|
return t || `canvas-req-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function $(t, e, a) {
|
|
1770
1770
|
return {
|
|
1771
1771
|
success: !1,
|
|
1772
1772
|
requestId: e,
|
|
@@ -1775,59 +1775,59 @@ function Y(t, e, a) {
|
|
|
1775
1775
|
error: a
|
|
1776
1776
|
};
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1779
|
-
return t ? null :
|
|
1778
|
+
function bt(t, e, a) {
|
|
1779
|
+
return t ? null : $(e, a, {
|
|
1780
1780
|
code: "INVALID_PARAMS",
|
|
1781
|
-
message: "
|
|
1781
|
+
message: u("FWA.30af1787570601160")
|
|
1782
1782
|
});
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1784
|
+
function Ta(t) {
|
|
1785
1785
|
return {
|
|
1786
1786
|
async insertCard(e) {
|
|
1787
|
-
const a =
|
|
1787
|
+
const a = Ct(e.requestId), n = t.getSnapshot(), i = bt(n, "insertCard", a);
|
|
1788
1788
|
if (i || !n) return i;
|
|
1789
1789
|
if (e.baseSnapshotVersion !== void 0 && e.baseSnapshotVersion !== n.version)
|
|
1790
|
-
return
|
|
1790
|
+
return $("insertCard", a, {
|
|
1791
1791
|
code: "VERSION_CONFLICT",
|
|
1792
|
-
message: "
|
|
1792
|
+
message: u("FWA.1a961787570602208"),
|
|
1793
1793
|
details: { expected: e.baseSnapshotVersion, actual: n.version }
|
|
1794
1794
|
});
|
|
1795
|
-
const s = await
|
|
1795
|
+
const s = await rt(e, n.blocks.map((o) => o.layout));
|
|
1796
1796
|
if (!s.block)
|
|
1797
|
-
return
|
|
1797
|
+
return $("insertCard", a, {
|
|
1798
1798
|
code: "CAPABILITY_NOT_FOUND",
|
|
1799
|
-
message: s.reason || "
|
|
1799
|
+
message: s.reason || u("FWA.f9461787570820908"),
|
|
1800
1800
|
details: s
|
|
1801
1801
|
});
|
|
1802
1802
|
const c = n.version;
|
|
1803
1803
|
if (e.targetScope === "nested" || e.targetParentId) {
|
|
1804
|
-
const o = e.targetParentId,
|
|
1805
|
-
if (!o || !
|
|
1806
|
-
return
|
|
1804
|
+
const o = e.targetParentId, l = n.blocks.findIndex((W) => W.id === o), m = l >= 0 ? n.blocks[l] : void 0;
|
|
1805
|
+
if (!o || !m || !O(m.data))
|
|
1806
|
+
return $("insertCard", a, {
|
|
1807
1807
|
code: "CARD_NOT_FOUND",
|
|
1808
|
-
message: "
|
|
1808
|
+
message: u("FWA.cd5e1787570783618"),
|
|
1809
1809
|
details: { targetParentId: o }
|
|
1810
1810
|
});
|
|
1811
|
-
const
|
|
1811
|
+
const p = pt(s.block, {
|
|
1812
1812
|
parentId: o,
|
|
1813
1813
|
layout: {
|
|
1814
1814
|
...s.block.layout,
|
|
1815
1815
|
...e.layout,
|
|
1816
1816
|
i: s.block.id
|
|
1817
1817
|
}
|
|
1818
|
-
}),
|
|
1819
|
-
...
|
|
1818
|
+
}), y = m.data, I = Array.isArray(y.nestedBlocks) ? y.nestedBlocks : [], x = n.blocks.map((W, N) => N === l ? {
|
|
1819
|
+
...W,
|
|
1820
1820
|
data: {
|
|
1821
|
-
...
|
|
1821
|
+
...y,
|
|
1822
1822
|
nestedLayoutMode: "grid",
|
|
1823
|
-
nestedBlocks: [...
|
|
1823
|
+
nestedBlocks: [...I, p]
|
|
1824
1824
|
}
|
|
1825
|
-
} :
|
|
1825
|
+
} : W), F = {
|
|
1826
1826
|
...n,
|
|
1827
1827
|
version: n.version + 1,
|
|
1828
1828
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1829
|
-
blocks:
|
|
1830
|
-
},
|
|
1829
|
+
blocks: x
|
|
1830
|
+
}, g = await t.commitSnapshot(F, {
|
|
1831
1831
|
...e.persistence || {},
|
|
1832
1832
|
baseSnapshotVersion: c
|
|
1833
1833
|
});
|
|
@@ -1836,10 +1836,10 @@ function Ha(t) {
|
|
|
1836
1836
|
requestId: a,
|
|
1837
1837
|
operation: "insertCard",
|
|
1838
1838
|
affectedCardIds: [s.block.id],
|
|
1839
|
-
snapshotVersion:
|
|
1839
|
+
snapshotVersion: g.version,
|
|
1840
1840
|
data: {
|
|
1841
1841
|
card: s.block,
|
|
1842
|
-
snapshot:
|
|
1842
|
+
snapshot: g
|
|
1843
1843
|
}
|
|
1844
1844
|
};
|
|
1845
1845
|
}
|
|
@@ -1848,7 +1848,7 @@ function Ha(t) {
|
|
|
1848
1848
|
version: n.version + 1,
|
|
1849
1849
|
layoutVersion: 3,
|
|
1850
1850
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1851
|
-
blocks:
|
|
1851
|
+
blocks: qt([...n.blocks, s.block])
|
|
1852
1852
|
}, r = await t.commitSnapshot(d, {
|
|
1853
1853
|
...e.persistence || {},
|
|
1854
1854
|
baseSnapshotVersion: c
|
|
@@ -1867,13 +1867,13 @@ function Ha(t) {
|
|
|
1867
1867
|
},
|
|
1868
1868
|
async updateCard(e) {
|
|
1869
1869
|
var o;
|
|
1870
|
-
const a =
|
|
1870
|
+
const a = Ct(e.requestId), n = t.getSnapshot(), i = bt(n, "updateCard", a);
|
|
1871
1871
|
if (i || !n) return i;
|
|
1872
1872
|
const s = n.version, c = await Gt(n, e);
|
|
1873
1873
|
if (c.status !== "success" || !c.snapshot)
|
|
1874
|
-
return
|
|
1874
|
+
return $("updateCard", a, c.error || {
|
|
1875
1875
|
code: "UNSUPPORTED_OPERATION",
|
|
1876
|
-
message: "
|
|
1876
|
+
message: u("FWA.68701787571066464"),
|
|
1877
1877
|
details: c
|
|
1878
1878
|
});
|
|
1879
1879
|
c.locatedCardId && ((o = t.locateCard) == null || o.call(t, c.locatedCardId));
|
|
@@ -1898,35 +1898,35 @@ function Ha(t) {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
export {
|
|
1900
1900
|
Sa as A,
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1901
|
+
Oa as B,
|
|
1902
|
+
Aa as C,
|
|
1903
|
+
w as D,
|
|
1904
|
+
ga as R,
|
|
1905
|
+
X as W,
|
|
1906
1906
|
Ma as a,
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1907
|
+
Lt as b,
|
|
1908
|
+
Ta as c,
|
|
1909
|
+
xa as d,
|
|
1910
|
+
Yt as e,
|
|
1911
|
+
ta as f,
|
|
1912
|
+
Na as g,
|
|
1913
1913
|
Dt as h,
|
|
1914
|
-
|
|
1915
|
-
|
|
1914
|
+
j as i,
|
|
1915
|
+
Ia as j,
|
|
1916
1916
|
S as k,
|
|
1917
|
-
|
|
1918
|
-
|
|
1917
|
+
wa as l,
|
|
1918
|
+
Ha as m,
|
|
1919
1919
|
kt as n,
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1920
|
+
Ra as o,
|
|
1921
|
+
Ut as p,
|
|
1922
|
+
Fa as q,
|
|
1923
|
+
Ea as r,
|
|
1924
|
+
mt as s,
|
|
1925
|
+
va as t,
|
|
1926
|
+
Wa as u,
|
|
1927
|
+
Ca as v,
|
|
1928
|
+
Ot as w,
|
|
1929
|
+
La as x,
|
|
1930
|
+
ba as y,
|
|
1931
|
+
re as z
|
|
1932
1932
|
};
|