/* * Extracted from browser-delivered Turbopack chunk: fd0220e4d10052af.701bdafa2d.js * Module id: 579306 * For reading/searching only; this factory depends on the original Turbopack runtime. */ const moduleFactory = (e) => { "use strict"; var t = e.i(462214), n = e.i(358379), i = e.i(111558), r = e.i(41671), a = e.i(791997), o = e.i(111581); function s(e, t) { return `停止下载 (${e}/${t})`; } let c = "border border-[#FF3B30] bg-black/80 hover:!bg-red-500/20"; e.s( [ "batchZipRunningGroupExtraClass", 0, c, "batchZipRunningVirtualBtnClassName", 0, "flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs text-white transition-colors border border-[#FF3B30] bg-black/80 hover:!bg-red-500/20", "formatBatchZipDownloadRunningLabel", () => s, ], 579306, ); let l = { padding: "4px", borderRadius: 12, border: "0.5px solid var(--canvas-controls-border)", background: "var(--canvas-controls-bg)", boxShadow: "var(--canvas-shadow-dropdown)", backdropFilter: "blur(16px)", }, u = "flex h-8 items-center justify-center rounded-lg transition-colors hover:bg-canvas-controls-hover text-[13px] select-none cursor-pointer text-canvas-controls-text px-2 gap-1.5", h = { width: 0, borderLeft: "0.5px solid var(--canvas-controls-border)" }, f = [ null, "#FF3B30", "#FF9500", "#FFCC00", "#34C759", "#30D5C8", "#007AFF", "#5856D6", "#FF2D95", "#8E8E93", ]; function d() { return (0, t.jsx)("div", { className: "mx-0.5 h-4 flex-shrink-0", style: h, }); } function p({ currentColor: e, onSelect: n }) { return (0, t.jsx)("div", { style: { ...l, padding: "12px", width: "max-content" }, children: (0, t.jsx)("div", { className: "grid grid-cols-5 gap-3", children: f.map((i) => { let r = i === e || (null === i && null === e); return (0, t.jsx)( "div", { className: "flex h-9 w-9 cursor-pointer items-center justify-center rounded-full transition-transform hover:scale-110", style: { outline: r ? `2px solid ${i ?? "var(--border-brand)"}` : "none", outlineOffset: 2, }, onClick: (e) => { e.stopPropagation(), n(i); }, children: null === i ? (0, t.jsx)("div", { className: "border-canvas-controls-border bg-canvas-controls-hover relative h-7 w-7 rounded-full border-2", children: (0, t.jsx)("div", { className: "absolute left-1/2 top-1/2 h-[2px] w-full -translate-x-1/2 -translate-y-1/2 rotate-45 rounded", style: { background: "#FF3B30" }, }), }) : (0, t.jsx)("div", { className: "h-7 w-7 rounded-full", style: { background: i }, }), }, i ?? "none", ); }), }), }); } function g({ onSelect: e, onClose: n }) { return (0, t.jsxs)("div", { className: "flex flex-col gap-1", style: { ...l, padding: "4px", width: "max-content", minWidth: "120px", }, children: [ (0, t.jsxs)("div", { className: "text-canvas-controls-text hover:bg-canvas-controls-hover flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors", onClick: (t) => { t.stopPropagation(), e("grid"); }, children: [ (0, t.jsx)(r.Icons.layoutGrid, { width: 16, height: 16 }), (0, t.jsx)("span", { children: "宫格排列" }), ], }), (0, t.jsxs)("div", { className: "text-canvas-controls-text hover:bg-canvas-controls-hover flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors", onClick: (t) => { t.stopPropagation(), e("horizontal"); }, children: [ (0, t.jsx)(r.Icons.workflow, { width: 16, height: 16 }), (0, t.jsx)("span", { children: "水平排列" }), ], }), (0, t.jsxs)("div", { className: "text-canvas-controls-text hover:bg-canvas-controls-hover flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors", onClick: (t) => { t.stopPropagation(), e("vertical"); }, children: [ (0, t.jsx)(r.Icons.list, { width: 16, height: 16 }), (0, t.jsx)("span", { children: "垂直排列" }), ], }), ], }); } function b({ groupColor: e = null, workflowUuid: h, isGroupRunning: f = !1, isStoryboardGroup: b = !1, isStoryboardImageGroup: m = !1, pipelineProgress: w, onColorChange: v, onRunGroup: x, onCreateWorkflow: y, onUngroup: _, onLayoutChange: S, onBatchGenerateVideo: E, groupNodeId: M, onDownloadAll: T, }) { let k, C, A = (0, a.useCanvasThemeStore)((e) => e.theme), { batchZipDownload: N, cancelBatchZipDownload: I } = (0, o.useCanvasCallbacks)(), P = "running" === N.status && "group" === N.mode && N.groupId === M, [R, L] = (0, n.useState)(!1), [D, j] = (0, n.useState)(!1), O = (0, n.useRef)(null), F = (0, n.useRef)(null), U = (0, n.useRef)(null), B = (0, n.useRef)(null); (0, n.useEffect)(() => { let e = (e) => { let t = e.target; !R || O.current?.contains(t) || U.current?.contains(t) || L(!1), !D || F.current?.contains(t) || B.current?.contains(t) || j(!1); }; return ( (R || D) && document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e) ); }, [R, D]); let H = (0, n.useCallback)((e) => { e.stopPropagation(), L((e) => !e), j(!1); }, []), z = (0, n.useCallback)((e) => { e.stopPropagation(), j((e) => !e), L(!1); }, []), G = (0, n.useCallback)( (e) => { v?.(e), L(!1); }, [v], ), $ = (0, n.useCallback)( (e) => { S?.(e), j(!1); }, [S], ), V = (0, n.useCallback)(() => { if (!O.current) return; let e = O.current.getBoundingClientRect(); return { top: e.top, left: e.left }; }, []), W = (0, n.useCallback)(() => { if (!F.current) return; let e = F.current.getBoundingClientRect(); return { top: e.top, left: e.left + e.width / 2 }; }, []); return (0, t.jsxs)(t.Fragment, { children: [ (0, t.jsxs)("div", { className: "nodrag z-50 flex items-center gap-0.5 whitespace-nowrap", style: l, children: [ (0, t.jsx)("div", { ref: O, children: (0, t.jsx)("div", { className: "hover:bg-canvas-controls-hover flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg transition-colors", onClick: H, children: e ? (0, t.jsx)("div", { className: "size-6 rounded-full", style: { background: e }, }) : (0, t.jsx)("div", { className: "size-6 rounded-full bg-[#D9D9D9]", }), }), }), (0, t.jsx)("div", { ref: F, children: (0, t.jsx)("div", { className: "hover:bg-canvas-controls-hover flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg", onClick: z, children: (0, t.jsx)(r.Icons.LayoutPanelTop, { width: 16, height: 16, }), }), }), (0, t.jsx)("div", { className: "flex items-center self-stretch py-2", children: (0, t.jsx)(d, {}), }), (0, t.jsx)("div", { className: `${u} ${f ? "text-red-400 hover:bg-red-500/20" : ""}`, onClick: x, children: f ? (0, t.jsxs)(t.Fragment, { children: [ (0, t.jsx)(r.Icons.lucideSquare, { width: 14, height: 14, }), (0, t.jsxs)("span", { children: ["停止", w ? ` (${w})` : ""], }), ], }) : (0, t.jsxs)(t.Fragment, { children: [ b ? (0, t.jsx)(r.Icons.Refresh, { width: 16, height: 16, }) : (0, t.jsx)(r.Icons.PlayLine, { width: 16, height: 16, }), (0, t.jsx)("span", { children: b ? "重新生成" : "整组执行", }), ], }), }), m && (0, t.jsxs)("div", { className: `${u}`, onClick: E, children: [ (0, t.jsx)(r.Icons.VideoAdd, { width: 16, height: 16 }), (0, t.jsx)("span", { children: "批量生成视频" }), ], }), !b && (0, t.jsxs)("div", { className: u, onClick: y, children: [ (0, t.jsx)(r.Icons.GitFork, { width: 16, height: 16 }), (0, t.jsx)("span", { children: h ? "更新工具箱" : "添加到工具箱", }), ], }), (0, t.jsxs)("div", { className: u, onClick: _, children: [ (0, t.jsx)(r.Icons.group, { width: 16, height: 16 }), (0, t.jsx)("span", { children: "解组" }), ], }), T && (0, t.jsx)("div", { className: P && "running" === N.status ? `${u} ${c}` : u, onClick: (e) => { e.stopPropagation(), P ? I?.() : T(); }, children: P && "running" === N.status ? (0, t.jsxs)(t.Fragment, { children: [ (0, t.jsx)(r.Icons.lucideSquare, { width: 16, height: 16, }), (0, t.jsx)("span", { children: s(N.current, N.total), }), ], }) : (0, t.jsxs)(t.Fragment, { children: [ (0, t.jsx)(r.Icons.BulkDownload, { width: 16, height: 16, }), (0, t.jsx)("span", { children: "批量下载" }), ], }), }), ], }), R && ((k = V()) ? (0, i.createPortal)( (0, t.jsx)("div", { ref: U, className: `nodrag nopan nowheel ${"light" === A ? "canvas-light" : ""}`, style: { position: "fixed", top: k.top, left: k.left, transform: "translateY(-100%) translateY(-8px)", zIndex: "var(--z-sticky)", }, onMouseDown: (e) => e.stopPropagation(), children: (0, t.jsx)(p, { currentColor: e, onSelect: G }), }), document.body, ) : null), D && ((C = W()) ? (0, i.createPortal)( (0, t.jsx)("div", { ref: B, className: `nodrag nopan nowheel ${"light" === A ? "canvas-light" : ""}`, style: { position: "fixed", top: C.top, left: C.left, transform: "translate(-50%, -100%) translateY(-8px)", zIndex: "var(--z-sticky)", }, onMouseDown: (e) => e.stopPropagation(), children: (0, t.jsx)(g, { onSelect: $, onClose: () => j(!1), }), }), document.body, ) : null), ], }); } e.s(["GroupNodeToolbar", () => b, "LayoutPicker", () => g], 970683); }; export default moduleFactory;