@hanzo/dev 4.2.0 → 4.2.2
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/{BinaryViewer-CmFUK4zZ.js → BinaryViewer-CeQaKnXQ.js} +19 -19
- package/dist/{ChatMarkdown-nvEI7iCv.js → ChatMarkdown-DqKVAYd6.js} +2460 -2460
- package/dist/{DevicePanel-v5e3sEIf.js → DevicePanel-D-pksK3r.js} +532 -532
- package/dist/{DeviceStreamView-CCIfmbxH.js → DeviceStreamView-DsCoOzDV.js} +377 -377
- package/dist/{DiffCommentAnnotation-BPTN_2a6.js → DiffCommentAnnotation-CCtanhmq.js} +227 -227
- package/dist/{DiffFileTree-B_br90vY.js → DiffFileTree-BhEDIwzm.js} +13 -13
- package/dist/{DiffPanel-V5R5TPuK.js → DiffPanel-BPZ6Ru_G.js} +328 -328
- package/dist/{DiffWorkerPoolProvider-BwFR-Fc9.js → DiffWorkerPoolProvider-8Qh-Y5iP.js} +3 -3
- package/dist/{DocumentPages-VSn83vty.js → DocumentPages-MN1xyIRb.js} +3 -3
- package/dist/{ExpandedImageDialog-CAorLacL.js → ExpandedImageDialog-tCY2TFXU.js} +404 -404
- package/dist/{FileExplorerPane-CeHulcPz.js → FileExplorerPane-BgJw-BA4.js} +4 -4
- package/dist/{FilePreviewPanel-BVNLvWOc.js → FilePreviewPanel-DHteid8j.js} +1089 -1089
- package/dist/{FontFilePreview-Dj8Blcay.js → FontFilePreview-COxgoDy5.js} +2 -2
- package/dist/{FontViewer-CLDdwhSr.js → FontViewer-jxARaj1f.js} +5 -5
- package/dist/{HanzoConnectAccountPages-BEzYfu2l.js → HanzoConnectAccountPages-BM2mB27b.js} +357 -357
- package/dist/{HanzoConnectSidebarSignIn-BhD6-Up5.js → HanzoConnectSidebarSignIn-BSOkKAjH.js} +3 -3
- package/dist/{Icons-CvSmt8vD.js → Icons-CdegMw5l.js} +1 -1
- package/dist/{LargeTextViewer-DfFnYGCw.js → LargeTextViewer-BX5-yWcy.js} +8 -8
- package/dist/{MermaidDiagram-CTolIzQD.js → MermaidDiagram-sVLnox7j.js} +8 -8
- package/dist/{MermaidFilePreview-CP2zP4FU.js → MermaidFilePreview-BqB2exZU.js} +2 -2
- package/dist/{MermaidViewer-BDfYkS9E.js → MermaidViewer-B0WYx1jk.js} +3 -3
- package/dist/{NotebookPreview-Cybs5uM0.js → NotebookPreview-B_7pSd7A.js} +10 -10
- package/dist/{OfficeFilePreview-7JsmSoKU.js → OfficeFilePreview-BJsNoaju.js} +2 -2
- package/dist/{OfficeViewer-CJoojlJK.js → OfficeViewer-TgdFnOtV.js} +10 -10
- package/dist/{OpenInPicker-BIMWUxBP.js → OpenInPicker-B3gPcFs6.js} +287 -287
- package/dist/{OpenXmlOfficeViewer-C24Kj8DM.js → OpenXmlOfficeViewer-C18a0NFP.js} +4 -4
- package/dist/{PdfViewer-Cf1iD759.js → PdfViewer-BanXvPmz.js} +16 -16
- package/dist/{PreviewFaviconIcon-zFOuzIxe.js → PreviewFaviconIcon-Dzjf4QXZ.js} +892 -892
- package/dist/{PreviewImage-oY5YnuTr.js → PreviewImage-Ct8eWJb8.js} +3 -3
- package/dist/{PreviewImageContent-n6eLzY99.js → PreviewImageContent-Dd8dzt9u.js} +3 -3
- package/dist/{PreviewPanel-Bo4Lt02m.js → PreviewPanel-BnsoHObW.js} +489 -489
- package/dist/{PreviewPanelShell-DhXLeN5j.js → PreviewPanelShell-Dezxjg0T.js} +71 -71
- package/dist/{ProjectIconPickerDialog-D0kFzt8f.js → ProjectIconPickerDialog-LomrzROv.js} +29 -29
- package/dist/{ProjectMonogram-D35xrrXQ.js → ProjectMonogram-D21--FQY.js} +1 -1
- package/dist/{ProviderAuthTerminal-DfsXnu7A.js → ProviderAuthTerminal-CYalqlUB.js} +3 -3
- package/dist/{PullRequestCodeTab-Dv_0kVad.js → PullRequestCodeTab-Jt9jdq55.js} +476 -476
- package/dist/{PullRequestReviewAnnotation-LeuwO-iH.js → PullRequestReviewAnnotation-xg3n0doV.js} +334 -334
- package/dist/{ReadOnlySourcePreview-D__IA5g1.js → ReadOnlySourcePreview-BYlRPbKI.js} +5 -5
- package/dist/{RelativeTime-BMRprQS8.js → RelativeTime-DQhoNsWZ.js} +2 -2
- package/dist/{RightPanelResizeHandle-BLbSz-gk.js → RightPanelResizeHandle-PumvYb9P.js} +2 -2
- package/dist/{ThemeEditorPanel-CUDdsRsE.js → ThemeEditorPanel-BmXXpaCI.js} +196 -196
- package/dist/{ThreadTerminalDrawer-BF3Ix0q_.js → ThreadTerminalDrawer-Cf4l2axO.js} +461 -461
- package/dist/{VirtualTablePreview-dajviAfu.js → VirtualTablePreview-mA6DOFwb.js} +1 -1
- package/dist/{anchoredCopyToast-DnUtg1n_.js → anchoredCopyToast-BVa_dlBU.js} +2 -2
- package/dist/{assetUrls-DkY7vXfM.js → assetUrls-D8lRk7Xd.js} +45 -45
- package/dist/{browserLinkTarget-CA46wnQC.js → browserLinkTarget-CCzAioAu.js} +18 -18
- package/dist/builder/api/models.d.ts +2 -0
- package/dist/builder/api/models.js +6 -1
- package/dist/builder/api/sandbox.d.ts +2 -0
- package/dist/builder/api/sandbox.js +3 -1
- package/dist/builder/desk.d.ts +6 -0
- package/dist/builder/desk.js +79 -14
- package/dist/builder/mind.d.ts +5 -5
- package/dist/builder/mind.js +35 -14
- package/dist/builder/pane.d.ts +1 -1
- package/dist/builder/pane.js +1 -1
- package/dist/builder/panel.js +5 -5
- package/dist/builder/preview-fallback.d.ts +47 -0
- package/dist/builder/preview-fallback.js +341 -0
- package/dist/{changedFileKind-D6QYvIez.js → changedFileKind-OIp-fuQd.js} +5 -5
- package/dist/{collapsible-DFT41MdC.js → collapsible-CDT6JKbk.js} +1 -1
- package/dist/{color-picker-CshqBbpY.js → color-picker-kSVcH92L.js} +16 -16
- package/dist/core.d.ts +38 -0
- package/dist/core.js +1 -1
- package/dist/{decodeImagePreview-DnfFEjhw.js → decodeImagePreview-DbkSuh7q.js} +2 -2
- package/dist/{delimitedPreview-BiEpdYOj.js → delimitedPreview-DbbXcqOT.js} +1 -1
- package/dist/{dialog-DhQtWGRa.js → dialog-EmpqFZiK.js} +40 -40
- package/dist/{embed-c030vUqM.js → embed-CzXFS50X.js} +39626 -38922
- package/dist/{empty-Bm5EzcG8.js → empty-ChM6gdzn.js} +1 -1
- package/dist/{errors-DrFQSJW3.js → errors-D8_Zn8KN.js} +2 -2
- package/dist/{fileContextMenu-BBo91omq.js → fileContextMenu-hdALQktP.js} +54 -54
- package/dist/{fileExplorerLabel-AikEChiS.js → fileExplorerLabel-DMdkA7jY.js} +507 -507
- package/dist/{fileSurfaceChrome-Cqkvn8RQ.js → fileSurfaceChrome-BDyKklTq.js} +26 -26
- package/dist/{hanzoWebAnalytics-CCxpTzcI.js → hanzoWebAnalytics-B1eETW-7.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/{input-group-DEJEuwc9.js → input-group-BZ_QN-y7.js} +1 -1
- package/dist/{keybindings-C5tK_GAk.js → keybindings-D0pBlT1k.js} +7812 -7806
- package/dist/keymap.js +1 -1
- package/dist/{lucideIconByName-DUaXKH0V.js → lucideIconByName-CXY44V8P.js} +6835 -6848
- package/dist/{mediaReference-Bt_mh-ag.js → mediaReference-3wc4ZfY8.js} +95 -95
- package/dist/mediaSource-jW5c7b4r.js +70 -0
- package/dist/{modelPickerVisibility-Jue3CLfc.js → modelPickerVisibility-DBTc5r1G.js} +1 -1
- package/dist/{network-BbwqRm8c.js → network-wuXD7-is.js} +1 -1
- package/dist/{popover-anNQdce7.js → popover-BAyP2Tdr.js} +1 -1
- package/dist/{presentation-D9mVPBHm.js → presentation-68y8EAuH.js} +299 -299
- package/dist/{previewFailureMessages-BKpsSGX5.js → previewFailureMessages-CFguipaK.js} +3 -3
- package/dist/query-BPk2W3QN.js +63 -0
- package/dist/{readBinaryPreview-BAQ4fFjm.js → readBinaryPreview-DgDAUfzQ.js} +2 -2
- package/dist/{refresh-icon-BYx64to1.js → refresh-icon-Vo5ImiQL.js} +1 -1
- package/dist/{scroll-area-ChvX8uOh.js → scroll-area-CEoyjC7h.js} +1 -1
- package/dist/{select-DumYjny_.js → select-DLFnkZsI.js} +2 -2
- package/dist/{session-_kmiSv2A.js → session-Decc4Fo5.js} +1063 -1063
- package/dist/{skeleton-CJqwfMSF.js → skeleton-BOKpAZv6.js} +1 -1
- package/dist/{switch-COwevwaq.js → switch-DjpPjtQN.js} +2 -2
- package/dist/{themePalette-Dl_7omVL.js → themePalette-C-GtwwqV.js} +977 -977
- package/dist/{threadSearch-BHyWwcV3.js → threadSearch-sHEENLiT.js} +162 -162
- package/dist/{toggle-CEO6qTxB.js → toggle-B4F0EEtI.js} +1 -1
- package/dist/{toggle-group-BHovdMDl.js → toggle-group-l8hRPswr.js} +2 -2
- package/dist/{use-atom-command-ByoYq_K6.js → use-atom-command-XemtT1Gv.js} +1 -1
- package/dist/{useAriaLabelledBy-DPSISlnL.js → useAriaLabelledBy-CibvSz-b.js} +1 -1
- package/dist/{useFileMetadata-e7zsixVX.js → useFileMetadata-ChvPTfBY.js} +33 -33
- package/dist/{useFloatingRootContext-CJ9stHca.js → useFloatingRootContext-ppoGvqar.js} +1 -1
- package/dist/{useLiveRefresh-BkKJKXhH.js → useLiveRefresh-aHkPuz6N.js} +172 -172
- package/dist/{useNextRenderData-CyUmSAgz.js → useNextRenderData-Jm142a1q.js} +1 -1
- package/dist/{useSettings-DYG9Dmro.js → useSettings-Due4XCTB.js} +139 -139
- package/dist/{useTextFieldSpeech-COa9XcRx.js → useTextFieldSpeech-XN9r-f-r.js} +1404 -1404
- package/dist/useTheme-B9hvAuzL.js +411 -0
- package/dist/{utils-515nQ17G.js → utils-DtKQl-D3.js} +6184 -6172
- package/dist/{wizard-i86ViMRc.js → wizard-DjD4UNew.js} +3 -3
- package/dist/{workspaceFocus-BV1_9KiH.js → workspaceFocus-MR1plm6A.js} +144 -144
- package/dist/{zap-e0OsRjBR.js → zap-iwsUKtvA.js} +30 -17
- package/package.json +17 -17
- package/dist/mediaSource-zI7JWid4.js +0 -70
- package/dist/query-BxrrBAp6.js +0 -63
- package/dist/useTheme-D2ZM1gvV.js +0 -376
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import { fp as e } from "./utils-515nQ17G.js";
|
|
2
|
-
import { cd as t, ff as n, hd as r, kd as i, nf as a, rb as o, wd as s } from "./keybindings-C5tK_GAk.js";
|
|
3
|
-
import { F as c, H as l, I as u, L as ee, T as d, b as f, c as te, i as p, k as ne, l as re, n as m, o as h, r as ie, w as ae, x as g } from "./themePalette-Dl_7omVL.js";
|
|
4
|
-
import "./errors-DrFQSJW3.js";
|
|
5
|
-
import { useSyncExternalStore as _ } from "react";
|
|
6
|
-
import { c as oe } from "react/compiler-runtime";
|
|
7
|
-
// src/hooks/useTheme.ts
|
|
8
|
-
var v = "hanzodev:theme", y = "(prefers-color-scheme: dark)", b = {
|
|
9
|
-
theme: "dark",
|
|
10
|
-
resolvedTheme: "dark",
|
|
11
|
-
systemDark: !0,
|
|
12
|
-
followSystem: !1,
|
|
13
|
-
appearanceMode: "dark",
|
|
14
|
-
themeHalves: null
|
|
15
|
-
};
|
|
16
|
-
function se() {
|
|
17
|
-
return x();
|
|
18
|
-
}
|
|
19
|
-
function ce() {
|
|
20
|
-
return typeof window > "u" ? {} : S();
|
|
21
|
-
}
|
|
22
|
-
function x() {
|
|
23
|
-
if (typeof window > "u") return null;
|
|
24
|
-
try {
|
|
25
|
-
return ne(window.localStorage.getItem(p));
|
|
26
|
-
} catch {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function S() {
|
|
31
|
-
try {
|
|
32
|
-
let e = JSON.parse(window.localStorage.getItem("hanzodev:theme-halves:v1") ?? "null");
|
|
33
|
-
if (typeof e != "object" || !e) return {};
|
|
34
|
-
let t = {};
|
|
35
|
-
for (let n of ["light", "dark"]) {
|
|
36
|
-
let r = e[n];
|
|
37
|
-
typeof r == "string" && (t[n] = r);
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
} catch {
|
|
41
|
-
return {};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function C(e) {
|
|
45
|
-
return `${e?.light ?? ""}|${e?.dark ?? ""}`;
|
|
46
|
-
}
|
|
47
|
-
var w = "theme-color", le = `meta[name="${w}"][data-dynamic-theme-color="true"]`, T = class extends i()("ThemeStorageError", {
|
|
48
|
-
operation: r(["read", "write"]),
|
|
49
|
-
storageKey: s,
|
|
50
|
-
theme: n(h),
|
|
51
|
-
cause: t()
|
|
52
|
-
}) {
|
|
53
|
-
get message() {
|
|
54
|
-
return `Failed to ${this.operation} theme preference for ${this.storageKey}.`;
|
|
55
|
-
}
|
|
56
|
-
}, E = a(T), D = class extends i()("DesktopThemeSyncError", {
|
|
57
|
-
theme: h,
|
|
58
|
-
cause: t()
|
|
59
|
-
}) {
|
|
60
|
-
get message() {
|
|
61
|
-
return `Failed to sync the ${this.theme} theme to the desktop shell.`;
|
|
62
|
-
}
|
|
63
|
-
}, ue = a(D), O = [], k = null, A = !0, j = null, M = null, N = null;
|
|
64
|
-
function P() {
|
|
65
|
-
A = !0;
|
|
66
|
-
for (let e of O) e();
|
|
67
|
-
}
|
|
68
|
-
function F() {
|
|
69
|
-
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).matches;
|
|
70
|
-
}
|
|
71
|
-
function de(e) {
|
|
72
|
-
if (typeof window > "u") return e === "system";
|
|
73
|
-
try {
|
|
74
|
-
let e = window.localStorage.getItem(ie);
|
|
75
|
-
if (e === "true") return !0;
|
|
76
|
-
if (e === "false") return !1;
|
|
77
|
-
} catch {}
|
|
78
|
-
return e === "system";
|
|
79
|
-
}
|
|
80
|
-
function fe(e) {
|
|
81
|
-
return e === "light" || e === "dark" || e === "system";
|
|
82
|
-
}
|
|
83
|
-
function I(e) {
|
|
84
|
-
if (typeof window < "u") try {
|
|
85
|
-
let e = window.localStorage.getItem(m);
|
|
86
|
-
if (fe(e)) return e;
|
|
87
|
-
} catch {}
|
|
88
|
-
return de(e) ? "system" : f(e) ?? "light";
|
|
89
|
-
}
|
|
90
|
-
function L(e) {
|
|
91
|
-
if (typeof window < "u") try {
|
|
92
|
-
window.localStorage.setItem(m, e);
|
|
93
|
-
} catch (e) {
|
|
94
|
-
throw new T({
|
|
95
|
-
operation: "write",
|
|
96
|
-
storageKey: m,
|
|
97
|
-
cause: e
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function R() {
|
|
102
|
-
if (typeof window > "u") return b.theme;
|
|
103
|
-
let e;
|
|
104
|
-
try {
|
|
105
|
-
e = window.localStorage.getItem(v);
|
|
106
|
-
} catch (e) {
|
|
107
|
-
throw new T({
|
|
108
|
-
operation: "read",
|
|
109
|
-
storageKey: v,
|
|
110
|
-
cause: e
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
return e !== null && d(e) ? re(e) : b.theme;
|
|
114
|
-
}
|
|
115
|
-
function pe(e) {
|
|
116
|
-
if (typeof window < "u") try {
|
|
117
|
-
window.localStorage.setItem(v, e), N = null;
|
|
118
|
-
} catch (t) {
|
|
119
|
-
throw new T({
|
|
120
|
-
operation: "write",
|
|
121
|
-
storageKey: v,
|
|
122
|
-
theme: e,
|
|
123
|
-
cause: t
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function z() {
|
|
128
|
-
if (N !== null) return b.theme;
|
|
129
|
-
try {
|
|
130
|
-
return R();
|
|
131
|
-
} catch (t) {
|
|
132
|
-
let n = E(t) ? t : new T({
|
|
133
|
-
operation: "read",
|
|
134
|
-
storageKey: v,
|
|
135
|
-
cause: t
|
|
136
|
-
});
|
|
137
|
-
return N = n, console.error(n.message, {
|
|
138
|
-
operation: n.operation,
|
|
139
|
-
storageKey: n.storageKey,
|
|
140
|
-
...e(n)
|
|
141
|
-
}), b.theme;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function me() {
|
|
145
|
-
let e = document.querySelector(le);
|
|
146
|
-
return e || (e = document.createElement("meta"), e.name = w, e.setAttribute("data-dynamic-theme-color", "true"), document.head.append(e), e);
|
|
147
|
-
}
|
|
148
|
-
function B(e) {
|
|
149
|
-
let t = e?.trim().toLowerCase();
|
|
150
|
-
return !t || t === "transparent" || t === "rgba(0, 0, 0, 0)" || t === "rgba(0 0 0 / 0)" ? null : e?.trim() ?? null;
|
|
151
|
-
}
|
|
152
|
-
function he() {
|
|
153
|
-
return document.querySelector("main[data-slot='sidebar-inset']") ?? document.querySelector("[data-slot='sidebar-inner']") ?? document.body;
|
|
154
|
-
}
|
|
155
|
-
function V() {
|
|
156
|
-
if (typeof document > "u" || typeof getComputedStyle > "u") return;
|
|
157
|
-
let e = getComputedStyle(document.documentElement), t = document.documentElement.dataset.themeId ? B(e.getPropertyValue("--app-chrome-background")) : null, n = B(getComputedStyle(he()).backgroundColor), r = B(getComputedStyle(document.body).backgroundColor), i = t ?? n ?? r;
|
|
158
|
-
if (!i) return;
|
|
159
|
-
document.documentElement.style.backgroundColor = i, document.body.style.backgroundColor = i;
|
|
160
|
-
let a = document.querySelectorAll(`meta[name="${w}"]`);
|
|
161
|
-
if (a.length === 0) me().setAttribute("content", i);
|
|
162
|
-
else for (let e of a) e.setAttribute("content", i);
|
|
163
|
-
}
|
|
164
|
-
function H(e, { suppressTransitions: t = !1, preservePreview: n = !0 } = {}) {
|
|
165
|
-
if (typeof document > "u" || typeof window > "u" || n && document.documentElement.dataset?.themeId === "__preview") return;
|
|
166
|
-
let r = I(e), i = r === "system", a = i ? F() : !1, o = x();
|
|
167
|
-
if (M?.theme === e && M.systemDark === a && M.followSystem === i && M.appearanceMode === r && C(M.themeHalves) === C(o)) {
|
|
168
|
-
U(e, i, r);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
t && document.documentElement.classList.add("no-transitions");
|
|
172
|
-
let s = u(e, a, i, r, o);
|
|
173
|
-
te(ee(e, o, s), s), document.documentElement.classList.toggle("dark", s === "dark"), M = {
|
|
174
|
-
theme: e,
|
|
175
|
-
systemDark: a,
|
|
176
|
-
followSystem: i,
|
|
177
|
-
appearanceMode: r,
|
|
178
|
-
themeHalves: o
|
|
179
|
-
}, V(), U(e, i, r), t && (document.documentElement.offsetHeight, requestAnimationFrame(() => {
|
|
180
|
-
document.documentElement.classList.remove("no-transitions");
|
|
181
|
-
}));
|
|
182
|
-
}
|
|
183
|
-
async function ge(e, t, n, r, i = x()) {
|
|
184
|
-
try {
|
|
185
|
-
await e.setTheme(c(t, n, r, i));
|
|
186
|
-
} catch (e) {
|
|
187
|
-
throw new D({
|
|
188
|
-
theme: t,
|
|
189
|
-
cause: e
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
function U(t, n, r) {
|
|
194
|
-
if (typeof window > "u") return;
|
|
195
|
-
let i = window.desktopBridge, a = x(), o = c(t, n, r, a);
|
|
196
|
-
i && typeof i.setTheme == "function" && j !== o && (j = o, ge(i, t, n, r, a).catch((n) => {
|
|
197
|
-
let r = ue(n) ? n : new D({
|
|
198
|
-
theme: t,
|
|
199
|
-
cause: n
|
|
200
|
-
});
|
|
201
|
-
console.error(r.message, {
|
|
202
|
-
theme: r.theme,
|
|
203
|
-
...e(r)
|
|
204
|
-
}), j === o && (j = null);
|
|
205
|
-
}));
|
|
206
|
-
}
|
|
207
|
-
typeof document < "u" && typeof window < "u" && H(z());
|
|
208
|
-
function W() {
|
|
209
|
-
if (typeof window > "u") return b;
|
|
210
|
-
if (!A && k) return k;
|
|
211
|
-
A = !1;
|
|
212
|
-
let e = z(), t = I(e), n = t === "system", r = n ? F() : !1, i = x(), a = u(e, r, n, t, i);
|
|
213
|
-
return k && k.theme === e && k.resolvedTheme === a && k.systemDark === r && k.followSystem === n && k.appearanceMode === t && C(k.themeHalves) === C(i) || (k = {
|
|
214
|
-
theme: e,
|
|
215
|
-
resolvedTheme: a,
|
|
216
|
-
systemDark: r,
|
|
217
|
-
followSystem: n,
|
|
218
|
-
appearanceMode: t,
|
|
219
|
-
themeHalves: i
|
|
220
|
-
}), k;
|
|
221
|
-
}
|
|
222
|
-
function G() {
|
|
223
|
-
return b;
|
|
224
|
-
}
|
|
225
|
-
function K() {
|
|
226
|
-
let e = z();
|
|
227
|
-
I(e) === "system" && H(e, { suppressTransitions: !0 }), P();
|
|
228
|
-
}
|
|
229
|
-
function q(e) {
|
|
230
|
-
e.key === v ? (N = null, H(z(), { suppressTransitions: !0 }), P()) : e.key === "hanzodev:theme-follow-system" || e.key === "hanzodev:theme-appearance-mode" || e.key === "hanzodev:theme-halves:v1" ? (H(z(), { suppressTransitions: !0 }), P()) : (e.key === "hanzodev:themes:v1" || e.key === null) && (e.key === null && (N = null), ae(), M = null, H(z(), { suppressTransitions: !0 }), P());
|
|
231
|
-
}
|
|
232
|
-
var J = null;
|
|
233
|
-
function Y(e) {
|
|
234
|
-
if (typeof window > "u") return () => {};
|
|
235
|
-
if (O.push(e), !J) {
|
|
236
|
-
let e = typeof window.matchMedia == "function" ? window.matchMedia(y) : null;
|
|
237
|
-
e?.addEventListener("change", K), window.addEventListener("storage", q), J = () => {
|
|
238
|
-
e?.removeEventListener("change", K), window.removeEventListener("storage", q);
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
return () => {
|
|
242
|
-
O = O.filter((t) => t !== e), O.length === 0 && (J?.(), J = null);
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
function _e() {
|
|
246
|
-
return W();
|
|
247
|
-
}
|
|
248
|
-
function ve(e) {
|
|
249
|
-
let t = Y(e), n = l(e);
|
|
250
|
-
return () => {
|
|
251
|
-
t(), n();
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
function ye() {
|
|
255
|
-
return g() ?? W().resolvedTheme;
|
|
256
|
-
}
|
|
257
|
-
function be() {
|
|
258
|
-
let { resolvedTheme: e } = _(Y, W, G);
|
|
259
|
-
return _(l, g, xe) ?? e;
|
|
260
|
-
}
|
|
261
|
-
function xe() {
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
function X(t) {
|
|
265
|
-
if (typeof window > "u") return !1;
|
|
266
|
-
try {
|
|
267
|
-
o(z(), I, L);
|
|
268
|
-
let e = window.localStorage.getItem(p);
|
|
269
|
-
window.localStorage.removeItem(p);
|
|
270
|
-
try {
|
|
271
|
-
pe(t);
|
|
272
|
-
} catch (t) {
|
|
273
|
-
if (e !== null) try {
|
|
274
|
-
window.localStorage.setItem(p, e);
|
|
275
|
-
} catch {}
|
|
276
|
-
throw t;
|
|
277
|
-
}
|
|
278
|
-
} catch (n) {
|
|
279
|
-
let r = E(n) ? n : new T({
|
|
280
|
-
operation: "write",
|
|
281
|
-
storageKey: v,
|
|
282
|
-
theme: t,
|
|
283
|
-
cause: n
|
|
284
|
-
});
|
|
285
|
-
return console.error(r.message, {
|
|
286
|
-
operation: r.operation,
|
|
287
|
-
storageKey: r.storageKey,
|
|
288
|
-
theme: t,
|
|
289
|
-
...e(r)
|
|
290
|
-
}), !1;
|
|
291
|
-
}
|
|
292
|
-
return H(t, { suppressTransitions: !0 }), P(), !0;
|
|
293
|
-
}
|
|
294
|
-
function Z(t) {
|
|
295
|
-
if (typeof window > "u") return !1;
|
|
296
|
-
try {
|
|
297
|
-
L(t);
|
|
298
|
-
} catch (t) {
|
|
299
|
-
let n = E(t) ? t : new T({
|
|
300
|
-
operation: "write",
|
|
301
|
-
storageKey: m,
|
|
302
|
-
cause: t
|
|
303
|
-
});
|
|
304
|
-
return console.error(n.message, {
|
|
305
|
-
operation: n.operation,
|
|
306
|
-
storageKey: n.storageKey,
|
|
307
|
-
...e(n)
|
|
308
|
-
}), !1;
|
|
309
|
-
}
|
|
310
|
-
return N = null, H(z(), { suppressTransitions: !0 }), P(), !0;
|
|
311
|
-
}
|
|
312
|
-
function Q(t, n) {
|
|
313
|
-
if (typeof window > "u") return !1;
|
|
314
|
-
try {
|
|
315
|
-
let e = { ...S() };
|
|
316
|
-
n === null ? delete e[t] : e[t] = n, e.light === void 0 && e.dark === void 0 ? window.localStorage.removeItem(p) : window.localStorage.setItem(p, JSON.stringify(e));
|
|
317
|
-
} catch (t) {
|
|
318
|
-
let n = new T({
|
|
319
|
-
operation: "write",
|
|
320
|
-
storageKey: p,
|
|
321
|
-
cause: t
|
|
322
|
-
});
|
|
323
|
-
return console.error(n.message, {
|
|
324
|
-
operation: n.operation,
|
|
325
|
-
storageKey: n.storageKey,
|
|
326
|
-
...e(n)
|
|
327
|
-
}), !1;
|
|
328
|
-
}
|
|
329
|
-
return H(z(), { suppressTransitions: !0 }), P(), !0;
|
|
330
|
-
}
|
|
331
|
-
function Se() {
|
|
332
|
-
if (typeof window > "u") return !1;
|
|
333
|
-
try {
|
|
334
|
-
window.localStorage.removeItem(p);
|
|
335
|
-
} catch (t) {
|
|
336
|
-
let n = new T({
|
|
337
|
-
operation: "write",
|
|
338
|
-
storageKey: p,
|
|
339
|
-
cause: t
|
|
340
|
-
});
|
|
341
|
-
return console.error(n.message, {
|
|
342
|
-
operation: n.operation,
|
|
343
|
-
storageKey: n.storageKey,
|
|
344
|
-
...e(n)
|
|
345
|
-
}), !1;
|
|
346
|
-
}
|
|
347
|
-
return H(z(), { suppressTransitions: !0 }), P(), !0;
|
|
348
|
-
}
|
|
349
|
-
function $({ preservePreview: e = !1 } = {}) {
|
|
350
|
-
typeof window < "u" && (M = null, H(z(), {
|
|
351
|
-
suppressTransitions: !0,
|
|
352
|
-
preservePreview: e
|
|
353
|
-
}), P());
|
|
354
|
-
}
|
|
355
|
-
function Ce() {
|
|
356
|
-
let e = oe(9), t = _(Y, W, G), { theme: n, resolvedTheme: r } = t, i;
|
|
357
|
-
e[0] === n ? i = e[1] : (i = (e) => {
|
|
358
|
-
let t = I(n);
|
|
359
|
-
return Z(e ? "system" : t === "system" ? f(n) ?? "light" : t);
|
|
360
|
-
}, e[0] = n, e[1] = i);
|
|
361
|
-
let a = i, o;
|
|
362
|
-
return e[2] !== r || e[3] !== a || e[4] !== t.appearanceMode || e[5] !== t.followSystem || e[6] !== t.themeHalves || e[7] !== n ? (o = {
|
|
363
|
-
theme: n,
|
|
364
|
-
setTheme: X,
|
|
365
|
-
setAppearanceMode: Z,
|
|
366
|
-
setFollowSystem: a,
|
|
367
|
-
setThemeHalf: Q,
|
|
368
|
-
clearThemeHalves: Se,
|
|
369
|
-
refreshTheme: $,
|
|
370
|
-
followSystem: t.followSystem,
|
|
371
|
-
appearanceMode: t.appearanceMode,
|
|
372
|
-
resolvedTheme: r,
|
|
373
|
-
themeHalves: t.themeHalves
|
|
374
|
-
}, e[2] = r, e[3] = a, e[4] = t.appearanceMode, e[5] = t.followSystem, e[6] = t.themeHalves, e[7] = n, e[8] = o) : o = e[8], o;
|
|
375
|
-
}
|
|
376
|
-
export { ce as a, Z as c, V as d, be as f, se as i, X as l, _e as n, R as o, Ce as p, I as r, $ as s, ye as t, ve as u };
|