@nice2dev/ui-video 1.0.29 → 1.1.5

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/dist/index.cjs CHANGED
@@ -1,27 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),de=c.forwardRef(({menubar:d,toolbar:f,sidebar:l,sidebarWidth:N=220,rightSidebar:S,rightSidebarWidth:H=280,children:u,bottomPanel:t,bottomPanelHeight:T,statusBar:b,height:_="100%",flush:y=!1,className:w,style:k,id:M,"data-testid":R},P)=>{const z=`nice-app-shell__sidebar${y?" nice-app-shell__sidebar--flush":""}`;return e.jsxs("div",{ref:P,id:M,"data-testid":R,className:`nice-app-shell${w?` ${w}`:""}`,style:{height:_,...k},children:[d!=null&&e.jsx("div",{className:`nice-app-shell__menubar${y?" nice-app-shell__chrome--flush":""}`,children:d}),f!=null&&e.jsx("div",{className:`nice-app-shell__toolbar${y?" nice-app-shell__chrome--flush":""}`,children:f}),e.jsxs("div",{className:"nice-app-shell__body",children:[l!=null&&e.jsx("aside",{className:z,style:y?void 0:{width:N},children:l}),e.jsx("main",{className:"nice-app-shell__content",children:u}),S!=null&&e.jsx("aside",{className:`${z} nice-app-shell__sidebar--right`,style:y?void 0:{width:H},children:S})]}),t!=null&&e.jsx("div",{className:`nice-app-shell__bottom${y?" nice-app-shell__bottom--flush":""}`,style:T!=null?{height:T}:void 0,children:t}),b!=null&&e.jsx("div",{className:"nice-app-shell__status",children:b})]})});de.displayName="NiceAppShell";const xe=(d,f)=>f,ge=c.createContext(xe);function je(){return{t:c.useContext(ge)}}c.createContext({dir:"ltr",isRTL:!1,flip:d=>d,value:d=>d.ltr});c.createContext(null);c.createContext(null);const we={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"};c.createContext({displayStyle:"default",variantConfig:we,setDisplayStyle:()=>{}});c.createContext({});c.createContext({direction:"ltr",isRTL:!1,flip:d=>d,flipStyle:(d,f)=>({[d]:f})});c.createContext({permissions:{},getAccessMode:()=>"full"});c.createContext(null);const Ne=process.env.NODE_ENV==="development";let le={enabled:Ne,slowRenderThreshold:16};const fe=[],oe=new Map,me=new Map;function ke(){fe.length=0,oe.clear(),me.clear()}function Se(d){const f=le.slowRenderThreshold;return fe.filter(l=>l.actualDuration>f)}function J(d){return d<1?`${(d*1e3).toFixed(0)}μs`:d<1e3?`${d.toFixed(2)}ms`:`${(d/1e3).toFixed(2)}s`}function Ce(){const d=Array.from(oe.values()),f=Se(),l=d.reduce((H,u)=>H+u.renderCount,0),N=d.length>0?d.reduce((H,u)=>H+u.avgRenderTime,0)/d.length:0,S=Array.from(me.values());return{stats:d,slowRenders:f,totalRenders:l,avgRenderTime:N,marks:S}}function He(){const d=Ce();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${d.totalRenders}`),console.log(`Average render time: ${J(d.avgRenderTime)}`),console.log(`Slow renders: ${d.slowRenders.length}`),console.group("Component Stats"),console.table(d.stats.sort((f,l)=>l.totalRenderTime-f.totalRenderTime).map(f=>({Name:f.componentName,Renders:f.renderCount,"Avg Time":J(f.avgRenderTime),"Max Time":J(f.maxRenderTime),"Total Time":J(f.totalRenderTime),"Slow Renders":f.slowRenderCount}))),console.groupEnd(),d.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(d.slowRenders.slice(-10).map(f=>({Component:f.componentName,Phase:f.phase,Duration:J(f.actualDuration),Time:new Date(f.timestamp).toLocaleTimeString()}))),console.groupEnd()),d.marks.length>0&&(console.group("Custom Marks"),console.table(d.marks.filter(f=>f.duration).map(f=>({Name:f.name,Duration:J(f.duration)}))),console.groupEnd()),console.groupEnd()}const Re=c.memo(({position:d="bottom-right",defaultCollapsed:f=!0})=>{const[l,N]=c.useState(f),[S,H]=c.useState([]),[u,t]=c.useState({used:0,total:0});if(c.useEffect(()=>{const b=()=>{const y=Array.from(oe.values());H(y.sort((k,M)=>M.totalRenderTime-k.totalRenderTime).slice(0,10));const w=window.performance;w.memory&&t({used:w.memory.usedJSHeapSize/1024/1024,total:w.memory.totalJSHeapSize/1024/1024})};b();const _=setInterval(b,2e3);return()=>clearInterval(_)},[]),!le.enabled)return null;const T={position:"fixed",zIndex:99999,...d.includes("top")?{top:8}:{bottom:8},...d.includes("left")?{left:8}:{right:8}};return e.jsxs("div",{style:{...T,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:l?"4px 8px":8,maxWidth:l?"auto":300,maxHeight:l?"auto":400,overflow:"auto"},children:[e.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>N(b=>!b),children:[e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),e.jsx("span",{children:"Profiler"}),u.used>0&&e.jsxs("span",{style:{color:u.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[u.used.toFixed(0),"MB"]}),e.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:l?"▼":"▲"})]}),!l&&e.jsxs("div",{style:{marginTop:8},children:[e.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:e.jsx("strong",{children:"Top Components"})}),S.map(b=>e.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:b.componentName}),e.jsx("span",{style:{color:b.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:J(b.avgRenderTime)}),e.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",b.renderCount]})]},b.componentName)),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[e.jsx("button",{onClick:He,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),e.jsx("button",{onClick:ke,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});Re.displayName="ProfilerOverlay";process.env.NODE_ENV;c.createContext(null);const Te=c.createContext({enabled:!0,active:!1,run:()=>{}});function Ie(){return c.useContext(Te)}function _e(d,f){if(!d)return null;if(d===!0)return f&&f.length>0?f:null;if(Array.isArray(d))return d.length>0?d:null;const l=d.steps??f;return l&&l.length>0?l:null}function Me(d,f){return d.map(l=>({target:l.target,title:l.titleKey?f(l.titleKey,l.title??""):l.title??"",content:l.contentKey?f(l.contentKey,l.content??""):l.content??"",placement:l.placement,highlightPadding:l.highlightPadding,showArrow:l.showArrow,scrollIntoView:l.scrollIntoView,disableInteraction:l.disableInteraction}))}const $e=({steps:d,autoStart:f,label:l,size:N="md",className:S,style:H,"data-testid":u})=>{const{enabled:t,run:T}=Ie(),{t:b}=je();if(!t||!d||d.length===0)return null;const _=l??b("tutorial.startAria","Start tutorial");return e.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${N}`+(S?` ${S}`:""),style:H,"data-testid":u,"aria-label":_,title:_,onClick:()=>T(Me(d,b),{autoStart:f}),children:"?"})},ce="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(ce)){const d=document.createElement("style");d.id=ce,d.textContent=`
2
- .nice-tutorial-button {
3
- display: inline-flex;
4
- align-items: center;
5
- justify-content: center;
6
- border: 1px solid var(--nice-border, #cbd5e1);
7
- background: var(--nice-bg, #fff);
8
- color: var(--nice-text-secondary, #475569);
9
- border-radius: var(--nice-radius-full, 9999px);
10
- cursor: help;
11
- font-weight: 700;
12
- line-height: 1;
13
- padding: 0;
14
- transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
15
- }
16
- .nice-tutorial-button:hover {
17
- background: var(--nice-primary, #2563eb);
18
- border-color: var(--nice-primary, #2563eb);
19
- color: var(--nice-text-inverse, #fff);
20
- }
21
- .nice-tutorial-button:focus-visible {
22
- outline: none;
23
- box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
24
- }
25
- .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
26
- .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
27
- `,document.head.appendChild(d)}c.createContext(null);c.createContext(null);c.createContext(null);const ue={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},pe={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},ye={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},he=d=>({color:d,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),De={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},Ae={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function o(d,f,l,N,S){return{name:d,darkMode:"light",colors:{...f,surface:f.surface??l.primary,surfaceHover:f.surfaceHover??l.secondary},backgrounds:{...l,elevated:l.elevated??l.primary,inset:l.inset??l.tertiary,canvas:l.canvas??l.primary},text:{...N,inverse:N.inverse??"#ffffff"},borders:he(S),shadows:De,spacing:ue,typography:pe,transitions:ye}}function C(d,f,l,N,S){return{name:d,darkMode:"dark",colors:{...f,surface:f.surface??l.secondary,surfaceHover:f.surfaceHover??l.tertiary},backgrounds:{...l,elevated:l.elevated??l.secondary,inset:l.inset??l.primary,canvas:l.canvas??l.primary},text:{...N,inverse:N.inverse??"#0f172a"},borders:he(S),shadows:Ae,spacing:ue,typography:pe,transitions:ye}}o("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1");o("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8");o("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1");o("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db");o("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8");o("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1");o("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db");o("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4");o("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af");o("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7");o("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d");o("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd");o("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4");o("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc");o("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9");o("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264");o("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4");o("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74");o("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9");o("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc");o("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af");o("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74");C("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b");C("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46");C("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266");C("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626");C("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252");C("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151");C("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87");C("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985");C("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040");C("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857");o("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac");o("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc");o("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047");o("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74");o("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4");o("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe");o("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5");o("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac");o("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd");o("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0");o("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4");o("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd");o("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0");o("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa");o("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe");o("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a");o("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0");o("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3");o("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1");o("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb");o("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1");o("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd");o("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd");o("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1");o("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0");o("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d");o("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9");C("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a");o("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5");C("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642");C("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32");C("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452");C("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866");o("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8");C("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300");o("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8");o("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4");C("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44");C("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333");C("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66");o("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0");C("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400");o("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af");o("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe");o("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d");o("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe");o("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8");o("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d");o("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0");o("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0");o("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb");o("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe");o("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5");o("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d");o("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac");o("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896");C("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff");o("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0");o("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c");o("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5");C("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e");C("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58");o("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8");o("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0");c.createContext(null);c.createContext(null);const Ee={id:crypto.randomUUID(),name:"Untitled Project",resolution:{width:1920,height:1080,label:"1080p"},frameRate:30,duration:0,tracks:[{id:"1",type:"video",name:"Video 1",items:[],muted:!1,locked:!1,visible:!0},{id:"2",type:"audio",name:"Audio 1",items:[],muted:!1,locked:!1,visible:!0}],assets:[],settings:{backgroundColor:"var(--nice-text, #000000)",audio:{sampleRate:48e3,channels:2,bitrate:320},video:{codec:"h264",bitrate:8e3,profile:"high"}}},ze=[{type:"blur",name:"Blur",icon:"🔵"},{type:"brightness",name:"Brightness",icon:"☀️"},{type:"contrast",name:"Contrast",icon:"◐"},{type:"saturation",name:"Saturation",icon:"🎨"},{type:"grayscale",name:"Grayscale",icon:"⬛"},{type:"sepia",name:"Sepia",icon:"🟤"},{type:"chromaKey",name:"Chroma Key",icon:"🟢"},{type:"crop",name:"Crop",icon:"✂️"},{type:"zoom",name:"Zoom",icon:"🔍"}],Fe=[{type:"fade",name:"Fade"},{type:"dissolve",name:"Dissolve"},{type:"wipe",name:"Wipe"},{type:"slide",name:"Slide"},{type:"zoom",name:"Zoom"},{type:"push",name:"Push"}],Pe=[{target:".nice-video-editor",titleKey:"tutorial.videoEditorPro.intro.title",title:"Video editor",contentKey:"tutorial.videoEditorPro.intro.content",content:"Add media to the timeline, arrange and trim clips, apply effects and transitions, then configure and run the export.",placement:"auto"}],Ue=({project:d,onProjectChange:f,onExport:l,onAssetUpload:N,className:S="",tutorial:H})=>{const[u,t]=c.useState(d||Ee),[T,b]=c.useState("timeline"),[_,y]=c.useState(null),[w,k]=c.useState(null),[M,R]=c.useState(0),[P,z]=c.useState(!1),[I,W]=c.useState(1),[V,A]=c.useState(!0),[E,U]=c.useState(null),Q=c.useRef(null),ee=c.useRef(null),D=c.useRef(null);c.useEffect(()=>{d&&t(d)},[d]),c.useEffect(()=>()=>{D.current&&clearInterval(D.current)},[]);const j=c.useCallback(s=>{const n={...u,...s};t(n),f==null||f(n)},[u,f]),g=async s=>{const n=[];for(const r of Array.from(s)){const p=r.type.startsWith("video/")?"video":r.type.startsWith("audio/")?"audio":"image";let h;N?h=await N(r):h={id:crypto.randomUUID(),type:p,name:r.name,url:URL.createObjectURL(r),size:r.size},n.push(h)}j({assets:[...u.assets,...n]})},L=s=>{const n={id:crypto.randomUUID(),type:s,name:`${s.charAt(0).toUpperCase()+s.slice(1)} ${u.tracks.filter(r=>r.type===s).length+1}`,items:[],muted:!1,locked:!1,visible:!0};j({tracks:[...u.tracks,n]})},K=s=>{j({tracks:u.tracks.filter(n=>n.id!==s)}),_===s&&y(null)},O=s=>{j({tracks:u.tracks.map(n=>n.id===s?{...n,muted:!n.muted}:n)})},Y=s=>{j({tracks:u.tracks.map(n=>n.id===s?{...n,locked:!n.locked}:n)})},$=(s,n)=>{const r=u.tracks.find(x=>x.id===s);if(!r||r.locked)return;const p=r.items[r.items.length-1],h=p?p.startTime+p.duration:0,v={id:crypto.randomUUID(),assetId:n.id,type:n.type,startTime:h,duration:n.duration||5,offset:0,properties:{x:0,y:0,opacity:1,scale:1,volume:1},effects:[],transitions:[]};j({tracks:u.tracks.map(x=>x.id===s?{...x,items:[...x.items,v]}:x)})},G=(s,n,r)=>{const p={id:crypto.randomUUID(),type:r,name:r.charAt(0).toUpperCase()+r.slice(1),parameters:ae(r)};j({tracks:u.tracks.map(h=>h.id===s?{...h,items:h.items.map(v=>v.id===n?{...v,effects:[...v.effects,p]}:v)}:h)})},F=(s,n,r,p)=>{const h={id:crypto.randomUUID(),type:r,duration:.5,position:p};j({tracks:u.tracks.map(v=>v.id===s?{...v,items:v.items.map(x=>x.id===n?{...x,transitions:[...x.transitions,h]}:x)}:v)})},ae=s=>{switch(s){case"blur":return{radius:5};case"brightness":return{value:100};case"contrast":return{value:100};case"saturation":return{value:100};case"grayscale":return{amount:100};case"sepia":return{amount:100};case"chromaKey":return{color:"var(--nice-success, #00ff00)",threshold:40};case"crop":return{top:0,right:0,bottom:0,left:0};case"zoom":return{scale:1,x:0,y:0};default:return{}}},re=()=>{P?(D.current&&clearInterval(D.current),z(!1)):(D.current=setInterval(()=>{R(s=>{const n=Math.max(...u.tracks.flatMap(r=>r.items.map(p=>p.startTime+p.duration)),0);return s>=n?(clearInterval(D.current),z(!1),0):s+1/u.frameRate})},1e3/u.frameRate),z(!0))},q=s=>{R(Math.max(0,s))},Z=async()=>{if(l){U(0);try{const s=setInterval(()=>{U(n=>n!==null&&n<90?n+Math.random()*10:n)},500);await l(u,u.settings.video.codec),clearInterval(s),U(100),setTimeout(()=>U(null),2e3)}catch(s){U(null),console.error("Export failed:",s)}}},X=s=>{const n=Math.floor(s/60),r=Math.floor(s%60),p=Math.floor(s%1*u.frameRate);return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`},B=()=>{for(const s of u.tracks){const n=s.items.find(r=>r.id===w);if(n)return{track:s,item:n}}return null},se=e.jsxs("header",{className:"video-editor__header",children:[e.jsxs("div",{className:"header__project-info",children:[e.jsx("input",{type:"text",value:u.name,onChange:s=>j({name:s.target.value}),className:"project-name-input"}),e.jsxs("span",{className:"project-settings",children:[u.resolution.width,"x",u.resolution.height," • ",u.frameRate,"fps"]})]}),e.jsx("div",{className:"header__tabs",children:["timeline","effects","transitions","export"].map(s=>e.jsx("button",{className:`tab-button ${T===s?"tab-button--active":""}`,onClick:()=>b(s),children:s.charAt(0).toUpperCase()+s.slice(1)},s))}),e.jsx("div",{className:"header__actions",children:e.jsx("button",{className:"action-button action-button--primary",onClick:Z,disabled:E!==null,children:E!==null?`Exporting ${Math.round(E)}%`:"Export"})})]}),te=w&&T!=="export"?(()=>{const s=B();if(!s)return null;const{track:n,item:r}=s;return e.jsxs("div",{className:"item-inspector",children:[e.jsx("h4",{children:"Item Properties"}),e.jsxs("div",{className:"inspector-section",children:[e.jsxs("label",{children:["Start Time",e.jsx("input",{type:"number",step:"0.1",value:r.startTime,onChange:p=>{const h=parseFloat(p.target.value);j({tracks:u.tracks.map(v=>v.id===n.id?{...v,items:v.items.map(x=>x.id===r.id?{...x,startTime:h}:x)}:v)})}})]}),e.jsxs("label",{children:["Duration",e.jsx("input",{type:"number",step:"0.1",value:r.duration,onChange:p=>{const h=parseFloat(p.target.value);j({tracks:u.tracks.map(v=>v.id===n.id?{...v,items:v.items.map(x=>x.id===r.id?{...x,duration:h}:x)}:v)})}})]}),e.jsxs("label",{children:["Opacity",e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:r.properties.opacity??1,onChange:p=>{const h=parseFloat(p.target.value);j({tracks:u.tracks.map(v=>v.id===n.id?{...v,items:v.items.map(x=>x.id===r.id?{...x,properties:{...x.properties,opacity:h}}:x)}:v)})}})]})]}),e.jsxs("h4",{children:["Effects (",r.effects.length,")"]}),e.jsx("div",{className:"effects-list",children:r.effects.map(p=>e.jsx("div",{className:"effect-badge",children:p.name},p.id))})]})})():null,a=V?e.jsxs("aside",{className:"video-editor__asset-library",children:[e.jsxs("div",{className:"asset-library__header",children:[e.jsx("h3",{children:"Assets"}),e.jsx("button",{className:"close-button",onClick:()=>A(!1),children:"×"})]}),e.jsx("div",{className:"asset-library__upload",children:e.jsxs("label",{className:"upload-zone",children:[e.jsx("input",{type:"file",multiple:!0,accept:"video/*,audio/*,image/*",onChange:s=>s.target.files&&g(s.target.files),hidden:!0}),e.jsx("span",{className:"upload-icon",children:"+"}),e.jsx("span",{children:"Drop files or click to upload"})]})}),e.jsx("div",{className:"asset-library__list",children:u.assets.map(s=>e.jsxs("div",{className:"asset-item",draggable:!0,onDragStart:n=>n.dataTransfer.setData("assetId",s.id),children:[e.jsx("div",{className:"asset-thumbnail",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):e.jsx("span",{className:"asset-type-icon",children:s.type==="video"?"🎬":s.type==="audio"?"🎵":"🖼️"})}),e.jsxs("div",{className:"asset-info",children:[e.jsx("span",{className:"asset-name",children:s.name}),e.jsxs("span",{className:"asset-meta",children:[(s.size/1024/1024).toFixed(1),"MB"]})]})]},s.id))})]}):void 0,i=e.jsx("div",{className:"video-editor__preview-area",children:e.jsxs("div",{className:"preview-container",children:[e.jsxs("div",{className:"preview-canvas",style:{aspectRatio:`${u.resolution.width}/${u.resolution.height}`},children:[e.jsx("video",{ref:ee,className:"preview-video"}),e.jsx("div",{className:"preview-overlay",children:!V&&e.jsx("button",{className:"toggle-library-button",onClick:()=>A(!0),children:"📁"})})]}),e.jsxs("div",{className:"playback-controls",children:[e.jsx("button",{onClick:()=>q(0),children:"⏮️"}),e.jsx("button",{onClick:()=>q(M-1/u.frameRate),children:"⏪"}),e.jsx("button",{onClick:re,className:"play-button",children:P?"⏸️":"▶️"}),e.jsx("button",{onClick:()=>q(M+1/u.frameRate),children:"⏩"}),e.jsx("span",{className:"time-display",children:X(M)})]})]})}),m=e.jsxs("div",{className:"video-editor__panel",children:[T==="timeline"&&e.jsxs("div",{className:"timeline-panel",children:[e.jsxs("div",{className:"timeline-toolbar",children:[e.jsxs("div",{className:"track-buttons",children:[e.jsx("button",{onClick:()=>L("video"),children:"+ Video Track"}),e.jsx("button",{onClick:()=>L("audio"),children:"+ Audio Track"}),e.jsx("button",{onClick:()=>L("text"),children:"+ Text Track"})]}),e.jsxs("div",{className:"zoom-controls",children:[e.jsx("button",{onClick:()=>W(Math.max(.25,I-.25)),children:"-"}),e.jsxs("span",{children:[Math.round(I*100),"%"]}),e.jsx("button",{onClick:()=>W(Math.min(4,I+.25)),children:"+"})]})]}),e.jsxs("div",{className:"timeline-container",ref:Q,children:[e.jsx("div",{className:"timeline-ruler",children:Array.from({length:Math.ceil(30/I)}).map((s,n)=>e.jsx("div",{className:"ruler-mark",style:{left:`${n*50*I}px`},children:X(n)},n))}),e.jsx("div",{className:"timeline-playhead",style:{left:`${M*50*I}px`}}),e.jsx("div",{className:"timeline-tracks",children:u.tracks.map(s=>e.jsxs("div",{className:`timeline-track ${_===s.id?"timeline-track--selected":""} ${s.locked?"timeline-track--locked":""}`,onClick:()=>y(s.id),onDrop:n=>{n.preventDefault();const r=n.dataTransfer.getData("assetId"),p=u.assets.find(h=>h.id===r);p&&$(s.id,p)},onDragOver:n=>n.preventDefault(),children:[e.jsxs("div",{className:"track-header",children:[e.jsx("span",{className:"track-name",children:s.name}),e.jsxs("div",{className:"track-controls",children:[e.jsx("button",{className:s.muted?"active":"",onClick:n=>{n.stopPropagation(),O(s.id)},children:s.muted?"🔇":"🔊"}),e.jsx("button",{className:s.locked?"active":"",onClick:n=>{n.stopPropagation(),Y(s.id)},children:s.locked?"🔒":"🔓"}),e.jsx("button",{onClick:n=>{n.stopPropagation(),K(s.id)},children:"🗑️"})]})]}),e.jsx("div",{className:"track-items",children:s.items.map(n=>{const r=u.assets.find(p=>p.id===n.assetId);return e.jsxs("div",{className:`track-item track-item--${n.type} ${w===n.id?"track-item--selected":""}`,style:{left:`${n.startTime*50*I}px`,width:`${n.duration*50*I}px`},onClick:p=>{p.stopPropagation(),k(n.id)},children:[e.jsx("span",{className:"item-name",children:(r==null?void 0:r.name)||"Untitled"}),n.transitions.length>0&&e.jsx("span",{className:"item-transitions",children:"✨"}),n.effects.length>0&&e.jsx("span",{className:"item-effects",children:"🎨"})]},n.id)})})]},s.id))})]})]}),T==="effects"&&e.jsxs("div",{className:"effects-panel",children:[e.jsx("h3",{children:"Video Effects"}),e.jsx("p",{className:"panel-hint",children:"Select a clip to apply effects"}),e.jsx("div",{className:"effects-grid",children:ze.map(s=>e.jsxs("button",{className:"effect-preset",disabled:!w,onClick:()=>{const n=B();n&&G(n.track.id,n.item.id,s.type)},children:[e.jsx("span",{className:"effect-icon",children:s.icon}),e.jsx("span",{className:"effect-name",children:s.name})]},s.type))})]}),T==="transitions"&&e.jsxs("div",{className:"transitions-panel",children:[e.jsx("h3",{children:"Transitions"}),e.jsx("p",{className:"panel-hint",children:"Select a clip and add transitions between clips"}),e.jsx("div",{className:"transitions-grid",children:Fe.map(s=>e.jsxs("div",{className:"transition-preset",children:[e.jsx("span",{className:"transition-name",children:s.name}),e.jsxs("div",{className:"transition-buttons",children:[e.jsx("button",{disabled:!w,onClick:()=>{const n=B();n&&F(n.track.id,n.item.id,s.type,"start")},children:"In"}),e.jsx("button",{disabled:!w,onClick:()=>{const n=B();n&&F(n.track.id,n.item.id,s.type,"end")},children:"Out"})]})]},s.type))})]}),T==="export"&&e.jsxs("div",{className:"export-panel",children:[e.jsx("h3",{children:"Export Settings"}),e.jsxs("div",{className:"export-settings",children:[e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Resolution"}),e.jsxs("select",{value:`${u.resolution.width}x${u.resolution.height}`,onChange:s=>{const[n,r]=s.target.value.split("x").map(Number);j({resolution:{width:n,height:r}})},children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"}),e.jsx("option",{value:"3840x2160",children:"4K (3840x2160)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Frame Rate"}),e.jsxs("select",{value:u.frameRate,onChange:s=>j({frameRate:parseInt(s.target.value)}),children:[e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"}),e.jsx("option",{value:"120",children:"120 fps"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Video Codec"}),e.jsxs("select",{value:u.settings.video.codec,onChange:s=>j({settings:{...u.settings,video:{...u.settings.video,codec:s.target.value}}}),children:[e.jsx("option",{value:"h264",children:"H.264 (Best Compatibility)"}),e.jsx("option",{value:"h265",children:"H.265/HEVC (Smaller Size)"}),e.jsx("option",{value:"vp9",children:"VP9 (Web Optimized)"}),e.jsx("option",{value:"av1",children:"AV1 (Future Standard)"})]})]}),e.jsxs("div",{className:"setting-group",children:[e.jsx("label",{children:"Video Bitrate (Mbps)"}),e.jsx("input",{type:"number",value:u.settings.video.bitrate/1e3,onChange:s=>j({settings:{...u.settings,video:{...u.settings.video,bitrate:parseFloat(s.target.value)*1e3}}}),min:"1",max:"100"})]})]}),e.jsx("button",{className:"export-button",onClick:Z,disabled:E!==null,children:E!==null?`Exporting... ${Math.round(E)}%`:"Export Video"}),E!==null&&e.jsx("div",{className:"export-progress",children:e.jsx("div",{className:"export-progress-bar",style:{width:`${E}%`}})})]})]});return e.jsxs(de,{flush:!0,className:`nice-video-editor ${S}`,height:"100%",style:{position:"relative",minHeight:600},toolbar:se,sidebar:a,rightSidebar:te??void 0,bottomPanel:m,children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx($e,{steps:_e(H,Pe)})}),i]})},Le={video:{source:"screen",showCursor:!0,frameRate:30,resolution:{width:1920,height:1080}},audio:{enabled:!0,source:"both",echoCancellation:!0,noiseSuppression:!0},output:{format:"webm",quality:"high"}},Ve=({options:d,onRecordingStart:f,onRecordingStop:l,onRecordingPause:N,onRecordingResume:S,onError:H,className:u=""})=>{var s,n;const[t,T]=c.useState({...Le,...d}),[b,_]=c.useState(null),[y,w]=c.useState("idle"),[k,M]=c.useState([]),[R,P]=c.useState(null),[z,I]=c.useState(null),[W,V]=c.useState(!1),[A,E]=c.useState(!1),[U,Q]=c.useState("pen"),[ee,D]=c.useState("var(--nice-danger, #ff0000)"),j=c.useRef(null),g=c.useRef([]),L=c.useRef(null),K=c.useRef(null),O=c.useRef(null),Y=c.useRef(0);c.useEffect(()=>()=>{R&&R.getTracks().forEach(r=>r.stop()),O.current&&clearInterval(O.current)},[R]);const $=r=>{T(p=>({...p,...r,video:{...p.video,...r.video},audio:{...p.audio,...r.audio},output:{...p.output,...r.output}}))},G=async()=>{try{w("preparing");const r={video:{cursor:t.video.showCursor?"always":"never",frameRate:t.video.frameRate},audio:t.audio.source==="system"||t.audio.source==="both"},p=await navigator.mediaDevices.getDisplayMedia(r);if(t.audio.enabled&&(t.audio.source==="microphone"||t.audio.source==="both"))try{(await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:t.audio.echoCancellation,noiseSuppression:t.audio.noiseSuppression}})).getAudioTracks().forEach(v=>p.addTrack(v))}catch(h){console.warn("Could not access microphone:",h)}P(p),L.current&&(L.current.srcObject=p,L.current.play()),w("idle")}catch(r){w("error"),H==null||H(r instanceof Error?r:new Error("Failed to start preview"))}},F=async()=>{R||await G();for(let r=3;r>0;r--)I(r),await new Promise(p=>setTimeout(p,1e3));I(null);try{const r=R||await ae();if(!r)throw new Error("No stream available");const p=se(t.output.format),h=new MediaRecorder(r,{mimeType:p,videoBitsPerSecond:te(t.output.quality)});g.current=[],h.ondataavailable=x=>{x.data.size>0&&g.current.push(x.data)},h.onstop=()=>{const x=new Blob(g.current,{type:p});b&&(l==null||l({...b,status:"stopped"},x))},j.current=h,h.start(1e3),Y.current=Date.now();const v={id:crypto.randomUUID(),status:"recording",startTime:new Date,duration:0,size:0,options:t,chunks:[]};_(v),w("recording"),f==null||f(v),O.current=setInterval(()=>{_(x=>x?{...x,duration:(Date.now()-Y.current)/1e3,size:g.current.reduce((be,ve)=>be+ve.size,0)}:null)},100)}catch(r){w("error"),H==null||H(r instanceof Error?r:new Error("Failed to start recording"))}},ae=async()=>(await G(),R),re=()=>{j.current&&y==="recording"&&(j.current.pause(),w("paused"),N==null||N())},q=()=>{j.current&&y==="paused"&&(j.current.resume(),w("recording"),S==null||S())},Z=()=>{O.current&&clearInterval(O.current),j.current&&(y==="recording"||y==="paused")&&(j.current.stop(),w("stopped")),R&&(R.getTracks().forEach(r=>r.stop()),P(null))},X=c.useCallback(r=>{if(y!=="recording")return;const p={id:crypto.randomUUID(),time:(b==null?void 0:b.duration)||0,label:r||`Marker ${k.length+1}`,color:a()};M(h=>[...h,p])},[y,b==null?void 0:b.duration,k.length]),B=r=>{M(p=>p.filter(h=>h.id!==r))},se=r=>{switch(r){case"mp4":return"video/mp4";case"mkv":return"video/x-matroska";default:return"video/webm;codecs=vp9"}},te=r=>{switch(r){case"low":return 25e5;case"medium":return 5e6;case"lossless":return 2e7;default:return 8e6}},a=()=>{const r=["var(--nice-danger, #ff4444)","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff"];return r[Math.floor(Math.random()*r.length)]},i=r=>{const p=Math.floor(r/3600),h=Math.floor(r%3600/60),v=Math.floor(r%60),x=Math.floor(r%1*100);return p>0?`${p}:${h.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}`:`${h.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}.${x.toString().padStart(2,"0")}`},m=r=>r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/1024/1024).toFixed(1)} MB`;return e.jsxs("div",{className:`nice-screen-recorder ${u}`,children:[e.jsxs("div",{className:"recorder__preview",children:[z!==null&&e.jsx("div",{className:"countdown-overlay",children:e.jsx("span",{className:"countdown-number",children:z})}),e.jsx("video",{ref:L,className:"preview-video",muted:!0,playsInline:!0}),A&&e.jsx("canvas",{ref:K,className:"annotation-canvas"}),!R&&y==="idle"&&e.jsx("div",{className:"preview-placeholder",children:e.jsxs("button",{className:"start-preview-button",onClick:G,children:[e.jsx("span",{className:"icon",children:"🖥️"}),e.jsx("span",{children:"Select Screen to Record"})]})}),y==="recording"&&e.jsxs("div",{className:"recording-indicator",children:[e.jsx("span",{className:"recording-dot"}),e.jsx("span",{children:"REC"})]})]}),e.jsxs("div",{className:"recorder__controls",children:[e.jsxs("div",{className:"controls__main",children:[y==="idle"&&e.jsxs("button",{className:"control-button control-button--record",onClick:F,disabled:!!z,children:[e.jsx("span",{className:"icon",children:"⏺️"}),e.jsx("span",{children:"Start Recording"})]}),y==="recording"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"control-button control-button--pause",onClick:re,children:[e.jsx("span",{className:"icon",children:"⏸️"}),e.jsx("span",{children:"Pause"})]}),e.jsxs("button",{className:"control-button control-button--stop",onClick:Z,children:[e.jsx("span",{className:"icon",children:"⏹️"}),e.jsx("span",{children:"Stop"})]})]}),y==="paused"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"control-button control-button--resume",onClick:q,children:[e.jsx("span",{className:"icon",children:"▶️"}),e.jsx("span",{children:"Resume"})]}),e.jsxs("button",{className:"control-button control-button--stop",onClick:Z,children:[e.jsx("span",{className:"icon",children:"⏹️"}),e.jsx("span",{children:"Stop"})]})]}),y==="stopped"&&e.jsxs("button",{className:"control-button control-button--new",onClick:()=>{w("idle"),_(null),M([])},children:[e.jsx("span",{className:"icon",children:"🔄"}),e.jsx("span",{children:"New Recording"})]})]}),e.jsxs("div",{className:"controls__secondary",children:[(y==="recording"||y==="paused")&&e.jsxs("button",{className:"control-button control-button--marker",onClick:()=>X(),children:[e.jsx("span",{className:"icon",children:"🚩"}),e.jsx("span",{children:"Add Marker"})]}),e.jsxs("button",{className:`control-button ${A?"control-button--active":""}`,onClick:()=>E(!A),disabled:y!=="recording",children:[e.jsx("span",{className:"icon",children:"✏️"}),e.jsx("span",{children:"Annotate"})]}),e.jsx("button",{className:"control-button control-button--settings",onClick:()=>V(!W),disabled:y==="recording",children:e.jsx("span",{className:"icon",children:"⚙️"})})]})]}),e.jsxs("div",{className:"recorder__status",children:[e.jsxs("div",{className:"status__info",children:[e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Duration:"})," ",i((b==null?void 0:b.duration)||0)]}),e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Size:"})," ",m((b==null?void 0:b.size)||0)]}),e.jsxs("span",{className:"status-item",children:[e.jsx("strong",{children:"Markers:"})," ",k.length]})]}),e.jsxs("div",{className:"status__quality",children:[t.video.resolution&&e.jsxs("span",{children:[t.video.resolution.width,"x",t.video.resolution.height]}),e.jsxs("span",{children:[t.video.frameRate,"fps"]}),e.jsx("span",{className:t.audio.enabled?"audio-on":"audio-off",children:t.audio.enabled?"🔊":"🔇"})]})]}),A&&y==="recording"&&e.jsxs("div",{className:"recorder__annotation-tools",children:[e.jsx("div",{className:"tool-group",children:["pen","arrow","rectangle","text"].map(r=>e.jsxs("button",{className:`tool-button ${U===r?"tool-button--active":""}`,onClick:()=>Q(r),children:[r==="pen"&&"✏️",r==="arrow"&&"➡️",r==="rectangle"&&"⬜",r==="text"&&"T"]},r))}),e.jsx("div",{className:"color-group",children:["var(--nice-danger, #ff0000)","var(--nice-success, #00ff00)","var(--nice-primary, #0000ff)","var(--nice-warning, #ffff00)","var(--nice-bg, #fff)","var(--nice-text, #000000)"].map(r=>e.jsx("button",{className:`color-button ${ee===r?"color-button--active":""}`,style:{backgroundColor:r},onClick:()=>D(r)},r))})]}),k.length>0&&e.jsxs("div",{className:"recorder__markers",children:[e.jsx("h4",{children:"Markers"}),e.jsx("div",{className:"markers-list",children:k.map(r=>e.jsxs("div",{className:"marker-item",style:{borderLeftColor:r.color},children:[e.jsx("span",{className:"marker-time",children:i(r.time)}),e.jsx("input",{type:"text",value:r.label,onChange:p=>{M(h=>h.map(v=>v.id===r.id?{...v,label:p.target.value}:v))},className:"marker-label"}),e.jsx("button",{className:"marker-remove",onClick:()=>B(r.id),children:"×"})]},r.id))})]}),W&&e.jsxs("div",{className:"recorder__settings",children:[e.jsxs("div",{className:"settings-header",children:[e.jsx("h3",{children:"Recording Settings"}),e.jsx("button",{className:"close-button",onClick:()=>V(!1),children:"×"})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Video"}),e.jsxs("label",{children:["Source",e.jsxs("select",{value:t.video.source,onChange:r=>$({video:{...t.video,source:r.target.value}}),children:[e.jsx("option",{value:"screen",children:"Entire Screen"}),e.jsx("option",{value:"window",children:"Application Window"}),e.jsx("option",{value:"tab",children:"Browser Tab"}),e.jsx("option",{value:"camera",children:"Camera"})]})]}),e.jsxs("label",{children:["Resolution",e.jsxs("select",{value:`${(s=t.video.resolution)==null?void 0:s.width}x${(n=t.video.resolution)==null?void 0:n.height}`,onChange:r=>{const[p,h]=r.target.value.split("x").map(Number);$({video:{...t.video,resolution:{width:p,height:h}}})},children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"}),e.jsx("option",{value:"3840x2160",children:"4K (3840x2160)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"})]})]}),e.jsxs("label",{children:["Frame Rate",e.jsxs("select",{value:t.video.frameRate,onChange:r=>$({video:{...t.video,frameRate:parseInt(r.target.value)}}),children:[e.jsx("option",{value:"15",children:"15 fps"}),e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"})]})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:t.video.showCursor,onChange:r=>$({video:{...t.video,showCursor:r.target.checked}})}),"Show Cursor"]})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Audio"}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:t.audio.enabled,onChange:r=>$({audio:{...t.audio,enabled:r.target.checked}})}),"Enable Audio"]}),t.audio.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Source",e.jsxs("select",{value:t.audio.source,onChange:r=>$({audio:{...t.audio,source:r.target.value}}),children:[e.jsx("option",{value:"system",children:"System Audio"}),e.jsx("option",{value:"microphone",children:"Microphone"}),e.jsx("option",{value:"both",children:"Both"})]})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:t.audio.echoCancellation,onChange:r=>$({audio:{...t.audio,echoCancellation:r.target.checked}})}),"Echo Cancellation"]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:t.audio.noiseSuppression,onChange:r=>$({audio:{...t.audio,noiseSuppression:r.target.checked}})}),"Noise Suppression"]})]})]}),e.jsxs("div",{className:"settings-section",children:[e.jsx("h4",{children:"Output"}),e.jsxs("label",{children:["Format",e.jsxs("select",{value:t.output.format,onChange:r=>$({output:{...t.output,format:r.target.value}}),children:[e.jsx("option",{value:"webm",children:"WebM (Best Web)"}),e.jsx("option",{value:"mp4",children:"MP4 (Most Compatible)"}),e.jsx("option",{value:"mkv",children:"MKV (Lossless)"})]})]}),e.jsxs("label",{children:["Quality",e.jsxs("select",{value:t.output.quality,onChange:r=>$({output:{...t.output,quality:r.target.value}}),children:[e.jsx("option",{value:"low",children:"Low (Smaller file)"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High (Recommended)"}),e.jsx("option",{value:"lossless",children:"Lossless (Largest file)"})]})]})]})]})]})},Oe={id:crypto.randomUUID(),name:"My Stream",protocol:"rtmp",destinations:[],sources:[],layout:{name:"Default",canvas:{width:1920,height:1080,backgroundColor:"var(--nice-text, #000000)"},layers:[]},settings:{video:{resolution:{width:1920,height:1080},frameRate:30,codec:"h264",bitrate:6e3,keyframe:2,profile:"high"},audio:{sampleRate:48e3,bitrate:160,channels:2,codec:"aac"}}},ne=[{platform:"youtube",name:"YouTube",icon:"📺",defaultUrl:"rtmp://a.rtmp.youtube.com/live2"},{platform:"twitch",name:"Twitch",icon:"🎮",defaultUrl:"rtmp://live.twitch.tv/app"},{platform:"facebook",name:"Facebook",icon:"📘",defaultUrl:"rtmps://live-api-s.facebook.com:443/rtmp"},{platform:"custom-rtmp",name:"Custom RTMP",icon:"🔗",defaultUrl:""},{platform:"custom-srt",name:"Custom SRT",icon:"🔒",defaultUrl:""}],ie=[{type:"camera",name:"Camera",icon:"📷"},{type:"screen",name:"Screen Capture",icon:"🖥️"},{type:"window",name:"Window Capture",icon:"🪟"},{type:"browser",name:"Browser Source",icon:"🌐"},{type:"image",name:"Image",icon:"🖼️"},{type:"video",name:"Video",icon:"🎬"},{type:"microphone",name:"Microphone",icon:"🎤"},{type:"system-audio",name:"System Audio",icon:"🔊"}],Be=({config:d,onConfigChange:f,onStreamStart:l,onStreamStop:N,onStatsUpdate:S,onError:H,className:u=""})=>{const[t,T]=c.useState(d||Oe),[b,_]=c.useState("sources"),[y,w]=c.useState(!1),[k,M]=c.useState({duration:0,viewers:0,peakViewers:0,bitrate:0,fps:0,droppedFrames:0,cpuUsage:0,memoryUsage:0}),[R,P]=c.useState(null),[z,I]=c.useState(!1),[W,V]=c.useState(!1),[A,E]=c.useState([t.layout]),[U,Q]=c.useState(0),ee=c.useRef(null),D=c.useRef(null),j=c.useRef(0);c.useEffect(()=>{d&&T(d)},[d]),c.useEffect(()=>()=>{D.current&&clearInterval(D.current)},[]);const g=c.useCallback(a=>{const i={...t,...a};T(i),f==null||f(i)},[t,f]),L=a=>{const i=ne.find(s=>s.platform===a),m={id:crypto.randomUUID(),name:(i==null?void 0:i.name)||"Custom",platform:a,url:(i==null?void 0:i.defaultUrl)||"",streamKey:"",enabled:!0,status:"idle"};g({destinations:[...t.destinations,m]}),V(!1)},K=(a,i)=>{g({destinations:t.destinations.map(m=>m.id===a?{...m,...i}:m)})},O=a=>{g({destinations:t.destinations.filter(i=>i.id!==a)})},Y=async a=>{const i=ie.find(n=>n.type===a),m={id:crypto.randomUUID(),type:a,name:`${(i==null?void 0:i.name)||a} ${t.sources.filter(n=>n.type===a).length+1}`,settings:{},volume:1,muted:!1};try{if(a==="camera"||a==="microphone"){const n=a==="camera"?{video:!0}:{audio:!0},p=(await navigator.mediaDevices.enumerateDevices()).filter(h=>a==="camera"?h.kind==="videoinput":h.kind==="audioinput");p.length>0&&(m.settings.deviceId=p[0].deviceId)}else(a==="screen"||a==="window")&&await navigator.mediaDevices.getDisplayMedia({video:!0})}catch(n){console.warn(`Could not access ${a}:`,n)}g({sources:[...t.sources,m]});const s={id:crypto.randomUUID(),sourceId:m.id,position:{x:0,y:0},size:{width:t.layout.canvas.width,height:t.layout.canvas.height},visible:!0,opacity:1,zIndex:t.layout.layers.length};g({layout:{...t.layout,layers:[...t.layout.layers,s]}}),I(!1)},$=(a,i)=>{g({sources:t.sources.map(m=>m.id===a?{...m,...i}:m)})},G=a=>{g({sources:t.sources.filter(i=>i.id!==a),layout:{...t.layout,layers:t.layout.layers.filter(i=>i.sourceId!==a)}})},F=(a,i)=>{g({layout:{...t.layout,layers:t.layout.layers.map(m=>m.id===a?{...m,...i}:m)}})},ae=a=>{const i=t.layout.layers.findIndex(m=>m.id===a);if(i<t.layout.layers.length-1){const m=[...t.layout.layers];[m[i],m[i+1]]=[m[i+1],m[i]],m.forEach((s,n)=>{s.zIndex=n}),g({layout:{...t.layout,layers:m}})}},re=a=>{const i=t.layout.layers.findIndex(m=>m.id===a);if(i>0){const m=[...t.layout.layers];[m[i],m[i-1]]=[m[i-1],m[i]],m.forEach((s,n)=>{s.zIndex=n}),g({layout:{...t.layout,layers:m}})}},q=()=>{const a={name:`Scene ${A.length+1}`,canvas:{...t.layout.canvas},layers:[]};E([...A,a])},Z=a=>{const i=[...A];i[U]=t.layout,E(i),Q(a),g({layout:A[a]})},X=async()=>{try{g({destinations:t.destinations.map(a=>a.enabled?{...a,status:"connecting"}:a)}),await new Promise(a=>setTimeout(a,2e3)),g({destinations:t.destinations.map(a=>a.enabled?{...a,status:"live"}:a)}),w(!0),j.current=Date.now(),l==null||l(),D.current=setInterval(()=>{const a={duration:(Date.now()-j.current)/1e3,viewers:Math.floor(Math.random()*100)+k.viewers,peakViewers:Math.max(k.peakViewers,k.viewers),bitrate:t.settings.video.bitrate+Math.floor(Math.random()*500-250),fps:t.settings.video.frameRate-Math.random()*2,droppedFrames:k.droppedFrames+(Math.random()>.95?1:0),cpuUsage:15+Math.random()*30,memoryUsage:40+Math.random()*20};M(a),S==null||S(a)},1e3)}catch(a){H==null||H(a instanceof Error?a:new Error("Failed to start stream")),g({destinations:t.destinations.map(i=>({...i,status:"error"}))})}},B=()=>{D.current&&clearInterval(D.current),g({destinations:t.destinations.map(a=>({...a,status:"idle"}))}),w(!1),N==null||N()},se=a=>{const i=Math.floor(a/3600),m=Math.floor(a%3600/60),s=Math.floor(a%60);return`${i.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`},te=a=>{switch(a){case"live":return"var(--nice-success, #00ff00)";case"connecting":return"var(--nice-warning, #ffff00)";case"error":return"var(--nice-danger, #ff0000)";default:return"var(--nice-text-secondary, #888888)"}};return e.jsxs("div",{className:`nice-live-streaming ${u}`,children:[e.jsxs("header",{className:"streaming__header",children:[e.jsxs("div",{className:"header__title",children:[e.jsx("input",{type:"text",value:t.name,onChange:a=>g({name:a.target.value}),className:"stream-name-input"}),y&&e.jsxs("span",{className:"live-badge",children:[e.jsx("span",{className:"live-dot"})," LIVE"]})]}),e.jsx("div",{className:"header__stats",children:y&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"stat-item",children:["⏱️ ",se(k.duration)]}),e.jsxs("span",{className:"stat-item",children:["👥 ",k.viewers]}),e.jsxs("span",{className:"stat-item",children:["📊 ",Math.round(k.bitrate)," kbps"]}),e.jsxs("span",{className:"stat-item",children:["🎬 ",k.fps.toFixed(1)," fps"]})]})}),e.jsx("div",{className:"header__actions",children:y?e.jsx("button",{className:"action-button action-button--stop",onClick:B,children:"End Stream"}):e.jsx("button",{className:"action-button action-button--go-live",onClick:X,disabled:t.destinations.filter(a=>a.enabled).length===0,children:"Go Live"})})]}),e.jsxs("div",{className:"streaming__main",children:[e.jsxs("div",{className:"streaming__preview",children:[e.jsxs("div",{className:"scenes-bar",children:[A.map((a,i)=>e.jsx("button",{className:`scene-button ${U===i?"scene-button--active":""}`,onClick:()=>Z(i),children:a.name},i)),e.jsx("button",{className:"scene-button scene-button--add",onClick:q,children:"+"})]}),e.jsx("div",{ref:ee,className:"preview-canvas",style:{aspectRatio:`${t.layout.canvas.width}/${t.layout.canvas.height}`,backgroundColor:t.layout.canvas.backgroundColor},children:t.layout.layers.sort((a,i)=>a.zIndex-i.zIndex).map(a=>{var m;const i=t.sources.find(s=>s.id===a.sourceId);return!a.visible||!i?null:e.jsx("div",{className:`canvas-layer ${R===a.id?"canvas-layer--selected":""}`,style:{left:`${a.position.x/t.layout.canvas.width*100}%`,top:`${a.position.y/t.layout.canvas.height*100}%`,width:`${a.size.width/t.layout.canvas.width*100}%`,height:`${a.size.height/t.layout.canvas.height*100}%`,opacity:a.opacity,zIndex:a.zIndex},onClick:()=>P(a.id),children:e.jsxs("div",{className:"layer-content",children:[e.jsx("span",{className:"layer-icon",children:((m=ie.find(s=>s.type===i.type))==null?void 0:m.icon)||"📦"}),e.jsx("span",{className:"layer-name",children:i.name})]})},a.id)})})]}),e.jsxs("aside",{className:"streaming__panel",children:[e.jsx("div",{className:"panel-tabs",children:["sources","audio","destinations","settings"].map(a=>e.jsx("button",{className:`panel-tab ${b===a?"panel-tab--active":""}`,onClick:()=>_(a),children:a.charAt(0).toUpperCase()+a.slice(1)},a))}),e.jsxs("div",{className:"panel-content",children:[b==="sources"&&e.jsxs("div",{className:"sources-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Sources"}),e.jsx("button",{className:"add-button",onClick:()=>I(!0),disabled:y,children:"+ Add"})]}),e.jsx("div",{className:"sources-list",children:t.sources.filter(a=>a.type!=="microphone"&&a.type!=="system-audio").map(a=>{var m;const i=t.layout.layers.find(s=>s.sourceId===a.id);return e.jsxs("div",{className:`source-item ${R===(i==null?void 0:i.id)?"source-item--selected":""}`,onClick:()=>i&&P(i.id),children:[e.jsx("span",{className:"source-icon",children:(m=ie.find(s=>s.type===a.type))==null?void 0:m.icon}),e.jsx("span",{className:"source-name",children:a.name}),e.jsxs("div",{className:"source-controls",children:[e.jsx("button",{className:i!=null&&i.visible?"":"inactive",onClick:s=>{s.stopPropagation(),i&&F(i.id,{visible:!i.visible})},children:i!=null&&i.visible?"👁️":"👁️‍🗨️"}),e.jsx("button",{onClick:s=>{s.stopPropagation(),i&&ae(i.id)},children:"⬆️"}),e.jsx("button",{onClick:s=>{s.stopPropagation(),i&&re(i.id)},children:"⬇️"}),e.jsx("button",{onClick:s=>{s.stopPropagation(),G(a.id)},disabled:y,children:"🗑️"})]})]},a.id)})}),R&&e.jsxs("div",{className:"layer-properties",children:[e.jsx("h4",{children:"Properties"}),(()=>{const a=t.layout.layers.find(i=>i.id===R);return a?e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["X Position",e.jsx("input",{type:"number",value:a.position.x,onChange:i=>F(a.id,{position:{...a.position,x:parseInt(i.target.value)||0}})})]}),e.jsxs("label",{children:["Y Position",e.jsx("input",{type:"number",value:a.position.y,onChange:i=>F(a.id,{position:{...a.position,y:parseInt(i.target.value)||0}})})]}),e.jsxs("label",{children:["Width",e.jsx("input",{type:"number",value:a.size.width,onChange:i=>F(a.id,{size:{...a.size,width:parseInt(i.target.value)||100}})})]}),e.jsxs("label",{children:["Height",e.jsx("input",{type:"number",value:a.size.height,onChange:i=>F(a.id,{size:{...a.size,height:parseInt(i.target.value)||100}})})]}),e.jsxs("label",{children:["Opacity",e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:a.opacity,onChange:i=>F(a.id,{opacity:parseFloat(i.target.value)})})]})]}):null})()]})]}),b==="audio"&&e.jsxs("div",{className:"audio-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Audio Mixer"}),e.jsx("button",{className:"add-button",onClick:()=>{I(!0)},disabled:y,children:"+ Add"})]}),e.jsxs("div",{className:"audio-sources",children:[t.sources.filter(a=>a.type==="microphone"||a.type==="system-audio"||a.type==="video").map(a=>{var i;return e.jsxs("div",{className:"audio-source",children:[e.jsxs("div",{className:"audio-header",children:[e.jsx("span",{className:"audio-icon",children:(i=ie.find(m=>m.type===a.type))==null?void 0:i.icon}),e.jsx("span",{className:"audio-name",children:a.name}),e.jsx("button",{className:a.muted?"muted":"",onClick:()=>$(a.id,{muted:!a.muted}),children:a.muted?"🔇":"🔊"})]}),e.jsxs("div",{className:"audio-slider",children:[e.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:a.volume??1,onChange:m=>$(a.id,{volume:parseFloat(m.target.value)}),disabled:a.muted}),e.jsxs("span",{className:"volume-value",children:[Math.round((a.volume??1)*100),"%"]})]}),e.jsx("div",{className:"audio-meter",children:e.jsx("div",{className:"meter-fill",style:{width:`${(a.volume??1)*70+Math.random()*30}%`}})})]},a.id)}),t.sources.filter(a=>a.type==="microphone"||a.type==="system-audio").length===0&&e.jsx("p",{className:"empty-message",children:"No audio sources added"})]})]}),b==="destinations"&&e.jsxs("div",{className:"destinations-panel",children:[e.jsxs("div",{className:"panel-header",children:[e.jsx("h3",{children:"Destinations"}),e.jsx("button",{className:"add-button",onClick:()=>V(!0),disabled:y,children:"+ Add"})]}),e.jsxs("div",{className:"destinations-list",children:[t.destinations.map(a=>{var i;return e.jsxs("div",{className:"destination-item",children:[e.jsxs("div",{className:"destination-header",children:[e.jsx("span",{className:"status-indicator",style:{backgroundColor:te(a.status)}}),e.jsx("span",{className:"destination-icon",children:(i=ne.find(m=>m.platform===a.platform))==null?void 0:i.icon}),e.jsx("span",{className:"destination-name",children:a.name}),e.jsxs("label",{className:"toggle",children:[e.jsx("input",{type:"checkbox",checked:a.enabled,onChange:m=>K(a.id,{enabled:m.target.checked}),disabled:y}),e.jsx("span",{className:"toggle-slider"})]})]}),e.jsxs("div",{className:"destination-config",children:[e.jsxs("label",{children:["Server URL",e.jsx("input",{type:"text",value:a.url,onChange:m=>K(a.id,{url:m.target.value}),placeholder:"rtmp://...",disabled:y})]}),e.jsxs("label",{children:["Stream Key",e.jsx("input",{type:"password",value:a.streamKey||"",onChange:m=>K(a.id,{streamKey:m.target.value}),placeholder:"Enter stream key",disabled:y})]})]}),e.jsx("button",{className:"remove-button",onClick:()=>O(a.id),disabled:y,children:"Remove"})]},a.id)}),t.destinations.length===0&&e.jsx("p",{className:"empty-message",children:"No destinations configured"})]})]}),b==="settings"&&e.jsxs("div",{className:"settings-panel",children:[e.jsxs("div",{className:"setting-section",children:[e.jsx("h4",{children:"Video"}),e.jsxs("label",{children:["Resolution",e.jsxs("select",{value:`${t.settings.video.resolution.width}x${t.settings.video.resolution.height}`,onChange:a=>{const[i,m]=a.target.value.split("x").map(Number);g({settings:{...t.settings,video:{...t.settings.video,resolution:{width:i,height:m}}},layout:{...t.layout,canvas:{...t.layout.canvas,width:i,height:m}}})},disabled:y,children:[e.jsx("option",{value:"1920x1080",children:"1080p (1920x1080)"}),e.jsx("option",{value:"1280x720",children:"720p (1280x720)"}),e.jsx("option",{value:"2560x1440",children:"1440p (2560x1440)"})]})]}),e.jsxs("label",{children:["Frame Rate",e.jsxs("select",{value:t.settings.video.frameRate,onChange:a=>g({settings:{...t.settings,video:{...t.settings.video,frameRate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"24",children:"24 fps"}),e.jsx("option",{value:"30",children:"30 fps"}),e.jsx("option",{value:"60",children:"60 fps"})]})]}),e.jsxs("label",{children:["Bitrate (kbps)",e.jsx("input",{type:"number",value:t.settings.video.bitrate,onChange:a=>g({settings:{...t.settings,video:{...t.settings.video,bitrate:parseInt(a.target.value)||6e3}}}),min:"1000",max:"50000",disabled:y})]}),e.jsxs("label",{children:["Keyframe Interval (sec)",e.jsx("input",{type:"number",value:t.settings.video.keyframe,onChange:a=>g({settings:{...t.settings,video:{...t.settings.video,keyframe:parseInt(a.target.value)||2}}}),min:"1",max:"10",disabled:y})]})]}),e.jsxs("div",{className:"setting-section",children:[e.jsx("h4",{children:"Audio"}),e.jsxs("label",{children:["Sample Rate",e.jsxs("select",{value:t.settings.audio.sampleRate,onChange:a=>g({settings:{...t.settings,audio:{...t.settings.audio,sampleRate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"44100",children:"44.1 kHz"}),e.jsx("option",{value:"48000",children:"48 kHz"})]})]}),e.jsxs("label",{children:["Audio Bitrate (kbps)",e.jsxs("select",{value:t.settings.audio.bitrate,onChange:a=>g({settings:{...t.settings,audio:{...t.settings.audio,bitrate:parseInt(a.target.value)}}}),disabled:y,children:[e.jsx("option",{value:"96",children:"96 kbps"}),e.jsx("option",{value:"128",children:"128 kbps"}),e.jsx("option",{value:"160",children:"160 kbps"}),e.jsx("option",{value:"320",children:"320 kbps"})]})]})]})]})]})]})]}),y&&e.jsx("footer",{className:"streaming__footer",children:e.jsxs("div",{className:"footer-stats",children:[e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"CPU"}),e.jsxs("span",{className:"value",children:[k.cpuUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Memory"}),e.jsxs("span",{className:"value",children:[k.memoryUsage.toFixed(1),"%"]})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Dropped"}),e.jsx("span",{className:"value",children:k.droppedFrames})]}),e.jsxs("span",{className:"stat",children:[e.jsx("label",{children:"Peak Viewers"}),e.jsx("span",{className:"value",children:k.peakViewers})]})]})}),z&&e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Add Source"}),e.jsx("button",{className:"close-button",onClick:()=>I(!1),children:"×"})]}),e.jsx("div",{className:"modal-content",children:e.jsx("div",{className:"source-type-grid",children:ie.map(a=>e.jsxs("button",{className:"source-type-button",onClick:()=>Y(a.type),children:[e.jsx("span",{className:"icon",children:a.icon}),e.jsx("span",{className:"name",children:a.name})]},a.type))})})]})}),W&&e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:"Add Destination"}),e.jsx("button",{className:"close-button",onClick:()=>V(!1),children:"×"})]}),e.jsx("div",{className:"modal-content",children:e.jsx("div",{className:"platform-grid",children:ne.map(a=>e.jsxs("button",{className:"platform-button",onClick:()=>L(a.platform),children:[e.jsx("span",{className:"icon",children:a.icon}),e.jsx("span",{className:"name",children:a.name})]},a.platform))})})]})})]})};exports.NiceLiveStreaming=Be;exports.NiceScreenRecorder=Ve;exports.NiceVideoEditor=Ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BlWqQ7I-.cjs");exports.NiceLiveStreaming=e.NiceLiveStreaming;exports.NiceScreenRecorder=e.NiceScreenRecorder;exports.NiceVideoEditor=e.NiceVideoEditor;