@autoaiai/aicut 0.1.7 → 0.1.13
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/MANUAL.md +94 -84
- package/package.json +1 -1
- package/product.json +2 -1
- package/skills/aicut/SKILL.md +4 -4
- package/skills/aicut/references/commands.md +15 -15
- package/skills/aicut/references/film-format.md +1 -1
- package/skills/aicut/references/recipes.md +4 -4
- package/skills/aicut/references/troubleshooting.md +2 -2
- package/skills/aicut-motion/SKILL.md +75 -9
- package/skills/aicut-motion/THIRD_PARTY_NOTICES.md +14 -0
- package/skills/aicut-motion/assets/atlas/lib/harness.js +116 -0
- package/skills/aicut-motion/assets/atlas/lib/sound.js +274 -0
- package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/code.js +937 -0
- package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/code.js +909 -0
- package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/code.js +881 -0
- package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/code.js +897 -0
- package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/code.js +814 -0
- package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/code.js +990 -0
- package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/code.js +994 -0
- package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/code.js +792 -0
- package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/code.js +840 -0
- package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/code.js +1126 -0
- package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/code.js +854 -0
- package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/code.js +1124 -0
- package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/code.js +728 -0
- package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/code.js +664 -0
- package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/code.js +991 -0
- package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/code.js +801 -0
- package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/code.js +692 -0
- package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/code.js +756 -0
- package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/code.js +922 -0
- package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/code.js +852 -0
- package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/code.js +724 -0
- package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/code.js +793 -0
- package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/code.js +846 -0
- package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/code.js +1008 -0
- package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/code.js +680 -0
- package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/code.js +633 -0
- package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/code.js +757 -0
- package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/code.js +828 -0
- package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/code.js +697 -0
- package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/code.js +687 -0
- package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/code.js +727 -0
- package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/code.js +903 -0
- package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/code.js +662 -0
- package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/code.js +951 -0
- package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/code.js +759 -0
- package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/code.js +738 -0
- package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/code.js +793 -0
- package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/code.js +673 -0
- package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/code.js +907 -0
- package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/code.js +833 -0
- package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/041-manga-page/code.js +845 -0
- package/skills/aicut-motion/assets/atlas/styles/041-manga-page/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/041-manga-page/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/code.js +496 -0
- package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/043-light-painting/code.js +635 -0
- package/skills/aicut-motion/assets/atlas/styles/043-light-painting/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/043-light-painting/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/code.js +799 -0
- package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/code.js +547 -0
- package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/code.js +592 -0
- package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/code.js +768 -0
- package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/048-transit-map/code.js +666 -0
- package/skills/aicut-motion/assets/atlas/styles/048-transit-map/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/048-transit-map/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/code.js +559 -0
- package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/code.js +943 -0
- package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/code.js +606 -0
- package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/code.js +730 -0
- package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/code.js +782 -0
- package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/code.js +504 -0
- package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/code.js +517 -0
- package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/code.js +713 -0
- package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/code.js +717 -0
- package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/code.js +540 -0
- package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/code.js +524 -0
- package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/code.js +934 -0
- package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/code.js +690 -0
- package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/code.js +612 -0
- package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/code.js +666 -0
- package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/code.js +651 -0
- package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/code.js +656 -0
- package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/code.js +672 -0
- package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/code.js +548 -0
- package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/code.js +989 -0
- package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/code.js +440 -0
- package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/code.js +895 -0
- package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/code.js +563 -0
- package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/code.js +627 -0
- package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/code.js +1096 -0
- package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/code.js +595 -0
- package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/code.js +665 -0
- package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/code.js +645 -0
- package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/code.js +436 -0
- package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/code.js +1237 -0
- package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/code.js +622 -0
- package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/code.js +524 -0
- package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/code.js +689 -0
- package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/code.js +574 -0
- package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/code.js +469 -0
- package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/084-flow-field/code.js +531 -0
- package/skills/aicut-motion/assets/atlas/styles/084-flow-field/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/084-flow-field/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/code.js +675 -0
- package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/style.json +13 -0
- package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/code.js +609 -0
- package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/poster.jpg +0 -0
- package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/style.json +13 -0
- package/skills/aicut-motion/references/design-systems/README.md +1 -1
- package/skills/aicut-motion/references/motion-delivery.md +55 -0
- package/skills/aicut-motion/references/pages.md +1 -1
- package/skills/aicut-motion/references/style-index.json +690 -0
- package/skills/aicut-motion/references/style-research.md +73 -0
- package/skills/aicut-motion/references/style-selection.md +71 -0
- package/skills/aicut-motion/scripts/atlas-viewer.html +195 -0
- package/skills/aicut-motion/scripts/atlas.mjs +109 -0
- package/studio/client.mjs +3 -3
- package/studio/server/fetch-github.mjs +14 -3
- package/studio/server/server.mjs +71 -6
- package/studio/server/skill-summaries.mjs +60 -0
- package/studio/server/skills.mjs +121 -7
- package/studio/server/styles-store.mjs +235 -0
- package/studio/server/template-posters.mjs +2 -2
- package/studio/server/templates-page.mjs +93 -93
- package/studio/server/templates.mjs +32 -7
- package/studio/ui/dist/assets/ExportCenter-DasulhAv.js +1 -0
- package/studio/ui/dist/assets/SettingsModal-BZw0Hz2_.js +2 -0
- package/studio/ui/dist/assets/apple-touch-icon-ClxQ7j-O.png +0 -0
- package/studio/ui/dist/assets/es-C8XPZARI.js +1 -0
- package/studio/ui/dist/assets/favicon-Blwx8Trs.png +0 -0
- package/studio/ui/dist/assets/index-BjJVmBzB.js +1623 -0
- package/studio/ui/dist/assets/index-C3BfKZFO.css +1 -0
- package/studio/ui/dist/assets/ja-BeNkdaEj.js +1 -0
- package/studio/ui/dist/assets/ko-DcTVhdzK.js +1 -0
- package/studio/ui/dist/assets/zh-CN-Cg51ctbL.js +1 -0
- package/studio/ui/dist/index.html +4 -3
- package/studio/ui/dist/assets/ExportCenter-F-2vF-lQ.js +0 -1
- package/studio/ui/dist/assets/SettingsModal-BgVYguNu.js +0 -2
- package/studio/ui/dist/assets/es-BRUzvuoM.js +0 -1
- package/studio/ui/dist/assets/index-Bhg-9dA3.css +0 -1
- package/studio/ui/dist/assets/index-CWur1Iw9.js +0 -1625
- package/studio/ui/dist/assets/ja-Cth-uDcW.js +0 -1
- package/studio/ui/dist/assets/ko-upvw591D.js +0 -1
- package/studio/ui/dist/assets/zh-CN-BCfJFazB.js +0 -1
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>AiCut Studio</title>
|
|
7
|
-
<link rel="icon" type="image/
|
|
7
|
+
<link rel="icon" type="image/png" href="/assets/favicon-Blwx8Trs.png">
|
|
8
|
+
<link rel="apple-touch-icon" href="/assets/apple-touch-icon-ClxQ7j-O.png">
|
|
8
9
|
<script>
|
|
9
10
|
/* the theme before the first paint, so the wrong one never flashes: dark unless the person chose another */
|
|
10
11
|
(function () {
|
|
@@ -14,8 +15,8 @@
|
|
|
14
15
|
document.documentElement.dataset.theme = t === 'dark' ? 'dark' : 'light';
|
|
15
16
|
})();
|
|
16
17
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-BjJVmBzB.js"></script>
|
|
19
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C3BfKZFO.css">
|
|
19
20
|
</head>
|
|
20
21
|
<body>
|
|
21
22
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Te,F as ne,u as St,e as Nt,R as h,G as wt,H as Et,I as Qe,J as De,r as Mt,j as t,X as Ft,C as Pt,K as $,N as Dt,D as $t,O as _e,h as dt,L as Ue,Q as At,U as It,M as _t,V as Tt,W as Ht,Y as Rt,Z as zt,_ as Lt,$ as Ot,a0 as We,a1 as qt,a2 as Bt,s as Gt,y as Vt,a3 as Kt}from"./index-CWur1Iw9.js";const Qt=Te("FolderArchive",[["circle",{cx:"15",cy:"19",r:"2",key:"u2pros"}],["path",{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1",key:"1jj40k"}],["path",{d:"M15 11v-1",key:"cntcp"}],["path",{d:"M15 17v-2",key:"1279jj"}]]);const Ut=Te("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);const Wt=Te("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Xe=["prores4444","hevc_alpha","vp9","png"],Xt={h264:"H.264",hevc:"HEVC",vp9:"WebM VP9",prores422hq:"ProRes 422 HQ",prores4444:"ProRes 4444",hevc_alpha:"HEVC + Alpha",png:"PNG"},ge=[{id:"bilibili",name:"哔哩哔哩",group:"landscape",frame:"16:9",shortEdge:1080,fps:60,burnSubtitles:!1,china:!0},{id:"douyin",name:"抖音",group:"vertical",frame:"9:16",shortEdge:1080,fps:30,burnSubtitles:!0,china:!0},{id:"kuaishou",name:"快手",group:"vertical",frame:"9:16",shortEdge:1080,fps:30,burnSubtitles:!0,china:!0},{id:"channels",name:"视频号",group:"vertical",frame:"9:16",shortEdge:1080,fps:30,burnSubtitles:!0,china:!0},{id:"xiaohongshu",name:"小红书",group:"feed",frame:"3:4",shortEdge:1080,fps:30,burnSubtitles:!0,china:!0},{id:"youtube",name:"YouTube",group:"landscape",frame:"16:9",shortEdge:1080,fps:60,burnSubtitles:!1},{id:"youtube-4k",name:"YouTube 4K",group:"landscape",frame:"16:9",shortEdge:2160,fps:60,burnSubtitles:!1},{id:"x",name:"X",group:"landscape",frame:"16:9",shortEdge:1080,fps:30,burnSubtitles:!0,maxDurationSec:140},{id:"shorts",name:"YouTube Shorts",group:"vertical",frame:"9:16",shortEdge:1080,fps:30,burnSubtitles:!0,maxDurationSec:180},{id:"tiktok",name:"TikTok",group:"vertical",frame:"9:16",shortEdge:1080,fps:30,burnSubtitles:!0},{id:"reels",name:"Instagram Reels",group:"vertical",frame:"9:16",shortEdge:1080,fps:30,burnSubtitles:!0},{id:"instagram",name:"Instagram Feed",group:"feed",frame:"4:5",shortEdge:1080,fps:30,burnSubtitles:!0},{id:"square",name:"LinkedIn · Facebook",group:"feed",frame:"1:1",shortEdge:1080,fps:30,burnSubtitles:!0}];function Yt(a){return a==="zh-CN"?[...ge.filter(o=>o.china),...ge.filter(o=>!o.china)]:ge.filter(o=>!o.china)}function Zt(a){return ge.find(o=>o.id===a)??null}const ue=4096;function A(a){return Math.max(2,Math.round(a/2)*2)}function xt(a,o){const i=a.ratio??a.w/Math.max(1,a.h);let r,c;if(i>=1?(c=A(o),r=A(c*i)):(r=A(o),c=A(r/i)),r>ue||c>ue){const f=Math.min(ue/r,ue/c);r=A(r*f),c=A(c*f)}return{w:r,h:c}}function Jt(a,o){const i=a.ratio??a.w/Math.max(1,a.h);return i>=1?{w:A(o),h:A(o/i)}:{w:A(o*i),h:A(o)}}function Ye(a,o,i,r){return xt(ne(a,o,i),r)}const er={standard:.07,high:.11,master:.2};function tr(a,o,i,r){return Math.min(12e7,Math.max(2e6,a.w*a.h*Math.max(1,o)*er[i]*r))}const me={w:1920,h:1080,fps:30,bytes:15e4},rr=[.25,4],sr=[.9,1.1],ar={standard:.58,high:1,master:1.6},nr={h264:1,hevc:.6,vp9:.7},lr={vp9:2e4,prores422hq:192e3,prores4444:192e3,hevc_alpha:192e3};function Ze(a,o,i,r){const c=ne(a,o,i),f=Math.min(1,c.inner.w*c.inner.h/Math.max(1,c.w*c.h));return r.w*r.h*f}function or(a){const o=Math.max(0,a.durationMs)/1e3,i=a.size.w*a.size.h;let r,c=sr;switch(a.codec){case"prores422hq":r=22e7*(i/(1920*1080))*(a.fps/30);break;case"prores4444":r=33e7*(i/(1920*1080))*(a.fps/30);break;case"hevc_alpha":r=tr(a.size,a.fps,a.quality,.8);break;case"png":r=i*8*a.fps;break;default:{const x=a.filmPixels??i;r=8*me.bytes*(x/(me.w*me.h))**.75*(Math.max(1,a.fps)/me.fps)**.35*ar[a.quality]*(nr[a.codec]??1),c=rr}}const f=a.audio?lr[a.codec]??24e3:0,m=x=>Math.round((r/8*x+f)*o);return[m(c[0]),m(c[1])]}const he={w:640,h:360,fps:15,bytes:3e5},Je=[.4,3];function ir(a){const o=a.filmPixels??a.size.w*a.size.h,i=he.bytes*(o/(he.w*he.h))**.9*(Math.max(1,a.fps)/he.fps)**.6*Math.max(0,a.durationMs)/1e3;return[Math.round(i*Je[0]),Math.round(i*Je[1])]}const $e=400;function cr(a,o){const i=a.filter(x=>x.durMs>0&&x.startMs<o),r=(x,I)=>{const k=[...x].sort((b,P)=>b.ms-P.ms),s=[];for(const b of k){const P=s.at(-1);P&&b.ms-P.last<$e?(P.last=b.ms,I&&(P.ms=b.ms),P.labels.includes(b.label)||P.labels.push(b.label)):s.push({ms:b.ms,last:b.ms,labels:[b.label]})}return s.map(b=>({ms:b.ms,title:b.labels.filter(Boolean).join(", ")}))},c=r(i.map(x=>({ms:Math.max(0,x.startMs),label:x.label})),!1),f=r(i.map(x=>({ms:Math.min(o,x.startMs+x.durMs),label:x.label})),!0);c[0]&&c[0].ms<$e?c[0].ms=0:c.unshift({ms:0,title:""});const m=f.at(-1);return m&&o-m.ms<$e?m.ms=o:o>0&&f.push({ms:o,title:""}),{starts:c,ends:f.filter(x=>x.ms>0)}}const et=[{id:"video",icon:t.jsx(It,{size:16})},{id:"nle",icon:t.jsx(dt,{size:16})},{id:"social",icon:t.jsx(_t,{size:16})},{id:"alpha",icon:t.jsx(Tt,{size:16})},{id:"gif",icon:t.jsx(Ht,{size:16})},{id:"audio",icon:t.jsx(Rt,{size:16})},{id:"subtitles",icon:t.jsx(zt,{size:16})},{id:"images",icon:t.jsx(Ut,{size:16})},{id:"slides",icon:t.jsx(Wt,{size:16})},{id:"html",icon:t.jsx(Lt,{size:16})},{id:"project",icon:t.jsx(Qt,{size:16})}],Ae={premiere:"Premiere Pro",resolve:"DaVinci Resolve"},tt={jianying:"剪映",capcut:"CapCut"},dr=["voice","music","sfx","footage"],be="__film__",C={dest:"video",presets:["youtube"],socialQuality:"high",socialSubs:"auto",video:{codec:"h264",shortEdge:1080,fps:"source",quality:"high",frame:"current",fill:"contain",audio:!0,burn:!0,sidecar:"none"},gif:{width:640,fps:15,frame:"current",fill:"contain",burn:!0},alpha:{codec:"prores4444",source:be,shortEdge:1080,scale:1,fps:30,audio:!0},audio:{format:"wav",mix:!0,stems:!1},nle:{app:"auto",fps:"source",audio:"clips",subtitles:!0},subtitles:{format:"srt"},images:{format:"png",shortEdge:1080,frame:"current",fill:"contain",burn:!1},slides:{format:"pptx",shortEdge:1080,frame:"current",fill:"contain",burn:!1},html:{mode:"pages",shortEdge:1080,frame:"current",fill:"contain",burn:!1,packed:!0},project:{as:"zip",history:!1,chat:!1,logs:!1},folder:""},pt="aicut.exportCenter.v1";function xr(a){const o=a==="zh-CN"?{...C,presets:["bilibili"]}:C;try{const i=JSON.parse(localStorage.getItem(pt)??"null");return!i||typeof i!="object"?o:{...C,...i,presets:Array.isArray(i.presets)?i.presets.filter(r=>Zt(r)):C.presets,video:{...C.video,...i.video},gif:{...C.gif,...i.gif},alpha:{...C.alpha,...i.alpha},audio:{...C.audio,...i.audio},nle:{...C.nle,...i.nle},subtitles:{...C.subtitles,...i.subtitles},images:{...C.images,...i.images},slides:{...C.slides,...i.slides},html:{...C.html,...i.html},project:{...C.project,...i.project?.as==="folder"?{as:"folder"}:{}}}}catch{return o}}function pr(a){try{localStorage.setItem(pt,JSON.stringify(a))}catch{}}const rt=[480,720,1080,1440,2160],st=[720,1080,1440,2160],at=Dt,ur=[320,480,640,800,1080],mr=[10,12,15,20,24],nt=["h264","hevc","prores422hq","prores4444","hevc_alpha","vp9","png"],hr=[.5,1,2],fr=["landscape","vertical","feed"],lt=[23.976,24,25,29.97,30,50,59.94,60],ot=/\.(mp4|m4v|mov|webm|mkv|avi|ogv)$/i;function fe(a,o){if(!o)return!0;switch(a){case"h264":return o.h264;case"hevc":return o.hevc;case"hevc_alpha":return o.hevcAlpha;case"vp9":return o.vp9;case"prores422hq":case"prores4444":return o.prores;case"png":return!0}}const gr=new Set(["social","video","alpha","gif","audio","images","slides","html"]);function kr(a){const{open:o,onClose:i}=a,r=St(),c=Nt(),f=h.useMemo(()=>Yt(c),[c]),[m,x]=h.useState(null),[I,k]=h.useState({jianying:!1,capcut:!1}),[s,b]=h.useState(C),[P,mt]=h.useState(!1),[M,W]=h.useState({on:!1,from:0,to:0}),[_,ve]=h.useState(null),[je,X]=h.useState(null),[le,ht]=h.useState(""),[He,ft]=h.useState(null),[S,gt]=h.useState(null),[K,Re]=h.useState(null),[oe,Y]=h.useState(null);h.useEffect(()=>{if(!o)return;const e=xr(c);b(a.focusClipId?{...e,dest:"alpha",alpha:{...e.alpha,source:a.focusClipId}}:e),mt(!0),X(null),ve(null),Y(null),W(n=>({...n,on:!1})),wt(a.projectId).then(n=>{x(n.can),k({jianying:!!n.drafts?.jianying,capcut:!!n.drafts?.capcut}),ht(n.folder),ft(n.subtitles??0),gt(n.project??null)}).catch(()=>{})},[o]),h.useEffect(()=>{P&&pr(s)},[s,P]),h.useEffect(()=>{if(!o)return;const e=n=>{n.key==="Escape"&&!_&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o,i,_]);const g=a.stage,v=a.durationMs,N=a.film??null,Z=h.useMemo(()=>new Set((N?.sounds??[]).filter(e=>e.durMs>0).map(e=>e.src&&ot.test(e.src)?"footage":e.kind)),[N]),Ce=N!=null&&Z.size===0,ie=h.useMemo(()=>a.mgBlocks??[],[a.mgBlocks]),y=He??0,ke=h.useMemo(()=>[...N?.scenes??[]].sort((e,n)=>e.startMs-n.startMs).find(e=>e.src&&ot.test(e.src))?.src??null,[N]);h.useEffect(()=>{if(Re(null),!o||!ke)return;let e=!0;return Et(a.projectId,ke).then(n=>{!e||n==null||Re(lt.find(l=>Math.abs(l-n)<.05)??null)}).catch(()=>{}),()=>{e=!1}},[o,ke,a.projectId]);const ye=h.useMemo(()=>cr(N?.scenes??[],v),[N,v]),Se=h.useMemo(()=>{if(!N)return 1;let e=-1/0,n=0;for(const l of[...N.scenes].sort((w,j)=>w.startMs-j.startMs))!(l.durMs>0)||l.startMs>=v||l.startMs-e<400||(e=l.startMs,n++);return Math.max(1,Math.min(120,n))},[N,v]);h.useEffect(()=>{W(e=>({...e,from:0,to:v}))},[v]);const Q=M.on&&M.to>M.from&&(M.from>0||M.to<v)?{fromMs:M.from,toMs:M.to}:void 0,q=Q?Q.toMs-Q.fromMs:v,ce=Q?[Q.fromMs/1e3,Q.toMs/1e3]:void 0,B=e=>e==="current"?a.frame:e,J=a.projectFps??30,ze=e=>e==="source"?J:e,d=(e,n)=>{b(l=>({...l,[e]:typeof n=="object"&&!Array.isArray(n)&&n!==null?{...l[e],...n}:n}))},u=et.some(e=>e.id===s.dest)?s.dest:"video",T=ie.find(e=>e.clipId===s.alpha.source),bt=u==="alpha"&&T?T.durMs:q,G=fe(s.video.codec,m)&&nt.includes(s.video.codec)?s.video.codec:"h264",ee=Xe.includes(s.alpha.codec)&&fe(s.alpha.codec,m)?s.alpha.codec:"prores4444",Le=s.audio.format==="mp3"&&m&&!m.mp3?"wav":s.audio.format,de=c==="zh-CN"?"jianying":"capcut",te=I[de]||!I[de==="jianying"?"capcut":"jianying"]?de:de==="jianying"?"capcut":"jianying",Ne=I[te],re=e=>r(e).replaceAll("{app}",tt[te]),H=s.nle.app==="auto"?Ne?"draft":"premiere":s.nle.app,vt=u==="nle"&&H==="draft"&&Ne,xe=e=>Xt[e]+(e==="png"?` ${r("exportCenter.sequence")}`:""),Oe=h.useMemo(()=>Qe.filter(e=>s.project[e]&&(S==null||S[e]!=null)),[s.project,S]),se=h.useMemo(()=>{const e=ce?{range:ce}:{},n=l=>y>0&&l?{burnSubtitles:!0}:{};switch(u){case"social":return s.presets.map(l=>f.find(w=>w.id===l)??null).filter(l=>l!==null).map(l=>({kind:"video",codec:"h264",frame:l.frame,fill:"contain",shortEdge:l.shortEdge,fps:l.fps,quality:s.socialQuality,audio:!0,preset:l.name,label:l.name,...n(s.socialSubs==="auto"?l.burnSubtitles:s.socialSubs==="on"),...e}));case"video":{const l=s.video;return[{kind:"video",codec:G,frame:B(l.frame),fill:l.fill,shortEdge:l.shortEdge,fps:ze(l.fps),quality:l.quality,audio:l.audio,label:xe(G),...n(l.burn),...y>0&&l.sidecar!=="none"&&G!=="png"?{sidecar:l.sidecar}:{},...e}]}case"alpha":{const l=s.alpha;return T?[{kind:"video",codec:ee,clip:T.clipId,scale:l.scale,fps:l.fps,quality:"high",audio:l.audio,label:T.label}]:[{kind:"video",codec:ee,frame:"native",shortEdge:l.shortEdge,fps:l.fps,quality:"high",audio:l.audio,label:xe(ee),...e}]}case"gif":return[{kind:"gif",frame:B(s.gif.frame),fill:s.gif.fill,width:s.gif.width,fps:s.gif.fps,label:"GIF",...n(s.gif.burn),...e}];case"audio":{const l=s.audio.stems;return[{kind:"audio",format:Le,stems:l,mix:l?s.audio.mix:!0,label:r(l?"exportCenter.audioStems":"exportCenter.audioMix"),...e}]}case"nle":return[{kind:"nle",format:H==="draft"?te:"xml",fps:s.nle.fps==="source"?K??J:s.nle.fps,audio:s.nle.audio,media:"copy",subtitles:s.nle.subtitles,label:H==="draft"?re("exportCenter.nleDraftTitle"):`${Ae[H]} XML`}];case"subtitles":return[{kind:"subtitles",format:s.subtitles.format,label:s.subtitles.format==="txt"?r("exportCenter.transcript"):s.subtitles.format.toUpperCase(),...e}];case"images":return[{kind:"stills",format:s.images.format,shortEdge:s.images.shortEdge,frame:B(s.images.frame),fill:s.images.fill,label:r("exportCenter.stills"),...n(s.images.burn)}];case"slides":return[{kind:"slides",format:s.slides.format,shortEdge:s.slides.shortEdge,frame:B(s.slides.frame),fill:s.slides.fill,label:s.slides.format==="pdf"?"PDF":"PowerPoint",...n(s.slides.burn)}];case"html":return[{kind:"html",mode:s.html.mode,shortEdge:s.html.shortEdge,frame:B(s.html.frame),fill:s.html.fill,packed:s.html.packed,label:"HTML",...n(s.html.mode==="deck"&&s.html.burn)}];case"project":return[{kind:"project",as:s.project.as,parts:Oe,label:r(s.project.as==="zip"?"exportCenter.projectZip":"exportCenter.projectFolder")}]}},[u,s,m,f,H,te,ce?.[0],ce?.[1],a.frame,ie,K,y,Oe]),qe=h.useMemo(()=>se.reduce(([e,n],l)=>{const w=([j,E])=>[e+j,n+E];if(l.kind==="video"){if(l.clip)return[e,n];const j=l.frame??"native",E=l.fill??"contain",D=Ye(g,j,E,l.shortEdge??Math.min(g.w,g.h));return w(or({codec:l.codec,size:D,filmPixels:Ze(g,j,E,D),fps:l.fps,quality:l.quality,durationMs:q,audio:l.audio&&l.codec!=="png"&&!Ce}))}if(l.kind==="gif"){const j=l.frame??"native",E=l.fill??"contain",D=Jt(ne(g,j,E),l.width);return w(ir({size:D,filmPixels:Ze(g,j,E,D),fps:l.fps,durationMs:q}))}if(l.kind==="audio"){const j=l.format==="wav"?192e3:32e3,E=(l.mix?1:0)+(l.stems?Z.size:0),D=j*(q/1e3)*Math.max(1,E);return w([D,D])}if(l.kind==="project"&&S){const j=l.parts.reduce((E,D)=>E+(S[D]??0),S.work);return w([j,j])}return[e,n]},[0,0]),[se,g,q,Z,Ce,S]),Be=qe[1]>0?[...new Set(qe.map(e=>De(e)))].join("–"):"",R=s.folder||le,we=se.reduce((e,n)=>n.kind==="audio"?e+(n.mix?1:0)+(n.stems?Math.max(1,Z.size):0):n.kind==="video"&&n.sidecar?e+2:e+1,0),pe=a.missingFiles??[],Ee=pe.length&&gr.has(u)?r("exportCenter.missingMedia").replace("{n}",String(pe.length)).replace("{files}",pe.slice(0,3).map(e=>e.split("/").pop()).join(", ")+(pe.length>3?", …":"")):null,Me=Ee||(!v&&u!=="project"?r("exportCenter.emptyFilm"):u==="social"&&se.length===0?r("exportCenter.pickPreset"):u==="subtitles"&&He!=null&&y===0?r("exportCenter.noCaptions"):u==="audio"&&Ce?r("exportCenter.noAudio"):null),Ge=async e=>{if(!_){if(X(null),!R){X({ok:!1,text:r("exportCenter.noFolder")});return}ve(r("exportCenter.queueing"));try{const n=await Kt(a.projectId,e,s.folder||void 0);a.onQueued?.(n),i()}catch(n){X({ok:!1,text:n instanceof TypeError?r("exportCenter.engineDown"):n instanceof Error?n.message:String(n)})}finally{ve(null)}}},Fe=a.playheadMs!=null&&a.playheadMs>0&&a.playheadMs<v?a.playheadMs/1e3:void 0,jt=()=>{const e=Fe;Ge([{kind:"poster",format:s.images.format,shortEdge:s.images.shortEdge,frame:B(s.images.frame),fill:s.images.fill,label:r("exportCenter.poster"),...e!=null?{at:e}:{},...y>0&&s.images.burn?{burnSubtitles:!0}:{}}])},Ve=()=>{if(oe==null)return;const e=oe.trim();d("folder",e===le?"":e),Y(null)},[Pe,Ke]=h.useState(!1),Ct=async()=>{if(!Pe){Ke(!0);try{const e={title:r("exportCenter.pickTitle"),button:r("exportCenter.pickButton"),...R?{at:R}:{}},n=Gt?.folders?.pick,l=n?await n(e):await Vt.pickFolder(e.title,e.at);l&&d("folder",l===le?"":l)}catch{Y(R)}finally{Ke(!1)}}};if(!o||typeof document>"u")return null;const kt=_??(we>1?r("exportCenter.exportN").replace("{n}",String(we)):r("exportCenter.export")),yt=!!_||!!Me||!R;return Mt.createPortal(t.jsx("div",{className:"fixed inset-0 z-[130] flex items-center justify-center bg-black/45 p-4 backdrop-blur-[2px]",onClick:()=>{_||i()},children:t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":r("exportCenter.title"),className:"flex h-[min(640px,calc(100vh-32px))] w-full max-w-[1080px] overflow-hidden rounded-2xl border border-[var(--border)] bg-[var(--surface)] shadow-[var(--shadow-lg)]",style:{animation:"aicut-rise 0.16s ease-out both"},onClick:e=>e.stopPropagation(),children:[t.jsxs("nav",{className:"flex min-h-0 w-[212px] shrink-0 flex-col border-r border-[var(--border-soft)] bg-[var(--surface-2)]",children:[t.jsx("h2",{className:"shrink-0 px-5 pb-2 pt-4 text-[15px] font-semibold tracking-tight text-[var(--text)]",children:r("exportCenter.title")}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-3 pb-2",children:et.map(e=>{const n=u===e.id;return t.jsxs("button",{type:"button","aria-pressed":n,onClick:()=>{d("dest",e.id),X(null)},className:`flex items-start gap-2.5 rounded-lg px-2.5 py-2 text-left transition ${n?"bg-[var(--surface)] shadow-[var(--shadow-sm)]":"hover:bg-[var(--bg-hover)]"}`,children:[t.jsx("span",{className:`mt-0.5 shrink-0 ${n?"text-[var(--text)]":"text-[var(--text-muted)]"}`,children:e.icon}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:`block text-[13px] font-medium ${n?"text-[var(--text)]":"text-[var(--text-muted)]"}`,children:r(`exportCenter.dest.${e.id}`)}),t.jsx("span",{className:"block text-[11px] leading-snug text-[var(--text-faint)]",children:re(`exportCenter.destHint.${e.id}`)})]})]},e.id)})}),t.jsx("div",{className:"shrink-0 border-t border-[var(--border-soft)] px-5 py-3 text-[10.5px] leading-relaxed text-[var(--text-faint)]",children:r("exportCenter.engineDesktop")})]}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-5 pb-1 pt-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h3",{className:"text-[14px] font-semibold text-[var(--text)]",children:r(`exportCenter.dest.${u}`)}),t.jsx("p",{className:"mt-0.5 text-[12px] leading-relaxed text-[var(--text-muted)]",children:re(`exportCenter.destDesc.${u}`)})]}),t.jsx("button",{type:"button",onClick:i,disabled:!!_,"aria-label":r("exportDialog.close"),className:"self-start rounded-lg p-1 text-[var(--text-faint)] transition hover:bg-[var(--bg-hover)] hover:text-[var(--text)]",children:t.jsx(Ft,{size:16})})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-4 pt-3",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[u==="social"&&t.jsxs(t.Fragment,{children:[fr.map(e=>t.jsx(p,{label:r(`exportCenter.group.${e}`),children:t.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:f.filter(n=>n.group===e).map(n=>{const l=s.presets.includes(n.id),w=xt(ne(g,n.frame),n.shortEdge),j=n.maxDurationSec!=null&&q/1e3>n.maxDurationSec;return t.jsxs("button",{type:"button","aria-pressed":l,onClick:()=>d("presets",l?s.presets.filter(E=>E!==n.id):[...s.presets,n.id]),className:`relative flex flex-col items-start gap-0.5 rounded-xl border px-3 py-2.5 text-left transition ${l?"border-[var(--text)] bg-[var(--bg-hover)]":"border-[var(--border)] hover:border-[var(--text-faint)]"}`,children:[t.jsxs("span",{className:"flex w-full items-center gap-1.5",children:[t.jsx(ut,{frame:n.frame,stage:g}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium text-[var(--text)]",children:n.name}),l&&t.jsx(Pt,{size:13,className:"shrink-0 text-[var(--text)]"})]}),t.jsxs("span",{className:"text-[11px] tabular-nums text-[var(--text-faint)]",children:[w.w,"×",w.h," · ",n.fps,"fps"]}),j&&t.jsx("span",{className:"text-[10.5px] leading-snug text-[var(--warn)]",children:r("exportCenter.tooLong").replace("{max}",$(n.maxDurationSec*1e3))})]},n.id)})})},e)),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsx(p,{label:r("exportCenter.quality"),children:t.jsx(ct,{value:s.socialQuality,onChange:e=>d("socialQuality",e),t:r})}),y>0&&t.jsx(p,{label:r("exportCenter.burnSubtitles"),children:t.jsx(O,{value:s.socialSubs,options:[{value:"auto",label:r("exportCenter.subsAuto")},{value:"on",label:r("exportCenter.subsOn")},{value:"off",label:r("exportCenter.subsOff")}],onChange:e=>d("socialSubs",e)})})]}),t.jsx(L,{children:r("exportCenter.socialHint")})]}),u==="video"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.codec"),children:t.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:nt.map(e=>{const n=!fe(e,m);return t.jsx(U,{on:G===e,disabled:n,title:xe(e),desc:r(n?"exportCenter.notOnThisComputer":`exportCenter.codecHint.${e}`),onClick:()=>d("video",{codec:e})},e)})})}),t.jsx(ae,{value:s.video.frame,fill:s.video.fill,current:a.frame,stage:g,onChange:e=>d("video",{frame:e}),onFill:e=>d("video",{fill:e}),t:r}),t.jsx(p,{label:r("exportCenter.resolution"),children:t.jsx(V,{value:s.video.shortEdge,options:rt.map(e=>{const n=Ye(g,B(s.video.frame),s.video.fill,e);return{value:e,label:e===2160?"4K":`${e}p`,sub:`${n.w}×${n.h}`}}),onChange:e=>d("video",{shortEdge:e})})}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsx(p,{label:r("exportCenter.fps"),children:t.jsx(Ie,{label:r("exportCenter.fps"),value:ze(s.video.fps),rates:at,own:{fps:J,note:r("exportCenter.fpsProject")},onPick:e=>d("video",{fps:e===J?"source":e})})}),!(G.startsWith("prores")||G==="png")&&t.jsx(p,{label:r("exportCenter.quality"),children:t.jsx(ct,{value:s.video.quality,onChange:e=>d("video",{quality:e}),t:r})})]}),G!=="png"&&t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[t.jsx(p,{label:r("exportCenter.audio"),children:t.jsx(F,{checked:s.video.audio,onChange:e=>d("video",{audio:e}),label:r("exportCenter.includeAudio")})}),y>0&&t.jsxs(p,{label:r("exportCenter.subtitles"),children:[t.jsx(F,{checked:s.video.burn,onChange:e=>d("video",{burn:e}),label:r("exportCenter.burnIn")}),t.jsx("div",{className:"mt-2",children:t.jsx(O,{value:s.video.sidecar,options:[{value:"none",label:r("exportCenter.noSidecar")},{value:"srt",label:"+ SRT"},{value:"vtt",label:"+ VTT"}],onChange:e=>d("video",{sidecar:e})})})]})]})]}),u==="alpha"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.alphaSource"),children:t.jsxs("div",{className:"flex max-h-[200px] flex-col gap-1.5 overflow-y-auto pr-1",children:[[{clipId:be,label:r("exportCenter.alphaWhole"),startMs:0,durMs:v},...ie].map(e=>{const n=(T?T.clipId:be)===e.clipId;return t.jsxs("button",{type:"button","aria-pressed":n,onClick:()=>d("alpha",{source:e.clipId}),className:`flex items-center gap-2.5 rounded-lg border px-3 py-2 text-left transition ${n?"border-[var(--text)] bg-[var(--bg-hover)]":"border-[var(--border)] hover:border-[var(--text-faint)]"}`,children:[t.jsx("span",{className:`h-3.5 w-3.5 shrink-0 rounded-full border ${n?"border-[4px] border-[var(--text)]":"border-[var(--text-faint)]"}`}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium text-[var(--text)]",children:e.label}),t.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-[var(--text-faint)]",children:e.clipId===be?r("exportCenter.alphaWholeHint"):`${$(e.startMs)} · ${$(e.durMs)}`})]},e.clipId)}),ie.length===0&&t.jsx(L,{children:r("exportCenter.alphaNoBlocks")})]})}),t.jsx(p,{label:r("exportCenter.format"),children:t.jsx("div",{className:"grid grid-cols-2 gap-2",children:Xe.map(e=>{const n=!fe(e,m);return t.jsx(U,{on:ee===e,disabled:n,title:xe(e),desc:r(n?"exportCenter.notOnThisComputer":`exportCenter.alphaCodecHint.${e}`),onClick:()=>d("alpha",{codec:e})},e)})})}),t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[T?t.jsx(p,{label:r("exportCenter.alphaScale"),children:t.jsx(V,{value:s.alpha.scale,options:hr.map(e=>({value:e,label:`${e}×`})),onChange:e=>d("alpha",{scale:e})})}):t.jsx(p,{label:r("exportCenter.resolution"),children:t.jsx(V,{value:s.alpha.shortEdge,options:rt.map(e=>({value:e,label:e===2160?"4K":`${e}p`})),onChange:e=>d("alpha",{shortEdge:e})})}),t.jsx(p,{label:r("exportCenter.fps"),children:t.jsx(Ie,{label:r("exportCenter.fps"),value:s.alpha.fps,rates:at,own:{fps:J,note:r("exportCenter.fpsProject")},onPick:e=>d("alpha",{fps:e})})})]}),ee!=="png"&&t.jsx(F,{checked:s.alpha.audio,onChange:e=>d("alpha",{audio:e}),label:r("exportCenter.includeAudio")}),t.jsx(jr,{children:r("exportCenter.alphaHint")})]}),u==="nle"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.nleFor"),children:t.jsx(O,{value:H,options:[{value:"draft",label:tt[te]},{value:"premiere",label:Ae.premiere},{value:"resolve",label:Ae.resolve}],onChange:e=>d("nle",{app:e})})}),t.jsx(p,{label:r("exportCenter.fps"),children:t.jsx(Ie,{label:r("exportCenter.fps"),value:s.nle.fps==="source"?K??30:s.nle.fps,rates:lt,own:K?{fps:K,note:r("exportCenter.fpsSource")}:null,onPick:e=>d("nle",{fps:e===K?"source":e})})}),t.jsx(p,{label:r("exportCenter.nleAudio"),children:t.jsx(O,{value:s.nle.audio,options:[{value:"clips",label:r("exportCenter.nleAudioClips")},{value:"stems",label:r("exportCenter.nleAudioStems")}],onChange:e=>d("nle",{audio:e})})}),y>0&&t.jsx(F,{checked:s.nle.subtitles,onChange:e=>d("nle",{subtitles:e}),label:r(H==="draft"?"exportCenter.nleSubs":"exportCenter.nleSrt")}),t.jsx(L,{children:re(H==="premiere"?"exportCenter.nleHintPremiere":H==="resolve"?"exportCenter.nleHintResolve":Ne?"exportCenter.nleHintDraft":"exportCenter.nleHintDraftNone")})]}),u==="gif"&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:s.gif.frame,fill:s.gif.fill,current:a.frame,stage:g,onChange:e=>d("gif",{frame:e}),onFill:e=>d("gif",{fill:e}),t:r}),t.jsx(p,{label:r("exportCenter.gifWidth"),children:t.jsx(V,{value:s.gif.width,options:ur.map(e=>({value:e,label:`${e}px`})),onChange:e=>d("gif",{width:e})})}),t.jsx(p,{label:r("exportCenter.fps"),children:t.jsx(V,{value:s.gif.fps,options:mr.map(e=>({value:e,label:`${e}`})),onChange:e=>d("gif",{fps:e})})}),y>0&&t.jsx(F,{checked:s.gif.burn,onChange:e=>d("gif",{burn:e}),label:r("exportCenter.burnIn")}),t.jsx(L,{children:r("exportCenter.gifHint")})]}),u==="audio"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.format"),children:t.jsx("div",{className:"grid grid-cols-3 gap-2",children:["wav","m4a","mp3"].map(e=>{const n=e==="mp3"&&m!=null&&!m.mp3;return t.jsx(U,{on:Le===e,disabled:n,title:e.toUpperCase(),desc:r(n?"exportCenter.notOnThisComputer":`exportCenter.audioHint.${e}`),onClick:()=>d("audio",{format:e})},e)})})}),t.jsx(p,{label:r("exportCenter.contents"),children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(F,{checked:s.audio.mix||!s.audio.stems,onChange:e=>d("audio",{mix:e}),label:r("exportCenter.audioMix"),disabled:!s.audio.stems}),t.jsx(F,{checked:s.audio.stems,onChange:e=>d("audio",{stems:e}),label:r("exportCenter.audioStems")}),s.audio.stems&&N&&t.jsx("p",{className:"pl-6 text-[11.5px] text-[var(--text-faint)]",children:dr.filter(e=>Z.has(e)).map(e=>r(`exportCenter.stem.${e}`)).join(" · ")||r("exportCenter.noAudio")})]})}),t.jsx(L,{children:r("exportCenter.stemsHint")})]}),u==="subtitles"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.format"),children:t.jsx("div",{className:"grid grid-cols-3 gap-2",children:["srt","vtt","txt"].map(e=>t.jsx(U,{on:s.subtitles.format===e,title:e==="txt"?r("exportCenter.transcript"):e.toUpperCase(),desc:r(`exportCenter.subsHint.${e}`),onClick:()=>d("subtitles",{format:e})},e))})}),t.jsx(L,{children:r("exportCenter.captionCount").replace("{n}",String(y))})]}),u==="project"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.format"),children:t.jsx("div",{className:"grid grid-cols-2 gap-2",children:["zip","folder"].map(e=>t.jsx(U,{on:s.project.as===e,title:r(e==="zip"?"exportCenter.projectZip":"exportCenter.projectFolder"),desc:r(e==="zip"?"exportCenter.projectZipHint":"exportCenter.projectFolderHint"),onClick:()=>d("project",{as:e})},e))})}),t.jsx(p,{label:r("exportCenter.contents"),children:t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx(it,{checked:!0,locked:!0,onChange:()=>{},label:r("exportCenter.projectPart.work"),hint:r("exportCenter.projectPartHint.work"),size:S?De(S.work):""}),Qe.map(e=>{const n=S!=null&&S[e]==null;return t.jsx(it,{checked:s.project[e]&&!n,disabled:n,onChange:l=>d("project",{[e]:l}),label:r(`exportCenter.projectPart.${e}`),hint:r(n?"exportCenter.projectPartNone":`exportCenter.projectPartHint.${e}`),size:!n&&S?De(S[e]??0):""},e)})]})}),t.jsx(L,{children:r("exportCenter.projectHint")})]}),u==="images"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.poster"),children:t.jsxs("button",{type:"button",onClick:jt,disabled:!!_||!v||!R,className:"inline-flex h-9 items-center gap-2 self-start rounded-lg border border-[var(--border)] px-3 text-[12.5px] font-medium text-[var(--text)] transition hover:bg-[var(--bg-hover)] disabled:cursor-not-allowed disabled:opacity-40",children:[t.jsx($t,{size:14}),Fe!=null?r("exportCenter.posterAt").replace("{time}",$(Fe*1e3)):r("exportCenter.posterMiddle")]})}),t.jsxs(p,{label:r("exportCenter.sceneStills"),children:[t.jsx("p",{className:"-mt-1 mb-1 text-[12px] text-[var(--text-muted)]",children:r("exportCenter.sceneStillsDesc").replace("{n}",String(Se))}),t.jsx(O,{value:s.images.format,options:[{value:"png",label:"PNG"},{value:"jpg",label:"JPG"}],onChange:e=>d("images",{format:e})})]}),t.jsx(ae,{value:s.images.frame,fill:s.images.fill,current:a.frame,stage:g,onChange:e=>d("images",{frame:e}),onFill:e=>d("images",{fill:e}),t:r}),t.jsx(p,{label:r("exportCenter.resolution"),children:t.jsx(V,{value:s.images.shortEdge,options:st.map(e=>({value:e,label:e===2160?"4K":`${e}p`})),onChange:e=>d("images",{shortEdge:e})})}),y>0&&t.jsx(F,{checked:s.images.burn,onChange:e=>d("images",{burn:e}),label:r("exportCenter.burnIn")})]}),u==="slides"&&t.jsxs(t.Fragment,{children:[t.jsx(p,{label:r("exportCenter.format"),children:t.jsx("div",{className:"grid grid-cols-2 gap-2",children:["pptx","pdf"].map(e=>t.jsx(U,{on:s.slides.format===e,title:e==="pptx"?"PowerPoint":"PDF",desc:r(`exportCenter.slidesHint.${e}`),onClick:()=>d("slides",{format:e})},e))})}),t.jsx(ae,{value:s.slides.frame,fill:s.slides.fill,current:a.frame,stage:g,onChange:e=>d("slides",{frame:e}),onFill:e=>d("slides",{fill:e}),t:r}),y>0&&t.jsx(F,{checked:s.slides.burn,onChange:e=>d("slides",{burn:e}),label:r("exportCenter.burnIn")})]}),u==="html"&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{label:r("exportCenter.htmlMode"),children:[t.jsx(O,{value:s.html.mode,options:[{value:"pages",label:r("exportCenter.htmlModePages")},{value:"film",label:r("exportCenter.htmlModeFilm")},{value:"deck",label:r("exportCenter.htmlModeDeck")}],onChange:e=>d("html",{mode:e})}),t.jsx(L,{children:r(s.html.mode==="film"?"exportCenter.htmlFilmHint":s.html.mode==="pages"?"exportCenter.htmlPagesHint":"exportCenter.htmlHint").replace("{n}",String(Se))})]}),s.html.mode==="deck"&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:s.html.frame,fill:s.html.fill,current:a.frame,stage:g,onChange:e=>d("html",{frame:e}),onFill:e=>d("html",{fill:e}),t:r}),t.jsx(p,{label:r("exportCenter.resolution"),children:t.jsx(V,{value:s.html.shortEdge,options:st.map(e=>({value:e,label:e===2160?"4K":`${e}p`})),onChange:e=>d("html",{shortEdge:e})})}),y>0&&t.jsx(F,{checked:s.html.burn,onChange:e=>d("html",{burn:e}),label:r("exportCenter.burnIn")})]}),t.jsxs(p,{label:r("exportCenter.htmlPacking"),children:[t.jsx(F,{checked:s.html.packed,onChange:e=>d("html",{packed:e}),label:r("exportCenter.htmlPacked")}),t.jsx(L,{children:r("exportCenter.htmlPackedHint")})]})]}),(u==="social"||u==="video"||u==="gif"||u==="audio"||u==="subtitles"||u==="alpha"&&!T)&&v>0&&t.jsxs(p,{label:r("exportCenter.range"),children:[t.jsx(O,{value:M.on?"part":"all",options:[{value:"all",label:`${r("exportCenter.rangeAll")} · ${$(v)}`},{value:"part",label:r("exportCenter.rangePart")}],onChange:e=>W(n=>({...n,on:e==="part"}))}),M.on&&t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[12px] text-[var(--text-muted)]",children:[t.jsx("div",{className:"flex w-[220px] min-w-0",children:t.jsx(_e,{label:r("exportCenter.rangeFrom"),size:"md",value:String(M.from),groups:[{choices:ye.starts.map(e=>({value:String(e.ms),label:[$(e.ms),e.title].filter(Boolean).join(" · ")}))}],onPick:e=>{const n=Number(e);W(l=>({...l,from:n,to:l.to>n?l.to:ye.ends.find(w=>w.ms>n)?.ms??v}))}})}),t.jsx("span",{children:"→"}),t.jsx("div",{className:"flex w-[220px] min-w-0",children:t.jsx(_e,{label:r("exportCenter.rangeTo"),size:"md",value:String(M.to),groups:[{choices:ye.ends.filter(e=>e.ms>M.from).map(e=>({value:String(e.ms),label:[$(e.ms),e.title].filter(Boolean).join(" · ")}))}],onPick:e=>W(n=>({...n,to:Number(e)}))})}),t.jsx("span",{className:"tabular-nums",children:$(q)})]})]})]})}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-3 border-t border-[var(--border-soft)] bg-[color-mix(in_srgb,var(--surface-2)_45%,transparent)] px-5 py-3.5",children:[vt?t.jsxs("div",{className:"-ml-2 flex min-w-0 max-w-[340px] flex-1 items-center gap-2.5 px-2 py-1.5",children:[t.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-[var(--surface-2)] text-[var(--text-muted)] ring-1 ring-[var(--border)]",children:t.jsx(dt,{size:15})}),t.jsxs("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-faint)]",children:r("exportCenter.saveTo")}),t.jsx("span",{className:"truncate text-[13px] font-medium text-[var(--text)]",children:re("exportCenter.nleDraftTitle")})]})]}):oe!=null?t.jsx("input",{autoFocus:!0,value:oe,spellCheck:!1,"aria-label":r("exportCenter.saveTo"),onChange:e=>Y(e.target.value),onFocus:e=>e.currentTarget.select(),onBlur:Ve,onKeyDown:e=>{e.key==="Enter"&&(e.preventDefault(),Ve()),e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),Y(null))},className:"h-10 min-w-[200px] flex-1 rounded-lg border border-[var(--border)] bg-[var(--bg)] px-3 font-mono text-[12px] text-[var(--text)] outline-none focus:border-[var(--text-faint)]"}):t.jsxs("button",{type:"button",onClick:()=>{Ct()},disabled:Pe,title:R,"aria-label":`${r("exportCenter.saveTo")}: ${R||"—"}. ${r("exportCenter.change")}`,className:"group -ml-2 flex min-w-0 max-w-[340px] flex-1 items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition hover:bg-[var(--bg-hover)] disabled:opacity-60",children:[t.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-[var(--surface-2)] text-[var(--text-muted)] ring-1 ring-[var(--border)] transition group-hover:text-[var(--text)]",children:Pe?t.jsx(Ue,{size:15,className:"animate-spin"}):t.jsx(At,{size:15})}),t.jsxs("span",{className:"flex min-w-0 flex-col",children:[t.jsxs("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-faint)]",children:r("exportCenter.saveTo")}),t.jsx("span",{className:"truncate text-[13px] font-medium text-[var(--text)]",children:br(R)||"—"})]}),t.jsx("span",{className:"truncate text-[11px] text-[var(--text-faint)] group-hover:text-[var(--text-muted)]",children:r("exportCenter.change")})]})]}),t.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-4",children:[t.jsx("div",{className:"min-w-0 text-right text-[12px] leading-snug",children:je?t.jsx("span",{className:je.ok?"text-[var(--ok)]":"text-[var(--err)]",children:je.text}):Me?t.jsx("span",{"data-export-reason":"",className:Ee?"text-[var(--warn)]":"text-[var(--text-faint)]",children:Me}):t.jsxs(t.Fragment,{children:[u==="project"?null:u==="html"?t.jsx("span",{className:"block text-[var(--text-muted)] tabular-nums",children:r(s.html.mode==="film"?"exportCenter.htmlFilmSummary":"exportCenter.htmlSummary").replace("{n}",String(Se))}):t.jsx("span",{className:"block text-[var(--text-muted)] tabular-nums",children:r("exportCenter.summary").replace("{n}",String(we)).replace("{dur}",$(bt))}),Be?t.jsx("span",{className:"block text-[11px] text-[var(--text-faint)] tabular-nums",children:`${r("exportCenter.approx")} ${Be}`}):null]})}),t.jsxs("button",{type:"button",onClick:()=>{Ge(se)},disabled:yt,className:"flex h-10 shrink-0 items-center gap-2 rounded-xl bg-[var(--text)] px-6 text-[13.5px] font-medium text-[var(--bg)] transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:[_?t.jsx(Ue,{size:14,className:"animate-spin"}):null,kt]})]})]})]}),t.jsxs("aside",{className:"hidden w-[212px] shrink-0 flex-col overflow-y-auto border-l border-[var(--border-soft)] bg-[var(--surface-2)] px-4 pb-4 pt-4 min-[980px]:flex",children:[t.jsx("h4",{className:"text-[12px] font-semibold tracking-tight text-[var(--text)]",children:r("exportCenter.draftParams")}),t.jsxs("dl",{className:"mt-3 flex flex-col gap-2.5",children:[t.jsx(z,{k:r("exportCenter.dpName"),v:a.title}),t.jsx(z,{k:r("exportCenter.dpColor"),v:"Rec.709 SDR"}),t.jsx(z,{k:r("exportCenter.dpRatio"),v:vr(g.w,g.h)}),t.jsx(z,{k:r("exportCenter.dpRes"),v:`${g.w} × ${g.h}`}),t.jsx(z,{k:r("exportCenter.dpDuration"),v:$(v)}),t.jsx(z,{k:r("exportCenter.dpFps"),v:a.projectFps?`${a.projectFps} fps`:r("exportCenter.dpFpsSource")}),t.jsx(z,{k:r("exportCenter.dpScenes"),v:N?String(N.scenes.length):"—"}),t.jsx(z,{k:r("exportCenter.dpSubs"),v:String(y)}),t.jsx(z,{k:r("exportCenter.dpFolder"),v:le||"—"})]})]})]})}),document.body)}function br(a){return a.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||a}function z({k:a,v:o}){return t.jsxs("div",{className:"min-w-0",children:[t.jsx("dt",{className:"text-[10.5px] leading-snug text-[var(--text-faint)]",children:a}),t.jsx("dd",{className:"break-all text-[11.5px] leading-snug text-[var(--text)]",children:o})]})}function vr(a,o){const i=a/Math.max(1,o),r=[[16/9,"16:9"],[9/16,"9:16"],[4/3,"4:3"],[3/4,"3:4"],[1,"1:1"],[3/2,"3:2"],[2/3,"2:3"],[21/9,"21:9"],[5/4,"5:4"],[4/5,"4:5"]];for(const[c,f]of r)if(Math.abs(i-c)<.02)return f;return`${i.toFixed(2)}:1`}function p({label:a,children:o}){return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-[11.5px] font-medium uppercase tracking-wide text-[var(--text-faint)]",children:a}),o]})}function L({children:a}){return t.jsx("p",{className:"text-[11.5px] leading-relaxed text-[var(--text-faint)]",children:a})}function jr({children:a}){return t.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2.5 text-[12px] leading-relaxed text-[var(--text-muted)]",children:[t.jsx(Bt,{size:14,className:"mt-0.5 shrink-0 text-[var(--warn)]"}),t.jsx("span",{children:a})]})}function U({on:a,disabled:o,title:i,desc:r,onClick:c}){return t.jsxs("button",{type:"button","aria-pressed":a,disabled:o,onClick:c,className:`flex flex-col items-start gap-0.5 rounded-xl border px-3 py-2.5 text-left transition disabled:cursor-not-allowed disabled:opacity-45 ${a?"border-[var(--text)] bg-[var(--bg-hover)]":"border-[var(--border)] hover:border-[var(--text-faint)]"}`,children:[t.jsx("span",{className:"text-[12.5px] font-medium text-[var(--text)]",children:i}),t.jsx("span",{className:"text-[11px] leading-snug text-[var(--text-faint)]",children:r})]})}function Ie({label:a,value:o,rates:i,own:r,onPick:c}){const f=[...new Set([...i,...r?[r.fps]:[]])].sort((x,I)=>x-I),m=x=>`${x} fps${r&&x===r.fps?` · ${r.note}`:""}`;return t.jsx(_e,{size:"md",label:a,value:String(o),groups:[{choices:f.map(x=>({value:String(x),label:m(x)}))}],onPick:x=>c(Number(x))})}function V({value:a,options:o,onChange:i}){return t.jsx("div",{className:"flex flex-wrap items-start gap-1.5",children:o.map(r=>{const c=r.value===a;return t.jsxs("button",{type:"button","aria-pressed":c,onClick:()=>i(r.value),className:`flex min-w-[56px] flex-col items-center rounded-lg border px-2.5 py-1.5 transition ${c?"border-[var(--text)] bg-[var(--bg-hover)] text-[var(--text)]":"border-[var(--border)] text-[var(--text-muted)] hover:border-[var(--text-faint)]"}`,children:[t.jsx("span",{className:"text-[12.5px] font-medium tabular-nums",children:r.label}),r.sub?t.jsx("span",{className:"text-[10px] tabular-nums text-[var(--text-faint)]",children:r.sub}):null]},String(r.value))})})}function O({value:a,options:o,onChange:i}){return t.jsx("div",{className:"inline-flex max-w-full self-start overflow-x-auto rounded-full border border-[var(--border)] bg-[var(--bg)] p-[3px]",children:o.map(r=>t.jsx("button",{type:"button","aria-pressed":r.value===a,onClick:()=>i(r.value),className:`shrink-0 whitespace-nowrap rounded-full px-3 py-1 text-[12px] font-medium transition ${r.value===a?"bg-[var(--surface-3,var(--bg-hover))] text-[var(--text)] shadow-[var(--shadow-sm)]":"text-[var(--text-muted)] hover:text-[var(--text)]"}`,children:r.label},r.value))})}function F({checked:a,onChange:o,label:i,disabled:r,locked:c}){const f=r?"text-[var(--text-faint)]":a||c?"text-[var(--text)]":"text-[var(--text-muted)]";return t.jsxs("label",{className:`flex select-none items-center gap-2.5 text-[12.5px] ${f} ${r||c?"cursor-default":"cursor-pointer"}`,children:[t.jsx("button",{type:"button",role:"switch","aria-checked":a||!!c,"aria-readonly":c||void 0,disabled:r,onClick:()=>{c||o(!a)},className:`relative h-[18px] w-[30px] shrink-0 rounded-full transition ${a||c?"bg-[var(--text)]":"bg-[var(--border-strong,var(--border))]"} ${c?"cursor-default":""} disabled:opacity-50`,children:t.jsx("span",{className:`absolute top-[2px] h-[14px] w-[14px] rounded-full bg-[var(--bg)] transition-[left] ${a||c?"left-[14px]":"left-[2px]"}`})}),i]})}function it({checked:a,onChange:o,label:i,hint:r,size:c,disabled:f,locked:m}){return t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(F,{checked:a,onChange:o,label:i,disabled:f,locked:m}),c&&t.jsx("span",{className:"ml-auto font-mono text-[11px] tabular-nums text-[var(--text-faint)]",children:c})]}),t.jsx("p",{className:"pl-[40px] text-[11.5px] leading-snug text-[var(--text-faint)]",children:r})]})}function ct({value:a,onChange:o,t:i}){return t.jsx(O,{value:a,options:[{value:"standard",label:i("exportCenter.qStandard")},{value:"high",label:i("exportCenter.qHigh")},{value:"master",label:i("exportCenter.qMaster")}],onChange:o})}function ut({frame:a,stage:o,fill:i="contain"}){const r=ne(o,a,i),c=14/Math.max(r.w,r.h),f=Math.max(6,r.w*c),m=Math.max(6,r.h*c);return t.jsx("span",{className:"relative inline-block shrink-0 overflow-hidden rounded-[2px] border border-[var(--text-faint)]",style:{width:f,height:m},children:t.jsx("span",{className:"absolute bg-[var(--text-muted)] opacity-50",style:{left:r.inner.left*c,top:r.inner.top*c,width:r.inner.w*c,height:r.inner.h*c}})})}function ae({value:a,fill:o,current:i,stage:r,onChange:c,onFill:f,t:m}){const x=a==="current"?i:a,I=x!=="native"&&Math.abs(Ot(x,r)-r.w/Math.max(1,r.h))>.01;return t.jsxs(p,{label:m("exportCenter.frame"),children:[t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[[...We,...We.includes(x)?[]:[x]].map(k=>{const s=x===k;return t.jsxs("button",{type:"button","aria-pressed":s,onClick:()=>c(k===i?"current":k),className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-[12px] font-medium transition ${s?"border-[var(--text)] bg-[var(--bg-hover)] text-[var(--text)]":"border-[var(--border)] text-[var(--text-muted)] hover:border-[var(--text-faint)]"}`,children:[t.jsx(ut,{frame:k,stage:r,fill:o}),k==="native"?m("exportCenter.frameNative"):k]},k)}),t.jsx(qt,{chip:!0,value:x,onPick:k=>c(k===i?"current":k)})]}),I&&t.jsx(O,{value:o,options:[{value:"contain",label:m("exportCenter.fillContain")},{value:"cover",label:m("exportCenter.fillCover")}],onChange:f})]})}export{kr as ExportCenter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as W,R as m,j as e,P as ye,C as G,a as ke,u as M,s as T,L as B,b as Be,d as Oe,e as Q,D as ue,f as J,g as Ue,X as we,B as ge,M as Ie,h as Ne,E as Se,i as _e,T as Ce,k as $e,p as We,r as He,S as Ge,l as Ve,m as Ye,n as Je,o as Ze,q as fe,t as Qe,v as Ee,w as oe,x as Xe,y as ae,z as Me,A as et}from"./index-CWur1Iw9.js";const tt=W("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const st=W("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);const nt=W("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const at=W("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);const rt=W("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);const it=W("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const lt=W("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),ot=["codex","claude","gemini","copilot","cursor","opencode","codebuddy","qwen","kimi"],ct=["deepseek"];function te(t){return ct.includes(t)}function xe({label:t,value:s,options:a,onChange:n,width:r}){const[c,o]=m.useState(!1),x=m.useRef(null),h=m.useRef({text:"",at:0}),u=a.find(d=>d.value===s)??a[0];m.useEffect(()=>{if(!c)return;const d=requestAnimationFrame(()=>(x.current?.querySelector('[aria-selected="true"]')??x.current?.querySelector('[role="option"]'))?.focus());return()=>cancelAnimationFrame(d)},[c]);const b=d=>{o(!1),d.value!==s&&n(d.value)},l=d=>{const g=Array.from(x.current?.querySelectorAll('[role="option"]')??[]),y=g.indexOf(document.activeElement);if(d.key==="ArrowDown"||d.key==="ArrowUp")d.preventDefault(),g[(y+(d.key==="ArrowDown"?1:-1)+g.length)%g.length]?.focus();else if(d.key==="Home"||d.key==="End")d.preventDefault(),g[d.key==="Home"?0:g.length-1]?.focus();else if(d.key.length===1&&!d.metaKey&&!d.ctrlKey&&!d.altKey){const C=Date.now();h.current={text:(C-h.current.at<700?h.current.text:"")+d.key.toLowerCase(),at:C};const E=a.findIndex($=>$.label.toLowerCase().startsWith(h.current.text));E>=0&&g[E]?.focus()}};return e.jsx(ye,{open:c,onOpenChange:o,placement:"auto",align:"end",layer:10060,trigger:e.jsxs("button",{type:"button","aria-label":`${t}: ${u.label}`,"aria-haspopup":"listbox","aria-expanded":c,style:r?{width:r}:void 0,className:`flex h-10 max-w-full items-center gap-2 ${r?"":"w-auto"} rounded-[8px] border px-3 text-left text-[14.5px] text-[var(--text)] transition ${c?"border-[var(--text-muted)]":"border-[var(--border)] hover:border-[var(--border-strong)]"}`,children:[u.icon?e.jsx("span",{className:"flex shrink-0 text-[var(--text-muted)]",children:u.icon}):null,e.jsx("span",{className:r?"min-w-0 flex-1 truncate":"whitespace-nowrap",children:u.label}),e.jsx(ke,{size:15,className:"shrink-0 text-[var(--text-muted)]"})]}),children:e.jsx("div",{ref:x,role:"listbox","aria-label":t,onKeyDown:l,style:{minWidth:r??160},className:"max-h-[min(320px,var(--popover-max-h))] overflow-y-auto rounded-[10px] border border-[var(--border)] bg-[var(--surface)] p-1 shadow-[var(--shadow-lg)]",children:a.map(d=>{const g=d.value===s;return e.jsxs("button",{type:"button",role:"option","aria-selected":g,onClick:()=>b(d),className:"flex h-9 w-full items-center gap-2 rounded-[6px] px-2 text-left text-[14.5px] text-[var(--text)] outline-none hover:bg-[var(--bg-hover)] focus-visible:bg-[var(--bg-hover)]",children:[d.icon?e.jsx("span",{className:"flex shrink-0 text-[var(--text-muted)]",children:d.icon}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.label}),e.jsx(G,{size:16,className:g?"shrink-0 text-[var(--text)]":"invisible shrink-0"})]},d.value)})})})}function H({note:t,children:s}){return e.jsxs("div",{className:"flex max-w-[880px] flex-col",children:[t?e.jsx("p",{className:"mb-8 text-[14.5px] leading-relaxed text-[var(--text-muted)]",children:t}):null,s]})}function F({title:t,footnote:s,children:a}){return e.jsxs("section",{className:"mb-10 last:mb-0",children:[t?e.jsx("h3",{className:"mb-1 text-[17px] font-semibold tracking-[-0.01em] text-[var(--text)]",children:t}):null,e.jsx("div",{className:"flex flex-col divide-y divide-[var(--border)]",children:a}),s?e.jsx("p",{className:"pt-2 text-[13.5px] leading-relaxed text-[var(--text-faint)]",children:s}):null]})}function z({mark:t,title:s,badge:a,description:n,control:r,children:c}){return e.jsxs("div",{className:"py-4",children:[e.jsxs("div",{className:"flex min-h-10 items-center gap-4",children:[t?e.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] bg-[var(--fill-tsp)] text-[var(--text)]",children:t}):null,e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[e.jsx("span",{className:"text-[15px] text-[var(--text)]",children:s}),a]}),n?e.jsx("div",{className:"mt-1 text-[14px] leading-[1.55] text-[var(--text-muted)]",children:n}):null]}),r?e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r}):null]}),c?e.jsx("div",{className:"pt-3",children:c}):null]})}function U({tone:t="ok",children:s}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[13.5px] text-[var(--text-muted)]",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${t==="ok"?"bg-[var(--ok)]":"bg-[var(--text-faint)]"}`,"aria-hidden":!0}),s]})}const Ae={default:"border border-[var(--border)] text-[var(--text)] hover:bg-[var(--bg-hover)]",primary:"border border-transparent bg-[var(--text)] text-[var(--bg)] hover:opacity-90",quiet:"border border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text)]"};function k({variant:t="default",className:s="",...a}){return e.jsx("button",{type:"button",...a,className:`inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] px-3.5 text-[14px] font-medium transition disabled:pointer-events-none disabled:opacity-50 ${Ae[t]} ${s}`})}function dt({className:t="",...s}){return e.jsx("a",{target:"_blank",rel:"noreferrer",...s,className:`inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] px-3.5 text-[14px] font-medium transition ${Ae.default} ${t}`})}function Z({checked:t,onChange:s,label:a,disabled:n}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":a,title:a,disabled:n,onClick:()=>s(!t),className:`relative h-6 w-10 shrink-0 rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--text)]":"bg-[var(--surface-3)]"}`,children:e.jsx("span",{className:`absolute top-[3px] h-[18px] w-[18px] rounded-full bg-[var(--bg)] shadow-[0_1px_2px_rgba(0,0,0,0.2)] transition-all ${t?"left-[19px]":"left-[3px]"}`})})}function ze({label:t,value:s,options:a,onChange:n}){return e.jsx("div",{role:"radiogroup","aria-label":t,className:"inline-flex shrink-0 gap-0.5 rounded-[10px] bg-[var(--fill-tsp)] p-[3px]",children:a.map(r=>{const c=r.value===s;return e.jsxs("button",{type:"button",role:"radio","aria-checked":c,onClick:()=>{c||n(r.value)},className:`inline-flex h-[30px] items-center gap-1.5 whitespace-nowrap rounded-[7px] px-3 text-[14px] transition ${c?"bg-[var(--dock-pane)] text-[var(--text)] shadow-[0_1px_2px_rgba(0,0,0,0.08)] ring-1 ring-[var(--border)]":"text-[var(--text-muted)] hover:text-[var(--text)]"}`,children:[r.icon?e.jsx("span",{className:"flex shrink-0",children:r.icon}):null,r.label]},r.value)})})}const q=m.forwardRef(function({className:s="",...a},n){return e.jsx("input",{ref:n,...a,className:`h-10 w-full min-w-0 rounded-[8px] border border-[var(--border)] bg-transparent px-3 text-[14px] text-[var(--text)] outline-none transition placeholder:text-[var(--text-faint)] hover:border-[var(--border-strong)] focus:border-[var(--text-muted)] ${s}`})});function X({children:t}){return e.jsx("div",{className:"flex flex-col gap-2.5 rounded-[10px] border border-[var(--border)] p-4",children:t})}const re="inline-flex items-center gap-1 text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",I="text-[13.5px] leading-relaxed text-[var(--err)]",Re=["codex"];function ut(){const[t,s]=m.useState(null);return m.useEffect(()=>{const a=T?.agents;if(!a)return;let n=!0;a.list().then(o=>{n&&s(o)}).catch(()=>{});const r=a.onChange(o=>s(o)),c=()=>{a.list(!0).then(o=>{n&&s(o)}).catch(()=>{})};return window.addEventListener("focus",c),()=>{n=!1,r(),window.removeEventListener("focus",c)}},[]),t}function xt({id:t}){return t==="byok"?e.jsx(tt,{size:16}):e.jsx(J,{id:Ue(t),size:17})}function pt(t){const[s,a]=m.useState({}),n=(t??[]).filter(r=>Re.includes(r.id)&&r.status==="ready").map(r=>r.id).join(",");return m.useEffect(()=>{const r=T?.agents?.usage;if(!r||!n)return;let c=!0;const o=()=>{for(const x of n.split(","))r(x).then(h=>{c&&a(u=>({...u,[x]:h}))}).catch(()=>{c&&a(h=>({...h,[x]:null}))})};return o(),window.addEventListener("focus",o),()=>{c=!1,window.removeEventListener("focus",o)}},[n]),s}function mt({window:t}){const s=M(),a=Q(),n=t.kind==="five_hour"?s("settings.agents.usageFiveHour"):t.kind==="seven_day"?s("settings.agents.usageWeek"):s("settings.agents.usageWindow").replace("{hours}",String(Math.round((t.minutes??0)/60))),r=Math.round(t.usedPercent),c=(()=>{if(t.resetsAt==null)return null;const o=Math.max(0,Math.round((t.resetsAt-Date.now())/6e4)),x=new Intl.RelativeTimeFormat(a,{numeric:"auto"}),h=o<60?x.format(o,"minute"):o<2880?x.format(Math.round(o/60),"hour"):x.format(Math.round(o/1440),"day");return s("settings.agents.usageResets").replace("{time}",h)})();return e.jsxs("div",{className:"flex items-center gap-3 text-[13px]",children:[e.jsx("span",{className:"w-[92px] shrink-0 text-[var(--text-muted)]",children:n}),e.jsx("div",{className:"h-1.5 min-w-[80px] flex-1 overflow-hidden rounded-full bg-[var(--fill-tsp)]",role:"progressbar","aria-label":n,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:`h-full rounded-full ${r>=90?"bg-[var(--danger,#e5484d)]":r>=70?"bg-[var(--warn,#f5a524)]":"bg-[var(--text)]"}`,style:{width:`${Math.max(r,1.5)}%`}})}),e.jsx("span",{className:"w-[64px] shrink-0 text-right tabular-nums text-[var(--text)]",children:s("settings.agents.usageUsed").replace("{percent}",String(r))}),e.jsx("span",{className:"w-[120px] shrink-0 truncate text-[var(--text-faint)]",children:c??""})]})}function ht(){const t=M(),s=ut(),a=pt(s),n=T?.agents,[r,c]=m.useState(null),[o,x]=m.useState(null),[h,u]=m.useState(null),[b,l]=m.useState(null);if(!n)return null;const d=(i,S)=>{c(i),x(null),S().then(N=>{const K=N;K&&K.ok===!1&&x({id:i,text:K.error??t("settings.agents.failed")})}).catch(N=>x({id:i,text:N instanceof Error?N.message:String(N)})).finally(()=>c(null))},g=i=>d(i.id,async()=>{const S=await n.locate(i.id,{title:t("settings.agents.locateTitle").replace("{name}",i.name),button:t("settings.agents.locateButton")});return S.ok&&l(null),S.ok||!S.error&&!S.code?{ok:!0}:S.code==="not-a-program"?{ok:!1,error:t("settings.agents.notAProgram")}:S.code==="did-not-start"?{ok:!1,error:`${t("settings.agents.didNotStart")} ${S.error??""}`.trim()}:S}),y=i=>{l({id:i.id,report:null}),n.diagnose(i.id).then(S=>l(N=>N?.id===i.id?{id:i.id,report:S}:N)).catch(S=>{l(null),x({id:i.id,text:S instanceof Error?S.message:String(S)})})},C=i=>{switch(i.hint){case"chosen-missing":return t("settings.agents.hintChosenMissing");case"wsl":return t("settings.agents.hintWsl");case"unusable":return t("settings.agents.hintUnusable");case"none":return t("settings.agents.hintNone").replaceAll("{program}",i.program??"");default:return i.found?t("settings.agents.hintFound").replace("{path}",i.found):null}},E=(i,S)=>{navigator.clipboard.writeText(i.text).then(()=>l(N=>N?.id===S?{...N,copied:!0}:N)).catch(()=>{})},$=i=>{switch(i.status){case"off":return t("settings.agents.off");case"sign-in":return t("settings.agents.signedOut");case"waiting":return t("settings.agents.waiting");case"missing":return i.setupRequired==="code-tab"?t("settings.agents.claudeSetup"):t("settings.agents.missing");case"key":return t("settings.agents.needsKey");case"unavailable":return t("settings.agents.unavailable");case"checking":return t("settings.agents.checking");default:return null}},D=i=>{const S=a[i.id]?.account,N=i.account?{...i.account,...S?.email?{email:S.email}:{},...S?.plan&&!i.account.plan?{plan:S.plan}:{}}:null;if(!N)return null;const K=N.method==="chatgpt"?t("settings.agents.accountChatgpt"):N.method==="api-key"?t("settings.agents.accountApiKey"):N.method==="console"?t("settings.agents.accountConsole"):null,L=N.plan?N.plan.charAt(0).toUpperCase()+N.plan.slice(1):null,_=[N.org,N.email,L,N.email||N.org?null:K].filter(Boolean);return _.length?_.join(" · "):null},f=(i,S=!0)=>{const N=r===i.id,K=!te(i.id);if(i.status==="ready"&&S){const L=n.locate&&i.id!=="byok"&&K;return e.jsxs(e.Fragment,{children:[L?e.jsxs(k,{variant:"quiet",disabled:N,onClick:()=>g(i),children:[N?e.jsx(B,{size:16,className:"animate-spin","aria-hidden":!0}):null,t("settings.agents.locate")]}):null,e.jsx(k,{variant:"quiet",disabled:N,title:i.id==="byok"?void 0:t("settings.agents.disconnectHint").replaceAll("{name}",i.name),onClick:()=>d(i.id,()=>n.disconnect(i.id)),children:t("settings.agents.disconnect")})]})}if(i.status==="missing"){const L=n.locate&&i.setupRequired!=="code-tab"&&!te(i.id);return!i.install&&!L?null:e.jsxs(e.Fragment,{children:[L?e.jsxs(k,{variant:"quiet",disabled:N,onClick:()=>g(i),children:[N?e.jsx(B,{size:16,className:"animate-spin","aria-hidden":!0}):null,t("settings.agents.locate")]}):null,i.install?e.jsxs(dt,{href:i.install,children:[e.jsx(ue,{size:16}),t("settings.agents.install")]}):null]})}return i.status==="key"?e.jsx(k,{onClick:()=>u(i.id),children:t("settings.agents.setUpKey")}):i.status==="unavailable"?null:i.status==="checking"?e.jsx(B,{size:16,className:"animate-spin text-[var(--text-muted)]","aria-hidden":!0}):e.jsxs(k,{disabled:N||i.status==="waiting",onClick:()=>d(i.id,()=>n.connect(i.id)),children:[N?e.jsx(B,{size:16,className:"animate-spin","aria-hidden":!0}):null,i.status==="sign-in"?t("settings.agents.signIn"):t("settings.agents.connect")]})},j=(i,S=!0)=>{const N=i.id==="byok"||te(i.id)?i.byok:void 0,K=o?.id===i.id?o.text:i.error,L=h===i.id,_=!!n.diagnose&&i.status==="missing"&&i.setupRequired!=="code-tab",P=b?.id===i.id?b:null,ee=a[i.id],me=S&&i.status==="ready"&&Re.includes(i.id)&&!!n.usage&&(ee===void 0||!!ee?.windows.length),he=P?.report?C(P.report):null;return e.jsx(z,{mark:e.jsx(xt,{id:i.id}),title:i.id==="byok"?t("settings.agents.byokName"):Oe(i.id,i.name,t),badge:e.jsxs(e.Fragment,{children:[i.id==="codex"||i.id==="claude"?e.jsx("span",{title:t("settings.agents.recommendedHint"),className:"inline-flex h-[18px] items-center rounded-full border border-[var(--border)] px-1.5 text-[11px] text-[var(--text-muted)]",children:t("settings.agents.recommended")}):null,i.status==="ready"&&S?e.jsx(U,{children:N?`${De(i).join(", ")} · •••• ${i.byok.last4}`:t("settings.agents.ready")}):null]}),description:i.status==="ready"?D(i):$(i),control:e.jsxs(e.Fragment,{children:[N&&!L?e.jsx(k,{variant:"quiet",onClick:()=>u(i.id),children:t("settings.agents.change")}):null,f(i,S),f(i,S)?e.jsx("span",{className:"mx-1 h-5 w-px bg-[var(--border)]","aria-hidden":!0}):null,e.jsx(Z,{checked:i.shown,label:t("settings.agents.showInChat"),onChange:Y=>{n.setShown(i.id,Y)}})]}),children:i.status==="waiting"||L||K||i.chosen||_||me?e.jsxs("div",{className:"flex flex-col gap-1.5 pl-[34px]",children:[me?e.jsx("div",{className:"flex flex-col gap-1.5","aria-label":t("settings.agents.usage"),children:ee===void 0?e.jsxs("p",{className:"flex items-center gap-1.5 text-[13px] text-[var(--text-faint)]",children:[e.jsx(B,{size:13,className:"animate-spin","aria-hidden":!0}),t("settings.agents.usageLoading")]}):ee?.windows.map(Y=>e.jsx(mt,{window:Y},Y.kind+(Y.minutes??"")))}):null,i.chosen?e.jsxs("p",{className:"break-all text-[13.5px] leading-relaxed text-[var(--text-muted)]",children:[t("settings.agents.chosenAt").replace("{path}",i.chosen)," ",n.useAutomatic?e.jsx("button",{type:"button",onClick:()=>d(i.id,()=>n.useAutomatic(i.id)),className:"underline underline-offset-2 hover:text-[var(--text)]",children:t("settings.agents.automatic")}):null]}):null,_&&!P?e.jsx("p",{className:"text-[13.5px] leading-relaxed text-[var(--text-muted)]",children:e.jsx("button",{type:"button",onClick:()=>y(i),className:"underline underline-offset-2 hover:text-[var(--text)]",children:t("settings.agents.whyMissing")})}):null,_&&P&&!P.report?e.jsxs("p",{className:"flex items-center gap-1.5 text-[13.5px] text-[var(--text-muted)]",children:[e.jsx(B,{size:14,className:"animate-spin","aria-hidden":!0}),t("settings.agents.searching")]}):null,_&&P?.report?e.jsxs(X,{children:[he?e.jsx("p",{className:"break-words text-[14px] leading-relaxed text-[var(--text)]",children:he}):null,e.jsx("p",{className:"text-[13px] leading-relaxed text-[var(--text-faint)]",children:t("settings.agents.reportNote")}),e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx(k,{variant:"quiet",onClick:()=>l(null),children:t("settings.agents.close")}),e.jsxs(k,{onClick:()=>E(P.report,i.id),children:[P.copied?e.jsx(G,{size:15,"aria-hidden":!0}):e.jsx(Be,{size:15,"aria-hidden":!0}),P.copied?t("settings.agents.copied"):t("settings.agents.copyReport")]})]})]}):null,i.status==="waiting"?e.jsxs("p",{className:"text-[14.5px] leading-relaxed text-[var(--text-muted)]",children:[t("settings.agents.waitingHint")," ",e.jsx("button",{type:"button",onClick:()=>d(i.id,()=>n.connect(i.id)),className:"underline underline-offset-2 hover:text-[var(--text)]",children:t("settings.agents.startAgain")})]}):null,L?e.jsx(vt,{agent:i,onDone:()=>u(null)}):null,K?e.jsx("p",{className:I,children:K}):null]}):null},i.id)},p=s??[],A=i=>p.find(S=>S.id===i),v=["codex","claude","byok"].map(A).filter(i=>!!i),w=p.filter(i=>ot.includes(i.id)&&!v.includes(i)),R=p.filter(i=>te(i.id)),O=[...v,...w.filter(i=>i.shown),...R.filter(i=>i.shown)],V=[...R.filter(i=>!i.shown),...w.filter(i=>!i.shown)];return e.jsxs(H,{note:t("settings.agents.intro"),children:[e.jsx(F,{title:t("settings.agents.groupYours"),footnote:t("settings.agents.showHint"),children:O.map(i=>j(i))}),V.length?e.jsx(F,{title:t("settings.agents.groupMore"),children:V.map(i=>j(i,!1))}):null]})}const se=[{value:"responses",label:"OpenAI Responses",address:"https://api.openai.com/v1"},{value:"chat",label:"OpenAI Chat Completions",address:"https://api.openai.com/v1"},{value:"anthropic",label:"Anthropic Messages",address:"https://api.anthropic.com"}],De=t=>t.byok?.models?.length?t.byok.models:t.preset?.models??[t.byok?.model??""].filter(Boolean),ve=t=>[...new Set(t.split(/[,\n]/).map(s=>s.trim()).filter(Boolean))],gt=t=>De(t).map(s=>({name:s,...t.byok?.efforts?.[s]??{levels:["auto"],effort:"auto"}}));function ft({row:t,onChange:s,onRemove:a}){const n=M(),r=o=>n(`settings.agents.effortLevels.${o}`),c=o=>{const x=t.levels.includes(o);if(x&&t.levels.length===1)return;const h=ge.filter(u=>u===o?!x:t.levels.includes(u));s({...t,levels:h,effort:h.includes(t.effort)?t.effort:h[0]})};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-[8px] border border-[var(--border)] px-3 py-2.5",children:[e.jsxs("div",{className:"flex min-h-8 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[13.5px] text-[var(--text)]",title:t.name,children:t.name}),t.levels.length>1?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"shrink-0 text-[13px] text-[var(--text-muted)]",children:n("settings.agents.effortStart")}),e.jsx(xe,{label:n("settings.agents.effortStart"),value:t.effort,width:128,onChange:o=>s({...t,effort:o}),options:t.levels.map(o=>({value:o,label:r(o)}))})]}):null,e.jsx("button",{type:"button",onClick:a,"aria-label":n("settings.agents.removeModel").replace("{name}",t.name),title:n("settings.agents.removeModel").replace("{name}",t.name),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[6px] text-[var(--text-faint)] transition hover:bg-[var(--bg-hover)] hover:text-[var(--text)]",children:e.jsx(we,{size:14,"aria-hidden":!0})})]}),e.jsx("div",{role:"group","aria-label":`${n("settings.agents.efforts")} · ${t.name}`,className:"flex flex-wrap items-center gap-1",children:ge.map(o=>{const x=t.levels.includes(o);return e.jsxs("button",{type:"button","aria-pressed":x,onClick:()=>c(o),className:`inline-flex h-7 items-center gap-1 rounded-full border px-2.5 text-[12.5px] transition ${x?"border-[var(--text-muted)] bg-[var(--fill-tsp)] text-[var(--text)]":"border-[var(--border)] text-[var(--text-muted)] hover:border-[var(--border-strong)] hover:text-[var(--text)]"}`,children:[x?e.jsx(G,{size:12,"aria-hidden":!0}):null,r(o)]},o)})})]})}function vt({agent:t,onDone:s}){const a=M(),n=T?.agents,[r,c]=m.useState(t.byok?.format??t.preset?.format??"responses"),o=se.find(v=>v.value===r),[x,h]=m.useState(t.byok?.baseUrl??t.preset?.baseUrl??o.address),[u,b]=m.useState(()=>gt(t)),[l,d]=m.useState(""),g=()=>{const v=ve(l).filter(w=>!u.some(R=>R.name===w));v.length&&b(w=>[...w,...v.map(R=>({name:R,levels:["auto"],effort:"auto"}))]),d("")},y=()=>[...u,...ve(l).filter(v=>!u.some(w=>w.name===v)).map(v=>({name:v,levels:["auto"],effort:"auto"}))],[C,E]=m.useState(""),[$,D]=m.useState({busy:!1,error:null}),f=v=>{(se.some(w=>w.address===x.trim())||!x.trim())&&h(se.find(w=>w.value===v).address),c(v)},j=()=>{if(!n)return;D({busy:!0,error:null});const v=y();n.configureByok({provider:t.id,format:r,baseUrl:x,models:v.map(w=>w.name),efforts:Object.fromEntries(v.map(w=>[w.name,{levels:w.levels,effort:w.effort}])),...C?{key:C}:{}}).then(w=>{w.ok?(E(""),d(""),D({busy:!1,error:null}),s()):D({busy:!1,error:w.error??a("settings.agents.failed")})}).catch(w=>D({busy:!1,error:w instanceof Error?w.message:String(w)}))},p=y().length>0&&x.trim()&&(C.trim()||t.byok),A=v=>e.jsx("span",{className:"w-[92px] shrink-0 text-[13px] text-[var(--text-muted)]",children:v});return e.jsx(X,{children:e.jsxs("form",{className:"contents",onSubmit:v=>{v.preventDefault(),p&&!$.busy&&j()},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[A(a("settings.agents.format")),e.jsx(xe,{label:a("settings.agents.format"),value:r,onChange:f,width:220,options:se.map(v=>({value:v.value,label:v.label}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[A(a("settings.agents.address")),e.jsx(q,{value:x,onChange:v=>h(v.target.value),placeholder:o.address,"aria-label":a("settings.agents.address"),spellCheck:!1})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"flex h-10 items-center",children:A(a("settings.agents.model"))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[u.map(v=>e.jsx(ft,{row:v,onChange:w=>b(R=>R.map(O=>O.name===v.name?w:O)),onRemove:()=>b(w=>w.filter(R=>R.name!==v.name))},v.name)),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{value:l,onChange:v=>d(v.target.value),placeholder:a("settings.agents.modelPlaceholder"),"aria-label":a("settings.agents.model"),spellCheck:!1,onKeyDown:v=>{v.key==="Enter"&&l.trim()&&(v.preventDefault(),g())}}),e.jsx(k,{onClick:g,disabled:!l.trim(),children:a("settings.agents.addModel")})]}),u.length?e.jsx("p",{className:"text-[12.5px] leading-relaxed text-[var(--text-faint)]",children:a("settings.agents.effortHint")}):null]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[A(a("settings.agents.key")),e.jsx(q,{type:"password",value:C,onChange:v=>E(v.target.value),autoComplete:"off",className:"font-mono placeholder:font-sans",placeholder:t.byok?a("settings.agents.keyKept").replace("{last4}",t.byok.last4):a("settings.agents.keyPlaceholder"),"aria-label":a("settings.agents.key")})]}),e.jsx("p",{className:"text-[13px] leading-relaxed text-[var(--text-faint)]",children:a("settings.agents.byokNote")}),$.error?e.jsx("p",{className:I,children:$.error}):null,e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx(k,{variant:"quiet",onClick:s,children:a("settings.agents.cancel")}),e.jsxs(k,{type:"submit",variant:"primary",disabled:$.busy||!p,children:[$.busy?e.jsx(B,{size:15,className:"animate-spin","aria-hidden":!0}):null,$.busy?a("settings.agents.checkingKey"):a("settings.agents.save")]})]})]})})}function bt(t,s){return t.providers.filter(a=>!a.source&&a.verbs.includes(s)).map(a=>a.name).sort((a,n)=>a.localeCompare(n))}const jt=(t,s)=>t.providers.some(a=>a.verbs.includes(s)),yt=["tts","music","sfx","asr","image","image-search","video","translate","web-search"];async function ce(t,s){const a=await fetch(`/api/providers${t}`,{method:s?.method??"GET",cache:"no-store",headers:s?.json===void 0?void 0:{"content-type":"application/json"},body:s?.json===void 0?void 0:JSON.stringify(s.json)}),n=await a.json().catch(()=>({}));if(!a.ok)throw new Error(n.error??`Studio answered ${a.status}`);return n}function pe(){const[t,s]=m.useState(null),[a,n]=m.useState(null),[r,c]=m.useState(null),[o,x]=m.useState(null);m.useEffect(()=>{let l=!0,d=0;const g=y=>{ce("").then(C=>{l&&(s(C),n(null),c(null))},C=>{l&&(y<4?d=window.setTimeout(()=>g(y+1),1e3*2**y):n(C.message))})};return g(0),()=>{l=!1,window.clearTimeout(d)}},[]);const h=m.useCallback(async(l,d,g)=>{x(l),n(null);try{const y=await ce(d,g),{whisper:C,separator:E,...$}=y,D=d.split("/")[1]??"";return s(()=>!C&&!E?$:{...$,providers:$.providers.map(f=>f.id!==D?f:C?{...f,whisper:C}:E?{...f,separator:E}:f)}),$}catch(y){return n(y instanceof Error?y.message:String(y)),c(l),null}finally{x(null)}},[]),u=m.useCallback(async()=>{try{s(await ce("")),n(null),c(null)}catch(l){n(l instanceof Error?l.message:String(l))}},[]),b=t?.providers.some(l=>[...l.whisper?.models??[],...l.separator?.models??[]].some(d=>d.progress!=null))??!1;return m.useEffect(()=>{if(!b)return;const l=window.setInterval(()=>{u()},1500);return()=>window.clearInterval(l)},[b,u]),{state:t,problem:a,problemFor:r,busy:o,saveKey:async(l,d)=>!!await h(l,`/${encodeURIComponent(l)}/key`,{method:"PUT",json:{key:d}}),removeKey:async l=>{await h(l,`/${encodeURIComponent(l)}/key`,{method:"DELETE"})},useEnvKey:async l=>!!await h(l,`/${encodeURIComponent(l)}/key`,{method:"PUT",json:{env:!0}}),choose:async(l,d,g)=>{await h(l,"/use",{method:"PUT",json:{verb:l,provider:d||null,...g}})},saveService:async(l,d)=>!!await h(l??"custom",l?`/custom/${encodeURIComponent(l)}`:"/custom",{method:l?"PUT":"POST",json:d}),removeService:async l=>{await h(l,`/custom/${encodeURIComponent(l)}`,{method:"DELETE"})},reload:u,downloadModel:async(l,d)=>{await h(`${l}:${d}`,`/${encodeURIComponent(l)}/models`,{method:"POST",json:{model:d}})},removeModel:async(l,d)=>{await h(`${l}:${d}`,`/${encodeURIComponent(l)}/models/${encodeURIComponent(d)}`,{method:"DELETE"})}}}async function ne(t,s){const a=await fetch(`/api/video-models${t}`,{method:s?.method??"GET",cache:"no-store",headers:s?.json===void 0?void 0:{"content-type":"application/json"},body:s?.json===void 0?void 0:JSON.stringify(s.json)}),n=await a.json().catch(()=>({}));if(!a.ok)throw new Error(n.error??`Studio answered ${a.status}`);return n}function kt(){const[t,s]=m.useState(null),[a,n]=m.useState(null),[r,c]=m.useState(null);m.useEffect(()=>{let u=!0,b=0;const l=d=>{ne("").then(g=>{u&&(s(g),n(null))},g=>{u&&(d<4?b=window.setTimeout(()=>l(d+1),1e3*2**d):n(g.message))})};return l(0),()=>{u=!1,window.clearTimeout(b)}},[]);const o=async u=>{c("endpoint"),n(null);try{const b=await ne("",{method:"PUT",json:{endpoint:u}});return s(b),b.local.reachable===!0}catch(b){return n(b instanceof Error?b.message:String(b)),!1}finally{c(null)}},x=async()=>{c("check"),n(null);try{s(await ne("/check",{method:"POST"}))}catch(u){n(u instanceof Error?u.message:String(u))}finally{c(null)}},h=m.useCallback(async()=>{try{s(await ne("")),n(null)}catch(u){n(u instanceof Error?u.message:String(u))}},[]);return{state:t,problem:a,busy:r,save:o,check:x,reload:h}}function wt({onConnect:t}){const s=M(),a=kt(),n=pe(),[r,c]=m.useState(null),[o,x]=m.useState(""),[h,u]=m.useState(!1),[b,l]=m.useState(null),d=a.state?.cloud??[],g=d.filter(p=>p.builtin),y=d.filter(p=>!p.builtin),C=a.state?.local,E=n.state?{provider:n.state.use.video??null,model:n.state.model.video??null}:null,$=()=>{c(null),x(""),l(null)},D=async p=>{if(!p.provider||!o.trim()||h)return;u(!0),l(null);const A=await n.saveKey(p.provider,o.trim());if(u(!1),!A){l(n.problem??s("settings.video.cloud.keyRefused"));return}$(),await a.reload();const v=!n.state?.use.video;await n.reload(),v&&p.model&&await n.choose("video",p.provider,{model:p.model})},f=p=>{const A=p.via??"",v=s("settings.video.cloud.pasteKey").replace("{service}",A);return e.jsx("form",{className:"pl-[34px]",onSubmit:w=>{w.preventDefault(),D(p)},children:e.jsxs(X,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{type:"password",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:o,onChange:w=>x(w.target.value),onKeyDown:w=>{w.key==="Escape"&&(w.preventDefault(),$())},placeholder:v,"aria-label":v,className:"flex-1 font-mono placeholder:font-sans"}),e.jsx(k,{variant:"quiet",onClick:$,children:s("settings.video.cloud.cancel")}),e.jsx(k,{type:"submit",variant:"primary",disabled:!o.trim()||h,children:s("settings.video.cloud.save")})]}),b?e.jsx("p",{className:I,role:"alert",children:b}):null,p.keysUrl?e.jsxs("a",{href:p.keysUrl,target:"_blank",rel:"noreferrer",className:`${re} text-[13.5px]`,children:[s("settings.video.cloud.getKey").replace("{service}",A),e.jsx(Se,{size:12})]}):null]})})},j=p=>e.jsx(Nt,{model:p,on:!!(E&&p.provider&&E.provider===p.provider&&E.model===p.model),busy:n.busy==="video"||h,onUse:()=>{p.provider&&p.model&&n.choose("video",p.provider,{model:p.model})},onConnect:()=>{if(!p.builtin){t();return}c(p.id),x(""),l(null)},below:p.builtin&&r===p.id?f(p):null},p.id);return e.jsxs(H,{note:s("settings.video.desc"),children:[e.jsx(F,{title:s("settings.video.cloud.title"),footnote:s("settings.video.cloud.note"),children:g.map(j)}),y.length?e.jsx(F,{title:s("settings.video.cloud.more"),footnote:s("settings.video.cloud.moreNote"),children:y.map(j)}):null,C?e.jsx(St,{local:C,hook:a}):null,a.problem?e.jsx("p",{className:I,children:a.problem}):null]})}function Nt({model:t,on:s,busy:a,onUse:n,onConnect:r,below:c}){const o=M(),x=t.builtin?t.connected?s?e.jsxs(U,{children:[e.jsx(G,{size:14,"aria-hidden":!0}),o("settings.video.cloud.using")]}):e.jsx(k,{disabled:a,onClick:n,children:o("settings.video.cloud.use")}):e.jsx(k,{onClick:r,children:o("settings.video.cloud.connect")}):e.jsx(k,{variant:"quiet",onClick:r,children:o("settings.video.cloud.addOwn")});return e.jsx(z,{mark:t.provider?e.jsx(J,{id:t.provider,size:17}):e.jsx(Ne,{size:16}),title:t.name,badge:t.maker?e.jsx("span",{className:"text-[13.5px] text-[var(--text-faint)]",children:t.maker}):null,description:t.builtin?t.connected?o("settings.video.cloud.servedBy").replace("{service}",t.via??""):o("settings.video.cloud.notConnected").replace("{service}",t.via??""):o("settings.video.cloud.own"),control:x,children:c})}function St({local:t,hook:s}){const a=M(),[n,r]=m.useState(t.endpoint);m.useEffect(()=>{r(t.endpoint)},[t.endpoint]);const c=s.busy,o=n.trim().replace(/\/+$/,"")!==t.endpoint,x=()=>{c||s.save(n)};return e.jsxs(F,{title:a("settings.video.local.title"),footnote:a("settings.video.local.note"),children:[e.jsx(z,{mark:e.jsx(Ie,{size:16}),title:a("settings.video.local.endpoint"),description:a("settings.video.local.endpointHint"),badge:c?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[13.5px] text-[var(--text-muted)]",children:[e.jsx(B,{size:13,className:"animate-spin","aria-hidden":!0}),a("settings.video.local.asking")]}):t.reachable===!0?e.jsx(U,{children:a("settings.video.local.reachable")}):t.reachable===!1?e.jsx(U,{tone:"muted",children:a("settings.video.local.unreachable")}):null,control:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{"aria-label":a("settings.video.local.endpoint"),value:n,spellCheck:!1,placeholder:"http://127.0.0.1:8188",onChange:h=>r(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),x())},className:"w-[248px] font-mono text-[13.5px]"}),e.jsx(k,{disabled:!!c,onClick:x,children:a(o?"settings.video.local.save":"settings.video.local.check")})]})}),t.models.map(h=>e.jsx(z,{title:h.name,badge:e.jsx("span",{className:"text-[13.5px] text-[var(--text-faint)]",children:h.maker}),description:e.jsx("span",{className:"font-mono text-[12.5px] text-[var(--text-faint)]",children:h.nodes.join(" / ")}),control:h.installed?e.jsxs(U,{children:[e.jsx(G,{size:14,"aria-hidden":!0}),a("settings.video.local.installed")]}):e.jsx(U,{tone:"muted",children:a("settings.video.local.missing")})},h.id))]})}function Ct({onConnect:t}){const s=M(),a=pe(),n=a.state,r=!!n?.providers.some(c=>c.source);return e.jsxs(H,{note:s("settings.models.desc"),children:[n&&!r?e.jsx(F,{children:e.jsx(z,{description:s("settings.models.nothing"),title:s("settings.models.goConnect"),control:e.jsx(k,{onClick:t,children:s("settings.models.goConnect")})})}):null,n?e.jsx(F,{footnote:s("settings.models.otherBody"),children:yt.filter(c=>jt(n,c)).map(c=>e.jsx($t,{verb:c,hook:a,onConnect:t},c))}):null,a.problem?e.jsx("p",{className:I,children:a.problem}):null]})}function $t({verb:t,hook:s,onConnect:a}){const n=M(),r=s.state,c=n(`settings.providers.verbs.${t}`),o=r.use[t]??"",x=[];for(const d of r.providers)if(d.source&&d.verbs.includes(t)||d.id===o)for(const g of d.models[t]??[])x.push({value:`${d.id}:${g.id}`,provider:d.id,providerName:d.name,name:g.name,pick:{model:g.id}});x.sort((d,g)=>d.providerName.localeCompare(g.providerName));const h=d=>r.providers.find(g=>g.id===d)?.models[t]?.[0]?.id,u=o?`${o}:${r.model[t]??h(o)??""}`:"",b=x.find(d=>d.value===u),l=bt(r,t);return e.jsx(z,{title:c,description:n(`settings.models.about.${t}`),control:e.jsx(Et,{label:c,choices:x,current:b??null,busy:s.busy===t,could:l,onConnect:a,onPick:d=>{s.choose(t,d?.provider??"",d?.pick)}})})}function Et({label:t,choices:s,current:a,busy:n,could:r,onConnect:c,onPick:o}){const x=M(),h=Q(),[u,b]=m.useState(!1),l=m.useRef(null),d=s.length===0,g=s.reduce((f,j)=>{const p=f.find(A=>A.provider===j.provider);return p?p.choices.push(j):f.push({provider:j.provider,name:j.providerName,choices:[j]}),f},[]);m.useEffect(()=>{if(!u)return;const f=requestAnimationFrame(()=>(l.current?.querySelector('[aria-selected="true"]')??l.current?.querySelector('[role="option"]'))?.focus());return()=>cancelAnimationFrame(f)},[u]);const y=f=>{if(f.key!=="ArrowDown"&&f.key!=="ArrowUp")return;f.preventDefault();const j=Array.from(l.current?.querySelectorAll('[role="option"]')??[]),p=j.indexOf(document.activeElement);j[(p+(f.key==="ArrowDown"?1:-1)+j.length)%j.length]?.focus()},C=f=>{b(!1),f?.value!==a?.value&&o(f)},E=(f,j)=>{const p=(f?.value??"")===(a?.value??"");return e.jsxs("button",{type:"button",role:"option","aria-selected":p,onClick:()=>C(f),className:"flex h-9 w-full items-center gap-2 rounded-[6px] px-2 text-left text-[14.5px] text-[var(--text)] outline-none hover:bg-[var(--bg-hover)] focus-visible:bg-[var(--bg-hover)]",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:j}),p?e.jsx(G,{size:17,className:"shrink-0 text-[var(--text-muted)]"}):null]},f?.value??"")},$=r.length?x("settings.models.connectNamed").replace("{names}",new Intl.ListFormat(h,{type:"disjunction"}).format(r)):x("settings.models.goConnect"),D=d?e.jsxs("button",{type:"button","aria-label":`${t}: ${$}`,title:$,disabled:n,onClick:c,className:"flex h-10 w-[280px] items-center gap-2 rounded-[8px] border border-[var(--border)] px-3 text-left text-[14.5px] text-[var(--text-muted)] transition hover:border-[var(--border-strong)] hover:text-[var(--text)] disabled:opacity-60",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:$}),e.jsx(_e,{size:15,className:"shrink-0"})]}):e.jsxs("button",{type:"button","aria-label":t,"aria-haspopup":"listbox","aria-expanded":u,disabled:n,className:`flex h-10 w-[280px] items-center gap-2 rounded-[8px] border px-3 text-left text-[14.5px] text-[var(--text)] transition disabled:opacity-60 ${u?"border-[var(--text-muted)]":"border-[var(--border)] hover:border-[var(--border-strong)]"}`,children:[a?e.jsx(J,{id:a.provider,size:15}):null,e.jsx("span",{className:`min-w-0 flex-1 truncate ${a?"":"text-[var(--text-muted)]"}`,children:a?`${a.providerName} · ${a.name}`:x("settings.models.none")}),e.jsx(ke,{size:15,className:"shrink-0 text-[var(--text-muted)]"})]});return e.jsx("div",{className:"shrink-0",children:e.jsx(ye,{open:u&&!d,onOpenChange:b,placement:"auto",align:"end",layer:10060,trigger:D,children:e.jsxs("div",{ref:l,role:"listbox","aria-label":t,onKeyDown:y,className:"max-h-[min(360px,var(--popover-max-h))] w-[288px] overflow-y-auto rounded-[10px] border border-[var(--border)] bg-[var(--surface)] p-1 shadow-[var(--shadow-lg)]",children:[g.map(f=>e.jsxs("div",{className:"mb-1",role:"group","aria-label":f.name,children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 pb-1 pt-1.5 text-[14px] font-medium text-[var(--text-muted)]",children:[e.jsx(J,{id:f.provider,size:15}),f.name]}),f.choices.map(j=>E(j,j.name))]},f.provider)),e.jsx("div",{className:"border-t border-[var(--border-soft)] pt-1",children:E(null,x("settings.models.none"))})]})})})}const Mt=["tts","music","sfx","asr","image","image-search","video","translate","web-search"];function At({highlight:t=null}){const s=M(),a=pe(),n=[...a.state?.providers??[]].sort((r,c)=>r.name.localeCompare(c.name));return e.jsxs(H,{note:s("settings.providers.desc"),children:[e.jsx(F,{footnote:s("settings.providers.keyNote"),children:n.map(r=>r.local?r.separator?e.jsx(Lt,{provider:r,hook:a,highlighted:t===r.id},r.id):r.whisper?e.jsx(qt,{provider:r,hook:a,highlighted:t===r.id},r.id):e.jsx(Tt,{provider:r,hook:a,highlighted:t===r.id},r.id):e.jsx(Kt,{provider:r,hook:a,highlighted:t===r.id},r.id))}),e.jsx(Rt,{hook:a}),a.problem&&!n.some(r=>r.id===a.problemFor)&&!zt(a)?e.jsx("p",{className:I,children:a.problem}):null]})}const zt=t=>t.problemFor==="custom"||!!t.state?.custom.some(s=>s.id===t.problemFor);function Rt({hook:t}){const s=M(),a=t.state?.custom??[],[n,r]=m.useState(null);return t.state?e.jsxs(F,{title:s("settings.providers.own.title"),footnote:s("settings.providers.own.note"),children:[a.map(c=>e.jsx(z,{mark:e.jsx(it,{size:16}),title:c.name,badge:c.last4?e.jsx(U,{tone:"muted",children:e.jsxs("span",{className:"font-mono tabular-nums",children:["•••• ",c.last4]})}):null,description:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-mono text-[13px] text-[var(--text-faint)]",children:c.url}),c.note?e.jsx("span",{className:"mt-0.5 block whitespace-pre-line",children:c.note}):null]}),control:n===c.id?null:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"quiet",disabled:t.busy===c.id,onClick:()=>{t.removeService(c.id)},children:s("settings.providers.own.remove")}),e.jsx(k,{onClick:()=>r(c.id),children:s("settings.providers.own.edit")})]}),children:n===c.id?e.jsx(be,{hook:t,service:c,onDone:()=>r(null)}):null},c.id)),n===""?e.jsx("div",{className:"py-4",children:e.jsx(be,{hook:t,service:null,onDone:()=>r(null)})}):e.jsx("div",{className:"py-4",children:e.jsxs(k,{onClick:()=>r(""),children:[e.jsx($e,{size:15,strokeWidth:2}),s("settings.providers.own.add")]})})]}):null}function be({hook:t,service:s,onDone:a}){const n=M(),[r,c]=m.useState({name:s?.name??"",url:s?.url??"",auth:s?.auth??Dt,note:s?.note??""}),[o,x]=m.useState(""),[h,u]=m.useState(!1),b=t.busy===(s?.id??"custom"),l=y=>C=>c(E=>({...E,[y]:C.target.value})),d=async()=>{if(b||!r.name.trim()||!r.url.trim())return;const y={...r,...o.trim()?{key:o.trim()}:h||!s?{key:""}:{}};await t.saveService(s?.id??null,y)&&a()},g=(y,C)=>e.jsxs("label",{className:"flex flex-col gap-1.5 text-[13.5px] text-[var(--text-muted)]",children:[y,C]});return e.jsx("form",{className:s?"pl-[52px]":"",onSubmit:y=>{y.preventDefault(),d()},onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),a())},children:e.jsxs(X,{children:[g(n("settings.providers.own.name"),e.jsx(q,{autoFocus:!0,value:r.name,onChange:l("name"),placeholder:n("settings.providers.own.namePlaceholder")})),g(n("settings.providers.own.url"),e.jsx(q,{value:r.url,onChange:l("url"),placeholder:"http://localhost:8000",spellCheck:!1,className:"font-mono placeholder:font-sans"})),g(n("settings.providers.own.key"),e.jsx(q,{type:"password",autoComplete:"off",spellCheck:!1,value:o,onChange:y=>{x(y.target.value),u(!1)},placeholder:s?.last4&&!h?n("settings.providers.own.keyKeep").replaceAll("{last4}",s.last4):n("settings.providers.own.keyOptional"),className:"font-mono placeholder:font-sans"})),s?.last4&&!o&&!h?e.jsx("button",{type:"button",className:`${re} self-start text-[13.5px]`,onClick:()=>u(!0),children:n("settings.providers.own.removeKey")}):null,g(n("settings.providers.own.auth"),e.jsx(q,{value:r.auth,onChange:l("auth"),spellCheck:!1,className:"font-mono"})),g(n("settings.providers.own.what"),e.jsx("textarea",{value:r.note,onChange:l("note"),rows:3,maxLength:600,placeholder:n("settings.providers.own.whatPlaceholder"),className:"w-full min-w-0 resize-y rounded-[8px] border border-[var(--border)] bg-transparent px-3 py-2 text-[14px] leading-[1.5] text-[var(--text)] outline-none transition placeholder:text-[var(--text-faint)] hover:border-[var(--border-strong)] focus:border-[var(--text-muted)]"})),t.problem&&t.problemFor===(s?.id??"custom")?e.jsx("p",{className:I,role:"alert",children:t.problem}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(k,{variant:"quiet",onClick:a,children:n("settings.providers.cancel")}),e.jsx(k,{type:"submit",variant:"primary",disabled:b||!r.name.trim()||!r.url.trim(),children:n("settings.providers.save")})]})]})})}const Dt="Authorization: Bearer {key}";function ie({id:t,name:s,badge:a,children:n,action:r,below:c,highlighted:o=!1}){const x=m.useRef(null);return m.useEffect(()=>{if(!o)return;const h=x.current;h&&(h.scrollIntoView({block:"center"}),h.querySelector("[data-row-action]")?.focus({preventScroll:!0}))},[o]),e.jsx("div",{ref:x,"data-provider":t,...o?{"data-highlight":""}:{},className:"rounded-[10px] transition-colors duration-500",style:o?{background:"var(--bg-active)",outline:"2px solid var(--text-muted)",outlineOffset:2}:void 0,children:e.jsx(z,{mark:e.jsx(J,{id:t,size:17}),title:s,badge:a,description:n,control:r,children:c})})}function le({children:t}){const s=M();return e.jsxs(U,{children:[s("settings.providers.connected"),t]})}function Ft(t,s){const a=t.map((n,r)=>r?s(`settings.providers.verbs.${n}`).toLowerCase():s(`settings.providers.verbs.${n}`));return a.length>1?`${a.slice(0,-1).join(", ")} ${s("settings.providers.and")} ${a.at(-1)}`:a[0]??""}function Kt({provider:t,hook:s,highlighted:a=!1}){const n=M(),[r,c]=m.useState(!1),[o,x]=m.useState(""),h=s.busy===t.id,u=()=>{c(!1),x("")},b=async()=>{!o.trim()||h||await s.saveKey(t.id,o)&&u()},l=n("settings.providers.pasteKey").replaceAll("{name}",t.name);return e.jsx(ie,{id:t.id,name:t.name,highlighted:a,badge:t.source?e.jsx(le,{children:e.jsxs("span",{className:"font-mono tabular-nums text-[var(--text-faint)]","aria-label":n("settings.providers.keyEnding").replaceAll("{last4}",t.last4??""),children:["•••• ",t.last4]})}):null,action:t.source?e.jsx(k,{variant:"quiet",disabled:h,onClick:()=>{s.removeKey(t.id)},children:n("settings.providers.disconnect")}):r?null:e.jsxs(k,{onClick:()=>c(!0),children:[e.jsx($e,{size:15,strokeWidth:2}),n("settings.providers.connect")]}),below:r&&!t.source?e.jsx("form",{className:"pl-[34px]",onSubmit:d=>{d.preventDefault(),b()},children:e.jsxs(X,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{type:"password",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:o,onChange:d=>x(d.target.value),onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),u())},placeholder:l,"aria-label":l,className:"flex-1 font-mono placeholder:font-sans"}),e.jsx(k,{variant:"quiet",onClick:u,children:n("settings.providers.cancel")}),e.jsx(k,{type:"submit",variant:"primary",disabled:!o.trim()||h,children:n("settings.providers.save")})]}),s.problem&&s.problemFor===t.id?e.jsx("p",{className:I,role:"alert",children:s.problem}):null,t.envKey?e.jsx("button",{type:"button",disabled:h,onClick:()=>{s.useEnvKey(t.id).then(d=>{d&&u()})},className:`${re} self-start text-[14.5px]`,children:n("settings.providers.useEnv").replaceAll("{env}",t.env)}):null,e.jsxs("a",{href:t.keysUrl,target:"_blank",rel:"noreferrer",className:`${re} text-[14.5px]`,children:[n("settings.providers.getKey").replaceAll("{name}",t.name),e.jsx(Se,{size:12})]})]})}):null,children:Ft(Mt.filter(d=>t.verbs.includes(d)),n)})}function Fe(t){return t>=1024*1024*1024?`${(t/1024**3).toFixed(1)} GB`:`${Math.round(t/1024**2)} MB`}function Tt({provider:t,hook:s,highlighted:a=!1}){const n=M(),r=s.state?.use.tts===t.id;return e.jsxs(ie,{id:t.id,name:t.name,highlighted:a,badge:e.jsx(le,{}),action:null,children:[e.jsx("span",{className:"block",children:n("settings.providers.edge.desc")}),e.jsx("span",{className:"mt-1 block text-[12.5px] text-[var(--text-faint)]",children:n("settings.providers.edge.languages")}),e.jsxs("span",{className:"mt-1.5 flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 text-[13px] text-[var(--text-faint)]",children:n(r?"settings.providers.edge.ready":"settings.providers.edge.pick")}),r?null:e.jsx(k,{variant:"quiet","data-row-action":!0,disabled:s.busy==="edge-tts:tts",onClick:()=>{s.choose("tts",t.id)},children:n("settings.providers.edge.use")})]})]})}function Lt({provider:t,hook:s,highlighted:a=!1}){const n=M(),r=t.separator,c=s.busy?.startsWith(`${t.id}:`)?s.busy:null;return e.jsxs(ie,{id:t.id,name:t.name,highlighted:a,badge:r?.models.some(o=>o.downloaded)?e.jsx(le,{}):null,action:null,children:[e.jsx("span",{className:"block",children:n("settings.providers.separate.desc")}),e.jsx("span",{className:"mt-1.5 block",children:r?.models.map(o=>{const x=c===`${t.id}:${o.id}`;return e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"shrink-0 text-[13.5px] text-[var(--text)]",children:o.name}),e.jsx("span",{className:"shrink-0 text-[12.5px] tabular-nums text-[var(--text-faint)]",children:Fe(o.bytes)}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-[var(--text-faint)]",children:o.progress!=null?n("settings.providers.local.progress").replace("{p}",`${Math.round(o.progress*100)}`):o.error??""}),o.downloaded?e.jsxs(k,{variant:"quiet",disabled:x,onClick:()=>{s.removeModel(t.id,o.id)},children:[e.jsx(Ce,{size:14,strokeWidth:2}),n("settings.providers.local.remove")]}):e.jsxs(k,{"data-row-action":!0,disabled:x||o.progress!=null,onClick:()=>{s.downloadModel(t.id,o.id)},children:[e.jsx(ue,{size:14,strokeWidth:2}),n("settings.providers.local.download")]})]},o.id)})}),e.jsx("span",{className:"mt-1 block text-[12.5px] text-[var(--text-faint)]",children:n("settings.providers.separate.note")})]})}function qt({provider:t,hook:s,highlighted:a=!1}){const n=M(),r=t.whisper,c=s.busy?.startsWith(`${t.id}:`)?s.busy:null,o=t.id==="local-whisper",x=o?t.name:`${t.name}${n("settings.providers.sensevoice.tag")}`,h=(r?.models.length??0)>1;return e.jsxs(ie,{id:t.id,name:x,highlighted:a,badge:r?.models.some(u=>u.downloaded)?e.jsx(le,{}):null,action:null,children:[e.jsx("span",{className:"block",children:n(o?"settings.providers.local.desc":"settings.providers.sensevoice.desc")}),o?e.jsx("span",{className:"mt-1.5 block text-[13px] text-[var(--text)]",children:n("settings.providers.local.chinese")}):null,e.jsx("span",{className:"mt-1.5 block",children:r?.models.map(u=>{const b=c===`${t.id}:${u.id}`;return e.jsxs("span",{className:"mb-1 block",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[h?e.jsx("span",{className:"w-[9.5em] shrink-0 truncate text-[13.5px] text-[var(--text)]",children:u.name}):null,e.jsx("span",{className:"shrink-0 text-[12.5px] tabular-nums text-[var(--text-faint)]",children:Fe(u.bytes)}),u.vram!=null?e.jsx("span",{className:"shrink-0 text-[12.5px] tabular-nums text-[var(--text-faint)]",children:n("settings.providers.local.vram").replace("{g}",String(u.vram))}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-[var(--text-faint)]",children:u.progress!=null?n("settings.providers.local.progress").replace("{p}",`${Math.round(u.progress*100)}`):u.error??""}),u.downloaded?e.jsxs(k,{variant:"quiet",disabled:b,onClick:()=>{s.removeModel(t.id,u.id)},children:[e.jsx(Ce,{size:14,strokeWidth:2}),n("settings.providers.local.remove")]}):e.jsxs(k,{"data-row-action":!0,disabled:b||u.progress!=null,onClick:()=>{s.downloadModel(t.id,u.id)},children:[e.jsx(ue,{size:14,strokeWidth:2}),n("settings.providers.local.download")]})]}),u.languages?.length?e.jsx("span",{className:"mt-0.5 block text-[12px] text-[var(--text-faint)]",children:n("settings.providers.local.languages").replace("{list}",u.languages.map(l=>n(`settings.providers.local.lang.${l}`)).join(n("settings.providers.local.langSep")))}):null]},u.id)})}),o?e.jsx("span",{className:"mt-1 block text-[12.5px] text-[var(--text-faint)]",children:n("settings.providers.local.vramHint")}):null,r?.models.some(u=>u.downloaded)?s.state?.use.asr===t.id?e.jsx("span",{className:"mt-0.5 block text-[13px] text-[var(--text-faint)]",children:n("settings.providers.local.ready")}):e.jsxs("span",{className:"mt-0.5 flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 text-[13px] text-[var(--text-faint)]",children:n("settings.providers.local.pick")}),e.jsx(k,{variant:"quiet","data-row-action":!0,disabled:s.busy===`${t.id}:asr`,onClick:()=>{s.choose("asr",t.id)},children:n("settings.providers.local.use")})]}):null]})}const Ke="aicut.theme",Te=()=>window.matchMedia("(prefers-color-scheme: dark)");function Le(){try{const t=localStorage.getItem(Ke);return t==="light"||t==="system"?t:"dark"}catch{return"dark"}}function qe(t){document.documentElement.dataset.theme=t==="system"?Te().matches?"dark":"light":t}const de=new Set;typeof window<"u"&&Te().addEventListener("change",()=>{Le()==="system"&&qe("system")});function Pt(t){try{localStorage.setItem(Ke,t)}catch{}qe(t);for(const s of de)s()}function Bt(){return[m.useSyncExternalStore(s=>(de.add(s),()=>de.delete(s)),Le,()=>"dark"),Pt]}const Ot=[{group:"settings",sections:["general",...T?.agents?["agents"]:[],"video","providers","models"]},{group:"help",sections:["shortcuts",...T?.developer?["developer"]:[]]}],Ut=[{label:"settings.links.github",href:"https://github.com/autoaiai/aicut"},{label:"settings.links.examples",href:"https://github.com/aicut/examples"},{label:"settings.links.site",href:"https://aicut.dev"}],It={general:e.jsx(Je,{size:18,strokeWidth:1.75}),agents:e.jsx(Ye,{size:18,strokeWidth:1.75}),video:e.jsx(Ne,{size:18,strokeWidth:1.75}),providers:e.jsx(rt,{size:18,strokeWidth:1.75}),models:e.jsx(Ve,{size:18,strokeWidth:1.75}),developer:e.jsx(lt,{size:18,strokeWidth:1.75}),shortcuts:e.jsx(st,{size:18,strokeWidth:1.75})},je={general:["settings.appearance","settings.performance","settings.playback"],agents:"settings.agents",video:"settings.video",providers:"settings.providers",models:"settings.models",developer:"settings.developer",shortcuts:"settings.shortcuts"};function Xt({open:t,onClose:s,section:a,highlight:n}){const r=M(),c=Q(),[o,x]=m.useState("general"),[h,u]=m.useState(""),[b,l]=m.useState(!1),d=m.useRef(null),g=m.useRef(null),y=m.useRef(s);y.current=s;const C=m.useRef(n);C.current=n,m.useLayoutEffect(()=>{t&&(x(a??"general"),u(""))},[t,a]);const E=m.useMemo(()=>Object.fromEntries(Object.keys(je).map(p=>[p,[r(`settings.sections.${p}`),...[je[p]].flat().flatMap(A=>We(A,c))].join(`
|
|
2
|
-
`).toLowerCase()])),[r,c]),$=h.trim().toLowerCase(),D=Ot.map(p=>({...p,sections:p.sections.filter(A=>!$||E[A].includes($))})).filter(p=>p.sections.length>0),f=D.flatMap(p=>p.sections),j=f.includes(o)?o:f[0]??null;return m.useEffect(()=>{if(!t)return;const p=document.activeElement,A=R=>{if(R.defaultPrevented||(R.key==="Escape"&&y.current(),R.key!=="Tab"||!d.current?.contains(document.activeElement)))return;const O=Array.from(d.current.querySelectorAll('button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), [tabindex="0"]')).filter(S=>S.getClientRects().length>0),V=O[0],i=O[O.length-1];R.shiftKey&&document.activeElement===V?(R.preventDefault(),i?.focus()):!R.shiftKey&&document.activeElement===i&&(R.preventDefault(),V?.focus())};window.addEventListener("keydown",A);const v=document.body.style.overflow;document.body.style.overflow="hidden";const w=requestAnimationFrame(()=>{l(!0),C.current||g.current?.focus()});return()=>{window.removeEventListener("keydown",A),document.body.style.overflow=v,cancelAnimationFrame(w),l(!1),p?.isConnected&&p.focus()}},[t]),t?He.createPortal(e.jsx("div",{className:"fixed inset-0 z-[10050] grid place-items-center p-6",style:{background:"rgba(0,0,0,0.5)",opacity:b?1:0,transition:"opacity 160ms ease"},onMouseDown:p=>{p.target===p.currentTarget&&s()},children:e.jsxs("div",{ref:d,role:"dialog","aria-modal":"true","aria-labelledby":"settings-title",className:"relative flex h-[min(800px,90vh)] w-full max-w-[1120px] overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--dock-pane)] shadow-[0_24px_64px_-12px_rgba(0,0,0,0.5),0_4px_16px_rgba(0,0,0,0.14)]",style:{opacity:b?1:0,transform:b?"scale(1)":"scale(0.98)",transition:"opacity 160ms ease, transform 200ms ease"},children:[e.jsxs("nav",{"aria-label":r("settings.title"),className:"flex w-[264px] shrink-0 flex-col overflow-y-auto border-r border-[var(--border)] px-3 pb-4 pt-3",children:[e.jsxs("label",{className:"mb-3 flex h-10 shrink-0 items-center gap-2.5 rounded-[9px] border border-[var(--border)] px-3 text-[var(--text-muted)] transition focus-within:border-[var(--text-muted)]",children:[e.jsx(Ge,{size:17,strokeWidth:1.75,className:"shrink-0","aria-hidden":!0}),e.jsx("input",{ref:g,value:h,onChange:p=>u(p.target.value),placeholder:r("settings.search"),"aria-label":r("settings.search"),className:"min-w-0 flex-1 bg-transparent text-[15px] text-[var(--text)] outline-none placeholder:text-[var(--text-faint)]"})]}),D.map(p=>e.jsxs("div",{className:"mt-3 flex flex-col gap-0.5",children:[e.jsx("div",{className:"px-2.5 pb-1.5 text-[13px] text-[var(--text-faint)]",children:r(p.group==="help"?"settings.groups.help":"settings.title")}),p.sections.map(A=>{const v=j===A;return e.jsxs("button",{type:"button","aria-current":v?"page":void 0,onClick:()=>x(A),className:`flex h-10 min-w-0 items-center gap-3 rounded-[8px] px-2.5 text-left text-[15px] transition ${v?"bg-[var(--bg-active)] text-[var(--text)]":"text-[var(--text-dim)] hover:bg-[var(--bg-hover)] hover:text-[var(--text)]"}`,children:[e.jsx("span",{className:`shrink-0 ${v?"text-[var(--text)]":"text-[var(--text-muted)]"}`,children:It[A]}),e.jsx("span",{className:"min-w-0 truncate",children:r(`settings.sections.${A}`)})]},A)})]},p.group)),f.length===0?e.jsx("p",{className:"px-2.5 pt-4 text-[14px] text-[var(--text-faint)]",children:r("settings.noResults")}):null,e.jsx("div",{className:"mt-auto flex flex-wrap gap-x-4 gap-y-1 px-2.5 pt-6 text-[13px] text-[var(--text-faint)]",children:Ut.map(p=>e.jsx("a",{href:p.href,target:"_blank",rel:"noreferrer",className:"rounded-[4px] transition hover:text-[var(--text)]",children:r(p.label)},p.href))})]}),e.jsxs("div",{className:"relative flex min-w-0 flex-1 flex-col",children:[e.jsx("button",{type:"button",onClick:s,"aria-label":r("settings.done"),className:"absolute right-4 top-4 z-10 flex h-9 w-9 items-center justify-center rounded-[8px] text-[var(--text-muted)] transition hover:bg-[var(--bg-hover)] hover:text-[var(--text)]",children:e.jsx(we,{size:19,strokeWidth:1.75})}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-10 pb-12 pt-9",children:[j?e.jsx("h2",{id:"settings-title",className:"mb-7 text-[22px] font-semibold tracking-[-0.015em] text-[var(--text)]",children:r(`settings.sections.${j}`)}):null,j==="general"&&e.jsx(_t,{}),j==="agents"&&e.jsx(ht,{}),j==="video"&&e.jsx(wt,{onConnect:()=>{u(""),x("providers")}}),j==="providers"&&e.jsx(At,{highlight:n??null}),j==="models"&&e.jsx(Ct,{onConnect:()=>{u(""),x("providers")}}),j==="developer"&&e.jsx(Jt,{}),j==="shortcuts"&&e.jsx(Zt,{})]},j??"none")]})]})}),document.body):null}function _t(){const t=M(),[s,a]=Bt(),[n,r]=Ze(),c=Q(),o=fe.find(x=>x.code===c)?.name??c;return e.jsxs(H,{children:[e.jsxs(F,{title:t("settings.appearance.group"),children:[e.jsx(z,{title:t("settings.appearance.theme"),description:t("settings.appearance.themeHint"),control:e.jsx(ze,{label:t("settings.appearance.theme"),value:s,onChange:a,options:[{value:"system",label:t("settings.appearance.system"),icon:e.jsx(nt,{size:15})},{value:"light",label:t("settings.appearance.light"),icon:e.jsx(Qe,{size:15})},{value:"dark",label:t("settings.appearance.dark"),icon:e.jsx(at,{size:15})}]})}),e.jsx(z,{title:t("settings.appearance.language"),description:n==="system"?`${t("settings.appearance.languageHint")} · ${o}`:t("settings.appearance.languageHint"),control:e.jsx(xe,{label:t("settings.appearance.language"),value:n,onChange:r,options:[{value:"system",label:t("settings.appearance.languageSystem")},...fe.map(x=>({value:x.code,label:x.name}))]})})]}),e.jsx(Wt,{}),e.jsx(Ht,{}),T?.update?.onState?e.jsx(Yt,{}):e.jsx(Gt,{})]})}function Wt(){const t=M(),s=T?.acceleration,[a,n]=m.useState(null);if(m.useEffect(()=>{if(s)return s.get().then(n).catch(()=>{}),s.onChange(n)},[s]),!s)return null;const r=!!a&&a.on!==a.atStart;return e.jsx(F,{title:t("settings.performance.group"),children:e.jsx(z,{title:t("settings.performance.gpu"),badge:r?e.jsx("span",{className:"rounded-full bg-[var(--fill-tsp)] px-2 py-0.5 text-[11.5px] text-[var(--text-muted)]",children:t("settings.performance.gpuWaiting")}):null,description:t(r?"settings.performance.gpuRestartHint":"settings.performance.gpuHint"),control:e.jsxs(e.Fragment,{children:[r?e.jsx(k,{onClick:()=>s.restart(),children:t("settings.performance.restart")}):null,a?e.jsx(Z,{checked:a.on,label:t("settings.performance.gpu"),onChange:c=>{n({...a,on:c}),s.set(c).then(n).catch(()=>{})}}):null]})})})}function Ht(){const t=M(),[s,a]=m.useState(null);if(m.useEffect(()=>{ae.prefs().then(a).catch(()=>{})},[]),!s)return null;const n=r=>{a({...s,proxies:{...s.proxies,...r}}),ae.setPrefs({proxies:r}).then(a).catch(()=>{})};return e.jsxs(F,{title:t("settings.playback.group"),children:[e.jsx(z,{title:t("settings.playback.proxies"),description:t("settings.playback.proxiesHint"),control:e.jsx(Z,{checked:s.proxies.on,onChange:r=>n({on:r}),label:t("settings.playback.proxies")})}),s.proxies.on?e.jsx(z,{title:t("settings.playback.proxySize"),description:t("settings.playback.proxySizeHint"),control:e.jsx(ze,{label:t("settings.playback.proxySize"),value:String(s.proxies.height),onChange:r=>n({height:Number(r)}),options:[{value:"540",label:"540p"},{value:"720",label:"720p"},{value:"1080",label:"1080p"}]})}):null]})}function Gt(){const t=M(),[s,a]=m.useState(null),[n,r]=m.useState("idle");m.useEffect(()=>{ae.version().then(a).catch(()=>{})},[]);const c=!!T,o=()=>{r("checking");const h=s?.checkedAt??null;ae.version(!0).then(u=>{a(u),r(u.checkedAt!=null&&u.checkedAt!==h?"idle":"failed")}).catch(()=>r("failed"))},x=c?t("settings.about.inApp"):s?.source?t("settings.about.source"):s&&!s.checking?t("settings.about.off"):n==="checking"?t("settings.about.checking"):n==="failed"?t("settings.about.failed"):s?.newer?t("settings.about.newer").replace("{version}",s.latest??""):s?.latest?t("settings.about.upToDate"):t("settings.about.never");return e.jsxs(F,{title:t("settings.about.group"),children:[e.jsx(z,{title:s?`AiCut ${s.version}`:"AiCut",description:x,control:c||!s?.checking?null:e.jsx(k,{disabled:n==="checking",onClick:o,children:t("settings.about.check")}),children:Me(s?.version)?e.jsx(Pe,{version:s.version}):null}),!c&&!s?.source&&s?.newer?e.jsx(z,{title:t("settings.about.howTitle"),description:t("settings.about.how"),control:e.jsx("code",{className:"select-all rounded-md bg-[var(--surface-2)] px-2 py-1 font-mono text-[12px] text-[var(--text)]",children:"npx -y @autoaiai/aicut@latest open"})}):null]})}function Pe({version:t}){const s=M();return e.jsx("button",{type:"button",onClick:()=>Ee([t]),className:"mb-2 text-[13.5px] text-[var(--text-muted)] underline underline-offset-2 transition hover:text-[var(--text)]",children:s("settings.about.whatsNew")})}const Vt=10*6e4;function Yt(){const t=M(),s=Q(),a=T?.update,[n,r]=m.useState(null),[c,o]=m.useState(null);m.useEffect(()=>a?.onState?.(r),[a]);const x=m.useRef(!1);m.useEffect(()=>{if(!n||x.current)return;x.current=!0,(n.checkedAt==null||Date.now()-n.checkedAt>Vt)&&["idle","current","error"].includes(n.status)&&a?.check?.()},[n,a]);const h=()=>{o(null),a?.check?.()},u=()=>{o(null),a?.restart().then(f=>{!f.ok&&f.error&&o(f.error)})},b=f=>{const j=Math.round((Date.now()-f)/6e4),p=new Intl.RelativeTimeFormat(s,{numeric:"auto"});return j<60?p.format(-j,"minute"):j<2880?p.format(-Math.round(j/60),"hour"):p.format(-Math.round(j/1440),"day")},l=n,d=l?.availableVersion??"",g=c??(l?.status==="ready"?l.error:null),y=g==="agent-busy"?t("update.agentBusy"):g==="exporting"?t("update.exporting"):g==="install-failed"?t("update.installFailed").replace("{version}",d):null,C=l?.error==="offline"?t("settings.about.appOffline"):l?.error==="unavailable"?t("settings.about.appUnavailable"):t("settings.about.appFailed"),E=f=>e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(B,{size:13,className:"animate-spin","aria-hidden":!0}),f]}),$=l?l.status==="off"?t("settings.about.appOff"):l.status==="idle"||l.status==="checking"?E(t("settings.about.checking")):l.status==="current"?`${t("settings.about.upToDate")}${l.checkedAt?` ${t("settings.about.appChecked").replace("{time}",b(l.checkedAt))}`:""}`:l.status==="available"||l.status==="downloading"?E(`${t("settings.about.appDownloading").replace("{version}",d)}${l.status==="downloading"?` ${Math.round(l.progress)}%`:""}`):l.status==="staging"?E(t("settings.about.appStaging").replace("{version}",d)):l.status==="ready"?y??t("update.ready").replace("{version}",d):l.status==="installing"?E(t("update.installing")):C:null,D=l?l.status==="current"?e.jsx(k,{onClick:h,children:t("settings.about.check")}):l.status==="error"?e.jsx(k,{onClick:h,children:t("settings.about.appRetry")}):l.status==="ready"?e.jsx(k,{variant:"primary",onClick:u,children:t("update.restart")}):null:null;return e.jsx(F,{title:t("settings.about.group"),children:e.jsxs(z,{title:`AiCut ${l?.version??""}`.trim(),badge:l?.channel==="beta"?e.jsx("span",{className:"rounded-full bg-[var(--fill-tsp)] px-2 py-0.5 text-[11.5px] text-[var(--text-muted)]",children:"beta"}):null,description:$,control:D,children:[Me(l?.version)?e.jsx(Pe,{version:l.version}):null,l?.status==="downloading"?e.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-[var(--fill-tsp)]",role:"progressbar","aria-valuenow":Math.round(l.progress),"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"h-full rounded-full bg-[var(--text)] transition-[width]",style:{width:`${Math.max(2,l.progress)}%`}})}):null]})})}function Jt(){const t=M(),s=T?.developer,[a,n]=m.useState(null);if(m.useEffect(()=>{if(s)return s.get().then(n),s.onChange(n)},[s]),!s)return null;const r=c=>{n(o=>o&&{...o,...c}),s.set(c)};return e.jsxs(H,{note:t("settings.developer.intro"),children:[e.jsxs(F,{title:t("settings.developer.group"),footnote:t("settings.developer.where"),children:[e.jsx(z,{title:t("settings.developer.changes"),description:t("settings.developer.changesHint"),control:a?e.jsx(Z,{checked:a.changes,label:t("settings.developer.changes"),onChange:c=>r({changes:c})}):null}),e.jsx(z,{title:t("settings.developer.logs"),description:t("settings.developer.logsHint"),control:a?e.jsx(Z,{checked:a.logs,label:t("settings.developer.logs"),onChange:c=>r({logs:c})}):null})]}),oe()?e.jsx(F,{title:t("settings.developer.releaseGroup"),children:e.jsx(z,{title:t("settings.developer.previewWhatsNew"),description:t("settings.developer.previewWhatsNewHint").replace("{version}",oe()),control:e.jsx(k,{onClick:()=>Ee([oe()]),children:t("settings.developer.preview")})})}):null]})}function Zt(){const t=M(),s=Xe(t,et());return e.jsx(H,{note:t("settings.shortcuts.hint"),children:s.map(a=>e.jsx(F,{title:a.title,children:a.items.map(n=>e.jsxs("div",{className:"flex min-h-[52px] items-center justify-between gap-6 py-2.5",children:[e.jsx("span",{className:"text-[15px] text-[var(--text)]",children:n.label}),e.jsx("span",{className:"flex max-w-[55%] shrink-0 flex-wrap items-center justify-end gap-1",children:n.keys.map((r,c)=>e.jsxs(m.Fragment,{children:[c>0?e.jsx("span",{className:"px-0.5 text-[13px] text-[var(--text-faint)]",children:"/"}):null,e.jsx("kbd",{className:"inline-flex h-7 min-w-7 items-center justify-center rounded-[6px] border border-[var(--border)] px-1.5 font-sans text-[13px] text-[var(--text-dim)]",children:r})]},r))})]},n.label))},a.title))})}export{Xt as SettingsModal};
|