moi-computer 0.9.1-next.0 → 0.9.1-next.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/client/api/app-config.ts +51 -0
- package/client/api/workspace-keys.ts +1 -0
- package/client/app/routes/WorkspaceRoute.tsx +4 -2
- package/client/components/ui/button.tsx +1 -1
- package/client/features/applets/api.ts +38 -0
- package/client/features/applets/applet-thumbnail.ts +208 -0
- package/client/features/chat/ChatEmptyState.tsx +5 -3
- package/client/features/chat/ChatPanel.tsx +2 -8
- package/client/features/chat/ChatSelector.tsx +29 -10
- package/client/features/chat/MarkdownContent.tsx +2 -2
- package/client/features/home/HomePage.tsx +13 -0
- package/client/features/home/WorkspacePreview.tsx +51 -33
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +9 -0
- package/client/features/home/workspace-setup/InstallMoiDialog.tsx +245 -0
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +1 -1
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +1 -1
- package/client/features/views/ViewBuilder.tsx +18 -4
- package/client/features/views/ViewManager.tsx +18 -2
- package/client/features/widgets/WidgetFrame.tsx +1 -1
- package/client/features/widgets/WidgetGrid.tsx +1 -1
- package/client/features/widgets/Widgets.tsx +16 -15
- package/client/features/workspace/CustomizePanel.tsx +29 -8
- package/client/features/workspace/WorkspaceScreen.tsx +8 -14
- package/client/index.tsx +6 -1
- package/client/runtime/useWorkspaceEvents.ts +17 -0
- package/client/runtime/workspace-theme.ts +36 -6
- package/dist/chunk-87q78504.js +1 -0
- package/dist/chunk-8s41nd3g.js +1 -0
- package/dist/{chunk-pp62fnxh.js → chunk-b959mdkj.js} +1 -1
- package/dist/chunk-cagtq45k.js +1 -0
- package/dist/chunk-ek6zde7t.js +10 -0
- package/dist/chunk-n8tq2494.js +82 -0
- package/dist/chunk-v82nefjq.css +1 -0
- package/dist/{chunk-sxc24vfp.js → chunk-zbeq02yc.js} +1 -1
- package/dist/chunk-zbt8emsw.js +2 -0
- package/dist/{chunk-6w6j9g4b.js → chunk-zcyvyebg.js} +2 -2
- package/dist/chunk-zfz3b4xg.js +2 -0
- package/dist/index.html +1 -1
- package/lib/themes.ts +4 -4
- package/lib/types.ts +60 -41
- package/package.json +1 -1
- package/server/api.ts +69 -31
- package/server/app-config.ts +144 -0
- package/server/applets.ts +17 -0
- package/server/cli.ts +47 -11
- package/server/layout.ts +40 -45
- package/server/moi-scaffold.ts +37 -1
- package/server/session-config.ts +3 -13
- package/server/thumbnails.ts +197 -0
- package/server/views.ts +10 -1
- package/server/widgets.ts +4 -18
- package/workspace/.claude/skills/moi-workspace/SKILL.md +13 -1
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +153 -253
- package/client/features/drawings/annotation-availability.ts +0 -10
- package/client/features/widgets/api.ts +0 -47
- package/client/features/widgets/useWidgetThumbnails.ts +0 -107
- package/client/features/widgets/widget-snapshot.ts +0 -71
- package/dist/chunk-3becmq75.js +0 -81
- package/dist/chunk-8ew39cvq.js +0 -10
- package/dist/chunk-c8gtrjwp.js +0 -1
- package/dist/chunk-v964b5g7.js +0 -1
- package/dist/chunk-zx33ts9d.css +0 -1
|
@@ -24,14 +24,25 @@ const RADIUS_OPTIONS = Object.entries(RADIUS_THEMES) as [RadiusTheme, RadiusThem
|
|
|
24
24
|
|
|
25
25
|
type CustomizeOptionGroupProps = {
|
|
26
26
|
children: ReactNode
|
|
27
|
+
className?: string
|
|
28
|
+
gridClassName?: string
|
|
27
29
|
label: string
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
function CustomizeOptionGroup({
|
|
32
|
+
function CustomizeOptionGroup({
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
gridClassName,
|
|
36
|
+
label
|
|
37
|
+
}: CustomizeOptionGroupProps) {
|
|
31
38
|
return (
|
|
32
|
-
<div className=
|
|
39
|
+
<div className={cn('flex flex-col gap-2', className)}>
|
|
33
40
|
<p className="text-xs font-medium">{label}</p>
|
|
34
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
role="group"
|
|
43
|
+
aria-label={label}
|
|
44
|
+
className={cn('grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2', gridClassName)}
|
|
45
|
+
>
|
|
35
46
|
{children}
|
|
36
47
|
</div>
|
|
37
48
|
</div>
|
|
@@ -81,9 +92,12 @@ export function CustomizePanel({ onClose, ref }: CustomizePanelProps) {
|
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
return (
|
|
84
|
-
<BottomPanel ref={ref} title="Customize" onClose={onClose}>
|
|
85
|
-
<div className="
|
|
86
|
-
<CustomizeOptionGroup
|
|
95
|
+
<BottomPanel ref={ref} title="Customize" onClose={onClose} className="@4xl/workspace:max-w-4xl">
|
|
96
|
+
<div className="grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2">
|
|
97
|
+
<CustomizeOptionGroup
|
|
98
|
+
label="Font"
|
|
99
|
+
className="@4xl/workspace:col-span-2 @4xl/workspace:col-start-1"
|
|
100
|
+
>
|
|
87
101
|
{FONT_OPTIONS.map(([key, config]) => (
|
|
88
102
|
<CustomizeOption
|
|
89
103
|
key={key}
|
|
@@ -96,7 +110,10 @@ export function CustomizePanel({ onClose, ref }: CustomizePanelProps) {
|
|
|
96
110
|
))}
|
|
97
111
|
</CustomizeOptionGroup>
|
|
98
112
|
|
|
99
|
-
<CustomizeOptionGroup
|
|
113
|
+
<CustomizeOptionGroup
|
|
114
|
+
label="Colors"
|
|
115
|
+
className="@4xl/workspace:col-span-2 @4xl/workspace:col-start-4"
|
|
116
|
+
>
|
|
100
117
|
{COLOR_OPTIONS.map(([key, preset]) => (
|
|
101
118
|
<CustomizeOption
|
|
102
119
|
key={key}
|
|
@@ -122,7 +139,11 @@ export function CustomizePanel({ onClose, ref }: CustomizePanelProps) {
|
|
|
122
139
|
))}
|
|
123
140
|
</CustomizeOptionGroup>
|
|
124
141
|
|
|
125
|
-
<CustomizeOptionGroup
|
|
142
|
+
<CustomizeOptionGroup
|
|
143
|
+
label="Radius"
|
|
144
|
+
className="@4xl/workspace:col-start-7"
|
|
145
|
+
gridClassName="@4xl/workspace:grid-cols-1"
|
|
146
|
+
>
|
|
126
147
|
{RADIUS_OPTIONS.map(([key, preset]) => (
|
|
127
148
|
<CustomizeOption
|
|
128
149
|
key={key}
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from '@tabler/icons-react'
|
|
13
13
|
|
|
14
14
|
import { IconGhost } from '@/client/components/shared/IconGhost'
|
|
15
|
-
import { canAnnotateWorkspaceContent } from '@/client/features/drawings/annotation-availability'
|
|
16
15
|
import { DrawingLayer } from '@/client/features/drawings/DrawingLayer'
|
|
17
16
|
import { DrawingToolbar } from '@/client/features/drawings/DrawingToolbar'
|
|
18
17
|
import { useChatAnnotation } from '@/client/features/drawings/useChatAnnotation'
|
|
@@ -311,11 +310,9 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
311
310
|
? activeBuilder
|
|
312
311
|
: undefined
|
|
313
312
|
const activeDraftBuilderId = activeDraftBuilder?.id
|
|
314
|
-
const canAnnotate =
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
activeView !== undefined
|
|
318
|
-
)
|
|
313
|
+
const canAnnotate =
|
|
314
|
+
widgetMode === 'idle' &&
|
|
315
|
+
((activeTab === 'widgets' && widgets.length > 0) || activeView !== undefined)
|
|
319
316
|
const annotation = useChatAnnotation({
|
|
320
317
|
workspaceId,
|
|
321
318
|
sessionId,
|
|
@@ -574,7 +571,6 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
574
571
|
composerAvailability={composerAvailability}
|
|
575
572
|
send={send}
|
|
576
573
|
stop={stop}
|
|
577
|
-
onSelectSession={selectSession}
|
|
578
574
|
onClose={() => setMode('fullscreen')}
|
|
579
575
|
annotation={annotation.docked}
|
|
580
576
|
builderDraft={builderChatDraft}
|
|
@@ -595,13 +591,12 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
595
591
|
composerAvailability={composerAvailability}
|
|
596
592
|
send={send}
|
|
597
593
|
stop={stop}
|
|
598
|
-
onSelectSession={selectSession}
|
|
599
594
|
/>
|
|
600
595
|
)
|
|
601
596
|
const workspacePanel = (
|
|
602
597
|
<div
|
|
603
598
|
className={cn(
|
|
604
|
-
'flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius]',
|
|
599
|
+
'@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius]',
|
|
605
600
|
mode === 'split' && 'rounded-xl'
|
|
606
601
|
)}
|
|
607
602
|
>
|
|
@@ -672,6 +667,10 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
672
667
|
</DrawingLayer>
|
|
673
668
|
</div>
|
|
674
669
|
|
|
670
|
+
<AnimatePresence>
|
|
671
|
+
{widgetMode === 'customizing' && <CustomizePanel onClose={() => setWidgetMode('idle')} />}
|
|
672
|
+
</AnimatePresence>
|
|
673
|
+
|
|
675
674
|
<PanelHeader>
|
|
676
675
|
<div className="flex min-w-0 flex-1 items-center gap-4">
|
|
677
676
|
<div className="flex items-center gap-2">
|
|
@@ -723,10 +722,6 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
723
722
|
)}
|
|
724
723
|
</div>
|
|
725
724
|
|
|
726
|
-
<AnimatePresence>
|
|
727
|
-
{widgetMode === 'customizing' && <CustomizePanel onClose={() => setWidgetMode('idle')} />}
|
|
728
|
-
</AnimatePresence>
|
|
729
|
-
|
|
730
725
|
{mode === 'fullscreen' && activeTab !== 'agent' && hasWorkspaceContent && (
|
|
731
726
|
<ChatPopup
|
|
732
727
|
loading={hasRunningSession}
|
|
@@ -751,7 +746,6 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
751
746
|
composerAvailability={composerAvailability}
|
|
752
747
|
send={send}
|
|
753
748
|
stop={stop}
|
|
754
|
-
onSelectSession={selectSession}
|
|
755
749
|
onClose={onClose}
|
|
756
750
|
annotation={annotation.popup}
|
|
757
751
|
builderDraft={builderChatDraft}
|
package/client/index.tsx
CHANGED
|
@@ -21,7 +21,12 @@ if (import.meta.hot) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export async function init(el: HTMLElement) {
|
|
24
|
-
|
|
24
|
+
// Startup config loads in parallel with the main chunk, so it is available
|
|
25
|
+
// synchronously to every component from the first render.
|
|
26
|
+
const [{ mount }] = await Promise.all([
|
|
27
|
+
import('./main'),
|
|
28
|
+
import('./api/app-config').then(m => m.loadAppConfig())
|
|
29
|
+
])
|
|
25
30
|
mount(el)
|
|
26
31
|
}
|
|
27
32
|
|
|
@@ -56,6 +56,11 @@ export type WorkspaceEvent =
|
|
|
56
56
|
type WorkspaceEventHandler = (event: WorkspaceEvent) => void
|
|
57
57
|
|
|
58
58
|
const listeners = new Set<WorkspaceEventHandler>()
|
|
59
|
+
// Fired when the socket comes back after a drop — for the SPA that means the
|
|
60
|
+
// server restarted (it holds the connection for its whole lifetime), so
|
|
61
|
+
// restart-scoped state such as the startup config can refetch.
|
|
62
|
+
const reconnectListeners = new Set<() => void>()
|
|
63
|
+
let everConnected = false
|
|
59
64
|
let ws: WebSocket | null = null
|
|
60
65
|
let connecting = false
|
|
61
66
|
|
|
@@ -68,6 +73,8 @@ function ensureConnection() {
|
|
|
68
73
|
socket.onopen = () => {
|
|
69
74
|
ws = socket
|
|
70
75
|
connecting = false
|
|
76
|
+
if (everConnected) for (const handler of reconnectListeners) handler()
|
|
77
|
+
everConnected = true
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
socket.onmessage = event => {
|
|
@@ -91,6 +98,16 @@ function ensureConnection() {
|
|
|
91
98
|
}
|
|
92
99
|
}
|
|
93
100
|
|
|
101
|
+
// Subscribe to reconnects; returns the unsubscribe. Only fires while some
|
|
102
|
+
// component holds the events socket open via useWorkspaceEvent (the app shell
|
|
103
|
+
// always does).
|
|
104
|
+
export function onWorkspaceEventsReconnect(handler: () => void): () => void {
|
|
105
|
+
reconnectListeners.add(handler)
|
|
106
|
+
return () => {
|
|
107
|
+
reconnectListeners.delete(handler)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
94
111
|
export function useWorkspaceEvent(handler: WorkspaceEventHandler) {
|
|
95
112
|
const handlerRef = useRef(handler)
|
|
96
113
|
handlerRef.current = handler
|
|
@@ -43,27 +43,50 @@ function themeColorProperty(token: ThemeColorToken): `--${string}` {
|
|
|
43
43
|
return `--${name}`
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function
|
|
46
|
+
export function getWorkspaceThemeFontStyle(theme: WorkspaceLayout['theme']): WorkspaceThemeStyle {
|
|
47
|
+
const style: WorkspaceThemeStyle = {}
|
|
48
|
+
const resolved = resolveWorkspaceTheme(theme)
|
|
49
|
+
const font = FONT_THEMES[resolved.font] ?? FONT_THEMES[DEFAULT_WORKSPACE_THEME.font]
|
|
50
|
+
for (const [token, property] of WORKSPACE_FONT_PROPERTIES) {
|
|
51
|
+
style[property] = font[token]
|
|
52
|
+
}
|
|
53
|
+
return style
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function getWorkspaceThemeColorStyle(
|
|
47
57
|
theme: WorkspaceLayout['theme'],
|
|
48
58
|
colorMode: ThemeColorMode = 'workspace'
|
|
49
59
|
): WorkspaceThemeStyle {
|
|
50
60
|
const style: WorkspaceThemeStyle = {}
|
|
51
61
|
const resolved = resolveWorkspaceTheme(theme)
|
|
52
|
-
const font = FONT_THEMES[resolved.font] ?? FONT_THEMES[DEFAULT_WORKSPACE_THEME.font]
|
|
53
62
|
const color = COLOR_THEMES[resolved.color] ?? COLOR_THEMES[DEFAULT_WORKSPACE_THEME.color]
|
|
54
63
|
const primary = color.primary ?? (colorMode === 'widget' ? DEFAULT_PRIMARY_COLOR : undefined)
|
|
55
64
|
const colors = primary ? deriveThemeColors(primary, colorMode) : undefined
|
|
56
|
-
const radius = RADIUS_THEMES[resolved.radius] ?? RADIUS_THEMES[DEFAULT_WORKSPACE_THEME.radius]
|
|
57
|
-
for (const [token, property] of WORKSPACE_FONT_PROPERTIES) {
|
|
58
|
-
style[property] = font[token]
|
|
59
|
-
}
|
|
60
65
|
for (const [token, property] of WORKSPACE_COLOR_PROPERTIES) {
|
|
61
66
|
style[property] = colors?.[token]
|
|
62
67
|
}
|
|
68
|
+
return style
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getWorkspaceThemeRadiusStyle(theme: WorkspaceLayout['theme']): WorkspaceThemeStyle {
|
|
72
|
+
const style: WorkspaceThemeStyle = {}
|
|
73
|
+
const resolved = resolveWorkspaceTheme(theme)
|
|
74
|
+
const radius = RADIUS_THEMES[resolved.radius] ?? RADIUS_THEMES[DEFAULT_WORKSPACE_THEME.radius]
|
|
63
75
|
style[WORKSPACE_RADIUS_PROPERTY] = radius.radius
|
|
64
76
|
return style
|
|
65
77
|
}
|
|
66
78
|
|
|
79
|
+
export function getWorkspaceThemeStyle(
|
|
80
|
+
theme: WorkspaceLayout['theme'],
|
|
81
|
+
colorMode: ThemeColorMode = 'workspace'
|
|
82
|
+
): WorkspaceThemeStyle {
|
|
83
|
+
return {
|
|
84
|
+
...getWorkspaceThemeFontStyle(theme),
|
|
85
|
+
...getWorkspaceThemeColorStyle(theme, colorMode),
|
|
86
|
+
...getWorkspaceThemeRadiusStyle(theme)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
67
90
|
export function usePreloadWorkspaceFonts() {
|
|
68
91
|
useEffect(() => {
|
|
69
92
|
if (document.getElementById(FONT_PREVIEW_LINK_ID)) return
|
|
@@ -71,6 +94,10 @@ export function usePreloadWorkspaceFonts() {
|
|
|
71
94
|
const link = document.createElement('link')
|
|
72
95
|
link.id = FONT_PREVIEW_LINK_ID
|
|
73
96
|
link.rel = 'stylesheet'
|
|
97
|
+
// CORS mode makes the sheet's cssRules readable, so thumbnail capture
|
|
98
|
+
// (modern-screenshot) can inline the @font-face rules into its SVG —
|
|
99
|
+
// an SVG rasterized in <img> can't use the page's webfonts otherwise.
|
|
100
|
+
link.crossOrigin = 'anonymous'
|
|
74
101
|
link.href = `https://fonts.googleapis.com/css2?family=${ALL_FONTS_QUERY}&display=swap`
|
|
75
102
|
document.head.appendChild(link)
|
|
76
103
|
|
|
@@ -122,6 +149,9 @@ export function useWorkspaceTheme(theme: WorkspaceLayout['theme']) {
|
|
|
122
149
|
const link = document.createElement('link')
|
|
123
150
|
link.id = FONT_LINK_ID
|
|
124
151
|
link.rel = 'stylesheet'
|
|
152
|
+
// Same CORS requirement as the preview link above: thumbnail capture
|
|
153
|
+
// can only embed @font-face rules from origin-clean stylesheets.
|
|
154
|
+
link.crossOrigin = 'anonymous'
|
|
125
155
|
link.href = url
|
|
126
156
|
document.head.appendChild(link)
|
|
127
157
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Vc as r}from"/chunk-zbeq02yc.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function o(a){let[{mount:t}]=await Promise.all([import("/chunk-n8tq2494.js"),import("/chunk-cagtq45k.js").then((e)=>e.loadAppConfig())]);t(a)}globalThis.__init=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"/chunk-pcnahct1.js";import"/chunk-zbeq02yc.js";export{a as sanitizeSvg};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"/chunk-
|
|
1
|
+
import"/chunk-zbeq02yc.js";function t(z,Q){return z[13]=1,z[14]=Q>>8,z[15]=Q&255,z[16]=Q>>8,z[17]=Q&255,z}var e=112,zz=72,Qz=89,Zz=115,p;function Nz(){let z=new Int32Array(256);for(let Q=0;Q<256;Q++){let Z=Q;for(let $=0;$<8;$++)Z=Z&1?3988292384^Z>>>1:Z>>>1;z[Q]=Z}return z}function Iz(z){let Q=-1;if(!p)p=Nz();for(let Z=0;Z<z.length;Z++)Q=p[(Q^z[Z])&255]^Q>>>8;return Q^-1}function Uz(z){let Q=z.length-1;for(let Z=Q;Z>=4;Z--)if(z[Z-4]===9&&z[Z-3]===e&&z[Z-2]===zz&&z[Z-1]===Qz&&z[Z]===Zz)return Z-3;return 0}function $z(z,Q,Z=!1){let $=new Uint8Array(13);Q*=39.3701,$[0]=e,$[1]=zz,$[2]=Qz,$[3]=Zz,$[4]=Q>>>24,$[5]=Q>>>16,$[6]=Q>>>8,$[7]=Q&255,$[8]=$[4],$[9]=$[5],$[10]=$[6],$[11]=$[7],$[12]=1;let Y=Iz($),K=new Uint8Array(4);if(K[0]=Y>>>24,K[1]=Y>>>16,K[2]=Y>>>8,K[3]=Y&255,Z){let X=Uz(z);return z.set($,X),z.set(K,X+13),z}else{let X=new Uint8Array(4);X[0]=0,X[1]=0,X[2]=0,X[3]=9;let J=new Uint8Array(54);return J.set(z,0),J.set(X,33),J.set($,37),J.set(K,50),J}}var Dz="AAlwSFlz",Fz="AAAJcEhZ",Rz="AAAACXBI";function wz(z){let Q=z.indexOf(Dz);if(Q===-1)Q=z.indexOf(Fz);if(Q===-1)Q=z.indexOf(Rz);return Q}var Jz="[modern-screenshot]",D=typeof window<"u",Ez=D&&"Worker"in window,Kz=D&&"atob"in window,Cz=D&&"btoa"in window,x=D?window.navigator?.userAgent:"",Yz=x.includes("Chrome"),S=x.includes("AppleWebKit")&&!Yz,u=x.includes("Firefox"),fz=(z)=>z&&("__CONTEXT__"in z),Tz=(z)=>z.constructor.name==="CSSFontFaceRule",bz=(z)=>z.constructor.name==="CSSImportRule",Sz=(z)=>z.constructor.name==="CSSLayerBlockRule",k=(z)=>z.nodeType===1,f=(z)=>typeof z.className==="object",Xz=(z)=>z.tagName==="image",hz=(z)=>z.tagName==="use",w=(z)=>k(z)&&typeof z.style<"u"&&!f(z),gz=(z)=>z.nodeType===8,vz=(z)=>z.nodeType===3,R=(z)=>z.tagName==="IMG",h=(z)=>z.tagName==="VIDEO",pz=(z)=>z.tagName==="CANVAS",yz=(z)=>z.tagName==="TEXTAREA",mz=(z)=>z.tagName==="INPUT",xz=(z)=>z.tagName==="STYLE",uz=(z)=>z.tagName==="SCRIPT",iz=(z)=>z.tagName==="SELECT",cz=(z)=>z.tagName==="SLOT",dz=(z)=>z.tagName==="IFRAME",az=(...z)=>console.warn(Jz,...z);function lz(z){let Q=z?.createElement?.("canvas");if(Q)Q.height=Q.width=1;return Boolean(Q)&&"toDataURL"in Q&&Boolean(Q.toDataURL("image/webp").includes("image/webp"))}var y=(z)=>z.startsWith("data:");function Gz(z,Q){if(z.match(/^[a-z]+:\/\//i))return z;if(D&&z.match(/^\/\//))return window.location.protocol+z;if(z.match(/^[a-z]+:/i))return z;if(!D)return z;let Z=g().implementation.createHTMLDocument(),$=Z.createElement("base"),Y=Z.createElement("a");if(Z.head.appendChild($),Z.body.appendChild(Y),Q)$.href=Q;return Y.href=z,Y.href}function g(z){return(z&&k(z)?z?.ownerDocument:z)??window.document}var v="http://www.w3.org/2000/svg";function jz(z,Q,Z){let $=g(Z).createElementNS(v,"svg");return $.setAttributeNS(null,"width",z.toString()),$.setAttributeNS(null,"height",Q.toString()),$.setAttributeNS(null,"viewBox",`0 0 ${z} ${Q}`),$}function Vz(z,Q){let Z=new XMLSerializer().serializeToString(z);if(Q)Z=Z.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"");return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Z)}`}async function sz(z,Q="image/png",Z=1){try{return await new Promise(($,Y)=>{z.toBlob((K)=>{if(K)$(K);else Y(Error("Blob is null"))},Q,Z)})}catch($){if(Kz)return rz(z.toDataURL(Q,Z));throw $}}function rz(z){let[Q,Z]=z.split(","),$=Q.match(/data:(.+);/)?.[1]??void 0,Y=window.atob(Z),K=Y.length,X=new Uint8Array(K);for(let J=0;J<K;J+=1)X[J]=Y.charCodeAt(J);return new Blob([X],{type:$})}function Hz(z,Q){return new Promise((Z,$)=>{let Y=new FileReader;if(Y.onload=()=>Z(Y.result),Y.onerror=()=>$(Y.error),Y.onabort=()=>$(Error(`Failed read blob to ${Q}`)),Q==="dataUrl")Y.readAsDataURL(z);else if(Q==="arrayBuffer")Y.readAsArrayBuffer(z)})}var nz=(z)=>Hz(z,"dataUrl"),oz=(z)=>Hz(z,"arrayBuffer");function F(z,Q){let Z=g(Q).createElement("img");return Z.decoding="sync",Z.loading="eager",Z.src=z,Z}function E(z,Q){return new Promise((Z)=>{let{timeout:$,ownerDocument:Y,onError:K,onWarn:X}=Q??{},J=typeof z==="string"?F(z,g(Y)):z,V=null,j=null;function G(){Z(J),V&&clearTimeout(V),j?.()}if($)V=setTimeout(G,$);if(h(J)){let M=J.currentSrc||J.src;if(!M){if(J.poster)return E(J.poster,Q).then(Z);return G()}if(J.readyState>=2)return G();let B=G,q=(W)=>{X?.("Failed video load",M,W),K?.(W),G()};j=()=>{J.removeEventListener("loadeddata",B),J.removeEventListener("error",q)},J.addEventListener("loadeddata",B,{once:!0}),J.addEventListener("error",q,{once:!0})}else{let M=Xz(J)?J.href.baseVal:J.currentSrc||J.src;if(!M)return G();let B=async()=>{if(R(J)&&"decode"in J)try{await J.decode()}catch(W){X?.("Failed to decode image, trying to render anyway",J.dataset.originalSrc||M,W)}G()},q=(W)=>{X?.("Failed image load",J.dataset.originalSrc||M,W),G()};if(R(J)&&J.complete)return B();j=()=>{J.removeEventListener("load",B),J.removeEventListener("error",q)},J.addEventListener("load",B,{once:!0}),J.addEventListener("error",q,{once:!0})}})}async function tz(z,Q){if(w(z))if(R(z)||h(z))await E(z,Q);else await Promise.all(["img","video"].flatMap((Z)=>{return Array.from(z.querySelectorAll(Z)).map(($)=>E($,Q))}))}var Bz=function(){let Q=0,Z=()=>`0000${(Math.random()*1679616<<0).toString(36)}`.slice(-4);return()=>{return Q+=1,`u${Z()}${Q}`}}();function Mz(z){return z?.split(",").map((Q)=>Q.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var a=0;function ez(z){let Q=`${Jz}[#${a}]`;return a++,{time:(Z)=>z&&console.time(`${Q} ${Z}`),timeEnd:(Z)=>z&&console.timeEnd(`${Q} ${Z}`),warn:(...Z)=>z&&az(...Z)}}function zQ(z){return{cache:z?"no-cache":"force-cache"}}async function N(z,Q){return fz(z)?z:QQ(z,{...Q,autoDestruct:!0})}async function QQ(z,Q){let{scale:Z=1,workerUrl:$,workerNumber:Y=1}=Q||{},K=Boolean(Q?.debug),X=Q?.features??!0,J=z.ownerDocument??(D?window.document:void 0),V=z.ownerDocument?.defaultView??(D?window:void 0),j=new Map,G={width:0,height:0,quality:1,type:"image/png",scale:Z,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:30000,progress:null,debug:K,fetch:{requestInit:zQ(Q?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...Q?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:Y,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...Q,__CONTEXT__:!0,log:ez(K),node:z,ownerDocument:J,ownerWindow:V,dpi:Z===1?null:96*Z,svgStyleElement:qz(J),svgDefsElement:J?.createElementNS(v,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ez&&$&&Y?Y:0})].map(()=>{try{let q=new Worker($);return q.onmessage=async(W)=>{let{url:H,result:L}=W.data;if(L)j.get(H)?.resolve?.(L);else j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q.onmessageerror=(W)=>{let{url:H}=W.data;j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q}catch(q){return G.log.warn("Failed to new Worker",q),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[lz(J)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:j,drawImageCount:0,tasks:[],features:X,isEnable:(q)=>{if(q==="restoreScrollPosition")return typeof X==="boolean"?!1:X[q]??!1;if(typeof X==="boolean")return X;return X[q]??!0},shadowRoots:[]};G.log.time("wait until load"),await tz(z,{timeout:G.timeout,onWarn:G.log.warn}),G.log.timeEnd("wait until load");let{width:M,height:B}=ZQ(z,G);return G.width=M,G.height=B,G}function qz(z){if(!z)return;let Q=z.createElement("style"),Z=Q.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Mc as a,Nc as b}from"/chunk-zbt8emsw.js";import"/chunk-zfz3b4xg.js";import"/chunk-zbeq02yc.js";export{b as useAppConfig,a as loadAppConfig};
|