react-semaphor 0.1.544 → 0.1.545
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/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +50 -47
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
- package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +556 -544
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +163 -152
- package/dist/index.js +351 -323
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js}
RENAMED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsxs as h, jsx as l, Fragment as ie } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import
|
|
4
|
-
import { u as
|
|
5
|
-
import { ad as va, ae as H } from "./numeric-presentation-
|
|
6
|
-
import { l as oe, B as V, N as ba, O as ga, Q as ya, U as wa, V as Sa, W as xa, X as se, z as Z, Y as he, P as Ca, a as Na, b as Ea, c as Ze, L as ht, r as Pe, s as ze, t as Fe, u as Le, v as X, T as Ta, d as ka, e as Qe, g as et } from "./switch-C3jLxlG0.js";
|
|
7
|
-
import { X as Ia } from "./x-4f5U2XwU.js";
|
|
8
|
-
import { j as Aa } from "./index-CuHybtft.js";
|
|
3
|
+
import Lt, { useRef as Y, useState as L, useCallback as $, useEffect as ee, useMemo as q, lazy as Se, Suspense as ye, useLayoutEffect as Xe, Activity as _t, useId as ce } from "react";
|
|
4
|
+
import { u as M, ba as Mt, bb as Ot, bc as mt, Z as Ut, bd as Wt, be as jt, bf as Bt, b as $t, a_ as Be, bg as Vt, bh as Kt, bi as ft, t as Ht, bj as qt, bk as Gt, bl as Xt, bm as Jt, bn as be, bo as ht, bp as Je, E as Yt, F as Zt, S as Qt, B as ea, a as ta, U as aa, D as ra, A as na, C as la, bq as sa, br as ia, bs as oa, bt as da, bu as Ye, bv as Ne, bw as ca, bx as $e, by as ua, bz as ma, bA as fa, bB as ha, bC as pa } from "./semaphor-ready-indicator-BxF96Yhv.js";
|
|
5
|
+
import { ad as va, ae as H } from "./numeric-presentation-7X_IrD58.js";
|
|
9
6
|
import "./validators-DMHTpf7a.js";
|
|
10
7
|
import "./matrix-operation-contract-8OIO4gob.js";
|
|
11
8
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
12
9
|
import "zod";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
10
|
+
import { j as ba } from "./index-CuHybtft.js";
|
|
11
|
+
import { parseValueFormatPreferencesResponse as ga, canonicalizeSupportedLocale as pt, getSupportedCurrencyCodes as ya, canonicalizeSupportedCurrencyCode as wa } from "../value-format-preferences/index.js";
|
|
12
|
+
import { c as O } from "./_commonjsHelpers-DimLPMtv.js";
|
|
13
|
+
import "./pivot-result-lifecycle-DM4CyGKs.js";
|
|
14
|
+
import { A as Sa } from "./table-settings-CLZocegs.js";
|
|
15
|
+
import { W as xa, aW as Ca, a6 as Na, a7 as Ea, aX as Ta } from "./resolve-dashboard-input-context-DJ2tICwz.js";
|
|
16
|
+
import { l as oe, B as V, N as Ia, O as ka, Q as Aa, U as Da, V as Ra, W as Pa, X as se, z as Q, Y as he, P as za, a as Fa, b as La, c as Ze, L as vt, r as Pe, s as ze, t as Fe, u as Le, v as J, T as _a, d as Ma, e as Qe, g as et } from "./switch-uDtPgQlQ.js";
|
|
17
|
+
import { X as Oa } from "./x-4f5U2XwU.js";
|
|
18
|
+
import { r as Ua, a as bt } from "./availability-Bp5Gfu1I.js";
|
|
19
|
+
import { s as Wa } from "./stable-serialize-CfqXeiBP.js";
|
|
20
|
+
import { S as ja } from "./selection-reducer-Dj_8xD69.js";
|
|
21
|
+
import { a as Ba } from "./report-runtime-context-Dq8XyODK.js";
|
|
21
22
|
import { r as ge, M as ue } from "./temporal-bucket-D7NBrrtL.js";
|
|
22
|
-
function
|
|
23
|
-
const a =
|
|
24
|
-
var m,
|
|
25
|
-
const o = ((m = a.current) == null ? void 0 : m.clientWidth) ?? 0, f = ((
|
|
23
|
+
function $a(e = []) {
|
|
24
|
+
const a = Y(null), t = Y(null), n = Y(null), [r, i] = L(), s = $(() => {
|
|
25
|
+
var m, x, I;
|
|
26
|
+
const o = ((m = a.current) == null ? void 0 : m.clientWidth) ?? 0, f = ((x = n.current) == null ? void 0 : x.offsetWidth) ?? 0, u = ((I = t.current) == null ? void 0 : I.offsetWidth) ?? 0, c = o - f - u - 8, v = Math.max(c, 0);
|
|
26
27
|
i((w) => w === v ? w : v);
|
|
27
28
|
}, []);
|
|
28
29
|
return ee(() => {
|
|
@@ -33,34 +34,48 @@ function Oa(e = []) {
|
|
|
33
34
|
}, [s, ...e]), {
|
|
34
35
|
headerRef: a,
|
|
35
36
|
leftActionsRef: t,
|
|
36
|
-
rightActionsRef:
|
|
37
|
-
titleMaxWidth:
|
|
37
|
+
rightActionsRef: n,
|
|
38
|
+
titleMaxWidth: r,
|
|
38
39
|
updateAvailableWidth: s
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
var
|
|
43
|
-
const a =
|
|
44
|
-
(
|
|
45
|
-
), { preferences: t } =
|
|
46
|
-
(
|
|
47
|
-
),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
function Va({ filter: e }) {
|
|
43
|
+
var w;
|
|
44
|
+
const a = M(
|
|
45
|
+
(y) => y.isDashboardEditing
|
|
46
|
+
), { preferences: t } = Mt(), n = Ot((w = t == null ? void 0 : t.cardDisplay) == null ? void 0 : w.mode), r = M((y) => y.dashboard), i = M(
|
|
47
|
+
(y) => y.dashboardInputValues
|
|
48
|
+
), s = M((y) => y.selectedSheetId), o = mt(), f = q(() => {
|
|
49
|
+
var F;
|
|
50
|
+
const y = (F = xa(r).findFilterInput({
|
|
51
|
+
filterId: e.id
|
|
52
|
+
})) == null ? void 0 : F.input;
|
|
53
|
+
if (!y) return !1;
|
|
54
|
+
const P = Ca({
|
|
55
|
+
dashboard: r,
|
|
56
|
+
input: y,
|
|
57
|
+
runtimeValues: i,
|
|
58
|
+
target: { sheetId: s },
|
|
59
|
+
calendar: o
|
|
60
|
+
});
|
|
61
|
+
return (P == null ? void 0 : P.status) === "set";
|
|
62
|
+
}, [o, r, i, e.id, s]), { removeFilterInput: u, saveFilterSettings: g } = Ut(), {
|
|
63
|
+
headerRef: c,
|
|
64
|
+
leftActionsRef: v,
|
|
65
|
+
rightActionsRef: m,
|
|
66
|
+
titleMaxWidth: x,
|
|
67
|
+
updateAvailableWidth: I
|
|
68
|
+
} = $a([
|
|
54
69
|
a,
|
|
55
|
-
|
|
56
|
-
|
|
70
|
+
f,
|
|
71
|
+
n
|
|
57
72
|
]);
|
|
58
73
|
return ee(() => {
|
|
59
|
-
|
|
60
|
-
}, [e.title,
|
|
74
|
+
I();
|
|
75
|
+
}, [e.title, I]), /* @__PURE__ */ h(
|
|
61
76
|
"div",
|
|
62
77
|
{
|
|
63
|
-
ref:
|
|
78
|
+
ref: c,
|
|
64
79
|
className: "group mb-1 flex h-5 items-center justify-between",
|
|
65
80
|
children: [
|
|
66
81
|
/* @__PURE__ */ h("div", { className: "flex grow items-center gap-2 min-w-0", children: [
|
|
@@ -68,12 +83,15 @@ function ja({ filter: e }) {
|
|
|
68
83
|
"div",
|
|
69
84
|
{
|
|
70
85
|
className: "min-w-0 flex-1",
|
|
71
|
-
style:
|
|
86
|
+
style: x !== void 0 ? { maxWidth: x } : void 0,
|
|
72
87
|
children: /* @__PURE__ */ l(oe, { className: "my-1 block w-full text-sm", children: /* @__PURE__ */ l(
|
|
73
|
-
|
|
88
|
+
Wt,
|
|
74
89
|
{
|
|
75
90
|
value: e.title || e.column,
|
|
76
|
-
onSave: (
|
|
91
|
+
onSave: (y) => g(
|
|
92
|
+
{ filterId: e.id },
|
|
93
|
+
{ definition: { ...e, title: y } }
|
|
94
|
+
),
|
|
77
95
|
isEditable: a,
|
|
78
96
|
placeholder: "Filter",
|
|
79
97
|
displayClassName: "text-sm truncate",
|
|
@@ -86,44 +104,54 @@ function ja({ filter: e }) {
|
|
|
86
104
|
"div",
|
|
87
105
|
{
|
|
88
106
|
className: "flex shrink-0 items-center gap-1.5",
|
|
89
|
-
ref:
|
|
107
|
+
ref: v,
|
|
90
108
|
children: [
|
|
91
|
-
a && /* @__PURE__ */ l(
|
|
109
|
+
a && /* @__PURE__ */ l(
|
|
110
|
+
jt,
|
|
111
|
+
{
|
|
112
|
+
filter: e,
|
|
113
|
+
isEditing: a,
|
|
114
|
+
filterRef: { filterId: e.id }
|
|
115
|
+
}
|
|
116
|
+
),
|
|
92
117
|
a && /* @__PURE__ */ l(
|
|
93
118
|
"button",
|
|
94
119
|
{
|
|
95
120
|
onClick: () => {
|
|
96
|
-
|
|
121
|
+
u({ filterId: e.id });
|
|
97
122
|
},
|
|
98
123
|
className: "text-muted-foreground hover:text-foreground",
|
|
99
|
-
children: /* @__PURE__ */ l(
|
|
124
|
+
children: /* @__PURE__ */ l(Oa, { className: "size-3.5" })
|
|
100
125
|
}
|
|
101
126
|
)
|
|
102
127
|
]
|
|
103
128
|
}
|
|
104
129
|
)
|
|
105
130
|
] }),
|
|
106
|
-
/* @__PURE__ */ l("div", { className: "hidden", ref:
|
|
131
|
+
/* @__PURE__ */ l("div", { className: "hidden", ref: m })
|
|
107
132
|
]
|
|
108
133
|
}
|
|
109
134
|
);
|
|
110
135
|
}
|
|
111
|
-
function
|
|
112
|
-
const e =
|
|
113
|
-
|
|
136
|
+
function Ka() {
|
|
137
|
+
const e = M((r) => r.dashboard), a = M((r) => r.selectedSheetId), t = M((r) => r.theme), n = q(
|
|
138
|
+
() => Na(e, a, "dashboard").filter(({ input: r }) => Ea(r)).map(({ input: r }) => r.filter),
|
|
139
|
+
[e, a]
|
|
140
|
+
);
|
|
141
|
+
return n.length ? /* @__PURE__ */ l(
|
|
114
142
|
"div",
|
|
115
143
|
{
|
|
116
|
-
className:
|
|
117
|
-
"bg-[repeating-linear-gradient(45deg,_#ffffff_0_3px,_#f3f3f3_3px_6px)]":
|
|
118
|
-
"bg-[repeating-linear-gradient(45deg,_#18171d_0_3px,_#272729_3px_6px)]":
|
|
144
|
+
className: O("mb-1 flex items-center gap-2 border-y px-0.5 pb-0.5", {
|
|
145
|
+
"bg-[repeating-linear-gradient(45deg,_#ffffff_0_3px,_#f3f3f3_3px_6px)]": t === "light",
|
|
146
|
+
"bg-[repeating-linear-gradient(45deg,_#18171d_0_3px,_#272729_3px_6px)]": t === "dark"
|
|
119
147
|
}),
|
|
120
|
-
children:
|
|
148
|
+
children: n.map((r) => /* @__PURE__ */ h(
|
|
121
149
|
"div",
|
|
122
150
|
{
|
|
123
151
|
className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
|
|
124
152
|
children: [
|
|
125
|
-
/* @__PURE__ */ l(
|
|
126
|
-
/* @__PURE__ */ l(
|
|
153
|
+
/* @__PURE__ */ l(Va, { filter: r }),
|
|
154
|
+
/* @__PURE__ */ l(Bt, { filter: r })
|
|
127
155
|
]
|
|
128
156
|
},
|
|
129
157
|
r.id
|
|
@@ -131,39 +159,39 @@ function Wa() {
|
|
|
131
159
|
}
|
|
132
160
|
) : null;
|
|
133
161
|
}
|
|
134
|
-
function
|
|
162
|
+
function Ha() {
|
|
135
163
|
var i;
|
|
136
|
-
const e =
|
|
164
|
+
const e = M((s) => s.dashboard), a = M((s) => s.selectedSheetId), t = M(
|
|
137
165
|
(s) => s.isDashboardEditing
|
|
138
|
-
),
|
|
166
|
+
), n = (i = e.sheets) == null ? void 0 : i.find(
|
|
139
167
|
(s) => s.id === a
|
|
140
|
-
),
|
|
168
|
+
), r = Ta(n);
|
|
141
169
|
return /* @__PURE__ */ l(
|
|
142
170
|
"div",
|
|
143
171
|
{
|
|
144
172
|
role: "dashboard-plus-main",
|
|
145
173
|
className: "flex min-h-0 grow basis-0 overflow-hidden",
|
|
146
174
|
children: /* @__PURE__ */ h("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: [
|
|
147
|
-
t && !
|
|
148
|
-
/* @__PURE__ */ l(
|
|
175
|
+
t && !r && /* @__PURE__ */ l(Ka, {}),
|
|
176
|
+
/* @__PURE__ */ l($t, {})
|
|
149
177
|
] })
|
|
150
178
|
}
|
|
151
179
|
);
|
|
152
180
|
}
|
|
153
|
-
const
|
|
154
|
-
function
|
|
155
|
-
return
|
|
181
|
+
const qa = /* @__PURE__ */ new Set(["iat", "exp", "nbf", "jti"]);
|
|
182
|
+
function Ga(e) {
|
|
183
|
+
return Wa(
|
|
156
184
|
Object.fromEntries(
|
|
157
|
-
Object.entries(e ?? {}).filter(([a]) =>
|
|
185
|
+
Object.entries(e ?? {}).filter(([a]) => !qa.has(a))
|
|
158
186
|
)
|
|
159
187
|
);
|
|
160
188
|
}
|
|
161
|
-
function
|
|
189
|
+
function Xa(e) {
|
|
162
190
|
var t;
|
|
163
191
|
const a = e == null ? void 0 : e.config;
|
|
164
|
-
return
|
|
192
|
+
return Ua({
|
|
165
193
|
features: ((t = a == null ? void 0 : a.projectFeatures) == null ? void 0 : t.features) ?? {},
|
|
166
|
-
config: { enabled:
|
|
194
|
+
config: { enabled: bt(a).enabled },
|
|
167
195
|
identity: {
|
|
168
196
|
orgUserId: e == null ? void 0 : e.orgUserId,
|
|
169
197
|
tenantId: e == null ? void 0 : e.tenantId,
|
|
@@ -175,54 +203,54 @@ function Ka(e) {
|
|
|
175
203
|
let tt = 0;
|
|
176
204
|
function at(e, a) {
|
|
177
205
|
tt += 1;
|
|
178
|
-
const { name: t, layout:
|
|
179
|
-
return { ...
|
|
206
|
+
const { name: t, layout: n } = bt(a == null ? void 0 : a.config);
|
|
207
|
+
return { ...Kt(n), id: tt, callerKey: e, assistantName: t };
|
|
180
208
|
}
|
|
181
|
-
function
|
|
209
|
+
function Ja({
|
|
182
210
|
children: e,
|
|
183
211
|
authToken: a
|
|
184
212
|
}) {
|
|
185
|
-
const t = Be(),
|
|
186
|
-
() => a === void 0 ? t.tokenProps :
|
|
213
|
+
const t = Be(), n = q(
|
|
214
|
+
() => a === void 0 ? t.tokenProps : Za(a),
|
|
187
215
|
[a, t.tokenProps]
|
|
188
|
-
),
|
|
189
|
-
() =>
|
|
190
|
-
[
|
|
191
|
-
), [s, o] =
|
|
192
|
-
s.callerKey !==
|
|
193
|
-
const f =
|
|
194
|
-
return /* @__PURE__ */ l(
|
|
216
|
+
), r = q(() => Ga(n), [n]), i = q(
|
|
217
|
+
() => Xa(n).available,
|
|
218
|
+
[n]
|
|
219
|
+
), [s, o] = L(() => at(r, n));
|
|
220
|
+
s.callerKey !== r && o(at(r, n)), Qa(s);
|
|
221
|
+
const f = q(() => ({ instance: s, available: i }), [s, i]);
|
|
222
|
+
return /* @__PURE__ */ l(Vt.Provider, { value: f, children: e });
|
|
195
223
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
224
|
+
function Ya({ children: e }) {
|
|
225
|
+
return ft() ? /* @__PURE__ */ l(ie, { children: e }) : /* @__PURE__ */ l(Ja, { children: e });
|
|
198
226
|
}
|
|
199
|
-
function
|
|
227
|
+
function Za(e) {
|
|
200
228
|
if (!(e != null && e.accessToken)) return {};
|
|
201
229
|
try {
|
|
202
|
-
return
|
|
230
|
+
return ba(e.accessToken);
|
|
203
231
|
} catch {
|
|
204
232
|
return {};
|
|
205
233
|
}
|
|
206
234
|
}
|
|
207
|
-
function
|
|
235
|
+
function Qa(e) {
|
|
208
236
|
ee(() => {
|
|
209
|
-
const a = (
|
|
237
|
+
const a = (n, r) => {
|
|
210
238
|
const i = e.store.getState().focus;
|
|
211
|
-
i && !
|
|
212
|
-
}, t =
|
|
213
|
-
return a(t.selectedSheetId, t.dashboard),
|
|
214
|
-
(
|
|
239
|
+
i && !er(i, n, r) && e.clearFocus();
|
|
240
|
+
}, t = M.getState();
|
|
241
|
+
return a(t.selectedSheetId, t.dashboard), M.subscribe((n, r) => {
|
|
242
|
+
(n.selectedSheetId !== r.selectedSheetId || n.dashboard !== r.dashboard) && a(n.selectedSheetId, n.dashboard), n.isVisualEditing && !r.isVisualEditing && e.leaveBeside();
|
|
215
243
|
});
|
|
216
244
|
}, [e]);
|
|
217
245
|
}
|
|
218
|
-
function
|
|
246
|
+
function er(e, a, t) {
|
|
219
247
|
if ((a ?? null) !== e.sheetId) return !1;
|
|
220
|
-
const
|
|
221
|
-
return !!
|
|
248
|
+
const n = t ? Sa(t, e.cardId) : void 0;
|
|
249
|
+
return !!n && n.sheet.id === e.sheetId;
|
|
222
250
|
}
|
|
223
|
-
const
|
|
224
|
-
function
|
|
225
|
-
const e =
|
|
251
|
+
const tr = Se(() => import("./assistant-chat-D7sWTypJ.js"));
|
|
252
|
+
function yn() {
|
|
253
|
+
const e = Ht();
|
|
226
254
|
return e.available ? /* @__PURE__ */ h(
|
|
227
255
|
V,
|
|
228
256
|
{
|
|
@@ -231,24 +259,24 @@ function hn() {
|
|
|
231
259
|
"aria-pressed": e.isOpen,
|
|
232
260
|
onClick: e.toggle,
|
|
233
261
|
children: [
|
|
234
|
-
/* @__PURE__ */ l(
|
|
262
|
+
/* @__PURE__ */ l(qt, { className: "h-3.5 w-3.5" }),
|
|
235
263
|
e.assistantName
|
|
236
264
|
]
|
|
237
265
|
}
|
|
238
266
|
) : null;
|
|
239
267
|
}
|
|
240
|
-
const
|
|
268
|
+
const ar = {
|
|
241
269
|
// Docked widths are the viewer's (the resize handle), applied as a style.
|
|
242
270
|
"docked-right": "relative shrink-0 border-l border-border",
|
|
243
271
|
"docked-left": "relative order-first shrink-0 border-r border-border",
|
|
244
272
|
centered: "absolute left-1/2 top-1/2 z-30 h-[min(80%,760px)] w-[min(640px,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-card border border-border shadow-lg",
|
|
245
273
|
"full-page": "absolute inset-0 z-30"
|
|
246
|
-
},
|
|
247
|
-
function
|
|
248
|
-
const a =
|
|
249
|
-
(a == null ? void 0 : a.instance.store) ??
|
|
250
|
-
|
|
251
|
-
var
|
|
274
|
+
}, rr = "absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg", nr = 640, fe = 8;
|
|
275
|
+
function lr({ surface: e = "dashboard" } = {}) {
|
|
276
|
+
const a = ft(), { isOpen: t, mounted: n, storedLayout: r, width: i, beside: s, besideSize: o, focusCardId: f, askCount: u } = Gt(
|
|
277
|
+
(a == null ? void 0 : a.instance.store) ?? Jt,
|
|
278
|
+
Xt((w) => {
|
|
279
|
+
var y;
|
|
252
280
|
return {
|
|
253
281
|
isOpen: w.isOpen,
|
|
254
282
|
mounted: w.mounted,
|
|
@@ -256,15 +284,15 @@ function tr({ surface: e = "dashboard" } = {}) {
|
|
|
256
284
|
width: w.width,
|
|
257
285
|
beside: w.beside,
|
|
258
286
|
besideSize: w.besideSize,
|
|
259
|
-
focusCardId: (
|
|
287
|
+
focusCardId: (y = w.focus) == null ? void 0 : y.cardId,
|
|
260
288
|
askCount: w.askCount
|
|
261
289
|
};
|
|
262
290
|
})
|
|
263
|
-
), g = e === "none", c =
|
|
264
|
-
(w) => s && t && f && !g ?
|
|
265
|
-
), v =
|
|
266
|
-
if (!(a != null && a.available) || !
|
|
267
|
-
const m = g ? "full-page" : v.shown ? "beside-card" :
|
|
291
|
+
), g = e === "none", c = M(
|
|
292
|
+
(w) => s && t && f && !g ? sr(w.dashboard, w.selectedSheetId, f) : void 0
|
|
293
|
+
), v = ir(c, u);
|
|
294
|
+
if (!(a != null && a.available) || !n && !g) return null;
|
|
295
|
+
const m = g ? "full-page" : v.shown ? "beside-card" : r, x = g || t, I = m === "docked-right" || m === "docked-left";
|
|
268
296
|
return /* @__PURE__ */ h(
|
|
269
297
|
"aside",
|
|
270
298
|
{
|
|
@@ -274,61 +302,61 @@ function tr({ surface: e = "dashboard" } = {}) {
|
|
|
274
302
|
"data-layout": m,
|
|
275
303
|
"data-beside-frame": m === "beside-card" ? c : void 0,
|
|
276
304
|
"data-beside-side": m === "beside-card" ? v.side : void 0,
|
|
277
|
-
className:
|
|
305
|
+
className: O(
|
|
278
306
|
"flex-col bg-background",
|
|
279
|
-
m === "beside-card" ?
|
|
280
|
-
|
|
307
|
+
m === "beside-card" ? rr : ar[m],
|
|
308
|
+
x ? "flex" : "hidden"
|
|
281
309
|
),
|
|
282
310
|
style: m === "beside-card" ? { ...v.style, width: o.width, height: o.height } : (
|
|
283
311
|
// The saved width, never more than the share of the dashboard's area the
|
|
284
312
|
// handle allows, however the area is sized now or later (P4-10).
|
|
285
|
-
|
|
313
|
+
I ? { width: i, maxWidth: `${gt * 100}%` } : void 0
|
|
286
314
|
),
|
|
287
315
|
onKeyDown: m === "beside-card" ? (w) => {
|
|
288
316
|
if (w.key !== "Escape" || w.defaultPrevented || !(w.target instanceof Node) || !w.currentTarget.contains(w.target)) return;
|
|
289
317
|
w.preventDefault();
|
|
290
|
-
const
|
|
291
|
-
a.instance.close(),
|
|
318
|
+
const y = v.cardActions();
|
|
319
|
+
a.instance.close(), y == null || y.focus();
|
|
292
320
|
} : void 0,
|
|
293
321
|
children: [
|
|
294
|
-
|
|
295
|
-
m === "beside-card" ? /* @__PURE__ */ l(
|
|
296
|
-
/* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(
|
|
322
|
+
I ? /* @__PURE__ */ l(cr, { instance: a.instance, side: m === "docked-left" ? "right" : "left", width: i }) : null,
|
|
323
|
+
m === "beside-card" ? /* @__PURE__ */ l(dr, { instance: a.instance, size: o, side: v.handleSide }) : null,
|
|
324
|
+
/* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(tr, { instance: a.instance, surface: e, placement: m }, a.instance.id) })
|
|
297
325
|
]
|
|
298
326
|
}
|
|
299
327
|
);
|
|
300
328
|
}
|
|
301
|
-
function
|
|
302
|
-
var
|
|
303
|
-
const
|
|
304
|
-
return (s = (i =
|
|
329
|
+
function sr(e, a, t) {
|
|
330
|
+
var r, i, s;
|
|
331
|
+
const n = (r = e.sheets) == null ? void 0 : r.find((o) => o.id === a);
|
|
332
|
+
return (s = (i = n == null ? void 0 : n.frames) == null ? void 0 : i.find((o) => {
|
|
305
333
|
var f;
|
|
306
334
|
return (f = o.cards) == null ? void 0 : f.some((u) => u.id === t);
|
|
307
335
|
})) == null ? void 0 : s.id;
|
|
308
336
|
}
|
|
309
|
-
function
|
|
310
|
-
var
|
|
311
|
-
const [t,
|
|
337
|
+
function ir(e, a) {
|
|
338
|
+
var x;
|
|
339
|
+
const [t, n] = L(void 0), [r, i] = L(void 0), s = Y(a);
|
|
312
340
|
Xe(() => {
|
|
313
341
|
s.current = a;
|
|
314
342
|
});
|
|
315
|
-
const o =
|
|
343
|
+
const o = r === a ? null : t, { refs: f, elements: u, floatingStyles: g, middlewareData: c, isPositioned: v } = Ia({
|
|
316
344
|
strategy: "absolute",
|
|
317
345
|
placement: o ?? "right-start",
|
|
318
346
|
middleware: [
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
347
|
+
ka(fe),
|
|
348
|
+
Aa({ padding: fe }),
|
|
349
|
+
Da({
|
|
322
350
|
padding: fe,
|
|
323
|
-
apply: ({ availableWidth:
|
|
324
|
-
|
|
351
|
+
apply: ({ availableWidth: I, availableHeight: w, elements: y }) => {
|
|
352
|
+
y.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, I)}px`), y.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, w)}px`);
|
|
325
353
|
}
|
|
326
354
|
}),
|
|
327
|
-
|
|
355
|
+
Ra()
|
|
328
356
|
],
|
|
329
|
-
whileElementsMounted: (
|
|
330
|
-
const
|
|
331
|
-
|
|
357
|
+
whileElementsMounted: (I, w, y) => Pa(I, w, () => {
|
|
358
|
+
const P = or(I, w);
|
|
359
|
+
n(P), P === null && i(s.current), y();
|
|
332
360
|
})
|
|
333
361
|
}), m = u.floating;
|
|
334
362
|
return Xe(() => {
|
|
@@ -340,38 +368,38 @@ function rr(e, a) {
|
|
|
340
368
|
...g,
|
|
341
369
|
// Not before it is placed (its side is chosen first): never a flash at
|
|
342
370
|
// the row's corner. With the card wholly out of view, it goes with the card.
|
|
343
|
-
...!v || (
|
|
371
|
+
...!v || (x = c.hide) != null && x.referenceHidden ? { visibility: "hidden" } : {}
|
|
344
372
|
},
|
|
345
373
|
/** The side the conversation took; the size handle sits on the corner away from the card. */
|
|
346
374
|
side: o ?? void 0,
|
|
347
375
|
handleSide: o === "left-start" ? "left" : "right",
|
|
348
376
|
/** The card's ··· menu, where Ask lives and focus returns on Escape. */
|
|
349
377
|
cardActions: () => {
|
|
350
|
-
var
|
|
351
|
-
return e ? (
|
|
378
|
+
var I;
|
|
379
|
+
return e ? (I = rt(m == null ? void 0 : m.parentElement, e)) == null ? void 0 : I.querySelector("[data-card-actions]") : null;
|
|
352
380
|
}
|
|
353
381
|
};
|
|
354
382
|
}
|
|
355
383
|
function rt(e, a) {
|
|
356
384
|
return e ? Array.from(e.querySelectorAll("[data-frame-id]")).find((t) => t.dataset.frameId === a) ?? null : null;
|
|
357
385
|
}
|
|
358
|
-
function
|
|
386
|
+
function or(e, a) {
|
|
359
387
|
const t = a.parentElement;
|
|
360
388
|
if (!t || !e.isConnected) return null;
|
|
361
|
-
const
|
|
362
|
-
if (
|
|
363
|
-
const
|
|
364
|
-
return s(
|
|
389
|
+
const n = t.getBoundingClientRect();
|
|
390
|
+
if (n.width < nr) return null;
|
|
391
|
+
const r = e.getBoundingClientRect(), { min: i } = ht, s = (o, f) => o >= i.width + 2 * fe && f >= i.height + 2 * fe;
|
|
392
|
+
return s(n.right - r.right, n.height) ? "right-start" : s(r.left - n.left, n.height) ? "left-start" : s(n.width, n.bottom - r.bottom) ? "bottom-start" : null;
|
|
365
393
|
}
|
|
366
|
-
function
|
|
394
|
+
function dr({
|
|
367
395
|
instance: e,
|
|
368
396
|
size: a,
|
|
369
397
|
side: t
|
|
370
398
|
}) {
|
|
371
|
-
const
|
|
372
|
-
const o =
|
|
399
|
+
const n = Y(void 0), r = t === "left" ? -1 : 1, i = (s) => {
|
|
400
|
+
const o = n.current;
|
|
373
401
|
return {
|
|
374
|
-
width: o.start.width +
|
|
402
|
+
width: o.start.width + r * (s.clientX - o.x),
|
|
375
403
|
height: o.start.height + (s.clientY - o.y)
|
|
376
404
|
};
|
|
377
405
|
};
|
|
@@ -384,60 +412,60 @@ function lr({
|
|
|
384
412
|
title: "Drag to resize. Double-click to reset.",
|
|
385
413
|
onPointerDown: (s) => {
|
|
386
414
|
var o, f;
|
|
387
|
-
s.preventDefault(), (f = (o = s.currentTarget).setPointerCapture) == null || f.call(o, s.pointerId),
|
|
415
|
+
s.preventDefault(), (f = (o = s.currentTarget).setPointerCapture) == null || f.call(o, s.pointerId), n.current = { x: s.clientX, y: s.clientY, start: a };
|
|
388
416
|
},
|
|
389
417
|
onPointerMove: (s) => {
|
|
390
|
-
|
|
418
|
+
n.current && e.setBesideSize(i(s));
|
|
391
419
|
},
|
|
392
420
|
onPointerUp: (s) => {
|
|
393
|
-
|
|
421
|
+
n.current && (e.setBesideSize(i(s), { save: !0 }), n.current = void 0);
|
|
394
422
|
},
|
|
395
423
|
onPointerCancel: () => {
|
|
396
|
-
|
|
424
|
+
n.current = void 0;
|
|
397
425
|
},
|
|
398
426
|
onKeyDown: (s) => {
|
|
399
427
|
const o = {
|
|
400
|
-
ArrowLeft: { width: -
|
|
401
|
-
ArrowRight: { width:
|
|
428
|
+
ArrowLeft: { width: -r * le, height: 0 },
|
|
429
|
+
ArrowRight: { width: r * le, height: 0 },
|
|
402
430
|
ArrowUp: { width: 0, height: -le },
|
|
403
431
|
ArrowDown: { width: 0, height: le }
|
|
404
432
|
}[s.key];
|
|
405
433
|
o && (s.preventDefault(), e.setBesideSize({ width: a.width + o.width, height: a.height + o.height }, { save: !0 }));
|
|
406
434
|
},
|
|
407
|
-
onDoubleClick: () => e.setBesideSize(
|
|
408
|
-
className:
|
|
435
|
+
onDoubleClick: () => e.setBesideSize(ht.default, { save: !0 }),
|
|
436
|
+
className: O(
|
|
409
437
|
"absolute bottom-0 z-10 h-3 w-3 touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
|
|
410
438
|
t === "left" ? "left-0 cursor-nesw-resize rounded-bl-card" : "right-0 cursor-nwse-resize rounded-br-card"
|
|
411
439
|
)
|
|
412
440
|
}
|
|
413
441
|
);
|
|
414
442
|
}
|
|
415
|
-
const le = 16,
|
|
416
|
-
function
|
|
417
|
-
const
|
|
418
|
-
var m,
|
|
419
|
-
const v = (
|
|
420
|
-
return v ? v *
|
|
443
|
+
const le = 16, gt = 0.6;
|
|
444
|
+
function cr({ instance: e, side: a, width: t }) {
|
|
445
|
+
const n = Y(void 0), r = (c) => {
|
|
446
|
+
var m, x;
|
|
447
|
+
const v = (x = (m = c.closest("aside")) == null ? void 0 : m.parentElement) == null ? void 0 : x.clientWidth;
|
|
448
|
+
return v ? v * gt : be.max;
|
|
421
449
|
}, i = (c) => {
|
|
422
450
|
var v;
|
|
423
451
|
return ((v = c.closest("aside")) == null ? void 0 : v.getBoundingClientRect().width) || t;
|
|
424
452
|
}, s = (c) => {
|
|
425
|
-
const v =
|
|
453
|
+
const v = n.current;
|
|
426
454
|
if (!v) return t;
|
|
427
455
|
const m = c - v.startX;
|
|
428
456
|
return Je(v.startWidth + (a === "left" ? -m : m), v.maxForArea);
|
|
429
457
|
}, o = (c) => {
|
|
430
458
|
var v, m;
|
|
431
|
-
c.preventDefault(), (m = (v = c.currentTarget).setPointerCapture) == null || m.call(v, c.pointerId),
|
|
459
|
+
c.preventDefault(), (m = (v = c.currentTarget).setPointerCapture) == null || m.call(v, c.pointerId), n.current = { startX: c.clientX, startWidth: i(c.currentTarget), maxForArea: r(c.currentTarget) };
|
|
432
460
|
}, f = (c) => {
|
|
433
|
-
|
|
461
|
+
n.current && e.setWidth(s(c.clientX));
|
|
434
462
|
}, u = (c) => {
|
|
435
|
-
|
|
463
|
+
n.current && (e.setWidth(s(c.clientX), { save: !0 }), n.current = void 0);
|
|
436
464
|
}, g = (c) => {
|
|
437
465
|
if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
|
|
438
466
|
c.preventDefault();
|
|
439
467
|
const v = c.key === "ArrowLeft" == (a === "left");
|
|
440
|
-
e.setWidth(Je(i(c.currentTarget) + (v ? le : -le),
|
|
468
|
+
e.setWidth(Je(i(c.currentTarget) + (v ? le : -le), r(c.currentTarget)), { save: !0 });
|
|
441
469
|
};
|
|
442
470
|
return /* @__PURE__ */ l(
|
|
443
471
|
"div",
|
|
@@ -456,27 +484,27 @@ function sr({ instance: e, side: a, width: t }) {
|
|
|
456
484
|
onPointerCancel: u,
|
|
457
485
|
onKeyDown: g,
|
|
458
486
|
onDoubleClick: () => e.setWidth(be.default, { save: !0 }),
|
|
459
|
-
className:
|
|
487
|
+
className: O(
|
|
460
488
|
"absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
|
|
461
489
|
a === "left" ? "-left-[3px]" : "-right-[3px]"
|
|
462
490
|
)
|
|
463
491
|
}
|
|
464
492
|
);
|
|
465
493
|
}
|
|
466
|
-
const
|
|
467
|
-
() => import("./edit-dashboard-visual-
|
|
468
|
-
),
|
|
469
|
-
function
|
|
494
|
+
const ur = Se(() => import("./dashboard-controls-Cq05n3e0.js")), mr = Se(
|
|
495
|
+
() => import("./edit-dashboard-visual-JPtNfJRb.js")
|
|
496
|
+
), fr = Se(() => import("./dashboard-json-CoYRPqxx.js"));
|
|
497
|
+
function wn({
|
|
470
498
|
showControls: e = !1,
|
|
471
499
|
showFooter: a = !0,
|
|
472
500
|
...t
|
|
473
501
|
}) {
|
|
474
|
-
const
|
|
502
|
+
const n = M((o) => o.isVisualEditing), r = M(
|
|
475
503
|
(o) => o.showDashboardJSON
|
|
476
504
|
), { appearance: i, preferences: s } = t;
|
|
477
|
-
return /* @__PURE__ */ l(
|
|
478
|
-
/* @__PURE__ */ l(
|
|
479
|
-
/* @__PURE__ */ h(
|
|
505
|
+
return /* @__PURE__ */ l(Yt, { FallbackComponent: Zt, children: /* @__PURE__ */ l(Qt, { dashboardProps: t, children: /* @__PURE__ */ h(ea, { children: [
|
|
506
|
+
/* @__PURE__ */ l(ta, { componentType: "surfboard", componentId: t.id }),
|
|
507
|
+
/* @__PURE__ */ h(aa, { appearance: i, children: [
|
|
480
508
|
/* @__PURE__ */ l(
|
|
481
509
|
va,
|
|
482
510
|
{
|
|
@@ -492,41 +520,41 @@ function pn({
|
|
|
492
520
|
}
|
|
493
521
|
}
|
|
494
522
|
),
|
|
495
|
-
/* @__PURE__ */ h(
|
|
496
|
-
|
|
497
|
-
/* @__PURE__ */ l(
|
|
498
|
-
e && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(
|
|
523
|
+
/* @__PURE__ */ h(ra, { preferences: s, children: [
|
|
524
|
+
r && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(fr, {}) }),
|
|
525
|
+
/* @__PURE__ */ l(na, { children: /* @__PURE__ */ l(Ya, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
|
|
526
|
+
e && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(ur, {}) }),
|
|
499
527
|
/* @__PURE__ */ h("div", { className: "relative flex grow overflow-hidden", children: [
|
|
500
|
-
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(
|
|
501
|
-
|
|
502
|
-
/* @__PURE__ */ l(
|
|
528
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(la, { ...t, type: "dashboard", children: [
|
|
529
|
+
n && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(mr, {}) }),
|
|
530
|
+
/* @__PURE__ */ l(_t, { mode: n ? "hidden" : "visible", children: /* @__PURE__ */ l(Ha, {}) })
|
|
503
531
|
] }) }),
|
|
504
|
-
/* @__PURE__ */ l(
|
|
532
|
+
/* @__PURE__ */ l(lr, {})
|
|
505
533
|
] })
|
|
506
534
|
] }) }) })
|
|
507
535
|
] })
|
|
508
536
|
] })
|
|
509
537
|
] }) }) });
|
|
510
538
|
}
|
|
511
|
-
var nt = 1,
|
|
512
|
-
function _e(e, a, t,
|
|
513
|
-
if (i === a.length) return
|
|
514
|
-
var o = `${
|
|
539
|
+
var nt = 1, hr = 0.9, pr = 0.8, vr = 0.17, Ee = 0.1, Te = 0.999, br = 0.9999, gr = 0.99, yr = /[\\\/_+.#"@\[\(\{&]/, wr = /[\\\/_+.#"@\[\(\{&]/g, Sr = /[\s-]/, yt = /[\s-]/g;
|
|
540
|
+
function _e(e, a, t, n, r, i, s) {
|
|
541
|
+
if (i === a.length) return r === e.length ? nt : gr;
|
|
542
|
+
var o = `${r},${i}`;
|
|
515
543
|
if (s[o] !== void 0) return s[o];
|
|
516
|
-
for (var f =
|
|
544
|
+
for (var f = n.charAt(i), u = t.indexOf(f, r), g = 0, c, v, m, x; u >= 0; ) c = _e(e, a, t, n, u + 1, i + 1, s), c > g && (u === r ? c *= nt : yr.test(e.charAt(u - 1)) ? (c *= pr, m = e.slice(r, u - 1).match(wr), m && r > 0 && (c *= Math.pow(Te, m.length))) : Sr.test(e.charAt(u - 1)) ? (c *= hr, x = e.slice(r, u - 1).match(yt), x && r > 0 && (c *= Math.pow(Te, x.length))) : (c *= vr, r > 0 && (c *= Math.pow(Te, u - r))), e.charAt(u) !== a.charAt(i) && (c *= br)), (c < Ee && t.charAt(u - 1) === n.charAt(i + 1) || n.charAt(i + 1) === n.charAt(i) && t.charAt(u - 1) !== n.charAt(i)) && (v = _e(e, a, t, n, u + 1, i + 2, s), v * Ee > c && (c = v * Ee)), c > g && (g = c), u = t.indexOf(f, u + 1);
|
|
517
545
|
return s[o] = g, g;
|
|
518
546
|
}
|
|
519
547
|
function lt(e) {
|
|
520
|
-
return e.toLowerCase().replace(
|
|
548
|
+
return e.toLowerCase().replace(yt, " ");
|
|
521
549
|
}
|
|
522
|
-
function
|
|
550
|
+
function xr(e, a, t) {
|
|
523
551
|
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, _e(e, a, lt(e), lt(a), 0, 0, {});
|
|
524
552
|
}
|
|
525
|
-
var me = '[cmdk-group=""]',
|
|
553
|
+
var me = '[cmdk-group=""]', Ie = '[cmdk-group-items=""]', Cr = '[cmdk-group-heading=""]', wt = '[cmdk-item=""]', st = `${wt}:not([aria-disabled="true"])`, Me = "cmdk-item-select", re = "data-value", Nr = (e, a, t) => xr(e, a, t), St = p.createContext(void 0), pe = () => p.useContext(St), xt = p.createContext(void 0), Ve = () => p.useContext(xt), Ct = p.createContext(void 0), Nt = p.forwardRef((e, a) => {
|
|
526
554
|
let t = ne(() => {
|
|
527
555
|
var d, T;
|
|
528
556
|
return { search: "", value: (T = (d = e.value) != null ? d : e.defaultValue) != null ? T : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
529
|
-
}),
|
|
557
|
+
}), n = ne(() => /* @__PURE__ */ new Set()), r = ne(() => /* @__PURE__ */ new Map()), i = ne(() => /* @__PURE__ */ new Map()), s = ne(() => /* @__PURE__ */ new Set()), o = Et(e), { label: f, children: u, value: g, onValueChange: c, filter: v, shouldFilter: m, loop: x, disablePointerSelection: I = !1, vimBindings: w = !0, ...y } = e, P = se(), F = se(), U = se(), _ = p.useRef(null), E = Lr();
|
|
530
558
|
te(() => {
|
|
531
559
|
if (g !== void 0) {
|
|
532
560
|
let d = g.trim();
|
|
@@ -536,20 +564,20 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
|
|
|
536
564
|
E(6, ae);
|
|
537
565
|
}, []);
|
|
538
566
|
let b = p.useMemo(() => ({ subscribe: (d) => (s.current.add(d), () => s.current.delete(d)), snapshot: () => t.current, setState: (d, T, A) => {
|
|
539
|
-
var
|
|
567
|
+
var S, D, z, B;
|
|
540
568
|
if (!Object.is(t.current[d], T)) {
|
|
541
|
-
if (t.current[d] = T, d === "search") K(),
|
|
569
|
+
if (t.current[d] = T, d === "search") K(), C(), E(1, G);
|
|
542
570
|
else if (d === "value") {
|
|
543
571
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
544
|
-
let
|
|
545
|
-
|
|
572
|
+
let W = document.getElementById(U);
|
|
573
|
+
W ? W.focus() : (S = document.getElementById(P)) == null || S.focus();
|
|
546
574
|
}
|
|
547
575
|
if (E(7, () => {
|
|
548
|
-
var
|
|
549
|
-
t.current.selectedItemId = (
|
|
576
|
+
var W;
|
|
577
|
+
t.current.selectedItemId = (W = X()) == null ? void 0 : W.id, b.emit();
|
|
550
578
|
}), A || E(5, ae), ((D = o.current) == null ? void 0 : D.value) !== void 0) {
|
|
551
|
-
let
|
|
552
|
-
(B = (
|
|
579
|
+
let W = T ?? "";
|
|
580
|
+
(B = (z = o.current).onValueChange) == null || B.call(z, W);
|
|
553
581
|
return;
|
|
554
582
|
}
|
|
555
583
|
}
|
|
@@ -557,108 +585,108 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
|
|
|
557
585
|
}
|
|
558
586
|
}, emit: () => {
|
|
559
587
|
s.current.forEach((d) => d());
|
|
560
|
-
} }), []),
|
|
561
|
-
var
|
|
562
|
-
T !== ((
|
|
563
|
-
|
|
588
|
+
} }), []), N = p.useMemo(() => ({ value: (d, T, A) => {
|
|
589
|
+
var S;
|
|
590
|
+
T !== ((S = i.current.get(d)) == null ? void 0 : S.value) && (i.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d, R(T, A)), E(2, () => {
|
|
591
|
+
C(), b.emit();
|
|
564
592
|
}));
|
|
565
|
-
}, item: (d, T) => (
|
|
566
|
-
K(),
|
|
593
|
+
}, item: (d, T) => (n.current.add(d), T && (r.current.has(T) ? r.current.get(T).add(d) : r.current.set(T, /* @__PURE__ */ new Set([d]))), E(3, () => {
|
|
594
|
+
K(), C(), t.current.value || G(), b.emit();
|
|
567
595
|
}), () => {
|
|
568
|
-
i.current.delete(d),
|
|
569
|
-
let A =
|
|
596
|
+
i.current.delete(d), n.current.delete(d), t.current.filtered.items.delete(d);
|
|
597
|
+
let A = X();
|
|
570
598
|
E(4, () => {
|
|
571
|
-
K(), (A == null ? void 0 : A.getAttribute("id")) === d &&
|
|
599
|
+
K(), (A == null ? void 0 : A.getAttribute("id")) === d && G(), b.emit();
|
|
572
600
|
});
|
|
573
|
-
}), group: (d) => (
|
|
574
|
-
i.current.delete(d),
|
|
575
|
-
}), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId:
|
|
601
|
+
}), group: (d) => (r.current.has(d) || r.current.set(d, /* @__PURE__ */ new Set()), () => {
|
|
602
|
+
i.current.delete(d), r.current.delete(d);
|
|
603
|
+
}), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: P, inputId: U, labelId: F, listInnerRef: _ }), []);
|
|
576
604
|
function R(d, T) {
|
|
577
|
-
var A,
|
|
578
|
-
let D = (
|
|
605
|
+
var A, S;
|
|
606
|
+
let D = (S = (A = o.current) == null ? void 0 : A.filter) != null ? S : Nr;
|
|
579
607
|
return d ? D(d, t.current.search, T) : 0;
|
|
580
608
|
}
|
|
581
|
-
function
|
|
609
|
+
function C() {
|
|
582
610
|
if (!t.current.search || o.current.shouldFilter === !1) return;
|
|
583
611
|
let d = t.current.filtered.items, T = [];
|
|
584
|
-
t.current.filtered.groups.forEach((
|
|
585
|
-
let D =
|
|
612
|
+
t.current.filtered.groups.forEach((S) => {
|
|
613
|
+
let D = r.current.get(S), z = 0;
|
|
586
614
|
D.forEach((B) => {
|
|
587
|
-
let
|
|
588
|
-
|
|
589
|
-
}), T.push([
|
|
615
|
+
let W = d.get(B);
|
|
616
|
+
z = Math.max(W, z);
|
|
617
|
+
}), T.push([S, z]);
|
|
590
618
|
});
|
|
591
619
|
let A = _.current;
|
|
592
|
-
|
|
593
|
-
var
|
|
594
|
-
let
|
|
595
|
-
return ((
|
|
596
|
-
}).forEach((
|
|
597
|
-
let D =
|
|
598
|
-
D ? D.appendChild(
|
|
599
|
-
}), T.sort((
|
|
620
|
+
k().sort((S, D) => {
|
|
621
|
+
var z, B;
|
|
622
|
+
let W = S.getAttribute("id"), ve = D.getAttribute("id");
|
|
623
|
+
return ((z = d.get(ve)) != null ? z : 0) - ((B = d.get(W)) != null ? B : 0);
|
|
624
|
+
}).forEach((S) => {
|
|
625
|
+
let D = S.closest(Ie);
|
|
626
|
+
D ? D.appendChild(S.parentElement === D ? S : S.closest(`${Ie} > *`)) : A.appendChild(S.parentElement === A ? S : S.closest(`${Ie} > *`));
|
|
627
|
+
}), T.sort((S, D) => D[1] - S[1]).forEach((S) => {
|
|
600
628
|
var D;
|
|
601
|
-
let
|
|
602
|
-
|
|
629
|
+
let z = (D = _.current) == null ? void 0 : D.querySelector(`${me}[${re}="${encodeURIComponent(S[0])}"]`);
|
|
630
|
+
z == null || z.parentElement.appendChild(z);
|
|
603
631
|
});
|
|
604
632
|
}
|
|
605
|
-
function
|
|
606
|
-
let d =
|
|
633
|
+
function G() {
|
|
634
|
+
let d = k().find((A) => A.getAttribute("aria-disabled") !== "true"), T = d == null ? void 0 : d.getAttribute(re);
|
|
607
635
|
b.setState("value", T || void 0);
|
|
608
636
|
}
|
|
609
637
|
function K() {
|
|
610
|
-
var d, T, A,
|
|
638
|
+
var d, T, A, S;
|
|
611
639
|
if (!t.current.search || o.current.shouldFilter === !1) {
|
|
612
|
-
t.current.filtered.count =
|
|
640
|
+
t.current.filtered.count = n.current.size;
|
|
613
641
|
return;
|
|
614
642
|
}
|
|
615
643
|
t.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
616
644
|
let D = 0;
|
|
617
|
-
for (let
|
|
618
|
-
let B = (T = (d = i.current.get(
|
|
619
|
-
t.current.filtered.items.set(
|
|
645
|
+
for (let z of n.current) {
|
|
646
|
+
let B = (T = (d = i.current.get(z)) == null ? void 0 : d.value) != null ? T : "", W = (S = (A = i.current.get(z)) == null ? void 0 : A.keywords) != null ? S : [], ve = R(B, W);
|
|
647
|
+
t.current.filtered.items.set(z, ve), ve > 0 && D++;
|
|
620
648
|
}
|
|
621
|
-
for (let [
|
|
622
|
-
t.current.filtered.groups.add(
|
|
649
|
+
for (let [z, B] of r.current) for (let W of B) if (t.current.filtered.items.get(W) > 0) {
|
|
650
|
+
t.current.filtered.groups.add(z);
|
|
623
651
|
break;
|
|
624
652
|
}
|
|
625
653
|
t.current.filtered.count = D;
|
|
626
654
|
}
|
|
627
655
|
function ae() {
|
|
628
656
|
var d, T, A;
|
|
629
|
-
let
|
|
630
|
-
|
|
657
|
+
let S = X();
|
|
658
|
+
S && (((d = S.parentElement) == null ? void 0 : d.firstChild) === S && ((A = (T = S.closest(me)) == null ? void 0 : T.querySelector(Cr)) == null || A.scrollIntoView({ block: "nearest" })), S.scrollIntoView({ block: "nearest" }));
|
|
631
659
|
}
|
|
632
|
-
function
|
|
660
|
+
function X() {
|
|
633
661
|
var d;
|
|
634
|
-
return (d = _.current) == null ? void 0 : d.querySelector(`${
|
|
662
|
+
return (d = _.current) == null ? void 0 : d.querySelector(`${wt}[aria-selected="true"]`);
|
|
635
663
|
}
|
|
636
|
-
function
|
|
664
|
+
function k() {
|
|
637
665
|
var d;
|
|
638
666
|
return Array.from(((d = _.current) == null ? void 0 : d.querySelectorAll(st)) || []);
|
|
639
667
|
}
|
|
640
668
|
function de(d) {
|
|
641
|
-
let T =
|
|
669
|
+
let T = k()[d];
|
|
642
670
|
T && b.setState("value", T.getAttribute(re));
|
|
643
671
|
}
|
|
644
672
|
function Ce(d) {
|
|
645
673
|
var T;
|
|
646
|
-
let A =
|
|
647
|
-
(T = o.current) != null && T.loop && (
|
|
674
|
+
let A = X(), S = k(), D = S.findIndex((B) => B === A), z = S[D + d];
|
|
675
|
+
(T = o.current) != null && T.loop && (z = D + d < 0 ? S[S.length - 1] : D + d === S.length ? S[0] : S[D + d]), z && b.setState("value", z.getAttribute(re));
|
|
648
676
|
}
|
|
649
677
|
function Ke(d) {
|
|
650
|
-
let T =
|
|
651
|
-
for (; A && !
|
|
652
|
-
|
|
678
|
+
let T = X(), A = T == null ? void 0 : T.closest(me), S;
|
|
679
|
+
for (; A && !S; ) A = d > 0 ? zr(A, me) : Fr(A, me), S = A == null ? void 0 : A.querySelector(st);
|
|
680
|
+
S ? b.setState("value", S.getAttribute(re)) : Ce(d);
|
|
653
681
|
}
|
|
654
|
-
let He = () => de(
|
|
682
|
+
let He = () => de(k().length - 1), qe = (d) => {
|
|
655
683
|
d.preventDefault(), d.metaKey ? He() : d.altKey ? Ke(1) : Ce(1);
|
|
656
684
|
}, Ge = (d) => {
|
|
657
685
|
d.preventDefault(), d.metaKey ? de(0) : d.altKey ? Ke(-1) : Ce(-1);
|
|
658
686
|
};
|
|
659
|
-
return p.createElement(
|
|
687
|
+
return p.createElement(Q.div, { ref: a, tabIndex: -1, ...y, "cmdk-root": "", onKeyDown: (d) => {
|
|
660
688
|
var T;
|
|
661
|
-
(T =
|
|
689
|
+
(T = y.onKeyDown) == null || T.call(y, d);
|
|
662
690
|
let A = d.nativeEvent.isComposing || d.keyCode === 229;
|
|
663
691
|
if (!(d.defaultPrevented || A)) switch (d.key) {
|
|
664
692
|
case "n":
|
|
@@ -689,52 +717,52 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
|
|
|
689
717
|
}
|
|
690
718
|
case "Enter": {
|
|
691
719
|
d.preventDefault();
|
|
692
|
-
let
|
|
693
|
-
if (
|
|
720
|
+
let S = X();
|
|
721
|
+
if (S) {
|
|
694
722
|
let D = new Event(Me);
|
|
695
|
-
|
|
723
|
+
S.dispatchEvent(D);
|
|
696
724
|
}
|
|
697
725
|
}
|
|
698
726
|
}
|
|
699
|
-
} }, p.createElement("label", { "cmdk-label": "", htmlFor:
|
|
700
|
-
}),
|
|
701
|
-
var t,
|
|
702
|
-
let
|
|
727
|
+
} }, p.createElement("label", { "cmdk-label": "", htmlFor: N.inputId, id: N.labelId, style: Mr }, f), xe(e, (d) => p.createElement(xt.Provider, { value: b }, p.createElement(St.Provider, { value: N }, d))));
|
|
728
|
+
}), Er = p.forwardRef((e, a) => {
|
|
729
|
+
var t, n;
|
|
730
|
+
let r = se(), i = p.useRef(null), s = p.useContext(Ct), o = pe(), f = Et(e), u = (n = (t = f.current) == null ? void 0 : t.forceMount) != null ? n : s == null ? void 0 : s.forceMount;
|
|
703
731
|
te(() => {
|
|
704
|
-
if (!u) return o.item(
|
|
732
|
+
if (!u) return o.item(r, s == null ? void 0 : s.id);
|
|
705
733
|
}, [u]);
|
|
706
|
-
let g =
|
|
734
|
+
let g = Tt(r, i, [e.value, e.children, i], e.keywords), c = Ve(), v = Z((E) => E.value && E.value === g.current), m = Z((E) => u || o.filter() === !1 ? !0 : E.search ? E.filtered.items.get(r) > 0 : !0);
|
|
707
735
|
p.useEffect(() => {
|
|
708
736
|
let E = i.current;
|
|
709
|
-
if (!(!E || e.disabled)) return E.addEventListener(Me,
|
|
737
|
+
if (!(!E || e.disabled)) return E.addEventListener(Me, x), () => E.removeEventListener(Me, x);
|
|
710
738
|
}, [m, e.onSelect, e.disabled]);
|
|
711
|
-
function
|
|
739
|
+
function x() {
|
|
712
740
|
var E, b;
|
|
713
|
-
|
|
741
|
+
I(), (b = (E = f.current).onSelect) == null || b.call(E, g.current);
|
|
714
742
|
}
|
|
715
|
-
function
|
|
743
|
+
function I() {
|
|
716
744
|
c.setState("value", g.current, !0);
|
|
717
745
|
}
|
|
718
746
|
if (!m) return null;
|
|
719
|
-
let { disabled: w, value:
|
|
720
|
-
return p.createElement(
|
|
721
|
-
}),
|
|
722
|
-
let { heading: t, children:
|
|
723
|
-
te(() => g.group(s), []),
|
|
724
|
-
let v = p.useMemo(() => ({ id: s, forceMount:
|
|
725
|
-
return p.createElement(
|
|
726
|
-
}),
|
|
727
|
-
let { alwaysRender: t, ...
|
|
728
|
-
return !t && !i ? null : p.createElement(
|
|
729
|
-
}),
|
|
730
|
-
let { onValueChange: t, ...
|
|
747
|
+
let { disabled: w, value: y, onSelect: P, forceMount: F, keywords: U, ..._ } = e;
|
|
748
|
+
return p.createElement(Q.div, { ref: he(i, a), ..._, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!w, "aria-selected": !!v, "data-disabled": !!w, "data-selected": !!v, onPointerMove: w || o.getDisablePointerSelection() ? void 0 : I, onClick: w ? void 0 : x }, e.children);
|
|
749
|
+
}), Tr = p.forwardRef((e, a) => {
|
|
750
|
+
let { heading: t, children: n, forceMount: r, ...i } = e, s = se(), o = p.useRef(null), f = p.useRef(null), u = se(), g = pe(), c = Z((m) => r || g.filter() === !1 ? !0 : m.search ? m.filtered.groups.has(s) : !0);
|
|
751
|
+
te(() => g.group(s), []), Tt(s, o, [e.value, e.heading, f]);
|
|
752
|
+
let v = p.useMemo(() => ({ id: s, forceMount: r }), [r]);
|
|
753
|
+
return p.createElement(Q.div, { ref: he(o, a), ...i, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), xe(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(Ct.Provider, { value: v }, m))));
|
|
754
|
+
}), Ir = p.forwardRef((e, a) => {
|
|
755
|
+
let { alwaysRender: t, ...n } = e, r = p.useRef(null), i = Z((s) => !s.search);
|
|
756
|
+
return !t && !i ? null : p.createElement(Q.div, { ref: he(r, a), ...n, "cmdk-separator": "", role: "separator" });
|
|
757
|
+
}), kr = p.forwardRef((e, a) => {
|
|
758
|
+
let { onValueChange: t, ...n } = e, r = e.value != null, i = Ve(), s = Z((u) => u.search), o = Z((u) => u.selectedItemId), f = pe();
|
|
731
759
|
return p.useEffect(() => {
|
|
732
760
|
e.value != null && i.setState("search", e.value);
|
|
733
|
-
}, [e.value]), p.createElement(
|
|
734
|
-
|
|
761
|
+
}, [e.value]), p.createElement(Q.input, { ref: a, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": f.listId, "aria-labelledby": f.labelId, "aria-activedescendant": o, id: f.inputId, type: "text", value: r ? e.value : s, onChange: (u) => {
|
|
762
|
+
r || i.setState("search", u.target.value), t == null || t(u.target.value);
|
|
735
763
|
} });
|
|
736
|
-
}),
|
|
737
|
-
let { children: t, label:
|
|
764
|
+
}), Ar = p.forwardRef((e, a) => {
|
|
765
|
+
let { children: t, label: n = "Suggestions", ...r } = e, i = p.useRef(null), s = p.useRef(null), o = Z((u) => u.selectedItemId), f = pe();
|
|
738
766
|
return p.useEffect(() => {
|
|
739
767
|
if (s.current && i.current) {
|
|
740
768
|
let u = s.current, g = i.current, c, v = new ResizeObserver(() => {
|
|
@@ -747,29 +775,29 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
|
|
|
747
775
|
cancelAnimationFrame(c), v.unobserve(u);
|
|
748
776
|
};
|
|
749
777
|
}
|
|
750
|
-
}, []), p.createElement(
|
|
751
|
-
}),
|
|
752
|
-
let { open: t, onOpenChange:
|
|
753
|
-
return p.createElement(
|
|
754
|
-
}),
|
|
755
|
-
let { progress: t, children:
|
|
756
|
-
return p.createElement(
|
|
757
|
-
}),
|
|
758
|
-
function
|
|
778
|
+
}, []), p.createElement(Q.div, { ref: he(i, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": o, "aria-label": n, id: f.listId }, xe(e, (u) => p.createElement("div", { ref: he(s, f.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
779
|
+
}), Dr = p.forwardRef((e, a) => {
|
|
780
|
+
let { open: t, onOpenChange: n, overlayClassName: r, contentClassName: i, container: s, ...o } = e;
|
|
781
|
+
return p.createElement(sa, { open: t, onOpenChange: n }, p.createElement(ia, { container: s }, p.createElement(oa, { "cmdk-overlay": "", className: r }), p.createElement(da, { "aria-label": e.label, "cmdk-dialog": "", className: i }, p.createElement(Nt, { ref: a, ...o }))));
|
|
782
|
+
}), Rr = p.forwardRef((e, a) => Z((t) => t.filtered.count === 0) ? p.createElement(Q.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), Pr = p.forwardRef((e, a) => {
|
|
783
|
+
let { progress: t, children: n, label: r = "Loading...", ...i } = e;
|
|
784
|
+
return p.createElement(Q.div, { ref: a, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, xe(e, (s) => p.createElement("div", { "aria-hidden": !0 }, s)));
|
|
785
|
+
}), j = Object.assign(Nt, { List: Ar, Item: Er, Input: kr, Group: Tr, Separator: Ir, Dialog: Dr, Empty: Rr, Loading: Pr });
|
|
786
|
+
function zr(e, a) {
|
|
759
787
|
let t = e.nextElementSibling;
|
|
760
788
|
for (; t; ) {
|
|
761
789
|
if (t.matches(a)) return t;
|
|
762
790
|
t = t.nextElementSibling;
|
|
763
791
|
}
|
|
764
792
|
}
|
|
765
|
-
function
|
|
793
|
+
function Fr(e, a) {
|
|
766
794
|
let t = e.previousElementSibling;
|
|
767
795
|
for (; t; ) {
|
|
768
796
|
if (t.matches(a)) return t;
|
|
769
797
|
t = t.previousElementSibling;
|
|
770
798
|
}
|
|
771
799
|
}
|
|
772
|
-
function
|
|
800
|
+
function Et(e) {
|
|
773
801
|
let a = p.useRef(e);
|
|
774
802
|
return te(() => {
|
|
775
803
|
a.current = e;
|
|
@@ -780,59 +808,59 @@ function ne(e) {
|
|
|
780
808
|
let a = p.useRef();
|
|
781
809
|
return a.current === void 0 && (a.current = e()), a;
|
|
782
810
|
}
|
|
783
|
-
function
|
|
811
|
+
function Z(e) {
|
|
784
812
|
let a = Ve(), t = () => e(a.snapshot());
|
|
785
813
|
return p.useSyncExternalStore(a.subscribe, t, t);
|
|
786
814
|
}
|
|
787
|
-
function
|
|
788
|
-
let
|
|
815
|
+
function Tt(e, a, t, n = []) {
|
|
816
|
+
let r = p.useRef(), i = pe();
|
|
789
817
|
return te(() => {
|
|
790
818
|
var s;
|
|
791
819
|
let o = (() => {
|
|
792
820
|
var u;
|
|
793
821
|
for (let g of t) {
|
|
794
822
|
if (typeof g == "string") return g.trim();
|
|
795
|
-
if (typeof g == "object" && "current" in g) return g.current ? (u = g.current.textContent) == null ? void 0 : u.trim() :
|
|
823
|
+
if (typeof g == "object" && "current" in g) return g.current ? (u = g.current.textContent) == null ? void 0 : u.trim() : r.current;
|
|
796
824
|
}
|
|
797
|
-
})(), f =
|
|
798
|
-
i.value(e, o, f), (s = a.current) == null || s.setAttribute(re, o),
|
|
799
|
-
}),
|
|
825
|
+
})(), f = n.map((u) => u.trim());
|
|
826
|
+
i.value(e, o, f), (s = a.current) == null || s.setAttribute(re, o), r.current = o;
|
|
827
|
+
}), r;
|
|
800
828
|
}
|
|
801
|
-
var
|
|
829
|
+
var Lr = () => {
|
|
802
830
|
let [e, a] = p.useState(), t = ne(() => /* @__PURE__ */ new Map());
|
|
803
831
|
return te(() => {
|
|
804
|
-
t.current.forEach((
|
|
805
|
-
}, [e]), (
|
|
806
|
-
t.current.set(
|
|
832
|
+
t.current.forEach((n) => n()), t.current = /* @__PURE__ */ new Map();
|
|
833
|
+
}, [e]), (n, r) => {
|
|
834
|
+
t.current.set(n, r), a({});
|
|
807
835
|
};
|
|
808
836
|
};
|
|
809
|
-
function
|
|
837
|
+
function _r(e) {
|
|
810
838
|
let a = e.type;
|
|
811
839
|
return typeof a == "function" ? a(e.props) : "render" in a ? a.render(e.props) : e;
|
|
812
840
|
}
|
|
813
841
|
function xe({ asChild: e, children: a }, t) {
|
|
814
|
-
return e && p.isValidElement(a) ? p.cloneElement(
|
|
842
|
+
return e && p.isValidElement(a) ? p.cloneElement(_r(a), { ref: a.ref }, t(a.props.children)) : t(a);
|
|
815
843
|
}
|
|
816
|
-
var
|
|
817
|
-
const
|
|
818
|
-
|
|
844
|
+
var Mr = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
845
|
+
const It = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
|
|
846
|
+
j,
|
|
819
847
|
{
|
|
820
848
|
ref: t,
|
|
821
|
-
className:
|
|
849
|
+
className: O(
|
|
822
850
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
823
851
|
e
|
|
824
852
|
),
|
|
825
853
|
...a
|
|
826
854
|
}
|
|
827
855
|
));
|
|
828
|
-
|
|
856
|
+
It.displayName = j.displayName;
|
|
829
857
|
const kt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
830
|
-
/* @__PURE__ */ l(
|
|
858
|
+
/* @__PURE__ */ l(ja, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
831
859
|
/* @__PURE__ */ l(
|
|
832
|
-
|
|
860
|
+
j.Input,
|
|
833
861
|
{
|
|
834
862
|
ref: t,
|
|
835
|
-
className:
|
|
863
|
+
className: O(
|
|
836
864
|
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-[hsl(var(--semaphor-placeholder-foreground))] disabled:cursor-not-allowed disabled:opacity-50",
|
|
837
865
|
e
|
|
838
866
|
),
|
|
@@ -840,74 +868,74 @@ const kt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div",
|
|
|
840
868
|
}
|
|
841
869
|
)
|
|
842
870
|
] }));
|
|
843
|
-
kt.displayName =
|
|
844
|
-
const
|
|
845
|
-
|
|
871
|
+
kt.displayName = j.Input.displayName;
|
|
872
|
+
const At = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
|
|
873
|
+
j.List,
|
|
846
874
|
{
|
|
847
875
|
ref: t,
|
|
848
|
-
className:
|
|
876
|
+
className: O("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
849
877
|
...a
|
|
850
878
|
}
|
|
851
879
|
));
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
|
|
880
|
+
At.displayName = j.List.displayName;
|
|
881
|
+
const Dt = p.forwardRef((e, a) => /* @__PURE__ */ l(
|
|
882
|
+
j.Empty,
|
|
855
883
|
{
|
|
856
884
|
ref: a,
|
|
857
885
|
className: "py-6 text-center text-sm",
|
|
858
886
|
...e
|
|
859
887
|
}
|
|
860
888
|
));
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
|
|
889
|
+
Dt.displayName = j.Empty.displayName;
|
|
890
|
+
const Oe = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
|
|
891
|
+
j.Group,
|
|
864
892
|
{
|
|
865
893
|
ref: t,
|
|
866
|
-
className:
|
|
894
|
+
className: O(
|
|
867
895
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
868
896
|
e
|
|
869
897
|
),
|
|
870
898
|
...a
|
|
871
899
|
}
|
|
872
900
|
));
|
|
873
|
-
|
|
874
|
-
const
|
|
875
|
-
|
|
901
|
+
Oe.displayName = j.Group.displayName;
|
|
902
|
+
const Rt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
|
|
903
|
+
j.Separator,
|
|
876
904
|
{
|
|
877
905
|
ref: t,
|
|
878
|
-
className:
|
|
906
|
+
className: O("-mx-1 h-px bg-border", e),
|
|
879
907
|
...a
|
|
880
908
|
}
|
|
881
909
|
));
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
|
|
910
|
+
Rt.displayName = j.Separator.displayName;
|
|
911
|
+
const Ue = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
|
|
912
|
+
j.Item,
|
|
885
913
|
{
|
|
886
914
|
ref: t,
|
|
887
|
-
className:
|
|
915
|
+
className: O(
|
|
888
916
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
|
|
889
917
|
e
|
|
890
918
|
),
|
|
891
919
|
...a
|
|
892
920
|
}
|
|
893
921
|
));
|
|
894
|
-
|
|
895
|
-
function
|
|
896
|
-
const { authToken: a, tokenProps: t } = Be(),
|
|
922
|
+
Ue.displayName = j.Item.displayName;
|
|
923
|
+
function Or(e = {}) {
|
|
924
|
+
const { authToken: a, tokenProps: t } = Be(), n = M(
|
|
897
925
|
(E) => E.actions.applyResolvedCalendarPreferences
|
|
898
|
-
),
|
|
899
|
-
|
|
900
|
-
w(null),
|
|
926
|
+
), r = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = L(!1), [u, g] = L(!1), [c, v] = L(!1), [m, x] = L(null), [I, w] = L(null), y = Y(i);
|
|
927
|
+
y.current = i, ee(() => {
|
|
928
|
+
w(null), x(null), f(!1), g(!1), v(!1);
|
|
901
929
|
}, [i]);
|
|
902
|
-
const
|
|
903
|
-
const b =
|
|
930
|
+
const P = $(async (E) => {
|
|
931
|
+
const b = Ba(await E.json());
|
|
904
932
|
if (!b.ok)
|
|
905
933
|
throw new Error("Calendar preferences response is invalid");
|
|
906
934
|
return b.value;
|
|
907
|
-
}, []),
|
|
908
|
-
if (!
|
|
935
|
+
}, []), F = $(async () => {
|
|
936
|
+
if (!r || !i || !s) return;
|
|
909
937
|
const E = i;
|
|
910
|
-
f(!0),
|
|
938
|
+
f(!0), x(null);
|
|
911
939
|
try {
|
|
912
940
|
const b = await fetch(
|
|
913
941
|
`${s}/v1/user-preferences/calendar`,
|
|
@@ -920,25 +948,25 @@ function Fr(e = {}) {
|
|
|
920
948
|
const R = await b.json().catch(() => ({}));
|
|
921
949
|
throw new Error(R.error || "Failed to fetch preferences");
|
|
922
950
|
}
|
|
923
|
-
const
|
|
924
|
-
|
|
951
|
+
const N = await P(b);
|
|
952
|
+
y.current === E && w(N);
|
|
925
953
|
} catch (b) {
|
|
926
|
-
|
|
954
|
+
y.current === E && x(b instanceof Error ? b.message : "Unknown error");
|
|
927
955
|
} finally {
|
|
928
|
-
|
|
956
|
+
y.current === E && f(!1);
|
|
929
957
|
}
|
|
930
|
-
}, [i, s,
|
|
958
|
+
}, [i, s, r, P]);
|
|
931
959
|
ee(() => {
|
|
932
|
-
|
|
933
|
-
}, [
|
|
960
|
+
r && F();
|
|
961
|
+
}, [r, F]);
|
|
934
962
|
const U = $(
|
|
935
963
|
async (E) => {
|
|
936
964
|
if (!i || !s)
|
|
937
|
-
return
|
|
965
|
+
return x("Not authenticated"), !1;
|
|
938
966
|
const b = i;
|
|
939
|
-
g(!0),
|
|
967
|
+
g(!0), x(null);
|
|
940
968
|
try {
|
|
941
|
-
const
|
|
969
|
+
const N = await fetch(
|
|
942
970
|
`${s}/v1/user-preferences/calendar`,
|
|
943
971
|
{
|
|
944
972
|
method: "PATCH",
|
|
@@ -949,29 +977,29 @@ function Fr(e = {}) {
|
|
|
949
977
|
body: JSON.stringify(E)
|
|
950
978
|
}
|
|
951
979
|
);
|
|
952
|
-
if (!
|
|
953
|
-
const
|
|
954
|
-
throw new Error(
|
|
980
|
+
if (!N.ok) {
|
|
981
|
+
const C = await N.json().catch(() => ({}));
|
|
982
|
+
throw new Error(C.error || "Failed to update preferences");
|
|
955
983
|
}
|
|
956
|
-
const R = await
|
|
957
|
-
return
|
|
958
|
-
} catch (
|
|
959
|
-
return
|
|
984
|
+
const R = await P(N);
|
|
985
|
+
return y.current !== b ? !1 : (w(R), n(R.resolved, R.sources), !0);
|
|
986
|
+
} catch (N) {
|
|
987
|
+
return y.current === b && x(N instanceof Error ? N.message : "Unknown error"), !1;
|
|
960
988
|
} finally {
|
|
961
|
-
|
|
989
|
+
y.current === b && g(!1);
|
|
962
990
|
}
|
|
963
991
|
},
|
|
964
992
|
[
|
|
965
993
|
i,
|
|
966
994
|
s,
|
|
967
|
-
|
|
968
|
-
|
|
995
|
+
n,
|
|
996
|
+
P
|
|
969
997
|
]
|
|
970
998
|
), _ = $(async () => {
|
|
971
999
|
if (!i || !s)
|
|
972
|
-
return
|
|
1000
|
+
return x("Not authenticated"), !1;
|
|
973
1001
|
const E = i;
|
|
974
|
-
v(!0),
|
|
1002
|
+
v(!0), x(null);
|
|
975
1003
|
try {
|
|
976
1004
|
const b = await fetch(
|
|
977
1005
|
`${s}/v1/user-preferences/calendar`,
|
|
@@ -984,28 +1012,28 @@ function Fr(e = {}) {
|
|
|
984
1012
|
const R = await b.json().catch(() => ({}));
|
|
985
1013
|
throw new Error(R.error || "Failed to clear preferences");
|
|
986
1014
|
}
|
|
987
|
-
const
|
|
988
|
-
return
|
|
1015
|
+
const N = await P(b);
|
|
1016
|
+
return y.current !== E ? !1 : (w(N), n(N.resolved, N.sources), !0);
|
|
989
1017
|
} catch (b) {
|
|
990
|
-
return
|
|
1018
|
+
return y.current === E && x(b instanceof Error ? b.message : "Unknown error"), !1;
|
|
991
1019
|
} finally {
|
|
992
|
-
|
|
1020
|
+
y.current === E && v(!1);
|
|
993
1021
|
}
|
|
994
1022
|
}, [
|
|
995
1023
|
i,
|
|
996
1024
|
s,
|
|
997
|
-
|
|
998
|
-
|
|
1025
|
+
n,
|
|
1026
|
+
P
|
|
999
1027
|
]);
|
|
1000
1028
|
return {
|
|
1001
|
-
preferences:
|
|
1029
|
+
preferences: I,
|
|
1002
1030
|
isLoading: o,
|
|
1003
1031
|
isSaving: u,
|
|
1004
1032
|
isClearing: c,
|
|
1005
1033
|
error: m,
|
|
1006
1034
|
updatePreferences: U,
|
|
1007
1035
|
clearPreferences: _,
|
|
1008
|
-
refetch:
|
|
1036
|
+
refetch: F
|
|
1009
1037
|
};
|
|
1010
1038
|
}
|
|
1011
1039
|
const we = [
|
|
@@ -1023,12 +1051,12 @@ const we = [
|
|
|
1023
1051
|
{ value: "Asia/Kolkata", label: "Mumbai, New Delhi" },
|
|
1024
1052
|
{ value: "Australia/Sydney", label: "Sydney" },
|
|
1025
1053
|
{ value: "UTC", label: "UTC" }
|
|
1026
|
-
],
|
|
1054
|
+
], Pt = [
|
|
1027
1055
|
{ value: 0, label: "Sunday" },
|
|
1028
1056
|
{ value: 1, label: "Monday" },
|
|
1029
1057
|
{ value: 6, label: "Saturday" }
|
|
1030
1058
|
], it = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
1031
|
-
function
|
|
1059
|
+
function Ur() {
|
|
1032
1060
|
try {
|
|
1033
1061
|
const e = Intl;
|
|
1034
1062
|
if (e.supportedValuesOf)
|
|
@@ -1037,7 +1065,7 @@ function Lr() {
|
|
|
1037
1065
|
}
|
|
1038
1066
|
return we.map((e) => e.value);
|
|
1039
1067
|
}
|
|
1040
|
-
function
|
|
1068
|
+
function Wr(e) {
|
|
1041
1069
|
if (!e) return "default";
|
|
1042
1070
|
if (e.tz !== e.weekStart) return "inherited";
|
|
1043
1071
|
switch (e.tz) {
|
|
@@ -1057,39 +1085,39 @@ function ot(e) {
|
|
|
1057
1085
|
const a = we.find((t) => t.value === e);
|
|
1058
1086
|
return a ? a.label : e;
|
|
1059
1087
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const a =
|
|
1088
|
+
function jr(e) {
|
|
1089
|
+
const a = Pt.find((t) => t.value === e);
|
|
1062
1090
|
return a ? a.label : String(e);
|
|
1063
1091
|
}
|
|
1064
|
-
function
|
|
1092
|
+
function Br({
|
|
1065
1093
|
active: e,
|
|
1066
1094
|
onClose: a
|
|
1067
1095
|
}) {
|
|
1068
1096
|
const {
|
|
1069
1097
|
preferences: t,
|
|
1070
|
-
isLoading:
|
|
1071
|
-
isSaving:
|
|
1098
|
+
isLoading: n,
|
|
1099
|
+
isSaving: r,
|
|
1072
1100
|
isClearing: i,
|
|
1073
1101
|
updatePreferences: s,
|
|
1074
1102
|
clearPreferences: o
|
|
1075
|
-
} =
|
|
1103
|
+
} = Or({ enabled: e }), f = mt(), u = (t == null ? void 0 : t.resolved.tz) || (f == null ? void 0 : f.tz) || "UTC", g = (t == null ? void 0 : t.resolved.weekStart) ?? (f == null ? void 0 : f.weekStart) ?? 1, [c, v] = L((t == null ? void 0 : t.stored) === null), [m, x] = L(!1), [I, w] = L(
|
|
1076
1104
|
u
|
|
1077
|
-
), [
|
|
1105
|
+
), [y, P] = L(
|
|
1078
1106
|
g
|
|
1079
|
-
), [
|
|
1107
|
+
), [F, U] = L(!1), _ = q(() => Ur(), []), E = q(
|
|
1080
1108
|
() => _.filter(
|
|
1081
|
-
(
|
|
1109
|
+
(k) => !we.some((de) => de.value === k)
|
|
1082
1110
|
),
|
|
1083
1111
|
[_]
|
|
1084
|
-
), b =
|
|
1112
|
+
), b = q(() => ot(I), [I]), N = t != null && t.inherited ? ot(t.inherited.tz) : "UTC", R = t != null && t.inherited ? jr(t.inherited.weekStart) : "Monday", C = Wr(
|
|
1085
1113
|
t == null ? void 0 : t.inheritedSources
|
|
1086
1114
|
);
|
|
1087
|
-
|
|
1115
|
+
Lt.useEffect(() => {
|
|
1088
1116
|
if (!e) {
|
|
1089
|
-
|
|
1117
|
+
x(!1);
|
|
1090
1118
|
return;
|
|
1091
1119
|
}
|
|
1092
|
-
m || (t && v(t.stored === null), w(u),
|
|
1120
|
+
m || (t && v(t.stored === null), w(u), P(g));
|
|
1093
1121
|
}, [
|
|
1094
1122
|
e,
|
|
1095
1123
|
m,
|
|
@@ -1097,26 +1125,26 @@ function Ur({
|
|
|
1097
1125
|
u,
|
|
1098
1126
|
g
|
|
1099
1127
|
]);
|
|
1100
|
-
const
|
|
1101
|
-
if (
|
|
1128
|
+
const G = async () => {
|
|
1129
|
+
if (n) {
|
|
1102
1130
|
H.error("Preferences are still loading. Please try again.");
|
|
1103
1131
|
return;
|
|
1104
1132
|
}
|
|
1105
1133
|
c ? await o() ? (H.success("Now using default settings."), a()) : H.error("Failed to save preferences. Please try again.") : await s({
|
|
1106
|
-
tz:
|
|
1107
|
-
weekStart:
|
|
1134
|
+
tz: I,
|
|
1135
|
+
weekStart: y
|
|
1108
1136
|
}) ? (H.success("Preferences saved."), a()) : H.error("Failed to save preferences. Please try again.");
|
|
1109
1137
|
}, K = () => {
|
|
1110
1138
|
a();
|
|
1111
|
-
}, ae =
|
|
1139
|
+
}, ae = r || i, X = ae || n;
|
|
1112
1140
|
return /* @__PURE__ */ h(ie, { children: [
|
|
1113
1141
|
/* @__PURE__ */ h("div", { className: "space-y-4 py-1", children: [
|
|
1114
1142
|
/* @__PURE__ */ h(
|
|
1115
1143
|
Ye,
|
|
1116
1144
|
{
|
|
1117
1145
|
value: c ? "defaults" : "custom",
|
|
1118
|
-
onValueChange: (
|
|
1119
|
-
|
|
1146
|
+
onValueChange: (k) => {
|
|
1147
|
+
x(!0), v(k === "defaults");
|
|
1120
1148
|
},
|
|
1121
1149
|
className: "space-y-0.5",
|
|
1122
1150
|
children: [
|
|
@@ -1124,12 +1152,12 @@ function Ur({
|
|
|
1124
1152
|
"label",
|
|
1125
1153
|
{
|
|
1126
1154
|
htmlFor: "mode-defaults",
|
|
1127
|
-
className:
|
|
1155
|
+
className: O(
|
|
1128
1156
|
"flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
|
|
1129
1157
|
c && "bg-muted/50"
|
|
1130
1158
|
),
|
|
1131
1159
|
onClick: () => {
|
|
1132
|
-
|
|
1160
|
+
x(!0), v(!0);
|
|
1133
1161
|
},
|
|
1134
1162
|
children: [
|
|
1135
1163
|
/* @__PURE__ */ l(
|
|
@@ -1143,11 +1171,11 @@ function Ur({
|
|
|
1143
1171
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
|
|
1144
1172
|
/* @__PURE__ */ h("p", { className: "text-[13px] font-medium text-foreground", children: [
|
|
1145
1173
|
"Use ",
|
|
1146
|
-
|
|
1174
|
+
C,
|
|
1147
1175
|
" defaults"
|
|
1148
1176
|
] }),
|
|
1149
1177
|
/* @__PURE__ */ h("p", { className: "text-[12px] text-muted-foreground", children: [
|
|
1150
|
-
|
|
1178
|
+
N,
|
|
1151
1179
|
", week starts ",
|
|
1152
1180
|
R
|
|
1153
1181
|
] })
|
|
@@ -1159,12 +1187,12 @@ function Ur({
|
|
|
1159
1187
|
"label",
|
|
1160
1188
|
{
|
|
1161
1189
|
htmlFor: "mode-custom",
|
|
1162
|
-
className:
|
|
1190
|
+
className: O(
|
|
1163
1191
|
"flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
|
|
1164
1192
|
!c && "bg-muted/50"
|
|
1165
1193
|
),
|
|
1166
1194
|
onClick: () => {
|
|
1167
|
-
|
|
1195
|
+
x(!0), v(!1);
|
|
1168
1196
|
},
|
|
1169
1197
|
children: [
|
|
1170
1198
|
/* @__PURE__ */ l(
|
|
@@ -1185,7 +1213,7 @@ function Ur({
|
|
|
1185
1213
|
/* @__PURE__ */ h(
|
|
1186
1214
|
"div",
|
|
1187
1215
|
{
|
|
1188
|
-
className:
|
|
1216
|
+
className: O(
|
|
1189
1217
|
"space-y-4 border-t border-border/60 pt-4 transition-opacity",
|
|
1190
1218
|
c && "pointer-events-none opacity-50"
|
|
1191
1219
|
),
|
|
@@ -1193,19 +1221,19 @@ function Ur({
|
|
|
1193
1221
|
/* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1194
1222
|
/* @__PURE__ */ l(oe, { className: it, children: "Timezone" }),
|
|
1195
1223
|
/* @__PURE__ */ h(
|
|
1196
|
-
|
|
1224
|
+
za,
|
|
1197
1225
|
{
|
|
1198
|
-
open:
|
|
1226
|
+
open: F,
|
|
1199
1227
|
onOpenChange: U,
|
|
1200
1228
|
modal: !0,
|
|
1201
1229
|
children: [
|
|
1202
|
-
/* @__PURE__ */ l(
|
|
1230
|
+
/* @__PURE__ */ l(Fa, { asChild: !0, children: /* @__PURE__ */ h(
|
|
1203
1231
|
V,
|
|
1204
1232
|
{
|
|
1205
1233
|
variant: "outline",
|
|
1206
1234
|
size: "xs",
|
|
1207
1235
|
role: "combobox",
|
|
1208
|
-
"aria-expanded":
|
|
1236
|
+
"aria-expanded": F,
|
|
1209
1237
|
className: "w-full justify-between text-[12px] font-normal",
|
|
1210
1238
|
disabled: c,
|
|
1211
1239
|
children: [
|
|
@@ -1215,59 +1243,59 @@ function Ur({
|
|
|
1215
1243
|
}
|
|
1216
1244
|
) }),
|
|
1217
1245
|
/* @__PURE__ */ l(
|
|
1218
|
-
|
|
1246
|
+
La,
|
|
1219
1247
|
{
|
|
1220
1248
|
className: "z-50 w-[--radix-popover-trigger-width] p-0",
|
|
1221
1249
|
align: "start",
|
|
1222
|
-
children: /* @__PURE__ */ h(
|
|
1250
|
+
children: /* @__PURE__ */ h(It, { className: "overflow-visible", children: [
|
|
1223
1251
|
/* @__PURE__ */ l(kt, { placeholder: "Search timezones…" }),
|
|
1224
|
-
/* @__PURE__ */ h(
|
|
1225
|
-
/* @__PURE__ */ l(
|
|
1226
|
-
/* @__PURE__ */ l(
|
|
1227
|
-
|
|
1252
|
+
/* @__PURE__ */ h(At, { children: [
|
|
1253
|
+
/* @__PURE__ */ l(Dt, { children: "No timezone found." }),
|
|
1254
|
+
/* @__PURE__ */ l(Oe, { heading: "Common", children: we.map((k) => /* @__PURE__ */ h(
|
|
1255
|
+
Ue,
|
|
1228
1256
|
{
|
|
1229
|
-
value: `${
|
|
1257
|
+
value: `${k.value} ${k.label}`,
|
|
1230
1258
|
onSelect: () => {
|
|
1231
|
-
|
|
1259
|
+
x(!0), w(k.value), U(!1);
|
|
1232
1260
|
},
|
|
1233
1261
|
children: [
|
|
1234
1262
|
/* @__PURE__ */ l(
|
|
1235
1263
|
Ze,
|
|
1236
1264
|
{
|
|
1237
|
-
className:
|
|
1265
|
+
className: O(
|
|
1238
1266
|
"h-3.5 w-3.5",
|
|
1239
|
-
|
|
1267
|
+
I === k.value ? "opacity-100" : "opacity-0"
|
|
1240
1268
|
)
|
|
1241
1269
|
}
|
|
1242
1270
|
),
|
|
1243
|
-
/* @__PURE__ */ l("span", { className: "flex-1", children:
|
|
1244
|
-
/* @__PURE__ */ l("span", { className: "text-[11px] text-muted-foreground", children:
|
|
1271
|
+
/* @__PURE__ */ l("span", { className: "flex-1", children: k.label }),
|
|
1272
|
+
/* @__PURE__ */ l("span", { className: "text-[11px] text-muted-foreground", children: k.value })
|
|
1245
1273
|
]
|
|
1246
1274
|
},
|
|
1247
|
-
|
|
1275
|
+
k.value
|
|
1248
1276
|
)) }),
|
|
1249
|
-
/* @__PURE__ */ l(
|
|
1250
|
-
/* @__PURE__ */ l(
|
|
1251
|
-
|
|
1277
|
+
/* @__PURE__ */ l(Rt, {}),
|
|
1278
|
+
/* @__PURE__ */ l(Oe, { heading: "All timezones", children: E.map((k) => /* @__PURE__ */ h(
|
|
1279
|
+
Ue,
|
|
1252
1280
|
{
|
|
1253
|
-
value:
|
|
1281
|
+
value: k,
|
|
1254
1282
|
onSelect: () => {
|
|
1255
|
-
|
|
1283
|
+
x(!0), w(k), U(!1);
|
|
1256
1284
|
},
|
|
1257
1285
|
children: [
|
|
1258
1286
|
/* @__PURE__ */ l(
|
|
1259
1287
|
Ze,
|
|
1260
1288
|
{
|
|
1261
|
-
className:
|
|
1289
|
+
className: O(
|
|
1262
1290
|
"h-3.5 w-3.5",
|
|
1263
|
-
|
|
1291
|
+
I === k ? "opacity-100" : "opacity-0"
|
|
1264
1292
|
)
|
|
1265
1293
|
}
|
|
1266
1294
|
),
|
|
1267
|
-
|
|
1295
|
+
k
|
|
1268
1296
|
]
|
|
1269
1297
|
},
|
|
1270
|
-
|
|
1298
|
+
k
|
|
1271
1299
|
)) })
|
|
1272
1300
|
] })
|
|
1273
1301
|
] })
|
|
@@ -1282,17 +1310,17 @@ function Ur({
|
|
|
1282
1310
|
/* @__PURE__ */ l(
|
|
1283
1311
|
Ye,
|
|
1284
1312
|
{
|
|
1285
|
-
value: String(
|
|
1286
|
-
onValueChange: (
|
|
1287
|
-
|
|
1313
|
+
value: String(y),
|
|
1314
|
+
onValueChange: (k) => {
|
|
1315
|
+
x(!0), P(Number(k));
|
|
1288
1316
|
},
|
|
1289
1317
|
className: "flex gap-4",
|
|
1290
1318
|
disabled: c,
|
|
1291
|
-
children:
|
|
1319
|
+
children: Pt.map((k) => /* @__PURE__ */ h(
|
|
1292
1320
|
"label",
|
|
1293
1321
|
{
|
|
1294
|
-
htmlFor: `week-start-${
|
|
1295
|
-
className:
|
|
1322
|
+
htmlFor: `week-start-${k.value}`,
|
|
1323
|
+
className: O(
|
|
1296
1324
|
"flex cursor-pointer items-center gap-2 text-[13px]",
|
|
1297
1325
|
c && "cursor-not-allowed"
|
|
1298
1326
|
),
|
|
@@ -1300,15 +1328,15 @@ function Ur({
|
|
|
1300
1328
|
/* @__PURE__ */ l(
|
|
1301
1329
|
Ne,
|
|
1302
1330
|
{
|
|
1303
|
-
value: String(
|
|
1304
|
-
id: `week-start-${
|
|
1331
|
+
value: String(k.value),
|
|
1332
|
+
id: `week-start-${k.value}`,
|
|
1305
1333
|
disabled: c
|
|
1306
1334
|
}
|
|
1307
1335
|
),
|
|
1308
|
-
|
|
1336
|
+
k.label
|
|
1309
1337
|
]
|
|
1310
1338
|
},
|
|
1311
|
-
|
|
1339
|
+
k.value
|
|
1312
1340
|
))
|
|
1313
1341
|
}
|
|
1314
1342
|
)
|
|
@@ -1328,29 +1356,29 @@ function Ur({
|
|
|
1328
1356
|
children: "Cancel"
|
|
1329
1357
|
}
|
|
1330
1358
|
),
|
|
1331
|
-
/* @__PURE__ */ l(V, { size: "xs", onClick:
|
|
1332
|
-
/* @__PURE__ */ l(
|
|
1359
|
+
/* @__PURE__ */ l(V, { size: "xs", onClick: G, disabled: X, children: ae ? /* @__PURE__ */ h(ie, { children: [
|
|
1360
|
+
/* @__PURE__ */ l(vt, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1333
1361
|
"Saving…"
|
|
1334
1362
|
] }) : "Save" })
|
|
1335
1363
|
] })
|
|
1336
1364
|
] });
|
|
1337
1365
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const { authToken: a, tokenProps: t } = Be(),
|
|
1366
|
+
function $r(e = {}) {
|
|
1367
|
+
const { authToken: a, tokenProps: t } = Be(), n = M(
|
|
1340
1368
|
(b) => b.actions.applyResolvedValueFormatPreferences
|
|
1341
|
-
),
|
|
1369
|
+
), r = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = Y(i);
|
|
1342
1370
|
o.current = i;
|
|
1343
|
-
const [f, u] =
|
|
1371
|
+
const [f, u] = L(null), [g, c] = L(!1), [v, m] = L(!1), [x, I] = L(!1), [w, y] = L(null);
|
|
1344
1372
|
ee(() => {
|
|
1345
|
-
u(null),
|
|
1373
|
+
u(null), y(null), c(!1), m(!1), I(!1);
|
|
1346
1374
|
}, [i]);
|
|
1347
|
-
const
|
|
1348
|
-
const
|
|
1349
|
-
if (!
|
|
1375
|
+
const P = $(async (b) => {
|
|
1376
|
+
const N = ga(await b.json());
|
|
1377
|
+
if (!N.ok)
|
|
1350
1378
|
throw new Error("Value format preferences response is invalid");
|
|
1351
|
-
return
|
|
1352
|
-
}, []),
|
|
1353
|
-
async (b,
|
|
1379
|
+
return N.value;
|
|
1380
|
+
}, []), F = $(
|
|
1381
|
+
async (b, N) => {
|
|
1354
1382
|
if (!i || !s)
|
|
1355
1383
|
throw new Error("Not authenticated");
|
|
1356
1384
|
const R = await fetch(
|
|
@@ -1359,72 +1387,72 @@ function Or(e = {}) {
|
|
|
1359
1387
|
method: b,
|
|
1360
1388
|
headers: {
|
|
1361
1389
|
Authorization: `Bearer ${i}`,
|
|
1362
|
-
...
|
|
1390
|
+
...N ? { "Content-Type": "application/json" } : {}
|
|
1363
1391
|
},
|
|
1364
|
-
body:
|
|
1392
|
+
body: N ? JSON.stringify(N) : void 0
|
|
1365
1393
|
}
|
|
1366
1394
|
);
|
|
1367
1395
|
if (!R.ok) {
|
|
1368
|
-
const
|
|
1369
|
-
throw new Error(
|
|
1396
|
+
const C = await R.json().catch(() => ({}));
|
|
1397
|
+
throw new Error(C.error || "Failed to update preferences");
|
|
1370
1398
|
}
|
|
1371
|
-
return
|
|
1399
|
+
return P(R);
|
|
1372
1400
|
},
|
|
1373
|
-
[i, s,
|
|
1401
|
+
[i, s, P]
|
|
1374
1402
|
), U = $(async () => {
|
|
1375
|
-
if (!
|
|
1403
|
+
if (!r || !i || !s) return;
|
|
1376
1404
|
const b = i;
|
|
1377
|
-
c(!0),
|
|
1405
|
+
c(!0), y(null);
|
|
1378
1406
|
try {
|
|
1379
|
-
const
|
|
1380
|
-
o.current === b && u(
|
|
1381
|
-
} catch (
|
|
1382
|
-
o.current === b &&
|
|
1407
|
+
const N = await F("GET");
|
|
1408
|
+
o.current === b && u(N);
|
|
1409
|
+
} catch (N) {
|
|
1410
|
+
o.current === b && y(N instanceof Error ? N.message : "Unknown error");
|
|
1383
1411
|
} finally {
|
|
1384
1412
|
o.current === b && c(!1);
|
|
1385
1413
|
}
|
|
1386
|
-
}, [i, s,
|
|
1414
|
+
}, [i, s, r, F]);
|
|
1387
1415
|
ee(() => {
|
|
1388
|
-
|
|
1389
|
-
}, [
|
|
1416
|
+
r && U();
|
|
1417
|
+
}, [r, U]);
|
|
1390
1418
|
const _ = $(
|
|
1391
1419
|
async (b) => {
|
|
1392
|
-
const
|
|
1393
|
-
m(!0),
|
|
1420
|
+
const N = i;
|
|
1421
|
+
m(!0), y(null);
|
|
1394
1422
|
try {
|
|
1395
|
-
const R = await
|
|
1396
|
-
return o.current !==
|
|
1423
|
+
const R = await F("PATCH", b);
|
|
1424
|
+
return o.current !== N ? !1 : (u(R), n(R.resolved, R.sources), !0);
|
|
1397
1425
|
} catch (R) {
|
|
1398
|
-
return o.current ===
|
|
1426
|
+
return o.current === N && y(R instanceof Error ? R.message : "Unknown error"), !1;
|
|
1399
1427
|
} finally {
|
|
1400
|
-
o.current ===
|
|
1428
|
+
o.current === N && m(!1);
|
|
1401
1429
|
}
|
|
1402
1430
|
},
|
|
1403
|
-
[i,
|
|
1431
|
+
[i, n, F]
|
|
1404
1432
|
), E = $(async () => {
|
|
1405
1433
|
const b = i;
|
|
1406
|
-
|
|
1434
|
+
I(!0), y(null);
|
|
1407
1435
|
try {
|
|
1408
|
-
const
|
|
1409
|
-
return o.current !== b ? !1 : (u(
|
|
1410
|
-
} catch (
|
|
1411
|
-
return o.current === b &&
|
|
1436
|
+
const N = await F("DELETE");
|
|
1437
|
+
return o.current !== b ? !1 : (u(N), n(N.resolved, N.sources), !0);
|
|
1438
|
+
} catch (N) {
|
|
1439
|
+
return o.current === b && y(N instanceof Error ? N.message : "Unknown error"), !1;
|
|
1412
1440
|
} finally {
|
|
1413
|
-
o.current === b &&
|
|
1441
|
+
o.current === b && I(!1);
|
|
1414
1442
|
}
|
|
1415
|
-
}, [i,
|
|
1443
|
+
}, [i, n, F]);
|
|
1416
1444
|
return {
|
|
1417
1445
|
preferences: f,
|
|
1418
1446
|
isLoading: g,
|
|
1419
1447
|
isSaving: v,
|
|
1420
|
-
isClearing:
|
|
1448
|
+
isClearing: x,
|
|
1421
1449
|
error: w,
|
|
1422
1450
|
updatePreferences: _,
|
|
1423
1451
|
clearPreferences: E,
|
|
1424
1452
|
refetch: U
|
|
1425
1453
|
};
|
|
1426
1454
|
}
|
|
1427
|
-
const
|
|
1455
|
+
const We = [
|
|
1428
1456
|
{ value: "en-US", label: "English (United States)" },
|
|
1429
1457
|
{ value: "en-GB", label: "English (United Kingdom)" },
|
|
1430
1458
|
{ value: "de-DE", label: "German (Germany)" },
|
|
@@ -1437,7 +1465,7 @@ const je = [
|
|
|
1437
1465
|
{ value: "en-IN", label: "English (India)" },
|
|
1438
1466
|
{ value: "en-NZ", label: "English (New Zealand)" },
|
|
1439
1467
|
{ value: "mi-NZ", label: "Māori (New Zealand)" }
|
|
1440
|
-
],
|
|
1468
|
+
], zt = /* @__PURE__ */ new Set([
|
|
1441
1469
|
"USD",
|
|
1442
1470
|
"EUR",
|
|
1443
1471
|
"GBP",
|
|
@@ -1448,14 +1476,14 @@ const je = [
|
|
|
1448
1476
|
"INR",
|
|
1449
1477
|
"BRL",
|
|
1450
1478
|
"KWD"
|
|
1451
|
-
]),
|
|
1452
|
-
(e) => !
|
|
1453
|
-
),
|
|
1479
|
+
]), Vr = ya(), Kr = Vr.filter(
|
|
1480
|
+
(e) => !zt.has(e)
|
|
1481
|
+
), Ft = [
|
|
1454
1482
|
{ value: "short", label: "Short" },
|
|
1455
1483
|
{ value: "medium", label: "Medium" },
|
|
1456
1484
|
{ value: "long", label: "Long" }
|
|
1457
|
-
], dt = "2026-07-31",
|
|
1458
|
-
function
|
|
1485
|
+
], dt = "2026-07-31", ke = "2026-07-31T14:30:45";
|
|
1486
|
+
function je(e) {
|
|
1459
1487
|
switch (e) {
|
|
1460
1488
|
case "viewer_user":
|
|
1461
1489
|
return "user";
|
|
@@ -1475,10 +1503,10 @@ function We(e) {
|
|
|
1475
1503
|
}
|
|
1476
1504
|
function Ae(e) {
|
|
1477
1505
|
var a;
|
|
1478
|
-
return ((a =
|
|
1506
|
+
return ((a = Ft.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
|
|
1479
1507
|
}
|
|
1480
|
-
function
|
|
1481
|
-
const a =
|
|
1508
|
+
function Hr(e) {
|
|
1509
|
+
const a = We.find((t) => t.value === e);
|
|
1482
1510
|
return a ? `${a.label} — ${a.value}` : e;
|
|
1483
1511
|
}
|
|
1484
1512
|
function De(e) {
|
|
@@ -1492,13 +1520,13 @@ function Re({
|
|
|
1492
1520
|
id: e,
|
|
1493
1521
|
label: a,
|
|
1494
1522
|
value: t,
|
|
1495
|
-
inherited:
|
|
1496
|
-
inheritedSource:
|
|
1523
|
+
inherited: n,
|
|
1524
|
+
inheritedSource: r,
|
|
1497
1525
|
examples: i,
|
|
1498
1526
|
disabled: s,
|
|
1499
1527
|
onValueChange: o
|
|
1500
1528
|
}) {
|
|
1501
|
-
const f = t === void 0 ? `Inherited · ${Ae(
|
|
1529
|
+
const f = t === void 0 ? `Inherited · ${Ae(n)}` : Ae(t);
|
|
1502
1530
|
return /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1503
1531
|
/* @__PURE__ */ l(oe, { htmlFor: e, className: "text-[11px] text-muted-foreground", children: a }),
|
|
1504
1532
|
/* @__PURE__ */ h(
|
|
@@ -1510,18 +1538,18 @@ function Re({
|
|
|
1510
1538
|
children: [
|
|
1511
1539
|
/* @__PURE__ */ l(ze, { id: e, size: "xs", children: /* @__PURE__ */ l(Fe, { children: f }) }),
|
|
1512
1540
|
/* @__PURE__ */ h(Le, { children: [
|
|
1513
|
-
/* @__PURE__ */ l(
|
|
1541
|
+
/* @__PURE__ */ l(J, { value: "inherit", className: "[&>span:last-child]:w-full", children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
|
|
1514
1542
|
/* @__PURE__ */ h("span", { children: [
|
|
1515
1543
|
"Inherited from ",
|
|
1516
|
-
|
|
1544
|
+
je(r),
|
|
1517
1545
|
" ·",
|
|
1518
1546
|
" ",
|
|
1519
|
-
Ae(
|
|
1547
|
+
Ae(n)
|
|
1520
1548
|
] }),
|
|
1521
|
-
/* @__PURE__ */ l("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: i[
|
|
1549
|
+
/* @__PURE__ */ l("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: i[n] })
|
|
1522
1550
|
] }) }),
|
|
1523
|
-
|
|
1524
|
-
|
|
1551
|
+
Ft.map((u) => /* @__PURE__ */ l(
|
|
1552
|
+
J,
|
|
1525
1553
|
{
|
|
1526
1554
|
value: u.value,
|
|
1527
1555
|
className: "[&>span:last-child]:w-full",
|
|
@@ -1538,14 +1566,14 @@ function Re({
|
|
|
1538
1566
|
)
|
|
1539
1567
|
] });
|
|
1540
1568
|
}
|
|
1541
|
-
function
|
|
1569
|
+
function qr({
|
|
1542
1570
|
value: e,
|
|
1543
1571
|
inherited: a,
|
|
1544
1572
|
inheritedSources: t,
|
|
1545
|
-
onChange:
|
|
1546
|
-
disabled:
|
|
1573
|
+
onChange: n,
|
|
1574
|
+
disabled: r
|
|
1547
1575
|
}) {
|
|
1548
|
-
var E, b,
|
|
1576
|
+
var E, b, N, R;
|
|
1549
1577
|
const i = ce(), s = ce(), o = ce(), f = ce(), u = ce(), c = (e.locale === void 0 ? void 0 : pt(e.locale)) ?? a.locale, v = e.defaultCurrency ?? a.defaultCurrency, m = {
|
|
1550
1578
|
locale: c,
|
|
1551
1579
|
dateStyle: e.dateStyle ?? a.dateStyle,
|
|
@@ -1554,59 +1582,59 @@ function $r({
|
|
|
1554
1582
|
timeStyle: ((b = e.dateTime) == null ? void 0 : b.timeStyle) ?? a.dateTime.timeStyle
|
|
1555
1583
|
},
|
|
1556
1584
|
defaultCurrency: v
|
|
1557
|
-
},
|
|
1585
|
+
}, x = new Intl.NumberFormat(c, {
|
|
1558
1586
|
style: "currency",
|
|
1559
1587
|
currency: v
|
|
1560
|
-
}).format(1e3),
|
|
1588
|
+
}).format(1e3), I = ge({
|
|
1561
1589
|
preferences: m,
|
|
1562
1590
|
calendar: { tz: "UTC" }
|
|
1563
1591
|
}), w = ue({
|
|
1564
1592
|
value: dt,
|
|
1565
1593
|
metadata: { kind: "raw_temporal", valueKind: "date" },
|
|
1566
|
-
format:
|
|
1567
|
-
}).text,
|
|
1568
|
-
value:
|
|
1594
|
+
format: I
|
|
1595
|
+
}).text, y = ue({
|
|
1596
|
+
value: ke,
|
|
1569
1597
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1570
|
-
format:
|
|
1571
|
-
}).text,
|
|
1572
|
-
(
|
|
1598
|
+
format: I
|
|
1599
|
+
}).text, P = De(
|
|
1600
|
+
(C) => ue({
|
|
1573
1601
|
value: dt,
|
|
1574
1602
|
metadata: { kind: "raw_temporal", valueKind: "date" },
|
|
1575
1603
|
format: ge({
|
|
1576
|
-
preferences: { ...m, dateStyle:
|
|
1604
|
+
preferences: { ...m, dateStyle: C },
|
|
1577
1605
|
calendar: { tz: "UTC" }
|
|
1578
1606
|
})
|
|
1579
1607
|
}).text
|
|
1580
|
-
),
|
|
1581
|
-
(
|
|
1582
|
-
value:
|
|
1608
|
+
), F = De(
|
|
1609
|
+
(C) => ue({
|
|
1610
|
+
value: ke,
|
|
1583
1611
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1584
1612
|
format: ge({
|
|
1585
1613
|
preferences: {
|
|
1586
1614
|
...m,
|
|
1587
|
-
dateTime: { ...m.dateTime, dateStyle:
|
|
1615
|
+
dateTime: { ...m.dateTime, dateStyle: C }
|
|
1588
1616
|
},
|
|
1589
1617
|
calendar: { tz: "UTC" }
|
|
1590
1618
|
})
|
|
1591
1619
|
}).text
|
|
1592
1620
|
), U = De(
|
|
1593
|
-
(
|
|
1594
|
-
value:
|
|
1621
|
+
(C) => ue({
|
|
1622
|
+
value: ke,
|
|
1595
1623
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1596
1624
|
format: ge({
|
|
1597
1625
|
preferences: {
|
|
1598
1626
|
...m,
|
|
1599
|
-
dateTime: { ...m.dateTime, timeStyle:
|
|
1627
|
+
dateTime: { ...m.dateTime, timeStyle: C }
|
|
1600
1628
|
},
|
|
1601
1629
|
calendar: { tz: "UTC" }
|
|
1602
1630
|
})
|
|
1603
1631
|
}).text
|
|
1604
|
-
), _ = (
|
|
1632
|
+
), _ = (C, G) => {
|
|
1605
1633
|
const K = {
|
|
1606
1634
|
...e.dateTime,
|
|
1607
|
-
[
|
|
1635
|
+
[C]: G === "inherit" ? void 0 : G
|
|
1608
1636
|
};
|
|
1609
|
-
|
|
1637
|
+
n({
|
|
1610
1638
|
...e,
|
|
1611
1639
|
dateTime: K.dateStyle === void 0 && K.timeStyle === void 0 ? void 0 : K
|
|
1612
1640
|
});
|
|
@@ -1625,29 +1653,29 @@ function $r({
|
|
|
1625
1653
|
Pe,
|
|
1626
1654
|
{
|
|
1627
1655
|
value: e.locale ?? "inherit",
|
|
1628
|
-
disabled:
|
|
1629
|
-
onValueChange: (
|
|
1656
|
+
disabled: r,
|
|
1657
|
+
onValueChange: (C) => n({
|
|
1630
1658
|
...e,
|
|
1631
|
-
locale:
|
|
1659
|
+
locale: C === "inherit" ? void 0 : C
|
|
1632
1660
|
}),
|
|
1633
1661
|
children: [
|
|
1634
|
-
/* @__PURE__ */ l(ze, { id: i, size: "xs", children: /* @__PURE__ */ l(Fe, { children: e.locale === void 0 ? `Inherited · ${a.locale}` :
|
|
1662
|
+
/* @__PURE__ */ l(ze, { id: i, size: "xs", children: /* @__PURE__ */ l(Fe, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Hr(e.locale) }) }),
|
|
1635
1663
|
/* @__PURE__ */ h(Le, { children: [
|
|
1636
|
-
/* @__PURE__ */ h(
|
|
1664
|
+
/* @__PURE__ */ h(J, { value: "inherit", children: [
|
|
1637
1665
|
"Inherited from ",
|
|
1638
|
-
|
|
1666
|
+
je(t.locale),
|
|
1639
1667
|
" ·",
|
|
1640
1668
|
" ",
|
|
1641
1669
|
a.locale
|
|
1642
1670
|
] }),
|
|
1643
|
-
e.locale && !
|
|
1644
|
-
(
|
|
1645
|
-
) && /* @__PURE__ */ l(
|
|
1646
|
-
|
|
1647
|
-
|
|
1671
|
+
e.locale && !We.some(
|
|
1672
|
+
(C) => C.value === e.locale
|
|
1673
|
+
) && /* @__PURE__ */ l(J, { value: e.locale, children: e.locale }),
|
|
1674
|
+
We.map((C) => /* @__PURE__ */ h(J, { value: C.value, children: [
|
|
1675
|
+
C.label,
|
|
1648
1676
|
" — ",
|
|
1649
|
-
|
|
1650
|
-
] },
|
|
1677
|
+
C.value
|
|
1678
|
+
] }, C.value))
|
|
1651
1679
|
] })
|
|
1652
1680
|
]
|
|
1653
1681
|
}
|
|
@@ -1663,11 +1691,11 @@ function $r({
|
|
|
1663
1691
|
value: e.dateStyle,
|
|
1664
1692
|
inherited: a.dateStyle,
|
|
1665
1693
|
inheritedSource: t.dateStyle,
|
|
1666
|
-
examples:
|
|
1667
|
-
disabled:
|
|
1668
|
-
onValueChange: (
|
|
1694
|
+
examples: P,
|
|
1695
|
+
disabled: r,
|
|
1696
|
+
onValueChange: (C) => n({
|
|
1669
1697
|
...e,
|
|
1670
|
-
dateStyle:
|
|
1698
|
+
dateStyle: C === "inherit" ? void 0 : C
|
|
1671
1699
|
})
|
|
1672
1700
|
}
|
|
1673
1701
|
)
|
|
@@ -1679,12 +1707,12 @@ function $r({
|
|
|
1679
1707
|
{
|
|
1680
1708
|
id: f,
|
|
1681
1709
|
label: "Date",
|
|
1682
|
-
value: (
|
|
1710
|
+
value: (N = e.dateTime) == null ? void 0 : N.dateStyle,
|
|
1683
1711
|
inherited: a.dateTime.dateStyle,
|
|
1684
1712
|
inheritedSource: t.dateTime.dateStyle,
|
|
1685
|
-
examples:
|
|
1686
|
-
disabled:
|
|
1687
|
-
onValueChange: (
|
|
1713
|
+
examples: F,
|
|
1714
|
+
disabled: r,
|
|
1715
|
+
onValueChange: (C) => _("dateStyle", C)
|
|
1688
1716
|
}
|
|
1689
1717
|
),
|
|
1690
1718
|
/* @__PURE__ */ l(
|
|
@@ -1696,8 +1724,8 @@ function $r({
|
|
|
1696
1724
|
inherited: a.dateTime.timeStyle,
|
|
1697
1725
|
inheritedSource: t.dateTime.timeStyle,
|
|
1698
1726
|
examples: U,
|
|
1699
|
-
disabled:
|
|
1700
|
-
onValueChange: (
|
|
1727
|
+
disabled: r,
|
|
1728
|
+
onValueChange: (C) => _("timeStyle", C)
|
|
1701
1729
|
}
|
|
1702
1730
|
)
|
|
1703
1731
|
] }),
|
|
@@ -1714,23 +1742,23 @@ function $r({
|
|
|
1714
1742
|
Pe,
|
|
1715
1743
|
{
|
|
1716
1744
|
value: e.defaultCurrency ?? "inherit",
|
|
1717
|
-
disabled:
|
|
1718
|
-
onValueChange: (
|
|
1745
|
+
disabled: r,
|
|
1746
|
+
onValueChange: (C) => n({
|
|
1719
1747
|
...e,
|
|
1720
|
-
defaultCurrency:
|
|
1748
|
+
defaultCurrency: C === "inherit" ? void 0 : C
|
|
1721
1749
|
}),
|
|
1722
1750
|
children: [
|
|
1723
1751
|
/* @__PURE__ */ l(ze, { id: s, size: "xs", children: /* @__PURE__ */ l(Fe, { children: e.defaultCurrency === void 0 ? `Inherited · ${a.defaultCurrency}` : e.defaultCurrency }) }),
|
|
1724
1752
|
/* @__PURE__ */ h(Le, { children: [
|
|
1725
|
-
/* @__PURE__ */ h(
|
|
1753
|
+
/* @__PURE__ */ h(J, { value: "inherit", children: [
|
|
1726
1754
|
"Inherited from ",
|
|
1727
|
-
|
|
1755
|
+
je(t.defaultCurrency),
|
|
1728
1756
|
" ·",
|
|
1729
1757
|
" ",
|
|
1730
1758
|
a.defaultCurrency
|
|
1731
1759
|
] }),
|
|
1732
|
-
[...
|
|
1733
|
-
|
|
1760
|
+
[...zt].map((C) => /* @__PURE__ */ l(J, { value: C, children: C }, C)),
|
|
1761
|
+
Kr.map((C) => /* @__PURE__ */ l(J, { value: C, children: C }, C))
|
|
1734
1762
|
] })
|
|
1735
1763
|
]
|
|
1736
1764
|
}
|
|
@@ -1745,11 +1773,11 @@ function $r({
|
|
|
1745
1773
|
] }),
|
|
1746
1774
|
/* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1747
1775
|
/* @__PURE__ */ l("dt", { className: "text-muted-foreground", children: "Date & time" }),
|
|
1748
|
-
/* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children:
|
|
1776
|
+
/* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children: y })
|
|
1749
1777
|
] }),
|
|
1750
1778
|
/* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1751
1779
|
/* @__PURE__ */ l("dt", { className: "text-muted-foreground", children: "Currency" }),
|
|
1752
|
-
/* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children:
|
|
1780
|
+
/* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children: x })
|
|
1753
1781
|
] })
|
|
1754
1782
|
] })
|
|
1755
1783
|
] }),
|
|
@@ -1764,7 +1792,7 @@ const ct = [
|
|
|
1764
1792
|
"defaultCurrency"
|
|
1765
1793
|
];
|
|
1766
1794
|
function ut(e, a) {
|
|
1767
|
-
var t,
|
|
1795
|
+
var t, n;
|
|
1768
1796
|
switch (a) {
|
|
1769
1797
|
case "locale":
|
|
1770
1798
|
return e == null ? void 0 : e.locale;
|
|
@@ -1773,14 +1801,14 @@ function ut(e, a) {
|
|
|
1773
1801
|
case "dateTime.dateStyle":
|
|
1774
1802
|
return (t = e == null ? void 0 : e.dateTime) == null ? void 0 : t.dateStyle;
|
|
1775
1803
|
case "dateTime.timeStyle":
|
|
1776
|
-
return (
|
|
1804
|
+
return (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.timeStyle;
|
|
1777
1805
|
case "defaultCurrency":
|
|
1778
1806
|
return e == null ? void 0 : e.defaultCurrency;
|
|
1779
1807
|
}
|
|
1780
1808
|
}
|
|
1781
|
-
function
|
|
1782
|
-
var
|
|
1783
|
-
const a = (
|
|
1809
|
+
function Gr(e) {
|
|
1810
|
+
var n, r;
|
|
1811
|
+
const a = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.dateStyle, t = (r = e == null ? void 0 : e.dateTime) == null ? void 0 : r.timeStyle;
|
|
1784
1812
|
return {
|
|
1785
1813
|
locale: e == null ? void 0 : e.locale,
|
|
1786
1814
|
dateStyle: e == null ? void 0 : e.dateStyle,
|
|
@@ -1788,16 +1816,16 @@ function Vr(e) {
|
|
|
1788
1816
|
defaultCurrency: e == null ? void 0 : e.defaultCurrency
|
|
1789
1817
|
};
|
|
1790
1818
|
}
|
|
1791
|
-
function
|
|
1819
|
+
function Xr({
|
|
1792
1820
|
active: e,
|
|
1793
1821
|
onClose: a
|
|
1794
1822
|
}) {
|
|
1795
1823
|
var o, f, u, g, c, v, m;
|
|
1796
|
-
const { preferences: t, isLoading:
|
|
1824
|
+
const { preferences: t, isLoading: n, isSaving: r, updatePreferences: i } = $r({ enabled: e });
|
|
1797
1825
|
if (!e) return null;
|
|
1798
1826
|
if (!t)
|
|
1799
1827
|
return /* @__PURE__ */ h(ie, { children: [
|
|
1800
|
-
/* @__PURE__ */ l("div", { className: "py-2", children: /* @__PURE__ */ l("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children:
|
|
1828
|
+
/* @__PURE__ */ l("div", { className: "py-2", children: /* @__PURE__ */ l("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children: n ? "Loading preferences…" : "Preferences unavailable." }) }),
|
|
1801
1829
|
/* @__PURE__ */ h($e, { className: "justify-between sm:justify-between", children: [
|
|
1802
1830
|
/* @__PURE__ */ l(V, { variant: "ghost", size: "xs", disabled: !0, children: "Reset display formats" }),
|
|
1803
1831
|
/* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
@@ -1814,50 +1842,50 @@ function Kr({
|
|
|
1814
1842
|
((m = t.stored) == null ? void 0 : m.defaultCurrency) ?? ""
|
|
1815
1843
|
].join(":");
|
|
1816
1844
|
return /* @__PURE__ */ l(
|
|
1817
|
-
|
|
1845
|
+
Jr,
|
|
1818
1846
|
{
|
|
1819
1847
|
preferences: t,
|
|
1820
|
-
isSaving:
|
|
1848
|
+
isSaving: r,
|
|
1821
1849
|
updatePreferences: i,
|
|
1822
1850
|
onClose: a
|
|
1823
1851
|
},
|
|
1824
1852
|
s
|
|
1825
1853
|
);
|
|
1826
1854
|
}
|
|
1827
|
-
function
|
|
1855
|
+
function Jr({
|
|
1828
1856
|
preferences: e,
|
|
1829
1857
|
isSaving: a,
|
|
1830
1858
|
updatePreferences: t,
|
|
1831
|
-
onClose:
|
|
1859
|
+
onClose: n
|
|
1832
1860
|
}) {
|
|
1833
1861
|
var u, g;
|
|
1834
|
-
const [
|
|
1835
|
-
() =>
|
|
1836
|
-
), s = (
|
|
1862
|
+
const [r, i] = L(
|
|
1863
|
+
() => Gr(e.stored)
|
|
1864
|
+
), s = (r.locale === void 0 || pt(r.locale) !== void 0) && (r.defaultCurrency === void 0 || wa(r.defaultCurrency) !== void 0) && (r.dateStyle === void 0 || ["short", "medium", "long"].includes(r.dateStyle)) && (((u = r.dateTime) == null ? void 0 : u.dateStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.dateStyle)) && (((g = r.dateTime) == null ? void 0 : g.timeStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.timeStyle)), o = async () => {
|
|
1837
1865
|
const c = {
|
|
1838
|
-
...
|
|
1839
|
-
...
|
|
1840
|
-
...
|
|
1841
|
-
...
|
|
1866
|
+
...r.locale !== void 0 ? { locale: r.locale } : {},
|
|
1867
|
+
...r.dateStyle !== void 0 ? { dateStyle: r.dateStyle } : {},
|
|
1868
|
+
...r.dateTime ? { dateTime: { ...r.dateTime } } : {},
|
|
1869
|
+
...r.defaultCurrency !== void 0 ? { defaultCurrency: r.defaultCurrency } : {}
|
|
1842
1870
|
}, v = ct.filter(
|
|
1843
|
-
(
|
|
1871
|
+
(I) => ut(r, I) === void 0 && ut(e.stored, I) !== void 0
|
|
1844
1872
|
), m = {
|
|
1845
1873
|
...Object.keys(c).length > 0 ? { set: c } : {},
|
|
1846
1874
|
...v.length > 0 ? { clear: v } : {}
|
|
1847
1875
|
};
|
|
1848
|
-
(Object.keys(m).length === 0 ? !0 : await t(m)) ? (H.success("Display format preferences saved."),
|
|
1876
|
+
(Object.keys(m).length === 0 ? !0 : await t(m)) ? (H.success("Display format preferences saved."), n()) : H.error("Failed to save preferences. Please try again.");
|
|
1849
1877
|
}, f = async () => {
|
|
1850
1878
|
await t({
|
|
1851
1879
|
clear: [...ct]
|
|
1852
|
-
}) ? (H.success("Display format preferences reset."),
|
|
1880
|
+
}) ? (H.success("Display format preferences reset."), n()) : H.error(
|
|
1853
1881
|
"Failed to reset display format preferences. Please try again."
|
|
1854
1882
|
);
|
|
1855
1883
|
};
|
|
1856
1884
|
return /* @__PURE__ */ h(ie, { children: [
|
|
1857
1885
|
/* @__PURE__ */ l("div", { className: "py-2", children: /* @__PURE__ */ l(
|
|
1858
|
-
|
|
1886
|
+
qr,
|
|
1859
1887
|
{
|
|
1860
|
-
value:
|
|
1888
|
+
value: r,
|
|
1861
1889
|
inherited: e.inherited,
|
|
1862
1890
|
inheritedSources: e.inheritedSources,
|
|
1863
1891
|
onChange: i,
|
|
@@ -1881,7 +1909,7 @@ function Hr({
|
|
|
1881
1909
|
{
|
|
1882
1910
|
variant: "outline",
|
|
1883
1911
|
size: "xs",
|
|
1884
|
-
onClick:
|
|
1912
|
+
onClick: n,
|
|
1885
1913
|
disabled: a,
|
|
1886
1914
|
children: "Cancel"
|
|
1887
1915
|
}
|
|
@@ -1893,7 +1921,7 @@ function Hr({
|
|
|
1893
1921
|
onClick: o,
|
|
1894
1922
|
disabled: a || !s,
|
|
1895
1923
|
children: a ? /* @__PURE__ */ h(ie, { children: [
|
|
1896
|
-
/* @__PURE__ */ l(
|
|
1924
|
+
/* @__PURE__ */ l(vt, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1897
1925
|
"Saving…"
|
|
1898
1926
|
] }) : "Save"
|
|
1899
1927
|
}
|
|
@@ -1902,49 +1930,49 @@ function Hr({
|
|
|
1902
1930
|
] })
|
|
1903
1931
|
] });
|
|
1904
1932
|
}
|
|
1905
|
-
function
|
|
1933
|
+
function Sn({
|
|
1906
1934
|
open: e,
|
|
1907
1935
|
onOpenChange: a
|
|
1908
1936
|
}) {
|
|
1909
|
-
const [t,
|
|
1937
|
+
const [t, n] = L("display"), r = () => a(!1);
|
|
1910
1938
|
return /* @__PURE__ */ l(ua, { open: e, onOpenChange: a, children: /* @__PURE__ */ h(ma, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
|
|
1911
1939
|
/* @__PURE__ */ h(fa, { children: [
|
|
1912
1940
|
/* @__PURE__ */ l(ha, { className: "text-[15px]", children: "Report preferences" }),
|
|
1913
1941
|
/* @__PURE__ */ l(pa, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
|
|
1914
1942
|
] }),
|
|
1915
|
-
/* @__PURE__ */ h(
|
|
1916
|
-
/* @__PURE__ */ h(
|
|
1943
|
+
/* @__PURE__ */ h(_a, { value: t, onValueChange: n, children: [
|
|
1944
|
+
/* @__PURE__ */ h(Ma, { variant: "underline", className: "w-full justify-start", children: [
|
|
1917
1945
|
/* @__PURE__ */ l(Qe, { value: "display", children: "Display formats" }),
|
|
1918
1946
|
/* @__PURE__ */ l(Qe, { value: "calendar", children: "Calendar" })
|
|
1919
1947
|
] }),
|
|
1920
1948
|
/* @__PURE__ */ l(et, { value: "display", children: /* @__PURE__ */ l(
|
|
1921
|
-
|
|
1949
|
+
Xr,
|
|
1922
1950
|
{
|
|
1923
1951
|
active: e && t === "display",
|
|
1924
|
-
onClose:
|
|
1952
|
+
onClose: r
|
|
1925
1953
|
}
|
|
1926
1954
|
) }),
|
|
1927
1955
|
/* @__PURE__ */ l(et, { value: "calendar", children: /* @__PURE__ */ l(
|
|
1928
|
-
|
|
1956
|
+
Br,
|
|
1929
1957
|
{
|
|
1930
1958
|
active: e && t === "calendar",
|
|
1931
|
-
onClose:
|
|
1959
|
+
onClose: r
|
|
1932
1960
|
}
|
|
1933
1961
|
) })
|
|
1934
1962
|
] })
|
|
1935
1963
|
] }) });
|
|
1936
1964
|
}
|
|
1937
1965
|
export {
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1966
|
+
Ja as A,
|
|
1967
|
+
It as C,
|
|
1968
|
+
wn as D,
|
|
1969
|
+
Sn as R,
|
|
1970
|
+
qr as a,
|
|
1943
1971
|
kt as b,
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1972
|
+
At as c,
|
|
1973
|
+
Dt as d,
|
|
1974
|
+
Oe as e,
|
|
1975
|
+
Ue as f,
|
|
1976
|
+
lr as g,
|
|
1977
|
+
yn as h
|
|
1950
1978
|
};
|