@feedmepos/mf-report 5.34.2 → 5.35.0-beta.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/dist/{App-D-YQ3yMW.js → App-DQyEf0mm.js} +40 -40
- package/dist/{DateRangeSelect-OTyc3v5_.js → DateRangeSelect-DvE_au_i.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-CxIN_bfu.js → Default.vue_vue_type_script_setup_true_lang-B5Ir3Xuu.js} +1 -1
- package/dist/{DigestListView-DCpIQY1v.js → DigestListView-Cl2EK5bf.js} +3 -3
- package/dist/DigestReaderView-BS0iuanX.js +489 -0
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-iRcCryhy.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DfVW7Q_x.js} +173 -173
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-VTI9bq-3.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Fcz2N71N.js} +175 -175
- package/dist/{InsightView-WQ3IXr2b.js → InsightView-CmA2Xi0T.js} +5 -5
- package/dist/{Integration-Bx6Xt8rm.js → Integration-DdfS7Jgh.js} +3 -3
- package/dist/{Integrations-BSsJGc4e.js → Integrations-CRMbmKLq.js} +2 -2
- package/dist/{Layout-CmTYhuDW.js → Layout-kcAw_A-E.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-SjaEdhpI.js → LocationSelect.vue_vue_type_script_setup_true_lang-BRYP_afx.js} +1553 -1547
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CtJRTkuw.js → MenuTab.vue_vue_type_script_setup_true_lang-I8gsgGXJ.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DERX_GCc.js → NavigationTab.vue_vue_type_script_setup_true_lang-D3QOPpyj.js} +5 -5
- package/dist/{OverviewView-BXuqus0r.js → OverviewView-tS8EKm9q.js} +5 -5
- package/dist/{Report-Cj7xHOMI.js → Report-BvJw6A0s.js} +3 -3
- package/dist/ReportCanvasView-Bywb09Z7.js +1066 -0
- package/dist/{ReportEditor-v3CRHflb.js → ReportEditor-D88J-04n.js} +7 -7
- package/dist/{ReportView-IbQC8Qf1.js → ReportView-DxnYH37m.js} +6 -6
- package/dist/{ReportViewRoute-NwvXWZDf.js → ReportViewRoute-DJdbgiqN.js} +2 -2
- package/dist/{Setting-GyFSTgFs.js → Setting-CNrh7nBB.js} +94 -94
- package/dist/{Template-DLVGn41O.js → Template-BreFV27K.js} +3 -3
- package/dist/{TileEditor-DT4ayXKN.js → TileEditor-CLXi5in3.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-Bh0NcO-n.js → TilePageStack.vue_vue_type_script_setup_true_lang-HMTKQELw.js} +2 -2
- package/dist/{TransitionFade-DIDahT3W.js → TransitionFade-tUK-3l63.js} +5 -5
- package/dist/{app-X-tKojve.js → app-CwMmSHUw.js} +21 -21
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-Cpgnh20a.js → formatChartData.worker-Bt8turfo.js} +22 -22
- package/dist/assets/{processTableData.worker-B7I6PElJ.js → processTableData.worker-MGb36f8J.js} +22 -22
- package/dist/{currency-Cebf4JT_.js → currency-BUi-Xq6N.js} +1 -1
- package/dist/{index-Brvkpnxl.js → index-cojDf4MH.js} +503 -473
- package/dist/{report-CoK9Yl1E.js → report-CtMB0C_H.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useDigestFont-DUUhWR6u.js → useDigestFont-HI14Bq_l.js} +1 -1
- package/dist/{useReportCanvasPanel-B8qruqY0.js → useReportCanvasPicks-ZAlJK9Cv.js} +1353 -1264
- package/dist/{useRestaurantPermission-BTBg_goI.js → useRestaurantPermission-DO4WIH7P.js} +1 -1
- package/package.json +2 -2
- package/dist/DigestReaderView-W6sW8h9Q.js +0 -526
- package/dist/ReportCanvasView-CGt4ayU2.js +0 -1035
|
@@ -2,7 +2,7 @@ import { computed as u } from "vue";
|
|
|
2
2
|
import { u as c } from "./_plugin-vue_export-helper-Bx7s49ra.js";
|
|
3
3
|
import { useSnackbar as f } from "@feedmepos/ui-library";
|
|
4
4
|
import { useCoreStore as d } from "@feedmepos/mf-common";
|
|
5
|
-
import { a4 as l, a5 as i } from "./app-
|
|
5
|
+
import { a4 as l, a5 as i } from "./app-CwMmSHUw.js";
|
|
6
6
|
function g(t) {
|
|
7
7
|
return Array.isArray(t) ? t : [];
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feedmepos/mf-report",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.35.0-beta.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@feedmepos/feature-flag": "^0.0.15",
|
|
21
21
|
"@feedmepos/hrm-permission": "1.1.0-dev.3",
|
|
22
22
|
"@feedmepos/mf-common": "1.29.36",
|
|
23
|
-
"@feedmepos/ui-library": "1.10.
|
|
23
|
+
"@feedmepos/ui-library": "1.10.19",
|
|
24
24
|
"@feedmepos/ui-library-v2": "2.0.0-alpha.0",
|
|
25
25
|
"axios": "^1.20.0",
|
|
26
26
|
"change-case": "^5.4.3",
|
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
import { defineComponent as _e, ref as f, watch as W, onMounted as be, nextTick as ct, resolveComponent as z, openBlock as m, createElementBlock as _, createElementVNode as b, unref as a, createVNode as P, createCommentVNode as C, computed as k, onBeforeUnmount as dt, createBlock as R, withCtx as j, createSlots as pt, toDisplayString as L, normalizeClass as he } from "vue";
|
|
2
|
-
import { useRoute as mt, useRouter as vt } from "vue-router";
|
|
3
|
-
import { useI18n as xe } from "@feedmepos/mf-common";
|
|
4
|
-
import { useBreakpoints as ft } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as gt } from "./Default.vue_vue_type_script_setup_true_lang-CxIN_bfu.js";
|
|
6
|
-
import { _ as ke } from "./SelectComponent.vue_vue_type_script_setup_true_lang-Cxx-TQz9.js";
|
|
7
|
-
import { u as ht, a as kt, R as wt, b as yt, c as _t, d as bt, e as xt } from "./useReportCanvasPanel-B8qruqY0.js";
|
|
8
|
-
import { b as Ct, d as St, a as Vt, _ as Rt, D as Pt } from "./useDigestFont-DUUhWR6u.js";
|
|
9
|
-
import { f as Tt, n as Et, o as It, A as we } from "./app-X-tKojve.js";
|
|
10
|
-
import { _ as At } from "./_plugin-vue_export-helper-Bx7s49ra.js";
|
|
11
|
-
const Mt = { class: "relative flex min-h-0 grow flex-col" }, Ft = ["srcdoc", "title"], Bt = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
14
|
-
"data-testid": "digest-frame-loading"
|
|
15
|
-
}, Dt = /* @__PURE__ */ _e({
|
|
16
|
-
__name: "DigestCanvasFrame",
|
|
17
|
-
props: {
|
|
18
|
-
digest: {},
|
|
19
|
-
commentMode: { type: Boolean },
|
|
20
|
-
picked: {}
|
|
21
|
-
},
|
|
22
|
-
emits: ["select", "area", "cancel"],
|
|
23
|
-
setup(ee, { emit: n }) {
|
|
24
|
-
const O = { MYR: "RM" }, w = ee, T = n, { t: K } = xe(), I = f(), S = f(!1), c = {
|
|
25
|
-
reportId: `digest-${w.digest.weekStart}`,
|
|
26
|
-
version: 1,
|
|
27
|
-
state: "published",
|
|
28
|
-
canEdit: !1,
|
|
29
|
-
hostFilters: !1,
|
|
30
|
-
...w.digest.canvas
|
|
31
|
-
}, y = ht(c.reportId, { frozen: w.digest.rows }), A = new Set(
|
|
32
|
-
c.sections.flatMap((o) => {
|
|
33
|
-
var l;
|
|
34
|
-
const i = (l = o.config) == null ? void 0 : l.href;
|
|
35
|
-
return o.component === "digest-idea" && typeof i == "string" ? [i] : [];
|
|
36
|
-
})
|
|
37
|
-
), x = kt(I, {
|
|
38
|
-
onSelectSection: (o, i) => T("select", o, i),
|
|
39
|
-
onSelectArea: (o) => T("area", o),
|
|
40
|
-
onCancelSelection: () => T("cancel"),
|
|
41
|
-
onSetParams: (o, i) => {
|
|
42
|
-
y.setParams(o, i);
|
|
43
|
-
},
|
|
44
|
-
// a saved page records nothing back (its sections were checked before it was saved); a drawn part ends the loader
|
|
45
|
-
onSectionRendered: () => {
|
|
46
|
-
S.value = !0;
|
|
47
|
-
},
|
|
48
|
-
onSectionError: (o, i, l) => {
|
|
49
|
-
S.value = !0, console.warn("[digest] section failed", { weekStart: w.digest.weekStart, sectionId: o, message: l });
|
|
50
|
-
},
|
|
51
|
-
onSectionLayout: () => {
|
|
52
|
-
},
|
|
53
|
-
onOpenLink: (o) => {
|
|
54
|
-
A.has(o) && window.open(o, "_blank", "noopener,noreferrer");
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return y.onResult((o) => x.pushRows(o)), y.onParamsChanged(() => x.pushParams(y.paramState())), W([() => w.commentMode, () => w.picked, x.ready], () => {
|
|
58
|
-
x.setCommentMode(!!w.commentMode, w.picked ?? [], !0);
|
|
59
|
-
}), be(async () => {
|
|
60
|
-
y.load(c), await ct();
|
|
61
|
-
const o = y.env();
|
|
62
|
-
await x.init(c.sections, y.paramState(), {
|
|
63
|
-
...o,
|
|
64
|
-
currency: w.digest.money || O[o.currency] || o.currency,
|
|
65
|
-
digest: !0,
|
|
66
|
-
digestFont: Ct
|
|
67
|
-
});
|
|
68
|
-
}), (o, i) => {
|
|
69
|
-
const l = z("FmCircularProgress");
|
|
70
|
-
return m(), _("div", Mt, [
|
|
71
|
-
b("iframe", {
|
|
72
|
-
ref_key: "frame",
|
|
73
|
-
ref: I,
|
|
74
|
-
"data-testid": "digest-frame",
|
|
75
|
-
class: "min-h-0 grow border-0",
|
|
76
|
-
srcdoc: a(wt),
|
|
77
|
-
sandbox: "allow-scripts",
|
|
78
|
-
title: a(K)("reportV5.digest.frameTitle")
|
|
79
|
-
}, null, 8, Ft),
|
|
80
|
-
S.value ? C("", !0) : (m(), _("div", Bt, [
|
|
81
|
-
P(l, { size: "xl" })
|
|
82
|
-
]))
|
|
83
|
-
]);
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}), $t = { class: "flex min-w-0 grow flex-col" }, jt = { class: "fm-typo-en-title-md-600 block min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap" }, Lt = {
|
|
87
|
-
key: 0,
|
|
88
|
-
class: "flex shrink-0 flex-wrap items-center gap-8 border-b border-fm-color-border-secondary px-16 py-8",
|
|
89
|
-
"data-testid": "digest-toolbar"
|
|
90
|
-
}, zt = { class: "digest-kind" }, Ot = {
|
|
91
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary",
|
|
92
|
-
"data-testid": "digest-published"
|
|
93
|
-
}, qt = {
|
|
94
|
-
key: 1,
|
|
95
|
-
"data-testid": "digest-comment-hint",
|
|
96
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
97
|
-
}, Nt = ["aria-pressed", "aria-label", "disabled"], Ut = {
|
|
98
|
-
width: "20",
|
|
99
|
-
height: "20",
|
|
100
|
-
viewBox: "0 0 20 20",
|
|
101
|
-
fill: "none",
|
|
102
|
-
"aria-hidden": "true"
|
|
103
|
-
}, Ht = ["fill"], Yt = {
|
|
104
|
-
key: 3,
|
|
105
|
-
class: "fm-typo-en-body-sm-400 p-16 text-fm-color-typo-error",
|
|
106
|
-
"data-testid": "digest-error"
|
|
107
|
-
}, Gt = {
|
|
108
|
-
key: 4,
|
|
109
|
-
class: "flex min-h-[75vh] flex-1 items-center justify-center",
|
|
110
|
-
"data-testid": "digest-loading"
|
|
111
|
-
}, Kt = {
|
|
112
|
-
key: 5,
|
|
113
|
-
class: "flex min-h-[75vh] flex-1 flex-col"
|
|
114
|
-
}, Qt = ["role", "aria-modal", "aria-label"], ye = 24, Xt = /* @__PURE__ */ _e({
|
|
115
|
-
__name: "DigestReaderView",
|
|
116
|
-
setup(ee) {
|
|
117
|
-
var pe;
|
|
118
|
-
const { t: n, locale: O } = xe(), { breakpoints: w } = ft(), T = mt(), K = vt(), I = Tt(), S = k(() => String(T.params.weekStart ?? "")), c = f(), y = f(!0), A = f(""), x = f(!1), o = f(!1), i = f(!1), l = f(""), te = f(""), M = f(!1), v = f(!1), Q = f(!1), ae = k(() => v.value && !Q.value), { root: Ce, drawer: Se, docked: X, modal: Z } = yt(i, ae);
|
|
119
|
-
W([v, i], ([e, t]) => {
|
|
120
|
-
(!e || !t) && (Q.value = !1);
|
|
121
|
-
});
|
|
122
|
-
const q = f([]), F = f([]), r = k({
|
|
123
|
-
get: () => M.value ? q.value : F.value,
|
|
124
|
-
set: (e) => {
|
|
125
|
-
M.value ? q.value = e : F.value = e;
|
|
126
|
-
}
|
|
127
|
-
}), N = k(() => r.value.flatMap((e) => e.targets)), B = (e) => e.map((t) => ({ targets: [t], widen: [] })), Ve = k(() => r.value.map((e) => e.targets[0])), Re = k(
|
|
128
|
-
() => r.value.map(({ targets: [e, ...t] }) => {
|
|
129
|
-
if (!t.length) return e;
|
|
130
|
-
const s = [e, ...t];
|
|
131
|
-
return {
|
|
132
|
-
sectionId: e.sectionId,
|
|
133
|
-
version: e.version,
|
|
134
|
-
label: [...new Set(s.map((u) => u.label).filter(Boolean))].join(", "),
|
|
135
|
-
elementText: s.map((u) => u.elementText).filter(Boolean).join(" · "),
|
|
136
|
-
area: e.area
|
|
137
|
-
};
|
|
138
|
-
})
|
|
139
|
-
), U = k(() => {
|
|
140
|
-
var e;
|
|
141
|
-
return ((e = c.value) == null ? void 0 : e.canvas.sections) ?? [];
|
|
142
|
-
}), se = k(
|
|
143
|
-
() => N.value.some(
|
|
144
|
-
(e) => !U.value.some(
|
|
145
|
-
(t) => t.id === e.sectionId && t.version === e.version
|
|
146
|
-
)
|
|
147
|
-
)
|
|
148
|
-
);
|
|
149
|
-
function Pe(e, t) {
|
|
150
|
-
var h;
|
|
151
|
-
const s = e.config ?? {}, u = s.title ?? s.headline;
|
|
152
|
-
if (typeof u == "string" && u) return u;
|
|
153
|
-
if (e.component === "digest-kpis") return n("reportV5.digest.ask.tiles");
|
|
154
|
-
const p = U.value.slice(0, t).reverse().find((d) => d.component === "digest-chapter");
|
|
155
|
-
return e.component === "digest-text" && typeof ((h = p == null ? void 0 : p.config) == null ? void 0 : h.title) == "string" ? p.config.title : n("reportV5.digest.ask.part", { number: t + 1 });
|
|
156
|
-
}
|
|
157
|
-
function H() {
|
|
158
|
-
r.value = [], v.value = !1;
|
|
159
|
-
}
|
|
160
|
-
function Te(e) {
|
|
161
|
-
const t = r.value[e];
|
|
162
|
-
if (!t) return;
|
|
163
|
-
const [s] = t.targets;
|
|
164
|
-
if (!s.element || s.area) {
|
|
165
|
-
r.value = r.value.filter(($, E) => E !== e);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const { element: u, ...p } = s, [h, ...d] = t.widen, G = h ? { ...p, element: h, elementText: h.text ?? "", elementTag: h.tag } : p;
|
|
169
|
-
r.value = r.value.map(
|
|
170
|
-
($, E) => E === e ? { targets: [G], widen: d } : $
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
function ne(e) {
|
|
174
|
-
const t = U.value.findIndex((u) => u.id === e.sectionId), s = U.value[t];
|
|
175
|
-
if (!(!s || s.version !== e.version))
|
|
176
|
-
return { ...e, label: e.label || Pe(s, t) };
|
|
177
|
-
}
|
|
178
|
-
function Ee(e, t) {
|
|
179
|
-
var s, u, p, h, d, G, $, E, me, ve, fe, ge;
|
|
180
|
-
return e.sectionId === t.sectionId && ((s = e.element) == null ? void 0 : s.part) === ((u = t.element) == null ? void 0 : u.part) && (((p = e.element) == null ? void 0 : p.path) ?? []).join(".") === (((h = t.element) == null ? void 0 : h.path) ?? []).join(".") && ((G = (d = e.element) == null ? void 0 : d.datum) == null ? void 0 : G.datasetIndex) === ((E = ($ = t.element) == null ? void 0 : $.datum) == null ? void 0 : E.datasetIndex) && ((ve = (me = e.element) == null ? void 0 : me.datum) == null ? void 0 : ve.index) === ((ge = (fe = t.element) == null ? void 0 : fe.datum) == null ? void 0 : ge.index);
|
|
181
|
-
}
|
|
182
|
-
function Ie(e, t) {
|
|
183
|
-
if (!v.value || V.value) return;
|
|
184
|
-
const s = ne(e);
|
|
185
|
-
if (!s) return;
|
|
186
|
-
const u = r.value.findIndex(
|
|
187
|
-
(p) => !p.targets[0].area && Ee(p.targets[0], s)
|
|
188
|
-
);
|
|
189
|
-
u >= 0 ? r.value = r.value.filter((p, h) => h !== u) : N.value.length < ye && (r.value = [...r.value, { targets: [s], widen: t }]), i.value = !0;
|
|
190
|
-
}
|
|
191
|
-
function Ae(e) {
|
|
192
|
-
if (!v.value || V.value) return;
|
|
193
|
-
const t = e.map(ne);
|
|
194
|
-
!t.length || !t.every((s) => !!s) || N.value.length + t.length > ye || (r.value = [...r.value, { targets: t, widen: [] }], i.value = !0);
|
|
195
|
-
}
|
|
196
|
-
const Me = ((pe = window.matchMedia) == null ? void 0 : pe.call(window, "(pointer: coarse)").matches) ?? !1;
|
|
197
|
-
function Fe() {
|
|
198
|
-
if (v.value) return H();
|
|
199
|
-
v.value = !0, i.value = !0;
|
|
200
|
-
}
|
|
201
|
-
function Be() {
|
|
202
|
-
Q.value = !0, i.value = !0;
|
|
203
|
-
}
|
|
204
|
-
function oe(e) {
|
|
205
|
-
e.key === "Escape" && v.value && H();
|
|
206
|
-
}
|
|
207
|
-
const g = _t(bt(S.value)), {
|
|
208
|
-
messages: De,
|
|
209
|
-
sessionId: $e,
|
|
210
|
-
title: je,
|
|
211
|
-
chats: Le,
|
|
212
|
-
chatsCursor: re,
|
|
213
|
-
chatsLoading: ze,
|
|
214
|
-
chatsError: Oe,
|
|
215
|
-
switching: J,
|
|
216
|
-
earlier: qe,
|
|
217
|
-
loadingEarlier: Ne,
|
|
218
|
-
streaming: Ue,
|
|
219
|
-
turnId: He,
|
|
220
|
-
step: Ye,
|
|
221
|
-
error: ie,
|
|
222
|
-
interrupted: Ge,
|
|
223
|
-
stoppable: Ke,
|
|
224
|
-
stopping: Qe,
|
|
225
|
-
unsent: Xe,
|
|
226
|
-
slow: Ze,
|
|
227
|
-
startedAt: Je,
|
|
228
|
-
awaiting: We,
|
|
229
|
-
noReplyId: et
|
|
230
|
-
} = g, V = k(() => Ue.value || We.value), le = k(() => V.value || J.value);
|
|
231
|
-
let ue = !1;
|
|
232
|
-
W(i, (e) => {
|
|
233
|
-
!e || ue || (ue = !0, g.load());
|
|
234
|
-
});
|
|
235
|
-
async function Y() {
|
|
236
|
-
const e = l.value.trim();
|
|
237
|
-
if (!(!e || V.value || J.value || se.value)) {
|
|
238
|
-
if (l.value = "", await g.send(e, N.value), ie.value) {
|
|
239
|
-
l.value || (l.value = e);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
H();
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
async function ce(e) {
|
|
246
|
-
g.stashDraft(
|
|
247
|
-
l.value,
|
|
248
|
-
F.value.flatMap((s) => s.targets)
|
|
249
|
-
), await e();
|
|
250
|
-
const t = g.recallDraft();
|
|
251
|
-
l.value = t.text, F.value = B(t.targets), v.value = !1;
|
|
252
|
-
}
|
|
253
|
-
async function tt(e) {
|
|
254
|
-
if (le.value) return;
|
|
255
|
-
const t = e ? [...q.value] : [];
|
|
256
|
-
let s = !1;
|
|
257
|
-
await ce(async () => {
|
|
258
|
-
s = await g.startChat();
|
|
259
|
-
}), s && e && (M.value = !1, F.value = t, q.value = [], l.value = e, await Y());
|
|
260
|
-
}
|
|
261
|
-
const at = (e) => ce(() => g.select(e));
|
|
262
|
-
function st(e) {
|
|
263
|
-
const t = g.takeUnsent(e);
|
|
264
|
-
if (t)
|
|
265
|
-
return l.value = t.text, r.value = B(t.targets), Y();
|
|
266
|
-
}
|
|
267
|
-
async function nt() {
|
|
268
|
-
const e = await g.stop();
|
|
269
|
-
!e || l.value.trim() || (l.value = e.text, r.value = B(e.targets));
|
|
270
|
-
}
|
|
271
|
-
function ot(e) {
|
|
272
|
-
const t = g.requestOf(e);
|
|
273
|
-
t && (l.value = t.text, r.value = B(t.targets));
|
|
274
|
-
}
|
|
275
|
-
function rt(e) {
|
|
276
|
-
const t = g.requestOf(e);
|
|
277
|
-
if (t)
|
|
278
|
-
return l.value = t.text, r.value = B(t.targets), Y();
|
|
279
|
-
}
|
|
280
|
-
const D = k(
|
|
281
|
-
() => c.value ? St(c.value.weekStart, c.value.weekEnd, O.value) : ""
|
|
282
|
-
), it = k(() => {
|
|
283
|
-
const e = c.value;
|
|
284
|
-
if (!e) return "";
|
|
285
|
-
const t = [
|
|
286
|
-
n("reportV5.digest.published", {
|
|
287
|
-
date: Vt(e.createdAt, O.value, e.timezone)
|
|
288
|
-
})
|
|
289
|
-
];
|
|
290
|
-
return e.outlets && t.push(n("reportV5.digest.outlets", { count: e.outlets }, e.outlets)), t.join(" · ");
|
|
291
|
-
}), lt = k(
|
|
292
|
-
() => {
|
|
293
|
-
var e;
|
|
294
|
-
return (((e = c.value) == null ? void 0 : e.canvas.sections) ?? []).filter(
|
|
295
|
-
(t) => {
|
|
296
|
-
var s;
|
|
297
|
-
return t.component === "digest-chapter" && typeof ((s = t.config) == null ? void 0 : s.title) == "string";
|
|
298
|
-
}
|
|
299
|
-
).slice(0, 3).map((t) => {
|
|
300
|
-
var u;
|
|
301
|
-
const s = String((u = t.config) == null ? void 0 : u.title);
|
|
302
|
-
return { label: s, prompt: n("reportV5.digest.ask.about", { title: s }) };
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
), de = k(() => ({
|
|
306
|
-
title: n("reportV5.digest.ask.title"),
|
|
307
|
-
welcome: n("reportV5.digest.ask.welcome"),
|
|
308
|
-
hint: n("reportV5.digest.ask.hint", { subject: D.value }),
|
|
309
|
-
target: n("reportV5.digest.ask.target", { subject: D.value }),
|
|
310
|
-
placeholder: n("reportV5.digest.ask.title"),
|
|
311
|
-
outcomes: {
|
|
312
|
-
withheld: n("reportV5.digest.ask.withheld"),
|
|
313
|
-
failed: n("reportV5.digest.ask.failed"),
|
|
314
|
-
stopped: n("reportV5.digest.ask.stopped")
|
|
315
|
-
}
|
|
316
|
-
}));
|
|
317
|
-
function ut() {
|
|
318
|
-
K.push({ name: "digest", query: T.query });
|
|
319
|
-
}
|
|
320
|
-
return be(async () => {
|
|
321
|
-
window.addEventListener("keydown", oe);
|
|
322
|
-
try {
|
|
323
|
-
c.value = await Et(S.value), It(S.value).catch(() => {
|
|
324
|
-
});
|
|
325
|
-
} catch (e) {
|
|
326
|
-
e instanceof we && e.status === 403 ? x.value = !0 : e instanceof we && e.status === 404 ? o.value = !0 : A.value = e instanceof Error ? e.message : String(e);
|
|
327
|
-
} finally {
|
|
328
|
-
y.value = !1;
|
|
329
|
-
}
|
|
330
|
-
I.subscription || await I.loadSubscription().catch(() => {
|
|
331
|
-
});
|
|
332
|
-
}), dt(() => window.removeEventListener("keydown", oe)), (e, t) => {
|
|
333
|
-
const s = z("FmTooltip"), u = z("FmPageHead"), p = z("FmButton"), h = z("FmCircularProgress");
|
|
334
|
-
return m(), R(gt, null, {
|
|
335
|
-
default: j(() => [
|
|
336
|
-
b("div", {
|
|
337
|
-
ref_key: "root",
|
|
338
|
-
ref: Ce,
|
|
339
|
-
class: "relative flex h-full min-h-0 w-full"
|
|
340
|
-
}, [
|
|
341
|
-
b("div", $t, [
|
|
342
|
-
P(u, {
|
|
343
|
-
class: "shrink-0",
|
|
344
|
-
title: D.value || a(n)("reportV5.digest.title"),
|
|
345
|
-
"back-button": !0,
|
|
346
|
-
"data-testid": "digest-reader-head",
|
|
347
|
-
"onClick:back": ut
|
|
348
|
-
}, pt({
|
|
349
|
-
title: j(() => [
|
|
350
|
-
P(s, {
|
|
351
|
-
content: D.value,
|
|
352
|
-
placement: "bottom",
|
|
353
|
-
"z-index": 2e3,
|
|
354
|
-
class: "flex min-w-0 max-w-full justify-start"
|
|
355
|
-
}, {
|
|
356
|
-
default: j(() => [
|
|
357
|
-
b("p", jt, L(D.value || a(n)("reportV5.digest.title")), 1)
|
|
358
|
-
]),
|
|
359
|
-
_: 1
|
|
360
|
-
}, 8, ["content"])
|
|
361
|
-
]),
|
|
362
|
-
_: 2
|
|
363
|
-
}, [
|
|
364
|
-
a(w).lg || a(w).md ? {
|
|
365
|
-
name: "append",
|
|
366
|
-
fn: j(() => [
|
|
367
|
-
c.value ? (m(), R(Rt, { key: 0 })) : C("", !0)
|
|
368
|
-
]),
|
|
369
|
-
key: "0"
|
|
370
|
-
} : void 0
|
|
371
|
-
]), 1032, ["title"]),
|
|
372
|
-
c.value ? (m(), _("div", Lt, [
|
|
373
|
-
b("span", zt, L(a(n)("reportV5.digest.card.weekly")), 1),
|
|
374
|
-
b("span", Ot, L(it.value), 1),
|
|
375
|
-
t[9] || (t[9] = b("span", { class: "grow" }, null, -1)),
|
|
376
|
-
v.value && r.value.length && !a(X) ? (m(), R(p, {
|
|
377
|
-
key: 0,
|
|
378
|
-
"data-testid": "digest-ask-picked",
|
|
379
|
-
variant: "tertiary",
|
|
380
|
-
size: "sm",
|
|
381
|
-
"prepend-icon": "auto_awesome",
|
|
382
|
-
label: a(n)("reportV5.digest.ask.askPicked"),
|
|
383
|
-
onClick: Be
|
|
384
|
-
}, null, 8, ["label"])) : v.value ? (m(), _("span", qt, L(r.value.length ? a(n)("reportV5.digest.ask.picked", { count: r.value.length }) : a(n)(a(Me) ? "reportV5.digest.ask.pickingTouch" : "reportV5.digest.ask.picking")), 1)) : C("", !0),
|
|
385
|
-
P(s, {
|
|
386
|
-
placement: "bottom",
|
|
387
|
-
content: v.value ? a(n)("reportV5.reportAi.chat.cancelSelection") : a(n)("reportV5.digest.ask.comment")
|
|
388
|
-
}, {
|
|
389
|
-
default: j(() => [
|
|
390
|
-
b("button", {
|
|
391
|
-
"data-testid": "digest-comment-toggle",
|
|
392
|
-
class: he(["digest-comment flex h-32 w-32 items-center justify-center rounded-md text-fm-color-typo-secondary disabled:opacity-50", v.value && "bg-fm-color-neutral-gray-100 text-fm-color-primary"]),
|
|
393
|
-
"aria-pressed": v.value,
|
|
394
|
-
"aria-label": a(n)("reportV5.digest.ask.comment"),
|
|
395
|
-
disabled: V.value,
|
|
396
|
-
onClick: Fe
|
|
397
|
-
}, [
|
|
398
|
-
(m(), _("svg", Ut, [
|
|
399
|
-
b("path", {
|
|
400
|
-
d: "M5 3.5h5a6.5 6.5 0 1 1-6.5 6.5V5A1.5 1.5 0 0 1 5 3.5Z",
|
|
401
|
-
fill: v.value ? "currentColor" : "none",
|
|
402
|
-
stroke: "currentColor",
|
|
403
|
-
"stroke-width": "1.5",
|
|
404
|
-
"stroke-linecap": "round",
|
|
405
|
-
"stroke-linejoin": "round"
|
|
406
|
-
}, null, 8, Ht)
|
|
407
|
-
]))
|
|
408
|
-
], 10, Nt)
|
|
409
|
-
]),
|
|
410
|
-
_: 1
|
|
411
|
-
}, 8, ["content"]),
|
|
412
|
-
i.value ? C("", !0) : (m(), R(p, {
|
|
413
|
-
key: 2,
|
|
414
|
-
"data-testid": "digest-ask-open",
|
|
415
|
-
variant: "tertiary",
|
|
416
|
-
"prepend-icon": "auto_awesome",
|
|
417
|
-
label: a(n)("reportV5.digest.ask.title"),
|
|
418
|
-
onClick: t[0] || (t[0] = (d) => i.value = !0)
|
|
419
|
-
}, null, 8, ["label"]))
|
|
420
|
-
])) : C("", !0),
|
|
421
|
-
x.value ? (m(), R(ke, {
|
|
422
|
-
key: 1,
|
|
423
|
-
"data-testid": "digest-refused",
|
|
424
|
-
title: a(n)("reportV5.digest.refusedTitle"),
|
|
425
|
-
"sub-title": a(n)("reportV5.digest.refusedBody")
|
|
426
|
-
}, null, 8, ["title", "sub-title"])) : o.value ? (m(), R(ke, {
|
|
427
|
-
key: 2,
|
|
428
|
-
title: a(n)("reportV5.digest.missingTitle"),
|
|
429
|
-
"sub-title": a(n)("reportV5.digest.missingBody")
|
|
430
|
-
}, null, 8, ["title", "sub-title"])) : A.value ? (m(), _("p", Yt, L(A.value), 1)) : y.value ? (m(), _("div", Gt, [
|
|
431
|
-
P(h, { size: "xl" })
|
|
432
|
-
])) : c.value ? (m(), _("div", Kt, [
|
|
433
|
-
P(Pt, {
|
|
434
|
-
"hide-subscribed": "",
|
|
435
|
-
class: "m-16 shrink-0"
|
|
436
|
-
}),
|
|
437
|
-
(m(), R(Dt, {
|
|
438
|
-
key: `${c.value.weekStart}:${c.value.createdAt}`,
|
|
439
|
-
digest: c.value,
|
|
440
|
-
"comment-mode": v.value && !V.value,
|
|
441
|
-
picked: Ve.value,
|
|
442
|
-
onSelect: Ie,
|
|
443
|
-
onArea: Ae,
|
|
444
|
-
onCancel: H
|
|
445
|
-
}, null, 8, ["digest", "comment-mode", "picked"]))
|
|
446
|
-
])) : C("", !0)
|
|
447
|
-
]),
|
|
448
|
-
a(Z) ? (m(), _("div", {
|
|
449
|
-
key: 0,
|
|
450
|
-
class: "digest-scrim absolute inset-0 z-20",
|
|
451
|
-
onClick: t[1] || (t[1] = (d) => i.value = !1)
|
|
452
|
-
})) : C("", !0),
|
|
453
|
-
i.value && c.value && (a(X) || !ae.value) ? (m(), _("div", {
|
|
454
|
-
key: 1,
|
|
455
|
-
ref_key: "drawer",
|
|
456
|
-
ref: Se,
|
|
457
|
-
"data-testid": "digest-chat",
|
|
458
|
-
class: he(
|
|
459
|
-
a(X) ? "w-[380px] shrink-0" : "absolute inset-y-0 right-0 z-30 w-full max-w-[380px] shadow-lg"
|
|
460
|
-
),
|
|
461
|
-
role: a(Z) ? "dialog" : void 0,
|
|
462
|
-
"aria-modal": a(Z) ? "true" : void 0,
|
|
463
|
-
"aria-label": de.value.title
|
|
464
|
-
}, [
|
|
465
|
-
P(xt, {
|
|
466
|
-
"home-draft": te.value,
|
|
467
|
-
"onUpdate:homeDraft": t[2] || (t[2] = (d) => te.value = d),
|
|
468
|
-
"home-open": M.value,
|
|
469
|
-
"onUpdate:homeOpen": t[3] || (t[3] = (d) => M.value = d),
|
|
470
|
-
messages: a(De),
|
|
471
|
-
draft: l.value,
|
|
472
|
-
targets: Re.value,
|
|
473
|
-
"target-stale": se.value,
|
|
474
|
-
streaming: V.value,
|
|
475
|
-
"turn-id": a(He),
|
|
476
|
-
phase: a(Ye) ?? "working",
|
|
477
|
-
slow: a(Ze),
|
|
478
|
-
"started-at": a(Je),
|
|
479
|
-
error: a(ie),
|
|
480
|
-
interrupted: a(Ge),
|
|
481
|
-
blank: !1,
|
|
482
|
-
run: null,
|
|
483
|
-
"run-anchor-id": null,
|
|
484
|
-
"run-stale": !1,
|
|
485
|
-
"retry-error": "",
|
|
486
|
-
"unsent-ids": a(Xe),
|
|
487
|
-
"no-reply-id": a(et),
|
|
488
|
-
"chat-id": a($e),
|
|
489
|
-
"chat-title": a(je),
|
|
490
|
-
chats: a(Le),
|
|
491
|
-
"chats-cursor": a(re),
|
|
492
|
-
"chats-loading": a(ze),
|
|
493
|
-
"chats-error": a(Oe),
|
|
494
|
-
switching: a(J),
|
|
495
|
-
busy: le.value,
|
|
496
|
-
stoppable: a(Ke),
|
|
497
|
-
stopping: a(Qe),
|
|
498
|
-
earlier: a(qe),
|
|
499
|
-
"loading-earlier": a(Ne),
|
|
500
|
-
copy: de.value,
|
|
501
|
-
starters: lt.value,
|
|
502
|
-
"onUpdate:draft": t[4] || (t[4] = (d) => l.value = d),
|
|
503
|
-
onClearTarget: Te,
|
|
504
|
-
onSubmit: Y,
|
|
505
|
-
onClose: t[5] || (t[5] = (d) => i.value = !1),
|
|
506
|
-
onResend: st,
|
|
507
|
-
onAskAgain: rt,
|
|
508
|
-
onEditRequest: ot,
|
|
509
|
-
onStop: nt,
|
|
510
|
-
onNewChat: tt,
|
|
511
|
-
onSelectChat: at,
|
|
512
|
-
onLoadChats: t[6] || (t[6] = (d) => a(g).loadChats()),
|
|
513
|
-
onLoadMoreChats: t[7] || (t[7] = (d) => a(g).loadChats(a(re) ?? void 0)),
|
|
514
|
-
onLoadEarlier: t[8] || (t[8] = (d) => a(g).loadEarlier())
|
|
515
|
-
}, null, 8, ["home-draft", "home-open", "messages", "draft", "targets", "target-stale", "streaming", "turn-id", "phase", "slow", "started-at", "error", "interrupted", "unsent-ids", "no-reply-id", "chat-id", "chat-title", "chats", "chats-cursor", "chats-loading", "chats-error", "switching", "busy", "stoppable", "stopping", "earlier", "loading-earlier", "copy", "starters"])
|
|
516
|
-
], 10, Qt)) : C("", !0)
|
|
517
|
-
], 512)
|
|
518
|
-
]),
|
|
519
|
-
_: 1
|
|
520
|
-
});
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
}), ia = /* @__PURE__ */ At(Xt, [["__scopeId", "data-v-bd126bd6"]]);
|
|
524
|
-
export {
|
|
525
|
-
ia as default
|
|
526
|
-
};
|