// creation-tool.jsx — Image generation (参考生图 + 文生图) // Layout matches video-tool.jsx: AppShell + tabs inside aside + results panel const IMG_ACCENT = '#22d3ee'; // ── OSS thumbnail helpers (shared with video-tool pattern) ────────────────── let _ctCdnDomain = null; const _ctFetchCdn = () => { if (_ctCdnDomain !== null) return Promise.resolve(_ctCdnDomain); const p = window.YiteAPI?.getCdnDomain?.() || Promise.resolve(''); return p.then(d => { _ctCdnDomain = d; return d; }); }; const _ctThumbUrl = (url, tag, cdnDomain) => { if (!url || !cdnDomain || !url.startsWith(cdnDomain) || url.includes('?')) return url; if (tag === 'video') return url + '?x-oss-process=video/snapshot,t_1000,f_jpg,w_200,h_200,m_fast'; if (tag === 'image') return url + '?x-oss-process=image/resize,w_200,h_200,m_fill/format,webp'; return url; }; const _isVideoUrl2 = url => /\.(mp4|mov|webm|avi|mkv)(\?|$)/i.test(url); const ResultMedia2 = ({ url, style: s }) => _isVideoUrl2(url) ?