@fses/workbench-app 0.2.21 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WORKBENCH-CLOSURE.json +14 -14
- package/dist/{WorkbenchCardCenterDrawer-BxRFAZDG.js → WorkbenchCardCenterDrawer-BOGnU-yE.js} +2 -2
- package/dist/{WorkbenchDiagnosticsFooter-BXQJLBMu.js → WorkbenchDiagnosticsFooter-DmkrIuSA.js} +1 -1
- package/dist/{WorkbenchDiagnosticsPage-OdYSvQ2O.js → WorkbenchDiagnosticsPage-D8jFQL6N.js} +1 -1
- package/dist/{Workspace-C4Co3cIc.js → Workspace-CLKgeb_a.js} +1024 -1023
- package/dist/{customCardCatalog-D8woQgB9.js → customCardCatalog-BtPqvNq5.js} +1 -1
- package/dist/fses-workbench-app.js +2 -2
- package/dist/{index-C1Y_OWV9.js → index-R9-vwhCW.js} +5 -5
- package/dist/runtime/index.js +1 -1
- package/dist/{useWorkbenchRuntime-CJLqEtgU.js → useWorkbenchRuntime-DqU8RWC9.js} +693 -692
- package/dist/version.d.ts +1 -1
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +2 -4
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +1 -1
- package/node_modules/@fses/ai-chat/package.json +3 -3
- package/node_modules/@fses/workbench-card/package.json +1 -1
- package/package.json +3 -3
|
@@ -1705,8 +1705,8 @@ function iw(e, t, n) {
|
|
|
1705
1705
|
const p = t.slice(m, l), y = [...t.slice(0, m)].reverse().find((W) => o.has(W)), I = t.slice(l).find((W) => o.has(W)), w = y ? o.get(y) ?? -1 : -1, k = I ? o.get(I) ?? e.headers.length : e.headers.length, F = a.filter((W) => W > w && W < k && !d.has(W));
|
|
1706
1706
|
if (F.length < p.length) return;
|
|
1707
1707
|
const D = !y && I ? F.slice(-p.length) : F.slice(0, p.length);
|
|
1708
|
-
p.forEach((W,
|
|
1709
|
-
o.set(W, D[
|
|
1708
|
+
p.forEach((W, V) => {
|
|
1709
|
+
o.set(W, D[V]), d.add(D[V]);
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
1712
|
return o.size === t.length && aw(o, t) ? o : void 0;
|
|
@@ -1785,8 +1785,8 @@ function Kc(e, t, n = "") {
|
|
|
1785
1785
|
const s = Pa(r, a);
|
|
1786
1786
|
if (s.length === 0) return;
|
|
1787
1787
|
const i = Wh(r), o = Oh(r, s), c = lw(n, s, a), d = (c == null ? void 0 : c.labels) || {}, l = Object.fromEntries(tu(r).flatMap((D) => {
|
|
1788
|
-
const W = Ds(D),
|
|
1789
|
-
return W &&
|
|
1788
|
+
const W = Ds(D), V = dr(eu(D), W);
|
|
1789
|
+
return W && V ? [[W, V]] : [];
|
|
1790
1790
|
})), m = s.map((D, W) => ({
|
|
1791
1791
|
key: D,
|
|
1792
1792
|
label: i[D] || d[D] || l[D] || o[D] || D || f("FWA.e3bc1787570894472", { p0: W + 1 })
|
|
@@ -2054,10 +2054,10 @@ function Rw(e, t) {
|
|
|
2054
2054
|
}).map((G) => ({
|
|
2055
2055
|
...G,
|
|
2056
2056
|
...o ? { recommendationOrigin: o } : {}
|
|
2057
|
-
})),
|
|
2057
|
+
})), V = uo(Aw(
|
|
2058
2058
|
D.length > 0 ? D : W
|
|
2059
2059
|
));
|
|
2060
|
-
return
|
|
2060
|
+
return V.length === 0 ? null : {
|
|
2061
2061
|
recommendationId: `${e.id}-card-recommendations`,
|
|
2062
2062
|
prompt: e.userPrompt,
|
|
2063
2063
|
message: D.length === 0 && W.length > 0 ? Gd : ge(n, ["message"]) || t.summary || f("FWA.5f711787570954225"),
|
|
@@ -2075,7 +2075,7 @@ function Rw(e, t) {
|
|
|
2075
2075
|
...r ? { queryResult: r } : {},
|
|
2076
2076
|
...d ? { echartsCoverage: d } : {},
|
|
2077
2077
|
...l ? { registryCoverage: l } : {},
|
|
2078
|
-
recommendations:
|
|
2078
|
+
recommendations: V
|
|
2079
2079
|
};
|
|
2080
2080
|
}
|
|
2081
2081
|
function _w(e, t, n) {
|
|
@@ -3582,13 +3582,13 @@ function dC(e) {
|
|
|
3582
3582
|
].filter((a) => !!(a.resultId || a.sourceTurnId));
|
|
3583
3583
|
}
|
|
3584
3584
|
function Cp(e) {
|
|
3585
|
-
var
|
|
3585
|
+
var V;
|
|
3586
3586
|
if (e.recommendationOrigin === "deep_agent_transcript" && cC(e.payload))
|
|
3587
3587
|
return null;
|
|
3588
3588
|
const t = cu(e.payload);
|
|
3589
3589
|
if (t.kind !== "workbench_card_recommendation") return null;
|
|
3590
3590
|
const n = vn(t.publicPayload), r = ot(n.queryResult) ? n.queryResult : void 0, a = Nr(r), s = uo(zc(n.recommendations).map((G) => {
|
|
3591
|
-
const
|
|
3591
|
+
const J = ot(G.queryResult) ? G.queryResult : void 0, q = Nr(J) ?? a, ce = Qd({
|
|
3592
3592
|
...G,
|
|
3593
3593
|
...q ? { queryResult: q } : {}
|
|
3594
3594
|
});
|
|
@@ -3606,7 +3606,7 @@ function Cp(e) {
|
|
|
3606
3606
|
});
|
|
3607
3607
|
})), i = [
|
|
3608
3608
|
...$c({ queryResult: n.queryResult }),
|
|
3609
|
-
...zc(n.recommendations).flatMap((G,
|
|
3609
|
+
...zc(n.recommendations).flatMap((G, J) => $c(G, `recommendations[${J}].`))
|
|
3610
3610
|
];
|
|
3611
3611
|
if (e.recommendationOrigin === "deep_agent_transcript" && i.length > 0) {
|
|
3612
3612
|
const G = ot(r == null ? void 0 : r.metadata) ? r.metadata : {};
|
|
@@ -3625,7 +3625,7 @@ function Cp(e) {
|
|
|
3625
3625
|
placementTurnId: e.turnId,
|
|
3626
3626
|
message: ve(n.message) || ve(t.summary) || f("FWA.b9041787570682551"),
|
|
3627
3627
|
recommendations: s
|
|
3628
|
-
}, l = ve(n.conversationId) || ve(e.conversationId), m = Ap(n.source), p = ve(n.sourceTurnId) || ve(r == null ? void 0 : r.sourceTurnId) || ve(vn(r == null ? void 0 : r.metadata).sourceTurnId) || ve((
|
|
3628
|
+
}, l = ve(n.conversationId) || ve(e.conversationId), m = Ap(n.source), p = ve(n.sourceTurnId) || ve(r == null ? void 0 : r.sourceTurnId) || ve(vn(r == null ? void 0 : r.metadata).sourceTurnId) || ve((V = s.find((G) => ve(G.sourceTurnId))) == null ? void 0 : V.sourceTurnId) || ve(e.sourceTurnId), y = Za(n.totalRecommendationCount), I = Za(n.eligibleCandidateCount), w = Za(n.returnedCandidateCount), k = Za(n.readyCandidateCount), F = Za(n.diagnosticCandidateCount), D = Array.isArray(n.chartFamilyCoverage) ? n.chartFamilyCoverage.filter((G) => typeof G == "string") : void 0, W = ot(n.projectionFamilyCoverage) ? n.projectionFamilyCoverage : void 0;
|
|
3629
3629
|
return l && (d.conversationId = l), e.recommendationOrigin && (d.recommendationOrigin = e.recommendationOrigin), m && (d.source = m), p && (d.sourceTurnId = p), typeof n.exhausted == "boolean" && (d.exhausted = n.exhausted), y && (d.totalRecommendationCount = y), I && (d.eligibleCandidateCount = I), w && (d.returnedCandidateCount = w), k && (d.readyCandidateCount = k), F && (d.diagnosticCandidateCount = F), D && (d.chartFamilyCoverage = D), W && (d.projectionFamilyCoverage = W), a && (d.queryResult = a), o && (d.echartsCoverage = o), c && (d.registryCoverage = c), d;
|
|
3630
3630
|
}
|
|
3631
3631
|
function bp(e) {
|
|
@@ -3648,8 +3648,8 @@ function bp(e) {
|
|
|
3648
3648
|
...D ? { queryResult: D } : {}
|
|
3649
3649
|
});
|
|
3650
3650
|
c && (o.conversationId = c), d && (o.source = d), l && (o.sourceTurnId = l), m && (o.question = m), p && (o.userInstruction = p), y && (o.reason = y), typeof r.confidence == "number" && (o.confidence = r.confidence), I && (o.dataShape = I), w && (o.cardConfig = w), k && (o.selectedConfig = k), W && (o.dataBinding = W), D && (o.queryResult = D);
|
|
3651
|
-
const
|
|
3652
|
-
return
|
|
3651
|
+
const V = ve(n.message) || ve(t.summary);
|
|
3652
|
+
return V && (o.message = V), o;
|
|
3653
3653
|
}
|
|
3654
3654
|
const uC = /* @__PURE__ */ new Set([
|
|
3655
3655
|
"not_attempted",
|
|
@@ -5283,7 +5283,7 @@ const K = co, $t = 999, of = {
|
|
|
5283
5283
|
}, ac = {
|
|
5284
5284
|
minRows: 1,
|
|
5285
5285
|
maxRows: $t
|
|
5286
|
-
}, Bp = 2, V1 = 0.82, Ss = 0.5, Oi = 0.5, kr = 1, Ep = 2, sc = 8, Wp = 13, H1 = 13, ic = 21, Op = 8, oc = Op, cc = 13, K1 = 32, dc = 38, Lp = 56, Ws = 63, cn = 30, j1 = 72, uc = 42, Np = 42, G1 = 6, z1 = 8, U1 = 5, Y1 = 24, cf = 6, Q1 = 4, lc = 10, J1 = 10, X1 = 4, Z1 = 42, eb = 18, tb = 38, nb = Ws, qp = 180, rb = 24, ab = 5, Xc =
|
|
5286
|
+
}, Bp = 2, V1 = 0.82, Ss = 0.5, Oi = 0.5, kr = 1, Ep = 2, sc = 8, Wp = 13, H1 = 13, ic = 21, Op = 8, oc = Op, cc = 13, K1 = 32, dc = 38, Lp = 56, Ws = 63, cn = 30, j1 = 72, uc = 42, Np = 42, G1 = 6, z1 = 8, U1 = 5, Y1 = 24, cf = 6, Q1 = 4, lc = 10, J1 = 10, X1 = 4, Z1 = 42, eb = 18, tb = 38, nb = Ws, qp = 180, rb = 24, ab = 5, Xc = Y(ab * K / rb), sb = /风险总览|风险概览|顶部风险|集团经营健康|经营健康综合得分|重大经营风险|预算严重偏差|资金类预警|项目隐患|GLOBAL RISK POSTURE|risk posture|today movement|business risk|capital alert|budget deviation/i, $p = /安全风险总览|安全风险概览|security risk/i, Vp = /经营健康|重大经营风险|预算严重偏差|资金类预警|项目隐患|TODAY MOVEMENT|GLOBAL RISK POSTURE|risk posture|business risk|capital alert|budget deviation/i, Hp = /董事长|高管|集团经营健康综合得分|GLOBAL RISK POSTURE|TODAY MOVEMENT|重大经营风险|预算严重偏差|资金类预警|风险全景下钻|亏损主体|组织隐患|利润底线|财务资金风险|风险红线|重大投资风险|战略投资追加|chairman|executive|risk posture/i, Kp = /经营健康|综合得分|health score|health/i, jp = /重大经营风险|经营风险|operating risks?|business risk/i, Gp = /预算严重偏差|预算偏差|budget/i, zp = /资金类预警|资金预警|capital|fund/i, Up = /项目隐患|项目风险|project hidden|hidden risks?/i, Yp = /TODAY MOVEMENT|今日异动|风险异动|经营异动|movement/i, Qp = /\b(CIO|IT)\b|信息化中心|IT\s*年度|IT\s*项目|IT\s*采购|IT\s*成本|IT\s*资产|系统上线审批|权限变更审批|安全整改待办|运维|研发|基础设施|服务监控|资源负载|机房|服务器|云主机|终端|License|软件|硬件|账号|权限|漏洞|攻击|网络安全|信息安全|安全事件|等保|堡垒机|服务工单|数据库|接口|中台|ERP|MES|WMS|SCM|CRM|ops|infrastructure|software|system|cyber|service desk/i, Jp = /statusList|resourceBars|incidentList|securityScore|infrastructure|operations|ops|service monitor|incident center|resource bars|security score|compliance audit|基础设施|运维稳定|稳定性|全局服务监控|服务监控|故障|告警|近七日故障|资源负载|CPU|内存|存储|带宽|信息安全|合规治理|安全风险|安全健康|安全健康分|敏感数据|数据导出|弱口令|账号|权限|审计|等保|隐私合规|日志留存|漏洞|攻击/i, ib = /\u57fa\u7840\u8bbe\u65bd|\u8fd0\u7ef4\u7a33\u5b9a|\u7a33\u5b9a\u6027|\u5168\u5c40\u670d\u52a1\u76d1\u63a7|\u670d\u52a1\u76d1\u63a7|\u8d44\u6e90\u8d1f\u8f7d|\u4fe1\u606f\u5b89\u5168|\u5408\u89c4\u6cbb\u7406|\u5b89\u5168\u98ce\u9669|\u5b89\u5168\u5065\u5eb7|infrastructure|operations|ops|information security|compliance|security score/i, ob = /\u6a21\u5757\u6807\u9898\u680f|title\s*bar|section\s*title/i, Xp = /\u9876\u90e8\u5bfc\u822a|\u5de5\u4f5c\u53f0\u9876\u90e8|\u4e13\u5c5e\u5de5\u4f5c\u53f0|\u5bfc\u822a\u680f|page\s*header|header\s*banner|dashboard\s*header/i, cb = /营销|销售|客户|渠道|投放|业绩|市场|竞品|活动|线索|转化|复购|回款|ROI|CAC|声量|曝光|推广|campaign|sales|marketing|customer|channel|funnel|conversion/i, hu = /人力|人事|人才|用工|劳动|社保|合同|考勤|加班|迟到|旷工|请假|薪酬|绩效|招聘|员工|组织|编制|司龄|任免|继任|培训|持证|人效|流失|超编|合规管控|用工合规|HR|CHRO|human resources|workforce|staffing|headcount/i, db = /快捷入口|快速入口|入口导航|常用入口|蹇嵎鍏ュ彛|蹇€熷叆鍙鍏ュ彛瀵艰埅|甯哥敤鍏ュ彛|quick\s*links?|quick\s*entry/i, ub = /战略\s*KPI|KPI\s*看板|战略KPI看板|经营KPI|核心指标看板|目标完成率|营业收入|strategy\s*kpi|business\s*kpi/i, Zp = /预警|风险|现金流|逾期|库存|投诉|warning|risk|cash\s*flow|overdue|inventory|complaint/i, lb = /现金流|逾期账款|逾期|库存|投诉率|投诉|cash\s*flow|overdue|inventory|complaint/i;
|
|
5287
5287
|
function v(e) {
|
|
5288
5288
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
5289
5289
|
}
|
|
@@ -5514,7 +5514,7 @@ function eg(e) {
|
|
|
5514
5514
|
if (!Number.isFinite(y) || !m.every((q) => Math.abs(se(v(q.layout).y, y) - y) <= Xc + 1)) return e;
|
|
5515
5515
|
const w = new Set(t.map((q) => M(q.id)).filter(Boolean)), k = m.filter((q) => w.has(M(q.id))), F = Cb(n, k);
|
|
5516
5516
|
if (F.filter((q) => Vp.test(yo(q))).length < 5) return e;
|
|
5517
|
-
const D = v(n.data), W = v(n.meta),
|
|
5517
|
+
const D = v(n.data), W = v(n.meta), V = v(W.visual), G = {
|
|
5518
5518
|
...n,
|
|
5519
5519
|
id: M(n.id) || "persisted-risk-summary-band",
|
|
5520
5520
|
title: f("FWA.b1341787571343646"),
|
|
@@ -5533,17 +5533,17 @@ function eg(e) {
|
|
|
5533
5533
|
dataShape: "customCanvas",
|
|
5534
5534
|
composeSource: "image",
|
|
5535
5535
|
visual: {
|
|
5536
|
-
|
|
5536
|
+
...V,
|
|
5537
5537
|
businessSummaryBand: "risk",
|
|
5538
|
-
backgroundColor: M(
|
|
5539
|
-
textColor: M(
|
|
5540
|
-
borderColor: M(
|
|
5541
|
-
cardShadow: M(
|
|
5542
|
-
density: M(
|
|
5538
|
+
backgroundColor: M(V.backgroundColor) || "#172235",
|
|
5539
|
+
textColor: M(V.textColor) || "#F8FAFC",
|
|
5540
|
+
borderColor: M(V.borderColor) || "#172235",
|
|
5541
|
+
cardShadow: M(V.cardShadow) || "none",
|
|
5542
|
+
density: M(V.density) || "compact"
|
|
5543
5543
|
}
|
|
5544
5544
|
}
|
|
5545
|
-
},
|
|
5546
|
-
return e.filter((q) => !
|
|
5545
|
+
}, J = new Set(k.map((q) => M(q.id)).filter((q) => q && q !== M(n.id)));
|
|
5546
|
+
return e.filter((q) => !J.has(M(q.id))).map((q) => M(q.id) === M(n.id) ? G : q);
|
|
5547
5547
|
}
|
|
5548
5548
|
function DB(e) {
|
|
5549
5549
|
return bu(
|
|
@@ -5555,10 +5555,10 @@ function pu(e) {
|
|
|
5555
5555
|
if (!Number.isFinite(a) || !Number.isFinite(s) || a <= 0 || s <= 0) return;
|
|
5556
5556
|
const i = se(t.x, Number.NaN), o = se(t.y, Number.NaN);
|
|
5557
5557
|
return {
|
|
5558
|
-
x: Number.isFinite(i) ?
|
|
5559
|
-
y: Number.isFinite(o) ?
|
|
5560
|
-
w:
|
|
5561
|
-
h:
|
|
5558
|
+
x: Number.isFinite(i) ? Y(i * r) : 0,
|
|
5559
|
+
y: Number.isFinite(o) ? Y(o) : 0,
|
|
5560
|
+
w: Y(a * r),
|
|
5561
|
+
h: Y(s)
|
|
5562
5562
|
};
|
|
5563
5563
|
}
|
|
5564
5564
|
function gu(e, t) {
|
|
@@ -5589,7 +5589,7 @@ function vb(e, t) {
|
|
|
5589
5589
|
}), a = r.reduce((m, p) => m + p, 0), s = n > 1 || a > K * 0.72, i = e.map((m) => {
|
|
5590
5590
|
var p;
|
|
5591
5591
|
return As(m.block) ? Math.max(10, Math.min(10, m.block.layout.h)) : (p = m.basis) == null ? void 0 : p.h;
|
|
5592
|
-
}).filter((m) => m !== void 0 && Number.isFinite(m) && m > 0), o = i.length > 0 ? wi(i) : void 0, c =
|
|
5592
|
+
}).filter((m) => m !== void 0 && Number.isFinite(m) && m > 0), o = i.length > 0 ? wi(i) : void 0, c = Y(Math.max(
|
|
5593
5593
|
1,
|
|
5594
5594
|
...e.map((m) => {
|
|
5595
5595
|
var p;
|
|
@@ -5599,15 +5599,15 @@ function vb(e, t) {
|
|
|
5599
5599
|
let d = 0;
|
|
5600
5600
|
return { layouts: e.slice().sort((m, p) => m.order - p.order || m.index - p.index).map((m, p) => {
|
|
5601
5601
|
var k;
|
|
5602
|
-
const y = n - p, I = s ?
|
|
5602
|
+
const y = n - p, I = s ? Y(p === n - 1 ? K - d : K / n) : Math.min(K, r[p] ?? m.block.layout.w), w = gu(M(m.block.id, `image-fallback-${m.order}`), {
|
|
5603
5603
|
...m.block.layout,
|
|
5604
5604
|
x: s ? d : fe(((k = m.basis) == null ? void 0 : k.x) ?? m.block.layout.x, 0, Math.max(0, K - I)),
|
|
5605
5605
|
y: t,
|
|
5606
5606
|
w: Math.max(1, I || K / y),
|
|
5607
5607
|
h: c
|
|
5608
5608
|
});
|
|
5609
|
-
return d =
|
|
5610
|
-
}), nextY:
|
|
5609
|
+
return d = Y(d + w.w), { index: m.index, layout: w };
|
|
5610
|
+
}), nextY: Y(t + c) };
|
|
5611
5611
|
}
|
|
5612
5612
|
function Rb(e) {
|
|
5613
5613
|
const t = [];
|
|
@@ -5698,7 +5698,7 @@ function tg(e) {
|
|
|
5698
5698
|
function xb(e) {
|
|
5699
5699
|
const t = Ea(e);
|
|
5700
5700
|
if (!t) return;
|
|
5701
|
-
const n = M(e.id, "image-source-anchor"), r =
|
|
5701
|
+
const n = M(e.id, "image-source-anchor"), r = Y(t.x / 1920 * K), a = Y(t.y / 1920 * K), s = Y(t.width / 1920 * K), i = Y(t.height / 1920 * K), o = se(e.layout.w, Number.NaN), c = se(e.layout.h, Number.NaN), d = fe(Number.isFinite(o) && o > 0 ? o : s, 1, K), l = fe(Number.isFinite(c) && c > 0 ? c : Math.max(1, i), 1, $t);
|
|
5702
5702
|
return gu(n, {
|
|
5703
5703
|
...e.layout,
|
|
5704
5704
|
x: fe(r, 0, Math.max(0, K - d)),
|
|
@@ -5746,7 +5746,7 @@ function Db(e) {
|
|
|
5746
5746
|
const w = o.get(e.indexOf(p)) || p.layout;
|
|
5747
5747
|
return Math.max(m, se(w.y) + Math.max(1, se(w.h, 1)));
|
|
5748
5748
|
}, 0);
|
|
5749
|
-
let d =
|
|
5749
|
+
let d = Y(c);
|
|
5750
5750
|
return s.forEach((m, p) => {
|
|
5751
5751
|
if (m.entries.length === 0) return;
|
|
5752
5752
|
(p === s.length - 1 ? Rb(m.entries) : [m.entries]).forEach((I) => {
|
|
@@ -5776,10 +5776,10 @@ function PB(e) {
|
|
|
5776
5776
|
l.push(y), p += 1;
|
|
5777
5777
|
continue;
|
|
5778
5778
|
}
|
|
5779
|
-
const I =
|
|
5779
|
+
const I = Y(y.layout.y), w = [];
|
|
5780
5780
|
for (; p < i.length && de(i[p]) && !Xt(i[p]) && bR(I, w, i[p]); )
|
|
5781
5781
|
w.push(i[p]), p += 1;
|
|
5782
|
-
const k = w.map((It) => It.layout), F = Dg(w), D = !F && k.some((It) => !!bs(It, m)), W = gg(w, k, o),
|
|
5782
|
+
const k = w.map((It) => It.layout), F = Dg(w), D = !F && k.some((It) => !!bs(It, m)), W = gg(w, k, o), V = !!W, G = w.length === 1 ? ig(k[0], m, d, w[0]) : void 0, J = G && G !== k[0] ? [G] : void 0, q = W || J || Bg(
|
|
5783
5783
|
Eg(k, c, D ? void 0 : w),
|
|
5784
5784
|
k,
|
|
5785
5785
|
F ? [] : m
|
|
@@ -5787,7 +5787,7 @@ function PB(e) {
|
|
|
5787
5787
|
const Dn = [...Kt, ...It], Zs = ln(rn, Dn, K, $t) ? rn : ar(rn, Dn, Be);
|
|
5788
5788
|
return [...It, Zs];
|
|
5789
5789
|
}, []));
|
|
5790
|
-
|
|
5790
|
+
!V && !w.some(rd) && !ad(w) && m.push(...sd(k, na)), l.push(...w.map((It, rn) => DR({
|
|
5791
5791
|
...It,
|
|
5792
5792
|
layout: {
|
|
5793
5793
|
...It.layout,
|
|
@@ -5877,23 +5877,23 @@ function rg(e, t, n) {
|
|
|
5877
5877
|
function ln(e, t, n, r) {
|
|
5878
5878
|
return rg(e, n, r) && t.every((a) => !yu(e, a));
|
|
5879
5879
|
}
|
|
5880
|
-
function
|
|
5880
|
+
function Y(e) {
|
|
5881
5881
|
return Math.round(e * 1e3) / 1e3;
|
|
5882
5882
|
}
|
|
5883
5883
|
function ff(e, t, n, r, a) {
|
|
5884
|
-
const s = se(e, r), i = se(t, a), o =
|
|
5884
|
+
const s = se(e, r), i = se(t, a), o = Y(s * n), c = Y((s + i) * n);
|
|
5885
5885
|
return {
|
|
5886
5886
|
start: o,
|
|
5887
|
-
span: Math.max(0,
|
|
5887
|
+
span: Math.max(0, Y(c - o))
|
|
5888
5888
|
};
|
|
5889
5889
|
}
|
|
5890
5890
|
function Ni(e) {
|
|
5891
|
-
return [...new Set(e.map((t) =>
|
|
5891
|
+
return [...new Set(e.map((t) => Y(t)))].filter((t) => Number.isFinite(t)).sort((t, n) => t - n);
|
|
5892
5892
|
}
|
|
5893
5893
|
function Bb(e) {
|
|
5894
5894
|
const t = /* @__PURE__ */ new Map();
|
|
5895
5895
|
return e.forEach((n) => {
|
|
5896
|
-
const r =
|
|
5896
|
+
const r = Y(n.y);
|
|
5897
5897
|
t.set(r, [...t.get(r) || [], n]);
|
|
5898
5898
|
}), [...t.entries()].map(([n, r]) => ({
|
|
5899
5899
|
y: n,
|
|
@@ -5933,24 +5933,24 @@ function qb(e, t, n, r) {
|
|
|
5933
5933
|
const a = [];
|
|
5934
5934
|
let s = 0, i = t, o = 0;
|
|
5935
5935
|
return e.forEach((c) => {
|
|
5936
|
-
const d = fe(
|
|
5937
|
-
s > 0 && s + d > n && (s = 0, i =
|
|
5938
|
-
const m = fe(
|
|
5936
|
+
const d = fe(Y(c.w), 1, n), l = fe(Y(c.h), 1, r);
|
|
5937
|
+
s > 0 && s + d > n && (s = 0, i = Y(i + o), o = 0);
|
|
5938
|
+
const m = fe(Y(i), 0, Math.max(0, r - l));
|
|
5939
5939
|
a.push({
|
|
5940
5940
|
...c,
|
|
5941
|
-
x:
|
|
5941
|
+
x: Y(s),
|
|
5942
5942
|
y: m,
|
|
5943
5943
|
w: d,
|
|
5944
5944
|
h: l
|
|
5945
|
-
}), s =
|
|
5945
|
+
}), s = Y(s + d), o = Math.max(o, l);
|
|
5946
5946
|
}), a;
|
|
5947
5947
|
}
|
|
5948
5948
|
function Vr(e, t) {
|
|
5949
|
-
const n = K, r = Math.max(t.rows, t.maxRows || Be.maxRows), a = fe(
|
|
5949
|
+
const n = K, r = Math.max(t.rows, t.maxRows || Be.maxRows), a = fe(Y(e.w), 1, n), s = fe(Y(e.h), 1, r);
|
|
5950
5950
|
return {
|
|
5951
5951
|
...e,
|
|
5952
|
-
x: fe(
|
|
5953
|
-
y: fe(
|
|
5952
|
+
x: fe(Y(e.x), 0, Math.max(0, n - a)),
|
|
5953
|
+
y: fe(Y(e.y), 0, Math.max(0, r - s)),
|
|
5954
5954
|
w: a,
|
|
5955
5955
|
h: s
|
|
5956
5956
|
};
|
|
@@ -6021,7 +6021,7 @@ function nd(e, t, n) {
|
|
|
6021
6021
|
const r = n - t;
|
|
6022
6022
|
return e.map((a) => ({
|
|
6023
6023
|
...a,
|
|
6024
|
-
y:
|
|
6024
|
+
y: Y(a.y + r)
|
|
6025
6025
|
}));
|
|
6026
6026
|
}
|
|
6027
6027
|
function sg(e, t, n = [], r) {
|
|
@@ -6033,7 +6033,7 @@ function sg(e, t, n = [], r) {
|
|
|
6033
6033
|
(l) => Math.abs(l.layout.y + l.layout.h - s) <= kr
|
|
6034
6034
|
).some(
|
|
6035
6035
|
(l) => rd(l.block) || Qe(l.block)
|
|
6036
|
-
) ? Oi : 0, c =
|
|
6036
|
+
) ? Oi : 0, c = Y(s + o), d = Math.min(...e.map((l) => l.y));
|
|
6037
6037
|
return e.every((l) => Math.abs(l.y - c) <= kr) ? e : nd(e, d, c);
|
|
6038
6038
|
}
|
|
6039
6039
|
return e.map((a) => {
|
|
@@ -6043,7 +6043,7 @@ function sg(e, t, n = [], r) {
|
|
|
6043
6043
|
(l) => Math.abs(l.layout.y + l.layout.h - i) <= kr
|
|
6044
6044
|
).some(
|
|
6045
6045
|
(l) => rd(l.block) || Qe(l.block)
|
|
6046
|
-
) ? Oi : 0, d =
|
|
6046
|
+
) ? Oi : 0, d = Y(i + c);
|
|
6047
6047
|
return c === 0 && Math.abs(a.y - i) <= kr || c > 0 && a.y >= d && Math.abs(a.y - d) <= kr ? a : {
|
|
6048
6048
|
...a,
|
|
6049
6049
|
y: d
|
|
@@ -6090,8 +6090,8 @@ function Kb(e, t) {
|
|
|
6090
6090
|
if (!(c <= e.w))
|
|
6091
6091
|
return {
|
|
6092
6092
|
...e,
|
|
6093
|
-
x:
|
|
6094
|
-
w:
|
|
6093
|
+
x: Y(i),
|
|
6094
|
+
w: Y(c),
|
|
6095
6095
|
maxW: K
|
|
6096
6096
|
};
|
|
6097
6097
|
}
|
|
@@ -6418,10 +6418,10 @@ function pg(e) {
|
|
|
6418
6418
|
const n = Li(t);
|
|
6419
6419
|
for (let r = 0; r < n.length - 1; r += 1) {
|
|
6420
6420
|
const a = n[r], s = n[r + 1];
|
|
6421
|
-
if (!av(a) || !sv(s) ||
|
|
6421
|
+
if (!av(a) || !sv(s) || Y(a.layout.x) > 1 || !qi(a.layout.y, s.layout) || a.layout.w <= 0 || s.layout.w <= 0) continue;
|
|
6422
6422
|
const i = Math.max(...t.map((I) => I.layout.x + I.layout.w)), o = Math.max(1, i - s.layout.x), c = a.layout.w / Math.max(1, i), d = o / Math.max(1, i);
|
|
6423
6423
|
if (c < 0.12 || c > 0.32 || d < 0.55) continue;
|
|
6424
|
-
const l =
|
|
6424
|
+
const l = Y(fe(a.layout.w / Math.max(1, i) * K, 18, 25)), m = Y(l + Ss), p = Y(K - m);
|
|
6425
6425
|
if (p < K * 0.65) continue;
|
|
6426
6426
|
const y = /* @__PURE__ */ new Set();
|
|
6427
6427
|
if (t.forEach((I) => {
|
|
@@ -6444,7 +6444,7 @@ function pg(e) {
|
|
|
6444
6444
|
}
|
|
6445
6445
|
}
|
|
6446
6446
|
function mf(e, t) {
|
|
6447
|
-
const n = fe((e.x - t.sourceMainX) / Math.max(1, t.sourceMainW), 0, 1), r = fe((e.x + e.w - t.sourceMainX) / Math.max(1, t.sourceMainW), n, 1), a =
|
|
6447
|
+
const n = fe((e.x - t.sourceMainX) / Math.max(1, t.sourceMainW), 0, 1), r = fe((e.x + e.w - t.sourceMainX) / Math.max(1, t.sourceMainW), n, 1), a = Y(t.displayMainX + n * t.displayMainW), s = Y(t.displayMainX + r * t.displayMainW), i = Math.max(1, Y(s - a));
|
|
6448
6448
|
return {
|
|
6449
6449
|
...e,
|
|
6450
6450
|
x: fe(a, t.displayMainX, Math.max(t.displayMainX, K - i)),
|
|
@@ -6465,18 +6465,18 @@ function gg(e, t, n) {
|
|
|
6465
6465
|
x: 0,
|
|
6466
6466
|
y: o,
|
|
6467
6467
|
w: n.displaySidebarW,
|
|
6468
|
-
h:
|
|
6469
|
-
minH: Math.max(d.minH || 1,
|
|
6468
|
+
h: Y(c),
|
|
6469
|
+
minH: Math.max(d.minH || 1, Y(c)),
|
|
6470
6470
|
maxW: K
|
|
6471
6471
|
} : m === n.mainId ? {
|
|
6472
6472
|
...d,
|
|
6473
6473
|
x: n.displayMainX,
|
|
6474
6474
|
y: o,
|
|
6475
6475
|
w: n.displayMainW,
|
|
6476
|
-
h:
|
|
6477
|
-
minH: Math.max(d.minH || 1,
|
|
6476
|
+
h: Y(c),
|
|
6477
|
+
minH: Math.max(d.minH || 1, Y(c)),
|
|
6478
6478
|
maxW: K
|
|
6479
|
-
} : mf({ ...d, y: o, h:
|
|
6479
|
+
} : mf({ ...d, y: o, h: Y(c) }, n);
|
|
6480
6480
|
});
|
|
6481
6481
|
}
|
|
6482
6482
|
if (!e.map((o, c) => {
|
|
@@ -6974,13 +6974,13 @@ function Ov(e, t) {
|
|
|
6974
6974
|
});
|
|
6975
6975
|
}
|
|
6976
6976
|
function Lv(e, t, n, r) {
|
|
6977
|
-
const a = Mg(v(e.layout), t), s = le(a.x) ?? 0, i = le(a.y) ?? Math.max(0, t.layout.h - 4), o = Math.max(1, le(a.w) ?? t.layout.w), c = Math.max(2, le(a.h) ?? 3), d = Math.max(1, r), l = Math.max(2,
|
|
6977
|
+
const a = Mg(v(e.layout), t), s = le(a.x) ?? 0, i = le(a.y) ?? Math.max(0, t.layout.h - 4), o = Math.max(1, le(a.w) ?? t.layout.w), c = Math.max(2, le(a.h) ?? 3), d = Math.max(1, r), l = Math.max(2, Y(o / d)), m = Y(s + l * n), p = Math.max(2, Y(s + o - m));
|
|
6978
6978
|
return {
|
|
6979
6979
|
i: `${M(e.id, "strategy-kpi-risk-strip")}-risk-${n + 1}`,
|
|
6980
6980
|
x: m,
|
|
6981
|
-
y: Math.max(0,
|
|
6981
|
+
y: Math.max(0, Y(i)),
|
|
6982
6982
|
w: Math.min(l, p),
|
|
6983
|
-
h: Math.max(2,
|
|
6983
|
+
h: Math.max(2, Y(c)),
|
|
6984
6984
|
slot: "body"
|
|
6985
6985
|
};
|
|
6986
6986
|
}
|
|
@@ -7121,10 +7121,10 @@ function Qv(e, t) {
|
|
|
7121
7121
|
}
|
|
7122
7122
|
}, o), m = i ? {
|
|
7123
7123
|
i: n,
|
|
7124
|
-
x:
|
|
7125
|
-
y:
|
|
7126
|
-
w:
|
|
7127
|
-
h:
|
|
7124
|
+
x: Y(i.x / 1920 * K),
|
|
7125
|
+
y: Y(i.y / 1920 * K),
|
|
7126
|
+
w: Y(i.w / 1920 * K),
|
|
7127
|
+
h: Y(i.h / 1920 * K),
|
|
7128
7128
|
minW: 1,
|
|
7129
7129
|
minH: 1,
|
|
7130
7130
|
maxW: K,
|
|
@@ -7177,7 +7177,7 @@ function Jv(e) {
|
|
|
7177
7177
|
), y = p.findIndex((w) => w.index === d.index) + 1;
|
|
7178
7178
|
let I = 0;
|
|
7179
7179
|
l && m ? I = l.box.x + (m.box.x - l.box.x) * y / (p.length + 1) : l ? I = l.box.x + (a + o) * y : m && (I = m.box.x - (a + o) * (p.length - y + 1)), c.set(d.index, {
|
|
7180
|
-
x:
|
|
7180
|
+
x: Y(fe(I, 0, Math.max(0, i - a))),
|
|
7181
7181
|
y: r,
|
|
7182
7182
|
w: a,
|
|
7183
7183
|
h: s
|
|
@@ -7254,10 +7254,10 @@ function _g(e, t) {
|
|
|
7254
7254
|
layout: {
|
|
7255
7255
|
...e.layout,
|
|
7256
7256
|
i: s,
|
|
7257
|
-
x:
|
|
7258
|
-
y:
|
|
7259
|
-
w:
|
|
7260
|
-
h:
|
|
7257
|
+
x: Y(t.x / 1920 * K),
|
|
7258
|
+
y: Y(t.y / 1920 * K),
|
|
7259
|
+
w: Y(t.w / 1920 * K),
|
|
7260
|
+
h: Y(t.h / 1920 * K),
|
|
7261
7261
|
minW: 1,
|
|
7262
7262
|
minH: 1,
|
|
7263
7263
|
maxW: K,
|
|
@@ -7436,7 +7436,7 @@ function dR(e) {
|
|
|
7436
7436
|
};
|
|
7437
7437
|
}
|
|
7438
7438
|
function If(e, t, n, r) {
|
|
7439
|
-
return e >= n && e + t <= n + r + 1e-3 ?
|
|
7439
|
+
return e >= n && e + t <= n + r + 1e-3 ? Y(e - n) : e;
|
|
7440
7440
|
}
|
|
7441
7441
|
function le(e) {
|
|
7442
7442
|
const t = Number(e);
|
|
@@ -7591,8 +7591,8 @@ function yR(e, t) {
|
|
|
7591
7591
|
x: l === 0 ? 0 : i,
|
|
7592
7592
|
y: a,
|
|
7593
7593
|
w: i,
|
|
7594
|
-
h:
|
|
7595
|
-
minH: Math.max(d.layout.minH || 1,
|
|
7594
|
+
h: Y(s),
|
|
7595
|
+
minH: Math.max(d.layout.minH || 1, Y(s)),
|
|
7596
7596
|
maxW: K
|
|
7597
7597
|
});
|
|
7598
7598
|
}), e.map((d, l) => c.get(l) || d);
|
|
@@ -7612,8 +7612,8 @@ function IR(e, t, n = {}) {
|
|
|
7612
7612
|
const k = m[w];
|
|
7613
7613
|
y.set(I.i, {
|
|
7614
7614
|
...I,
|
|
7615
|
-
x:
|
|
7616
|
-
w:
|
|
7615
|
+
x: Y(p),
|
|
7616
|
+
w: Y(k),
|
|
7617
7617
|
maxW: K
|
|
7618
7618
|
}), p += k + c;
|
|
7619
7619
|
}), e.map((I) => y.get(I.i) || I);
|
|
@@ -7650,8 +7650,8 @@ function Bg(e, t, n) {
|
|
|
7650
7650
|
const s = t[a] || r, i = bs(s, n);
|
|
7651
7651
|
return i ? {
|
|
7652
7652
|
...r,
|
|
7653
|
-
x:
|
|
7654
|
-
w:
|
|
7653
|
+
x: Y(i.x),
|
|
7654
|
+
w: Y(i.w),
|
|
7655
7655
|
maxW: K
|
|
7656
7656
|
} : r;
|
|
7657
7657
|
});
|
|
@@ -7683,14 +7683,14 @@ function CR(e, t) {
|
|
|
7683
7683
|
return c.length === 0 ? !1 : c.reduce((l, m) => m.start > l.cursor ? { cursor: m.end, width: l.width + m.end - m.start } : m.end > l.cursor ? { cursor: m.end, width: l.width + m.end - l.cursor } : l, { cursor: c[0].start, width: 0 }).width / o <= 0.45;
|
|
7684
7684
|
}
|
|
7685
7685
|
function qi(e, t) {
|
|
7686
|
-
return Math.abs(
|
|
7686
|
+
return Math.abs(Y(t.y) - e) <= kr;
|
|
7687
7687
|
}
|
|
7688
7688
|
function bR(e, t, n) {
|
|
7689
|
-
return qi(e, n.layout) ? !0 : vR(t, n) ? Math.abs(
|
|
7689
|
+
return qi(e, n.layout) ? !0 : vR(t, n) ? Math.abs(Y(n.layout.y) - e) <= Ep : !1;
|
|
7690
7690
|
}
|
|
7691
7691
|
function vR(e, t) {
|
|
7692
7692
|
if (e.length === 0 || !fn(t) || !e.every((m) => fn(m))) return !1;
|
|
7693
|
-
const n = [...e.map((m) => m.layout), t.layout].sort((m, p) => m.x - p.x), r = n.map((m) => Math.max(1, m.h)), a = r.slice().sort((m, p) => m - p)[Math.floor(r.length / 2)] ?? 1, s = n.map((m) =>
|
|
7693
|
+
const n = [...e.map((m) => m.layout), t.layout].sort((m, p) => m.x - p.x), r = n.map((m) => Math.max(1, m.h)), a = r.slice().sort((m, p) => m - p)[Math.floor(r.length / 2)] ?? 1, s = n.map((m) => Y(m.y));
|
|
7694
7694
|
if (Math.max(...s) - Math.min(...s) > Ep || !r.every((m) => Math.abs(m - a) <= Math.max(1, a * 0.2)) || n.some((m, p) => {
|
|
7695
7695
|
const y = n[p - 1];
|
|
7696
7696
|
return !!(y && m.x < y.x + y.w - Ss);
|
|
@@ -7706,11 +7706,11 @@ function Eg(e, t, n) {
|
|
|
7706
7706
|
function RR(e, t) {
|
|
7707
7707
|
if (e.length <= 1) return e;
|
|
7708
7708
|
const n = Math.min(...e.map((s) => s.y)), r = Math.max(...e.map((s) => s.y - n + s.h)), a = _R(t) ? Ws : t != null && t.some(xg) ? Math.min(r, Lp) : Math.min(r, cn);
|
|
7709
|
-
return
|
|
7709
|
+
return Y(r) === Y(a) ? e : e.map((s) => ({
|
|
7710
7710
|
...s,
|
|
7711
7711
|
y: n,
|
|
7712
|
-
h:
|
|
7713
|
-
minH:
|
|
7712
|
+
h: Y(a),
|
|
7713
|
+
minH: Y(a)
|
|
7714
7714
|
}));
|
|
7715
7715
|
}
|
|
7716
7716
|
function Wg(e, t) {
|
|
@@ -7719,8 +7719,8 @@ function Wg(e, t) {
|
|
|
7719
7719
|
return t.every((s) => s.y === n && s.h >= a) ? t : t.map((s) => ({
|
|
7720
7720
|
...s,
|
|
7721
7721
|
y: n,
|
|
7722
|
-
h:
|
|
7723
|
-
minH: Math.max(s.minH || 1,
|
|
7722
|
+
h: Y(a),
|
|
7723
|
+
minH: Math.max(s.minH || 1, Y(a))
|
|
7724
7724
|
}));
|
|
7725
7725
|
}
|
|
7726
7726
|
function _R(e) {
|
|
@@ -7755,8 +7755,8 @@ function id(e) {
|
|
|
7755
7755
|
return e.map((r) => ({
|
|
7756
7756
|
...r,
|
|
7757
7757
|
y: t,
|
|
7758
|
-
h:
|
|
7759
|
-
minH: Math.max(r.minH || 1,
|
|
7758
|
+
h: Y(n),
|
|
7759
|
+
minH: Math.max(r.minH || 1, Y(n))
|
|
7760
7760
|
}));
|
|
7761
7761
|
}
|
|
7762
7762
|
function Lg(e, t) {
|
|
@@ -7814,8 +7814,8 @@ function kR(e, t) {
|
|
|
7814
7814
|
return t.every((i) => i.y === n && i.h >= s) ? t : t.map((i) => ({
|
|
7815
7815
|
...i,
|
|
7816
7816
|
y: n,
|
|
7817
|
-
h:
|
|
7818
|
-
minH: Math.max(i.minH || 1,
|
|
7817
|
+
h: Y(s),
|
|
7818
|
+
minH: Math.max(i.minH || 1, Y(s))
|
|
7819
7819
|
}));
|
|
7820
7820
|
}
|
|
7821
7821
|
function MR(e) {
|
|
@@ -7829,7 +7829,7 @@ function MR(e) {
|
|
|
7829
7829
|
const p = v(m.layout), y = le(p.x), I = le(p.w);
|
|
7830
7830
|
return y === void 0 || I === void 0 ? l : Math.max(l, y + I);
|
|
7831
7831
|
}, 0), d = Math.max(0, o ?? 0, c - i);
|
|
7832
|
-
return d <= 0 ? 0 :
|
|
7832
|
+
return d <= 0 ? 0 : Y(fe(d / s * K, 1, K));
|
|
7833
7833
|
}
|
|
7834
7834
|
function xR(e) {
|
|
7835
7835
|
const t = MR(e);
|
|
@@ -7885,7 +7885,7 @@ function Hg(e, t, n, r = !1) {
|
|
|
7885
7885
|
return nd(e, i, p);
|
|
7886
7886
|
}
|
|
7887
7887
|
function Kg(e) {
|
|
7888
|
-
return new Set(e.map((t) =>
|
|
7888
|
+
return new Set(e.map((t) => Y(t.y))).size > 1;
|
|
7889
7889
|
}
|
|
7890
7890
|
function BR(e, t, n) {
|
|
7891
7891
|
return e.reduce((r, a) => {
|
|
@@ -7917,16 +7917,16 @@ function ER(e, t) {
|
|
|
7917
7917
|
if (r !== K) return;
|
|
7918
7918
|
const a = se(n.w, Number.NaN), s = se(n.h, Number.NaN);
|
|
7919
7919
|
if (!Number.isFinite(a) || !Number.isFinite(s) || a <= 0 || s <= 0) return;
|
|
7920
|
-
const i = K / r, o = se(n.x, Number.NaN), c = se(n.y, Number.NaN), d = v(e.layout), l = K / Math.max(1, Gg({ layout: d, meta: {} }, Be)), m =
|
|
7920
|
+
const i = K / r, o = se(n.x, Number.NaN), c = se(n.y, Number.NaN), d = v(e.layout), l = K / Math.max(1, Gg({ layout: d, meta: {} }, Be)), m = Y(se(d.x, 0) * l), p = Y(se(d.y, 0) * l), y = Number.isFinite(o) ? Y(o * i) : m, I = Number.isFinite(c) ? Y(c) : p;
|
|
7921
7921
|
return Os({
|
|
7922
7922
|
...d,
|
|
7923
7923
|
i: t,
|
|
7924
|
-
x: fe(y, 0, Math.max(0, K -
|
|
7924
|
+
x: fe(y, 0, Math.max(0, K - Y(a * i))),
|
|
7925
7925
|
y: Math.max(0, I),
|
|
7926
|
-
w:
|
|
7927
|
-
h:
|
|
7928
|
-
minW: Math.min(
|
|
7929
|
-
minH: Math.min(
|
|
7926
|
+
w: Y(a * i),
|
|
7927
|
+
h: Y(s),
|
|
7928
|
+
minW: Math.min(Y(a * i), Math.max(1, se(d.minW, 1))),
|
|
7929
|
+
minH: Math.min(Y(s), Math.max(1, se(d.minH, 1))),
|
|
7930
7930
|
maxW: K,
|
|
7931
7931
|
maxH: $t
|
|
7932
7932
|
}, t, Be);
|
|
@@ -7957,8 +7957,8 @@ function Af(e, t = Jt(), n = "block") {
|
|
|
7957
7957
|
y: l.start,
|
|
7958
7958
|
w: d.span,
|
|
7959
7959
|
h: l.span,
|
|
7960
|
-
minW:
|
|
7961
|
-
minH:
|
|
7960
|
+
minW: Y(se(a.minW, 1) * o),
|
|
7961
|
+
minH: Y(se(a.minH, 1) * o),
|
|
7962
7962
|
maxW: K,
|
|
7963
7963
|
maxH: $t
|
|
7964
7964
|
}, r, {
|
|
@@ -7980,42 +7980,42 @@ function WR(e, t, n) {
|
|
|
7980
7980
|
rows: Math.max(t.rows, t.maxRows || Be.maxRows)
|
|
7981
7981
|
}, a = /* @__PURE__ */ new Map(), s = bu(
|
|
7982
7982
|
eg(e)
|
|
7983
|
-
), i = s.filter((W) => !uf(W)).map((W,
|
|
7984
|
-
const G = M(W.id, n()),
|
|
7983
|
+
), i = s.filter((W) => !uf(W)).map((W, V) => {
|
|
7984
|
+
const G = M(W.id, n()), J = og(
|
|
7985
7985
|
ng(Af(W, r, G))
|
|
7986
|
-
), q =
|
|
7986
|
+
), q = J.layout, ce = `${q.x}:${q.y}:${q.w}:${q.h}`, Ee = a.get(ce) || 0;
|
|
7987
7987
|
a.set(ce, Ee + 1);
|
|
7988
7988
|
const lt = Ee > 0 ? Os({ ...q, y: q.y + Ee * q.h }, G, r) : q;
|
|
7989
7989
|
return {
|
|
7990
7990
|
block: {
|
|
7991
|
-
...
|
|
7991
|
+
...J,
|
|
7992
7992
|
layout: lt
|
|
7993
7993
|
},
|
|
7994
|
-
index:
|
|
7994
|
+
index: V
|
|
7995
7995
|
};
|
|
7996
7996
|
}), o = s.filter((W) => uf(W)).map((W) => {
|
|
7997
|
-
const
|
|
7998
|
-
return Af(W, r,
|
|
7999
|
-
}), c = [], d = [], l = i.filter((W) => de(W.block)).map((W) => W.block.layout), m = Math.max(1, ...l.map((W) => W.x + W.w)), p = i.sort((W,
|
|
8000
|
-
const G = v(W.block.layout),
|
|
7997
|
+
const V = M(W.id, n());
|
|
7998
|
+
return Af(W, r, V);
|
|
7999
|
+
}), c = [], d = [], l = i.filter((W) => de(W.block)).map((W) => W.block.layout), m = Math.max(1, ...l.map((W) => W.x + W.w)), p = i.sort((W, V) => {
|
|
8000
|
+
const G = v(W.block.layout), J = v(V.block.layout), q = se(G.y, 0) - se(J.y, 0);
|
|
8001
8001
|
if (q !== 0) return q;
|
|
8002
|
-
const ce = se(G.x, 0) - se(
|
|
8003
|
-
return ce !== 0 ? ce : W.index -
|
|
8002
|
+
const ce = se(G.x, 0) - se(J.x, 0);
|
|
8003
|
+
return ce !== 0 ? ce : W.index - V.index;
|
|
8004
8004
|
}), y = pg(p.map((W) => W.block)), I = p.flatMap((W) => {
|
|
8005
|
-
const
|
|
8006
|
-
return G === void 0 || !de(
|
|
8007
|
-
block:
|
|
8005
|
+
const V = W.block, G = Zt(V);
|
|
8006
|
+
return G === void 0 || !de(V) || Ea(V) ? [] : [{
|
|
8007
|
+
block: V,
|
|
8008
8008
|
index: W.index,
|
|
8009
8009
|
order: G,
|
|
8010
|
-
basis: pu(
|
|
8010
|
+
basis: pu(V)
|
|
8011
8011
|
}];
|
|
8012
8012
|
}), w = tg(I), k = (W) => Xt(W) && !w, F = [];
|
|
8013
8013
|
let D = 0;
|
|
8014
8014
|
for (; D < p.length; ) {
|
|
8015
|
-
const W = p[D],
|
|
8015
|
+
const W = p[D], V = W.block.layout;
|
|
8016
8016
|
if (k(W.block)) {
|
|
8017
8017
|
D += 1;
|
|
8018
|
-
const G = ln(
|
|
8018
|
+
const G = ln(V, c, r.cols, r.maxRows) ? V : ar(V, c, r);
|
|
8019
8019
|
c.push(G), F.push({
|
|
8020
8020
|
...W.block,
|
|
8021
8021
|
layout: G
|
|
@@ -8023,8 +8023,8 @@ function WR(e, t, n) {
|
|
|
8023
8023
|
continue;
|
|
8024
8024
|
}
|
|
8025
8025
|
if (de(W.block)) {
|
|
8026
|
-
const G = D,
|
|
8027
|
-
for (; D < p.length && de(p[D].block) && !k(p[D].block) && qi(
|
|
8026
|
+
const G = D, J = V.y;
|
|
8027
|
+
for (; D < p.length && de(p[D].block) && !k(p[D].block) && qi(Y(J), p[D].block.layout); )
|
|
8028
8028
|
D += 1;
|
|
8029
8029
|
const q = p.slice(G, D), ce = q.map((ke) => ke.block.layout), Ee = Dg(q.map((ke) => ke.block)), lt = !Ee && ce.some((ke) => !!bs(ke, d)), ft = gg(
|
|
8030
8030
|
q.map((ke) => ke.block),
|
|
@@ -8074,7 +8074,7 @@ function WR(e, t, n) {
|
|
|
8074
8074
|
}
|
|
8075
8075
|
D += 1;
|
|
8076
8076
|
{
|
|
8077
|
-
const G = ln(
|
|
8077
|
+
const G = ln(V, c, r.cols, r.maxRows) ? V : ar(V, c, r);
|
|
8078
8078
|
c.push(G), F.push({
|
|
8079
8079
|
...W.block,
|
|
8080
8080
|
layout: G
|
|
@@ -8308,7 +8308,7 @@ function HR(e, t, n) {
|
|
|
8308
8308
|
status: e.layoutDraft.status
|
|
8309
8309
|
}
|
|
8310
8310
|
})), (((m = (l = e.planResult) == null ? void 0 : l.cardPlan) == null ? void 0 : m.blocks) || ((p = e.planResult) == null ? void 0 : p.blockPlans) || []).forEach((k, F) => {
|
|
8311
|
-
var W,
|
|
8311
|
+
var W, V;
|
|
8312
8312
|
const D = F + 1;
|
|
8313
8313
|
o.push(Sn({
|
|
8314
8314
|
artifactId: `${e.id}:card-plan:${k.id}`,
|
|
@@ -8325,7 +8325,7 @@ function HR(e, t, n) {
|
|
|
8325
8325
|
lightweightPayload: {
|
|
8326
8326
|
block: Ci(k),
|
|
8327
8327
|
blockId: k.id,
|
|
8328
|
-
sourceDraftId: ((W = e.previewDraft) == null ? void 0 : W.draftId) || ((
|
|
8328
|
+
sourceDraftId: ((W = e.previewDraft) == null ? void 0 : W.draftId) || ((V = e.layoutDraft) == null ? void 0 : V.draftId)
|
|
8329
8329
|
}
|
|
8330
8330
|
}));
|
|
8331
8331
|
}), e.previewDraft) {
|
|
@@ -8361,11 +8361,11 @@ function HR(e, t, n) {
|
|
|
8361
8361
|
...e.previewDraft.changedBlockIds,
|
|
8362
8362
|
...e.previewDraft.insertedBlockIds
|
|
8363
8363
|
]);
|
|
8364
|
-
e.previewDraft.nextBlocks.filter((W) => F.size === 0 || F.has(W.id)).forEach((W,
|
|
8365
|
-
var
|
|
8366
|
-
const G =
|
|
8364
|
+
e.previewDraft.nextBlocks.filter((W) => F.size === 0 || F.has(W.id)).forEach((W, V) => {
|
|
8365
|
+
var J, q, ce;
|
|
8366
|
+
const G = V + 1;
|
|
8367
8367
|
o.push(Sn({
|
|
8368
|
-
artifactId: `${(
|
|
8368
|
+
artifactId: `${(J = e.previewDraft) == null ? void 0 : J.draftId}:block:${W.id}`,
|
|
8369
8369
|
type: "preview_block",
|
|
8370
8370
|
workItemId: r,
|
|
8371
8371
|
turnId: e.id,
|
|
@@ -8375,7 +8375,7 @@ function HR(e, t, n) {
|
|
|
8375
8375
|
ordinal: G,
|
|
8376
8376
|
createdAt: ((q = e.previewDraft) == null ? void 0 : q.createdAt) || s,
|
|
8377
8377
|
updatedAt: i,
|
|
8378
|
-
payloadRef: { source: "turn", path: `turns.${e.id}.previewDraft.nextBlocks.${
|
|
8378
|
+
payloadRef: { source: "turn", path: `turns.${e.id}.previewDraft.nextBlocks.${V}` },
|
|
8379
8379
|
lightweightPayload: {
|
|
8380
8380
|
block: Ci(W),
|
|
8381
8381
|
blockId: W.id,
|
|
@@ -8489,7 +8489,7 @@ function jR(e, t) {
|
|
|
8489
8489
|
}));
|
|
8490
8490
|
}
|
|
8491
8491
|
function pc(e) {
|
|
8492
|
-
var F, D, W,
|
|
8492
|
+
var F, D, W, V, G, J;
|
|
8493
8493
|
const t = e.turns.filter((q) => q.conversationId === e.currentConversationId), n = t[t.length - 1], r = t.flatMap((q, ce) => HR(q, ce, n == null ? void 0 : n.id)), a = KR(e.snapshot, e.selectedBlockId), s = jR(e.snapshot, e.selectedNestedBlock), i = [...r, ...a, ...s], o = /* @__PURE__ */ new Map();
|
|
8494
8494
|
i.forEach((q) => {
|
|
8495
8495
|
const ce = o.get(q.turnId) || [];
|
|
@@ -8511,9 +8511,9 @@ function pc(e) {
|
|
|
8511
8511
|
selectedBlock: d,
|
|
8512
8512
|
canvas: {
|
|
8513
8513
|
snapshotVersion: ((W = e.snapshot) == null ? void 0 : W.version) || 0,
|
|
8514
|
-
layoutConfig: ((
|
|
8514
|
+
layoutConfig: ((V = e.snapshot) == null ? void 0 : V.layoutConfig) || Be,
|
|
8515
8515
|
blockCount: ((G = e.snapshot) == null ? void 0 : G.blocks.length) || 0,
|
|
8516
|
-
blocks: (((
|
|
8516
|
+
blocks: (((J = e.snapshot) == null ? void 0 : J.blocks) || []).map($R),
|
|
8517
8517
|
selectedBlock: d,
|
|
8518
8518
|
canonicalLayoutContext: Mu(e.snapshot)
|
|
8519
8519
|
},
|
|
@@ -8632,10 +8632,10 @@ function Qg(e) {
|
|
|
8632
8632
|
const k = I.flatMap((F) => {
|
|
8633
8633
|
const D = ud(F);
|
|
8634
8634
|
if (!D) return [F];
|
|
8635
|
-
const W = Rf(D, t || y.conversationId || "", e.answerSectionKey),
|
|
8636
|
-
if (
|
|
8635
|
+
const W = Rf(D, t || y.conversationId || "", e.answerSectionKey), V = yh(W, n), G = F.id === r, J = o === _f(y.id, F.id);
|
|
8636
|
+
if (!V && !G && !J) return [F];
|
|
8637
8637
|
const q = !Yg(D);
|
|
8638
|
-
return
|
|
8638
|
+
return V && s && q && !e.replaceExistingForSource ? (c = !0, [F]) : V || G || J ? (w = !0, e.replaceExistingForSource || !s || vf(a, n) >= vf(F, W) ? (d = !0, y.id === e.event.turnId && !l ? (l = !0, [a]) : []) : (d = !0, y.id === e.event.turnId && (m = !0), [F])) : [F];
|
|
8639
8639
|
});
|
|
8640
8640
|
return w ? {
|
|
8641
8641
|
...y,
|
|
@@ -9003,21 +9003,21 @@ function G_(e, t, n, r, a, s) {
|
|
|
9003
9003
|
nestedLayoutMode: y,
|
|
9004
9004
|
nestedLayoutBasis: I,
|
|
9005
9005
|
...w
|
|
9006
|
-
} = t, k = Array.isArray(p) && p.length > 0 ? p : dT(e, n, r, s == null ? void 0 : s.childIdsByContainerId), F = js(e, e.layout, n, /* @__PURE__ */ new Set(), s == null ? void 0 : s.childIdsByContainerId), D = yy(e, n, r, t.nestedBlocks, a, s), W = s ? pt(e, n, s.childIdsByContainerId).length : pt(e, n).length,
|
|
9006
|
+
} = t, k = Array.isArray(p) && p.length > 0 ? p : dT(e, n, r, s == null ? void 0 : s.childIdsByContainerId), F = js(e, e.layout, n, /* @__PURE__ */ new Set(), s == null ? void 0 : s.childIdsByContainerId), D = yy(e, n, r, t.nestedBlocks, a, s), W = s ? pt(e, n, s.childIdsByContainerId).length : pt(e, n).length, V = oT(e, D, F), G = r === "image" && ek(e, n), J = r === "image" && !yr(e) && !G && cT(
|
|
9007
9007
|
e.id,
|
|
9008
9008
|
D,
|
|
9009
|
-
|
|
9010
|
-
), q =
|
|
9009
|
+
V
|
|
9010
|
+
), q = J || r !== "image" ? [] : G ? tk(D) : Y_(D, V), ce = q.length > 0 ? J_(D, V, q) : {};
|
|
9011
9011
|
return {
|
|
9012
9012
|
shape: "customCanvas",
|
|
9013
9013
|
sourceLabel: typeof l == "string" && l.trim() ? l : "Workbench V2 container",
|
|
9014
9014
|
...w,
|
|
9015
9015
|
...i ? { appearance: i } : {},
|
|
9016
|
-
...r === "image" ? { nestedLayoutBasis:
|
|
9017
|
-
...
|
|
9016
|
+
...r === "image" ? { nestedLayoutBasis: V } : {},
|
|
9017
|
+
...J ? {
|
|
9018
9018
|
nestedLayoutMode: "absolute"
|
|
9019
9019
|
} : {},
|
|
9020
|
-
...!
|
|
9020
|
+
...!J && q.length > 0 ? {
|
|
9021
9021
|
nestedLayoutMode: "stack",
|
|
9022
9022
|
nestedLayoutStacks: q,
|
|
9023
9023
|
...Object.keys(ce).length > 0 ? { nestedLayoutItems: ce } : {}
|
|
@@ -9028,7 +9028,7 @@ function G_(e, t, n, r, a, s) {
|
|
|
9028
9028
|
};
|
|
9029
9029
|
}
|
|
9030
9030
|
function Xr(e) {
|
|
9031
|
-
return Array.isArray(e) ? e.map((t) =>
|
|
9031
|
+
return Array.isArray(e) ? e.map((t) => Z(t) ? [
|
|
9032
9032
|
t.label,
|
|
9033
9033
|
t.text,
|
|
9034
9034
|
t.title,
|
|
@@ -9125,7 +9125,7 @@ function my(e, t) {
|
|
|
9125
9125
|
const n = L(e.id);
|
|
9126
9126
|
if (!n) return [];
|
|
9127
9127
|
const r = e.layout;
|
|
9128
|
-
if (!
|
|
9128
|
+
if (!Z(r)) return [];
|
|
9129
9129
|
const a = H(r.x), s = H(r.y), i = H(r.w), o = H(r.h);
|
|
9130
9130
|
if (a === void 0 || s === void 0 || i === void 0 || o === void 0) return [];
|
|
9131
9131
|
const c = t.x ?? 0, d = t.y ?? 0, l = Math.max(1, t.w ?? Ye), m = Math.max(1, t.h ?? 1), p = {
|
|
@@ -9142,7 +9142,7 @@ function my(e, t) {
|
|
|
9142
9142
|
}];
|
|
9143
9143
|
}
|
|
9144
9144
|
function Z_(e) {
|
|
9145
|
-
const t =
|
|
9145
|
+
const t = Z(e.data) ? e.data : {};
|
|
9146
9146
|
return [
|
|
9147
9147
|
e.title,
|
|
9148
9148
|
e.kind,
|
|
@@ -9150,7 +9150,7 @@ function Z_(e) {
|
|
|
9150
9150
|
e.capabilityId,
|
|
9151
9151
|
e.rendererKey,
|
|
9152
9152
|
e.dataShape,
|
|
9153
|
-
e.meta &&
|
|
9153
|
+
e.meta && Z(e.meta) ? e.meta.visualKind : void 0,
|
|
9154
9154
|
t.kind,
|
|
9155
9155
|
t.shape,
|
|
9156
9156
|
t.visualKind,
|
|
@@ -9234,7 +9234,7 @@ function oT(e, t, n) {
|
|
|
9234
9234
|
}
|
|
9235
9235
|
function hy(e, t, n) {
|
|
9236
9236
|
const r = t.layout;
|
|
9237
|
-
if (!
|
|
9237
|
+
if (!Z(r)) return [];
|
|
9238
9238
|
const a = L(r.parentId);
|
|
9239
9239
|
if (a && a !== e) return [];
|
|
9240
9240
|
const s = H(r.x), i = H(r.y), o = H(r.w), c = H(r.h);
|
|
@@ -9277,7 +9277,7 @@ function gy(e) {
|
|
|
9277
9277
|
}
|
|
9278
9278
|
function dT(e, t, n, r) {
|
|
9279
9279
|
if (n === "image") return [];
|
|
9280
|
-
const a =
|
|
9280
|
+
const a = Z(e.slots) ? e.slots : {}, s = [], i = /* @__PURE__ */ new Set();
|
|
9281
9281
|
for (const [o, c] of Object.entries(a)) {
|
|
9282
9282
|
const d = Array.isArray(c) ? c.filter((l) => typeof l == "string" && l.length > 0) : [];
|
|
9283
9283
|
d.length !== 0 && (s.push({
|
|
@@ -9370,12 +9370,12 @@ function Iy(e, t, n, r, a, s, i, o, c, d, l, m = "") {
|
|
|
9370
9370
|
}
|
|
9371
9371
|
function uT(e, t, n, r, a) {
|
|
9372
9372
|
if (!a.has(t.id) || t.kind !== "container" || ae(t) !== "image" || pt(t, n, r).length === 0) return !1;
|
|
9373
|
-
const s =
|
|
9373
|
+
const s = ie(e);
|
|
9374
9374
|
return !!(s && La(e, s, n).some((i) => i.card.id === t.id));
|
|
9375
9375
|
}
|
|
9376
9376
|
function lT(e, t, n, r, a, s, i, o) {
|
|
9377
|
-
var
|
|
9378
|
-
const c = Ou(n), d = Ay(n), l = L(d == null ? void 0 : d.bindingId) ?? L(d == null ? void 0 : d.id), m = L(d == null ? void 0 : d.status) || "none", p = pT(n), y = m === "error" &&
|
|
9377
|
+
var V;
|
|
9378
|
+
const c = Ou(n), d = Ay(n), l = L(d == null ? void 0 : d.bindingId) ?? L(d == null ? void 0 : d.id), m = L(d == null ? void 0 : d.status) || "none", p = pT(n), y = m === "error" && Z(d == null ? void 0 : d.humanIntervention) ? d.humanIntervention : void 0, I = L(d == null ? void 0 : d.queryIntent), w = aI(n), k = Fu(n, r), F = oI({ ...n, title: k }, Z(n.renderData) ? n.renderData : {}), D = Tk(n, F), W = n.kind === "container" && Du(n, i, o) ? yy(
|
|
9379
9379
|
n,
|
|
9380
9380
|
i,
|
|
9381
9381
|
r,
|
|
@@ -9403,7 +9403,7 @@ function lT(e, t, n, r, a, s, i, o) {
|
|
|
9403
9403
|
state: {
|
|
9404
9404
|
mode: "final",
|
|
9405
9405
|
status: m === "running" ? "running" : m === "error" ? "failed" : "ready",
|
|
9406
|
-
refreshable: !!((
|
|
9406
|
+
refreshable: !!((V = n.dataBinding) != null && V.refreshApi),
|
|
9407
9407
|
cacheable: !0
|
|
9408
9408
|
},
|
|
9409
9409
|
layout: Xy(e, n, i, t, o),
|
|
@@ -9424,7 +9424,7 @@ function Du(e, t, n) {
|
|
|
9424
9424
|
}
|
|
9425
9425
|
function Sy(e) {
|
|
9426
9426
|
return Array.isArray(e) ? new Map(e.flatMap((t) => {
|
|
9427
|
-
if (!
|
|
9427
|
+
if (!Z(t)) return [];
|
|
9428
9428
|
const n = L(t.id);
|
|
9429
9429
|
return n ? [[n, t]] : [];
|
|
9430
9430
|
})) : /* @__PURE__ */ new Map();
|
|
@@ -9449,9 +9449,9 @@ function Ay(e) {
|
|
|
9449
9449
|
...t ? { bindingId: t } : {},
|
|
9450
9450
|
...I ? { status: I } : {},
|
|
9451
9451
|
...y ? { queryIntent: y } : {},
|
|
9452
|
-
...
|
|
9453
|
-
...I === "error" &&
|
|
9454
|
-
...I === "error" &&
|
|
9452
|
+
...Z(e.dataBinding.params) ? { params: e.dataBinding.params } : {},
|
|
9453
|
+
...I === "error" && Z(e.dataBinding.humanIntervention) ? { humanIntervention: e.dataBinding.humanIntervention } : {},
|
|
9454
|
+
...I === "error" && Z(e.dataBinding.diagnostics) ? { diagnostics: e.dataBinding.diagnostics } : {},
|
|
9455
9455
|
...w ? { lastError: w } : {},
|
|
9456
9456
|
...k ? { error: k } : {}
|
|
9457
9457
|
};
|
|
@@ -9486,14 +9486,14 @@ function wy(e, t) {
|
|
|
9486
9486
|
const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
9487
9487
|
for (const a of e.values()) {
|
|
9488
9488
|
if (!UT(a, e)) continue;
|
|
9489
|
-
const s =
|
|
9489
|
+
const s = ie(a);
|
|
9490
9490
|
if (s)
|
|
9491
9491
|
for (const { card: i } of Oy(a, s, e))
|
|
9492
9492
|
n.has(i.id) || Rn(i, e) || n.set(i.id, a.id);
|
|
9493
9493
|
}
|
|
9494
9494
|
for (const a of e.values()) {
|
|
9495
9495
|
if (!Eu(a, e) && !_o(a, e) && !Hs(a, e)) continue;
|
|
9496
|
-
const s =
|
|
9496
|
+
const s = ie(a);
|
|
9497
9497
|
if (s)
|
|
9498
9498
|
for (const { card: i } of La(a, s, e))
|
|
9499
9499
|
n.has(i.id) || Rn(i, e) || hd(i.id, e) && !ji(i, e) || (n.set(i.id, a.id), i.kind === "container" && r.add(i.id));
|
|
@@ -9513,7 +9513,7 @@ function wy(e, t) {
|
|
|
9513
9513
|
}
|
|
9514
9514
|
function pT(e) {
|
|
9515
9515
|
const t = e.dataBinding;
|
|
9516
|
-
return L(t == null ? void 0 : t.lastError) ?? L(t == null ? void 0 : t.lastRefreshError) ?? L(t == null ? void 0 : t.error) ?? L(
|
|
9516
|
+
return L(t == null ? void 0 : t.lastError) ?? L(t == null ? void 0 : t.lastRefreshError) ?? L(t == null ? void 0 : t.error) ?? L(Z(e.renderData) ? e.renderData.reason : void 0) ?? L(Z(e.renderData) ? e.renderData.message : void 0);
|
|
9517
9517
|
}
|
|
9518
9518
|
function gT(e, t, n, r) {
|
|
9519
9519
|
var m;
|
|
@@ -9554,7 +9554,7 @@ function Rs(e, t) {
|
|
|
9554
9554
|
const n = [];
|
|
9555
9555
|
for (const r of t.values()) {
|
|
9556
9556
|
if (r.id === e.id || r.kind !== "container") continue;
|
|
9557
|
-
const a =
|
|
9557
|
+
const a = ie(r);
|
|
9558
9558
|
a && La(r, a, t).some((s) => s.card.id === e.id) && n.push(r.id);
|
|
9559
9559
|
}
|
|
9560
9560
|
return n;
|
|
@@ -9568,7 +9568,7 @@ function ST(e, t, n, r, a) {
|
|
|
9568
9568
|
if (e.kind !== "container" || ae(e) !== "image") return !1;
|
|
9569
9569
|
const s = n.get(t);
|
|
9570
9570
|
if (!s || s.kind !== "container") return !1;
|
|
9571
|
-
const i =
|
|
9571
|
+
const i = ie(s);
|
|
9572
9572
|
if (!i || !La(s, i, n).some((c) => c.card.id === e.id)) return !1;
|
|
9573
9573
|
const o = /* @__PURE__ */ new Set();
|
|
9574
9574
|
return a == null || a.forEach((c, d) => {
|
|
@@ -9580,13 +9580,13 @@ function Cy(e, t, n, r) {
|
|
|
9580
9580
|
}
|
|
9581
9581
|
function AT(e, t) {
|
|
9582
9582
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || gr(e) || By(e, t) || pr(e)) return !1;
|
|
9583
|
-
const n =
|
|
9583
|
+
const n = ie(e);
|
|
9584
9584
|
if (!n || n.w < 6 || n.h < 5 || CT(e)) return !1;
|
|
9585
9585
|
const r = wT(e);
|
|
9586
9586
|
return r ? [...t.values()].some((a) => a.id !== e.id && a.kind === "container" && ae(a) === "image" && bT(a, r)) : !1;
|
|
9587
9587
|
}
|
|
9588
9588
|
function wT(e) {
|
|
9589
|
-
const t =
|
|
9589
|
+
const t = Z(e.renderData) ? e.renderData : {};
|
|
9590
9590
|
return Ki([
|
|
9591
9591
|
e.title,
|
|
9592
9592
|
t.title,
|
|
@@ -9597,17 +9597,17 @@ function wT(e) {
|
|
|
9597
9597
|
].filter((n) => typeof n == "string" && n.trim()).join(" "));
|
|
9598
9598
|
}
|
|
9599
9599
|
function CT(e) {
|
|
9600
|
-
const t =
|
|
9600
|
+
const t = Z(e.renderData) ? e.renderData : {}, n = Array.isArray(t.elements) ? t.elements : [], r = Ki(e.title), a = n.map((s) => Xr([s])).map((s) => Ki(s)).filter((s) => s && s !== r);
|
|
9601
9601
|
return new Set(a).size >= 2;
|
|
9602
9602
|
}
|
|
9603
9603
|
function bT(e, t) {
|
|
9604
9604
|
return vT(e).some((n) => n === t || n.length >= 3 && t.includes(n) || t.length >= 3 && n.includes(t));
|
|
9605
9605
|
}
|
|
9606
9606
|
function vT(e) {
|
|
9607
|
-
const t =
|
|
9607
|
+
const t = Z(e.renderData) ? e.renderData : {};
|
|
9608
9608
|
return (Array.isArray(t.nestedBlocks) ? t.nestedBlocks : []).flatMap((r) => {
|
|
9609
|
-
if (!
|
|
9610
|
-
const a =
|
|
9609
|
+
if (!Z(r)) return [];
|
|
9610
|
+
const a = Z(r.data) ? r.data : {}, s = [
|
|
9611
9611
|
r.title,
|
|
9612
9612
|
r.label,
|
|
9613
9613
|
r.name,
|
|
@@ -9671,7 +9671,7 @@ function TT(e) {
|
|
|
9671
9671
|
}));
|
|
9672
9672
|
if (!Number.isFinite(m) || m > 4 || p < 16) return;
|
|
9673
9673
|
const y = t.filter((I) => I.kind === "container" && sk(I)).filter((I) => {
|
|
9674
|
-
const w =
|
|
9674
|
+
const w = ie(I);
|
|
9675
9675
|
return !!(w && w.y < l && w.x <= 1 && w.w >= 18);
|
|
9676
9676
|
}).sort((I, w) => {
|
|
9677
9677
|
var k, F;
|
|
@@ -9685,7 +9685,7 @@ function TT(e) {
|
|
|
9685
9685
|
}
|
|
9686
9686
|
function sa(e, t, n = !1) {
|
|
9687
9687
|
return e.filter((r) => r.kind === "metric" || r.kind === "list" || n && r.kind === "container").filter((r) => !Te(r)).filter((r) => t.test(yt(r))).filter((r) => {
|
|
9688
|
-
const a =
|
|
9688
|
+
const a = ie(r);
|
|
9689
9689
|
return !!(a && a.y >= 1 && a.y <= 6 && a.h <= 4);
|
|
9690
9690
|
}).sort((r, a) => {
|
|
9691
9691
|
var s, i, o, c;
|
|
@@ -9773,12 +9773,12 @@ function $s(e, t, n) {
|
|
|
9773
9773
|
}
|
|
9774
9774
|
function Bu(e, t, n) {
|
|
9775
9775
|
if (ae(e) !== "image" || e.kind === "container" && !_y(e, t) && !ji(e, t) && !_s(e, t) || Rn(e, t) || hd(e.id, t, n) && !ji(e, t) && !_s(e, t)) return;
|
|
9776
|
-
const r =
|
|
9776
|
+
const r = ie(e);
|
|
9777
9777
|
if (!r) return;
|
|
9778
9778
|
let a;
|
|
9779
9779
|
for (const s of t.values()) {
|
|
9780
9780
|
if (s.kind !== "container" || s.id === e.id || ae(s) !== "image" || Te(s) || en(s) || Vt(s) || Ey(s, t) || Rn(s, t)) continue;
|
|
9781
|
-
const i =
|
|
9781
|
+
const i = ie(s);
|
|
9782
9782
|
if (!i || Hs(s, t)) continue;
|
|
9783
9783
|
const o = FT(s, i, e, r, t);
|
|
9784
9784
|
o <= 0 || (!a || o > a.score) && (a = { id: s.id, score: o });
|
|
@@ -9787,7 +9787,7 @@ function Bu(e, t, n) {
|
|
|
9787
9787
|
}
|
|
9788
9788
|
function ji(e, t) {
|
|
9789
9789
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e)) return !1;
|
|
9790
|
-
const n =
|
|
9790
|
+
const n = ie(e);
|
|
9791
9791
|
if (!n || n.w >= 8 || n.h >= 5) return !1;
|
|
9792
9792
|
const r = Hn(e, "child");
|
|
9793
9793
|
if (!r.has("hrTalentDevelopment") && !r.has("operationDelivery") && !r.has("operationResource") && !r.has("operationMilestone")) return !1;
|
|
@@ -9799,13 +9799,13 @@ function ji(e, t) {
|
|
|
9799
9799
|
}
|
|
9800
9800
|
function _s(e, t) {
|
|
9801
9801
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e)) return !1;
|
|
9802
|
-
const n =
|
|
9802
|
+
const n = ie(e);
|
|
9803
9803
|
if (!n || n.w < 6 || n.w > 14 || n.h < 5 || n.h > 14) return !1;
|
|
9804
9804
|
const r = Zr(e, t).filter((d) => t.has(d));
|
|
9805
9805
|
if (r.length < Zg || r.length > Wa) return !1;
|
|
9806
9806
|
const a = r.map((d) => t.get(d)).filter((d) => !!d);
|
|
9807
9807
|
if (!a.every((d) => d.kind !== "container" && ea(d))) return !1;
|
|
9808
|
-
const s = a.map(
|
|
9808
|
+
const s = a.map(ie).filter((d) => !!d);
|
|
9809
9809
|
if (s.length !== a.length) return !0;
|
|
9810
9810
|
const i = Math.min(...s.map((d) => d.x));
|
|
9811
9811
|
return Math.max(...s.map((d) => d.x + d.w)) - i <= n.w + 1e-3 || Na(n, s) >= 0.45;
|
|
@@ -9819,7 +9819,7 @@ function Ta(e, t, n) {
|
|
|
9819
9819
|
var l;
|
|
9820
9820
|
if (ae(e) !== "image" || ae(t) !== "image") return !0;
|
|
9821
9821
|
if (e.kind !== "container" || Te(e)) return !1;
|
|
9822
|
-
const r =
|
|
9822
|
+
const r = ie(e), a = ie(t);
|
|
9823
9823
|
if (!r || !a || yr(e) && Dy(e, t.id, n)) return !0;
|
|
9824
9824
|
const s = ((l = t.layout) == null ? void 0 : l.parentId) === e.id;
|
|
9825
9825
|
if (s && xT(r, a)) return !0;
|
|
@@ -9835,7 +9835,7 @@ function Ta(e, t, n) {
|
|
|
9835
9835
|
function Wf(e, t, n, r, a, s) {
|
|
9836
9836
|
return [...s.values()].some((i) => {
|
|
9837
9837
|
if (i.id === e || i.id === r.id || i.kind !== "container" || ae(i) !== "image" || Te(i) || en(i) || Vt(i)) return !1;
|
|
9838
|
-
const o =
|
|
9838
|
+
const o = ie(i);
|
|
9839
9839
|
if (!o || a.y < o.y - 0.1) return !1;
|
|
9840
9840
|
const c = vt(o, a), d = mn(o, a);
|
|
9841
9841
|
if (c < 0.45 && d < 0.45 || n >= 0.45 && c < 0.45) return !1;
|
|
@@ -9864,7 +9864,7 @@ function Ry(e, t, n) {
|
|
|
9864
9864
|
var i;
|
|
9865
9865
|
const s = L((i = a.layout) == null ? void 0 : i.parentId);
|
|
9866
9866
|
return !s || s === a.id || !n.has(s);
|
|
9867
|
-
}).filter((a) => !Te(a)).map((a) =>
|
|
9867
|
+
}).filter((a) => !Te(a)).map((a) => ie(a)).filter((a) => !!a).filter((a) => a.y > t.y && vt(a, t) >= 0.25).sort((a, s) => a.y - s.y)[0]) == null ? void 0 : r.y;
|
|
9868
9868
|
}
|
|
9869
9869
|
function hd(e, t, n) {
|
|
9870
9870
|
for (const r of t.values()) {
|
|
@@ -9901,10 +9901,10 @@ function Vs(e) {
|
|
|
9901
9901
|
}
|
|
9902
9902
|
function _y(e, t) {
|
|
9903
9903
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e)) return !1;
|
|
9904
|
-
const n =
|
|
9904
|
+
const n = ie(e);
|
|
9905
9905
|
return n && n.w >= 8 && n.h >= 6 ? !1 : Zr(e, t).every((r) => !t.has(r));
|
|
9906
9906
|
}
|
|
9907
|
-
function
|
|
9907
|
+
function ie(e) {
|
|
9908
9908
|
var s, i, o, c;
|
|
9909
9909
|
const t = H((s = e.layout) == null ? void 0 : s.x), n = H((i = e.layout) == null ? void 0 : i.y), r = H((o = e.layout) == null ? void 0 : o.w), a = H((c = e.layout) == null ? void 0 : c.h);
|
|
9910
9910
|
return t === void 0 || n === void 0 || r === void 0 || a === void 0 ? void 0 : { x: t, y: n, w: r, h: a };
|
|
@@ -9917,11 +9917,11 @@ function mn(e, t) {
|
|
|
9917
9917
|
}
|
|
9918
9918
|
function vo(e, t, n) {
|
|
9919
9919
|
var r;
|
|
9920
|
-
return (r = [...n.values()].filter((a) => a.id !== e.id && a.kind === "container" && ae(a) === "image").filter((a) => !Rn(a, n)).filter((a) => !PT(e, t, a, n)).filter((a) => !DT(e, t, a, n)).map((a) =>
|
|
9920
|
+
return (r = [...n.values()].filter((a) => a.id !== e.id && a.kind === "container" && ae(a) === "image").filter((a) => !Rn(a, n)).filter((a) => !PT(e, t, a, n)).filter((a) => !DT(e, t, a, n)).map((a) => ie(a)).filter((a) => !!a).filter((a) => a.y > t.y && vt(a, t) >= 0.25).sort((a, s) => a.y - s.y)[0]) == null ? void 0 : r.y;
|
|
9921
9921
|
}
|
|
9922
9922
|
function DT(e, t, n, r) {
|
|
9923
9923
|
if (!Eu(e, r) && !_o(e, r) && !Hs(e, r)) return !1;
|
|
9924
|
-
const a =
|
|
9924
|
+
const a = ie(n);
|
|
9925
9925
|
if (!a || !Ks(n, r)) return !1;
|
|
9926
9926
|
const s = vt(t, a), i = mn(t, a);
|
|
9927
9927
|
if (s < 0.45 && i < 0.45) return !1;
|
|
@@ -9940,7 +9940,7 @@ function PT(e, t, n, r) {
|
|
|
9940
9940
|
if (!_y(n, r) && !ji(n, r) && !a) return !1;
|
|
9941
9941
|
const s = Hn(e, "container"), i = Hn(n, "child");
|
|
9942
9942
|
if (!a && !Ro(e, n) && !Ty(s, i)) return !1;
|
|
9943
|
-
const o =
|
|
9943
|
+
const o = ie(n);
|
|
9944
9944
|
if (!o || o.y < t.y) return !1;
|
|
9945
9945
|
const c = vt(t, o), d = mn(t, o);
|
|
9946
9946
|
return a ? c < 0.45 && d < 0.45 ? !1 : o.y + o.h <= t.y + t.h + ny : c < 0.6 && d < 0.6 ? !1 : o.y + o.h <= t.y + t.h + Vs(e);
|
|
@@ -9979,7 +9979,7 @@ function NT(e) {
|
|
|
9979
9979
|
function qT(e) {
|
|
9980
9980
|
var i;
|
|
9981
9981
|
if ($T(e)) return !0;
|
|
9982
|
-
const t = H((i = e.layout) == null ? void 0 : i.h) ?? 0, n = hn(e).length, r =
|
|
9982
|
+
const t = H((i = e.layout) == null ? void 0 : i.h) ?? 0, n = hn(e).length, r = Z(e.renderData) ? e.renderData : {}, a = Array.isArray(r.elements) ? r.elements : [], s = L(r.narrative) ?? "";
|
|
9983
9983
|
return n >= 3 || t >= 12 && n >= 2 || t >= 10 && s.length >= 48 || t >= 10 && a.length >= 4;
|
|
9984
9984
|
}
|
|
9985
9985
|
function $T(e) {
|
|
@@ -10006,7 +10006,7 @@ function ky(e) {
|
|
|
10006
10006
|
}
|
|
10007
10007
|
function yt(e) {
|
|
10008
10008
|
var s, i, o;
|
|
10009
|
-
const t =
|
|
10009
|
+
const t = Z(e.renderData) ? e.renderData : {}, n = Z(e.appearance) ? e.appearance : {}, r = Z(e.meta) ? e.meta : {}, a = Z(r.visual) ? r.visual : {};
|
|
10010
10010
|
return [
|
|
10011
10011
|
e.title,
|
|
10012
10012
|
e.subtitle,
|
|
@@ -10053,7 +10053,7 @@ function Lf(e, t, n) {
|
|
|
10053
10053
|
}
|
|
10054
10054
|
function HT(e, t) {
|
|
10055
10055
|
var r;
|
|
10056
|
-
const n =
|
|
10056
|
+
const n = Z(e.slots) ? e.slots : {};
|
|
10057
10057
|
for (const [a, s] of Object.entries(n))
|
|
10058
10058
|
if (Array.isArray(s) && s.includes(t.id)) return a;
|
|
10059
10059
|
return ((r = t.layout) == null ? void 0 : r.parentId) === e.id && typeof t.layout.slot == "string" && t.layout.slot.trim() ? t.layout.slot : "children";
|
|
@@ -10068,7 +10068,7 @@ function pt(e, t = /* @__PURE__ */ new Map(), n) {
|
|
|
10068
10068
|
return Zr(e, t).forEach(i), jT(e, t).forEach(i), lr(e, t) && s.sort((o, c) => xy(o, c, t)), s;
|
|
10069
10069
|
}
|
|
10070
10070
|
function xy(e, t, n) {
|
|
10071
|
-
const r =
|
|
10071
|
+
const r = ie(n.get(e) ?? {}), a = ie(n.get(t) ?? {});
|
|
10072
10072
|
return ((r == null ? void 0 : r.y) ?? 0) - ((a == null ? void 0 : a.y) ?? 0) || ((r == null ? void 0 : r.x) ?? 0) - ((a == null ? void 0 : a.x) ?? 0) || e.localeCompare(t);
|
|
10073
10073
|
}
|
|
10074
10074
|
function Zr(e, t = /* @__PURE__ */ new Map()) {
|
|
@@ -10080,7 +10080,7 @@ function hn(e, t = /* @__PURE__ */ new Map()) {
|
|
|
10080
10080
|
const o = t.get(s), c = o ? i.fromContainerDeclaration ? Fy(e, o, t) : Ta(e, o, t) : !0;
|
|
10081
10081
|
o && !c || (n.add(s), r.push(s));
|
|
10082
10082
|
};
|
|
10083
|
-
return (Array.isArray(e.children) ? e.children : []).forEach((s) => a(s, { fromContainerDeclaration: !0 })), Object.values(
|
|
10083
|
+
return (Array.isArray(e.children) ? e.children : []).forEach((s) => a(s, { fromContainerDeclaration: !0 })), Object.values(Z(e.slots) ? e.slots : {}).forEach((s) => {
|
|
10084
10084
|
Array.isArray(s) && s.forEach((i) => a(i, { fromContainerDeclaration: !0 }));
|
|
10085
10085
|
}), t.forEach((s) => {
|
|
10086
10086
|
var i;
|
|
@@ -10096,7 +10096,7 @@ function Fy(e, t, n) {
|
|
|
10096
10096
|
function Dy(e, t, n) {
|
|
10097
10097
|
var a, s;
|
|
10098
10098
|
if ((Array.isArray(e.children) ? e.children : []).includes(t)) return !0;
|
|
10099
|
-
const r =
|
|
10099
|
+
const r = Z(e.slots) ? e.slots : {};
|
|
10100
10100
|
return Object.values(r).some((i) => Array.isArray(i) && i.includes(t)) ? !0 : ((s = (a = n.get(t)) == null ? void 0 : a.layout) == null ? void 0 : s.parentId) === e.id;
|
|
10101
10101
|
}
|
|
10102
10102
|
function Py(e, t, n) {
|
|
@@ -10106,7 +10106,7 @@ function Py(e, t, n) {
|
|
|
10106
10106
|
return r && r !== e.id && n.has(r) ? !1 : r ? Ta(e, t, n) : pd(e, t);
|
|
10107
10107
|
}
|
|
10108
10108
|
function pd(e, t) {
|
|
10109
|
-
const n =
|
|
10109
|
+
const n = ie(e), r = ie(t);
|
|
10110
10110
|
if (!n || !r) return !0;
|
|
10111
10111
|
if (r.y >= n.y - 0.1 && r.y <= n.y + n.h + Oa) {
|
|
10112
10112
|
const a = vt(n, r), s = mn(n, r);
|
|
@@ -10117,14 +10117,14 @@ function pd(e, t) {
|
|
|
10117
10117
|
function By(e, t) {
|
|
10118
10118
|
if ((Array.isArray(e.children) ? e.children : []).some((r) => typeof r == "string" && t.has(r)))
|
|
10119
10119
|
return !0;
|
|
10120
|
-
const n =
|
|
10120
|
+
const n = Z(e.slots) ? e.slots : {};
|
|
10121
10121
|
return Object.values(n).some((r) => Array.isArray(r) && r.some((a) => typeof a == "string" && t.has(a))) ? !0 : [...t.values()].some((r) => {
|
|
10122
10122
|
var a;
|
|
10123
10123
|
return r.id !== e.id && ((a = r.layout) == null ? void 0 : a.parentId) === e.id;
|
|
10124
10124
|
});
|
|
10125
10125
|
}
|
|
10126
10126
|
function pr(e) {
|
|
10127
|
-
return Sy(
|
|
10127
|
+
return Sy(Z(e.renderData) ? e.renderData.nestedBlocks : void 0).size > 0;
|
|
10128
10128
|
}
|
|
10129
10129
|
function Ey(e, t) {
|
|
10130
10130
|
return e.kind === "container" && pr(e) && !By(e, t);
|
|
@@ -10134,13 +10134,13 @@ function KT(e, t, n) {
|
|
|
10134
10134
|
}
|
|
10135
10135
|
function jT(e, t) {
|
|
10136
10136
|
return Te(e) ? [] : e.kind !== "container" || ae(e) !== "image" ? [] : [...t.values()].map((n, r) => ({ candidate: n, index: r })).filter(({ candidate: n }) => n.id !== e.id && Bu(n, t) === e.id).sort((n, r) => {
|
|
10137
|
-
const a =
|
|
10137
|
+
const a = ie(n.candidate), s = ie(r.candidate);
|
|
10138
10138
|
return ((a == null ? void 0 : a.y) ?? 0) - ((s == null ? void 0 : s.y) ?? 0) || ((a == null ? void 0 : a.x) ?? 0) - ((s == null ? void 0 : s.x) ?? 0) || n.index - r.index;
|
|
10139
10139
|
}).map(({ candidate: n }) => n.id);
|
|
10140
10140
|
}
|
|
10141
10141
|
function Te(e) {
|
|
10142
10142
|
if (e.kind !== "container" || ae(e) !== "image" || e.capabilityId === "card.composite.bidCollaboration") return !1;
|
|
10143
|
-
const t =
|
|
10143
|
+
const t = Z(e.renderData) ? e.renderData : {}, n = Z(e.meta) ? e.meta : {}, r = Z(e.appearance) ? e.appearance : {}, a = Z(n.visual) ? n.visual : {}, s = Z(n.v2) ? n.v2 : {}, i = Z(s.appearance) ? s.appearance : {}, o = Z(s.visual) ? s.visual : {}, c = [
|
|
10144
10144
|
e.title,
|
|
10145
10145
|
e.subtitle,
|
|
10146
10146
|
n.rendererKey,
|
|
@@ -10159,7 +10159,7 @@ function Te(e) {
|
|
|
10159
10159
|
Xr(t.elements)
|
|
10160
10160
|
].filter((p) => typeof p == "string" && p.trim()).join(" ");
|
|
10161
10161
|
if (GT(e, t, r, n, a, i, o) || /image-header-banner|dark_header|header|banner/i.test(c) && !Ot(c) || zT(e, c)) return !0;
|
|
10162
|
-
const d =
|
|
10162
|
+
const d = ie(e);
|
|
10163
10163
|
return !!(d && d.x <= 1 && d.y <= 1 && d.w >= 18 && d.h <= 4) && /CIO|workbench|workspace|工作台|信息化中心|自动巡检/i.test(c) && !Ot(c) && z_(t, r, a, i, o) || !!(d && d.x <= 1 && d.y <= 1 && d.w >= 18 && /CIO|workbench|workspace|工作台|信息化中心|自动巡检/i.test(c) && !Ot(c)) ? !0 : /image-header-banner|dark_header|顶部导航|标题栏|header|banner/i.test(c) && !Ot(c);
|
|
10164
10164
|
}
|
|
10165
10165
|
function GT(e, t, n, r, a, s, i) {
|
|
@@ -10175,24 +10175,24 @@ function GT(e, t, n, r, a, s, i) {
|
|
|
10175
10175
|
}
|
|
10176
10176
|
function zT(e, t) {
|
|
10177
10177
|
if (e.kind !== "container" || ae(e) !== "image" || e.capabilityId === "card.composite.bidCollaboration" || Ot(t) || gr(e)) return !1;
|
|
10178
|
-
const n =
|
|
10178
|
+
const n = ie(e);
|
|
10179
10179
|
if (!n || n.x > 1 || n.y > 5 || n.w < 18 || n.h > 4) return !1;
|
|
10180
10180
|
const r = [
|
|
10181
10181
|
e.title,
|
|
10182
10182
|
e.subtitle,
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10183
|
+
Z(e.renderData) ? e.renderData.title : void 0,
|
|
10184
|
+
Z(e.renderData) ? e.renderData.narrative : void 0,
|
|
10185
|
+
Z(e.renderData) ? Xr(e.renderData.elements) : void 0
|
|
10186
10186
|
].filter((a) => typeof a == "string" && a.trim()).join(" ");
|
|
10187
10187
|
return /dashboard|workbench|workspace|cockpit|overview|monitor|scorecard|command center|status board|title|page header|header|banner|仪表盘|驾驶舱|看板|总览|概览|监控|工作台|标题|页头/i.test(r);
|
|
10188
10188
|
}
|
|
10189
10189
|
function gr(e) {
|
|
10190
|
-
const t =
|
|
10190
|
+
const t = Z(e.dataBinding) ? e.dataBinding : void 0;
|
|
10191
10191
|
return t ? !!(qa(e) || L(t.status) || L(t.queryIntent) || L(t.refreshApi) || L(t.source)) : !1;
|
|
10192
10192
|
}
|
|
10193
10193
|
function Kr(e, t) {
|
|
10194
10194
|
if (e.kind !== "container" || ae(e) !== "image" || Ot(yt(e)) || gr(e) || pr(e) || _o(e, t)) return !1;
|
|
10195
|
-
const n =
|
|
10195
|
+
const n = ie(e);
|
|
10196
10196
|
if (!n || n.x > 1 || n.w < 12 || n.h > R_) return !1;
|
|
10197
10197
|
const r = hn(e, t);
|
|
10198
10198
|
if (r.length < 3) return !1;
|
|
@@ -10203,13 +10203,13 @@ function Kr(e, t) {
|
|
|
10203
10203
|
return o.kind === "metric" || ((c = o.meta) == null ? void 0 : c.dataShape) === "metricSummary";
|
|
10204
10204
|
});
|
|
10205
10205
|
return s.length < Math.max(3, Math.ceil(a.length * 0.6)) ? !1 : s.filter((o) => {
|
|
10206
|
-
const c =
|
|
10206
|
+
const c = ie(o);
|
|
10207
10207
|
return !!(c && c.y >= n.y && c.h >= 2 && c.y + c.h > n.y + n.h + 0.1);
|
|
10208
10208
|
}).length >= Math.max(3, Math.ceil(s.length * 0.8));
|
|
10209
10209
|
}
|
|
10210
10210
|
function lr(e, t) {
|
|
10211
10211
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || Ot(yt(e)) || gr(e) || pr(e)) return !1;
|
|
10212
|
-
const n =
|
|
10212
|
+
const n = ie(e);
|
|
10213
10213
|
if (!n || n.w < 8 || n.h > T_) return !1;
|
|
10214
10214
|
const r = ak(e, n, t);
|
|
10215
10215
|
if (r.length < Zg || r.length > Wa) return !1;
|
|
@@ -10218,7 +10218,7 @@ function lr(e, t) {
|
|
|
10218
10218
|
}
|
|
10219
10219
|
function Eu(e, t) {
|
|
10220
10220
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || Ot(yt(e)) || gr(e) || pr(e) || hn(e, t).some((s) => t.has(s))) return !1;
|
|
10221
|
-
const n =
|
|
10221
|
+
const n = ie(e);
|
|
10222
10222
|
if (!n || n.w < 12 || n.h > M_) return !1;
|
|
10223
10223
|
const r = Ny(e, n, t);
|
|
10224
10224
|
if (r.length < 2 || r.length > Wa) return !1;
|
|
@@ -10227,7 +10227,7 @@ function Eu(e, t) {
|
|
|
10227
10227
|
}
|
|
10228
10228
|
function _o(e, t) {
|
|
10229
10229
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || Ot(yt(e)) || gr(e) || pr(e)) return !1;
|
|
10230
|
-
const n =
|
|
10230
|
+
const n = ie(e);
|
|
10231
10231
|
if (!n || n.w < 12 || n.h > F_) return !1;
|
|
10232
10232
|
const r = hn(e, t).map((o) => t.get(o)).filter((o) => !!o);
|
|
10233
10233
|
if (r.length < Ff || r.filter((o) => {
|
|
@@ -10245,12 +10245,12 @@ function La(e, t, n) {
|
|
|
10245
10245
|
function Wy(e, t, n) {
|
|
10246
10246
|
var c;
|
|
10247
10247
|
if (e.kind !== "container" || ae(e) !== "image") return [];
|
|
10248
|
-
const r =
|
|
10248
|
+
const r = ie(e);
|
|
10249
10249
|
if (!r) return [];
|
|
10250
10250
|
const a = vo(e, r, t), s = Math.min(
|
|
10251
10251
|
r.y + r.h + Df,
|
|
10252
10252
|
a ?? Number.POSITIVE_INFINITY
|
|
10253
|
-
), i = [...t.values()].filter((d) => d.id !== e.id && ae(d) === "image").filter((d) => !n.has(d.id)).filter((d) => !Rn(d, t)).filter((d) => ea(d)).map((d) => ({ card: d, box:
|
|
10253
|
+
), i = [...t.values()].filter((d) => d.id !== e.id && ae(d) === "image").filter((d) => !n.has(d.id)).filter((d) => !Rn(d, t)).filter((d) => ea(d)).map((d) => ({ card: d, box: ie(d) })).filter((d) => !!d.box).filter(({ box: d }) => {
|
|
10254
10254
|
if (d.w > r.w + 1e-3 || !(d.y >= r.y + r.h - 0.1 && d.y + d.h <= s + 1e-3)) return !1;
|
|
10255
10255
|
const m = vt(r, d), p = mn(r, d);
|
|
10256
10256
|
return m >= Pf || p >= Pf;
|
|
@@ -10259,14 +10259,14 @@ function Wy(e, t, n) {
|
|
|
10259
10259
|
}
|
|
10260
10260
|
function UT(e, t) {
|
|
10261
10261
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || !pr(e)) return !1;
|
|
10262
|
-
const n =
|
|
10262
|
+
const n = ie(e);
|
|
10263
10263
|
return !!(n && Oy(e, n, t).length > 0);
|
|
10264
10264
|
}
|
|
10265
10265
|
function Oy(e, t, n) {
|
|
10266
10266
|
const r = vo(e, t, n), a = Math.min(
|
|
10267
10267
|
t.y + t.h + Vs(e),
|
|
10268
10268
|
r ?? Number.POSITIVE_INFINITY
|
|
10269
|
-
), s = [...n.values()].filter((i) => i.id !== e.id && ae(i) === "image").filter((i) => ZT(i, n)).map((i) => ({ card: i, box:
|
|
10269
|
+
), s = [...n.values()].filter((i) => i.id !== e.id && ae(i) === "image").filter((i) => ZT(i, n)).map((i) => ({ card: i, box: ie(i) })).filter((i) => !!i.box);
|
|
10270
10270
|
return s.filter(({ card: i, box: o }) => {
|
|
10271
10271
|
if (o.y < t.y - 0.1 || o.y + o.h > a + 1e-3 || r !== void 0 && o.y >= r) return !1;
|
|
10272
10272
|
const c = vt(t, o), d = mn(t, o), l = c >= 0.45 || d >= 0.45 || JT(e, t, o, n) || XT(t, o, s.map((p) => p.box)), m = Ro(e, i);
|
|
@@ -10279,13 +10279,13 @@ function YT(e, t) {
|
|
|
10279
10279
|
}
|
|
10280
10280
|
function QT(e, t) {
|
|
10281
10281
|
if (e.kind !== "container" || ae(e) !== "image" || hn(e, t).filter((a) => t.has(a)).length <= 0) return !1;
|
|
10282
|
-
const r =
|
|
10282
|
+
const r = ie(e);
|
|
10283
10283
|
return !!(r && r.w >= 8 && r.h >= 6);
|
|
10284
10284
|
}
|
|
10285
10285
|
function JT(e, t, n, r) {
|
|
10286
10286
|
var i;
|
|
10287
10287
|
if (n.x < t.x + t.w - 0.1 || n.y < t.y - 0.1) return !1;
|
|
10288
|
-
const s = (i = [...r.values()].filter((o) => o.id !== e.id && o.kind === "container" && ae(o) === "image").filter((o) => !Rn(o, r)).map((o) =>
|
|
10288
|
+
const s = (i = [...r.values()].filter((o) => o.id !== e.id && o.kind === "container" && ae(o) === "image").filter((o) => !Rn(o, r)).map((o) => ie(o)).filter((o) => !!o).filter((o) => o.x >= t.x + t.w - 0.1 && Ly(t, o) >= 0.45).sort((o, c) => o.x - c.x).find((o) => o.x >= n.x + n.w - 0.1)) == null ? void 0 : i.x;
|
|
10289
10289
|
return s !== void 0 && n.x + n.w > s + 1e-3 ? !1 : n.x + n.w <= Ye + 1e-3;
|
|
10290
10290
|
}
|
|
10291
10291
|
function XT(e, t, n) {
|
|
@@ -10310,7 +10310,7 @@ function ZT(e, t) {
|
|
|
10310
10310
|
return ae(e) !== "image" || Rn(e, t) ? !1 : e.kind === "container" ? Ks(e, t) : ea(e);
|
|
10311
10311
|
}
|
|
10312
10312
|
function ek(e, t) {
|
|
10313
|
-
const n =
|
|
10313
|
+
const n = ie(e);
|
|
10314
10314
|
return !!(n && La(e, n, t).length >= 2);
|
|
10315
10315
|
}
|
|
10316
10316
|
function tk(e) {
|
|
@@ -10321,7 +10321,7 @@ function tk(e) {
|
|
|
10321
10321
|
}
|
|
10322
10322
|
function Ny(e, t, n) {
|
|
10323
10323
|
var i;
|
|
10324
|
-
const r = t.y + t.h + ey, a = [...n.values()].filter((o) => o.id !== e.id && ae(o) === "image").filter((o) => Ks(o, n)).map((o) => ({ card: o, box:
|
|
10324
|
+
const r = t.y + t.h + ey, a = [...n.values()].filter((o) => o.id !== e.id && ae(o) === "image").filter((o) => Ks(o, n)).map((o) => ({ card: o, box: ie(o) })).filter((o) => !!o.box).filter(({ box: o }) => {
|
|
10325
10325
|
const c = vt(t, o), d = mn(t, o);
|
|
10326
10326
|
return o.y >= t.y + t.h - 0.1 && o.y + o.h <= r + 1e-3 && (c >= 0.45 || d >= 0.45);
|
|
10327
10327
|
}).sort((o, c) => o.box.y - c.box.y || o.box.x - c.box.x || o.card.id.localeCompare(c.card.id)), s = (i = a[0]) == null ? void 0 : i.box;
|
|
@@ -10332,7 +10332,7 @@ function qy(e, t, n) {
|
|
|
10332
10332
|
const r = new Set(hn(e, n)), a = rk(e, n), s = Math.max(t.y + t.h - 0.1, (a ?? t.y + t.h) - 0.25), i = Math.max(
|
|
10333
10333
|
t.y + t.h + fd,
|
|
10334
10334
|
(a ?? t.y + t.h) + fd
|
|
10335
|
-
), o = [...n.values()].filter((l) => l.id !== e.id && !r.has(l.id) && ae(l) === "image").filter((l) => Ks(l, n)).map((l) => ({ card: l, box:
|
|
10335
|
+
), o = [...n.values()].filter((l) => l.id !== e.id && !r.has(l.id) && ae(l) === "image").filter((l) => Ks(l, n)).map((l) => ({ card: l, box: ie(l) })).filter((l) => !!l.box).filter(({ box: l }) => {
|
|
10336
10336
|
const m = vt(t, l), p = mn(t, l);
|
|
10337
10337
|
return l.y >= s && l.y + l.h <= i + 1e-3 && (m >= 0.45 || p >= 0.45);
|
|
10338
10338
|
}).sort((l, m) => l.box.y - m.box.y || l.box.x - m.box.x || l.card.id.localeCompare(m.card.id));
|
|
@@ -10358,14 +10358,14 @@ function nk(e, t) {
|
|
|
10358
10358
|
}
|
|
10359
10359
|
function Hs(e, t) {
|
|
10360
10360
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || Ot(yt(e)) || gr(e) || pr(e) || hn(e, t).some((s) => t.has(s))) return !1;
|
|
10361
|
-
const n =
|
|
10361
|
+
const n = ie(e);
|
|
10362
10362
|
if (!n || n.w > B_ || n.h > P_) return !1;
|
|
10363
10363
|
const r = $y(e, n, t);
|
|
10364
10364
|
return r.length < 2 || r.length > Wa ? !1 : Na(Vy(n, r), r.map((s) => s.box)) >= E_;
|
|
10365
10365
|
}
|
|
10366
10366
|
function $y(e, t, n) {
|
|
10367
10367
|
var c;
|
|
10368
|
-
const r = t.y + t.h + ry, a = [...n.values()].filter((d) => d.id !== e.id && ae(d) === "image").filter((d) => Ks(d, n)).map((d) => ({ card: d, box:
|
|
10368
|
+
const r = t.y + t.h + ry, a = [...n.values()].filter((d) => d.id !== e.id && ae(d) === "image").filter((d) => Ks(d, n)).map((d) => ({ card: d, box: ie(d) })).filter((d) => !!d.box).filter(({ box: d }) => {
|
|
10369
10369
|
if (!(d.y >= t.y - 0.1 && d.y + d.h <= r + 1e-3)) return !1;
|
|
10370
10370
|
const m = fr(t, d) && d.x >= t.x + t.w - 0.1, p = d.y >= t.y + t.h - 0.1 && d.x <= t.x + t.w + 0.1;
|
|
10371
10371
|
return m || p;
|
|
@@ -10389,7 +10389,7 @@ function Vy(e, t) {
|
|
|
10389
10389
|
}
|
|
10390
10390
|
function rk(e, t) {
|
|
10391
10391
|
const n = hn(e, t).map((r) => t.get(r)).flatMap((r) => {
|
|
10392
|
-
const a = r ?
|
|
10392
|
+
const a = r ? ie(r) : void 0;
|
|
10393
10393
|
return a ? [a.y + a.h] : [];
|
|
10394
10394
|
});
|
|
10395
10395
|
return n.length > 0 ? Math.max(...n) : void 0;
|
|
@@ -10397,9 +10397,9 @@ function rk(e, t) {
|
|
|
10397
10397
|
function Ks(e, t) {
|
|
10398
10398
|
var d, l, m;
|
|
10399
10399
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || en(e) || Vt(e) || Rn(e, t)) return !1;
|
|
10400
|
-
const n =
|
|
10400
|
+
const n = ie(e);
|
|
10401
10401
|
if (!n || n.w < 4 || n.h < 3) return !1;
|
|
10402
|
-
const r =
|
|
10402
|
+
const r = Z(e.renderData) ? e.renderData : {}, a = Array.isArray(r.elements) ? r.elements.length : 0, s = Array.isArray(r.nestedBlocks) ? r.nestedBlocks.length : 0, i = hn(e, t).filter((p) => t.has(p)).length, o = [
|
|
10403
10403
|
e.title,
|
|
10404
10404
|
e.subtitle,
|
|
10405
10405
|
r.narrative,
|
|
@@ -10412,7 +10412,7 @@ function ak(e, t, n) {
|
|
|
10412
10412
|
t.y + t.h + Oa,
|
|
10413
10413
|
r ?? 0
|
|
10414
10414
|
);
|
|
10415
|
-
return [...n.values()].filter((s) => s.id !== e.id && ae(s) === "image").filter((s) => ea(s)).map((s) => ({ card: s, box:
|
|
10415
|
+
return [...n.values()].filter((s) => s.id !== e.id && ae(s) === "image").filter((s) => ea(s)).map((s) => ({ card: s, box: ie(s) })).filter((s) => !!s.box).filter(({ box: s }) => {
|
|
10416
10416
|
const i = vt(t, s), o = mn(t, s);
|
|
10417
10417
|
return s.y >= t.y && s.y + s.h <= a && (i >= 0.45 || o >= 0.45);
|
|
10418
10418
|
}).sort((s, i) => s.box.y - i.box.y || s.box.x - i.box.x || s.card.id.localeCompare(i.card.id));
|
|
@@ -10420,7 +10420,7 @@ function ak(e, t, n) {
|
|
|
10420
10420
|
function ea(e) {
|
|
10421
10421
|
var a, s, i, o;
|
|
10422
10422
|
if (e.kind === "container") return !1;
|
|
10423
|
-
const t = L((a = e.meta) == null ? void 0 : a.dataShape) ?? L(
|
|
10423
|
+
const t = L((a = e.meta) == null ? void 0 : a.dataShape) ?? L(Z(e.renderData) ? e.renderData.shape : void 0), n = !!(qa(e) || L((s = e.dataBinding) == null ? void 0 : s.status) || L((i = e.dataBinding) == null ? void 0 : i.queryIntent) || L((o = e.dataBinding) == null ? void 0 : o.refreshApi)), r = e.kind === "placeholder" || e.kind === "metric" || e.kind === "chart" || e.kind === "table" || e.kind === "list" || t === "metricSummary" || t === "singleSeries" || t === "multiSeries" || t === "rows" || t === "categoryRanking";
|
|
10424
10424
|
return n && r;
|
|
10425
10425
|
}
|
|
10426
10426
|
function Wu(e) {
|
|
@@ -10442,7 +10442,7 @@ function Na(e, t) {
|
|
|
10442
10442
|
function sk(e) {
|
|
10443
10443
|
if (e.kind !== "container" || ae(e) !== "image") return !1;
|
|
10444
10444
|
if (Te(e)) return !0;
|
|
10445
|
-
const t = yt(e), n =
|
|
10445
|
+
const t = yt(e), n = ie(e);
|
|
10446
10446
|
return !!(n && n.x <= 1 && n.y <= 1 && n.w >= 18 && n.h <= 4 && /工作台|workbench|workspace/i.test(t) && !/GLOBAL RISK POSTURE|risk posture|TODAY MOVEMENT/i.test(t));
|
|
10447
10447
|
}
|
|
10448
10448
|
function Ot(e) {
|
|
@@ -10453,7 +10453,7 @@ function yr(e) {
|
|
|
10453
10453
|
}
|
|
10454
10454
|
function Vt(e) {
|
|
10455
10455
|
if (e.kind !== "container" || ae(e) !== "image") return !1;
|
|
10456
|
-
const t =
|
|
10456
|
+
const t = Z(e.renderData) ? e.renderData : {}, n = [
|
|
10457
10457
|
e.title,
|
|
10458
10458
|
e.subtitle,
|
|
10459
10459
|
t.title,
|
|
@@ -10463,11 +10463,11 @@ function Vt(e) {
|
|
|
10463
10463
|
].filter((r) => typeof r == "string" && r.trim()).join(" ");
|
|
10464
10464
|
return /TODAY MOVEMENT|今日异动|风险异动|经营异动/i.test(n) && !/GLOBAL RISK POSTURE|risk posture|风险总览|风险概览|顶部风险/i.test(n);
|
|
10465
10465
|
}
|
|
10466
|
-
function
|
|
10466
|
+
function Z(e) {
|
|
10467
10467
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
10468
10468
|
}
|
|
10469
10469
|
function Ou(e) {
|
|
10470
|
-
const t = {}, n =
|
|
10470
|
+
const t = {}, n = Z(e.appearance) ? e.appearance : {}, r = L(n.businessSummaryBand) === "risk", a = Te(e), s = yr(e);
|
|
10471
10471
|
for (const [i, o] of Object.entries(n))
|
|
10472
10472
|
if (i !== "businessSummaryBand" && !(r && !s && ik(i))) {
|
|
10473
10473
|
if (typeof o == "string") {
|
|
@@ -10479,7 +10479,7 @@ function Ou(e) {
|
|
|
10479
10479
|
Number.isFinite(o) && (t[i] = o);
|
|
10480
10480
|
continue;
|
|
10481
10481
|
}
|
|
10482
|
-
(typeof o == "boolean" ||
|
|
10482
|
+
(typeof o == "boolean" || Z(o) || Array.isArray(o)) && (t[i] = o);
|
|
10483
10483
|
}
|
|
10484
10484
|
return a && (t.visualRole = "page_header", t.themeId || (t.themeId = "image-header-banner"), t.density || (t.density = "compact")), s && (t.businessSummaryBand = "risk", t.backgroundColor || (t.backgroundColor = "#172235"), t.textColor || (t.textColor = "#F8FAFC"), t.borderColor || (t.borderColor = "#172235"), t.cardShadow || (t.cardShadow = "none"), t.density || (t.density = "compact")), Object.keys(t).length > 0 ? t : void 0;
|
|
10485
10485
|
}
|
|
@@ -10488,8 +10488,8 @@ function ik(e) {
|
|
|
10488
10488
|
}
|
|
10489
10489
|
function Lu(e) {
|
|
10490
10490
|
var t;
|
|
10491
|
-
if (
|
|
10492
|
-
if (
|
|
10491
|
+
if (Z(e.fallback)) return e.fallback;
|
|
10492
|
+
if (Z((t = e.meta) == null ? void 0 : t.fallback)) return e.meta.fallback;
|
|
10493
10493
|
}
|
|
10494
10494
|
function ok(e) {
|
|
10495
10495
|
if (!e || e.manualAction !== "replace_card") return;
|
|
@@ -10503,7 +10503,7 @@ function ok(e) {
|
|
|
10503
10503
|
...i ? { reason: i } : {},
|
|
10504
10504
|
action: "replace_card",
|
|
10505
10505
|
...o ? { queryIntent: o } : {},
|
|
10506
|
-
...
|
|
10506
|
+
...Z(e.originalRegion) ? { originalRegion: e.originalRegion } : {}
|
|
10507
10507
|
};
|
|
10508
10508
|
}
|
|
10509
10509
|
function Hy(e) {
|
|
@@ -10549,7 +10549,7 @@ function qa(e) {
|
|
|
10549
10549
|
function Nf(e, t) {
|
|
10550
10550
|
const n = Ay(t);
|
|
10551
10551
|
if (!n) return e;
|
|
10552
|
-
const r = qa(t), a = L(n.status), s = L(n.lastError) ?? L(n.lastRefreshError) ?? L(n.error), i = a === "error" &&
|
|
10552
|
+
const r = qa(t), a = L(n.status), s = L(n.lastError) ?? L(n.lastRefreshError) ?? L(n.error), i = a === "error" && Z(n.humanIntervention) ? n.humanIntervention : void 0, o = { ...e };
|
|
10553
10553
|
return a && a !== "error" && (delete o.dataBindingError, delete o.dataBindingHumanIntervention, delete o.humanIntervention), a && delete o.dataBindingStatus, {
|
|
10554
10554
|
...o,
|
|
10555
10555
|
...r ? { dataBindingId: r } : {},
|
|
@@ -10560,11 +10560,11 @@ function Nf(e, t) {
|
|
|
10560
10560
|
};
|
|
10561
10561
|
}
|
|
10562
10562
|
function ck(e, t, n, r = /* @__PURE__ */ new Map(), a, s, i) {
|
|
10563
|
-
const o =
|
|
10563
|
+
const o = Z(e.renderData) ? e.renderData : {};
|
|
10564
10564
|
if (e.kind === "container")
|
|
10565
10565
|
return Nf(G_(e, o, r, a, s, i), e);
|
|
10566
10566
|
const c = oI(e, o), d = Ky(t, n), l = n ? {
|
|
10567
|
-
...
|
|
10567
|
+
...Z(e.recognition) ? { recognition: e.recognition } : {},
|
|
10568
10568
|
...d ? { fallback: d } : {}
|
|
10569
10569
|
} : {}, m = n ? {
|
|
10570
10570
|
...c,
|
|
@@ -10574,8 +10574,8 @@ function ck(e, t, n, r = /* @__PURE__ */ new Map(), a, s, i) {
|
|
|
10574
10574
|
return Nf(m, e);
|
|
10575
10575
|
}
|
|
10576
10576
|
function dk(e, t) {
|
|
10577
|
-
var
|
|
10578
|
-
const n = Lu(e), r = ok(n), a = Ky(n, r), s = ae(e, t.source), i = Fu(e, s), o = i === e.title ? e : { ...e, title: i }, c = ((
|
|
10577
|
+
var J, q, ce, Ee, lt, ft, tn, Dt;
|
|
10578
|
+
const n = Lu(e), r = ok(n), a = Ky(n, r), s = ae(e, t.source), i = Fu(e, s), o = i === e.title ? e : { ...e, title: i }, c = ((J = t.projectionIndexes) == null ? void 0 : J.siblingById) ?? Pu(t.siblingCards), d = t.topLevelCardIds ?? ((q = t.projectionIndexes) == null ? void 0 : q.topLevelCardIds) ?? Cy(t.siblingCards ?? [e], c, (ce = t.projectionIndexes) == null ? void 0 : ce.childIdsByContainerId), l = ck(o, n, r, c, s, d, t.projectionIndexes), m = e.layout || { i: e.id, x: 0, y: 0, w: 6, h: 4 }, p = Qy(e, c, d), y = Jy(e, c, d), I = p || y ? { ...m, ...y ?? {}, ...p ?? {}, i: e.id } : js(e, m, c, /* @__PURE__ */ new Set(), (Ee = t.projectionIndexes) == null ? void 0 : Ee.childIdsByContainerId), w = Uy(e, I), k = gk(e, w, c), F = Ou(e), D = aI(e), W = typeof D.capabilityId == "string" ? D.capabilityId : e.id, V = L((lt = e.dataBinding) == null ? void 0 : lt.status), G = V === "running" ? "running" : V === "error" ? "failed" : "ready";
|
|
10579
10579
|
return {
|
|
10580
10580
|
id: e.id,
|
|
10581
10581
|
version: 1,
|
|
@@ -10609,7 +10609,7 @@ function dk(e, t) {
|
|
|
10609
10609
|
},
|
|
10610
10610
|
data: l,
|
|
10611
10611
|
meta: {
|
|
10612
|
-
...
|
|
10612
|
+
...Z(e.meta) ? e.meta : {},
|
|
10613
10613
|
...D,
|
|
10614
10614
|
...F ? { visual: F } : {},
|
|
10615
10615
|
...s ? { composeSource: s } : {},
|
|
@@ -10677,13 +10677,13 @@ function uk(e, t, n, r, a) {
|
|
|
10677
10677
|
w: (c == null ? void 0 : c.w) ?? I(k ?? 24),
|
|
10678
10678
|
h: Math.max(Math.ceil(F * s), W_)
|
|
10679
10679
|
};
|
|
10680
|
-
const D = Math.ceil(ky(e) * s), W = bk(e, t, n, r, a),
|
|
10680
|
+
const D = Math.ceil(ky(e) * s), W = bk(e, t, n, r, a), V = Math.max(Math.ceil(F * s), b_), G = ae(e) === "image" && Ak(e, t, w, n, r, a), J = ae(e) === "image" && wk(e, t, w, n, r, a), q = J ? Sk(e, t, w, n, r, a) : 0, ce = W > 0 && !G ? Math.ceil(F * s) : V;
|
|
10681
10681
|
return {
|
|
10682
10682
|
...y,
|
|
10683
10683
|
w: (c == null ? void 0 : c.w) ?? I(k ?? 12),
|
|
10684
10684
|
h: Math.max(
|
|
10685
10685
|
ce,
|
|
10686
|
-
|
|
10686
|
+
J ? q : W,
|
|
10687
10687
|
D
|
|
10688
10688
|
)
|
|
10689
10689
|
};
|
|
@@ -10705,7 +10705,7 @@ function fk(e, t) {
|
|
|
10705
10705
|
return Math.max(0, ...n.filter((r) => r.id !== e.id || t.size > 1).filter((r) => ae(r) === "image").map((r) => zy(r)).filter((r) => !!r).map((r) => r.x + r.width));
|
|
10706
10706
|
}
|
|
10707
10707
|
function zy(e) {
|
|
10708
|
-
const t =
|
|
10708
|
+
const t = Z(e.recognition) ? e.recognition : void 0, n = Z(t == null ? void 0 : t.bbox) ? t.bbox : void 0, r = H(n == null ? void 0 : n.x), a = H(n == null ? void 0 : n.y), s = H(n == null ? void 0 : n.width), i = H(n == null ? void 0 : n.height);
|
|
10709
10709
|
if (!(r === void 0 || a === void 0 || s === void 0 || i === void 0 || s <= 0 || i <= 0))
|
|
10710
10710
|
return { x: Math.max(0, r), y: Math.max(0, a), width: s, height: i };
|
|
10711
10711
|
}
|
|
@@ -10731,27 +10731,27 @@ function Yy(e) {
|
|
|
10731
10731
|
function Qy(e, t, n) {
|
|
10732
10732
|
var w, k, F, D;
|
|
10733
10733
|
if (ae(e) !== "image") return;
|
|
10734
|
-
const r =
|
|
10734
|
+
const r = ie(e);
|
|
10735
10735
|
if (!r || e.kind !== "metric" && !yc(e)) return;
|
|
10736
10736
|
const a = [...t.values()].filter((W) => {
|
|
10737
10737
|
if (n && !n.has(W.id) || ae(W) !== "image") return !1;
|
|
10738
|
-
const
|
|
10739
|
-
return !!(
|
|
10740
|
-
}).sort((W,
|
|
10741
|
-
var G,
|
|
10742
|
-
return (H((G = W.layout) == null ? void 0 : G.x) ?? 0) - (H((
|
|
10738
|
+
const V = ie(W);
|
|
10739
|
+
return !!(V && V.h <= 4 && (W.kind === "metric" || yc(W)) && fr(r, V));
|
|
10740
|
+
}).sort((W, V) => {
|
|
10741
|
+
var G, J;
|
|
10742
|
+
return (H((G = W.layout) == null ? void 0 : G.x) ?? 0) - (H((J = V.layout) == null ? void 0 : J.x) ?? 0);
|
|
10743
10743
|
}), s = a.filter((W) => W.kind === "metric"), i = a.filter(yc);
|
|
10744
10744
|
if (a.length !== 6 || s.length !== 5 || i.length !== 1) return;
|
|
10745
10745
|
const o = i[0];
|
|
10746
10746
|
if (!o || ((w = a[a.length - 1]) == null ? void 0 : w.id) !== o.id) return;
|
|
10747
10747
|
const c = H((F = (k = a[0]) == null ? void 0 : k.layout) == null ? void 0 : F.x) ?? 0, d = Math.max(...a.map((W) => {
|
|
10748
|
-
const
|
|
10749
|
-
return
|
|
10748
|
+
const V = ie(W);
|
|
10749
|
+
return V ? V.x + V.w : c;
|
|
10750
10750
|
})), l = Math.max(1, d - c), m = Math.min(l * 0.3, Math.max(l * 0.24, 6)), p = (l - m) / s.length, y = a.findIndex((W) => W.id === e.id);
|
|
10751
10751
|
if (y < 0) return;
|
|
10752
10752
|
const I = Math.min(...a.map((W) => {
|
|
10753
|
-
var
|
|
10754
|
-
return H((
|
|
10753
|
+
var V;
|
|
10754
|
+
return H((V = W.layout) == null ? void 0 : V.y) ?? r.y;
|
|
10755
10755
|
}));
|
|
10756
10756
|
return {
|
|
10757
10757
|
x: Math.round((c + p * y) * 1e3) / 1e3,
|
|
@@ -10772,7 +10772,7 @@ function Jy(e, t, n) {
|
|
|
10772
10772
|
const a = [...t.values()].filter((w) => {
|
|
10773
10773
|
var F;
|
|
10774
10774
|
if (n && !n.has(w.id) || ae(w) !== "image" || H((F = w.layout) == null ? void 0 : F.y) !== r) return !1;
|
|
10775
|
-
const k =
|
|
10775
|
+
const k = ie(w);
|
|
10776
10776
|
return !!(k && k.h <= tr && w.kind === "metric");
|
|
10777
10777
|
}).sort((w, k) => {
|
|
10778
10778
|
var F, D;
|
|
@@ -10810,14 +10810,14 @@ function hk(e) {
|
|
|
10810
10810
|
}
|
|
10811
10811
|
function Nu(e) {
|
|
10812
10812
|
if (e.kind !== "container" || ae(e) !== "image" || Te(e) || yr(e)) return !1;
|
|
10813
|
-
const t =
|
|
10813
|
+
const t = ie(e);
|
|
10814
10814
|
return t && t.w > 8 ? !1 : /故障|告警|红警|置顶|P1|P2|incident|alert|alarm|fault|warning|critical/i.test(qu(e));
|
|
10815
10815
|
}
|
|
10816
10816
|
function pk(e) {
|
|
10817
10817
|
return /故障|告警|红警|异常|慢查询|接口|数据库|DBA|云资源|资源|存储|水位|P1|P2|incident|alert|alarm|fault|warning|critical|error|MES/i.test(e);
|
|
10818
10818
|
}
|
|
10819
10819
|
function qu(e) {
|
|
10820
|
-
const t =
|
|
10820
|
+
const t = Z(e.renderData) ? e.renderData : {};
|
|
10821
10821
|
return [
|
|
10822
10822
|
yt(e),
|
|
10823
10823
|
t.displayValue,
|
|
@@ -10829,7 +10829,7 @@ function qu(e) {
|
|
|
10829
10829
|
}
|
|
10830
10830
|
function en(e) {
|
|
10831
10831
|
if (e.kind !== "container" || ae(e) !== "image") return !1;
|
|
10832
|
-
const t =
|
|
10832
|
+
const t = Z(e.renderData) ? e.renderData : {};
|
|
10833
10833
|
return e.capabilityId === "card.composite.bidCollaboration.actions" || t.visualKind === "quickLinks" || /快捷入口|协同动作入口|quick\s*links?/i.test(qu(e));
|
|
10834
10834
|
}
|
|
10835
10835
|
function gk(e, t, n) {
|
|
@@ -10842,7 +10842,7 @@ function gk(e, t, n) {
|
|
|
10842
10842
|
return i ? yk(e, a, d, n) : d;
|
|
10843
10843
|
}
|
|
10844
10844
|
function yk(e, t, n, r) {
|
|
10845
|
-
const a =
|
|
10845
|
+
const a = ie({ ...e, layout: n }), s = ie(t);
|
|
10846
10846
|
if (!a || !s)
|
|
10847
10847
|
return {
|
|
10848
10848
|
...n,
|
|
@@ -10871,7 +10871,7 @@ function yk(e, t, n, r) {
|
|
|
10871
10871
|
};
|
|
10872
10872
|
}
|
|
10873
10873
|
function Ik(e, t) {
|
|
10874
|
-
const n = hn(e, t).map((a) => t.get(a)).filter((a) => !!a).map((a) => ({ card: a, box:
|
|
10874
|
+
const n = hn(e, t).map((a) => t.get(a)).filter((a) => !!a).map((a) => ({ card: a, box: ie(a) })).filter((a) => !!a.box).sort((a, s) => a.box.y - s.box.y || a.box.x - s.box.x || a.card.id.localeCompare(s.card.id)), r = [];
|
|
10875
10875
|
for (const a of n) {
|
|
10876
10876
|
const s = r.find((i) => i.some((o) => fr(o.box, a.box)));
|
|
10877
10877
|
s ? s.push(a) : r.push([a]);
|
|
@@ -10879,11 +10879,11 @@ function Ik(e, t) {
|
|
|
10879
10879
|
return r;
|
|
10880
10880
|
}
|
|
10881
10881
|
function Xy(e, t, n, r = e, a) {
|
|
10882
|
-
var W,
|
|
10882
|
+
var W, V;
|
|
10883
10883
|
const s = Fk(t, n, a == null ? void 0 : a.childIdsByContainerId), o = ((a == null ? void 0 : a.nestedOwnerByChildId.get(t.id)) ?? $s(n, a == null ? void 0 : a.childIdsByContainerId).get(t.id)) === e.id && !Zr(e, n).includes(t.id), c = r.id !== e.id && My(t.id, e.id, n, a == null ? void 0 : a.childIdsByContainerId);
|
|
10884
10884
|
if (ae(t) !== "image" || ((W = t.layout) == null ? void 0 : W.parentId) !== e.id && !o && !c)
|
|
10885
10885
|
return s;
|
|
10886
|
-
const d = e.layout, l = H(d == null ? void 0 : d.x), m = H(d == null ? void 0 : d.y), p = H(d == null ? void 0 : d.w), y = H(d == null ? void 0 : d.h), I = H(s.x), w = H(s.y), k = H(s.w), F = H(s.h), D = L((
|
|
10886
|
+
const d = e.layout, l = H(d == null ? void 0 : d.x), m = H(d == null ? void 0 : d.y), p = H(d == null ? void 0 : d.w), y = H(d == null ? void 0 : d.h), I = H(s.x), w = H(s.y), k = H(s.w), F = H(s.h), D = L((V = t.layout) == null ? void 0 : V.slot);
|
|
10887
10887
|
return l === void 0 || m === void 0 || p === void 0 || y === void 0 || I === void 0 || w === void 0 || k === void 0 || F === void 0 || !Zy(
|
|
10888
10888
|
D,
|
|
10889
10889
|
{ x: I, y: w, w: k, h: F },
|
|
@@ -11095,9 +11095,9 @@ function js(e, t, n, r = /* @__PURE__ */ new Set(), a) {
|
|
|
11095
11095
|
if (e.kind !== "container" || r.has(e.id)) return s;
|
|
11096
11096
|
const d = /* @__PURE__ */ new Set([...r, e.id]), l = kk(e, n), m = Math.max(i, (l == null ? void 0 : l.w) ?? 0, xk(e, n, s)), p = ky(e), y = pt(e, n, a).reduce((w, k) => {
|
|
11097
11097
|
const F = n.get(k);
|
|
11098
|
-
if (!F || !
|
|
11099
|
-
const D = Mk(s, F.layout), W = js(F, F.layout, n, d, a),
|
|
11100
|
-
return D === void 0 ||
|
|
11098
|
+
if (!F || !Z(F.layout)) return w;
|
|
11099
|
+
const D = Mk(s, F.layout), W = js(F, F.layout, n, d, a), V = H(W.h);
|
|
11100
|
+
return D === void 0 || V === void 0 ? w : Math.max(w, D + V);
|
|
11101
11101
|
}, 0), I = Math.max(o, y, (l == null ? void 0 : l.h) ?? 0, p);
|
|
11102
11102
|
return {
|
|
11103
11103
|
...s,
|
|
@@ -11108,7 +11108,7 @@ function js(e, t, n, r = /* @__PURE__ */ new Set(), a) {
|
|
|
11108
11108
|
};
|
|
11109
11109
|
}
|
|
11110
11110
|
function kk(e, t) {
|
|
11111
|
-
const n =
|
|
11111
|
+
const n = ie(e);
|
|
11112
11112
|
if (!n) return;
|
|
11113
11113
|
const r = La(e, n, t);
|
|
11114
11114
|
if (r.length === 0) return;
|
|
@@ -11151,9 +11151,9 @@ function ae(e, t) {
|
|
|
11151
11151
|
const n = L(t);
|
|
11152
11152
|
if (n) return n === "image" ? "image" : void 0;
|
|
11153
11153
|
if (L((s = e.meta) == null ? void 0 : s.composeSource) === "image") return "image";
|
|
11154
|
-
const r =
|
|
11154
|
+
const r = Z(e.recognition) ? e.recognition : void 0;
|
|
11155
11155
|
if (L(r == null ? void 0 : r.source) === "image") return "image";
|
|
11156
|
-
const a =
|
|
11156
|
+
const a = Z(e.renderData) ? e.renderData : void 0;
|
|
11157
11157
|
return L(a == null ? void 0 : a.source) === "image" || typeof e.capabilityId == "string" && e.capabilityId.startsWith("workbench.v2.image.") ? "image" : void 0;
|
|
11158
11158
|
}
|
|
11159
11159
|
function L(e) {
|
|
@@ -11191,7 +11191,7 @@ function ts(e) {
|
|
|
11191
11191
|
}
|
|
11192
11192
|
function cI(e, t) {
|
|
11193
11193
|
if (ae(e) !== "image") return t;
|
|
11194
|
-
const n =
|
|
11194
|
+
const n = Z(e.renderData) ? e.renderData : {}, r = { ...t }, a = L(t.source);
|
|
11195
11195
|
a && !ts(a) && (r.querySource = L(t.querySource) ?? a);
|
|
11196
11196
|
const s = L(n.source);
|
|
11197
11197
|
s && !ts(s) && !r.querySource && (r.querySource = s), (ts(n.source) || ts(n.snapshotSource) || ae(e) === "image") && (r.source = ts(s) ? s : "image", r.snapshotSource = L(n.snapshotSource) ?? "image");
|
|
@@ -11230,14 +11230,14 @@ function Pk(e, t) {
|
|
|
11230
11230
|
};
|
|
11231
11231
|
}
|
|
11232
11232
|
function Bk(e) {
|
|
11233
|
-
if (e.shape === "rows" && Array.isArray(e.columns) && Array.isArray(e.rows) && e.rows.every((i) =>
|
|
11233
|
+
if (e.shape === "rows" && Array.isArray(e.columns) && Array.isArray(e.rows) && e.rows.every((i) => Z(i) && Array.isArray(i.cells))) {
|
|
11234
11234
|
const i = zi(e, e.columns);
|
|
11235
11235
|
return {
|
|
11236
11236
|
...e,
|
|
11237
11237
|
columns: e.columns.map((o, c) => Ui(o, c, i))
|
|
11238
11238
|
};
|
|
11239
11239
|
}
|
|
11240
|
-
const t = Array.isArray(e.rows) ? e.rows.filter(
|
|
11240
|
+
const t = Array.isArray(e.rows) ? e.rows.filter(Z) : [], n = Array.isArray(e.columns) && e.columns.length > 0 ? e.columns : t[0] ? Object.keys(t[0]).filter((i) => i !== "id") : [], r = zi(e, n), a = Hk(n, t), s = a.map(jr);
|
|
11241
11241
|
return {
|
|
11242
11242
|
...e,
|
|
11243
11243
|
shape: "rows",
|
|
@@ -11260,7 +11260,7 @@ function Ek(e) {
|
|
|
11260
11260
|
};
|
|
11261
11261
|
}
|
|
11262
11262
|
function Wk(e, t) {
|
|
11263
|
-
const n =
|
|
11263
|
+
const n = Z(e) ? e : { label: e }, r = L(n.label) ?? L(n.title) ?? L(n.name) ?? String(t + 1), a = L(n.value) ?? L(n.amount) ?? L(n.status) ?? L(n.badge), s = H(n.value) ?? H(n.amount) ?? t + 1;
|
|
11264
11264
|
return {
|
|
11265
11265
|
label: r,
|
|
11266
11266
|
value: s,
|
|
@@ -11287,7 +11287,7 @@ function dI(e, t) {
|
|
|
11287
11287
|
return (((r = L(e.chartType)) == null ? void 0 : r.toLowerCase()) || ((s = L((a = t.meta) == null ? void 0 : a.rendererKey)) == null ? void 0 : s.toLowerCase()) || ((i = L(t.capabilityId)) == null ? void 0 : i.toLowerCase()) || "").includes("line") ? "line" : "bar";
|
|
11288
11288
|
}
|
|
11289
11289
|
function uI(e, t) {
|
|
11290
|
-
return Array.isArray(e) ? e.filter(
|
|
11290
|
+
return Array.isArray(e) ? e.filter(Z).map((n, r) => {
|
|
11291
11291
|
const a = L(n.type), s = Array.isArray(n.data) ? n.data : [];
|
|
11292
11292
|
return {
|
|
11293
11293
|
name: L(n.name) ?? `series-${r + 1}`,
|
|
@@ -11314,7 +11314,7 @@ function Nk(e, t, n) {
|
|
|
11314
11314
|
};
|
|
11315
11315
|
}
|
|
11316
11316
|
function jr(e, t) {
|
|
11317
|
-
return typeof e == "string" && e.trim() ? e.trim() :
|
|
11317
|
+
return typeof e == "string" && e.trim() ? e.trim() : Z(e) ? L(e.key) ?? L(e.dataIndex) ?? L(e.name) ?? L(e.label) ?? `column-${t + 1}` : `column-${t + 1}`;
|
|
11318
11318
|
}
|
|
11319
11319
|
function qk(e) {
|
|
11320
11320
|
return /[\u3400-\u9fff]/u.test(e);
|
|
@@ -11327,7 +11327,7 @@ function sn(e, t) {
|
|
|
11327
11327
|
return !n || $f(n) === $f(t) ? "" : qk(n) ? n : "";
|
|
11328
11328
|
}
|
|
11329
11329
|
function $k(e) {
|
|
11330
|
-
return
|
|
11330
|
+
return Z(e) ? Object.fromEntries(Object.entries(e).flatMap(([t, n]) => {
|
|
11331
11331
|
const r = sn(n, t);
|
|
11332
11332
|
return r ? [[t, r]] : [];
|
|
11333
11333
|
})) : {};
|
|
@@ -11336,13 +11336,13 @@ function Vf(e, t) {
|
|
|
11336
11336
|
if (!Array.isArray(e)) return {};
|
|
11337
11337
|
const n = t.map(jr);
|
|
11338
11338
|
return Object.fromEntries(e.flatMap((r, a) => {
|
|
11339
|
-
const s = (
|
|
11339
|
+
const s = (Z(r) ? jr(r, a) : n[a]) || "", i = Z(r) ? sn(r.label, s) || sn(r.title, s) || sn(r.displayName, s) || sn(r.nameCn, s) || sn(r.name_cn, s) : sn(r, s);
|
|
11340
11340
|
return s && i ? [[s, i]] : [];
|
|
11341
11341
|
}));
|
|
11342
11342
|
}
|
|
11343
11343
|
function Vk(e, t) {
|
|
11344
11344
|
if (!Array.isArray(e)) return {};
|
|
11345
|
-
const n = e.find(
|
|
11345
|
+
const n = e.find(Z);
|
|
11346
11346
|
if (!n) return {};
|
|
11347
11347
|
const r = t.map(jr);
|
|
11348
11348
|
return Object.fromEntries(Object.keys(n).flatMap((a, s) => {
|
|
@@ -11360,7 +11360,7 @@ function zi(e, t) {
|
|
|
11360
11360
|
}
|
|
11361
11361
|
function Ui(e, t, n = {}) {
|
|
11362
11362
|
if (typeof e == "string" && e.trim()) return n[e.trim()] || e.trim();
|
|
11363
|
-
if (
|
|
11363
|
+
if (Z(e)) {
|
|
11364
11364
|
const r = jr(e, t);
|
|
11365
11365
|
return n[r] || sn(e.label, r) || sn(e.title, r) || sn(e.displayName, r) || r || f("FWA.dd781787570960835", { p0: t + 1 });
|
|
11366
11366
|
}
|
|
@@ -11382,14 +11382,14 @@ function Kk(e, t, n) {
|
|
|
11382
11382
|
}
|
|
11383
11383
|
function jk(e, t, n) {
|
|
11384
11384
|
if (!Kk(e, t, n)) return t.data;
|
|
11385
|
-
if (t.data.shape === "rows" && Array.isArray(t.data.columns) && t.data.columns.every((l) => typeof l == "string") && Array.isArray(t.data.rows) && t.data.rows.every((l) =>
|
|
11385
|
+
if (t.data.shape === "rows" && Array.isArray(t.data.columns) && t.data.columns.every((l) => typeof l == "string") && Array.isArray(t.data.rows) && t.data.rows.every((l) => Z(l) && Array.isArray(l.cells))) {
|
|
11386
11386
|
const l = zi(t.data, t.data.columns);
|
|
11387
11387
|
return {
|
|
11388
11388
|
...t.data,
|
|
11389
11389
|
columns: t.data.columns.map((m, p) => Ui(m, p, l))
|
|
11390
11390
|
};
|
|
11391
11391
|
}
|
|
11392
|
-
const r = Array.isArray(t.data.rows) ? t.data.rows.filter(
|
|
11392
|
+
const r = Array.isArray(t.data.rows) ? t.data.rows.filter(Z) : [], a = r[0] ? Object.keys(r[0]).filter((l) => l !== "id") : [], s = Array.isArray(t.data.columns) && t.data.columns.length > 0 ? t.data.columns : a, i = zi(t.data, s), o = s.map(jr), c = s.map((l, m) => Ui(l, m, i)), d = r.map((l, m) => ({
|
|
11393
11393
|
id: L(l.id) ?? `row-${m + 1}`,
|
|
11394
11394
|
cells: o.map((p) => lI(l[p]))
|
|
11395
11395
|
}));
|
|
@@ -11411,7 +11411,7 @@ function zk(e, t, n) {
|
|
|
11411
11411
|
{ ...t, data: Nk(e, t, n) },
|
|
11412
11412
|
n
|
|
11413
11413
|
);
|
|
11414
|
-
const r = t.data, a =
|
|
11414
|
+
const r = t.data, a = Z(e.renderData) ? e.renderData : {}, s = sI(r, a), i = H(r.primaryValue) ?? H(r.value) ?? H(a.primaryValue) ?? 0;
|
|
11415
11415
|
return {
|
|
11416
11416
|
...r,
|
|
11417
11417
|
shape: "metricSummary",
|
|
@@ -15918,8 +15918,8 @@ function Zu(e, t) {
|
|
|
15918
15918
|
const F = ka(w[i]) || f("FWA.7be51787570967389", { p0: k + 1 }), D = ka(w[o]), W = o0(w[c]);
|
|
15919
15919
|
if (!D || W === void 0) return;
|
|
15920
15920
|
m.has(F) || (m.add(F), d.push(F)), p.has(D) || (p.add(D), l.push(D));
|
|
15921
|
-
const
|
|
15922
|
-
|
|
15921
|
+
const V = y.get(D) ?? /* @__PURE__ */ new Map();
|
|
15922
|
+
V.set(F, (V.get(F) ?? 0) + W), y.set(D, V);
|
|
15923
15923
|
}), d.length === 0 || l.length < 2) return null;
|
|
15924
15924
|
const I = s[c] || c;
|
|
15925
15925
|
return {
|
|
@@ -16007,7 +16007,7 @@ function OD(e, t) {
|
|
|
16007
16007
|
if (i.length === 0) return e;
|
|
16008
16008
|
const o = Zi(n.yAxis) && !Zi(n.xAxis) ? "yAxis" : "xAxis", c = o === "yAxis" ? "xAxis" : "yAxis", d = o === "yAxis" ? n.yAxis : n.xAxis, l = !!s || !p0(d) || RD(d) !== i.length, m = xD(n[c]), p = JSON.stringify(m) !== JSON.stringify(n[c]), y = n.series;
|
|
16009
16009
|
if (s) {
|
|
16010
|
-
const G = xm(n.dataZoom, i),
|
|
16010
|
+
const G = xm(n.dataZoom, i), J = Fm({
|
|
16011
16011
|
...n,
|
|
16012
16012
|
...o === "yAxis" ? { yAxis: us(n.yAxis, i) } : { xAxis: us(n.xAxis, i) },
|
|
16013
16013
|
...c === "yAxis" ? { yAxis: p ? m : n.yAxis } : { xAxis: p ? m : n.xAxis },
|
|
@@ -16015,27 +16015,27 @@ function OD(e, t) {
|
|
|
16015
16015
|
legend: BD(n.legend, s.seriesLabels),
|
|
16016
16016
|
...G !== void 0 ? { dataZoom: G } : {}
|
|
16017
16017
|
});
|
|
16018
|
-
return delete
|
|
16018
|
+
return delete J.title, {
|
|
16019
16019
|
...e,
|
|
16020
|
-
option:
|
|
16020
|
+
option: J
|
|
16021
16021
|
};
|
|
16022
16022
|
}
|
|
16023
|
-
const I = b0(t, a), w = Array.isArray(y) ? y : x(y) ? [y] : [], k = w.filter(x), F = I.length > 0 && k.length > 0 && v0(k) ? WD(k, a, I) : I.length > 0 && w.length > 0 ? w.map((G,
|
|
16023
|
+
const I = b0(t, a), w = Array.isArray(y) ? y : x(y) ? [y] : [], k = w.filter(x), F = I.length > 0 && k.length > 0 && v0(k) ? WD(k, a, I) : I.length > 0 && w.length > 0 ? w.map((G, J) => {
|
|
16024
16024
|
if (!x(G)) return G;
|
|
16025
|
-
const q = I[
|
|
16025
|
+
const q = I[J] || I[0], ce = a.map((lt) => lt[q]);
|
|
16026
16026
|
return (Array.isArray(G.data) ? G.data : []).length === ce.length ? G : { ...G, data: ce };
|
|
16027
|
-
}) : w, D = F.some((G,
|
|
16027
|
+
}) : w, D = F.some((G, J) => G !== w[J]), W = xm(n.dataZoom, i);
|
|
16028
16028
|
if (!l && !p && !D && W === void 0) return e;
|
|
16029
|
-
const
|
|
16029
|
+
const V = Fm({
|
|
16030
16030
|
...n,
|
|
16031
16031
|
...o === "yAxis" ? { yAxis: l ? us(n.yAxis, i) : n.yAxis } : { xAxis: l ? us(n.xAxis, i) : n.xAxis },
|
|
16032
16032
|
...c === "yAxis" ? { yAxis: p ? m : n.yAxis } : { xAxis: p ? m : n.xAxis },
|
|
16033
16033
|
...D ? { series: Array.isArray(y) ? F : F[0] } : {},
|
|
16034
16034
|
...W !== void 0 ? { dataZoom: W } : {}
|
|
16035
16035
|
});
|
|
16036
|
-
return delete
|
|
16036
|
+
return delete V.title, {
|
|
16037
16037
|
...e,
|
|
16038
|
-
option:
|
|
16038
|
+
option: V
|
|
16039
16039
|
};
|
|
16040
16040
|
}
|
|
16041
16041
|
function LD(e, t) {
|
|
@@ -16418,11 +16418,11 @@ function f8(e) {
|
|
|
16418
16418
|
l ? u8(E(r.renderer), l) : E(r.renderer),
|
|
16419
16419
|
m,
|
|
16420
16420
|
p
|
|
16421
|
-
), I = R0(m, p), w = Ke(e), F = Po(e), D = Object.keys(F).length > 0, W = zu(F),
|
|
16421
|
+
), I = R0(m, p), w = Ke(e), F = Po(e), D = Object.keys(F).length > 0, W = zu(F), V = R(F.status), G = R(F.filterSummary), J = _0({
|
|
16422
16422
|
...I,
|
|
16423
16423
|
...!I.dataBinding && D ? { dataBinding: F } : {},
|
|
16424
16424
|
...!I.dataBindingId && W ? { dataBindingId: W } : {},
|
|
16425
|
-
...!I.dataBindingStatus &&
|
|
16425
|
+
...!I.dataBindingStatus && V ? { dataBindingStatus: V } : {},
|
|
16426
16426
|
...!I.filterSummary && G ? { filterSummary: G } : {}
|
|
16427
16427
|
}, F);
|
|
16428
16428
|
return il({
|
|
@@ -16431,7 +16431,7 @@ function f8(e) {
|
|
|
16431
16431
|
title: r0(e, r),
|
|
16432
16432
|
renderer: Object.keys(y).length > 0 ? y : r.renderer,
|
|
16433
16433
|
...D ? { dataBinding: F } : {},
|
|
16434
|
-
data:
|
|
16434
|
+
data: J,
|
|
16435
16435
|
layout: {
|
|
16436
16436
|
...r.layout,
|
|
16437
16437
|
i: a
|
|
@@ -16651,17 +16651,17 @@ function S8(e, t, n) {
|
|
|
16651
16651
|
...e,
|
|
16652
16652
|
blocks: e.blocks.map((D) => {
|
|
16653
16653
|
if (D.id !== r) return D;
|
|
16654
|
-
const W = !F && Object.keys(o).length > 0 ? xo(D.layout, o, k) : D.layout,
|
|
16654
|
+
const W = !F && Object.keys(o).length > 0 ? xo(D.layout, o, k) : D.layout, V = F ? W.h : Gu(W, W.h, k), G = V > W.h && Or({ x: W.x, y: W.y, w: W.w, h: V }, [...k]) ? {
|
|
16655
16655
|
...W,
|
|
16656
|
-
h:
|
|
16657
|
-
minH: Math.max(at(W.minH) ?? 1,
|
|
16658
|
-
} : W,
|
|
16656
|
+
h: V,
|
|
16657
|
+
minH: Math.max(at(W.minH) ?? 1, V)
|
|
16658
|
+
} : W, J = E(D.data), q = Object.keys(o).length > 0 ? {
|
|
16659
16659
|
...o,
|
|
16660
|
-
...
|
|
16661
|
-
...
|
|
16662
|
-
...
|
|
16663
|
-
...
|
|
16664
|
-
} : D.data, ce = D, Ee = ce.dataBinding, ft =
|
|
16660
|
+
...J.dataBindingId ? { dataBindingId: J.dataBindingId } : I ? { dataBindingId: I } : {},
|
|
16661
|
+
...J.dataBindingStatus ? { dataBindingStatus: J.dataBindingStatus } : w ? { dataBindingStatus: w } : {},
|
|
16662
|
+
...J.dataBindingError ? { dataBindingError: J.dataBindingError } : {},
|
|
16663
|
+
...J.dataBinding ? { dataBinding: J.dataBinding } : Object.keys(y).length > 0 ? { dataBinding: y } : {}
|
|
16664
|
+
} : D.data, ce = D, Ee = ce.dataBinding, ft = J.dataBinding || Ee || (Object.keys(y).length > 0 ? y : void 0);
|
|
16665
16665
|
return {
|
|
16666
16666
|
...D,
|
|
16667
16667
|
title: n.title || D.title,
|
|
@@ -16671,9 +16671,9 @@ function S8(e, t, n) {
|
|
|
16671
16671
|
renderer: Object.keys(d).length > 0 ? d : D.renderer,
|
|
16672
16672
|
data: q,
|
|
16673
16673
|
layout: G,
|
|
16674
|
-
...
|
|
16675
|
-
...
|
|
16676
|
-
...
|
|
16674
|
+
...J.dataBindingId ? { dataBindingId: J.dataBindingId } : ce.dataBindingId ? { dataBindingId: ce.dataBindingId } : I ? { dataBindingId: I } : {},
|
|
16675
|
+
...J.dataBindingStatus ? { dataBindingStatus: J.dataBindingStatus } : ce.dataBindingStatus ? { dataBindingStatus: ce.dataBindingStatus } : w ? { dataBindingStatus: w } : {},
|
|
16676
|
+
...J.dataBindingError ? { dataBindingError: J.dataBindingError } : ce.dataBindingError ? { dataBindingError: ce.dataBindingError } : {},
|
|
16677
16677
|
...ft ? { dataBinding: ft } : {},
|
|
16678
16678
|
state: {
|
|
16679
16679
|
...D.state,
|
|
@@ -17935,11 +17935,11 @@ function Ii(e, t, n, r, a, s) {
|
|
|
17935
17935
|
lastRefreshedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
17936
17936
|
};
|
|
17937
17937
|
delete W.lastError, delete W.error, o.push({ cardId: d.id, data: F });
|
|
17938
|
-
const
|
|
17938
|
+
const V = e.cards.filter((J) => J.id !== d.id && J.layout && !J.layout.parentId).map((J) => J.layout);
|
|
17939
17939
|
return {
|
|
17940
17940
|
...d,
|
|
17941
17941
|
...r ? { meta: { ...d.meta ?? {}, ...r } } : {},
|
|
17942
|
-
layout: rF(d.layout, d.id, F,
|
|
17942
|
+
layout: rF(d.layout, d.id, F, V),
|
|
17943
17943
|
renderData: F,
|
|
17944
17944
|
dataBinding: W
|
|
17945
17945
|
};
|
|
@@ -18686,7 +18686,7 @@ function Mi(e, t, n, r, a, s) {
|
|
|
18686
18686
|
dataPayload: n,
|
|
18687
18687
|
lastRefreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18688
18688
|
status: "ready"
|
|
18689
|
-
} : null, W = N0(D ?? p.data.dataBinding),
|
|
18689
|
+
} : null, W = N0(D ?? p.data.dataBinding), V = zP(p, p.data), G = V ? q0(n) : null, J = G ? BP(p.data.option, G) : null, q = G ? V0({
|
|
18690
18690
|
...p.data,
|
|
18691
18691
|
...D ? { dataBinding: D } : {}
|
|
18692
18692
|
}, G) : [], ce = _0({
|
|
@@ -18694,8 +18694,8 @@ function Mi(e, t, n, r, a, s) {
|
|
|
18694
18694
|
dataBindingId: t,
|
|
18695
18695
|
dataBindingStatus: "ready",
|
|
18696
18696
|
...D ? { dataBinding: D } : {},
|
|
18697
|
-
|
|
18698
|
-
...
|
|
18697
|
+
...V ? {
|
|
18698
|
+
...J ? { option: J } : {},
|
|
18699
18699
|
...G ? {
|
|
18700
18700
|
categories: G.categories,
|
|
18701
18701
|
series: G.series,
|
|
@@ -18921,7 +18921,7 @@ function QP(e, t = {}) {
|
|
|
18921
18921
|
} : void 0, w = t.transportMode === "adapter" && t.agentTransportAdapter ? {
|
|
18922
18922
|
openEventStream: t.agentTransportAdapter.openEventStream,
|
|
18923
18923
|
requestJson: t.agentTransportAdapter.requestJson
|
|
18924
|
-
} : void 0, k = (u) => zC(u, I), F = (u, h) => o1(u, h, I), D = (u, h, g = {}) => n1(u, h, g, I), W = (u) => QC(u, I),
|
|
18924
|
+
} : void 0, k = (u) => zC(u, I), F = (u, h) => o1(u, h, I), D = (u, h, g = {}) => n1(u, h, g, I), W = (u) => QC(u, I), V = (u) => JC(u, I), G = (u, h) => UC(u, h, I), J = (u, h) => YC(u, h, I), q = (u, h) => XC(u, h, I), ce = (u, h) => ZC(u, h, I), Ee = (u, h) => e1(u, h, I), lt = (u, h) => r1(u, h, I), ft = (u, h) => T1(u, h, I), tn = (u, h) => a1(u, h, I), Dt = (u, h) => i1(u, h, I), Pt = (u, h) => c1(u, h, I), st = (u, h) => u1(u, h, I), Kt = (u, h, g, S, A) => s1(
|
|
18925
18925
|
u,
|
|
18926
18926
|
h,
|
|
18927
18927
|
g,
|
|
@@ -19077,8 +19077,8 @@ function QP(e, t = {}) {
|
|
|
19077
19077
|
return h.skipEditableWorkbenchCheck || await this.ensureEditableWorkbench(h), !0;
|
|
19078
19078
|
},
|
|
19079
19079
|
async initialize(u, h = {}) {
|
|
19080
|
-
var g, S, A, C, T, _, b, N, P, B,
|
|
19081
|
-
this.fdeMode = U5(h), this.entryResourceId = ((g = h.resourceId) == null ? void 0 : g.trim()) || ((S = h.fdeResourceId) == null ? void 0 : S.trim()) || "", this.fdeResourceId = ((A = h.fdeResourceId) == null ? void 0 : A.trim()) || ((C = h.resourceId) == null ? void 0 : C.trim()) || "", this.workspaceId = ((T = h.workspaceId) == null ? void 0 : T.trim()) || (this.fdeMode ? this.fdeResourceId : ""), this.userId = ((_ = h.userId) == null ? void 0 : _.trim()) || (this.fdeMode ? _5 : ""), this.tenantId = su(h) || "", this.appId = iu(h), this.roleId = ((b = h.roleId) == null ? void 0 : b.trim()) || (this.fdeMode ? T5 : u) || "", this.fdePath = ((N = h.fdePath) == null ? void 0 : N.trim()) || ((P = h.path) == null ? void 0 : P.trim()) || "", this.fdeName = ((B = h.fdeName) == null ? void 0 : B.trim()) || ((
|
|
19080
|
+
var g, S, A, C, T, _, b, N, P, B, j;
|
|
19081
|
+
this.fdeMode = U5(h), this.entryResourceId = ((g = h.resourceId) == null ? void 0 : g.trim()) || ((S = h.fdeResourceId) == null ? void 0 : S.trim()) || "", this.fdeResourceId = ((A = h.fdeResourceId) == null ? void 0 : A.trim()) || ((C = h.resourceId) == null ? void 0 : C.trim()) || "", this.workspaceId = ((T = h.workspaceId) == null ? void 0 : T.trim()) || (this.fdeMode ? this.fdeResourceId : ""), this.userId = ((_ = h.userId) == null ? void 0 : _.trim()) || (this.fdeMode ? _5 : ""), this.tenantId = su(h) || "", this.appId = iu(h), this.roleId = ((b = h.roleId) == null ? void 0 : b.trim()) || (this.fdeMode ? T5 : u) || "", this.fdePath = ((N = h.fdePath) == null ? void 0 : N.trim()) || ((P = h.path) == null ? void 0 : P.trim()) || "", this.fdeName = ((B = h.fdeName) == null ? void 0 : B.trim()) || ((j = h.name) == null ? void 0 : j.trim()) || "", this.fdeAssetPackage = null, this.resetWorkbenchPrologueState(), this.layoutConfig = Jt(), this.currentConversationId = Jn(), this.pendingDeepAgentRequiredAction = null, this.initialized = !0, this.persistUiMemory(), this.restoreRecoverableDeepAgentTurnsFromMemory(), h.autoLoad !== !1 && (await this.loadSnapshot(), this.fdeMode || this.connectWorkbenchSocket()), this.fdeMode && this.fdeResourceId && Rd({
|
|
19082
19082
|
type: "bt-workbench:fde-ready",
|
|
19083
19083
|
protocolVersion: 1,
|
|
19084
19084
|
resourceId: this.fdeResourceId
|
|
@@ -19243,19 +19243,19 @@ function QP(e, t = {}) {
|
|
|
19243
19243
|
});
|
|
19244
19244
|
if (N >= 0)
|
|
19245
19245
|
this.turns = this.turns.map((P, B) => {
|
|
19246
|
-
var
|
|
19246
|
+
var U;
|
|
19247
19247
|
if (B !== N) return P;
|
|
19248
|
-
const
|
|
19248
|
+
const j = {
|
|
19249
19249
|
conversationId: _.conversationId,
|
|
19250
19250
|
deepAgentSubmission: {
|
|
19251
19251
|
...P.deepAgentSubmission,
|
|
19252
19252
|
..._.deepAgentSubmission,
|
|
19253
|
-
idempotencyKey: ((
|
|
19253
|
+
idempotencyKey: ((U = P.deepAgentSubmission) == null ? void 0 : U.idempotencyKey) || ""
|
|
19254
19254
|
}
|
|
19255
19255
|
};
|
|
19256
|
-
return b ? { ...P, ...
|
|
19256
|
+
return b ? { ...P, ...j } : {
|
|
19257
19257
|
...P,
|
|
19258
|
-
...
|
|
19258
|
+
...j,
|
|
19259
19259
|
status: "streaming",
|
|
19260
19260
|
worklogStageText: f("FWA.800d1787571416351"),
|
|
19261
19261
|
worklogStageDetail: _.worklogStageDetail,
|
|
@@ -19397,7 +19397,7 @@ function QP(e, t = {}) {
|
|
|
19397
19397
|
}
|
|
19398
19398
|
this.workbenchPrologueLoading = !0;
|
|
19399
19399
|
try {
|
|
19400
|
-
const S = await
|
|
19400
|
+
const S = await V(h);
|
|
19401
19401
|
if (!T8(
|
|
19402
19402
|
{
|
|
19403
19403
|
resourceId: this.entryResourceId,
|
|
@@ -19735,12 +19735,12 @@ function QP(e, t = {}) {
|
|
|
19735
19735
|
}), N = async (B) => {
|
|
19736
19736
|
try {
|
|
19737
19737
|
return await b(B);
|
|
19738
|
-
} catch (
|
|
19739
|
-
if (!ss(
|
|
19738
|
+
} catch (j) {
|
|
19739
|
+
if (!ss(j)) throw j;
|
|
19740
19740
|
return {
|
|
19741
19741
|
status: "version_conflict",
|
|
19742
19742
|
message: f("FWA.02341787570743415"),
|
|
19743
|
-
error: { code: "WORKBENCH_VERSION_CONFLICT", message: we(
|
|
19743
|
+
error: { code: "WORKBENCH_VERSION_CONFLICT", message: we(j, f("FWA.02341787570743415")) }
|
|
19744
19744
|
};
|
|
19745
19745
|
}
|
|
19746
19746
|
};
|
|
@@ -19757,8 +19757,8 @@ function QP(e, t = {}) {
|
|
|
19757
19757
|
P.changedBlockIds
|
|
19758
19758
|
);
|
|
19759
19759
|
this.replaceSnapshot(B);
|
|
19760
|
-
const
|
|
19761
|
-
return this.lastComposeInsertedBlockIds =
|
|
19760
|
+
const j = (S = P.changedBlockIds) != null && S.length ? P.changedBlockIds : B.blocks.filter((U) => !A.has(U.id)).map((U) => U.id);
|
|
19761
|
+
return this.lastComposeInsertedBlockIds = j, this.canvasDirty = !1, this.canvasPendingSync = !1, {
|
|
19762
19762
|
...P,
|
|
19763
19763
|
snapshot: B
|
|
19764
19764
|
};
|
|
@@ -19779,26 +19779,26 @@ function QP(e, t = {}) {
|
|
|
19779
19779
|
try {
|
|
19780
19780
|
let A = new Set(this.snapshot.blocks.map((B) => B.id));
|
|
19781
19781
|
if (this.fdeMode) {
|
|
19782
|
-
const B = this.snapshot,
|
|
19782
|
+
const B = this.snapshot, j = bm(u, B), U = await this.persistSnapshotPreferIncremental({
|
|
19783
19783
|
...B,
|
|
19784
19784
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
19785
|
-
blocks: Fe([...B.blocks,
|
|
19785
|
+
blocks: Fe([...B.blocks, j])
|
|
19786
19786
|
}, {
|
|
19787
19787
|
baseSnapshot: B,
|
|
19788
19788
|
baseVersion: B.version
|
|
19789
|
-
}),
|
|
19790
|
-
var
|
|
19791
|
-
return ((
|
|
19789
|
+
}), oe = (g = U.blocks.find(($) => {
|
|
19790
|
+
var te;
|
|
19791
|
+
return ((te = $.meta) == null ? void 0 : te.aiChatCardId) === u.id;
|
|
19792
19792
|
})) == null ? void 0 : g.id;
|
|
19793
|
-
return this.lastComposeInsertedBlockIds =
|
|
19793
|
+
return this.lastComposeInsertedBlockIds = oe ? [oe] : [], this.canvasDirty = !1, this.canvasPendingSync = !1, U;
|
|
19794
19794
|
}
|
|
19795
19795
|
if (await this.ensureEditableWorkbench(), !this.snapshot) return null;
|
|
19796
19796
|
A = new Set(this.snapshot.blocks.map((B) => B.id));
|
|
19797
19797
|
const C = () => {
|
|
19798
|
-
var
|
|
19799
|
-
const B = W0(((
|
|
19798
|
+
var j, U, oe, $, te;
|
|
19799
|
+
const B = W0(((j = this.snapshot) == null ? void 0 : j.blocks) || [], u);
|
|
19800
19800
|
return Pt(this.context, {
|
|
19801
|
-
baseVersion: ((
|
|
19801
|
+
baseVersion: ((U = this.snapshot) == null ? void 0 : U.version) ?? 0,
|
|
19802
19802
|
title: so(u),
|
|
19803
19803
|
subtitle: io(u) || void 0,
|
|
19804
19804
|
capabilityId: vs,
|
|
@@ -19812,9 +19812,9 @@ function QP(e, t = {}) {
|
|
|
19812
19812
|
...xn(void 0, B),
|
|
19813
19813
|
...E0(u),
|
|
19814
19814
|
aiChatCardId: u.id,
|
|
19815
|
-
aiChatCardVersion: (
|
|
19816
|
-
generatedBy: (
|
|
19817
|
-
prompt: (
|
|
19815
|
+
aiChatCardVersion: (oe = u.meta) == null ? void 0 : oe.version,
|
|
19816
|
+
generatedBy: ($ = u.meta) == null ? void 0 : $.generatedBy,
|
|
19817
|
+
prompt: (te = u.meta) == null ? void 0 : te.prompt
|
|
19818
19818
|
}
|
|
19819
19819
|
});
|
|
19820
19820
|
};
|
|
@@ -19823,9 +19823,9 @@ function QP(e, t = {}) {
|
|
|
19823
19823
|
T = await C();
|
|
19824
19824
|
} catch (B) {
|
|
19825
19825
|
if (!ss(B)) throw B;
|
|
19826
|
-
const
|
|
19827
|
-
if (this.replaceSnapshot(
|
|
19828
|
-
return oa(f("FWA.b37a1787570474800", { p0: u.title })),
|
|
19826
|
+
const j = await k(this.context), U = as(j.blocks, u);
|
|
19827
|
+
if (this.replaceSnapshot(j), U)
|
|
19828
|
+
return oa(f("FWA.b37a1787570474800", { p0: u.title })), j;
|
|
19829
19829
|
T = await C();
|
|
19830
19830
|
}
|
|
19831
19831
|
const _ = await this.persistSnapshotPreferIncremental({
|
|
@@ -19837,8 +19837,8 @@ function QP(e, t = {}) {
|
|
|
19837
19837
|
baseSnapshot: T,
|
|
19838
19838
|
baseVersion: T.version
|
|
19839
19839
|
}), b = HP(_, u, A), N = _.blocks.filter((B) => !A.has(B.id)).map((B) => B.id), P = N.length > 0 ? N[0] : (S = [...b.blocks].reverse().find((B) => {
|
|
19840
|
-
var
|
|
19841
|
-
return ((
|
|
19840
|
+
var j;
|
|
19841
|
+
return ((j = B.meta) == null ? void 0 : j.aiChatCardId) === u.id;
|
|
19842
19842
|
})) == null ? void 0 : S.id;
|
|
19843
19843
|
return this.replaceSnapshot(b), this.lastComposeInsertedBlockIds = P ? [P] : [], this.canvasDirty = !1, this.canvasPendingSync = !1, b;
|
|
19844
19844
|
} catch (A) {
|
|
@@ -19860,31 +19860,31 @@ function QP(e, t = {}) {
|
|
|
19860
19860
|
this.saving = !0, this.error = "";
|
|
19861
19861
|
try {
|
|
19862
19862
|
if (this.fdeMode) {
|
|
19863
|
-
const
|
|
19864
|
-
...
|
|
19863
|
+
const te = this.snapshot, re = _P(u, te), O = await this.persistSnapshotPreferIncremental({
|
|
19864
|
+
...te,
|
|
19865
19865
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
19866
|
-
blocks: Fe([...
|
|
19866
|
+
blocks: Fe([...te.blocks, re])
|
|
19867
19867
|
}, {
|
|
19868
|
-
baseSnapshot:
|
|
19869
|
-
baseVersion:
|
|
19870
|
-
}),
|
|
19868
|
+
baseSnapshot: te,
|
|
19869
|
+
baseVersion: te.version
|
|
19870
|
+
}), X = (g = O.blocks.find((z) => {
|
|
19871
19871
|
var Q;
|
|
19872
19872
|
return ((Q = z.meta) == null ? void 0 : Q.aiChatMetricCardId) === u.id;
|
|
19873
19873
|
})) == null ? void 0 : g.id;
|
|
19874
|
-
return this.lastComposeInsertedBlockIds =
|
|
19874
|
+
return this.lastComposeInsertedBlockIds = X ? [X] : [], this.canvasDirty = !1, this.canvasPendingSync = !1, O;
|
|
19875
19875
|
}
|
|
19876
|
-
const
|
|
19876
|
+
const j = L0(this.snapshot.blocks), U = await this.insertCard({
|
|
19877
19877
|
requestId: `ai-metric-${u.id}`,
|
|
19878
19878
|
capabilityId: "card.metric.numeric",
|
|
19879
19879
|
title: u.title,
|
|
19880
19880
|
data: O0(u),
|
|
19881
19881
|
renderer: { engine: "custom", rendererKey: "metricStrip" },
|
|
19882
|
-
layout:
|
|
19882
|
+
layout: j,
|
|
19883
19883
|
size: { preset: "medium", width: 33.333, height: 34 },
|
|
19884
19884
|
meta: {
|
|
19885
19885
|
source: "ai-chat-metric",
|
|
19886
19886
|
sizePreset: "medium",
|
|
19887
|
-
...xn(void 0,
|
|
19887
|
+
...xn(void 0, j),
|
|
19888
19888
|
aiChatMetricCardId: u.id,
|
|
19889
19889
|
aiChatMetricCardVersion: (S = u.meta) == null ? void 0 : S.version,
|
|
19890
19890
|
generatedBy: (A = u.meta) == null ? void 0 : A.generatedBy,
|
|
@@ -19893,15 +19893,15 @@ function QP(e, t = {}) {
|
|
|
19893
19893
|
metricId: u.metricId || ((b = u.dataBinding) == null ? void 0 : b.metricId)
|
|
19894
19894
|
}
|
|
19895
19895
|
});
|
|
19896
|
-
if (!
|
|
19897
|
-
throw new Error(((N =
|
|
19898
|
-
const
|
|
19896
|
+
if (!U.success)
|
|
19897
|
+
throw new Error(((N = U.error) == null ? void 0 : N.message) || f("FWA.b0e41787571113948"));
|
|
19898
|
+
const oe = ((P = U.data) == null ? void 0 : P.snapshot) || this.snapshot, $ = (B = [...(oe == null ? void 0 : oe.blocks) || []].reverse().find((te) => {
|
|
19899
19899
|
var re;
|
|
19900
|
-
return ((re =
|
|
19900
|
+
return ((re = te.meta) == null ? void 0 : re.aiChatMetricCardId) === u.id;
|
|
19901
19901
|
})) == null ? void 0 : B.id;
|
|
19902
|
-
return this.lastComposeInsertedBlockIds =
|
|
19903
|
-
} catch (
|
|
19904
|
-
throw this.error = we(
|
|
19902
|
+
return this.lastComposeInsertedBlockIds = $ ? [$] : [], this.canvasDirty = !1, this.canvasPendingSync = !1, oe;
|
|
19903
|
+
} catch (j) {
|
|
19904
|
+
throw this.error = we(j, f("FWA.afa21787571015682")), j;
|
|
19905
19905
|
} finally {
|
|
19906
19906
|
this.saving = !1;
|
|
19907
19907
|
}
|
|
@@ -19919,24 +19919,24 @@ function QP(e, t = {}) {
|
|
|
19919
19919
|
try {
|
|
19920
19920
|
if (!this.fdeMode) {
|
|
19921
19921
|
await this.ensureEditableWorkbench();
|
|
19922
|
-
const B = bD(h),
|
|
19922
|
+
const B = bD(h), j = E(B), U = R(h.conversationId) ?? Q5(
|
|
19923
19923
|
xe,
|
|
19924
19924
|
this.$state,
|
|
19925
19925
|
this.turns,
|
|
19926
19926
|
this.currentConversationId,
|
|
19927
19927
|
this.activeTurnId || "",
|
|
19928
19928
|
r
|
|
19929
|
-
),
|
|
19930
|
-
let
|
|
19931
|
-
const
|
|
19929
|
+
), oe = this.turns.filter((X) => X.conversationId === U).map(ns);
|
|
19930
|
+
let $ = C;
|
|
19931
|
+
const te = (X) => st(this.context, {
|
|
19932
19932
|
...(() => {
|
|
19933
|
-
const z = A ? Pd(
|
|
19934
|
-
snapshot:
|
|
19933
|
+
const z = A ? Pd(X, [A])[0] || A : null, Q = Mu(X), me = (Q == null ? void 0 : Q.layoutSource) === "gridstack_layout_tree" ? Q.layoutTree : void 0, he = z && Q ? NI({
|
|
19934
|
+
snapshot: X,
|
|
19935
19935
|
layoutTree: me,
|
|
19936
19936
|
candidateBlock: z,
|
|
19937
19937
|
sizeProfile: s0(z),
|
|
19938
19938
|
fallbackPreset: Us(z)
|
|
19939
|
-
}) : void 0,
|
|
19939
|
+
}) : void 0, ee = he && z ? {
|
|
19940
19940
|
...z,
|
|
19941
19941
|
layout: he.layout,
|
|
19942
19942
|
meta: {
|
|
@@ -19946,15 +19946,15 @@ function QP(e, t = {}) {
|
|
|
19946
19946
|
adjustedSizeProfile: he.adjustedSizeProfile
|
|
19947
19947
|
}
|
|
19948
19948
|
} : z;
|
|
19949
|
-
|
|
19950
|
-
const ye =
|
|
19949
|
+
$ = ee;
|
|
19950
|
+
const ye = ee ? a8(h, ee) : i8(h);
|
|
19951
19951
|
if (!ye)
|
|
19952
19952
|
throw new Error(f("FWA.3b8d1787570740649"));
|
|
19953
|
-
const et =
|
|
19954
|
-
currentConversationId:
|
|
19953
|
+
const et = ee ? m8(ee) : void 0, Le = R(ye.title) ?? R(h.title) ?? R(j.question) ?? h.capabilityId, Ge = pc({
|
|
19954
|
+
currentConversationId: U,
|
|
19955
19955
|
activeTurnId: this.activeTurnId,
|
|
19956
|
-
turns:
|
|
19957
|
-
snapshot:
|
|
19956
|
+
turns: oe,
|
|
19957
|
+
snapshot: X,
|
|
19958
19958
|
selectedBlockId: null,
|
|
19959
19959
|
selectedNestedBlock: null,
|
|
19960
19960
|
input: Le,
|
|
@@ -19973,9 +19973,9 @@ function QP(e, t = {}) {
|
|
|
19973
19973
|
}
|
|
19974
19974
|
} : Ge;
|
|
19975
19975
|
return {
|
|
19976
|
-
baseVersion:
|
|
19976
|
+
baseVersion: X.version,
|
|
19977
19977
|
input: Le,
|
|
19978
|
-
conversationId:
|
|
19978
|
+
conversationId: U,
|
|
19979
19979
|
selectedSystemCard: ye,
|
|
19980
19980
|
...B ? { queryEvidence: B } : {},
|
|
19981
19981
|
...et ? { plannedBlock: et } : {},
|
|
@@ -19984,9 +19984,9 @@ function QP(e, t = {}) {
|
|
|
19984
19984
|
screenContext: St
|
|
19985
19985
|
};
|
|
19986
19986
|
})()
|
|
19987
|
-
}), re = async (
|
|
19987
|
+
}), re = async (X) => {
|
|
19988
19988
|
try {
|
|
19989
|
-
return await
|
|
19989
|
+
return await te(X);
|
|
19990
19990
|
} catch (z) {
|
|
19991
19991
|
if (!ss(z)) throw z;
|
|
19992
19992
|
return {
|
|
@@ -19998,26 +19998,26 @@ function QP(e, t = {}) {
|
|
|
19998
19998
|
};
|
|
19999
19999
|
let O = await re(S);
|
|
20000
20000
|
if (Zm(O)) {
|
|
20001
|
-
const
|
|
20002
|
-
this.replaceSnapshot(
|
|
20001
|
+
const X = await k(this.context);
|
|
20002
|
+
this.replaceSnapshot(X), O = await re(X);
|
|
20003
20003
|
}
|
|
20004
20004
|
if (O.status !== "applied" && O.status !== "legacy_host_resolved")
|
|
20005
20005
|
return this.lastComposeInsertedBlockIds = [], this.error = ((_ = O.error) == null ? void 0 : _.message) || O.message || f("FWA.d5351787570971811"), Me.warning(this.error), null;
|
|
20006
20006
|
if (O.snapshot) {
|
|
20007
|
-
const
|
|
20008
|
-
me ?
|
|
20007
|
+
const X = y8(S, O), z = Tr(O.insertedBlockIds, O.changedBlockIds), Q = z.length > 0 ? z : X.blocks.filter((ye) => !T.has(ye.id)).map((ye) => ye.id), me = !!($ && Fo($)), he = S8(
|
|
20008
|
+
me ? X : await _c(X, Q),
|
|
20009
20009
|
Q,
|
|
20010
|
-
|
|
20011
|
-
),
|
|
20010
|
+
$
|
|
20011
|
+
), ee = r8(
|
|
20012
20012
|
he,
|
|
20013
20013
|
Q,
|
|
20014
|
-
|
|
20014
|
+
$
|
|
20015
20015
|
);
|
|
20016
|
-
return this.replaceSnapshot(
|
|
20016
|
+
return this.replaceSnapshot(ee), g.length > 0 && (this.turns = bd(
|
|
20017
20017
|
this.turns,
|
|
20018
20018
|
g,
|
|
20019
|
-
|
|
20020
|
-
)), this.lastComposeInsertedBlockIds = Q.length ? Q :
|
|
20019
|
+
U
|
|
20020
|
+
)), this.lastComposeInsertedBlockIds = Q.length ? Q : ee.blocks.filter((ye) => !T.has(ye.id)).map((ye) => ye.id), this.canvasDirty = !1, this.canvasPendingSync = !1, ee;
|
|
20021
20021
|
}
|
|
20022
20022
|
return null;
|
|
20023
20023
|
}
|
|
@@ -20231,50 +20231,51 @@ function QP(e, t = {}) {
|
|
|
20231
20231
|
* @returns Refresh result returned by run-agent.
|
|
20232
20232
|
*/
|
|
20233
20233
|
async retryDataBindingRefresh(u, h = {}) {
|
|
20234
|
-
var
|
|
20234
|
+
var P, B;
|
|
20235
20235
|
if (!await this.prepareRuntimeWriteAction(f("FWA.65221787571521509"), {
|
|
20236
20236
|
silentRegistryRefresh: !0,
|
|
20237
20237
|
skipEditableWorkbenchCheck: !0
|
|
20238
20238
|
}))
|
|
20239
20239
|
throw new Error("FDE_RUNTIME_ACTION_DISABLED");
|
|
20240
|
-
const g = Um(((
|
|
20240
|
+
const g = Um(((P = this.snapshot) == null ? void 0 : P.blocks) || [], u, h.bindingId), S = g ? Yi(g, h.bindingId) : null;
|
|
20241
20241
|
if (!g || !S)
|
|
20242
20242
|
throw new Error("DATA_BINDING_REFRESH_TARGET_NOT_FOUND");
|
|
20243
|
-
const A =
|
|
20243
|
+
const A = {
|
|
20244
20244
|
targetCardId: u,
|
|
20245
|
-
|
|
20246
|
-
|
|
20245
|
+
// 用户主动点击刷新时,本轮查询结果必须覆盖旧的成功状态;旧数据仍保留用于展示。
|
|
20246
|
+
forceErrorStatus: !0
|
|
20247
|
+
}, C = G8(
|
|
20247
20248
|
this.workspaceId,
|
|
20248
20249
|
this.context.userId,
|
|
20249
20250
|
this.roleId,
|
|
20250
20251
|
S.bindingId,
|
|
20251
20252
|
u,
|
|
20252
20253
|
h.filterValues
|
|
20253
|
-
),
|
|
20254
|
-
if (
|
|
20255
|
-
const
|
|
20254
|
+
), T = ti.get(C);
|
|
20255
|
+
if (T) return T;
|
|
20256
|
+
const _ = {
|
|
20256
20257
|
...h,
|
|
20257
|
-
businessWording: ((
|
|
20258
|
-
},
|
|
20259
|
-
const
|
|
20260
|
-
...
|
|
20261
|
-
businessWording:
|
|
20258
|
+
businessWording: ((B = h.businessWording) == null ? void 0 : B.trim()) || Qm(g, S.bindingId)
|
|
20259
|
+
}, b = async (j, U) => {
|
|
20260
|
+
const oe = {
|
|
20261
|
+
..._,
|
|
20262
|
+
businessWording: _.businessWording || Qm(U, j.bindingId)
|
|
20262
20263
|
};
|
|
20263
|
-
this.markDataBindingRefreshStatus(j.bindingId, "running", void 0,
|
|
20264
|
-
const
|
|
20264
|
+
this.markDataBindingRefreshStatus(j.bindingId, "running", void 0, A);
|
|
20265
|
+
const $ = await ll({
|
|
20265
20266
|
userId: this.context.userId,
|
|
20266
20267
|
...this.context.tenantId ? { tenantId: this.context.tenantId } : {},
|
|
20267
20268
|
...this.context.appId ? { appId: this.context.appId } : {},
|
|
20268
20269
|
roleId: this.roleId,
|
|
20269
20270
|
conversationId: this.currentConversationId
|
|
20270
|
-
}, j.refreshApi,
|
|
20271
|
-
if (
|
|
20272
|
-
throw this.applyDataBindingRefreshResult(
|
|
20273
|
-
return this.applyDataBindingRefreshResult(
|
|
20274
|
-
},
|
|
20275
|
-
var
|
|
20276
|
-
const
|
|
20277
|
-
if (this.markDataBindingRefreshStatus(S.bindingId, "error",
|
|
20271
|
+
}, j.refreshApi, oe);
|
|
20272
|
+
if ($.success === !1 && K8($))
|
|
20273
|
+
throw this.applyDataBindingRefreshResult($, A), new Error($.errorMessage || $.errorCode || "DATA_BINDING_NOT_FOUND");
|
|
20274
|
+
return this.applyDataBindingRefreshResult($, A), $;
|
|
20275
|
+
}, N = b(S, g).catch(async (j) => {
|
|
20276
|
+
var O;
|
|
20277
|
+
const U = we(j, "Data binding refresh failed");
|
|
20278
|
+
if (this.markDataBindingRefreshStatus(S.bindingId, "error", U, A), !await rf(
|
|
20278
20279
|
{
|
|
20279
20280
|
userId: this.context.userId,
|
|
20280
20281
|
...this.context.tenantId ? { tenantId: this.context.tenantId } : {},
|
|
@@ -20286,16 +20287,16 @@ function QP(e, t = {}) {
|
|
|
20286
20287
|
Vo
|
|
20287
20288
|
) || !Lm(j))
|
|
20288
20289
|
throw j;
|
|
20289
|
-
const
|
|
20290
|
-
this.replaceSnapshot(ca(
|
|
20291
|
-
const
|
|
20292
|
-
if (!
|
|
20290
|
+
const $ = await k(this.context);
|
|
20291
|
+
this.replaceSnapshot(ca($));
|
|
20292
|
+
const te = Um(((O = this.snapshot) == null ? void 0 : O.blocks) || [], u, h.bindingId), re = te ? Yi(te, h.bindingId) : null;
|
|
20293
|
+
if (!te || !re)
|
|
20293
20294
|
throw j;
|
|
20294
|
-
return
|
|
20295
|
+
return b(re, te);
|
|
20295
20296
|
}).finally(() => {
|
|
20296
|
-
ti.delete(
|
|
20297
|
+
ti.delete(C);
|
|
20297
20298
|
});
|
|
20298
|
-
return ti.set(
|
|
20299
|
+
return ti.set(C, N), N;
|
|
20299
20300
|
},
|
|
20300
20301
|
/**
|
|
20301
20302
|
* 保存已有运行态指标卡的 FDE 筛选绑定并同步当前快照摘要。
|
|
@@ -20402,32 +20403,32 @@ function QP(e, t = {}) {
|
|
|
20402
20403
|
if (C) {
|
|
20403
20404
|
const b = async (O) => {
|
|
20404
20405
|
if (!is(O)) throw O;
|
|
20405
|
-
const
|
|
20406
|
+
const X = await k(this.context), z = {
|
|
20406
20407
|
...A,
|
|
20407
|
-
version:
|
|
20408
|
-
updatedAt:
|
|
20408
|
+
version: X.version,
|
|
20409
|
+
updatedAt: X.updatedAt
|
|
20409
20410
|
}, Q = await D(this.context, z, {
|
|
20410
|
-
baseVersion:
|
|
20411
|
+
baseVersion: X.version,
|
|
20411
20412
|
persistenceFallbackReason: "card-patch-failed",
|
|
20412
20413
|
persistenceFallbackSummary: Xn(C, A)
|
|
20413
20414
|
});
|
|
20414
20415
|
return this.replaceSnapshot(Q), Q;
|
|
20415
20416
|
}, N = async (O) => {
|
|
20416
20417
|
if (!is(O)) throw O;
|
|
20417
|
-
const
|
|
20418
|
+
const X = await k(this.context), z = {
|
|
20418
20419
|
...A,
|
|
20419
|
-
version:
|
|
20420
|
-
updatedAt:
|
|
20420
|
+
version: X.version,
|
|
20421
|
+
updatedAt: X.updatedAt
|
|
20421
20422
|
}, Q = await D(this.context, z, {
|
|
20422
|
-
baseVersion:
|
|
20423
|
+
baseVersion: X.version,
|
|
20423
20424
|
persistenceFallbackReason: "card-mutation-failed",
|
|
20424
20425
|
persistenceFallbackSummary: Xn(C, A)
|
|
20425
20426
|
});
|
|
20426
20427
|
return this.replaceSnapshot(Q), Q;
|
|
20427
|
-
}, P = async (O,
|
|
20428
|
+
}, P = async (O, X) => {
|
|
20428
20429
|
if (!is(O)) throw O;
|
|
20429
20430
|
const z = await k(this.context), Q = {
|
|
20430
|
-
...
|
|
20431
|
+
...X,
|
|
20431
20432
|
version: z.version,
|
|
20432
20433
|
updatedAt: z.updatedAt
|
|
20433
20434
|
}, me = await D(this.context, Q, {
|
|
@@ -20436,37 +20437,37 @@ function QP(e, t = {}) {
|
|
|
20436
20437
|
persistenceFallbackSummary: Xn(C, A)
|
|
20437
20438
|
});
|
|
20438
20439
|
return this.replaceSnapshot(me), me;
|
|
20439
|
-
}, B = async (O,
|
|
20440
|
+
}, B = async (O, X) => {
|
|
20440
20441
|
const z = {
|
|
20441
|
-
...
|
|
20442
|
+
...X,
|
|
20442
20443
|
version: O.version,
|
|
20443
20444
|
updatedAt: O.updatedAt
|
|
20444
20445
|
}, Q = await D(this.context, z, {
|
|
20445
20446
|
baseVersion: O.version,
|
|
20446
20447
|
persistenceFallbackReason: "card-layout-not-incremental",
|
|
20447
|
-
persistenceFallbackSummary: Xn(C,
|
|
20448
|
+
persistenceFallbackSummary: Xn(C, X)
|
|
20448
20449
|
});
|
|
20449
20450
|
return this.replaceSnapshot(Q), Q;
|
|
20450
|
-
},
|
|
20451
|
-
if (
|
|
20452
|
-
let O,
|
|
20451
|
+
}, j = qm(C, A);
|
|
20452
|
+
if (j) {
|
|
20453
|
+
let O, X = j, z = C;
|
|
20453
20454
|
try {
|
|
20454
20455
|
O = await Pt(
|
|
20455
20456
|
this.context,
|
|
20456
|
-
ma(
|
|
20457
|
+
ma(j.inserted, T ?? C.version)
|
|
20457
20458
|
);
|
|
20458
|
-
} catch (
|
|
20459
|
-
if (!ss(
|
|
20460
|
-
const ye = await k(this.context), et = sP(
|
|
20461
|
-
if (!et) throw
|
|
20459
|
+
} catch (ee) {
|
|
20460
|
+
if (!ss(ee)) throw ee;
|
|
20461
|
+
const ye = await k(this.context), et = sP(j, ye);
|
|
20462
|
+
if (!et) throw ee;
|
|
20462
20463
|
const Le = qm(ye, et);
|
|
20463
|
-
if (!Le) throw
|
|
20464
|
-
z = ye,
|
|
20464
|
+
if (!Le) throw ee;
|
|
20465
|
+
z = ye, X = Le, O = await Pt(
|
|
20465
20466
|
this.context,
|
|
20466
20467
|
ma(Le.inserted, ye.version)
|
|
20467
20468
|
);
|
|
20468
20469
|
}
|
|
20469
|
-
const Q = aP(
|
|
20470
|
+
const Q = aP(X, z, O);
|
|
20470
20471
|
if (!Q)
|
|
20471
20472
|
return this.replaceSnapshot(O), O;
|
|
20472
20473
|
const me = { ...A, blocks: Q };
|
|
@@ -20481,16 +20482,16 @@ function QP(e, t = {}) {
|
|
|
20481
20482
|
layoutConfig: Cr(A.layoutConfig || this.layoutConfig),
|
|
20482
20483
|
visualConfig: vr(O, me)
|
|
20483
20484
|
});
|
|
20484
|
-
} catch (
|
|
20485
|
-
return P(
|
|
20485
|
+
} catch (ee) {
|
|
20486
|
+
return P(ee, me);
|
|
20486
20487
|
}
|
|
20487
20488
|
return this.replaceSnapshot(he), he;
|
|
20488
20489
|
}
|
|
20489
|
-
const
|
|
20490
|
-
if (
|
|
20491
|
-
let O = await Gn(this.context,
|
|
20490
|
+
const U = iP(C, A);
|
|
20491
|
+
if (U) {
|
|
20492
|
+
let O = await Gn(this.context, U.id, {
|
|
20492
20493
|
baseVersion: T ?? C.version,
|
|
20493
|
-
cardVersion:
|
|
20494
|
+
cardVersion: U.version
|
|
20494
20495
|
});
|
|
20495
20496
|
if (br(O, A))
|
|
20496
20497
|
return this.replaceSnapshot(O), O;
|
|
@@ -20503,17 +20504,17 @@ function QP(e, t = {}) {
|
|
|
20503
20504
|
layoutConfig: Cr(A.layoutConfig || this.layoutConfig),
|
|
20504
20505
|
visualConfig: vr(O, A)
|
|
20505
20506
|
});
|
|
20506
|
-
} catch (
|
|
20507
|
-
return P(
|
|
20507
|
+
} catch (X) {
|
|
20508
|
+
return P(X, A);
|
|
20508
20509
|
}
|
|
20509
20510
|
return this.replaceSnapshot(O), O;
|
|
20510
20511
|
}
|
|
20511
|
-
const
|
|
20512
|
-
if (
|
|
20512
|
+
const oe = oP(C, A);
|
|
20513
|
+
if (oe) {
|
|
20513
20514
|
let O = C;
|
|
20514
|
-
for (const
|
|
20515
|
-
const z = O.blocks.find((Q) => Q.id ===
|
|
20516
|
-
O = await Gn(this.context,
|
|
20515
|
+
for (const X of oe) {
|
|
20516
|
+
const z = O.blocks.find((Q) => Q.id === X.id) ?? X;
|
|
20517
|
+
O = await Gn(this.context, X.id, {
|
|
20517
20518
|
baseVersion: O.version,
|
|
20518
20519
|
cardVersion: z.version
|
|
20519
20520
|
});
|
|
@@ -20529,39 +20530,39 @@ function QP(e, t = {}) {
|
|
|
20529
20530
|
layoutConfig: Cr(A.layoutConfig || this.layoutConfig),
|
|
20530
20531
|
visualConfig: vr(O, A)
|
|
20531
20532
|
});
|
|
20532
|
-
} catch (
|
|
20533
|
-
return P(
|
|
20533
|
+
} catch (X) {
|
|
20534
|
+
return P(X, A);
|
|
20534
20535
|
}
|
|
20535
20536
|
return this.replaceSnapshot(O), O;
|
|
20536
20537
|
}
|
|
20537
|
-
const
|
|
20538
|
-
if (
|
|
20538
|
+
const $ = cP(C, A);
|
|
20539
|
+
if ($ && no($.current, $.target)) {
|
|
20539
20540
|
let O;
|
|
20540
20541
|
try {
|
|
20541
20542
|
O = await Ha(
|
|
20542
20543
|
this.context,
|
|
20543
|
-
|
|
20544
|
+
$.target.id,
|
|
20544
20545
|
gi(
|
|
20545
|
-
|
|
20546
|
-
|
|
20546
|
+
$.target,
|
|
20547
|
+
$.current,
|
|
20547
20548
|
T ?? C.version,
|
|
20548
20549
|
{
|
|
20549
|
-
includeLayout: yi(
|
|
20550
|
+
includeLayout: yi($.current, $.target)
|
|
20550
20551
|
}
|
|
20551
20552
|
)
|
|
20552
20553
|
);
|
|
20553
20554
|
} catch (Q) {
|
|
20554
20555
|
return b(Q);
|
|
20555
20556
|
}
|
|
20556
|
-
const
|
|
20557
|
+
const X = Mc(A, O, /* @__PURE__ */ new Map()), z = X ? { ...A, blocks: X } : null;
|
|
20557
20558
|
if (z && ua(O, z))
|
|
20558
20559
|
return this.replaceSnapshot(O), O;
|
|
20559
|
-
if (
|
|
20560
|
+
if (X && z && da(O, z)) {
|
|
20560
20561
|
try {
|
|
20561
20562
|
O = await F(this.context, {
|
|
20562
20563
|
baseVersion: O.version,
|
|
20563
20564
|
layoutVersion: z.layoutVersion,
|
|
20564
|
-
layout: En(
|
|
20565
|
+
layout: En(X),
|
|
20565
20566
|
layoutConfig: Cr(A.layoutConfig || this.layoutConfig),
|
|
20566
20567
|
visualConfig: vr(O, z)
|
|
20567
20568
|
});
|
|
@@ -20573,11 +20574,11 @@ function QP(e, t = {}) {
|
|
|
20573
20574
|
}
|
|
20574
20575
|
return z ? B(O, z) : B(O, A);
|
|
20575
20576
|
}
|
|
20576
|
-
const
|
|
20577
|
-
if (
|
|
20577
|
+
const te = F0(C, A);
|
|
20578
|
+
if (te && te.length > 1 && te.every((O) => no(O.current, O.target))) {
|
|
20578
20579
|
let O = C;
|
|
20579
20580
|
try {
|
|
20580
|
-
for (const Q of
|
|
20581
|
+
for (const Q of te) {
|
|
20581
20582
|
const me = O.blocks.find((he) => he.id === Q.current.id) ?? Q.current;
|
|
20582
20583
|
O = await Ha(
|
|
20583
20584
|
this.context,
|
|
@@ -20590,15 +20591,15 @@ function QP(e, t = {}) {
|
|
|
20590
20591
|
} catch (Q) {
|
|
20591
20592
|
return b(Q);
|
|
20592
20593
|
}
|
|
20593
|
-
const
|
|
20594
|
+
const X = Mc(A, O, /* @__PURE__ */ new Map()), z = X ? { ...A, blocks: X } : null;
|
|
20594
20595
|
if (z && ua(O, z))
|
|
20595
20596
|
return this.replaceSnapshot(O), O;
|
|
20596
|
-
if (
|
|
20597
|
+
if (X && z && da(O, z)) {
|
|
20597
20598
|
try {
|
|
20598
20599
|
O = await F(this.context, {
|
|
20599
20600
|
baseVersion: O.version,
|
|
20600
20601
|
layoutVersion: z.layoutVersion,
|
|
20601
|
-
layout: En(
|
|
20602
|
+
layout: En(X),
|
|
20602
20603
|
layoutConfig: Cr(A.layoutConfig || this.layoutConfig),
|
|
20603
20604
|
visualConfig: vr(O, z)
|
|
20604
20605
|
});
|
|
@@ -20613,46 +20614,46 @@ function QP(e, t = {}) {
|
|
|
20613
20614
|
const re = dP(C, A);
|
|
20614
20615
|
if (re) {
|
|
20615
20616
|
let O = C;
|
|
20616
|
-
const
|
|
20617
|
+
const X = /* @__PURE__ */ new Map();
|
|
20617
20618
|
let z = "delete";
|
|
20618
20619
|
try {
|
|
20619
20620
|
for (const he of re.deleted) {
|
|
20620
20621
|
z = "delete";
|
|
20621
|
-
const
|
|
20622
|
+
const ee = O.blocks.find((ye) => ye.id === he.id) ?? he;
|
|
20622
20623
|
O = await Gn(this.context, he.id, {
|
|
20623
20624
|
baseVersion: O.version,
|
|
20624
|
-
cardVersion:
|
|
20625
|
+
cardVersion: ee.version
|
|
20625
20626
|
});
|
|
20626
20627
|
}
|
|
20627
20628
|
for (const he of re.updated) {
|
|
20628
20629
|
z = "patch";
|
|
20629
|
-
const
|
|
20630
|
+
const ee = O.blocks.find((ye) => ye.id === he.current.id) ?? he.current;
|
|
20630
20631
|
O = await Ha(
|
|
20631
20632
|
this.context,
|
|
20632
20633
|
he.target.id,
|
|
20633
|
-
gi(he.target,
|
|
20634
|
-
includeLayout: yi(
|
|
20634
|
+
gi(he.target, ee, O.version, {
|
|
20635
|
+
includeLayout: yi(ee, he.target)
|
|
20635
20636
|
})
|
|
20636
20637
|
);
|
|
20637
20638
|
}
|
|
20638
20639
|
for (const he of re.inserted) {
|
|
20639
20640
|
z = "insert";
|
|
20640
|
-
const
|
|
20641
|
+
const ee = new Set(O.blocks.map((et) => et.id));
|
|
20641
20642
|
O = await Pt(
|
|
20642
20643
|
this.context,
|
|
20643
20644
|
ma(he, O.version)
|
|
20644
20645
|
);
|
|
20645
|
-
const ye = O.blocks.filter((et) => !
|
|
20646
|
+
const ye = O.blocks.filter((et) => !ee.has(et.id));
|
|
20646
20647
|
if (ye.length !== 1)
|
|
20647
20648
|
return B(O, A);
|
|
20648
|
-
|
|
20649
|
+
X.set(he.id, ye[0].id);
|
|
20649
20650
|
}
|
|
20650
20651
|
} catch (he) {
|
|
20651
20652
|
return z === "patch" ? b(he) : N(he);
|
|
20652
20653
|
}
|
|
20653
20654
|
if (br(O, A))
|
|
20654
20655
|
return this.replaceSnapshot(O), O;
|
|
20655
|
-
const Q = Mc(A, O,
|
|
20656
|
+
const Q = Mc(A, O, X), me = Q ? { ...A, blocks: Q } : null;
|
|
20656
20657
|
if (me && ua(O, me))
|
|
20657
20658
|
return this.replaceSnapshot(O), O;
|
|
20658
20659
|
if (Q && me && da(O, me)) {
|
|
@@ -20979,10 +20980,10 @@ function QP(e, t = {}) {
|
|
|
20979
20980
|
}
|
|
20980
20981
|
if (u.type === "document_ready") {
|
|
20981
20982
|
if (this.replaceV2Document(u.data.document), this.v2ComposeDataPatchTotal = F5(u.data.document), this.v2ComposePatchedCardIds = [], this.v2ComposeFailedCardIds = [], this.v2ComposeBusinessGapDetails = [], h) {
|
|
20982
|
-
const B = Ac(u.data.document.cards.length),
|
|
20983
|
+
const B = Ac(u.data.document.cards.length), j = this.v2ComposeDataPatchTotal > 0 ? f("FWA.1c101787570476401", { p0: this.v2ComposeDataPatchTotal }) : f("FWA.344f1787570671497");
|
|
20983
20984
|
this.pendingComposeStatus = {
|
|
20984
20985
|
messageId: h,
|
|
20985
|
-
content:
|
|
20986
|
+
content: j,
|
|
20986
20987
|
detail: B,
|
|
20987
20988
|
matchedSummary: B,
|
|
20988
20989
|
composeStage: "document_ready",
|
|
@@ -20999,13 +21000,13 @@ function QP(e, t = {}) {
|
|
|
20999
21000
|
bindingId: u.data.bindingId.trim()
|
|
21000
21001
|
};
|
|
21001
21002
|
if (!this.applyV2CardDataPatch(B)) return;
|
|
21002
|
-
this.v2ComposePatchedCardIds.includes(B.cardId) || (this.v2ComposePatchedCardIds = [...this.v2ComposePatchedCardIds, B.cardId]), B.status === "error" && !this.v2ComposeFailedCardIds.includes(B.cardId) ? this.v2ComposeFailedCardIds = [...this.v2ComposeFailedCardIds, B.cardId] : B.status !== "error" && this.v2ComposeFailedCardIds.includes(B.cardId) && (this.v2ComposeFailedCardIds = this.v2ComposeFailedCardIds.filter((
|
|
21003
|
-
const
|
|
21004
|
-
if (
|
|
21005
|
-
const
|
|
21003
|
+
this.v2ComposePatchedCardIds.includes(B.cardId) || (this.v2ComposePatchedCardIds = [...this.v2ComposePatchedCardIds, B.cardId]), B.status === "error" && !this.v2ComposeFailedCardIds.includes(B.cardId) ? this.v2ComposeFailedCardIds = [...this.v2ComposeFailedCardIds, B.cardId] : B.status !== "error" && this.v2ComposeFailedCardIds.includes(B.cardId) && (this.v2ComposeFailedCardIds = this.v2ComposeFailedCardIds.filter((oe) => oe !== B.cardId));
|
|
21004
|
+
const U = G5(B, this.v2Document);
|
|
21005
|
+
if (U && (this.v2ComposeBusinessGapDetails = wc(this.v2ComposeBusinessGapDetails, U)), h) {
|
|
21006
|
+
const oe = this.v2ComposePatchedCardIds.length, $ = this.v2ComposeDataPatchTotal || oe, te = this.v2ComposeFailedCardIds.length, re = this.v2ComposeBusinessGapDetails.length;
|
|
21006
21007
|
this.pendingComposeStatus = {
|
|
21007
21008
|
messageId: h,
|
|
21008
|
-
content: P5(
|
|
21009
|
+
content: P5(oe, $, te, re),
|
|
21009
21010
|
detail: (S = this.pendingComposeStatus) == null ? void 0 : S.matchedSummary,
|
|
21010
21011
|
matchedSummary: (A = this.pendingComposeStatus) == null ? void 0 : A.matchedSummary,
|
|
21011
21012
|
composeStage: "backfilling",
|
|
@@ -21016,11 +21017,11 @@ function QP(e, t = {}) {
|
|
|
21016
21017
|
}
|
|
21017
21018
|
if (u.type === "compose_error") {
|
|
21018
21019
|
if (h) {
|
|
21019
|
-
const B = _i(u.data.message),
|
|
21020
|
+
const B = _i(u.data.message), j = Cc(u.data.message);
|
|
21020
21021
|
this.pendingComposeStatus = {
|
|
21021
21022
|
messageId: h,
|
|
21022
21023
|
content: B,
|
|
21023
|
-
error:
|
|
21024
|
+
error: j,
|
|
21024
21025
|
detail: u.data.message,
|
|
21025
21026
|
composeStage: "error",
|
|
21026
21027
|
loading: !1
|
|
@@ -21036,19 +21037,19 @@ function QP(e, t = {}) {
|
|
|
21036
21037
|
this.v2Document = B.document;
|
|
21037
21038
|
const re = zt(this.snapshot, B.document, this.$state);
|
|
21038
21039
|
this.replaceSnapshot(re), this.layoutConfig = be(re.layoutConfig), this.v2ComposeBusinessGapDetails = B.details.reduce(
|
|
21039
|
-
(O,
|
|
21040
|
+
(O, X) => wc(O, X),
|
|
21040
21041
|
this.v2ComposeBusinessGapDetails
|
|
21041
21042
|
);
|
|
21042
21043
|
} else B && B.finalizedCount > 0 && (this.v2Document = B.document, this.v2ComposeBusinessGapDetails = B.details.reduce(
|
|
21043
21044
|
(re, O) => wc(re, O),
|
|
21044
21045
|
this.v2ComposeBusinessGapDetails
|
|
21045
21046
|
));
|
|
21046
|
-
const
|
|
21047
|
+
const j = ((T = this.v2Document) == null ? void 0 : T.workbenchId) === u.data.workbenchId ? this.v2Document.cards.length : u.data.cardCount, U = u.data.dataPatchFailed ?? this.v2ComposeFailedCardIds.length + ((B == null ? void 0 : B.finalizedCount) ?? 0), oe = u.data.dataPatchHumanIntervention ?? this.v2ComposeBusinessGapDetails.length, $ = Ac(j), te = this.v2ComposeBusinessGapDetails;
|
|
21047
21048
|
this.v2ComposeDataPatchTotal = 0, this.v2ComposePatchedCardIds = [], this.v2ComposeFailedCardIds = [], this.v2ComposeBusinessGapDetails = [], this.pendingComposeStatus = {
|
|
21048
21049
|
messageId: h,
|
|
21049
|
-
content: gm(
|
|
21050
|
-
detail: Im(
|
|
21051
|
-
matchedSummary:
|
|
21050
|
+
content: gm(j, U, oe),
|
|
21051
|
+
detail: Im($, te),
|
|
21052
|
+
matchedSummary: $,
|
|
21052
21053
|
composeStage: "done",
|
|
21053
21054
|
loading: !1
|
|
21054
21055
|
};
|
|
@@ -21057,8 +21058,8 @@ function QP(e, t = {}) {
|
|
|
21057
21058
|
}
|
|
21058
21059
|
if (u.type === "data_binding_running") {
|
|
21059
21060
|
if (h && ym(this.pendingComposeStatus, h)) return;
|
|
21060
|
-
const B = u.data.cardId.trim(),
|
|
21061
|
-
if (!W5(this.v2Document, B,
|
|
21061
|
+
const B = u.data.cardId.trim(), j = u.data.bindingId.trim();
|
|
21062
|
+
if (!W5(this.v2Document, B, j) || !this.markDataBindingRefreshStatus(j, "running")) return;
|
|
21062
21063
|
if (h && this.v2ComposeDataPatchTotal > 0) {
|
|
21063
21064
|
this.pendingComposeStatus = {
|
|
21064
21065
|
messageId: h,
|
|
@@ -21150,12 +21151,12 @@ function QP(e, t = {}) {
|
|
|
21150
21151
|
var b, N;
|
|
21151
21152
|
const _ = [];
|
|
21152
21153
|
for (const [P, B] of T.entries()) {
|
|
21153
|
-
const
|
|
21154
|
+
const j = P === 0 ? (b = this.snapshot) == null ? void 0 : b.version : void 0, U = await this.updateCard(gM(
|
|
21154
21155
|
h.patchIntent,
|
|
21155
21156
|
B,
|
|
21156
|
-
|
|
21157
|
+
j
|
|
21157
21158
|
));
|
|
21158
|
-
|
|
21159
|
+
U.success || _.push(((N = U.error) == null ? void 0 : N.message) || f("FWA.fd551787570851109", { p0: B }));
|
|
21159
21160
|
}
|
|
21160
21161
|
return _;
|
|
21161
21162
|
};
|
|
@@ -21356,10 +21357,10 @@ function QP(e, t = {}) {
|
|
|
21356
21357
|
if (u.type === "message_delta" || u.type === "message_completed") {
|
|
21357
21358
|
const C = W8(u, h.threadId);
|
|
21358
21359
|
if (u.channel === "preamble") {
|
|
21359
|
-
const B = (/* @__PURE__ */ new Date()).toISOString(),
|
|
21360
|
+
const B = (/* @__PURE__ */ new Date()).toISOString(), j = Gt.get(C) || { content: "", emittedFinalLength: 0 };
|
|
21360
21361
|
if (u.type === "message_delta") {
|
|
21361
|
-
|
|
21362
|
-
content:
|
|
21362
|
+
j.content = `${j.content}${u.content}`, Gt.set(C, j), this.turns = ne(this.turns, g, (oe) => ef(oe, {
|
|
21363
|
+
content: j.content,
|
|
21363
21364
|
createdAt: B,
|
|
21364
21365
|
done: !1,
|
|
21365
21366
|
messageId: u.messageId || `${u.runId}-message`,
|
|
@@ -21368,9 +21369,9 @@ function QP(e, t = {}) {
|
|
|
21368
21369
|
}));
|
|
21369
21370
|
return;
|
|
21370
21371
|
}
|
|
21371
|
-
const
|
|
21372
|
-
Gt.delete(C), this.turns = ne(this.turns, g, (
|
|
21373
|
-
content:
|
|
21372
|
+
const U = u.content || j.content || "";
|
|
21373
|
+
Gt.delete(C), this.turns = ne(this.turns, g, (oe) => ef(oe, {
|
|
21374
|
+
content: U,
|
|
21374
21375
|
createdAt: B,
|
|
21375
21376
|
done: !0,
|
|
21376
21377
|
messageId: u.messageId || `${u.runId}-message`,
|
|
@@ -21386,15 +21387,15 @@ function QP(e, t = {}) {
|
|
|
21386
21387
|
)), u.type === "message_delta") {
|
|
21387
21388
|
const B = Gt.get(C) || { content: "", emittedFinalLength: 0 };
|
|
21388
21389
|
if (B.content = `${B.content}${u.content}`, Gt.set(C, B), Xl(B.content)) return;
|
|
21389
|
-
const
|
|
21390
|
-
if (!
|
|
21391
|
-
const
|
|
21392
|
-
if (!
|
|
21393
|
-
B.emittedFinalLength =
|
|
21390
|
+
const j = Zl(B.content);
|
|
21391
|
+
if (!j.finalText || j.progressText && Xl(j.finalText)) return;
|
|
21392
|
+
const U = j.finalText.slice(B.emittedFinalLength);
|
|
21393
|
+
if (!U) return;
|
|
21394
|
+
B.emittedFinalLength = j.finalText.length, this.queueDeepAgentFinalDeltaEvent({
|
|
21394
21395
|
type: "final.delta",
|
|
21395
21396
|
turnId: g,
|
|
21396
21397
|
seq: mt(),
|
|
21397
|
-
markdownDelta:
|
|
21398
|
+
markdownDelta: U,
|
|
21398
21399
|
isFinalDelta: !1,
|
|
21399
21400
|
eventCode: "deep_agent.message.delta",
|
|
21400
21401
|
eventId: u.messageId || `${u.runId}-message`,
|
|
@@ -21585,40 +21586,40 @@ function QP(e, t = {}) {
|
|
|
21585
21586
|
conversationId: h.threadId
|
|
21586
21587
|
});
|
|
21587
21588
|
B && this.reduceStreamEvent(B, { conversationId: h.threadId, fallbackTurnId: g });
|
|
21588
|
-
const
|
|
21589
|
+
const j = bp({
|
|
21589
21590
|
payload: u.publicPayload,
|
|
21590
21591
|
turnId: g,
|
|
21591
21592
|
conversationId: h.threadId
|
|
21592
21593
|
});
|
|
21593
|
-
|
|
21594
|
-
const
|
|
21595
|
-
|
|
21594
|
+
j && this.reduceStreamEvent(j, { conversationId: h.threadId, fallbackTurnId: g });
|
|
21595
|
+
const U = D8(u.publicPayload), oe = b == null ? void 0 : b.confirmation;
|
|
21596
|
+
U ? (U.patchPlan && this.reduceStreamEvent({
|
|
21596
21597
|
type: "patch_plan_ready",
|
|
21597
21598
|
turnId: g,
|
|
21598
|
-
patchPlan:
|
|
21599
|
-
highlightBlockIds:
|
|
21600
|
-
candidateBlockIds:
|
|
21599
|
+
patchPlan: U.patchPlan,
|
|
21600
|
+
highlightBlockIds: U.patchPlan.targetBlockIds,
|
|
21601
|
+
candidateBlockIds: U.candidateBlockIds
|
|
21601
21602
|
}, { conversationId: h.threadId, fallbackTurnId: g }), this.reduceStreamEvent({
|
|
21602
21603
|
type: "needs_confirmation",
|
|
21603
21604
|
turnId: g,
|
|
21604
|
-
confirmation:
|
|
21605
|
-
candidateBlockIds:
|
|
21606
|
-
}, { conversationId: h.threadId, fallbackTurnId: g })) : (b == null ? void 0 : b.status) === "needs_confirmation" &&
|
|
21605
|
+
confirmation: U.confirmation,
|
|
21606
|
+
candidateBlockIds: U.candidateBlockIds
|
|
21607
|
+
}, { conversationId: h.threadId, fallbackTurnId: g })) : (b == null ? void 0 : b.status) === "needs_confirmation" && oe && this.reduceStreamEvent({
|
|
21607
21608
|
type: "needs_confirmation",
|
|
21608
21609
|
turnId: g,
|
|
21609
|
-
confirmation:
|
|
21610
|
+
confirmation: oe
|
|
21610
21611
|
}, { conversationId: h.threadId, fallbackTurnId: g });
|
|
21611
|
-
const
|
|
21612
|
-
|
|
21612
|
+
const $ = P8(u.publicPayload);
|
|
21613
|
+
$ && this.reduceStreamEvent({
|
|
21613
21614
|
type: "patch_plan_ready",
|
|
21614
21615
|
turnId: g,
|
|
21615
|
-
patchPlan:
|
|
21616
|
-
highlightBlockIds:
|
|
21617
|
-
candidateBlockIds:
|
|
21618
|
-
error:
|
|
21619
|
-
suggestions:
|
|
21620
|
-
}, { conversationId: h.threadId, fallbackTurnId: g }), B8(u.publicPayload) ? this.applyDeepAgentWorkbenchCardMutation(u.publicPayload, h.threadId).catch((
|
|
21621
|
-
this.error = we(
|
|
21616
|
+
patchPlan: $.patchPlan,
|
|
21617
|
+
highlightBlockIds: $.patchPlan.targetBlockIds,
|
|
21618
|
+
candidateBlockIds: $.candidateBlockIds,
|
|
21619
|
+
error: $.patchPlan.error ?? $.error,
|
|
21620
|
+
suggestions: $.patchPlan.suggestions ?? $.suggestions
|
|
21621
|
+
}, { conversationId: h.threadId, fallbackTurnId: g }), B8(u.publicPayload) ? this.applyDeepAgentWorkbenchCardMutation(u.publicPayload, h.threadId).catch((te) => {
|
|
21622
|
+
this.error = we(te, f("FWA.69851787570623808"));
|
|
21622
21623
|
}) : b && b.severity !== "confirmation" && (b.severity === "error" ? At(b.message) : b.severity === "warning" && oa(b.message));
|
|
21623
21624
|
}
|
|
21624
21625
|
ms(u.toolName) && (this.turns = ne(this.turns, g, Ic));
|
|
@@ -21689,10 +21690,10 @@ function QP(e, t = {}) {
|
|
|
21689
21690
|
* @param eventsUrl - 后端返回的 events URL。
|
|
21690
21691
|
*/
|
|
21691
21692
|
async openDeepAgentRunEventsOnce(u, h, g, S, A) {
|
|
21692
|
-
var O,
|
|
21693
|
+
var O, X;
|
|
21693
21694
|
const C = g || this.activeTurnId || ((O = this.turns[this.turns.length - 1]) == null ? void 0 : O.id) || h;
|
|
21694
21695
|
g && (Ka = g);
|
|
21695
|
-
const T = ps(this.$state), _ = ((
|
|
21696
|
+
const T = ps(this.$state), _ = ((X = xe.currentThreadSession) == null ? void 0 : X.scopeKey) === T && xe.currentThreadSession.threadId === u ? xe.currentThreadSession : li(xe, T, u);
|
|
21696
21697
|
if (_.eventsUrl = S || _.eventsUrl, it === u && Xe === h && jt && !jt.signal.aborted) {
|
|
21697
21698
|
Sr && await Sr;
|
|
21698
21699
|
return;
|
|
@@ -21706,9 +21707,9 @@ function QP(e, t = {}) {
|
|
|
21706
21707
|
Sr = new Promise((z, Q) => {
|
|
21707
21708
|
N = z, P = Q;
|
|
21708
21709
|
}), pn = P;
|
|
21709
|
-
let B = !1,
|
|
21710
|
-
const
|
|
21711
|
-
|
|
21710
|
+
let B = !1, j = !1, U = !1, oe = !1;
|
|
21711
|
+
const $ = () => !(A != null && A.onRecoverableError) || oe ? !!(A != null && A.onRecoverableError) : (oe = !0, A.onRecoverableError(), !0), te = (z = f("FWA.f7d11787571197719")) => {
|
|
21712
|
+
U || (U = !0, At(z));
|
|
21712
21713
|
}, re = na(
|
|
21713
21714
|
this.context,
|
|
21714
21715
|
u,
|
|
@@ -21721,19 +21722,19 @@ function QP(e, t = {}) {
|
|
|
21721
21722
|
if (b.signal.aborted || it !== u || Xe !== h)
|
|
21722
21723
|
return;
|
|
21723
21724
|
const me = F8(z);
|
|
21724
|
-
(me.type === "done" || me.type === "error" || me.type === "run_status" && (me.status === "failed" || me.status === "cancelled" || me.status === "completed" || me.status === "terminated")) && (
|
|
21725
|
+
(me.type === "done" || me.type === "error" || me.type === "run_status" && (me.status === "failed" || me.status === "cancelled" || me.status === "completed" || me.status === "terminated")) && (j = !0), this.reduceDeepAgentRunEvent(me, {
|
|
21725
21726
|
threadId: u,
|
|
21726
21727
|
runId: h,
|
|
21727
21728
|
fallbackTurnId: Ka || C
|
|
21728
|
-
}),
|
|
21729
|
+
}), j && this.refreshDeepAgentQueueSnapshot(u).catch(() => this.retryWaitingDeepAgentTurns(u)), Q.id && (_.lastEventId = Q.id);
|
|
21729
21730
|
},
|
|
21730
21731
|
onError: (z) => {
|
|
21731
21732
|
var he;
|
|
21732
|
-
if (b.signal.aborted || it !== u || Xe !== h || (P(z),
|
|
21733
|
-
|
|
21734
|
-
const Q = this.activeTurnId || ((he = this.turns[this.turns.length - 1]) == null ? void 0 : he.id), me = Q ? this.turns.find((
|
|
21735
|
-
Q && me && (this.planning || me.status === "streaming") && (this.turns = ne(this.turns, Q, (
|
|
21736
|
-
...
|
|
21733
|
+
if (b.signal.aborted || it !== u || Xe !== h || (P(z), $()) || !B) return;
|
|
21734
|
+
te();
|
|
21735
|
+
const Q = this.activeTurnId || ((he = this.turns[this.turns.length - 1]) == null ? void 0 : he.id), me = Q ? this.turns.find((ee) => ee.id === Q) : null;
|
|
21736
|
+
Q && me && (this.planning || me.status === "streaming") && (this.turns = ne(this.turns, Q, (ee) => Wn({
|
|
21737
|
+
...ee,
|
|
21737
21738
|
status: "error",
|
|
21738
21739
|
error: z.message,
|
|
21739
21740
|
worklogEndedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -21750,10 +21751,10 @@ function QP(e, t = {}) {
|
|
|
21750
21751
|
lastEventId: _.lastEventId
|
|
21751
21752
|
}
|
|
21752
21753
|
).then(async () => {
|
|
21753
|
-
if (b.signal.aborted || it !== u || Xe !== h || !B ||
|
|
21754
|
+
if (b.signal.aborted || it !== u || Xe !== h || !B || j)
|
|
21754
21755
|
return;
|
|
21755
21756
|
const z = await Dn(this.context, u, h);
|
|
21756
|
-
z.status === "failed" && (
|
|
21757
|
+
z.status === "failed" && (j = !0, this.reduceDeepAgentRunEvent({
|
|
21757
21758
|
type: "error",
|
|
21758
21759
|
runId: h,
|
|
21759
21760
|
message: V8(z.error),
|
|
@@ -21764,9 +21765,9 @@ function QP(e, t = {}) {
|
|
|
21764
21765
|
fallbackTurnId: C
|
|
21765
21766
|
}));
|
|
21766
21767
|
}).catch((z) => {
|
|
21767
|
-
if (b.signal.aborted || (P(z instanceof Error ? z : new Error(String(z))), it === u && Xe === h && (jt = null, it = null, Xe = null, Sr = null, pn = null), !B) ||
|
|
21768
|
+
if (b.signal.aborted || (P(z instanceof Error ? z : new Error(String(z))), it === u && Xe === h && (jt = null, it = null, Xe = null, Sr = null, pn = null), !B) || $()) return;
|
|
21768
21769
|
const Q = we(z, f("FWA.f7d11787571197719"));
|
|
21769
|
-
|
|
21770
|
+
te(Am(Q) ? f("FWA.f7d11787571197719") : Q);
|
|
21770
21771
|
}).finally(() => {
|
|
21771
21772
|
xe.currentThreadSession === _ && (_.eventsOpening = void 0);
|
|
21772
21773
|
});
|
|
@@ -21860,7 +21861,7 @@ function QP(e, t = {}) {
|
|
|
21860
21861
|
if (u.type !== "assistant_delta") {
|
|
21861
21862
|
if (u.type === "stream_message") {
|
|
21862
21863
|
if (this.turns = ne(this.turns, u.turnId, (b) => Sx(b, u)), rh(u.item.payload)) {
|
|
21863
|
-
const b = this.turns.find((
|
|
21864
|
+
const b = this.turns.find((j) => j.id === u.turnId), N = (b == null ? void 0 : b.conversationId) || h.conversationId, P = (b == null ? void 0 : b.userPrompt) || (b == null ? void 0 : b.title) || u.item.title, B = `${N || ""}:${u.turnId}:${u.item.id}`;
|
|
21864
21865
|
N && P && !Ho.has(B) && (Ho.add(B), (!b || !Sc(b, P)) && this.loadCardRecommendationsForLatestQueryResult(u.turnId, N, P));
|
|
21865
21866
|
}
|
|
21866
21867
|
return;
|
|
@@ -21909,7 +21910,7 @@ function QP(e, t = {}) {
|
|
|
21909
21910
|
const N = p8(this.snapshot, u.turnId, u.planResult), P = [
|
|
21910
21911
|
u.planResult.summary,
|
|
21911
21912
|
...u.planResult.assumptions,
|
|
21912
|
-
...u.planResult.plannerSteps.map((
|
|
21913
|
+
...u.planResult.plannerSteps.map((U) => `${U.label}:${U.detail}`)
|
|
21913
21914
|
].filter(Boolean).join(`
|
|
21914
21915
|
`), B = rr(
|
|
21915
21916
|
"proposal",
|
|
@@ -21918,7 +21919,7 @@ function QP(e, t = {}) {
|
|
|
21918
21919
|
"done",
|
|
21919
21920
|
JSON.stringify(u.planResult, null, 2),
|
|
21920
21921
|
P
|
|
21921
|
-
),
|
|
21922
|
+
), j = b.traceItems.some((U) => U.id === B.id) ? b.traceItems : [...b.traceItems, B];
|
|
21922
21923
|
return {
|
|
21923
21924
|
...b,
|
|
21924
21925
|
title: dx(u.planResult, b.userPrompt),
|
|
@@ -21929,14 +21930,14 @@ function QP(e, t = {}) {
|
|
|
21929
21930
|
worklogStageVisible: N ? !0 : b.worklogStageVisible,
|
|
21930
21931
|
mode: u.planResult.intentChannel,
|
|
21931
21932
|
intentChannel: u.planResult.intentChannel,
|
|
21932
|
-
traceItems:
|
|
21933
|
+
traceItems: j,
|
|
21933
21934
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
21934
21935
|
};
|
|
21935
21936
|
});
|
|
21936
21937
|
return;
|
|
21937
21938
|
}
|
|
21938
21939
|
if (u.type === "patch_plan_ready") {
|
|
21939
|
-
const b = u.patchPlan.targetResolve, N = (C = (A = u.patchPlan.error) == null ? void 0 : A.candidates) == null ? void 0 : C.map((
|
|
21940
|
+
const b = u.patchPlan.targetResolve, N = (C = (A = u.patchPlan.error) == null ? void 0 : A.candidates) == null ? void 0 : C.map((j) => j.blockId), P = Tr(
|
|
21940
21941
|
u.highlightBlockIds,
|
|
21941
21942
|
b == null ? void 0 : b.targetBlockIds,
|
|
21942
21943
|
u.patchPlan.targetBlockIds
|
|
@@ -21951,7 +21952,7 @@ function QP(e, t = {}) {
|
|
|
21951
21952
|
highlightBlockIds: P,
|
|
21952
21953
|
candidateBlockIds: B,
|
|
21953
21954
|
reason: u.patchPlan.targetSummary || (b == null ? void 0 : b.reason) || u.patchPlan.note || u.patchPlan.summary || u.patchPlan.reason || ""
|
|
21954
|
-
}), this.turns = ne(this.turns, u.turnId, (
|
|
21955
|
+
}), this.turns = ne(this.turns, u.turnId, (j) => bx(j, u));
|
|
21955
21956
|
return;
|
|
21956
21957
|
}
|
|
21957
21958
|
if (u.type === "card_recommendations_ready") {
|
|
@@ -22109,14 +22110,14 @@ function QP(e, t = {}) {
|
|
|
22109
22110
|
* @returns Promise resolved after the card patch request completes.
|
|
22110
22111
|
*/
|
|
22111
22112
|
async applyCardPatchPrompt(u, h = {}) {
|
|
22112
|
-
var N, P, B,
|
|
22113
|
+
var N, P, B, j, U, oe, $, te, re, O, X, z, Q, me, he;
|
|
22113
22114
|
const g = u.trim();
|
|
22114
22115
|
if (!g || !this.snapshot) return;
|
|
22115
22116
|
const S = h.selectedBlockId || this.lastComposeInsertedBlockIds[this.lastComposeInsertedBlockIds.length - 1] || this.patchHighlightBlockIds[this.patchHighlightBlockIds.length - 1] || null;
|
|
22116
22117
|
this.clearPatchHighlight();
|
|
22117
22118
|
const A = S || void 0, C = ((N = h.chatThreadId) == null ? void 0 : N.trim()) || ((P = h.clientDraftId) == null ? void 0 : P.trim()) || this.currentConversationId;
|
|
22118
22119
|
(h.chatThreadId || h.clientDraftId) && C !== this.currentConversationId && (this.currentConversationId = C);
|
|
22119
|
-
const T = this.turns.filter((
|
|
22120
|
+
const T = this.turns.filter((ee) => ee.conversationId === C).map(ns), _ = {
|
|
22120
22121
|
...er(g),
|
|
22121
22122
|
conversationId: C,
|
|
22122
22123
|
mode: "card_patch",
|
|
@@ -22143,11 +22144,11 @@ function QP(e, t = {}) {
|
|
|
22143
22144
|
}
|
|
22144
22145
|
});
|
|
22145
22146
|
this.turns = [
|
|
22146
|
-
...this.turns.map((
|
|
22147
|
+
...this.turns.map((ee) => ({ ...ee, collapsed: !0 })),
|
|
22147
22148
|
_
|
|
22148
22149
|
], this.activeTurnId = _.id, this.planning = !0, this.error = "";
|
|
22149
22150
|
try {
|
|
22150
|
-
const
|
|
22151
|
+
const ee = await tn(this.context, {
|
|
22151
22152
|
conversationId: C,
|
|
22152
22153
|
input: g,
|
|
22153
22154
|
selectedBlockId: A || void 0,
|
|
@@ -22155,7 +22156,7 @@ function QP(e, t = {}) {
|
|
|
22155
22156
|
baseVersion: this.snapshot.version,
|
|
22156
22157
|
screenContext: b
|
|
22157
22158
|
});
|
|
22158
|
-
if (V5(
|
|
22159
|
+
if (V5(ee)) {
|
|
22159
22160
|
await this.runPrompt(g, {
|
|
22160
22161
|
reuseTurnId: _.id,
|
|
22161
22162
|
selectedBlockId: A || null,
|
|
@@ -22167,57 +22168,57 @@ function QP(e, t = {}) {
|
|
|
22167
22168
|
});
|
|
22168
22169
|
return;
|
|
22169
22170
|
}
|
|
22170
|
-
if (
|
|
22171
|
-
const ye =
|
|
22172
|
-
if (!!(Array.isArray(ye == null ? void 0 : ye.suggestions) && ye.suggestions.length > 0 || Array.isArray(et == null ? void 0 : et.suggestions) && et.suggestions.length > 0) &&
|
|
22171
|
+
if (ee.status !== "applied" && ee.status !== "needs_confirmation" || ee.status === "needs_confirmation" && !ee.confirmation) {
|
|
22172
|
+
const ye = ee.patchPlan, et = ye != null && ye.error && typeof ye.error == "object" && !Array.isArray(ye.error) ? ye.error : void 0;
|
|
22173
|
+
if (!!(Array.isArray(ye == null ? void 0 : ye.suggestions) && ye.suggestions.length > 0 || Array.isArray(et == null ? void 0 : et.suggestions) && et.suggestions.length > 0) && ee.patchPlan) {
|
|
22173
22174
|
this.reduceStreamEvent({
|
|
22174
22175
|
type: "patch_plan_ready",
|
|
22175
22176
|
turnId: _.id,
|
|
22176
|
-
patchPlan:
|
|
22177
|
-
highlightBlockIds:
|
|
22178
|
-
candidateBlockIds: (
|
|
22179
|
-
error: (
|
|
22180
|
-
suggestions: (
|
|
22177
|
+
patchPlan: ee.patchPlan,
|
|
22178
|
+
highlightBlockIds: ee.changedBlockIds,
|
|
22179
|
+
candidateBlockIds: (j = (B = ee.patchPlan) == null ? void 0 : B.targetResolve) == null ? void 0 : j.candidateBlockIds,
|
|
22180
|
+
error: (U = ee.patchPlan) == null ? void 0 : U.error,
|
|
22181
|
+
suggestions: (oe = ee.patchPlan) == null ? void 0 : oe.suggestions
|
|
22181
22182
|
}), this.reduceStreamEvent({ type: "done", turnId: _.id });
|
|
22182
22183
|
return;
|
|
22183
22184
|
}
|
|
22184
|
-
const Ge =
|
|
22185
|
-
At(Ge), this.turns = this.turns.filter((St) => St.id !== _.id), this.activeTurnId = ((
|
|
22185
|
+
const Ge = ee.message || (($ = ee.error) == null ? void 0 : $.message) || f("FWA.e98e1787571267624");
|
|
22186
|
+
At(Ge), this.turns = this.turns.filter((St) => St.id !== _.id), this.activeTurnId = ((te = this.turns.find((St) => !St.collapsed)) == null ? void 0 : te.id) ?? ((re = this.turns[this.turns.length - 1]) == null ? void 0 : re.id) ?? null, this.error = "";
|
|
22186
22187
|
return;
|
|
22187
22188
|
}
|
|
22188
|
-
if (
|
|
22189
|
+
if (ee.patchPlan && this.reduceStreamEvent({
|
|
22189
22190
|
type: "patch_plan_ready",
|
|
22190
22191
|
turnId: _.id,
|
|
22191
|
-
patchPlan:
|
|
22192
|
-
highlightBlockIds:
|
|
22193
|
-
candidateBlockIds: (
|
|
22194
|
-
error: (z =
|
|
22195
|
-
suggestions: (Q =
|
|
22196
|
-
}),
|
|
22192
|
+
patchPlan: ee.patchPlan,
|
|
22193
|
+
highlightBlockIds: ee.changedBlockIds,
|
|
22194
|
+
candidateBlockIds: (X = (O = ee.patchPlan) == null ? void 0 : O.targetResolve) == null ? void 0 : X.candidateBlockIds,
|
|
22195
|
+
error: (z = ee.patchPlan) == null ? void 0 : z.error,
|
|
22196
|
+
suggestions: (Q = ee.patchPlan) == null ? void 0 : Q.suggestions
|
|
22197
|
+
}), ee.status === "needs_confirmation" && ee.confirmation) {
|
|
22197
22198
|
this.reduceStreamEvent({
|
|
22198
22199
|
type: "needs_confirmation",
|
|
22199
22200
|
turnId: _.id,
|
|
22200
|
-
confirmation:
|
|
22201
|
-
candidateBlockIds: (he = (me =
|
|
22201
|
+
confirmation: ee.confirmation,
|
|
22202
|
+
candidateBlockIds: (he = (me = ee.patchPlan) == null ? void 0 : me.targetResolve) == null ? void 0 : he.candidateBlockIds
|
|
22202
22203
|
});
|
|
22203
22204
|
return;
|
|
22204
22205
|
}
|
|
22205
|
-
if (
|
|
22206
|
-
const ye = Pm(this.snapshot,
|
|
22206
|
+
if (ee.status === "applied" && ee.snapshot) {
|
|
22207
|
+
const ye = Pm(this.snapshot, ee.snapshot, ee.changedBlockIds);
|
|
22207
22208
|
this.reduceStreamEvent({
|
|
22208
22209
|
type: "snapshot_updated",
|
|
22209
22210
|
turnId: _.id,
|
|
22210
22211
|
snapshot: ye,
|
|
22211
|
-
reason:
|
|
22212
|
-
changedBlockIds:
|
|
22213
|
-
highlightBlockIds:
|
|
22214
|
-
mutationTransaction:
|
|
22212
|
+
reason: ee.message,
|
|
22213
|
+
changedBlockIds: ee.changedBlockIds,
|
|
22214
|
+
highlightBlockIds: ee.changedBlockIds,
|
|
22215
|
+
mutationTransaction: ee.mutationTransaction
|
|
22215
22216
|
}), this.reduceStreamEvent({ type: "done", turnId: _.id });
|
|
22216
22217
|
return;
|
|
22217
22218
|
}
|
|
22218
22219
|
this.reduceStreamEvent({ type: "done", turnId: _.id });
|
|
22219
|
-
} catch (
|
|
22220
|
-
const ye = we(
|
|
22220
|
+
} catch (ee) {
|
|
22221
|
+
const ye = we(ee, f("FWA.900a1787571523455"));
|
|
22221
22222
|
this.error = ye, At(f("FWA.f7d11787571197719")), this.turns = ne(this.turns, _.id, (et) => Wn({
|
|
22222
22223
|
...et,
|
|
22223
22224
|
status: "error",
|
|
@@ -22298,7 +22299,7 @@ function QP(e, t = {}) {
|
|
|
22298
22299
|
}
|
|
22299
22300
|
},
|
|
22300
22301
|
async runPrompt(u, h, g) {
|
|
22301
|
-
var me, he,
|
|
22302
|
+
var me, he, ee, ye, et;
|
|
22302
22303
|
const S = u.trim();
|
|
22303
22304
|
if (!S) return;
|
|
22304
22305
|
const A = h && typeof h == "object" ? h : null, C = (me = A == null ? void 0 : A.chatThreadId) == null ? void 0 : me.trim(), T = (he = A == null ? void 0 : A.clientDraftId) == null ? void 0 : he.trim(), _ = C || T || this.currentConversationId;
|
|
@@ -22308,45 +22309,45 @@ function QP(e, t = {}) {
|
|
|
22308
22309
|
}
|
|
22309
22310
|
const b = typeof h == "object" ? h == null ? void 0 : h.selectedBlockId : h;
|
|
22310
22311
|
this.clearPatchHighlight();
|
|
22311
|
-
const N = typeof h == "object" ? (h == null ? void 0 : h.selectedSystemCard) ?? null : null, P = typeof h == "object" ? h == null ? void 0 : h.businessGroup : void 0, B = typeof h == "object" ? h == null ? void 0 : h.attachments : void 0,
|
|
22312
|
+
const N = typeof h == "object" ? (h == null ? void 0 : h.selectedSystemCard) ?? null : null, P = typeof h == "object" ? h == null ? void 0 : h.businessGroup : void 0, B = typeof h == "object" ? h == null ? void 0 : h.attachments : void 0, j = A == null ? void 0 : A.actionPayload;
|
|
22312
22313
|
(C || T) && _ !== this.currentConversationId && (this.currentConversationId = _);
|
|
22313
|
-
let
|
|
22314
|
-
const
|
|
22315
|
-
if (
|
|
22314
|
+
let U;
|
|
22315
|
+
const oe = A != null && A.reuseTurnId ? this.turns.find((Le) => Le.id === A.reuseTurnId) : void 0;
|
|
22316
|
+
if (oe) {
|
|
22316
22317
|
const Le = {
|
|
22317
22318
|
...er(S),
|
|
22318
|
-
id:
|
|
22319
|
+
id: oe.id,
|
|
22319
22320
|
conversationId: _,
|
|
22320
|
-
createdAt:
|
|
22321
|
-
worklogStartedAt:
|
|
22322
|
-
deepAgentSubmission:
|
|
22321
|
+
createdAt: oe.createdAt,
|
|
22322
|
+
worklogStartedAt: oe.worklogStartedAt,
|
|
22323
|
+
deepAgentSubmission: oe.userPrompt === S && oe.deepAgentSubmission ? { ...oe.deepAgentSubmission, status: "submitting" } : Jo()
|
|
22323
22324
|
};
|
|
22324
|
-
|
|
22325
|
-
(Ge) => Ge.id ===
|
|
22325
|
+
U = Le, this.turns = this.turns.map(
|
|
22326
|
+
(Ge) => Ge.id === oe.id ? Le : { ...Ge, collapsed: !0 }
|
|
22326
22327
|
);
|
|
22327
22328
|
} else
|
|
22328
|
-
|
|
22329
|
+
U = {
|
|
22329
22330
|
...er(S),
|
|
22330
22331
|
conversationId: _,
|
|
22331
22332
|
deepAgentSubmission: Jo()
|
|
22332
22333
|
}, this.turns = [
|
|
22333
22334
|
...this.turns.map((Le) => ({ ...Le, collapsed: !0 })),
|
|
22334
|
-
|
|
22335
|
+
U
|
|
22335
22336
|
];
|
|
22336
|
-
const
|
|
22337
|
+
const $ = j ?? null, te = R8({
|
|
22337
22338
|
workspaceId: this.workspaceId,
|
|
22338
22339
|
selectedBlockId: b,
|
|
22339
22340
|
selectedSystemCard: N,
|
|
22340
22341
|
businessGroup: P,
|
|
22341
22342
|
attachments: B,
|
|
22342
|
-
actionPayload:
|
|
22343
|
+
actionPayload: $
|
|
22343
22344
|
}), re = this.activeTurnId;
|
|
22344
|
-
if (this.activeTurnId =
|
|
22345
|
+
if (this.activeTurnId = U.id, this.planning = !!Xe || this.planning, this.error = "", ju(S) && !N && !(B != null && B.length) && !$) {
|
|
22345
22346
|
try {
|
|
22346
22347
|
const Le = _;
|
|
22347
|
-
await this.loadCardRecommendationsForLatestQueryResult(
|
|
22348
|
+
await this.loadCardRecommendationsForLatestQueryResult(U.id, Le, S, {
|
|
22348
22349
|
replaceExistingForSource: !0
|
|
22349
|
-
}), this.reduceStreamEvent({ type: "done", turnId:
|
|
22350
|
+
}), this.reduceStreamEvent({ type: "done", turnId: U.id });
|
|
22350
22351
|
} finally {
|
|
22351
22352
|
this.planning = !1;
|
|
22352
22353
|
}
|
|
@@ -22354,7 +22355,7 @@ function QP(e, t = {}) {
|
|
|
22354
22355
|
}
|
|
22355
22356
|
const O = new AbortController();
|
|
22356
22357
|
qe = O;
|
|
22357
|
-
let
|
|
22358
|
+
let X = U.id, z = !1;
|
|
22358
22359
|
const Q = () => {
|
|
22359
22360
|
z || (z = !0, At(f("FWA.f7d11787571197719")));
|
|
22360
22361
|
};
|
|
@@ -22374,18 +22375,18 @@ function QP(e, t = {}) {
|
|
|
22374
22375
|
appId: this.context.appId,
|
|
22375
22376
|
businessGroup: P,
|
|
22376
22377
|
content: S,
|
|
22377
|
-
refs:
|
|
22378
|
-
turnId:
|
|
22379
|
-
snapshotVersion: (
|
|
22378
|
+
refs: te,
|
|
22379
|
+
turnId: U.id,
|
|
22380
|
+
snapshotVersion: (ee = this.snapshot) == null ? void 0 : ee.version,
|
|
22380
22381
|
selectedBlockId: b,
|
|
22381
22382
|
selectedNestedBlock: (A == null ? void 0 : A.selectedNestedBlock) ?? null,
|
|
22382
22383
|
selectedSystemCard: N,
|
|
22383
22384
|
attachments: B,
|
|
22384
|
-
actionPayload:
|
|
22385
|
-
}), St = ((ye =
|
|
22386
|
-
(et = A == null ? void 0 : A.onThreadReady) == null || et.call(A, Bn),
|
|
22385
|
+
actionPayload: $
|
|
22386
|
+
}), St = ((ye = U.deepAgentSubmission) == null ? void 0 : ye.idempotencyKey) || Jo().idempotencyKey, In = Le ? await It(this.context, Le, Ge, St) : await Xs(this.context, Ge, St), Bn = await this.ensureDeepAgentThreadConversationId(_, U.id, In.threadId);
|
|
22387
|
+
(et = A == null ? void 0 : A.onThreadReady) == null || et.call(A, Bn), X = U.id;
|
|
22387
22388
|
const Yn = In.status === "pending";
|
|
22388
|
-
return this.turns = ne(this.turns,
|
|
22389
|
+
return this.turns = ne(this.turns, U.id, (gl) => {
|
|
22389
22390
|
var yl;
|
|
22390
22391
|
return {
|
|
22391
22392
|
...gl,
|
|
@@ -22402,11 +22403,11 @@ function QP(e, t = {}) {
|
|
|
22402
22403
|
},
|
|
22403
22404
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
22404
22405
|
};
|
|
22405
|
-
}), this.persistRecoverableDeepAgentTurn(
|
|
22406
|
+
}), this.persistRecoverableDeepAgentTurn(U.id, B), Yn ? (this.activeTurnId = re || U.id, this.startDeepAgentQueuePolling(Bn), Bn) : (this.planning = !0, await this.openDeepAgentRunEventsOnce(Bn, In.runId, X, In.eventsUrl), Bn);
|
|
22406
22407
|
} catch (Le) {
|
|
22407
22408
|
if (O.signal.aborted) return;
|
|
22408
22409
|
const Ge = j7(Le), St = Ge === "queue_full" || Ge === "migration" || Ge === "legacy_active" || Ge === "network", In = Ge === "queue_full" ? f("FWA.8bd01787570646281") : Ge === "migration" ? f("FWA.bb171787570675085") : Ge === "legacy_active" ? f("FWA.253e1787570647300") : f("FWA.35391787570707068"), Bn = St ? In : we(Le, f("FWA.fed41787571117788"));
|
|
22409
|
-
St || Q(), this.turns = ne(this.turns,
|
|
22410
|
+
St || Q(), this.turns = ne(this.turns, U.id, (Yn) => Wn({
|
|
22410
22411
|
...Yn,
|
|
22411
22412
|
status: St ? "streaming" : "error",
|
|
22412
22413
|
error: St ? void 0 : Bn,
|
|
@@ -22418,7 +22419,7 @@ function QP(e, t = {}) {
|
|
|
22418
22419
|
retryKind: Ge
|
|
22419
22420
|
} : void 0,
|
|
22420
22421
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
22421
|
-
}, !0)), this.persistRecoverableDeepAgentTurn(
|
|
22422
|
+
}, !0)), this.persistRecoverableDeepAgentTurn(U.id, B), this.planning = !!Xe;
|
|
22422
22423
|
} finally {
|
|
22423
22424
|
qe === O && (qe = null);
|
|
22424
22425
|
}
|
|
@@ -22625,10 +22626,10 @@ function QP(e, t = {}) {
|
|
|
22625
22626
|
}
|
|
22626
22627
|
},
|
|
22627
22628
|
async saveCanvasConfig(u, h, g) {
|
|
22628
|
-
var B,
|
|
22629
|
-
const S = be(h || this.layoutConfig), A = (B = this.snapshot) == null ? void 0 : B.visualConfig, C = g === null ? void 0 : g === void 0 ? A : g.layoutTree === void 0 && ((
|
|
22629
|
+
var B, j, U;
|
|
22630
|
+
const S = be(h || this.layoutConfig), A = (B = this.snapshot) == null ? void 0 : B.visualConfig, C = g === null ? void 0 : g === void 0 ? A : g.layoutTree === void 0 && ((j = A == null ? void 0 : A.layoutTree) == null ? void 0 : j.version) === 4 ? { ...g, layoutTree: A.layoutTree } : g, T = ((U = C == null ? void 0 : C.layoutTree) == null ? void 0 : U.version) === 4, _ = T ? Il(S) : S;
|
|
22630
22631
|
this.error = "";
|
|
22631
|
-
const b = u.map((
|
|
22632
|
+
const b = u.map((oe) => bi(oe));
|
|
22632
22633
|
if (!this.snapshot) return null;
|
|
22633
22634
|
const N = {
|
|
22634
22635
|
...this.snapshot,
|
|
@@ -22913,20 +22914,20 @@ function QP(e, t = {}) {
|
|
|
22913
22914
|
* @param payload - 需要保存的 turn 与返回项 ID。
|
|
22914
22915
|
*/
|
|
22915
22916
|
async saveMemoryCaptureDraft(u) {
|
|
22916
|
-
var C, T, _, b, N, P, B,
|
|
22917
|
-
const h = this.turns.find((
|
|
22917
|
+
var C, T, _, b, N, P, B, j;
|
|
22918
|
+
const h = this.turns.find((U) => U.id === u.turnId), g = h == null ? void 0 : h.returnItems.find((U) => U.id === u.itemId), S = (T = (C = g == null ? void 0 : g.queryTrace) == null ? void 0 : C.details.memoryCandidates) == null ? void 0 : T[0], A = (_ = g == null ? void 0 : g.queryTrace) == null ? void 0 : _.details.memoryCapturePrompt;
|
|
22918
22919
|
if (!h || !g || !S || !A) {
|
|
22919
22920
|
(b = u.done) == null || b.call(u, !1);
|
|
22920
22921
|
return;
|
|
22921
22922
|
}
|
|
22922
22923
|
if (!this.userId || !this.workspaceId) {
|
|
22923
|
-
const
|
|
22924
|
-
this.error =
|
|
22924
|
+
const U = f("FWA.c0721787570501014");
|
|
22925
|
+
this.error = U, Me.error(U), (N = u.done) == null || N.call(u, !1);
|
|
22925
22926
|
return;
|
|
22926
22927
|
}
|
|
22927
22928
|
this.saving = !0, this.error = "";
|
|
22928
22929
|
try {
|
|
22929
|
-
const
|
|
22930
|
+
const U = ((P = S.evidenceRefs) == null ? void 0 : P[0]) || h.conversationId || this.currentConversationId, oe = await gI({
|
|
22930
22931
|
actorId: this.userId,
|
|
22931
22932
|
agentType: "query",
|
|
22932
22933
|
type: fF(S.type),
|
|
@@ -22938,7 +22939,7 @@ function QP(e, t = {}) {
|
|
|
22938
22939
|
evidence: {
|
|
22939
22940
|
type: "conversation",
|
|
22940
22941
|
text: h.userPrompt,
|
|
22941
|
-
refId:
|
|
22942
|
+
refId: U
|
|
22942
22943
|
},
|
|
22943
22944
|
traceId: h.id,
|
|
22944
22945
|
confidence: S.confidence,
|
|
@@ -22947,28 +22948,28 @@ function QP(e, t = {}) {
|
|
|
22947
22948
|
this.turns = ne(
|
|
22948
22949
|
this.turns,
|
|
22949
22950
|
h.id,
|
|
22950
|
-
(
|
|
22951
|
+
($) => tt(
|
|
22951
22952
|
{
|
|
22952
|
-
|
|
22953
|
-
returnItems: (
|
|
22953
|
+
...$,
|
|
22954
|
+
returnItems: ($.returnItems || []).map((te) => {
|
|
22954
22955
|
var re;
|
|
22955
|
-
return
|
|
22956
|
-
...
|
|
22956
|
+
return te.id === u.itemId && ((re = te.queryTrace) != null && re.details.memoryCapturePrompt) ? {
|
|
22957
|
+
...te,
|
|
22957
22958
|
queryTrace: {
|
|
22958
|
-
...
|
|
22959
|
+
...te.queryTrace,
|
|
22959
22960
|
details: {
|
|
22960
|
-
...
|
|
22961
|
+
...te.queryTrace.details,
|
|
22961
22962
|
memoryCapturePrompt: {
|
|
22962
|
-
...
|
|
22963
|
+
...te.queryTrace.details.memoryCapturePrompt,
|
|
22963
22964
|
status: "candidate_created"
|
|
22964
22965
|
}
|
|
22965
22966
|
}
|
|
22966
22967
|
}
|
|
22967
|
-
} :
|
|
22968
|
+
} : te;
|
|
22968
22969
|
}),
|
|
22969
22970
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
22970
22971
|
},
|
|
22971
|
-
Ne("status", f("FWA.8ed81787571120240"), f("FWA.9ef31787570462869"),
|
|
22972
|
+
Ne("status", f("FWA.8ed81787571120240"), f("FWA.9ef31787570462869"), oe, {
|
|
22972
22973
|
id: `${h.id}-memory-candidate-${Date.now()}`,
|
|
22973
22974
|
status: "done",
|
|
22974
22975
|
collapsed: !0,
|
|
@@ -22976,14 +22977,14 @@ function QP(e, t = {}) {
|
|
|
22976
22977
|
})
|
|
22977
22978
|
)
|
|
22978
22979
|
), Me.success(f("FWA.27bc1787571056650")), (B = u.done) == null || B.call(u, !0);
|
|
22979
|
-
} catch (
|
|
22980
|
-
const
|
|
22981
|
-
this.error =
|
|
22980
|
+
} catch (U) {
|
|
22981
|
+
const oe = we(U, f("FWA.bd431787571058006"));
|
|
22982
|
+
this.error = oe, Me.error(oe), (j = u.done) == null || j.call(u, !1), this.turns = ne(
|
|
22982
22983
|
this.turns,
|
|
22983
22984
|
h.id,
|
|
22984
|
-
(
|
|
22985
|
-
|
|
22986
|
-
Ne("error", f("FWA.bd431787571058006"),
|
|
22985
|
+
($) => tt(
|
|
22986
|
+
$,
|
|
22987
|
+
Ne("error", f("FWA.bd431787571058006"), oe, void 0, {
|
|
22987
22988
|
id: `${h.id}-memory-candidate-error-${Date.now()}`,
|
|
22988
22989
|
status: "error"
|
|
22989
22990
|
})
|
|
@@ -23356,7 +23357,7 @@ function QP(e, t = {}) {
|
|
|
23356
23357
|
const h = this.workbenches.find(
|
|
23357
23358
|
(g) => g.id === u && g.source === "fde_preset" && g.resource_id
|
|
23358
23359
|
);
|
|
23359
|
-
h && await
|
|
23360
|
+
h && await J(
|
|
23360
23361
|
{ workspaceId: u, userId: this.userId, roleId: this.roleId },
|
|
23361
23362
|
{ resource_id: h.resource_id }
|
|
23362
23363
|
), await q(this.context, { workspaceId: u }), this.workspaceId = u, this.resetWorkbenchPrologueState(), this.clearConversation(), await this.loadWorkbenchPrologueForActiveWorkspace(), await this.loadSnapshot(), this.connectWorkbenchSocket(!0);
|
|
@@ -23475,14 +23476,14 @@ function QP(e, t = {}) {
|
|
|
23475
23476
|
error: void 0,
|
|
23476
23477
|
detail: void 0
|
|
23477
23478
|
});
|
|
23478
|
-
const g = this.snapshot, S = new Set(g.blocks.map((
|
|
23479
|
+
const g = this.snapshot, S = new Set(g.blocks.map(($) => $.id));
|
|
23479
23480
|
if (this.fdeMode) {
|
|
23480
|
-
const
|
|
23481
|
+
const $ = g.blocks.map((z) => z.layout), te = h.blocks.map((z) => {
|
|
23481
23482
|
var he;
|
|
23482
23483
|
const Q = Z5(z);
|
|
23483
23484
|
if (S.has(Q.id)) return Q;
|
|
23484
|
-
const me = Xi(Q.id, Q.layout,
|
|
23485
|
-
return
|
|
23485
|
+
const me = Xi(Q.id, Q.layout, $);
|
|
23486
|
+
return $.push(me), {
|
|
23486
23487
|
...Q,
|
|
23487
23488
|
layout: me,
|
|
23488
23489
|
meta: {
|
|
@@ -23491,12 +23492,12 @@ function QP(e, t = {}) {
|
|
|
23491
23492
|
}
|
|
23492
23493
|
};
|
|
23493
23494
|
});
|
|
23494
|
-
if (
|
|
23495
|
+
if (te.length === 0)
|
|
23495
23496
|
throw new Error("No materialized cards returned for FDE insert");
|
|
23496
|
-
const re = new Map(
|
|
23497
|
+
const re = new Map(te.map((z) => [z.id, z])), O = [
|
|
23497
23498
|
...g.blocks.map((z) => re.get(z.id) || z),
|
|
23498
|
-
...
|
|
23499
|
-
],
|
|
23499
|
+
...te.filter((z) => !S.has(z.id))
|
|
23500
|
+
], X = await this.persistSnapshotPreferIncremental({
|
|
23500
23501
|
...g,
|
|
23501
23502
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23502
23503
|
blocks: Fe(O)
|
|
@@ -23504,79 +23505,79 @@ function QP(e, t = {}) {
|
|
|
23504
23505
|
baseSnapshot: g,
|
|
23505
23506
|
baseVersion: g.version
|
|
23506
23507
|
});
|
|
23507
|
-
return this.layoutConfig = be(
|
|
23508
|
+
return this.layoutConfig = be(X.layoutConfig || this.layoutConfig), this.lastComposeInsertedBlockIds = X.blocks.filter((z) => !S.has(z.id)).map((z) => z.id), this.pendingComposePlan = null, this.pendingComposeStatus && (this.pendingComposeStatus = {
|
|
23508
23509
|
...this.pendingComposeStatus,
|
|
23509
|
-
content: `Inserted ${this.lastComposeInsertedBlockIds.length ||
|
|
23510
|
+
content: `Inserted ${this.lastComposeInsertedBlockIds.length || te.length} cards`,
|
|
23510
23511
|
loading: !1,
|
|
23511
23512
|
error: void 0,
|
|
23512
23513
|
detail: void 0
|
|
23513
|
-
}), wm(`Inserted ${this.lastComposeInsertedBlockIds.length ||
|
|
23514
|
+
}), wm(`Inserted ${this.lastComposeInsertedBlockIds.length || te.length} cards`), X;
|
|
23514
23515
|
}
|
|
23515
23516
|
if (await this.ensureEditableWorkbench(), !this.snapshot)
|
|
23516
23517
|
throw new Error(f("FWA.8ff51787570813200"));
|
|
23517
|
-
const A = this.snapshot, C = new Set(A.blocks.map((
|
|
23518
|
+
const A = this.snapshot, C = new Set(A.blocks.map(($) => $.id)), T = await Dt(this.context, {
|
|
23518
23519
|
mode: "final",
|
|
23519
|
-
blockPlans: h.blocks.map((
|
|
23520
|
-
id:
|
|
23520
|
+
blockPlans: h.blocks.map(($) => ({
|
|
23521
|
+
id: $.blockId,
|
|
23521
23522
|
version: 1,
|
|
23522
23523
|
blockType: "display",
|
|
23523
23524
|
subType: "chart",
|
|
23524
|
-
title:
|
|
23525
|
-
subtitle:
|
|
23525
|
+
title: $.title,
|
|
23526
|
+
subtitle: $.subtitle,
|
|
23526
23527
|
layout: {
|
|
23527
|
-
i:
|
|
23528
|
-
x:
|
|
23529
|
-
y:
|
|
23530
|
-
w:
|
|
23531
|
-
h:
|
|
23528
|
+
i: $.blockId,
|
|
23529
|
+
x: $.layout.x,
|
|
23530
|
+
y: $.layout.y,
|
|
23531
|
+
w: $.layout.w,
|
|
23532
|
+
h: $.layout.h
|
|
23532
23533
|
},
|
|
23533
|
-
intent: { scene: "composition", bizIntent:
|
|
23534
|
-
source: { sourceType: "ai_composition", service: "composition", resourceKey:
|
|
23534
|
+
intent: { scene: "composition", bizIntent: $.title, roleTemplate: "default" },
|
|
23535
|
+
source: { sourceType: "ai_composition", service: "composition", resourceKey: $.capabilityId },
|
|
23535
23536
|
renderer: { engine: "echarts", rendererKey: "customEcharts" },
|
|
23536
23537
|
state: { mode: "preview", status: "draft", refreshable: !1, cacheable: !0 },
|
|
23537
|
-
data:
|
|
23538
|
-
meta: { confidence:
|
|
23538
|
+
data: $.bodyJson || {},
|
|
23539
|
+
meta: { confidence: $.confidence, capabilityId: $.capabilityId }
|
|
23539
23540
|
}))
|
|
23540
|
-
}), _ = A.blocks.map((
|
|
23541
|
+
}), _ = A.blocks.map(($) => $.layout), b = (T.materializedBlocks || []).map(($) => {
|
|
23541
23542
|
var re;
|
|
23542
|
-
if (C.has(
|
|
23543
|
-
const
|
|
23544
|
-
return _.push(
|
|
23545
|
-
|
|
23546
|
-
layout:
|
|
23543
|
+
if (C.has($.id)) return $;
|
|
23544
|
+
const te = Xi($.id, $.layout, _);
|
|
23545
|
+
return _.push(te), {
|
|
23546
|
+
...$,
|
|
23547
|
+
layout: te,
|
|
23547
23548
|
meta: {
|
|
23548
|
-
|
|
23549
|
-
sizePreset: ((re =
|
|
23549
|
+
...$.meta,
|
|
23550
|
+
sizePreset: ((re = $.meta) == null ? void 0 : re.sizePreset) ?? "medium"
|
|
23550
23551
|
}
|
|
23551
23552
|
};
|
|
23552
23553
|
});
|
|
23553
23554
|
if (b.length === 0)
|
|
23554
23555
|
throw new Error(f("FWA.ae891787570814891"));
|
|
23555
|
-
const N = b.some((
|
|
23556
|
+
const N = b.some(($) => C.has($.id));
|
|
23556
23557
|
let P;
|
|
23557
|
-
const B = new Map(A.blocks.map((
|
|
23558
|
-
|
|
23559
|
-
blocks: mP(
|
|
23560
|
-
}),
|
|
23561
|
-
if (!is(
|
|
23558
|
+
const B = new Map(A.blocks.map(($) => [$.id, $])), j = ($) => ({
|
|
23559
|
+
...$,
|
|
23560
|
+
blocks: mP($.blocks, b, C)
|
|
23561
|
+
}), U = async ($, te) => {
|
|
23562
|
+
if (!is($)) throw $;
|
|
23562
23563
|
const re = await k(this.context), O = {
|
|
23563
|
-
...
|
|
23564
|
+
...te,
|
|
23564
23565
|
version: re.version,
|
|
23565
23566
|
updatedAt: re.updatedAt
|
|
23566
23567
|
};
|
|
23567
23568
|
return D(this.context, O, {
|
|
23568
23569
|
baseVersion: re.version,
|
|
23569
23570
|
persistenceFallbackReason: "materialized-layout-failed",
|
|
23570
|
-
persistenceFallbackSummary: Xn(A,
|
|
23571
|
+
persistenceFallbackSummary: Xn(A, te)
|
|
23571
23572
|
});
|
|
23572
|
-
},
|
|
23573
|
-
if (!is(
|
|
23574
|
-
const re =
|
|
23573
|
+
}, oe = async ($, te) => {
|
|
23574
|
+
if (!is($)) throw $;
|
|
23575
|
+
const re = j(te), O = await k(this.context), X = {
|
|
23575
23576
|
...re,
|
|
23576
23577
|
version: O.version,
|
|
23577
23578
|
updatedAt: O.updatedAt
|
|
23578
23579
|
};
|
|
23579
|
-
return D(this.context,
|
|
23580
|
+
return D(this.context, X, {
|
|
23580
23581
|
baseVersion: O.version,
|
|
23581
23582
|
persistenceFallbackReason: "materialized-card-mutation-failed",
|
|
23582
23583
|
persistenceFallbackSummary: Xn(A, re)
|
|
@@ -23603,46 +23604,46 @@ function QP(e, t = {}) {
|
|
|
23603
23604
|
);
|
|
23604
23605
|
}
|
|
23605
23606
|
} catch (re) {
|
|
23606
|
-
P = await
|
|
23607
|
+
P = await oe(re, P);
|
|
23607
23608
|
}
|
|
23608
|
-
const
|
|
23609
|
-
if (!br(P,
|
|
23609
|
+
const $ = j(P).blocks, te = { ...P, blocks: $ };
|
|
23610
|
+
if (!br(P, te))
|
|
23610
23611
|
try {
|
|
23611
23612
|
P = await F(this.context, {
|
|
23612
23613
|
baseVersion: P.version,
|
|
23613
|
-
layoutVersion:
|
|
23614
|
-
layout: En(
|
|
23614
|
+
layoutVersion: te.layoutVersion,
|
|
23615
|
+
layout: En($),
|
|
23615
23616
|
layoutConfig: be(P.layoutConfig || this.layoutConfig),
|
|
23616
23617
|
visualConfig: P.visualConfig
|
|
23617
23618
|
});
|
|
23618
23619
|
} catch (re) {
|
|
23619
|
-
P = await
|
|
23620
|
+
P = await U(re, te);
|
|
23620
23621
|
}
|
|
23621
23622
|
} else if (N) {
|
|
23622
|
-
const
|
|
23623
|
-
...A.blocks.map((re) =>
|
|
23623
|
+
const $ = new Map(b.map((re) => [re.id, re])), te = [
|
|
23624
|
+
...A.blocks.map((re) => $.get(re.id) || re),
|
|
23624
23625
|
...b.filter((re) => !C.has(re.id))
|
|
23625
23626
|
];
|
|
23626
23627
|
P = await D(this.context, {
|
|
23627
23628
|
...A,
|
|
23628
|
-
blocks:
|
|
23629
|
+
blocks: te
|
|
23629
23630
|
}, {
|
|
23630
23631
|
baseVersion: A.version,
|
|
23631
23632
|
persistenceFallbackReason: "materialized-replacement-complex",
|
|
23632
23633
|
persistenceFallbackSummary: Xn(A, {
|
|
23633
23634
|
...A,
|
|
23634
|
-
blocks:
|
|
23635
|
+
blocks: te
|
|
23635
23636
|
})
|
|
23636
23637
|
});
|
|
23637
23638
|
} else {
|
|
23638
23639
|
P = A;
|
|
23639
|
-
for (const
|
|
23640
|
+
for (const $ of b)
|
|
23640
23641
|
P = await Pt(
|
|
23641
23642
|
this.context,
|
|
23642
|
-
ma(
|
|
23643
|
+
ma($, P.version)
|
|
23643
23644
|
);
|
|
23644
23645
|
}
|
|
23645
|
-
return this.replaceSnapshot(P), this.layoutConfig = be(P.layoutConfig || this.layoutConfig), this.lastComposeInsertedBlockIds = P.blocks.filter((
|
|
23646
|
+
return this.replaceSnapshot(P), this.layoutConfig = be(P.layoutConfig || this.layoutConfig), this.lastComposeInsertedBlockIds = P.blocks.filter(($) => !C.has($.id)).map(($) => $.id), this.pendingComposePlan = null, this.pendingComposeStatus && (this.pendingComposeStatus = {
|
|
23646
23647
|
...this.pendingComposeStatus,
|
|
23647
23648
|
content: f("FWA.4d661787570626849", { p0: this.lastComposeInsertedBlockIds.length || b.length }),
|
|
23648
23649
|
loading: !1,
|