react-semaphor 0.1.582 → 0.1.584
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 +183 -178
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/aggregate-measure-field-DsFXETpI.js +22 -0
- package/dist/chunks/{assistant-chat-CVtxjVEH.js → assistant-chat-nmycV1Se.js} +12 -12
- package/dist/chunks/{bookmark-impact-BDSeeRy7.js → bookmark-impact-CI3gmxi0.js} +2 -2
- package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-D9-RFkDg.js} +22 -22
- package/dist/chunks/{card-filter-builder-CMZ5nwdC.js → card-filter-builder-C7QyPqRy.js} +145 -145
- package/dist/chunks/{comparison-window-caption-sRFtnX1q.js → comparison-window-caption-BAnsTI8y.js} +291 -305
- package/dist/chunks/{dashboard-briefing-launcher-C9wf8KhD.js → dashboard-briefing-launcher-DXs0XA1O.js} +13 -13
- package/dist/chunks/{dashboard-controls-PDb9Gap5.js → dashboard-controls-6Zoo8d8Y.js} +84 -84
- package/dist/chunks/{dashboard-BNn7fpDY.js → dashboard-inJy_V78.js} +1 -1
- package/dist/chunks/{dashboard-json-CvtVy2UH.js → dashboard-json-D5eJhVA9.js} +4 -4
- package/dist/chunks/{dates-B42fboJU.js → dates-B3_GWc_Y.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-Cat0RWPp.js → edit-dashboard-visual-DR03SYeW.js} +17 -17
- package/dist/chunks/{filter-reach-copy-C-RH1rVx.js → filter-reach-copy-CZwzrxBp.js} +1403 -1240
- package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-DtOvqcjn.js} +8 -8
- package/dist/chunks/{index-JWLo4R_t.js → index-BgT1L0p5.js} +5 -5
- package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
- package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-dkS8szLM.js → matrix-analytical-definition-Cs2v43FM.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
- package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-Be4uS3Ql.js} +1 -1
- package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
- package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-uH06jiZD.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-DvZY4eJM.js} +779 -765
- package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-BZexMfmL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CwbsD6t6.js → report-preferences-dialog-DWeVe2so.js} +171 -170
- package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-6FP1-7aU.js → resolve-dashboard-input-context-uATCuOP7.js} +5083 -4973
- package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-D2G0uLji.js → saved-dashboard-context-DSVV9iqW.js} +6 -6
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
- package/dist/chunks/{semaphor-ready-indicator-UhNS27Gy.js → semaphor-ready-indicator-B9vvRMnJ.js} +46773 -45614
- package/dist/chunks/{shelf-drop-preview-context-DPksW68k.js → shelf-drop-preview-context-BHOnp5Bo.js} +5 -5
- package/dist/chunks/{stored-dashboard-KpTy4umJ.js → stored-dashboard-xc5iidHL.js} +210 -221
- package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
- package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Cv_94obr.js} +1 -1
- package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
- package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
- package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
- package/dist/chunks/{variable-draft-CP5I66_J.js → variable-draft-C3CjhsJQ.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1391 -1364
- package/dist/format-utils/index.js +140 -140
- package/dist/index.js +234 -231
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +7 -0
- package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
- package/dist/types/index.js +5 -5
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
- package/dist/types/lib/see-records/click.d.ts +79 -0
- package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
- package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
- package/dist/types/lib/types/common-types.d.ts +6 -0
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
- package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +61 -0
- package/dist/types/shared/usage-events/envelope.d.ts +4 -4
- package/package.json +1 -1
- package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
package/dist/chunks/{report-preferences-dialog-CwbsD6t6.js → report-preferences-dialog-DWeVe2so.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as i, Fragment as te, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
3
|
import Mt, { useMemo as ee, useState as F, useEffect as Z, lazy as Ie, Suspense as Se, useRef as H, useLayoutEffect as Ce, useCallback as W, Activity as jt, useId as de } from "react";
|
|
4
|
-
import { b as Bt,
|
|
4
|
+
import { b as Bt, b2 as qe, be as $t, bf as Vt, u as O, bg as vt, N as Wt, K as Kt, bh as qt, bi as Ht, bj as Gt, bk as Jt, bl as ge, bm as bt, bn as Qe, bo as Xt, a7 as ye, a6 as Zt, bp as Yt, bq as Qt, a8 as et, a9 as ea, br as ta, E as aa, F as ra, S as na, B as sa, a as la, U as ia, bs as oa, D as da, A as ca, C as ua, bt as ma, bu as fa, bv as ha, bw as pa, bx as va, by as ba, bz as tt, bA as ke, bB as ga, bC as He, bD as G, bE as ya, bF as wa, bG as Sa, bH as xa, bI as Ca } from "./semaphor-ready-indicator-B9vvRMnJ.js";
|
|
5
5
|
import { j as Ea, c as j } from "./pickers-DkqmtnTL.js";
|
|
6
|
-
import { J as Ia } from "./bookmark-state-
|
|
6
|
+
import { J as Ia } from "./bookmark-state-D9-RFkDg.js";
|
|
7
7
|
import { r as Na, a as gt } from "./availability-Bp5Gfu1I.js";
|
|
8
|
-
import { s as Ta } from "./resolve-dashboard-input-context-
|
|
9
|
-
import { B as K, Z as ka, _ as Aa, $ as Da, a0 as Ra, a1 as Pa, a2 as _a, a3 as ie, H as Q, a4 as he, s as pe, e as La, f as za, h as Fa, j as at, L as yt, y as Fe, z as
|
|
10
|
-
import "./validators-
|
|
11
|
-
import "./matrix-operation-contract-
|
|
8
|
+
import { s as Ta } from "./resolve-dashboard-input-context-uATCuOP7.js";
|
|
9
|
+
import { B as K, Z as ka, _ as Aa, $ as Da, a0 as Ra, a1 as Pa, a2 as _a, a3 as ie, H as Q, a4 as he, s as pe, e as La, f as za, h as Fa, j as at, L as yt, y as Fe, z as Ue, A as Oe, D as Me, E as X, T as Ua, k as Oa, l as rt, n as nt } from "./style-sheet-parts-_dGSFzDi.js";
|
|
10
|
+
import "./validators-CJ8Jh0E8.js";
|
|
11
|
+
import "./matrix-operation-contract-BM5TveR3.js";
|
|
12
12
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
13
13
|
import { parseValueFormatPreferencesResponse as Ma, canonicalizeSupportedLocale as wt, getSupportedCurrencyCodes as ja, canonicalizeSupportedCurrencyCode as Ba } from "../value-format-preferences/index.js";
|
|
14
|
-
import { e as $a } from "./filter-reach-copy-
|
|
15
|
-
import { a as Va } from "./report-runtime-context-
|
|
16
|
-
import {
|
|
14
|
+
import { e as $a } from "./filter-reach-copy-CZwzrxBp.js";
|
|
15
|
+
import { a as Va } from "./report-runtime-context-NlOXwyRB.js";
|
|
16
|
+
import { ao as we, av as ce } from "./pivot-result-contract-expectations-DvZY4eJM.js";
|
|
17
17
|
function Wa() {
|
|
18
18
|
return /* @__PURE__ */ i(
|
|
19
19
|
"div",
|
|
@@ -68,7 +68,7 @@ function Ga({
|
|
|
68
68
|
return /* @__PURE__ */ i($t.Provider, { value: f, children: e });
|
|
69
69
|
}
|
|
70
70
|
function Ja({ children: e }) {
|
|
71
|
-
return
|
|
71
|
+
return vt() ? /* @__PURE__ */ i(te, { children: e }) : /* @__PURE__ */ i(Ga, { children: e });
|
|
72
72
|
}
|
|
73
73
|
function Xa(e) {
|
|
74
74
|
if (!(e != null && e.accessToken)) return {};
|
|
@@ -83,8 +83,8 @@ function Za(e) {
|
|
|
83
83
|
const a = (n, r) => {
|
|
84
84
|
const l = e.store.getState().focus;
|
|
85
85
|
l && !Ya(l, n, r) && e.clearFocus();
|
|
86
|
-
}, t =
|
|
87
|
-
return a(t.selectedSheetId, t.dashboard),
|
|
86
|
+
}, t = O.getState();
|
|
87
|
+
return a(t.selectedSheetId, t.dashboard), O.subscribe((n, r) => {
|
|
88
88
|
(n.selectedSheetId !== r.selectedSheetId || n.dashboard !== r.dashboard) && a(n.selectedSheetId, n.dashboard), n.isVisualEditing && !r.isVisualEditing && e.leaveBeside();
|
|
89
89
|
});
|
|
90
90
|
}, [e]);
|
|
@@ -94,8 +94,8 @@ function Ya(e, a, t) {
|
|
|
94
94
|
const n = t ? Ia(t, e.cardId) : void 0;
|
|
95
95
|
return !!n && n.sheet.id === e.sheetId;
|
|
96
96
|
}
|
|
97
|
-
const Qa = Ie(() => import("./assistant-chat-
|
|
98
|
-
function
|
|
97
|
+
const Qa = Ie(() => import("./assistant-chat-nmycV1Se.js"));
|
|
98
|
+
function bn() {
|
|
99
99
|
const e = Wt(), a = Kt();
|
|
100
100
|
if (!e.available) return null;
|
|
101
101
|
const t = a !== "lg";
|
|
@@ -124,7 +124,7 @@ const er = {
|
|
|
124
124
|
"full-page": "absolute inset-0 z-30"
|
|
125
125
|
}, tr = "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", ar = 640, fe = 8;
|
|
126
126
|
function rr({ surface: e = "dashboard" } = {}) {
|
|
127
|
-
const a =
|
|
127
|
+
const a = vt(), { isOpen: t, mounted: n, storedLayout: r, width: l, beside: s, besideSize: o, focusCardId: f, askCount: u } = Ht(
|
|
128
128
|
(a == null ? void 0 : a.instance.store) ?? Jt,
|
|
129
129
|
Gt((y) => {
|
|
130
130
|
var C;
|
|
@@ -139,39 +139,39 @@ function rr({ surface: e = "dashboard" } = {}) {
|
|
|
139
139
|
askCount: y.askCount
|
|
140
140
|
};
|
|
141
141
|
})
|
|
142
|
-
), w = e === "none", c =
|
|
142
|
+
), w = e === "none", c = O(
|
|
143
143
|
(y) => s && t && f && !w ? nr(y.dashboard, y.selectedSheetId, f) : void 0
|
|
144
|
-
),
|
|
144
|
+
), b = sr(c, u);
|
|
145
145
|
if (!(a != null && a.available) || !n && !w) return null;
|
|
146
|
-
const m = w ? "full-page" :
|
|
146
|
+
const m = w ? "full-page" : b.shown ? "beside-card" : r, S = w || t, v = m === "docked-right" || m === "docked-left";
|
|
147
147
|
return /* @__PURE__ */ h(
|
|
148
148
|
"aside",
|
|
149
149
|
{
|
|
150
|
-
ref:
|
|
150
|
+
ref: b.setFloating,
|
|
151
151
|
"aria-label": a.instance.assistantName,
|
|
152
152
|
"data-testid": "assistant-panel",
|
|
153
153
|
"data-layout": m,
|
|
154
154
|
"data-beside-frame": m === "beside-card" ? c : void 0,
|
|
155
|
-
"data-beside-side": m === "beside-card" ?
|
|
155
|
+
"data-beside-side": m === "beside-card" ? b.side : void 0,
|
|
156
156
|
className: j(
|
|
157
157
|
"flex-col bg-background",
|
|
158
158
|
m === "beside-card" ? tr : er[m],
|
|
159
159
|
S ? "flex" : "hidden"
|
|
160
160
|
),
|
|
161
|
-
style: m === "beside-card" ? { ...
|
|
161
|
+
style: m === "beside-card" ? { ...b.style, width: o.width, height: o.height } : (
|
|
162
162
|
// The saved width, never more than the share of the dashboard's area the
|
|
163
163
|
// handle allows, however the area is sized now or later (P4-10).
|
|
164
|
-
|
|
164
|
+
v ? { width: l, maxWidth: `${St * 100}%` } : void 0
|
|
165
165
|
),
|
|
166
166
|
onKeyDown: m === "beside-card" ? (y) => {
|
|
167
167
|
if (y.key !== "Escape" || y.defaultPrevented || !(y.target instanceof Node) || !y.currentTarget.contains(y.target)) return;
|
|
168
168
|
y.preventDefault();
|
|
169
|
-
const C =
|
|
169
|
+
const C = b.cardActions();
|
|
170
170
|
a.instance.close(), C == null || C.focus();
|
|
171
171
|
} : void 0,
|
|
172
172
|
children: [
|
|
173
|
-
|
|
174
|
-
m === "beside-card" ? /* @__PURE__ */ i(ir, { instance: a.instance, size: o, side:
|
|
173
|
+
v ? /* @__PURE__ */ i(or, { instance: a.instance, side: m === "docked-left" ? "right" : "left", width: l }) : null,
|
|
174
|
+
m === "beside-card" ? /* @__PURE__ */ i(ir, { instance: a.instance, size: o, side: b.handleSide }) : null,
|
|
175
175
|
/* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(Qa, { instance: a.instance, surface: e, placement: m }, a.instance.id) })
|
|
176
176
|
]
|
|
177
177
|
}
|
|
@@ -191,7 +191,7 @@ function sr(e, a) {
|
|
|
191
191
|
Ce(() => {
|
|
192
192
|
s.current = a;
|
|
193
193
|
});
|
|
194
|
-
const o = r === a ? null : t, { refs: f, elements: u, floatingStyles: w, middlewareData: c, isPositioned:
|
|
194
|
+
const o = r === a ? null : t, { refs: f, elements: u, floatingStyles: w, middlewareData: c, isPositioned: b } = ka({
|
|
195
195
|
strategy: "absolute",
|
|
196
196
|
placement: o ?? "right-start",
|
|
197
197
|
middleware: [
|
|
@@ -199,14 +199,14 @@ function sr(e, a) {
|
|
|
199
199
|
Da({ padding: fe }),
|
|
200
200
|
Ra({
|
|
201
201
|
padding: fe,
|
|
202
|
-
apply: ({ availableWidth:
|
|
203
|
-
C.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0,
|
|
202
|
+
apply: ({ availableWidth: v, availableHeight: y, elements: C }) => {
|
|
203
|
+
C.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, v)}px`), C.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, y)}px`);
|
|
204
204
|
}
|
|
205
205
|
}),
|
|
206
206
|
Pa()
|
|
207
207
|
],
|
|
208
|
-
whileElementsMounted: (
|
|
209
|
-
const P = lr(
|
|
208
|
+
whileElementsMounted: (v, y, C) => _a(v, y, () => {
|
|
209
|
+
const P = lr(v, y);
|
|
210
210
|
n(P), P === null && l(s.current), C();
|
|
211
211
|
})
|
|
212
212
|
}), m = u.floating;
|
|
@@ -219,15 +219,15 @@ function sr(e, a) {
|
|
|
219
219
|
...w,
|
|
220
220
|
// Not before it is placed (its side is chosen first): never a flash at
|
|
221
221
|
// the row's corner. With the card wholly out of view, it goes with the card.
|
|
222
|
-
...!
|
|
222
|
+
...!b || (S = c.hide) != null && S.referenceHidden ? { visibility: "hidden" } : {}
|
|
223
223
|
},
|
|
224
224
|
/** The side the conversation took; the size handle sits on the corner away from the card. */
|
|
225
225
|
side: o ?? void 0,
|
|
226
226
|
handleSide: o === "left-start" ? "left" : "right",
|
|
227
227
|
/** The card's ··· menu, where Ask lives and focus returns on Escape. */
|
|
228
228
|
cardActions: () => {
|
|
229
|
-
var
|
|
230
|
-
return e ? (
|
|
229
|
+
var v;
|
|
230
|
+
return e ? (v = it(m == null ? void 0 : m.parentElement, e)) == null ? void 0 : v.querySelector("[data-card-actions]") : null;
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
233
|
}
|
|
@@ -239,7 +239,7 @@ function lr(e, a) {
|
|
|
239
239
|
if (!t || !e.isConnected) return null;
|
|
240
240
|
const n = t.getBoundingClientRect();
|
|
241
241
|
if (n.width < ar) return null;
|
|
242
|
-
const r = e.getBoundingClientRect(), { min: l } =
|
|
242
|
+
const r = e.getBoundingClientRect(), { min: l } = bt, s = (o, f) => o >= l.width + 2 * fe && f >= l.height + 2 * fe;
|
|
243
243
|
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;
|
|
244
244
|
}
|
|
245
245
|
function ir({
|
|
@@ -283,7 +283,7 @@ function ir({
|
|
|
283
283
|
}[s.key];
|
|
284
284
|
o && (s.preventDefault(), e.setBesideSize({ width: a.width + o.width, height: a.height + o.height }, { save: !0 }));
|
|
285
285
|
},
|
|
286
|
-
onDoubleClick: () => e.setBesideSize(
|
|
286
|
+
onDoubleClick: () => e.setBesideSize(bt.default, { save: !0 }),
|
|
287
287
|
className: j(
|
|
288
288
|
"absolute bottom-0 z-10 h-3 w-3 touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
|
|
289
289
|
t === "left" ? "left-0 cursor-nesw-resize rounded-bl-card" : "right-0 cursor-nwse-resize rounded-br-card"
|
|
@@ -295,19 +295,19 @@ const le = 16, St = 0.6;
|
|
|
295
295
|
function or({ instance: e, side: a, width: t }) {
|
|
296
296
|
const n = H(void 0), r = (c) => {
|
|
297
297
|
var m, S;
|
|
298
|
-
const
|
|
299
|
-
return
|
|
298
|
+
const b = (S = (m = c.closest("aside")) == null ? void 0 : m.parentElement) == null ? void 0 : S.clientWidth;
|
|
299
|
+
return b ? b * St : ge.max;
|
|
300
300
|
}, l = (c) => {
|
|
301
|
-
var
|
|
302
|
-
return ((
|
|
301
|
+
var b;
|
|
302
|
+
return ((b = c.closest("aside")) == null ? void 0 : b.getBoundingClientRect().width) || t;
|
|
303
303
|
}, s = (c) => {
|
|
304
|
-
const
|
|
305
|
-
if (!
|
|
306
|
-
const m = c -
|
|
307
|
-
return Qe(
|
|
304
|
+
const b = n.current;
|
|
305
|
+
if (!b) return t;
|
|
306
|
+
const m = c - b.startX;
|
|
307
|
+
return Qe(b.startWidth + (a === "left" ? -m : m), b.maxForArea);
|
|
308
308
|
}, o = (c) => {
|
|
309
|
-
var
|
|
310
|
-
c.preventDefault(), (m = (
|
|
309
|
+
var b, m;
|
|
310
|
+
c.preventDefault(), (m = (b = c.currentTarget).setPointerCapture) == null || m.call(b, c.pointerId), n.current = { startX: c.clientX, startWidth: l(c.currentTarget), maxForArea: r(c.currentTarget) };
|
|
311
311
|
}, f = (c) => {
|
|
312
312
|
n.current && e.setWidth(s(c.clientX));
|
|
313
313
|
}, u = (c) => {
|
|
@@ -315,8 +315,8 @@ function or({ instance: e, side: a, width: t }) {
|
|
|
315
315
|
}, w = (c) => {
|
|
316
316
|
if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
|
|
317
317
|
c.preventDefault();
|
|
318
|
-
const
|
|
319
|
-
e.setWidth(Qe(l(c.currentTarget) + (
|
|
318
|
+
const b = c.key === "ArrowLeft" == (a === "left");
|
|
319
|
+
e.setWidth(Qe(l(c.currentTarget) + (b ? le : -le), r(c.currentTarget)), { save: !0 });
|
|
320
320
|
};
|
|
321
321
|
return /* @__PURE__ */ i(
|
|
322
322
|
"div",
|
|
@@ -346,7 +346,7 @@ function dr(e) {
|
|
|
346
346
|
const a = Xt();
|
|
347
347
|
return W(
|
|
348
348
|
async (t, n) => {
|
|
349
|
-
const r =
|
|
349
|
+
const r = O.getState();
|
|
350
350
|
if (r.isVisualEditing)
|
|
351
351
|
return { ok: !1, reason: "not_editable", message: ye.not_editable };
|
|
352
352
|
if (!e()) return { ok: !1, reason: "not_editable", message: ye.no_save };
|
|
@@ -361,18 +361,18 @@ function dr(e) {
|
|
|
361
361
|
});
|
|
362
362
|
Zt(s, f);
|
|
363
363
|
}
|
|
364
|
-
return n != null && n.stillWanted && !n.stillWanted() ? { ok: !1, reason: "dropped" } : e() ?
|
|
364
|
+
return n != null && n.stillWanted && !n.stillWanted() ? { ok: !1, reason: "dropped" } : e() ? O.getState().actions.applyProposal({ ...t, semanticExecutionPayload: s }) : { ok: !1, reason: "not_editable", message: ye.no_save };
|
|
365
365
|
},
|
|
366
366
|
[e, a]
|
|
367
367
|
);
|
|
368
368
|
}
|
|
369
369
|
function cr(e) {
|
|
370
|
-
const { canEditDashboard: a, isInspectionMode: t } = Yt(), n = Qt(), r =
|
|
370
|
+
const { canEditDashboard: a, isInspectionMode: t } = Yt(), n = Qt(), r = O(et), l = e && n && a === !0 && !t, s = H(l);
|
|
371
371
|
Ce(() => {
|
|
372
372
|
s.current = l;
|
|
373
373
|
});
|
|
374
374
|
const o = W(
|
|
375
|
-
() => s.current && et(
|
|
375
|
+
() => s.current && et(O.getState()),
|
|
376
376
|
[]
|
|
377
377
|
);
|
|
378
378
|
return { canChange: l && r, canChangeNow: o };
|
|
@@ -392,7 +392,7 @@ function ur({
|
|
|
392
392
|
port: e,
|
|
393
393
|
onLifecycleEvent: a
|
|
394
394
|
}) {
|
|
395
|
-
const { canChange: t, canChangeNow: n } = cr(!0), r =
|
|
395
|
+
const { canChange: t, canChangeNow: n } = cr(!0), r = O((m) => {
|
|
396
396
|
var S;
|
|
397
397
|
return (S = m.dashboard) == null ? void 0 : S.id;
|
|
398
398
|
}), l = dr(n), [s, o] = F(null), f = H(/* @__PURE__ */ new Map()), u = H(/* @__PURE__ */ new Map()), w = H(Promise.resolve()), c = H({ apply: l, onLifecycleEvent: a });
|
|
@@ -401,43 +401,43 @@ function ur({
|
|
|
401
401
|
}), Z(() => {
|
|
402
402
|
e.setScreenState({ eligible: t, ...r ? { dashboardId: r } : {} });
|
|
403
403
|
}, [e, t, r]), Z(
|
|
404
|
-
() =>
|
|
404
|
+
() => O.subscribe((m, S) => {
|
|
405
405
|
if (m.editSessionEpoch !== S.editSessionEpoch) {
|
|
406
406
|
f.current.clear(), o(null);
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
409
|
if (m.dashboard !== S.dashboard)
|
|
410
|
-
for (const [
|
|
411
|
-
y !== m.dashboard && f.current.delete(
|
|
410
|
+
for (const [v, y] of f.current)
|
|
411
|
+
y !== m.dashboard && f.current.delete(v);
|
|
412
412
|
}),
|
|
413
413
|
[]
|
|
414
414
|
), Z(() => {
|
|
415
|
-
const m = (
|
|
416
|
-
const y =
|
|
417
|
-
if (!y || y.id !==
|
|
415
|
+
const m = (v) => {
|
|
416
|
+
const y = O.getState().dashboard;
|
|
417
|
+
if (!y || y.id !== v.dashboardId) return;
|
|
418
418
|
const C = hr();
|
|
419
419
|
f.current.set(C, y), e.answerCopyRequest({
|
|
420
420
|
kind: "uploaded",
|
|
421
421
|
screenId: e.screenId,
|
|
422
|
-
requestId:
|
|
422
|
+
requestId: v.requestId,
|
|
423
423
|
revisionId: C,
|
|
424
424
|
dashboard: y
|
|
425
425
|
});
|
|
426
|
-
}, S = async (
|
|
426
|
+
}, S = async (v, y) => {
|
|
427
427
|
var g, I, D;
|
|
428
|
-
const C = u.current.get(
|
|
428
|
+
const C = u.current.get(v.deliveryId);
|
|
429
429
|
if (C) {
|
|
430
|
-
e.reportOutcome({ screenId: e.screenId, deliveryId:
|
|
430
|
+
e.reportOutcome({ screenId: e.screenId, deliveryId: v.deliveryId, outcome: C });
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
|
-
const P = f.current.get(
|
|
433
|
+
const P = f.current.get(v.revisionId), z = () => !P || f.current.get(v.revisionId) !== P ? "dashboard_changed" : performance.now() < y + v.applyWithinMs ? null : "expired", U = z();
|
|
434
434
|
let _;
|
|
435
|
-
if (
|
|
436
|
-
_ = xe(
|
|
435
|
+
if (U || !P)
|
|
436
|
+
_ = xe(U ?? "dashboard_changed");
|
|
437
437
|
else {
|
|
438
438
|
let E = "expired";
|
|
439
439
|
const q = await c.current.apply(
|
|
440
|
-
{ proposalId:
|
|
440
|
+
{ proposalId: v.proposalId, operations: v.operations, context: v.context, basedOn: P },
|
|
441
441
|
{
|
|
442
442
|
stillWanted: () => {
|
|
443
443
|
const $ = z();
|
|
@@ -447,39 +447,39 @@ function ur({
|
|
|
447
447
|
);
|
|
448
448
|
_ = fr(q, E);
|
|
449
449
|
}
|
|
450
|
-
if (u.current.set(
|
|
451
|
-
const N = ((g =
|
|
452
|
-
o({ deliveryId:
|
|
450
|
+
if (u.current.set(v.deliveryId, _), e.reportOutcome({ screenId: e.screenId, deliveryId: v.deliveryId, outcome: _ }), _.status !== "applied") return;
|
|
451
|
+
const N = ((g = O.getState().dashboard) == null ? void 0 : g.id) ?? "";
|
|
452
|
+
o({ deliveryId: v.deliveryId, proposalId: v.proposalId, summary: v.summary, dashboardId: N, words: null }), (D = (I = c.current).onLifecycleEvent) == null || D.call(I, {
|
|
453
453
|
type: "dashboard:change-applied",
|
|
454
454
|
dashboardId: N,
|
|
455
|
-
payload: { deliveryId:
|
|
455
|
+
payload: { deliveryId: v.deliveryId, summary: v.summary }
|
|
456
456
|
});
|
|
457
457
|
};
|
|
458
|
-
return e.subscribe((
|
|
459
|
-
if (
|
|
460
|
-
m(
|
|
458
|
+
return e.subscribe((v) => {
|
|
459
|
+
if (v.type === "copy_request") {
|
|
460
|
+
m(v);
|
|
461
461
|
return;
|
|
462
462
|
}
|
|
463
463
|
const y = performance.now();
|
|
464
464
|
w.current = w.current.then(
|
|
465
|
-
() => S(
|
|
465
|
+
() => S(v, y).catch((C) => console.error("[live-screen] a delivery failed", C))
|
|
466
466
|
);
|
|
467
467
|
});
|
|
468
468
|
}, [e]);
|
|
469
|
-
const
|
|
470
|
-
var S,
|
|
469
|
+
const b = W(() => {
|
|
470
|
+
var S, v;
|
|
471
471
|
if (!s) return;
|
|
472
|
-
const m =
|
|
473
|
-
m.ok ? ((
|
|
472
|
+
const m = O.getState().actions.undoProposal(s.proposalId);
|
|
473
|
+
m.ok ? ((v = (S = c.current).onLifecycleEvent) == null || v.call(S, {
|
|
474
474
|
type: "dashboard:change-undone",
|
|
475
475
|
dashboardId: s.dashboardId,
|
|
476
476
|
payload: { deliveryId: s.deliveryId, summary: s.summary }
|
|
477
477
|
}), o(null)) : m.reason === "changed_since" ? o({ ...s, words: "changed_since" }) : m.reason === "not_editable" ? o({ ...s, words: "not_editable" }) : o(null);
|
|
478
478
|
}, [s]);
|
|
479
|
-
return s ? /* @__PURE__ */ i(mr, { note: s, onUndo:
|
|
479
|
+
return s ? /* @__PURE__ */ i(mr, { note: s, onUndo: b }) : null;
|
|
480
480
|
}
|
|
481
481
|
function mr({ note: e, onUndo: a }) {
|
|
482
|
-
const t =
|
|
482
|
+
const t = O((s) => ea(s, e.proposalId)), n = O((s) => s.isVisualEditing);
|
|
483
483
|
if (t === "none" && e.words === null) return null;
|
|
484
484
|
const r = e.words === "changed_since" || t === "changed_since", l = r ? "changed_since" : e.words === "not_editable" ? "not_editable" : t;
|
|
485
485
|
return /* @__PURE__ */ h(
|
|
@@ -536,16 +536,16 @@ function xe(e) {
|
|
|
536
536
|
function hr() {
|
|
537
537
|
return globalThis.crypto.randomUUID();
|
|
538
538
|
}
|
|
539
|
-
const pr = Ie(() => import("./dashboard-controls-
|
|
540
|
-
() => import("./edit-dashboard-visual-
|
|
541
|
-
),
|
|
539
|
+
const pr = Ie(() => import("./dashboard-controls-6Zoo8d8Y.js")), vr = Ie(
|
|
540
|
+
() => import("./edit-dashboard-visual-DR03SYeW.js")
|
|
541
|
+
), br = Ie(() => import("./dashboard-json-D5eJhVA9.js"));
|
|
542
542
|
function gn({
|
|
543
543
|
showControls: e = !1,
|
|
544
544
|
showFooter: a = !0,
|
|
545
545
|
liveScreen: t,
|
|
546
546
|
...n
|
|
547
547
|
}) {
|
|
548
|
-
const r =
|
|
548
|
+
const r = O((f) => f.isVisualEditing), l = O(
|
|
549
549
|
(f) => f.showDashboardJSON
|
|
550
550
|
), { appearance: s, preferences: o } = n;
|
|
551
551
|
return /* @__PURE__ */ i(aa, { FallbackComponent: ra, children: /* @__PURE__ */ i(na, { dashboardProps: n, children: /* @__PURE__ */ h(sa, { children: [
|
|
@@ -567,13 +567,13 @@ function gn({
|
|
|
567
567
|
}
|
|
568
568
|
),
|
|
569
569
|
/* @__PURE__ */ h(da, { preferences: o, children: [
|
|
570
|
-
l && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(
|
|
570
|
+
l && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(br, {}) }),
|
|
571
571
|
/* @__PURE__ */ i(ca, { children: /* @__PURE__ */ i(Ja, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
|
|
572
572
|
e && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(pr, {}) }),
|
|
573
573
|
t && /* @__PURE__ */ i(ur, { port: t, onLifecycleEvent: n.onDashboardLifecycleEvent }),
|
|
574
574
|
/* @__PURE__ */ h("div", { className: "relative flex grow overflow-hidden", children: [
|
|
575
575
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(ua, { ...n, type: "dashboard", children: [
|
|
576
|
-
r && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(
|
|
576
|
+
r && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(vr, {}) }),
|
|
577
577
|
/* @__PURE__ */ i(jt, { mode: r ? "hidden" : "visible", children: /* @__PURE__ */ i(Wa, {}) })
|
|
578
578
|
] }) }),
|
|
579
579
|
/* @__PURE__ */ i(rr, {})
|
|
@@ -588,7 +588,7 @@ function je(e, a, t, n, r, l, s) {
|
|
|
588
588
|
if (l === a.length) return r === e.length ? ot : xr;
|
|
589
589
|
var o = `${r},${l}`;
|
|
590
590
|
if (s[o] !== void 0) return s[o];
|
|
591
|
-
for (var f = n.charAt(l), u = t.indexOf(f, r), w = 0, c,
|
|
591
|
+
for (var f = n.charAt(l), u = t.indexOf(f, r), w = 0, c, b, m, S; u >= 0; ) c = je(e, a, t, n, u + 1, l + 1, s), c > w && (u === r ? c *= ot : Cr.test(e.charAt(u - 1)) ? (c *= yr, m = e.slice(r, u - 1).match(Er), m && r > 0 && (c *= Math.pow(De, m.length))) : Ir.test(e.charAt(u - 1)) ? (c *= gr, S = e.slice(r, u - 1).match(Ct), S && r > 0 && (c *= Math.pow(De, S.length))) : (c *= wr, r > 0 && (c *= Math.pow(De, u - r))), e.charAt(u) !== a.charAt(l) && (c *= Sr)), (c < Ae && t.charAt(u - 1) === n.charAt(l + 1) || n.charAt(l + 1) === n.charAt(l) && t.charAt(u - 1) !== n.charAt(l)) && (b = je(e, a, t, n, u + 1, l + 2, s), b * Ae > c && (c = b * Ae)), c > w && (w = c), u = t.indexOf(f, u + 1);
|
|
592
592
|
return s[o] = w, w;
|
|
593
593
|
}
|
|
594
594
|
function dt(e) {
|
|
@@ -597,11 +597,11 @@ function dt(e) {
|
|
|
597
597
|
function Nr(e, a, t) {
|
|
598
598
|
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, je(e, a, dt(e), dt(a), 0, 0, {});
|
|
599
599
|
}
|
|
600
|
-
var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-heading=""]', Et = '[cmdk-item=""]', ct = `${Et}:not([aria-disabled="true"])`, Be = "cmdk-item-select", ne = "data-value", kr = (e, a, t) => Nr(e, a, t), It = p.createContext(void 0),
|
|
600
|
+
var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-heading=""]', Et = '[cmdk-item=""]', ct = `${Et}:not([aria-disabled="true"])`, Be = "cmdk-item-select", ne = "data-value", kr = (e, a, t) => Nr(e, a, t), It = p.createContext(void 0), ve = () => p.useContext(It), Nt = p.createContext(void 0), Ge = () => p.useContext(Nt), Tt = p.createContext(void 0), kt = p.forwardRef((e, a) => {
|
|
601
601
|
let t = se(() => {
|
|
602
602
|
var d, T;
|
|
603
603
|
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() } };
|
|
604
|
-
}), n = se(() => /* @__PURE__ */ new Set()), r = se(() => /* @__PURE__ */ new Map()), l = se(() => /* @__PURE__ */ new Map()), s = se(() => /* @__PURE__ */ new Set()), o = At(e), { label: f, children: u, value: w, onValueChange: c, filter:
|
|
604
|
+
}), n = se(() => /* @__PURE__ */ new Set()), r = se(() => /* @__PURE__ */ new Map()), l = se(() => /* @__PURE__ */ new Map()), s = se(() => /* @__PURE__ */ new Set()), o = At(e), { label: f, children: u, value: w, onValueChange: c, filter: b, shouldFilter: m, loop: S, disablePointerSelection: v = !1, vimBindings: y = !0, ...C } = e, P = ie(), z = ie(), U = ie(), _ = p.useRef(null), N = Mr();
|
|
605
605
|
ae(() => {
|
|
606
606
|
if (w !== void 0) {
|
|
607
607
|
let d = w.trim();
|
|
@@ -616,7 +616,7 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
616
616
|
if (t.current[d] = T, d === "search") $(), E(), N(1, q);
|
|
617
617
|
else if (d === "value") {
|
|
618
618
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
619
|
-
let M = document.getElementById(
|
|
619
|
+
let M = document.getElementById(U);
|
|
620
620
|
M ? M.focus() : (x = document.getElementById(P)) == null || x.focus();
|
|
621
621
|
}
|
|
622
622
|
if (N(7, () => {
|
|
@@ -647,7 +647,7 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
647
647
|
});
|
|
648
648
|
}), group: (d) => (r.current.has(d) || r.current.set(d, /* @__PURE__ */ new Set()), () => {
|
|
649
649
|
l.current.delete(d), r.current.delete(d);
|
|
650
|
-
}), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: P, inputId:
|
|
650
|
+
}), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: P, inputId: U, labelId: z, listInnerRef: _ }), []);
|
|
651
651
|
function D(d, T) {
|
|
652
652
|
var A, x;
|
|
653
653
|
let R = (x = (A = o.current) == null ? void 0 : A.filter) != null ? x : kr;
|
|
@@ -666,8 +666,8 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
666
666
|
let A = _.current;
|
|
667
667
|
k().sort((x, R) => {
|
|
668
668
|
var L, V;
|
|
669
|
-
let M = x.getAttribute("id"),
|
|
670
|
-
return ((L = d.get(
|
|
669
|
+
let M = x.getAttribute("id"), be = R.getAttribute("id");
|
|
670
|
+
return ((L = d.get(be)) != null ? L : 0) - ((V = d.get(M)) != null ? V : 0);
|
|
671
671
|
}).forEach((x) => {
|
|
672
672
|
let R = x.closest(Re);
|
|
673
673
|
R ? R.appendChild(x.parentElement === R ? x : x.closest(`${Re} > *`)) : A.appendChild(x.parentElement === A ? x : x.closest(`${Re} > *`));
|
|
@@ -690,8 +690,8 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
690
690
|
t.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
691
691
|
let R = 0;
|
|
692
692
|
for (let L of n.current) {
|
|
693
|
-
let V = (T = (d = l.current.get(L)) == null ? void 0 : d.value) != null ? T : "", M = (x = (A = l.current.get(L)) == null ? void 0 : A.keywords) != null ? x : [],
|
|
694
|
-
t.current.filtered.items.set(L,
|
|
693
|
+
let V = (T = (d = l.current.get(L)) == null ? void 0 : d.value) != null ? T : "", M = (x = (A = l.current.get(L)) == null ? void 0 : A.keywords) != null ? x : [], be = D(V, M);
|
|
694
|
+
t.current.filtered.items.set(L, be), be > 0 && R++;
|
|
695
695
|
}
|
|
696
696
|
for (let [L, V] of r.current) for (let M of V) if (t.current.filtered.items.get(M) > 0) {
|
|
697
697
|
t.current.filtered.groups.add(L);
|
|
@@ -723,7 +723,7 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
723
723
|
}
|
|
724
724
|
function Je(d) {
|
|
725
725
|
let T = J(), A = T == null ? void 0 : T.closest(me), x;
|
|
726
|
-
for (; A && !x; ) A = d > 0 ?
|
|
726
|
+
for (; A && !x; ) A = d > 0 ? Ur(A, me) : Or(A, me), x = A == null ? void 0 : A.querySelector(ct);
|
|
727
727
|
x ? g.setState("value", x.getAttribute(ne)) : Te(d);
|
|
728
728
|
}
|
|
729
729
|
let Xe = () => oe(k().length - 1), Ze = (d) => {
|
|
@@ -774,52 +774,52 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
774
774
|
} }, p.createElement("label", { "cmdk-label": "", htmlFor: I.inputId, id: I.labelId, style: Br }, f), Ne(e, (d) => p.createElement(Nt.Provider, { value: g }, p.createElement(It.Provider, { value: I }, d))));
|
|
775
775
|
}), Ar = p.forwardRef((e, a) => {
|
|
776
776
|
var t, n;
|
|
777
|
-
let r = ie(), l = p.useRef(null), s = p.useContext(Tt), o =
|
|
777
|
+
let r = ie(), l = p.useRef(null), s = p.useContext(Tt), o = ve(), f = At(e), u = (n = (t = f.current) == null ? void 0 : t.forceMount) != null ? n : s == null ? void 0 : s.forceMount;
|
|
778
778
|
ae(() => {
|
|
779
779
|
if (!u) return o.item(r, s == null ? void 0 : s.id);
|
|
780
780
|
}, [u]);
|
|
781
|
-
let w = Dt(r, l, [e.value, e.children, l], e.keywords), c = Ge(),
|
|
781
|
+
let w = Dt(r, l, [e.value, e.children, l], e.keywords), c = Ge(), b = Y((N) => N.value && N.value === w.current), m = Y((N) => u || o.filter() === !1 ? !0 : N.search ? N.filtered.items.get(r) > 0 : !0);
|
|
782
782
|
p.useEffect(() => {
|
|
783
783
|
let N = l.current;
|
|
784
784
|
if (!(!N || e.disabled)) return N.addEventListener(Be, S), () => N.removeEventListener(Be, S);
|
|
785
785
|
}, [m, e.onSelect, e.disabled]);
|
|
786
786
|
function S() {
|
|
787
787
|
var N, g;
|
|
788
|
-
|
|
788
|
+
v(), (g = (N = f.current).onSelect) == null || g.call(N, w.current);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function v() {
|
|
791
791
|
c.setState("value", w.current, !0);
|
|
792
792
|
}
|
|
793
793
|
if (!m) return null;
|
|
794
|
-
let { disabled: y, value: C, onSelect: P, forceMount: z, keywords:
|
|
795
|
-
return p.createElement(Q.div, { ref: he(l, a), ..._, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!y, "aria-selected": !!
|
|
794
|
+
let { disabled: y, value: C, onSelect: P, forceMount: z, keywords: U, ..._ } = e;
|
|
795
|
+
return p.createElement(Q.div, { ref: he(l, a), ..._, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!y, "aria-selected": !!b, "data-disabled": !!y, "data-selected": !!b, onPointerMove: y || o.getDisablePointerSelection() ? void 0 : v, onClick: y ? void 0 : S }, e.children);
|
|
796
796
|
}), Dr = p.forwardRef((e, a) => {
|
|
797
|
-
let { heading: t, children: n, forceMount: r, ...l } = e, s = ie(), o = p.useRef(null), f = p.useRef(null), u = ie(), w =
|
|
797
|
+
let { heading: t, children: n, forceMount: r, ...l } = e, s = ie(), o = p.useRef(null), f = p.useRef(null), u = ie(), w = ve(), c = Y((m) => r || w.filter() === !1 ? !0 : m.search ? m.filtered.groups.has(s) : !0);
|
|
798
798
|
ae(() => w.group(s), []), Dt(s, o, [e.value, e.heading, f]);
|
|
799
|
-
let
|
|
800
|
-
return p.createElement(Q.div, { ref: he(o, a), ...l, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ne(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(Tt.Provider, { value:
|
|
799
|
+
let b = p.useMemo(() => ({ id: s, forceMount: r }), [r]);
|
|
800
|
+
return p.createElement(Q.div, { ref: he(o, a), ...l, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ne(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(Tt.Provider, { value: b }, m))));
|
|
801
801
|
}), Rr = p.forwardRef((e, a) => {
|
|
802
802
|
let { alwaysRender: t, ...n } = e, r = p.useRef(null), l = Y((s) => !s.search);
|
|
803
803
|
return !t && !l ? null : p.createElement(Q.div, { ref: he(r, a), ...n, "cmdk-separator": "", role: "separator" });
|
|
804
804
|
}), Pr = p.forwardRef((e, a) => {
|
|
805
|
-
let { onValueChange: t, ...n } = e, r = e.value != null, l = Ge(), s = Y((u) => u.search), o = Y((u) => u.selectedItemId), f =
|
|
805
|
+
let { onValueChange: t, ...n } = e, r = e.value != null, l = Ge(), s = Y((u) => u.search), o = Y((u) => u.selectedItemId), f = ve();
|
|
806
806
|
return p.useEffect(() => {
|
|
807
807
|
e.value != null && l.setState("search", e.value);
|
|
808
808
|
}, [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) => {
|
|
809
809
|
r || l.setState("search", u.target.value), t == null || t(u.target.value);
|
|
810
810
|
} });
|
|
811
811
|
}), _r = p.forwardRef((e, a) => {
|
|
812
|
-
let { children: t, label: n = "Suggestions", ...r } = e, l = p.useRef(null), s = p.useRef(null), o = Y((u) => u.selectedItemId), f =
|
|
812
|
+
let { children: t, label: n = "Suggestions", ...r } = e, l = p.useRef(null), s = p.useRef(null), o = Y((u) => u.selectedItemId), f = ve();
|
|
813
813
|
return p.useEffect(() => {
|
|
814
814
|
if (s.current && l.current) {
|
|
815
|
-
let u = s.current, w = l.current, c,
|
|
815
|
+
let u = s.current, w = l.current, c, b = new ResizeObserver(() => {
|
|
816
816
|
c = requestAnimationFrame(() => {
|
|
817
817
|
let m = u.offsetHeight;
|
|
818
818
|
w.style.setProperty("--cmdk-list-height", m.toFixed(1) + "px");
|
|
819
819
|
});
|
|
820
820
|
});
|
|
821
|
-
return
|
|
822
|
-
cancelAnimationFrame(c),
|
|
821
|
+
return b.observe(u), () => {
|
|
822
|
+
cancelAnimationFrame(c), b.unobserve(u);
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
825
|
}, []), p.createElement(Q.div, { ref: he(l, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": o, "aria-label": n, id: f.listId }, Ne(e, (u) => p.createElement("div", { ref: he(s, f.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
@@ -830,14 +830,14 @@ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-head
|
|
|
830
830
|
let { progress: t, children: n, label: r = "Loading...", ...l } = e;
|
|
831
831
|
return p.createElement(Q.div, { ref: a, ...l, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, Ne(e, (s) => p.createElement("div", { "aria-hidden": !0 }, s)));
|
|
832
832
|
}), B = Object.assign(kt, { List: _r, Item: Ar, Input: Pr, Group: Dr, Separator: Rr, Dialog: Lr, Empty: zr, Loading: Fr });
|
|
833
|
-
function
|
|
833
|
+
function Ur(e, a) {
|
|
834
834
|
let t = e.nextElementSibling;
|
|
835
835
|
for (; t; ) {
|
|
836
836
|
if (t.matches(a)) return t;
|
|
837
837
|
t = t.nextElementSibling;
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function Or(e, a) {
|
|
841
841
|
let t = e.previousElementSibling;
|
|
842
842
|
for (; t; ) {
|
|
843
843
|
if (t.matches(a)) return t;
|
|
@@ -860,7 +860,7 @@ function Y(e) {
|
|
|
860
860
|
return p.useSyncExternalStore(a.subscribe, t, t);
|
|
861
861
|
}
|
|
862
862
|
function Dt(e, a, t, n = []) {
|
|
863
|
-
let r = p.useRef(), l =
|
|
863
|
+
let r = p.useRef(), l = ve();
|
|
864
864
|
return ae(() => {
|
|
865
865
|
var s;
|
|
866
866
|
let o = (() => {
|
|
@@ -902,7 +902,7 @@ const Rt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
|
902
902
|
));
|
|
903
903
|
Rt.displayName = B.displayName;
|
|
904
904
|
const Pt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
905
|
-
/* @__PURE__ */ i(
|
|
905
|
+
/* @__PURE__ */ i(va, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
906
906
|
/* @__PURE__ */ i(
|
|
907
907
|
B.Input,
|
|
908
908
|
{
|
|
@@ -968,11 +968,11 @@ const Ve = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
|
968
968
|
));
|
|
969
969
|
Ve.displayName = B.Item.displayName;
|
|
970
970
|
function $r(e = {}) {
|
|
971
|
-
const { authToken: a, tokenProps: t } = qe(), n =
|
|
971
|
+
const { authToken: a, tokenProps: t } = qe(), n = O(
|
|
972
972
|
(N) => N.actions.applyResolvedCalendarPreferences
|
|
973
|
-
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = F(!1), [u, w] = F(!1), [c,
|
|
973
|
+
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = F(!1), [u, w] = F(!1), [c, b] = F(!1), [m, S] = F(null), [v, y] = F(null), C = H(l);
|
|
974
974
|
C.current = l, Z(() => {
|
|
975
|
-
y(null), S(null), f(!1), w(!1),
|
|
975
|
+
y(null), S(null), f(!1), w(!1), b(!1);
|
|
976
976
|
}, [l]);
|
|
977
977
|
const P = W(async (N) => {
|
|
978
978
|
const g = Va(await N.json());
|
|
@@ -1006,7 +1006,7 @@ function $r(e = {}) {
|
|
|
1006
1006
|
Z(() => {
|
|
1007
1007
|
r && z();
|
|
1008
1008
|
}, [r, z]);
|
|
1009
|
-
const
|
|
1009
|
+
const U = W(
|
|
1010
1010
|
async (N) => {
|
|
1011
1011
|
if (!l || !s)
|
|
1012
1012
|
return S("Not authenticated"), !1;
|
|
@@ -1046,7 +1046,7 @@ function $r(e = {}) {
|
|
|
1046
1046
|
if (!l || !s)
|
|
1047
1047
|
return S("Not authenticated"), !1;
|
|
1048
1048
|
const N = l;
|
|
1049
|
-
|
|
1049
|
+
b(!0), S(null);
|
|
1050
1050
|
try {
|
|
1051
1051
|
const g = await fetch(
|
|
1052
1052
|
`${s}/v1/user-preferences/calendar`,
|
|
@@ -1064,7 +1064,7 @@ function $r(e = {}) {
|
|
|
1064
1064
|
} catch (g) {
|
|
1065
1065
|
return C.current === N && S(g instanceof Error ? g.message : "Unknown error"), !1;
|
|
1066
1066
|
} finally {
|
|
1067
|
-
C.current === N &&
|
|
1067
|
+
C.current === N && b(!1);
|
|
1068
1068
|
}
|
|
1069
1069
|
}, [
|
|
1070
1070
|
l,
|
|
@@ -1073,12 +1073,12 @@ function $r(e = {}) {
|
|
|
1073
1073
|
P
|
|
1074
1074
|
]);
|
|
1075
1075
|
return {
|
|
1076
|
-
preferences:
|
|
1076
|
+
preferences: v,
|
|
1077
1077
|
isLoading: o,
|
|
1078
1078
|
isSaving: u,
|
|
1079
1079
|
isClearing: c,
|
|
1080
1080
|
error: m,
|
|
1081
|
-
updatePreferences:
|
|
1081
|
+
updatePreferences: U,
|
|
1082
1082
|
clearPreferences: _,
|
|
1083
1083
|
refetch: z
|
|
1084
1084
|
};
|
|
@@ -1147,16 +1147,16 @@ function qr({
|
|
|
1147
1147
|
isClearing: l,
|
|
1148
1148
|
updatePreferences: s,
|
|
1149
1149
|
clearPreferences: o
|
|
1150
|
-
} = $r({ enabled: e }), f =
|
|
1150
|
+
} = $r({ enabled: e }), f = ba(), u = (t == null ? void 0 : t.resolved.tz) || (f == null ? void 0 : f.tz) || "UTC", w = (t == null ? void 0 : t.resolved.weekStart) ?? (f == null ? void 0 : f.weekStart) ?? 1, [c, b] = F((t == null ? void 0 : t.stored) === null), [m, S] = F(!1), [v, y] = F(
|
|
1151
1151
|
u
|
|
1152
1152
|
), [C, P] = F(
|
|
1153
1153
|
w
|
|
1154
|
-
), [z,
|
|
1154
|
+
), [z, U] = F(!1), _ = ee(() => Vr(), []), N = ee(
|
|
1155
1155
|
() => _.filter(
|
|
1156
1156
|
(k) => !Ee.some((oe) => oe.value === k)
|
|
1157
1157
|
),
|
|
1158
1158
|
[_]
|
|
1159
|
-
), g = ee(() => mt(
|
|
1159
|
+
), g = ee(() => mt(v), [v]), I = t != null && t.inherited ? mt(t.inherited.tz) : "UTC", D = t != null && t.inherited ? Kr(t.inherited.weekStart) : "Monday", E = Wr(
|
|
1160
1160
|
t == null ? void 0 : t.inheritedSources
|
|
1161
1161
|
);
|
|
1162
1162
|
Mt.useEffect(() => {
|
|
@@ -1164,7 +1164,7 @@ function qr({
|
|
|
1164
1164
|
S(!1);
|
|
1165
1165
|
return;
|
|
1166
1166
|
}
|
|
1167
|
-
m || (t &&
|
|
1167
|
+
m || (t && b(t.stored === null), y(u), P(w));
|
|
1168
1168
|
}, [
|
|
1169
1169
|
e,
|
|
1170
1170
|
m,
|
|
@@ -1178,7 +1178,7 @@ function qr({
|
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
1180
|
c ? await o() ? (G.success("Now using default settings."), a()) : G.error("Failed to save preferences. Please try again.") : await s({
|
|
1181
|
-
tz:
|
|
1181
|
+
tz: v,
|
|
1182
1182
|
weekStart: C
|
|
1183
1183
|
}) ? (G.success("Preferences saved."), a()) : G.error("Failed to save preferences. Please try again.");
|
|
1184
1184
|
}, $ = () => {
|
|
@@ -1191,7 +1191,7 @@ function qr({
|
|
|
1191
1191
|
{
|
|
1192
1192
|
value: c ? "defaults" : "custom",
|
|
1193
1193
|
onValueChange: (k) => {
|
|
1194
|
-
S(!0),
|
|
1194
|
+
S(!0), b(k === "defaults");
|
|
1195
1195
|
},
|
|
1196
1196
|
className: "space-y-0.5",
|
|
1197
1197
|
children: [
|
|
@@ -1204,7 +1204,7 @@ function qr({
|
|
|
1204
1204
|
c && "bg-muted/50"
|
|
1205
1205
|
),
|
|
1206
1206
|
onClick: () => {
|
|
1207
|
-
S(!0),
|
|
1207
|
+
S(!0), b(!0);
|
|
1208
1208
|
},
|
|
1209
1209
|
children: [
|
|
1210
1210
|
/* @__PURE__ */ i(
|
|
@@ -1239,7 +1239,7 @@ function qr({
|
|
|
1239
1239
|
!c && "bg-muted/50"
|
|
1240
1240
|
),
|
|
1241
1241
|
onClick: () => {
|
|
1242
|
-
S(!0),
|
|
1242
|
+
S(!0), b(!1);
|
|
1243
1243
|
},
|
|
1244
1244
|
children: [
|
|
1245
1245
|
/* @__PURE__ */ i(
|
|
@@ -1271,7 +1271,7 @@ function qr({
|
|
|
1271
1271
|
La,
|
|
1272
1272
|
{
|
|
1273
1273
|
open: z,
|
|
1274
|
-
onOpenChange:
|
|
1274
|
+
onOpenChange: U,
|
|
1275
1275
|
modal: !0,
|
|
1276
1276
|
children: [
|
|
1277
1277
|
/* @__PURE__ */ i(za, { asChild: !0, children: /* @__PURE__ */ h(
|
|
@@ -1303,7 +1303,7 @@ function qr({
|
|
|
1303
1303
|
{
|
|
1304
1304
|
value: `${k.value} ${k.label}`,
|
|
1305
1305
|
onSelect: () => {
|
|
1306
|
-
S(!0), y(k.value),
|
|
1306
|
+
S(!0), y(k.value), U(!1);
|
|
1307
1307
|
},
|
|
1308
1308
|
children: [
|
|
1309
1309
|
/* @__PURE__ */ i(
|
|
@@ -1311,7 +1311,7 @@ function qr({
|
|
|
1311
1311
|
{
|
|
1312
1312
|
className: j(
|
|
1313
1313
|
"h-3.5 w-3.5",
|
|
1314
|
-
|
|
1314
|
+
v === k.value ? "opacity-100" : "opacity-0"
|
|
1315
1315
|
)
|
|
1316
1316
|
}
|
|
1317
1317
|
),
|
|
@@ -1327,7 +1327,7 @@ function qr({
|
|
|
1327
1327
|
{
|
|
1328
1328
|
value: k,
|
|
1329
1329
|
onSelect: () => {
|
|
1330
|
-
S(!0), y(k),
|
|
1330
|
+
S(!0), y(k), U(!1);
|
|
1331
1331
|
},
|
|
1332
1332
|
children: [
|
|
1333
1333
|
/* @__PURE__ */ i(
|
|
@@ -1335,7 +1335,7 @@ function qr({
|
|
|
1335
1335
|
{
|
|
1336
1336
|
className: j(
|
|
1337
1337
|
"h-3.5 w-3.5",
|
|
1338
|
-
|
|
1338
|
+
v === k ? "opacity-100" : "opacity-0"
|
|
1339
1339
|
)
|
|
1340
1340
|
}
|
|
1341
1341
|
),
|
|
@@ -1411,13 +1411,13 @@ function qr({
|
|
|
1411
1411
|
] });
|
|
1412
1412
|
}
|
|
1413
1413
|
function Hr(e = {}) {
|
|
1414
|
-
const { authToken: a, tokenProps: t } = qe(), n =
|
|
1414
|
+
const { authToken: a, tokenProps: t } = qe(), n = O(
|
|
1415
1415
|
(g) => g.actions.applyResolvedValueFormatPreferences
|
|
1416
1416
|
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = H(l);
|
|
1417
1417
|
o.current = l;
|
|
1418
|
-
const [f, u] = F(null), [w, c] = F(!1), [
|
|
1418
|
+
const [f, u] = F(null), [w, c] = F(!1), [b, m] = F(!1), [S, v] = F(!1), [y, C] = F(null);
|
|
1419
1419
|
Z(() => {
|
|
1420
|
-
u(null), C(null), c(!1), m(!1),
|
|
1420
|
+
u(null), C(null), c(!1), m(!1), v(!1);
|
|
1421
1421
|
}, [l]);
|
|
1422
1422
|
const P = W(async (g) => {
|
|
1423
1423
|
const I = Ma(await g.json());
|
|
@@ -1446,7 +1446,7 @@ function Hr(e = {}) {
|
|
|
1446
1446
|
return P(D);
|
|
1447
1447
|
},
|
|
1448
1448
|
[l, s, P]
|
|
1449
|
-
),
|
|
1449
|
+
), U = W(async () => {
|
|
1450
1450
|
if (!r || !l || !s) return;
|
|
1451
1451
|
const g = l;
|
|
1452
1452
|
c(!0), C(null);
|
|
@@ -1460,8 +1460,8 @@ function Hr(e = {}) {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
}, [l, s, r, z]);
|
|
1462
1462
|
Z(() => {
|
|
1463
|
-
r &&
|
|
1464
|
-
}, [r,
|
|
1463
|
+
r && U();
|
|
1464
|
+
}, [r, U]);
|
|
1465
1465
|
const _ = W(
|
|
1466
1466
|
async (g) => {
|
|
1467
1467
|
const I = l;
|
|
@@ -1478,25 +1478,25 @@ function Hr(e = {}) {
|
|
|
1478
1478
|
[l, n, z]
|
|
1479
1479
|
), N = W(async () => {
|
|
1480
1480
|
const g = l;
|
|
1481
|
-
|
|
1481
|
+
v(!0), C(null);
|
|
1482
1482
|
try {
|
|
1483
1483
|
const I = await z("DELETE");
|
|
1484
1484
|
return o.current !== g ? !1 : (u(I), n(I.resolved, I.sources), !0);
|
|
1485
1485
|
} catch (I) {
|
|
1486
1486
|
return o.current === g && C(I instanceof Error ? I.message : "Unknown error"), !1;
|
|
1487
1487
|
} finally {
|
|
1488
|
-
o.current === g &&
|
|
1488
|
+
o.current === g && v(!1);
|
|
1489
1489
|
}
|
|
1490
1490
|
}, [l, n, z]);
|
|
1491
1491
|
return {
|
|
1492
1492
|
preferences: f,
|
|
1493
1493
|
isLoading: w,
|
|
1494
|
-
isSaving:
|
|
1494
|
+
isSaving: b,
|
|
1495
1495
|
isClearing: S,
|
|
1496
1496
|
error: y,
|
|
1497
1497
|
updatePreferences: _,
|
|
1498
1498
|
clearPreferences: N,
|
|
1499
|
-
refetch:
|
|
1499
|
+
refetch: U
|
|
1500
1500
|
};
|
|
1501
1501
|
}
|
|
1502
1502
|
const We = [
|
|
@@ -1510,9 +1510,10 @@ const We = [
|
|
|
1510
1510
|
{ value: "pt-BR", label: "Portuguese (Brazil)" },
|
|
1511
1511
|
{ value: "ja-JP", label: "Japanese (Japan)" },
|
|
1512
1512
|
{ value: "en-IN", label: "English (India)" },
|
|
1513
|
+
{ value: "en-AU", label: "English (Australia)" },
|
|
1513
1514
|
{ value: "en-NZ", label: "English (New Zealand)" },
|
|
1514
1515
|
{ value: "mi-NZ", label: "Māori (New Zealand)" }
|
|
1515
|
-
],
|
|
1516
|
+
], Ut = /* @__PURE__ */ new Set([
|
|
1516
1517
|
"USD",
|
|
1517
1518
|
"EUR",
|
|
1518
1519
|
"GBP",
|
|
@@ -1524,8 +1525,8 @@ const We = [
|
|
|
1524
1525
|
"BRL",
|
|
1525
1526
|
"KWD"
|
|
1526
1527
|
]), Gr = ja(), Jr = Gr.filter(
|
|
1527
|
-
(e) => !
|
|
1528
|
-
),
|
|
1528
|
+
(e) => !Ut.has(e)
|
|
1529
|
+
), Ot = [
|
|
1529
1530
|
{ value: "short", label: "Short" },
|
|
1530
1531
|
{ value: "medium", label: "Medium" },
|
|
1531
1532
|
{ value: "long", label: "Long" }
|
|
@@ -1550,7 +1551,7 @@ function Ke(e) {
|
|
|
1550
1551
|
}
|
|
1551
1552
|
function _e(e) {
|
|
1552
1553
|
var a;
|
|
1553
|
-
return ((a =
|
|
1554
|
+
return ((a = Ot.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
|
|
1554
1555
|
}
|
|
1555
1556
|
function Xr(e) {
|
|
1556
1557
|
const a = We.find((t) => t.value === e);
|
|
@@ -1583,7 +1584,7 @@ function ze({
|
|
|
1583
1584
|
disabled: s,
|
|
1584
1585
|
onValueChange: o,
|
|
1585
1586
|
children: [
|
|
1586
|
-
/* @__PURE__ */ i(
|
|
1587
|
+
/* @__PURE__ */ i(Ue, { id: e, size: "xs", children: /* @__PURE__ */ i(Oe, { children: f }) }),
|
|
1587
1588
|
/* @__PURE__ */ h(Me, { children: [
|
|
1588
1589
|
/* @__PURE__ */ i(X, { 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: [
|
|
1589
1590
|
/* @__PURE__ */ h("span", { children: [
|
|
@@ -1595,7 +1596,7 @@ function ze({
|
|
|
1595
1596
|
] }),
|
|
1596
1597
|
/* @__PURE__ */ i("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[n] })
|
|
1597
1598
|
] }) }),
|
|
1598
|
-
|
|
1599
|
+
Ot.map((u) => /* @__PURE__ */ i(
|
|
1599
1600
|
X,
|
|
1600
1601
|
{
|
|
1601
1602
|
value: u.value,
|
|
@@ -1621,28 +1622,28 @@ function Zr({
|
|
|
1621
1622
|
disabled: r
|
|
1622
1623
|
}) {
|
|
1623
1624
|
var N, g, I, D;
|
|
1624
|
-
const l = de(), s = de(), o = de(), f = de(), u = de(), c = (e.locale === void 0 ? void 0 : wt(e.locale)) ?? a.locale,
|
|
1625
|
+
const l = de(), s = de(), o = de(), f = de(), u = de(), c = (e.locale === void 0 ? void 0 : wt(e.locale)) ?? a.locale, b = e.defaultCurrency ?? a.defaultCurrency, m = {
|
|
1625
1626
|
locale: c,
|
|
1626
1627
|
dateStyle: e.dateStyle ?? a.dateStyle,
|
|
1627
1628
|
dateTime: {
|
|
1628
1629
|
dateStyle: ((N = e.dateTime) == null ? void 0 : N.dateStyle) ?? a.dateTime.dateStyle,
|
|
1629
1630
|
timeStyle: ((g = e.dateTime) == null ? void 0 : g.timeStyle) ?? a.dateTime.timeStyle
|
|
1630
1631
|
},
|
|
1631
|
-
defaultCurrency:
|
|
1632
|
+
defaultCurrency: b
|
|
1632
1633
|
}, S = new Intl.NumberFormat(c, {
|
|
1633
1634
|
style: "currency",
|
|
1634
|
-
currency:
|
|
1635
|
-
}).format(1e3),
|
|
1635
|
+
currency: b
|
|
1636
|
+
}).format(1e3), v = we({
|
|
1636
1637
|
preferences: m,
|
|
1637
1638
|
calendar: { tz: "UTC" }
|
|
1638
1639
|
}), y = ce({
|
|
1639
1640
|
value: ft,
|
|
1640
1641
|
metadata: { kind: "raw_temporal", valueKind: "date" },
|
|
1641
|
-
format:
|
|
1642
|
+
format: v
|
|
1642
1643
|
}).text, C = ce({
|
|
1643
1644
|
value: Pe,
|
|
1644
1645
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1645
|
-
format:
|
|
1646
|
+
format: v
|
|
1646
1647
|
}).text, P = Le(
|
|
1647
1648
|
(E) => ce({
|
|
1648
1649
|
value: ft,
|
|
@@ -1664,7 +1665,7 @@ function Zr({
|
|
|
1664
1665
|
calendar: { tz: "UTC" }
|
|
1665
1666
|
})
|
|
1666
1667
|
}).text
|
|
1667
|
-
),
|
|
1668
|
+
), U = Le(
|
|
1668
1669
|
(E) => ce({
|
|
1669
1670
|
value: Pe,
|
|
1670
1671
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
@@ -1706,7 +1707,7 @@ function Zr({
|
|
|
1706
1707
|
locale: E === "inherit" ? void 0 : E
|
|
1707
1708
|
}),
|
|
1708
1709
|
children: [
|
|
1709
|
-
/* @__PURE__ */ i(
|
|
1710
|
+
/* @__PURE__ */ i(Ue, { id: l, size: "xs", children: /* @__PURE__ */ i(Oe, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Xr(e.locale) }) }),
|
|
1710
1711
|
/* @__PURE__ */ h(Me, { children: [
|
|
1711
1712
|
/* @__PURE__ */ h(X, { value: "inherit", children: [
|
|
1712
1713
|
"Inherited from ",
|
|
@@ -1770,7 +1771,7 @@ function Zr({
|
|
|
1770
1771
|
value: (D = e.dateTime) == null ? void 0 : D.timeStyle,
|
|
1771
1772
|
inherited: a.dateTime.timeStyle,
|
|
1772
1773
|
inheritedSource: t.dateTime.timeStyle,
|
|
1773
|
-
examples:
|
|
1774
|
+
examples: U,
|
|
1774
1775
|
disabled: r,
|
|
1775
1776
|
onValueChange: (E) => _("timeStyle", E)
|
|
1776
1777
|
}
|
|
@@ -1795,7 +1796,7 @@ function Zr({
|
|
|
1795
1796
|
defaultCurrency: E === "inherit" ? void 0 : E
|
|
1796
1797
|
}),
|
|
1797
1798
|
children: [
|
|
1798
|
-
/* @__PURE__ */ i(
|
|
1799
|
+
/* @__PURE__ */ i(Ue, { id: s, size: "xs", children: /* @__PURE__ */ i(Oe, { children: e.defaultCurrency === void 0 ? `Inherited · ${a.defaultCurrency}` : e.defaultCurrency }) }),
|
|
1799
1800
|
/* @__PURE__ */ h(Me, { children: [
|
|
1800
1801
|
/* @__PURE__ */ h(X, { value: "inherit", children: [
|
|
1801
1802
|
"Inherited from ",
|
|
@@ -1804,7 +1805,7 @@ function Zr({
|
|
|
1804
1805
|
" ",
|
|
1805
1806
|
a.defaultCurrency
|
|
1806
1807
|
] }),
|
|
1807
|
-
[...
|
|
1808
|
+
[...Ut].map((E) => /* @__PURE__ */ i(X, { value: E, children: E }, E)),
|
|
1808
1809
|
Jr.map((E) => /* @__PURE__ */ i(X, { value: E, children: E }, E))
|
|
1809
1810
|
] })
|
|
1810
1811
|
]
|
|
@@ -1867,7 +1868,7 @@ function Qr({
|
|
|
1867
1868
|
active: e,
|
|
1868
1869
|
onClose: a
|
|
1869
1870
|
}) {
|
|
1870
|
-
var o, f, u, w, c,
|
|
1871
|
+
var o, f, u, w, c, b, m;
|
|
1871
1872
|
const { preferences: t, isLoading: n, isSaving: r, updatePreferences: l } = Hr({ enabled: e });
|
|
1872
1873
|
if (!e) return null;
|
|
1873
1874
|
if (!t)
|
|
@@ -1885,7 +1886,7 @@ function Qr({
|
|
|
1885
1886
|
((o = t.stored) == null ? void 0 : o.locale) ?? "",
|
|
1886
1887
|
((f = t.stored) == null ? void 0 : f.dateStyle) ?? "",
|
|
1887
1888
|
((w = (u = t.stored) == null ? void 0 : u.dateTime) == null ? void 0 : w.dateStyle) ?? "",
|
|
1888
|
-
((
|
|
1889
|
+
((b = (c = t.stored) == null ? void 0 : c.dateTime) == null ? void 0 : b.timeStyle) ?? "",
|
|
1889
1890
|
((m = t.stored) == null ? void 0 : m.defaultCurrency) ?? ""
|
|
1890
1891
|
].join(":");
|
|
1891
1892
|
return /* @__PURE__ */ i(
|
|
@@ -1914,11 +1915,11 @@ function en({
|
|
|
1914
1915
|
...r.dateStyle !== void 0 ? { dateStyle: r.dateStyle } : {},
|
|
1915
1916
|
...r.dateTime ? { dateTime: { ...r.dateTime } } : {},
|
|
1916
1917
|
...r.defaultCurrency !== void 0 ? { defaultCurrency: r.defaultCurrency } : {}
|
|
1917
|
-
},
|
|
1918
|
-
(
|
|
1918
|
+
}, b = ht.filter(
|
|
1919
|
+
(v) => pt(r, v) === void 0 && pt(e.stored, v) !== void 0
|
|
1919
1920
|
), m = {
|
|
1920
1921
|
...Object.keys(c).length > 0 ? { set: c } : {},
|
|
1921
|
-
...
|
|
1922
|
+
...b.length > 0 ? { clear: b } : {}
|
|
1922
1923
|
};
|
|
1923
1924
|
(Object.keys(m).length === 0 ? !0 : await t(m)) ? (G.success("Display format preferences saved."), n()) : G.error("Failed to save preferences. Please try again.");
|
|
1924
1925
|
}, f = async () => {
|
|
@@ -1987,8 +1988,8 @@ function yn({
|
|
|
1987
1988
|
/* @__PURE__ */ i(xa, { className: "text-[15px]", children: "Report preferences" }),
|
|
1988
1989
|
/* @__PURE__ */ i(Ca, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
|
|
1989
1990
|
] }),
|
|
1990
|
-
/* @__PURE__ */ h(
|
|
1991
|
-
/* @__PURE__ */ h(
|
|
1991
|
+
/* @__PURE__ */ h(Ua, { value: t, onValueChange: n, children: [
|
|
1992
|
+
/* @__PURE__ */ h(Oa, { variant: "underline", className: "w-full justify-start", children: [
|
|
1992
1993
|
/* @__PURE__ */ i(rt, { value: "display", children: "Display formats" }),
|
|
1993
1994
|
/* @__PURE__ */ i(rt, { value: "calendar", children: "Calendar" })
|
|
1994
1995
|
] }),
|
|
@@ -2021,7 +2022,7 @@ export {
|
|
|
2021
2022
|
$e as e,
|
|
2022
2023
|
Ve as f,
|
|
2023
2024
|
rr as g,
|
|
2024
|
-
|
|
2025
|
+
bn as h,
|
|
2025
2026
|
dr as i,
|
|
2026
2027
|
cr as u
|
|
2027
2028
|
};
|