moi-computer 0.8.0 → 0.9.0
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/workspace-keys.ts +1 -2
- package/client/app/AppRouter.tsx +10 -3
- package/client/app/routes/HomeRoute.tsx +1 -1
- package/client/app/shell/SidebarLayout.tsx +2 -14
- package/client/components/shared/Composer.tsx +20 -7
- package/client/components/shared/PanelHeader.tsx +8 -1
- package/client/components/ui/button.tsx +3 -3
- package/client/components/ui/dialog.tsx +1 -1
- package/client/components/ui/dropdown-menu.tsx +2 -2
- package/client/components/ui/hover-card.tsx +1 -1
- package/client/components/ui/popover.tsx +1 -1
- package/client/components/ui/resizable.tsx +40 -0
- package/client/features/chat/ChatEmptyState.tsx +9 -11
- package/client/features/chat/ChatPanel.tsx +76 -48
- package/client/features/chat/ChatPopup.tsx +16 -2
- package/client/features/chat/ChatPromptBubbles.tsx +6 -8
- package/client/features/chat/ChatSelector.tsx +24 -7
- package/client/features/chat/MarkdownContent.tsx +1 -1
- package/client/features/chat/ModelPicker.tsx +5 -4
- package/client/features/chat/TurnView.tsx +108 -13
- package/client/features/chat/api.ts +1 -18
- package/client/features/chat/chat-send.ts +2 -2
- package/client/features/chat/{ChatComposer.tsx → composer/ChatComposer.tsx} +6 -5
- package/client/features/chat/composer/banners/ChatErrorBanner.tsx +28 -0
- package/client/features/chat/composer/banners/ComposerBanner.tsx +30 -0
- package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +91 -0
- package/client/features/{workspace → chat/composer/banners}/WorkspaceSkillUpdateBanner.tsx +9 -7
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +74 -0
- package/client/features/{workspace → chat/composer}/useWorkspaceSkillUpdates.ts +1 -1
- package/client/features/chat/group-turns.ts +46 -28
- package/client/features/chat/interleave-notices.ts +84 -0
- package/client/features/chat/model-order.ts +9 -3
- package/client/features/chat/tool-group/TimelineRow.tsx +23 -11
- package/client/features/chat/tool-group/ToolCallGroup.tsx +38 -3
- package/client/features/chat/tool-group/format.ts +51 -10
- package/client/features/chat/useAppletChatMessage.ts +11 -16
- package/client/features/chat/useChat.ts +3 -7
- package/client/features/dev/ChatStatesPage.tsx +466 -0
- package/client/features/dev/DevIndexPage.tsx +52 -0
- package/client/features/dev/DevRoutes.tsx +6 -3
- package/client/features/dev/HarnessDebugPage.tsx +3 -3
- package/client/features/dev/chat-states-fixtures.ts +744 -0
- package/client/features/scratchpad/Scratchpad.tsx +4 -0
- package/client/features/scratchpad/scratch-session.ts +71 -0
- package/client/features/views/ViewBuilderTab.tsx +5 -4
- package/client/features/views/useViewBuilderActions.ts +2 -2
- package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -2
- package/client/features/workspace/WorkspaceScreen.tsx +128 -146
- package/client/features/workspace/WorkspaceSplitLayout.tsx +111 -0
- package/client/features/workspace/api.ts +33 -8
- package/client/features/workspace/useFitsSplitLayout.ts +31 -5
- package/client/index.css +1 -1
- package/client/lib/flags.ts +4 -3
- package/client/runtime/useWorkspaceEvents.ts +18 -1
- package/client/store/ui.ts +5 -1
- package/dist/{chunk-0pcdwjkp.js → chunk-2vaafjp4.js} +1 -1
- package/dist/{chunk-9y2zbzqz.js → chunk-35fq49qa.js} +1 -1
- package/dist/{chunk-h9h8f176.js → chunk-3b3rkjet.js} +1 -1
- package/dist/chunk-gt7n06ef.js +1 -0
- package/dist/{chunk-r5ce5cdg.js → chunk-kkj86722.js} +75 -75
- package/dist/chunk-ty1sqbmn.js +80 -0
- package/dist/chunk-xeyxk7ep.js +10 -0
- package/dist/chunk-yz6wd5vc.css +1 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +37 -7
- package/lib/themes.ts +2 -2
- package/lib/types.ts +38 -8
- package/lib/workspace-layout.ts +2 -2
- package/package.json +6 -4
- package/server/agent.ts +199 -0
- package/server/api.ts +36 -17
- package/server/bundler/build-applet.ts +35 -44
- package/server/cli-env.ts +2 -2
- package/server/cli.ts +39 -53
- package/server/constants.ts +8 -0
- package/server/control-client.ts +124 -0
- package/server/control.ts +2 -2
- package/server/env-apply.ts +4 -0
- package/server/harness/README.md +32 -12
- package/server/harness/claude-code/auth.ts +54 -0
- package/server/harness/claude-code/index.ts +6 -1
- package/server/harness/codex/adapter.ts +9 -1
- package/server/harness/codex/auth.ts +50 -0
- package/server/harness/codex/index.ts +6 -1
- package/server/harness/codex/session.ts +33 -14
- package/server/harness/openclaw/NOTES.md +619 -186
- package/server/harness/openclaw/adapter.ts +121 -54
- package/server/harness/openclaw/compat.ts +95 -0
- package/server/harness/openclaw/cron-view.ts +78 -0
- package/server/harness/openclaw/discovery.ts +145 -52
- package/server/harness/openclaw/gateway.ts +224 -36
- package/server/harness/openclaw/index.ts +56 -21
- package/server/harness/openclaw/session.ts +1002 -67
- package/server/harness/openclaw/strip.ts +71 -23
- package/server/harness/openclaw/thinking.ts +150 -0
- package/server/harness/types.ts +10 -5
- package/server/layout.ts +5 -2
- package/server/service.ts +2 -2
- package/workspace/.claude/skills/moi-workspace/SKILL.md +6 -6
- package/workspace/.claude/skills/moi-workspace/{DESIGN.md → references/DESIGN.md} +19 -9
- package/client/features/dev/PixelPainter.tsx +0 -94
- package/client/features/dev/PlaygroundPage.tsx +0 -69
- package/dist/chunk-0k7brsms.js +0 -9
- package/dist/chunk-dfs36zgc.js +0 -1
- package/dist/chunk-dtwxpxbg.js +0 -51
- package/dist/chunk-ga7t9qsk.js +0 -2
- package/dist/chunk-tey2nq7c.js +0 -31
- package/dist/chunk-z73xpsa0.js +0 -50
- package/dist/chunk-zzgredta.css +0 -1
- /package/workspace/.claude/skills/moi-workspace/{SCRATCHPAD.md → references/SCRATCHPAD.md} +0 -0
|
@@ -3,10 +3,12 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
|
3
3
|
import { jsonRequest, requestJson, requestVoid } from '@/client/api/http'
|
|
4
4
|
import { WORKSPACE_RESOURCE_OPTIONS } from '@/client/api/query-options'
|
|
5
5
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
6
|
+
import { useWorkspaceEvent } from '@/client/runtime/useWorkspaceEvents'
|
|
6
7
|
import type {
|
|
7
|
-
|
|
8
|
+
HarnessLogin,
|
|
8
9
|
ViewInfo,
|
|
9
10
|
WidgetInfo,
|
|
11
|
+
WorkspaceAgent,
|
|
10
12
|
WorkspaceLayout,
|
|
11
13
|
WorkspaceSkillsStatus,
|
|
12
14
|
WorkspaceSkillsUpdateFailure,
|
|
@@ -28,18 +30,41 @@ export function useWorkspaceLayout(workspaceId: string) {
|
|
|
28
30
|
})
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
// The workspace's agent backend in one snapshot: availability (runtime
|
|
34
|
+
// presence + auth), any in-flight login ceremony, the model catalog, and
|
|
35
|
+
// capabilities. Fetched once at workspace open; afterwards the volatile parts
|
|
36
|
+
// (`availability`, `login`) are patched in place by `agent:updated` events —
|
|
37
|
+
// the server owns the login watch loop, so the client never polls. Focus
|
|
38
|
+
// refetch stays as a cheap safety net (the server serves its cache).
|
|
39
|
+
export function useWorkspaceAgent(workspaceId: string) {
|
|
40
|
+
const queryClient = useQueryClient()
|
|
41
|
+
useWorkspaceEvent(event => {
|
|
42
|
+
if (event.type === 'agent:updated' && event.workspaceId === workspaceId) {
|
|
43
|
+
queryClient.setQueryData<WorkspaceAgent>(workspaceKeys.agent(workspaceId), prev =>
|
|
44
|
+
prev ? { ...prev, availability: event.availability, login: event.login } : prev
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
// Env can swap credentials; the server dropped its cache — refetch.
|
|
48
|
+
if (event.type === 'env:updated' && event.workspaceId === workspaceId) {
|
|
49
|
+
queryClient.invalidateQueries({ queryKey: workspaceKeys.agent(workspaceId) })
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
return useQuery<WorkspaceAgent>({
|
|
53
|
+
queryKey: workspaceKeys.agent(workspaceId),
|
|
54
|
+
queryFn: () => requestJson(`/api/workspaces/${workspaceId}/agent`),
|
|
38
55
|
staleTime: 30_000,
|
|
39
56
|
refetchOnWindowFocus: true
|
|
40
57
|
})
|
|
41
58
|
}
|
|
42
59
|
|
|
60
|
+
export function startWorkspaceLogin(workspaceId: string): Promise<HarnessLogin> {
|
|
61
|
+
return requestJson(
|
|
62
|
+
`/api/workspaces/${workspaceId}/auth/login`,
|
|
63
|
+
{ method: 'POST' },
|
|
64
|
+
'Could not start sign-in'
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
43
68
|
export function useWorkspaceSkills(workspaceId: string) {
|
|
44
69
|
return useQuery<WorkspaceSkillsStatus>({
|
|
45
70
|
queryKey: workspaceKeys.skills(workspaceId),
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
|
+
export type WorkspaceSplitLayoutConstraints = {
|
|
4
|
+
workspaceMinWidth: number
|
|
5
|
+
chatMinWidth: number
|
|
6
|
+
chatMaxWidth: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type SplitLayoutState = WorkspaceSplitLayoutConstraints & {
|
|
10
|
+
fits: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
function tokenPx(name: string): number {
|
|
4
14
|
const root = document.documentElement
|
|
5
15
|
const raw = getComputedStyle(root).getPropertyValue(name).trim()
|
|
@@ -12,16 +22,22 @@ function tokenPx(name: string): number {
|
|
|
12
22
|
// not oscillate when the chat column appears or disappears.
|
|
13
23
|
export function useFitsSplitLayout<T extends HTMLElement>() {
|
|
14
24
|
const ref = useRef<T>(null)
|
|
15
|
-
const [
|
|
25
|
+
const [state, setState] = useState<SplitLayoutState | null>(null)
|
|
16
26
|
|
|
17
27
|
useLayoutEffect(() => {
|
|
18
28
|
const el = ref.current
|
|
19
29
|
if (!el) return
|
|
20
30
|
|
|
21
31
|
const update = (width: number) => {
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
32
|
+
const workspaceMinWidth = tokenPx('--column-w')
|
|
33
|
+
const chatMinWidth = tokenPx('--chat-min')
|
|
34
|
+
const chatMaxWidth = tokenPx('--chat-max')
|
|
35
|
+
setState({
|
|
36
|
+
fits: width - chatMinWidth >= workspaceMinWidth,
|
|
37
|
+
workspaceMinWidth,
|
|
38
|
+
chatMinWidth,
|
|
39
|
+
chatMaxWidth
|
|
40
|
+
})
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
update(el.getBoundingClientRect().width)
|
|
@@ -33,5 +49,15 @@ export function useFitsSplitLayout<T extends HTMLElement>() {
|
|
|
33
49
|
return () => ro.disconnect()
|
|
34
50
|
}, [])
|
|
35
51
|
|
|
36
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
ref,
|
|
54
|
+
fits: state?.fits ?? false,
|
|
55
|
+
constraints: state
|
|
56
|
+
? {
|
|
57
|
+
workspaceMinWidth: state.workspaceMinWidth,
|
|
58
|
+
chatMinWidth: state.chatMinWidth,
|
|
59
|
+
chatMaxWidth: state.chatMaxWidth
|
|
60
|
+
}
|
|
61
|
+
: null
|
|
62
|
+
}
|
|
37
63
|
}
|
package/client/index.css
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
sidebar's own widths live in SidebarLayout.tsx.) */
|
|
44
44
|
--page-pad: 2rem; /* padding around the working area */
|
|
45
45
|
--column-w: 40rem; /* grid content width; also the widget area's min before the chat yields */
|
|
46
|
-
--chat-min:
|
|
46
|
+
--chat-min: 320px; /* docked chat min width — narrower than this and it floats */
|
|
47
47
|
--chat-max: 460px; /* docked chat max width on wide screens */
|
|
48
48
|
--chat-max-container: 640px; /* contained ChatPanel: max width of the centered history + composer column */
|
|
49
49
|
}
|
package/client/lib/flags.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// per-thread or per-workspace settings. Change one and rebuild the client.
|
|
5
5
|
|
|
6
6
|
// Live token-by-token streaming of assistant responses. When true, the client
|
|
7
|
-
// asks the server to stream partial messages (only honored by providers
|
|
8
|
-
//
|
|
9
|
-
// responses arrive as whole blocks, exactly as
|
|
7
|
+
// asks the server to stream partial messages (only honored by providers whose
|
|
8
|
+
// `/agent` payload reports `supportsStreaming` — Claude Code and OpenClaw;
|
|
9
|
+
// ignored elsewhere). When false, responses arrive as whole blocks, exactly as
|
|
10
|
+
// before streaming existed.
|
|
10
11
|
export const STREAM_RESPONSES = true
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react'
|
|
2
2
|
|
|
3
3
|
import { wsUrl } from '@/client/lib/ws-url'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
AgentLoginState,
|
|
6
|
+
AppSettings,
|
|
7
|
+
HarnessAvailability,
|
|
8
|
+
ViewBuilder,
|
|
9
|
+
ViewInfo,
|
|
10
|
+
WidgetInfo,
|
|
11
|
+
WorkspaceTabId
|
|
12
|
+
} from '@/lib/types'
|
|
5
13
|
|
|
6
14
|
export type WorkspaceEvent =
|
|
7
15
|
| { type: 'widget:updated'; name: string }
|
|
@@ -21,6 +29,15 @@ export type WorkspaceEvent =
|
|
|
21
29
|
| { type: 'workspaces-list:updated' }
|
|
22
30
|
// A workspace's env changed outside the UI — refetch the env view.
|
|
23
31
|
| { type: 'env:updated'; workspaceId: string }
|
|
32
|
+
// The agent backend's availability or login ceremony changed (login landed,
|
|
33
|
+
// ceremony timed out, auth probe flipped). Carries the new state so caches
|
|
34
|
+
// patch without a refetch.
|
|
35
|
+
| {
|
|
36
|
+
type: 'agent:updated'
|
|
37
|
+
workspaceId: string
|
|
38
|
+
availability: HarnessAvailability
|
|
39
|
+
login?: AgentLoginState
|
|
40
|
+
}
|
|
24
41
|
// The Scratchpad canvas for `workspaceId` was saved — open tabs reload from
|
|
25
42
|
// disk. `origin` is the tab that wrote it, so that tab can skip its own echo.
|
|
26
43
|
| { type: 'scratchpad:updated'; workspaceId: string; origin?: string }
|
package/client/store/ui.ts
CHANGED
|
@@ -9,10 +9,12 @@ type UiStore = {
|
|
|
9
9
|
hasSentMessageFromMoi: boolean
|
|
10
10
|
workspaceIdsPendingAnalysis: string[]
|
|
11
11
|
composerDrafts: Record<string, string>
|
|
12
|
+
dockedChatWidth: number
|
|
12
13
|
setDiscoveredWorkspacesOpen: (open: boolean) => void
|
|
13
14
|
markWorkspacePendingAnalysis: (workspaceId: string) => void
|
|
14
15
|
markMessageSentFromMoi: (workspaceId: string) => void
|
|
15
16
|
setComposerDraft: (workspaceId: string, value: string) => void
|
|
17
|
+
setDockedChatWidth: (width: number) => void
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const createUiStore = (storage?: StateStorage) =>
|
|
@@ -23,6 +25,7 @@ export const createUiStore = (storage?: StateStorage) =>
|
|
|
23
25
|
hasSentMessageFromMoi: false,
|
|
24
26
|
workspaceIdsPendingAnalysis: [],
|
|
25
27
|
composerDrafts: {},
|
|
28
|
+
dockedChatWidth: 360,
|
|
26
29
|
setDiscoveredWorkspacesOpen: open => set({ discoveredWorkspacesOpen: open }),
|
|
27
30
|
markWorkspacePendingAnalysis: workspaceId =>
|
|
28
31
|
set(state => {
|
|
@@ -46,7 +49,8 @@ export const createUiStore = (storage?: StateStorage) =>
|
|
|
46
49
|
if (value) composerDrafts[workspaceId] = value
|
|
47
50
|
else delete composerDrafts[workspaceId]
|
|
48
51
|
return { composerDrafts }
|
|
49
|
-
})
|
|
52
|
+
}),
|
|
53
|
+
setDockedChatWidth: width => set({ dockedChatWidth: width })
|
|
50
54
|
}),
|
|
51
55
|
storage
|
|
52
56
|
? {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"/chunk-
|
|
1
|
+
import"/chunk-35fq49qa.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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
-
export{s as
|
|
2
|
+
export{s as Fc,t as Gc,u as Hc,v as Ic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ic as t}from"/chunk-35fq49qa.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:a}=await import("/chunk-ty1sqbmn.js");a(r)}globalThis.__init=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"/chunk-pcnahct1.js";import"/chunk-35fq49qa.js";export{a as sanitizeSvg};
|