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